@cuby-ui/core 0.0.106 → 0.0.107
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/components/context-menu/context-menu.component.d.ts +4 -2
- package/components/select/select.component.d.ts +4 -2
- package/esm2020/components/context-menu/context-menu.component.mjs +9 -3
- package/esm2020/components/select/select.component.mjs +7 -1
- package/fesm2015/cuby-ui-core.mjs +14 -2
- package/fesm2015/cuby-ui-core.mjs.map +1 -1
- package/fesm2020/cuby-ui-core.mjs +14 -2
- package/fesm2020/cuby-ui-core.mjs.map +1 -1
- package/package.json +3 -3
|
@@ -957,6 +957,9 @@ class CuiContextMenuComponent {
|
|
|
957
957
|
ngOnInit() {
|
|
958
958
|
this.initClickOutsideSubscription();
|
|
959
959
|
}
|
|
960
|
+
ngOnDestroy() {
|
|
961
|
+
this.clearViewContainerRef();
|
|
962
|
+
}
|
|
960
963
|
ngAfterViewInit() {
|
|
961
964
|
this.initTargetElementListener();
|
|
962
965
|
}
|
|
@@ -988,7 +991,7 @@ class CuiContextMenuComponent {
|
|
|
988
991
|
event.stopPropagation();
|
|
989
992
|
this.document.body.click();
|
|
990
993
|
this.isVisible = !this.isVisible;
|
|
991
|
-
this.
|
|
994
|
+
this.clearViewContainerRef();
|
|
992
995
|
if (this.isVisible) {
|
|
993
996
|
this.renderList();
|
|
994
997
|
this.changePosition(event.clientX, event.clientY);
|
|
@@ -1014,7 +1017,7 @@ class CuiContextMenuComponent {
|
|
|
1014
1017
|
}
|
|
1015
1018
|
close() {
|
|
1016
1019
|
this.isVisible = false;
|
|
1017
|
-
this.
|
|
1020
|
+
this.clearViewContainerRef();
|
|
1018
1021
|
}
|
|
1019
1022
|
renderList() {
|
|
1020
1023
|
const embeddedViewRef = this.viewContainerRef.createEmbeddedView(this.list);
|
|
@@ -1042,6 +1045,9 @@ class CuiContextMenuComponent {
|
|
|
1042
1045
|
this.changeDetectorRef.markForCheck();
|
|
1043
1046
|
});
|
|
1044
1047
|
}
|
|
1048
|
+
clearViewContainerRef() {
|
|
1049
|
+
this.viewContainerRef.clear();
|
|
1050
|
+
}
|
|
1045
1051
|
}
|
|
1046
1052
|
CuiContextMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiContextMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1047
1053
|
CuiContextMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CuiContextMenuComponent, selector: "cui-context-menu[items][target]", inputs: { items: "items", target: "target" }, host: { listeners: { "window:resize": "onClose()", "click": "onStopClickPropagation($event)" } }, providers: [CuiDestroyService], viewQueries: [{ propertyName: "list", first: true, predicate: ["list"], descendants: true }], hostDirectives: [{ directive: i2.CuiClickOutsideDirective }, { directive: i2.CuiTargetDirective, inputs: ["ccTarget", "target"] }], ngImport: i0, template: "<ng-template #list>\n <div class=\"c-container\">\n <ul\n *ngIf=\"isVisible\"\n class=\"c-ul\"\n >\n <li\n *ngFor=\"let item of items; trackBy: trackByFn\"\n [style.color]=\"item.color\"\n >\n <button\n type=\"button\"\n class=\"c-button\"\n (click)=\"onSelect(item)\"\n >\n <cui-svg\n *ngIf=\"item.icon\"\n [icon]=\"item.icon\"\n [color]=\"item.color\"\n ></cui-svg>\n <span>{{ item.label }}</span>\n </button>\n </li>\n </ul>\n </div>\n</ng-template>\n", styles: [":host{display:none}.c-container{position:fixed;width:268px;border-radius:8px}.c-ul{padding:7px 0;margin:0;list-style:none;font-weight:400;font-size:14px;line-height:20px;box-shadow:0 1px 4px #0000000a,0 1px 4px #0000000a;border:1px solid var(--cui-base-200);border-radius:inherit;background:var(--cui-base-0);color:var(--cui-base-900);font-family:var(--cui-main-font)}.c-button{padding:8px 11px 8px 0;border:0;flex-shrink:0;outline:none;cursor:pointer;appearance:none;color:inherit;font:inherit;background:inherit;text-decoration:none;-webkit-tap-highlight-color:transparent;padding:8px 11px;width:100%;display:flex;align-items:center;gap:12px}.c-button:active{background:var(--cui-base-50)}@media (hover: hover){.c-button:hover{background:var(--cui-base-50)}}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: CuiSvgComponent, selector: "cui-svg[icon]", inputs: ["width", "height", "strokeWidth", "color", "icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
@@ -1903,6 +1909,9 @@ class CuiSelectComponent {
|
|
|
1903
1909
|
ngOnInit() {
|
|
1904
1910
|
this.initClickOutsideSubscription();
|
|
1905
1911
|
}
|
|
1912
|
+
ngOnDestroy() {
|
|
1913
|
+
this.clearViewContainerRef();
|
|
1914
|
+
}
|
|
1906
1915
|
setDisabledState(isDisabled) {
|
|
1907
1916
|
this.isDisabled = isDisabled;
|
|
1908
1917
|
this.changeDetectorRef.markForCheck();
|
|
@@ -1966,6 +1975,9 @@ class CuiSelectComponent {
|
|
|
1966
1975
|
}
|
|
1967
1976
|
close() {
|
|
1968
1977
|
this.isOpened = false;
|
|
1978
|
+
this.clearViewContainerRef();
|
|
1979
|
+
}
|
|
1980
|
+
clearViewContainerRef() {
|
|
1969
1981
|
this.viewContainerRef.clear();
|
|
1970
1982
|
}
|
|
1971
1983
|
}
|