From 6cac3f23bbf27777b17812655b69bb4870aac6d8 Mon Sep 17 00:00:00 2001 From: FlipWarthog Date: Sun, 17 Sep 2023 14:36:00 -0400 Subject: [PATCH 01/75] Add Discussions badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a28ed703142..826bc016631 100755 --- a/README.md +++ b/README.md @@ -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) +[![Prime 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/wp-content/uploads/2022/09/primeng-gh-readme.jpg)](https://primeng.org) From 7b8f140aedf3fe325edcdbc6ab3171695ccd871f Mon Sep 17 00:00:00 2001 From: Egor Volvachev Date: Sat, 23 Sep 2023 18:42:36 +0300 Subject: [PATCH 02/75] fix(primeng/pEditableColumn): update column data in runtime Fixes #13708. --- src/app/components/table/table.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/app/components/table/table.ts b/src/app/components/table/table.ts index a4114524906..7f0a66a091b 100644 --- a/src/app/components/table/table.ts +++ b/src/app/components/table/table.ts @@ -3926,7 +3926,7 @@ export class ReorderableColumn implements AfterViewInit, OnDestroy { class: 'p-element' } }) -export class EditableColumn implements AfterViewInit, OnDestroy { +export class EditableColumn implements OnChanges, AfterViewInit, OnDestroy { @Input('pEditableColumn') data: any; @Input('pEditableColumnField') field: any; @@ -3941,6 +3941,12 @@ export class EditableColumn implements AfterViewInit, OnDestroy { constructor(public dt: Table, public el: ElementRef, public zone: NgZone) {} + public ngOnChanges({ data }: SimpleChanges): void { + if (this.el.nativeElement && !data.firstChange) { + this.dt.updateEditingCell(this.el.nativeElement, this.data, this.field, this.rowIndex); + } + } + ngAfterViewInit() { if (this.isEnabled()) { DomHandler.addClass(this.el.nativeElement, 'p-editable-column'); From a9dc071a239d390e83cbab2bc34e16d0bfa8d461 Mon Sep 17 00:00:00 2001 From: Balaji Sridharan Date: Sun, 24 Sep 2023 18:57:21 +0530 Subject: [PATCH 03/75] Fix #13722: FileUpload click instead of mouseup --- src/app/components/fileupload/fileupload.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/fileupload/fileupload.ts b/src/app/components/fileupload/fileupload.ts index 4915f03dd72..65fc204eb4e 100755 --- a/src/app/components/fileupload/fileupload.ts +++ b/src/app/components/fileupload/fileupload.ts @@ -121,7 +121,7 @@ import { FileBeforeUploadEvent, FileProgressEvent, FileRemoveEvent, FileSelectEv [ngClass]="{ 'p-button p-component p-fileupload-choose': true, 'p-button-icon-only': !basicButtonLabel, 'p-fileupload-choose-selected': hasFiles(), 'p-focus': focus, 'p-disabled': disabled }" [ngStyle]="style" [class]="styleClass" - (mouseup)="onBasicUploaderClick()" + (click)="onBasicUploaderClick()" (keydown)="onBasicKeydown($event)" tabindex="0" pRipple From 68b627fbd5b10cad3e5e9923529b6d92aa4558bf Mon Sep 17 00:00:00 2001 From: Md Ashik Date: Tue, 12 Sep 2023 16:57:31 +0600 Subject: [PATCH 04/75] fix: #12948 || Overlay: p-overlay div not removed from DOM on hiding panel. --- src/app/components/overlay/overlay.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/components/overlay/overlay.ts b/src/app/components/overlay/overlay.ts index 1b7d7047a87..d94f3996e4d 100644 --- a/src/app/components/overlay/overlay.ts +++ b/src/app/components/overlay/overlay.ts @@ -3,6 +3,7 @@ import { CommonModule, DOCUMENT, isPlatformBrowser } from '@angular/common'; import { AfterContentInit, ChangeDetectionStrategy, + ChangeDetectorRef, Component, ContentChildren, ElementRef, @@ -65,7 +66,7 @@ const hideOverlayContentAnimation = animation([animate('{{hideTransitionParams}} 'p-overlay-right-start': modal && overlayResponsiveDirection === 'right-start', 'p-overlay-right-end': modal && overlayResponsiveDirection === 'right-end' }" - (click)="onOverlayClick($event)" + (click)="onOverlayClick()" >
Date: Sat, 30 Sep 2023 09:57:38 +0200 Subject: [PATCH 05/75] Fixed #13784 - Fixed toast ngClass with SSR and Hydration --- src/app/components/toast/toast.interface.ts | 5 +++- src/app/components/toast/toast.ts | 26 +++++++++++++++++---- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/app/components/toast/toast.interface.ts b/src/app/components/toast/toast.interface.ts index 3c01b9eac73..b73f8ebebe0 100644 --- a/src/app/components/toast/toast.interface.ts +++ b/src/app/components/toast/toast.interface.ts @@ -1,6 +1,5 @@ import { TemplateRef } from '@angular/core'; import { Message } from 'primeng/api'; -import { Toast } from './toast'; /** * Defines valid templates in Toast. @@ -17,6 +16,7 @@ export interface ToastTemplates { $implicit: any; }): TemplateRef<{ $implicit: any }>; } + /** * Custom close event. * @see {@link Toast.onClose} @@ -28,6 +28,7 @@ export interface ToastCloseEvent { */ message: Message; } + /** * Custom close event. * @see {@link ToastItem.onClose} @@ -38,3 +39,5 @@ export interface ToastItemCloseEvent extends ToastCloseEvent { */ index: number; } + +export type ToastPositionType = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' | 'center'; diff --git a/src/app/components/toast/toast.ts b/src/app/components/toast/toast.ts index 842bec2f66d..167b033439b 100755 --- a/src/app/components/toast/toast.ts +++ b/src/app/components/toast/toast.ts @@ -31,7 +31,7 @@ import { TimesCircleIcon } from 'primeng/icons/timescircle'; import { RippleModule } from 'primeng/ripple'; import { ObjectUtils, UniqueComponentId, ZIndexUtils } from 'primeng/utils'; import { Subscription } from 'rxjs'; -import { ToastCloseEvent, ToastItemCloseEvent } from './toast.interface'; +import { ToastCloseEvent, ToastItemCloseEvent, ToastPositionType } from './toast.interface'; @Component({ selector: 'p-toastItem', @@ -92,7 +92,13 @@ import { ToastCloseEvent, ToastItemCloseEvent } from './toast.interface'; opacity: 1 }) ), - transition('void => *', [style({ transform: '{{showTransformParams}}', opacity: 0 }), animate('{{showTransitionParams}}')]), + transition('void => *', [ + style({ + transform: '{{showTransformParams}}', + opacity: 0 + }), + animate('{{showTransitionParams}}') + ]), transition('* => void', [ animate( '{{hideTransitionParams}}', @@ -183,6 +189,7 @@ export class ToastItem implements AfterViewInit, OnDestroy { this.clearTimeout(); } } + /** * Toast is used to display messages in an overlay. * @group Components @@ -190,7 +197,7 @@ export class ToastItem implements AfterViewInit, OnDestroy { @Component({ selector: 'p-toast', template: ` -
+
| undefined; + _position: ToastPositionType = 'top-right'; + constructor(@Inject(DOCUMENT) private document: Document, private renderer: Renderer2, public messageService: MessageService, private cd: ChangeDetectorRef, public config: PrimeNGConfig) {} styleElement: any; From 7f8b13da95269a13f9d56f15c4e06acff1803da1 Mon Sep 17 00:00:00 2001 From: aleprex99 <58468712+aleprex99@users.noreply.github.com> Date: Thu, 12 Oct 2023 10:08:52 +0200 Subject: [PATCH 06/75] Issue #13856 / Dialog: bad drag behavior when keepInViewport is false Fixes #13856 --- src/app/components/dialog/dialog.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/components/dialog/dialog.ts b/src/app/components/dialog/dialog.ts index 285a62a972a..7da32e26b51 100755 --- a/src/app/components/dialog/dialog.ts +++ b/src/app/components/dialog/dialog.ts @@ -737,7 +737,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`; } } } @@ -1016,4 +1016,4 @@ export class Dialog implements AfterContentInit, OnInit, OnDestroy { exports: [Dialog, SharedModule], declarations: [Dialog] }) -export class DialogModule {} \ No newline at end of file +export class DialogModule {} From f69e615de552f54b671fa4a42759548126fc26bd Mon Sep 17 00:00:00 2001 From: maruthumj Date: Thu, 26 Oct 2023 10:08:39 +0530 Subject: [PATCH 07/75] onHide event emitter change --- src/app/components/sidebar/sidebar.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/app/components/sidebar/sidebar.ts b/src/app/components/sidebar/sidebar.ts index 9c81e51711c..86eb3f94211 100755 --- a/src/app/components/sidebar/sidebar.ts +++ b/src/app/components/sidebar/sidebar.ts @@ -12,10 +12,12 @@ import { Inject, Input, NgModule, + OnChanges, OnDestroy, Output, QueryList, Renderer2, + SimpleChanges, TemplateRef, ViewEncapsulation } from '@angular/core'; @@ -95,7 +97,7 @@ const hideAnimation = animation([animate('{{transition}}', style({ transform: '{ class: 'p-element' } }) -export class Sidebar implements AfterViewInit, AfterContentInit, OnDestroy { +export class Sidebar implements AfterViewInit, AfterContentInit, OnDestroy, OnChanges { /** * Target element to attach the dialog, valid values are "body" or a local ng-template variable of another element (note: use binding with brackets for template variables, e.g. [appendTo]="mydiv" for a div element having #mydiv as variable name). * @group Props @@ -256,6 +258,17 @@ export class Sidebar implements AfterViewInit, AfterContentInit, OnDestroy { this.initialized = true; } + ngOnChanges(changes: SimpleChanges): void { + if(changes.visible){ + if(!changes.visible.firstChange){ + if(changes.visible.currentValue === false){ + this.hide(); + } + } + } + } + + ngAfterContentInit() { this.templates?.forEach((item) => { switch (item.getType()) { From 0eb9dfbc2672426a7b5de79c9afa966bc94898c6 Mon Sep 17 00:00:00 2001 From: Diego Franchina Date: Sun, 29 Oct 2023 22:53:33 +0100 Subject: [PATCH 08/75] fixed tristatecheckbox and added cursor pointer --- .../tristatecheckbox/tristatecheckbox.css | 5 +++++ .../tristatecheckbox/tristatecheckbox.ts | 15 ++++++++------- src/app/showcase/doc/tristatecheckbox/basicdoc.ts | 6 +++--- .../doc/tristatecheckbox/reactiveformsdoc.ts | 6 +++--- 4 files changed, 19 insertions(+), 13 deletions(-) create mode 100644 src/app/components/tristatecheckbox/tristatecheckbox.css diff --git a/src/app/components/tristatecheckbox/tristatecheckbox.css b/src/app/components/tristatecheckbox/tristatecheckbox.css new file mode 100644 index 00000000000..11d05e8bd90 --- /dev/null +++ b/src/app/components/tristatecheckbox/tristatecheckbox.css @@ -0,0 +1,5 @@ +@layer primeng { + .p-tristatecheckbox-label { + cursor: pointer; + } +} diff --git a/src/app/components/tristatecheckbox/tristatecheckbox.ts b/src/app/components/tristatecheckbox/tristatecheckbox.ts index 26d1e0cb2e4..23ed54a66f7 100755 --- a/src/app/components/tristatecheckbox/tristatecheckbox.ts +++ b/src/app/components/tristatecheckbox/tristatecheckbox.ts @@ -19,7 +19,7 @@ export const TRISTATECHECKBOX_VALUE_ACCESSOR: any = { @Component({ selector: 'p-triStateCheckbox', template: ` -
+
- - + `, providers: [TRISTATECHECKBOX_VALUE_ACCESSOR], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, + styleUrls: ['./tristatecheckbox.css'], host: { class: 'p-element' } }) export class TriStateCheckbox implements ControlValueAccessor { - constructor(private cd: ChangeDetectorRef) {} + constructor(private cd: ChangeDetectorRef) { } /** * When present, it specifies that the element should be disabled. * @group Props @@ -141,9 +142,9 @@ export class TriStateCheckbox implements ControlValueAccessor { value: Nullable; - onModelChange: Function = () => {}; + onModelChange: Function = () => { }; - onModelTouched: Function = () => {}; + onModelTouched: Function = () => { }; onClick(event: Event, input: HTMLInputElement) { if (!this.disabled && !this.readonly) { @@ -225,4 +226,4 @@ export class TriStateCheckbox implements ControlValueAccessor { exports: [TriStateCheckbox, SharedModule], declarations: [TriStateCheckbox] }) -export class TriStateCheckboxModule {} +export class TriStateCheckboxModule { } diff --git a/src/app/showcase/doc/tristatecheckbox/basicdoc.ts b/src/app/showcase/doc/tristatecheckbox/basicdoc.ts index e366a891bd1..f76cb44852f 100644 --- a/src/app/showcase/doc/tristatecheckbox/basicdoc.ts +++ b/src/app/showcase/doc/tristatecheckbox/basicdoc.ts @@ -9,7 +9,7 @@ import { Code } from '../../domain/code';
- +
` @@ -23,12 +23,12 @@ export class BasicDoc { code: Code = { basic: ` -`, +`, html: `
- +
`, typescript: ` diff --git a/src/app/showcase/doc/tristatecheckbox/reactiveformsdoc.ts b/src/app/showcase/doc/tristatecheckbox/reactiveformsdoc.ts index 5e75a3ddece..2b0c8262c75 100644 --- a/src/app/showcase/doc/tristatecheckbox/reactiveformsdoc.ts +++ b/src/app/showcase/doc/tristatecheckbox/reactiveformsdoc.ts @@ -11,7 +11,7 @@ import { Code } from '../../domain/code';
- +
@@ -34,14 +34,14 @@ export class ReactiveFormsDoc implements OnInit { basic: `
- +
`, html: `
- +
`, From a946b5f7841e6752eac0aff8d651c80e35010787 Mon Sep 17 00:00:00 2001 From: Diego Franchina Date: Sun, 29 Oct 2023 22:54:01 +0100 Subject: [PATCH 09/75] Formatted code --- src/app/components/accordion/accordion.ts | 2 +- .../components/tristatecheckbox/tristatecheckbox.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/components/accordion/accordion.ts b/src/app/components/accordion/accordion.ts index eb1f4677344..f11af7c0759 100755 --- a/src/app/components/accordion/accordion.ts +++ b/src/app/components/accordion/accordion.ts @@ -422,7 +422,7 @@ export class Accordion implements BlockableUI, AfterContentInit, OnDestroy { */ @Output() activeIndexChange: EventEmitter = new EventEmitter(); - @ContentChildren(AccordionTab, {descendants: true}) tabList: QueryList | undefined; + @ContentChildren(AccordionTab, { descendants: true }) tabList: QueryList | undefined; tabListSubscription: Subscription | null = null; diff --git a/src/app/components/tristatecheckbox/tristatecheckbox.ts b/src/app/components/tristatecheckbox/tristatecheckbox.ts index 23ed54a66f7..92c0eb5d425 100755 --- a/src/app/components/tristatecheckbox/tristatecheckbox.ts +++ b/src/app/components/tristatecheckbox/tristatecheckbox.ts @@ -19,7 +19,7 @@ export const TRISTATECHECKBOX_VALUE_ACCESSOR: any = { @Component({ selector: 'p-triStateCheckbox', template: ` -
+
; - onModelChange: Function = () => { }; + onModelChange: Function = () => {}; - onModelTouched: Function = () => { }; + onModelTouched: Function = () => {}; onClick(event: Event, input: HTMLInputElement) { if (!this.disabled && !this.readonly) { @@ -226,4 +226,4 @@ export class TriStateCheckbox implements ControlValueAccessor { exports: [TriStateCheckbox, SharedModule], declarations: [TriStateCheckbox] }) -export class TriStateCheckboxModule { } +export class TriStateCheckboxModule {} From 8705e65ee03d35b54b311e0c1527b76458adff9d Mon Sep 17 00:00:00 2001 From: Diego Franchina Date: Mon, 30 Oct 2023 20:45:14 +0100 Subject: [PATCH 10/75] hide menu on click in default button --- src/app/components/splitbutton/splitbutton.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/components/splitbutton/splitbutton.ts b/src/app/components/splitbutton/splitbutton.ts index c61ab96146b..08d7bd86ce6 100755 --- a/src/app/components/splitbutton/splitbutton.ts +++ b/src/app/components/splitbutton/splitbutton.ts @@ -218,6 +218,7 @@ export class SplitButton { onDefaultButtonClick(event: MouseEvent) { this.onClick.emit(event); + this.menu.hide(); } onDropdownButtonClick(event?: MouseEvent) { From 5556a36975d4e6c7fdb18f21dc236b716472ea46 Mon Sep 17 00:00:00 2001 From: Diego Franchina Date: Mon, 30 Oct 2023 20:45:29 +0100 Subject: [PATCH 11/75] Formatted code --- src/app/components/accordion/accordion.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/accordion/accordion.ts b/src/app/components/accordion/accordion.ts index eb1f4677344..f11af7c0759 100755 --- a/src/app/components/accordion/accordion.ts +++ b/src/app/components/accordion/accordion.ts @@ -422,7 +422,7 @@ export class Accordion implements BlockableUI, AfterContentInit, OnDestroy { */ @Output() activeIndexChange: EventEmitter = new EventEmitter(); - @ContentChildren(AccordionTab, {descendants: true}) tabList: QueryList | undefined; + @ContentChildren(AccordionTab, { descendants: true }) tabList: QueryList | undefined; tabListSubscription: Subscription | null = null; From bda1625b7384f60340c407b839cb7fe8b84fe758 Mon Sep 17 00:00:00 2001 From: Kevin <94969394+leykee@users.noreply.github.com> Date: Thu, 2 Nov 2023 15:56:39 +0100 Subject: [PATCH 12/75] fix(p-image-preview-indicator): only show image-preview-indicator when preview is true --- src/app/components/image/image.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/image/image.ts b/src/app/components/image/image.ts index 225844f734e..a73d12d53af 100755 --- a/src/app/components/image/image.ts +++ b/src/app/components/image/image.ts @@ -23,7 +23,7 @@ import { FocusTrapModule } from 'primeng/focustrap'; template: ` -