cps-ui-kit 0.93.0 → 0.95.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/components/cps-autocomplete/cps-autocomplete.component.mjs +5 -3
- package/esm2020/lib/components/cps-menu/cps-menu.component.mjs +10 -2
- package/esm2020/lib/components/cps-tree-autocomplete/cps-tree-autocomplete.component.mjs +5 -3
- package/fesm2015/cps-ui-kit.mjs +17 -5
- package/fesm2015/cps-ui-kit.mjs.map +1 -1
- package/fesm2020/cps-ui-kit.mjs +17 -5
- package/fesm2020/cps-ui-kit.mjs.map +1 -1
- package/lib/components/cps-menu/cps-menu.component.d.ts +1 -0
- package/package.json +1 -1
package/fesm2020/cps-ui-kit.mjs
CHANGED
|
@@ -1151,6 +1151,11 @@ class CpsMenuComponent {
|
|
|
1151
1151
|
}
|
|
1152
1152
|
}
|
|
1153
1153
|
align() {
|
|
1154
|
+
if (!this.target.isConnected) {
|
|
1155
|
+
this.hide();
|
|
1156
|
+
this._destroy();
|
|
1157
|
+
return;
|
|
1158
|
+
}
|
|
1154
1159
|
if (this.autoZIndex) {
|
|
1155
1160
|
ZIndexUtils.set('overlay', this.container, this.baseZIndex + this.config.zIndex.overlay);
|
|
1156
1161
|
}
|
|
@@ -1285,7 +1290,7 @@ class CpsMenuComponent {
|
|
|
1285
1290
|
this.unbindDocumentResizeListener();
|
|
1286
1291
|
this.unbindScrollListener();
|
|
1287
1292
|
}
|
|
1288
|
-
|
|
1293
|
+
_destroy() {
|
|
1289
1294
|
if (this.scrollHandler) {
|
|
1290
1295
|
this.scrollHandler.destroy();
|
|
1291
1296
|
this.scrollHandler = null;
|
|
@@ -1304,6 +1309,9 @@ class CpsMenuComponent {
|
|
|
1304
1309
|
this.overlaySubscription?.unsubscribe();
|
|
1305
1310
|
this.targetResizeObserver?.disconnect();
|
|
1306
1311
|
}
|
|
1312
|
+
ngOnDestroy() {
|
|
1313
|
+
this._destroy();
|
|
1314
|
+
}
|
|
1307
1315
|
}
|
|
1308
1316
|
CpsMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CpsMenuComponent, deps: [{ token: DOCUMENT }, { token: PLATFORM_ID }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: i4.PrimeNGConfig }, { token: i4.OverlayService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1309
1317
|
CpsMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: CpsMenuComponent, isStandalone: true, selector: "cps-menu", inputs: { header: "header", items: "items", withArrow: "withArrow", compressed: "compressed", focusOnShow: "focusOnShow", persistent: "persistent", containerClass: "containerClass", showTransitionOptions: "showTransitionOptions", hideTransitionOptions: "hideTransitionOptions" }, outputs: { menuShown: "menuShown", menuHidden: "menuHidden", beforeMenuHidden: "beforeMenuHidden", contentClicked: "contentClicked" }, ngImport: i0, template: "<div\n *ngIf=\"render\"\n class=\"cps-menu-container\"\n [ngClass]=\"{ 'cps-menu-no-arrow': !withArrow }\"\n [class]=\"containerClass\"\n (mousedown)=\"onOverlayClick($event)\"\n [@animation]=\"{\n value: overlayVisible ? 'open' : 'close',\n params: {\n showTransitionParams: showTransitionOptions,\n hideTransitionParams: hideTransitionOptions\n }\n }\"\n (@animation.start)=\"onAnimationStart($event)\"\n (@animation.done)=\"onAnimationEnd($event)\">\n <div (mousedown)=\"onContentClick()\" (touchstart)=\"onContentClick()\">\n <ng-container *ngIf=\"items.length < 1\">\n <ng-content></ng-content>\n </ng-container>\n <div\n *ngIf=\"items.length > 0\"\n class=\"cps-menu-content\"\n [ngClass]=\"{ 'cps-menu-content-compressed': compressed }\">\n <div *ngIf=\"header && !compressed\" class=\"cps-menu-header\">\n {{ header }}\n </div>\n\n <ng-container *ngFor=\"let item of items; let i = index\">\n <a\n *ngIf=\"!item.url\"\n (click)=\"onItemClick($event, item)\"\n [ngClass]=\"itemsClasses[i]\">\n <ng-container\n *ngTemplateOutlet=\"\n itemTemplate;\n context: {\n item: item\n }\n \"></ng-container>\n </a>\n <a\n *ngIf=\"item.url && item.url.startsWith('/')\"\n (click)=\"onItemClick($event, item)\"\n [routerLink]=\"item.url\"\n [target]=\"item.target\"\n [ngClass]=\"itemsClasses[i]\">\n <ng-container\n *ngTemplateOutlet=\"\n itemTemplate;\n context: {\n item: item\n }\n \"></ng-container>\n </a>\n <a\n *ngIf=\"item.url && !item.url.startsWith('/')\"\n (click)=\"onItemClick($event, item)\"\n [href]=\"item.url\"\n [attr.target]=\"item.target\"\n [ngClass]=\"itemsClasses[i]\">\n <ng-container\n *ngTemplateOutlet=\"\n itemTemplate;\n context: {\n item: item\n }\n \"></ng-container>\n </a>\n </ng-container>\n </div>\n </div>\n</div>\n\n<ng-template #itemTemplate let-item=\"item\">\n <div class=\"cps-menu-item-icon\" *ngIf=\"withIcons\">\n <cps-icon\n *ngIf=\"item.icon\"\n [icon]=\"item.icon\"\n [color]=\"item.disabled ? 'text-light' : 'text-dark'\"\n [size]=\"compressed ? 'small' : 'normal'\"></cps-icon>\n </div>\n <div class=\"cps-menu-item-content\">\n <span class=\"cps-menu-item-content-title\">{{ item.title }}</span>\n <span *ngIf=\"item.desc && !compressed\" class=\"cps-menu-item-content-desc\">{{\n item.desc\n }}</span>\n </div>\n</ng-template>\n", styles: [".cps-menu-container{background:#ffffff;border:0 none;box-shadow:0 1px 3px #0000004d;position:absolute;margin-top:14px;top:0;left:0;font-family:Source Sans Pro,sans-serif}.cps-menu-container:not(.cps-menu-no-arrow):before{border-width:14px;margin-left:-14px;border:solid transparent;border-color:#fff0;border-bottom-color:var(--cps-color-line-light)}.cps-menu-container:not(.cps-menu-no-arrow):after,.cps-menu-container:not(.cps-menu-no-arrow):before{bottom:100%;left:var(--overlayArrowLeft, 12);content:\" \";height:0;width:0;position:absolute;pointer-events:none}.cps-menu-container .cps-menu-content{padding:.75rem}.cps-menu-container .cps-menu-content{font-family:Source Sans Pro,sans-serif;display:flex;flex-direction:column;-webkit-user-select:none;user-select:none}.cps-menu-container .cps-menu-content .cps-menu-header{display:flex;align-items:center;min-height:50px;padding-bottom:8px;font-weight:600;color:var(--cps-color-text-dark);cursor:default}.cps-menu-container .cps-menu-content .cps-menu-item{text-decoration:unset;display:flex;align-items:center;padding:8px 48px 8px 0;border-top:1px solid rgba(0,0,0,.1215686275);cursor:pointer;min-height:58px}.cps-menu-container .cps-menu-content .cps-menu-item .cps-menu-item-icon{width:48px;align-items:center;display:flex}.cps-menu-container .cps-menu-content .cps-menu-item .cps-menu-item-icon cps-icon{margin-left:8px}.cps-menu-container .cps-menu-content .cps-menu-item .cps-menu-item-content{display:flex;flex-direction:column}.cps-menu-container .cps-menu-content .cps-menu-item .cps-menu-item-content .cps-menu-item-content-title{font-weight:600;font-size:15px;line-height:150%;color:var(--cps-color-text-dark)}.cps-menu-container .cps-menu-content .cps-menu-item .cps-menu-item-content .cps-menu-item-content-desc{font-size:12px;line-height:150%;color:var(--cps-color-text-light)}.cps-menu-container .cps-menu-content .cps-menu-item.cps-menu-item-disabled{pointer-events:none}.cps-menu-container .cps-menu-content .cps-menu-item.cps-menu-item-disabled .cps-menu-item-content .cps-menu-item-content-title{color:var(--cps-color-text-light)}.cps-menu-container .cps-menu-content .cps-menu-item.cps-menu-item-disabled .cps-menu-item-content .cps-menu-item-content-desc{color:var(--cps-color-text-lightest)}.cps-menu-container .cps-menu-content .cps-menu-item:not(.cps-menu-item-disabled):hover{background:#f8f4f5}.cps-menu-container .cps-menu-content .cps-menu-item:not(.cps-menu-item-disabled):hover .cps-menu-item-content .cps-menu-item-content-title{color:var(--cps-color-calm)}.cps-menu-container .cps-menu-content .cps-menu-item:not(.cps-menu-item-disabled):hover .cps-menu-item-content .cps-menu-item-content-desc{color:var(--cps-color-text-mild)}.cps-menu-container .cps-menu-content .cps-menu-item:not(.cps-menu-item-disabled):not(.cps-menu-item-compressed):hover .cps-menu-item-icon cps-icon i{color:var(--cps-color-calm)!important}.cps-menu-container .cps-menu-content .cps-menu-item:not(.cps-menu-item-disabled):active{background:#f1eaec}.cps-menu-container .cps-menu-content .cps-menu-item.cps-menu-item-first{border-top:none}.cps-menu-container .cps-menu-content.cps-menu-content-compressed{padding:0}.cps-menu-container .cps-menu-content.cps-menu-content-compressed .cps-menu-item{padding:0 16px;min-height:40px}.cps-menu-container .cps-menu-content.cps-menu-content-compressed .cps-menu-item .cps-menu-item-icon{width:36px}.cps-menu-container .cps-menu-content.cps-menu-content-compressed .cps-menu-item .cps-menu-item-content .cps-menu-item-content-title{font-weight:500}.cps-menu-container .cps-menu-content.cps-menu-content-compressed .cps-menu-item.cps-menu-item-compressed.cps-menu-item-compressed-with-icons{padding:0 26px 0 16px}.cps-menu-container .cps-menu-content.cps-menu-content-compressed .cps-menu-item:not(.cps-menu-item-disabled) .cps-menu-item-icon cps-icon i{color:var(--cps-color-prepared)!important}.cps-menu-container .cps-menu-content.cps-menu-content-compressed .cps-menu-item:not(.cps-menu-item-disabled) .cps-menu-item-content .cps-menu-item-content-title{color:var(--cps-color-prepared)}.cps-menu-container:not(.cps-menu-no-arrow):after{border-width:12px;margin-left:-12px;border:solid transparent;border-color:#fff0;border-bottom-color:#fff}.cps-menu-container-flipped{margin-top:0;margin-bottom:10px}.cps-menu-container:not(.cps-menu-no-arrow):after{border-width:12px;margin-left:-12px}.cps-menu-container:not(.cps-menu-no-arrow):before{border-width:14px;margin-left:-14px}.cps-menu-container-flipped:not(.cps-menu-no-arrow):after,.cps-menu-container-flipped:not(.cps-menu-no-arrow):before{bottom:auto;top:100%}.cps-menu-container.cps-menu-container-flipped:not(.cps-menu-no-arrow):after{border-bottom-color:transparent}.cps-menu-container.cps-menu-container-flipped:not(.cps-menu-no-arrow):before{border-bottom-color:transparent}.cps-menu-no-arrow{margin-top:0;margin-bottom:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: SharedModule }, { kind: "component", type: CpsIconComponent, selector: "cps-icon", inputs: ["icon", "size", "color"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }], animations: [
|
|
@@ -2532,8 +2540,10 @@ class CpsAutocompleteComponent {
|
|
|
2532
2540
|
onBoxClick() {
|
|
2533
2541
|
if (!this.multiple) {
|
|
2534
2542
|
this.activeSingle = true;
|
|
2535
|
-
this.inputText
|
|
2536
|
-
|
|
2543
|
+
if (!this.inputText)
|
|
2544
|
+
this.inputText = this._getValueLabel();
|
|
2545
|
+
if (!this.isOpened)
|
|
2546
|
+
this.filteredOptions = this.options;
|
|
2537
2547
|
}
|
|
2538
2548
|
this.focus();
|
|
2539
2549
|
this._dehighlightOption();
|
|
@@ -2937,8 +2947,10 @@ class CpsTreeAutocompleteComponent extends BaseTreeDropdownComponent {
|
|
|
2937
2947
|
onBoxClick() {
|
|
2938
2948
|
if (!this.multiple) {
|
|
2939
2949
|
this.activeSingle = true;
|
|
2940
|
-
this.inputText
|
|
2941
|
-
|
|
2950
|
+
if (!this.inputText)
|
|
2951
|
+
this.inputText = this._getValueLabel();
|
|
2952
|
+
if (!this.isOpened)
|
|
2953
|
+
this.treeList.resetFilter();
|
|
2942
2954
|
}
|
|
2943
2955
|
this.focus();
|
|
2944
2956
|
this.optionFocused = false;
|