cmat 0.0.110 → 0.0.112
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 +2751 -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 +985 -669
- 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 +39806 -22071
- 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 +1131 -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 -92
- 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 -5194
|
@@ -1,457 +1,702 @@
|
|
|
1
|
-
import { Overlay } from
|
|
2
|
-
import { TemplatePortal } from
|
|
3
|
-
import { NgClass } from
|
|
4
|
-
import * as i0 from
|
|
5
|
-
import {
|
|
6
|
-
import * as i1 from
|
|
7
|
-
import { FormControl,
|
|
8
|
-
import * as i2 from
|
|
9
|
-
import { MatButtonModule } from
|
|
10
|
-
import { MatMonthView } from
|
|
11
|
-
import * as i4 from
|
|
12
|
-
import { MatFormFieldModule } from
|
|
13
|
-
import * as i3 from
|
|
14
|
-
import { MatIconModule } from
|
|
15
|
-
import * as i5 from
|
|
16
|
-
import { MatInputModule } from
|
|
17
|
-
import dayjs from
|
|
18
|
-
import isBetween from
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
], viewQueries: [{ propertyName: "_matMonthView1", first: true, predicate: ["matMonthView1"], descendants: true, isSignal: true }, { propertyName: "_matMonthView2", first: true, predicate: ["matMonthView2"], descendants: true, isSignal: true }, { propertyName: "_pickerPanelOrigin", first: true, predicate: ["pickerPanelOrigin"], descendants: true, isSignal: true }, { propertyName: "_pickerPanel", first: true, predicate: ["pickerPanel"], descendants: true, isSignal: true }], exportAs: ["cmatDateRange"], ngImport: i0, template: "<div #pickerPanelOrigin role=\"presentation\" class=\"range\" (click)=\"openPickerPanel()\">\r\n\r\n <div class=\"start\" [ngClass]=\"controlClass()\">\r\n <div class=\"date\">{{rangeDisplay()?.startDate}}</div>\r\n @if (rangeDisplay()?.startTime) {\r\n <div class=\"time\">{{rangeDisplay()?.startTime}}</div>\r\n }\r\n </div>\r\n\r\n <div class=\"separator\">-</div>\r\n\r\n <div class=\"end\" [ngClass]=\"controlClass()\">\r\n <div class=\"date\">{{rangeDisplay()?.endDate}}</div>\r\n @if (rangeDisplay()?.endTime) {\r\n <div class=\"time\">{{rangeDisplay()?.endTime}}</div>\r\n }\r\n </div>\r\n\r\n</div>\r\n\r\n<ng-template #pickerPanel>\r\n\r\n <!-- Start -->\r\n <div class=\"start\">\r\n\r\n <div class=\"month\">\r\n <div class=\"month-header\">\r\n <button type=\"button\" class=\"previous-button\" matIconButton tabindex=\"1\" (click)=\"prev()\">\r\n <mat-icon [svgIcon]=\"'heroicons_outline:chevron-left'\"></mat-icon>\r\n </button>\r\n <div class=\"month-label\">{{getMonthLabel(1)}}</div>\r\n </div>\r\n <mat-month-view #matMonthView1 [dateFilter]=\"dateFilterFn()\" [dateClass]=\"dateClassFn()\"\r\n [activeDate]=\"activeDates().month1\" (activeDateChange)=\"onActiveDateChange(1, $event)\"\r\n (click)=\"$event.stopImmediatePropagation()\"\r\n (selectedChange)=\"onSelectedDateChange($event)\">\r\n </mat-month-view>\r\n </div>\r\n\r\n @if (timeRange()) {\r\n <mat-form-field class=\"time start-time\">\r\n <input matInput tabindex=\"3\" [autocomplete]=\"'off'\" [formControl]=\"startTimeFormControl\"\r\n (blur)=\"updateStartTime($event)\">\r\n <mat-label>\u5F00\u59CB\u65F6\u95F4</mat-label>\r\n </mat-form-field>\r\n }\r\n\r\n </div>\r\n\r\n <!-- End -->\r\n <div class=\"end\">\r\n\r\n <div class=\"month\">\r\n <div class=\"month-header\">\r\n <div class=\"month-label\">{{getMonthLabel(2)}}</div>\r\n <button type=\"button\" class=\"next-button\" matIconButton tabindex=\"2\" (click)=\"next()\">\r\n <mat-icon [svgIcon]=\"'heroicons_outline:chevron-right'\"></mat-icon>\r\n </button>\r\n </div>\r\n <mat-month-view #matMonthView2 [dateFilter]=\"dateFilterFn()\" [dateClass]=\"dateClassFn()\"\r\n [activeDate]=\"activeDates().month2\" (activeDateChange)=\"onActiveDateChange(2, $event)\"\r\n (click)=\"$event.stopImmediatePropagation()\"\r\n (selectedChange)=\"onSelectedDateChange($event)\">\r\n </mat-month-view>\r\n </div>\r\n\r\n @if (timeRange()) {\r\n <mat-form-field class=\"time end-time\">\r\n <input matInput tabindex=\"4\" [formControl]=\"endTimeFormControl\" (blur)=\"updateEndTime($event)\">\r\n <mat-label>\u7ED3\u675F\u65F6\u95F4</mat-label>\r\n </mat-form-field>\r\n }\r\n\r\n </div>\r\n\r\n </ng-template>", styles: ["cmat-date-range{display:flex;width:100%}cmat-date-range .range{display:flex;width:100%;align-items:center;height:48px;min-height:48px;max-height:48px;cursor:pointer}cmat-date-range .range .start,cmat-date-range .range .end{display:flex;align-items:center;height:100%;padding:0 16px;border-radius:6px;border-width:1px;line-height:1}cmat-date-range .range .date{white-space:nowrap}cmat-date-range .range .date+.time{margin-left:8px}cmat-date-range .range .time{white-space:nowrap}cmat-date-range .separator{margin:0 auto;width:6px}.cmat-date-range-panel{border-radius:12px;padding:24px}.cmat-date-range-panel .start,.cmat-date-range-panel .end{display:flex;flex-direction:column}.cmat-date-range-panel .start .month,.cmat-date-range-panel .end .month{max-width:196px;min-width:196px;width:196px}.cmat-date-range-panel .start .month .month-header,.cmat-date-range-panel .end .month .month-header{position:relative;display:flex;align-items:center;justify-content:center;height:32px;margin-bottom:16px}.cmat-date-range-panel .start .month .month-header .previous-button,.cmat-date-range-panel .start .month .month-header .next-button,.cmat-date-range-panel .end .month .month-header .previous-button,.cmat-date-range-panel .end .month .month-header .next-button{position:absolute;width:24px!important;height:24px!important;min-height:24px!important;max-height:24px!important;line-height:24px!important}.cmat-date-range-panel .start .month .month-header .previous-button,.cmat-date-range-panel .end .month .month-header .previous-button{left:0}.cmat-date-range-panel .start .month .month-header .next-button,.cmat-date-range-panel .end .month .month-header .next-button{right:0}.cmat-date-range-panel .start .month .month-header .month-label,.cmat-date-range-panel .end .month .month-header .month-label{font-weight:500}.cmat-date-range-panel .start .month mat-month-view,.cmat-date-range-panel .end .month mat-month-view{display:flex;min-height:188px}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table,.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table{width:100%;border-collapse:collapse}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody tr[aria-hidden=true],.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody tr[aria-hidden=true]{display:none!important}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody tr:first-child td:first-child[aria-hidden=true],.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody tr:first-child td:first-child[aria-hidden=true]{visibility:hidden;pointer-events:none;opacity:0}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody tr td .mat-calendar-body-cell-content,.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody tr td .mat-calendar-body-cell-content{background-color:transparent!important}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-today,.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-today{border:none!important}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell,.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell{width:28px!important;height:28px!important;padding:2px!important}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell.cmat-date-range:before,.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell.cmat-date-range:before{content:\"\";position:absolute;inset:2px 0}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell.cmat-date-range.cmat-date-range-start:before,.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell.cmat-date-range.cmat-date-range-start:before{border-radius:999px 0 0 999px}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell.cmat-date-range.cmat-date-range-start.cmat-date-range-end:before,.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell.cmat-date-range.cmat-date-range-start.cmat-date-range-end:before{right:2px;border-radius:999px}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell.cmat-date-range.cmat-date-range-end:before,.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell.cmat-date-range.cmat-date-range-end:before{border-radius:0 999px 999px 0}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell .mat-calendar-body-cell-content,.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell .mat-calendar-body-cell-content{position:relative;top:0;left:0;width:24px;height:24px;font-size:12px}.cmat-date-range-panel .time{width:100%;max-width:196px}.cmat-date-range-panel .start{align-items:flex-start;margin-right:20px}.cmat-date-range-panel .start .month .month-label{margin-left:8px}.cmat-date-range-panel .end{align-items:flex-end;margin-left:20px}.cmat-date-range-panel .end .month .month-label{margin-right:8px}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "component", type: MatMonthView, selector: "mat-month-view", inputs: ["activeDate", "selected", "minDate", "maxDate", "dateFilter", "dateClass", "comparisonStart", "comparisonEnd", "startDateAccessibleName", "endDateAccessibleName", "activeDrag"], outputs: ["selectedChange", "_userSelection", "dragStarted", "dragEnded", "activeDateChange"], exportAs: ["matMonthView"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i5.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: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
1
|
+
import { Overlay } from "@angular/cdk/overlay";
|
|
2
|
+
import { TemplatePortal } from "@angular/cdk/portal";
|
|
3
|
+
import { NgClass } from "@angular/common";
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
import { ChangeDetectionStrategy, Component, ViewContainerRef, ViewEncapsulation, computed, effect, forwardRef, inject, input, output, signal, untracked, viewChild } from "@angular/core";
|
|
6
|
+
import * as i1 from "@angular/forms";
|
|
7
|
+
import { FormControl, FormsModule, NG_VALUE_ACCESSOR, ReactiveFormsModule, Validators } from "@angular/forms";
|
|
8
|
+
import * as i2 from "@angular/material/button";
|
|
9
|
+
import { MatButtonModule } from "@angular/material/button";
|
|
10
|
+
import { MatMonthView } from "@angular/material/datepicker";
|
|
11
|
+
import * as i4 from "@angular/material/form-field";
|
|
12
|
+
import { MatFormFieldModule } from "@angular/material/form-field";
|
|
13
|
+
import * as i3 from "@angular/material/icon";
|
|
14
|
+
import { MatIconModule } from "@angular/material/icon";
|
|
15
|
+
import * as i5 from "@angular/material/input";
|
|
16
|
+
import { MatInputModule } from "@angular/material/input";
|
|
17
|
+
import dayjs from "dayjs";
|
|
18
|
+
import isBetween from "dayjs/plugin/isBetween";
|
|
19
|
+
var CmatDateRangeComponent = class CmatDateRangeComponent {
|
|
20
|
+
constructor() {
|
|
21
|
+
this.controlClass = input("", ...ngDevMode ? [{ debugName: "controlClass" }] : /* istanbul ignore next */ []);
|
|
22
|
+
this.dateFormat = input("YYYY/MM/DD", ...ngDevMode ? [{ debugName: "dateFormat" }] : /* istanbul ignore next */ []);
|
|
23
|
+
this.timeFormat = input("HH:mm", {
|
|
24
|
+
...ngDevMode ? { debugName: "timeFormat" } : /* istanbul ignore next */ {},
|
|
25
|
+
transform: (value) => value === "12" ? "hh:mmA" : "HH:mm"
|
|
26
|
+
});
|
|
27
|
+
this.readonly = input(false, ...ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []);
|
|
28
|
+
this.timeRange = input(true, ...ngDevMode ? [{ debugName: "timeRange" }] : /* istanbul ignore next */ []);
|
|
29
|
+
this.range = input(null, ...ngDevMode ? [{ debugName: "range" }] : /* istanbul ignore next */ []);
|
|
30
|
+
this.rangeChanged = output();
|
|
31
|
+
this.activeDates = signal({
|
|
32
|
+
month1: dayjs(),
|
|
33
|
+
month2: dayjs().add(1, "month")
|
|
34
|
+
}, ...ngDevMode ? [{ debugName: "activeDates" }] : /* istanbul ignore next */ []);
|
|
35
|
+
this.setWhichDate = signal("start", ...ngDevMode ? [{ debugName: "setWhichDate" }] : /* istanbul ignore next */ []);
|
|
36
|
+
this.rangeDisplay = computed(() => {
|
|
37
|
+
const r = this._range();
|
|
38
|
+
if (r.start && r.end) {
|
|
39
|
+
const start = r.start.clone();
|
|
40
|
+
const end = r.end.clone();
|
|
41
|
+
return {
|
|
42
|
+
startDate: start.format(this.dateFormat()),
|
|
43
|
+
startTime: this.timeRange() ? start.format(this.timeFormat()) : null,
|
|
44
|
+
endDate: end.format(this.dateFormat()),
|
|
45
|
+
endTime: this.timeRange() ? end.format(this.timeFormat()) : null
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
}, ...ngDevMode ? [{ debugName: "rangeDisplay" }] : /* istanbul ignore next */ []);
|
|
49
|
+
this.dateClassFn = computed(() => {
|
|
50
|
+
const r = this._range();
|
|
51
|
+
return (date) => {
|
|
52
|
+
if (r.start && r.end) {
|
|
53
|
+
if (date.isSame(r.start, "day") && date.isSame(r.end, "day")) return [
|
|
54
|
+
"cmat-date-range",
|
|
55
|
+
"cmat-date-range-start",
|
|
56
|
+
"cmat-date-range-end"
|
|
57
|
+
];
|
|
58
|
+
if (date.isSame(r.start, "day")) return ["cmat-date-range", "cmat-date-range-start"];
|
|
59
|
+
if (date.isSame(r.end, "day")) return ["cmat-date-range", "cmat-date-range-end"];
|
|
60
|
+
if (date.isBetween(r.start, r.end, "day")) return ["cmat-date-range", "cmat-date-range-mid"];
|
|
61
|
+
} else if (r.start && date.isSame(r.start, "day")) return ["cmat-date-range", "cmat-date-range-start"];
|
|
62
|
+
return [];
|
|
63
|
+
};
|
|
64
|
+
}, ...ngDevMode ? [{ debugName: "dateClassFn" }] : /* istanbul ignore next */ []);
|
|
65
|
+
this.dateFilterFn = computed(() => {
|
|
66
|
+
const which = this.setWhichDate();
|
|
67
|
+
const r = this._range();
|
|
68
|
+
return (date) => {
|
|
69
|
+
return !(which === "end" && r.start && date.isBefore(r.start, "day"));
|
|
70
|
+
};
|
|
71
|
+
}, ...ngDevMode ? [{ debugName: "dateFilterFn" }] : /* istanbul ignore next */ []);
|
|
72
|
+
this._matMonthView1 = viewChild("matMonthView1", ...ngDevMode ? [{ debugName: "_matMonthView1" }] : /* istanbul ignore next */ []);
|
|
73
|
+
this._matMonthView2 = viewChild("matMonthView2", ...ngDevMode ? [{ debugName: "_matMonthView2" }] : /* istanbul ignore next */ []);
|
|
74
|
+
this._pickerPanelOrigin = viewChild("pickerPanelOrigin", ...ngDevMode ? [{ debugName: "_pickerPanelOrigin" }] : /* istanbul ignore next */ []);
|
|
75
|
+
this._pickerPanel = viewChild("pickerPanel", ...ngDevMode ? [{ debugName: "_pickerPanel" }] : /* istanbul ignore next */ []);
|
|
76
|
+
this._overlay = inject(Overlay);
|
|
77
|
+
this._viewContainerRef = inject(ViewContainerRef);
|
|
78
|
+
this._overlayRef = null;
|
|
79
|
+
this._range = signal({
|
|
80
|
+
start: null,
|
|
81
|
+
end: null
|
|
82
|
+
}, ...ngDevMode ? [{ debugName: "_range" }] : /* istanbul ignore next */ []);
|
|
83
|
+
this._programmaticChange = false;
|
|
84
|
+
this._rangeInputFirstRun = true;
|
|
85
|
+
this._timeRangeFirstRun = true;
|
|
86
|
+
this._emittingChange = false;
|
|
87
|
+
this._timeRegExp = /* @__PURE__ */ new RegExp("^(0[0-9]|1[0-9]|2[0-4]|[0-9]):([0-5][0-9])(A|(?:AM)|P|(?:PM))?$", "i");
|
|
88
|
+
this._onChange = () => {};
|
|
89
|
+
this._onTouched = () => {};
|
|
90
|
+
dayjs.extend(isBetween);
|
|
91
|
+
effect(() => {
|
|
92
|
+
const rangeValue = this.range();
|
|
93
|
+
if (this._rangeInputFirstRun) {
|
|
94
|
+
this._rangeInputFirstRun = false;
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
untracked(() => {
|
|
98
|
+
this._setRangeFromInput(rangeValue);
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
effect(() => {
|
|
102
|
+
const tr = this.timeRange();
|
|
103
|
+
if (this._timeRangeFirstRun) {
|
|
104
|
+
this._timeRangeFirstRun = false;
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
untracked(() => {
|
|
108
|
+
if (!tr && this._range().start && this._range().end) this._setRangeFromInput({
|
|
109
|
+
start: this._range().start.clone().startOf("day").toISOString(),
|
|
110
|
+
end: this._range().end.clone().endOf("day").toISOString()
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
registerOnChange(fn) {
|
|
116
|
+
this._onChange = fn;
|
|
117
|
+
}
|
|
118
|
+
registerOnTouched(fn) {
|
|
119
|
+
this._onTouched = fn;
|
|
120
|
+
}
|
|
121
|
+
writeValue(range) {
|
|
122
|
+
this._programmaticChange = true;
|
|
123
|
+
this._setRangeFromInput(range);
|
|
124
|
+
}
|
|
125
|
+
ngOnInit() {
|
|
126
|
+
this._init();
|
|
127
|
+
}
|
|
128
|
+
ngOnDestroy() {
|
|
129
|
+
if (this._overlayRef) {
|
|
130
|
+
this._overlayRef.dispose();
|
|
131
|
+
this._overlayRef = null;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
openPickerPanel() {
|
|
135
|
+
if (this.readonly()) return;
|
|
136
|
+
const origin = this._pickerPanelOrigin();
|
|
137
|
+
if (!origin) return;
|
|
138
|
+
const overlayRef = this._overlay.create({
|
|
139
|
+
panelClass: "cmat-date-range-panel",
|
|
140
|
+
backdropClass: "",
|
|
141
|
+
hasBackdrop: true,
|
|
142
|
+
scrollStrategy: this._overlay.scrollStrategies.reposition(),
|
|
143
|
+
positionStrategy: this._overlay.position().flexibleConnectedTo(origin).withPositions([{
|
|
144
|
+
originX: "start",
|
|
145
|
+
originY: "bottom",
|
|
146
|
+
overlayX: "start",
|
|
147
|
+
overlayY: "top",
|
|
148
|
+
offsetY: 8
|
|
149
|
+
}, {
|
|
150
|
+
originX: "start",
|
|
151
|
+
originY: "top",
|
|
152
|
+
overlayX: "start",
|
|
153
|
+
overlayY: "bottom",
|
|
154
|
+
offsetY: -8
|
|
155
|
+
}])
|
|
156
|
+
});
|
|
157
|
+
this._overlayRef = overlayRef;
|
|
158
|
+
const templatePortal = new TemplatePortal(this._pickerPanel(), this._viewContainerRef);
|
|
159
|
+
overlayRef.backdropClick().subscribe(() => {
|
|
160
|
+
if (templatePortal?.isAttached) templatePortal.detach();
|
|
161
|
+
if (overlayRef?.hasAttached()) {
|
|
162
|
+
overlayRef.detach();
|
|
163
|
+
overlayRef.dispose();
|
|
164
|
+
}
|
|
165
|
+
this._overlayRef = null;
|
|
166
|
+
});
|
|
167
|
+
overlayRef.attach(templatePortal);
|
|
168
|
+
}
|
|
169
|
+
getMonthLabel(month) {
|
|
170
|
+
const dates = this.activeDates();
|
|
171
|
+
if (month === 1) return dates.month1?.clone().format("YYYY MMMM") ?? "";
|
|
172
|
+
return dates.month2?.clone().format("YYYY MMMM") ?? "";
|
|
173
|
+
}
|
|
174
|
+
onActiveDateChange(month, date) {
|
|
175
|
+
this.activeDates.update((dates) => {
|
|
176
|
+
if (month === 1) return {
|
|
177
|
+
month1: date,
|
|
178
|
+
month2: dates.month2
|
|
179
|
+
};
|
|
180
|
+
return {
|
|
181
|
+
month1: dates.month1,
|
|
182
|
+
month2: date
|
|
183
|
+
};
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
onSelectedDateChange(date) {
|
|
187
|
+
if (!date) return;
|
|
188
|
+
const whichDate = this.setWhichDate();
|
|
189
|
+
const r = this._range();
|
|
190
|
+
const newRange = {
|
|
191
|
+
start: (whichDate === "start" ? (r.start ?? dayjs()).clone().year(date.year()).month(date.month()).date(date.date()) : r.start ?? date).toISOString(),
|
|
192
|
+
end: (whichDate === "end" ? (r.end ?? dayjs()).clone().year(date.year()).month(date.month()).date(date.date()) : r.end ?? date).toISOString(),
|
|
193
|
+
whichDate
|
|
194
|
+
};
|
|
195
|
+
this.setWhichDate.set(whichDate === "start" ? "end" : "start");
|
|
196
|
+
this._setRangeFromInput(newRange);
|
|
197
|
+
}
|
|
198
|
+
prev() {
|
|
199
|
+
this.activeDates.update((dates) => ({
|
|
200
|
+
month1: dayjs(dates.month1).subtract(1, "month"),
|
|
201
|
+
month2: dayjs(dates.month2).subtract(1, "month")
|
|
202
|
+
}));
|
|
203
|
+
}
|
|
204
|
+
next() {
|
|
205
|
+
this.activeDates.update((dates) => ({
|
|
206
|
+
month1: dayjs(dates.month1).add(1, "month"),
|
|
207
|
+
month2: dayjs(dates.month2).add(1, "month")
|
|
208
|
+
}));
|
|
209
|
+
}
|
|
210
|
+
updateStartTime(event) {
|
|
211
|
+
const value = event.target?.value ?? "";
|
|
212
|
+
const parsedTime = this._parseTime(value);
|
|
213
|
+
const formControl = this.startTimeFormControl;
|
|
214
|
+
if (formControl?.invalid) {
|
|
215
|
+
const r = this._range();
|
|
216
|
+
if (r.start) formControl.setValue(r.start.clone().format(this.timeFormat()));
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
const r = this._range();
|
|
220
|
+
if (r.start && r.end) {
|
|
221
|
+
let startDate = r.start.clone().hour(parsedTime.hour()).minute(parsedTime.minute());
|
|
222
|
+
if (startDate.isAfter(r.end)) {
|
|
223
|
+
const endDateHours = r.end.hour();
|
|
224
|
+
const endDateMinutes = r.end.minute();
|
|
225
|
+
startDate.hour(endDateHours).minute(endDateMinutes);
|
|
226
|
+
}
|
|
227
|
+
this._setRangeFromInput({
|
|
228
|
+
start: startDate.toISOString(),
|
|
229
|
+
end: r.end.clone().toISOString(),
|
|
230
|
+
whichDate: "start"
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
updateEndTime(event) {
|
|
235
|
+
const value = event.target?.value ?? "";
|
|
236
|
+
const parsedTime = this._parseTime(value);
|
|
237
|
+
const formControl = this.endTimeFormControl;
|
|
238
|
+
if (formControl?.invalid) {
|
|
239
|
+
const r = this._range();
|
|
240
|
+
if (r.end) formControl.setValue(r.end.clone().format(this.timeFormat()));
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
const r = this._range();
|
|
244
|
+
if (r.start && r.end) {
|
|
245
|
+
let endDate = r.end.clone().hour(parsedTime.hour()).minute(parsedTime.minute());
|
|
246
|
+
if (endDate.isBefore(r.start)) {
|
|
247
|
+
const startDateHours = r.start.hour();
|
|
248
|
+
const startDateMinutes = r.start.minute();
|
|
249
|
+
endDate.hour(startDateHours).minute(startDateMinutes);
|
|
250
|
+
}
|
|
251
|
+
this._setRangeFromInput({
|
|
252
|
+
start: r.start.clone().toISOString(),
|
|
253
|
+
end: endDate.toISOString(),
|
|
254
|
+
whichDate: "end"
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
_setRangeFromInput(value) {
|
|
259
|
+
if (!(value?.start && value.end)) {
|
|
260
|
+
this._range.set({
|
|
261
|
+
start: null,
|
|
262
|
+
end: null
|
|
263
|
+
});
|
|
264
|
+
this.activeDates.set({
|
|
265
|
+
month1: dayjs(),
|
|
266
|
+
month2: dayjs().add(1, "month")
|
|
267
|
+
});
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
const whichDate = value.whichDate ?? null;
|
|
271
|
+
const start = dayjs(value.start);
|
|
272
|
+
const end = dayjs(value.end);
|
|
273
|
+
const currentRange = this._range();
|
|
274
|
+
let newStart = currentRange.start;
|
|
275
|
+
let newEnd = currentRange.end;
|
|
276
|
+
if (whichDate === "start") {
|
|
277
|
+
newStart = start.clone();
|
|
278
|
+
if (newEnd && newStart.isAfter(newEnd)) {
|
|
279
|
+
newEnd = start.clone().hour(newEnd.hour()).minute(newEnd.minute()).second(newEnd.second());
|
|
280
|
+
if (!newStart.isBefore(newEnd)) newEnd = start.clone();
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
if (whichDate === "end") {
|
|
284
|
+
newEnd = end.clone();
|
|
285
|
+
if (newStart?.isAfter(newEnd)) {
|
|
286
|
+
newStart = end.clone().hour(newStart.hour()).minute(newStart.minute()).second(newStart.second());
|
|
287
|
+
if (!newEnd.isAfter(newStart)) newStart = end.clone();
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
if (!whichDate) {
|
|
291
|
+
newStart = start.clone();
|
|
292
|
+
newEnd = start.isBefore(end) ? end.clone() : start.clone();
|
|
293
|
+
}
|
|
294
|
+
this._range.set({
|
|
295
|
+
start: newStart,
|
|
296
|
+
end: newEnd
|
|
297
|
+
});
|
|
298
|
+
if (newStart && newEnd) {
|
|
299
|
+
const rangeOutput = {
|
|
300
|
+
start: newStart.toISOString(),
|
|
301
|
+
end: newEnd.toISOString()
|
|
302
|
+
};
|
|
303
|
+
if (!this._programmaticChange && !this._emittingChange) {
|
|
304
|
+
this._emittingChange = true;
|
|
305
|
+
try {
|
|
306
|
+
this.rangeChanged.emit(rangeOutput);
|
|
307
|
+
this._onTouched();
|
|
308
|
+
this._onChange(rangeOutput);
|
|
309
|
+
} finally {
|
|
310
|
+
setTimeout(() => {
|
|
311
|
+
this._emittingChange = false;
|
|
312
|
+
}, 0);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
this.activeDates.set({
|
|
316
|
+
month1: newStart.clone(),
|
|
317
|
+
month2: newStart.clone().add(1, "month")
|
|
318
|
+
});
|
|
319
|
+
const timeFmt = this.timeFormat();
|
|
320
|
+
const startCtrl = this.startTimeFormControl;
|
|
321
|
+
const endCtrl = this.endTimeFormControl;
|
|
322
|
+
if (startCtrl && startCtrl.value !== newStart.clone().format(timeFmt)) startCtrl.setValue(newStart.clone().format(timeFmt));
|
|
323
|
+
if (endCtrl && endCtrl.value !== newEnd.clone().format(timeFmt)) endCtrl.setValue(newEnd.clone().format(timeFmt));
|
|
324
|
+
}
|
|
325
|
+
const matMonthView1 = this._matMonthView1();
|
|
326
|
+
const matMonthView2 = this._matMonthView2();
|
|
327
|
+
if (matMonthView1 && matMonthView2) {
|
|
328
|
+
const newDateClassFn = this.dateClassFn();
|
|
329
|
+
const newDateFilterFn = this.dateFilterFn();
|
|
330
|
+
matMonthView1.dateClass = newDateClassFn;
|
|
331
|
+
matMonthView2.dateClass = newDateClassFn;
|
|
332
|
+
matMonthView1.dateFilter = newDateFilterFn;
|
|
333
|
+
matMonthView2.dateFilter = newDateFilterFn;
|
|
334
|
+
matMonthView1.ngAfterContentInit();
|
|
335
|
+
matMonthView2.ngAfterContentInit();
|
|
336
|
+
}
|
|
337
|
+
this._programmaticChange = false;
|
|
338
|
+
}
|
|
339
|
+
_init() {
|
|
340
|
+
this.startTimeFormControl = new FormControl("", [Validators.pattern(this._timeRegExp)]);
|
|
341
|
+
this.endTimeFormControl = new FormControl("", [Validators.pattern(this._timeRegExp)]);
|
|
342
|
+
this._programmaticChange = true;
|
|
343
|
+
const rangeValue = this.range();
|
|
344
|
+
if (rangeValue) this._setRangeFromInput(rangeValue);
|
|
345
|
+
else this._setRangeFromInput({
|
|
346
|
+
start: dayjs().startOf("day").toISOString(),
|
|
347
|
+
end: dayjs().add(1, "day").endOf("day").toISOString()
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
_parseTime(value) {
|
|
351
|
+
if (value.split(this._timeRegExp).filter((part) => part !== "")[2] || null) return dayjs(value, "hh:mmA").second(0);
|
|
352
|
+
return dayjs(value, "HH:mm").second(0);
|
|
353
|
+
}
|
|
354
|
+
static {
|
|
355
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
356
|
+
minVersion: "12.0.0",
|
|
357
|
+
version: "22.2.3",
|
|
358
|
+
ngImport: i0,
|
|
359
|
+
type: CmatDateRangeComponent,
|
|
360
|
+
deps: [],
|
|
361
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
static {
|
|
365
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
366
|
+
minVersion: "17.0.0",
|
|
367
|
+
version: "22.2.3",
|
|
368
|
+
type: CmatDateRangeComponent,
|
|
369
|
+
isStandalone: true,
|
|
370
|
+
selector: "cmat-date-range",
|
|
371
|
+
inputs: {
|
|
372
|
+
controlClass: {
|
|
373
|
+
classPropertyName: "controlClass",
|
|
374
|
+
publicName: "controlClass",
|
|
375
|
+
isSignal: true,
|
|
376
|
+
isRequired: false,
|
|
377
|
+
transformFunction: null
|
|
378
|
+
},
|
|
379
|
+
dateFormat: {
|
|
380
|
+
classPropertyName: "dateFormat",
|
|
381
|
+
publicName: "dateFormat",
|
|
382
|
+
isSignal: true,
|
|
383
|
+
isRequired: false,
|
|
384
|
+
transformFunction: null
|
|
385
|
+
},
|
|
386
|
+
timeFormat: {
|
|
387
|
+
classPropertyName: "timeFormat",
|
|
388
|
+
publicName: "timeFormat",
|
|
389
|
+
isSignal: true,
|
|
390
|
+
isRequired: false,
|
|
391
|
+
transformFunction: null
|
|
392
|
+
},
|
|
393
|
+
readonly: {
|
|
394
|
+
classPropertyName: "readonly",
|
|
395
|
+
publicName: "readonly",
|
|
396
|
+
isSignal: true,
|
|
397
|
+
isRequired: false,
|
|
398
|
+
transformFunction: null
|
|
399
|
+
},
|
|
400
|
+
timeRange: {
|
|
401
|
+
classPropertyName: "timeRange",
|
|
402
|
+
publicName: "timeRange",
|
|
403
|
+
isSignal: true,
|
|
404
|
+
isRequired: false,
|
|
405
|
+
transformFunction: null
|
|
406
|
+
},
|
|
407
|
+
range: {
|
|
408
|
+
classPropertyName: "range",
|
|
409
|
+
publicName: "range",
|
|
410
|
+
isSignal: true,
|
|
411
|
+
isRequired: false,
|
|
412
|
+
transformFunction: null
|
|
413
|
+
}
|
|
414
|
+
},
|
|
415
|
+
outputs: { rangeChanged: "rangeChanged" },
|
|
416
|
+
providers: [{
|
|
417
|
+
provide: NG_VALUE_ACCESSOR,
|
|
418
|
+
useExisting: forwardRef(() => CmatDateRangeComponent),
|
|
419
|
+
multi: true
|
|
420
|
+
}],
|
|
421
|
+
viewQueries: [
|
|
422
|
+
{
|
|
423
|
+
propertyName: "_matMonthView1",
|
|
424
|
+
first: true,
|
|
425
|
+
predicate: ["matMonthView1"],
|
|
426
|
+
descendants: true,
|
|
427
|
+
isSignal: true
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
propertyName: "_matMonthView2",
|
|
431
|
+
first: true,
|
|
432
|
+
predicate: ["matMonthView2"],
|
|
433
|
+
descendants: true,
|
|
434
|
+
isSignal: true
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
propertyName: "_pickerPanelOrigin",
|
|
438
|
+
first: true,
|
|
439
|
+
predicate: ["pickerPanelOrigin"],
|
|
440
|
+
descendants: true,
|
|
441
|
+
isSignal: true
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
propertyName: "_pickerPanel",
|
|
445
|
+
first: true,
|
|
446
|
+
predicate: ["pickerPanel"],
|
|
447
|
+
descendants: true,
|
|
448
|
+
isSignal: true
|
|
449
|
+
}
|
|
450
|
+
],
|
|
451
|
+
exportAs: ["cmatDateRange"],
|
|
452
|
+
ngImport: i0,
|
|
453
|
+
template: "<div #pickerPanelOrigin role=\"presentation\" class=\"range\" (click)=\"openPickerPanel()\">\r\n\r\n <div class=\"start\" [ngClass]=\"controlClass()\">\r\n <div class=\"date\">{{rangeDisplay()?.startDate}}</div>\r\n @if (rangeDisplay()?.startTime) {\r\n <div class=\"time\">{{rangeDisplay()?.startTime}}</div>\r\n }\r\n </div>\r\n\r\n <div class=\"separator\">-</div>\r\n\r\n <div class=\"end\" [ngClass]=\"controlClass()\">\r\n <div class=\"date\">{{rangeDisplay()?.endDate}}</div>\r\n @if (rangeDisplay()?.endTime) {\r\n <div class=\"time\">{{rangeDisplay()?.endTime}}</div>\r\n }\r\n </div>\r\n\r\n</div>\r\n\r\n<ng-template #pickerPanel>\r\n\r\n <!-- Start -->\r\n <div class=\"start\">\r\n\r\n <div class=\"month\">\r\n <div class=\"month-header\">\r\n <button type=\"button\" class=\"previous-button\" matIconButton tabindex=\"1\" (click)=\"prev()\">\r\n <mat-icon [svgIcon]=\"'heroicons_outline:chevron-left'\"></mat-icon>\r\n </button>\r\n <div class=\"month-label\">{{getMonthLabel(1)}}</div>\r\n </div>\r\n <mat-month-view #matMonthView1 [dateFilter]=\"dateFilterFn()\" [dateClass]=\"dateClassFn()\"\r\n [activeDate]=\"activeDates().month1\" (activeDateChange)=\"onActiveDateChange(1, $event)\"\r\n (click)=\"$event.stopImmediatePropagation()\"\r\n (selectedChange)=\"onSelectedDateChange($event)\">\r\n </mat-month-view>\r\n </div>\r\n\r\n @if (timeRange()) {\r\n <mat-form-field class=\"time start-time\">\r\n <input matInput tabindex=\"3\" [autocomplete]=\"'off'\" [formControl]=\"startTimeFormControl\"\r\n (blur)=\"updateStartTime($event)\">\r\n <mat-label>开始时间</mat-label>\r\n </mat-form-field>\r\n }\r\n\r\n </div>\r\n\r\n <!-- End -->\r\n <div class=\"end\">\r\n\r\n <div class=\"month\">\r\n <div class=\"month-header\">\r\n <div class=\"month-label\">{{getMonthLabel(2)}}</div>\r\n <button type=\"button\" class=\"next-button\" matIconButton tabindex=\"2\" (click)=\"next()\">\r\n <mat-icon [svgIcon]=\"'heroicons_outline:chevron-right'\"></mat-icon>\r\n </button>\r\n </div>\r\n <mat-month-view #matMonthView2 [dateFilter]=\"dateFilterFn()\" [dateClass]=\"dateClassFn()\"\r\n [activeDate]=\"activeDates().month2\" (activeDateChange)=\"onActiveDateChange(2, $event)\"\r\n (click)=\"$event.stopImmediatePropagation()\"\r\n (selectedChange)=\"onSelectedDateChange($event)\">\r\n </mat-month-view>\r\n </div>\r\n\r\n @if (timeRange()) {\r\n <mat-form-field class=\"time end-time\">\r\n <input matInput tabindex=\"4\" [formControl]=\"endTimeFormControl\" (blur)=\"updateEndTime($event)\">\r\n <mat-label>结束时间</mat-label>\r\n </mat-form-field>\r\n }\r\n\r\n </div>\r\n\r\n </ng-template>",
|
|
454
|
+
styles: ["cmat-date-range{display:flex;width:100%}cmat-date-range .range{display:flex;width:100%;align-items:center;height:48px;min-height:48px;max-height:48px;cursor:pointer}cmat-date-range .range .start,cmat-date-range .range .end{display:flex;align-items:center;height:100%;padding:0 16px;border-radius:6px;border-width:1px;line-height:1}cmat-date-range .range .date{white-space:nowrap}cmat-date-range .range .date+.time{margin-left:8px}cmat-date-range .range .time{white-space:nowrap}cmat-date-range .separator{margin:0 auto;width:6px}.cmat-date-range-panel{border-radius:12px;padding:24px}.cmat-date-range-panel .start,.cmat-date-range-panel .end{display:flex;flex-direction:column}.cmat-date-range-panel .start .month,.cmat-date-range-panel .end .month{max-width:196px;min-width:196px;width:196px}.cmat-date-range-panel .start .month .month-header,.cmat-date-range-panel .end .month .month-header{position:relative;display:flex;align-items:center;justify-content:center;height:32px;margin-bottom:16px}.cmat-date-range-panel .start .month .month-header .previous-button,.cmat-date-range-panel .start .month .month-header .next-button,.cmat-date-range-panel .end .month .month-header .previous-button,.cmat-date-range-panel .end .month .month-header .next-button{position:absolute;width:24px!important;height:24px!important;min-height:24px!important;max-height:24px!important;line-height:24px!important}.cmat-date-range-panel .start .month .month-header .previous-button,.cmat-date-range-panel .end .month .month-header .previous-button{left:0}.cmat-date-range-panel .start .month .month-header .next-button,.cmat-date-range-panel .end .month .month-header .next-button{right:0}.cmat-date-range-panel .start .month .month-header .month-label,.cmat-date-range-panel .end .month .month-header .month-label{font-weight:500}.cmat-date-range-panel .start .month mat-month-view,.cmat-date-range-panel .end .month mat-month-view{display:flex;min-height:188px}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table,.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table{width:100%;border-collapse:collapse}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody tr[aria-hidden=true],.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody tr[aria-hidden=true]{display:none!important}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody tr:first-child td:first-child[aria-hidden=true],.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody tr:first-child td:first-child[aria-hidden=true]{visibility:hidden;pointer-events:none;opacity:0}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody tr td .mat-calendar-body-cell-content,.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody tr td .mat-calendar-body-cell-content{background-color:transparent!important}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-today,.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-today{border:none!important}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell,.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell{width:28px!important;height:28px!important;padding:2px!important}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell.cmat-date-range:before,.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell.cmat-date-range:before{content:\"\";position:absolute;inset:2px 0}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell.cmat-date-range.cmat-date-range-start:before,.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell.cmat-date-range.cmat-date-range-start:before{border-radius:999px 0 0 999px}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell.cmat-date-range.cmat-date-range-start.cmat-date-range-end:before,.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell.cmat-date-range.cmat-date-range-start.cmat-date-range-end:before{right:2px;border-radius:999px}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell.cmat-date-range.cmat-date-range-end:before,.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell.cmat-date-range.cmat-date-range-end:before{border-radius:0 999px 999px 0}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell .mat-calendar-body-cell-content,.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell .mat-calendar-body-cell-content{position:relative;top:0;left:0;width:24px;height:24px;font-size:12px}.cmat-date-range-panel .time{width:100%;max-width:196px}.cmat-date-range-panel .start{align-items:flex-start;margin-right:20px}.cmat-date-range-panel .start .month .month-label{margin-left:8px}.cmat-date-range-panel .end{align-items:flex-end;margin-left:20px}.cmat-date-range-panel .end .month .month-label{margin-right:8px}\n"],
|
|
455
|
+
dependencies: [
|
|
456
|
+
{
|
|
457
|
+
kind: "ngmodule",
|
|
458
|
+
type: FormsModule
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
kind: "directive",
|
|
462
|
+
type: i1.DefaultValueAccessor,
|
|
463
|
+
selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
kind: "directive",
|
|
467
|
+
type: i1.NgControlStatus,
|
|
468
|
+
selector: "[formControlName],[ngModel],[formControl]"
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
kind: "ngmodule",
|
|
472
|
+
type: ReactiveFormsModule
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
kind: "directive",
|
|
476
|
+
type: i1.FormControlDirective,
|
|
477
|
+
selector: "[formControl]",
|
|
478
|
+
inputs: [
|
|
479
|
+
"formControl",
|
|
480
|
+
"disabled",
|
|
481
|
+
"ngModel"
|
|
482
|
+
],
|
|
483
|
+
outputs: ["ngModelChange"],
|
|
484
|
+
exportAs: ["ngForm"]
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
kind: "ngmodule",
|
|
488
|
+
type: MatButtonModule
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
kind: "component",
|
|
492
|
+
type: i2.MatIconButton,
|
|
493
|
+
selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]",
|
|
494
|
+
exportAs: ["matButton", "matAnchor"]
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
kind: "ngmodule",
|
|
498
|
+
type: MatIconModule
|
|
499
|
+
},
|
|
500
|
+
{
|
|
501
|
+
kind: "component",
|
|
502
|
+
type: i3.MatIcon,
|
|
503
|
+
selector: "mat-icon",
|
|
504
|
+
inputs: [
|
|
505
|
+
"color",
|
|
506
|
+
"inline",
|
|
507
|
+
"svgIcon",
|
|
508
|
+
"fontSet",
|
|
509
|
+
"fontIcon"
|
|
510
|
+
],
|
|
511
|
+
exportAs: ["matIcon"]
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
kind: "ngmodule",
|
|
515
|
+
type: MatFormFieldModule
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
kind: "component",
|
|
519
|
+
type: i4.MatFormField,
|
|
520
|
+
selector: "mat-form-field",
|
|
521
|
+
inputs: [
|
|
522
|
+
"hideRequiredMarker",
|
|
523
|
+
"color",
|
|
524
|
+
"floatLabel",
|
|
525
|
+
"appearance",
|
|
526
|
+
"subscriptSizing",
|
|
527
|
+
"hintLabel"
|
|
528
|
+
],
|
|
529
|
+
exportAs: ["matFormField"]
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
kind: "directive",
|
|
533
|
+
type: i4.MatLabel,
|
|
534
|
+
selector: "mat-label"
|
|
535
|
+
},
|
|
536
|
+
{
|
|
537
|
+
kind: "component",
|
|
538
|
+
type: MatMonthView,
|
|
539
|
+
selector: "mat-month-view",
|
|
540
|
+
inputs: [
|
|
541
|
+
"activeDate",
|
|
542
|
+
"selected",
|
|
543
|
+
"minDate",
|
|
544
|
+
"maxDate",
|
|
545
|
+
"dateFilter",
|
|
546
|
+
"dateClass",
|
|
547
|
+
"comparisonStart",
|
|
548
|
+
"comparisonEnd",
|
|
549
|
+
"startDateAccessibleName",
|
|
550
|
+
"endDateAccessibleName",
|
|
551
|
+
"activeDrag"
|
|
552
|
+
],
|
|
553
|
+
outputs: [
|
|
554
|
+
"selectedChange",
|
|
555
|
+
"_userSelection",
|
|
556
|
+
"dragStarted",
|
|
557
|
+
"dragEnded",
|
|
558
|
+
"activeDateChange"
|
|
559
|
+
],
|
|
560
|
+
exportAs: ["matMonthView"]
|
|
561
|
+
},
|
|
562
|
+
{
|
|
563
|
+
kind: "ngmodule",
|
|
564
|
+
type: MatInputModule
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
kind: "directive",
|
|
568
|
+
type: i5.MatInput,
|
|
569
|
+
selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]",
|
|
570
|
+
inputs: [
|
|
571
|
+
"disabled",
|
|
572
|
+
"id",
|
|
573
|
+
"placeholder",
|
|
574
|
+
"name",
|
|
575
|
+
"required",
|
|
576
|
+
"type",
|
|
577
|
+
"errorStateMatcher",
|
|
578
|
+
"aria-describedby",
|
|
579
|
+
"value",
|
|
580
|
+
"readonly",
|
|
581
|
+
"disabledInteractive"
|
|
582
|
+
],
|
|
583
|
+
exportAs: ["matInput"]
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
kind: "directive",
|
|
587
|
+
type: NgClass,
|
|
588
|
+
selector: "[ngClass]",
|
|
589
|
+
inputs: ["class", "ngClass"]
|
|
590
|
+
}
|
|
591
|
+
],
|
|
592
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
593
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
594
|
+
});
|
|
595
|
+
}
|
|
596
|
+
};
|
|
597
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
598
|
+
minVersion: "12.0.0",
|
|
599
|
+
version: "22.2.3",
|
|
600
|
+
ngImport: i0,
|
|
601
|
+
type: CmatDateRangeComponent,
|
|
602
|
+
decorators: [{
|
|
603
|
+
type: Component,
|
|
604
|
+
args: [{
|
|
605
|
+
selector: "cmat-date-range",
|
|
606
|
+
encapsulation: ViewEncapsulation.None,
|
|
607
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
608
|
+
exportAs: "cmatDateRange",
|
|
609
|
+
providers: [{
|
|
610
|
+
provide: NG_VALUE_ACCESSOR,
|
|
611
|
+
useExisting: forwardRef(() => CmatDateRangeComponent),
|
|
612
|
+
multi: true
|
|
613
|
+
}],
|
|
614
|
+
imports: [
|
|
615
|
+
FormsModule,
|
|
616
|
+
ReactiveFormsModule,
|
|
617
|
+
MatButtonModule,
|
|
618
|
+
MatIconModule,
|
|
619
|
+
MatFormFieldModule,
|
|
620
|
+
MatMonthView,
|
|
621
|
+
MatInputModule,
|
|
622
|
+
NgClass
|
|
623
|
+
],
|
|
624
|
+
template: "<div #pickerPanelOrigin role=\"presentation\" class=\"range\" (click)=\"openPickerPanel()\">\r\n\r\n <div class=\"start\" [ngClass]=\"controlClass()\">\r\n <div class=\"date\">{{rangeDisplay()?.startDate}}</div>\r\n @if (rangeDisplay()?.startTime) {\r\n <div class=\"time\">{{rangeDisplay()?.startTime}}</div>\r\n }\r\n </div>\r\n\r\n <div class=\"separator\">-</div>\r\n\r\n <div class=\"end\" [ngClass]=\"controlClass()\">\r\n <div class=\"date\">{{rangeDisplay()?.endDate}}</div>\r\n @if (rangeDisplay()?.endTime) {\r\n <div class=\"time\">{{rangeDisplay()?.endTime}}</div>\r\n }\r\n </div>\r\n\r\n</div>\r\n\r\n<ng-template #pickerPanel>\r\n\r\n <!-- Start -->\r\n <div class=\"start\">\r\n\r\n <div class=\"month\">\r\n <div class=\"month-header\">\r\n <button type=\"button\" class=\"previous-button\" matIconButton tabindex=\"1\" (click)=\"prev()\">\r\n <mat-icon [svgIcon]=\"'heroicons_outline:chevron-left'\"></mat-icon>\r\n </button>\r\n <div class=\"month-label\">{{getMonthLabel(1)}}</div>\r\n </div>\r\n <mat-month-view #matMonthView1 [dateFilter]=\"dateFilterFn()\" [dateClass]=\"dateClassFn()\"\r\n [activeDate]=\"activeDates().month1\" (activeDateChange)=\"onActiveDateChange(1, $event)\"\r\n (click)=\"$event.stopImmediatePropagation()\"\r\n (selectedChange)=\"onSelectedDateChange($event)\">\r\n </mat-month-view>\r\n </div>\r\n\r\n @if (timeRange()) {\r\n <mat-form-field class=\"time start-time\">\r\n <input matInput tabindex=\"3\" [autocomplete]=\"'off'\" [formControl]=\"startTimeFormControl\"\r\n (blur)=\"updateStartTime($event)\">\r\n <mat-label>开始时间</mat-label>\r\n </mat-form-field>\r\n }\r\n\r\n </div>\r\n\r\n <!-- End -->\r\n <div class=\"end\">\r\n\r\n <div class=\"month\">\r\n <div class=\"month-header\">\r\n <div class=\"month-label\">{{getMonthLabel(2)}}</div>\r\n <button type=\"button\" class=\"next-button\" matIconButton tabindex=\"2\" (click)=\"next()\">\r\n <mat-icon [svgIcon]=\"'heroicons_outline:chevron-right'\"></mat-icon>\r\n </button>\r\n </div>\r\n <mat-month-view #matMonthView2 [dateFilter]=\"dateFilterFn()\" [dateClass]=\"dateClassFn()\"\r\n [activeDate]=\"activeDates().month2\" (activeDateChange)=\"onActiveDateChange(2, $event)\"\r\n (click)=\"$event.stopImmediatePropagation()\"\r\n (selectedChange)=\"onSelectedDateChange($event)\">\r\n </mat-month-view>\r\n </div>\r\n\r\n @if (timeRange()) {\r\n <mat-form-field class=\"time end-time\">\r\n <input matInput tabindex=\"4\" [formControl]=\"endTimeFormControl\" (blur)=\"updateEndTime($event)\">\r\n <mat-label>结束时间</mat-label>\r\n </mat-form-field>\r\n }\r\n\r\n </div>\r\n\r\n </ng-template>",
|
|
625
|
+
styles: ["cmat-date-range{display:flex;width:100%}cmat-date-range .range{display:flex;width:100%;align-items:center;height:48px;min-height:48px;max-height:48px;cursor:pointer}cmat-date-range .range .start,cmat-date-range .range .end{display:flex;align-items:center;height:100%;padding:0 16px;border-radius:6px;border-width:1px;line-height:1}cmat-date-range .range .date{white-space:nowrap}cmat-date-range .range .date+.time{margin-left:8px}cmat-date-range .range .time{white-space:nowrap}cmat-date-range .separator{margin:0 auto;width:6px}.cmat-date-range-panel{border-radius:12px;padding:24px}.cmat-date-range-panel .start,.cmat-date-range-panel .end{display:flex;flex-direction:column}.cmat-date-range-panel .start .month,.cmat-date-range-panel .end .month{max-width:196px;min-width:196px;width:196px}.cmat-date-range-panel .start .month .month-header,.cmat-date-range-panel .end .month .month-header{position:relative;display:flex;align-items:center;justify-content:center;height:32px;margin-bottom:16px}.cmat-date-range-panel .start .month .month-header .previous-button,.cmat-date-range-panel .start .month .month-header .next-button,.cmat-date-range-panel .end .month .month-header .previous-button,.cmat-date-range-panel .end .month .month-header .next-button{position:absolute;width:24px!important;height:24px!important;min-height:24px!important;max-height:24px!important;line-height:24px!important}.cmat-date-range-panel .start .month .month-header .previous-button,.cmat-date-range-panel .end .month .month-header .previous-button{left:0}.cmat-date-range-panel .start .month .month-header .next-button,.cmat-date-range-panel .end .month .month-header .next-button{right:0}.cmat-date-range-panel .start .month .month-header .month-label,.cmat-date-range-panel .end .month .month-header .month-label{font-weight:500}.cmat-date-range-panel .start .month mat-month-view,.cmat-date-range-panel .end .month mat-month-view{display:flex;min-height:188px}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table,.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table{width:100%;border-collapse:collapse}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody tr[aria-hidden=true],.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody tr[aria-hidden=true]{display:none!important}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody tr:first-child td:first-child[aria-hidden=true],.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody tr:first-child td:first-child[aria-hidden=true]{visibility:hidden;pointer-events:none;opacity:0}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody tr td .mat-calendar-body-cell-content,.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody tr td .mat-calendar-body-cell-content{background-color:transparent!important}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-today,.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-today{border:none!important}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell,.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell{width:28px!important;height:28px!important;padding:2px!important}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell.cmat-date-range:before,.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell.cmat-date-range:before{content:\"\";position:absolute;inset:2px 0}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell.cmat-date-range.cmat-date-range-start:before,.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell.cmat-date-range.cmat-date-range-start:before{border-radius:999px 0 0 999px}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell.cmat-date-range.cmat-date-range-start.cmat-date-range-end:before,.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell.cmat-date-range.cmat-date-range-start.cmat-date-range-end:before{right:2px;border-radius:999px}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell.cmat-date-range.cmat-date-range-end:before,.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell.cmat-date-range.cmat-date-range-end:before{border-radius:0 999px 999px 0}.cmat-date-range-panel .start .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell .mat-calendar-body-cell-content,.cmat-date-range-panel .end .month mat-month-view .mat-calendar-table tbody .mat-calendar-body-cell .mat-calendar-body-cell-content{position:relative;top:0;left:0;width:24px;height:24px;font-size:12px}.cmat-date-range-panel .time{width:100%;max-width:196px}.cmat-date-range-panel .start{align-items:flex-start;margin-right:20px}.cmat-date-range-panel .start .month .month-label{margin-left:8px}.cmat-date-range-panel .end{align-items:flex-end;margin-left:20px}.cmat-date-range-panel .end .month .month-label{margin-right:8px}\n"]
|
|
626
|
+
}]
|
|
627
|
+
}],
|
|
628
|
+
ctorParameters: () => [],
|
|
629
|
+
propDecorators: {
|
|
630
|
+
controlClass: [{
|
|
631
|
+
type: i0.Input,
|
|
632
|
+
args: [{
|
|
633
|
+
isSignal: true,
|
|
634
|
+
alias: "controlClass",
|
|
635
|
+
required: false
|
|
636
|
+
}]
|
|
637
|
+
}],
|
|
638
|
+
dateFormat: [{
|
|
639
|
+
type: i0.Input,
|
|
640
|
+
args: [{
|
|
641
|
+
isSignal: true,
|
|
642
|
+
alias: "dateFormat",
|
|
643
|
+
required: false
|
|
644
|
+
}]
|
|
645
|
+
}],
|
|
646
|
+
timeFormat: [{
|
|
647
|
+
type: i0.Input,
|
|
648
|
+
args: [{
|
|
649
|
+
isSignal: true,
|
|
650
|
+
alias: "timeFormat",
|
|
651
|
+
required: false
|
|
652
|
+
}]
|
|
653
|
+
}],
|
|
654
|
+
readonly: [{
|
|
655
|
+
type: i0.Input,
|
|
656
|
+
args: [{
|
|
657
|
+
isSignal: true,
|
|
658
|
+
alias: "readonly",
|
|
659
|
+
required: false
|
|
660
|
+
}]
|
|
661
|
+
}],
|
|
662
|
+
timeRange: [{
|
|
663
|
+
type: i0.Input,
|
|
664
|
+
args: [{
|
|
665
|
+
isSignal: true,
|
|
666
|
+
alias: "timeRange",
|
|
667
|
+
required: false
|
|
668
|
+
}]
|
|
669
|
+
}],
|
|
670
|
+
range: [{
|
|
671
|
+
type: i0.Input,
|
|
672
|
+
args: [{
|
|
673
|
+
isSignal: true,
|
|
674
|
+
alias: "range",
|
|
675
|
+
required: false
|
|
676
|
+
}]
|
|
677
|
+
}],
|
|
678
|
+
rangeChanged: [{
|
|
679
|
+
type: i0.Output,
|
|
680
|
+
args: ["rangeChanged"]
|
|
681
|
+
}],
|
|
682
|
+
_matMonthView1: [{
|
|
683
|
+
type: i0.ViewChild,
|
|
684
|
+
args: ["matMonthView1", { isSignal: true }]
|
|
685
|
+
}],
|
|
686
|
+
_matMonthView2: [{
|
|
687
|
+
type: i0.ViewChild,
|
|
688
|
+
args: ["matMonthView2", { isSignal: true }]
|
|
689
|
+
}],
|
|
690
|
+
_pickerPanelOrigin: [{
|
|
691
|
+
type: i0.ViewChild,
|
|
692
|
+
args: ["pickerPanelOrigin", { isSignal: true }]
|
|
693
|
+
}],
|
|
694
|
+
_pickerPanel: [{
|
|
695
|
+
type: i0.ViewChild,
|
|
696
|
+
args: ["pickerPanel", { isSignal: true }]
|
|
697
|
+
}]
|
|
698
|
+
}
|
|
699
|
+
});
|
|
456
700
|
export { CmatDateRangeComponent };
|
|
457
|
-
|
|
701
|
+
|
|
702
|
+
//# sourceMappingURL=cmat-components-date-range.mjs.map
|