cmat 0.0.117 → 0.0.119
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-breadcrumb.mjs +10 -9
- package/fesm2022/cmat-components-breadcrumb.mjs.map +1 -1
- package/fesm2022/cmat-components-card.mjs +6 -6
- package/fesm2022/cmat-components-card.mjs.map +1 -1
- package/fesm2022/cmat-components-carousel.mjs +16 -16
- package/fesm2022/cmat-components-carousel.mjs.map +1 -1
- package/fesm2022/cmat-components-cascade.mjs +1 -863
- package/fesm2022/cmat-components-chip-input.mjs +11 -11
- package/fesm2022/cmat-components-code-editor.mjs +3 -3
- package/fesm2022/cmat-components-color-picker.mjs +45 -45
- package/fesm2022/cmat-components-color-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-custom-formly.mjs +214 -214
- package/fesm2022/cmat-components-custom-formly.mjs.map +1 -1
- package/fesm2022/cmat-components-data-picker.mjs +43 -40
- package/fesm2022/cmat-components-data-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-date-range.mjs +15 -16
- package/fesm2022/cmat-components-date-range.mjs.map +1 -1
- package/fesm2022/cmat-components-date-time-display.mjs +4 -4
- package/fesm2022/cmat-components-drawer.mjs +9 -9
- package/fesm2022/cmat-components-drawer.mjs.map +1 -1
- package/fesm2022/cmat-components-empty-state.mjs +4 -4
- package/fesm2022/cmat-components-file-preview.mjs +4 -4
- package/fesm2022/cmat-components-filter-toolbar.mjs +12 -13
- package/fesm2022/cmat-components-filter-toolbar.mjs.map +1 -1
- package/fesm2022/cmat-components-form-actions.mjs +6 -6
- package/fesm2022/cmat-components-fullscreen.mjs +4 -4
- package/fesm2022/cmat-components-highlight.mjs +7 -7
- package/fesm2022/cmat-components-image-viewer.mjs +7 -7
- package/fesm2022/cmat-components-image-viewer.mjs.map +1 -1
- package/fesm2022/cmat-components-inline-loading.mjs +3 -3
- package/fesm2022/cmat-components-json-editor.mjs +7 -7
- package/fesm2022/cmat-components-json-editor.mjs.map +1 -1
- package/fesm2022/cmat-components-knob-input.mjs +6 -6
- package/fesm2022/cmat-components-loading-overlay.mjs +5 -5
- package/fesm2022/cmat-components-loading-overlay.mjs.map +1 -1
- package/fesm2022/cmat-components-masonry.mjs +4 -4
- package/fesm2022/cmat-components-material-color-picker.mjs +1 -337
- package/fesm2022/cmat-components-material-datetimepicker.mjs +1 -4312
- package/fesm2022/cmat-components-navigation.mjs +1 -3081
- package/fesm2022/cmat-components-opt-input.mjs +1 -542
- package/fesm2022/cmat-components-org-chart.mjs +1 -529
- package/fesm2022/cmat-components-page-header.mjs +4 -4
- package/fesm2022/cmat-components-pagination.mjs +21 -21
- package/fesm2022/cmat-components-pagination.mjs.map +1 -1
- package/fesm2022/cmat-components-password-strength.mjs +1 -880
- package/fesm2022/cmat-components-popover.mjs +1 -1022
- package/fesm2022/cmat-components-progress-bar.mjs +4 -4
- package/fesm2022/cmat-components-qrcode.mjs +3 -3
- package/fesm2022/cmat-components-rating.mjs +8 -8
- package/fesm2022/cmat-components-rich-text-editor.mjs +3 -3
- package/fesm2022/cmat-components-select-search.mjs +1 -930
- package/fesm2022/cmat-components-select-table.mjs +39 -39
- package/fesm2022/cmat-components-select-table.mjs.map +1 -1
- package/fesm2022/cmat-components-select-tree.mjs +28 -27
- package/fesm2022/cmat-components-select-tree.mjs.map +1 -1
- package/fesm2022/cmat-components-skeleton.mjs +5 -5
- package/fesm2022/cmat-components-skeleton.mjs.map +1 -1
- package/fesm2022/cmat-components-speed-dial.mjs +12 -12
- package/fesm2022/cmat-components-speed-dial.mjs.map +1 -1
- package/fesm2022/cmat-components-status-tag.mjs +6 -6
- package/fesm2022/cmat-components-status-tag.mjs.map +1 -1
- package/fesm2022/cmat-components-table-toolbar.mjs +4 -4
- package/fesm2022/cmat-components-timeline.mjs +19 -19
- package/fesm2022/cmat-components-timeline.mjs.map +1 -1
- package/fesm2022/cmat-components-toast.mjs +14 -14
- package/fesm2022/cmat-components-toast.mjs.map +1 -1
- package/fesm2022/cmat-components-transfer-picker.mjs +48 -49
- package/fesm2022/cmat-components-transfer-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-treetable.mjs +8 -8
- package/fesm2022/cmat-components-upload.mjs +17 -17
- package/fesm2022/cmat-components-x6-angular-shape.mjs +1 -1
- package/fesm2022/cmat-directives-animate-on-scroll.mjs +1 -221
- package/fesm2022/cmat-directives-arrow-cursor.mjs +3 -3
- package/fesm2022/cmat-directives-autofocus.mjs +3 -3
- package/fesm2022/cmat-directives-data-exporter.mjs +1 -544
- package/fesm2022/cmat-directives-debounce.mjs +1 -163
- package/fesm2022/cmat-directives-digit-only.mjs +6 -6
- package/fesm2022/cmat-directives-equal-validator.mjs +3 -3
- package/fesm2022/cmat-directives-seamless-auto-scroll.mjs +3 -3
- package/fesm2022/cmat-lib-mock-api.mjs +8 -8
- package/fesm2022/cmat-pipes-bytes.mjs +3 -3
- package/fesm2022/cmat-pipes-date-format.mjs +3 -3
- package/fesm2022/cmat-pipes-find-by-key.mjs +3 -3
- package/fesm2022/cmat-pipes-group-by.mjs +3 -3
- package/fesm2022/cmat-pipes-keys.mjs +3 -3
- package/fesm2022/cmat-pipes-secure.mjs +6 -6
- package/fesm2022/cmat-pipes-uppercase.mjs +3 -3
- package/fesm2022/cmat-reports.mjs +86 -80
- package/fesm2022/cmat-reports.mjs.map +1 -1
- package/fesm2022/cmat-services-alert.mjs +4 -4
- package/fesm2022/cmat-services-config.mjs +6 -6
- package/fesm2022/cmat-services-confirmation.mjs +1 -185
- package/fesm2022/cmat-services-data.mjs +5 -5
- package/fesm2022/cmat-services-export-as.mjs +4 -4
- package/fesm2022/cmat-services-loading.mjs +6 -6
- package/fesm2022/cmat-services-local-storage.mjs +3 -3
- package/fesm2022/cmat-services-media-watcher.mjs +4 -4
- package/fesm2022/cmat-services-platform.mjs +4 -4
- package/fesm2022/cmat-services-print.mjs +3 -3
- package/fesm2022/cmat-services-splash-screen.mjs +4 -4
- package/fesm2022/cmat-services-title.mjs +6 -6
- package/fesm2022/cmat-services-translation.mjs +4 -4
- package/fesm2022/cmat-services-utils.mjs +7 -7
- package/fesm2022/cmat.mjs +77 -39579
- package/fesm2022/public-api-BE83BHd7.mjs +930 -0
- package/fesm2022/public-api-BE83BHd7.mjs.map +1 -0
- package/fesm2022/public-api-BcmOSkgf.mjs +542 -0
- package/fesm2022/public-api-BcmOSkgf.mjs.map +1 -0
- package/fesm2022/public-api-BmMqKDzm.mjs +4312 -0
- package/fesm2022/public-api-BmMqKDzm.mjs.map +1 -0
- package/fesm2022/public-api-BnRFazGR.mjs +221 -0
- package/fesm2022/public-api-BnRFazGR.mjs.map +1 -0
- package/fesm2022/public-api-C9N9rKkB.mjs +185 -0
- package/fesm2022/public-api-C9N9rKkB.mjs.map +1 -0
- package/fesm2022/public-api-CXmCX9ZQ.mjs +863 -0
- package/fesm2022/public-api-CXmCX9ZQ.mjs.map +1 -0
- package/fesm2022/public-api-CfILyvuV.mjs +880 -0
- package/fesm2022/public-api-CfILyvuV.mjs.map +1 -0
- package/fesm2022/public-api-CgtBw-7O.mjs +163 -0
- package/fesm2022/public-api-CgtBw-7O.mjs.map +1 -0
- package/fesm2022/public-api-DEtzrfqy.mjs +544 -0
- package/fesm2022/public-api-DEtzrfqy.mjs.map +1 -0
- package/fesm2022/public-api-EK51WC1y.mjs +1022 -0
- package/fesm2022/public-api-EK51WC1y.mjs.map +1 -0
- package/fesm2022/public-api-IpTsAgZ4.mjs +3081 -0
- package/fesm2022/public-api-IpTsAgZ4.mjs.map +1 -0
- package/fesm2022/public-api-iRaKIVmd.mjs +338 -0
- package/fesm2022/public-api-iRaKIVmd.mjs.map +1 -0
- package/fesm2022/public-api-nzzDLiDj.mjs +529 -0
- package/fesm2022/public-api-nzzDLiDj.mjs.map +1 -0
- package/fesm2022/{cmat-quill-docx-exporter-D9Eo73Wq.mjs → quill-docx-exporter-D9Eo73Wq.mjs} +1 -1
- package/fesm2022/quill-docx-exporter-D9Eo73Wq.mjs.map +1 -0
- package/package.json +23 -22
- package/types/cmat-components-breadcrumb.d.ts +1 -1
- package/types/cmat-components-chip-input.d.ts +3 -3
- package/types/cmat-components-custom-formly.d.ts +2 -857
- package/types/cmat-components-data-picker.d.ts +12 -6
- package/types/cmat-components-date-range.d.ts +1 -1
- package/types/cmat-components-drawer.d.ts +1 -1
- package/types/cmat-components-form-actions.d.ts +1 -1
- package/types/cmat-components-knob-input.d.ts +1 -1
- package/types/cmat-components-masonry.d.ts +2 -1
- package/types/cmat-components-material-color-picker.d.ts +1 -1
- package/types/cmat-components-material-datetimepicker.d.ts +2 -836
- package/types/cmat-components-navigation.d.ts +1 -1
- package/types/cmat-components-opt-input.d.ts +2 -113
- package/types/cmat-components-org-chart.d.ts +1 -1
- package/types/cmat-components-page-header.d.ts +1 -1
- package/types/cmat-components-password-strength.d.ts +2 -201
- package/types/cmat-components-popover.d.ts +2 -270
- package/types/cmat-components-qrcode.d.ts +2 -113
- package/types/cmat-components-rating.d.ts +1 -1
- package/types/cmat-components-rich-text-editor.d.ts +1 -1
- package/types/cmat-components-select-search.d.ts +2 -200
- package/types/cmat-components-select-table.d.ts +3 -3
- package/types/cmat-components-select-tree.d.ts +6 -5
- package/types/cmat-components-status-tag.d.ts +2 -2
- package/types/cmat-components-toast.d.ts +2 -1
- package/types/cmat-components-transfer-picker.d.ts +2 -2
- package/types/cmat-components-upload.d.ts +1 -1
- package/types/cmat-components-x6-angular-shape.d.ts +1 -1
- package/types/cmat-directives-data-exporter.d.ts +1 -1
- package/types/cmat-directives-debounce.d.ts +2 -34
- package/types/cmat-directives-equal-validator.d.ts +1 -1
- package/types/cmat-directives-seamless-auto-scroll.d.ts +1 -1
- package/types/cmat-lib-mock-api.d.ts +3 -2
- package/types/cmat-pipes-secure.d.ts +1 -1
- package/types/cmat-reports.d.ts +6 -6
- package/types/cmat-services-alert.d.ts +1 -1
- package/types/cmat-services-confirmation.d.ts +2 -36
- package/types/cmat-services-data.d.ts +1 -1
- package/types/cmat-services-export-as.d.ts +1 -1
- package/types/cmat-services-loading.d.ts +1 -1
- package/types/cmat-services-translation.d.ts +1 -1
- package/types/cmat-services-utils.d.ts +2 -2
- package/types/cmat.d.ts +78 -7676
- package/types/public-api-BFGGDRK3.d.ts +201 -0
- package/types/public-api-BXS379ev.d.ts +202 -0
- package/types/public-api-C4CvABGO.d.ts +114 -0
- package/types/public-api-CSYz4G5Z.d.ts +271 -0
- package/types/public-api-NSrmlKKH.d.ts +114 -0
- package/types/public-api-PfNpHSSm.d.ts +837 -0
- package/types/public-api-f3WtygQS.d.ts +35 -0
- package/types/public-api-nBuSXSMJ.d.ts +858 -0
- package/types/public-api-yYeZrUAV.d.ts +37 -0
- package/fesm2022/cmat-components-cascade.mjs.map +0 -1
- package/fesm2022/cmat-components-custom-formly-quill-docx-exporter-BwwGX2Ie.mjs +0 -294
- package/fesm2022/cmat-components-custom-formly-quill-docx-exporter-BwwGX2Ie.mjs.map +0 -1
- package/fesm2022/cmat-components-material-color-picker.mjs.map +0 -1
- package/fesm2022/cmat-components-material-datetimepicker.mjs.map +0 -1
- package/fesm2022/cmat-components-navigation.mjs.map +0 -1
- package/fesm2022/cmat-components-opt-input.mjs.map +0 -1
- package/fesm2022/cmat-components-org-chart.mjs.map +0 -1
- package/fesm2022/cmat-components-password-strength.mjs.map +0 -1
- package/fesm2022/cmat-components-popover.mjs.map +0 -1
- package/fesm2022/cmat-components-select-search.mjs.map +0 -1
- package/fesm2022/cmat-directives-animate-on-scroll.mjs.map +0 -1
- package/fesm2022/cmat-directives-data-exporter.mjs.map +0 -1
- package/fesm2022/cmat-directives-debounce.mjs.map +0 -1
- package/fesm2022/cmat-quill-docx-exporter-D9Eo73Wq.mjs.map +0 -1
- package/fesm2022/cmat-services-confirmation.mjs.map +0 -1
- package/fesm2022/cmat.mjs.map +0 -1
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Directive, ElementRef, Injectable, Renderer2, inject, input } from "@angular/core";
|
|
3
|
+
import { EMPTY, Subscription, fromEvent } from "rxjs";
|
|
4
|
+
var ScrollService = class ScrollService {
|
|
5
|
+
constructor() {
|
|
6
|
+
this._scrollSub = new Subscription();
|
|
7
|
+
this._resizeSub = new Subscription();
|
|
8
|
+
this.manageScrollPos();
|
|
9
|
+
this.scrollObs = typeof window !== "undefined" ? fromEvent(window, "scroll") : EMPTY;
|
|
10
|
+
this._scrollSub = this.scrollObs.subscribe(() => this.manageScrollPos());
|
|
11
|
+
this.resizeObs = typeof window !== "undefined" ? fromEvent(window, "resize") : EMPTY;
|
|
12
|
+
this._resizeSub = this.resizeObs.subscribe(() => this.manageScrollPos());
|
|
13
|
+
}
|
|
14
|
+
ngOnDestroy() {
|
|
15
|
+
this._scrollSub.unsubscribe();
|
|
16
|
+
this._resizeSub.unsubscribe();
|
|
17
|
+
}
|
|
18
|
+
manageScrollPos() {
|
|
19
|
+
this.pos = typeof window !== "undefined" ? window.scrollY : 0;
|
|
20
|
+
}
|
|
21
|
+
static {
|
|
22
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
23
|
+
minVersion: "12.0.0",
|
|
24
|
+
version: "22.3.0",
|
|
25
|
+
ngImport: i0,
|
|
26
|
+
type: ScrollService,
|
|
27
|
+
deps: [],
|
|
28
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
static {
|
|
32
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
33
|
+
minVersion: "12.0.0",
|
|
34
|
+
version: "22.3.0",
|
|
35
|
+
ngImport: i0,
|
|
36
|
+
type: ScrollService,
|
|
37
|
+
providedIn: "root"
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
42
|
+
minVersion: "12.0.0",
|
|
43
|
+
version: "22.3.0",
|
|
44
|
+
ngImport: i0,
|
|
45
|
+
type: ScrollService,
|
|
46
|
+
decorators: [{
|
|
47
|
+
type: Injectable,
|
|
48
|
+
args: [{ providedIn: "root" }]
|
|
49
|
+
}],
|
|
50
|
+
ctorParameters: () => []
|
|
51
|
+
});
|
|
52
|
+
var CmatAnimationOnScrollDirective = class CmatAnimationOnScrollDirective {
|
|
53
|
+
constructor() {
|
|
54
|
+
this.animationName = input(null, ...ngDevMode ? [{ debugName: "animationName" }] : /* istanbul ignore next */ []);
|
|
55
|
+
this.offset = input(80, ...ngDevMode ? [{ debugName: "offset" }] : /* istanbul ignore next */ []);
|
|
56
|
+
this.useScroll = input(...ngDevMode ? [void 0, { debugName: "useScroll" }] : /* istanbul ignore next */ []);
|
|
57
|
+
this.threshold = input(...ngDevMode ? [void 0, { debugName: "threshold" }] : /* istanbul ignore next */ []);
|
|
58
|
+
this._scrollSub = new Subscription();
|
|
59
|
+
this._resizeSub = new Subscription();
|
|
60
|
+
this._elementRef = inject(ElementRef);
|
|
61
|
+
this._renderer = inject(Renderer2);
|
|
62
|
+
this._scroll = inject(ScrollService);
|
|
63
|
+
}
|
|
64
|
+
get id() {
|
|
65
|
+
return this._elementRef.nativeElement.id;
|
|
66
|
+
}
|
|
67
|
+
ngOnInit() {
|
|
68
|
+
if (!this.animationName()) return;
|
|
69
|
+
this._isVisible = false;
|
|
70
|
+
const shouldUseScroll = this.useScroll() ?? (this.useScroll() === false ? false : true);
|
|
71
|
+
const thresholdValue = this.threshold() ?? .5;
|
|
72
|
+
if ("IntersectionObserver" in window && shouldUseScroll) {
|
|
73
|
+
new IntersectionObserver((entries) => {
|
|
74
|
+
entries.forEach((entry) => {
|
|
75
|
+
if (!entry.isIntersecting) return;
|
|
76
|
+
this.addAnimationClass();
|
|
77
|
+
});
|
|
78
|
+
}, {
|
|
79
|
+
root: null,
|
|
80
|
+
threshold: thresholdValue,
|
|
81
|
+
rootMargin: "0px"
|
|
82
|
+
}).observe(this._elementRef.nativeElement);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
this._scrollSub = this._scroll.scrollObs.subscribe(() => this.manageVisibility());
|
|
86
|
+
this._resizeSub = this._scroll.resizeObs.subscribe(() => this.manageVisibility());
|
|
87
|
+
}
|
|
88
|
+
ngAfterViewInit() {
|
|
89
|
+
setTimeout(() => this.manageVisibility(), 1);
|
|
90
|
+
}
|
|
91
|
+
ngOnDestroy() {
|
|
92
|
+
this._scrollSub.unsubscribe();
|
|
93
|
+
this._resizeSub.unsubscribe();
|
|
94
|
+
}
|
|
95
|
+
manageVisibility() {
|
|
96
|
+
if (this._isVisible) return;
|
|
97
|
+
this.getWinHeight();
|
|
98
|
+
this.getOffsetTop();
|
|
99
|
+
const scrollTrigger = this._offsetTop + this.offset() - this._winHeight;
|
|
100
|
+
if (this._scroll.pos >= scrollTrigger) this.addAnimationClass();
|
|
101
|
+
}
|
|
102
|
+
addAnimationClass() {
|
|
103
|
+
if (!this.animationName()) return;
|
|
104
|
+
this._isVisible = true;
|
|
105
|
+
this.setClass(this.animationName());
|
|
106
|
+
}
|
|
107
|
+
setClass(classes) {
|
|
108
|
+
for (const c of classes.split(" ")) this._renderer.addClass(this._elementRef.nativeElement, c);
|
|
109
|
+
}
|
|
110
|
+
getWinHeight() {
|
|
111
|
+
this._winHeight = typeof window !== "undefined" ? window.innerHeight : 0;
|
|
112
|
+
}
|
|
113
|
+
getOffsetTop() {
|
|
114
|
+
if (typeof this._elementRef.nativeElement.getBoundingClientRect === "function") {
|
|
115
|
+
const viewportTop = this._elementRef.nativeElement.getBoundingClientRect().top;
|
|
116
|
+
const clientTop = this._elementRef.nativeElement.clientTop;
|
|
117
|
+
this._offsetTop = viewportTop + this._scroll.pos - clientTop;
|
|
118
|
+
} else this._offsetTop = 0;
|
|
119
|
+
}
|
|
120
|
+
static {
|
|
121
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
122
|
+
minVersion: "12.0.0",
|
|
123
|
+
version: "22.3.0",
|
|
124
|
+
ngImport: i0,
|
|
125
|
+
type: CmatAnimationOnScrollDirective,
|
|
126
|
+
deps: [],
|
|
127
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
static {
|
|
131
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
132
|
+
minVersion: "17.1.0",
|
|
133
|
+
version: "22.3.0",
|
|
134
|
+
type: CmatAnimationOnScrollDirective,
|
|
135
|
+
isStandalone: true,
|
|
136
|
+
selector: "[cmatAnimateOnScroll]",
|
|
137
|
+
inputs: {
|
|
138
|
+
animationName: {
|
|
139
|
+
classPropertyName: "animationName",
|
|
140
|
+
publicName: "animationName",
|
|
141
|
+
isSignal: true,
|
|
142
|
+
isRequired: false,
|
|
143
|
+
transformFunction: null
|
|
144
|
+
},
|
|
145
|
+
offset: {
|
|
146
|
+
classPropertyName: "offset",
|
|
147
|
+
publicName: "offset",
|
|
148
|
+
isSignal: true,
|
|
149
|
+
isRequired: false,
|
|
150
|
+
transformFunction: null
|
|
151
|
+
},
|
|
152
|
+
useScroll: {
|
|
153
|
+
classPropertyName: "useScroll",
|
|
154
|
+
publicName: "useScroll",
|
|
155
|
+
isSignal: true,
|
|
156
|
+
isRequired: false,
|
|
157
|
+
transformFunction: null
|
|
158
|
+
},
|
|
159
|
+
threshold: {
|
|
160
|
+
classPropertyName: "threshold",
|
|
161
|
+
publicName: "threshold",
|
|
162
|
+
isSignal: true,
|
|
163
|
+
isRequired: false,
|
|
164
|
+
transformFunction: null
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
providers: [ScrollService],
|
|
168
|
+
ngImport: i0
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
173
|
+
minVersion: "12.0.0",
|
|
174
|
+
version: "22.3.0",
|
|
175
|
+
ngImport: i0,
|
|
176
|
+
type: CmatAnimationOnScrollDirective,
|
|
177
|
+
decorators: [{
|
|
178
|
+
type: Directive,
|
|
179
|
+
args: [{
|
|
180
|
+
selector: "[cmatAnimateOnScroll]",
|
|
181
|
+
providers: [ScrollService]
|
|
182
|
+
}]
|
|
183
|
+
}],
|
|
184
|
+
propDecorators: {
|
|
185
|
+
animationName: [{
|
|
186
|
+
type: i0.Input,
|
|
187
|
+
args: [{
|
|
188
|
+
isSignal: true,
|
|
189
|
+
alias: "animationName",
|
|
190
|
+
required: false
|
|
191
|
+
}]
|
|
192
|
+
}],
|
|
193
|
+
offset: [{
|
|
194
|
+
type: i0.Input,
|
|
195
|
+
args: [{
|
|
196
|
+
isSignal: true,
|
|
197
|
+
alias: "offset",
|
|
198
|
+
required: false
|
|
199
|
+
}]
|
|
200
|
+
}],
|
|
201
|
+
useScroll: [{
|
|
202
|
+
type: i0.Input,
|
|
203
|
+
args: [{
|
|
204
|
+
isSignal: true,
|
|
205
|
+
alias: "useScroll",
|
|
206
|
+
required: false
|
|
207
|
+
}]
|
|
208
|
+
}],
|
|
209
|
+
threshold: [{
|
|
210
|
+
type: i0.Input,
|
|
211
|
+
args: [{
|
|
212
|
+
isSignal: true,
|
|
213
|
+
alias: "threshold",
|
|
214
|
+
required: false
|
|
215
|
+
}]
|
|
216
|
+
}]
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
export { CmatAnimationOnScrollDirective as t };
|
|
220
|
+
|
|
221
|
+
//# sourceMappingURL=public-api-BnRFazGR.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-api-BnRFazGR.mjs","names":[],"sources":["../../../projects/cmat/directives/animate-on-scroll/scroll.service.ts","../../../projects/cmat/directives/animate-on-scroll/animate-on-scroll.directive.ts"],"sourcesContent":["import { Injectable, OnDestroy } from '@angular/core';\r\nimport { Observable, Subscription, EMPTY, fromEvent } from 'rxjs';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class ScrollService implements OnDestroy {\r\n scrollObs: Observable<Event>;\r\n resizeObs: Observable<Event>;\r\n pos: number;\r\n private _scrollSub: Subscription = new Subscription();\r\n private _resizeSub: Subscription = new Subscription();\r\n\r\n constructor() {\r\n this.manageScrollPos();\r\n this.scrollObs =\r\n typeof window !== 'undefined' ? fromEvent(window, 'scroll') : EMPTY;\r\n this._scrollSub = this.scrollObs.subscribe(() => this.manageScrollPos());\r\n this.resizeObs =\r\n typeof window !== 'undefined' ? fromEvent(window, 'resize') : EMPTY;\r\n this._resizeSub = this.resizeObs.subscribe(() => this.manageScrollPos());\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this._scrollSub.unsubscribe();\r\n this._resizeSub.unsubscribe();\r\n }\r\n\r\n private manageScrollPos(): void {\r\n this.pos = typeof window !== 'undefined' ? window.scrollY : 0;\r\n }\r\n}\r\n","import { AfterViewInit, Directive, ElementRef, OnDestroy, OnInit, Renderer2, inject, input } from '@angular/core';\r\nimport { Subscription } from 'rxjs';\r\nimport { ScrollService } from './scroll.service';\r\n\r\n@Directive({\r\n selector: '[cmatAnimateOnScroll]',\r\n providers:[ScrollService]\r\n})\r\nexport class CmatAnimationOnScrollDirective implements OnInit, OnDestroy, AfterViewInit {\r\n readonly animationName = input<string | null>(null); // use fadeIn as default if not specified, specify null for no animation\r\n readonly offset = input<number>(80); // for scroll Listener\r\n readonly useScroll = input<boolean>();\r\n readonly threshold = input<number>(); // for intersection observer only for the time being\r\n\r\n private _offsetTop: number;\r\n private _isVisible: boolean;\r\n private _winHeight: number;\r\n private _scrollSub: Subscription = new Subscription();\r\n private _resizeSub: Subscription = new Subscription();\r\n private _elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\r\n private _renderer = inject(Renderer2);\r\n private _scroll = inject(ScrollService);\r\n\r\n private get id(): string {\r\n return this._elementRef.nativeElement.id;\r\n }\r\n\r\n ngOnInit(): void {\r\n if (!this.animationName()) {\r\n return;\r\n }\r\n this._isVisible = false;\r\n const shouldUseScroll = this.useScroll() ?? (this.useScroll() === false ? false : true);\r\n const thresholdValue = this.threshold() ?? 0.5;\r\n \r\n if ('IntersectionObserver' in window && shouldUseScroll) {\r\n const options: IntersectionObserverInit = {\r\n root: null,\r\n threshold: thresholdValue,\r\n rootMargin: '0px',\r\n };\r\n const observer: IntersectionObserver = new IntersectionObserver(\r\n (entries) => {\r\n entries.forEach((entry) => {\r\n if (!entry.isIntersecting) {\r\n return;\r\n }\r\n this.addAnimationClass();\r\n });\r\n },\r\n options\r\n );\r\n observer.observe(this._elementRef.nativeElement);\r\n return;\r\n }\r\n this._scrollSub = this._scroll.scrollObs.subscribe(() =>\r\n this.manageVisibility()\r\n );\r\n this._resizeSub = this._scroll.resizeObs.subscribe(() =>\r\n this.manageVisibility()\r\n );\r\n }\r\n\r\n ngAfterViewInit(): void {\r\n setTimeout(() => this.manageVisibility(), 1);\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this._scrollSub.unsubscribe();\r\n this._resizeSub.unsubscribe();\r\n }\r\n\r\n private manageVisibility(): void {\r\n if (this._isVisible) {\r\n return;\r\n }\r\n this.getWinHeight();\r\n this.getOffsetTop();\r\n const scrollTrigger = this._offsetTop + this.offset() - this._winHeight;\r\n if (this._scroll.pos >= scrollTrigger) {\r\n this.addAnimationClass();\r\n }\r\n }\r\n\r\n private addAnimationClass(): void {\r\n if (!this.animationName()) {\r\n return;\r\n }\r\n this._isVisible = true;\r\n this.setClass(this.animationName()!);\r\n }\r\n\r\n private setClass(classes: string): void {\r\n for (const c of classes.split(' ')) {\r\n this._renderer.addClass(this._elementRef.nativeElement, c);\r\n }\r\n }\r\n\r\n private getWinHeight(): void {\r\n this._winHeight = typeof window !== 'undefined' ? window.innerHeight : 0;\r\n }\r\n\r\n private getOffsetTop(): void {\r\n if (\r\n typeof this._elementRef.nativeElement.getBoundingClientRect === 'function'\r\n ) {\r\n const viewportTop =\r\n this._elementRef.nativeElement.getBoundingClientRect().top;\r\n const clientTop = this._elementRef.nativeElement.clientTop;\r\n this._offsetTop = viewportTop + this._scroll.pos - clientTop;\r\n } else {\r\n this._offsetTop = 0;\r\n }\r\n }\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;CAAA,UAAA;CAAA,MAAA;CAA8B,YAAA,CAAA;EAJ1C,MAAA;EAAU,MAAA,CAAA;GACP,UAAU;GACV,WAAU,CAAC,aAAa;EAC3B,CAAA"}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Component, Injectable, ViewEncapsulation, inject } from "@angular/core";
|
|
3
|
+
import { NgClass } from "@angular/common";
|
|
4
|
+
import * as i1 from "@angular/material/button";
|
|
5
|
+
import { MatButtonModule } from "@angular/material/button";
|
|
6
|
+
import * as i3 from "@angular/material/icon";
|
|
7
|
+
import { MatIconModule } from "@angular/material/icon";
|
|
8
|
+
import { merge } from "lodash-es";
|
|
9
|
+
import * as i2 from "@angular/material/dialog";
|
|
10
|
+
import { MAT_DIALOG_DATA, MatDialog, MatDialogModule, MatDialogRef } from "@angular/material/dialog";
|
|
11
|
+
var CmatConfirmationDialogComponent = class CmatConfirmationDialogComponent {
|
|
12
|
+
constructor() {
|
|
13
|
+
this.data = inject(MAT_DIALOG_DATA);
|
|
14
|
+
this.matDialogRef = inject(MatDialogRef);
|
|
15
|
+
}
|
|
16
|
+
static {
|
|
17
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
18
|
+
minVersion: "12.0.0",
|
|
19
|
+
version: "22.3.0",
|
|
20
|
+
ngImport: i0,
|
|
21
|
+
type: CmatConfirmationDialogComponent,
|
|
22
|
+
deps: [],
|
|
23
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
static {
|
|
27
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
28
|
+
minVersion: "17.0.0",
|
|
29
|
+
version: "22.3.0",
|
|
30
|
+
type: CmatConfirmationDialogComponent,
|
|
31
|
+
isStandalone: true,
|
|
32
|
+
selector: "cmat-confirmation-dialog",
|
|
33
|
+
ngImport: i0,
|
|
34
|
+
template: "<div class=\"relative flex flex-col w-full h-full\">\r\n\r\n \r\n @if (data.dismissible) {\r\n <div class=\"absolute top-0 right-0 pt-4 pr-4\">\r\n <button type=\"button\" matIconButton [matDialogClose]=\"undefined\">\r\n <mat-icon class=\"text-secondary\" [svgIcon]=\"'heroicons_outline:x-mark'\"></mat-icon>\r\n </button>\r\n </div>\r\n }\r\n\r\n \r\n <div class=\"flex flex-col md:flex-row items-center md:items-start p-8 pb-6 md:pb-8\">\r\n\r\n \r\n @if (data.icon?.show) {\r\n <div class=\"flex flex-none items-center justify-center w-10 h-10 md:mr-4 rounded-full\" [ngClass]=\"{'text-primary-600 bg-primary-100 dark:text-primary-50 dark:bg-primary-600': data.icon.color === 'primary',\r\n 'text-accent-600 bg-accent-100 dark:text-accent-50 dark:bg-accent-600': data.icon.color === 'accent',\r\n 'text-warn-600 bg-warn-100 dark:text-warn-50 dark:bg-warn-600': data.icon.color === 'warn',\r\n 'text-slate-600 bg-slate-100 dark:text-slate-50 dark:bg-slate-600': data.icon.color === 'basic',\r\n 'text-blue-600 bg-blue-100 dark:text-blue-50 dark:bg-blue-600': data.icon.color === 'info',\r\n 'text-emerald-500 bg-emerald-100 dark:text-emerald-50 dark:bg-emerald-500': data.icon.color === 'success',\r\n 'text-amber-500 bg-amber-100 dark:text-amber-50 dark:bg-amber-500': data.icon.color === 'warning',\r\n 'text-red-600 bg-red-100 dark:text-red-50 dark:bg-red-600': data.icon.color === 'error'\r\n }\">\r\n @if (data.icon.name) {\r\n <mat-icon class=\"text-current\" [svgIcon]=\"data.icon.name||''\"></mat-icon>\r\n }\r\n </div>\r\n }\r\n\r\n @if (data.title || data.message) {\r\n <div\r\n class=\"flex flex-col items-center md:items-start mt-4 md:mt-0 md:pr-8 gap-1 text-center md:text-left\">\r\n \r\n @if (data.title) {\r\n <div class=\"text-xl leading-6 font-medium\" [innerHTML]=\"data.title\"></div>\r\n }\r\n \r\n @if (data.message) {\r\n <div class=\"text-secondary\" [innerHTML]=\"data.message\"></div>\r\n }\r\n </div>\r\n }\r\n\r\n </div>\r\n\r\n \r\n @if (data.actions.confirm?.show || data.actions.cancel?.show) {\r\n <div\r\n class=\"flex items-center justify-center md:justify-end px-6 py-4 flex-row gap-3 bg-slate-50 dark:bg-black/10\">\r\n \r\n @if (data.actions.confirm?.show) {\r\n <button type=\"button\" matButton=\"filled\" [color]=\"data.actions.confirm.color\"\r\n [matDialogClose]=\"'confirmed'\">\r\n {{data.actions.confirm.label}}\r\n </button>\r\n }\r\n \r\n @if (data.actions.cancel?.show) {\r\n <button type=\"button\" matButton=\"outlined\" [matDialogClose]=\"'cancelled'\">\r\n {{data.actions.cancel.label}}\r\n </button>\r\n }\r\n </div>\r\n }\r\n\r\n</div>",
|
|
35
|
+
styles: [".cmat-confirmation-dialog-panel .mat-mdc-dialog-container{padding:0!important}\n"],
|
|
36
|
+
dependencies: [
|
|
37
|
+
{
|
|
38
|
+
kind: "ngmodule",
|
|
39
|
+
type: MatButtonModule
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
kind: "component",
|
|
43
|
+
type: i1.MatButton,
|
|
44
|
+
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] ",
|
|
45
|
+
inputs: ["matButton"],
|
|
46
|
+
exportAs: ["matButton", "matAnchor"]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
kind: "component",
|
|
50
|
+
type: i1.MatIconButton,
|
|
51
|
+
selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]",
|
|
52
|
+
exportAs: ["matButton", "matAnchor"]
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
kind: "ngmodule",
|
|
56
|
+
type: MatDialogModule
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
kind: "directive",
|
|
60
|
+
type: i2.MatDialogClose,
|
|
61
|
+
selector: "[mat-dialog-close], [matDialogClose]",
|
|
62
|
+
inputs: [
|
|
63
|
+
"aria-label",
|
|
64
|
+
"type",
|
|
65
|
+
"mat-dialog-close",
|
|
66
|
+
"matDialogClose"
|
|
67
|
+
],
|
|
68
|
+
exportAs: ["matDialogClose"]
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
kind: "ngmodule",
|
|
72
|
+
type: MatIconModule
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
kind: "component",
|
|
76
|
+
type: i3.MatIcon,
|
|
77
|
+
selector: "mat-icon",
|
|
78
|
+
inputs: [
|
|
79
|
+
"color",
|
|
80
|
+
"inline",
|
|
81
|
+
"svgIcon",
|
|
82
|
+
"fontSet",
|
|
83
|
+
"fontIcon"
|
|
84
|
+
],
|
|
85
|
+
exportAs: ["matIcon"]
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
kind: "directive",
|
|
89
|
+
type: NgClass,
|
|
90
|
+
selector: "[ngClass]",
|
|
91
|
+
inputs: ["class", "ngClass"]
|
|
92
|
+
}
|
|
93
|
+
],
|
|
94
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
99
|
+
minVersion: "12.0.0",
|
|
100
|
+
version: "22.3.0",
|
|
101
|
+
ngImport: i0,
|
|
102
|
+
type: CmatConfirmationDialogComponent,
|
|
103
|
+
decorators: [{
|
|
104
|
+
type: Component,
|
|
105
|
+
args: [{
|
|
106
|
+
selector: "cmat-confirmation-dialog",
|
|
107
|
+
encapsulation: ViewEncapsulation.None,
|
|
108
|
+
imports: [
|
|
109
|
+
MatButtonModule,
|
|
110
|
+
MatDialogModule,
|
|
111
|
+
MatIconModule,
|
|
112
|
+
NgClass
|
|
113
|
+
],
|
|
114
|
+
template: "<div class=\"relative flex flex-col w-full h-full\">\r\n\r\n \r\n @if (data.dismissible) {\r\n <div class=\"absolute top-0 right-0 pt-4 pr-4\">\r\n <button type=\"button\" matIconButton [matDialogClose]=\"undefined\">\r\n <mat-icon class=\"text-secondary\" [svgIcon]=\"'heroicons_outline:x-mark'\"></mat-icon>\r\n </button>\r\n </div>\r\n }\r\n\r\n \r\n <div class=\"flex flex-col md:flex-row items-center md:items-start p-8 pb-6 md:pb-8\">\r\n\r\n \r\n @if (data.icon?.show) {\r\n <div class=\"flex flex-none items-center justify-center w-10 h-10 md:mr-4 rounded-full\" [ngClass]=\"{'text-primary-600 bg-primary-100 dark:text-primary-50 dark:bg-primary-600': data.icon.color === 'primary',\r\n 'text-accent-600 bg-accent-100 dark:text-accent-50 dark:bg-accent-600': data.icon.color === 'accent',\r\n 'text-warn-600 bg-warn-100 dark:text-warn-50 dark:bg-warn-600': data.icon.color === 'warn',\r\n 'text-slate-600 bg-slate-100 dark:text-slate-50 dark:bg-slate-600': data.icon.color === 'basic',\r\n 'text-blue-600 bg-blue-100 dark:text-blue-50 dark:bg-blue-600': data.icon.color === 'info',\r\n 'text-emerald-500 bg-emerald-100 dark:text-emerald-50 dark:bg-emerald-500': data.icon.color === 'success',\r\n 'text-amber-500 bg-amber-100 dark:text-amber-50 dark:bg-amber-500': data.icon.color === 'warning',\r\n 'text-red-600 bg-red-100 dark:text-red-50 dark:bg-red-600': data.icon.color === 'error'\r\n }\">\r\n @if (data.icon.name) {\r\n <mat-icon class=\"text-current\" [svgIcon]=\"data.icon.name||''\"></mat-icon>\r\n }\r\n </div>\r\n }\r\n\r\n @if (data.title || data.message) {\r\n <div\r\n class=\"flex flex-col items-center md:items-start mt-4 md:mt-0 md:pr-8 gap-1 text-center md:text-left\">\r\n \r\n @if (data.title) {\r\n <div class=\"text-xl leading-6 font-medium\" [innerHTML]=\"data.title\"></div>\r\n }\r\n \r\n @if (data.message) {\r\n <div class=\"text-secondary\" [innerHTML]=\"data.message\"></div>\r\n }\r\n </div>\r\n }\r\n\r\n </div>\r\n\r\n \r\n @if (data.actions.confirm?.show || data.actions.cancel?.show) {\r\n <div\r\n class=\"flex items-center justify-center md:justify-end px-6 py-4 flex-row gap-3 bg-slate-50 dark:bg-black/10\">\r\n \r\n @if (data.actions.confirm?.show) {\r\n <button type=\"button\" matButton=\"filled\" [color]=\"data.actions.confirm.color\"\r\n [matDialogClose]=\"'confirmed'\">\r\n {{data.actions.confirm.label}}\r\n </button>\r\n }\r\n \r\n @if (data.actions.cancel?.show) {\r\n <button type=\"button\" matButton=\"outlined\" [matDialogClose]=\"'cancelled'\">\r\n {{data.actions.cancel.label}}\r\n </button>\r\n }\r\n </div>\r\n }\r\n\r\n</div>",
|
|
115
|
+
styles: [".cmat-confirmation-dialog-panel .mat-mdc-dialog-container{padding:0!important}\n"]
|
|
116
|
+
}]
|
|
117
|
+
}]
|
|
118
|
+
});
|
|
119
|
+
var CmatConfirmationService = class CmatConfirmationService {
|
|
120
|
+
constructor() {
|
|
121
|
+
this._matDialog = inject(MatDialog);
|
|
122
|
+
this._defaultConfig = {
|
|
123
|
+
title: "确认操作",
|
|
124
|
+
message: "确认此操作吗?",
|
|
125
|
+
icon: {
|
|
126
|
+
show: true,
|
|
127
|
+
name: "heroicons_outline:exclamation-triangle",
|
|
128
|
+
color: "warn"
|
|
129
|
+
},
|
|
130
|
+
actions: {
|
|
131
|
+
confirm: {
|
|
132
|
+
show: true,
|
|
133
|
+
label: "确认",
|
|
134
|
+
color: "warn"
|
|
135
|
+
},
|
|
136
|
+
cancel: {
|
|
137
|
+
show: true,
|
|
138
|
+
label: "取消"
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
dismissible: false
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
open(config) {
|
|
145
|
+
const userConfig = merge({}, this._defaultConfig, config);
|
|
146
|
+
return this._matDialog.open(CmatConfirmationDialogComponent, {
|
|
147
|
+
autoFocus: false,
|
|
148
|
+
disableClose: !userConfig.dismissible,
|
|
149
|
+
data: userConfig,
|
|
150
|
+
panelClass: "cmat-confirmation-dialog-panel"
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
static {
|
|
154
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
155
|
+
minVersion: "12.0.0",
|
|
156
|
+
version: "22.3.0",
|
|
157
|
+
ngImport: i0,
|
|
158
|
+
type: CmatConfirmationService,
|
|
159
|
+
deps: [],
|
|
160
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
static {
|
|
164
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
165
|
+
minVersion: "12.0.0",
|
|
166
|
+
version: "22.3.0",
|
|
167
|
+
ngImport: i0,
|
|
168
|
+
type: CmatConfirmationService,
|
|
169
|
+
providedIn: "root"
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
174
|
+
minVersion: "12.0.0",
|
|
175
|
+
version: "22.3.0",
|
|
176
|
+
ngImport: i0,
|
|
177
|
+
type: CmatConfirmationService,
|
|
178
|
+
decorators: [{
|
|
179
|
+
type: Injectable,
|
|
180
|
+
args: [{ providedIn: "root" }]
|
|
181
|
+
}]
|
|
182
|
+
});
|
|
183
|
+
export { CmatConfirmationService as t };
|
|
184
|
+
|
|
185
|
+
//# sourceMappingURL=public-api-C9N9rKkB.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-api-C9N9rKkB.mjs","names":[],"sources":["../../../projects/cmat/services/confirmation/dialog/dialog.component.ts","../../../projects/cmat/services/confirmation/dialog/dialog.component.html","../../../projects/cmat/services/confirmation/confirmation.service.ts"],"sourcesContent":["import { NgClass } from '@angular/common';\r\nimport { Component, ViewEncapsulation, inject } from '@angular/core';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MAT_DIALOG_DATA, MatDialogRef, MatDialogModule } from '@angular/material/dialog';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { CmatConfirmationConfig } from '../confirmation.types';\r\n\r\n@Component({\r\n selector: 'cmat-confirmation-dialog',\r\n templateUrl: './dialog.component.html',\r\n styles: [\r\n /* language=SCSS */\r\n `\r\n .cmat-confirmation-dialog-panel {\r\n .mat-mdc-dialog-container {\r\n padding: 0 !important;\r\n }\r\n }\r\n `\r\n ],\r\n encapsulation: ViewEncapsulation.None,\r\n imports: [MatButtonModule, MatDialogModule, MatIconModule, NgClass]\r\n})\r\nexport class CmatConfirmationDialogComponent {\r\n data = inject<CmatConfirmationConfig>(MAT_DIALOG_DATA);\r\n matDialogRef = inject<MatDialogRef<CmatConfirmationDialogComponent>>(MatDialogRef);\r\n}\r\n","<div class=\"relative flex flex-col w-full h-full\">\r\n\r\n \r\n @if (data.dismissible) {\r\n <div class=\"absolute top-0 right-0 pt-4 pr-4\">\r\n <button type=\"button\" matIconButton [matDialogClose]=\"undefined\">\r\n <mat-icon class=\"text-secondary\" [svgIcon]=\"'heroicons_outline:x-mark'\"></mat-icon>\r\n </button>\r\n </div>\r\n }\r\n\r\n \r\n <div class=\"flex flex-col md:flex-row items-center md:items-start p-8 pb-6 md:pb-8\">\r\n\r\n \r\n @if (data.icon?.show) {\r\n <div class=\"flex flex-none items-center justify-center w-10 h-10 md:mr-4 rounded-full\" [ngClass]=\"{'text-primary-600 bg-primary-100 dark:text-primary-50 dark:bg-primary-600': data.icon.color === 'primary',\r\n 'text-accent-600 bg-accent-100 dark:text-accent-50 dark:bg-accent-600': data.icon.color === 'accent',\r\n 'text-warn-600 bg-warn-100 dark:text-warn-50 dark:bg-warn-600': data.icon.color === 'warn',\r\n 'text-slate-600 bg-slate-100 dark:text-slate-50 dark:bg-slate-600': data.icon.color === 'basic',\r\n 'text-blue-600 bg-blue-100 dark:text-blue-50 dark:bg-blue-600': data.icon.color === 'info',\r\n 'text-emerald-500 bg-emerald-100 dark:text-emerald-50 dark:bg-emerald-500': data.icon.color === 'success',\r\n 'text-amber-500 bg-amber-100 dark:text-amber-50 dark:bg-amber-500': data.icon.color === 'warning',\r\n 'text-red-600 bg-red-100 dark:text-red-50 dark:bg-red-600': data.icon.color === 'error'\r\n }\">\r\n @if (data.icon.name) {\r\n <mat-icon class=\"text-current\" [svgIcon]=\"data.icon.name||''\"></mat-icon>\r\n }\r\n </div>\r\n }\r\n\r\n @if (data.title || data.message) {\r\n <div\r\n class=\"flex flex-col items-center md:items-start mt-4 md:mt-0 md:pr-8 gap-1 text-center md:text-left\">\r\n \r\n @if (data.title) {\r\n <div class=\"text-xl leading-6 font-medium\" [innerHTML]=\"data.title\"></div>\r\n }\r\n \r\n @if (data.message) {\r\n <div class=\"text-secondary\" [innerHTML]=\"data.message\"></div>\r\n }\r\n </div>\r\n }\r\n\r\n </div>\r\n\r\n \r\n @if (data.actions.confirm?.show || data.actions.cancel?.show) {\r\n <div\r\n class=\"flex items-center justify-center md:justify-end px-6 py-4 flex-row gap-3 bg-slate-50 dark:bg-black/10\">\r\n \r\n @if (data.actions.confirm?.show) {\r\n <button type=\"button\" matButton=\"filled\" [color]=\"data.actions.confirm.color\"\r\n [matDialogClose]=\"'confirmed'\">\r\n {{data.actions.confirm.label}}\r\n </button>\r\n }\r\n \r\n @if (data.actions.cancel?.show) {\r\n <button type=\"button\" matButton=\"outlined\" [matDialogClose]=\"'cancelled'\">\r\n {{data.actions.cancel.label}}\r\n </button>\r\n }\r\n </div>\r\n }\r\n\r\n</div>","import { Injectable, inject } from '@angular/core';\r\nimport { MatDialog, MatDialogRef } from '@angular/material/dialog';\r\nimport { merge } from 'lodash-es';\r\nimport { CmatConfirmationConfig } from './confirmation.types';\r\nimport { CmatConfirmationDialogComponent } from './dialog/dialog.component';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CmatConfirmationService {\r\n private _matDialog = inject(MatDialog);\r\n\r\n private _defaultConfig: CmatConfirmationConfig = {\r\n title: '确认操作',\r\n message: '确认此操作吗?',\r\n icon: {\r\n show: true,\r\n name: 'heroicons_outline:exclamation-triangle',\r\n color: 'warn'\r\n },\r\n actions: {\r\n confirm: {\r\n show: true,\r\n label: '确认',\r\n color: 'warn'\r\n },\r\n cancel: {\r\n show: true,\r\n label: '取消'\r\n }\r\n },\r\n dismissible: false\r\n };\r\n\r\n open(config: CmatConfirmationConfig): MatDialogRef<CmatConfirmationDialogComponent> {\r\n const userConfig = merge({}, this._defaultConfig, config);\r\n return this._matDialog.open(CmatConfirmationDialogComponent, {\r\n autoFocus: false,\r\n disableClose: !userConfig.dismissible,\r\n data: userConfig,\r\n panelClass: 'cmat-confirmation-dialog-panel'\r\n });\r\n }\r\n}\r\n"],"mappings":";;;;;;;;;;AAuBA,IAAa,kCAAb,MAAa,gCAA+B;CAhB5C,cAAA;EAiBI,KAAA,OAAO,OAA+B,eAAe;EACrD,KAAA,eAAe,OAAsD,YAAY;CACpF;CAHY;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAA+B,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAA/B;EAAA,KAAA,OAAA,GAAA,qBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,MAAA;GAA+B,cAAA;GAAA,UAAA;GAAA,UAAA;GAAA,UCvB5C;GAmEM,QAAA,CAAA,kFAAA;GAAA,cAAA;IAAA;KAAA,MAAA;KAAA,MD9CQ;IAAe;IAAA;KAAA,MAAA;KAAA,MAAA,GAAA;KAAA,UAAA;KAAA,QAAA,CAAA,WAAA;KAAA,UAAA,CAAA,aAAA,WAAA;IAAA;IAAA;KAAA,MAAA;KAAA,MAAA,GAAA;KAAA,UAAA;KAAA,UAAA,CAAA,aAAA,WAAA;IAAA;IAAA;KAAA,MAAA;KAAA,MAAE;IAAe;IAAA;KAAA,MAAA;KAAA,MAAA,GAAA;KAAA,UAAA;KAAA,QAAA;MAAA;MAAA;MAAA;MAAA;KAAA;KAAA,UAAA,CAAA,gBAAA;IAAA;IAAA;KAAA,MAAA;KAAA,MAAE;IAAa;IAAA;KAAA,MAAA;KAAA,MAAA,GAAA;KAAA,UAAA;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