cmat 0.0.111 → 0.0.113
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 +531 -536
- package/fesm2022/cmat-components-adapter.mjs.map +1 -1
- package/fesm2022/cmat-components-breadcrumb.mjs +521 -356
- package/fesm2022/cmat-components-breadcrumb.mjs.map +1 -1
- package/fesm2022/cmat-components-card.mjs +150 -42
- package/fesm2022/cmat-components-card.mjs.map +1 -1
- package/fesm2022/cmat-components-carousel.mjs +1120 -629
- package/fesm2022/cmat-components-carousel.mjs.map +1 -1
- package/fesm2022/cmat-components-cascade.mjs +861 -441
- package/fesm2022/cmat-components-cascade.mjs.map +1 -1
- package/fesm2022/cmat-components-chip-input.mjs +580 -335
- package/fesm2022/cmat-components-chip-input.mjs.map +1 -1
- package/fesm2022/cmat-components-code-editor.mjs +197 -105
- package/fesm2022/cmat-components-code-editor.mjs.map +1 -1
- package/fesm2022/cmat-components-color-picker.mjs +1762 -825
- package/fesm2022/cmat-components-color-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-custom-formly.mjs +5196 -2531
- package/fesm2022/cmat-components-custom-formly.mjs.map +1 -1
- package/fesm2022/cmat-components-data-picker.mjs +1901 -1073
- package/fesm2022/cmat-components-data-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-date-range.mjs +701 -456
- package/fesm2022/cmat-components-date-range.mjs.map +1 -1
- package/fesm2022/cmat-components-date-time-display.mjs +137 -30
- package/fesm2022/cmat-components-date-time-display.mjs.map +1 -1
- package/fesm2022/cmat-components-drawer.mjs +410 -258
- package/fesm2022/cmat-components-drawer.mjs.map +1 -1
- package/fesm2022/cmat-components-empty-state.mjs +201 -41
- package/fesm2022/cmat-components-empty-state.mjs.map +1 -1
- package/fesm2022/cmat-components-file-preview.mjs +198 -35
- package/fesm2022/cmat-components-file-preview.mjs.map +1 -1
- package/fesm2022/cmat-components-filter-toolbar.mjs +320 -72
- package/fesm2022/cmat-components-filter-toolbar.mjs.map +1 -1
- package/fesm2022/cmat-components-form-actions.mjs +102 -26
- package/fesm2022/cmat-components-form-actions.mjs.map +1 -1
- package/fesm2022/cmat-components-fullscreen.mjs +167 -47
- package/fesm2022/cmat-components-fullscreen.mjs.map +1 -1
- package/fesm2022/cmat-components-highlight.mjs +203 -112
- package/fesm2022/cmat-components-highlight.mjs.map +1 -1
- package/fesm2022/cmat-components-image-viewer.mjs +489 -215
- package/fesm2022/cmat-components-image-viewer.mjs.map +1 -1
- package/fesm2022/cmat-components-inline-loading.mjs +117 -27
- package/fesm2022/cmat-components-inline-loading.mjs.map +1 -1
- package/fesm2022/cmat-components-json-editor.mjs +276 -230
- package/fesm2022/cmat-components-json-editor.mjs.map +1 -1
- package/fesm2022/cmat-components-knob-input.mjs +615 -420
- package/fesm2022/cmat-components-knob-input.mjs.map +1 -1
- package/fesm2022/cmat-components-loading-overlay.mjs +53 -25
- package/fesm2022/cmat-components-loading-overlay.mjs.map +1 -1
- package/fesm2022/cmat-components-masonry.mjs +120 -40
- package/fesm2022/cmat-components-masonry.mjs.map +1 -1
- package/fesm2022/cmat-components-material-color-picker.mjs +332 -155
- package/fesm2022/cmat-components-material-color-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-material-datetimepicker.mjs +4283 -2504
- package/fesm2022/cmat-components-material-datetimepicker.mjs.map +1 -1
- package/fesm2022/cmat-components-navigation.mjs +3080 -1404
- package/fesm2022/cmat-components-navigation.mjs.map +1 -1
- package/fesm2022/cmat-components-opt-input.mjs +540 -466
- package/fesm2022/cmat-components-opt-input.mjs.map +1 -1
- package/fesm2022/cmat-components-org-chart.mjs +528 -125
- package/fesm2022/cmat-components-org-chart.mjs.map +1 -1
- package/fesm2022/cmat-components-page-header.mjs +141 -32
- package/fesm2022/cmat-components-page-header.mjs.map +1 -1
- package/fesm2022/cmat-components-pagination.mjs +866 -534
- package/fesm2022/cmat-components-pagination.mjs.map +1 -1
- package/fesm2022/cmat-components-password-strength.mjs +873 -434
- package/fesm2022/cmat-components-password-strength.mjs.map +1 -1
- package/fesm2022/cmat-components-popover.mjs +1012 -731
- package/fesm2022/cmat-components-popover.mjs.map +1 -1
- package/fesm2022/cmat-components-progress-bar.mjs +98 -35
- package/fesm2022/cmat-components-progress-bar.mjs.map +1 -1
- package/fesm2022/cmat-components-qrcode.mjs +463 -287
- package/fesm2022/cmat-components-qrcode.mjs.map +1 -1
- package/fesm2022/cmat-components-rating.mjs +377 -203
- package/fesm2022/cmat-components-rating.mjs.map +1 -1
- package/fesm2022/cmat-components-rich-text-editor.mjs +153 -39
- package/fesm2022/cmat-components-rich-text-editor.mjs.map +1 -1
- package/fesm2022/cmat-components-select-search.mjs +926 -496
- package/fesm2022/cmat-components-select-search.mjs.map +1 -1
- package/fesm2022/cmat-components-select-table.mjs +1280 -842
- package/fesm2022/cmat-components-select-table.mjs.map +1 -1
- package/fesm2022/cmat-components-select-tree.mjs +998 -690
- package/fesm2022/cmat-components-select-tree.mjs.map +1 -1
- package/fesm2022/cmat-components-skeleton.mjs +143 -57
- package/fesm2022/cmat-components-skeleton.mjs.map +1 -1
- package/fesm2022/cmat-components-speed-dial.mjs +457 -303
- package/fesm2022/cmat-components-speed-dial.mjs.map +1 -1
- package/fesm2022/cmat-components-status-tag.mjs +136 -44
- package/fesm2022/cmat-components-status-tag.mjs.map +1 -1
- package/fesm2022/cmat-components-table-toolbar.mjs +120 -28
- package/fesm2022/cmat-components-table-toolbar.mjs.map +1 -1
- package/fesm2022/cmat-components-timeline.mjs +464 -168
- package/fesm2022/cmat-components-timeline.mjs.map +1 -1
- package/fesm2022/cmat-components-toast.mjs +346 -262
- package/fesm2022/cmat-components-toast.mjs.map +1 -1
- package/fesm2022/cmat-components-transfer-picker.mjs +1427 -593
- package/fesm2022/cmat-components-transfer-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-treetable.mjs +372 -112
- package/fesm2022/cmat-components-treetable.mjs.map +1 -1
- package/fesm2022/cmat-components-upload.mjs +904 -410
- package/fesm2022/cmat-components-upload.mjs.map +1 -1
- package/fesm2022/cmat-components-x6-angular-shape.mjs +153 -170
- package/fesm2022/cmat-components-x6-angular-shape.mjs.map +1 -1
- package/fesm2022/cmat-directives-animate-on-scroll.mjs +220 -138
- package/fesm2022/cmat-directives-animate-on-scroll.mjs.map +1 -1
- package/fesm2022/cmat-directives-arrow-cursor.mjs +246 -193
- package/fesm2022/cmat-directives-arrow-cursor.mjs.map +1 -1
- package/fesm2022/cmat-directives-autofocus.mjs +43 -25
- package/fesm2022/cmat-directives-autofocus.mjs.map +1 -1
- package/fesm2022/cmat-directives-data-exporter.mjs +537 -338
- package/fesm2022/cmat-directives-data-exporter.mjs.map +1 -1
- package/fesm2022/cmat-directives-debounce.mjs +162 -76
- package/fesm2022/cmat-directives-debounce.mjs.map +1 -1
- package/fesm2022/cmat-directives-digit-only.mjs +457 -356
- package/fesm2022/cmat-directives-digit-only.mjs.map +1 -1
- package/fesm2022/cmat-directives-equal-validator.mjs +70 -53
- package/fesm2022/cmat-directives-equal-validator.mjs.map +1 -1
- package/fesm2022/cmat-directives-seamless-auto-scroll.mjs +180 -132
- package/fesm2022/cmat-directives-seamless-auto-scroll.mjs.map +1 -1
- package/fesm2022/cmat-lib-mock-api.mjs +207 -195
- package/fesm2022/cmat-lib-mock-api.mjs.map +1 -1
- package/fesm2022/cmat-pipes-bytes.mjs +50 -30
- package/fesm2022/cmat-pipes-bytes.mjs.map +1 -1
- package/fesm2022/cmat-pipes-date-format.mjs +41 -25
- package/fesm2022/cmat-pipes-date-format.mjs.map +1 -1
- package/fesm2022/cmat-pipes-find-by-key.mjs +44 -26
- package/fesm2022/cmat-pipes-find-by-key.mjs.map +1 -1
- package/fesm2022/cmat-pipes-group-by.mjs +50 -38
- package/fesm2022/cmat-pipes-group-by.mjs.map +1 -1
- package/fesm2022/cmat-pipes-keys.mjs +44 -31
- package/fesm2022/cmat-pipes-keys.mjs.map +1 -1
- package/fesm2022/cmat-pipes-secure.mjs +60 -49
- package/fesm2022/cmat-pipes-secure.mjs.map +1 -1
- package/fesm2022/cmat-pipes-uppercase.mjs +39 -22
- package/fesm2022/cmat-pipes-uppercase.mjs.map +1 -1
- package/fesm2022/cmat-reports.mjs +2761 -0
- package/fesm2022/cmat-reports.mjs.map +1 -0
- package/fesm2022/cmat-services-alert.mjs +249 -277
- package/fesm2022/cmat-services-alert.mjs.map +1 -1
- package/fesm2022/cmat-services-config.mjs +110 -81
- package/fesm2022/cmat-services-config.mjs.map +1 -1
- package/fesm2022/cmat-services-confirmation.mjs +184 -73
- package/fesm2022/cmat-services-confirmation.mjs.map +1 -1
- package/fesm2022/cmat-services-data.mjs +136 -125
- package/fesm2022/cmat-services-data.mjs.map +1 -1
- package/fesm2022/cmat-services-export-as.mjs +165 -183
- package/fesm2022/cmat-services-export-as.mjs.map +1 -1
- package/fesm2022/cmat-services-loading.mjs +116 -95
- package/fesm2022/cmat-services-loading.mjs.map +1 -1
- package/fesm2022/cmat-services-local-storage.mjs +75 -66
- package/fesm2022/cmat-services-local-storage.mjs.map +1 -1
- package/fesm2022/cmat-services-media-watcher.mjs +69 -64
- package/fesm2022/cmat-services-media-watcher.mjs.map +1 -1
- package/fesm2022/cmat-services-platform.mjs +48 -45
- package/fesm2022/cmat-services-platform.mjs.map +1 -1
- package/fesm2022/cmat-services-print.mjs +984 -1109
- package/fesm2022/cmat-services-print.mjs.map +1 -1
- package/fesm2022/cmat-services-splash-screen.mjs +53 -38
- package/fesm2022/cmat-services-splash-screen.mjs.map +1 -1
- package/fesm2022/cmat-services-title.mjs +57 -47
- package/fesm2022/cmat-services-title.mjs.map +1 -1
- package/fesm2022/cmat-services-translation.mjs +79 -68
- package/fesm2022/cmat-services-translation.mjs.map +1 -1
- package/fesm2022/cmat-services-utils.mjs +424 -517
- package/fesm2022/cmat-services-utils.mjs.map +1 -1
- package/fesm2022/cmat-validators.mjs +23 -33
- package/fesm2022/cmat-validators.mjs.map +1 -1
- package/fesm2022/cmat-version.mjs +12 -16
- package/fesm2022/cmat-version.mjs.map +1 -1
- package/fesm2022/cmat.mjs +39805 -22511
- package/fesm2022/cmat.mjs.map +1 -1
- package/package.json +5 -1
- package/types/cmat-components-adapter.d.ts +145 -156
- package/types/cmat-components-breadcrumb.d.ts +108 -86
- package/types/cmat-components-card.d.ts +34 -18
- package/types/cmat-components-carousel.d.ts +251 -134
- package/types/cmat-components-cascade.d.ts +158 -117
- package/types/cmat-components-chip-input.d.ts +105 -71
- package/types/cmat-components-code-editor.d.ts +59 -34
- package/types/cmat-components-color-picker.d.ts +378 -236
- package/types/cmat-components-custom-formly.d.ts +776 -814
- package/types/cmat-components-data-picker.d.ts +502 -360
- package/types/cmat-components-date-range.d.ts +106 -77
- package/types/cmat-components-date-time-display.d.ts +36 -13
- package/types/cmat-components-drawer.d.ts +91 -61
- package/types/cmat-components-empty-state.d.ts +47 -17
- package/types/cmat-components-file-preview.d.ts +42 -14
- package/types/cmat-components-filter-toolbar.d.ts +57 -25
- package/types/cmat-components-form-actions.d.ts +18 -10
- package/types/cmat-components-fullscreen.d.ts +21 -13
- package/types/cmat-components-highlight.d.ts +33 -26
- package/types/cmat-components-image-viewer.d.ts +119 -58
- package/types/cmat-components-inline-loading.d.ts +24 -11
- package/types/cmat-components-json-editor.d.ts +39 -28
- package/types/cmat-components-knob-input.d.ts +172 -101
- package/types/cmat-components-loading-overlay.d.ts +8 -11
- package/types/cmat-components-masonry.d.ts +27 -14
- package/types/cmat-components-material-color-picker.d.ts +56 -42
- package/types/cmat-components-material-datetimepicker.d.ts +817 -454
- package/types/cmat-components-navigation.d.ts +295 -221
- package/types/cmat-components-opt-input.d.ts +111 -90
- package/types/cmat-components-org-chart.d.ts +53 -35
- package/types/cmat-components-page-header.d.ts +37 -14
- package/types/cmat-components-pagination.d.ts +144 -107
- package/types/cmat-components-password-strength.d.ts +197 -86
- package/types/cmat-components-popover.d.ts +264 -166
- package/types/cmat-components-progress-bar.d.ts +17 -14
- package/types/cmat-components-qrcode.d.ts +111 -42
- package/types/cmat-components-rating.d.ts +105 -59
- package/types/cmat-components-rich-text-editor.d.ts +39 -16
- package/types/cmat-components-select-search.d.ts +195 -99
- package/types/cmat-components-select-table.d.ts +241 -142
- package/types/cmat-components-select-tree.d.ts +185 -118
- package/types/cmat-components-skeleton.d.ts +55 -32
- package/types/cmat-components-speed-dial.d.ts +86 -61
- package/types/cmat-components-status-tag.d.ts +42 -24
- package/types/cmat-components-table-toolbar.d.ts +30 -12
- package/types/cmat-components-timeline.d.ts +83 -51
- package/types/cmat-components-toast.d.ts +84 -85
- package/types/cmat-components-transfer-picker.d.ts +228 -181
- package/types/cmat-components-treetable.d.ts +63 -39
- package/types/cmat-components-upload.d.ts +205 -106
- package/types/cmat-components-x6-angular-shape.d.ts +29 -37
- package/types/cmat-directives-animate-on-scroll.d.ts +48 -30
- package/types/cmat-directives-arrow-cursor.d.ts +55 -35
- package/types/cmat-directives-autofocus.d.ts +8 -11
- package/types/cmat-directives-data-exporter.d.ts +71 -40
- package/types/cmat-directives-debounce.d.ts +31 -28
- package/types/cmat-directives-digit-only.d.ts +90 -53
- package/types/cmat-directives-equal-validator.d.ts +11 -14
- package/types/cmat-directives-seamless-auto-scroll.d.ts +42 -29
- package/types/cmat-lib-mock-api.d.ts +46 -55
- package/types/cmat-pipes-bytes.d.ts +7 -10
- package/types/cmat-pipes-date-format.d.ts +7 -10
- package/types/cmat-pipes-find-by-key.d.ts +8 -12
- package/types/cmat-pipes-group-by.d.ts +11 -15
- package/types/cmat-pipes-keys.d.ts +10 -13
- package/types/cmat-pipes-secure.d.ts +14 -17
- package/types/cmat-pipes-uppercase.d.ts +7 -10
- package/types/cmat-reports.d.ts +1138 -0
- package/types/cmat-services-alert.d.ts +80 -87
- package/types/cmat-services-config.d.ts +37 -43
- package/types/cmat-services-confirmation.d.ts +31 -37
- package/types/cmat-services-data.d.ts +18 -21
- package/types/cmat-services-export-as.d.ts +28 -33
- package/types/cmat-services-loading.d.ts +27 -31
- package/types/cmat-services-local-storage.d.ts +17 -21
- package/types/cmat-services-media-watcher.d.ts +14 -18
- package/types/cmat-services-platform.d.ts +8 -11
- package/types/cmat-services-print.d.ts +97 -102
- package/types/cmat-services-splash-screen.d.ts +11 -14
- package/types/cmat-services-title.d.ts +9 -12
- package/types/cmat-services-translation.d.ts +19 -22
- package/types/cmat-services-utils.d.ts +76 -80
- package/types/cmat-validators.d.ts +5 -8
- package/types/cmat-version.d.ts +8 -10
- package/types/cmat.d.ts +7551 -5204
|
@@ -1,411 +1,905 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
import * as
|
|
4
|
-
import { MatButtonModule } from
|
|
5
|
-
import * as i2
|
|
6
|
-
import { MatIconModule } from
|
|
7
|
-
import * as i1 from
|
|
8
|
-
import { MatListModule } from
|
|
9
|
-
import { CmatMediaWatcherService } from
|
|
10
|
-
import { NgClass } from
|
|
11
|
-
import { HttpClient, HttpEventType } from
|
|
12
|
-
import { takeUntilDestroyed } from
|
|
13
|
-
import * as i3 from
|
|
14
|
-
import { MatProgressBarModule } from
|
|
15
|
-
import * as i4 from
|
|
16
|
-
import { MatTooltipModule } from
|
|
17
|
-
import { CmatBytesPipe } from
|
|
18
|
-
import { CmatUtilsService } from
|
|
19
|
-
import { saveAs } from
|
|
20
|
-
import { CmatUrlStateConfigService } from
|
|
21
|
-
import { catchError, map, tap } from
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, HostListener, Injectable, ViewEncapsulation, computed, effect, inject, input, model, output, signal, viewChildren } from "@angular/core";
|
|
3
|
+
import * as i1$1 from "@angular/material/button";
|
|
4
|
+
import { MatButtonModule } from "@angular/material/button";
|
|
5
|
+
import * as i2 from "@angular/material/icon";
|
|
6
|
+
import { MatIconModule } from "@angular/material/icon";
|
|
7
|
+
import * as i1 from "@angular/material/list";
|
|
8
|
+
import { MatListModule } from "@angular/material/list";
|
|
9
|
+
import { CmatMediaWatcherService } from "cmat/services/media-watcher";
|
|
10
|
+
import { NgClass } from "@angular/common";
|
|
11
|
+
import { HttpClient, HttpEventType } from "@angular/common/http";
|
|
12
|
+
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
|
13
|
+
import * as i3 from "@angular/material/progress-bar";
|
|
14
|
+
import { MatProgressBarModule } from "@angular/material/progress-bar";
|
|
15
|
+
import * as i4 from "@angular/material/tooltip";
|
|
16
|
+
import { MatTooltipModule } from "@angular/material/tooltip";
|
|
17
|
+
import { CmatBytesPipe } from "cmat/pipes/bytes";
|
|
18
|
+
import { CmatUtilsService } from "cmat/services/utils";
|
|
19
|
+
import { saveAs } from "file-saver-es";
|
|
20
|
+
import { CmatUrlStateConfigService } from "cmat/services/config";
|
|
21
|
+
import { catchError, map, tap } from "rxjs";
|
|
22
|
+
var CmatFilesUtilService = class CmatFilesUtilService {
|
|
23
|
+
constructor() {
|
|
24
|
+
this._http = inject(HttpClient);
|
|
25
|
+
this._urlStateConfigService = inject(CmatUrlStateConfigService);
|
|
26
|
+
this._destroyRef = inject(DestroyRef);
|
|
27
|
+
this._config = this._urlStateConfigService.config;
|
|
28
|
+
}
|
|
29
|
+
downloadFile(fileId, isStream = true) {
|
|
30
|
+
return this._http.get(`${this._config().fileUrl}/download/${fileId}`, {
|
|
31
|
+
headers: CmatUtilsService.getRequestCryptoHeaders(fileId),
|
|
32
|
+
observe: "response",
|
|
33
|
+
reportDownloadProgress: true,
|
|
34
|
+
responseType: "blob",
|
|
35
|
+
params: { isStream }
|
|
36
|
+
}).pipe(catchError(CmatUtilsService.handleError));
|
|
37
|
+
}
|
|
38
|
+
downloadFileZip(fileIds) {
|
|
39
|
+
return this._http.post(`${this._config().fileUrl}/download`, fileIds, {
|
|
40
|
+
headers: CmatUtilsService.getRequestCryptoHeaders("fileZip"),
|
|
41
|
+
observe: "response",
|
|
42
|
+
reportDownloadProgress: true,
|
|
43
|
+
responseType: "blob"
|
|
44
|
+
}).pipe(catchError(CmatUtilsService.handleError));
|
|
45
|
+
}
|
|
46
|
+
uploadFile(file) {
|
|
47
|
+
return this._http.post(`${this._config().fileUrl}/upload`, file, {
|
|
48
|
+
headers: CmatUtilsService.getRequestCryptoHeaders("files"),
|
|
49
|
+
observe: "events",
|
|
50
|
+
reportUploadProgress: true,
|
|
51
|
+
responseType: "json"
|
|
52
|
+
}).pipe(catchError(CmatUtilsService.handleError));
|
|
53
|
+
}
|
|
54
|
+
uploadFileToProcessed(file) {
|
|
55
|
+
return this._http.post(`${this._config().fileUrl}/upload/finish`, file, {
|
|
56
|
+
headers: CmatUtilsService.getRequestCryptoHeaders("files"),
|
|
57
|
+
observe: "events",
|
|
58
|
+
reportUploadProgress: true,
|
|
59
|
+
responseType: "json"
|
|
60
|
+
}).pipe(catchError(CmatUtilsService.handleError));
|
|
61
|
+
}
|
|
62
|
+
switchPublic(fileId, isPublic) {
|
|
63
|
+
return this._http.patch(`${this._config().fileUrl}/switch-public/${fileId}`, {
|
|
64
|
+
id: fileId,
|
|
65
|
+
isPublic
|
|
66
|
+
}, { headers: CmatUtilsService.getRequestCryptoHeaders("files-switch-public") }).pipe(catchError((err) => CmatUtilsService.handleError(err)));
|
|
67
|
+
}
|
|
68
|
+
deleteFile(fileId) {
|
|
69
|
+
return this._http.delete(`${this._config().fileUrl}/${fileId}`, { headers: CmatUtilsService.getRequestCryptoHeaders(fileId) }).pipe(catchError((err) => CmatUtilsService.handleError(err)));
|
|
70
|
+
}
|
|
71
|
+
getFileList(queryData, pageIndex = -1, pageSize = -1) {
|
|
72
|
+
if (this._config().enableDataProtect) return this._http.post(`${this._config().fileUrl}/${pageIndex}/${pageSize}`, CmatUtilsService.getEncryptData(JSON.stringify(queryData)), {
|
|
73
|
+
headers: CmatUtilsService.getRequestCryptoHeaders("fileList"),
|
|
74
|
+
responseType: "text"
|
|
75
|
+
}).pipe(map((res) => JSON.parse(CmatUtilsService.getDecryptData(res))), catchError((err) => CmatUtilsService.handleError(err)));
|
|
76
|
+
else return this._http.post(`${this._config().fileUrl}/${pageIndex}/${pageSize}`, queryData, {
|
|
77
|
+
headers: CmatUtilsService.getRequestCryptoHeaders("fileList"),
|
|
78
|
+
responseType: "json"
|
|
79
|
+
}).pipe(tap((res) => res), catchError((err) => CmatUtilsService.handleError(err)));
|
|
80
|
+
}
|
|
81
|
+
static {
|
|
82
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
83
|
+
minVersion: "12.0.0",
|
|
84
|
+
version: "22.2.3",
|
|
85
|
+
ngImport: i0,
|
|
86
|
+
type: CmatFilesUtilService,
|
|
87
|
+
deps: [],
|
|
88
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
static {
|
|
92
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
93
|
+
minVersion: "12.0.0",
|
|
94
|
+
version: "22.2.3",
|
|
95
|
+
ngImport: i0,
|
|
96
|
+
type: CmatFilesUtilService,
|
|
97
|
+
providedIn: "root"
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
102
|
+
minVersion: "12.0.0",
|
|
103
|
+
version: "22.2.3",
|
|
104
|
+
ngImport: i0,
|
|
105
|
+
type: CmatFilesUtilService,
|
|
106
|
+
decorators: [{
|
|
107
|
+
type: Injectable,
|
|
108
|
+
args: [{ providedIn: "root" }]
|
|
109
|
+
}]
|
|
110
|
+
});
|
|
111
|
+
var CmatUploadComponent = class CmatUploadComponent {
|
|
112
|
+
constructor() {
|
|
113
|
+
this.removeEvent = output();
|
|
114
|
+
this.uploadEvent = output();
|
|
115
|
+
this.fileAlias = input("fileData", ...ngDevMode ? [{ debugName: "fileAlias" }] : /* istanbul ignore next */ []);
|
|
116
|
+
this.filePath = input("", ...ngDevMode ? [{ debugName: "filePath" }] : /* istanbul ignore next */ []);
|
|
117
|
+
this.fileCategory = input("", ...ngDevMode ? [{ debugName: "fileCategory" }] : /* istanbul ignore next */ []);
|
|
118
|
+
this.isPublic = input(false, ...ngDevMode ? [{ debugName: "isPublic" }] : /* istanbul ignore next */ []);
|
|
119
|
+
this.editMode = input(false, ...ngDevMode ? [{ debugName: "editMode" }] : /* istanbul ignore next */ []);
|
|
120
|
+
this.autoUpload = input(true, ...ngDevMode ? [{ debugName: "autoUpload" }] : /* istanbul ignore next */ []);
|
|
121
|
+
this.file = model.required(...ngDevMode ? [{ debugName: "file" }] : /* istanbul ignore next */ []);
|
|
122
|
+
this.id = input(null, ...ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []);
|
|
123
|
+
this.progressPercentage = signal(0, ...ngDevMode ? [{ debugName: "progressPercentage" }] : /* istanbul ignore next */ []);
|
|
124
|
+
this.loaded = signal(0, ...ngDevMode ? [{ debugName: "loaded" }] : /* istanbul ignore next */ []);
|
|
125
|
+
this.total = signal(0, ...ngDevMode ? [{ debugName: "total" }] : /* istanbul ignore next */ []);
|
|
126
|
+
this.isUploading = signal(false, ...ngDevMode ? [{ debugName: "isUploading" }] : /* istanbul ignore next */ []);
|
|
127
|
+
this.uploadedId = signal(null, ...ngDevMode ? [{ debugName: "uploadedId" }] : /* istanbul ignore next */ []);
|
|
128
|
+
this._fileService = inject(CmatFilesUtilService);
|
|
129
|
+
this._destroyRef = inject(DestroyRef);
|
|
130
|
+
effect(() => {
|
|
131
|
+
const file = this.file();
|
|
132
|
+
this.total.set(file.size);
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
get fileType() {
|
|
136
|
+
return CmatUtilsService.getFileType(this.file().type);
|
|
137
|
+
}
|
|
138
|
+
get fileSize() {
|
|
139
|
+
return Number(this.file().size ?? this.file().length);
|
|
140
|
+
}
|
|
141
|
+
ngOnInit() {
|
|
142
|
+
if (this.autoUpload() && this.id() === null) this.upload();
|
|
143
|
+
}
|
|
144
|
+
upload() {
|
|
145
|
+
this.isUploading.set(true);
|
|
146
|
+
const file = this.file();
|
|
147
|
+
const fileModel = {
|
|
148
|
+
id: null,
|
|
149
|
+
fileName: file.name,
|
|
150
|
+
length: file.size,
|
|
151
|
+
fileCategory: this.fileCategory(),
|
|
152
|
+
isPublic: this.isPublic(),
|
|
153
|
+
filePath: this.filePath(),
|
|
154
|
+
fileType: this.fileType,
|
|
155
|
+
data: file.data
|
|
156
|
+
};
|
|
157
|
+
const formData = new FormData();
|
|
158
|
+
const fileBlob = file.data ?? file;
|
|
159
|
+
if (fileBlob instanceof Blob) formData.set(this.fileAlias(), fileBlob, file.fileName ?? file.name);
|
|
160
|
+
formData.append("fileInfo", JSON.stringify(fileModel));
|
|
161
|
+
this._fileService.uploadFile(formData).pipe(takeUntilDestroyed(this._destroyRef)).subscribe((event) => {
|
|
162
|
+
if (event.type === HttpEventType.UploadProgress && typeof event.total === "number") {
|
|
163
|
+
this.progressPercentage.set(Math.floor(event.loaded * 100 / event.total));
|
|
164
|
+
this.loaded.set(event.loaded);
|
|
165
|
+
this.total.set(event.total);
|
|
166
|
+
}
|
|
167
|
+
if (event.type === HttpEventType.Response) {
|
|
168
|
+
const fileId = typeof event.body?.id === "string" ? event.body.id : void 0;
|
|
169
|
+
if (!fileId) {
|
|
170
|
+
this.isUploading.set(false);
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
this.uploadedId.set(fileId);
|
|
174
|
+
file.id = fileId;
|
|
175
|
+
this.file.set(file);
|
|
176
|
+
this.isUploading.set(false);
|
|
177
|
+
this.uploadEvent.emit(this.file());
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
download() {
|
|
182
|
+
const id = this.uploadedId() ?? this.id();
|
|
183
|
+
if (!id) return;
|
|
184
|
+
this._fileService.downloadFile(id).pipe(takeUntilDestroyed(this._destroyRef)).subscribe((file) => {
|
|
185
|
+
saveAs(new Blob([file.body ?? new Blob()], { type: "text/plain;charset=utf-8" }), this.file().name);
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
remove() {
|
|
189
|
+
this.removeEvent.emit(this);
|
|
190
|
+
}
|
|
191
|
+
static {
|
|
192
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
193
|
+
minVersion: "12.0.0",
|
|
194
|
+
version: "22.2.3",
|
|
195
|
+
ngImport: i0,
|
|
196
|
+
type: CmatUploadComponent,
|
|
197
|
+
deps: [],
|
|
198
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
static {
|
|
202
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
203
|
+
minVersion: "17.0.0",
|
|
204
|
+
version: "22.2.3",
|
|
205
|
+
type: CmatUploadComponent,
|
|
206
|
+
isStandalone: true,
|
|
207
|
+
selector: "cmat-upload",
|
|
208
|
+
inputs: {
|
|
209
|
+
fileAlias: {
|
|
210
|
+
classPropertyName: "fileAlias",
|
|
211
|
+
publicName: "fileAlias",
|
|
212
|
+
isSignal: true,
|
|
213
|
+
isRequired: false,
|
|
214
|
+
transformFunction: null
|
|
215
|
+
},
|
|
216
|
+
filePath: {
|
|
217
|
+
classPropertyName: "filePath",
|
|
218
|
+
publicName: "filePath",
|
|
219
|
+
isSignal: true,
|
|
220
|
+
isRequired: false,
|
|
221
|
+
transformFunction: null
|
|
222
|
+
},
|
|
223
|
+
fileCategory: {
|
|
224
|
+
classPropertyName: "fileCategory",
|
|
225
|
+
publicName: "fileCategory",
|
|
226
|
+
isSignal: true,
|
|
227
|
+
isRequired: false,
|
|
228
|
+
transformFunction: null
|
|
229
|
+
},
|
|
230
|
+
isPublic: {
|
|
231
|
+
classPropertyName: "isPublic",
|
|
232
|
+
publicName: "isPublic",
|
|
233
|
+
isSignal: true,
|
|
234
|
+
isRequired: false,
|
|
235
|
+
transformFunction: null
|
|
236
|
+
},
|
|
237
|
+
editMode: {
|
|
238
|
+
classPropertyName: "editMode",
|
|
239
|
+
publicName: "editMode",
|
|
240
|
+
isSignal: true,
|
|
241
|
+
isRequired: false,
|
|
242
|
+
transformFunction: null
|
|
243
|
+
},
|
|
244
|
+
autoUpload: {
|
|
245
|
+
classPropertyName: "autoUpload",
|
|
246
|
+
publicName: "autoUpload",
|
|
247
|
+
isSignal: true,
|
|
248
|
+
isRequired: false,
|
|
249
|
+
transformFunction: null
|
|
250
|
+
},
|
|
251
|
+
file: {
|
|
252
|
+
classPropertyName: "file",
|
|
253
|
+
publicName: "file",
|
|
254
|
+
isSignal: true,
|
|
255
|
+
isRequired: true,
|
|
256
|
+
transformFunction: null
|
|
257
|
+
},
|
|
258
|
+
id: {
|
|
259
|
+
classPropertyName: "id",
|
|
260
|
+
publicName: "id",
|
|
261
|
+
isSignal: true,
|
|
262
|
+
isRequired: false,
|
|
263
|
+
transformFunction: null
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
outputs: {
|
|
267
|
+
removeEvent: "removeEvent",
|
|
268
|
+
uploadEvent: "uploadEvent",
|
|
269
|
+
file: "fileChange"
|
|
270
|
+
},
|
|
271
|
+
exportAs: ["cmatUpload"],
|
|
272
|
+
ngImport: i0,
|
|
273
|
+
template: "<div class=\"flex flex-col\">\r\n <div class=\"flex items-center gap-3 px-3 py-2\">\r\n <mat-icon class=\"icon-size-5 text-slate-400 dark:text-slate-500 flex-none\" [svgIcon]=\"fileType\"></mat-icon>\r\n <span\r\n matTooltip=\"{{ file().name }}\"\r\n class=\"text-sm flex-auto whitespace-nowrap overflow-hidden text-ellipsis\"\r\n >{{ file().name }}</span>\r\n <span class=\"text-xs text-secondary whitespace-nowrap flex-none\">{{ fileSize | cmatBytes }}</span>\r\n <span class=\"flex flex-row gap-0.5 print:hidden flex-none\">\r\n @if (id() === null) {\r\n <button\r\n matIconButton\r\n color=\"primary\"\r\n class=\"w-8 min-h-8 h-8 max-w-8\"\r\n [ngClass]=\"{ disabled: isUploading() }\"\r\n (click)=\"upload()\"\r\n >\r\n <mat-icon\r\n class=\"icon-size-5\"\r\n [svgIcon]=\"'mat_outline:file_upload'\"\r\n ></mat-icon>\r\n </button>\r\n }\r\n\r\n @if (id() !== null) {\r\n <button\r\n matIconButton\r\n color=\"primary\"\r\n class=\"w-8 min-h-8 h-8 max-w-8\"\r\n (click)=\"download()\"\r\n >\r\n <mat-icon\r\n class=\"icon-size-5\"\r\n [svgIcon]=\"'mat_outline:file_download'\"\r\n ></mat-icon>\r\n </button>\r\n }\r\n\r\n @if (editMode()) {\r\n <button\r\n matIconButton\r\n color=\"warn\"\r\n class=\"w-8 min-h-8 h-8 max-w-8\"\r\n (click)=\"remove()\"\r\n >\r\n <mat-icon\r\n class=\"icon-size-5\"\r\n [svgIcon]=\"'heroicons_solid:trash'\"\r\n ></mat-icon>\r\n </button>\r\n }\r\n </span>\r\n </div>\r\n @if (id() === null) {\r\n <div class=\"px-3 pb-2\">\r\n <mat-progress-bar [value]=\"progressPercentage()\"></mat-progress-bar>\r\n <div class=\"text-xs text-secondary mt-1\">\r\n {{ progressPercentage() }}% · {{ loaded() | cmatBytes }} / {{ total() | cmatBytes }}\r\n </div>\r\n </div>\r\n }\r\n</div>\r\n",
|
|
274
|
+
dependencies: [
|
|
275
|
+
{
|
|
276
|
+
kind: "ngmodule",
|
|
277
|
+
type: MatButtonModule
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
kind: "component",
|
|
281
|
+
type: i1$1.MatIconButton,
|
|
282
|
+
selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]",
|
|
283
|
+
exportAs: ["matButton", "matAnchor"]
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
kind: "ngmodule",
|
|
287
|
+
type: MatIconModule
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
kind: "component",
|
|
291
|
+
type: i2.MatIcon,
|
|
292
|
+
selector: "mat-icon",
|
|
293
|
+
inputs: [
|
|
294
|
+
"color",
|
|
295
|
+
"inline",
|
|
296
|
+
"svgIcon",
|
|
297
|
+
"fontSet",
|
|
298
|
+
"fontIcon"
|
|
299
|
+
],
|
|
300
|
+
exportAs: ["matIcon"]
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
kind: "ngmodule",
|
|
304
|
+
type: MatProgressBarModule
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
kind: "component",
|
|
308
|
+
type: i3.MatProgressBar,
|
|
309
|
+
selector: "mat-progress-bar",
|
|
310
|
+
inputs: [
|
|
311
|
+
"color",
|
|
312
|
+
"value",
|
|
313
|
+
"bufferValue",
|
|
314
|
+
"mode"
|
|
315
|
+
],
|
|
316
|
+
outputs: ["animationEnd"],
|
|
317
|
+
exportAs: ["matProgressBar"]
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
kind: "ngmodule",
|
|
321
|
+
type: MatTooltipModule
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
kind: "directive",
|
|
325
|
+
type: i4.MatTooltip,
|
|
326
|
+
selector: "[matTooltip]",
|
|
327
|
+
inputs: [
|
|
328
|
+
"matTooltipPosition",
|
|
329
|
+
"matTooltipPositionAtOrigin",
|
|
330
|
+
"matTooltipDisabled",
|
|
331
|
+
"matTooltipShowDelay",
|
|
332
|
+
"matTooltipHideDelay",
|
|
333
|
+
"matTooltipTouchGestures",
|
|
334
|
+
"matTooltip",
|
|
335
|
+
"matTooltipClass"
|
|
336
|
+
],
|
|
337
|
+
exportAs: ["matTooltip"]
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
kind: "directive",
|
|
341
|
+
type: NgClass,
|
|
342
|
+
selector: "[ngClass]",
|
|
343
|
+
inputs: ["class", "ngClass"]
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
kind: "pipe",
|
|
347
|
+
type: CmatBytesPipe,
|
|
348
|
+
name: "cmatBytes"
|
|
349
|
+
}
|
|
350
|
+
],
|
|
351
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
352
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
};
|
|
356
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
357
|
+
minVersion: "12.0.0",
|
|
358
|
+
version: "22.2.3",
|
|
359
|
+
ngImport: i0,
|
|
360
|
+
type: CmatUploadComponent,
|
|
361
|
+
decorators: [{
|
|
362
|
+
type: Component,
|
|
363
|
+
args: [{
|
|
364
|
+
selector: "cmat-upload",
|
|
365
|
+
encapsulation: ViewEncapsulation.None,
|
|
366
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
367
|
+
exportAs: "cmatUpload",
|
|
368
|
+
imports: [
|
|
369
|
+
MatButtonModule,
|
|
370
|
+
MatIconModule,
|
|
371
|
+
MatProgressBarModule,
|
|
372
|
+
MatTooltipModule,
|
|
373
|
+
CmatBytesPipe,
|
|
374
|
+
NgClass
|
|
375
|
+
],
|
|
376
|
+
template: "<div class=\"flex flex-col\">\r\n <div class=\"flex items-center gap-3 px-3 py-2\">\r\n <mat-icon class=\"icon-size-5 text-slate-400 dark:text-slate-500 flex-none\" [svgIcon]=\"fileType\"></mat-icon>\r\n <span\r\n matTooltip=\"{{ file().name }}\"\r\n class=\"text-sm flex-auto whitespace-nowrap overflow-hidden text-ellipsis\"\r\n >{{ file().name }}</span>\r\n <span class=\"text-xs text-secondary whitespace-nowrap flex-none\">{{ fileSize | cmatBytes }}</span>\r\n <span class=\"flex flex-row gap-0.5 print:hidden flex-none\">\r\n @if (id() === null) {\r\n <button\r\n matIconButton\r\n color=\"primary\"\r\n class=\"w-8 min-h-8 h-8 max-w-8\"\r\n [ngClass]=\"{ disabled: isUploading() }\"\r\n (click)=\"upload()\"\r\n >\r\n <mat-icon\r\n class=\"icon-size-5\"\r\n [svgIcon]=\"'mat_outline:file_upload'\"\r\n ></mat-icon>\r\n </button>\r\n }\r\n\r\n @if (id() !== null) {\r\n <button\r\n matIconButton\r\n color=\"primary\"\r\n class=\"w-8 min-h-8 h-8 max-w-8\"\r\n (click)=\"download()\"\r\n >\r\n <mat-icon\r\n class=\"icon-size-5\"\r\n [svgIcon]=\"'mat_outline:file_download'\"\r\n ></mat-icon>\r\n </button>\r\n }\r\n\r\n @if (editMode()) {\r\n <button\r\n matIconButton\r\n color=\"warn\"\r\n class=\"w-8 min-h-8 h-8 max-w-8\"\r\n (click)=\"remove()\"\r\n >\r\n <mat-icon\r\n class=\"icon-size-5\"\r\n [svgIcon]=\"'heroicons_solid:trash'\"\r\n ></mat-icon>\r\n </button>\r\n }\r\n </span>\r\n </div>\r\n @if (id() === null) {\r\n <div class=\"px-3 pb-2\">\r\n <mat-progress-bar [value]=\"progressPercentage()\"></mat-progress-bar>\r\n <div class=\"text-xs text-secondary mt-1\">\r\n {{ progressPercentage() }}% · {{ loaded() | cmatBytes }} / {{ total() | cmatBytes }}\r\n </div>\r\n </div>\r\n }\r\n</div>\r\n"
|
|
377
|
+
}]
|
|
378
|
+
}],
|
|
379
|
+
ctorParameters: () => [],
|
|
380
|
+
propDecorators: {
|
|
381
|
+
removeEvent: [{
|
|
382
|
+
type: i0.Output,
|
|
383
|
+
args: ["removeEvent"]
|
|
384
|
+
}],
|
|
385
|
+
uploadEvent: [{
|
|
386
|
+
type: i0.Output,
|
|
387
|
+
args: ["uploadEvent"]
|
|
388
|
+
}],
|
|
389
|
+
fileAlias: [{
|
|
390
|
+
type: i0.Input,
|
|
391
|
+
args: [{
|
|
392
|
+
isSignal: true,
|
|
393
|
+
alias: "fileAlias",
|
|
394
|
+
required: false
|
|
395
|
+
}]
|
|
396
|
+
}],
|
|
397
|
+
filePath: [{
|
|
398
|
+
type: i0.Input,
|
|
399
|
+
args: [{
|
|
400
|
+
isSignal: true,
|
|
401
|
+
alias: "filePath",
|
|
402
|
+
required: false
|
|
403
|
+
}]
|
|
404
|
+
}],
|
|
405
|
+
fileCategory: [{
|
|
406
|
+
type: i0.Input,
|
|
407
|
+
args: [{
|
|
408
|
+
isSignal: true,
|
|
409
|
+
alias: "fileCategory",
|
|
410
|
+
required: false
|
|
411
|
+
}]
|
|
412
|
+
}],
|
|
413
|
+
isPublic: [{
|
|
414
|
+
type: i0.Input,
|
|
415
|
+
args: [{
|
|
416
|
+
isSignal: true,
|
|
417
|
+
alias: "isPublic",
|
|
418
|
+
required: false
|
|
419
|
+
}]
|
|
420
|
+
}],
|
|
421
|
+
editMode: [{
|
|
422
|
+
type: i0.Input,
|
|
423
|
+
args: [{
|
|
424
|
+
isSignal: true,
|
|
425
|
+
alias: "editMode",
|
|
426
|
+
required: false
|
|
427
|
+
}]
|
|
428
|
+
}],
|
|
429
|
+
autoUpload: [{
|
|
430
|
+
type: i0.Input,
|
|
431
|
+
args: [{
|
|
432
|
+
isSignal: true,
|
|
433
|
+
alias: "autoUpload",
|
|
434
|
+
required: false
|
|
435
|
+
}]
|
|
436
|
+
}],
|
|
437
|
+
file: [{
|
|
438
|
+
type: i0.Input,
|
|
439
|
+
args: [{
|
|
440
|
+
isSignal: true,
|
|
441
|
+
alias: "file",
|
|
442
|
+
required: true
|
|
443
|
+
}]
|
|
444
|
+
}, {
|
|
445
|
+
type: i0.Output,
|
|
446
|
+
args: ["fileChange"]
|
|
447
|
+
}],
|
|
448
|
+
id: [{
|
|
449
|
+
type: i0.Input,
|
|
450
|
+
args: [{
|
|
451
|
+
isSignal: true,
|
|
452
|
+
alias: "id",
|
|
453
|
+
required: false
|
|
454
|
+
}]
|
|
455
|
+
}]
|
|
456
|
+
}
|
|
457
|
+
});
|
|
458
|
+
var CmatUploadQueueComponent = class CmatUploadQueueComponent {
|
|
459
|
+
constructor() {
|
|
460
|
+
this.outputRemoveIdEvent = output();
|
|
461
|
+
this.outputUploadIdEvent = output();
|
|
462
|
+
this.outputFilesDataEvent = output();
|
|
463
|
+
this.fileAlias = input("fileData", ...ngDevMode ? [{ debugName: "fileAlias" }] : /* istanbul ignore next */ []);
|
|
464
|
+
this.filePath = input("", ...ngDevMode ? [{ debugName: "filePath" }] : /* istanbul ignore next */ []);
|
|
465
|
+
this.fileCategory = input("", ...ngDevMode ? [{ debugName: "fileCategory" }] : /* istanbul ignore next */ []);
|
|
466
|
+
this.isPublic = input(false, ...ngDevMode ? [{ debugName: "isPublic" }] : /* istanbul ignore next */ []);
|
|
467
|
+
this.required = input(false, ...ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []);
|
|
468
|
+
this.autoUpload = input(true, ...ngDevMode ? [{ debugName: "autoUpload" }] : /* istanbul ignore next */ []);
|
|
469
|
+
this.multiple = input(true, ...ngDevMode ? [{ debugName: "multiple" }] : /* istanbul ignore next */ []);
|
|
470
|
+
this.accept = input("", ...ngDevMode ? [{ debugName: "accept" }] : /* istanbul ignore next */ []);
|
|
471
|
+
this.title = input("附件", ...ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []);
|
|
472
|
+
this.editMode = input(false, ...ngDevMode ? [{ debugName: "editMode" }] : /* istanbul ignore next */ []);
|
|
473
|
+
this.filesData = model([], ...ngDevMode ? [{ debugName: "filesData" }] : /* istanbul ignore next */ []);
|
|
474
|
+
this.id = "cmatupload-" + crypto.randomUUID().slice(0, 8);
|
|
475
|
+
this.fileUploads = viewChildren(CmatUploadComponent, ...ngDevMode ? [{ debugName: "fileUploads" }] : /* istanbul ignore next */ []);
|
|
476
|
+
this._cmatMediaWatcherService = inject(CmatMediaWatcherService);
|
|
477
|
+
this._elementRef = inject(ElementRef);
|
|
478
|
+
this.isHandSet = computed(() => {
|
|
479
|
+
return !this._cmatMediaWatcherService.mediaChange().matchingAliases.includes("lg");
|
|
480
|
+
}, ...ngDevMode ? [{ debugName: "isHandSet" }] : /* istanbul ignore next */ []);
|
|
481
|
+
}
|
|
482
|
+
onDrop(event) {
|
|
483
|
+
const hasFiles = event.dataTransfer?.files && event.dataTransfer.files.length > 0;
|
|
484
|
+
if (event.dataTransfer?.types.includes("application/x-ng-dnd")) return;
|
|
485
|
+
if (!hasFiles) return;
|
|
486
|
+
for (const file of event.dataTransfer.files) if (this.accept()?.includes(file.type)) this.add(file);
|
|
487
|
+
event.preventDefault();
|
|
488
|
+
event.stopPropagation();
|
|
489
|
+
}
|
|
490
|
+
onDropOver(event) {
|
|
491
|
+
if (event.dataTransfer?.types.includes("application/x-ng-dnd")) return;
|
|
492
|
+
event.preventDefault();
|
|
493
|
+
}
|
|
494
|
+
ngAfterViewInit() {
|
|
495
|
+
const fileUpload = this._elementRef.nativeElement.querySelector(`#${this.id}`);
|
|
496
|
+
if (!(fileUpload instanceof HTMLInputElement)) return;
|
|
497
|
+
fileUpload.onchange = () => {
|
|
498
|
+
for (let index = 0; index < (fileUpload.files?.length ?? 0); index++) {
|
|
499
|
+
const file = fileUpload.files[index];
|
|
500
|
+
this.add(file);
|
|
501
|
+
}
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
add(file) {
|
|
505
|
+
if (!this.isFileTypeAccepted(file.type)) return;
|
|
506
|
+
const filesData = this.filesData() ?? [];
|
|
507
|
+
const fileModel = {
|
|
508
|
+
fileName: file.name,
|
|
509
|
+
length: file.size,
|
|
510
|
+
fileType: "file",
|
|
511
|
+
filePath: "",
|
|
512
|
+
isPublic: false,
|
|
513
|
+
fileCategory: "",
|
|
514
|
+
uploadDate: /* @__PURE__ */ new Date(),
|
|
515
|
+
data: file,
|
|
516
|
+
name: file.name,
|
|
517
|
+
size: file.size,
|
|
518
|
+
type: file.type
|
|
519
|
+
};
|
|
520
|
+
let newFilesData;
|
|
521
|
+
if (!(!this.multiple() && filesData.length > 0)) newFilesData = [...filesData, fileModel];
|
|
522
|
+
else {
|
|
523
|
+
const firstUpload = this.fileUploads()[0];
|
|
524
|
+
if (firstUpload?.id() === null) {
|
|
525
|
+
newFilesData = [...filesData, fileModel];
|
|
526
|
+
firstUpload.remove();
|
|
527
|
+
} else return;
|
|
528
|
+
}
|
|
529
|
+
this.filesData.set(newFilesData);
|
|
530
|
+
}
|
|
531
|
+
upload(event) {
|
|
532
|
+
this.outputUploadIdEvent.emit(event.id ?? "");
|
|
533
|
+
this.outputFilesDataEvent.emit(this.filesData());
|
|
534
|
+
}
|
|
535
|
+
remove(event) {
|
|
536
|
+
const filesData = this.filesData();
|
|
537
|
+
if (filesData) {
|
|
538
|
+
if (filesData.findIndex((j) => j === event.file()) > -1) {
|
|
539
|
+
if (event.file().id) this.outputRemoveIdEvent.emit(event.file().id);
|
|
540
|
+
const newData = filesData.filter((j) => j !== event.file());
|
|
541
|
+
this.filesData.set(newData);
|
|
542
|
+
this.outputFilesDataEvent.emit(newData);
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
uploadAll() {
|
|
547
|
+
this.fileUploads().forEach((fileUpload) => {
|
|
548
|
+
if (fileUpload.id() === null) fileUpload.upload();
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
removeAll() {
|
|
552
|
+
this.fileUploads().forEach((fileUpload) => {
|
|
553
|
+
fileUpload.remove();
|
|
554
|
+
});
|
|
555
|
+
}
|
|
556
|
+
choose() {
|
|
557
|
+
this._elementRef.nativeElement.querySelector(`#${this.id}`)?.dispatchEvent(new MouseEvent("click"));
|
|
558
|
+
}
|
|
559
|
+
isFileTypeAccepted(fileType) {
|
|
560
|
+
const accept = this.accept();
|
|
561
|
+
if (!accept || accept === "") return true;
|
|
562
|
+
return accept.split(",").map((type) => type.trim()).some((type) => {
|
|
563
|
+
if (type.endsWith("/*")) {
|
|
564
|
+
const prefix = type.slice(0, -1);
|
|
565
|
+
return fileType.startsWith(prefix);
|
|
566
|
+
}
|
|
567
|
+
return fileType === type;
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
static {
|
|
571
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
572
|
+
minVersion: "12.0.0",
|
|
573
|
+
version: "22.2.3",
|
|
574
|
+
ngImport: i0,
|
|
575
|
+
type: CmatUploadQueueComponent,
|
|
576
|
+
deps: [],
|
|
577
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
578
|
+
});
|
|
579
|
+
}
|
|
580
|
+
static {
|
|
581
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
582
|
+
minVersion: "17.0.0",
|
|
583
|
+
version: "22.2.3",
|
|
584
|
+
type: CmatUploadQueueComponent,
|
|
585
|
+
isStandalone: true,
|
|
586
|
+
selector: "cmat-upload-queue",
|
|
587
|
+
inputs: {
|
|
588
|
+
fileAlias: {
|
|
589
|
+
classPropertyName: "fileAlias",
|
|
590
|
+
publicName: "fileAlias",
|
|
591
|
+
isSignal: true,
|
|
592
|
+
isRequired: false,
|
|
593
|
+
transformFunction: null
|
|
594
|
+
},
|
|
595
|
+
filePath: {
|
|
596
|
+
classPropertyName: "filePath",
|
|
597
|
+
publicName: "filePath",
|
|
598
|
+
isSignal: true,
|
|
599
|
+
isRequired: false,
|
|
600
|
+
transformFunction: null
|
|
601
|
+
},
|
|
602
|
+
fileCategory: {
|
|
603
|
+
classPropertyName: "fileCategory",
|
|
604
|
+
publicName: "fileCategory",
|
|
605
|
+
isSignal: true,
|
|
606
|
+
isRequired: false,
|
|
607
|
+
transformFunction: null
|
|
608
|
+
},
|
|
609
|
+
isPublic: {
|
|
610
|
+
classPropertyName: "isPublic",
|
|
611
|
+
publicName: "isPublic",
|
|
612
|
+
isSignal: true,
|
|
613
|
+
isRequired: false,
|
|
614
|
+
transformFunction: null
|
|
615
|
+
},
|
|
616
|
+
required: {
|
|
617
|
+
classPropertyName: "required",
|
|
618
|
+
publicName: "required",
|
|
619
|
+
isSignal: true,
|
|
620
|
+
isRequired: false,
|
|
621
|
+
transformFunction: null
|
|
622
|
+
},
|
|
623
|
+
autoUpload: {
|
|
624
|
+
classPropertyName: "autoUpload",
|
|
625
|
+
publicName: "autoUpload",
|
|
626
|
+
isSignal: true,
|
|
627
|
+
isRequired: false,
|
|
628
|
+
transformFunction: null
|
|
629
|
+
},
|
|
630
|
+
multiple: {
|
|
631
|
+
classPropertyName: "multiple",
|
|
632
|
+
publicName: "multiple",
|
|
633
|
+
isSignal: true,
|
|
634
|
+
isRequired: false,
|
|
635
|
+
transformFunction: null
|
|
636
|
+
},
|
|
637
|
+
accept: {
|
|
638
|
+
classPropertyName: "accept",
|
|
639
|
+
publicName: "accept",
|
|
640
|
+
isSignal: true,
|
|
641
|
+
isRequired: false,
|
|
642
|
+
transformFunction: null
|
|
643
|
+
},
|
|
644
|
+
title: {
|
|
645
|
+
classPropertyName: "title",
|
|
646
|
+
publicName: "title",
|
|
647
|
+
isSignal: true,
|
|
648
|
+
isRequired: false,
|
|
649
|
+
transformFunction: null
|
|
650
|
+
},
|
|
651
|
+
editMode: {
|
|
652
|
+
classPropertyName: "editMode",
|
|
653
|
+
publicName: "editMode",
|
|
654
|
+
isSignal: true,
|
|
655
|
+
isRequired: false,
|
|
656
|
+
transformFunction: null
|
|
657
|
+
},
|
|
658
|
+
filesData: {
|
|
659
|
+
classPropertyName: "filesData",
|
|
660
|
+
publicName: "filesData",
|
|
661
|
+
isSignal: true,
|
|
662
|
+
isRequired: false,
|
|
663
|
+
transformFunction: null
|
|
664
|
+
}
|
|
665
|
+
},
|
|
666
|
+
outputs: {
|
|
667
|
+
outputRemoveIdEvent: "outputRemoveIdEvent",
|
|
668
|
+
outputUploadIdEvent: "outputUploadIdEvent",
|
|
669
|
+
outputFilesDataEvent: "outputFilesDataEvent",
|
|
670
|
+
filesData: "filesDataChange"
|
|
671
|
+
},
|
|
672
|
+
host: { listeners: {
|
|
673
|
+
"drop": "onDrop($event)",
|
|
674
|
+
"dragover": "onDropOver($event)"
|
|
675
|
+
} },
|
|
676
|
+
viewQueries: [{
|
|
677
|
+
propertyName: "fileUploads",
|
|
678
|
+
predicate: CmatUploadComponent,
|
|
679
|
+
descendants: true,
|
|
680
|
+
isSignal: true
|
|
681
|
+
}],
|
|
682
|
+
exportAs: ["cmatUploadQueue"],
|
|
683
|
+
ngImport: i0,
|
|
684
|
+
template: "<div class=\"rounded-xl border border-slate-200 dark:border-slate-700 overflow-hidden bg-card\">\r\n <div class=\"flex items-center gap-2 px-3 py-2 bg-primary-50 dark:bg-primary-900/30 border-b border-primary-200 dark:border-primary-700\">\r\n <mat-icon class=\"icon-size-5 text-primary-500\" [svgIcon]=\"'heroicons_outline:paper-clip'\"></mat-icon>\r\n <span class=\"text-sm font-semibold text-primary-500\">\r\n {{ title() }}\r\n @if (required()) {\r\n <span>*</span>\r\n }\r\n </span>\r\n </div>\r\n <input type=\"file\" class=\"hidden\" [id]=\"id\" [multiple]=\"multiple()\" [accept]=\"accept()\" />\r\n\r\n @if (editMode()) {\r\n <div class=\"flex flex-row gap-1 p-2 print:hidden\">\r\n @if (!isHandSet()) {\r\n <button matButton=\"filled\" color=\"primary\" (click)=\"choose()\">\r\n @if (autoUpload()) {\r\n <mat-icon [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon>\r\n } @else {\r\n <mat-icon [svgIcon]=\"'mat_outline:add_box'\"></mat-icon>\r\n }\r\n <span class=\"ml-2\">选择</span>\r\n </button>\r\n @if (filesData() && multiple() && filesData().length > 0) {\r\n @if (!autoUpload()) {\r\n <button matButton=\"filled\" color=\"accent\" (click)=\"uploadAll()\">\r\n <mat-icon [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon><span class=\"ml-2\">上传全部</span>\r\n </button>\r\n }\r\n\r\n <button matButton=\"filled\" color=\"warn\" (click)=\"removeAll()\">\r\n <mat-icon [svgIcon]=\"'heroicons_solid:trash'\"></mat-icon><span class=\"ml-2\">删除全部</span>\r\n </button>\r\n }\r\n } @else {\r\n <button matIconButton color=\"primary\" (click)=\"choose()\">\r\n @if (autoUpload()) {\r\n <mat-icon [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon>\r\n } @else {\r\n <mat-icon [svgIcon]=\"'mat_outline:add_box'\"></mat-icon>\r\n }\r\n </button>\r\n\r\n @if (filesData() && multiple() && filesData().length > 0) {\r\n @if (!autoUpload()) {\r\n <button matIconButton color=\"accent\" (click)=\"uploadAll()\">\r\n <mat-icon [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon>\r\n </button>\r\n }\r\n\r\n <button matIconButton color=\"warn\" (click)=\"removeAll()\">\r\n <mat-icon [svgIcon]=\"'heroicons_solid:trash'\"></mat-icon>\r\n </button>\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n <div class=\"border-t\">\r\n @if (!filesData() || filesData().length === 0) {\r\n <div class=\"flex flex-col items-center justify-center py-4 text-hint\">\r\n <mat-icon class=\"w-16! h-16! text-4xl! mb-3\" [svgIcon]=\"'heroicons_outline:folder-open'\"></mat-icon>\r\n <span class=\"text-sm\">暂无内容</span>\r\n </div>\r\n }@else{\r\n <mat-list>\r\n @for (file of filesData(); track $index) {\r\n <mat-list-item class=\"cmat-upload-file-item h-full\">\r\n <cmat-upload class=\"my-2\" [fileAlias]=\"fileAlias()\" [filePath]=\"filePath()\" [fileCategory]=\"fileCategory()\"\r\n [autoUpload]=\"autoUpload()\" [editMode]=\"editMode()\" [file]=\"file\" [id]=\"file.id || null\"\r\n [isPublic]=\"isPublic()\" (removeEvent)=\"remove($event)\" (uploadEvent)=\"upload($event)\"></cmat-upload>\r\n </mat-list-item>\r\n }\r\n </mat-list>\r\n }\r\n </div>\r\n</div>\r\n",
|
|
685
|
+
dependencies: [
|
|
686
|
+
{
|
|
687
|
+
kind: "ngmodule",
|
|
688
|
+
type: MatListModule
|
|
689
|
+
},
|
|
690
|
+
{
|
|
691
|
+
kind: "component",
|
|
692
|
+
type: i1.MatList,
|
|
693
|
+
selector: "mat-list",
|
|
694
|
+
exportAs: ["matList"]
|
|
695
|
+
},
|
|
696
|
+
{
|
|
697
|
+
kind: "component",
|
|
698
|
+
type: i1.MatListItem,
|
|
699
|
+
selector: "mat-list-item, a[mat-list-item], button[mat-list-item]",
|
|
700
|
+
inputs: ["activated"],
|
|
701
|
+
exportAs: ["matListItem"]
|
|
702
|
+
},
|
|
703
|
+
{
|
|
704
|
+
kind: "ngmodule",
|
|
705
|
+
type: MatButtonModule
|
|
706
|
+
},
|
|
707
|
+
{
|
|
708
|
+
kind: "component",
|
|
709
|
+
type: i1$1.MatButton,
|
|
710
|
+
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] ",
|
|
711
|
+
inputs: ["matButton"],
|
|
712
|
+
exportAs: ["matButton", "matAnchor"]
|
|
713
|
+
},
|
|
714
|
+
{
|
|
715
|
+
kind: "component",
|
|
716
|
+
type: i1$1.MatIconButton,
|
|
717
|
+
selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]",
|
|
718
|
+
exportAs: ["matButton", "matAnchor"]
|
|
719
|
+
},
|
|
720
|
+
{
|
|
721
|
+
kind: "ngmodule",
|
|
722
|
+
type: MatIconModule
|
|
723
|
+
},
|
|
724
|
+
{
|
|
725
|
+
kind: "component",
|
|
726
|
+
type: i2.MatIcon,
|
|
727
|
+
selector: "mat-icon",
|
|
728
|
+
inputs: [
|
|
729
|
+
"color",
|
|
730
|
+
"inline",
|
|
731
|
+
"svgIcon",
|
|
732
|
+
"fontSet",
|
|
733
|
+
"fontIcon"
|
|
734
|
+
],
|
|
735
|
+
exportAs: ["matIcon"]
|
|
736
|
+
},
|
|
737
|
+
{
|
|
738
|
+
kind: "component",
|
|
739
|
+
type: CmatUploadComponent,
|
|
740
|
+
selector: "cmat-upload",
|
|
741
|
+
inputs: [
|
|
742
|
+
"fileAlias",
|
|
743
|
+
"filePath",
|
|
744
|
+
"fileCategory",
|
|
745
|
+
"isPublic",
|
|
746
|
+
"editMode",
|
|
747
|
+
"autoUpload",
|
|
748
|
+
"file",
|
|
749
|
+
"id"
|
|
750
|
+
],
|
|
751
|
+
outputs: [
|
|
752
|
+
"removeEvent",
|
|
753
|
+
"uploadEvent",
|
|
754
|
+
"fileChange"
|
|
755
|
+
],
|
|
756
|
+
exportAs: ["cmatUpload"]
|
|
757
|
+
}
|
|
758
|
+
],
|
|
759
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
760
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
761
|
+
});
|
|
762
|
+
}
|
|
763
|
+
};
|
|
764
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
765
|
+
minVersion: "12.0.0",
|
|
766
|
+
version: "22.2.3",
|
|
767
|
+
ngImport: i0,
|
|
768
|
+
type: CmatUploadQueueComponent,
|
|
769
|
+
decorators: [{
|
|
770
|
+
type: Component,
|
|
771
|
+
args: [{
|
|
772
|
+
selector: "cmat-upload-queue",
|
|
773
|
+
encapsulation: ViewEncapsulation.None,
|
|
774
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
775
|
+
exportAs: "cmatUploadQueue",
|
|
776
|
+
imports: [
|
|
777
|
+
MatListModule,
|
|
778
|
+
MatButtonModule,
|
|
779
|
+
MatIconModule,
|
|
780
|
+
CmatUploadComponent
|
|
781
|
+
],
|
|
782
|
+
template: "<div class=\"rounded-xl border border-slate-200 dark:border-slate-700 overflow-hidden bg-card\">\r\n <div class=\"flex items-center gap-2 px-3 py-2 bg-primary-50 dark:bg-primary-900/30 border-b border-primary-200 dark:border-primary-700\">\r\n <mat-icon class=\"icon-size-5 text-primary-500\" [svgIcon]=\"'heroicons_outline:paper-clip'\"></mat-icon>\r\n <span class=\"text-sm font-semibold text-primary-500\">\r\n {{ title() }}\r\n @if (required()) {\r\n <span>*</span>\r\n }\r\n </span>\r\n </div>\r\n <input type=\"file\" class=\"hidden\" [id]=\"id\" [multiple]=\"multiple()\" [accept]=\"accept()\" />\r\n\r\n @if (editMode()) {\r\n <div class=\"flex flex-row gap-1 p-2 print:hidden\">\r\n @if (!isHandSet()) {\r\n <button matButton=\"filled\" color=\"primary\" (click)=\"choose()\">\r\n @if (autoUpload()) {\r\n <mat-icon [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon>\r\n } @else {\r\n <mat-icon [svgIcon]=\"'mat_outline:add_box'\"></mat-icon>\r\n }\r\n <span class=\"ml-2\">选择</span>\r\n </button>\r\n @if (filesData() && multiple() && filesData().length > 0) {\r\n @if (!autoUpload()) {\r\n <button matButton=\"filled\" color=\"accent\" (click)=\"uploadAll()\">\r\n <mat-icon [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon><span class=\"ml-2\">上传全部</span>\r\n </button>\r\n }\r\n\r\n <button matButton=\"filled\" color=\"warn\" (click)=\"removeAll()\">\r\n <mat-icon [svgIcon]=\"'heroicons_solid:trash'\"></mat-icon><span class=\"ml-2\">删除全部</span>\r\n </button>\r\n }\r\n } @else {\r\n <button matIconButton color=\"primary\" (click)=\"choose()\">\r\n @if (autoUpload()) {\r\n <mat-icon [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon>\r\n } @else {\r\n <mat-icon [svgIcon]=\"'mat_outline:add_box'\"></mat-icon>\r\n }\r\n </button>\r\n\r\n @if (filesData() && multiple() && filesData().length > 0) {\r\n @if (!autoUpload()) {\r\n <button matIconButton color=\"accent\" (click)=\"uploadAll()\">\r\n <mat-icon [svgIcon]=\"'mat_outline:file_upload'\"></mat-icon>\r\n </button>\r\n }\r\n\r\n <button matIconButton color=\"warn\" (click)=\"removeAll()\">\r\n <mat-icon [svgIcon]=\"'heroicons_solid:trash'\"></mat-icon>\r\n </button>\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n <div class=\"border-t\">\r\n @if (!filesData() || filesData().length === 0) {\r\n <div class=\"flex flex-col items-center justify-center py-4 text-hint\">\r\n <mat-icon class=\"w-16! h-16! text-4xl! mb-3\" [svgIcon]=\"'heroicons_outline:folder-open'\"></mat-icon>\r\n <span class=\"text-sm\">暂无内容</span>\r\n </div>\r\n }@else{\r\n <mat-list>\r\n @for (file of filesData(); track $index) {\r\n <mat-list-item class=\"cmat-upload-file-item h-full\">\r\n <cmat-upload class=\"my-2\" [fileAlias]=\"fileAlias()\" [filePath]=\"filePath()\" [fileCategory]=\"fileCategory()\"\r\n [autoUpload]=\"autoUpload()\" [editMode]=\"editMode()\" [file]=\"file\" [id]=\"file.id || null\"\r\n [isPublic]=\"isPublic()\" (removeEvent)=\"remove($event)\" (uploadEvent)=\"upload($event)\"></cmat-upload>\r\n </mat-list-item>\r\n }\r\n </mat-list>\r\n }\r\n </div>\r\n</div>\r\n"
|
|
783
|
+
}]
|
|
784
|
+
}],
|
|
785
|
+
propDecorators: {
|
|
786
|
+
outputRemoveIdEvent: [{
|
|
787
|
+
type: i0.Output,
|
|
788
|
+
args: ["outputRemoveIdEvent"]
|
|
789
|
+
}],
|
|
790
|
+
outputUploadIdEvent: [{
|
|
791
|
+
type: i0.Output,
|
|
792
|
+
args: ["outputUploadIdEvent"]
|
|
793
|
+
}],
|
|
794
|
+
outputFilesDataEvent: [{
|
|
795
|
+
type: i0.Output,
|
|
796
|
+
args: ["outputFilesDataEvent"]
|
|
797
|
+
}],
|
|
798
|
+
fileAlias: [{
|
|
799
|
+
type: i0.Input,
|
|
800
|
+
args: [{
|
|
801
|
+
isSignal: true,
|
|
802
|
+
alias: "fileAlias",
|
|
803
|
+
required: false
|
|
804
|
+
}]
|
|
805
|
+
}],
|
|
806
|
+
filePath: [{
|
|
807
|
+
type: i0.Input,
|
|
808
|
+
args: [{
|
|
809
|
+
isSignal: true,
|
|
810
|
+
alias: "filePath",
|
|
811
|
+
required: false
|
|
812
|
+
}]
|
|
813
|
+
}],
|
|
814
|
+
fileCategory: [{
|
|
815
|
+
type: i0.Input,
|
|
816
|
+
args: [{
|
|
817
|
+
isSignal: true,
|
|
818
|
+
alias: "fileCategory",
|
|
819
|
+
required: false
|
|
820
|
+
}]
|
|
821
|
+
}],
|
|
822
|
+
isPublic: [{
|
|
823
|
+
type: i0.Input,
|
|
824
|
+
args: [{
|
|
825
|
+
isSignal: true,
|
|
826
|
+
alias: "isPublic",
|
|
827
|
+
required: false
|
|
828
|
+
}]
|
|
829
|
+
}],
|
|
830
|
+
required: [{
|
|
831
|
+
type: i0.Input,
|
|
832
|
+
args: [{
|
|
833
|
+
isSignal: true,
|
|
834
|
+
alias: "required",
|
|
835
|
+
required: false
|
|
836
|
+
}]
|
|
837
|
+
}],
|
|
838
|
+
autoUpload: [{
|
|
839
|
+
type: i0.Input,
|
|
840
|
+
args: [{
|
|
841
|
+
isSignal: true,
|
|
842
|
+
alias: "autoUpload",
|
|
843
|
+
required: false
|
|
844
|
+
}]
|
|
845
|
+
}],
|
|
846
|
+
multiple: [{
|
|
847
|
+
type: i0.Input,
|
|
848
|
+
args: [{
|
|
849
|
+
isSignal: true,
|
|
850
|
+
alias: "multiple",
|
|
851
|
+
required: false
|
|
852
|
+
}]
|
|
853
|
+
}],
|
|
854
|
+
accept: [{
|
|
855
|
+
type: i0.Input,
|
|
856
|
+
args: [{
|
|
857
|
+
isSignal: true,
|
|
858
|
+
alias: "accept",
|
|
859
|
+
required: false
|
|
860
|
+
}]
|
|
861
|
+
}],
|
|
862
|
+
title: [{
|
|
863
|
+
type: i0.Input,
|
|
864
|
+
args: [{
|
|
865
|
+
isSignal: true,
|
|
866
|
+
alias: "title",
|
|
867
|
+
required: false
|
|
868
|
+
}]
|
|
869
|
+
}],
|
|
870
|
+
editMode: [{
|
|
871
|
+
type: i0.Input,
|
|
872
|
+
args: [{
|
|
873
|
+
isSignal: true,
|
|
874
|
+
alias: "editMode",
|
|
875
|
+
required: false
|
|
876
|
+
}]
|
|
877
|
+
}],
|
|
878
|
+
filesData: [{
|
|
879
|
+
type: i0.Input,
|
|
880
|
+
args: [{
|
|
881
|
+
isSignal: true,
|
|
882
|
+
alias: "filesData",
|
|
883
|
+
required: false
|
|
884
|
+
}]
|
|
885
|
+
}, {
|
|
886
|
+
type: i0.Output,
|
|
887
|
+
args: ["filesDataChange"]
|
|
888
|
+
}],
|
|
889
|
+
fileUploads: [{
|
|
890
|
+
type: i0.ViewChildren,
|
|
891
|
+
args: [i0.forwardRef(() => CmatUploadComponent), { isSignal: true }]
|
|
892
|
+
}],
|
|
893
|
+
onDrop: [{
|
|
894
|
+
type: HostListener,
|
|
895
|
+
args: ["drop", ["$event"]]
|
|
896
|
+
}],
|
|
897
|
+
onDropOver: [{
|
|
898
|
+
type: HostListener,
|
|
899
|
+
args: ["dragover", ["$event"]]
|
|
900
|
+
}]
|
|
901
|
+
}
|
|
902
|
+
});
|
|
410
903
|
export { CmatFilesUtilService, CmatUploadComponent, CmatUploadQueueComponent };
|
|
411
|
-
|
|
904
|
+
|
|
905
|
+
//# sourceMappingURL=cmat-components-upload.mjs.map
|