From e4c7792adea004e62f18011ac05b056972a5a8af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=87etin?= <69278826+cetincakiroglu@users.noreply.github.com> Date: Thu, 4 Jan 2024 18:05:36 +0300 Subject: [PATCH 1/4] Update changelog & set new version --- CHANGELOG.md | 27 +++++++++++++++---- package-lock.json | 4 +-- package.json | 2 +- src/app/components/package.json | 2 +- src/app/showcase/data/versions.json | 2 +- .../layout/doc/codeeditor/templates.ts | 2 +- 6 files changed, 28 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f5d62a453a1..85c9391cbc3 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,22 @@ # Changelog +## [17.3.1](https://github.com/primefaces/primeng/tree/17.3.1) (2024-01-04) + +[Full Changelog](https://github.com/primefaces/primeng/compare/17.3.0...17.3.1) + +**Fixed bugs:** +- Table: Multiple selection with SHIFT/click does not work together with paginator and lazy loading [\#14140](https://github.com/primefaces/primeng/issues/14140) +- Toast | Close callback is not exposed in headless. [\#14483](https://github.com/primefaces/primeng/issues/14483) +- Exporting p-table with non exportable columns may lead in unecessary ending csvSeparator [\#14248](https://github.com/primefaces/primeng/issues/14248) +- Error loading dropdown menu after performing a filter on the field programmatically[\#14432](https://github.com/primefaces/primeng/issues/14432) +- Component: Tree checkbox disabled css not working [\#14251](https://github.com/primefaces/primeng/issues/14251) +- Dropdown | Component selects first option on tab press [\#14473](https://github.com/primefaces/primeng/issues/14473) +- Component: Sidebar. Cannot close sidebar programmatically [\#14450](https://github.com/primefaces/primeng/issues/14450) +- MegaMenu | Error: Cannot read properties of undefined [\#14476](https://github.com/primefaces/primeng/issues/14476) + ## [17.3.0](https://github.com/primefaces/primeng/tree/17.3.0) (2023-12-28) [Full Changelog](https://github.com/primefaces/primeng/compare/17.2.0...17.3.0) + **Breaking Changes:** - Dropdown | Deprecate autoDisplayFirst property [\#14426](https://github.com/primefaces/primeng/issues/14426) @@ -338,12 +353,18 @@ - 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.3](https://github.com/primefaces/primeng/tree/16.4.3) (2024-01-04) + +[Full Changelog](https://github.com/primefaces/primeng/compare/16.4.2...16.4.3) + +**Fixed bugs:** +- ContextMenu | Touch Device support[\#14375](https://github.com/primefaces/primeng/issues/14375) + ## [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) @@ -352,7 +373,6 @@ [Full Changelog](https://github.com/primefaces/primeng/compare/16.4.0...16.4.1) **Fixed bugs:** - - Menu Components | id property of menuItem API is ignored [\#13763](https://github.com/primefaces/primeng/issues/13763) - ESLint Error [\#13764](https://github.com/primefaces/primeng/issues/13764) - Table: Incorrect behavior when a column is both sortable and filterable, and user clicks on a certain part of the filter icon [\#13361](https://github.com/primefaces/primeng/issues/13361) @@ -365,7 +385,6 @@ [Full Changelog](https://github.com/primefaces/primeng/compare/16.3.1...16.4.0) **Implemented New Features and Enhancements:** - - Theme updates: change :focus to focus-visible [\#13740](https://github.com/primefaces/primeng/issues/13740) - New @layer implementation [\#13737](https://github.com/primefaces/primeng/issues/13737) - dynamic dialog module (same instances on top of each other) and update deprecated methods [\#13617](https://github.com/primefaces/primeng/issues/13617) @@ -379,7 +398,6 @@ - Add GTAG Manager [\#13626](https://github.com/primefaces/primeng/issues/13626) **Fixed bugs:** - - TreeSelect: Close Button icon not centred [\#13750](https://github.com/primefaces/primeng/issues/13750) - PrimeNG 16.1.0 selecting a menu option causes panel to scroll [\#13390](https://github.com/primefaces/primeng/issues/13390) - p-tabPanel does not detect changes when "headerStyle", "headerStyleClass" binding is changed [\#13746](https://github.com/primefaces/primeng/issues/13746) @@ -418,7 +436,6 @@ [Full Changelog](https://github.com/primefaces/primeng/compare/16.3.0...16.3.1) **Fixed bugs:** - - PrimeNG build is not working [\#13581](https://github.com/primefaces/primeng/issues/13581) ## [16.3.0](https://github.com/primefaces/primeng/tree/16.3.0) (2023-08-30) diff --git a/package-lock.json b/package-lock.json index 3f8d0861731..ac539b67e6f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "primeng", - "version": "17.0.0", + "version": "17.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "primeng", - "version": "17.0.0", + "version": "17.3.0", "license": "SEE LICENSE IN LICENSE.md", "devDependencies": { "@angular-devkit/build-angular": "^17.0.5", diff --git a/package.json b/package.json index ac5d14f14fe..49f4c74faf5 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "primeng", - "version": "17.3.0", + "version": "17.3.1", "license": "SEE LICENSE IN LICENSE.md", "scripts": { "ng": "ng", diff --git a/src/app/components/package.json b/src/app/components/package.json index 772f2339ca4..d3c47dc029b 100644 --- a/src/app/components/package.json +++ b/src/app/components/package.json @@ -1,6 +1,6 @@ { "name": "primeng", - "version": "17.3.0", + "version": "17.3.1", "repository": { "type": "git", "url": "https://github.com/primefaces/primeng" diff --git a/src/app/showcase/data/versions.json b/src/app/showcase/data/versions.json index a5965bd9d55..399fc31ea47 100644 --- a/src/app/showcase/data/versions.json +++ b/src/app/showcase/data/versions.json @@ -1,6 +1,6 @@ [ { - "version": "v17.3.0", + "version": "v17.3.1", "name": "v17", "url": "https://primeng.org" }, diff --git a/src/app/showcase/layout/doc/codeeditor/templates.ts b/src/app/showcase/layout/doc/codeeditor/templates.ts index 980ef8ea85d..2a312a8f90f 100644 --- a/src/app/showcase/layout/doc/codeeditor/templates.ts +++ b/src/app/showcase/layout/doc/codeeditor/templates.ts @@ -15,7 +15,7 @@ export interface Props { const app_dependencies = pkg ? pkg.devDependencies : {}; const PrimeNG = { - version: '17.3.0', + version: '17.3.1', description: 'PrimeNG is an open source UI library for Angular featuring a rich set of 80+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with PrimeBlock, which has 370+ ready to use UI blocks to build spectacular applications in no time.' }; From ae51553361ec7ad5189f272125f8047a7546c0e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=87etin?= <69278826+cetincakiroglu@users.noreply.github.com> Date: Thu, 4 Jan 2024 18:11:55 +0300 Subject: [PATCH 2/4] Code format --- src/app/components/treetable/treetable.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/treetable/treetable.ts b/src/app/components/treetable/treetable.ts index 5b122fb8f95..83274adde6c 100755 --- a/src/app/components/treetable/treetable.ts +++ b/src/app/components/treetable/treetable.ts @@ -1968,7 +1968,7 @@ export class TreeTable implements AfterContentInit, OnInit, OnDestroy, Blockable this.totalRecords = this.filteredNodes ? this.filteredNodes.length : this.value ? this.value.length : 0; } } - this.cd.markForCheck() + this.cd.markForCheck(); } this.first = 0; From d091bed67b689906028e6208009e3dd06f147f08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=87etin?= <69278826+cetincakiroglu@users.noreply.github.com> Date: Thu, 4 Jan 2024 18:13:31 +0300 Subject: [PATCH 3/4] Remove type --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 49f4c74faf5..4ac77f125ca 100755 --- a/package.json +++ b/package.json @@ -22,7 +22,6 @@ "type": "git", "url": "https://github.com/primefaces/primeng.git" }, - "type": "module", "devDependencies": { "@angular-devkit/build-angular": "^17.0.5", "@angular-eslint/eslint-plugin": "17.1.1", From 357d6366b426c0c2a0f5b3e667f61aa2aec1ab68 Mon Sep 17 00:00:00 2001 From: mertsincan Date: Fri, 5 Jan 2024 01:08:04 +0000 Subject: [PATCH 4/4] Fixed #14488 - Table Virtual Scroll with Fixed Columns and Lazy Loading Causes Erratic Scrolling and Incomplete Data Display --- src/app/components/scroller/scroller.ts | 22 +++++++++---------- src/app/components/table/table.ts | 29 ++++++++++--------------- 2 files changed, 23 insertions(+), 28 deletions(-) diff --git a/src/app/components/scroller/scroller.ts b/src/app/components/scroller/scroller.ts index a1f80ca1f8d..ec1b33bcb18 100644 --- a/src/app/components/scroller/scroller.ts +++ b/src/app/components/scroller/scroller.ts @@ -504,10 +504,6 @@ export class Scroller implements OnInit, AfterContentInit, AfterViewChecked, OnD return this._columns; } - get isPageChanged() { - return this._step ? this.page !== this.getPageByFirst() : true; - } - constructor(@Inject(DOCUMENT) private document: Document, @Inject(PLATFORM_ID) private platformId: any, private renderer: Renderer2, private cd: ChangeDetectorRef, private zone: NgZone) {} ngOnInit() { @@ -653,8 +649,12 @@ export class Scroller implements OnInit, AfterContentInit, AfterViewChecked, OnD return this.elementViewChild; } - getPageByFirst() { - return Math.floor((this.first + this.d_numToleratedItems * 4) / (this._step || 1)); + getPageByFirst(first?: any) { + return Math.floor(((first ?? this.first) + this.d_numToleratedItems * 4) / (this._step || 1)); + } + + isPageChanged(first?: any) { + return this._step ? this.page !== this.getPageByFirst(first ?? this.first) : true; } scrollTo(options: ScrollToOptions) { @@ -977,10 +977,10 @@ export class Scroller implements OnInit, AfterContentInit, AfterViewChecked, OnD this.handleEvents('onScrollIndexChange', newState); - if (this._lazy && this.isPageChanged) { + if (this._lazy && this.isPageChanged(first)) { const lazyLoadState = { - first: this._step ? Math.min(this.getPageByFirst() * this._step, (this.items).length - this._step) : first, - last: Math.min(this._step ? (this.getPageByFirst() + 1) * this._step : last, (this.items).length) + first: this._step ? Math.min(this.getPageByFirst(first) * this._step, (this.items).length - this._step) : first, + last: Math.min(this._step ? (this.getPageByFirst(first) + 1) * this._step : last, (this.items).length) }; const isLazyStateChanged = this.lazyLoadState.first !== lazyLoadState.first || this.lazyLoadState.last !== lazyLoadState.last; @@ -993,14 +993,14 @@ export class Scroller implements OnInit, AfterContentInit, AfterViewChecked, OnD onContainerScroll(event: Event) { this.handleEvents('onScroll', { originalEvent: event }); - if (this._delay && this.isPageChanged) { + if (this._delay && this.isPageChanged()) { if (this.scrollTimeout) { clearTimeout(this.scrollTimeout); } if (!this.d_loading && this.showLoader) { const { isRangeChanged } = this.onScrollPositionChange(event); - const changed = isRangeChanged || (this._step ? this.isPageChanged : false); + const changed = isRangeChanged || (this._step ? this.isPageChanged() : false); if (changed) { this.d_loading = true; diff --git a/src/app/components/table/table.ts b/src/app/components/table/table.ts index d6929fe08a6..2ede18e55d5 100644 --- a/src/app/components/table/table.ts +++ b/src/app/components/table/table.ts @@ -1,16 +1,13 @@ import { animate, AnimationEvent, style, transition, trigger } from '@angular/animations'; import { CommonModule, DOCUMENT, isPlatformBrowser } from '@angular/common'; import { - AfterContentChecked, AfterContentInit, - AfterViewChecked, AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChildren, Directive, - DoCheck, ElementRef, EventEmitter, HostListener, @@ -33,28 +30,29 @@ import { ViewEncapsulation } from '@angular/core'; import { FormsModule } from '@angular/forms'; -import { BlockableUI, FilterMatchMode, FilterMetadata, FilterOperator, FilterService, LazyLoadMeta, OverlayService, PrimeNGConfig, PrimeTemplate, SelectItem, SharedModule, SortMeta, TableState, TranslationKeys } from 'primeng/api'; +import { BlockableUI, FilterMatchMode, FilterMetadata, FilterOperator, FilterService, LazyLoadMeta, OverlayService, PrimeNGConfig, PrimeTemplate, ScrollerOptions, SelectItem, SharedModule, SortMeta, TableState, TranslationKeys } from 'primeng/api'; import { ButtonModule } from 'primeng/button'; import { CalendarModule } from 'primeng/calendar'; import { ConnectedOverlayScrollHandler, DomHandler } from 'primeng/dom'; import { DropdownModule } from 'primeng/dropdown'; -import { InputNumberModule } from 'primeng/inputnumber'; -import { InputTextModule } from 'primeng/inputtext'; -import { PaginatorModule } from 'primeng/paginator'; -import { Scroller, ScrollerModule } from 'primeng/scroller'; -import { ScrollerOptions } from 'primeng/api'; -import { SelectButtonModule } from 'primeng/selectbutton'; -import { TriStateCheckboxModule } from 'primeng/tristatecheckbox'; -import { ObjectUtils, UniqueComponentId, ZIndexUtils } from 'primeng/utils'; -import { Subject, Subscription } from 'rxjs'; import { ArrowDownIcon } from 'primeng/icons/arrowdown'; import { ArrowUpIcon } from 'primeng/icons/arrowup'; import { CheckIcon } from 'primeng/icons/check'; import { FilterIcon } from 'primeng/icons/filter'; +import { FilterSlashIcon } from 'primeng/icons/filterslash'; import { SortAltIcon } from 'primeng/icons/sortalt'; import { SortAmountDownIcon } from 'primeng/icons/sortamountdown'; import { SortAmountUpAltIcon } from 'primeng/icons/sortamountupalt'; import { SpinnerIcon } from 'primeng/icons/spinner'; +import { InputNumberModule } from 'primeng/inputnumber'; +import { InputTextModule } from 'primeng/inputtext'; +import { PaginatorModule } from 'primeng/paginator'; +import { Scroller, ScrollerModule } from 'primeng/scroller'; +import { SelectButtonModule } from 'primeng/selectbutton'; +import { TriStateCheckboxModule } from 'primeng/tristatecheckbox'; +import { Nullable, VoidListener } from 'primeng/ts-helpers'; +import { ObjectUtils, UniqueComponentId, ZIndexUtils } from 'primeng/utils'; +import { Subject, Subscription } from 'rxjs'; import { ExportCSVOptions, TableColResizeEvent, @@ -74,9 +72,6 @@ import { TableRowUnSelectEvent, TableSelectAllChangeEvent } from './table.interface'; -import { Nullable, VoidListener } from 'primeng/ts-helpers'; -import { FilterSlashIcon } from 'primeng/icons/filterslash'; -import { platformBrowser } from '@angular/platform-browser'; @Injectable() export class TableService { @@ -3268,7 +3263,7 @@ export class FrozenColumn implements AfterViewInit { set frozen(val: boolean) { this._frozen = val; - this.updateStickyPosition(); + Promise.resolve(null).then(() => this.updateStickyPosition()); } @Input() alignFrozen: string = 'left';