Skip to content

Commit

Permalink
Merge branch 'primefaces:master' into new-feature-primefaces#4134
Browse files Browse the repository at this point in the history
  • Loading branch information
userkks authored May 25, 2023
2 parents a42bd36 + 64903b4 commit 1cb5d1e
Show file tree
Hide file tree
Showing 153 changed files with 3,153 additions and 1,179 deletions.
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,40 @@
# Changelog

## [9.5.0](https://github.com/primefaces/primereact/tree/9.5.0) (2023-05-24)

[Full Changelog](https://github.com/primefaces/primereact/compare/9.4.0...9.5.0)

**Implemented New Features and Enhancements:**

- Add `hideOverlaysOnDocumentScrolling` option to PrimeReact config [\#4448](https://github.com/primefaces/primereact/issues/4448)
- Icons: clipPath improvements [\#4441](https://github.com/primefaces/primereact/issues/4441)
- AutoComplete: panelFooterTemplate prop [\#4426](https://github.com/primefaces/primereact/issues/4426)
- MultiSelect: No way to disable filter auto focus [\#4423](https://github.com/primefaces/primereact/issues/4423)
- New passthrough\(pt\) property implementation for Media Components [\#4393](https://github.com/primefaces/primereact/issues/4393)
- New passthrough\(pt\) property implementation for Chart & FileUpload & Message Components [\#4392](https://github.com/primefaces/primereact/issues/4392)
- New passthrough\(pt\) property implementation for Menu Components [\#4391](https://github.com/primefaces/primereact/issues/4391)
- Mention: suggestion panel to hide when scrolling away [\#4223](https://github.com/primefaces/primereact/issues/4223)
- Messages-Toast: Inconsistency [\#4077](https://github.com/primefaces/primereact/issues/4077)
- Menu: Add ability to right align [\#3753](https://github.com/primefaces/primereact/issues/3753)

**Fixed bugs:**

- Dropdown: Footer using incorrect style name [\#4446](https://github.com/primefaces/primereact/issues/4446)
- InputNumber: preventing ripple on buttons [\#4443](https://github.com/primefaces/primereact/issues/4443)
- Datatable: filterIcon and filterClearIcon not propagated [\#4439](https://github.com/primefaces/primereact/issues/4439)
- BreadCrumb: SVG location of the DOM [\#4438](https://github.com/primefaces/primereact/issues/4438)
- DataTable: Filter Clear icon is missing [\#4437](https://github.com/primefaces/primereact/issues/4437)
- Datatable: Setting rowEditorInitIcon has no effect. [\#4430](https://github.com/primefaces/primereact/issues/4430)
- MultiSelect clear icon not aligned correctly [\#4427](https://github.com/primefaces/primereact/issues/4427)
- TriStateCheckbox: "undefined" value render checkbox highlighted but without value [\#4422](https://github.com/primefaces/primereact/issues/4422)
- Checkbox: Toggling value by clicking the label broken [\#4402](https://github.com/primefaces/primereact/issues/4402)
- Image: Zoom out action disabled when fully zoomed in [\#4400](https://github.com/primefaces/primereact/issues/4400)
- ConfirmDialog: Missing dialog header [\#4397](https://github.com/primefaces/primereact/issues/4397)
- Autocomplete: multiple + forceSelection [\#4363](https://github.com/primefaces/primereact/issues/4363)
- DataTable: resizableColumns with stateStorage will not adjust saved column width after refresh. [\#4211](https://github.com/primefaces/primereact/issues/4211)
- Autocomplete clears selected values onBlur when forceSelection and multiple are true [\#4203](https://github.com/primefaces/primereact/issues/4203)
- Dropdown: rendering problem when used in a Dialog [\#2683](https://github.com/primefaces/primereact/issues/2683)

## [9.4.0](https://github.com/primefaces/primereact/tree/9.4.0) (2023-05-12)

[Full Changelog](https://github.com/primefaces/primereact/compare/9.3.1...9.4.0)
Expand Down
56 changes: 51 additions & 5 deletions components/doc/autocomplete/templatedoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,30 @@ export function TemplateDoc(props) {
);
};

const panelFooterTemplate = () => {
const isCountrySelected = (filteredCountries || []).some((country) => country['name'] === selectedCountry);

return (
<div className="py-2 px-3">
{isCountrySelected ? (
<span>
<b>{selectedCountry}</b> selected.
</span>
) : (
'No country selected.'
)}
</div>
);
};

useEffect(() => {
CountryService.getCountries().then((data) => setCountries(data));
}, []); // eslint-disable-line react-hooks/exhaustive-deps

const code = {
basic: `
<AutoComplete field="name" value={selectedCountry} suggestions={filteredCountries}
completeMethod={search} onChange={(e) => setSelectedCountry(e.value)} itemTemplate={itemTemplate} />
<AutoComplete field="name" value={selectedCountry} suggestions={filteredCountries}
completeMethod={search} onChange={(e) => setSelectedCountry(e.value)} itemTemplate={itemTemplate} panelFooterTemplate={panelFooterTemplate} />
`,
javascript: `
import React, { useEffect, useState } from 'react';
Expand All @@ -54,6 +70,21 @@ export default function TemplateDemo() {
const [selectedCountry, setSelectedCountry] = useState(null);
const [filteredCountries, setFilteredCountries] = useState(null);
const panelFooterTemplate = () => {
const isCountrySelected = (filteredCountries || []).some( country => country['name'] === selectedCountry );
return (
<div className="py-2 px-3">
{isCountrySelected ? (
<span>
<b>{selectedCountry}</b> selected.
</span>
) : (
'No country selected.'
)}
</div>
);
};
const search = (event) => {
// Timeout to emulate a network connection
setTimeout(() => {
Expand Down Expand Up @@ -93,7 +124,7 @@ export default function TemplateDemo() {
return (
<div className="card flex justify-content-center">
<AutoComplete field="name" value={selectedCountry} suggestions={filteredCountries}
completeMethod={search} onChange={(e) => setSelectedCountry(e.value)} itemTemplate={itemTemplate} />
completeMethod={search} onChange={(e) => setSelectedCountry(e.value)} itemTemplate={itemTemplate} panelFooterTemplate={panelFooterTemplate} />
</div>
)
}
Expand Down Expand Up @@ -144,6 +175,21 @@ export default function TemplateDemo() {
</div>
);
};
const panelFooterTemplate = () => {
const isCountrySelected = (filteredCountries || []).some( country => country['name'] === selectedCountry );
return (
<div className="py-2 px-3">
{isCountrySelected ? (
<span>
<b>{selectedCountry}</b> selected.
</span>
) : (
'No country selected.'
)}
</div>
);
};
useEffect(() => {
CountryService.getCountries().then((data) => setCountries(data));
Expand All @@ -152,7 +198,7 @@ export default function TemplateDemo() {
return (
<div className="card flex justify-content-center">
<AutoComplete field="name" value={selectedCountry} suggestions={filteredCountries}
completeMethod={search} onChange={(e: AutoCompleteChangeEvent) => setSelectedCountry(e.value)} itemTemplate={itemTemplate} />
completeMethod={search} onChange={(e: AutoCompleteChangeEvent) => setSelectedCountry(e.value)} itemTemplate={itemTemplate} panelFooterTemplate={panelFooterTemplate} />
</div>
)
}
Expand All @@ -175,7 +221,7 @@ export default function TemplateDemo() {
</p>
</DocSectionText>
<div className="card flex justify-content-center">
<AutoComplete field="name" value={selectedCountry} suggestions={filteredCountries} completeMethod={search} onChange={(e) => setSelectedCountry(e.value)} itemTemplate={itemTemplate} />
<AutoComplete field="name" value={selectedCountry} suggestions={filteredCountries} completeMethod={search} onChange={(e) => setSelectedCountry(e.value)} itemTemplate={itemTemplate} panelFooterTemplate={panelFooterTemplate} />
</div>
<DocSectionCode code={code} service={['CountryService']} />
</>
Expand Down
Loading

0 comments on commit 1cb5d1e

Please sign in to comment.