cmat 0.0.86 → 0.0.88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/cmat-components-adapter.mjs +9 -9
- package/fesm2022/cmat-components-adapter.mjs.map +1 -1
- package/fesm2022/cmat-components-breadcrumb.mjs +98 -80
- package/fesm2022/cmat-components-breadcrumb.mjs.map +1 -1
- package/fesm2022/cmat-components-card.mjs +26 -34
- package/fesm2022/cmat-components-card.mjs.map +1 -1
- package/fesm2022/cmat-components-carousel.mjs +467 -556
- package/fesm2022/cmat-components-carousel.mjs.map +1 -1
- package/fesm2022/cmat-components-cascade.mjs +270 -259
- package/fesm2022/cmat-components-cascade.mjs.map +1 -1
- package/fesm2022/cmat-components-chip-input.mjs +200 -116
- package/fesm2022/cmat-components-chip-input.mjs.map +1 -1
- package/fesm2022/cmat-components-code-editor.mjs +85 -38
- package/fesm2022/cmat-components-code-editor.mjs.map +1 -1
- package/fesm2022/cmat-components-color-picker.mjs +841 -0
- package/fesm2022/cmat-components-color-picker.mjs.map +1 -0
- package/fesm2022/cmat-components-custom-formly.mjs +1395 -838
- package/fesm2022/cmat-components-custom-formly.mjs.map +1 -1
- package/fesm2022/cmat-components-data-picker.mjs +996 -0
- package/fesm2022/cmat-components-data-picker.mjs.map +1 -0
- package/fesm2022/cmat-components-date-range.mjs +310 -264
- package/fesm2022/cmat-components-date-range.mjs.map +1 -1
- package/fesm2022/cmat-components-date-time-display.mjs +16 -20
- package/fesm2022/cmat-components-date-time-display.mjs.map +1 -1
- package/fesm2022/cmat-components-drawer.mjs +120 -137
- package/fesm2022/cmat-components-drawer.mjs.map +1 -1
- package/fesm2022/cmat-components-empty-state.mjs +17 -24
- package/fesm2022/cmat-components-empty-state.mjs.map +1 -1
- package/fesm2022/cmat-components-file-preview.mjs +18 -24
- package/fesm2022/cmat-components-file-preview.mjs.map +1 -1
- package/fesm2022/cmat-components-filter-toolbar.mjs +30 -39
- package/fesm2022/cmat-components-filter-toolbar.mjs.map +1 -1
- package/fesm2022/cmat-components-form-actions.mjs +12 -12
- package/fesm2022/cmat-components-form-actions.mjs.map +1 -1
- package/fesm2022/cmat-components-fullscreen.mjs +10 -10
- package/fesm2022/cmat-components-fullscreen.mjs.map +1 -1
- package/fesm2022/cmat-components-highlight.mjs +48 -41
- package/fesm2022/cmat-components-highlight.mjs.map +1 -1
- package/fesm2022/cmat-components-image-viewer.mjs +104 -107
- package/fesm2022/cmat-components-image-viewer.mjs.map +1 -1
- package/fesm2022/cmat-components-inline-loading.mjs +12 -15
- package/fesm2022/cmat-components-inline-loading.mjs.map +1 -1
- package/fesm2022/cmat-components-json-editor.mjs +118 -75
- package/fesm2022/cmat-components-json-editor.mjs.map +1 -1
- package/fesm2022/cmat-components-knob-input.mjs +196 -178
- package/fesm2022/cmat-components-knob-input.mjs.map +1 -1
- package/fesm2022/cmat-components-masonry.mjs +26 -41
- package/fesm2022/cmat-components-masonry.mjs.map +1 -1
- package/fesm2022/cmat-components-material-color-picker.mjs +81 -80
- package/fesm2022/cmat-components-material-color-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-material-datetimepicker.mjs +1212 -1287
- package/fesm2022/cmat-components-material-datetimepicker.mjs.map +1 -1
- package/fesm2022/cmat-components-navigation.mjs +467 -450
- package/fesm2022/cmat-components-navigation.mjs.map +1 -1
- package/fesm2022/cmat-components-opt-input.mjs +143 -132
- package/fesm2022/cmat-components-opt-input.mjs.map +1 -1
- package/fesm2022/cmat-components-org-chart.mjs +68 -83
- package/fesm2022/cmat-components-org-chart.mjs.map +1 -1
- package/fesm2022/cmat-components-page-header.mjs +18 -24
- package/fesm2022/cmat-components-page-header.mjs.map +1 -1
- package/fesm2022/cmat-components-pagination.mjs +220 -136
- package/fesm2022/cmat-components-pagination.mjs.map +1 -1
- package/fesm2022/cmat-components-password-strength.mjs +262 -215
- package/fesm2022/cmat-components-password-strength.mjs.map +1 -1
- package/fesm2022/cmat-components-popover.mjs +227 -195
- package/fesm2022/cmat-components-popover.mjs.map +1 -1
- package/fesm2022/cmat-components-progress-bar.mjs +15 -34
- package/fesm2022/cmat-components-progress-bar.mjs.map +1 -1
- package/fesm2022/cmat-components-qrcode.mjs +95 -88
- package/fesm2022/cmat-components-qrcode.mjs.map +1 -1
- package/fesm2022/cmat-components-rating.mjs +70 -67
- package/fesm2022/cmat-components-rating.mjs.map +1 -1
- package/fesm2022/cmat-components-rich-text-editor.mjs +23 -26
- package/fesm2022/cmat-components-rich-text-editor.mjs.map +1 -1
- package/fesm2022/cmat-components-select-search.mjs +190 -159
- package/fesm2022/cmat-components-select-search.mjs.map +1 -1
- package/fesm2022/cmat-components-select-table.mjs +276 -213
- package/fesm2022/cmat-components-select-table.mjs.map +1 -1
- package/fesm2022/cmat-components-select-tree.mjs +178 -128
- package/fesm2022/cmat-components-select-tree.mjs.map +1 -1
- package/fesm2022/cmat-components-skeleton.mjs +44 -28
- package/fesm2022/cmat-components-skeleton.mjs.map +1 -1
- package/fesm2022/cmat-components-speed-dial.mjs +107 -163
- package/fesm2022/cmat-components-speed-dial.mjs.map +1 -1
- package/fesm2022/cmat-components-status-tag.mjs +29 -36
- package/fesm2022/cmat-components-status-tag.mjs.map +1 -1
- package/fesm2022/cmat-components-table-toolbar.mjs +14 -18
- package/fesm2022/cmat-components-table-toolbar.mjs.map +1 -1
- package/fesm2022/cmat-components-timeline.mjs +111 -118
- package/fesm2022/cmat-components-timeline.mjs.map +1 -1
- package/fesm2022/cmat-components-toast.mjs +65 -66
- package/fesm2022/cmat-components-toast.mjs.map +1 -1
- package/fesm2022/cmat-components-transfer-picker.mjs +130 -160
- package/fesm2022/cmat-components-transfer-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-treetable.mjs +32 -39
- package/fesm2022/cmat-components-treetable.mjs.map +1 -1
- package/fesm2022/cmat-components-upload.mjs +186 -176
- package/fesm2022/cmat-components-upload.mjs.map +1 -1
- package/fesm2022/cmat-directives-animate-on-scroll.mjs +25 -28
- package/fesm2022/cmat-directives-animate-on-scroll.mjs.map +1 -1
- package/fesm2022/cmat-directives-arrow-cursor.mjs +85 -92
- package/fesm2022/cmat-directives-arrow-cursor.mjs.map +1 -1
- package/fesm2022/cmat-directives-autofocus.mjs +3 -3
- package/fesm2022/cmat-directives-autofocus.mjs.map +1 -1
- package/fesm2022/cmat-directives-data-exporter.mjs +49 -50
- package/fesm2022/cmat-directives-data-exporter.mjs.map +1 -1
- package/fesm2022/cmat-directives-debounce.mjs +16 -19
- package/fesm2022/cmat-directives-debounce.mjs.map +1 -1
- package/fesm2022/cmat-directives-digit-only.mjs +60 -69
- package/fesm2022/cmat-directives-digit-only.mjs.map +1 -1
- package/fesm2022/cmat-directives-equal-validator.mjs +3 -3
- package/fesm2022/cmat-directives-equal-validator.mjs.map +1 -1
- package/fesm2022/cmat-directives-seamless-auto-scroll.mjs +31 -30
- package/fesm2022/cmat-directives-seamless-auto-scroll.mjs.map +1 -1
- package/fesm2022/cmat-lib-mock-api.mjs +6 -6
- package/fesm2022/cmat-lib-mock-api.mjs.map +1 -1
- package/fesm2022/cmat-pipes-bytes.mjs +3 -3
- package/fesm2022/cmat-pipes-bytes.mjs.map +1 -1
- package/fesm2022/cmat-pipes-date-format.mjs +3 -3
- package/fesm2022/cmat-pipes-date-format.mjs.map +1 -1
- package/fesm2022/cmat-pipes-find-by-key.mjs +3 -3
- package/fesm2022/cmat-pipes-find-by-key.mjs.map +1 -1
- package/fesm2022/cmat-pipes-group-by.mjs +3 -3
- package/fesm2022/cmat-pipes-group-by.mjs.map +1 -1
- package/fesm2022/cmat-pipes-keys.mjs +3 -3
- package/fesm2022/cmat-pipes-keys.mjs.map +1 -1
- package/fesm2022/cmat-pipes-secure.mjs +7 -13
- package/fesm2022/cmat-pipes-secure.mjs.map +1 -1
- package/fesm2022/cmat-pipes-uppercase.mjs +3 -3
- package/fesm2022/cmat-pipes-uppercase.mjs.map +1 -1
- package/fesm2022/cmat-services-alert.mjs +26 -27
- package/fesm2022/cmat-services-alert.mjs.map +1 -1
- package/fesm2022/cmat-services-config.mjs +14 -23
- package/fesm2022/cmat-services-config.mjs.map +1 -1
- package/fesm2022/cmat-services-confirmation.mjs +8 -8
- package/fesm2022/cmat-services-confirmation.mjs.map +1 -1
- package/fesm2022/cmat-services-data.mjs +6 -10
- package/fesm2022/cmat-services-data.mjs.map +1 -1
- package/fesm2022/cmat-services-export-as.mjs +3 -3
- package/fesm2022/cmat-services-export-as.mjs.map +1 -1
- package/fesm2022/cmat-services-loading.mjs +30 -47
- package/fesm2022/cmat-services-loading.mjs.map +1 -1
- package/fesm2022/cmat-services-local-storage.mjs +3 -3
- package/fesm2022/cmat-services-local-storage.mjs.map +1 -1
- package/fesm2022/cmat-services-media-watcher.mjs +43 -34
- package/fesm2022/cmat-services-media-watcher.mjs.map +1 -1
- package/fesm2022/cmat-services-platform.mjs +3 -3
- package/fesm2022/cmat-services-platform.mjs.map +1 -1
- package/fesm2022/cmat-services-splash-screen.mjs +3 -3
- package/fesm2022/cmat-services-splash-screen.mjs.map +1 -1
- package/fesm2022/cmat-services-title.mjs +3 -3
- package/fesm2022/cmat-services-title.mjs.map +1 -1
- package/fesm2022/cmat-services-translation.mjs +11 -11
- package/fesm2022/cmat-services-translation.mjs.map +1 -1
- package/fesm2022/cmat-services-utils.mjs +4 -4
- package/fesm2022/cmat-services-utils.mjs.map +1 -1
- package/fesm2022/cmat.mjs +9229 -7508
- package/fesm2022/cmat.mjs.map +1 -1
- package/icons/material-icons/heroicons-outline.svg +3 -0
- package/icons/material-icons/heroicons-solid.svg +3 -0
- package/package.json +10 -1
- package/styles/components/bundle.scss +21 -0
- package/styles/overrides/angular-material.scss +22 -1
- package/tailwind/plugins/theming.js +183 -183
- package/types/cmat-components-breadcrumb.d.ts +40 -37
- package/types/cmat-components-card.d.ts +11 -13
- package/types/cmat-components-carousel.d.ts +87 -113
- package/types/cmat-components-cascade.d.ts +84 -65
- package/types/cmat-components-chip-input.d.ts +29 -24
- package/types/cmat-components-code-editor.d.ts +28 -12
- package/types/cmat-components-color-picker.d.ts +236 -0
- package/types/cmat-components-custom-formly.d.ts +316 -184
- package/types/cmat-components-data-picker.d.ts +372 -0
- package/types/cmat-components-date-range.d.ts +31 -36
- package/types/cmat-components-date-time-display.d.ts +8 -8
- package/types/cmat-components-drawer.d.ts +30 -32
- package/types/cmat-components-empty-state.d.ts +9 -10
- package/types/cmat-components-file-preview.d.ts +9 -9
- package/types/cmat-components-filter-toolbar.d.ts +15 -15
- package/types/cmat-components-form-actions.d.ts +5 -5
- package/types/cmat-components-fullscreen.d.ts +5 -5
- package/types/cmat-components-highlight.d.ts +13 -14
- package/types/cmat-components-image-viewer.d.ts +29 -33
- package/types/cmat-components-inline-loading.d.ts +6 -6
- package/types/cmat-components-json-editor.d.ts +15 -17
- package/types/cmat-components-knob-input.d.ts +58 -55
- package/types/cmat-components-masonry.d.ts +9 -12
- package/types/cmat-components-material-color-picker.d.ts +16 -21
- package/types/cmat-components-material-datetimepicker.d.ts +174 -216
- package/types/cmat-components-navigation.d.ts +34 -39
- package/types/cmat-components-opt-input.d.ts +35 -33
- package/types/cmat-components-org-chart.d.ts +8 -9
- package/types/cmat-components-page-header.d.ts +9 -9
- package/types/cmat-components-pagination.d.ts +36 -40
- package/types/cmat-components-password-strength.d.ts +58 -64
- package/types/cmat-components-popover.d.ts +22 -32
- package/types/cmat-components-progress-bar.d.ts +7 -10
- package/types/cmat-components-qrcode.d.ts +22 -22
- package/types/cmat-components-rating.d.ts +17 -19
- package/types/cmat-components-rich-text-editor.d.ts +11 -12
- package/types/cmat-components-select-search.d.ts +48 -36
- package/types/cmat-components-select-table.d.ts +38 -34
- package/types/cmat-components-select-tree.d.ts +17 -15
- package/types/cmat-components-skeleton.d.ts +27 -10
- package/types/cmat-components-speed-dial.d.ts +24 -33
- package/types/cmat-components-status-tag.d.ts +19 -9
- package/types/cmat-components-table-toolbar.d.ts +7 -7
- package/types/cmat-components-timeline.d.ts +33 -34
- package/types/cmat-components-toast.d.ts +26 -30
- package/types/cmat-components-transfer-picker.d.ts +51 -56
- package/types/cmat-components-treetable.d.ts +12 -13
- package/types/cmat-components-upload.d.ts +33 -38
- package/types/cmat-components-x6-angular-shape.d.ts +1 -1
- package/types/cmat-directives-animate-on-scroll.d.ts +7 -7
- package/types/cmat-directives-arrow-cursor.d.ts +18 -20
- package/types/cmat-directives-data-exporter.d.ts +10 -10
- package/types/cmat-directives-debounce.d.ts +5 -5
- package/types/cmat-directives-digit-only.d.ts +13 -13
- package/types/cmat-directives-seamless-auto-scroll.d.ts +7 -7
- package/types/cmat-pipes-secure.d.ts +1 -3
- package/types/cmat-services-alert.d.ts +11 -12
- package/types/cmat-services-config.d.ts +2 -7
- package/types/cmat-services-confirmation.d.ts +2 -2
- package/types/cmat-services-data.d.ts +0 -1
- package/types/cmat-services-loading.d.ts +14 -22
- package/types/cmat-services-media-watcher.d.ts +5 -5
- package/types/cmat-services-translation.d.ts +4 -5
- package/types/cmat.d.ts +2167 -1746
|
@@ -1,38 +1,32 @@
|
|
|
1
1
|
import { CommonModule } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import {
|
|
3
|
+
import { input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
4
|
import * as i1 from '@angular/material/icon';
|
|
5
5
|
import { MatIconModule } from '@angular/material/icon';
|
|
6
6
|
import { CmatImageComponent } from 'cmat/components/image-viewer';
|
|
7
7
|
|
|
8
8
|
class CmatFilePreviewComponent {
|
|
9
9
|
constructor() {
|
|
10
|
-
this.name = ''
|
|
11
|
-
|
|
12
|
-
this.
|
|
13
|
-
|
|
14
|
-
this.
|
|
15
|
-
|
|
10
|
+
this.name = input('', /* @ts-ignore */
|
|
11
|
+
...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
12
|
+
this.description = input('', /* @ts-ignore */
|
|
13
|
+
...(ngDevMode ? [{ debugName: "description" }] : /* istanbul ignore next */ []));
|
|
14
|
+
this.fileType = input('file', /* @ts-ignore */
|
|
15
|
+
...(ngDevMode ? [{ debugName: "fileType" }] : /* istanbul ignore next */ []));
|
|
16
|
+
this.size = input('', /* @ts-ignore */
|
|
17
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
18
|
+
this.src = input('', /* @ts-ignore */
|
|
19
|
+
...(ngDevMode ? [{ debugName: "src" }] : /* istanbul ignore next */ []));
|
|
20
|
+
this.previewImage = input(true, /* @ts-ignore */
|
|
21
|
+
...(ngDevMode ? [{ debugName: "previewImage" }] : /* istanbul ignore next */ []));
|
|
16
22
|
}
|
|
17
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
18
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
23
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatFilePreviewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
24
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", 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 }); }
|
|
19
25
|
}
|
|
20
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
26
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatFilePreviewComponent, decorators: [{
|
|
21
27
|
type: Component,
|
|
22
|
-
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 @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"] }]
|
|
23
|
-
}], propDecorators: { name: [{
|
|
24
|
-
type: Input
|
|
25
|
-
}], description: [{
|
|
26
|
-
type: Input
|
|
27
|
-
}], fileType: [{
|
|
28
|
-
type: Input
|
|
29
|
-
}], size: [{
|
|
30
|
-
type: Input
|
|
31
|
-
}], src: [{
|
|
32
|
-
type: Input
|
|
33
|
-
}], previewImage: [{
|
|
34
|
-
type: Input
|
|
35
|
-
}] } });
|
|
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
|
+
}], 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 }] }] } });
|
|
36
30
|
|
|
37
31
|
/**
|
|
38
32
|
* Generated bundle index. Do not edit.
|
|
@@ -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,
|
|
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;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CommonModule } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import {
|
|
3
|
+
import { input, output, inject, DestroyRef, effect, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
4
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
5
|
import * as i5 from '@angular/forms';
|
|
6
6
|
import { FormControl, ReactiveFormsModule } from '@angular/forms';
|
|
@@ -15,26 +15,36 @@ import { MatInputModule } from '@angular/material/input';
|
|
|
15
15
|
|
|
16
16
|
class CmatFilterToolbarComponent {
|
|
17
17
|
constructor() {
|
|
18
|
-
this.title = ''
|
|
19
|
-
|
|
20
|
-
this.
|
|
21
|
-
|
|
22
|
-
this.
|
|
23
|
-
|
|
24
|
-
this.
|
|
25
|
-
|
|
26
|
-
this.
|
|
27
|
-
|
|
18
|
+
this.title = input('', /* @ts-ignore */
|
|
19
|
+
...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
20
|
+
this.description = input('', /* @ts-ignore */
|
|
21
|
+
...(ngDevMode ? [{ debugName: "description" }] : /* istanbul ignore next */ []));
|
|
22
|
+
this.searchPlaceholder = input('搜索', /* @ts-ignore */
|
|
23
|
+
...(ngDevMode ? [{ debugName: "searchPlaceholder" }] : /* istanbul ignore next */ []));
|
|
24
|
+
this.showSearch = input(true, /* @ts-ignore */
|
|
25
|
+
...(ngDevMode ? [{ debugName: "showSearch" }] : /* istanbul ignore next */ []));
|
|
26
|
+
this.searchText = input('', /* @ts-ignore */
|
|
27
|
+
...(ngDevMode ? [{ debugName: "searchText" }] : /* istanbul ignore next */ []));
|
|
28
|
+
this.clearable = input(true, /* @ts-ignore */
|
|
29
|
+
...(ngDevMode ? [{ debugName: "clearable" }] : /* istanbul ignore next */ []));
|
|
30
|
+
this.searchTextChange = output();
|
|
31
|
+
this.clear = output();
|
|
32
|
+
this.searchSubmit = output();
|
|
28
33
|
this.searchControl = new FormControl('');
|
|
29
34
|
this._destroyRef = inject(DestroyRef);
|
|
35
|
+
effect(() => {
|
|
36
|
+
const externalText = this.searchText();
|
|
37
|
+
const currentControlValue = this.searchControl.value;
|
|
38
|
+
if (externalText !== currentControlValue) {
|
|
39
|
+
this.searchControl.setValue(externalText, { emitEvent: false });
|
|
40
|
+
}
|
|
41
|
+
});
|
|
30
42
|
}
|
|
31
43
|
ngOnInit() {
|
|
32
|
-
this.searchControl.setValue(this.searchText, { emitEvent: false });
|
|
33
44
|
this.searchControl.valueChanges
|
|
34
45
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
35
46
|
.subscribe((value) => {
|
|
36
47
|
const text = value ?? '';
|
|
37
|
-
this.searchText = text;
|
|
38
48
|
this.searchTextChange.emit(text);
|
|
39
49
|
});
|
|
40
50
|
}
|
|
@@ -45,34 +55,15 @@ class CmatFilterToolbarComponent {
|
|
|
45
55
|
this.searchControl.setValue('', { emitEvent: true });
|
|
46
56
|
this.clear.emit();
|
|
47
57
|
}
|
|
48
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
49
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
58
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatFilterToolbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
59
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", 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 mat-icon-button 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 }); }
|
|
50
60
|
}
|
|
51
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
61
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatFilterToolbarComponent, decorators: [{
|
|
52
62
|
type: Component,
|
|
53
|
-
args: [{ selector: 'cmat-filter-toolbar', changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, MatButtonModule, MatFormFieldModule, MatIconModule, MatInputModule, ReactiveFormsModule],
|
|
54
|
-
|
|
55
|
-
type:
|
|
56
|
-
|
|
57
|
-
type: Input
|
|
58
|
-
}], searchPlaceholder: [{
|
|
59
|
-
type: Input
|
|
60
|
-
}], showSearch: [{
|
|
61
|
-
type: Input
|
|
62
|
-
}], searchText: [{
|
|
63
|
-
type: Input
|
|
64
|
-
}], clearable: [{
|
|
65
|
-
type: Input
|
|
66
|
-
}], searchTextChange: [{
|
|
67
|
-
type: Output
|
|
68
|
-
}], clear: [{
|
|
69
|
-
type: Output
|
|
70
|
-
}], searchSubmit: [{
|
|
71
|
-
type: Output
|
|
72
|
-
}], hostClass: [{
|
|
73
|
-
type: HostBinding,
|
|
74
|
-
args: ['class']
|
|
75
|
-
}] } });
|
|
63
|
+
args: [{ selector: 'cmat-filter-toolbar', changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, MatButtonModule, MatFormFieldModule, MatIconModule, MatInputModule, ReactiveFormsModule], host: {
|
|
64
|
+
'class': 'block'
|
|
65
|
+
}, 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 mat-icon-button 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"] }]
|
|
66
|
+
}], ctorParameters: () => [], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], showSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSearch", required: false }] }], searchText: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchText", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], searchTextChange: [{ type: i0.Output, args: ["searchTextChange"] }], clear: [{ type: i0.Output, args: ["clear"] }], searchSubmit: [{ type: i0.Output, args: ["searchSubmit"] }] } });
|
|
76
67
|
|
|
77
68
|
/**
|
|
78
69
|
* Generated bundle index. Do not edit.
|
|
@@ -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 {
|
|
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 mat-icon-button 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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,EAAA,CAAA,CAAA;;2FAKtG,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAVtC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,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,wjDAAA,EAAA,MAAA,EAAA,CAAA,wBAAA,CAAA,EAAA;;;AE1BL;;AAEG;;;;"}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
+
import { A11yModule } from '@angular/cdk/a11y';
|
|
2
|
+
import * as i1 from '@angular/common';
|
|
1
3
|
import { CommonModule } from '@angular/common';
|
|
2
4
|
import * as i0 from '@angular/core';
|
|
3
|
-
import {
|
|
5
|
+
import { input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
6
|
|
|
5
7
|
class CmatFormActionsComponent {
|
|
6
8
|
constructor() {
|
|
7
|
-
this.align = 'end'
|
|
8
|
-
|
|
9
|
+
this.align = input('end', /* @ts-ignore */
|
|
10
|
+
...(ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []));
|
|
11
|
+
this.divider = input(true, /* @ts-ignore */
|
|
12
|
+
...(ngDevMode ? [{ debugName: "divider" }] : /* istanbul ignore next */ []));
|
|
9
13
|
}
|
|
10
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
11
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
14
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatFormActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
15
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.2", 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 }); }
|
|
12
16
|
}
|
|
13
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
17
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatFormActionsComponent, decorators: [{
|
|
14
18
|
type: Component,
|
|
15
|
-
args: [{ selector: 'cmat-form-actions', changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule], template: "<div class=\"flex flex-col gap-3 border-default pt-4\"
|
|
16
|
-
}], propDecorators: { align: [{
|
|
17
|
-
type: Input
|
|
18
|
-
}], divider: [{
|
|
19
|
-
type: Input
|
|
20
|
-
}] } });
|
|
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
|
+
}], propDecorators: { align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }], divider: [{ type: i0.Input, args: [{ isSignal: true, alias: "divider", required: false }] }] } });
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Generated bundle index. Do not edit.
|
|
@@ -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 { CommonModule } from '@angular/common';\r\nimport { ChangeDetectionStrategy, Component,
|
|
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,6 +1,6 @@
|
|
|
1
1
|
import { NgTemplateOutlet } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { inject, DOCUMENT,
|
|
3
|
+
import { input, inject, DOCUMENT, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
|
|
4
4
|
import * as i1 from '@angular/material/button';
|
|
5
5
|
import { MatButtonModule } from '@angular/material/button';
|
|
6
6
|
import * as i3 from '@angular/material/icon';
|
|
@@ -10,6 +10,10 @@ import { MatTooltipModule } from '@angular/material/tooltip';
|
|
|
10
10
|
|
|
11
11
|
class CmatFullscreenComponent {
|
|
12
12
|
constructor() {
|
|
13
|
+
this.iconTpl = input(/* @ts-ignore */
|
|
14
|
+
...(ngDevMode ? [undefined, { debugName: "iconTpl" }] : /* istanbul ignore next */ []));
|
|
15
|
+
this.tooltip = input(/* @ts-ignore */
|
|
16
|
+
...(ngDevMode ? [undefined, { debugName: "tooltip" }] : /* istanbul ignore next */ []));
|
|
13
17
|
this._document = inject(DOCUMENT);
|
|
14
18
|
}
|
|
15
19
|
toggleFullscreen() {
|
|
@@ -28,17 +32,13 @@ class CmatFullscreenComponent {
|
|
|
28
32
|
});
|
|
29
33
|
}
|
|
30
34
|
}
|
|
31
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
32
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
35
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatFullscreenComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
36
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.2", 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 }); }
|
|
33
37
|
}
|
|
34
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
38
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatFullscreenComponent, decorators: [{
|
|
35
39
|
type: Component,
|
|
36
|
-
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" }]
|
|
37
|
-
}], propDecorators: { iconTpl: [{
|
|
38
|
-
type: Input
|
|
39
|
-
}], tooltip: [{
|
|
40
|
-
type: Input
|
|
41
|
-
}] } });
|
|
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
|
+
}], propDecorators: { iconTpl: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconTpl", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }] } });
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
44
|
* Generated bundle index. Do not edit.
|
|
@@ -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 {
|
|
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,CA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,EAAA,CAAA,yBAAA,EAAA,kBAAA,EAAA,0BAAA,CAAA,EAAA,EAAA,EAAA,IAAA,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;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NgClass } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { Injectable, inject, ElementRef, ViewContainerRef,
|
|
3
|
+
import { Injectable, input, viewChild, TemplateRef, signal, inject, ElementRef, ViewContainerRef, effect, untracked, SecurityContext, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
|
|
4
4
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
5
5
|
import hljs from 'highlight.js';
|
|
6
6
|
|
|
@@ -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: "
|
|
32
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
31
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatHighlightService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
32
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatHighlightService, providedIn: 'root' }); }
|
|
33
33
|
}
|
|
34
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
34
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatHighlightService, decorators: [{
|
|
35
35
|
type: Injectable,
|
|
36
36
|
args: [{
|
|
37
37
|
providedIn: 'root'
|
|
@@ -40,62 +40,69 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImpo
|
|
|
40
40
|
|
|
41
41
|
class CmatHighlightComponent {
|
|
42
42
|
constructor() {
|
|
43
|
+
this.code = input(/* @ts-ignore */
|
|
44
|
+
...(ngDevMode ? [undefined, { debugName: "code" }] : /* istanbul ignore next */ []));
|
|
45
|
+
this.lang = input(/* @ts-ignore */
|
|
46
|
+
...(ngDevMode ? [undefined, { debugName: "lang" }] : /* istanbul ignore next */ []));
|
|
47
|
+
this.templateRef = viewChild.required(TemplateRef);
|
|
48
|
+
this._highlightedCode = signal(null, /* @ts-ignore */
|
|
49
|
+
...(ngDevMode ? [{ debugName: "_highlightedCode" }] : /* istanbul ignore next */ []));
|
|
50
|
+
this._viewRef = null;
|
|
43
51
|
this._domSanitizer = inject(DomSanitizer);
|
|
44
52
|
this._elementRef = inject(ElementRef);
|
|
45
53
|
this._cmatHighlightService = inject(CmatHighlightService);
|
|
46
54
|
this._viewContainerRef = inject(ViewContainerRef);
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
if (!
|
|
55
|
+
effect(() => {
|
|
56
|
+
const codeInput = this.code();
|
|
57
|
+
const lang = this.lang();
|
|
58
|
+
if (!lang) {
|
|
51
59
|
return;
|
|
52
60
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
this._highlightAndInsert();
|
|
61
|
+
untracked(() => {
|
|
62
|
+
let codeToHighlight = codeInput;
|
|
63
|
+
codeToHighlight ??= this._elementRef.nativeElement.value ?? '';
|
|
64
|
+
if (!codeToHighlight) {
|
|
65
|
+
this._clearView();
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
this._processHighlight(codeToHighlight, lang);
|
|
69
|
+
});
|
|
70
|
+
});
|
|
64
71
|
}
|
|
65
|
-
|
|
66
|
-
if (!this.templateRef) {
|
|
72
|
+
_processHighlight(code, lang) {
|
|
73
|
+
if (!this.templateRef()) {
|
|
67
74
|
return;
|
|
68
75
|
}
|
|
69
|
-
|
|
76
|
+
const highlighted = this._cmatHighlightService.highlight(code, lang);
|
|
77
|
+
const sanitizedCode = this._domSanitizer.sanitize(SecurityContext.HTML, highlighted);
|
|
78
|
+
if (sanitizedCode === null) {
|
|
79
|
+
this._clearView();
|
|
70
80
|
return;
|
|
71
81
|
}
|
|
82
|
+
this._highlightedCode.set(sanitizedCode);
|
|
72
83
|
if (this._viewRef) {
|
|
73
84
|
this._viewRef.destroy();
|
|
74
85
|
this._viewRef = null;
|
|
75
86
|
}
|
|
76
|
-
this.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
this._viewRef = this._viewContainerRef.createEmbeddedView(this.templateRef, {
|
|
81
|
-
highlightedCode: this.highlightedCode,
|
|
82
|
-
lang: this.lang
|
|
87
|
+
this._viewRef = this._viewContainerRef.createEmbeddedView(this.templateRef(), {
|
|
88
|
+
highlightedCode: sanitizedCode,
|
|
89
|
+
lang: lang,
|
|
83
90
|
});
|
|
84
91
|
}
|
|
85
|
-
|
|
86
|
-
|
|
92
|
+
_clearView() {
|
|
93
|
+
if (this._viewRef) {
|
|
94
|
+
this._viewRef.destroy();
|
|
95
|
+
this._viewRef = null;
|
|
96
|
+
}
|
|
97
|
+
this._highlightedCode.set(null);
|
|
98
|
+
}
|
|
99
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatHighlightComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
100
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.2", 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 }); }
|
|
87
101
|
}
|
|
88
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
102
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatHighlightComponent, decorators: [{
|
|
89
103
|
type: Component,
|
|
90
|
-
args: [{ selector: 'textarea[cmat-highlight]', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatHighlight', imports: [NgClass], template: "<ng-
|
|
91
|
-
}], propDecorators: { code: [{
|
|
92
|
-
type: Input
|
|
93
|
-
}], lang: [{
|
|
94
|
-
type: Input
|
|
95
|
-
}], templateRef: [{
|
|
96
|
-
type: ViewChild,
|
|
97
|
-
args: [TemplateRef]
|
|
98
|
-
}] } });
|
|
104
|
+
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"] }]
|
|
105
|
+
}], 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 }] }] } });
|
|
99
106
|
|
|
100
107
|
/**
|
|
101
108
|
* Generated bundle index. Do not edit.
|