cmat 0.0.86 → 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 +4 -4
- package/fesm2022/cmat-services-utils.mjs.map +1 -1
- package/fesm2022/cmat.mjs +9229 -7508
- 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,6 +1,6 @@
|
|
|
1
1
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { Injectable,
|
|
3
|
+
import { Injectable, signal, input, output, inject, ElementRef, Renderer2, effect, untracked, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
|
|
4
4
|
import { CmatUtilsService } from 'cmat/services/utils';
|
|
5
5
|
|
|
6
6
|
class CmatDrawerService {
|
|
@@ -16,103 +16,84 @@ class CmatDrawerService {
|
|
|
16
16
|
getComponent(name) {
|
|
17
17
|
return this._componentRegistry.get(name);
|
|
18
18
|
}
|
|
19
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
20
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
19
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatDrawerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
20
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatDrawerService, providedIn: 'root' }); }
|
|
21
21
|
}
|
|
22
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
22
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatDrawerService, decorators: [{
|
|
23
23
|
type: Injectable,
|
|
24
24
|
args: [{
|
|
25
25
|
providedIn: 'root'
|
|
26
26
|
}]
|
|
27
27
|
}] });
|
|
28
28
|
|
|
29
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
29
30
|
class CmatDrawerComponent {
|
|
30
31
|
constructor() {
|
|
31
|
-
/*
|
|
32
|
-
|
|
33
|
-
this.
|
|
34
|
-
this.
|
|
35
|
-
|
|
36
|
-
this.
|
|
37
|
-
|
|
38
|
-
this.
|
|
39
|
-
this.
|
|
40
|
-
|
|
41
|
-
this.
|
|
42
|
-
this.
|
|
32
|
+
this.refreshVersion = signal(0, /* @ts-ignore */
|
|
33
|
+
...(ngDevMode ? [{ debugName: "refreshVersion" }] : /* istanbul ignore next */ []));
|
|
34
|
+
this.fixed = input(false, { ...(ngDevMode ? { debugName: "fixed" } : /* istanbul ignore next */ {}), transform: coerceBooleanProperty });
|
|
35
|
+
this.mode = input('side', /* @ts-ignore */
|
|
36
|
+
...(ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []));
|
|
37
|
+
this.name = input(/* @ts-ignore */
|
|
38
|
+
...(ngDevMode ? [undefined, { debugName: "name" }] : /* istanbul ignore next */ []));
|
|
39
|
+
this.opened = input(false, { ...(ngDevMode ? { debugName: "opened" } : /* istanbul ignore next */ {}), transform: coerceBooleanProperty });
|
|
40
|
+
this.position = input('left', /* @ts-ignore */
|
|
41
|
+
...(ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []));
|
|
42
|
+
this.transparentOverlay = input(false, { ...(ngDevMode ? { debugName: "transparentOverlay" } : /* istanbul ignore next */ {}), transform: coerceBooleanProperty });
|
|
43
|
+
this.fixedChanged = output();
|
|
44
|
+
this.modeChanged = output();
|
|
45
|
+
this.openedChanged = output();
|
|
46
|
+
this.positionChanged = output();
|
|
47
|
+
this._utilsService = inject(CmatUtilsService);
|
|
43
48
|
this._elementRef = inject(ElementRef);
|
|
44
49
|
this._renderer2 = inject(Renderer2);
|
|
45
50
|
this._cmatDrawerService = inject(CmatDrawerService);
|
|
46
|
-
this.
|
|
47
|
-
|
|
51
|
+
this._resolvedName = signal('', /* @ts-ignore */
|
|
52
|
+
...(ngDevMode ? [{ debugName: "_resolvedName" }] : /* istanbul ignore next */ []));
|
|
53
|
+
this._animationsEnabled = signal(false, /* @ts-ignore */
|
|
54
|
+
...(ngDevMode ? [{ debugName: "_animationsEnabled" }] : /* istanbul ignore next */ []));
|
|
55
|
+
this._hovered = signal(false, /* @ts-ignore */
|
|
56
|
+
...(ngDevMode ? [{ debugName: "_hovered" }] : /* istanbul ignore next */ []));
|
|
48
57
|
this._overlay = null;
|
|
49
58
|
this._overlayClickDestroyFn = null;
|
|
50
59
|
this._overlayLeaveTimeoutId = null;
|
|
51
60
|
this._modeChangeTimeoutId = null;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
[`cmat-drawer-position-${this.position}`]: true
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
get styleList() {
|
|
65
|
-
return {
|
|
66
|
-
'visibility': this.opened ? 'visible' : 'hidden'
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
onMouseenter() {
|
|
70
|
-
this._enableAnimations();
|
|
71
|
-
this._hovered = true;
|
|
72
|
-
}
|
|
73
|
-
onMouseleave() {
|
|
74
|
-
this._enableAnimations();
|
|
75
|
-
this._hovered = false;
|
|
76
|
-
}
|
|
77
|
-
ngOnChanges(changes) {
|
|
78
|
-
if ('fixed' in changes) {
|
|
79
|
-
this.fixed = coerceBooleanProperty(changes['fixed'].currentValue);
|
|
80
|
-
this.fixedChanged.emit(this.fixed);
|
|
81
|
-
}
|
|
82
|
-
if ('mode' in changes) {
|
|
83
|
-
const previousMode = changes['mode'].previousValue;
|
|
84
|
-
const currentMode = changes['mode'].currentValue;
|
|
85
|
-
this._disableAnimations();
|
|
86
|
-
if (previousMode === 'over' && currentMode === 'side') {
|
|
87
|
-
this._hideOverlay();
|
|
88
|
-
}
|
|
89
|
-
if (previousMode === 'side' && currentMode === 'over') {
|
|
90
|
-
if (this.opened) {
|
|
91
|
-
this._showOverlay();
|
|
61
|
+
effect(() => {
|
|
62
|
+
this.fixedChanged.emit(this.fixed());
|
|
63
|
+
});
|
|
64
|
+
let previousMode;
|
|
65
|
+
effect(() => {
|
|
66
|
+
const currentMode = this.mode();
|
|
67
|
+
untracked(() => {
|
|
68
|
+
if (previousMode !== undefined && previousMode !== currentMode) {
|
|
69
|
+
this._handleModeChange(previousMode, currentMode);
|
|
92
70
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
this.
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
71
|
+
previousMode = currentMode;
|
|
72
|
+
this.modeChanged.emit(currentMode);
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
effect(() => {
|
|
76
|
+
this.positionChanged.emit(this.position());
|
|
77
|
+
});
|
|
78
|
+
let previousOpened;
|
|
79
|
+
effect(() => {
|
|
80
|
+
const isOpen = this.opened();
|
|
81
|
+
untracked(() => {
|
|
82
|
+
if (previousOpened !== undefined && previousOpened !== isOpen) {
|
|
83
|
+
this._toggleOpened(isOpen);
|
|
84
|
+
}
|
|
85
|
+
previousOpened = isOpen;
|
|
86
|
+
});
|
|
87
|
+
});
|
|
110
88
|
}
|
|
111
89
|
ngOnInit() {
|
|
112
|
-
this.
|
|
90
|
+
const providedName = this.name();
|
|
91
|
+
const finalName = providedName ?? this._utilsService.randomId();
|
|
92
|
+
this._resolvedName.set(finalName);
|
|
93
|
+
this._cmatDrawerService.registerComponent(finalName, this);
|
|
113
94
|
}
|
|
114
95
|
ngOnDestroy() {
|
|
115
|
-
this._cmatDrawerService.deregisterComponent(this.
|
|
96
|
+
this._cmatDrawerService.deregisterComponent(this._resolvedName());
|
|
116
97
|
this._cleanupOverlay();
|
|
117
98
|
if (this._modeChangeTimeoutId !== null) {
|
|
118
99
|
clearTimeout(this._modeChangeTimeoutId);
|
|
@@ -120,25 +101,61 @@ class CmatDrawerComponent {
|
|
|
120
101
|
}
|
|
121
102
|
}
|
|
122
103
|
open() {
|
|
123
|
-
if (this.opened) {
|
|
104
|
+
if (this.opened()) {
|
|
124
105
|
return;
|
|
125
106
|
}
|
|
126
107
|
this._toggleOpened(true);
|
|
127
108
|
}
|
|
128
109
|
close() {
|
|
129
|
-
if (!this.opened) {
|
|
110
|
+
if (!this.opened()) {
|
|
130
111
|
return;
|
|
131
112
|
}
|
|
132
113
|
this._toggleOpened(false);
|
|
133
114
|
}
|
|
134
115
|
toggle() {
|
|
135
|
-
if (this.opened) {
|
|
116
|
+
if (this.opened()) {
|
|
136
117
|
this.close();
|
|
137
118
|
}
|
|
138
119
|
else {
|
|
139
120
|
this.open();
|
|
140
121
|
}
|
|
141
122
|
}
|
|
123
|
+
onMouseenter() {
|
|
124
|
+
this._enableAnimations();
|
|
125
|
+
this._hovered.set(true);
|
|
126
|
+
}
|
|
127
|
+
onMouseleave() {
|
|
128
|
+
this._enableAnimations();
|
|
129
|
+
this._hovered.set(false);
|
|
130
|
+
}
|
|
131
|
+
_handleModeChange(previousMode, currentMode) {
|
|
132
|
+
this._disableAnimations();
|
|
133
|
+
if (previousMode === 'over' && currentMode === 'side') {
|
|
134
|
+
this._hideOverlay();
|
|
135
|
+
}
|
|
136
|
+
if (previousMode === 'side' && currentMode === 'over') {
|
|
137
|
+
if (this.opened()) {
|
|
138
|
+
this._showOverlay();
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
this._modeChangeTimeoutId = window.setTimeout(() => {
|
|
142
|
+
this._modeChangeTimeoutId = null;
|
|
143
|
+
this._enableAnimations();
|
|
144
|
+
}, 500);
|
|
145
|
+
}
|
|
146
|
+
_toggleOpened(open) {
|
|
147
|
+
this._enableAnimations();
|
|
148
|
+
if (this.mode() === 'over') {
|
|
149
|
+
if (open) {
|
|
150
|
+
this._showOverlay();
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
this._hideOverlay();
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
this.refreshVersion.update(value => value + 1);
|
|
157
|
+
this.openedChanged.emit(open);
|
|
158
|
+
}
|
|
142
159
|
_removeOverlayElement() {
|
|
143
160
|
if (this._overlayClickDestroyFn) {
|
|
144
161
|
this._overlayClickDestroyFn();
|
|
@@ -160,16 +177,16 @@ class CmatDrawerComponent {
|
|
|
160
177
|
}
|
|
161
178
|
}
|
|
162
179
|
_enableAnimations() {
|
|
163
|
-
if (this._animationsEnabled) {
|
|
180
|
+
if (this._animationsEnabled()) {
|
|
164
181
|
return;
|
|
165
182
|
}
|
|
166
|
-
this._animationsEnabled
|
|
183
|
+
this._animationsEnabled.set(true);
|
|
167
184
|
}
|
|
168
185
|
_disableAnimations() {
|
|
169
|
-
if (!this._animationsEnabled) {
|
|
186
|
+
if (!this._animationsEnabled()) {
|
|
170
187
|
return;
|
|
171
188
|
}
|
|
172
|
-
this._animationsEnabled
|
|
189
|
+
this._animationsEnabled.set(false);
|
|
173
190
|
}
|
|
174
191
|
_showOverlay() {
|
|
175
192
|
this._cleanupOverlay();
|
|
@@ -178,10 +195,10 @@ class CmatDrawerComponent {
|
|
|
178
195
|
return;
|
|
179
196
|
}
|
|
180
197
|
this._overlay.classList.add('cmat-drawer-overlay');
|
|
181
|
-
if (this.fixed) {
|
|
198
|
+
if (this.fixed()) {
|
|
182
199
|
this._overlay.classList.add('cmat-drawer-overlay-fixed');
|
|
183
200
|
}
|
|
184
|
-
if (this.transparentOverlay) {
|
|
201
|
+
if (this.transparentOverlay()) {
|
|
185
202
|
this._overlay.classList.add('cmat-drawer-overlay-transparent');
|
|
186
203
|
}
|
|
187
204
|
const parentEl = this._elementRef.nativeElement.parentElement;
|
|
@@ -214,59 +231,25 @@ class CmatDrawerComponent {
|
|
|
214
231
|
this._removeOverlayElement();
|
|
215
232
|
}, 400);
|
|
216
233
|
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
this._enableAnimations();
|
|
220
|
-
if (this.mode === 'over') {
|
|
221
|
-
if (open) {
|
|
222
|
-
this._showOverlay();
|
|
223
|
-
}
|
|
224
|
-
else {
|
|
225
|
-
this._hideOverlay();
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
this.refreshVersion.update(value => value + 1);
|
|
229
|
-
this.openedChanged.emit(open);
|
|
230
|
-
}
|
|
231
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: CmatDrawerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
232
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.10", type: CmatDrawerComponent, isStandalone: true, selector: "cmat-drawer", inputs: { fixed: "fixed", mode: "mode", name: "name", opened: "opened", position: "position", transparentOverlay: "transparentOverlay" }, outputs: { fixedChanged: "fixedChanged", modeChanged: "modeChanged", openedChanged: "openedChanged", positionChanged: "positionChanged" }, host: { listeners: { "mouseenter": "onMouseenter()", "mouseleave": "onMouseleave()" }, properties: { "class": "this.classList", "style": "this.styleList" } }, exportAs: ["cmatDrawer"], usesOnChanges: true, ngImport: i0, template: "<div class=\"cmat-drawer-content\">\r\n <ng-content></ng-content>\r\n</div>\r\n<div class=\"cmat-drawer-wrapper\" [attr.data-refresh]=\"refreshVersion()\" [class.cmat-drawer-opened]=\"opened\">\r\n</div>\r\n", styles: ["cmat-drawer{position:relative;display:flex;flex-direction:column;flex:1 1 auto;width:320px;min-width:320px;max-width:320px;z-index:300;box-shadow:0 2px 8px #00000059}cmat-drawer.cmat-drawer-animations-enabled{transition-duration:.4s;transition-timing-function:cubic-bezier(.25,.8,.25,1);transition-property:visibility,margin-left,margin-right,transform,width,max-width,min-width}cmat-drawer.cmat-drawer-animations-enabled .cmat-drawer-content{transition-duration:.4s;transition-timing-function:cubic-bezier(.25,.8,.25,1);transition-property:width,max-width,min-width}cmat-drawer.cmat-drawer-mode-over{position:absolute;top:0;bottom:0}cmat-drawer.cmat-drawer-mode-over.cmat-drawer-fixed{position:fixed}cmat-drawer.cmat-drawer-position-left.cmat-drawer-mode-side{margin-left:-320px}cmat-drawer.cmat-drawer-position-left.cmat-drawer-mode-side.cmat-drawer-opened{margin-left:0}cmat-drawer.cmat-drawer-position-left.cmat-drawer-mode-over{left:0;transform:translate3d(-100%,0,0)}cmat-drawer.cmat-drawer-position-left.cmat-drawer-mode-over.cmat-drawer-opened{transform:translateZ(0)}cmat-drawer.cmat-drawer-position-left .cmat-drawer-content{left:0}cmat-drawer.cmat-drawer-position-right.cmat-drawer-mode-side{margin-right:-320px}cmat-drawer.cmat-drawer-position-right.cmat-drawer-mode-side.cmat-drawer-opened{margin-right:0}cmat-drawer.cmat-drawer-position-right.cmat-drawer-mode-over{right:0;transform:translate3d(100%,0,0)}cmat-drawer.cmat-drawer-position-right.cmat-drawer-mode-over.cmat-drawer-opened{transform:translateZ(0)}cmat-drawer.cmat-drawer-position-right .cmat-drawer-content{right:0}cmat-drawer .cmat-drawer-content{position:absolute;display:flex;flex:1 1 auto;top:0;bottom:0;width:100%;height:100%;overflow:hidden}.cmat-drawer-overlay{position:absolute;inset:0;z-index:299;opacity:1;background-color:#0009}.cmat-drawer-overlay.cmat-drawer-overlay-fixed{position:fixed}.cmat-drawer-overlay.cmat-drawer-overlay-transparent{background-color:transparent}.cmat-drawer-overlay.cmat-drawer-overlay-enter{animation:drawer-overlay-enter .3s cubic-bezier(.25,.8,.25,1)}.cmat-drawer-overlay.cmat-drawer-overlay-leave{animation:drawer-overlay-leave .3s cubic-bezier(.25,.8,.25,1)}@keyframes drawer-overlay-enter{0%{opacity:0}to{opacity:1}}@keyframes drawer-overlay-leave{0%{opacity:1}to{opacity:0}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
234
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatDrawerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
235
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.2", type: CmatDrawerComponent, isStandalone: true, selector: "cmat-drawer", inputs: { fixed: { classPropertyName: "fixed", publicName: "fixed", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, opened: { classPropertyName: "opened", publicName: "opened", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, transparentOverlay: { classPropertyName: "transparentOverlay", publicName: "transparentOverlay", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { fixedChanged: "fixedChanged", modeChanged: "modeChanged", openedChanged: "openedChanged", positionChanged: "positionChanged" }, host: { listeners: { "mouseenter": "onMouseenter()", "mouseleave": "onMouseleave()" }, properties: { "class.cmat-drawer-animations-enabled": "_animationsEnabled()", "class.cmat-drawer-fixed": "fixed()", "class.cmat-drawer-hover": "_hovered()", "class.cmat-drawer-opened": "opened()", "class.cmat-drawer-mode-side": "mode() === 'side'", "class.cmat-drawer-mode-over": "mode() === 'over'", "class.cmat-drawer-position-left": "position() === 'left'", "class.cmat-drawer-position-right": "position() === 'right'", "style.visibility": "opened() ? \"visible\" : \"hidden\"" } }, exportAs: ["cmatDrawer"], ngImport: i0, template: "<div class=\"cmat-drawer-content\">\r\n <ng-content></ng-content>\r\n</div>\r\n<div class=\"cmat-drawer-wrapper\" [attr.data-refresh]=\"refreshVersion()\" [class.cmat-drawer-opened]=\"opened()\">\r\n</div>\r\n", styles: ["cmat-drawer{position:relative;display:flex;flex-direction:column;flex:1 1 auto;width:320px;min-width:320px;max-width:320px;z-index:300;box-shadow:0 2px 8px #00000059}cmat-drawer.cmat-drawer-animations-enabled{transition-duration:.4s;transition-timing-function:cubic-bezier(.25,.8,.25,1);transition-property:visibility,margin-left,margin-right,transform,width,max-width,min-width}cmat-drawer.cmat-drawer-animations-enabled .cmat-drawer-content{transition-duration:.4s;transition-timing-function:cubic-bezier(.25,.8,.25,1);transition-property:width,max-width,min-width}cmat-drawer.cmat-drawer-mode-over{position:absolute;top:0;bottom:0}cmat-drawer.cmat-drawer-mode-over.cmat-drawer-fixed{position:fixed}cmat-drawer.cmat-drawer-position-left.cmat-drawer-mode-side{margin-left:-320px}cmat-drawer.cmat-drawer-position-left.cmat-drawer-mode-side.cmat-drawer-opened{margin-left:0}cmat-drawer.cmat-drawer-position-left.cmat-drawer-mode-over{left:0;transform:translate3d(-100%,0,0)}cmat-drawer.cmat-drawer-position-left.cmat-drawer-mode-over.cmat-drawer-opened{transform:translateZ(0)}cmat-drawer.cmat-drawer-position-left .cmat-drawer-content{left:0}cmat-drawer.cmat-drawer-position-right.cmat-drawer-mode-side{margin-right:-320px}cmat-drawer.cmat-drawer-position-right.cmat-drawer-mode-side.cmat-drawer-opened{margin-right:0}cmat-drawer.cmat-drawer-position-right.cmat-drawer-mode-over{right:0;transform:translate3d(100%,0,0)}cmat-drawer.cmat-drawer-position-right.cmat-drawer-mode-over.cmat-drawer-opened{transform:translateZ(0)}cmat-drawer.cmat-drawer-position-right .cmat-drawer-content{right:0}cmat-drawer .cmat-drawer-content{position:absolute;display:flex;flex:1 1 auto;top:0;bottom:0;width:100%;height:100%;overflow:hidden}.cmat-drawer-overlay{position:absolute;inset:0;z-index:299;opacity:1;background-color:#0009}.cmat-drawer-overlay.cmat-drawer-overlay-fixed{position:fixed}.cmat-drawer-overlay.cmat-drawer-overlay-transparent{background-color:transparent}.cmat-drawer-overlay.cmat-drawer-overlay-enter{animation:drawer-overlay-enter .3s cubic-bezier(.25,.8,.25,1)}.cmat-drawer-overlay.cmat-drawer-overlay-leave{animation:drawer-overlay-leave .3s cubic-bezier(.25,.8,.25,1)}@keyframes drawer-overlay-enter{0%{opacity:0}to{opacity:1}}@keyframes drawer-overlay-leave{0%{opacity:1}to{opacity:0}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
233
236
|
}
|
|
234
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
237
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatDrawerComponent, decorators: [{
|
|
235
238
|
type: Component,
|
|
236
|
-
args: [{ selector: 'cmat-drawer', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatDrawer',
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
type: Output
|
|
251
|
-
}], modeChanged: [{
|
|
252
|
-
type: Output
|
|
253
|
-
}], openedChanged: [{
|
|
254
|
-
type: Output
|
|
255
|
-
}], positionChanged: [{
|
|
256
|
-
type: Output
|
|
257
|
-
}], classList: [{
|
|
258
|
-
type: HostBinding,
|
|
259
|
-
args: ['class']
|
|
260
|
-
}], styleList: [{
|
|
261
|
-
type: HostBinding,
|
|
262
|
-
args: ['style']
|
|
263
|
-
}], onMouseenter: [{
|
|
264
|
-
type: HostListener,
|
|
265
|
-
args: ['mouseenter']
|
|
266
|
-
}], onMouseleave: [{
|
|
267
|
-
type: HostListener,
|
|
268
|
-
args: ['mouseleave']
|
|
269
|
-
}] } });
|
|
239
|
+
args: [{ selector: 'cmat-drawer', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatDrawer', host: {
|
|
240
|
+
'[class.cmat-drawer-animations-enabled]': '_animationsEnabled()',
|
|
241
|
+
'[class.cmat-drawer-fixed]': 'fixed()',
|
|
242
|
+
'[class.cmat-drawer-hover]': '_hovered()',
|
|
243
|
+
'[class.cmat-drawer-opened]': 'opened()',
|
|
244
|
+
'[class.cmat-drawer-mode-side]': 'mode() === \'side\'',
|
|
245
|
+
'[class.cmat-drawer-mode-over]': 'mode() === \'over\'',
|
|
246
|
+
'[class.cmat-drawer-position-left]': 'position() === \'left\'',
|
|
247
|
+
'[class.cmat-drawer-position-right]': 'position() === \'right\'',
|
|
248
|
+
'[style.visibility]': 'opened() ? "visible" : "hidden"',
|
|
249
|
+
'(mouseenter)': 'onMouseenter()',
|
|
250
|
+
'(mouseleave)': 'onMouseleave()'
|
|
251
|
+
}, template: "<div class=\"cmat-drawer-content\">\r\n <ng-content></ng-content>\r\n</div>\r\n<div class=\"cmat-drawer-wrapper\" [attr.data-refresh]=\"refreshVersion()\" [class.cmat-drawer-opened]=\"opened()\">\r\n</div>\r\n", styles: ["cmat-drawer{position:relative;display:flex;flex-direction:column;flex:1 1 auto;width:320px;min-width:320px;max-width:320px;z-index:300;box-shadow:0 2px 8px #00000059}cmat-drawer.cmat-drawer-animations-enabled{transition-duration:.4s;transition-timing-function:cubic-bezier(.25,.8,.25,1);transition-property:visibility,margin-left,margin-right,transform,width,max-width,min-width}cmat-drawer.cmat-drawer-animations-enabled .cmat-drawer-content{transition-duration:.4s;transition-timing-function:cubic-bezier(.25,.8,.25,1);transition-property:width,max-width,min-width}cmat-drawer.cmat-drawer-mode-over{position:absolute;top:0;bottom:0}cmat-drawer.cmat-drawer-mode-over.cmat-drawer-fixed{position:fixed}cmat-drawer.cmat-drawer-position-left.cmat-drawer-mode-side{margin-left:-320px}cmat-drawer.cmat-drawer-position-left.cmat-drawer-mode-side.cmat-drawer-opened{margin-left:0}cmat-drawer.cmat-drawer-position-left.cmat-drawer-mode-over{left:0;transform:translate3d(-100%,0,0)}cmat-drawer.cmat-drawer-position-left.cmat-drawer-mode-over.cmat-drawer-opened{transform:translateZ(0)}cmat-drawer.cmat-drawer-position-left .cmat-drawer-content{left:0}cmat-drawer.cmat-drawer-position-right.cmat-drawer-mode-side{margin-right:-320px}cmat-drawer.cmat-drawer-position-right.cmat-drawer-mode-side.cmat-drawer-opened{margin-right:0}cmat-drawer.cmat-drawer-position-right.cmat-drawer-mode-over{right:0;transform:translate3d(100%,0,0)}cmat-drawer.cmat-drawer-position-right.cmat-drawer-mode-over.cmat-drawer-opened{transform:translateZ(0)}cmat-drawer.cmat-drawer-position-right .cmat-drawer-content{right:0}cmat-drawer .cmat-drawer-content{position:absolute;display:flex;flex:1 1 auto;top:0;bottom:0;width:100%;height:100%;overflow:hidden}.cmat-drawer-overlay{position:absolute;inset:0;z-index:299;opacity:1;background-color:#0009}.cmat-drawer-overlay.cmat-drawer-overlay-fixed{position:fixed}.cmat-drawer-overlay.cmat-drawer-overlay-transparent{background-color:transparent}.cmat-drawer-overlay.cmat-drawer-overlay-enter{animation:drawer-overlay-enter .3s cubic-bezier(.25,.8,.25,1)}.cmat-drawer-overlay.cmat-drawer-overlay-leave{animation:drawer-overlay-leave .3s cubic-bezier(.25,.8,.25,1)}@keyframes drawer-overlay-enter{0%{opacity:0}to{opacity:1}}@keyframes drawer-overlay-leave{0%{opacity:1}to{opacity:0}}\n"] }]
|
|
252
|
+
}], ctorParameters: () => [], propDecorators: { fixed: [{ type: i0.Input, args: [{ isSignal: true, alias: "fixed", required: false }] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], opened: [{ type: i0.Input, args: [{ isSignal: true, alias: "opened", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], transparentOverlay: [{ type: i0.Input, args: [{ isSignal: true, alias: "transparentOverlay", required: false }] }], fixedChanged: [{ type: i0.Output, args: ["fixedChanged"] }], modeChanged: [{ type: i0.Output, args: ["modeChanged"] }], openedChanged: [{ type: i0.Output, args: ["openedChanged"] }], positionChanged: [{ type: i0.Output, args: ["positionChanged"] }] } });
|
|
270
253
|
|
|
271
254
|
/**
|
|
272
255
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmat-components-drawer.mjs","sources":["../../../projects/cmat/components/drawer/drawer.service.ts","../../../projects/cmat/components/drawer/drawer.component.ts","../../../projects/cmat/components/drawer/drawer.component.html","../../../projects/cmat/components/drawer/cmat-components-drawer.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\nimport { CmatDrawerComponent } from './drawer.component';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CmatDrawerService {\r\n private _componentRegistry: Map<string, CmatDrawerComponent> = new Map<string, CmatDrawerComponent>();\r\n \r\n registerComponent(name: string, component: CmatDrawerComponent): void {\r\n this._componentRegistry.set(name, component);\r\n }\r\n\r\n \r\n deregisterComponent(name: string): void {\r\n this._componentRegistry.delete(name);\r\n }\r\n\r\n \r\n getComponent(name: string): CmatDrawerComponent | void {\r\n return this._componentRegistry.get(name);\r\n }\r\n}\r\n","import { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\r\nimport { ChangeDetectionStrategy, Component, ElementRef, EventEmitter, HostBinding, HostListener, Input, OnChanges, OnDestroy, OnInit, Output, Renderer2, SimpleChanges, ViewEncapsulation, inject, signal } from '@angular/core';\r\nimport { CmatUtilsService } from 'cmat/services/utils';\r\nimport { CmatDrawerService } from './drawer.service';\r\nimport { CmatDrawerMode, CmatDrawerPosition } from './drawer.types';\r\n\r\n@Component({\r\n selector: 'cmat-drawer',\r\n templateUrl: './drawer.component.html',\r\n styleUrls: ['./drawer.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n exportAs: 'cmatDrawer'\r\n})\r\nexport class CmatDrawerComponent implements OnChanges, OnInit, OnDestroy {\r\n /* eslint-disable @typescript-eslint/naming-convention */\r\n static ngAcceptInputType_fixed: BooleanInput;\r\n static ngAcceptInputType_opened: BooleanInput;\r\n static ngAcceptInputType_transparentOverlay: BooleanInput;\r\n /* eslint-enable @typescript-eslint/naming-convention */\r\n\r\n @Input() fixed: boolean = false;\r\n @Input() mode: CmatDrawerMode = 'side';\r\n @Input() name: string = inject(CmatUtilsService).randomId();\r\n @Input() opened: boolean = false;\r\n @Input() position: CmatDrawerPosition = 'left';\r\n @Input() transparentOverlay: boolean = false;\r\n @Output() readonly fixedChanged: EventEmitter<boolean> = new EventEmitter<boolean>();\r\n @Output() readonly modeChanged: EventEmitter<CmatDrawerMode> = new EventEmitter<CmatDrawerMode>();\r\n @Output() readonly openedChanged: EventEmitter<boolean> = new EventEmitter<boolean>();\r\n @Output() readonly positionChanged: EventEmitter<CmatDrawerPosition> = new EventEmitter<CmatDrawerPosition>();\r\n\r\n readonly refreshVersion = signal(0);\r\n\r\n private _elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\r\n private _renderer2 = inject(Renderer2);\r\n private _cmatDrawerService = inject(CmatDrawerService);\r\n\r\n private _animationsEnabled: boolean = false;\r\n private _hovered: boolean = false;\r\n private _overlay: HTMLElement | null = null;\r\n private _overlayClickDestroyFn: (() => void) | null = null;\r\n private _overlayLeaveTimeoutId: number | null = null;\r\n private _modeChangeTimeoutId: number | null = null;\r\n\r\n @HostBinding('class') get classList(): Record<string, boolean> {\r\n /* eslint-disable @typescript-eslint/naming-convention */\r\n return {\r\n 'cmat-drawer-animations-enabled': this._animationsEnabled,\r\n 'cmat-drawer-fixed': this.fixed,\r\n 'cmat-drawer-hover': this._hovered,\r\n [`cmat-drawer-mode-${this.mode}`]: true,\r\n 'cmat-drawer-opened': this.opened,\r\n [`cmat-drawer-position-${this.position}`]: true\r\n };\r\n }\r\n\r\n @HostBinding('style') get styleList(): Record<string, string> {\r\n return {\r\n 'visibility': this.opened ? 'visible' : 'hidden'\r\n };\r\n }\r\n\r\n @HostListener('mouseenter')\r\n onMouseenter(): void {\r\n this._enableAnimations();\r\n this._hovered = true;\r\n } \r\n\r\n @HostListener('mouseleave')\r\n onMouseleave(): void {\r\n this._enableAnimations();\r\n this._hovered = false;\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges): void {\r\n if ('fixed' in changes) {\r\n this.fixed = coerceBooleanProperty(changes['fixed'].currentValue);\r\n this.fixedChanged.emit(this.fixed);\r\n }\r\n if ('mode' in changes) {\r\n const previousMode = changes['mode'].previousValue as CmatDrawerMode | undefined;\r\n const currentMode = changes['mode'].currentValue as CmatDrawerMode | undefined;\r\n this._disableAnimations();\r\n if (previousMode === 'over' && currentMode === 'side') {\r\n this._hideOverlay();\r\n }\r\n if (previousMode === 'side' && currentMode === 'over') {\r\n if (this.opened) {\r\n this._showOverlay();\r\n }\r\n }\r\n this.modeChanged.emit(currentMode);\r\n this._modeChangeTimeoutId = window.setTimeout(() => {\r\n this._modeChangeTimeoutId = null;\r\n this._enableAnimations();\r\n }, 500);\r\n }\r\n if ('opened' in changes) {\r\n const open = coerceBooleanProperty(changes['opened'].currentValue);\r\n this._toggleOpened(open);\r\n }\r\n if ('position' in changes) {\r\n this.positionChanged.emit(this.position);\r\n }\r\n if ('transparentOverlay' in changes) {\r\n this.transparentOverlay = coerceBooleanProperty(changes['transparentOverlay'].currentValue);\r\n }\r\n }\r\n\r\n ngOnInit(): void {\r\n this._cmatDrawerService.registerComponent(this.name, this);\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this._cmatDrawerService.deregisterComponent(this.name);\r\n this._cleanupOverlay();\r\n if (this._modeChangeTimeoutId !== null) {\r\n clearTimeout(this._modeChangeTimeoutId);\r\n this._modeChangeTimeoutId = null;\r\n }\r\n }\r\n\r\n open(): void {\r\n if (this.opened) {\r\n return;\r\n }\r\n this._toggleOpened(true);\r\n }\r\n\r\n close(): void {\r\n if (!this.opened) {\r\n return;\r\n }\r\n this._toggleOpened(false);\r\n }\r\n\r\n toggle(): void {\r\n if (this.opened) {\r\n this.close();\r\n }\r\n else {\r\n this.open();\r\n }\r\n }\r\n\r\n\r\n private _removeOverlayElement(): void {\r\n if (this._overlayClickDestroyFn) {\r\n this._overlayClickDestroyFn();\r\n this._overlayClickDestroyFn = null;\r\n }\r\n if (this._overlay) {\r\n this._overlay.parentNode?.removeChild(this._overlay);\r\n this._overlay = null;\r\n }\r\n }\r\n\r\n private _cleanupOverlay(): void {\r\n this._clearOverlayLeaveTimeout();\r\n this._removeOverlayElement();\r\n }\r\n\r\n private _clearOverlayLeaveTimeout(): void {\r\n if (this._overlayLeaveTimeoutId !== null) {\r\n clearTimeout(this._overlayLeaveTimeoutId);\r\n this._overlayLeaveTimeoutId = null;\r\n }\r\n }\r\n\r\n private _enableAnimations(): void {\r\n if (this._animationsEnabled) {\r\n return;\r\n }\r\n this._animationsEnabled = true;\r\n }\r\n\r\n\r\n private _disableAnimations(): void {\r\n if (!this._animationsEnabled) {\r\n return;\r\n }\r\n this._animationsEnabled = false;\r\n }\r\n\r\n\r\n private _showOverlay(): void {\r\n this._cleanupOverlay();\r\n\r\n this._overlay = this._renderer2.createElement('div') as HTMLElement;\r\n if (!this._overlay) {\r\n return;\r\n }\r\n this._overlay.classList.add('cmat-drawer-overlay');\r\n if (this.fixed) {\r\n this._overlay.classList.add('cmat-drawer-overlay-fixed');\r\n }\r\n if (this.transparentOverlay) {\r\n this._overlay.classList.add('cmat-drawer-overlay-transparent');\r\n }\r\n const parentEl = this._elementRef.nativeElement.parentElement;\r\n if (parentEl) {\r\n this._renderer2.appendChild(parentEl, this._overlay);\r\n }\r\n\r\n this._overlay.classList.add('cmat-drawer-overlay-enter');\r\n\r\n this._overlayClickDestroyFn = this._renderer2.listen(this._overlay, 'click', () => {\r\n this.close();\r\n });\r\n }\r\n\r\n\r\n private _hideOverlay(): void {\r\n if (!this._overlay) {\r\n return;\r\n }\r\n\r\n this._overlay.classList.remove('cmat-drawer-overlay-enter');\r\n\r\n const overlay = this._overlay;\r\n const handleAnimationEnd = (event: AnimationEvent): void => {\r\n if (event.animationName === 'drawer-overlay-leave') {\r\n overlay.removeEventListener('animationend', handleAnimationEnd);\r\n this._clearOverlayLeaveTimeout();\r\n this._removeOverlayElement();\r\n }\r\n };\r\n\r\n overlay.addEventListener('animationend', handleAnimationEnd);\r\n overlay.classList.add('cmat-drawer-overlay-leave');\r\n\r\n this._overlayLeaveTimeoutId = window.setTimeout(() => {\r\n this._overlayLeaveTimeoutId = null;\r\n overlay.removeEventListener('animationend', handleAnimationEnd);\r\n this._removeOverlayElement();\r\n }, 400);\r\n }\r\n\r\n\r\n private _toggleOpened(open: boolean): void {\r\n this.opened = open;\r\n this._enableAnimations();\r\n if (this.mode === 'over') {\r\n if (open) {\r\n this._showOverlay();\r\n }\r\n else {\r\n this._hideOverlay();\r\n }\r\n }\r\n\r\n this.refreshVersion.update(value => value + 1);\r\n this.openedChanged.emit(open);\r\n }\r\n}\r\n","<div class=\"cmat-drawer-content\">\r\n <ng-content></ng-content>\r\n</div>\r\n<div class=\"cmat-drawer-wrapper\" [attr.data-refresh]=\"refreshVersion()\" [class.cmat-drawer-opened]=\"opened\">\r\n</div>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAMa,iBAAiB,CAAA;AAH9B,IAAA,WAAA,GAAA;AAIY,QAAA,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s","sources":["../../../projects/cmat/components/drawer/drawer.service.ts","../../../projects/cmat/components/drawer/drawer.component.ts","../../../projects/cmat/components/drawer/drawer.component.html","../../../projects/cmat/components/drawer/cmat-components-drawer.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\nimport { CmatDrawerComponent } from './drawer.component';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CmatDrawerService {\r\n private _componentRegistry: Map<string, CmatDrawerComponent> = new Map<string, CmatDrawerComponent>();\r\n \r\n registerComponent(name: string, component: CmatDrawerComponent): void {\r\n this._componentRegistry.set(name, component);\r\n }\r\n\r\n \r\n deregisterComponent(name: string): void {\r\n this._componentRegistry.delete(name);\r\n }\r\n\r\n \r\n getComponent(name: string): CmatDrawerComponent | void {\r\n return this._componentRegistry.get(name);\r\n }\r\n}\r\n","/* eslint-disable @typescript-eslint/naming-convention */\r\nimport { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\r\nimport {\r\n ChangeDetectionStrategy,\r\n Component,\r\n ElementRef,\r\n inject,\r\n input,\r\n output,\r\n OnInit,\r\n OnDestroy,\r\n effect,\r\n Renderer2,\r\n ViewEncapsulation,\r\n signal,\r\n untracked,\r\n} from '@angular/core';\r\nimport { CmatUtilsService } from 'cmat/services/utils';\r\nimport { CmatDrawerService } from './drawer.service';\r\nimport { CmatDrawerMode, CmatDrawerPosition } from './drawer.types';\r\n\r\n@Component({\r\n selector: 'cmat-drawer',\r\n templateUrl: './drawer.component.html',\r\n styleUrls: ['./drawer.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n exportAs: 'cmatDrawer',\r\n host: {\r\n '[class.cmat-drawer-animations-enabled]': '_animationsEnabled()',\r\n '[class.cmat-drawer-fixed]': 'fixed()',\r\n '[class.cmat-drawer-hover]': '_hovered()',\r\n '[class.cmat-drawer-opened]': 'opened()',\r\n '[class.cmat-drawer-mode-side]': 'mode() === \\'side\\'',\r\n '[class.cmat-drawer-mode-over]': 'mode() === \\'over\\'',\r\n '[class.cmat-drawer-position-left]': 'position() === \\'left\\'',\r\n '[class.cmat-drawer-position-right]': 'position() === \\'right\\'',\r\n '[style.visibility]': 'opened() ? \"visible\" : \"hidden\"',\r\n '(mouseenter)': 'onMouseenter()',\r\n '(mouseleave)': 'onMouseleave()'\r\n }\r\n})\r\nexport class CmatDrawerComponent implements OnInit, OnDestroy {\r\n readonly refreshVersion = signal(0);\r\n\r\n readonly fixed = input<boolean, BooleanInput>(false, {\r\n transform: coerceBooleanProperty\r\n });\r\n readonly mode = input<CmatDrawerMode>('side');\r\n readonly name = input<string>();\r\n readonly opened = input<boolean, BooleanInput>(false, {\r\n transform: coerceBooleanProperty\r\n });\r\n readonly position = input<CmatDrawerPosition>('left');\r\n readonly transparentOverlay = input<boolean, BooleanInput>(false, {\r\n transform: coerceBooleanProperty\r\n });\r\n\r\n readonly fixedChanged = output<boolean>();\r\n readonly modeChanged = output<CmatDrawerMode>();\r\n readonly openedChanged = output<boolean>();\r\n readonly positionChanged = output<CmatDrawerPosition>();\r\n\r\n\r\n private readonly _utilsService = inject(CmatUtilsService);\r\n private readonly _elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\r\n private readonly _renderer2 = inject(Renderer2);\r\n private readonly _cmatDrawerService = inject(CmatDrawerService);\r\n\r\n private readonly _resolvedName = signal<string>('');\r\n private readonly _animationsEnabled = signal<boolean>(false);\r\n private readonly _hovered = signal<boolean>(false);\r\n\r\n private _overlay: HTMLElement | null = null;\r\n private _overlayClickDestroyFn: (() => void) | null = null;\r\n private _overlayLeaveTimeoutId: number | null = null;\r\n private _modeChangeTimeoutId: number | null = null;\r\n\r\n constructor() {\r\n effect(() => {\r\n this.fixedChanged.emit(this.fixed());\r\n });\r\n\r\n let previousMode: CmatDrawerMode | undefined;\r\n effect(() => {\r\n const currentMode = this.mode();\r\n untracked(() => {\r\n if (previousMode !== undefined && previousMode !== currentMode) {\r\n this._handleModeChange(previousMode, currentMode);\r\n }\r\n previousMode = currentMode;\r\n this.modeChanged.emit(currentMode);\r\n });\r\n });\r\n\r\n effect(() => {\r\n this.positionChanged.emit(this.position());\r\n });\r\n\r\n let previousOpened: boolean | undefined;\r\n effect(() => {\r\n const isOpen = this.opened();\r\n untracked(() => {\r\n if (previousOpened !== undefined && previousOpened !== isOpen) {\r\n this._toggleOpened(isOpen);\r\n }\r\n previousOpened = isOpen;\r\n });\r\n });\r\n }\r\n\r\n ngOnInit(): void {\r\n const providedName = this.name();\r\n const finalName = providedName ?? this._utilsService.randomId();\r\n this._resolvedName.set(finalName);\r\n\r\n this._cmatDrawerService.registerComponent(finalName, this);\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this._cmatDrawerService.deregisterComponent(this._resolvedName());\r\n this._cleanupOverlay();\r\n if (this._modeChangeTimeoutId !== null) {\r\n clearTimeout(this._modeChangeTimeoutId);\r\n this._modeChangeTimeoutId = null;\r\n }\r\n }\r\n\r\n open(): void {\r\n if (this.opened()) {\r\n return;\r\n }\r\n this._toggleOpened(true);\r\n }\r\n\r\n close(): void {\r\n if (!this.opened()) {\r\n return;\r\n }\r\n this._toggleOpened(false);\r\n }\r\n\r\n toggle(): void {\r\n if (this.opened()) {\r\n this.close();\r\n } else {\r\n this.open();\r\n }\r\n }\r\n\r\n onMouseenter(): void {\r\n this._enableAnimations();\r\n this._hovered.set(true);\r\n }\r\n\r\n onMouseleave(): void {\r\n this._enableAnimations();\r\n this._hovered.set(false);\r\n }\r\n\r\n private _handleModeChange(previousMode: CmatDrawerMode, currentMode: CmatDrawerMode): void {\r\n this._disableAnimations();\r\n\r\n if (previousMode === 'over' && currentMode === 'side') {\r\n this._hideOverlay();\r\n }\r\n\r\n if (previousMode === 'side' && currentMode === 'over') {\r\n if (this.opened()) {\r\n this._showOverlay();\r\n }\r\n }\r\n\r\n this._modeChangeTimeoutId = window.setTimeout(() => {\r\n this._modeChangeTimeoutId = null;\r\n this._enableAnimations();\r\n }, 500);\r\n }\r\n\r\n private _toggleOpened(open: boolean): void {\r\n this._enableAnimations();\r\n\r\n if (this.mode() === 'over') {\r\n if (open) {\r\n this._showOverlay();\r\n } else {\r\n this._hideOverlay();\r\n }\r\n }\r\n\r\n this.refreshVersion.update(value => value + 1);\r\n this.openedChanged.emit(open);\r\n }\r\n\r\n private _removeOverlayElement(): void {\r\n if (this._overlayClickDestroyFn) {\r\n this._overlayClickDestroyFn();\r\n this._overlayClickDestroyFn = null;\r\n }\r\n if (this._overlay) {\r\n this._overlay.parentNode?.removeChild(this._overlay);\r\n this._overlay = null;\r\n }\r\n }\r\n\r\n private _cleanupOverlay(): void {\r\n this._clearOverlayLeaveTimeout();\r\n this._removeOverlayElement();\r\n }\r\n\r\n private _clearOverlayLeaveTimeout(): void {\r\n if (this._overlayLeaveTimeoutId !== null) {\r\n clearTimeout(this._overlayLeaveTimeoutId);\r\n this._overlayLeaveTimeoutId = null;\r\n }\r\n }\r\n\r\n private _enableAnimations(): void {\r\n if (this._animationsEnabled()) {\r\n return;\r\n }\r\n this._animationsEnabled.set(true);\r\n }\r\n\r\n private _disableAnimations(): void {\r\n if (!this._animationsEnabled()) {\r\n return;\r\n }\r\n this._animationsEnabled.set(false);\r\n }\r\n\r\n private _showOverlay(): void {\r\n this._cleanupOverlay();\r\n\r\n this._overlay = this._renderer2.createElement('div') as HTMLElement;\r\n if (!this._overlay) {\r\n return;\r\n }\r\n this._overlay.classList.add('cmat-drawer-overlay');\r\n if (this.fixed()) {\r\n this._overlay.classList.add('cmat-drawer-overlay-fixed');\r\n }\r\n if (this.transparentOverlay()) {\r\n this._overlay.classList.add('cmat-drawer-overlay-transparent');\r\n }\r\n\r\n const parentEl = this._elementRef.nativeElement.parentElement;\r\n if (parentEl) {\r\n this._renderer2.appendChild(parentEl, this._overlay);\r\n }\r\n\r\n this._overlay.classList.add('cmat-drawer-overlay-enter');\r\n\r\n this._overlayClickDestroyFn = this._renderer2.listen(this._overlay, 'click', () => {\r\n this.close();\r\n });\r\n }\r\n\r\n private _hideOverlay(): void {\r\n if (!this._overlay) {\r\n return;\r\n }\r\n\r\n this._overlay.classList.remove('cmat-drawer-overlay-enter');\r\n\r\n const overlay = this._overlay;\r\n const handleAnimationEnd = (event: AnimationEvent): void => {\r\n if (event.animationName === 'drawer-overlay-leave') {\r\n overlay.removeEventListener('animationend', handleAnimationEnd);\r\n this._clearOverlayLeaveTimeout();\r\n this._removeOverlayElement();\r\n }\r\n };\r\n\r\n overlay.addEventListener('animationend', handleAnimationEnd);\r\n overlay.classList.add('cmat-drawer-overlay-leave');\r\n\r\n this._overlayLeaveTimeoutId = window.setTimeout(() => {\r\n this._overlayLeaveTimeoutId = null;\r\n overlay.removeEventListener('animationend', handleAnimationEnd);\r\n this._removeOverlayElement();\r\n }, 400);\r\n }\r\n}","<div class=\"cmat-drawer-content\">\r\n <ng-content></ng-content>\r\n</div>\r\n<div class=\"cmat-drawer-wrapper\" [attr.data-refresh]=\"refreshVersion()\" [class.cmat-drawer-opened]=\"opened()\">\r\n</div>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAMa,iBAAiB,CAAA;AAH9B,IAAA,WAAA,GAAA;AAIY,QAAA,IAAA,CAAA,kBAAkB,GAAqC,IAAI,GAAG,EAA+B;AAexG,IAAA;IAbG,iBAAiB,CAAC,IAAY,EAAE,SAA8B,EAAA;QAC1D,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,IAAI,EAAE,SAAS,CAAC;IAChD;AAGA,IAAA,mBAAmB,CAAC,IAAY,EAAA;AAC5B,QAAA,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC;IACxC;AAGA,IAAA,YAAY,CAAC,IAAY,EAAA;QACrB,OAAO,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC;IAC5C;8GAfS,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,U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from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/material/button';
|
|
4
4
|
import { MatButtonModule } from '@angular/material/button';
|
|
5
5
|
import * as i2 from '@angular/material/icon';
|
|
@@ -7,35 +7,28 @@ import { MatIconModule } from '@angular/material/icon';
|
|
|
7
7
|
|
|
8
8
|
class CmatEmptyStateComponent {
|
|
9
9
|
constructor() {
|
|
10
|
-
this.icon = 'mat_outline:inbox'
|
|
11
|
-
|
|
12
|
-
this.
|
|
13
|
-
|
|
14
|
-
this.
|
|
15
|
-
|
|
10
|
+
this.icon = input('mat_outline:inbox', /* @ts-ignore */
|
|
11
|
+
...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
12
|
+
this.title = input('暂无内容', /* @ts-ignore */
|
|
13
|
+
...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
14
|
+
this.description = input('当前没有可显示的数据。', /* @ts-ignore */
|
|
15
|
+
...(ngDevMode ? [{ debugName: "description" }] : /* istanbul ignore next */ []));
|
|
16
|
+
this.ctaLabel = input('', /* @ts-ignore */
|
|
17
|
+
...(ngDevMode ? [{ debugName: "ctaLabel" }] : /* istanbul ignore next */ []));
|
|
18
|
+
this.ctaDisabled = input(false, /* @ts-ignore */
|
|
19
|
+
...(ngDevMode ? [{ debugName: "ctaDisabled" }] : /* istanbul ignore next */ []));
|
|
20
|
+
this.ctaClick = output();
|
|
16
21
|
}
|
|
17
22
|
emitAction() {
|
|
18
23
|
this.ctaClick.emit();
|
|
19
24
|
}
|
|
20
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
21
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
25
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatEmptyStateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
26
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: CmatEmptyStateComponent, isStandalone: true, selector: "cmat-empty-state", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, ctaLabel: { classPropertyName: "ctaLabel", publicName: "ctaLabel", isSignal: true, isRequired: false, transformFunction: null }, ctaDisabled: { classPropertyName: "ctaDisabled", publicName: "ctaDisabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { ctaClick: "ctaClick" }, ngImport: i0, template: "<div\r\n class=\"flex flex-col items-center justify-center rounded-2xl bg-card px-6 py-10 text-center shadow-sm\"\r\n>\r\n @if (icon()) {\r\n <div\r\n class=\"flex h-16 w-16 items-center justify-center rounded-full bg-slate-100 dark:bg-slate-600 text-slate-500 dark:text-slate-300\"\r\n >\r\n <mat-icon [svgIcon]=\"icon()\"></mat-icon>\r\n </div>\r\n }\r\n\r\n <h3 class=\"mt-4 text-lg font-semibold\">{{ title() }}</h3>\r\n\r\n @if (description()) {\r\n <p\r\n class=\"mt-2 max-w-xl text-sm leading-6 text-slate-500 dark:text-slate-300\"\r\n >\r\n {{ description() }}\r\n </p>\r\n }\r\n\r\n @if (ctaLabel()) {\r\n <div class=\"mt-4\">\r\n <button\r\n matButton=\"outlined\"\r\n type=\"button\"\r\n [disabled]=\"ctaDisabled()\"\r\n (click)=\"emitAction()\"\r\n >\r\n {{ ctaLabel() }}\r\n </button>\r\n </div>\r\n }\r\n</div>\r\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
22
27
|
}
|
|
23
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
28
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatEmptyStateComponent, decorators: [{
|
|
24
29
|
type: Component,
|
|
25
|
-
args: [{ selector: 'cmat-empty-state', changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatButtonModule, MatIconModule], template: "<div
|
|
26
|
-
}], propDecorators: { icon: [{
|
|
27
|
-
type: Input
|
|
28
|
-
}], title: [{
|
|
29
|
-
type: Input
|
|
30
|
-
}], description: [{
|
|
31
|
-
type: Input
|
|
32
|
-
}], ctaLabel: [{
|
|
33
|
-
type: Input
|
|
34
|
-
}], ctaDisabled: [{
|
|
35
|
-
type: Input
|
|
36
|
-
}], ctaClick: [{
|
|
37
|
-
type: Output
|
|
38
|
-
}] } });
|
|
30
|
+
args: [{ selector: 'cmat-empty-state', changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatButtonModule, MatIconModule], template: "<div\r\n class=\"flex flex-col items-center justify-center rounded-2xl bg-card px-6 py-10 text-center shadow-sm\"\r\n>\r\n @if (icon()) {\r\n <div\r\n class=\"flex h-16 w-16 items-center justify-center rounded-full bg-slate-100 dark:bg-slate-600 text-slate-500 dark:text-slate-300\"\r\n >\r\n <mat-icon [svgIcon]=\"icon()\"></mat-icon>\r\n </div>\r\n }\r\n\r\n <h3 class=\"mt-4 text-lg font-semibold\">{{ title() }}</h3>\r\n\r\n @if (description()) {\r\n <p\r\n class=\"mt-2 max-w-xl text-sm leading-6 text-slate-500 dark:text-slate-300\"\r\n >\r\n {{ description() }}\r\n </p>\r\n }\r\n\r\n @if (ctaLabel()) {\r\n <div class=\"mt-4\">\r\n <button\r\n matButton=\"outlined\"\r\n type=\"button\"\r\n [disabled]=\"ctaDisabled()\"\r\n (click)=\"emitAction()\"\r\n >\r\n {{ ctaLabel() }}\r\n </button>\r\n </div>\r\n }\r\n</div>\r\n", styles: [":host{display:block}\n"] }]
|
|
31
|
+
}], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], ctaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ctaLabel", required: false }] }], ctaDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "ctaDisabled", required: false }] }], ctaClick: [{ type: i0.Output, args: ["ctaClick"] }] } });
|
|
39
32
|
|
|
40
33
|
/**
|
|
41
34
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmat-components-empty-state.mjs","sources":["../../../projects/cmat/components/empty-state/empty-state.component.ts","../../../projects/cmat/components/empty-state/empty-state.component.html","../../../projects/cmat/components/empty-state/cmat-components-empty-state.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component,
|
|
1
|
+
{"version":3,"file":"cmat-components-empty-state.mjs","sources":["../../../projects/cmat/components/empty-state/empty-state.component.ts","../../../projects/cmat/components/empty-state/empty-state.component.html","../../../projects/cmat/components/empty-state/cmat-components-empty-state.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input, output } from '@angular/core';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatIconModule } from '@angular/material/icon';\r\n\r\n@Component({\r\n selector: 'cmat-empty-state',\r\n templateUrl: './empty-state.component.html',\r\n styleUrls: ['./empty-state.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [MatButtonModule, MatIconModule],\r\n})\r\nexport class CmatEmptyStateComponent {\r\n readonly icon = input<string>('mat_outline:inbox');\r\n\r\n readonly title = input<string>('暂无内容');\r\n readonly description = input<string>('当前没有可显示的数据。');\r\n readonly ctaLabel = input<string>('');\r\n readonly ctaDisabled = input<boolean>(false);\r\n readonly ctaClick = output<void>();\r\n\r\n emitAction(): void {\r\n this.ctaClick.emit();\r\n }\r\n}\r\n","<div\r\n class=\"flex flex-col items-center justify-center rounded-2xl bg-card px-6 py-10 text-center shadow-sm\"\r\n>\r\n @if (icon()) {\r\n <div\r\n class=\"flex h-16 w-16 items-center justify-center rounded-full bg-slate-100 dark:bg-slate-600 text-slate-500 dark:text-slate-300\"\r\n >\r\n <mat-icon [svgIcon]=\"icon()\"></mat-icon>\r\n </div>\r\n }\r\n\r\n <h3 class=\"mt-4 text-lg font-semibold\">{{ title() }}</h3>\r\n\r\n @if (description()) {\r\n <p\r\n class=\"mt-2 max-w-xl text-sm leading-6 text-slate-500 dark:text-slate-300\"\r\n >\r\n {{ description() }}\r\n </p>\r\n }\r\n\r\n @if (ctaLabel()) {\r\n <div class=\"mt-4\">\r\n <button\r\n matButton=\"outlined\"\r\n type=\"button\"\r\n [disabled]=\"ctaDisabled()\"\r\n (click)=\"emitAction()\"\r\n >\r\n {{ ctaLabel() }}\r\n </button>\r\n </div>\r\n }\r\n</div>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;MAWa,uBAAuB,CAAA;AAPpC,IAAA,WAAA,GAAA;QAQW,IAAA,CAAA,IAAI,GAAG,KAAK,CAAS,mBAAmB;iFAAC;QAEzC,IAAA,CAAA,KAAK,GAAG,KAAK,CAAS,MAAM;kFAAC;QAC7B,IAAA,CAAA,WAAW,GAAG,KAAK,CAAS,aAAa;wFAAC;QAC1C,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAS,EAAE;qFAAC;QAC5B,IAAA,CAAA,WAAW,GAAG,KAAK,CAAU,KAAK;wFAAC;QACnC,IAAA,CAAA,QAAQ,GAAG,MA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