Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/primefaces/primeng
Browse files Browse the repository at this point in the history
  • Loading branch information
cetincakiroglu committed Jun 12, 2023
1 parent cd6bb1b commit 95c60cc
Show file tree
Hide file tree
Showing 37 changed files with 173 additions and 152 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@
- Checkbox in p-treeNode always checked when using custom icon [\#12951](https://github.com/primefaces/primeng/issues/12951)
- ConfirmDialog: Duplicated AcceptIcons [\#13001](https://github.com/primefaces/primeng/issues/13001)

## ![LTS](https://www.primefaces.org/wp-content/uploads/2020/01/lts-icon-24.png "PrimeNG LTS") [15.4.4-LTS](https://www.npmjs.com/package/primeng/v/15.4.4-lts) (2023-05-29)

**Fixed bugs:**
- Panel: Custom expand Icon is never showing [\#13074](https://github.com/primefaces/primeng/issues/13074)
- Improve LicenseManager structure

## ![LTS](https://www.primefaces.org/wp-content/uploads/2020/01/lts-icon-24.png "PrimeNG LTS") [15.4.3-LTS](https://www.npmjs.com/package/primeng/v/15.4.3-lts) (2023-05-18)

**Fixed bugs:**
Expand Down Expand Up @@ -251,6 +257,13 @@
- Sidebar: Footer Templating [\#12259](https://github.com/primefaces/primeng/issues/12259)
- Calendar: Day names don't update [\#12148](https://github.com/primefaces/primeng/issues/12148)

## ![LTS](https://www.primefaces.org/wp-content/uploads/2020/01/lts-icon-24.png "PrimeNG LTS") [14.2.8-LTS](https://www.npmjs.com/package/primeng/v/14.2.8-lts) (2023-05-30)

**Fixed bugs:**
- VirtualScroller | fails to initalize correctly inside tabView [\#12542](https://github.com/primefaces/primeng/issues/12542)
- Menubar: Overflow Problem [\#12549](https://github.com/primefaces/primeng/issues/12549)
- Reimplement LicenseManager structure

## ![LTS](https://www.primefaces.org/wp-content/uploads/2020/01/lts-icon-24.png "PrimeNG LTS") [14.2.7-LTS](https://www.npmjs.com/package/primeng/v/14.2.7-lts) (2023-05-18)

**Fixed bugs:**
Expand Down
2 changes: 1 addition & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,4 @@
}
}
}
}
}
6 changes: 3 additions & 3 deletions src/app/components/api/contextmenuservice.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable } from '@angular/core';
import { Subject } from 'rxjs';
import { Nullable } from 'primeng/ts-helpers';
import { Subject } from 'rxjs';

