cmat 0.0.87 → 0.0.88
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/fesm2022/cmat-components-adapter.mjs +9 -9
- package/fesm2022/cmat-components-adapter.mjs.map +1 -1
- package/fesm2022/cmat-components-breadcrumb.mjs +98 -80
- package/fesm2022/cmat-components-breadcrumb.mjs.map +1 -1
- package/fesm2022/cmat-components-card.mjs +26 -34
- package/fesm2022/cmat-components-card.mjs.map +1 -1
- package/fesm2022/cmat-components-carousel.mjs +467 -556
- package/fesm2022/cmat-components-carousel.mjs.map +1 -1
- package/fesm2022/cmat-components-cascade.mjs +270 -259
- package/fesm2022/cmat-components-cascade.mjs.map +1 -1
- package/fesm2022/cmat-components-chip-input.mjs +200 -116
- package/fesm2022/cmat-components-chip-input.mjs.map +1 -1
- package/fesm2022/cmat-components-code-editor.mjs +85 -38
- package/fesm2022/cmat-components-code-editor.mjs.map +1 -1
- package/fesm2022/cmat-components-color-picker.mjs +841 -0
- package/fesm2022/cmat-components-color-picker.mjs.map +1 -0
- package/fesm2022/cmat-components-custom-formly.mjs +1395 -838
- package/fesm2022/cmat-components-custom-formly.mjs.map +1 -1
- package/fesm2022/cmat-components-data-picker.mjs +996 -0
- package/fesm2022/cmat-components-data-picker.mjs.map +1 -0
- package/fesm2022/cmat-components-date-range.mjs +310 -264
- package/fesm2022/cmat-components-date-range.mjs.map +1 -1
- package/fesm2022/cmat-components-date-time-display.mjs +16 -20
- package/fesm2022/cmat-components-date-time-display.mjs.map +1 -1
- package/fesm2022/cmat-components-drawer.mjs +120 -137
- package/fesm2022/cmat-components-drawer.mjs.map +1 -1
- package/fesm2022/cmat-components-empty-state.mjs +17 -24
- package/fesm2022/cmat-components-empty-state.mjs.map +1 -1
- package/fesm2022/cmat-components-file-preview.mjs +18 -24
- package/fesm2022/cmat-components-file-preview.mjs.map +1 -1
- package/fesm2022/cmat-components-filter-toolbar.mjs +30 -39
- package/fesm2022/cmat-components-filter-toolbar.mjs.map +1 -1
- package/fesm2022/cmat-components-form-actions.mjs +12 -12
- package/fesm2022/cmat-components-form-actions.mjs.map +1 -1
- package/fesm2022/cmat-components-fullscreen.mjs +10 -10
- package/fesm2022/cmat-components-fullscreen.mjs.map +1 -1
- package/fesm2022/cmat-components-highlight.mjs +48 -41
- package/fesm2022/cmat-components-highlight.mjs.map +1 -1
- package/fesm2022/cmat-components-image-viewer.mjs +104 -107
- package/fesm2022/cmat-components-image-viewer.mjs.map +1 -1
- package/fesm2022/cmat-components-inline-loading.mjs +12 -15
- package/fesm2022/cmat-components-inline-loading.mjs.map +1 -1
- package/fesm2022/cmat-components-json-editor.mjs +118 -75
- package/fesm2022/cmat-components-json-editor.mjs.map +1 -1
- package/fesm2022/cmat-components-knob-input.mjs +196 -178
- package/fesm2022/cmat-components-knob-input.mjs.map +1 -1
- package/fesm2022/cmat-components-masonry.mjs +26 -41
- package/fesm2022/cmat-components-masonry.mjs.map +1 -1
- package/fesm2022/cmat-components-material-color-picker.mjs +81 -80
- package/fesm2022/cmat-components-material-color-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-material-datetimepicker.mjs +1212 -1287
- package/fesm2022/cmat-components-material-datetimepicker.mjs.map +1 -1
- package/fesm2022/cmat-components-navigation.mjs +467 -450
- package/fesm2022/cmat-components-navigation.mjs.map +1 -1
- package/fesm2022/cmat-components-opt-input.mjs +143 -132
- package/fesm2022/cmat-components-opt-input.mjs.map +1 -1
- package/fesm2022/cmat-components-org-chart.mjs +68 -83
- package/fesm2022/cmat-components-org-chart.mjs.map +1 -1
- package/fesm2022/cmat-components-page-header.mjs +18 -24
- package/fesm2022/cmat-components-page-header.mjs.map +1 -1
- package/fesm2022/cmat-components-pagination.mjs +220 -136
- package/fesm2022/cmat-components-pagination.mjs.map +1 -1
- package/fesm2022/cmat-components-password-strength.mjs +262 -215
- package/fesm2022/cmat-components-password-strength.mjs.map +1 -1
- package/fesm2022/cmat-components-popover.mjs +227 -195
- package/fesm2022/cmat-components-popover.mjs.map +1 -1
- package/fesm2022/cmat-components-progress-bar.mjs +15 -34
- package/fesm2022/cmat-components-progress-bar.mjs.map +1 -1
- package/fesm2022/cmat-components-qrcode.mjs +95 -88
- package/fesm2022/cmat-components-qrcode.mjs.map +1 -1
- package/fesm2022/cmat-components-rating.mjs +70 -67
- package/fesm2022/cmat-components-rating.mjs.map +1 -1
- package/fesm2022/cmat-components-rich-text-editor.mjs +23 -26
- package/fesm2022/cmat-components-rich-text-editor.mjs.map +1 -1
- package/fesm2022/cmat-components-select-search.mjs +190 -159
- package/fesm2022/cmat-components-select-search.mjs.map +1 -1
- package/fesm2022/cmat-components-select-table.mjs +276 -213
- package/fesm2022/cmat-components-select-table.mjs.map +1 -1
- package/fesm2022/cmat-components-select-tree.mjs +178 -128
- package/fesm2022/cmat-components-select-tree.mjs.map +1 -1
- package/fesm2022/cmat-components-skeleton.mjs +44 -28
- package/fesm2022/cmat-components-skeleton.mjs.map +1 -1
- package/fesm2022/cmat-components-speed-dial.mjs +107 -163
- package/fesm2022/cmat-components-speed-dial.mjs.map +1 -1
- package/fesm2022/cmat-components-status-tag.mjs +29 -36
- package/fesm2022/cmat-components-status-tag.mjs.map +1 -1
- package/fesm2022/cmat-components-table-toolbar.mjs +14 -18
- package/fesm2022/cmat-components-table-toolbar.mjs.map +1 -1
- package/fesm2022/cmat-components-timeline.mjs +111 -118
- package/fesm2022/cmat-components-timeline.mjs.map +1 -1
- package/fesm2022/cmat-components-toast.mjs +65 -66
- package/fesm2022/cmat-components-toast.mjs.map +1 -1
- package/fesm2022/cmat-components-transfer-picker.mjs +130 -160
- package/fesm2022/cmat-components-transfer-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-treetable.mjs +32 -39
- package/fesm2022/cmat-components-treetable.mjs.map +1 -1
- package/fesm2022/cmat-components-upload.mjs +186 -176
- package/fesm2022/cmat-components-upload.mjs.map +1 -1
- package/fesm2022/cmat-directives-animate-on-scroll.mjs +25 -28
- package/fesm2022/cmat-directives-animate-on-scroll.mjs.map +1 -1
- package/fesm2022/cmat-directives-arrow-cursor.mjs +85 -92
- package/fesm2022/cmat-directives-arrow-cursor.mjs.map +1 -1
- package/fesm2022/cmat-directives-autofocus.mjs +3 -3
- package/fesm2022/cmat-directives-autofocus.mjs.map +1 -1
- package/fesm2022/cmat-directives-data-exporter.mjs +49 -50
- package/fesm2022/cmat-directives-data-exporter.mjs.map +1 -1
- package/fesm2022/cmat-directives-debounce.mjs +16 -19
- package/fesm2022/cmat-directives-debounce.mjs.map +1 -1
- package/fesm2022/cmat-directives-digit-only.mjs +60 -69
- package/fesm2022/cmat-directives-digit-only.mjs.map +1 -1
- package/fesm2022/cmat-directives-equal-validator.mjs +3 -3
- package/fesm2022/cmat-directives-equal-validator.mjs.map +1 -1
- package/fesm2022/cmat-directives-seamless-auto-scroll.mjs +31 -30
- package/fesm2022/cmat-directives-seamless-auto-scroll.mjs.map +1 -1
- package/fesm2022/cmat-lib-mock-api.mjs +6 -6
- package/fesm2022/cmat-lib-mock-api.mjs.map +1 -1
- package/fesm2022/cmat-pipes-bytes.mjs +3 -3
- package/fesm2022/cmat-pipes-bytes.mjs.map +1 -1
- package/fesm2022/cmat-pipes-date-format.mjs +3 -3
- package/fesm2022/cmat-pipes-date-format.mjs.map +1 -1
- package/fesm2022/cmat-pipes-find-by-key.mjs +3 -3
- package/fesm2022/cmat-pipes-find-by-key.mjs.map +1 -1
- package/fesm2022/cmat-pipes-group-by.mjs +3 -3
- package/fesm2022/cmat-pipes-group-by.mjs.map +1 -1
- package/fesm2022/cmat-pipes-keys.mjs +3 -3
- package/fesm2022/cmat-pipes-keys.mjs.map +1 -1
- package/fesm2022/cmat-pipes-secure.mjs +7 -13
- package/fesm2022/cmat-pipes-secure.mjs.map +1 -1
- package/fesm2022/cmat-pipes-uppercase.mjs +3 -3
- package/fesm2022/cmat-pipes-uppercase.mjs.map +1 -1
- package/fesm2022/cmat-services-alert.mjs +26 -27
- package/fesm2022/cmat-services-alert.mjs.map +1 -1
- package/fesm2022/cmat-services-config.mjs +14 -23
- package/fesm2022/cmat-services-config.mjs.map +1 -1
- package/fesm2022/cmat-services-confirmation.mjs +8 -8
- package/fesm2022/cmat-services-confirmation.mjs.map +1 -1
- package/fesm2022/cmat-services-data.mjs +6 -10
- package/fesm2022/cmat-services-data.mjs.map +1 -1
- package/fesm2022/cmat-services-export-as.mjs +3 -3
- package/fesm2022/cmat-services-export-as.mjs.map +1 -1
- package/fesm2022/cmat-services-loading.mjs +30 -47
- package/fesm2022/cmat-services-loading.mjs.map +1 -1
- package/fesm2022/cmat-services-local-storage.mjs +3 -3
- package/fesm2022/cmat-services-local-storage.mjs.map +1 -1
- package/fesm2022/cmat-services-media-watcher.mjs +43 -34
- package/fesm2022/cmat-services-media-watcher.mjs.map +1 -1
- package/fesm2022/cmat-services-platform.mjs +3 -3
- package/fesm2022/cmat-services-platform.mjs.map +1 -1
- package/fesm2022/cmat-services-splash-screen.mjs +3 -3
- package/fesm2022/cmat-services-splash-screen.mjs.map +1 -1
- package/fesm2022/cmat-services-title.mjs +3 -3
- package/fesm2022/cmat-services-title.mjs.map +1 -1
- package/fesm2022/cmat-services-translation.mjs +11 -11
- package/fesm2022/cmat-services-translation.mjs.map +1 -1
- package/fesm2022/cmat-services-utils.mjs +3 -3
- package/fesm2022/cmat-services-utils.mjs.map +1 -1
- package/fesm2022/cmat.mjs +9228 -7507
- package/fesm2022/cmat.mjs.map +1 -1
- package/icons/material-icons/heroicons-outline.svg +3 -0
- package/icons/material-icons/heroicons-solid.svg +3 -0
- package/package.json +10 -1
- package/styles/components/bundle.scss +21 -0
- package/styles/overrides/angular-material.scss +22 -1
- package/tailwind/plugins/theming.js +183 -183
- package/types/cmat-components-breadcrumb.d.ts +40 -37
- package/types/cmat-components-card.d.ts +11 -13
- package/types/cmat-components-carousel.d.ts +87 -113
- package/types/cmat-components-cascade.d.ts +84 -65
- package/types/cmat-components-chip-input.d.ts +29 -24
- package/types/cmat-components-code-editor.d.ts +28 -12
- package/types/cmat-components-color-picker.d.ts +236 -0
- package/types/cmat-components-custom-formly.d.ts +316 -184
- package/types/cmat-components-data-picker.d.ts +372 -0
- package/types/cmat-components-date-range.d.ts +31 -36
- package/types/cmat-components-date-time-display.d.ts +8 -8
- package/types/cmat-components-drawer.d.ts +30 -32
- package/types/cmat-components-empty-state.d.ts +9 -10
- package/types/cmat-components-file-preview.d.ts +9 -9
- package/types/cmat-components-filter-toolbar.d.ts +15 -15
- package/types/cmat-components-form-actions.d.ts +5 -5
- package/types/cmat-components-fullscreen.d.ts +5 -5
- package/types/cmat-components-highlight.d.ts +13 -14
- package/types/cmat-components-image-viewer.d.ts +29 -33
- package/types/cmat-components-inline-loading.d.ts +6 -6
- package/types/cmat-components-json-editor.d.ts +15 -17
- package/types/cmat-components-knob-input.d.ts +58 -55
- package/types/cmat-components-masonry.d.ts +9 -12
- package/types/cmat-components-material-color-picker.d.ts +16 -21
- package/types/cmat-components-material-datetimepicker.d.ts +174 -216
- package/types/cmat-components-navigation.d.ts +34 -39
- package/types/cmat-components-opt-input.d.ts +35 -33
- package/types/cmat-components-org-chart.d.ts +8 -9
- package/types/cmat-components-page-header.d.ts +9 -9
- package/types/cmat-components-pagination.d.ts +36 -40
- package/types/cmat-components-password-strength.d.ts +58 -64
- package/types/cmat-components-popover.d.ts +22 -32
- package/types/cmat-components-progress-bar.d.ts +7 -10
- package/types/cmat-components-qrcode.d.ts +22 -22
- package/types/cmat-components-rating.d.ts +17 -19
- package/types/cmat-components-rich-text-editor.d.ts +11 -12
- package/types/cmat-components-select-search.d.ts +48 -36
- package/types/cmat-components-select-table.d.ts +38 -34
- package/types/cmat-components-select-tree.d.ts +17 -15
- package/types/cmat-components-skeleton.d.ts +27 -10
- package/types/cmat-components-speed-dial.d.ts +24 -33
- package/types/cmat-components-status-tag.d.ts +19 -9
- package/types/cmat-components-table-toolbar.d.ts +7 -7
- package/types/cmat-components-timeline.d.ts +33 -34
- package/types/cmat-components-toast.d.ts +26 -30
- package/types/cmat-components-transfer-picker.d.ts +51 -56
- package/types/cmat-components-treetable.d.ts +12 -13
- package/types/cmat-components-upload.d.ts +33 -38
- package/types/cmat-components-x6-angular-shape.d.ts +1 -1
- package/types/cmat-directives-animate-on-scroll.d.ts +7 -7
- package/types/cmat-directives-arrow-cursor.d.ts +18 -20
- package/types/cmat-directives-data-exporter.d.ts +10 -10
- package/types/cmat-directives-debounce.d.ts +5 -5
- package/types/cmat-directives-digit-only.d.ts +13 -13
- package/types/cmat-directives-seamless-auto-scroll.d.ts +7 -7
- package/types/cmat-pipes-secure.d.ts +1 -3
- package/types/cmat-services-alert.d.ts +11 -12
- package/types/cmat-services-config.d.ts +2 -7
- package/types/cmat-services-confirmation.d.ts +2 -2
- package/types/cmat-services-data.d.ts +0 -1
- package/types/cmat-services-loading.d.ts +14 -22
- package/types/cmat-services-media-watcher.d.ts +5 -5
- package/types/cmat-services-translation.d.ts +4 -5
- package/types/cmat.d.ts +2167 -1746
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ChangeDetectionStrategy, ViewEncapsulation, Component,
|
|
3
|
-
import {
|
|
4
|
-
import { MAT_BOTTOM_SHEET_DATA, MatBottomSheet } from '@angular/material/bottom-sheet';
|
|
2
|
+
import { inject, signal, computed, ChangeDetectionStrategy, ViewEncapsulation, Component, input, viewChild, DestroyRef, effect, Input } from '@angular/core';
|
|
3
|
+
import { MAT_BOTTOM_SHEET_DATA, MatBottomSheetRef, MatBottomSheet } from '@angular/material/bottom-sheet';
|
|
5
4
|
import * as i1 from '@angular/material/button';
|
|
6
5
|
import { MatButtonModule } from '@angular/material/button';
|
|
7
6
|
import * as i4 from '@angular/material/icon';
|
|
@@ -10,15 +9,15 @@ import * as i3 from '@angular/material/list';
|
|
|
10
9
|
import { MatListModule } from '@angular/material/list';
|
|
11
10
|
import * as i2 from '@angular/material/tabs';
|
|
12
11
|
import { MatTabsModule } from '@angular/material/tabs';
|
|
13
|
-
import { isUndefined, isNull, isNil } from 'lodash-es';
|
|
14
12
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
15
13
|
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
|
|
16
14
|
import * as i3$1 from '@angular/cdk/overlay';
|
|
17
|
-
import { Overlay, OverlayConfig, OverlayModule
|
|
15
|
+
import { CdkOverlayOrigin, Overlay, OverlayConfig, OverlayModule } from '@angular/cdk/overlay';
|
|
18
16
|
import * as i4$1 from '@angular/cdk/portal';
|
|
19
|
-
import { PortalModule } from '@angular/cdk/portal';
|
|
17
|
+
import { CdkPortal, PortalModule } from '@angular/cdk/portal';
|
|
20
18
|
import { NgClass } from '@angular/common';
|
|
21
19
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
20
|
+
import { NgControl } from '@angular/forms';
|
|
22
21
|
import { MatFormFieldControl } from '@angular/material/form-field';
|
|
23
22
|
import * as i2$1 from '@angular/material/input';
|
|
24
23
|
import { MatInputModule } from '@angular/material/input';
|
|
@@ -27,135 +26,191 @@ import { map } from 'rxjs/operators';
|
|
|
27
26
|
|
|
28
27
|
class CmatCascadeBottomSheetComponent {
|
|
29
28
|
constructor() {
|
|
30
|
-
this.
|
|
31
|
-
this.
|
|
32
|
-
|
|
33
|
-
this.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
}
|
|
29
|
+
this.data = inject(MAT_BOTTOM_SHEET_DATA);
|
|
30
|
+
this.selectedTab = signal(0, /* @ts-ignore */
|
|
31
|
+
...(ngDevMode ? [{ debugName: "selectedTab" }] : /* istanbul ignore next */ []));
|
|
32
|
+
this.labels = computed(() => {
|
|
33
|
+
return this.data.steps().map((step) => {
|
|
34
|
+
const activeItem = step.find((item) => item.active);
|
|
35
|
+
return activeItem?.label ?? '选择';
|
|
36
|
+
});
|
|
37
|
+
}, /* @ts-ignore */
|
|
38
|
+
...(ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []));
|
|
39
|
+
this._bottomSheetRef = inject((MatBottomSheetRef));
|
|
40
|
+
this.resetTabIndex();
|
|
41
|
+
}
|
|
42
|
+
resetTabIndex() {
|
|
43
|
+
const hasValue = this.data.currentLabels().length > 0;
|
|
44
|
+
this.selectedTab.set(hasValue ? this.data.currentLabels().length - 1 : 0);
|
|
39
45
|
}
|
|
40
46
|
clickHandle(event) {
|
|
41
47
|
event.stopPropagation();
|
|
42
48
|
}
|
|
43
|
-
|
|
49
|
+
dismiss() {
|
|
50
|
+
this._bottomSheetRef.dismiss();
|
|
51
|
+
}
|
|
52
|
+
select(disabled) {
|
|
44
53
|
if (!disabled) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
this.
|
|
54
|
+
const currentIndex = this.selectedTab();
|
|
55
|
+
if (currentIndex < this.data.steps().length - 1) {
|
|
56
|
+
this.selectedTab.set(currentIndex + 1);
|
|
48
57
|
}
|
|
49
|
-
this.selected.setValue(this.root.steps.length - 1);
|
|
50
58
|
}
|
|
51
59
|
}
|
|
52
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
53
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
60
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatCascadeBottomSheetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
61
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: CmatCascadeBottomSheetComponent, isStandalone: true, selector: "cmat-cascade-bottom-sheet", exportAs: ["cmatCascadeBottomSheet"], ngImport: i0, template: "<div role=\"presentation\" class=\"cmat-cascade-bottom-sheet\" (click)=\"clickHandle($event)\">\r\n <div class=\"sheet-header flex items-center\">\r\n <p class=\"sheet-title\">{{data.placeholder}}</p>\r\n <button type=\"button\" matIconButton (click)=\"dismiss()\">\r\n <mat-icon [svgIcon]=\"'heroicons_outline:x-mark'\"></mat-icon>\r\n </button>\r\n </div>\r\n <mat-tab-group [selectedIndex]=\"selectedTab()\" (selectedIndexChange)=\"selectedTab.set($event)\">\r\n @for (menuItem of data.steps(); track $index; let step = $index) {\r\n <mat-tab [label]=\"labels()[step]\">\r\n <mat-list class=\"menu-list overflow-y-auto scrollbar-custom\">\r\n @for (listItem of menuItem; track listItem.value; let i = $index) {\r\n <mat-list-item class=\"menu-item\"\r\n [class.active]=\"listItem.active\" [class.disabled]=\"listItem.disabled\"\r\n (click)=\"data.selectHandle($event, step, i); select(listItem.disabled);\">\r\n <div matLine>{{listItem.label}}</div>\r\n </mat-list-item>\r\n }\r\n </mat-list>\r\n </mat-tab>\r\n }\r\n </mat-tab-group>\r\n</div>", styles: [".cmat-cascade-bottom-sheet{padding:0;margin:-8px -16px}.cmat-cascade-bottom-sheet .sheet-header{display:flex;flex:1 1 0%;align-items:center;font-size:1rem;border-bottom-width:1px;padding:12px 16px}.cmat-cascade-bottom-sheet .sheet-header .sheet-title{margin:0;padding:0;letter-spacing:.05rem;text-align:center;flex-grow:1}.cmat-cascade-bottom-sheet .menu-list{vertical-align:top;box-sizing:border-box;margin:0;padding:0;width:100%;overflow:hidden;position:relative;height:204px}.cmat-cascade-bottom-sheet .menu-item{padding:0 16px;text-overflow:ellipsis;box-sizing:border-box;cursor:pointer!important;font-size:14px;line-height:3em}.cmat-cascade-bottom-sheet .menu-item.disabled{cursor:not-allowed!important;pointer-events:none}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatTabsModule }, { kind: "component", type: i2.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass", "id"], exportAs: ["matTab"] }, { kind: "component", type: i2.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "fitInkBarToContent", "mat-stretch-tabs", "mat-align-tabs", "dynamicHeight", "selectedIndex", "headerPosition", "animationDuration", "contentTabIndex", "disablePagination", "disableRipple", "preserveContent", "backgroundColor", "aria-label", "aria-labelledby"], outputs: ["selectedIndexChange", "focusChange", "animationDone", "selectedTabChange"], exportAs: ["matTabGroup"] }, { kind: "ngmodule", type: MatListModule }, { kind: "component", type: i3.MatList, selector: "mat-list", exportAs: ["matList"] }, { kind: "component", type: i3.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
54
62
|
}
|
|
55
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
63
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatCascadeBottomSheetComponent, decorators: [{
|
|
56
64
|
type: Component,
|
|
57
|
-
args: [{ selector: 'cmat-cascade-bottom-sheet', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatCascadeBottomSheet', imports: [MatButtonModule, MatTabsModule, MatListModule, MatIconModule], template: "<div role=\"presentation\" class=\"cmat-cascade-bottom-sheet\" (click)=\"clickHandle($event)\">\r\n <div class=\"sheet-header flex items-center\">\r\n <p class=\"sheet-title\">{{
|
|
65
|
+
args: [{ selector: 'cmat-cascade-bottom-sheet', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatCascadeBottomSheet', imports: [MatButtonModule, MatTabsModule, MatListModule, MatIconModule], template: "<div role=\"presentation\" class=\"cmat-cascade-bottom-sheet\" (click)=\"clickHandle($event)\">\r\n <div class=\"sheet-header flex items-center\">\r\n <p class=\"sheet-title\">{{data.placeholder}}</p>\r\n <button type=\"button\" matIconButton (click)=\"dismiss()\">\r\n <mat-icon [svgIcon]=\"'heroicons_outline:x-mark'\"></mat-icon>\r\n </button>\r\n </div>\r\n <mat-tab-group [selectedIndex]=\"selectedTab()\" (selectedIndexChange)=\"selectedTab.set($event)\">\r\n @for (menuItem of data.steps(); track $index; let step = $index) {\r\n <mat-tab [label]=\"labels()[step]\">\r\n <mat-list class=\"menu-list overflow-y-auto scrollbar-custom\">\r\n @for (listItem of menuItem; track listItem.value; let i = $index) {\r\n <mat-list-item class=\"menu-item\"\r\n [class.active]=\"listItem.active\" [class.disabled]=\"listItem.disabled\"\r\n (click)=\"data.selectHandle($event, step, i); select(listItem.disabled);\">\r\n <div matLine>{{listItem.label}}</div>\r\n </mat-list-item>\r\n }\r\n </mat-list>\r\n </mat-tab>\r\n }\r\n </mat-tab-group>\r\n</div>", styles: [".cmat-cascade-bottom-sheet{padding:0;margin:-8px -16px}.cmat-cascade-bottom-sheet .sheet-header{display:flex;flex:1 1 0%;align-items:center;font-size:1rem;border-bottom-width:1px;padding:12px 16px}.cmat-cascade-bottom-sheet .sheet-header .sheet-title{margin:0;padding:0;letter-spacing:.05rem;text-align:center;flex-grow:1}.cmat-cascade-bottom-sheet .menu-list{vertical-align:top;box-sizing:border-box;margin:0;padding:0;width:100%;overflow:hidden;position:relative;height:204px}.cmat-cascade-bottom-sheet .menu-item{padding:0 16px;text-overflow:ellipsis;box-sizing:border-box;cursor:pointer!important;font-size:14px;line-height:3em}.cmat-cascade-bottom-sheet .menu-item.disabled{cursor:not-allowed!important;pointer-events:none}\n"] }]
|
|
58
66
|
}], ctorParameters: () => [] });
|
|
59
67
|
|
|
60
68
|
class CmatCascadeMenuComponent {
|
|
61
69
|
constructor() {
|
|
62
70
|
this.root = inject(CmatCascadeListComponent, { optional: true });
|
|
63
71
|
}
|
|
64
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
65
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
72
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatCascadeMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
73
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: CmatCascadeMenuComponent, isStandalone: true, selector: "cmat-cascade-menu", exportAs: ["cmatCascadeMenu"], ngImport: i0, template: "@for (menuItem of root.steps(); track $index; let step = $index) {\r\n <mat-list class=\"menu-list overflow-y-auto scrollbar-custom\">\r\n @for (listItem of menuItem; track listItem.value; let i = $index) {\r\n <mat-list-item class=\"menu-item\"\r\n [class.active]=\"listItem.active\" [class.disabled]=\"listItem.disabled\"\r\n (click)=\"root.selectHandle($event, step, i);\">\r\n <div matLine>{{listItem.label}}</div>\r\n @if (listItem.children && listItem.children.length) {\r\n <mat-icon class=\"item-icon\" [svgIcon]=\"'mat_outline:chevron_right'\"></mat-icon>\r\n }\r\n </mat-list-item>\r\n }\r\n </mat-list>\r\n}", styles: ["cmat-cascade-menu{height:200px;z-index:2007;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f;white-space:nowrap}cmat-cascade-menu .menu-list{display:inline-block;border-right-width:1px;box-sizing:border-box;margin:0;padding:.5rem;overflow:hidden;position:relative;height:200px;min-width:200px;vertical-align:top}cmat-cascade-menu .menu-list:last-child{border-right-width:0px}cmat-cascade-menu .menu-item{line-height:3rem;padding:0 16px;position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;box-sizing:border-box;cursor:pointer!important}cmat-cascade-menu .menu-item.disabled{cursor:not-allowed!important}cmat-cascade-menu .menu-item .item-icon{position:absolute;justify-items:center;top:50%;bottom:50%;right:0;transform:translateY(-50%)}\n"], dependencies: [{ kind: "ngmodule", type: MatListModule }, { kind: "component", type: i3.MatList, selector: "mat-list", exportAs: ["matList"] }, { kind: "component", type: i3.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
66
74
|
}
|
|
67
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
75
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatCascadeMenuComponent, decorators: [{
|
|
68
76
|
type: Component,
|
|
69
|
-
args: [{ selector: 'cmat-cascade-menu', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatCascadeMenu', imports: [MatListModule, MatIconModule], template: "@for (menuItem of root.steps; track
|
|
77
|
+
args: [{ selector: 'cmat-cascade-menu', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatCascadeMenu', imports: [MatListModule, MatIconModule], template: "@for (menuItem of root.steps(); track $index; let step = $index) {\r\n <mat-list class=\"menu-list overflow-y-auto scrollbar-custom\">\r\n @for (listItem of menuItem; track listItem.value; let i = $index) {\r\n <mat-list-item class=\"menu-item\"\r\n [class.active]=\"listItem.active\" [class.disabled]=\"listItem.disabled\"\r\n (click)=\"root.selectHandle($event, step, i);\">\r\n <div matLine>{{listItem.label}}</div>\r\n @if (listItem.children && listItem.children.length) {\r\n <mat-icon class=\"item-icon\" [svgIcon]=\"'mat_outline:chevron_right'\"></mat-icon>\r\n }\r\n </mat-list-item>\r\n }\r\n </mat-list>\r\n}", styles: ["cmat-cascade-menu{height:200px;z-index:2007;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f;white-space:nowrap}cmat-cascade-menu .menu-list{display:inline-block;border-right-width:1px;box-sizing:border-box;margin:0;padding:.5rem;overflow:hidden;position:relative;height:200px;min-width:200px;vertical-align:top}cmat-cascade-menu .menu-list:last-child{border-right-width:0px}cmat-cascade-menu .menu-item{line-height:3rem;padding:0 16px;position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;box-sizing:border-box;cursor:pointer!important}cmat-cascade-menu .menu-item.disabled{cursor:not-allowed!important}cmat-cascade-menu .menu-item .item-icon{position:absolute;justify-items:center;top:50%;bottom:50%;right:0;transform:translateY(-50%)}\n"] }]
|
|
70
78
|
}] });
|
|
71
79
|
|
|
72
80
|
/* eslint-disable @typescript-eslint/member-ordering */
|
|
73
81
|
let NEXT_ID = 0;
|
|
74
82
|
class CmatCascadeListComponent {
|
|
83
|
+
get placeholder() {
|
|
84
|
+
return this._placeholderSignal();
|
|
85
|
+
}
|
|
86
|
+
set placeholder(value) {
|
|
87
|
+
this._placeholderSignal.set(value);
|
|
88
|
+
this.stateChanges.next();
|
|
89
|
+
}
|
|
90
|
+
get disabled() {
|
|
91
|
+
if (this.ngControl?.disabled != null) {
|
|
92
|
+
return this.ngControl.disabled;
|
|
93
|
+
}
|
|
94
|
+
return this._disabledSignal();
|
|
95
|
+
}
|
|
96
|
+
set disabled(value) {
|
|
97
|
+
this._disabledSignal.set(coerceBooleanProperty(value));
|
|
98
|
+
this.stateChanges.next();
|
|
99
|
+
}
|
|
100
|
+
get required() {
|
|
101
|
+
return this._requiredSignal();
|
|
102
|
+
}
|
|
103
|
+
set required(value) {
|
|
104
|
+
this._requiredSignal.set(coerceBooleanProperty(value));
|
|
105
|
+
}
|
|
106
|
+
get empty() {
|
|
107
|
+
return !this._value();
|
|
108
|
+
}
|
|
109
|
+
get shouldLabelFloat() {
|
|
110
|
+
return this.focused || !this.empty;
|
|
111
|
+
}
|
|
112
|
+
get errorState() {
|
|
113
|
+
if (this.ngControl == null) {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
return (this.touched && this.ngControl.invalid) ?? false;
|
|
117
|
+
}
|
|
118
|
+
;
|
|
75
119
|
constructor() {
|
|
120
|
+
this.id = `cmat-cascade-list-${NEXT_ID++}`;
|
|
121
|
+
this.options = input.required(/* @ts-ignore */
|
|
122
|
+
...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
123
|
+
this.clearable = input(false, /* @ts-ignore */
|
|
124
|
+
...(ngDevMode ? [{ debugName: "clearable" }] : /* istanbul ignore next */ []));
|
|
125
|
+
this.fullLevels = input(true, /* @ts-ignore */
|
|
126
|
+
...(ngDevMode ? [{ debugName: "fullLevels" }] : /* istanbul ignore next */ []));
|
|
127
|
+
this.changeOnSelect = input(false, /* @ts-ignore */
|
|
128
|
+
...(ngDevMode ? [{ debugName: "changeOnSelect" }] : /* istanbul ignore next */ []));
|
|
129
|
+
this.allowLabelValue = input(false, /* @ts-ignore */
|
|
130
|
+
...(ngDevMode ? [{ debugName: "allowLabelValue" }] : /* istanbul ignore next */ []));
|
|
131
|
+
this.touchUi = input(false, { ...(ngDevMode ? { debugName: "touchUi" } : /* istanbul ignore next */ {}), transform: coerceBooleanProperty });
|
|
132
|
+
this.overlayOrigin = viewChild.required(CdkOverlayOrigin);
|
|
133
|
+
this.menuTemplate = viewChild.required(CdkPortal);
|
|
134
|
+
this._inputElement = viewChild('inputElement', /* @ts-ignore */
|
|
135
|
+
...(ngDevMode ? [{ debugName: "_inputElement" }] : /* istanbul ignore next */ []));
|
|
136
|
+
this._placeholderSignal = signal('请选择', /* @ts-ignore */
|
|
137
|
+
...(ngDevMode ? [{ debugName: "_placeholderSignal" }] : /* istanbul ignore next */ []));
|
|
138
|
+
this._disabledSignal = signal(false, /* @ts-ignore */
|
|
139
|
+
...(ngDevMode ? [{ debugName: "_disabledSignal" }] : /* istanbul ignore next */ []));
|
|
140
|
+
this._requiredSignal = signal(false, /* @ts-ignore */
|
|
141
|
+
...(ngDevMode ? [{ debugName: "_requiredSignal" }] : /* istanbul ignore next */ []));
|
|
76
142
|
this.ngControl = inject(NgControl, { optional: true, self: true });
|
|
143
|
+
this.stateChanges = new Subject();
|
|
144
|
+
this.controlType = 'cmat-cascade-list';
|
|
77
145
|
this._overlay = inject(Overlay);
|
|
78
146
|
this._breakpointObserver = inject(BreakpointObserver);
|
|
79
147
|
this._bottomSheet = inject(MatBottomSheet);
|
|
80
148
|
this._destroyRef = inject(DestroyRef);
|
|
81
|
-
/*
|
|
82
|
-
|
|
83
|
-
this.
|
|
84
|
-
|
|
85
|
-
this.
|
|
86
|
-
|
|
87
|
-
this.
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
this.
|
|
97
|
-
|
|
98
|
-
|
|
149
|
+
this._value = signal(null, /* @ts-ignore */
|
|
150
|
+
...(ngDevMode ? [{ debugName: "_value" }] : /* istanbul ignore next */ []));
|
|
151
|
+
this._focused = signal(false, /* @ts-ignore */
|
|
152
|
+
...(ngDevMode ? [{ debugName: "_focused" }] : /* istanbul ignore next */ []));
|
|
153
|
+
this._touched = signal(false, /* @ts-ignore */
|
|
154
|
+
...(ngDevMode ? [{ debugName: "_touched" }] : /* istanbul ignore next */ []));
|
|
155
|
+
this.currentLabels = computed(() => {
|
|
156
|
+
const value = this._value();
|
|
157
|
+
const opts = this.options();
|
|
158
|
+
if (!value?.length || !opts.length) {
|
|
159
|
+
return [];
|
|
160
|
+
}
|
|
161
|
+
return this._findLabelsByValue(value, opts);
|
|
162
|
+
}, /* @ts-ignore */
|
|
163
|
+
...(ngDevMode ? [{ debugName: "currentLabels" }] : /* istanbul ignore next */ []));
|
|
164
|
+
this.steps = computed(() => {
|
|
165
|
+
const labels = this.currentLabels();
|
|
166
|
+
const opts = this.options();
|
|
167
|
+
if (!labels.length) {
|
|
168
|
+
const step1 = opts.map(item => ({ ...item, active: false }));
|
|
169
|
+
return [step1];
|
|
170
|
+
}
|
|
171
|
+
return this._buildStepsFromLabels(labels, opts);
|
|
172
|
+
}, /* @ts-ignore */
|
|
173
|
+
...(ngDevMode ? [{ debugName: "steps" }] : /* istanbul ignore next */ []));
|
|
174
|
+
this.showClearIcon = computed(() => {
|
|
175
|
+
return this.clearable() && this.currentLabels().length > 0 && !this.disabled;
|
|
176
|
+
}, /* @ts-ignore */
|
|
177
|
+
...(ngDevMode ? [{ debugName: "showClearIcon" }] : /* istanbul ignore next */ []));
|
|
178
|
+
this.menuVisible = computed(() => {
|
|
179
|
+
return !this.touchUi() && (this.overlayRef?.hasAttached() ?? false);
|
|
180
|
+
}, /* @ts-ignore */
|
|
181
|
+
...(ngDevMode ? [{ debugName: "menuVisible" }] : /* istanbul ignore next */ []));
|
|
99
182
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
100
|
-
this.
|
|
183
|
+
this._onChange = () => { };
|
|
101
184
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
102
|
-
this.
|
|
185
|
+
this._onTouched = () => { };
|
|
103
186
|
if (this.ngControl != null) {
|
|
104
187
|
this.ngControl.valueAccessor = this;
|
|
105
188
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
get placeholder() {
|
|
114
|
-
return this._placeholder;
|
|
115
|
-
}
|
|
116
|
-
set placeholder(value) {
|
|
117
|
-
this._placeholder = value;
|
|
118
|
-
this.stateChanges.next();
|
|
189
|
+
effect(() => {
|
|
190
|
+
const labels = this.currentLabels();
|
|
191
|
+
if (this._inputElement()?.nativeElement.value !== this._getLabelText(labels)) {
|
|
192
|
+
this._updateInputValue(labels);
|
|
193
|
+
}
|
|
194
|
+
});
|
|
119
195
|
}
|
|
120
196
|
get value() {
|
|
121
|
-
return this._value;
|
|
122
|
-
}
|
|
123
|
-
set value(value) {
|
|
124
|
-
if (value !== this.value) {
|
|
125
|
-
this._value = value;
|
|
126
|
-
this._setInputValue();
|
|
127
|
-
this.stateChanges.next();
|
|
128
|
-
this.controlChange(value);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
get empty() {
|
|
132
|
-
return !this._value;
|
|
197
|
+
return this._value();
|
|
133
198
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
return false;
|
|
137
|
-
return (this.touched && this.ngControl?.invalid) ?? false;
|
|
199
|
+
set value(val) {
|
|
200
|
+
this._value.set(val);
|
|
138
201
|
}
|
|
139
|
-
get
|
|
140
|
-
return this.
|
|
202
|
+
get focused() {
|
|
203
|
+
return this._focused();
|
|
141
204
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
this._required = coerceBooleanProperty(value);
|
|
205
|
+
set focused(val) {
|
|
206
|
+
this._focused.set(val);
|
|
145
207
|
this.stateChanges.next();
|
|
146
208
|
}
|
|
147
|
-
get
|
|
148
|
-
|
|
149
|
-
return this.ngControl.disabled;
|
|
150
|
-
}
|
|
151
|
-
return this._disabled;
|
|
209
|
+
get touched() {
|
|
210
|
+
return this._touched();
|
|
152
211
|
}
|
|
153
|
-
set
|
|
154
|
-
this.
|
|
155
|
-
if (this.focused) {
|
|
156
|
-
this.focused = false;
|
|
157
|
-
this.stateChanges.next();
|
|
158
|
-
}
|
|
212
|
+
set touched(val) {
|
|
213
|
+
this._touched.set(val);
|
|
159
214
|
}
|
|
160
215
|
ngOnInit() {
|
|
161
216
|
const config = new OverlayConfig({
|
|
@@ -164,261 +219,217 @@ class CmatCascadeListComponent {
|
|
|
164
219
|
scrollStrategy: this._overlay.scrollStrategies.reposition(),
|
|
165
220
|
positionStrategy: this._overlay
|
|
166
221
|
.position()
|
|
167
|
-
.flexibleConnectedTo(this.overlayOrigin.elementRef)
|
|
222
|
+
.flexibleConnectedTo(this.overlayOrigin().elementRef)
|
|
168
223
|
.withPositions([
|
|
169
|
-
{
|
|
170
|
-
|
|
171
|
-
originY: 'bottom',
|
|
172
|
-
overlayX: 'start',
|
|
173
|
-
overlayY: 'top'
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
originX: 'start',
|
|
177
|
-
originY: 'top',
|
|
178
|
-
overlayX: 'start',
|
|
179
|
-
overlayY: 'bottom'
|
|
180
|
-
}
|
|
224
|
+
{ originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top' },
|
|
225
|
+
{ originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom' }
|
|
181
226
|
])
|
|
182
227
|
});
|
|
183
|
-
this._breakpointObserver.observe(Breakpoints.Handset).pipe(takeUntilDestroyed(this._destroyRef), map(
|
|
184
|
-
this.touchUi !== matches
|
|
228
|
+
this._breakpointObserver.observe(Breakpoints.Handset).pipe(takeUntilDestroyed(this._destroyRef), map(match => match.matches)).subscribe((matches) => {
|
|
229
|
+
if (this.touchUi() !== matches) {
|
|
230
|
+
if (!matches && this.bottomSheetRef) {
|
|
231
|
+
// 从移动切换到桌面:关闭 BottomSheet
|
|
232
|
+
this.bottomSheetRef.dismiss();
|
|
233
|
+
// 可选:自动打开 Overlay
|
|
234
|
+
if (this.focused) {
|
|
235
|
+
setTimeout(() => this.overlayRef.attach(this.menuTemplate()));
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
else if (matches && this.overlayRef?.hasAttached()) {
|
|
239
|
+
// 从桌面切换到移动:关闭 Overlay
|
|
240
|
+
this.overlayRef.detach();
|
|
241
|
+
// 可选:自动打开 BottomSheet
|
|
242
|
+
this._openBottomSheet();
|
|
243
|
+
}
|
|
244
|
+
}
|
|
185
245
|
});
|
|
186
246
|
this.overlayRef = this._overlay.create(config);
|
|
187
247
|
this.overlayRef.backdropClick().subscribe(() => {
|
|
188
248
|
this.overlayRef.detach();
|
|
189
249
|
});
|
|
190
250
|
}
|
|
191
|
-
ngOnChanges(changes) {
|
|
192
|
-
if (changes['options']) {
|
|
193
|
-
if ((this.value && !this.value.length) || !this.value) {
|
|
194
|
-
const step1 = this.options.map((option) => ({
|
|
195
|
-
...option,
|
|
196
|
-
active: false
|
|
197
|
-
}));
|
|
198
|
-
this.steps = [step1];
|
|
199
|
-
}
|
|
200
|
-
this._init();
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
251
|
ngOnDestroy() {
|
|
204
252
|
this.stateChanges.complete();
|
|
253
|
+
if (this.overlayRef) {
|
|
254
|
+
this.overlayRef.dispose();
|
|
255
|
+
}
|
|
205
256
|
}
|
|
206
257
|
writeValue(value) {
|
|
207
|
-
this.value
|
|
208
|
-
this.steps = [];
|
|
209
|
-
this._init();
|
|
258
|
+
this._value.set(value);
|
|
210
259
|
}
|
|
211
260
|
registerOnChange(fn) {
|
|
212
|
-
this.
|
|
261
|
+
this._onChange = fn;
|
|
213
262
|
}
|
|
214
263
|
registerOnTouched(fn) {
|
|
215
|
-
this.
|
|
264
|
+
this._onTouched = fn;
|
|
216
265
|
}
|
|
217
266
|
setDisabledState(isDisabled) {
|
|
218
|
-
this.
|
|
267
|
+
this._disabledSignal.set(isDisabled);
|
|
219
268
|
}
|
|
220
269
|
setDescribedByIds(ids) {
|
|
221
270
|
if (ids.length) {
|
|
222
|
-
this._inputElement
|
|
271
|
+
this._inputElement()?.nativeElement.setAttribute('aria-describedby', ids.join(' '));
|
|
223
272
|
}
|
|
224
273
|
else {
|
|
225
|
-
this._inputElement
|
|
274
|
+
this._inputElement()?.nativeElement.removeAttribute('aria-describedby');
|
|
226
275
|
}
|
|
227
276
|
}
|
|
228
277
|
onContainerClick() {
|
|
229
278
|
if (!this.focused) {
|
|
230
|
-
this._inputElement
|
|
279
|
+
this._inputElement()?.nativeElement.focus();
|
|
231
280
|
}
|
|
232
281
|
}
|
|
233
282
|
clickHandle(event) {
|
|
234
|
-
if (this.disabled || this.options.length === 0) {
|
|
283
|
+
if (this.disabled || this.options().length === 0) {
|
|
235
284
|
return;
|
|
236
285
|
}
|
|
237
286
|
const element = event.target;
|
|
238
|
-
const
|
|
239
|
-
if (!
|
|
287
|
+
const cascadeListElement = this._inputElement()?.nativeElement.closest('.cmat-cascade-list');
|
|
288
|
+
if (!cascadeListElement?.contains(element)) {
|
|
240
289
|
return;
|
|
241
290
|
}
|
|
242
|
-
if (this.touchUi) {
|
|
291
|
+
if (this.touchUi()) {
|
|
243
292
|
if (this.overlayRef?.hasAttached()) {
|
|
244
293
|
this.overlayRef.detach();
|
|
245
294
|
}
|
|
246
295
|
this._openBottomSheet();
|
|
247
296
|
}
|
|
248
297
|
else {
|
|
249
|
-
this.overlayRef.attach(this.menuTemplate);
|
|
298
|
+
this.overlayRef.attach(this.menuTemplate());
|
|
250
299
|
}
|
|
251
300
|
}
|
|
252
301
|
clearValue(event) {
|
|
253
302
|
if (event) {
|
|
254
303
|
event.stopPropagation();
|
|
304
|
+
event.preventDefault();
|
|
255
305
|
}
|
|
256
|
-
this.
|
|
257
|
-
this.
|
|
258
|
-
|
|
259
|
-
...option,
|
|
260
|
-
active: false
|
|
261
|
-
}));
|
|
262
|
-
this.steps = [step1];
|
|
263
|
-
this.value = null;
|
|
264
|
-
this.refreshVersion.update(value => value + 1);
|
|
265
|
-
}
|
|
266
|
-
showClearIcon() {
|
|
267
|
-
return !!(this.clearable && this.currentLabels.length > 0 && !this.disabled);
|
|
306
|
+
this._value.set(null);
|
|
307
|
+
this._onChange(null);
|
|
308
|
+
this._onTouched();
|
|
268
309
|
}
|
|
269
310
|
selectHandle(event, step, index) {
|
|
270
311
|
event.stopPropagation();
|
|
271
|
-
|
|
312
|
+
const currentSteps = this.steps();
|
|
313
|
+
const selectedItem = currentSteps[step][index];
|
|
314
|
+
if (selectedItem.disabled) {
|
|
272
315
|
return;
|
|
273
316
|
}
|
|
274
|
-
this.
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
...item,
|
|
286
|
-
active: false
|
|
287
|
-
}));
|
|
288
|
-
this.steps.push(nativeNext);
|
|
317
|
+
this._value.update((values) => {
|
|
318
|
+
const newValues = values ? values.slice(0, step) : [];
|
|
319
|
+
newValues.push({
|
|
320
|
+
value: selectedItem.value,
|
|
321
|
+
label: selectedItem.label
|
|
322
|
+
});
|
|
323
|
+
return newValues;
|
|
324
|
+
});
|
|
325
|
+
this._onChange(this._value());
|
|
326
|
+
this._onTouched();
|
|
327
|
+
if (selectedItem.children?.length && !this.changeOnSelect()) {
|
|
289
328
|
return;
|
|
290
329
|
}
|
|
291
|
-
this._changeLabels();
|
|
292
330
|
if (this.overlayRef?.hasAttached()) {
|
|
293
331
|
this.overlayRef.detach();
|
|
294
332
|
}
|
|
295
|
-
if (this.touchUi) {
|
|
333
|
+
if (this.touchUi() && this.bottomSheetRef) {
|
|
296
334
|
this.bottomSheetRef.dismiss();
|
|
297
335
|
}
|
|
298
336
|
}
|
|
299
337
|
onFocusIn() {
|
|
300
338
|
if (!this.focused) {
|
|
301
339
|
this.focused = true;
|
|
302
|
-
this.stateChanges.next();
|
|
303
340
|
}
|
|
304
341
|
}
|
|
305
342
|
onFocusOut(event) {
|
|
306
|
-
|
|
343
|
+
const relatedTarget = event.relatedTarget;
|
|
344
|
+
const isMenuClick = relatedTarget?.closest('.cmat-cascade-menu, .cmat-cascade-bottom-sheet');
|
|
345
|
+
if (!isMenuClick && !this._inputElement()?.nativeElement.contains(relatedTarget)) {
|
|
307
346
|
this.touched = true;
|
|
308
347
|
this.focused = false;
|
|
309
|
-
this.
|
|
310
|
-
this.stateChanges.next();
|
|
348
|
+
this._onTouched();
|
|
311
349
|
}
|
|
312
350
|
}
|
|
313
|
-
|
|
314
|
-
const
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
}));
|
|
351
|
+
_findLabelsByValue(value, options) {
|
|
352
|
+
const result = [];
|
|
353
|
+
let currentOptions = options;
|
|
354
|
+
for (const val of value) {
|
|
355
|
+
const found = this.allowLabelValue()
|
|
356
|
+
? currentOptions.find(item => item.value === val.value || item.label === val.label)
|
|
357
|
+
: currentOptions.find(item => item.value === val.value);
|
|
358
|
+
if (found) {
|
|
359
|
+
result.push(found);
|
|
360
|
+
currentOptions = found.children ?? [];
|
|
324
361
|
}
|
|
325
362
|
else {
|
|
326
|
-
|
|
363
|
+
break;
|
|
327
364
|
}
|
|
328
|
-
});
|
|
329
|
-
this.steps.push(step);
|
|
330
|
-
index += 1;
|
|
331
|
-
if (this.value && index < this.value.length) {
|
|
332
|
-
this._initSteps(index, options);
|
|
333
365
|
}
|
|
366
|
+
return result;
|
|
334
367
|
}
|
|
335
|
-
|
|
336
|
-
const
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
368
|
+
_buildStepsFromLabels(labels, rootOptions) {
|
|
369
|
+
const steps = [];
|
|
370
|
+
let currentOptions = rootOptions;
|
|
371
|
+
for (const label of labels) {
|
|
372
|
+
const stepItems = currentOptions.map(item => ({
|
|
373
|
+
...item,
|
|
374
|
+
active: item.value === label.value
|
|
375
|
+
}));
|
|
376
|
+
steps.push(stepItems);
|
|
377
|
+
currentOptions = label.children ?? [];
|
|
378
|
+
}
|
|
379
|
+
if (currentOptions.length > 0) {
|
|
380
|
+
steps.push(currentOptions.map(item => ({ ...item, active: false })));
|
|
381
|
+
}
|
|
382
|
+
return steps;
|
|
383
|
+
}
|
|
384
|
+
_updateInputValue(labels) {
|
|
385
|
+
if (!this._inputElement) {
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
388
|
+
let text;
|
|
389
|
+
if (this.fullLevels()) {
|
|
390
|
+
text = labels.map((l, i) => `${l.label}${i < labels.length - 1 ? ' / ' : ''}`).join('');
|
|
391
|
+
}
|
|
392
|
+
else {
|
|
393
|
+
text = labels[labels.length - 1]?.label ?? '';
|
|
394
|
+
}
|
|
395
|
+
this._inputElement().nativeElement.value = text;
|
|
349
396
|
}
|
|
350
397
|
_openBottomSheet() {
|
|
398
|
+
const data = {
|
|
399
|
+
options: this.options(),
|
|
400
|
+
steps: this.steps,
|
|
401
|
+
currentLabels: this.currentLabels,
|
|
402
|
+
selectHandle: this.selectHandle.bind(this),
|
|
403
|
+
changeOnSelect: this.changeOnSelect(),
|
|
404
|
+
placeholder: this.placeholder
|
|
405
|
+
};
|
|
351
406
|
this.bottomSheetRef = this._bottomSheet.open(CmatCascadeBottomSheetComponent, {
|
|
352
|
-
data
|
|
407
|
+
data
|
|
353
408
|
});
|
|
354
409
|
}
|
|
355
|
-
|
|
356
|
-
this.
|
|
357
|
-
|
|
358
|
-
let options = this.options;
|
|
359
|
-
const val = this.value.map((v) => {
|
|
360
|
-
const item = options.filter((i) => i.value === v.value || (this.allowLabelValue && i.label === v.label))?.[0];
|
|
361
|
-
if (!isUndefined(item?.children))
|
|
362
|
-
options = item.children;
|
|
363
|
-
return item;
|
|
364
|
-
});
|
|
365
|
-
this.currentLabels = val.filter((v) => !!v);
|
|
366
|
-
this._setInputValue();
|
|
367
|
-
this._initSteps(0, this.options);
|
|
410
|
+
_getLabelText(labels) {
|
|
411
|
+
if (this.fullLevels()) {
|
|
412
|
+
return labels.map((l, i) => `${l.label}${i < labels.length - 1 ? ' / ' : ''}`).join('');
|
|
368
413
|
}
|
|
369
|
-
|
|
414
|
+
return labels[labels.length - 1]?.label ?? '';
|
|
370
415
|
}
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
if (this.fullLevels) {
|
|
374
|
-
this.currentLabels.map((value, i) => {
|
|
375
|
-
this._inputElement.nativeElement.value += `${value.label}${i < this.currentLabels.length - 1 ? ' / ' : ''}`;
|
|
376
|
-
});
|
|
377
|
-
}
|
|
378
|
-
else {
|
|
379
|
-
this._inputElement.nativeElement.value = this.currentLabels[this.currentLabels.length - 1].label ?? '';
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: CmatCascadeListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
383
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.11", type: CmatCascadeListComponent, isStandalone: true, selector: "cmat-cascade-list", inputs: { id: "id", options: "options", clearable: "clearable", fullLevels: "fullLevels", changeOnSelect: "changeOnSelect", allowLabelValue: "allowLabelValue", touchUi: "touchUi", placeholder: "placeholder", value: "value", required: "required", disabled: "disabled" }, host: { properties: { "attr.id": "this.id" } }, providers: [{ provide: MatFormFieldControl, useExisting: CmatCascadeListComponent }], viewQueries: [{ propertyName: "overlayOrigin", first: true, predicate: CdkOverlayOrigin, descendants: true, static: true }, { propertyName: "menuTemplate", first: true, predicate: ["menuTemplate"], descendants: true, static: true }, { propertyName: "_inputElement", first: true, predicate: ["inputElement"], descendants: true, static: true }], exportAs: ["cmatCascadeList"], usesOnChanges: true, ngImport: i0, template: "<span role=\"presentation\" class=\"cmat-cascade-list\" cdk-overlay-origin [attr.data-refresh]=\"refreshVersion()\"\r\n [ngClass]=\"{'opened': menuVisible, 'disabled': disabled}\">\r\n <input #inputElement matInput readonly [required]='required' [placeholder]=\"currentLabels.length>0 ? '' : placeholder\" (click)=\"clickHandle($event)\"\r\n (focusin)=\"onFocusIn()\" (focusout)=\"onFocusOut($event)\">\r\n\r\n @if (showClearIcon()) {\r\n <button type=\"button\" matSuffix matIconButton aria-label=\"Clear\" (click)=\"clearValue($event)\">\r\n <mat-icon [svgIcon]=\"'heroicons_outline:x-mark'\"></mat-icon>\r\n </button>\r\n }\r\n @else {\r\n <mat-icon matSuffix [svgIcon]=\"'mat_outline:arrow_drop_down'\"></mat-icon>\r\n }\r\n</span>\r\n\r\n<ng-template #menuTemplate=\"cdkPortal\" cdkPortal>\r\n <cmat-cascade-menu></cmat-cascade-menu>\r\n</ng-template>\r\n", styles: ["cmat-cascade-list{width:100%}.cmat-cascade-list{position:relative;display:flex;width:100%;line-height:2;align-items:center}.cmat-cascade-list mat-form-field{width:100%}.cmat-cascade-list input{cursor:pointer}.cmat-cascade-list.disabled .cascade-label{z-index:2}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: CmatCascadeMenuComponent, selector: "cmat-cascade-menu", exportAs: ["cmatCascadeMenu"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i3$1.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "ngmodule", type: PortalModule }, { kind: "directive", type: i4$1.CdkPortal, selector: "[cdkPortal]", exportAs: ["cdkPortal"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
416
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatCascadeListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
417
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: CmatCascadeListComponent, isStandalone: true, selector: "cmat-cascade-list", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, fullLevels: { classPropertyName: "fullLevels", publicName: "fullLevels", isSignal: true, isRequired: false, transformFunction: null }, changeOnSelect: { classPropertyName: "changeOnSelect", publicName: "changeOnSelect", isSignal: true, isRequired: false, transformFunction: null }, allowLabelValue: { classPropertyName: "allowLabelValue", publicName: "allowLabelValue", isSignal: true, isRequired: false, transformFunction: null }, touchUi: { classPropertyName: "touchUi", publicName: "touchUi", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: false, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: false, isRequired: false, transformFunction: null } }, host: { properties: { "attr.id": "id" } }, providers: [{ provide: MatFormFieldControl, useExisting: CmatCascadeListComponent }], viewQueries: [{ propertyName: "overlayOrigin", first: true, predicate: CdkOverlayOrigin, descendants: true, isSignal: true }, { propertyName: "menuTemplate", first: true, predicate: CdkPortal, descendants: true, isSignal: true }, { propertyName: "_inputElement", first: true, predicate: ["inputElement"], descendants: true, isSignal: true }], exportAs: ["cmatCascadeList"], ngImport: i0, template: "<span role=\"presentation\" class=\"cmat-cascade-list\" cdk-overlay-origin\r\n [ngClass]=\"{'opened': menuVisible(), 'disabled': disabled, 'error-state': errorState}\">\r\n <input #inputElement matInput readonly [required]='required' [placeholder]=\"currentLabels().length>0 ? '' : placeholder\" (click)=\"clickHandle($event)\"\r\n (focusin)=\"onFocusIn()\" (focusout)=\"onFocusOut($event)\">\r\n\r\n @if (showClearIcon()) {\r\n <button type=\"button\" matSuffix matIconButton aria-label=\"Clear\" (click)=\"clearValue($event)\">\r\n <mat-icon [svgIcon]=\"'heroicons_outline:x-mark'\"></mat-icon>\r\n </button>\r\n }\r\n @else {\r\n <mat-icon matSuffix [svgIcon]=\"'mat_outline:arrow_drop_down'\"></mat-icon>\r\n }\r\n</span>\r\n\r\n<ng-template #menuTemplate=\"cdkPortal\" cdkPortal>\r\n <cmat-cascade-menu></cmat-cascade-menu>\r\n</ng-template>", styles: ["cmat-cascade-list{width:100%}.cmat-cascade-list{position:relative;display:flex;width:100%;line-height:2;align-items:center}.cmat-cascade-list mat-form-field{width:100%}.cmat-cascade-list input{cursor:pointer}.cmat-cascade-list.disabled .cascade-label{z-index:2}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: CmatCascadeMenuComponent, selector: "cmat-cascade-menu", exportAs: ["cmatCascadeMenu"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i3$1.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "ngmodule", type: PortalModule }, { kind: "directive", type: i4$1.CdkPortal, selector: "[cdkPortal]", exportAs: ["cdkPortal"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
384
418
|
}
|
|
385
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
419
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatCascadeListComponent, decorators: [{
|
|
386
420
|
type: Component,
|
|
387
|
-
args: [{ selector: 'cmat-cascade-list', providers: [{ provide: MatFormFieldControl, useExisting: CmatCascadeListComponent }], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatCascadeList', imports: [MatIconModule, NgClass, CmatCascadeMenuComponent, MatInputModule,
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
}], options: [{
|
|
394
|
-
type: Input,
|
|
395
|
-
args: [{ required: true }]
|
|
396
|
-
}], clearable: [{
|
|
397
|
-
type: Input
|
|
398
|
-
}], fullLevels: [{
|
|
399
|
-
type: Input
|
|
400
|
-
}], changeOnSelect: [{
|
|
401
|
-
type: Input
|
|
402
|
-
}], allowLabelValue: [{
|
|
421
|
+
args: [{ selector: 'cmat-cascade-list', providers: [{ provide: MatFormFieldControl, useExisting: CmatCascadeListComponent }], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatCascadeList', imports: [MatIconModule, NgClass, CmatCascadeMenuComponent, MatInputModule,
|
|
422
|
+
OverlayModule, PortalModule, MatButtonModule], host: {
|
|
423
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
424
|
+
'[attr.id]': 'id',
|
|
425
|
+
}, template: "<span role=\"presentation\" class=\"cmat-cascade-list\" cdk-overlay-origin\r\n [ngClass]=\"{'opened': menuVisible(), 'disabled': disabled, 'error-state': errorState}\">\r\n <input #inputElement matInput readonly [required]='required' [placeholder]=\"currentLabels().length>0 ? '' : placeholder\" (click)=\"clickHandle($event)\"\r\n (focusin)=\"onFocusIn()\" (focusout)=\"onFocusOut($event)\">\r\n\r\n @if (showClearIcon()) {\r\n <button type=\"button\" matSuffix matIconButton aria-label=\"Clear\" (click)=\"clearValue($event)\">\r\n <mat-icon [svgIcon]=\"'heroicons_outline:x-mark'\"></mat-icon>\r\n </button>\r\n }\r\n @else {\r\n <mat-icon matSuffix [svgIcon]=\"'mat_outline:arrow_drop_down'\"></mat-icon>\r\n }\r\n</span>\r\n\r\n<ng-template #menuTemplate=\"cdkPortal\" cdkPortal>\r\n <cmat-cascade-menu></cmat-cascade-menu>\r\n</ng-template>", styles: ["cmat-cascade-list{width:100%}.cmat-cascade-list{position:relative;display:flex;width:100%;line-height:2;align-items:center}.cmat-cascade-list mat-form-field{width:100%}.cmat-cascade-list input{cursor:pointer}.cmat-cascade-list.disabled .cascade-label{z-index:2}\n"] }]
|
|
426
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: true }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], fullLevels: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullLevels", required: false }] }], changeOnSelect: [{ type: i0.Input, args: [{ isSignal: true, alias: "changeOnSelect", required: false }] }], allowLabelValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowLabelValue", required: false }] }], touchUi: [{ type: i0.Input, args: [{ isSignal: true, alias: "touchUi", required: false }] }], overlayOrigin: [{ type: i0.ViewChild, args: [i0.forwardRef(() => CdkOverlayOrigin), { isSignal: true }] }], menuTemplate: [{ type: i0.ViewChild, args: [i0.forwardRef(() => CdkPortal), { isSignal: true }] }], _inputElement: [{ type: i0.ViewChild, args: ['inputElement', { isSignal: true }] }], placeholder: [{
|
|
403
427
|
type: Input
|
|
404
|
-
}],
|
|
405
|
-
type: ViewChild,
|
|
406
|
-
args: [CdkOverlayOrigin, { static: true }]
|
|
407
|
-
}], menuTemplate: [{
|
|
408
|
-
type: ViewChild,
|
|
409
|
-
args: ['menuTemplate', { static: true }]
|
|
410
|
-
}], _inputElement: [{
|
|
411
|
-
type: ViewChild,
|
|
412
|
-
args: ['inputElement', { static: true }]
|
|
413
|
-
}], touchUi: [{
|
|
414
|
-
type: Input
|
|
415
|
-
}], placeholder: [{
|
|
416
|
-
type: Input
|
|
417
|
-
}], value: [{
|
|
428
|
+
}], disabled: [{
|
|
418
429
|
type: Input
|
|
419
430
|
}], required: [{
|
|
420
431
|
type: Input
|
|
421
|
-
}],
|
|
432
|
+
}], value: [{
|
|
422
433
|
type: Input
|
|
423
434
|
}] } });
|
|
424
435
|
|