From a3286dcd54174811146592eabf37b776e467c53f Mon Sep 17 00:00:00 2001 From: Sinan997 Date: Tue, 21 May 2024 01:10:05 +0300 Subject: [PATCH 01/12] enhancement: add `p-disabled` to the chip icon if option is disabled --- src/app/components/multiselect/multiselect.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/multiselect/multiselect.ts b/src/app/components/multiselect/multiselect.ts index 171ef381b35..54bc1d28039 100755 --- a/src/app/components/multiselect/multiselect.ts +++ b/src/app/components/multiselect/multiselect.ts @@ -192,7 +192,7 @@ export class MultiSelectItem {
{{ getLabelByValue(item) }} - + From 479647cc2ec737fc64337dff0aa2b74191a2ab10 Mon Sep 17 00:00:00 2001 From: Sinan997 Date: Tue, 21 May 2024 01:54:35 +0300 Subject: [PATCH 02/12] fix: use `optionDisabled` input instead of static value --- src/app/components/multiselect/multiselect.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/multiselect/multiselect.ts b/src/app/components/multiselect/multiselect.ts index 54bc1d28039..de65770acc8 100755 --- a/src/app/components/multiselect/multiselect.ts +++ b/src/app/components/multiselect/multiselect.ts @@ -192,7 +192,7 @@ export class MultiSelectItem {
{{ getLabelByValue(item) }} - + From fb7443f5d73629202cd2520fcf2d38cab7241872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20=C3=87etin?= <92744169+mehmetcetin01140@users.noreply.github.com> Date: Mon, 1 Jul 2024 09:56:14 +0300 Subject: [PATCH 03/12] Fixed #15903 - Table | Multiple Selection with dataKey shows wrong selected row count upon CTRL+A --- src/app/components/table/table.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/app/components/table/table.ts b/src/app/components/table/table.ts index aa4873daa12..41caa9dcf73 100644 --- a/src/app/components/table/table.ts +++ b/src/app/components/table/table.ts @@ -1849,7 +1849,7 @@ export class Table implements OnInit, AfterViewInit, AfterContentInit, Blockable } } - selectRange(event: MouseEvent | KeyboardEvent, rowIndex: number) { + selectRange(event: MouseEvent | KeyboardEvent, rowIndex: number, isCtrlASelection? : boolean | undefined) { let rangeStart, rangeEnd; if (this.anchorRowIndex > rowIndex) { @@ -1871,13 +1871,15 @@ export class Table implements OnInit, AfterViewInit, AfterContentInit, Blockable let rangeRowsData = []; for (let i = rangeStart; i <= rangeEnd; i++) { let rangeRowData = this.filteredValue ? this.filteredValue[i] : this.value[i]; - if (!this.isSelected(rangeRowData)) { + if (!this.isSelected(rangeRowData) && !isCtrlASelection) { if (!this.isRowSelectable(rangeRowData, rowIndex)) { continue; } rangeRowsData.push(rangeRowData); + this._selection = [...this.selection, rangeRowData]; + let dataKeyValue = this.dataKey ? String(ObjectUtils.resolveFieldData(rangeRowData, this.dataKey)) : null; if (dataKeyValue) { this.selectionKeys[dataKeyValue] = 1; @@ -3632,7 +3634,7 @@ export class SelectableRow implements OnInit, OnDestroy { if (event.code === 'KeyA' && (event.metaKey || event.ctrlKey) && this.dt.selectionMode === 'multiple') { const data = this.dt.dataToRender(this.dt.processedData); this.dt.selection = [...data]; - this.dt.selectRange(event, data.length - 1); + this.dt.selectRange(event, data.length - 1, true); event.preventDefault(); } From 86e6bfde386e349f9cb565faf714cccbb057f428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20=C3=87etin?= <92744169+mehmetcetin01140@users.noreply.github.com> Date: Tue, 2 Jul 2024 13:36:54 +0300 Subject: [PATCH 04/12] Fixed #15933 - Button Tooltip shows up after Dialog opens --- src/app/components/tooltip/tooltip.ts | 30 ++++++++++++++++----------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/app/components/tooltip/tooltip.ts b/src/app/components/tooltip/tooltip.ts index 34a99d9277f..4d6779273d9 100755 --- a/src/app/components/tooltip/tooltip.ts +++ b/src/app/components/tooltip/tooltip.ts @@ -164,6 +164,8 @@ export class Tooltip implements AfterViewInit, OnDestroy { resizeListener: any; + interactionInProgress = false; + constructor( @Inject(PLATFORM_ID) private platformId: any, public el: ElementRef, @@ -339,24 +341,28 @@ export class Tooltip implements AfterViewInit, OnDestroy { } activate() { - this.active = true; - this.clearHideTimeout(); + if (!this.interactionInProgress) { + this.active = true; + this.clearHideTimeout(); - if (this.getOption('showDelay')) - this.showTimeout = setTimeout(() => { - this.show(); - }, this.getOption('showDelay')); - else this.show(); + if (this.getOption('showDelay')) + this.showTimeout = setTimeout(() => { + this.show(); + }, this.getOption('showDelay')); + else this.show(); - if (this.getOption('life')) { - let duration = this.getOption('showDelay') ? this.getOption('life') + this.getOption('showDelay') : this.getOption('life'); - this.hideTimeout = setTimeout(() => { - this.hide(); - }, duration); + if (this.getOption('life')) { + let duration = this.getOption('showDelay') ? this.getOption('life') + this.getOption('showDelay') : this.getOption('life'); + this.hideTimeout = setTimeout(() => { + this.hide(); + }, duration); + } } + this.interactionInProgress = true; } deactivate() { + this.interactionInProgress = false; this.active = false; this.clearShowTimeout(); From fd1ed3c650ad411dc086fe288eff5f0c491a7ffb Mon Sep 17 00:00:00 2001 From: Marc Schmidt Date: Tue, 2 Jul 2024 16:24:22 +0200 Subject: [PATCH 05/12] fix(splitter): minSizes not working as expected Closes: #15943 --- src/app/components/splitter/splitter.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/components/splitter/splitter.ts b/src/app/components/splitter/splitter.ts index 2f81b158534..9a8eb9ac3c2 100755 --- a/src/app/components/splitter/splitter.ts +++ b/src/app/components/splitter/splitter.ts @@ -394,11 +394,13 @@ export class Splitter { } validateResize(newPrevPanelSize: number, newNextPanelSize: number) { - if (this.minSizes.length >= 1 && this.minSizes[0] && this.minSizes[0] > newPrevPanelSize) { + const prevPanelIndex = this.prevPanelIndex; + if (this.minSizes.length > prevPanelIndex && this.minSizes[prevPanelIndex] && this.minSizes[prevPanelIndex] > newPrevPanelSize) { return false; } - if (this.minSizes.length > 1 && this.minSizes[1] && this.minSizes[1] > newNextPanelSize) { + const nextPanelIndex = this.prevPanelIndex + 1; + if (this.minSizes.length > nextPanelIndex && this.minSizes[nextPanelIndex] && this.minSizes[nextPanelIndex] > newNextPanelSize) { return false; } From 8cee8092fdf0fe81d1d579581c2858216c56043b Mon Sep 17 00:00:00 2001 From: Marc Schmidt Date: Tue, 2 Jul 2024 16:38:00 +0200 Subject: [PATCH 06/12] fix(splitter): resize not working when iFrames are used in panels Setting `pointer-events` to none to the panels when resizing fixes this issue. Closes: #15942 --- src/app/components/splitter/splitter.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app/components/splitter/splitter.css b/src/app/components/splitter/splitter.css index c265335f1da..04406c815c2 100644 --- a/src/app/components/splitter/splitter.css +++ b/src/app/components/splitter/splitter.css @@ -62,4 +62,8 @@ width: 24px; height: 100%; } + + .p-splitter-resizing .p-splitter-panel { + pointer-events: none; + } } From 7b389a2b66427a14bb14bf2f379ab8876b9a94fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20=C3=87etin?= <92744169+mehmetcetin01140@users.noreply.github.com> Date: Wed, 3 Jul 2024 11:06:28 +0300 Subject: [PATCH 07/12] Fixed #15799 - InputNumber unneeded update model on blur --- src/app/components/inputnumber/inputnumber.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/app/components/inputnumber/inputnumber.ts b/src/app/components/inputnumber/inputnumber.ts index 7dca44d2a95..574b1389005 100644 --- a/src/app/components/inputnumber/inputnumber.ts +++ b/src/app/components/inputnumber/inputnumber.ts @@ -597,6 +597,7 @@ export class InputNumber implements OnInit, AfterContentInit, OnChanges, Control const decimalChar = this.getDecimalChar(); return new RegExp(`[${decimalChar}]`, 'g'); } + getDecimalChar(): string { const formatter = new Intl.NumberFormat(this.locale, { ...this.getOptions(), useGrouping: false }); return formatter @@ -648,6 +649,10 @@ export class InputNumber implements OnInit, AfterContentInit, OnChanges, Control return new RegExp(`${this.escapeRegExp(this.suffixChar || '')}`, 'g'); } + get isBlurUpdateOnMode() { + return this.ngControl?.control?.updateOn === 'blur'; + } + formatValue(value: any) { if (value != null) { if (value === '-') { @@ -1281,7 +1286,7 @@ export class InputNumber implements OnInit, AfterContentInit, OnChanges, Control if (this.isValueChanged(currentValue, newValue)) { (this.input as ElementRef).nativeElement.value = this.formatValue(newValue); this.input?.nativeElement.setAttribute('aria-valuenow', newValue); - this.updateModel(event, newValue); + !this.isBlurUpdateOnMode && this.updateModel(event, newValue); this.onInput.emit({ originalEvent: event, value: newValue, formattedValue: currentValue }); } } @@ -1446,16 +1451,14 @@ export class InputNumber implements OnInit, AfterContentInit, OnChanges, Control } updateModel(event: Event, value: any) { - const isBlurUpdateOnMode = this.ngControl?.control?.updateOn === 'blur'; - if (this.value !== value) { this.value = value; - if (!(isBlurUpdateOnMode && this.focused)) { + if (!(this.isBlurUpdateOnMode && this.focused)) { + this.onModelChange(value); + } else if (this.isBlurUpdateOnMode) { this.onModelChange(value); } - } else if (isBlurUpdateOnMode) { - this.onModelChange(value); } this.onModelTouched(); } From 0be881f0e692ed155e001988c33fff0294d1f987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=87etin?= <69278826+cetincakiroglu@users.noreply.github.com> Date: Wed, 3 Jul 2024 12:15:15 +0300 Subject: [PATCH 08/12] Fixes #15911 - Table | Add csp nonce to responsive style element --- src/app/components/table/table.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/components/table/table.ts b/src/app/components/table/table.ts index b15d650b46b..d2834ef206d 100644 --- a/src/app/components/table/table.ts +++ b/src/app/components/table/table.ts @@ -2988,7 +2988,8 @@ export class Table implements OnInit, AfterViewInit, AfterContentInit, Blockable this.responsiveStyleElement = this.renderer.createElement('style'); this.responsiveStyleElement.type = 'text/css'; this.renderer.appendChild(this.document.head, this.responsiveStyleElement); - + DomHandler.setAttribute(this.responsiveStyleElement, 'nonce', this.config?.csp()?.nonce); + let innerHTML = ` @media screen and (max-width: ${this.breakpoint}) { #${this.id}-table > .p-datatable-thead > tr > th, From 45d20f246d7cf465b7f4ccd869f58d03e31f3ecb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20=C3=87etin?= <92744169+mehmetcetin01140@users.noreply.github.com> Date: Wed, 3 Jul 2024 17:20:42 +0300 Subject: [PATCH 09/12] Fixed #15954 - MultiSelect | MultiSelectChangeEvent wrong select value --- src/app/components/multiselect/multiselect.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/multiselect/multiselect.ts b/src/app/components/multiselect/multiselect.ts index 73a348647d2..faeaa641bd9 100755 --- a/src/app/components/multiselect/multiselect.ts +++ b/src/app/components/multiselect/multiselect.ts @@ -1379,7 +1379,7 @@ export class MultiSelect implements OnInit, AfterViewInit, AfterContentInit, Aft isFocus && DomHandler.focus(this.focusInputViewChild?.nativeElement); this.onChange.emit({ - originalEvent: event, + originalEvent: { ...event, selected: !event.selected }, value: value, itemValue: option }); From 10281dc692037884059a04ccb0997315b1ccc68c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20=C3=87etin?= <92744169+mehmetcetin01140@users.noreply.github.com> Date: Thu, 4 Jul 2024 11:58:54 +0300 Subject: [PATCH 10/12] refactor --- src/app/components/table/table.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/components/table/table.ts b/src/app/components/table/table.ts index bfa640a8414..5c28388c42f 100644 --- a/src/app/components/table/table.ts +++ b/src/app/components/table/table.ts @@ -1849,7 +1849,7 @@ export class Table implements OnInit, AfterViewInit, AfterContentInit, Blockable } } - selectRange(event: MouseEvent | KeyboardEvent, rowIndex: number, isCtrlASelection? : boolean | undefined) { + selectRange(event: MouseEvent | KeyboardEvent, rowIndex: number, isMetaKeySelection? : boolean | undefined) { let rangeStart, rangeEnd; if (this.anchorRowIndex > rowIndex) { @@ -1871,7 +1871,7 @@ export class Table implements OnInit, AfterViewInit, AfterContentInit, Blockable let rangeRowsData = []; for (let i = rangeStart; i <= rangeEnd; i++) { let rangeRowData = this.filteredValue ? this.filteredValue[i] : this.value[i]; - if (!this.isSelected(rangeRowData) && !isCtrlASelection) { + if (!this.isSelected(rangeRowData) && !isMetaKeySelection) { if (!this.isRowSelectable(rangeRowData, rowIndex)) { continue; } From f9974c0954d484d984e955600b00eae6212e2fb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=87etin?= <69278826+cetincakiroglu@users.noreply.github.com> Date: Thu, 4 Jul 2024 12:19:46 +0300 Subject: [PATCH 11/12] refactor --- src/app/components/multiselect/multiselect.ts | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/app/components/multiselect/multiselect.ts b/src/app/components/multiselect/multiselect.ts index cb6b58d1ef8..a6cf3d381a4 100755 --- a/src/app/components/multiselect/multiselect.ts +++ b/src/app/components/multiselect/multiselect.ts @@ -195,7 +195,14 @@ export class MultiSelectItem {
{{ getLabelByValue(item) }} - + @@ -1182,15 +1189,7 @@ export class MultiSelect implements OnInit, AfterViewInit, AfterContentInit, Aft return ObjectUtils.isNotEmpty(this.maxSelectedLabels) && this.modelValue() && this.modelValue().length > this.maxSelectedLabels ? this.modelValue().slice(0, this.maxSelectedLabels) : this.modelValue(); }); - constructor( - public el: ElementRef, - public renderer: Renderer2, - public cd: ChangeDetectorRef, - public zone: NgZone, - public filterService: FilterService, - public config: PrimeNGConfig, - public overlayService: OverlayService - ) { + constructor(public el: ElementRef, public renderer: Renderer2, public cd: ChangeDetectorRef, public zone: NgZone, public filterService: FilterService, public config: PrimeNGConfig, public overlayService: OverlayService) { effect(() => { const modelValue = this.modelValue(); From e2183480f8b958116b1e207d7e3c3318e766a383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=87etin?= <69278826+cetincakiroglu@users.noreply.github.com> Date: Thu, 4 Jul 2024 14:30:24 +0300 Subject: [PATCH 12/12] Fixes #15959 - Splitter | Add missing rule --- src/app/components/splitter/splitter.css | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/components/splitter/splitter.css b/src/app/components/splitter/splitter.css index 04406c815c2..ede5c126f07 100644 --- a/src/app/components/splitter/splitter.css +++ b/src/app/components/splitter/splitter.css @@ -9,6 +9,7 @@ } .p-splitter-panel { + overflow: hidden; flex-grow: 1; }