primeng 16.7.0 → 16.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/dropdown/dropdown.mjs +26 -21
- package/esm2022/listbox/listbox.interface.mjs +1 -1
- package/esm2022/listbox/listbox.mjs +4 -3
- package/esm2022/multiselect/multiselect.mjs +5 -3
- package/esm2022/selectbutton/selectbutton.mjs +2 -1
- package/esm2022/treetable/treetable.mjs +21 -25
- package/fesm2022/primeng-dropdown.mjs +26 -21
- package/fesm2022/primeng-dropdown.mjs.map +1 -1
- package/fesm2022/primeng-listbox.mjs +3 -2
- package/fesm2022/primeng-listbox.mjs.map +1 -1
- package/fesm2022/primeng-multiselect.mjs +4 -2
- package/fesm2022/primeng-multiselect.mjs.map +1 -1
- package/fesm2022/primeng-selectbutton.mjs +1 -0
- package/fesm2022/primeng-selectbutton.mjs.map +1 -1
- package/fesm2022/primeng-treetable.mjs +23 -27
- package/fesm2022/primeng-treetable.mjs.map +1 -1
- package/listbox/listbox.interface.d.ts +1 -1
- package/package.json +138 -138
- package/treetable/treetable.d.ts +3 -4
@@ -16,7 +16,7 @@ import * as i6 from 'primeng/scroller';
|
|
16
16
|
import { ScrollerModule } from 'primeng/scroller';
|
17
17
|
import * as i5 from 'primeng/tooltip';
|
18
18
|
import { TooltipModule } from 'primeng/tooltip';
|
19
|
-
import {
|
19
|
+
import { ObjectUtils, UniqueComponentId } from 'primeng/utils';
|
20
20
|
import { TimesIcon } from 'primeng/icons/times';
|
21
21
|
import { ChevronDownIcon } from 'primeng/icons/chevrondown';
|
22
22
|
import { SearchIcon } from 'primeng/icons/search';
|
@@ -609,7 +609,7 @@ class Dropdown {
|
|
609
609
|
return this.modelValue() || this.modelValue() != null || this.modelValue() != undefined;
|
610
610
|
}
|
611
611
|
get isVisibleClearIcon() {
|
612
|
-
return this.modelValue() != null && this.modelValue() !== '' && this.showClear && !this.disabled;
|
612
|
+
return this.modelValue() != null && ObjectUtils.isNotEmpty(this.modelValue()) && this.modelValue() !== '' && this.showClear && !this.disabled;
|
613
613
|
}
|
614
614
|
get containerClass() {
|
615
615
|
return {
|
@@ -622,10 +622,11 @@ class Dropdown {
|
|
622
622
|
};
|
623
623
|
}
|
624
624
|
get inputClass() {
|
625
|
+
const label = this.label();
|
625
626
|
return {
|
626
627
|
'p-dropdown-label p-inputtext': true,
|
627
|
-
'p-placeholder': this.placeholder &&
|
628
|
-
'p-dropdown-label-empty': !this.editable && !this.selectedItemTemplate && (
|
628
|
+
'p-placeholder': this.placeholder && label === this.placeholder,
|
629
|
+
'p-dropdown-label-empty': !this.editable && !this.selectedItemTemplate && (!label || label === 'p-emptylabel' || label.length === 0)
|
629
630
|
};
|
630
631
|
}
|
631
632
|
get panelClass() {
|
@@ -638,7 +639,9 @@ class Dropdown {
|
|
638
639
|
visibleOptions = computed(() => {
|
639
640
|
const options = this.group ? this.flatOptions(this.options) : this.options || [];
|
640
641
|
if (this._filterValue()) {
|
641
|
-
const filteredOptions = this.
|
642
|
+
const filteredOptions = !this.filterBy && !this.filterFields && !this.optionValue
|
643
|
+
? this.options.filter((option) => option.toLowerCase().indexOf(this._filterValue().toLowerCase()) !== -1)
|
644
|
+
: this.filterService.filter(options, this.searchFields(), this._filterValue(), this.filterMatchMode, this.filterLocale);
|
642
645
|
if (this.group) {
|
643
646
|
const optionGroups = this.options || [];
|
644
647
|
const filtered = [];
|
@@ -656,12 +659,7 @@ class Dropdown {
|
|
656
659
|
});
|
657
660
|
label = computed(() => {
|
658
661
|
let selectedOptionIndex;
|
659
|
-
|
660
|
-
selectedOptionIndex = this.findFirstOptionIndex();
|
661
|
-
}
|
662
|
-
if (!this.autoDisplayFirst) {
|
663
|
-
selectedOptionIndex = this.findSelectedOptionIndex();
|
664
|
-
}
|
662
|
+
this.autoDisplayFirst ? (!this.modelValue() ? (selectedOptionIndex = -1) : (selectedOptionIndex = this.findFirstOptionIndex())) : (selectedOptionIndex = this.findSelectedOptionIndex());
|
665
663
|
return this.modelValue() ? this.getOptionLabel(this.modelValue()) : selectedOptionIndex !== -1 ? this.getOptionLabel(this.visibleOptions()[selectedOptionIndex]) : this.placeholder || 'p-emptylabel';
|
666
664
|
});
|
667
665
|
constructor(el, renderer, cd, zone, filterService, config) {
|
@@ -782,13 +780,16 @@ class Dropdown {
|
|
782
780
|
}
|
783
781
|
}
|
784
782
|
updateModel(value, event) {
|
783
|
+
this.value = value;
|
785
784
|
this.onModelChange(value);
|
785
|
+
if (this.value !== this.modelValue()) {
|
786
|
+
this.onChange.emit({
|
787
|
+
originalEvent: event,
|
788
|
+
value: value
|
789
|
+
});
|
790
|
+
}
|
786
791
|
this.modelValue.set(value);
|
787
792
|
this.selectedOptionUpdated = true;
|
788
|
-
this.onChange.emit({
|
789
|
-
originalEvent: event,
|
790
|
-
value: value
|
791
|
-
});
|
792
793
|
}
|
793
794
|
isSelected(option) {
|
794
795
|
return this.isValidOption(option) && ObjectUtils.equals(this.modelValue(), this.getOptionValue(option), this.equalityKey());
|
@@ -836,7 +837,7 @@ class Dropdown {
|
|
836
837
|
if (this.filter) {
|
837
838
|
this.resetFilter();
|
838
839
|
}
|
839
|
-
this.value =
|
840
|
+
this.value = value;
|
840
841
|
this.updateModel(this.value);
|
841
842
|
this.updateEditableLabel();
|
842
843
|
this.cd.markForCheck();
|
@@ -1308,7 +1309,7 @@ class Dropdown {
|
|
1308
1309
|
this.applyFocus();
|
1309
1310
|
}
|
1310
1311
|
clear(event) {
|
1311
|
-
this.updateModel(
|
1312
|
+
this.updateModel(null, event);
|
1312
1313
|
this.updateEditableLabel();
|
1313
1314
|
this.onClear.emit(event);
|
1314
1315
|
}
|
@@ -1339,9 +1340,11 @@ class Dropdown {
|
|
1339
1340
|
(blur)="onInputBlur($event)"
|
1340
1341
|
(keydown)="onKeyDown($event)"
|
1341
1342
|
>
|
1342
|
-
<ng-container *ngIf="!selectedItemTemplate">{{ label() === 'p-emptylabel' ? ' ' : label() || 'empty' }}</ng-container>
|
1343
|
+
<ng-container *ngIf="!selectedItemTemplate; else defaultPlaceholder">{{ label() === 'p-emptylabel' ? ' ' : label() || 'empty' }}</ng-container>
|
1343
1344
|
<ng-container *ngTemplateOutlet="selectedItemTemplate; context: { $implicit: modelValue() }"></ng-container>
|
1344
|
-
<
|
1345
|
+
<ng-template #defaultPlaceholder>
|
1346
|
+
<span *ngIf="label() === placeholder || (label() && !placeholder)">{{ label() === 'p-emptylabel' ? ' ' : placeholder }}</span>
|
1347
|
+
</ng-template>
|
1345
1348
|
</span>
|
1346
1349
|
<input
|
1347
1350
|
*ngIf="editable"
|
@@ -1528,9 +1531,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImpor
|
|
1528
1531
|
(blur)="onInputBlur($event)"
|
1529
1532
|
(keydown)="onKeyDown($event)"
|
1530
1533
|
>
|
1531
|
-
<ng-container *ngIf="!selectedItemTemplate">{{ label() === 'p-emptylabel' ? ' ' : label() || 'empty' }}</ng-container>
|
1534
|
+
<ng-container *ngIf="!selectedItemTemplate; else defaultPlaceholder">{{ label() === 'p-emptylabel' ? ' ' : label() || 'empty' }}</ng-container>
|
1532
1535
|
<ng-container *ngTemplateOutlet="selectedItemTemplate; context: { $implicit: modelValue() }"></ng-container>
|
1533
|
-
<
|
1536
|
+
<ng-template #defaultPlaceholder>
|
1537
|
+
<span *ngIf="label() === placeholder || (label() && !placeholder)">{{ label() === 'p-emptylabel' ? ' ' : placeholder }}</span>
|
1538
|
+
</ng-template>
|
1534
1539
|
</span>
|
1535
1540
|
<input
|
1536
1541
|
*ngIf="editable"
|