cmat 0.0.109 → 0.0.111
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 +9 -9
- package/fesm2022/cmat-components-breadcrumb.mjs.map +1 -1
- package/fesm2022/cmat-components-card.mjs +3 -3
- package/fesm2022/cmat-components-card.mjs.map +1 -1
- package/fesm2022/cmat-components-carousel.mjs +12 -12
- package/fesm2022/cmat-components-carousel.mjs.map +1 -1
- package/fesm2022/cmat-components-cascade.mjs +9 -9
- package/fesm2022/cmat-components-cascade.mjs.map +1 -1
- package/fesm2022/cmat-components-chip-input.mjs +3 -3
- package/fesm2022/cmat-components-chip-input.mjs.map +1 -1
- package/fesm2022/cmat-components-code-editor.mjs +3 -3
- package/fesm2022/cmat-components-code-editor.mjs.map +1 -1
- package/fesm2022/cmat-components-color-picker.mjs +28 -28
- package/fesm2022/cmat-components-color-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-custom-formly.mjs +98 -98
- package/fesm2022/cmat-components-custom-formly.mjs.map +1 -1
- package/fesm2022/cmat-components-data-picker.mjs +15 -15
- package/fesm2022/cmat-components-data-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-date-range.mjs +5 -5
- package/fesm2022/cmat-components-date-range.mjs.map +1 -1
- package/fesm2022/cmat-components-date-time-display.mjs +3 -3
- package/fesm2022/cmat-components-date-time-display.mjs.map +1 -1
- package/fesm2022/cmat-components-drawer.mjs +6 -6
- package/fesm2022/cmat-components-drawer.mjs.map +1 -1
- package/fesm2022/cmat-components-empty-state.mjs +3 -3
- package/fesm2022/cmat-components-empty-state.mjs.map +1 -1
- package/fesm2022/cmat-components-file-preview.mjs +3 -3
- package/fesm2022/cmat-components-file-preview.mjs.map +1 -1
- package/fesm2022/cmat-components-filter-toolbar.mjs +3 -3
- package/fesm2022/cmat-components-filter-toolbar.mjs.map +1 -1
- package/fesm2022/cmat-components-form-actions.mjs +3 -3
- package/fesm2022/cmat-components-form-actions.mjs.map +1 -1
- package/fesm2022/cmat-components-fullscreen.mjs +3 -3
- package/fesm2022/cmat-components-fullscreen.mjs.map +1 -1
- package/fesm2022/cmat-components-highlight.mjs +6 -6
- package/fesm2022/cmat-components-highlight.mjs.map +1 -1
- package/fesm2022/cmat-components-image-viewer.mjs +3 -3
- package/fesm2022/cmat-components-image-viewer.mjs.map +1 -1
- package/fesm2022/cmat-components-inline-loading.mjs +3 -3
- package/fesm2022/cmat-components-inline-loading.mjs.map +1 -1
- package/fesm2022/cmat-components-json-editor.mjs +3 -3
- package/fesm2022/cmat-components-json-editor.mjs.map +1 -1
- package/fesm2022/cmat-components-knob-input.mjs +3 -3
- package/fesm2022/cmat-components-knob-input.mjs.map +1 -1
- package/fesm2022/cmat-components-loading-overlay.mjs +3 -3
- package/fesm2022/cmat-components-loading-overlay.mjs.map +1 -1
- package/fesm2022/cmat-components-masonry.mjs +3 -3
- package/fesm2022/cmat-components-masonry.mjs.map +1 -1
- package/fesm2022/cmat-components-material-color-picker.mjs +3 -3
- package/fesm2022/cmat-components-material-color-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-material-datetimepicker.mjs +42 -42
- package/fesm2022/cmat-components-material-datetimepicker.mjs.map +1 -1
- package/fesm2022/cmat-components-navigation.mjs +39 -39
- package/fesm2022/cmat-components-navigation.mjs.map +1 -1
- package/fesm2022/cmat-components-opt-input.mjs +3 -3
- package/fesm2022/cmat-components-opt-input.mjs.map +1 -1
- package/fesm2022/cmat-components-org-chart.mjs +9 -9
- package/fesm2022/cmat-components-org-chart.mjs.map +1 -1
- package/fesm2022/cmat-components-page-header.mjs +3 -3
- package/fesm2022/cmat-components-page-header.mjs.map +1 -1
- package/fesm2022/cmat-components-pagination.mjs +12 -12
- package/fesm2022/cmat-components-pagination.mjs.map +1 -1
- package/fesm2022/cmat-components-password-strength.mjs +9 -9
- package/fesm2022/cmat-components-password-strength.mjs.map +1 -1
- package/fesm2022/cmat-components-popover.mjs +9 -9
- package/fesm2022/cmat-components-popover.mjs.map +1 -1
- package/fesm2022/cmat-components-progress-bar.mjs +3 -3
- package/fesm2022/cmat-components-progress-bar.mjs.map +1 -1
- package/fesm2022/cmat-components-qrcode.mjs +3 -3
- package/fesm2022/cmat-components-qrcode.mjs.map +1 -1
- package/fesm2022/cmat-components-rating.mjs +3 -3
- package/fesm2022/cmat-components-rating.mjs.map +1 -1
- package/fesm2022/cmat-components-rich-text-editor.mjs +3 -3
- package/fesm2022/cmat-components-rich-text-editor.mjs.map +1 -1
- package/fesm2022/cmat-components-select-search.mjs +9 -9
- package/fesm2022/cmat-components-select-search.mjs.map +1 -1
- package/fesm2022/cmat-components-select-table.mjs +6 -4
- package/fesm2022/cmat-components-select-table.mjs.map +1 -1
- package/fesm2022/cmat-components-select-tree.mjs +3 -3
- package/fesm2022/cmat-components-select-tree.mjs.map +1 -1
- package/fesm2022/cmat-components-skeleton.mjs +3 -3
- package/fesm2022/cmat-components-skeleton.mjs.map +1 -1
- package/fesm2022/cmat-components-speed-dial.mjs +9 -9
- package/fesm2022/cmat-components-speed-dial.mjs.map +1 -1
- package/fesm2022/cmat-components-status-tag.mjs +3 -3
- package/fesm2022/cmat-components-status-tag.mjs.map +1 -1
- package/fesm2022/cmat-components-table-toolbar.mjs +3 -3
- package/fesm2022/cmat-components-table-toolbar.mjs.map +1 -1
- package/fesm2022/cmat-components-timeline.mjs +12 -12
- package/fesm2022/cmat-components-timeline.mjs.map +1 -1
- package/fesm2022/cmat-components-toast.mjs +9 -9
- package/fesm2022/cmat-components-toast.mjs.map +1 -1
- package/fesm2022/cmat-components-transfer-picker.mjs +18 -18
- package/fesm2022/cmat-components-transfer-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-treetable.mjs +7 -7
- package/fesm2022/cmat-components-treetable.mjs.map +1 -1
- package/fesm2022/cmat-components-upload.mjs +9 -9
- package/fesm2022/cmat-components-upload.mjs.map +1 -1
- package/fesm2022/cmat-components-x6-angular-shape.mjs.map +1 -1
- package/fesm2022/cmat-directives-animate-on-scroll.mjs +6 -6
- package/fesm2022/cmat-directives-animate-on-scroll.mjs.map +1 -1
- package/fesm2022/cmat-directives-arrow-cursor.mjs +3 -3
- 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 +21 -21
- package/fesm2022/cmat-directives-data-exporter.mjs.map +1 -1
- package/fesm2022/cmat-directives-debounce.mjs +9 -9
- package/fesm2022/cmat-directives-debounce.mjs.map +1 -1
- package/fesm2022/cmat-directives-digit-only.mjs +6 -6
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- package/fesm2022/cmat-services-alert.mjs.map +1 -1
- package/fesm2022/cmat-services-config.mjs +6 -6
- package/fesm2022/cmat-services-config.mjs.map +1 -1
- package/fesm2022/cmat-services-confirmation.mjs +6 -6
- package/fesm2022/cmat-services-confirmation.mjs.map +1 -1
- package/fesm2022/cmat-services-data.mjs +3 -3
- 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 +6 -6
- 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 +3 -3
- 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-print.mjs +1117 -0
- package/fesm2022/cmat-services-print.mjs.map +1 -0
- 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 +3 -3
- package/fesm2022/cmat-services-translation.mjs.map +1 -1
- package/fesm2022/cmat-services-utils.mjs +3 -3
- package/fesm2022/cmat-services-utils.mjs.map +1 -1
- package/fesm2022/cmat-validators.mjs.map +1 -1
- package/fesm2022/cmat-version.mjs.map +1 -1
- package/fesm2022/cmat.mjs +1672 -562
- package/fesm2022/cmat.mjs.map +1 -1
- package/package.json +5 -1
- package/styles/components/bundle.scss +13 -0
- package/styles/overrides/angular-material.scss +23 -0
- package/types/cmat-services-print.d.ts +104 -0
- package/types/cmat.d.ts +104 -4
|
@@ -20,10 +20,10 @@ class CmatFilePreviewComponent {
|
|
|
20
20
|
this.previewImage = input(true, /* @ts-ignore */
|
|
21
21
|
...(ngDevMode ? [{ debugName: "previewImage" }] : /* istanbul ignore next */ []));
|
|
22
22
|
}
|
|
23
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
24
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.
|
|
23
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatFilePreviewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
24
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.0", type: CmatFilePreviewComponent, isStandalone: true, selector: "cmat-file-preview", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, fileType: { classPropertyName: "fileType", publicName: "fileType", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, src: { classPropertyName: "src", publicName: "src", isSignal: true, isRequired: false, transformFunction: null }, previewImage: { classPropertyName: "previewImage", publicName: "previewImage", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"flex flex-col gap-4 rounded-2xl bg-card p-4 shadow-sm md:flex-row md:items-start\">\r\n <div\r\n class=\"flex h-24 w-24 flex-none items-center justify-center overflow-hidden rounded-xl bg-slate-200 dark:bg-slate-600 text-slate-300 dark:text-slate-500\">\r\n @if (previewImage() && src()) {\r\n <cmat-image class=\"h-full w-full object-cover\" [src]=\"src()\" [alt]=\"name()\" [preview]=\"true\"></cmat-image>\r\n } @else {\r\n <mat-icon [svgIcon]=\"'mat_outline:description'\"></mat-icon>\r\n }\r\n </div>\r\n\r\n <div class=\"min-w-0 flex-1\">\r\n <div class=\"flex flex-col gap-1\">\r\n <div class=\"truncate text-base font-semibold\">{{ name() }}</div>\r\n\r\n @if (description()) {\r\n <div class=\"text-sm leading-6 text-slate-500 dark:text-slate-300\">{{ description() }}</div>\r\n }\r\n </div>\r\n\r\n <div class=\"mt-3 flex flex-wrap items-center gap-3 text-sm \">\r\n @if (fileType()) {\r\n <span class=\"rounded-full bg-slate-100 dark:bg-slate-600 px-2 py-0.5\">{{ fileType() }}</span>\r\n }\r\n @if (size()) {\r\n <span class=\" text-slate-500 dark:text-slate-300\">{{ size() }}</span>\r\n }\r\n </div>\r\n </div>\r\n</div>", styles: [":host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: CmatImageComponent, selector: "cmat-image", inputs: ["imageClass", "imageStyle", "src", "srcSet", "previewImageSrc", "previewImageSrcSet", "alt", "width", "height", "loading", "appendTo", "preview"], outputs: ["previewShowChange", "imageErrorEvent"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
25
25
|
}
|
|
26
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
26
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatFilePreviewComponent, decorators: [{
|
|
27
27
|
type: Component,
|
|
28
28
|
args: [{ selector: 'cmat-file-preview', changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, CmatImageComponent, MatIconModule], template: "<div class=\"flex flex-col gap-4 rounded-2xl bg-card p-4 shadow-sm md:flex-row md:items-start\">\r\n <div\r\n class=\"flex h-24 w-24 flex-none items-center justify-center overflow-hidden rounded-xl bg-slate-200 dark:bg-slate-600 text-slate-300 dark:text-slate-500\">\r\n @if (previewImage() && src()) {\r\n <cmat-image class=\"h-full w-full object-cover\" [src]=\"src()\" [alt]=\"name()\" [preview]=\"true\"></cmat-image>\r\n } @else {\r\n <mat-icon [svgIcon]=\"'mat_outline:description'\"></mat-icon>\r\n }\r\n </div>\r\n\r\n <div class=\"min-w-0 flex-1\">\r\n <div class=\"flex flex-col gap-1\">\r\n <div class=\"truncate text-base font-semibold\">{{ name() }}</div>\r\n\r\n @if (description()) {\r\n <div class=\"text-sm leading-6 text-slate-500 dark:text-slate-300\">{{ description() }}</div>\r\n }\r\n </div>\r\n\r\n <div class=\"mt-3 flex flex-wrap items-center gap-3 text-sm \">\r\n @if (fileType()) {\r\n <span class=\"rounded-full bg-slate-100 dark:bg-slate-600 px-2 py-0.5\">{{ fileType() }}</span>\r\n }\r\n @if (size()) {\r\n <span class=\" text-slate-500 dark:text-slate-300\">{{ size() }}</span>\r\n }\r\n </div>\r\n </div>\r\n</div>", styles: [":host{display:block}\n"] }]
|
|
29
29
|
}], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], fileType: [{ type: i0.Input, args: [{ isSignal: true, alias: "fileType", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], src: [{ type: i0.Input, args: [{ isSignal: true, alias: "src", required: false }] }], previewImage: [{ type: i0.Input, args: [{ isSignal: true, alias: "previewImage", required: false }] }] } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmat-components-file-preview.mjs","sources":["../../../projects/cmat/components/file-preview/file-preview.component.ts","../../../projects/cmat/components/file-preview/file-preview.component.html","../../../projects/cmat/components/file-preview/cmat-components-file-preview.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\r\nimport { ChangeDetectionStrategy, Component, input } from '@angular/core';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { CmatImageComponent } from 'cmat/components/image-viewer';\r\n\r\n@Component({\r\n selector: 'cmat-file-preview',\r\n templateUrl: './file-preview.component.html',\r\n styleUrls: ['./file-preview.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [CommonModule, CmatImageComponent, MatIconModule]\r\n})\r\nexport class CmatFilePreviewComponent {\r\n readonly name = input<string>('');\r\n readonly description = input<string>('');\r\n readonly fileType = input<string>('file');\r\n readonly size = input<string>('');\r\n readonly src = input<string>('');\r\n readonly previewImage = input<boolean>(true);\r\n}","<div class=\"flex flex-col gap-4 rounded-2xl bg-card p-4 shadow-sm md:flex-row md:items-start\">\r\n <div\r\n class=\"flex h-24 w-24 flex-none items-center justify-center overflow-hidden rounded-xl bg-slate-200 dark:bg-slate-600 text-slate-300 dark:text-slate-500\">\r\n @if (previewImage() && src()) {\r\n <cmat-image class=\"h-full w-full object-cover\" [src]=\"src()\" [alt]=\"name()\" [preview]=\"true\"></cmat-image>\r\n } @else {\r\n <mat-icon [svgIcon]=\"'mat_outline:description'\"></mat-icon>\r\n }\r\n </div>\r\n\r\n <div class=\"min-w-0 flex-1\">\r\n <div class=\"flex flex-col gap-1\">\r\n <div class=\"truncate text-base font-semibold\">{{ name() }}</div>\r\n\r\n @if (description()) {\r\n <div class=\"text-sm leading-6 text-slate-500 dark:text-slate-300\">{{ description() }}</div>\r\n }\r\n </div>\r\n\r\n <div class=\"mt-3 flex flex-wrap items-center gap-3 text-sm \">\r\n @if (fileType()) {\r\n <span class=\"rounded-full bg-slate-100 dark:bg-slate-600 px-2 py-0.5\">{{ fileType() }}</span>\r\n }\r\n @if (size()) {\r\n <span class=\" text-slate-500 dark:text-slate-300\">{{ size() }}</span>\r\n }\r\n </div>\r\n </div>\r\n</div>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;MAYa,wBAAwB,CAAA;AAPrC,IAAA,WAAA,GAAA;QAQa,IAAA,CAAA,IAAI,GAAG,KAAK,CAAS,EAAE;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AA,EAAA,8zCAAA,EAAA,MAAA,EAAA,CAAA,wBAAA,CAAA,EAAA;;;AEV9D;;AAEG
|
|
1
|
+
{"version":3,"file":"cmat-components-file-preview.mjs","sources":["../../../projects/cmat/components/file-preview/file-preview.component.ts","../../../projects/cmat/components/file-preview/file-preview.component.html","../../../projects/cmat/components/file-preview/cmat-components-file-preview.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\r\nimport { ChangeDetectionStrategy, Component, input } from '@angular/core';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { CmatImageComponent } from 'cmat/components/image-viewer';\r\n\r\n@Component({\r\n selector: 'cmat-file-preview',\r\n templateUrl: './file-preview.component.html',\r\n styleUrls: ['./file-preview.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [CommonModule, CmatImageComponent, MatIconModule]\r\n})\r\nexport class CmatFilePreviewComponent {\r\n readonly name = input<string>('');\r\n readonly description = input<string>('');\r\n readonly fileType = input<string>('file');\r\n readonly size = input<string>('');\r\n readonly src = input<string>('');\r\n readonly previewImage = input<boolean>(true);\r\n}","<div class=\"flex flex-col gap-4 rounded-2xl bg-card p-4 shadow-sm md:flex-row md:items-start\">\r\n <div\r\n class=\"flex h-24 w-24 flex-none items-center justify-center overflow-hidden rounded-xl bg-slate-200 dark:bg-slate-600 text-slate-300 dark:text-slate-500\">\r\n @if (previewImage() && src()) {\r\n <cmat-image class=\"h-full w-full object-cover\" [src]=\"src()\" [alt]=\"name()\" [preview]=\"true\"></cmat-image>\r\n } @else {\r\n <mat-icon [svgIcon]=\"'mat_outline:description'\"></mat-icon>\r\n }\r\n </div>\r\n\r\n <div class=\"min-w-0 flex-1\">\r\n <div class=\"flex flex-col gap-1\">\r\n <div class=\"truncate text-base font-semibold\">{{ name() }}</div>\r\n\r\n @if (description()) {\r\n <div class=\"text-sm leading-6 text-slate-500 dark:text-slate-300\">{{ description() }}</div>\r\n }\r\n </div>\r\n\r\n <div class=\"mt-3 flex flex-wrap items-center gap-3 text-sm \">\r\n @if (fileType()) {\r\n <span class=\"rounded-full bg-slate-100 dark:bg-slate-600 px-2 py-0.5\">{{ fileType() }}</span>\r\n }\r\n @if (size()) {\r\n <span class=\" text-slate-500 dark:text-slate-300\">{{ size() }}</span>\r\n }\r\n </div>\r\n </div>\r\n</div>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;MAYa,wBAAwB,CAAA;AAPrC,IAAA,WAAA,GAAA;QAQa,IAAA,CAAA,IAAI,GAAG,KAAK,CAAS,EAAE;iFAAC;QACxB,IAAA,CAAA,WAAW,GAAG,KAAK,CAAS,EAAE;wFAAC;QAC/B,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAS,MAAM;qFAAC;QAChC,IAAA,CAAA,IAAI,GAAG,KAAK,CAAS,EAAE;iFAAC;QACxB,IAAA,CAAA,GAAG,GAAG,KAAK,CAAS,EAAE;gFAAC;QACvB,IAAA,CAAA,YAAY,GAAG,KAAK,CAAU,IAAI;yFAAC;AAC/C,IAAA;8GAPY,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAxB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,wBAAwB,60BCZrC,8zCA4BM,EAAA,MAAA,EAAA,CAAA,wBAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDlBQ,YAAY,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,kBAAkB,qQAAE,aAAa,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,UAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,SAAA,EAAA,SAAA,EAAA,UAAA,CAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAEhD,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAPpC,SAAS;+BACI,mBAAmB,EAAA,eAAA,EAGZ,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC,CAAC,YAAY,EAAE,kBAAkB,EAAE,aAAa,CAAC,EAAA,QAAA,EAAA,8zCAAA,EAAA,MAAA,EAAA,CAAA,wBAAA,CAAA,EAAA;;;AEV9D;;AAEG;;"}
|
|
@@ -55,10 +55,10 @@ class CmatFilterToolbarComponent {
|
|
|
55
55
|
this.searchControl.setValue('', { emitEvent: true });
|
|
56
56
|
this.clear.emit();
|
|
57
57
|
}
|
|
58
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
59
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.
|
|
58
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatFilterToolbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
59
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.0", type: CmatFilterToolbarComponent, isStandalone: true, selector: "cmat-filter-toolbar", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, showSearch: { classPropertyName: "showSearch", publicName: "showSearch", isSignal: true, isRequired: false, transformFunction: null }, searchText: { classPropertyName: "searchText", publicName: "searchText", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { searchTextChange: "searchTextChange", clear: "clear", searchSubmit: "searchSubmit" }, host: { classAttribute: "block" }, ngImport: i0, template: "<div class=\"flex flex-col gap-4 rounded-2xl border border-default bg-card p-4 shadow-sm\">\r\n <div class=\"flex flex-col gap-1\">\r\n @if (title()) {\r\n <h3 class=\"text-lg font-semibold text-default\">{{ title() }}</h3>\r\n }\r\n\r\n @if (description()) {\r\n <p class=\"text-sm leading-6 text-secondary\">{{ description() }}</p>\r\n }\r\n </div>\r\n\r\n <div class=\"flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between\">\r\n <div class=\"flex-1\">\r\n @if (showSearch()) {\r\n <mat-form-field class=\"w-full max-w-xl\" subscriptSizing=\"dynamic\">\r\n <mat-icon matPrefix class=\"text-secondary\" [svgIcon]=\"'heroicons_outline:magnifying-glass'\"></mat-icon>\r\n <input matInput [placeholder]=\"searchPlaceholder()\" [formControl]=\"searchControl\" (keyup.enter)=\"submitSearch()\" />\r\n @if (clearable() && searchControl.value) {\r\n <button matIconButton matSuffix type=\"button\" class=\"mx-2\" aria-label=\"\u6E05\u7A7A\u641C\u7D22\" (click)=\"clearSearch()\">\r\n <mat-icon class=\"text-secondary\" [svgIcon]=\"'heroicons_outline:x-mark'\"></mat-icon>\r\n </button>\r\n }\r\n </mat-form-field>\r\n }\r\n </div>\r\n\r\n <div class=\"flex items-center gap-2\">\r\n <ng-content select=\"[cmatFilterToolbarActions]\"></ng-content>\r\n </div>\r\n </div>\r\n</div>", styles: [":host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
60
60
|
}
|
|
61
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
61
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatFilterToolbarComponent, decorators: [{
|
|
62
62
|
type: Component,
|
|
63
63
|
args: [{ selector: 'cmat-filter-toolbar', changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, MatButtonModule, MatFormFieldModule, MatIconModule, MatInputModule, ReactiveFormsModule], host: {
|
|
64
64
|
'class': 'block'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmat-components-filter-toolbar.mjs","sources":["../../../projects/cmat/components/filter-toolbar/filter-toolbar.component.ts","../../../projects/cmat/components/filter-toolbar/filter-toolbar.component.html","../../../projects/cmat/components/filter-toolbar/cmat-components-filter-toolbar.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\r\nimport {\r\n ChangeDetectionStrategy,\r\n Component,\r\n DestroyRef,\r\n effect,\r\n inject,\r\n input,\r\n output,\r\n OnInit,\r\n} from '@angular/core';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { FormControl, ReactiveFormsModule } from '@angular/forms';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatInputModule } from '@angular/material/input';\r\n\r\n@Component({\r\n selector: 'cmat-filter-toolbar',\r\n templateUrl: './filter-toolbar.component.html',\r\n styleUrls: ['./filter-toolbar.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [CommonModule, MatButtonModule, MatFormFieldModule, MatIconModule, MatInputModule, ReactiveFormsModule],\r\n host: {\r\n 'class': 'block'\r\n }\r\n})\r\nexport class CmatFilterToolbarComponent implements OnInit {\r\n readonly title = input<string>('');\r\n readonly description = input<string>('');\r\n readonly searchPlaceholder = input<string>('搜索');\r\n readonly showSearch = input<boolean>(true);\r\n readonly searchText = input<string>('');\r\n readonly clearable = input<boolean>(true);\r\n\r\n\r\n readonly searchTextChange = output<string>();\r\n readonly clear = output<void>();\r\n readonly searchSubmit = output<string>();\r\n\r\n\r\n readonly searchControl = new FormControl<string>('');\r\n private readonly _destroyRef = inject(DestroyRef);\r\n\r\n constructor() {\r\n effect(() => {\r\n const externalText = this.searchText();\r\n const currentControlValue = this.searchControl.value;\r\n \r\n if (externalText !== currentControlValue) {\r\n this.searchControl.setValue(externalText, { emitEvent: false });\r\n }\r\n });\r\n }\r\n\r\n ngOnInit(): void {\r\n this.searchControl.valueChanges\r\n .pipe(takeUntilDestroyed(this._destroyRef))\r\n .subscribe((value) => {\r\n const text = value ?? '';\r\n this.searchTextChange.emit(text);\r\n });\r\n }\r\n\r\n\r\n submitSearch(): void {\r\n this.searchSubmit.emit(this.searchControl.value ?? '');\r\n }\r\n\r\n clearSearch(): void {\r\n this.searchControl.setValue('', { emitEvent: true });\r\n this.clear.emit();\r\n }\r\n}","<div class=\"flex flex-col gap-4 rounded-2xl border border-default bg-card p-4 shadow-sm\">\r\n <div class=\"flex flex-col gap-1\">\r\n @if (title()) {\r\n <h3 class=\"text-lg font-semibold text-default\">{{ title() }}</h3>\r\n }\r\n\r\n @if (description()) {\r\n <p class=\"text-sm leading-6 text-secondary\">{{ description() }}</p>\r\n }\r\n </div>\r\n\r\n <div class=\"flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between\">\r\n <div class=\"flex-1\">\r\n @if (showSearch()) {\r\n <mat-form-field class=\"w-full max-w-xl\" subscriptSizing=\"dynamic\">\r\n <mat-icon matPrefix class=\"text-secondary\" [svgIcon]=\"'heroicons_outline:magnifying-glass'\"></mat-icon>\r\n <input matInput [placeholder]=\"searchPlaceholder()\" [formControl]=\"searchControl\" (keyup.enter)=\"submitSearch()\" />\r\n @if (clearable() && searchControl.value) {\r\n <button matIconButton matSuffix type=\"button\" class=\"mx-2\" aria-label=\"清空搜索\" (click)=\"clearSearch()\">\r\n <mat-icon class=\"text-secondary\" [svgIcon]=\"'heroicons_outline:x-mark'\"></mat-icon>\r\n </button>\r\n }\r\n </mat-form-field>\r\n }\r\n </div>\r\n\r\n <div class=\"flex items-center gap-2\">\r\n <ng-content select=\"[cmatFilterToolbarActions]\"></ng-content>\r\n </div>\r\n </div>\r\n</div>","/**\n * Generated bundle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AE,eAAe,EAAE,kBAAkB,EAAE,aAAa,EAAE,cAAc,EAAE,mBAAmB,CAAC,EAAA,IAAA,EAC1G;AACF,wBAAA,OAAO,EAAE;AACZ,qBAAA,EAAA,QAAA,EAAA,sjDAAA,EAAA,MAAA,EAAA,CAAA,wBAAA,CAAA,EAAA;;;AE1BL;;AAEG
|
|
1
|
+
{"version":3,"file":"cmat-components-filter-toolbar.mjs","sources":["../../../projects/cmat/components/filter-toolbar/filter-toolbar.component.ts","../../../projects/cmat/components/filter-toolbar/filter-toolbar.component.html","../../../projects/cmat/components/filter-toolbar/cmat-components-filter-toolbar.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\r\nimport {\r\n ChangeDetectionStrategy,\r\n Component,\r\n DestroyRef,\r\n effect,\r\n inject,\r\n input,\r\n output,\r\n OnInit,\r\n} from '@angular/core';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { FormControl, ReactiveFormsModule } from '@angular/forms';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatInputModule } from '@angular/material/input';\r\n\r\n@Component({\r\n selector: 'cmat-filter-toolbar',\r\n templateUrl: './filter-toolbar.component.html',\r\n styleUrls: ['./filter-toolbar.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [CommonModule, MatButtonModule, MatFormFieldModule, MatIconModule, MatInputModule, ReactiveFormsModule],\r\n host: {\r\n 'class': 'block'\r\n }\r\n})\r\nexport class CmatFilterToolbarComponent implements OnInit {\r\n readonly title = input<string>('');\r\n readonly description = input<string>('');\r\n readonly searchPlaceholder = input<string>('搜索');\r\n readonly showSearch = input<boolean>(true);\r\n readonly searchText = input<string>('');\r\n readonly clearable = input<boolean>(true);\r\n\r\n\r\n readonly searchTextChange = output<string>();\r\n readonly clear = output<void>();\r\n readonly searchSubmit = output<string>();\r\n\r\n\r\n readonly searchControl = new FormControl<string>('');\r\n private readonly _destroyRef = inject(DestroyRef);\r\n\r\n constructor() {\r\n effect(() => {\r\n const externalText = this.searchText();\r\n const currentControlValue = this.searchControl.value;\r\n \r\n if (externalText !== currentControlValue) {\r\n this.searchControl.setValue(externalText, { emitEvent: false });\r\n }\r\n });\r\n }\r\n\r\n ngOnInit(): void {\r\n this.searchControl.valueChanges\r\n .pipe(takeUntilDestroyed(this._destroyRef))\r\n .subscribe((value) => {\r\n const text = value ?? '';\r\n this.searchTextChange.emit(text);\r\n });\r\n }\r\n\r\n\r\n submitSearch(): void {\r\n this.searchSubmit.emit(this.searchControl.value ?? '');\r\n }\r\n\r\n clearSearch(): void {\r\n this.searchControl.setValue('', { emitEvent: true });\r\n this.clear.emit();\r\n }\r\n}","<div class=\"flex flex-col gap-4 rounded-2xl border border-default bg-card p-4 shadow-sm\">\r\n <div class=\"flex flex-col gap-1\">\r\n @if (title()) {\r\n <h3 class=\"text-lg font-semibold text-default\">{{ title() }}</h3>\r\n }\r\n\r\n @if (description()) {\r\n <p class=\"text-sm leading-6 text-secondary\">{{ description() }}</p>\r\n }\r\n </div>\r\n\r\n <div class=\"flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between\">\r\n <div class=\"flex-1\">\r\n @if (showSearch()) {\r\n <mat-form-field class=\"w-full max-w-xl\" subscriptSizing=\"dynamic\">\r\n <mat-icon matPrefix class=\"text-secondary\" [svgIcon]=\"'heroicons_outline:magnifying-glass'\"></mat-icon>\r\n <input matInput [placeholder]=\"searchPlaceholder()\" [formControl]=\"searchControl\" (keyup.enter)=\"submitSearch()\" />\r\n @if (clearable() && searchControl.value) {\r\n <button matIconButton matSuffix type=\"button\" class=\"mx-2\" aria-label=\"清空搜索\" (click)=\"clearSearch()\">\r\n <mat-icon class=\"text-secondary\" [svgIcon]=\"'heroicons_outline:x-mark'\"></mat-icon>\r\n </button>\r\n }\r\n </mat-form-field>\r\n }\r\n </div>\r\n\r\n <div class=\"flex items-center gap-2\">\r\n <ng-content select=\"[cmatFilterToolbarActions]\"></ng-content>\r\n </div>\r\n </div>\r\n</div>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;MA4Ba,0BAA0B,CAAA;AAiBnC,IAAA,WAAA,GAAA;QAhBS,IAAA,CAAA,KAAK,GAAG,KAAK,CAAS,EAAE;kFAAC;QACzB,IAAA,CAAA,WAAW,GAAG,KAAK,CAAS,EAAE;wFAAC;QAC/B,IAAA,CAAA,iBAAiB,GAAG,KAAK,CAAS,IAAI;8FAAC;QACvC,IAAA,CAAA,UAAU,GAAG,KAAK,CAAU,IAAI;uFAAC;QACjC,IAAA,CAAA,UAAU,GAAG,KAAK,CAAS,EAAE;uFAAC;QAC9B,IAAA,CAAA,SAAS,GAAG,KAAK,CAAU,IAAI;sFAAC;QAGhC,IAAA,CAAA,gBAAgB,GAAG,MAAM,EAAU;QACnC,IAAA,CAAA,KAAK,GAAG,MAAM,EAAQ;QACtB,IAAA,CAAA,YAAY,GAAG,MAAM,EAAU;AAG/B,QAAA,IAAA,CAAA,aAAa,GAAG,IAAI,WAAW,CAAS,EAAE,CAAC;AACnC,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;QAG7C,MAAM,CAAC,MAAK;AACR,YAAA,MAAM,YAAY,GAAG,IAAI,CAAC,UAAU,EAAE;AACtC,YAAA,MAAM,mBAAmB,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK;AAEpD,YAAA,IAAI,YAAY,KAAK,mBAAmB,EAAE;AACtC,gBAAA,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;YACnE;AACJ,QAAA,CAAC,CAAC;IACN;IAEA,QAAQ,GAAA;QACJ,IAAI,CAAC,aAAa,CAAC;AACd,aAAA,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,WAAW,CAAC;AACzC,aAAA,SAAS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EAAA,qBAAqB,mBAGd,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC,CAAC,YAAY,EAAE,eAAe,EAAE,kBAAkB,EAAE,aAAa,EAAE,cAAc,EAAE,mBAAmB,CAAC,EAAA,IAAA,EAC1G;AACF,wBAAA,OAAO,EAAE;AACZ,qBAAA,EAAA,QAAA,EAAA,sjDAAA,EAAA,MAAA,EAAA,CAAA,wBAAA,CAAA,EAAA;;;AE1BL;;AAEG;;"}
|
|
@@ -11,10 +11,10 @@ class CmatFormActionsComponent {
|
|
|
11
11
|
this.divider = input(true, /* @ts-ignore */
|
|
12
12
|
...(ngDevMode ? [{ debugName: "divider" }] : /* istanbul ignore next */ []));
|
|
13
13
|
}
|
|
14
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
15
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.
|
|
14
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatFormActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
15
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.2.0", type: CmatFormActionsComponent, isStandalone: true, selector: "cmat-form-actions", inputs: { align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, divider: { classPropertyName: "divider", publicName: "divider", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"flex flex-col gap-3 border-default pt-4\"\r\n [ngClass]=\"{'border-t':divider(),'items-start':align() === 'start','items-center':align() === 'center','items-end':align() === 'end'}\">\r\n <div class=\"flex flex-wrap gap-2\"\r\n [ngClass]=\"{'justify-start':align() === 'start','justify-center':align() === 'center','justify-end':align() === 'end'}\">\r\n <ng-content select=\"[cmatFormActionsLeft]\"></ng-content>\r\n </div>\r\n\r\n <div class=\"flex flex-wrap gap-2\"\r\n [ngClass]=\"{'justify-start':align() === 'start','justify-center':align() === 'center','justify-end':align() === 'end'}\">\r\n <ng-content select=\"[cmatFormActions]\"></ng-content>\r\n </div>\r\n</div>", styles: [":host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: A11yModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
16
16
|
}
|
|
17
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
17
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatFormActionsComponent, decorators: [{
|
|
18
18
|
type: Component,
|
|
19
19
|
args: [{ selector: 'cmat-form-actions', changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, A11yModule], template: "<div class=\"flex flex-col gap-3 border-default pt-4\"\r\n [ngClass]=\"{'border-t':divider(),'items-start':align() === 'start','items-center':align() === 'center','items-end':align() === 'end'}\">\r\n <div class=\"flex flex-wrap gap-2\"\r\n [ngClass]=\"{'justify-start':align() === 'start','justify-center':align() === 'center','justify-end':align() === 'end'}\">\r\n <ng-content select=\"[cmatFormActionsLeft]\"></ng-content>\r\n </div>\r\n\r\n <div class=\"flex flex-wrap gap-2\"\r\n [ngClass]=\"{'justify-start':align() === 'start','justify-center':align() === 'center','justify-end':align() === 'end'}\">\r\n <ng-content select=\"[cmatFormActions]\"></ng-content>\r\n </div>\r\n</div>", styles: [":host{display:block}\n"] }]
|
|
20
20
|
}], propDecorators: { align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }], divider: [{ type: i0.Input, args: [{ isSignal: true, alias: "divider", required: false }] }] } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmat-components-form-actions.mjs","sources":["../../../projects/cmat/components/form-actions/form-actions.component.ts","../../../projects/cmat/components/form-actions/form-actions.component.html","../../../projects/cmat/components/form-actions/cmat-components-form-actions.ts"],"sourcesContent":["import { A11yModule } from '@angular/cdk/a11y';\r\nimport { CommonModule } from '@angular/common';\r\nimport { ChangeDetectionStrategy, Component, input } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'cmat-form-actions',\r\n templateUrl: './form-actions.component.html',\r\n styleUrls: ['./form-actions.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [CommonModule, A11yModule]\r\n})\r\nexport class CmatFormActionsComponent {\r\n readonly align = input<'start' | 'center' | 'end'>('end');\r\n readonly divider = input<boolean>(true);\r\n}","<div class=\"flex flex-col gap-3 border-default pt-4\"\r\n [ngClass]=\"{'border-t':divider(),'items-start':align() === 'start','items-center':align() === 'center','items-end':align() === 'end'}\">\r\n <div class=\"flex flex-wrap gap-2\"\r\n [ngClass]=\"{'justify-start':align() === 'start','justify-center':align() === 'center','justify-end':align() === 'end'}\">\r\n <ng-content select=\"[cmatFormActionsLeft]\"></ng-content>\r\n </div>\r\n\r\n <div class=\"flex flex-wrap gap-2\"\r\n [ngClass]=\"{'justify-start':align() === 'start','justify-center':align() === 'center','justify-end':align() === 'end'}\">\r\n <ng-content select=\"[cmatFormActions]\"></ng-content>\r\n </div>\r\n</div>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAWa,wBAAwB,CAAA;AAPrC,IAAA,WAAA,GAAA;QAQa,IAAA,CAAA,KAAK,GAAG,KAAK,CAA6B,KAAK;kFAAC;QAChD,IAAA,CAAA,OAAO,GAAG,KAAK,CAAU,IAAI;oFAAC;AAC1C,IAAA;8GAHY,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAxB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,wBAAwB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,MAAA,EAAA,EAAA,KAAA,EAAA,EAAA,iBAAA,EAAA,OAAA,EAAA,UAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,OAAA,EAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,UAAA,EAAA,SAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECXrC,6tBAWM,EAAA,MAAA,EAAA,CAAA,wBAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDFQ,YAAY,4HAAE,UAAU,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAEzB,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAPpC,SAAS;+BACI,mBAAmB,EAAA,eAAA,EAGZ,uBAAuB,CAAC,MAAM,WACtC,CAAC,YAAY,EAAE,UAAU,CAAC,EAAA,QAAA,EAAA,6tBAAA,EAAA,MAAA,EAAA,CAAA,wBAAA,CAAA,EAAA;;;AETvC;;AAEG
|
|
1
|
+
{"version":3,"file":"cmat-components-form-actions.mjs","sources":["../../../projects/cmat/components/form-actions/form-actions.component.ts","../../../projects/cmat/components/form-actions/form-actions.component.html","../../../projects/cmat/components/form-actions/cmat-components-form-actions.ts"],"sourcesContent":["import { A11yModule } from '@angular/cdk/a11y';\r\nimport { CommonModule } from '@angular/common';\r\nimport { ChangeDetectionStrategy, Component, input } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'cmat-form-actions',\r\n templateUrl: './form-actions.component.html',\r\n styleUrls: ['./form-actions.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [CommonModule, A11yModule]\r\n})\r\nexport class CmatFormActionsComponent {\r\n readonly align = input<'start' | 'center' | 'end'>('end');\r\n readonly divider = input<boolean>(true);\r\n}","<div class=\"flex flex-col gap-3 border-default pt-4\"\r\n [ngClass]=\"{'border-t':divider(),'items-start':align() === 'start','items-center':align() === 'center','items-end':align() === 'end'}\">\r\n <div class=\"flex flex-wrap gap-2\"\r\n [ngClass]=\"{'justify-start':align() === 'start','justify-center':align() === 'center','justify-end':align() === 'end'}\">\r\n <ng-content select=\"[cmatFormActionsLeft]\"></ng-content>\r\n </div>\r\n\r\n <div class=\"flex flex-wrap gap-2\"\r\n [ngClass]=\"{'justify-start':align() === 'start','justify-center':align() === 'center','justify-end':align() === 'end'}\">\r\n <ng-content select=\"[cmatFormActions]\"></ng-content>\r\n </div>\r\n</div>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAWa,wBAAwB,CAAA;AAPrC,IAAA,WAAA,GAAA;QAQa,IAAA,CAAA,KAAK,GAAG,KAAK,CAA6B,KAAK;kFAAC;QAChD,IAAA,CAAA,OAAO,GAAG,KAAK,CAAU,IAAI;oFAAC;AAC1C,IAAA;8GAHY,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAxB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,wBAAwB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,MAAA,EAAA,EAAA,KAAA,EAAA,EAAA,iBAAA,EAAA,OAAA,EAAA,UAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,OAAA,EAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,UAAA,EAAA,SAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECXrC,6tBAWM,EAAA,MAAA,EAAA,CAAA,wBAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDFQ,YAAY,4HAAE,UAAU,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAEzB,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAPpC,SAAS;+BACI,mBAAmB,EAAA,eAAA,EAGZ,uBAAuB,CAAC,MAAM,WACtC,CAAC,YAAY,EAAE,UAAU,CAAC,EAAA,QAAA,EAAA,6tBAAA,EAAA,MAAA,EAAA,CAAA,wBAAA,CAAA,EAAA;;;AETvC;;AAEG;;"}
|
|
@@ -32,10 +32,10 @@ class CmatFullscreenComponent {
|
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
36
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.
|
|
35
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatFullscreenComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
36
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.2.0", type: CmatFullscreenComponent, isStandalone: true, selector: "cmat-fullscreen", inputs: { iconTpl: { classPropertyName: "iconTpl", publicName: "iconTpl", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["cmatFullscreen"], ngImport: i0, template: "\r\n<button type=\"button\" matIconButton [matTooltip]=\"tooltip() || '\u5207\u6362\u5168\u5C4F'\" (click)=\"toggleFullscreen()\">\r\n <ng-container [ngTemplateOutlet]=\"iconTpl() || defaultIconTpl\"></ng-container>\r\n</button>\r\n\r\n\r\n<ng-template #defaultIconTpl>\r\n <mat-icon [svgIcon]=\"'heroicons_outline:arrows-pointing-out'\"></mat-icon>\r\n</ng-template>\r\n", dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i2.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
37
37
|
}
|
|
38
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
38
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatFullscreenComponent, decorators: [{
|
|
39
39
|
type: Component,
|
|
40
40
|
args: [{ selector: 'cmat-fullscreen', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatFullscreen', imports: [MatButtonModule, MatTooltipModule, NgTemplateOutlet, MatIconModule], template: "\r\n<button type=\"button\" matIconButton [matTooltip]=\"tooltip() || '\u5207\u6362\u5168\u5C4F'\" (click)=\"toggleFullscreen()\">\r\n <ng-container [ngTemplateOutlet]=\"iconTpl() || defaultIconTpl\"></ng-container>\r\n</button>\r\n\r\n\r\n<ng-template #defaultIconTpl>\r\n <mat-icon [svgIcon]=\"'heroicons_outline:arrows-pointing-out'\"></mat-icon>\r\n</ng-template>\r\n" }]
|
|
41
41
|
}], propDecorators: { iconTpl: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconTpl", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }] } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmat-components-fullscreen.mjs","sources":["../../../projects/cmat/components/fullscreen/fullscreen.component.ts","../../../projects/cmat/components/fullscreen/fullscreen.component.html","../../../projects/cmat/components/fullscreen/cmat-components-fullscreen.ts"],"sourcesContent":["import { NgTemplateOutlet } from '@angular/common';\r\nimport {\r\n ChangeDetectionStrategy,\r\n Component,\r\n TemplateRef,\r\n ViewEncapsulation,\r\n DOCUMENT,\r\n inject,\r\n input,\r\n} from '@angular/core';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\n\r\n@Component({\r\n selector: 'cmat-fullscreen',\r\n templateUrl: './fullscreen.component.html',\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n exportAs: 'cmatFullscreen',\r\n imports: [MatButtonModule, MatTooltipModule, NgTemplateOutlet, MatIconModule]\r\n})\r\nexport class CmatFullscreenComponent {\r\n readonly iconTpl = input<TemplateRef<unknown>>();\r\n readonly tooltip = input<string>();\r\n\r\n private _document = inject<Document>(DOCUMENT);\r\n\r\n\r\n toggleFullscreen(): void {\r\n if (!this._document.fullscreenEnabled) {\r\n console.warn('Fullscreen is not available in this browser.');\r\n return;\r\n }\r\n\r\n const fullScreen = this._document.fullscreenElement;\r\n\r\n if (fullScreen) {\r\n void this._document.exitFullscreen();\r\n }\r\n else {\r\n this._document.documentElement.requestFullscreen()\r\n .catch((): void => {\r\n console.error('Entering fullscreen mode failed.');\r\n });\r\n }\r\n }\r\n}","\r\n<button type=\"button\" matIconButton [matTooltip]=\"tooltip() || '切换全屏'\" (click)=\"toggleFullscreen()\">\r\n <ng-container [ngTemplateOutlet]=\"iconTpl() || defaultIconTpl\"></ng-container>\r\n</button>\r\n\r\n\r\n<ng-template #defaultIconTpl>\r\n <mat-icon [svgIcon]=\"'heroicons_outline:arrows-pointing-out'\"></mat-icon>\r\n</ng-template>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;MAsBa,uBAAuB,CAAA;AARpC,IAAA,WAAA,GAAA;AASa,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK;+FAAwB;AACvC,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK;+FAAU;AAE1B,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAW,QAAQ,CAAC;AAqBjD,IAAA;IAlBG,gBAAgB,GAAA;AACZ,QAAA,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,iBAAiB,EAAE;AACnC,YAAA,OAAO,CAAC,IAAI,CAAC,8CAA8C,CAAC;YAC5D;QACJ;AAEA,QAAA,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,iBAAiB;QAEnD,IAAI,UAAU,EAAE;AACZ,YAAA,KAAK,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE;QACxC;aACK;AACD,YAAA,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,iBAAiB;iBAC3C,KAAK,CAAC,MAAW;AACd,gBAAA,OAAO,CAAC,KAAK,CAAC,kCAAkC,CAAC;AACrD,YAAA,CAAC,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A,QAAA,EAAA,UAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,SAAA,EAAA,SAAA,EAAA,UAAA,CAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA;;2FAEnE,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBARnC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iBAAiB,iBAEZ,iBAAiB,CAAC,IAAI,EAAA,eAAA,EACpB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EACrC,gBAAgB,EAAA,OAAA,EACjB,CAAC,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,CAAC,EAAA,QAAA,EAAA,4XAAA,EAAA;;;AEpBjF;;AAEG
|
|
1
|
+
{"version":3,"file":"cmat-components-fullscreen.mjs","sources":["../../../projects/cmat/components/fullscreen/fullscreen.component.ts","../../../projects/cmat/components/fullscreen/fullscreen.component.html","../../../projects/cmat/components/fullscreen/cmat-components-fullscreen.ts"],"sourcesContent":["import { NgTemplateOutlet } from '@angular/common';\r\nimport {\r\n ChangeDetectionStrategy,\r\n Component,\r\n TemplateRef,\r\n ViewEncapsulation,\r\n DOCUMENT,\r\n inject,\r\n input,\r\n} from '@angular/core';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\n\r\n@Component({\r\n selector: 'cmat-fullscreen',\r\n templateUrl: './fullscreen.component.html',\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n exportAs: 'cmatFullscreen',\r\n imports: [MatButtonModule, MatTooltipModule, NgTemplateOutlet, MatIconModule]\r\n})\r\nexport class CmatFullscreenComponent {\r\n readonly iconTpl = input<TemplateRef<unknown>>();\r\n readonly tooltip = input<string>();\r\n\r\n private _document = inject<Document>(DOCUMENT);\r\n\r\n\r\n toggleFullscreen(): void {\r\n if (!this._document.fullscreenEnabled) {\r\n console.warn('Fullscreen is not available in this browser.');\r\n return;\r\n }\r\n\r\n const fullScreen = this._document.fullscreenElement;\r\n\r\n if (fullScreen) {\r\n void this._document.exitFullscreen();\r\n }\r\n else {\r\n this._document.documentElement.requestFullscreen()\r\n .catch((): void => {\r\n console.error('Entering fullscreen mode failed.');\r\n });\r\n }\r\n }\r\n}","\r\n<button type=\"button\" matIconButton [matTooltip]=\"tooltip() || '切换全屏'\" (click)=\"toggleFullscreen()\">\r\n <ng-container [ngTemplateOutlet]=\"iconTpl() || defaultIconTpl\"></ng-container>\r\n</button>\r\n\r\n\r\n<ng-template #defaultIconTpl>\r\n <mat-icon [svgIcon]=\"'heroicons_outline:arrows-pointing-out'\"></mat-icon>\r\n</ng-template>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;MAsBa,uBAAuB,CAAA;AARpC,IAAA,WAAA,GAAA;AASa,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK;+FAAwB;AACvC,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK;+FAAU;AAE1B,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAW,QAAQ,CAAC;AAqBjD,IAAA;IAlBG,gBAAgB,GAAA;AACZ,QAAA,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,iBAAiB,EAAE;AACnC,YAAA,OAAO,CAAC,IAAI,CAAC,8CAA8C,CAAC;YAC5D;QACJ;AAEA,QAAA,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,iBAAiB;QAEnD,IAAI,UAAU,EAAE;AACZ,YAAA,KAAK,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE;QACxC;aACK;AACD,YAAA,IAAI,CAAC,SAAS,CAAC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AAA,EAAA,UAAA,EAAA,IAAA,EAAE,aAAa,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,UAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,SAAA,EAAA,SAAA,EAAA,UAAA,CAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA;;2FAEnE,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBARnC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iBAAiB,iBAEZ,iBAAiB,CAAC,IAAI,EAAA,eAAA,EACpB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EACrC,gBAAgB,EAAA,OAAA,EACjB,CAAC,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,CAAC,EAAA,QAAA,EAAA,4XAAA,EAAA;;;AEpBjF;;AAEG;;"}
|
|
@@ -28,10 +28,10 @@ class CmatHighlightService {
|
|
|
28
28
|
});
|
|
29
29
|
return lines.map(line => line.substring(indentation)).join('\n');
|
|
30
30
|
}
|
|
31
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
32
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.
|
|
31
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatHighlightService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
32
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatHighlightService, providedIn: 'root' }); }
|
|
33
33
|
}
|
|
34
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
34
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatHighlightService, decorators: [{
|
|
35
35
|
type: Injectable,
|
|
36
36
|
args: [{
|
|
37
37
|
providedIn: 'root'
|
|
@@ -97,10 +97,10 @@ class CmatHighlightComponent {
|
|
|
97
97
|
}
|
|
98
98
|
this._highlightedCode.set(null);
|
|
99
99
|
}
|
|
100
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
101
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.
|
|
100
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatHighlightComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
101
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.2.0", type: CmatHighlightComponent, isStandalone: true, selector: "textarea[cmat-highlight]", inputs: { code: { classPropertyName: "code", publicName: "code", isSignal: true, isRequired: false, transformFunction: null }, lang: { classPropertyName: "lang", publicName: "lang", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "templateRef", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], exportAs: ["cmatHighlight"], ngImport: i0, template: "<ng-template let-highlightedCode=\"highlightedCode\" let-lang=\"lang\">\r\n <div class=\"cmat-highlight cmat-highlight-code-container\">\r\n <pre [ngClass]=\"'language-' + lang\"><code [ngClass]=\"'language-' + lang\" [innerHTML]=\"highlightedCode\"></code>\r\n </pre>\r\n </div>\r\n</ng-template>", styles: ["textarea[cmat-highlight]{display:none}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
102
102
|
}
|
|
103
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
103
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatHighlightComponent, decorators: [{
|
|
104
104
|
type: Component,
|
|
105
105
|
args: [{ selector: 'textarea[cmat-highlight]', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatHighlight', imports: [NgClass], template: "<ng-template let-highlightedCode=\"highlightedCode\" let-lang=\"lang\">\r\n <div class=\"cmat-highlight cmat-highlight-code-container\">\r\n <pre [ngClass]=\"'language-' + lang\"><code [ngClass]=\"'language-' + lang\" [innerHTML]=\"highlightedCode\"></code>\r\n </pre>\r\n </div>\r\n</ng-template>", styles: ["textarea[cmat-highlight]{display:none}\n"] }]
|
|
106
106
|
}], ctorParameters: () => [], propDecorators: { code: [{ type: i0.Input, args: [{ isSignal: true, alias: "code", required: false }] }], lang: [{ type: i0.Input, args: [{ isSignal: true, alias: "lang", required: false }] }], templateRef: [{ type: i0.ViewChild, args: [i0.forwardRef(() => TemplateRef), { isSignal: true }] }] } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmat-components-highlight.mjs","sources":["../../../projects/cmat/components/highlight/highlight.service.ts","../../../projects/cmat/components/highlight/highlight.component.ts","../../../projects/cmat/components/highlight/highlight.component.html","../../../projects/cmat/components/highlight/cmat-components-highlight.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\nimport hljs from 'highlight.js';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CmatHighlightService {\r\n highlight(code: string, language: string): string {\r\n code = this._format(code);\r\n return hljs.highlight(code, { language }).value;\r\n }\r\n\r\n private _format(code: string): string {\r\n let indentation = 0;\r\n const lines = code.split('\\n');\r\n while (lines.length && lines[0].trim() === '') {\r\n lines.shift();\r\n }\r\n\r\n while (lines.length && lines[lines.length - 1].trim() === '') {\r\n lines.pop();\r\n }\r\n lines.filter(line => line.length)\r\n .forEach((line, index) => {\r\n if (index === 0) {\r\n indentation = line.search(/\\S|$/);\r\n return;\r\n }\r\n indentation = Math.min(line.search(/\\S|$/), indentation);\r\n });\r\n return lines.map(line => line.substring(indentation)).join('\\n');\r\n }\r\n}\r\n","import { NgClass } from '@angular/common';\r\nimport {\r\n ChangeDetectionStrategy,\r\n Component,\r\n ElementRef,\r\n EmbeddedViewRef,\r\n TemplateRef,\r\n ViewContainerRef,\r\n ViewEncapsulation,\r\n effect,\r\n inject,\r\n input,\r\n signal,\r\n SecurityContext,\r\n viewChild,\r\n untracked,\r\n} from '@angular/core';\r\nimport { DomSanitizer } from '@angular/platform-browser';\r\nimport { CmatHighlightService } from './highlight.service';\r\n\r\n@Component({\r\n selector: 'textarea[cmat-highlight]',\r\n templateUrl: './highlight.component.html',\r\n styleUrls: ['./highlight.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n exportAs: 'cmatHighlight',\r\n imports: [NgClass],\r\n})\r\nexport class CmatHighlightComponent {\r\n readonly code = input<string>();\r\n readonly lang = input<string>();\r\n\r\n private readonly templateRef = viewChild.required(TemplateRef);\r\n\r\n private readonly _highlightedCode = signal<string | null>(null);\r\n\r\n private _viewRef: EmbeddedViewRef<any> | null = null;\r\n\r\n private readonly _domSanitizer = inject(DomSanitizer);\r\n private readonly _elementRef = inject<ElementRef<HTMLTextAreaElement>>(ElementRef);\r\n private readonly _cmatHighlightService = inject(CmatHighlightService);\r\n private readonly _viewContainerRef = inject(ViewContainerRef);\r\n\r\n constructor() {\r\n effect(() => {\r\n const codeInput = this.code();\r\n const lang = this.lang();\r\n\r\n if (!lang) {\r\n return;\r\n }\r\n\r\n untracked(() => {\r\n let codeToHighlight = codeInput;\r\n codeToHighlight ??= this._elementRef.nativeElement.value ?? '';\r\n\r\n if (!codeToHighlight) {\r\n this._clearView();\r\n return;\r\n }\r\n\r\n this._processHighlight(codeToHighlight, lang);\r\n });\r\n });\r\n }\r\n\r\n private _processHighlight(code: string, lang: string): void {\r\n if (!this.templateRef()) {\r\n return;\r\n }\r\n\r\n const highlighted = this._cmatHighlightService.highlight(code, lang);\r\n const sanitizedCode = this._domSanitizer.sanitize(SecurityContext.HTML, highlighted);\r\n\r\n if (sanitizedCode === null) {\r\n this._clearView();\r\n return;\r\n }\r\n\r\n this._highlightedCode.set(sanitizedCode);\r\n\r\n if (this._viewRef) {\r\n this._viewRef.destroy();\r\n this._viewRef = null;\r\n }\r\n\r\n this._viewRef = this._viewContainerRef.createEmbeddedView(this.templateRef(), {\r\n highlightedCode: sanitizedCode,\r\n lang: lang,\r\n });\r\n }\r\n\r\n private _clearView(): void {\r\n if (this._viewRef) {\r\n this._viewRef.destroy();\r\n this._viewRef = null;\r\n }\r\n this._highlightedCode.set(null);\r\n }\r\n}","<ng-template let-highlightedCode=\"highlightedCode\" let-lang=\"lang\">\r\n <div class=\"cmat-highlight cmat-highlight-code-container\">\r\n <pre [ngClass]=\"'language-' + lang\"><code [ngClass]=\"'language-' + lang\" [innerHTML]=\"highlightedCode\"></code>\r\n </pre>\r\n </div>\r\n</ng-template>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAMa,oBAAoB,CAAA;IAC7B,SAAS,CAAC,IAAY,EAAE,QAAgB,EAAA;AACpC,QAAA,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;AACzB,QAAA,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,KAAK;IACnD;AAEQ,IAAA,OAAO,CAAC,IAAY,EAAA;QACxB,IAAI,WAAW,GAAG,CAAC;QACnB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;AAC9B,QAAA,OAAO,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,CAAC,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A,EAAA,EAAA,IAAA,EAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,WAAA,EAAA,CAAA,EAAA,YAAA,EAAA,aAAA,EAAA,KAAA,EAAA,IAAA,EAAA,SAAA,EAIiB,WAAW,EAAA,WAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECjC/D,uTAKc,kGDsBF,OAAO,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,SAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA;;2FAEN,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBATlC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,0BAA0B,EAAA,aAAA,EAGrB,iBAAiB,CAAC,IAAI,EAAA,eAAA,EACpB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EACrC,eAAe,EAAA,OAAA,EAChB,CAAC,OAAO,CAAC,EAAA,QAAA,EAAA,uTAAA,EAAA,MAAA,EAAA,CAAA,0CAAA,CAAA,EAAA;uSAMgC,WAAW,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEjC/D;;AAEG
|
|
1
|
+
{"version":3,"file":"cmat-components-highlight.mjs","sources":["../../../projects/cmat/components/highlight/highlight.service.ts","../../../projects/cmat/components/highlight/highlight.component.ts","../../../projects/cmat/components/highlight/highlight.component.html","../../../projects/cmat/components/highlight/cmat-components-highlight.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\nimport hljs from 'highlight.js';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CmatHighlightService {\r\n highlight(code: string, language: string): string {\r\n code = this._format(code);\r\n return hljs.highlight(code, { language }).value;\r\n }\r\n\r\n private _format(code: string): string {\r\n let indentation = 0;\r\n const lines = code.split('\\n');\r\n while (lines.length && lines[0].trim() === '') {\r\n lines.shift();\r\n }\r\n\r\n while (lines.length && lines[lines.length - 1].trim() === '') {\r\n lines.pop();\r\n }\r\n lines.filter(line => line.length)\r\n .forEach((line, index) => {\r\n if (index === 0) {\r\n indentation = line.search(/\\S|$/);\r\n return;\r\n }\r\n indentation = Math.min(line.search(/\\S|$/), indentation);\r\n });\r\n return lines.map(line => line.substring(indentation)).join('\\n');\r\n }\r\n}\r\n","import { NgClass } from '@angular/common';\r\nimport {\r\n ChangeDetectionStrategy,\r\n Component,\r\n ElementRef,\r\n EmbeddedViewRef,\r\n TemplateRef,\r\n ViewContainerRef,\r\n ViewEncapsulation,\r\n effect,\r\n inject,\r\n input,\r\n signal,\r\n SecurityContext,\r\n viewChild,\r\n untracked,\r\n} from '@angular/core';\r\nimport { DomSanitizer } from '@angular/platform-browser';\r\nimport { CmatHighlightService } from './highlight.service';\r\n\r\n@Component({\r\n selector: 'textarea[cmat-highlight]',\r\n templateUrl: './highlight.component.html',\r\n styleUrls: ['./highlight.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n exportAs: 'cmatHighlight',\r\n imports: [NgClass],\r\n})\r\nexport class CmatHighlightComponent {\r\n readonly code = input<string>();\r\n readonly lang = input<string>();\r\n\r\n private readonly templateRef = viewChild.required(TemplateRef);\r\n\r\n private readonly _highlightedCode = signal<string | null>(null);\r\n\r\n private _viewRef: EmbeddedViewRef<any> | null = null;\r\n\r\n private readonly _domSanitizer = inject(DomSanitizer);\r\n private readonly _elementRef = inject<ElementRef<HTMLTextAreaElement>>(ElementRef);\r\n private readonly _cmatHighlightService = inject(CmatHighlightService);\r\n private readonly _viewContainerRef = inject(ViewContainerRef);\r\n\r\n constructor() {\r\n effect(() => {\r\n const codeInput = this.code();\r\n const lang = this.lang();\r\n\r\n if (!lang) {\r\n return;\r\n }\r\n\r\n untracked(() => {\r\n let codeToHighlight = codeInput;\r\n codeToHighlight ??= this._elementRef.nativeElement.value ?? '';\r\n\r\n if (!codeToHighlight) {\r\n this._clearView();\r\n return;\r\n }\r\n\r\n this._processHighlight(codeToHighlight, lang);\r\n });\r\n });\r\n }\r\n\r\n private _processHighlight(code: string, lang: string): void {\r\n if (!this.templateRef()) {\r\n return;\r\n }\r\n\r\n const highlighted = this._cmatHighlightService.highlight(code, lang);\r\n const sanitizedCode = this._domSanitizer.sanitize(SecurityContext.HTML, highlighted);\r\n\r\n if (sanitizedCode === null) {\r\n this._clearView();\r\n return;\r\n }\r\n\r\n this._highlightedCode.set(sanitizedCode);\r\n\r\n if (this._viewRef) {\r\n this._viewRef.destroy();\r\n this._viewRef = null;\r\n }\r\n\r\n this._viewRef = this._viewContainerRef.createEmbeddedView(this.templateRef(), {\r\n highlightedCode: sanitizedCode,\r\n lang: lang,\r\n });\r\n }\r\n\r\n private _clearView(): void {\r\n if (this._viewRef) {\r\n this._viewRef.destroy();\r\n this._viewRef = null;\r\n }\r\n this._highlightedCode.set(null);\r\n }\r\n}","<ng-template let-highlightedCode=\"highlightedCode\" let-lang=\"lang\">\r\n <div class=\"cmat-highlight cmat-highlight-code-container\">\r\n <pre [ngClass]=\"'language-' + lang\"><code [ngClass]=\"'language-' + lang\" [innerHTML]=\"highlightedCode\"></code>\r\n </pre>\r\n </div>\r\n</ng-template>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAMa,oBAAoB,CAAA;IAC7B,SAAS,CAAC,IAAY,EAAE,QAAgB,EAAA;AACpC,QAAA,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC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C,WAAW,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEjC/D;;AAEG;;"}
|
|
@@ -197,10 +197,10 @@ class CmatImageComponent {
|
|
|
197
197
|
const body = this._document.body;
|
|
198
198
|
body.style.overflow = this._originalOverflow ?? '';
|
|
199
199
|
}
|
|
200
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
201
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.
|
|
200
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatImageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
201
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.0", type: CmatImageComponent, isStandalone: true, selector: "cmat-image", inputs: { imageClass: { classPropertyName: "imageClass", publicName: "imageClass", isSignal: true, isRequired: false, transformFunction: null }, imageStyle: { classPropertyName: "imageStyle", publicName: "imageStyle", isSignal: true, isRequired: false, transformFunction: null }, src: { classPropertyName: "src", publicName: "src", isSignal: true, isRequired: false, transformFunction: null }, srcSet: { classPropertyName: "srcSet", publicName: "srcSet", isSignal: true, isRequired: false, transformFunction: null }, previewImageSrc: { classPropertyName: "previewImageSrc", publicName: "previewImageSrc", isSignal: true, isRequired: false, transformFunction: null }, previewImageSrcSet: { classPropertyName: "previewImageSrcSet", publicName: "previewImageSrcSet", isSignal: true, isRequired: false, transformFunction: null }, alt: { classPropertyName: "alt", publicName: "alt", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: true, isRequired: false, transformFunction: null }, preview: { classPropertyName: "preview", publicName: "preview", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { previewShowChange: "previewShowChange", imageErrorEvent: "imageErrorEvent" }, host: { listeners: { "document:keydown.escape": "onKeydownHandler($event)" } }, viewQueries: [{ propertyName: "maskRef", first: true, predicate: ["mask"], descendants: true, isSignal: true }, { propertyName: "previewButtonRef", first: true, predicate: ["previewButton"], descendants: true, isSignal: true }, { propertyName: "closeButtonRef", first: true, predicate: ["closeButton"], descendants: true, isSignal: true }], ngImport: i0, template: "<span [ngClass]=\"{ 'cmat-image-preview-container ': preview() }\">\r\n <img \r\n [attr.src]=\"src()\" \r\n [attr.srcset]=\"srcSet()\" \r\n [attr.alt]=\"alt()\" \r\n [attr.width]=\"width()\" \r\n [attr.height]=\"height()\"\r\n [attr.loading]=\"loading()\" \r\n [ngStyle]=\"imageStyle()\" \r\n [class]=\"imageClass()\" \r\n (error)=\"imageError($event)\" />\r\n \r\n @if(preview()){\r\n <div class=\"cmat-image-preview-indicator\" role=\"presentation\" (click)=\"onImageClick()\">\r\n <button #previewButton matIconButton>\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'heroicons_solid:eye'\"></mat-icon>\r\n </button>\r\n </div>\r\n }\r\n\r\n @if(maskVisible()){\r\n <div #mask class=\"cmat-image-mask cmat-image-overlay cmat-image-overlay-enter\" animate.leave=\"cmat-image-overlay-leave\"\r\n role=\"dialog\" [attr.aria-modal]=\"maskVisible()\" (click)=\"closePreview()\" (keydown)=\"onMaskKeydown($event)\">\r\n <div class=\"cmat-image-toolbar\" role=\"presentation\" (click)=\"handleToolbarClick($event)\">\r\n <button matIconButton (click)=\"rotateRight()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:rotate_right'\"></mat-icon>\r\n </button>\r\n <button matIconButton (click)=\"rotateLeft()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:rotate_left'\"></mat-icon>\r\n </button>\r\n <!-- \u7ED1\u5B9A computed signals -->\r\n <button matIconButton [disabled]=\"isZoomOutDisabled()\" (click)=\"zoomOut()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:zoom_out'\"></mat-icon>\r\n </button>\r\n <button matIconButton [disabled]=\"isZoomInDisabled()\" (click)=\"zoomIn()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:zoom_in'\"></mat-icon>\r\n </button>\r\n <button #closeButton matIconButton (click)=\"closePreview()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:close'\"></mat-icon>\r\n </button>\r\n </div>\r\n @if(previewVisible()){\r\n <div role=\"presentation\" class=\"cmat-image-preview-enter\" animate.leave=\"cmat-image-preview-leave\"\r\n (click)=\"onPreviewImageClick($event)\">\r\n <img class=\"cmat-image-preview\" alt=\"image\" \r\n [attr.src]=\"previewImageSrc() ? previewImageSrc() : src()\"\r\n [attr.srcset]=\"previewImageSrcSet()\" \r\n [ngStyle]=\"imagePreviewStyle()\" />\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n</span>", styles: [".cmat-image-mask{display:flex;align-items:center;justify-content:center}.cmat-image-preview-container{position:relative;display:inline-block;line-height:0}.cmat-image-preview-indicator{position:absolute;left:0;top:0;width:100%;height:100%;outline:none;border:none;padding:0;display:flex;align-items:center;justify-content:center;opacity:0;will-change:opacity,background-color;pointer-events:none;transition:opacity .3s ease}.cmat-image-preview-container:hover>.cmat-image-preview-indicator{opacity:1;cursor:pointer;background-color:#00000080;pointer-events:auto}.cmat-image-preview-container>img{cursor:pointer}.cmat-image-toolbar{position:absolute;top:0;right:0;display:flex;z-index:1;padding:.5rem}.cmat-image-preview{transition:transform .18s cubic-bezier(.2,0,0,1),opacity .18s cubic-bezier(.2,0,0,1);max-width:100vw;max-height:100vh;will-change:transform,opacity;transform-origin:center center;backface-visibility:hidden;transform:translateZ(0)}.cmat-image-preview-enter{animation:preview-enter-animation .18s cubic-bezier(.2,0,0,1)}.cmat-image-preview-leave{animation:preview-leave-animation .18s cubic-bezier(.2,0,0,1)}.cmat-image-overlay{background-color:#0006;transition:background-color .18s cubic-bezier(.2,0,0,1),opacity .18s cubic-bezier(.2,0,0,1);will-change:background-color,opacity;position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:99}.cmat-image-overlay-enter{animation:image-overlay-enter-animation .18s cubic-bezier(.2,0,0,1)}.cmat-image-overlay-leave{z-index:0;animation:image-overlay-leave-animation .18s cubic-bezier(.2,0,0,1)}@keyframes preview-enter-animation{0%{transform:scale(.7);opacity:0}to{transform:scale(1);opacity:1}}@keyframes preview-leave-animation{0%{transform:scale(1);opacity:1}to{transform:scale(.7);opacity:0}}@keyframes image-overlay-enter-animation{0%{background-color:transparent}to{background-color:#000000e6}}@keyframes image-overlay-leave-animation{0%{background-color:#000000e6}to{background-color:transparent}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
202
202
|
}
|
|
203
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
203
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatImageComponent, decorators: [{
|
|
204
204
|
type: Component,
|
|
205
205
|
args: [{ selector: 'cmat-image', imports: [CommonModule, MatButtonModule, MatIconModule], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<span [ngClass]=\"{ 'cmat-image-preview-container ': preview() }\">\r\n <img \r\n [attr.src]=\"src()\" \r\n [attr.srcset]=\"srcSet()\" \r\n [attr.alt]=\"alt()\" \r\n [attr.width]=\"width()\" \r\n [attr.height]=\"height()\"\r\n [attr.loading]=\"loading()\" \r\n [ngStyle]=\"imageStyle()\" \r\n [class]=\"imageClass()\" \r\n (error)=\"imageError($event)\" />\r\n \r\n @if(preview()){\r\n <div class=\"cmat-image-preview-indicator\" role=\"presentation\" (click)=\"onImageClick()\">\r\n <button #previewButton matIconButton>\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'heroicons_solid:eye'\"></mat-icon>\r\n </button>\r\n </div>\r\n }\r\n\r\n @if(maskVisible()){\r\n <div #mask class=\"cmat-image-mask cmat-image-overlay cmat-image-overlay-enter\" animate.leave=\"cmat-image-overlay-leave\"\r\n role=\"dialog\" [attr.aria-modal]=\"maskVisible()\" (click)=\"closePreview()\" (keydown)=\"onMaskKeydown($event)\">\r\n <div class=\"cmat-image-toolbar\" role=\"presentation\" (click)=\"handleToolbarClick($event)\">\r\n <button matIconButton (click)=\"rotateRight()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:rotate_right'\"></mat-icon>\r\n </button>\r\n <button matIconButton (click)=\"rotateLeft()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:rotate_left'\"></mat-icon>\r\n </button>\r\n <!-- \u7ED1\u5B9A computed signals -->\r\n <button matIconButton [disabled]=\"isZoomOutDisabled()\" (click)=\"zoomOut()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:zoom_out'\"></mat-icon>\r\n </button>\r\n <button matIconButton [disabled]=\"isZoomInDisabled()\" (click)=\"zoomIn()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:zoom_in'\"></mat-icon>\r\n </button>\r\n <button #closeButton matIconButton (click)=\"closePreview()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:close'\"></mat-icon>\r\n </button>\r\n </div>\r\n @if(previewVisible()){\r\n <div role=\"presentation\" class=\"cmat-image-preview-enter\" animate.leave=\"cmat-image-preview-leave\"\r\n (click)=\"onPreviewImageClick($event)\">\r\n <img class=\"cmat-image-preview\" alt=\"image\" \r\n [attr.src]=\"previewImageSrc() ? previewImageSrc() : src()\"\r\n [attr.srcset]=\"previewImageSrcSet()\" \r\n [ngStyle]=\"imagePreviewStyle()\" />\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n</span>", styles: [".cmat-image-mask{display:flex;align-items:center;justify-content:center}.cmat-image-preview-container{position:relative;display:inline-block;line-height:0}.cmat-image-preview-indicator{position:absolute;left:0;top:0;width:100%;height:100%;outline:none;border:none;padding:0;display:flex;align-items:center;justify-content:center;opacity:0;will-change:opacity,background-color;pointer-events:none;transition:opacity .3s ease}.cmat-image-preview-container:hover>.cmat-image-preview-indicator{opacity:1;cursor:pointer;background-color:#00000080;pointer-events:auto}.cmat-image-preview-container>img{cursor:pointer}.cmat-image-toolbar{position:absolute;top:0;right:0;display:flex;z-index:1;padding:.5rem}.cmat-image-preview{transition:transform .18s cubic-bezier(.2,0,0,1),opacity .18s cubic-bezier(.2,0,0,1);max-width:100vw;max-height:100vh;will-change:transform,opacity;transform-origin:center center;backface-visibility:hidden;transform:translateZ(0)}.cmat-image-preview-enter{animation:preview-enter-animation .18s cubic-bezier(.2,0,0,1)}.cmat-image-preview-leave{animation:preview-leave-animation .18s cubic-bezier(.2,0,0,1)}.cmat-image-overlay{background-color:#0006;transition:background-color .18s cubic-bezier(.2,0,0,1),opacity .18s cubic-bezier(.2,0,0,1);will-change:background-color,opacity;position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:99}.cmat-image-overlay-enter{animation:image-overlay-enter-animation .18s cubic-bezier(.2,0,0,1)}.cmat-image-overlay-leave{z-index:0;animation:image-overlay-leave-animation .18s cubic-bezier(.2,0,0,1)}@keyframes preview-enter-animation{0%{transform:scale(.7);opacity:0}to{transform:scale(1);opacity:1}}@keyframes preview-leave-animation{0%{transform:scale(1);opacity:1}to{transform:scale(.7);opacity:0}}@keyframes image-overlay-enter-animation{0%{background-color:transparent}to{background-color:#000000e6}}@keyframes image-overlay-leave-animation{0%{background-color:#000000e6}to{background-color:transparent}}\n"] }]
|
|
206
206
|
}], ctorParameters: () => [], propDecorators: { maskRef: [{ type: i0.ViewChild, args: ['mask', { isSignal: true }] }], previewButtonRef: [{ type: i0.ViewChild, args: ['previewButton', { isSignal: true }] }], closeButtonRef: [{ type: i0.ViewChild, args: ['closeButton', { isSignal: true }] }], imageClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "imageClass", required: false }] }], imageStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "imageStyle", required: false }] }], src: [{ type: i0.Input, args: [{ isSignal: true, alias: "src", required: false }] }], srcSet: [{ type: i0.Input, args: [{ isSignal: true, alias: "srcSet", required: false }] }], previewImageSrc: [{ type: i0.Input, args: [{ isSignal: true, alias: "previewImageSrc", required: false }] }], previewImageSrcSet: [{ type: i0.Input, args: [{ isSignal: true, alias: "previewImageSrcSet", required: false }] }], alt: [{ type: i0.Input, args: [{ isSignal: true, alias: "alt", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], appendTo: [{ type: i0.Input, args: [{ isSignal: true, alias: "appendTo", required: false }] }], preview: [{ type: i0.Input, args: [{ isSignal: true, alias: "preview", required: false }] }], previewShowChange: [{ type: i0.Output, args: ["previewShowChange"] }], imageErrorEvent: [{ type: i0.Output, args: ["imageErrorEvent"] }], onKeydownHandler: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmat-components-image-viewer.mjs","sources":["../../../projects/cmat/components/image-viewer/image-viewer.component.ts","../../../projects/cmat/components/image-viewer/image-viewer.component.html","../../../projects/cmat/components/image-viewer/cmat-components-image-viewer.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\r\nimport {\r\n ChangeDetectionStrategy,\r\n Component,\r\n ElementRef,\r\n inject,\r\n ViewEncapsulation,\r\n booleanAttribute,\r\n DOCUMENT,\r\n HostListener,\r\n signal,\r\n input,\r\n output,\r\n viewChild,\r\n effect,\r\n computed, // 引入 computed\r\n} from '@angular/core';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { SafeUrl } from '@angular/platform-browser';\r\n\r\n@Component({\r\n selector: 'cmat-image',\r\n templateUrl: './image-viewer.component.html',\r\n styleUrls: ['./image-viewer.component.scss'],\r\n imports: [CommonModule, MatButtonModule, MatIconModule],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.None\r\n})\r\nexport class CmatImageComponent {\r\n readonly maskRef = viewChild<HTMLDivElement>('mask');\r\n readonly previewButtonRef = viewChild<HTMLButtonElement>('previewButton');\r\n readonly closeButtonRef = viewChild<HTMLButtonElement>('closeButton');\r\n\r\n readonly imageClass = input<string | undefined>(undefined);\r\n readonly imageStyle = input<Record<string, string> | null | undefined>(undefined);\r\n readonly src = input<SafeUrl | undefined>(undefined);\r\n readonly srcSet = input<SafeUrl | undefined>(undefined);\r\n readonly previewImageSrc = input<SafeUrl | undefined>(undefined);\r\n readonly previewImageSrcSet = input<SafeUrl | undefined>(undefined);\r\n readonly alt = input<string | undefined>(undefined);\r\n readonly width = input<number | undefined>(undefined);\r\n readonly height = input<number | undefined>(undefined);\r\n readonly loading = input<'lazy' | 'eager' | undefined>(undefined);\r\n\r\n readonly appendTo = input<HTMLElement | ElementRef<HTMLElement> | string | null | undefined>(undefined);\r\n\r\n readonly preview = input<boolean, boolean | string>(false, { transform: booleanAttribute });\r\n\r\n readonly previewShowChange = output<boolean>();\r\n readonly imageErrorEvent = output<Event>();\r\n\r\n readonly maskVisible = signal(false);\r\n readonly previewVisible = signal(false);\r\n\r\n readonly rotate = signal(0);\r\n readonly scale = signal(1);\r\n\r\n readonly isZoomOutDisabled = computed(() => {\r\n return this.scale() - this._zoomSettings.step <= this._zoomSettings.min;\r\n });\r\n\r\n readonly isZoomInDisabled = computed(() => {\r\n return this.scale() + this._zoomSettings.step >= this._zoomSettings.max;\r\n });\r\n\r\n readonly imagePreviewStyle = computed(() => {\r\n return {\r\n transform: `rotate(${this.rotate()}deg) scale(${this.scale()})`\r\n };\r\n });\r\n\r\n private readonly _document = inject<Document>(DOCUMENT);\r\n\r\n private readonly _animationDuration = 150;\r\n private _loadingPreview: boolean = false;\r\n private _closePreviewByEscape: boolean = false;\r\n private _closePreviewTimeoutId: number | null = null;\r\n private _originalOverflow: string | null = null;\r\n\r\n private _zoomSettings = {\r\n default: 1,\r\n step: 0.1,\r\n max: 1.5,\r\n min: 0.5\r\n };\r\n\r\n\r\n constructor() {\r\n effect(() => {\r\n const maskEl = this.maskRef();\r\n if (maskEl && this._loadingPreview) {\r\n this.appendContainer(maskEl);\r\n }\r\n });\r\n\r\n effect(() => {\r\n const btn = this.previewButtonRef();\r\n if (btn && this._closePreviewByEscape) {\r\n btn.focus();\r\n this._closePreviewByEscape = false;\r\n }\r\n });\r\n\r\n effect(() => {\r\n const btn = this.closeButtonRef();\r\n if (btn && this._loadingPreview) {\r\n btn.focus();\r\n this._loadingPreview = false;\r\n }\r\n });\r\n }\r\n\r\n @HostListener('document:keydown.escape', ['$event'])\r\n onKeydownHandler(): void {\r\n if (this.previewVisible()) {\r\n this._enableBackgroundScroll();\r\n this.closePreview();\r\n }\r\n }\r\n\r\n onImageClick(): void {\r\n if (this.preview()) {\r\n this._disableBackgroundScroll();\r\n this.maskVisible.set(true);\r\n this._loadingPreview = true;\r\n\r\n requestAnimationFrame(() => {\r\n this.previewVisible.set(true);\r\n this.previewShowChange.emit(true);\r\n });\r\n }\r\n }\r\n\r\n onMaskKeydown(event: KeyboardEvent): void {\r\n switch (event.code) {\r\n case 'Escape':\r\n this.closePreview();\r\n this._closePreviewByEscape = true;\r\n event.preventDefault();\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n onPreviewImageClick(event: MouseEvent): void {\r\n event.stopPropagation();\r\n }\r\n\r\n rotateRight(): void {\r\n // 使用 update 方法基于当前值计算新值\r\n this.rotate.update(r => r + 90);\r\n }\r\n\r\n rotateLeft(): void {\r\n this.rotate.update(r => r - 90);\r\n }\r\n\r\n zoomIn(): void {\r\n this.scale.update(s => s + this._zoomSettings.step);\r\n }\r\n\r\n zoomOut(): void {\r\n this.scale.update(s => s - this._zoomSettings.step);\r\n }\r\n\r\n handleToolbarClick(event: MouseEvent): void {\r\n event.stopPropagation();\r\n }\r\n\r\n appendContainer(maskElement?: HTMLElement): void {\r\n const elToAppend = maskElement ?? this.maskRef();\r\n if (!elToAppend) return;\r\n\r\n const target = this.appendTo();\r\n\r\n if (target) {\r\n if (target === 'body') {\r\n this._document.body.appendChild(elToAppend);\r\n } else {\r\n let nativeElement: HTMLElement | null = null;\r\n\r\n if (target instanceof HTMLElement) {\r\n nativeElement = target;\r\n } else if (target instanceof ElementRef) {\r\n nativeElement = target.nativeElement;\r\n } else if (typeof target === 'object' && target !== null && 'el' in target) {\r\n const customTarget = target as { el?: { nativeElement?: HTMLElement } };\r\n nativeElement = customTarget.el?.nativeElement ?? null;\r\n }\r\n\r\n if (nativeElement) {\r\n nativeElement.appendChild(elToAppend);\r\n }\r\n }\r\n }\r\n }\r\n\r\n closePreview(): void {\r\n if (this._closePreviewTimeoutId !== null) {\r\n clearTimeout(this._closePreviewTimeoutId);\r\n this._closePreviewTimeoutId = null;\r\n }\r\n\r\n this._enableBackgroundScroll();\r\n this.previewVisible.set(false);\r\n\r\n this._closePreviewTimeoutId = window.setTimeout(() => {\r\n this.maskVisible.set(false);\r\n // 重置 signal 状态\r\n this.rotate.set(0);\r\n this.scale.set(this._zoomSettings.default);\r\n this.previewShowChange.emit(false);\r\n this._closePreviewTimeoutId = null;\r\n }, this._animationDuration);\r\n }\r\n\r\n imageError(event: Event): void {\r\n this.imageErrorEvent.emit(event);\r\n }\r\n\r\n private _disableBackgroundScroll(): void {\r\n const body = this._document.body;\r\n this._originalOverflow = body.style.overflow;\r\n body.style.overflow = 'hidden';\r\n }\r\n\r\n private _enableBackgroundScroll(): void {\r\n const body = this._document.body;\r\n body.style.overflow = this._originalOverflow ?? '';\r\n }\r\n}","<span [ngClass]=\"{ 'cmat-image-preview-container ': preview() }\">\r\n <img \r\n [attr.src]=\"src()\" \r\n [attr.srcset]=\"srcSet()\" \r\n [attr.alt]=\"alt()\" \r\n [attr.width]=\"width()\" \r\n [attr.height]=\"height()\"\r\n [attr.loading]=\"loading()\" \r\n [ngStyle]=\"imageStyle()\" \r\n [class]=\"imageClass()\" \r\n (error)=\"imageError($event)\" />\r\n \r\n @if(preview()){\r\n <div class=\"cmat-image-preview-indicator\" role=\"presentation\" (click)=\"onImageClick()\">\r\n <button #previewButton matIconButton>\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'heroicons_solid:eye'\"></mat-icon>\r\n </button>\r\n </div>\r\n }\r\n\r\n @if(maskVisible()){\r\n <div #mask class=\"cmat-image-mask cmat-image-overlay cmat-image-overlay-enter\" animate.leave=\"cmat-image-overlay-leave\"\r\n role=\"dialog\" [attr.aria-modal]=\"maskVisible()\" (click)=\"closePreview()\" (keydown)=\"onMaskKeydown($event)\">\r\n <div class=\"cmat-image-toolbar\" role=\"presentation\" (click)=\"handleToolbarClick($event)\">\r\n <button matIconButton (click)=\"rotateRight()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:rotate_right'\"></mat-icon>\r\n </button>\r\n <button matIconButton (click)=\"rotateLeft()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:rotate_left'\"></mat-icon>\r\n </button>\r\n <!-- 绑定 computed signals -->\r\n <button matIconButton [disabled]=\"isZoomOutDisabled()\" (click)=\"zoomOut()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:zoom_out'\"></mat-icon>\r\n </button>\r\n <button matIconButton [disabled]=\"isZoomInDisabled()\" (click)=\"zoomIn()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:zoom_in'\"></mat-icon>\r\n </button>\r\n <button #closeButton matIconButton (click)=\"closePreview()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:close'\"></mat-icon>\r\n </button>\r\n </div>\r\n @if(previewVisible()){\r\n <div role=\"presentation\" class=\"cmat-image-preview-enter\" animate.leave=\"cmat-image-preview-leave\"\r\n (click)=\"onPreviewImageClick($event)\">\r\n <img class=\"cmat-image-preview\" alt=\"image\" \r\n [attr.src]=\"previewImageSrc() ? previewImageSrc() : src()\"\r\n [attr.srcset]=\"previewImageSrcSet()\" \r\n [ngStyle]=\"imagePreviewStyle()\" />\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n</span>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MA6Ba,kBAAkB,CAAA;AA2D3B,IAAA,WAAA,GAAA;QA1DS,IAAA,CAAA,OAAO,GAAG,SAAS,CAAiB,MAAM;oFAAC;QAC3C,IAAA,CAAA,gBAAgB,GAAG,SAAS,CAAoB,eAAe;6FAAC;QAChE,IAAA,CAAA,cAAc,GAAG,SAAS,CAAoB,aAAa;2FAAC;QAE5D,IAAA,CAAA,UAAU,GAAG,KAAK,CAAqB,SAAS;uFAAC;QACjD,IAAA,CAAA,UAAU,GAAG,KAAK,CAA4C,SAAS;uFAAC;QACxE,IAAA,CAAA,GAAG,GAAG,KAAK,CAAsB,SAAS;gFAAC;QAC3C,IAAA,CAAA,MAAM,GAAG,KAAK,CAAsB,SAAS;mFAAC;QAC9C,IAAA,CAAA,eAAe,GAAG,KAAK,CAAsB,SAAS;4FAAC;QACvD,IAAA,CAAA,kBAAk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AA,mBAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,iBAAA,CAAA,EAAA,CAAA,EAAA,gBAAA,EAAA,CAAA;sBAiFnE,YAAY;uBAAC,yBAAyB,EAAE,CAAC,QAAQ,CAAC;;;AEjHvD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"cmat-components-image-viewer.mjs","sources":["../../../projects/cmat/components/image-viewer/image-viewer.component.ts","../../../projects/cmat/components/image-viewer/image-viewer.component.html","../../../projects/cmat/components/image-viewer/cmat-components-image-viewer.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\r\nimport {\r\n ChangeDetectionStrategy,\r\n Component,\r\n ElementRef,\r\n inject,\r\n ViewEncapsulation,\r\n booleanAttribute,\r\n DOCUMENT,\r\n HostListener,\r\n signal,\r\n input,\r\n output,\r\n viewChild,\r\n effect,\r\n computed, // 引入 computed\r\n} from '@angular/core';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { SafeUrl } from '@angular/platform-browser';\r\n\r\n@Component({\r\n selector: 'cmat-image',\r\n templateUrl: './image-viewer.component.html',\r\n styleUrls: ['./image-viewer.component.scss'],\r\n imports: [CommonModule, MatButtonModule, MatIconModule],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.None\r\n})\r\nexport class CmatImageComponent {\r\n readonly maskRef = viewChild<HTMLDivElement>('mask');\r\n readonly previewButtonRef = viewChild<HTMLButtonElement>('previewButton');\r\n readonly closeButtonRef = viewChild<HTMLButtonElement>('closeButton');\r\n\r\n readonly imageClass = input<string | undefined>(undefined);\r\n readonly imageStyle = input<Record<string, string> | null | undefined>(undefined);\r\n readonly src = input<SafeUrl | undefined>(undefined);\r\n readonly srcSet = input<SafeUrl | undefined>(undefined);\r\n readonly previewImageSrc = input<SafeUrl | undefined>(undefined);\r\n readonly previewImageSrcSet = input<SafeUrl | undefined>(undefined);\r\n readonly alt = input<string | undefined>(undefined);\r\n readonly width = input<number | undefined>(undefined);\r\n readonly height = input<number | undefined>(undefined);\r\n readonly loading = input<'lazy' | 'eager' | undefined>(undefined);\r\n\r\n readonly appendTo = input<HTMLElement | ElementRef<HTMLElement> | string | null | undefined>(undefined);\r\n\r\n readonly preview = input<boolean, boolean | string>(false, { transform: booleanAttribute });\r\n\r\n readonly previewShowChange = output<boolean>();\r\n readonly imageErrorEvent = output<Event>();\r\n\r\n readonly maskVisible = signal(false);\r\n readonly previewVisible = signal(false);\r\n\r\n readonly rotate = signal(0);\r\n readonly scale = signal(1);\r\n\r\n readonly isZoomOutDisabled = computed(() => {\r\n return this.scale() - this._zoomSettings.step <= this._zoomSettings.min;\r\n });\r\n\r\n readonly isZoomInDisabled = computed(() => {\r\n return this.scale() + this._zoomSettings.step >= this._zoomSettings.max;\r\n });\r\n\r\n readonly imagePreviewStyle = computed(() => {\r\n return {\r\n transform: `rotate(${this.rotate()}deg) scale(${this.scale()})`\r\n };\r\n });\r\n\r\n private readonly _document = inject<Document>(DOCUMENT);\r\n\r\n private readonly _animationDuration = 150;\r\n private _loadingPreview: boolean = false;\r\n private _closePreviewByEscape: boolean = false;\r\n private _closePreviewTimeoutId: number | null = null;\r\n private _originalOverflow: string | null = null;\r\n\r\n private _zoomSettings = {\r\n default: 1,\r\n step: 0.1,\r\n max: 1.5,\r\n min: 0.5\r\n };\r\n\r\n\r\n constructor() {\r\n effect(() => {\r\n const maskEl = this.maskRef();\r\n if (maskEl && this._loadingPreview) {\r\n this.appendContainer(maskEl);\r\n }\r\n });\r\n\r\n effect(() => {\r\n const btn = this.previewButtonRef();\r\n if (btn && this._closePreviewByEscape) {\r\n btn.focus();\r\n this._closePreviewByEscape = false;\r\n }\r\n });\r\n\r\n effect(() => {\r\n const btn = this.closeButtonRef();\r\n if (btn && this._loadingPreview) {\r\n btn.focus();\r\n this._loadingPreview = false;\r\n }\r\n });\r\n }\r\n\r\n @HostListener('document:keydown.escape', ['$event'])\r\n onKeydownHandler(): void {\r\n if (this.previewVisible()) {\r\n this._enableBackgroundScroll();\r\n this.closePreview();\r\n }\r\n }\r\n\r\n onImageClick(): void {\r\n if (this.preview()) {\r\n this._disableBackgroundScroll();\r\n this.maskVisible.set(true);\r\n this._loadingPreview = true;\r\n\r\n requestAnimationFrame(() => {\r\n this.previewVisible.set(true);\r\n this.previewShowChange.emit(true);\r\n });\r\n }\r\n }\r\n\r\n onMaskKeydown(event: KeyboardEvent): void {\r\n switch (event.code) {\r\n case 'Escape':\r\n this.closePreview();\r\n this._closePreviewByEscape = true;\r\n event.preventDefault();\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n onPreviewImageClick(event: MouseEvent): void {\r\n event.stopPropagation();\r\n }\r\n\r\n rotateRight(): void {\r\n // 使用 update 方法基于当前值计算新值\r\n this.rotate.update(r => r + 90);\r\n }\r\n\r\n rotateLeft(): void {\r\n this.rotate.update(r => r - 90);\r\n }\r\n\r\n zoomIn(): void {\r\n this.scale.update(s => s + this._zoomSettings.step);\r\n }\r\n\r\n zoomOut(): void {\r\n this.scale.update(s => s - this._zoomSettings.step);\r\n }\r\n\r\n handleToolbarClick(event: MouseEvent): void {\r\n event.stopPropagation();\r\n }\r\n\r\n appendContainer(maskElement?: HTMLElement): void {\r\n const elToAppend = maskElement ?? this.maskRef();\r\n if (!elToAppend) return;\r\n\r\n const target = this.appendTo();\r\n\r\n if (target) {\r\n if (target === 'body') {\r\n this._document.body.appendChild(elToAppend);\r\n } else {\r\n let nativeElement: HTMLElement | null = null;\r\n\r\n if (target instanceof HTMLElement) {\r\n nativeElement = target;\r\n } else if (target instanceof ElementRef) {\r\n nativeElement = target.nativeElement;\r\n } else if (typeof target === 'object' && target !== null && 'el' in target) {\r\n const customTarget = target as { el?: { nativeElement?: HTMLElement } };\r\n nativeElement = customTarget.el?.nativeElement ?? null;\r\n }\r\n\r\n if (nativeElement) {\r\n nativeElement.appendChild(elToAppend);\r\n }\r\n }\r\n }\r\n }\r\n\r\n closePreview(): void {\r\n if (this._closePreviewTimeoutId !== null) {\r\n clearTimeout(this._closePreviewTimeoutId);\r\n this._closePreviewTimeoutId = null;\r\n }\r\n\r\n this._enableBackgroundScroll();\r\n this.previewVisible.set(false);\r\n\r\n this._closePreviewTimeoutId = window.setTimeout(() => {\r\n this.maskVisible.set(false);\r\n // 重置 signal 状态\r\n this.rotate.set(0);\r\n this.scale.set(this._zoomSettings.default);\r\n this.previewShowChange.emit(false);\r\n this._closePreviewTimeoutId = null;\r\n }, this._animationDuration);\r\n }\r\n\r\n imageError(event: Event): void {\r\n this.imageErrorEvent.emit(event);\r\n }\r\n\r\n private _disableBackgroundScroll(): void {\r\n const body = this._document.body;\r\n this._originalOverflow = body.style.overflow;\r\n body.style.overflow = 'hidden';\r\n }\r\n\r\n private _enableBackgroundScroll(): void {\r\n const body = this._document.body;\r\n body.style.overflow = this._originalOverflow ?? '';\r\n }\r\n}","<span [ngClass]=\"{ 'cmat-image-preview-container ': preview() }\">\r\n <img \r\n [attr.src]=\"src()\" \r\n [attr.srcset]=\"srcSet()\" \r\n [attr.alt]=\"alt()\" \r\n [attr.width]=\"width()\" \r\n [attr.height]=\"height()\"\r\n [attr.loading]=\"loading()\" \r\n [ngStyle]=\"imageStyle()\" \r\n [class]=\"imageClass()\" \r\n (error)=\"imageError($event)\" />\r\n \r\n @if(preview()){\r\n <div class=\"cmat-image-preview-indicator\" role=\"presentation\" (click)=\"onImageClick()\">\r\n <button #previewButton matIconButton>\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'heroicons_solid:eye'\"></mat-icon>\r\n </button>\r\n </div>\r\n }\r\n\r\n @if(maskVisible()){\r\n <div #mask class=\"cmat-image-mask cmat-image-overlay cmat-image-overlay-enter\" animate.leave=\"cmat-image-overlay-leave\"\r\n role=\"dialog\" [attr.aria-modal]=\"maskVisible()\" (click)=\"closePreview()\" (keydown)=\"onMaskKeydown($event)\">\r\n <div class=\"cmat-image-toolbar\" role=\"presentation\" (click)=\"handleToolbarClick($event)\">\r\n <button matIconButton (click)=\"rotateRight()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:rotate_right'\"></mat-icon>\r\n </button>\r\n <button matIconButton (click)=\"rotateLeft()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:rotate_left'\"></mat-icon>\r\n </button>\r\n <!-- 绑定 computed signals -->\r\n <button matIconButton [disabled]=\"isZoomOutDisabled()\" (click)=\"zoomOut()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:zoom_out'\"></mat-icon>\r\n </button>\r\n <button matIconButton [disabled]=\"isZoomInDisabled()\" (click)=\"zoomIn()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:zoom_in'\"></mat-icon>\r\n </button>\r\n <button #closeButton matIconButton (click)=\"closePreview()\">\r\n <mat-icon class=\"text-white\" [svgIcon]=\"'mat_solid:close'\"></mat-icon>\r\n </button>\r\n </div>\r\n @if(previewVisible()){\r\n <div role=\"presentation\" class=\"cmat-image-preview-enter\" animate.leave=\"cmat-image-preview-leave\"\r\n (click)=\"onPreviewImageClick($event)\">\r\n <img class=\"cmat-image-preview\" alt=\"image\" \r\n [attr.src]=\"previewImageSrc() ? previewImageSrc() : src()\"\r\n [attr.srcset]=\"previewImageSrcSet()\" \r\n [ngStyle]=\"imagePreviewStyle()\" />\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n</span>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MA6Ba,kBAAkB,CAAA;AA2D3B,IAAA,WAAA,GAAA;QA1DS,IAAA,CAAA,OAAO,GAAG,SAAS,CAAiB,MAAM;oFAAC;QAC3C,IAAA,CAAA,gBAAgB,GAAG,SAAS,CAAoB,eAAe;6FAAC;QAChE,IAAA,CAAA,cAAc,GAAG,SAAS,CAAoB,aAAa;2FAAC;Q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AAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,OAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,SAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,iBAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,iBAAA,CAAA,EAAA,CAAA,EAAA,gBAAA,EAAA,CAAA;sBAiFnE,YAAY;uBAAC,yBAAyB,EAAE,CAAC,QAAQ,CAAC;;;AEjHvD;;AAEG;;"}
|
|
@@ -12,10 +12,10 @@ class CmatInlineLoadingComponent {
|
|
|
12
12
|
this.showText = input(true, /* @ts-ignore */
|
|
13
13
|
...(ngDevMode ? [{ debugName: "showText" }] : /* istanbul ignore next */ []));
|
|
14
14
|
}
|
|
15
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
16
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.
|
|
15
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatInlineLoadingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
16
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.0", type: CmatInlineLoadingComponent, isStandalone: true, selector: "cmat-inline-loading", inputs: { message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null }, diameter: { classPropertyName: "diameter", publicName: "diameter", isSignal: true, isRequired: false, transformFunction: null }, showText: { classPropertyName: "showText", publicName: "showText", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"inline-flex items-center gap-2 rounded-full bg-hover px-3 py-1 text-sm text-secondary\">\r\n <mat-progress-spinner mode=\"indeterminate\" color=\"primary\" [diameter]=\"diameter()\" [strokeWidth]=\"2\"></mat-progress-spinner>\r\n @if (showText()) {\r\n <span>{{ message() }}</span>\r\n }\r\n</div>\r\n", styles: [":host{display:inline-flex}\n"], dependencies: [{ kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i1.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
17
17
|
}
|
|
18
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
18
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatInlineLoadingComponent, decorators: [{
|
|
19
19
|
type: Component,
|
|
20
20
|
args: [{ selector: 'cmat-inline-loading', changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatProgressSpinnerModule], template: "<div class=\"inline-flex items-center gap-2 rounded-full bg-hover px-3 py-1 text-sm text-secondary\">\r\n <mat-progress-spinner mode=\"indeterminate\" color=\"primary\" [diameter]=\"diameter()\" [strokeWidth]=\"2\"></mat-progress-spinner>\r\n @if (showText()) {\r\n <span>{{ message() }}</span>\r\n }\r\n</div>\r\n", styles: [":host{display:inline-flex}\n"] }]
|
|
21
21
|
}], propDecorators: { message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }], diameter: [{ type: i0.Input, args: [{ isSignal: true, alias: "diameter", required: false }] }], showText: [{ type: i0.Input, args: [{ isSignal: true, alias: "showText", required: false }] }] } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmat-components-inline-loading.mjs","sources":["../../../projects/cmat/components/inline-loading/inline-loading.component.ts","../../../projects/cmat/components/inline-loading/inline-loading.component.html","../../../projects/cmat/components/inline-loading/cmat-components-inline-loading.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input } from '@angular/core';\r\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\r\n\r\n@Component({\r\n selector: 'cmat-inline-loading',\r\n templateUrl: './inline-loading.component.html',\r\n styleUrls: ['./inline-loading.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [MatProgressSpinnerModule]\r\n})\r\nexport class CmatInlineLoadingComponent {\r\n readonly message=input<string>('加载中...');\r\n readonly diameter=input<number>(20);\r\n readonly showText=input<boolean>(true);\r\n}\r\n","<div class=\"inline-flex items-center gap-2 rounded-full bg-hover px-3 py-1 text-sm text-secondary\">\r\n <mat-progress-spinner mode=\"indeterminate\" color=\"primary\" [diameter]=\"diameter()\" [strokeWidth]=\"2\"></mat-progress-spinner>\r\n @if (showText()) {\r\n <span>{{ message() }}</span>\r\n }\r\n</div>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAUa,0BAA0B,CAAA;AAPvC,IAAA,WAAA,GAAA;QAQa,IAAA,CAAA,OAAO,GAAC,KAAK,CAAS,QAAQ;oFAAC;QAC/B,IAAA,CAAA,QAAQ,GAAC,KAAK,CAAS,EAAE;qFAAC;QAC1B,IAAA,CAAA,QAAQ,GAAC,KAAK,CAAU,IAAI;qFAAC;AACzC,IAAA;8GAJY,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAA1B,0BAA0B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,qBAAA,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,UAAA,EAAA,SAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,UAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,UAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECVvC,4UAMA,EAAA,MAAA,EAAA,CAAA,8BAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDEc,wBAAwB,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,kBAAA,EAAA,QAAA,EAAA,mCAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,MAAA,EAAA,OAAA,EAAA,UAAA,EAAA,aAAA,CAAA,EAAA,QAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAEzB,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAPtC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,qBAAqB,mBAGd,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC,CAAC,wBAAwB,CAAC,EAAA,QAAA,EAAA,4UAAA,EAAA,MAAA,EAAA,CAAA,8BAAA,CAAA,EAAA;;;AERvC;;AAEG
|
|
1
|
+
{"version":3,"file":"cmat-components-inline-loading.mjs","sources":["../../../projects/cmat/components/inline-loading/inline-loading.component.ts","../../../projects/cmat/components/inline-loading/inline-loading.component.html","../../../projects/cmat/components/inline-loading/cmat-components-inline-loading.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input } from '@angular/core';\r\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\r\n\r\n@Component({\r\n selector: 'cmat-inline-loading',\r\n templateUrl: './inline-loading.component.html',\r\n styleUrls: ['./inline-loading.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [MatProgressSpinnerModule]\r\n})\r\nexport class CmatInlineLoadingComponent {\r\n readonly message=input<string>('加载中...');\r\n readonly diameter=input<number>(20);\r\n readonly showText=input<boolean>(true);\r\n}\r\n","<div class=\"inline-flex items-center gap-2 rounded-full bg-hover px-3 py-1 text-sm text-secondary\">\r\n <mat-progress-spinner mode=\"indeterminate\" color=\"primary\" [diameter]=\"diameter()\" [strokeWidth]=\"2\"></mat-progress-spinner>\r\n @if (showText()) {\r\n <span>{{ message() }}</span>\r\n }\r\n</div>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAUa,0BAA0B,CAAA;AAPvC,IAAA,WAAA,GAAA;QAQa,IAAA,CAAA,OAAO,GAAC,KAAK,CAAS,QAAQ;oFAAC;QAC/B,IAAA,CAAA,QAAQ,GAAC,KAAK,CAAS,EAAE;qFAAC;QAC1B,IAAA,CAAA,QAAQ,GAAC,KAAK,CAAU,IAAI;qFAAC;AACzC,IAAA;8GAJY,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAA1B,0BAA0B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,qBAAA,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,UAAA,EAAA,SAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,UA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