diff --git a/package-lock.json b/package-lock.json index b01a1def2c7..e4dd459de7a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "primeng", - "version": "17.18.10", + "version": "17.18.11", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "primeng", - "version": "17.18.10", + "version": "17.18.11", "license": "SEE LICENSE IN LICENSE.md", "devDependencies": { "@angular-devkit/build-angular": "^18.0.2", @@ -43,9 +43,9 @@ "esbuild": "^0.19.8", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", - "eslint-plugin-import": "*", - "eslint-plugin-jsdoc": "*", - "eslint-plugin-prefer-arrow": "*", + "eslint-plugin-import": "latest", + "eslint-plugin-jsdoc": "latest", + "eslint-plugin-prefer-arrow": "latest", "express": "^4.20.0", "file-saver": "^2.0.5", "gulp": "^5.0.0", diff --git a/src/app/components/autocomplete/autocomplete.ts b/src/app/components/autocomplete/autocomplete.ts index 7423f62461e..276b39b60cd 100755 --- a/src/app/components/autocomplete/autocomplete.ts +++ b/src/app/components/autocomplete/autocomplete.ts @@ -1,4 +1,4 @@ -import { animate, AnimationEvent, style, transition, trigger } from '@angular/animations'; +import { AnimationEvent } from '@angular/animations'; import { CommonModule, DOCUMENT } from '@angular/common'; import { AfterContentInit, @@ -28,7 +28,7 @@ import { ViewEncapsulation } from '@angular/core'; import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; -import { OverlayOptions, OverlayService, PrimeNGConfig, PrimeTemplate, SharedModule, TranslationKeys } from 'primeng/api'; +import { OverlayOptions, OverlayService, PrimeNGConfig, PrimeTemplate, ScrollerOptions, SharedModule, TranslationKeys } from 'primeng/api'; import { AutoFocusModule } from 'primeng/autofocus'; import { ButtonModule } from 'primeng/button'; import { ConnectedOverlayScrollHandler, DomHandler } from 'primeng/dom'; @@ -36,13 +36,12 @@ import { InputTextModule } from 'primeng/inputtext'; import { Overlay, OverlayModule } from 'primeng/overlay'; import { RippleModule } from 'primeng/ripple'; import { Scroller, ScrollerModule } from 'primeng/scroller'; -import { ScrollerOptions } from 'primeng/api'; import { ObjectUtils, UniqueComponentId } from 'primeng/utils'; import { TimesCircleIcon } from 'primeng/icons/timescircle'; import { SpinnerIcon } from 'primeng/icons/spinner'; import { TimesIcon } from 'primeng/icons/times'; import { ChevronDownIcon } from 'primeng/icons/chevrondown'; -import { Nullable, VoidListener } from 'primeng/ts-helpers'; +import { Nullable } from 'primeng/ts-helpers'; import { AutoCompleteCompleteEvent, AutoCompleteDropdownClickEvent, AutoCompleteLazyLoadEvent, AutoCompleteSelectEvent, AutoCompleteUnselectEvent } from './autocomplete.interface'; export const AUTOCOMPLETE_VALUE_ACCESSOR: any = { @@ -880,13 +879,19 @@ export class AutoComplete implements AfterViewChecked, AfterContentInit, OnDestr return typeof this.modelValue() === 'string' && this.optionValue; } - get isVisibleClearIcon(): boolean | undefined { return this.modelValue() != null && this.hasSelectedOption() && this.showClear && !this.disabled && !this.loading; } - constructor(@Inject(DOCUMENT) private document: Document, public el: ElementRef, public renderer: Renderer2, public cd: ChangeDetectorRef, public config: PrimeNGConfig, public overlayService: OverlayService, private zone: NgZone) { - + constructor( + @Inject(DOCUMENT) private document: Document, + public el: ElementRef, + public renderer: Renderer2, + public cd: ChangeDetectorRef, + public config: PrimeNGConfig, + public overlayService: OverlayService, + private zone: NgZone + ) { effect(() => { this.filled = ObjectUtils.isNotEmpty(this.modelValue()); }); diff --git a/src/app/components/calendar/calendar.ts b/src/app/components/calendar/calendar.ts index d3a5185c037..c68f731ab8a 100644 --- a/src/app/components/calendar/calendar.ts +++ b/src/app/components/calendar/calendar.ts @@ -37,7 +37,7 @@ import { ChevronDownIcon } from 'primeng/icons/chevrondown'; import { TimesIcon } from 'primeng/icons/times'; import { CalendarIcon } from 'primeng/icons/calendar'; import { Nullable, VoidListener } from 'primeng/ts-helpers'; -import { NavigationState, CalendarResponsiveOptions, CalendarTypeView, LocaleSettings, Month, CalendarMonthChangeEvent, CalendarYearChangeEvent } from './calendar.interface'; +import { CalendarMonthChangeEvent, CalendarResponsiveOptions, CalendarTypeView, CalendarYearChangeEvent, LocaleSettings, Month, NavigationState } from './calendar.interface'; import { AutoFocusModule } from 'primeng/autofocus'; export const CALENDAR_VALUE_ACCESSOR: any = { @@ -1847,7 +1847,7 @@ export class Calendar implements OnInit, OnDestroy, ControlValueAccessor { if (!this.isComparable()) return false; if (this.isMultipleSelection()) return false; - let value = this.isRangeSelection() ? this.value[0] : this.value; + let value = this.isRangeSelection() ? this.value[0] : this.value; return value ? value.getFullYear() === year : false; } diff --git a/src/app/components/panel/panel.ts b/src/app/components/panel/panel.ts index 10197ef6382..7f60238688f 100755 --- a/src/app/components/panel/panel.ts +++ b/src/app/components/panel/panel.ts @@ -1,6 +1,22 @@ import { animate, state, style, transition, trigger } from '@angular/animations'; import { CommonModule } from '@angular/common'; -import { AfterContentInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChild, ContentChildren, ElementRef, EventEmitter, Input, NgModule, Output, QueryList, TemplateRef, ViewEncapsulation, booleanAttribute } from '@angular/core'; +import { + AfterContentInit, + booleanAttribute, + ChangeDetectionStrategy, + ChangeDetectorRef, + Component, + ContentChild, + ContentChildren, + ElementRef, + EventEmitter, + Input, + NgModule, + Output, + QueryList, + TemplateRef, + ViewEncapsulation, +} from '@angular/core'; import { BlockableUI, Footer, PrimeTemplate, SharedModule } from 'primeng/api'; import { MinusIcon } from 'primeng/icons/minus'; import { PlusIcon } from 'primeng/icons/plus'; @@ -211,7 +227,10 @@ export class Panel implements AfterContentInit, BlockableUI { return this.header; } - constructor(private el: ElementRef, private cd: ChangeDetectorRef) {} + constructor( + private el: ElementRef, + private cd: ChangeDetectorRef + ) {} ngAfterContentInit() { (this.templates as QueryList).forEach((item) => { diff --git a/src/app/components/scroller/scroller.ts b/src/app/components/scroller/scroller.ts index f8af62927bd..8e57fb18b83 100644 --- a/src/app/components/scroller/scroller.ts +++ b/src/app/components/scroller/scroller.ts @@ -21,13 +21,19 @@ import { SimpleChanges, TemplateRef, ViewChild, - ViewEncapsulation + ViewEncapsulation, } from '@angular/core'; import { PrimeTemplate, ScrollerOptions, SharedModule } from 'primeng/api'; import { DomHandler } from 'primeng/dom'; import { SpinnerIcon } from 'primeng/icons/spinner'; -import { Nullable, VoidListener } from 'primeng/ts-helpers'; -import { ScrollerLazyLoadEvent, ScrollerScrollEvent, ScrollerScrollIndexChangeEvent, ScrollerToType } from './scroller.interface'; +import { Nullable } from 'primeng/ts-helpers'; +import { + ScrollerLazyLoadEvent, + ScrollerScrollEvent, + ScrollerScrollIndexChangeEvent, + ScrollerToType, +} from './scroller.interface'; + /** * Scroller is a performance-approach to handle huge data efficiently. * @group Components @@ -874,14 +880,13 @@ export class Scroller implements OnInit, AfterContentInit, AfterViewChecked, OnD setSpacerSize() { if (this._items) { - const setProp = (_name, _count, _size) => (this.spacerStyle = { ...this.spacerStyle, ...{[`${_name}`]: _count * _size + 'px' }}); + const setProp = (_name, _count, _size) => (this.spacerStyle = { ...this.spacerStyle, ...{ [`${_name}`]: _count * _size + 'px' } }); const numItems = this._items.length; if (this.both) { setProp('height', numItems, this._itemSize[0]); setProp('width', this._columns?.length || this._items[1]?.length, this._itemSize[1]); - } - else { + } else { this.horizontal ? setProp('width', this._columns.length || this._items.length, this._itemSize) : setProp('height', numItems, this._itemSize); } } diff --git a/src/app/components/tree/tree.spec.ts b/src/app/components/tree/tree.spec.ts index be2535abc17..8e996a6a142 100755 --- a/src/app/components/tree/tree.spec.ts +++ b/src/app/components/tree/tree.spec.ts @@ -1,10 +1,10 @@ -import { TestBed, ComponentFixture } from '@angular/core/testing'; +import { ComponentFixture, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { Tree, UITreeNode } from './tree'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ContextMenu, ContextMenuSub } from 'primeng/contextmenu'; import { RouterTestingModule } from '@angular/router/testing'; -import { Component, ElementRef, ViewChild, OnInit, NO_ERRORS_SCHEMA } from '@angular/core'; +import { Component, ElementRef, NO_ERRORS_SCHEMA, OnInit, ViewChild } from '@angular/core'; import { ContextMenuService, TreeDragDropService } from 'primeng/api'; @Component({ @@ -195,7 +195,12 @@ describe('Tree', () => { data: 'De Niro Movies', children: [ { label: 'Goodfellas', icon: 'pi pi-file-video-o', data: 'Goodfellas Movie' }, - { label: 'Untouchables', icon: 'pi pi-file-video-o', data: 'Untouchables Movie', selectable: false } + { + label: 'Untouchables', + icon: 'pi pi-file-video-o', + data: 'Untouchables Movie', + selectable: false + } ] } ] diff --git a/src/app/components/tree/tree.ts b/src/app/components/tree/tree.ts index be0d8d8a099..10e38b64700 100755 --- a/src/app/components/tree/tree.ts +++ b/src/app/components/tree/tree.ts @@ -24,11 +24,10 @@ import { ViewChild, ViewEncapsulation } from '@angular/core'; -import { BlockableUI, PrimeNGConfig, PrimeTemplate, SharedModule, TranslationKeys, TreeDragDropService, TreeNode } from 'primeng/api'; +import { BlockableUI, PrimeNGConfig, PrimeTemplate, ScrollerOptions, SharedModule, TranslationKeys, TreeDragDropService, TreeNode } from 'primeng/api'; import { DomHandler } from 'primeng/dom'; import { RippleModule } from 'primeng/ripple'; import { Scroller, ScrollerModule } from 'primeng/scroller'; -import { ScrollerOptions } from 'primeng/api'; import { ObjectUtils } from 'primeng/utils'; import { Subscription } from 'rxjs'; import { CheckIcon } from 'primeng/icons/check'; @@ -1542,20 +1541,20 @@ export class Tree implements OnInit, AfterContentInit, OnChanges, OnDestroy, Blo } } } - + filterUnselectableChildren(node: TreeNode): TreeNode { - let clonedNode = Object.assign({}, node); - - if (clonedNode.children && clonedNode.children.length) { - for (let child of clonedNode.children) { - if (child.selectable === false) { - clonedNode.children = clonedNode.children.filter((val: TreeNode) => val != child); - } - child = this.filterUnselectableChildren(child); + let clonedNode = Object.assign({}, node); + + if (clonedNode.children && clonedNode.children.length) { + for (let child of clonedNode.children) { + if (child.selectable === false) { + clonedNode.children = clonedNode.children.filter((val: TreeNode) => val != child); + } + child = this.filterUnselectableChildren(child); + } } - } - return clonedNode; + return clonedNode; } isSelected(node: TreeNode) { diff --git a/src/app/showcase/doc/autocomplete/objectsdoc.ts b/src/app/showcase/doc/autocomplete/objectsdoc.ts index f8fbcf2dee9..311280fdffc 100644 --- a/src/app/showcase/doc/autocomplete/objectsdoc.ts +++ b/src/app/showcase/doc/autocomplete/objectsdoc.ts @@ -11,8 +11,8 @@ interface AutoCompleteCompleteEvent { selector: 'autocomplete-objects-demo', template: `

- AutoComplete can also work with objects using the optionLabel property that defines the label to display as a suggestion. The value passed to the model would still be the object instance of a suggestion. Here is an example with a - Country object that has name and code fields such as {name: "United States", code:"USA"}. + AutoComplete can also work with objects using the optionLabel property that defines the label to display as a suggestion. The value passed to the model would still be the object instance of a suggestion. Here is an example with + a Country object that has name and code fields such as {name: "United States", code:"USA"}.

diff --git a/src/app/showcase/doc/autocomplete/showclear-doc.component.ts b/src/app/showcase/doc/autocomplete/showclear-doc.component.ts index 217201f2ff6..b0e74ba96ba 100644 --- a/src/app/showcase/doc/autocomplete/showclear-doc.component.ts +++ b/src/app/showcase/doc/autocomplete/showclear-doc.component.ts @@ -25,12 +25,16 @@ export class ShowClearDoc implements OnInit { countries: any[] | undefined; countryFormGroup: FormGroup = this.formBuilder.group({ - 'country': [{ name: 'Switzerland', code: 'CH' }] + country: [{ name: 'Switzerland', code: 'CH' }] }); filteredCountries: any[] | undefined; - constructor(private countryService: CountryService, private PlatformService: PlatformService, private formBuilder: FormBuilder) {} + constructor( + private countryService: CountryService, + private PlatformService: PlatformService, + private formBuilder: FormBuilder + ) {} ngOnInit() { if (this.PlatformService.isBrowser()) { diff --git a/src/app/showcase/pages/templates/atlantis/atlantis.ts b/src/app/showcase/pages/templates/atlantis/atlantis.ts index d1092e497c4..f8747bb71d4 100644 --- a/src/app/showcase/pages/templates/atlantis/atlantis.ts +++ b/src/app/showcase/pages/templates/atlantis/atlantis.ts @@ -9,6 +9,7 @@ import { TemplateSeparatorModule } from 'src/app/showcase/layout/templates/templ import { TemplateYoutubeModule } from 'src/app/showcase/layout/templates/templateyoutube'; import { AtlantisLogo } from './atlantislogo'; import { AtlantisSeparator } from './atlantisseparator'; + @Component({ standalone: true, selector: 'atlantis-page', @@ -202,7 +203,7 @@ export class AtlantisPage { { title: 'Basic License', price: '$59', - included: ['Non Commercial Usage', 'Single End Product, No Multi-Use', '1 Year Free Updates'], + included: ['Non Commercial Usage', 'Single End Product, No Multi-Use', '1 Year Free Updates'] }, { title: 'Extended License',