@Injectable()
export class ContextMenuService {
Expand All @@ -12,11 +12,11 @@ export class ContextMenuService {

changeKey(key: string) {
this.activeItemKey = key;
this.activeItemKeyChange.next(this.activeItemKey!);
this.activeItemKeyChange.next(this.activeItemKey as string);
}

reset() {
this.activeItemKey = null;
this.activeItemKeyChange.next(this.activeItemKey!);
this.activeItemKeyChange.next(this.activeItemKey as any);
}
}
4 changes: 2 additions & 2 deletions src/app/components/badge/badge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class BadgeDirective implements AfterViewInit, OnDestroy {
this._value = val;

if (this.initialized) {
let badge = document.getElementById(this.id);
let badge: HTMLElement = document.getElementById(this.id) as HTMLElement;

if (this._value) {
if (DomHandler.hasClass(badge, 'p-badge-dot')) DomHandler.removeClass(badge, 'p-badge-dot');
Expand All @@ -66,7 +66,7 @@ export class BadgeDirective implements AfterViewInit, OnDestroy {
DomHandler.addClass(badge, 'p-badge-dot');
}

badge!.innerHTML = '';
badge.innerHTML = '';
this.renderer.appendChild(badge, document.createTextNode(this._value));
}
}
Expand Down
1 change: 1 addition & 0 deletions src/app/components/button/button.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

.p-button:disabled {
cursor: default;
pointer-events: none;
}

.p-button-icon-only {
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/button/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class ButtonDirective implements AfterViewInit, OnDestroy {
* @group Props
*/
@Input() get label(): string {
return this._label!;
return this._label as string;
}
set label(val: string) {
this._label = val;
Expand All @@ -55,7 +55,7 @@ export class ButtonDirective implements AfterViewInit, OnDestroy {
* @group Props
*/
@Input() get icon(): string {
return this._icon!;
return this._icon as string;
}
set icon(val: string) {
this._icon = val;
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/carousel/carousel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export class Carousel implements AfterContentInit {
* @group Props
*/
@Input() get value(): any[] {
return this._value!;
return this._value as any[];
}
set value(val) {
this._value = val;
Expand Down Expand Up @@ -436,7 +436,7 @@ export class Carousel implements AfterContentInit {
this._oldNumScroll = this._numScroll;
this.prevState.numScroll = this._numScroll;
this.prevState.numVisible = this._numVisible;
this.prevState.value = [...this._value!];
this.prevState.value = [...(this._value as any[])];

if (this.totalDots() > 0 && this.itemsContainer.nativeElement) {
this.itemsContainer.nativeElement.style.transform = this.isVertical() ? `translate3d(0, ${totalShiftedItems * (100 / this._numVisible)}%, 0)` : `translate3d(${totalShiftedItems * (100 / this._numVisible)}%, 0, 0)`;
Expand Down
10 changes: 5 additions & 5 deletions src/app/components/confirmdialog/confirmdialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ import { DomHandler } from 'primeng/dom';
import { CheckIcon } from 'primeng/icons/check';
import { TimesIcon } from 'primeng/icons/times';
import { RippleModule } from 'primeng/ripple';
import { Nullable } from 'primeng/ts-helpers';
import { UniqueComponentId, ZIndexUtils } from 'primeng/utils';
import { Subscription } from 'rxjs';
import { Nullable } from 'primeng/ts-helpers';

const showAnimation = animation([style({ transform: '{{transform}}', opacity: 0 }), animate('{{transition}}', style({ transform: 'none', opacity: 1 }))]);

Expand Down Expand Up @@ -501,7 +501,7 @@ export class ConfirmDialog implements AfterContentInit, OnInit, OnDestroy {

appendContainer() {
if (this.appendTo) {
if (this.appendTo === 'body') this.document.body.appendChild(this.wrapper!);
if (this.appendTo === 'body') this.document.body.appendChild(this.wrapper as HTMLElement);
else DomHandler.appendChild(this.wrapper, this.appendTo);
}
}
Expand Down Expand Up @@ -581,7 +581,7 @@ export class ConfirmDialog implements AfterContentInit, OnInit, OnDestroy {
moveOnTop() {
if (this.autoZIndex) {
ZIndexUtils.set('modal', this.container, this.baseZIndex + this.config.zIndex.modal);
this.wrapper!.style.zIndex = String(parseInt(this.container!.style.zIndex, 10) - 1);
(<HTMLElement>this.wrapper).style.zIndex = String(parseInt((<HTMLDivElement>this.container).style.zIndex, 10) - 1);
}
}

Expand All @@ -604,15 +604,15 @@ export class ConfirmDialog implements AfterContentInit, OnInit, OnDestroy {

this.documentEscapeListener = this.renderer.listen(documentTarget, 'keydown', (event) => {
if (event.which == 27 && this.option('closeOnEscape') && this.closable) {
if (parseInt(this.container!.style.zIndex) === ZIndexUtils.get(this.container) && this.visible) {
if (parseInt((this.container as HTMLDivElement).style.zIndex) === ZIndexUtils.get(this.container) && this.visible) {
this.close(event);
}
}

if (event.which === 9 && this.focusTrap) {
event.preventDefault();

let focusableElements = DomHandler.getFocusableElements(this.container!);
let focusableElements = DomHandler.getFocusableElements(this.container as HTMLDivElement);

if (focusableElements && focusableElements.length > 0) {
if (!focusableElements[0].ownerDocument.activeElement) {
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/confirmpopup/confirmpopup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { AfterContentInit, ChangeDetectionStrategy, ChangeDetectorRef, Component
import { Confirmation, ConfirmationService, OverlayService, PrimeNGConfig, PrimeTemplate, SharedModule, TranslationKeys } from 'primeng/api';
import { ButtonModule } from 'primeng/button';
import { ConnectedOverlayScrollHandler, DomHandler } from 'primeng/dom';
import { Nullable, VoidListener } from 'primeng/ts-helpers';
import { ZIndexUtils } from 'primeng/utils';
import { Subscription } from 'rxjs';
import { Nullable, VoidListener } from 'primeng/ts-helpers';

@Component({
selector: 'p-confirmPopup',
Expand Down Expand Up @@ -253,7 +253,7 @@ export class ConfirmPopup implements AfterContentInit, OnDestroy {
if (containerOffset.left < targetOffset.left) {
arrowLeft = targetOffset.left - containerOffset.left;
}
this.container!.style.setProperty('--overlayArrowLeft', `${arrowLeft}px`);
(this.container as HTMLDivElement).style.setProperty('--overlayArrowLeft', `${arrowLeft}px`);

if (containerOffset.top < targetOffset.top) {
DomHandler.addClass(this.container, 'p-confirm-popup-flipped');
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/contextmenu/contextmenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ import { DomHandler } from 'primeng/dom';
import { AngleRightIcon } from 'primeng/icons/angleright';
import { RippleModule } from 'primeng/ripple';
import { TooltipModule } from 'primeng/tooltip';
import { Nullable, VoidListener } from 'primeng/ts-helpers';
import { ZIndexUtils } from 'primeng/utils';
import { Subject, Subscription } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { Nullable, VoidListener } from 'primeng/ts-helpers';

@Component({
selector: 'p-contextMenuSub',
Expand Down Expand Up @@ -649,7 +649,7 @@ export class ContextMenu implements AfterViewInit, OnDestroy {

let indexes = key.split('_');
return indexes.reduce((item: any, currentIndex: any) => {
return item ? item.items[currentIndex] : this.model![currentIndex];
return item ? item.items[currentIndex] : (this.model as MenuItem[])[currentIndex];
}, null);
}

Expand Down
50 changes: 25 additions & 25 deletions src/app/components/dialog/dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ import { TimesIcon } from 'primeng/icons/times';
import { WindowMaximizeIcon } from 'primeng/icons/windowmaximize';
import { WindowMinimizeIcon } from 'primeng/icons/windowminimize';
import { RippleModule } from 'primeng/ripple';
import { UniqueComponentId, ZIndexUtils } from 'primeng/utils';
import { Nullable, VoidListener } from 'primeng/ts-helpers';
import { UniqueComponentId, ZIndexUtils } from 'primeng/utils';

const showAnimation = animation([style({ transform: '{{transform}}', opacity: 0 }), animate('{{transition}}')]);

Expand Down Expand Up @@ -615,7 +615,7 @@ export class Dialog implements AfterContentInit, OnInit, OnDestroy {
moveOnTop() {
if (this.autoZIndex) {
ZIndexUtils.set('modal', this.container, this.baseZIndex + this.config.zIndex.modal);
this.wrapper!.style.zIndex = String(parseInt(this.container!.style.zIndex, 10) - 1);
(this.wrapper as HTMLElement).style.zIndex = String(parseInt((this.container as HTMLDivElement).style.zIndex, 10) - 1);
}
}

Expand Down Expand Up @@ -651,7 +651,7 @@ export class Dialog implements AfterContentInit, OnInit, OnDestroy {
this.lastPageX = event.pageX;
this.lastPageY = event.pageY;

this.container!.style.margin = '0';
(this.container as HTMLDivElement).style.margin = '0';
DomHandler.addClass(this.document.body, 'p-unselectable-text');
}
}
Expand All @@ -661,7 +661,7 @@ export class Dialog implements AfterContentInit, OnInit, OnDestroy {
if (event.which === 9) {
event.preventDefault();

let focusableElements = DomHandler.getFocusableElements(this.container!);
let focusableElements = DomHandler.getFocusableElements(this.container as HTMLDivElement);

if (focusableElements && focusableElements.length > 0) {
if (!focusableElements[0].ownerDocument.activeElement) {
Expand All @@ -686,32 +686,32 @@ export class Dialog implements AfterContentInit, OnInit, OnDestroy {
if (this.dragging) {
let containerWidth = DomHandler.getOuterWidth(this.container);
let containerHeight = DomHandler.getOuterHeight(this.container);
let deltaX = event.pageX - this.lastPageX!;
let deltaY = event.pageY - this.lastPageY!;
let offset = this.container!.getBoundingClientRect();
let deltaX = event.pageX - (this.lastPageX as number);
let deltaY = event.pageY - (this.lastPageY as number);
let offset = (this.container as HTMLDivElement).getBoundingClientRect();
let leftPos = offset.left + deltaX;
let topPos = offset.top + deltaY;
let viewport = DomHandler.getViewport();

this.container!.style.position = 'fixed';
(this.container as HTMLDivElement).style.position = 'fixed';

if (this.keepInViewport) {
if (leftPos >= this.minX && leftPos + containerWidth < viewport.width) {
this._style.left = leftPos + 'px';
this.lastPageX = event.pageX;
this.container!.style.left = leftPos + 'px';
(this.container as HTMLDivElement).style.left = leftPos + 'px';
}

if (topPos >= this.minY && topPos + containerHeight < viewport.height) {
this._style.top = topPos + 'px';
this.lastPageY = event.pageY;
this.container!.style.top = topPos + 'px';
(this.container as HTMLDivElement).style.top = topPos + 'px';
}
} else {
this.lastPageX = event.pageX;
this.container!.style.left = leftPos + 'px';
(this.container as HTMLDivElement).style.left = leftPos + 'px';
this.lastPageY = event.pageY;
this.container!.style.top = topPos + 'px';
(this.container as HTMLDivElement).style.top = topPos + 'px';
}
}
}
Expand All @@ -726,10 +726,10 @@ export class Dialog implements AfterContentInit, OnInit, OnDestroy {
}

resetPosition() {
this.container!.style.position = '';
this.container!.style.left = '';
this.container!.style.top = '';
this.container!.style.margin = '';
(this.container as HTMLDivElement).style.position = '';
(this.container as HTMLDivElement).style.left = '';
(this.container as HTMLDivElement).style.top = '';
(this.container as HTMLDivElement).style.margin = '';
}

//backward compatibility
Expand All @@ -749,18 +749,18 @@ export class Dialog implements AfterContentInit, OnInit, OnDestroy {

onResize(event: MouseEvent) {
if (this.resizing) {
let deltaX = event.pageX - this.lastPageX!;
let deltaY = event.pageY - this.lastPageY!;
let deltaX = event.pageX - (this.lastPageX as number);
let deltaY = event.pageY - (this.lastPageY as number);
let containerWidth = DomHandler.getOuterWidth(this.container);
let containerHeight = DomHandler.getOuterHeight(this.container);
let contentHeight = DomHandler.getOuterHeight(this.contentViewChild?.nativeElement);
let newWidth = containerWidth + deltaX;
let newHeight = containerHeight + deltaY;
let minWidth = this.container!.style.minWidth;
let minHeight = this.container!.style.minHeight;
let offset = this.container!.getBoundingClientRect();
let minWidth = (this.container as HTMLDivElement).style.minWidth;
let minHeight = (this.container as HTMLDivElement).style.minHeight;
let offset = (this.container as HTMLDivElement).getBoundingClientRect();
let viewport = DomHandler.getViewport();
let hasBeenDragged = !parseInt(this.container!.style.top) || !parseInt(this.container!.style.left);
let hasBeenDragged = !parseInt((this.container as HTMLDivElement).style.top) || !parseInt((this.container as HTMLDivElement).style.left);

if (hasBeenDragged) {
newWidth += deltaX;
Expand All @@ -769,15 +769,15 @@ export class Dialog implements AfterContentInit, OnInit, OnDestroy {

if ((!minWidth || newWidth > parseInt(minWidth)) && offset.left + newWidth < viewport.width) {
this._style.width = newWidth + 'px';
this.container!.style.width = this._style.width;
(this.container as HTMLDivElement).style.width = this._style.width;
}

if ((!minHeight || newHeight > parseInt(minHeight)) && offset.top + newHeight < viewport.height) {
this.contentViewChild!.nativeElement.style.height = contentHeight + newHeight - containerHeight + 'px';
(<ElementRef>this.contentViewChild).nativeElement.style.height = contentHeight + newHeight - containerHeight + 'px';

if (this._style.height) {
this._style.height = newHeight + 'px';
this.container!.style.height = this._style.height;
(this.container as HTMLDivElement).style.height = this._style.height;
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/app/components/dragdrop/dragdrop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ export class Draggable implements AfterViewInit, OnDestroy {
dragStart(event: DragEvent) {
if (this.allowDrag() && !this.pDraggableDisabled) {
if (this.dragEffect) {
event.dataTransfer!.effectAllowed = this.dragEffect;
(event.dataTransfer as DataTransfer).effectAllowed = this.dragEffect;
}
event.dataTransfer!.setData('text', this.scope!);
(event.dataTransfer as DataTransfer).setData('text', this.scope!);

this.onDragStart.emit(event);

Expand Down Expand Up @@ -233,7 +233,7 @@ export class Droppable implements AfterViewInit, OnDestroy {
event.preventDefault();

if (this.dropEffect) {
event.dataTransfer!.dropEffect = this.dropEffect;
(event.dataTransfer as DataTransfer).dropEffect = this.dropEffect;
}

DomHandler.addClass(this.el.nativeElement, 'p-draggable-enter');
Expand All @@ -249,7 +249,7 @@ export class Droppable implements AfterViewInit, OnDestroy {
}

allowDrop(event: DragEvent): boolean {
let dragScope = event.dataTransfer!.getData('text');
let dragScope = (event.dataTransfer as DataTransfer).getData('text');
if (typeof this.scope == 'string' && dragScope == this.scope) {
return true;
} else if (Array.isArray(this.scope)) {
Expand Down
Loading

0 comments on commit 95c60cc

Please sign in to comment.