Skip to content

Commit

Permalink
Merge branch 'master' into issue-13993
Browse files Browse the repository at this point in the history
  • Loading branch information
cetincakiroglu committed Nov 17, 2023
2 parents 5fd9170 + 1e476bf commit b4028d9
Show file tree
Hide file tree
Showing 45 changed files with 389 additions and 191 deletions.
60 changes: 59 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,38 @@
# Changelog

## [16.7.2](https://github.com/primefaces/primeng/tree/16.7.2) (2023-11-08)

[Full Changelog](https://github.com/primefaces/primeng/compare/16.7.1...16.7.2)

**Fixed bugs:**
- Overlay: p-overlay div not removed from DOM on hiding panel [\#12948](https://github.com/primefaces/primeng/issues/12948)
- Table / EditableColumn: onEditComplete emitts old data value and not the new one as documented [\#13708](https://github.com/primefaces/primeng/issues/13708)
- FileUpload: Input Triggered on Any Mouse Click [\#13722](https://github.com/primefaces/primeng/issues/13722)
- Toast | Position Class is there twice when using Angular SSR and Client Hydration [\#13784](https://github.com/primefaces/primeng/issues/13784)
- Dialog: bad drag behavior when keepInViewport is false [\#13856](https://github.com/primefaces/primeng/issues/13856)
- p-image-preview-indicator rendered when preview is false [\#14002](https://github.com/primefaces/primeng/issues/14002)
- TriStateCheckboxComponent: inputId not working [\#13946](https://github.com/primefaces/primeng/issues/13946)
- splitButton: close dropdown when default button is clicked [\#13962](https://github.com/primefaces/primeng/issues/13962)
- SelectButton in v16.7.1 is only partially fixed [\#14048](https://github.com/primefaces/primeng/issues/14048)

## [16.7.1](https://github.com/primefaces/primeng/tree/16.7.1) (2023-11-06)

[Full Changelog](https://github.com/primefaces/primeng/compare/16.7.0...16.7.1)

**Fixed bugs:**
- BIG ERROR with DropDown [\#13996](https://github.com/primefaces/primeng/issues/13996)
- Component: p-dropdwon onChange is called multiple times at init [\#14005](https://github.com/primefaces/primeng/issues/14005)
- Change of Dropdown selection throws error: Cannot read properties of undefined (reading 'length') primeng dropdown [\#14007](https://github.com/primefaces/primeng/issues/14007)
- Dropdown filtering issues with array of strings [\#14011](https://github.com/primefaces/primeng/issues/14011)
- The ngModel directive can't set an item of dropdown in version 16.7.0 [\#14023](https://github.com/primefaces/primeng/issues/14023)
- ListBox | onClick event does not emit [\#14036](https://github.com/primefaces/primeng/issues/14036)
- ListBox | OnChange doesn't emit [\#14033](https://github.com/primefaces/primeng/issues/14033)
- onClick event listbox error v16.7.0 [\#13998](https://github.com/primefaces/primeng/issues/13998)
- MultiSelect | Input section receives focus on filter click. [\#14035](https://github.com/primefaces/primeng/issues/14035)
- Multiselect set value error v16.7.0 [\#13999](https://github.com/primefaces/primeng/issues/13999)
- SelectButton broken in v16.7.0 [\#14021](https://github.com/primefaces/primeng/issues/14021)
- Global filter to search tree-table is not returning all the relevant results [\#14016](https://github.com/primefaces/primeng/issues/14016)

## [16.7.0](https://github.com/primefaces/primeng/tree/16.7.0) (2023-11-01)

[Full Changelog](https://github.com/primefaces/primeng/compare/16.6.0...16.7.0)
Expand Down Expand Up @@ -50,7 +83,7 @@

## [16.5.0](https://github.com/primefaces/primeng/tree/16.5.0) (2023-10-11)

[Full Changelog](https://github.com/primefaces/primeng/compare/16.4.1...16.5.0)
[Full Changelog](https://github.com/primefaces/primeng/compare/16.4.2...16.5.0)

**Deprecated:**
- SlideMenu: Deprecate from PrimeNG [\#13830](https://github.com/primefaces/primeng/issues/13830)
Expand Down Expand Up @@ -78,6 +111,15 @@
- p-dialog: ExpressionChangedAfterItHasBeenCheckedError with attr.aria-labelledby [\#13636](https://github.com/primefaces/primeng/issues/13636)
- Textarea: autoResize doesn't work when used inside a Dialog [\#9231](https://github.com/primefaces/primeng/issues/9231)

## [16.4.2](https://github.com/primefaces/primeng/tree/16.4.2) (2023-11-10)

[Full Changelog](https://github.com/primefaces/primeng/compare/16.4.1...16.4.2)

**Fixed bugs:**

- TreeTable | Global filter to search tree-table is not returning all the relevant results [\#14082](https://github.com/primefaces/primeng/issues/14082)
- Dropdown | FocusTrap doesn't allow user to tab on next element [\#14083](https://github.com/primefaces/primeng/issues/14083)

## [16.4.1](https://github.com/primefaces/primeng/tree/16.4.1) (2023-09-27)

[Full Changelog](https://github.com/primefaces/primeng/compare/16.4.0...16.4.1)
Expand Down Expand Up @@ -400,6 +442,14 @@
- Checkbox in p-treeNode always checked when using custom icon [\#12951](https://github.com/primefaces/primeng/issues/12951)
- ConfirmDialog: Duplicated AcceptIcons [\#13001](https://github.com/primefaces/primeng/issues/13001)

## ![LTS](https://www.primefaces.org/wp-content/uploads/2020/01/lts-icon-24.png "PrimeNG LTS") [15.4.12-LTS](https://www.npmjs.com/package/primeng/v/15.4.12-lts) (2023-11-08)

**Fixed bugs:**
- Overlay: p-overlay div not removed from DOM on hiding panel [\#12948](https://github.com/primefaces/primeng/issues/12948)
- Table / EditableColumn: onEditComplete emitts old data value and not the new one as documented [\#13708](https://github.com/primefaces/primeng/issues/13708)
- FileUpload: Input Triggered on Any Mouse Click [\#13722](https://github.com/primefaces/primeng/issues/13722)
- Dialog: bad drag behavior when keepInViewport is false [\#13856](https://github.com/primefaces/primeng/issues/13856)

## ![LTS](https://www.primefaces.org/wp-content/uploads/2020/01/lts-icon-24.png "PrimeNG LTS") [15.4.11-LTS](https://www.npmjs.com/package/primeng/v/15.4.11-lts) (2023-10-19)
**Fixed bugs:**
- Password | Incorrect placement of close icon when [toggleMask]="true" [\#13817](https://github.com/primefaces/primeng/issues/13817)
Expand Down Expand Up @@ -678,6 +728,14 @@
- Sidebar: Footer Templating [\#12259](https://github.com/primefaces/primeng/issues/12259)
- Calendar: Day names don't update [\#12148](https://github.com/primefaces/primeng/issues/12148)

## ![LTS](https://www.primefaces.org/wp-content/uploads/2020/01/lts-icon-24.png "PrimeNG LTS") [14.2.15-LTS](https://www.npmjs.com/package/primeng/v/14.2.15-lts) (2023-11-08)

**Fixed bugs:**
- Overlay: p-overlay div not removed from DOM on hiding panel [\#12948](https://github.com/primefaces/primeng/issues/12948)
- Table / EditableColumn: onEditComplete emitts old data value and not the new one as documented [\#13708](https://github.com/primefaces/primeng/issues/13708)
- FileUpload: Input Triggered on Any Mouse Click [\#13722](https://github.com/primefaces/primeng/issues/13722)
- Dialog: bad drag behavior when keepInViewport is false [\#13856](https://github.com/primefaces/primeng/issues/13856)

## ![LTS](https://www.primefaces.org/wp-content/uploads/2020/01/lts-icon-24.png "PrimeNG LTS") [14.2.14-LTS](https://www.npmjs.com/package/primeng/v/14.2.14-lts) (2023-10-19)
**Fixed bugs:**
- Password | Incorrect placement of close icon when [toggleMask]="true" [\#13817](https://github.com/primefaces/primeng/issues/13817)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[![npm downloads](https://img.shields.io/npm/dm/primeng.svg)](https://www.npmjs.com/package/primeng)
[![Actions CI](https://github.com/primefaces/primeng/workflows/NodeJS%20CI/badge.svg)](https://github.com/primefaces/primeng/actions/workflows/node.js.yml)
[![Discord Chat](https://img.shields.io/discord/557940238991753223.svg?color=7289da&label=chat&logo=discord)](https://discord.gg/gzKFYnpmCY)
[![Discussions](https://img.shields.io/github/discussions-search?query=org%3Aprimefaces&logo=github&label=Prime%20Discussions&link=https%3A%2F%2Fgithub.com%2Forgs%2Fprimefaces%2Fdiscussions)](https://github.com/orgs/primefaces/discussions)

[![PrimeNG Hero](https://www.primefaces.org/static/social/primeng-preview.jpg)](https://primeng.org)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "primeng",
"version": "16.7.0",
"version": "16.7.2",
"license": "SEE LICENSE IN LICENSE.md",
"scripts": {
"ng": "ng",
Expand Down
35 changes: 29 additions & 6 deletions src/app/components/autocomplete/autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export const AUTOCOMPLETE_VALUE_ACCESSOR: any = {
<p-overlay
#overlay
[(visible)]="overlayVisible"
[options]="virtualScrollOptions"
[options]="overlayOptions"
[target]="'@parent'"
[appendTo]="appendTo"
[showTransitionOptions]="showTransitionOptions"
Expand All @@ -197,7 +197,6 @@ export const AUTOCOMPLETE_VALUE_ACCESSOR: any = {
*ngIf="virtualScroll"
#scroller
[items]="visibleOptions()"
[tabindex]="-1"
[style]="{ height: scrollHeight }"
[itemSize]="virtualScrollItemSize || _itemSize"
[autoSize]="true"
Expand Down Expand Up @@ -1023,7 +1022,7 @@ export class AutoComplete implements AfterViewChecked, AfterContentInit, OnDestr
return;
}

if (!this.overlayViewChild || !this.overlayViewChild.overlayViewChild.nativeElement.contains(event.target)) {
if (!this.overlayViewChild || !this.overlayViewChild.overlayViewChild?.nativeElement.contains(event.target)) {
DomHandler.focus(this.inputEL.nativeElement);
}
}
Expand Down Expand Up @@ -1055,9 +1054,12 @@ export class AutoComplete implements AfterViewChecked, AfterContentInit, OnDestr
this.updateModel(query);
}

if (query.length === 0) {
this.hide();
if (query.length === 0 && !this.multiple) {
this.onClear.emit();

setTimeout(() => {
this.hide();
}, this.delay / 2);
} else {
if (query.length >= this.minLength) {
this.focusedOptionIndex.set(-1);
Expand Down Expand Up @@ -1240,6 +1242,7 @@ export class AutoComplete implements AfterViewChecked, AfterContentInit, OnDestr
this.changeFocusedOptionIndex(event, optionIndex);

event.preventDefault();
event.stopPropagation();
}

onArrowUpKey(event) {
Expand All @@ -1260,6 +1263,7 @@ export class AutoComplete implements AfterViewChecked, AfterContentInit, OnDestr
this.changeFocusedOptionIndex(event, optionIndex);

event.preventDefault();
event.stopPropagation();
}
}

Expand Down Expand Up @@ -1566,7 +1570,26 @@ export class AutoComplete implements AfterViewChecked, AfterContentInit, OnDestr
onOverlayAnimationStart(event: AnimationEvent) {
if (event.toState === 'visible') {
this.itemsWrapper = DomHandler.findSingle(this.overlayViewChild.overlayViewChild?.nativeElement, this.virtualScroll ? '.p-scroller' : '.p-autocomplete-panel');
this.virtualScroll && this.scroller?.setContentEl(this.itemsViewChild?.nativeElement);

if(this.virtualScroll) {
this.scroller?.setContentEl(this.itemsViewChild?.nativeElement);
this.scroller.viewInit();
}
if(this.visibleOptions() && this.visibleOptions().length) {
if(this.virtualScroll) {
const selectedIndex = this.modelValue() ? this.focusedOptionIndex() : -1;

if (selectedIndex !== -1) {
this.scroller?.scrollToIndex(selectedIndex);
}
} else {
let selectedListItem = DomHandler.findSingle(this.itemsWrapper, '.p-autocomplete-item.p-highlight');

if (selectedListItem) {
selectedListItem.scrollIntoView({ block: 'nearest', inline: 'center' });
}
}
}
}
}

Expand Down
16 changes: 6 additions & 10 deletions src/app/components/chips/chips.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const CHIPS_VALUE_ACCESSOR: any = {
(paste)="onPaste($event)"
(focus)="onInputFocus($event)"
(blur)="onInputBlur($event)"
[disabled]="disabled || maxedOut"
[disabled]="disabled || isMaxedOut"
[ngStyle]="inputStyle"
[class]="inputStyleClass"
/>
Expand All @@ -101,7 +101,7 @@ export const CHIPS_VALUE_ACCESSOR: any = {
host: {
class: 'p-element p-inputwrapper',
'[class.p-inputwrapper-filled]': 'filled',
'[class.p-inputwrapper-focus]': 'focus',
'[class.p-inputwrapper-focus]': 'focused',
'[class.p-chips-clearable]': 'showClear'
},
providers: [CHIPS_VALUE_ACCESSOR],
Expand Down Expand Up @@ -263,7 +263,7 @@ export class Chips implements AfterContentInit, ControlValueAccessor {
return this.focusedIndex !== null ? `${this.id}_chips_item_${this.focusedIndex}` : null;
}

private get isValueMaxLimited(): boolean {
get isMaxedOut(): boolean {
return this.max && this.value && this.max === this.value.length;
}

Expand Down Expand Up @@ -459,7 +459,7 @@ export class Chips implements AfterContentInit, ControlValueAccessor {
this.value = this.value || [];

if (item && item.trim().length) {
if ((this.allowDuplicate || this.value.indexOf(item) === -1) && !this.isValueMaxLimited) {
if ((this.allowDuplicate || this.value.indexOf(item) === -1) && !this.isMaxedOut) {
this.value = [...this.value, item];
this.onModelChange(this.value);
this.onAdd.emit({
Expand Down Expand Up @@ -500,7 +500,7 @@ export class Chips implements AfterContentInit, ControlValueAccessor {
break;

case 'Enter':
if (inputValue && inputValue.trim().length && !this.maxedOut()) {
if (inputValue && inputValue.trim().length && !this.isMaxedOut) {
this.addItem(event, inputValue, true);
}

Expand Down Expand Up @@ -530,7 +530,7 @@ export class Chips implements AfterContentInit, ControlValueAccessor {

updateMaxedOut(): void {
if (this.inputViewChild && this.inputViewChild.nativeElement) {
if (this.isValueMaxLimited) {
if (this.isMaxedOut) {
// Calling `blur` is necessary because firefox does not call `onfocus` events
// for disabled inputs, unlike chromium browsers.
this.inputViewChild.nativeElement.blur();
Expand All @@ -544,10 +544,6 @@ export class Chips implements AfterContentInit, ControlValueAccessor {
}
}
}

maxedOut(): boolean {
return this.max && this.value && this.max === this.value.length;
}
}

@NgModule({
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/confirmdialog/confirmdialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ export class ConfirmDialog implements AfterContentInit, OnInit, OnDestroy {
* Element to receive the focus when the dialog gets visible.
* @group Props
*/
@Input() defaultFocus: 'accept' | 'reject' | 'close' = 'accept';
@Input() defaultFocus: 'accept' | 'reject' | 'close' | 'none' = 'accept';
/**
* Object literal to define widths per screen size.
* @group Props
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/dialog/dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ export class Dialog implements AfterContentInit, OnInit, OnDestroy {
this.lastPageX = event.pageX;
this.container.style.left = `${leftPos}px`;
this.lastPageY = event.pageY;
this.container.style.top = `${leftPos}px`;
this.container.style.top = `${topPos}px`;
}
}
}
Expand Down
Loading

0 comments on commit b4028d9

Please sign in to comment.