cmat 0.0.78 → 0.0.79
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 -46
- package/fesm2022/cmat-components-adapter.mjs.map +1 -1
- package/fesm2022/cmat-components-breadcrumb.mjs +104 -205
- package/fesm2022/cmat-components-breadcrumb.mjs.map +1 -1
- package/fesm2022/cmat-components-card.mjs +4 -8
- package/fesm2022/cmat-components-card.mjs.map +1 -1
- package/fesm2022/cmat-components-carousel.mjs +12 -12
- package/fesm2022/cmat-components-cascade.mjs +14 -20
- package/fesm2022/cmat-components-cascade.mjs.map +1 -1
- package/fesm2022/cmat-components-chip-input.mjs +21 -21
- package/fesm2022/cmat-components-chip-input.mjs.map +1 -1
- package/fesm2022/cmat-components-code-editor.mjs +4 -22
- package/fesm2022/cmat-components-code-editor.mjs.map +1 -1
- package/fesm2022/cmat-components-custom-formly.mjs +153 -220
- package/fesm2022/cmat-components-custom-formly.mjs.map +1 -1
- package/fesm2022/cmat-components-date-range.mjs +5 -177
- package/fesm2022/cmat-components-date-range.mjs.map +1 -1
- package/fesm2022/cmat-components-date-time-display.mjs +3 -15
- package/fesm2022/cmat-components-date-time-display.mjs.map +1 -1
- package/fesm2022/cmat-components-drawer.mjs +6 -96
- package/fesm2022/cmat-components-drawer.mjs.map +1 -1
- package/fesm2022/cmat-components-empty-state.mjs +4 -25
- package/fesm2022/cmat-components-empty-state.mjs.map +1 -1
- package/fesm2022/cmat-components-file-preview.mjs +3 -21
- package/fesm2022/cmat-components-file-preview.mjs.map +1 -1
- package/fesm2022/cmat-components-filter-toolbar.mjs +7 -50
- package/fesm2022/cmat-components-filter-toolbar.mjs.map +1 -1
- package/fesm2022/cmat-components-form-actions.mjs +3 -9
- package/fesm2022/cmat-components-form-actions.mjs.map +1 -1
- package/fesm2022/cmat-components-fullscreen.mjs +4 -4
- package/fesm2022/cmat-components-fullscreen.mjs.map +1 -1
- package/fesm2022/cmat-components-highlight.mjs +6 -31
- package/fesm2022/cmat-components-highlight.mjs.map +1 -1
- package/fesm2022/cmat-components-image-viewer.mjs +3 -12
- package/fesm2022/cmat-components-image-viewer.mjs.map +1 -1
- package/fesm2022/cmat-components-inline-loading.mjs +3 -12
- package/fesm2022/cmat-components-inline-loading.mjs.map +1 -1
- package/fesm2022/cmat-components-json-editor.mjs +10 -13
- package/fesm2022/cmat-components-json-editor.mjs.map +1 -1
- package/fesm2022/cmat-components-knob-input.mjs +18 -12
- package/fesm2022/cmat-components-knob-input.mjs.map +1 -1
- package/fesm2022/cmat-components-masonry.mjs +3 -9
- package/fesm2022/cmat-components-masonry.mjs.map +1 -1
- package/fesm2022/cmat-components-material-color-picker.mjs +3 -23
- package/fesm2022/cmat-components-material-color-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-material-datetimepicker.mjs +49 -397
- package/fesm2022/cmat-components-material-datetimepicker.mjs.map +1 -1
- package/fesm2022/cmat-components-navigation.mjs +183 -725
- package/fesm2022/cmat-components-navigation.mjs.map +1 -1
- package/fesm2022/cmat-components-opt-input.mjs +7 -10
- package/fesm2022/cmat-components-opt-input.mjs.map +1 -1
- package/fesm2022/cmat-components-org-chart.mjs +11 -11
- package/fesm2022/cmat-components-org-chart.mjs.map +1 -1
- package/fesm2022/cmat-components-page-header.mjs +8 -19
- package/fesm2022/cmat-components-page-header.mjs.map +1 -1
- package/fesm2022/cmat-components-pagination.mjs +96 -93
- package/fesm2022/cmat-components-pagination.mjs.map +1 -1
- package/fesm2022/cmat-components-password-strength.mjs +10 -11
- package/fesm2022/cmat-components-password-strength.mjs.map +1 -1
- package/fesm2022/cmat-components-popover.mjs +15 -149
- package/fesm2022/cmat-components-popover.mjs.map +1 -1
- package/fesm2022/cmat-components-progress-bar.mjs +9 -16
- package/fesm2022/cmat-components-progress-bar.mjs.map +1 -1
- package/fesm2022/cmat-components-qrcode.mjs +5 -11
- package/fesm2022/cmat-components-qrcode.mjs.map +1 -1
- package/fesm2022/cmat-components-rating.mjs +3 -3
- package/fesm2022/cmat-components-rich-text-editor.mjs +4 -25
- package/fesm2022/cmat-components-rich-text-editor.mjs.map +1 -1
- package/fesm2022/cmat-components-select-search.mjs +46 -72
- package/fesm2022/cmat-components-select-search.mjs.map +1 -1
- package/fesm2022/cmat-components-select-table.mjs +193 -150
- package/fesm2022/cmat-components-select-table.mjs.map +1 -1
- package/fesm2022/cmat-components-select-tree.mjs +124 -78
- package/fesm2022/cmat-components-select-tree.mjs.map +1 -1
- package/fesm2022/cmat-components-skeleton.mjs +4 -22
- package/fesm2022/cmat-components-skeleton.mjs.map +1 -1
- package/fesm2022/cmat-components-speed-dial.mjs +9 -11
- package/fesm2022/cmat-components-speed-dial.mjs.map +1 -1
- package/fesm2022/cmat-components-status-tag.mjs +3 -18
- package/fesm2022/cmat-components-status-tag.mjs.map +1 -1
- package/fesm2022/cmat-components-table-toolbar.mjs +3 -15
- package/fesm2022/cmat-components-table-toolbar.mjs.map +1 -1
- package/fesm2022/cmat-components-timeline.mjs +18 -21
- package/fesm2022/cmat-components-timeline.mjs.map +1 -1
- package/fesm2022/cmat-components-toast.mjs +16 -14
- package/fesm2022/cmat-components-toast.mjs.map +1 -1
- package/fesm2022/cmat-components-transfer-picker.mjs +103 -80
- package/fesm2022/cmat-components-transfer-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-treetable.mjs +6 -6
- package/fesm2022/cmat-components-upload.mjs +21 -36
- package/fesm2022/cmat-components-upload.mjs.map +1 -1
- package/fesm2022/cmat-components-x6-angular-shape.mjs +0 -1
- package/fesm2022/cmat-components-x6-angular-shape.mjs.map +1 -1
- package/fesm2022/cmat-directives-animate-on-scroll.mjs +6 -27
- package/fesm2022/cmat-directives-animate-on-scroll.mjs.map +1 -1
- package/fesm2022/cmat-directives-arrow-cursor.mjs +7 -9
- package/fesm2022/cmat-directives-arrow-cursor.mjs.map +1 -1
- package/fesm2022/cmat-directives-autofocus.mjs +3 -3
- package/fesm2022/cmat-directives-data-exporter.mjs +24 -33
- package/fesm2022/cmat-directives-data-exporter.mjs.map +1 -1
- package/fesm2022/cmat-directives-debounce.mjs +14 -17
- package/fesm2022/cmat-directives-debounce.mjs.map +1 -1
- package/fesm2022/cmat-directives-digit-only.mjs +6 -23
- package/fesm2022/cmat-directives-digit-only.mjs.map +1 -1
- package/fesm2022/cmat-directives-equal-validator.mjs +3 -3
- package/fesm2022/cmat-directives-seamless-auto-scroll.mjs +4 -11
- package/fesm2022/cmat-directives-seamless-auto-scroll.mjs.map +1 -1
- package/fesm2022/cmat-lib-mock-api.mjs +6 -43
- package/fesm2022/cmat-lib-mock-api.mjs.map +1 -1
- package/fesm2022/cmat-pipes-bytes.mjs +3 -3
- package/fesm2022/cmat-pipes-date-format.mjs +3 -3
- package/fesm2022/cmat-pipes-find-by-key.mjs +3 -5
- package/fesm2022/cmat-pipes-find-by-key.mjs.map +1 -1
- package/fesm2022/cmat-pipes-group-by.mjs +3 -3
- package/fesm2022/cmat-pipes-keys.mjs +3 -3
- package/fesm2022/cmat-pipes-secure.mjs +8 -12
- package/fesm2022/cmat-pipes-secure.mjs.map +1 -1
- package/fesm2022/cmat-pipes-uppercase.mjs +3 -3
- package/fesm2022/cmat-services-alert.mjs +3 -3
- package/fesm2022/cmat-services-config.mjs +50 -26
- package/fesm2022/cmat-services-config.mjs.map +1 -1
- package/fesm2022/cmat-services-confirmation.mjs +9 -11
- package/fesm2022/cmat-services-confirmation.mjs.map +1 -1
- package/fesm2022/cmat-services-data.mjs +56 -101
- package/fesm2022/cmat-services-data.mjs.map +1 -1
- package/fesm2022/cmat-services-export-as.mjs +4 -32
- package/fesm2022/cmat-services-export-as.mjs.map +1 -1
- package/fesm2022/cmat-services-loading.mjs +49 -40
- package/fesm2022/cmat-services-loading.mjs.map +1 -1
- package/fesm2022/cmat-services-local-storage.mjs +3 -3
- package/fesm2022/cmat-services-media-watcher.mjs +19 -25
- package/fesm2022/cmat-services-media-watcher.mjs.map +1 -1
- package/fesm2022/cmat-services-platform.mjs +3 -10
- package/fesm2022/cmat-services-platform.mjs.map +1 -1
- package/fesm2022/cmat-services-splash-screen.mjs +8 -13
- package/fesm2022/cmat-services-splash-screen.mjs.map +1 -1
- package/fesm2022/cmat-services-title.mjs +8 -12
- package/fesm2022/cmat-services-title.mjs.map +1 -1
- package/fesm2022/cmat-services-translation.mjs +3 -3
- package/fesm2022/cmat-services-utils.mjs +5 -27
- package/fesm2022/cmat-services-utils.mjs.map +1 -1
- package/fesm2022/cmat-validators.mjs +0 -8
- package/fesm2022/cmat-validators.mjs.map +1 -1
- package/fesm2022/cmat.mjs +3159 -3441
- package/fesm2022/cmat.mjs.map +1 -1
- package/package.json +1 -1
- package/tailwind/plugins/helpers.js +1 -10
- package/tailwind/plugins/scrollbar/index.js +0 -1
- package/tailwind/plugins/scrollbar/typedefs.js +1 -7
- package/tailwind/plugins/scrollbar/utilities.js +9 -58
- package/tailwind/plugins/scrollbar/variants.js +2 -17
- package/tailwind/plugins/theming.js +1 -57
- package/tailwind/utils/generate-contrasts.js +1 -12
- package/tailwind/utils/generate-palette.js +1 -32
- package/types/cmat-components-adapter.d.ts +0 -25
- package/types/cmat-components-breadcrumb.d.ts +25 -175
- package/types/cmat-components-carousel.d.ts +0 -18
- package/types/cmat-components-cascade.d.ts +1 -1
- package/types/cmat-components-chip-input.d.ts +4 -3
- package/types/cmat-components-code-editor.d.ts +0 -18
- package/types/cmat-components-custom-formly.d.ts +22 -28
- package/types/cmat-components-date-range.d.ts +0 -71
- package/types/cmat-components-date-time-display.d.ts +0 -15
- package/types/cmat-components-drawer.d.ts +0 -42
- package/types/cmat-components-empty-state.d.ts +0 -21
- package/types/cmat-components-file-preview.d.ts +0 -18
- package/types/cmat-components-filter-toolbar.d.ts +3 -43
- package/types/cmat-components-form-actions.d.ts +0 -6
- package/types/cmat-components-image-viewer.d.ts +0 -12
- package/types/cmat-components-inline-loading.d.ts +0 -9
- package/types/cmat-components-knob-input.d.ts +1 -1
- package/types/cmat-components-material-datetimepicker.d.ts +0 -263
- package/types/cmat-components-navigation.d.ts +24 -164
- package/types/cmat-components-opt-input.d.ts +1 -1
- package/types/cmat-components-page-header.d.ts +2 -16
- package/types/cmat-components-pagination.d.ts +22 -24
- package/types/cmat-components-popover.d.ts +1 -109
- package/types/cmat-components-progress-bar.d.ts +3 -4
- package/types/cmat-components-rich-text-editor.d.ts +0 -21
- package/types/cmat-components-select-search.d.ts +3 -19
- package/types/cmat-components-select-table.d.ts +17 -4
- package/types/cmat-components-select-tree.d.ts +20 -19
- package/types/cmat-components-skeleton.d.ts +0 -18
- package/types/cmat-components-status-tag.d.ts +0 -15
- package/types/cmat-components-table-toolbar.d.ts +0 -12
- package/types/cmat-components-timeline.d.ts +3 -4
- package/types/cmat-components-toast.d.ts +1 -0
- package/types/cmat-components-transfer-picker.d.ts +23 -27
- package/types/cmat-components-upload.d.ts +7 -10
- package/types/cmat-components-x6-angular-shape.d.ts +0 -1
- package/types/cmat-directives-arrow-cursor.d.ts +1 -1
- package/types/cmat-directives-debounce.d.ts +3 -4
- package/types/cmat-pipes-secure.d.ts +3 -4
- package/types/cmat-services-config.d.ts +35 -13
- package/types/cmat-services-data.d.ts +13 -12
- package/types/cmat-services-export-as.d.ts +0 -22
- package/types/cmat-services-loading.d.ts +15 -10
- package/types/cmat-services-media-watcher.d.ts +10 -13
- package/types/cmat-services-splash-screen.d.ts +2 -4
- package/types/cmat-services-title.d.ts +3 -5
- package/types/cmat.d.ts +655 -1308
|
@@ -7,41 +7,20 @@ import { MatIconModule } from '@angular/material/icon';
|
|
|
7
7
|
|
|
8
8
|
class CmatEmptyStateComponent {
|
|
9
9
|
constructor() {
|
|
10
|
-
/**
|
|
11
|
-
* 图标名称。
|
|
12
|
-
*/
|
|
13
10
|
this.icon = 'mat_outline:inbox';
|
|
14
|
-
/**
|
|
15
|
-
* 标题。
|
|
16
|
-
*/
|
|
17
11
|
this.title = '暂无内容';
|
|
18
|
-
|
|
19
|
-
* 说明文字。
|
|
20
|
-
*/
|
|
21
|
-
this.description = '当前没有可展示的数据。';
|
|
22
|
-
/**
|
|
23
|
-
* 按钮文字。
|
|
24
|
-
*/
|
|
12
|
+
this.description = '当前没有可显示的数据。';
|
|
25
13
|
this.ctaLabel = '';
|
|
26
|
-
/**
|
|
27
|
-
* 按钮是否禁用。
|
|
28
|
-
*/
|
|
29
14
|
this.ctaDisabled = false;
|
|
30
|
-
/**
|
|
31
|
-
* 点击按钮事件。
|
|
32
|
-
*/
|
|
33
15
|
this.ctaClick = new EventEmitter();
|
|
34
16
|
}
|
|
35
|
-
/**
|
|
36
|
-
* 触发操作。
|
|
37
|
-
*/
|
|
38
17
|
emitAction() {
|
|
39
18
|
this.ctaClick.emit();
|
|
40
19
|
}
|
|
41
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
42
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.
|
|
20
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CmatEmptyStateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
21
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: CmatEmptyStateComponent, isStandalone: true, selector: "cmat-empty-state", inputs: { icon: "icon", title: "title", description: "description", ctaLabel: "ctaLabel", ctaDisabled: "ctaDisabled" }, outputs: { ctaClick: "ctaClick" }, ngImport: i0, template: "<div class=\"flex flex-col items-center justify-center rounded-2xl bg-card px-6 py-10 text-center shadow-sm\">\r\n @if (icon) {\r\n <div class=\"flex h-16 w-16 items-center justify-center rounded-full bg-slate-100 dark:bg-slate-600 text-slate-500 dark:text-slate-300\">\r\n <mat-icon [svgIcon]=\"icon\"></mat-icon>\r\n </div>\r\n }\r\n\r\n <h3 class=\"mt-4 text-lg font-semibold\">{{ title }}</h3>\r\n\r\n @if (description) {\r\n <p class=\"mt-2 max-w-xl text-sm leading-6 text-slate-500 dark:text-slate-300\">{{ description }}</p>\r\n }\r\n\r\n @if (ctaLabel) {\r\n <div class=\"mt-4\">\r\n <button matButton=\"outlined\" type=\"button\" [disabled]=\"ctaDisabled\" (click)=\"emitAction()\">{{ ctaLabel }}</button>\r\n </div>\r\n }\r\n</div>\r\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
43
22
|
}
|
|
44
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
23
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CmatEmptyStateComponent, decorators: [{
|
|
45
24
|
type: Component,
|
|
46
25
|
args: [{ selector: 'cmat-empty-state', changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatButtonModule, MatIconModule], template: "<div class=\"flex flex-col items-center justify-center rounded-2xl bg-card px-6 py-10 text-center shadow-sm\">\r\n @if (icon) {\r\n <div class=\"flex h-16 w-16 items-center justify-center rounded-full bg-slate-100 dark:bg-slate-600 text-slate-500 dark:text-slate-300\">\r\n <mat-icon [svgIcon]=\"icon\"></mat-icon>\r\n </div>\r\n }\r\n\r\n <h3 class=\"mt-4 text-lg font-semibold\">{{ title }}</h3>\r\n\r\n @if (description) {\r\n <p class=\"mt-2 max-w-xl text-sm leading-6 text-slate-500 dark:text-slate-300\">{{ description }}</p>\r\n }\r\n\r\n @if (ctaLabel) {\r\n <div class=\"mt-4\">\r\n <button matButton=\"outlined\" type=\"button\" [disabled]=\"ctaDisabled\" (click)=\"emitAction()\">{{ ctaLabel }}</button>\r\n </div>\r\n }\r\n</div>\r\n", styles: [":host{display:block}\n"] }]
|
|
47
26
|
}], propDecorators: { icon: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmat-components-empty-state.mjs","sources":["../../../projects/cmat/components/empty-state/empty-state.component.ts","../../../projects/cmat/components/empty-state/empty-state.component.html","../../../projects/cmat/components/empty-state/cmat-components-empty-state.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatIconModule } from '@angular/material/icon';\r\n\r\n@Component({\r\n selector: 'cmat-empty-state',\r\n templateUrl: './empty-state.component.html',\r\n styleUrls: ['./empty-state.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [MatButtonModule, MatIconModule]\r\n})\r\nexport class CmatEmptyStateComponent {\r\n
|
|
1
|
+
{"version":3,"file":"cmat-components-empty-state.mjs","sources":["../../../projects/cmat/components/empty-state/empty-state.component.ts","../../../projects/cmat/components/empty-state/empty-state.component.html","../../../projects/cmat/components/empty-state/cmat-components-empty-state.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatIconModule } from '@angular/material/icon';\r\n\r\n@Component({\r\n selector: 'cmat-empty-state',\r\n templateUrl: './empty-state.component.html',\r\n styleUrls: ['./empty-state.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [MatButtonModule, MatIconModule]\r\n})\r\nexport class CmatEmptyStateComponent {\r\n \r\n @Input() icon = 'mat_outline:inbox';\r\n\r\n \r\n @Input() title = '暂无内容';\r\n\r\n \r\n @Input() description = '当前没有可显示的数据。';\r\n\r\n \r\n @Input() ctaLabel = '';\r\n\r\n \r\n @Input() ctaDisabled = false;\r\n\r\n \r\n @Output() ctaClick = new EventEmitter<void>();\r\n\r\n \r\n emitAction(): void {\r\n this.ctaClick.emit();\r\n }\r\n}\r\n","<div class=\"flex flex-col items-center justify-center rounded-2xl bg-card px-6 py-10 text-center shadow-sm\">\r\n @if (icon) {\r\n <div class=\"flex h-16 w-16 items-center justify-center rounded-full bg-slate-100 dark:bg-slate-600 text-slate-500 dark:text-slate-300\">\r\n <mat-icon [svgIcon]=\"icon\"></mat-icon>\r\n </div>\r\n }\r\n\r\n <h3 class=\"mt-4 text-lg font-semibold\">{{ title }}</h3>\r\n\r\n @if (description) {\r\n <p class=\"mt-2 max-w-xl text-sm leading-6 text-slate-500 dark:text-slate-300\">{{ description }}</p>\r\n }\r\n\r\n @if (ctaLabel) {\r\n <div class=\"mt-4\">\r\n <button matButton=\"outlined\" type=\"button\" [disabled]=\"ctaDisabled\" (click)=\"emitAction()\">{{ ctaLabel }}</button>\r\n </div>\r\n }\r\n</div>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;MAWa,uBAAuB,CAAA;AAPpC,IAAA,WAAA,GAAA;QASa,IAAA,CAAA,IAAI,GAAG,mBAAmB;QAG1B,IAAA,CAAA,KAAK,GAAG,MAAM;QAGd,IAAA,CAAA,WAAW,GAAG,aAAa;QAG3B,IAAA,CAAA,QAAQ,GAAG,EAAE;QAGb,IAAA,CAAA,WAAW,GAAG,KAAK;AAGlB,QAAA,IAAA,CAAA,QAAQ,GAAG,IAAI,YAAY,EAAQ;AAMhD,IAAA;IAHG,UAAU,GAAA;AACN,QAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE;IACxB;8GAtBS,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAvB,IAAA,SAAA,IAAA,CAA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constructor() {
|
|
10
|
-
/**
|
|
11
|
-
* 文件名。
|
|
12
|
-
*/
|
|
13
10
|
this.name = '';
|
|
14
|
-
/**
|
|
15
|
-
* 文件描述。
|
|
16
|
-
*/
|
|
17
11
|
this.description = '';
|
|
18
|
-
/**
|
|
19
|
-
* 文件类型。
|
|
20
|
-
*/
|
|
21
12
|
this.fileType = 'file';
|
|
22
|
-
/**
|
|
23
|
-
* 文件大小。
|
|
24
|
-
*/
|
|
25
13
|
this.size = '';
|
|
26
|
-
/**
|
|
27
|
-
* 预览地址。
|
|
28
|
-
*/
|
|
29
14
|
this.src = '';
|
|
30
|
-
/**
|
|
31
|
-
* 是否预览图片。
|
|
32
|
-
*/
|
|
33
15
|
this.previewImage = true;
|
|
34
16
|
}
|
|
35
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
36
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.
|
|
17
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CmatFilePreviewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
18
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: CmatFilePreviewComponent, isStandalone: true, selector: "cmat-file-preview", inputs: { name: "name", description: "description", fileType: "fileType", size: "size", src: "src", previewImage: "previewImage" }, 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 @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 }); }
|
|
37
19
|
}
|
|
38
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
20
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CmatFilePreviewComponent, decorators: [{
|
|
39
21
|
type: Component,
|
|
40
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"] }]
|
|
41
23
|
}], propDecorators: { name: [{
|
|
@@ -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
|
|
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 \r\n @Input() name = '';\r\n\r\n \r\n @Input() description = '';\r\n\r\n \r\n @Input() fileType = 'file';\r\n\r\n \r\n @Input() size = '';\r\n\r\n \r\n @Input() src: any = '';\r\n\r\n \r\n @Input() previewImage = true;\r\n}\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 @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 }}</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CAAC,MAAM,EAAA,OAAA,EACtC,CAAC,YAAY,EAAE,kBAAkB,EAAE,aAAa,CAAC,EAAA,QAAA,EAAA,oyCAAA,EAAA,MAAA,EAAA,CAAA,wBAAA,CAAA,EAAA;;sBAIzD;;sBAGA;;sBAGA;;sBAGA;;sBAGA;;sBAGA;;;AE7BL;;AAEG;;;;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CommonModule } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { EventEmitter, HostBinding, Output, Input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { EventEmitter, inject, DestroyRef, HostBinding, Output, Input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
5
|
import * as i5 from '@angular/forms';
|
|
5
6
|
import { FormControl, ReactiveFormsModule } from '@angular/forms';
|
|
6
7
|
import * as i1 from '@angular/material/button';
|
|
@@ -11,87 +12,43 @@ import * as i3 from '@angular/material/icon';
|
|
|
11
12
|
import { MatIconModule } from '@angular/material/icon';
|
|
12
13
|
import * as i4 from '@angular/material/input';
|
|
13
14
|
import { MatInputModule } from '@angular/material/input';
|
|
14
|
-
import { Subject, takeUntil } from 'rxjs';
|
|
15
15
|
|
|
16
16
|
class CmatFilterToolbarComponent {
|
|
17
17
|
constructor() {
|
|
18
|
-
/**
|
|
19
|
-
* 标题。
|
|
20
|
-
*/
|
|
21
18
|
this.title = '';
|
|
22
|
-
/**
|
|
23
|
-
* 说明文字。
|
|
24
|
-
*/
|
|
25
19
|
this.description = '';
|
|
26
|
-
/**
|
|
27
|
-
* 搜索框占位符。
|
|
28
|
-
*/
|
|
29
20
|
this.searchPlaceholder = '搜索';
|
|
30
|
-
/**
|
|
31
|
-
* 是否显示搜索框。
|
|
32
|
-
*/
|
|
33
21
|
this.showSearch = true;
|
|
34
|
-
/**
|
|
35
|
-
* 当前搜索内容。
|
|
36
|
-
*/
|
|
37
22
|
this.searchText = '';
|
|
38
|
-
/**
|
|
39
|
-
* 是否允许清空搜索内容。
|
|
40
|
-
*/
|
|
41
23
|
this.clearable = true;
|
|
42
|
-
/**
|
|
43
|
-
* 搜索内容变化事件。
|
|
44
|
-
*/
|
|
45
24
|
this.searchTextChange = new EventEmitter();
|
|
46
|
-
/**
|
|
47
|
-
* 清空事件。
|
|
48
|
-
*/
|
|
49
25
|
this.clear = new EventEmitter();
|
|
50
|
-
/**
|
|
51
|
-
* 搜索提交事件。
|
|
52
|
-
*/
|
|
53
26
|
this.searchSubmit = new EventEmitter();
|
|
54
27
|
this.hostClass = 'block';
|
|
55
28
|
this.searchControl = new FormControl('');
|
|
56
|
-
this.
|
|
29
|
+
this._destroyRef = inject(DestroyRef);
|
|
57
30
|
}
|
|
58
|
-
/**
|
|
59
|
-
* 初始化搜索联动。
|
|
60
|
-
*/
|
|
61
31
|
ngOnInit() {
|
|
62
32
|
this.searchControl.setValue(this.searchText, { emitEvent: false });
|
|
63
33
|
this.searchControl.valueChanges
|
|
64
|
-
.pipe(
|
|
34
|
+
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
65
35
|
.subscribe((value) => {
|
|
66
36
|
const text = value ?? '';
|
|
67
37
|
this.searchText = text;
|
|
68
38
|
this.searchTextChange.emit(text);
|
|
69
39
|
});
|
|
70
40
|
}
|
|
71
|
-
/**
|
|
72
|
-
* 释放订阅。
|
|
73
|
-
*/
|
|
74
|
-
ngOnDestroy() {
|
|
75
|
-
this._unsubscribeAll.next();
|
|
76
|
-
this._unsubscribeAll.complete();
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* 提交搜索。
|
|
80
|
-
*/
|
|
81
41
|
submitSearch() {
|
|
82
42
|
this.searchSubmit.emit(this.searchControl.value ?? '');
|
|
83
43
|
}
|
|
84
|
-
/**
|
|
85
|
-
* 清空搜索。
|
|
86
|
-
*/
|
|
87
44
|
clearSearch() {
|
|
88
45
|
this.searchControl.setValue('', { emitEvent: true });
|
|
89
46
|
this.clear.emit();
|
|
90
47
|
}
|
|
91
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
92
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.
|
|
48
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CmatFilterToolbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
49
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: CmatFilterToolbarComponent, isStandalone: true, selector: "cmat-filter-toolbar", inputs: { title: "title", description: "description", searchPlaceholder: "searchPlaceholder", showSearch: "showSearch", searchText: "searchText", clearable: "clearable" }, outputs: { searchTextChange: "searchTextChange", clear: "clear", searchSubmit: "searchSubmit" }, host: { properties: { "class": "this.hostClass" } }, 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\" 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>\r\n", 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])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[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 }); }
|
|
93
50
|
}
|
|
94
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
51
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CmatFilterToolbarComponent, decorators: [{
|
|
95
52
|
type: Component,
|
|
96
53
|
args: [{ selector: 'cmat-filter-toolbar', changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, MatButtonModule, MatFormFieldModule, MatIconModule, MatInputModule, ReactiveFormsModule], 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\" 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>\r\n", styles: [":host{display:block}\n"] }]
|
|
97
54
|
}], propDecorators: { title: [{
|
|
@@ -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 { ChangeDetectionStrategy, Component, EventEmitter, HostBinding, Input,
|
|
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 { ChangeDetectionStrategy, Component, DestroyRef, EventEmitter, HostBinding, Input, OnInit, Output, inject } 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})\r\nexport class CmatFilterToolbarComponent implements OnInit {\r\n \r\n @Input() title = '';\r\n\r\n \r\n @Input() description = '';\r\n\r\n \r\n @Input() searchPlaceholder = '搜索';\r\n\r\n \r\n @Input() showSearch = true;\r\n\r\n \r\n @Input() searchText = '';\r\n\r\n \r\n @Input() clearable = true;\r\n\r\n \r\n @Output() searchTextChange = new EventEmitter<string>();\r\n\r\n \r\n @Output() clear = new EventEmitter<void>();\r\n\r\n \r\n @Output() searchSubmit = new EventEmitter<string>();\r\n\r\n @HostBinding('class') hostClass = 'block';\r\n\r\n searchControl = new FormControl('');\r\n\r\n private readonly _destroyRef = inject(DestroyRef);\r\n\r\n \r\n ngOnInit(): void {\r\n this.searchControl.setValue(this.searchText, { emitEvent: false });\r\n\r\n this.searchControl.valueChanges\r\n .pipe(takeUntilDestroyed(this._destroyRef))\r\n .subscribe((value) => {\r\n const text = value ?? '';\r\n this.searchText = text;\r\n this.searchTextChange.emit(text);\r\n });\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 \r\n clearSearch(): void {\r\n this.searchControl.setValue('', { emitEvent: true });\r\n this.clear.emit();\r\n }\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\" 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>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;MAgBa,0BAA0B,CAAA;AAPvC,IAAA,WAAA,GAAA;QASa,IAAA,CAAA,KAAK,GAAG,EAAE;QAGV,IAAA,CAAA,WAAW,GAAG,EAAE;QAGhB,IAAA,CAAA,iBAAiB,GAAG,IAAI;QAGxB,IAAA,CAAA,UAAU,GAAG,IAAI;QAGjB,IAAA,CAAA,UAAU,GAAG,EAAE;QAGf,IAAA,CAAA,SAAS,GAAG,IAAI;AAGf,QAAA,IAAA,CAAA,gBAAgB,GAAG,IAAI,YAAY,EAAU;AAG7C,QAAA,IAAA,CAAA,KAAK,GAAG,IAAI,YAAY,EAAQ;AAGhC,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,YAAY,EAAU;QAE7B,IAAA,CAAA,SAAS,GAAG,OAAO;AAEzC,QAAA,IAAA,CAAA,aAAa,GAAG,IAAI,WAAW,CAAC,EAAE,CAAC;AAElB,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;AA0BpD,IAAA;IAvBG,QAAQ,GAAA;AACJ,QAAA,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;QAElE,IAAI,CAAC,aAAa,CAAC;AACd,aAAA,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,WAAW,CAAC;AACzC,aAAA,SAAS,CAAC,CAAC,KAAK,KAAI;AACjB,YAAA,MAAM,IAAI,GAAG,KAAK,IAAI,EAAE;AACxB,YAAA,IAAI,CAAC,UAAU,GAAG,IAAI;AACtB,YAAA,IAAI,CAA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AA,EAAA,2CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,oBAAA,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,CAAA,aAAA,EAAA,UAAA,EAAA,SAAA,CAAA,EAAA,OAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,CAAA,QAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAEtG,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAPtC,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,QAAA,EAAA,+hDAAA,EAAA,MAAA,EAAA,CAAA,wBAAA,CAAA,EAAA;;sBAI/G;;sBAGA;;sBAGA;;sBAGA;;sBAGA;;sBAGA;;sBAGA;;sBAGA;;sBAGA;;sBAEA,WAAW;uBAAC,OAAO;;;AE5CxB;;AAEG;;;;"}
|
|
@@ -4,19 +4,13 @@ import { Input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
|
4
4
|
|
|
5
5
|
class CmatFormActionsComponent {
|
|
6
6
|
constructor() {
|
|
7
|
-
/**
|
|
8
|
-
* 对齐方式。
|
|
9
|
-
*/
|
|
10
7
|
this.align = 'end';
|
|
11
|
-
/**
|
|
12
|
-
* 是否显示顶部分割线。
|
|
13
|
-
*/
|
|
14
8
|
this.divider = true;
|
|
15
9
|
}
|
|
16
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
17
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.
|
|
10
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CmatFormActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
11
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.8", type: CmatFormActionsComponent, isStandalone: true, selector: "cmat-form-actions", inputs: { align: "align", divider: "divider" }, ngImport: i0, template: "<div class=\"flex flex-col gap-3 border-default pt-4\" [class.border-t]=\"divider\" [class.items-start]=\"align === 'start'\" [class.items-center]=\"align === 'center'\" [class.items-end]=\"align === 'end'\">\r\n <div class=\"flex flex-wrap gap-2\" [class.justify-start]=\"align === 'start'\" [class.justify-center]=\"align === 'center'\" [class.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\" [class.justify-start]=\"align === 'start'\" [class.justify-center]=\"align === 'center'\" [class.justify-end]=\"align === 'end'\">\r\n <ng-content select=\"[cmatFormActions]\"></ng-content>\r\n </div>\r\n</div>\r\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
18
12
|
}
|
|
19
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
13
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CmatFormActionsComponent, decorators: [{
|
|
20
14
|
type: Component,
|
|
21
15
|
args: [{ selector: 'cmat-form-actions', changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule], template: "<div class=\"flex flex-col gap-3 border-default pt-4\" [class.border-t]=\"divider\" [class.items-start]=\"align === 'start'\" [class.items-center]=\"align === 'center'\" [class.items-end]=\"align === 'end'\">\r\n <div class=\"flex flex-wrap gap-2\" [class.justify-start]=\"align === 'start'\" [class.justify-center]=\"align === 'center'\" [class.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\" [class.justify-start]=\"align === 'start'\" [class.justify-center]=\"align === 'center'\" [class.justify-end]=\"align === 'end'\">\r\n <ng-content select=\"[cmatFormActions]\"></ng-content>\r\n </div>\r\n</div>\r\n", styles: [":host{display:block}\n"] }]
|
|
22
16
|
}], propDecorators: { align: [{
|
|
@@ -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, 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]\r\n})\r\nexport class CmatFormActionsComponent {\r\n
|
|
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, 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]\r\n})\r\nexport class CmatFormActionsComponent {\r\n \r\n @Input() align: 'start' | 'center' | 'end' = 'end';\r\n\r\n \r\n @Input() divider = true;\r\n}\r\n","<div class=\"flex flex-col gap-3 border-default pt-4\" [class.border-t]=\"divider\" [class.items-start]=\"align === 'start'\" [class.items-center]=\"align === 'center'\" [class.items-end]=\"align === 'end'\">\r\n <div class=\"flex flex-wrap gap-2\" [class.justify-start]=\"align === 'start'\" [class.justify-center]=\"align === 'center'\" [class.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\" [class.justify-start]=\"align === 'start'\" [class.justify-center]=\"align === 'center'\" [class.justify-end]=\"align === 'end'\">\r\n <ng-content select=\"[cmatFormActions]\"></ng-content>\r\n </div>\r\n</div>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAUa,wBAAwB,CAAA;AAPrC,IAAA,WAAA,GAAA;QASa,IAAA,CAAA,KAAK,GAA+B,KAAK;QAGzC,IAAA,CAAA,OAAO,GAAG,IAAI;AAC1B,IAAA;8GANY,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAxB,wBAAwB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,MAAA,EAAA,EAAA,KAAA,EAAA,OAAA,EAAA,OAAA,EAAA,SAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECVrC,ouBASA,EAAA,MAAA,EAAA,CAAA,wBAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDDc,YAAY,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAEb,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAPpC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,mBAAmB,mBAGZ,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC,CAAC,YAAY,CAAC,EAAA,QAAA,EAAA,ouBAAA,EAAA,MAAA,EAAA,CAAA,wBAAA,CAAA,EAAA;;sBAItB;;sBAGA;;;AEfL;;AAEG;;;;"}
|
|
@@ -28,12 +28,12 @@ class CmatFullscreenComponent {
|
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
32
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.
|
|
31
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CmatFullscreenComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
32
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.8", type: CmatFullscreenComponent, isStandalone: true, selector: "cmat-fullscreen", inputs: { iconTpl: "iconTpl", tooltip: "tooltip" }, 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
33
|
}
|
|
34
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
34
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CmatFullscreenComponent, decorators: [{
|
|
35
35
|
type: Component,
|
|
36
|
-
args: [{ selector: 'cmat-fullscreen', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatFullscreen', imports: [MatButtonModule, MatTooltipModule, NgTemplateOutlet, MatIconModule], template: "
|
|
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
37
|
}], propDecorators: { iconTpl: [{
|
|
38
38
|
type: Input
|
|
39
39
|
}], tooltip: [{
|
|
@@ -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 { ChangeDetectionStrategy, Component, Input, TemplateRef, ViewEncapsulation, DOCUMENT, inject } 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 @Input() iconTpl: TemplateRef<any>;\r\n @Input() tooltip: 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.log('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(() => {\r\n console.error('Entering fullscreen mode failed.');\r\n });\r\n }\r\n }\r\n}\r\n","
|
|
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 { ChangeDetectionStrategy, Component, Input, TemplateRef, ViewEncapsulation, DOCUMENT, inject } 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 @Input() iconTpl: TemplateRef<any>;\r\n @Input() tooltip: 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.log('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(() => {\r\n console.error('Entering fullscreen mode failed.');\r\n });\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":";;;;;;;;;;MAca,uBAAuB,CAAA;AARpC,IAAA,WAAA,GAAA;AAYY,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,GAAG,CAAC,8CAA8C,CAAC;YAC3D;QACJ;AAEA,QAAA,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,iBAAiB;QAEnD,IAAI,UAAU,EAAE;A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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,wXAAA,EAAA;;sBAG5E;;sBACA;;;AEhBL;;AAEG;;;;"}
|
|
@@ -6,42 +6,32 @@ import hljs from 'highlight.js';
|
|
|
6
6
|
|
|
7
7
|
class CmatHighlightService {
|
|
8
8
|
highlight(code, language) {
|
|
9
|
-
// Format the code
|
|
10
9
|
code = this._format(code);
|
|
11
|
-
// Highlight and return the code
|
|
12
10
|
return hljs.highlight(code, { language }).value;
|
|
13
11
|
}
|
|
14
12
|
_format(code) {
|
|
15
13
|
let indentation = 0;
|
|
16
|
-
// Split the code into lines and store the lines
|
|
17
14
|
const lines = code.split('\n');
|
|
18
|
-
// Trim the empty lines around the code block
|
|
19
15
|
while (lines.length && lines[0].trim() === '') {
|
|
20
16
|
lines.shift();
|
|
21
17
|
}
|
|
22
18
|
while (lines.length && lines[lines.length - 1].trim() === '') {
|
|
23
19
|
lines.pop();
|
|
24
20
|
}
|
|
25
|
-
// Iterate through the lines
|
|
26
21
|
lines.filter(line => line.length)
|
|
27
22
|
.forEach((line, index) => {
|
|
28
|
-
// Always get the indentation of the first line so we can
|
|
29
|
-
// have something to compare with
|
|
30
23
|
if (index === 0) {
|
|
31
24
|
indentation = line.search(/\S|$/);
|
|
32
25
|
return;
|
|
33
26
|
}
|
|
34
|
-
// Look at all the remaining lines to figure out the smallest indentation.
|
|
35
27
|
indentation = Math.min(line.search(/\S|$/), indentation);
|
|
36
28
|
});
|
|
37
|
-
// Iterate through the lines one more time, remove the extra
|
|
38
|
-
// indentation, join them together and return it
|
|
39
29
|
return lines.map(line => line.substring(indentation)).join('\n');
|
|
40
30
|
}
|
|
41
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
42
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.
|
|
31
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CmatHighlightService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
32
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CmatHighlightService, providedIn: 'root' }); }
|
|
43
33
|
}
|
|
44
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
34
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CmatHighlightService, decorators: [{
|
|
45
35
|
type: Injectable,
|
|
46
36
|
args: [{
|
|
47
37
|
providedIn: 'root'
|
|
@@ -56,62 +46,47 @@ class CmatHighlightComponent {
|
|
|
56
46
|
this._viewContainerRef = inject(ViewContainerRef);
|
|
57
47
|
}
|
|
58
48
|
ngOnChanges(changes) {
|
|
59
|
-
// Code & Lang
|
|
60
49
|
if ('code' in changes || 'lang' in changes) {
|
|
61
|
-
// Return if the viewContainerRef is not available
|
|
62
50
|
if (!this._viewContainerRef.length) {
|
|
63
51
|
return;
|
|
64
52
|
}
|
|
65
|
-
// Highlight and insert the code
|
|
66
53
|
this._highlightAndInsert();
|
|
67
54
|
}
|
|
68
55
|
}
|
|
69
56
|
ngAfterViewInit() {
|
|
70
|
-
// Return if there is no language set
|
|
71
57
|
if (!this.lang) {
|
|
72
58
|
return;
|
|
73
59
|
}
|
|
74
|
-
// If there is no code input, get the code from
|
|
75
|
-
// the textarea
|
|
76
60
|
if (!this.code) {
|
|
77
|
-
// Get the code
|
|
78
61
|
this.code = this._elementRef.nativeElement.value;
|
|
79
62
|
}
|
|
80
|
-
// Highlight and insert
|
|
81
63
|
this._highlightAndInsert();
|
|
82
64
|
}
|
|
83
65
|
_highlightAndInsert() {
|
|
84
|
-
// Return if the template reference is not available
|
|
85
66
|
if (!this.templateRef) {
|
|
86
67
|
return;
|
|
87
68
|
}
|
|
88
|
-
// Return if the code or language is not defined
|
|
89
69
|
if (!this.code || !this.lang) {
|
|
90
70
|
return;
|
|
91
71
|
}
|
|
92
|
-
// Destroy the component if there is already one
|
|
93
72
|
if (this._viewRef) {
|
|
94
73
|
this._viewRef.destroy();
|
|
95
74
|
this._viewRef = null;
|
|
96
75
|
}
|
|
97
|
-
// Highlight and sanitize the code just in case
|
|
98
76
|
this.highlightedCode = this._domSanitizer.sanitize(SecurityContext.HTML, this._cmatHighlightService.highlight(this.code, this.lang));
|
|
99
|
-
// Return if the highlighted code is null
|
|
100
77
|
if (this.highlightedCode === null) {
|
|
101
78
|
return;
|
|
102
79
|
}
|
|
103
|
-
// Render and insert the template
|
|
104
80
|
this._viewRef = this._viewContainerRef.createEmbeddedView(this.templateRef, {
|
|
105
81
|
highlightedCode: this.highlightedCode,
|
|
106
82
|
lang: this.lang
|
|
107
83
|
});
|
|
108
|
-
// Detect the changes
|
|
109
84
|
this._viewRef.detectChanges();
|
|
110
85
|
}
|
|
111
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
112
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.
|
|
86
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CmatHighlightComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
87
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.8", type: CmatHighlightComponent, isStandalone: true, selector: "textarea[cmat-highlight]", inputs: { code: "code", lang: "lang" }, viewQueries: [{ propertyName: "templateRef", first: true, predicate: TemplateRef, descendants: true }], exportAs: ["cmatHighlight"], usesOnChanges: true, ngImport: i0, template: "<ng-content></ng-content>\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>", 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 }); }
|
|
113
88
|
}
|
|
114
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
89
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CmatHighlightComponent, decorators: [{
|
|
115
90
|
type: Component,
|
|
116
91
|
args: [{ selector: 'textarea[cmat-highlight]', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatHighlight', imports: [NgClass], template: "<ng-content></ng-content>\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>", styles: ["textarea[cmat-highlight]{display:none}\n"] }]
|
|
117
92
|
}], propDecorators: { code: [{
|