Skip to content

Commit

Permalink
PrimeFaces 15.0.0-RC1
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Dec 4, 2024
1 parent 0e06d96 commit ebdcf2b
Show file tree
Hide file tree
Showing 25 changed files with 635 additions and 780 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.melloware</groupId>
<artifactId>quarkus-faces</artifactId>
<version>14.0.8</version>
<version>15.0.0-RC1</version>
<packaging>jar</packaging>
<name>quarkus-faces</name>
<description>Quarkus version of the PrimeFaces Showcase with many optimizations</description>
Expand All @@ -15,7 +15,7 @@
<lombok.version>1.18.36</lombok.version>
<myfaces.version>4.1.0-RC3</myfaces.version>
<omnifaces-quarkus.version>4.6.1</omnifaces-quarkus.version>
<primefaces-quarkus.version>3.14.8</primefaces-quarkus.version>
<primefaces-quarkus.version>3.15.0-RC1</primefaces-quarkus.version>
<quarkus.version>3.17.3</quarkus.version>
</properties>
<dependencyManagement>
Expand Down
15 changes: 5 additions & 10 deletions src/main/java/org/primefaces/showcase/menu/AppMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,8 @@ public void init() {
//MULTIMEDIA CATEGORY START
List<MenuItem> multimediaMenuItems = new ArrayList<>();
multimediaMenuItems.add(new MenuItem("Audio", "/ui/multimedia/audio"));
multimediaMenuItems.add(new MenuItem("Barcode", "/ui/multimedia/barcode"));
multimediaMenuItems.add(new MenuItem("QRCode", "/ui/multimedia/qrcode"));
multimediaMenuItems.add(new MenuItem("Barcode", "/ui/multimedia/barcode", "Updated"));
multimediaMenuItems.add(new MenuItem("QRCode", "/ui/multimedia/qrcode", "Updated"));
multimediaMenuItems.add(new MenuItem("Image Compare", "/ui/multimedia/compare"));

//Cropper Nested MenuItem
Expand Down Expand Up @@ -445,14 +445,8 @@ public void init() {

//Upload Nested MenuItem
List<MenuItem> uploadMenuItems = new ArrayList<>();
uploadMenuItems.add(new MenuItem("Basic", "/ui/file/upload/basic"));
uploadMenuItems.add(new MenuItem("Basic Auto", "/ui/file/upload/basicAuto"));
uploadMenuItems.add(new MenuItem("Single", "/ui/file/upload/single"));
uploadMenuItems.add(new MenuItem("Multiple", "/ui/file/upload/multiple"));
uploadMenuItems.add(new MenuItem("Auto", "/ui/file/upload/auto"));
uploadMenuItems.add(new MenuItem("DragDrop", "/ui/file/upload/dnd"));
uploadMenuItems.add(new MenuItem("Chunked", "/ui/file/upload/chunked"));
uploadMenuItems.add(new MenuItem("Tooltips", "/ui/file/upload/tooltips"));
uploadMenuItems.add(new MenuItem("Simple", "/ui/file/upload/simple"));
uploadMenuItems.add(new MenuItem("Advanced", "/ui/file/upload/advanced"));
fileMenuItems.add(new MenuItem("File Upload", uploadMenuItems));

fileMenuItems.add(new MenuItem("File Download", "/ui/file/download"));
Expand Down Expand Up @@ -513,6 +507,7 @@ public void init() {

miscMenuItems.add(new MenuItem("Effect", "/ui/misc/effect"));
miscMenuItems.add(new MenuItem("ExceptionHandler", "/ui/misc/exceptionHandler"));
miscMenuItems.add(new MenuItem("FeedReader", "/ui/misc/feedReader", "Updated"));
miscMenuItems.add(new MenuItem("IdleMonitor", "/ui/misc/idleMonitor"));
miscMenuItems.add(new MenuItem("ImportConstants", "/ui/misc/importConstants"));
miscMenuItems.add(new MenuItem("ImportEnum", "/ui/misc/importEnum"));
Expand Down
19 changes: 13 additions & 6 deletions src/main/java/org/primefaces/showcase/service/CountryService.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@
*/
package org.primefaces.showcase.service;

import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;


import jakarta.annotation.PostConstruct;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Named;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import org.primefaces.showcase.domain.Country;

Expand Down Expand Up @@ -72,6 +74,7 @@ public void init() {
locales.add(CountryService.toCountry(Locale.FRANCE));
locales.add(CountryService.toCountry(Locale.GERMANY));
locales.add(CountryService.toCountry(new Locale("de", "AT")));
locales.add(CountryService.toCountry(new Locale("de", "CH")));
locales.add(CountryService.toCountry(Locale.ITALY));
locales.add(CountryService.toCountry(Locale.KOREA));
locales.add(CountryService.toCountry(new Locale("es", "ES")));
Expand All @@ -82,6 +85,8 @@ public void init() {
locales.add(CountryService.toCountry(new Locale("ar", "SA"), true));
locales.add(CountryService.toCountry(new Locale("ar", "TN"), true));
locales.add(CountryService.toCountry(new Locale("bg", "BG")));
locales.add(CountryService.toCountry(new Locale("bn", "BD")));
locales.add(CountryService.toCountry(new Locale("bs", "BA")));
locales.add(CountryService.toCountry(new Locale("cs", "CZ")));
locales.add(CountryService.toCountry(new Locale("el", "GR")));
locales.add(CountryService.toCountry(new Locale("fa", "IR"), true));
Expand All @@ -107,11 +112,13 @@ public void init() {
locales.add(CountryService.toCountry(new Locale("ru", "RU")));
locales.add(CountryService.toCountry(new Locale("sk", "SK")));
locales.add(CountryService.toCountry(new Locale("sl", "SI")));
locales.add(CountryService.toCountry(new Locale("sr", "BA")));
locales.add(CountryService.toCountry(new Locale("sr", "RS")));
locales.add(CountryService.toCountry(new Locale("sv", "SE")));
locales.add(CountryService.toCountry(new Locale("th", "TH")));
locales.add(CountryService.toCountry(new Locale("tr", "TR")));
locales.add(CountryService.toCountry(new Locale("uk", "UA")));
locales.add(CountryService.toCountry(new Locale("uz", "UZ")));
locales.add(CountryService.toCountry(new Locale("vi", "VN")));
locales.add(CountryService.toCountry(Locale.SIMPLIFIED_CHINESE));
locales.add(CountryService.toCountry(Locale.TRADITIONAL_CHINESE));
Expand All @@ -138,4 +145,4 @@ public Map<Integer, Country> getLocalesAsMap() {
}
return localesAsMap;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,7 @@
<h:outputScript name="jquery/jquery.js" library="primefaces" target="head"/>
<h:outputScript name="jquery/jquery-plugins.js" library="primefaces" target="head"/>
<h:outputScript name="locales/locale-#{app.locale.language}.js" library="primefaces" target="head"/>
<h:outputScript name="moment/moment.js" library="primefaces" target="head"/>
<h:outputScript name="validation/validation.js" library="primefaces" target="head"/>
<h:outputScript name="validation/validation.bv.js" library="primefaces" target="head"/>
</f:view>
</h:body>

</html>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@
<h:outputText value="#{product.inventoryStatus}"/>
</f:facet>
<f:facet name="input">
<h:selectOneMenu value="#{product.inventoryStatus}" style="width:100%">
<p:selectOneMenu value="#{product.inventoryStatus}" style="width:100%">
<f:selectItems value="#{dtEditView.inventoryStatusList}" var="status"
itemLabel="#{status.text}" itemValue="#{status}"/>
</h:selectOneMenu>
</p:selectOneMenu>
</f:facet>
</p:cellEditor>
</p:column>
Expand Down Expand Up @@ -176,10 +176,10 @@
<h:outputText value="#{product.inventoryStatus}"/>
</f:facet>
<f:facet name="input">
<h:selectOneMenu value="#{product.inventoryStatus}" style="width:100%">
<p:selectOneMenu value="#{product.inventoryStatus}" style="width:100%">
<f:selectItems value="#{dtEditView.inventoryStatusList}" var="status"
itemLabel="#{status.text}" itemValue="#{status}"/>
</h:selectOneMenu>
</p:selectOneMenu>
</f:facet>
</p:cellEditor>
</p:column>
Expand Down
182 changes: 182 additions & 0 deletions src/main/resources/META-INF/resources/ui/file/upload/advanced.xhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="jakarta.faces.facelets"
xmlns:h="jakarta.faces.html"
xmlns:f="jakarta.faces.core"
xmlns:p="primefaces"
template="/template/template.xhtml">

<ui:define name="head">
<style>
body .ui-inputfield.ui-state-drag {
background: #ffffd6;
}
</style>
</ui:define>

<ui:define name="title">
FileUpload <span class="subitem">Advanced</span>
</ui:define>

<ui:define name="description">
Advanced FileUpload is an advanced uploader with dragdrop support, multi file uploads, auto uploading, progress tracking and validations.
</ui:define>

<ui:param name="documentationLink" value="/components/fileupload"/>
<ui:param name="widgetLink" value="FileUpload-1"/>

<ui:define name="implementation">
<div class="card">
<h5>Single</h5>

<p>Single mode allows only one file to be selected at a time from the native file dialog.</p>

<h:form id="single" enctype="multipart/form-data">
<p:fileUpload id="upload" listener="#{fileUploadView.handleFileUpload}"
mode="advanced" multiple="false"
accept=".gif,.jpg,.jpeg,.png"
update="growl"
onupload="return confirm('Are you sure?')">
<p:validateFile sizeLimit="1000000" fileLimit="3" allowTypes="/(\.|\/)(gif|jpeg|jpg|png)$/"
contentType="true"/>
</p:fileUpload>

<p:growl id="growl" showDetail="true" keepAlive="true"/>
</h:form>
</div>

<div class="card">
<h5>Multiple</h5>

<p>Multiple mode allows multiple files to be selected from the native file dialog if supported by the browser.</p>

<h:form id="multiple" enctype="multipart/form-data">
<p:fileUpload id="upload" listener="#{fileUploadView.handleFileUpload}"
mode="advanced" multiple="true"
accept=".gif,.jpg,.jpeg,.png"
update="growl">
<p:validateFile sizeLimit="1000000" fileLimit="3" allowTypes="/(\.|\/)(gif|jpeg|jpg|png)$/"/>
</p:fileUpload>

<p:growl id="growl" showDetail="true" keepAlive="true"/>
</h:form>
</div>

<div class="card">
<h5>Auto</h5>

<p>Upload process begins once the file is selected in auto mode.</p>

<h:form id="auto" enctype="multipart/form-data">
<p:fileUpload id="upload" listener="#{fileUploadView.handleFileUpload}" mode="advanced"
update="growl" auto="true">
<p:validateFile sizeLimit="100000" allowTypes="/(\.|\/)(gif|jpeg|jpg|png)$/"/>
</p:fileUpload>

<p:growl id="growl" showDetail="true" keepAlive="true"/>
</h:form>
</div>

<div class="card">
<h5>Chunked</h5>

<p>Chunked mode uploads files in (small) chunks to allow resume-functionality.</p>

<h:form id="chunked" enctype="multipart/form-data">
<p:fileUpload id="upload" listener="#{fileUploadView.handleFileUpload}" mode="advanced"
multiple="true"
update="growl"
maxChunkSize="1000000">
<p:validateFile sizeLimit="10000000" fileLimit="3" allowTypes="/(\.|\/)(gif|jpeg|jpg|png)$/"/>
</p:fileUpload>

<p:growl id="growl" showDetail="true" keepAlive="true"/>
</h:form>
</div>


<div class="card">
<h5>Custom Drag&amp;Drop</h5>

<p>Per default, the FileUpload itself is the drop zone. In addition FileUpload supports a custom dropZone.</p>

<h:form id="dropZone" enctype="multipart/form-data">
<div class="ui-fluid">
<div class="field">
<p:inputTextarea id="customDropZone" widgetVar="textarea"
rows="5" value="#{fileUploadView.dropZoneText}"/>
<small>
Drop on the text area to upload, or
<p:link value="choose" onclick="PF('uploadDnd').show();return false"
style="font-size:inherit"/>.
</small>
</div>
</div>

<p:fileUpload id="upload" widgetVar="uploadDnd" listener="#{fileUploadView.handleFileUploadTextarea}"
mode="advanced" auto="true"
dropZone="customDropZone"
update="@form"
style="display: none">
<p:validateFile allowTypes="/(\.|\/)(gif|jpeg|jpg|png)$/" sizeLimit="100000"/>
</p:fileUpload>

<p:growl id="growl" showDetail="true" keepAlive="true"/>
</h:form>
</div>

<div class="card">
<h5>Empty Facet</h5>

<p>The empty-facet is rendered when no files are added yet.</p>

<h:form id="empty" enctype="multipart/form-data">
<p:fileUpload id="upload" listener="#{fileUploadView.handleFileUpload}" mode="advanced"
multiple="true"
update="growl">
<f:facet name="empty">
Drag and drop files to here to upload.
</f:facet>
<p:validateFile sizeLimit="100000" fileLimit="3" allowTypes="/(\.|\/)(gif|jpeg|jpg|png)$/"/>
</p:fileUpload>

<p:growl id="growl" showDetail="true" keepAlive="true"/>
</h:form>
</div>

<div class="card">
<h5>Tooltips</h5>

<p>Tooltips can be attached to each one of FileUpload buttons in advanced mode using PFS. Moreover, you can use plain html browser native titles as well.</p>

<h:form id="tooltips" enctype="multipart/form-data">

<p:fileUpload id="uploader1" mode="advanced" styleClass="block mb-5"/>

<p:outputPanel id="tooltipsPanel">
<p:tooltip id="uploaderChooseFileBeforeUploadToolTip"
widgetVar="chooseWV" position="top"
for="@(#tooltips\:uploader1 > .ui-fileupload-buttonbar > .ui-fileupload-choose)"
value="Choose button tooltip"/>

<p:tooltip id="uploaderUploadButtonToolTip"
position="right"
for="@(#tooltips\:uploader1 > .ui-fileupload-buttonbar > .ui-fileupload-upload)"
value="Upload button tooltip" showEffect="clip"
hideEffect="explode"/>

<p:tooltip id="uploaderCancelButtonToolTip"
position="bottom"
for="@(#tooltips\:uploader1 > .ui-fileupload-buttonbar > .ui-fileupload-cancel)"
value="Cancel button tooltip"/>
</p:outputPanel>

<p:fileUpload id="uploader2" mode="advanced" styleClass="block mb-5"
chooseButtonTitle="Choose button tooltip"
uploadButtonTitle="Upload button tooltip"
cancelButtonTitle="Cancel button tooltip"/>
</h:form>
</div>

</ui:define>

</ui:composition>
32 changes: 0 additions & 32 deletions src/main/resources/META-INF/resources/ui/file/upload/auto.xhtml

This file was deleted.

Loading

0 comments on commit ebdcf2b

Please sign in to comment.