From d436ce825e1b4363339e491a8079f1ff99226ec2 Mon Sep 17 00:00:00 2001 From: Simon Schroffner Date: Wed, 22 Nov 2023 11:54:57 +0100 Subject: [PATCH 1/4] Fix Typo Changed the pTemplate name to use the correct selector. --- src/app/showcase/doc/rating/templatedoc.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/showcase/doc/rating/templatedoc.ts b/src/app/showcase/doc/rating/templatedoc.ts index ea51e0c2934..5a73ce67938 100644 --- a/src/app/showcase/doc/rating/templatedoc.ts +++ b/src/app/showcase/doc/rating/templatedoc.ts @@ -9,7 +9,7 @@ import { Code } from '../../domain/code';
- + From 8b9d61b03ca94b07e2e048a97d66645841532028 Mon Sep 17 00:00:00 2001 From: Simon Schroffner Date: Wed, 22 Nov 2023 11:54:57 +0100 Subject: [PATCH 2/4] Fix Typo Changed the pTemplate name to use the correct selector. --- src/app/showcase/doc/rating/templatedoc.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/showcase/doc/rating/templatedoc.ts b/src/app/showcase/doc/rating/templatedoc.ts index ea51e0c2934..3581c69fb4e 100644 --- a/src/app/showcase/doc/rating/templatedoc.ts +++ b/src/app/showcase/doc/rating/templatedoc.ts @@ -9,7 +9,7 @@ import { Code } from '../../domain/code';
- + @@ -33,7 +33,7 @@ export class TemplateDoc { code: Code = { basic: ` - + @@ -47,7 +47,7 @@ export class TemplateDoc { html: `
- + From d6c3eae1438443d300c3ca99613ef126248f734b Mon Sep 17 00:00:00 2001 From: G Vineeth Prakash Date: Tue, 28 Nov 2023 10:04:45 +0530 Subject: [PATCH 3/4] 14194: Fixed filter with default 'label' field --- src/app/components/multiselect/multiselect.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/app/components/multiselect/multiselect.ts b/src/app/components/multiselect/multiselect.ts index e36e8a8a48e..0dde56d24be 100755 --- a/src/app/components/multiselect/multiselect.ts +++ b/src/app/components/multiselect/multiselect.ts @@ -1285,7 +1285,7 @@ export class MultiSelect implements OnInit, AfterViewInit, AfterContentInit, Aft } searchFields() { - return this.filterFields || [this.optionLabel]; + return (this.filterBy || this.optionLabel || 'label').split(','); } findNearestSelectedOptionIndex(index, firstCheckUp = false) { @@ -2052,12 +2052,10 @@ export class MultiSelect implements OnInit, AfterViewInit, AfterContentInit, Aft activateFilter() { if (this.hasFilter() && this._options) { - let searchFields: string[] = (this.filterBy || this.optionLabel || 'label').split(','); - if (this.group) { let filteredGroups = []; for (let optgroup of this.options as any[]) { - let filteredSubOptions = this.filterService.filter(this.getOptionGroupChildren(optgroup), searchFields, this.filterValue, this.filterMatchMode, this.filterLocale); + let filteredSubOptions = this.filterService.filter(this.getOptionGroupChildren(optgroup), this.searchFields(), this.filterValue, this.filterMatchMode, this.filterLocale); if (filteredSubOptions && filteredSubOptions.length) { filteredGroups.push({ ...optgroup, ...{ [this.optionGroupChildren]: filteredSubOptions } }); } @@ -2065,7 +2063,7 @@ export class MultiSelect implements OnInit, AfterViewInit, AfterContentInit, Aft this._filteredOptions = filteredGroups; } else { - this._filteredOptions = this.filterService.filter(this.options as any[], searchFields, this._filterValue, this.filterMatchMode, this.filterLocale); + this._filteredOptions = this.filterService.filter(this.options as any[], this.searchFields(), this.filterValue, this.filterMatchMode, this.filterLocale); } } else { this._filteredOptions = null; From 945ed01f70843435497ae71845dfa5fc2808fba5 Mon Sep 17 00:00:00 2001 From: pete-mcwilliams Date: Tue, 28 Nov 2023 11:40:19 +0000 Subject: [PATCH 4/4] fix for option values of null and empty string (#14223) --- src/app/components/dropdown/dropdown.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/app/components/dropdown/dropdown.ts b/src/app/components/dropdown/dropdown.ts index ecd1b1780ff..09bfe511414 100755 --- a/src/app/components/dropdown/dropdown.ts +++ b/src/app/components/dropdown/dropdown.ts @@ -858,7 +858,7 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV } get isVisibleClearIcon(): boolean | undefined { - return this.modelValue() != null && ObjectUtils.isNotEmpty(this.modelValue()) && this.modelValue() !== '' && this.showClear && !this.disabled; + return this.modelValue() != null && this.hasSelectedOption() && this.showClear && !this.disabled; } get containerClass() { @@ -1134,9 +1134,9 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV return ( (this.optionGroupLabel ? index - - this.visibleOptions() - .slice(0, index) - .filter((option) => this.isOptionGroup(option)).length + this.visibleOptions() + .slice(0, index) + .filter((option) => this.isOptionGroup(option)).length : index) + 1 ); } @@ -1459,7 +1459,7 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV } hasSelectedOption() { - return ObjectUtils.isNotEmpty(this.modelValue()); + return this.modelValue() !== undefined; } isValidSelectedOption(option) { @@ -1487,8 +1487,8 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV const matchedOptionIndex = index < this.visibleOptions().length - 1 ? this.visibleOptions() - .slice(index + 1) - .findIndex((option) => this.isValidOption(option)) + .slice(index + 1) + .findIndex((option) => this.isValidOption(option)) : -1; return matchedOptionIndex > -1 ? matchedOptionIndex + index + 1 : index; } @@ -1666,8 +1666,8 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV optionIndex = optionIndex === -1 ? this.visibleOptions() - .slice(0, this.focusedOptionIndex()) - .findIndex((option) => this.isOptionMatched(option)) + .slice(0, this.focusedOptionIndex()) + .findIndex((option) => this.isOptionMatched(option)) : optionIndex + this.focusedOptionIndex(); } else { optionIndex = this.visibleOptions().findIndex((option) => this.isOptionMatched(option));