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,536 +1,868 @@
|
|
|
1
|
-
import { NgClass, NgStyle
|
|
2
|
-
import * as i0 from
|
|
3
|
-
import {
|
|
4
|
-
import * as i5 from
|
|
5
|
-
import { MatButtonModule } from
|
|
6
|
-
import * as i2 from
|
|
7
|
-
import { MatFormFieldModule } from
|
|
8
|
-
import * as i1 from
|
|
9
|
-
import { MatIconModule } from
|
|
10
|
-
import * as i3 from
|
|
11
|
-
import { MatInputModule } from
|
|
12
|
-
import * as i4 from
|
|
13
|
-
import { MatSelectModule } from
|
|
14
|
-
import { CmatDigitOnlyDirective } from
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
1
|
+
import { DecimalPipe, NgClass, NgStyle } from "@angular/common";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { ChangeDetectionStrategy, Component, DestroyRef, Directive, ElementRef, Injectable, Injector, Pipe, ViewEncapsulation, afterNextRender, computed, effect, inject, input, output, signal, untracked } from "@angular/core";
|
|
4
|
+
import * as i5 from "@angular/material/button";
|
|
5
|
+
import { MatButtonModule } from "@angular/material/button";
|
|
6
|
+
import * as i2 from "@angular/material/form-field";
|
|
7
|
+
import { MatFormFieldModule } from "@angular/material/form-field";
|
|
8
|
+
import * as i1 from "@angular/material/icon";
|
|
9
|
+
import { MatIconModule } from "@angular/material/icon";
|
|
10
|
+
import * as i3 from "@angular/material/input";
|
|
11
|
+
import { MatInputModule } from "@angular/material/input";
|
|
12
|
+
import * as i4 from "@angular/material/select";
|
|
13
|
+
import { MatSelectModule } from "@angular/material/select";
|
|
14
|
+
import { CmatDigitOnlyDirective } from "cmat/directives/digit-only";
|
|
15
|
+
var CmatPaginationService = class CmatPaginationService {
|
|
16
|
+
constructor() {
|
|
17
|
+
this._instances = signal({}, ...ngDevMode ? [{ debugName: "_instances" }] : /* istanbul ignore next */ []);
|
|
18
|
+
this.instances = this._instances.asReadonly();
|
|
19
|
+
this._defaultPaginationId = "DEFAULT_PAGINATION_ID";
|
|
20
|
+
}
|
|
21
|
+
defaultId() {
|
|
22
|
+
return this._defaultPaginationId;
|
|
23
|
+
}
|
|
24
|
+
notifyChange(_id) {
|
|
25
|
+
requestAnimationFrame(() => {
|
|
26
|
+
this._instances.update((current) => ({ ...current }));
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
register(instance, fromPipe = false) {
|
|
30
|
+
const normalizedInstance = {
|
|
31
|
+
...structuredClone(instance),
|
|
32
|
+
id: instance.id ?? this._defaultPaginationId
|
|
33
|
+
};
|
|
34
|
+
const id = normalizedInstance.id;
|
|
35
|
+
let changed = false;
|
|
36
|
+
const currentInstances = untracked(() => this._instances());
|
|
37
|
+
if (!currentInstances[id]) changed = true;
|
|
38
|
+
else if (this._needsUpdate(currentInstances[id], normalizedInstance)) changed = true;
|
|
39
|
+
if (changed) {
|
|
40
|
+
if (fromPipe) requestAnimationFrame(() => {
|
|
41
|
+
this._instances.update((current) => {
|
|
42
|
+
if (!current[id]) return {
|
|
43
|
+
...current,
|
|
44
|
+
[id]: normalizedInstance
|
|
45
|
+
};
|
|
46
|
+
else {
|
|
47
|
+
this._updateInstance(current[id], normalizedInstance);
|
|
48
|
+
return { ...current };
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
else this._instances.update((current) => {
|
|
53
|
+
if (!current[id]) return {
|
|
54
|
+
...current,
|
|
55
|
+
[id]: normalizedInstance
|
|
56
|
+
};
|
|
57
|
+
else {
|
|
58
|
+
this._updateInstance(current[id], normalizedInstance);
|
|
59
|
+
return { ...current };
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
return changed;
|
|
64
|
+
}
|
|
65
|
+
getCurrentPage(id) {
|
|
66
|
+
return this._instances()[id]?.currentPage;
|
|
67
|
+
}
|
|
68
|
+
getItemsPerPage(id) {
|
|
69
|
+
return this._instances()[id]?.itemsPerPage;
|
|
70
|
+
}
|
|
71
|
+
setCurrentPage(id, page) {
|
|
72
|
+
this._instances.update((current) => {
|
|
73
|
+
const instance = current[id];
|
|
74
|
+
if (instance) {
|
|
75
|
+
if (page <= Math.ceil(instance.totalItems / instance.itemsPerPage) && 1 <= page) {
|
|
76
|
+
current[id] = {
|
|
77
|
+
...instance,
|
|
78
|
+
currentPage: page
|
|
79
|
+
};
|
|
80
|
+
return { ...current };
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return current;
|
|
84
|
+
});
|
|
85
|
+
this.notifyChange(id);
|
|
86
|
+
}
|
|
87
|
+
setTotalItems(id, totalItems) {
|
|
88
|
+
this._instances.update((current) => {
|
|
89
|
+
const instance = current[id];
|
|
90
|
+
if (instance && 0 <= totalItems) {
|
|
91
|
+
current[id] = {
|
|
92
|
+
...instance,
|
|
93
|
+
totalItems
|
|
94
|
+
};
|
|
95
|
+
return { ...current };
|
|
96
|
+
}
|
|
97
|
+
return current;
|
|
98
|
+
});
|
|
99
|
+
this.notifyChange(id);
|
|
100
|
+
}
|
|
101
|
+
setItemsPerPage(id, itemsPerPage) {
|
|
102
|
+
this._instances.update((current) => {
|
|
103
|
+
const instance = current[id];
|
|
104
|
+
if (instance) {
|
|
105
|
+
current[id] = {
|
|
106
|
+
...instance,
|
|
107
|
+
itemsPerPage
|
|
108
|
+
};
|
|
109
|
+
return { ...current };
|
|
110
|
+
}
|
|
111
|
+
return current;
|
|
112
|
+
});
|
|
113
|
+
this.notifyChange(id);
|
|
114
|
+
}
|
|
115
|
+
getInstance(id = this._defaultPaginationId) {
|
|
116
|
+
const instance = this._instances()[id];
|
|
117
|
+
if (instance) return this._clone(instance);
|
|
118
|
+
}
|
|
119
|
+
_updateInstance(current, incoming) {
|
|
120
|
+
let changed = false;
|
|
121
|
+
if (incoming.id) {
|
|
122
|
+
const keys = /* @__PURE__ */ new Set([...Object.keys(current), ...Object.keys(incoming)]);
|
|
123
|
+
for (const prop of keys) {
|
|
124
|
+
const key = prop;
|
|
125
|
+
if (incoming[key] !== current[key]) {
|
|
126
|
+
current[key] = incoming[key];
|
|
127
|
+
changed = true;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return changed;
|
|
132
|
+
}
|
|
133
|
+
_needsUpdate(current, incoming) {
|
|
134
|
+
const keys = /* @__PURE__ */ new Set([...Object.keys(current), ...Object.keys(incoming)]);
|
|
135
|
+
for (const prop of keys) {
|
|
136
|
+
const key = prop;
|
|
137
|
+
if (incoming[key] !== current[key]) return true;
|
|
138
|
+
}
|
|
139
|
+
return false;
|
|
140
|
+
}
|
|
141
|
+
_clone(obj) {
|
|
142
|
+
return structuredClone(obj);
|
|
143
|
+
}
|
|
144
|
+
static {
|
|
145
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
146
|
+
minVersion: "12.0.0",
|
|
147
|
+
version: "22.2.3",
|
|
148
|
+
ngImport: i0,
|
|
149
|
+
type: CmatPaginationService,
|
|
150
|
+
deps: [],
|
|
151
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
static {
|
|
155
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
156
|
+
minVersion: "12.0.0",
|
|
157
|
+
version: "22.2.3",
|
|
158
|
+
ngImport: i0,
|
|
159
|
+
type: CmatPaginationService,
|
|
160
|
+
providedIn: "root"
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
165
|
+
minVersion: "12.0.0",
|
|
166
|
+
version: "22.2.3",
|
|
167
|
+
ngImport: i0,
|
|
168
|
+
type: CmatPaginationService,
|
|
169
|
+
decorators: [{
|
|
170
|
+
type: Injectable,
|
|
171
|
+
args: [{ providedIn: "root" }]
|
|
172
|
+
}]
|
|
173
|
+
});
|
|
174
|
+
var CmatPaginationDirective = class CmatPaginationDirective {
|
|
175
|
+
constructor() {
|
|
176
|
+
this.id = input(...ngDevMode ? [void 0, { debugName: "id" }] : /* istanbul ignore next */ []);
|
|
177
|
+
this.maxSize = input(7, ...ngDevMode ? [{ debugName: "maxSize" }] : /* istanbul ignore next */ []);
|
|
178
|
+
this.pageChange = output();
|
|
179
|
+
this.pageBoundsCorrection = output();
|
|
180
|
+
this.perPageCountChange = output();
|
|
181
|
+
this.pages = signal([], ...ngDevMode ? [{ debugName: "pages" }] : /* istanbul ignore next */ []);
|
|
182
|
+
this.service = inject(CmatPaginationService);
|
|
183
|
+
this._injector = inject(Injector);
|
|
184
|
+
this._pageLinksUpdateQueued = false;
|
|
185
|
+
effect(() => {
|
|
186
|
+
const instances = this.service.instances();
|
|
187
|
+
if (this._getId() === instances[this._getId()]?.id) untracked(() => {
|
|
188
|
+
this._schedulePageLinksUpdate();
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
this._schedulePageLinksUpdate();
|
|
192
|
+
}
|
|
193
|
+
previous() {
|
|
194
|
+
if (!this.isFirstPage()) {
|
|
195
|
+
this._checkValidId();
|
|
196
|
+
const current = this.getCurrent();
|
|
197
|
+
if (current) this.setCurrent(current - 1);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
next() {
|
|
201
|
+
if (!this.isLastPage()) {
|
|
202
|
+
this._checkValidId();
|
|
203
|
+
const current = this.getCurrent();
|
|
204
|
+
if (current) this.setCurrent(current + 1);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
goFirstPage() {
|
|
208
|
+
if (!this.isFirstPage()) {
|
|
209
|
+
this._checkValidId();
|
|
210
|
+
this.setCurrent(1);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
goLastPage() {
|
|
214
|
+
if (!this.isLastPage()) {
|
|
215
|
+
this._checkValidId();
|
|
216
|
+
const lastPage = this.getLastPage();
|
|
217
|
+
if (lastPage) this.setCurrent(lastPage);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
isFirstPage() {
|
|
221
|
+
return this.getCurrent() === 1;
|
|
222
|
+
}
|
|
223
|
+
isLastPage() {
|
|
224
|
+
return this.getLastPage() === this.getCurrent();
|
|
225
|
+
}
|
|
226
|
+
setCurrent(page) {
|
|
227
|
+
const nextPage = Number(page);
|
|
228
|
+
if (!Number.isNaN(nextPage)) this.pageChange.emit(nextPage);
|
|
229
|
+
}
|
|
230
|
+
getCurrent() {
|
|
231
|
+
return this.service.getCurrentPage(this._getId());
|
|
232
|
+
}
|
|
233
|
+
getLastPage() {
|
|
234
|
+
const inst = this.service.getInstance(this._getId());
|
|
235
|
+
if (!inst) return;
|
|
236
|
+
if (inst.totalItems < 1) return 1;
|
|
237
|
+
return Math.ceil(inst.totalItems / inst.itemsPerPage);
|
|
238
|
+
}
|
|
239
|
+
getTotalItems() {
|
|
240
|
+
return this.service.getInstance(this._getId())?.totalItems;
|
|
241
|
+
}
|
|
242
|
+
setItemsPerPage(count) {
|
|
243
|
+
const id = this._getId();
|
|
244
|
+
this.service.setItemsPerPage(id, count);
|
|
245
|
+
this.perPageCountChange.emit(count);
|
|
246
|
+
const inst = this.service.getInstance(id);
|
|
247
|
+
if (!inst) return;
|
|
248
|
+
this.setCurrent(this._outOfBoundCorrection(inst));
|
|
249
|
+
}
|
|
250
|
+
_getId() {
|
|
251
|
+
return this.id() ?? this.service.defaultId();
|
|
252
|
+
}
|
|
253
|
+
_checkValidId() {
|
|
254
|
+
const id = this._getId();
|
|
255
|
+
if (this.service.getInstance(id)?.id == null) console.warn(`PaginationControlsDirective: the specified id "${id}" does not match any registered PaginationInstance`);
|
|
256
|
+
}
|
|
257
|
+
_updatePageLinks() {
|
|
258
|
+
const inst = this.service.getInstance(this._getId());
|
|
259
|
+
if (!inst) {
|
|
260
|
+
this.pages.set([]);
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
const correctedCurrentPage = this._outOfBoundCorrection(inst);
|
|
264
|
+
const pageForRender = correctedCurrentPage !== inst.currentPage ? correctedCurrentPage : inst.currentPage;
|
|
265
|
+
this.pageBoundsCorrection.emit(correctedCurrentPage);
|
|
266
|
+
this.pages.set(this._createPageArray(pageForRender, inst.itemsPerPage, inst.totalItems, this.maxSize()));
|
|
267
|
+
}
|
|
268
|
+
_schedulePageLinksUpdate() {
|
|
269
|
+
if (this._pageLinksUpdateQueued) return;
|
|
270
|
+
this._pageLinksUpdateQueued = true;
|
|
271
|
+
afterNextRender(() => {
|
|
272
|
+
this._pageLinksUpdateQueued = false;
|
|
273
|
+
this._updatePageLinks();
|
|
274
|
+
}, { injector: this._injector });
|
|
275
|
+
}
|
|
276
|
+
_outOfBoundCorrection(instance) {
|
|
277
|
+
const totalPages = Math.ceil(instance.totalItems / instance.itemsPerPage);
|
|
278
|
+
if (totalPages < instance.currentPage && 0 < totalPages) return totalPages;
|
|
279
|
+
else if (instance.currentPage < 1) return 1;
|
|
280
|
+
return instance.currentPage;
|
|
281
|
+
}
|
|
282
|
+
_createPageArray(currentPage, itemsPerPage, totalItems, paginationRange) {
|
|
283
|
+
paginationRange = +paginationRange;
|
|
284
|
+
const pages = [];
|
|
285
|
+
const totalPages = Math.max(Math.ceil(totalItems / itemsPerPage), 1);
|
|
286
|
+
const halfWay = Math.ceil(paginationRange / 2);
|
|
287
|
+
const isStart = currentPage <= halfWay;
|
|
288
|
+
const isEnd = totalPages - halfWay < currentPage;
|
|
289
|
+
const isMiddle = !isStart && !isEnd;
|
|
290
|
+
const ellipsesNeeded = paginationRange < totalPages;
|
|
291
|
+
let i = 1;
|
|
292
|
+
while (i <= totalPages && i <= paginationRange) {
|
|
293
|
+
let label;
|
|
294
|
+
const pageNumber = this._calculatePageNumber(i, currentPage, paginationRange, totalPages);
|
|
295
|
+
const openingEllipsesNeeded = i === 2 && (isMiddle || isEnd);
|
|
296
|
+
const closingEllipsesNeeded = i === paginationRange - 1 && (isMiddle || isStart);
|
|
297
|
+
if (ellipsesNeeded && (openingEllipsesNeeded || closingEllipsesNeeded)) label = "...";
|
|
298
|
+
else label = pageNumber;
|
|
299
|
+
pages.push({
|
|
300
|
+
label,
|
|
301
|
+
value: pageNumber
|
|
302
|
+
});
|
|
303
|
+
i++;
|
|
304
|
+
}
|
|
305
|
+
return pages;
|
|
306
|
+
}
|
|
307
|
+
_calculatePageNumber(i, currentPage, paginationRange, totalPages) {
|
|
308
|
+
const halfWay = Math.ceil(paginationRange / 2);
|
|
309
|
+
if (i === paginationRange) return totalPages;
|
|
310
|
+
else if (i === 1) return i;
|
|
311
|
+
else if (paginationRange < totalPages) {
|
|
312
|
+
if (totalPages - halfWay < currentPage) return totalPages - paginationRange + i;
|
|
313
|
+
else if (halfWay < currentPage) return currentPage - halfWay + i;
|
|
314
|
+
else return i;
|
|
315
|
+
} else return i;
|
|
316
|
+
}
|
|
317
|
+
static {
|
|
318
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
319
|
+
minVersion: "12.0.0",
|
|
320
|
+
version: "22.2.3",
|
|
321
|
+
ngImport: i0,
|
|
322
|
+
type: CmatPaginationDirective,
|
|
323
|
+
deps: [],
|
|
324
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
static {
|
|
328
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
329
|
+
minVersion: "17.1.0",
|
|
330
|
+
version: "22.2.3",
|
|
331
|
+
type: CmatPaginationDirective,
|
|
332
|
+
isStandalone: true,
|
|
333
|
+
selector: "pagination-template,[pagination-template]",
|
|
334
|
+
inputs: {
|
|
335
|
+
id: {
|
|
336
|
+
classPropertyName: "id",
|
|
337
|
+
publicName: "id",
|
|
338
|
+
isSignal: true,
|
|
339
|
+
isRequired: false,
|
|
340
|
+
transformFunction: null
|
|
341
|
+
},
|
|
342
|
+
maxSize: {
|
|
343
|
+
classPropertyName: "maxSize",
|
|
344
|
+
publicName: "maxSize",
|
|
345
|
+
isSignal: true,
|
|
346
|
+
isRequired: false,
|
|
347
|
+
transformFunction: null
|
|
348
|
+
}
|
|
349
|
+
},
|
|
350
|
+
outputs: {
|
|
351
|
+
pageChange: "pageChange",
|
|
352
|
+
pageBoundsCorrection: "pageBoundsCorrection",
|
|
353
|
+
perPageCountChange: "perPageCountChange"
|
|
354
|
+
},
|
|
355
|
+
exportAs: ["paginationApi"],
|
|
356
|
+
ngImport: i0
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
};
|
|
360
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
361
|
+
minVersion: "12.0.0",
|
|
362
|
+
version: "22.2.3",
|
|
363
|
+
ngImport: i0,
|
|
364
|
+
type: CmatPaginationDirective,
|
|
365
|
+
decorators: [{
|
|
366
|
+
type: Directive,
|
|
367
|
+
args: [{
|
|
368
|
+
selector: "pagination-template,[pagination-template]",
|
|
369
|
+
exportAs: "paginationApi"
|
|
370
|
+
}]
|
|
371
|
+
}],
|
|
372
|
+
ctorParameters: () => [],
|
|
373
|
+
propDecorators: {
|
|
374
|
+
id: [{
|
|
375
|
+
type: i0.Input,
|
|
376
|
+
args: [{
|
|
377
|
+
isSignal: true,
|
|
378
|
+
alias: "id",
|
|
379
|
+
required: false
|
|
380
|
+
}]
|
|
381
|
+
}],
|
|
382
|
+
maxSize: [{
|
|
383
|
+
type: i0.Input,
|
|
384
|
+
args: [{
|
|
385
|
+
isSignal: true,
|
|
386
|
+
alias: "maxSize",
|
|
387
|
+
required: false
|
|
388
|
+
}]
|
|
389
|
+
}],
|
|
390
|
+
pageChange: [{
|
|
391
|
+
type: i0.Output,
|
|
392
|
+
args: ["pageChange"]
|
|
393
|
+
}],
|
|
394
|
+
pageBoundsCorrection: [{
|
|
395
|
+
type: i0.Output,
|
|
396
|
+
args: ["pageBoundsCorrection"]
|
|
397
|
+
}],
|
|
398
|
+
perPageCountChange: [{
|
|
399
|
+
type: i0.Output,
|
|
400
|
+
args: ["perPageCountChange"]
|
|
401
|
+
}]
|
|
402
|
+
}
|
|
403
|
+
});
|
|
404
|
+
var CmatPaginationComponent = class CmatPaginationComponent {
|
|
405
|
+
constructor() {
|
|
406
|
+
this.id = input(...ngDevMode ? [void 0, { debugName: "id" }] : /* istanbul ignore next */ []);
|
|
407
|
+
this.maxSize = input(7, ...ngDevMode ? [{ debugName: "maxSize" }] : /* istanbul ignore next */ []);
|
|
408
|
+
this.itemsPerPages = input([
|
|
409
|
+
10,
|
|
410
|
+
20,
|
|
411
|
+
30
|
|
412
|
+
], ...ngDevMode ? [{ debugName: "itemsPerPages" }] : /* istanbul ignore next */ []);
|
|
413
|
+
this.initPerPage = input(10, ...ngDevMode ? [{ debugName: "initPerPage" }] : /* istanbul ignore next */ []);
|
|
414
|
+
this.autoHide = input(false, ...ngDevMode ? [{ debugName: "autoHide" }] : /* istanbul ignore next */ []);
|
|
415
|
+
this.pageChange = output();
|
|
416
|
+
this.pageBoundsCorrection = output();
|
|
417
|
+
this.perPageCountChange = output();
|
|
418
|
+
this._elementRef = inject(ElementRef);
|
|
419
|
+
this._destroyRef = inject(DestroyRef);
|
|
420
|
+
this._componentWidth = signal(1024, ...ngDevMode ? [{ debugName: "_componentWidth" }] : /* istanbul ignore next */ []);
|
|
421
|
+
this.isScreenSmall = computed(() => {
|
|
422
|
+
return this._componentWidth() < 768;
|
|
423
|
+
}, ...ngDevMode ? [{ debugName: "isScreenSmall" }] : /* istanbul ignore next */ []);
|
|
424
|
+
afterNextRender(() => {
|
|
425
|
+
const element = this._elementRef.nativeElement;
|
|
426
|
+
if (getComputedStyle(element).display === "inline") {
|
|
427
|
+
element.style.display = "inline-block";
|
|
428
|
+
element.style.width = "100%";
|
|
429
|
+
}
|
|
430
|
+
const initialWidth = element.getBoundingClientRect().width;
|
|
431
|
+
if (initialWidth > 0) this._componentWidth.set(initialWidth);
|
|
432
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
433
|
+
for (const entry of entries) {
|
|
434
|
+
const width = entry.contentRect.width;
|
|
435
|
+
if (width > 0) this._componentWidth.set(width);
|
|
436
|
+
}
|
|
437
|
+
});
|
|
438
|
+
resizeObserver.observe(element);
|
|
439
|
+
this._destroyRef.onDestroy(() => {
|
|
440
|
+
resizeObserver.disconnect();
|
|
441
|
+
});
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
static {
|
|
445
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
446
|
+
minVersion: "12.0.0",
|
|
447
|
+
version: "22.2.3",
|
|
448
|
+
ngImport: i0,
|
|
449
|
+
type: CmatPaginationComponent,
|
|
450
|
+
deps: [],
|
|
451
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
static {
|
|
455
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
456
|
+
minVersion: "17.0.0",
|
|
457
|
+
version: "22.2.3",
|
|
458
|
+
type: CmatPaginationComponent,
|
|
459
|
+
isStandalone: true,
|
|
460
|
+
selector: "cmat-pagination",
|
|
461
|
+
inputs: {
|
|
462
|
+
id: {
|
|
463
|
+
classPropertyName: "id",
|
|
464
|
+
publicName: "id",
|
|
465
|
+
isSignal: true,
|
|
466
|
+
isRequired: false,
|
|
467
|
+
transformFunction: null
|
|
468
|
+
},
|
|
469
|
+
maxSize: {
|
|
470
|
+
classPropertyName: "maxSize",
|
|
471
|
+
publicName: "maxSize",
|
|
472
|
+
isSignal: true,
|
|
473
|
+
isRequired: false,
|
|
474
|
+
transformFunction: null
|
|
475
|
+
},
|
|
476
|
+
itemsPerPages: {
|
|
477
|
+
classPropertyName: "itemsPerPages",
|
|
478
|
+
publicName: "itemsPerPages",
|
|
479
|
+
isSignal: true,
|
|
480
|
+
isRequired: false,
|
|
481
|
+
transformFunction: null
|
|
482
|
+
},
|
|
483
|
+
initPerPage: {
|
|
484
|
+
classPropertyName: "initPerPage",
|
|
485
|
+
publicName: "initPerPage",
|
|
486
|
+
isSignal: true,
|
|
487
|
+
isRequired: false,
|
|
488
|
+
transformFunction: null
|
|
489
|
+
},
|
|
490
|
+
autoHide: {
|
|
491
|
+
classPropertyName: "autoHide",
|
|
492
|
+
publicName: "autoHide",
|
|
493
|
+
isSignal: true,
|
|
494
|
+
isRequired: false,
|
|
495
|
+
transformFunction: null
|
|
496
|
+
}
|
|
497
|
+
},
|
|
498
|
+
outputs: {
|
|
499
|
+
pageChange: "pageChange",
|
|
500
|
+
pageBoundsCorrection: "pageBoundsCorrection",
|
|
501
|
+
perPageCountChange: "perPageCountChange"
|
|
502
|
+
},
|
|
503
|
+
exportAs: ["cmatPagination"],
|
|
504
|
+
ngImport: i0,
|
|
505
|
+
template: "<pagination-template #p=\"paginationApi\" class=\"w-full px-4 py-2 flex items-center\" [id]=\"id()\"\r\n [maxSize]=\"isScreenSmall() && maxSize() > 5 ? 5 : maxSize()\"\r\n (pageChange)=\"pageChange.emit($event)\"\r\n (pageBoundsCorrection)=\"pageBoundsCorrection.emit($event)\" (perPageCountChange)=\"perPageCountChange.emit($event)\">\r\n @if (!(autoHide() && p.pages().length <= 1)) {\r\n <!-- 左:总计 -->\r\n <div class=\"flex-auto\" [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <span class=\"text-sm text-secondary whitespace-nowrap\">共 {{ p.getTotalItems() }} 条</span>\r\n </div>\r\n\r\n <!-- 右:导航 -->\r\n <nav role=\"navigation\" class=\"flex\" [ngClass]=\"{'w-full':isScreenSmall()}\">\r\n <ul class=\"flex items-center\"\r\n [ngClass]=\"{'justify-center w-full gap-0':isScreenSmall(),'flex-row gap-0.5':!isScreenSmall()}\">\r\n\r\n <!-- 首页 -->\r\n <li>\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === 1\" (click)=\"p.goFirstPage()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"mat_outline:first_page\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- 上一页 -->\r\n <li>\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === 1\" (click)=\"p.previous()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"heroicons_outline:chevron-left\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- 页码 -->\r\n <li class=\"mx-1\">\r\n <div class=\"flex items-center gap-0.5\">\r\n @for (page of p.pages(); track $index) {\r\n @if (page.label === \"...\") {\r\n <span class=\"flex items-center justify-center w-8 h-8 rounded-full text-sm text-secondary\">...</span>\r\n } @else if (p.getCurrent() === page.value) {\r\n <span class=\"flex items-center justify-center w-8 h-8 rounded-full bg-primary-500 text-white text-sm font-medium\">\r\n {{ page.label | number: \"\" }}\r\n </span>\r\n } @else {\r\n <a tabindex=\"0\" role=\"presentation\"\r\n class=\"flex items-center justify-center w-8 h-8 rounded-full text-sm text-secondary cursor-pointer hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors\"\r\n (click)=\"p.setCurrent(page.value)\">\r\n {{ page.label | number: \"\" }}\r\n </a>\r\n }\r\n }\r\n </div>\r\n </li>\r\n\r\n <!-- 下一页 -->\r\n <li>\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === p.getLastPage()\" (click)=\"p.next()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"heroicons_outline:chevron-right\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- 末页 -->\r\n <li>\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === p.getLastPage()\" (click)=\"p.goLastPage()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"mat_outline:last_page\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- 页码跳转(桌面端) -->\r\n <li class=\"px-1\" [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <mat-form-field appearance=\"outline\" [ngStyle]=\"{\r\n width: (p.getLastPage()?.toString()?.length || 0) * 8 + 64 + 'px',\r\n }\">\r\n <input #current matInput type=\"text\" cmatDigitOnly class=\"text-end\" [value]=\"p.getCurrent()\"\r\n [autocomplete]=\"'off'\" [min]=\"0\" [max]=\"p.getLastPage() || 0\" (keyup.enter)=\"p.setCurrent(current.value)\" />\r\n <span matSuffix>/\r\n <div class=\"px-2\">{{ p.getLastPage() }}</div>\r\n </span>\r\n </mat-form-field>\r\n </li>\r\n\r\n <!-- 每页条数(桌面端) -->\r\n <li class=\"px-1\" [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <mat-form-field class=\"w-20\" appearance=\"outline\">\r\n <mat-select #pageCount [value]=\"initPerPage()\" (selectionChange)=\"p.setItemsPerPage(pageCount.value)\">\r\n @for (perPage of itemsPerPages(); track perPage) {\r\n <mat-option [value]=\"perPage\">{{ perPage }}</mat-option>\r\n }\r\n </mat-select>\r\n </mat-form-field>\r\n </li>\r\n </ul>\r\n </nav>\r\n }\r\n</pagination-template>\r\n\r\n<style>\r\n @media (hover: none) and (pointer: coarse) {\r\n cmat-pagination button[matIconButton] {\r\n transition: transform 150ms ease;\r\n }\r\n cmat-pagination button[matIconButton]:active:not([disabled]) {\r\n transform: scale(0.88);\r\n }\r\n }\r\n</style>\r\n",
|
|
506
|
+
styles: ["@media(hover:none)and (pointer:coarse){cmat-pagination button[matIconButton]{transition:transform .15s ease}cmat-pagination button[matIconButton]:active:not([disabled]){transform:scale(.88)}}\n"],
|
|
507
|
+
dependencies: [
|
|
508
|
+
{
|
|
509
|
+
kind: "directive",
|
|
510
|
+
type: CmatPaginationDirective,
|
|
511
|
+
selector: "pagination-template,[pagination-template]",
|
|
512
|
+
inputs: ["id", "maxSize"],
|
|
513
|
+
outputs: [
|
|
514
|
+
"pageChange",
|
|
515
|
+
"pageBoundsCorrection",
|
|
516
|
+
"perPageCountChange"
|
|
517
|
+
],
|
|
518
|
+
exportAs: ["paginationApi"]
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
kind: "directive",
|
|
522
|
+
type: CmatDigitOnlyDirective,
|
|
523
|
+
selector: "[cmatDigitOnly]",
|
|
524
|
+
inputs: [
|
|
525
|
+
"decimal",
|
|
526
|
+
"decimalSeparator",
|
|
527
|
+
"allowNegatives",
|
|
528
|
+
"allowPaste",
|
|
529
|
+
"negativeSign",
|
|
530
|
+
"min",
|
|
531
|
+
"max",
|
|
532
|
+
"pattern"
|
|
533
|
+
]
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
kind: "ngmodule",
|
|
537
|
+
type: MatIconModule
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
kind: "component",
|
|
541
|
+
type: i1.MatIcon,
|
|
542
|
+
selector: "mat-icon",
|
|
543
|
+
inputs: [
|
|
544
|
+
"color",
|
|
545
|
+
"inline",
|
|
546
|
+
"svgIcon",
|
|
547
|
+
"fontSet",
|
|
548
|
+
"fontIcon"
|
|
549
|
+
],
|
|
550
|
+
exportAs: ["matIcon"]
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
kind: "ngmodule",
|
|
554
|
+
type: MatFormFieldModule
|
|
555
|
+
},
|
|
556
|
+
{
|
|
557
|
+
kind: "component",
|
|
558
|
+
type: i2.MatFormField,
|
|
559
|
+
selector: "mat-form-field",
|
|
560
|
+
inputs: [
|
|
561
|
+
"hideRequiredMarker",
|
|
562
|
+
"color",
|
|
563
|
+
"floatLabel",
|
|
564
|
+
"appearance",
|
|
565
|
+
"subscriptSizing",
|
|
566
|
+
"hintLabel"
|
|
567
|
+
],
|
|
568
|
+
exportAs: ["matFormField"]
|
|
569
|
+
},
|
|
570
|
+
{
|
|
571
|
+
kind: "directive",
|
|
572
|
+
type: i2.MatSuffix,
|
|
573
|
+
selector: "[matSuffix], [matIconSuffix], [matTextSuffix]",
|
|
574
|
+
inputs: ["matTextSuffix"]
|
|
575
|
+
},
|
|
576
|
+
{
|
|
577
|
+
kind: "ngmodule",
|
|
578
|
+
type: MatInputModule
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
kind: "directive",
|
|
582
|
+
type: i3.MatInput,
|
|
583
|
+
selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]",
|
|
584
|
+
inputs: [
|
|
585
|
+
"disabled",
|
|
586
|
+
"id",
|
|
587
|
+
"placeholder",
|
|
588
|
+
"name",
|
|
589
|
+
"required",
|
|
590
|
+
"type",
|
|
591
|
+
"errorStateMatcher",
|
|
592
|
+
"aria-describedby",
|
|
593
|
+
"value",
|
|
594
|
+
"readonly",
|
|
595
|
+
"disabledInteractive"
|
|
596
|
+
],
|
|
597
|
+
exportAs: ["matInput"]
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
kind: "ngmodule",
|
|
601
|
+
type: MatSelectModule
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
kind: "component",
|
|
605
|
+
type: i4.MatSelect,
|
|
606
|
+
selector: "mat-select",
|
|
607
|
+
inputs: [
|
|
608
|
+
"aria-describedby",
|
|
609
|
+
"panelClass",
|
|
610
|
+
"disabled",
|
|
611
|
+
"disableRipple",
|
|
612
|
+
"tabIndex",
|
|
613
|
+
"hideSingleSelectionIndicator",
|
|
614
|
+
"placeholder",
|
|
615
|
+
"required",
|
|
616
|
+
"multiple",
|
|
617
|
+
"disableOptionCentering",
|
|
618
|
+
"compareWith",
|
|
619
|
+
"value",
|
|
620
|
+
"aria-label",
|
|
621
|
+
"aria-labelledby",
|
|
622
|
+
"errorStateMatcher",
|
|
623
|
+
"typeaheadDebounceInterval",
|
|
624
|
+
"sortComparator",
|
|
625
|
+
"id",
|
|
626
|
+
"panelWidth",
|
|
627
|
+
"canSelectNullableOptions"
|
|
628
|
+
],
|
|
629
|
+
outputs: [
|
|
630
|
+
"openedChange",
|
|
631
|
+
"opened",
|
|
632
|
+
"closed",
|
|
633
|
+
"selectionChange",
|
|
634
|
+
"valueChange"
|
|
635
|
+
],
|
|
636
|
+
exportAs: ["matSelect"]
|
|
637
|
+
},
|
|
638
|
+
{
|
|
639
|
+
kind: "component",
|
|
640
|
+
type: i4.MatOption,
|
|
641
|
+
selector: "mat-option",
|
|
642
|
+
inputs: [
|
|
643
|
+
"value",
|
|
644
|
+
"id",
|
|
645
|
+
"disabled"
|
|
646
|
+
],
|
|
647
|
+
outputs: ["onSelectionChange"],
|
|
648
|
+
exportAs: ["matOption"]
|
|
649
|
+
},
|
|
650
|
+
{
|
|
651
|
+
kind: "ngmodule",
|
|
652
|
+
type: MatButtonModule
|
|
653
|
+
},
|
|
654
|
+
{
|
|
655
|
+
kind: "component",
|
|
656
|
+
type: i5.MatIconButton,
|
|
657
|
+
selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]",
|
|
658
|
+
exportAs: ["matButton", "matAnchor"]
|
|
659
|
+
},
|
|
660
|
+
{
|
|
661
|
+
kind: "directive",
|
|
662
|
+
type: NgClass,
|
|
663
|
+
selector: "[ngClass]",
|
|
664
|
+
inputs: ["class", "ngClass"]
|
|
665
|
+
},
|
|
666
|
+
{
|
|
667
|
+
kind: "directive",
|
|
668
|
+
type: NgStyle,
|
|
669
|
+
selector: "[ngStyle]",
|
|
670
|
+
inputs: ["ngStyle"]
|
|
671
|
+
},
|
|
672
|
+
{
|
|
673
|
+
kind: "pipe",
|
|
674
|
+
type: DecimalPipe,
|
|
675
|
+
name: "number"
|
|
676
|
+
}
|
|
677
|
+
],
|
|
678
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
679
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
680
|
+
});
|
|
681
|
+
}
|
|
682
|
+
};
|
|
683
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
684
|
+
minVersion: "12.0.0",
|
|
685
|
+
version: "22.2.3",
|
|
686
|
+
ngImport: i0,
|
|
687
|
+
type: CmatPaginationComponent,
|
|
688
|
+
decorators: [{
|
|
689
|
+
type: Component,
|
|
690
|
+
args: [{
|
|
691
|
+
selector: "cmat-pagination",
|
|
692
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
693
|
+
encapsulation: ViewEncapsulation.None,
|
|
694
|
+
exportAs: "cmatPagination",
|
|
695
|
+
imports: [
|
|
696
|
+
CmatPaginationDirective,
|
|
697
|
+
CmatDigitOnlyDirective,
|
|
698
|
+
MatIconModule,
|
|
699
|
+
MatFormFieldModule,
|
|
700
|
+
MatInputModule,
|
|
701
|
+
MatSelectModule,
|
|
702
|
+
DecimalPipe,
|
|
703
|
+
MatButtonModule,
|
|
704
|
+
NgClass,
|
|
705
|
+
NgStyle
|
|
706
|
+
],
|
|
707
|
+
template: "<pagination-template #p=\"paginationApi\" class=\"w-full px-4 py-2 flex items-center\" [id]=\"id()\"\r\n [maxSize]=\"isScreenSmall() && maxSize() > 5 ? 5 : maxSize()\"\r\n (pageChange)=\"pageChange.emit($event)\"\r\n (pageBoundsCorrection)=\"pageBoundsCorrection.emit($event)\" (perPageCountChange)=\"perPageCountChange.emit($event)\">\r\n @if (!(autoHide() && p.pages().length <= 1)) {\r\n <!-- 左:总计 -->\r\n <div class=\"flex-auto\" [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <span class=\"text-sm text-secondary whitespace-nowrap\">共 {{ p.getTotalItems() }} 条</span>\r\n </div>\r\n\r\n <!-- 右:导航 -->\r\n <nav role=\"navigation\" class=\"flex\" [ngClass]=\"{'w-full':isScreenSmall()}\">\r\n <ul class=\"flex items-center\"\r\n [ngClass]=\"{'justify-center w-full gap-0':isScreenSmall(),'flex-row gap-0.5':!isScreenSmall()}\">\r\n\r\n <!-- 首页 -->\r\n <li>\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === 1\" (click)=\"p.goFirstPage()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"mat_outline:first_page\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- 上一页 -->\r\n <li>\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === 1\" (click)=\"p.previous()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"heroicons_outline:chevron-left\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- 页码 -->\r\n <li class=\"mx-1\">\r\n <div class=\"flex items-center gap-0.5\">\r\n @for (page of p.pages(); track $index) {\r\n @if (page.label === \"...\") {\r\n <span class=\"flex items-center justify-center w-8 h-8 rounded-full text-sm text-secondary\">...</span>\r\n } @else if (p.getCurrent() === page.value) {\r\n <span class=\"flex items-center justify-center w-8 h-8 rounded-full bg-primary-500 text-white text-sm font-medium\">\r\n {{ page.label | number: \"\" }}\r\n </span>\r\n } @else {\r\n <a tabindex=\"0\" role=\"presentation\"\r\n class=\"flex items-center justify-center w-8 h-8 rounded-full text-sm text-secondary cursor-pointer hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors\"\r\n (click)=\"p.setCurrent(page.value)\">\r\n {{ page.label | number: \"\" }}\r\n </a>\r\n }\r\n }\r\n </div>\r\n </li>\r\n\r\n <!-- 下一页 -->\r\n <li>\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === p.getLastPage()\" (click)=\"p.next()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"heroicons_outline:chevron-right\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- 末页 -->\r\n <li>\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === p.getLastPage()\" (click)=\"p.goLastPage()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"mat_outline:last_page\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- 页码跳转(桌面端) -->\r\n <li class=\"px-1\" [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <mat-form-field appearance=\"outline\" [ngStyle]=\"{\r\n width: (p.getLastPage()?.toString()?.length || 0) * 8 + 64 + 'px',\r\n }\">\r\n <input #current matInput type=\"text\" cmatDigitOnly class=\"text-end\" [value]=\"p.getCurrent()\"\r\n [autocomplete]=\"'off'\" [min]=\"0\" [max]=\"p.getLastPage() || 0\" (keyup.enter)=\"p.setCurrent(current.value)\" />\r\n <span matSuffix>/\r\n <div class=\"px-2\">{{ p.getLastPage() }}</div>\r\n </span>\r\n </mat-form-field>\r\n </li>\r\n\r\n <!-- 每页条数(桌面端) -->\r\n <li class=\"px-1\" [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <mat-form-field class=\"w-20\" appearance=\"outline\">\r\n <mat-select #pageCount [value]=\"initPerPage()\" (selectionChange)=\"p.setItemsPerPage(pageCount.value)\">\r\n @for (perPage of itemsPerPages(); track perPage) {\r\n <mat-option [value]=\"perPage\">{{ perPage }}</mat-option>\r\n }\r\n </mat-select>\r\n </mat-form-field>\r\n </li>\r\n </ul>\r\n </nav>\r\n }\r\n</pagination-template>\r\n\r\n<style>\r\n @media (hover: none) and (pointer: coarse) {\r\n cmat-pagination button[matIconButton] {\r\n transition: transform 150ms ease;\r\n }\r\n cmat-pagination button[matIconButton]:active:not([disabled]) {\r\n transform: scale(0.88);\r\n }\r\n }\r\n</style>\r\n"
|
|
708
|
+
}]
|
|
709
|
+
}],
|
|
710
|
+
ctorParameters: () => [],
|
|
711
|
+
propDecorators: {
|
|
712
|
+
id: [{
|
|
713
|
+
type: i0.Input,
|
|
714
|
+
args: [{
|
|
715
|
+
isSignal: true,
|
|
716
|
+
alias: "id",
|
|
717
|
+
required: false
|
|
718
|
+
}]
|
|
719
|
+
}],
|
|
720
|
+
maxSize: [{
|
|
721
|
+
type: i0.Input,
|
|
722
|
+
args: [{
|
|
723
|
+
isSignal: true,
|
|
724
|
+
alias: "maxSize",
|
|
725
|
+
required: false
|
|
726
|
+
}]
|
|
727
|
+
}],
|
|
728
|
+
itemsPerPages: [{
|
|
729
|
+
type: i0.Input,
|
|
730
|
+
args: [{
|
|
731
|
+
isSignal: true,
|
|
732
|
+
alias: "itemsPerPages",
|
|
733
|
+
required: false
|
|
734
|
+
}]
|
|
735
|
+
}],
|
|
736
|
+
initPerPage: [{
|
|
737
|
+
type: i0.Input,
|
|
738
|
+
args: [{
|
|
739
|
+
isSignal: true,
|
|
740
|
+
alias: "initPerPage",
|
|
741
|
+
required: false
|
|
742
|
+
}]
|
|
743
|
+
}],
|
|
744
|
+
autoHide: [{
|
|
745
|
+
type: i0.Input,
|
|
746
|
+
args: [{
|
|
747
|
+
isSignal: true,
|
|
748
|
+
alias: "autoHide",
|
|
749
|
+
required: false
|
|
750
|
+
}]
|
|
751
|
+
}],
|
|
752
|
+
pageChange: [{
|
|
753
|
+
type: i0.Output,
|
|
754
|
+
args: ["pageChange"]
|
|
755
|
+
}],
|
|
756
|
+
pageBoundsCorrection: [{
|
|
757
|
+
type: i0.Output,
|
|
758
|
+
args: ["pageBoundsCorrection"]
|
|
759
|
+
}],
|
|
760
|
+
perPageCountChange: [{
|
|
761
|
+
type: i0.Output,
|
|
762
|
+
args: ["perPageCountChange"]
|
|
763
|
+
}]
|
|
764
|
+
}
|
|
765
|
+
});
|
|
442
766
|
const LARGE_NUMBER = Number.MAX_SAFE_INTEGER;
|
|
443
|
-
class CmatPaginatePipe {
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
767
|
+
var CmatPaginatePipe = class CmatPaginatePipe {
|
|
768
|
+
constructor() {
|
|
769
|
+
this.service = inject(CmatPaginationService);
|
|
770
|
+
this.state = {};
|
|
771
|
+
}
|
|
772
|
+
transform(collection, args) {
|
|
773
|
+
if (!Array.isArray(collection)) {
|
|
774
|
+
const _id = args.id ?? this.service.defaultId();
|
|
775
|
+
return this.state[_id]?.slice ?? collection;
|
|
776
|
+
}
|
|
777
|
+
const totalItems = this._toNumber(args.totalItems) || collection.length;
|
|
778
|
+
const serverSideMode = totalItems !== collection.length;
|
|
779
|
+
const instance = this.createInstance(collection, {
|
|
780
|
+
...args,
|
|
781
|
+
totalItems
|
|
782
|
+
});
|
|
783
|
+
const id = instance.id ?? this.service.defaultId();
|
|
784
|
+
let start;
|
|
785
|
+
let end;
|
|
786
|
+
const perPage = this._toNumber(args.itemsPerPage);
|
|
787
|
+
const emitChange = this.service.register(instance, true);
|
|
788
|
+
if (!serverSideMode) {
|
|
789
|
+
const pageSize = perPage || LARGE_NUMBER;
|
|
790
|
+
start = (instance.currentPage - 1) * pageSize;
|
|
791
|
+
end = start + pageSize;
|
|
792
|
+
if (this._stateIsIdentical(id, collection, start, end)) return this.state[id].slice;
|
|
793
|
+
const slice = collection.slice(start, end);
|
|
794
|
+
this._saveState(id, collection, slice, start, end);
|
|
795
|
+
this.service.notifyChange(id);
|
|
796
|
+
return slice;
|
|
797
|
+
}
|
|
798
|
+
if (emitChange) this.service.notifyChange(id);
|
|
799
|
+
this._saveState(id, collection, collection, start, end);
|
|
800
|
+
return collection;
|
|
801
|
+
}
|
|
802
|
+
createInstance(collection, config) {
|
|
803
|
+
this.checkConfig(config);
|
|
804
|
+
return {
|
|
805
|
+
id: config.id ?? this.service.defaultId(),
|
|
806
|
+
itemsPerPage: this._toNumber(config.itemsPerPage) || 10,
|
|
807
|
+
currentPage: this._toNumber(config.currentPage) || 1,
|
|
808
|
+
totalItems: this._toNumber(config.totalItems) || collection.length
|
|
809
|
+
};
|
|
810
|
+
}
|
|
811
|
+
checkConfig(config) {
|
|
812
|
+
const missing = ["itemsPerPage", "currentPage"].filter((prop) => !(prop in config));
|
|
813
|
+
if (missing.length > 0) throw new Error(`PaginatePipe: Argument is missing the following required properties: ${missing.join(", ")}`);
|
|
814
|
+
}
|
|
815
|
+
_saveState(id, collection, slice, start, end) {
|
|
816
|
+
this.state[id] = {
|
|
817
|
+
size: collection.length,
|
|
818
|
+
slice,
|
|
819
|
+
start,
|
|
820
|
+
end
|
|
821
|
+
};
|
|
822
|
+
}
|
|
823
|
+
_stateIsIdentical(id, collection, start, end) {
|
|
824
|
+
const state = this.state[id];
|
|
825
|
+
if (!state) return false;
|
|
826
|
+
if (!(state.size === collection.length && state.start === start && state.end === end)) return false;
|
|
827
|
+
return state.slice.every((element, index) => element === collection[start + index]);
|
|
828
|
+
}
|
|
829
|
+
_toNumber(value) {
|
|
830
|
+
return Number(value);
|
|
831
|
+
}
|
|
832
|
+
static {
|
|
833
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
834
|
+
minVersion: "12.0.0",
|
|
835
|
+
version: "22.2.3",
|
|
836
|
+
ngImport: i0,
|
|
837
|
+
type: CmatPaginatePipe,
|
|
838
|
+
deps: [],
|
|
839
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
840
|
+
});
|
|
841
|
+
}
|
|
842
|
+
static {
|
|
843
|
+
this.ɵpipe = i0.ɵɵngDeclarePipe({
|
|
844
|
+
minVersion: "14.0.0",
|
|
845
|
+
version: "22.2.3",
|
|
846
|
+
ngImport: i0,
|
|
847
|
+
type: CmatPaginatePipe,
|
|
848
|
+
isStandalone: true,
|
|
849
|
+
name: "paginate"
|
|
850
|
+
});
|
|
851
|
+
}
|
|
852
|
+
};
|
|
853
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
854
|
+
minVersion: "12.0.0",
|
|
855
|
+
version: "22.2.3",
|
|
856
|
+
ngImport: i0,
|
|
857
|
+
type: CmatPaginatePipe,
|
|
858
|
+
decorators: [{
|
|
859
|
+
type: Pipe,
|
|
860
|
+
args: [{
|
|
861
|
+
name: "paginate",
|
|
862
|
+
pure: true
|
|
863
|
+
}]
|
|
864
|
+
}]
|
|
865
|
+
});
|
|
535
866
|
export { CmatPaginatePipe, CmatPaginationComponent, CmatPaginationDirective, CmatPaginationService };
|
|
536
|
-
|
|
867
|
+
|
|
868
|
+
//# sourceMappingURL=cmat-components-pagination.mjs.map
|