cmat 0.0.111 → 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 +984 -1109
- package/fesm2022/cmat-services-print.mjs.map +1 -1
- package/fesm2022/cmat-services-splash-screen.mjs +53 -38
- package/fesm2022/cmat-services-splash-screen.mjs.map +1 -1
- package/fesm2022/cmat-services-title.mjs +57 -47
- package/fesm2022/cmat-services-title.mjs.map +1 -1
- package/fesm2022/cmat-services-translation.mjs +79 -68
- package/fesm2022/cmat-services-translation.mjs.map +1 -1
- package/fesm2022/cmat-services-utils.mjs +424 -517
- package/fesm2022/cmat-services-utils.mjs.map +1 -1
- package/fesm2022/cmat-validators.mjs +23 -33
- package/fesm2022/cmat-validators.mjs.map +1 -1
- package/fesm2022/cmat-version.mjs +12 -16
- package/fesm2022/cmat-version.mjs.map +1 -1
- package/fesm2022/cmat.mjs +39805 -22511
- package/fesm2022/cmat.mjs.map +1 -1
- package/package.json +5 -1
- package/types/cmat-components-adapter.d.ts +145 -156
- package/types/cmat-components-breadcrumb.d.ts +108 -86
- package/types/cmat-components-card.d.ts +34 -18
- package/types/cmat-components-carousel.d.ts +251 -134
- package/types/cmat-components-cascade.d.ts +158 -117
- package/types/cmat-components-chip-input.d.ts +105 -71
- package/types/cmat-components-code-editor.d.ts +59 -34
- package/types/cmat-components-color-picker.d.ts +378 -236
- package/types/cmat-components-custom-formly.d.ts +776 -814
- package/types/cmat-components-data-picker.d.ts +502 -360
- package/types/cmat-components-date-range.d.ts +106 -77
- package/types/cmat-components-date-time-display.d.ts +36 -13
- package/types/cmat-components-drawer.d.ts +91 -61
- package/types/cmat-components-empty-state.d.ts +47 -17
- package/types/cmat-components-file-preview.d.ts +42 -14
- package/types/cmat-components-filter-toolbar.d.ts +57 -25
- package/types/cmat-components-form-actions.d.ts +18 -10
- package/types/cmat-components-fullscreen.d.ts +21 -13
- package/types/cmat-components-highlight.d.ts +33 -26
- package/types/cmat-components-image-viewer.d.ts +119 -58
- package/types/cmat-components-inline-loading.d.ts +24 -11
- package/types/cmat-components-json-editor.d.ts +39 -28
- package/types/cmat-components-knob-input.d.ts +172 -101
- package/types/cmat-components-loading-overlay.d.ts +8 -11
- package/types/cmat-components-masonry.d.ts +27 -14
- package/types/cmat-components-material-color-picker.d.ts +56 -42
- package/types/cmat-components-material-datetimepicker.d.ts +817 -454
- package/types/cmat-components-navigation.d.ts +295 -221
- package/types/cmat-components-opt-input.d.ts +111 -90
- package/types/cmat-components-org-chart.d.ts +53 -35
- package/types/cmat-components-page-header.d.ts +37 -14
- package/types/cmat-components-pagination.d.ts +144 -107
- package/types/cmat-components-password-strength.d.ts +197 -86
- package/types/cmat-components-popover.d.ts +264 -166
- package/types/cmat-components-progress-bar.d.ts +17 -14
- package/types/cmat-components-qrcode.d.ts +111 -42
- package/types/cmat-components-rating.d.ts +105 -59
- package/types/cmat-components-rich-text-editor.d.ts +39 -16
- package/types/cmat-components-select-search.d.ts +195 -99
- package/types/cmat-components-select-table.d.ts +241 -142
- package/types/cmat-components-select-tree.d.ts +185 -118
- package/types/cmat-components-skeleton.d.ts +55 -32
- package/types/cmat-components-speed-dial.d.ts +86 -61
- package/types/cmat-components-status-tag.d.ts +42 -24
- package/types/cmat-components-table-toolbar.d.ts +30 -12
- package/types/cmat-components-timeline.d.ts +83 -51
- package/types/cmat-components-toast.d.ts +84 -85
- package/types/cmat-components-transfer-picker.d.ts +228 -181
- package/types/cmat-components-treetable.d.ts +63 -39
- package/types/cmat-components-upload.d.ts +205 -106
- package/types/cmat-components-x6-angular-shape.d.ts +29 -37
- package/types/cmat-directives-animate-on-scroll.d.ts +48 -30
- package/types/cmat-directives-arrow-cursor.d.ts +55 -35
- package/types/cmat-directives-autofocus.d.ts +8 -11
- package/types/cmat-directives-data-exporter.d.ts +71 -40
- package/types/cmat-directives-debounce.d.ts +31 -28
- package/types/cmat-directives-digit-only.d.ts +90 -53
- package/types/cmat-directives-equal-validator.d.ts +11 -14
- package/types/cmat-directives-seamless-auto-scroll.d.ts +42 -29
- package/types/cmat-lib-mock-api.d.ts +46 -55
- package/types/cmat-pipes-bytes.d.ts +7 -10
- package/types/cmat-pipes-date-format.d.ts +7 -10
- package/types/cmat-pipes-find-by-key.d.ts +8 -12
- package/types/cmat-pipes-group-by.d.ts +11 -15
- package/types/cmat-pipes-keys.d.ts +10 -13
- package/types/cmat-pipes-secure.d.ts +14 -17
- package/types/cmat-pipes-uppercase.d.ts +7 -10
- package/types/cmat-reports.d.ts +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 -102
- package/types/cmat-services-splash-screen.d.ts +11 -14
- package/types/cmat-services-title.d.ts +9 -12
- package/types/cmat-services-translation.d.ts +19 -22
- package/types/cmat-services-utils.d.ts +76 -80
- package/types/cmat-validators.d.ts +5 -8
- package/types/cmat-version.d.ts +8 -10
- package/types/cmat.d.ts +7551 -5204
|
@@ -1,205 +1,379 @@
|
|
|
1
|
-
import { coerceBooleanProperty } from
|
|
2
|
-
import {
|
|
3
|
-
import * as i0 from
|
|
4
|
-
import {
|
|
5
|
-
import { NgControl } from
|
|
6
|
-
import { MatFormFieldControl } from
|
|
7
|
-
import * as i1 from
|
|
8
|
-
import { MatIconModule } from
|
|
9
|
-
import { isNil } from
|
|
10
|
-
import { Subject } from
|
|
11
|
-
|
|
12
|
-
/* eslint-disable @typescript-eslint/member-ordering */
|
|
1
|
+
import { coerceBooleanProperty } from "@angular/cdk/coercion";
|
|
2
|
+
import { NgClass, NgStyle } from "@angular/common";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import { ChangeDetectionStrategy, Component, Input, ViewEncapsulation, effect, inject, input, output, signal, viewChild } from "@angular/core";
|
|
5
|
+
import { NgControl } from "@angular/forms";
|
|
6
|
+
import { MatFormFieldControl } from "@angular/material/form-field";
|
|
7
|
+
import * as i1 from "@angular/material/icon";
|
|
8
|
+
import { MatIconModule } from "@angular/material/icon";
|
|
9
|
+
import { isNil } from "lodash-es";
|
|
10
|
+
import { Subject } from "rxjs";
|
|
13
11
|
let NEXT_ID = 0;
|
|
14
|
-
class CmatRatingComponent {
|
|
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
|
-
|
|
12
|
+
var CmatRatingComponent = class CmatRatingComponent {
|
|
13
|
+
constructor() {
|
|
14
|
+
this.id = `cmat-chip-input-${NEXT_ID++}`;
|
|
15
|
+
this._ratingElementRef = viewChild("rating", ...ngDevMode ? [{ debugName: "_ratingElementRef" }] : /* istanbul ignore next */ []);
|
|
16
|
+
this.stars = input(5, ...ngDevMode ? [{ debugName: "stars" }] : /* istanbul ignore next */ []);
|
|
17
|
+
this.readonly = input(false, ...ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []);
|
|
18
|
+
this.hover = input(...ngDevMode ? [void 0, { debugName: "hover" }] : /* istanbul ignore next */ []);
|
|
19
|
+
this.half = input(...ngDevMode ? [void 0, { debugName: "half" }] : /* istanbul ignore next */ []);
|
|
20
|
+
this.color = input(...ngDevMode ? [void 0, { debugName: "color" }] : /* istanbul ignore next */ []);
|
|
21
|
+
this.showMode = input("horizontal", ...ngDevMode ? [{ debugName: "showMode" }] : /* istanbul ignore next */ []);
|
|
22
|
+
this.valueChange = output();
|
|
23
|
+
this.starArray = signal([], ...ngDevMode ? [{ debugName: "starArray" }] : /* istanbul ignore next */ []);
|
|
24
|
+
this.currentValue = signal(0, ...ngDevMode ? [{ debugName: "currentValue" }] : /* istanbul ignore next */ []);
|
|
25
|
+
this.stateChanges = new Subject();
|
|
26
|
+
this.focused = false;
|
|
27
|
+
this.touched = false;
|
|
28
|
+
this.controlType = "cmat-rating";
|
|
29
|
+
this.ngControl = inject(NgControl, {
|
|
30
|
+
optional: true,
|
|
31
|
+
self: true
|
|
32
|
+
});
|
|
33
|
+
this._value = signal(0, ...ngDevMode ? [{ debugName: "_value" }] : /* istanbul ignore next */ []);
|
|
34
|
+
this._placeholder = signal("", ...ngDevMode ? [{ debugName: "_placeholder" }] : /* istanbul ignore next */ []);
|
|
35
|
+
this._required = signal(false, ...ngDevMode ? [{ debugName: "_required" }] : /* istanbul ignore next */ []);
|
|
36
|
+
this._disabled = signal(false, ...ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []);
|
|
37
|
+
this.onModelChange = () => {};
|
|
38
|
+
this.onTouchedChange = () => {};
|
|
39
|
+
if (this.ngControl != null) this.ngControl.valueAccessor = this;
|
|
40
|
+
effect(() => {
|
|
41
|
+
this._initializeStarArray();
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
get placeholder() {
|
|
45
|
+
return this._placeholder();
|
|
46
|
+
}
|
|
47
|
+
set placeholder(value) {
|
|
48
|
+
this._placeholder.set(value);
|
|
49
|
+
this.stateChanges.next();
|
|
50
|
+
}
|
|
51
|
+
get value() {
|
|
52
|
+
return this._value();
|
|
53
|
+
}
|
|
54
|
+
set value(value) {
|
|
55
|
+
if (value !== this._value()) {
|
|
56
|
+
this._value.set(value);
|
|
57
|
+
this.stateChanges.next();
|
|
58
|
+
this.onModelChange(value);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
get empty() {
|
|
62
|
+
return !this._value();
|
|
63
|
+
}
|
|
64
|
+
get errorState() {
|
|
65
|
+
if (this.ngControl == null) return false;
|
|
66
|
+
return (this.touched && this.ngControl?.invalid) ?? false;
|
|
67
|
+
}
|
|
68
|
+
get shouldLabelFloat() {
|
|
69
|
+
return this.focused || !this.empty;
|
|
70
|
+
}
|
|
71
|
+
get required() {
|
|
72
|
+
return this._required();
|
|
73
|
+
}
|
|
74
|
+
set required(value) {
|
|
75
|
+
this._required.set(coerceBooleanProperty(value));
|
|
76
|
+
this.stateChanges.next();
|
|
77
|
+
}
|
|
78
|
+
get disabled() {
|
|
79
|
+
if (!isNil(this.ngControl?.disabled)) return this.ngControl.disabled;
|
|
80
|
+
return this._disabled() || this.readonly();
|
|
81
|
+
}
|
|
82
|
+
set disabled(value) {
|
|
83
|
+
this._disabled.set(coerceBooleanProperty(value));
|
|
84
|
+
if (this.focused) {
|
|
85
|
+
this.focused = false;
|
|
86
|
+
this.stateChanges.next();
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
writeValue(value) {
|
|
90
|
+
if (value !== null && value !== void 0) {
|
|
91
|
+
this.value = value;
|
|
92
|
+
this.currentValue.set(value);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
setDisabledState(isDisabled) {
|
|
96
|
+
this.disabled = isDisabled;
|
|
97
|
+
}
|
|
98
|
+
registerOnChange(fn) {
|
|
99
|
+
this.onModelChange = fn;
|
|
100
|
+
}
|
|
101
|
+
registerOnTouched(fn) {
|
|
102
|
+
this.onTouchedChange = fn;
|
|
103
|
+
}
|
|
104
|
+
setDescribedByIds(ids) {
|
|
105
|
+
const ratingEl = this._ratingElementRef();
|
|
106
|
+
if (ids.length) ratingEl?.nativeElement.setAttribute("aria-describedby", ids.join(" "));
|
|
107
|
+
else ratingEl?.nativeElement.removeAttribute("aria-describedby");
|
|
108
|
+
}
|
|
109
|
+
onContainerClick() {
|
|
110
|
+
if (!this.focused) this._ratingElementRef()?.nativeElement.focus();
|
|
111
|
+
}
|
|
112
|
+
onFocus() {
|
|
113
|
+
if (!this.focused) {
|
|
114
|
+
this.focused = true;
|
|
115
|
+
this.stateChanges.next();
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
isIn(value) {
|
|
119
|
+
const ex = this.value - value;
|
|
120
|
+
return ex > 0 && ex < 1;
|
|
121
|
+
}
|
|
122
|
+
onClick(event, value, half) {
|
|
123
|
+
event.stopPropagation();
|
|
124
|
+
if (!this.readonly()) {
|
|
125
|
+
this.value = value + 1;
|
|
126
|
+
if (half && this.half()) this.value -= .5;
|
|
127
|
+
this.currentValue.set(this.value);
|
|
128
|
+
this.valueChange.emit(this.currentValue());
|
|
129
|
+
this.onModelChange(this.currentValue());
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
onMouseover(event, value, half) {
|
|
133
|
+
event.stopPropagation();
|
|
134
|
+
if (this.hover() && !this.readonly()) {
|
|
135
|
+
this.value = value + 1;
|
|
136
|
+
if (half && this.half()) this.value -= .5;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
onMouseleave() {
|
|
140
|
+
if (this.value !== this.currentValue()) this.value = this.currentValue();
|
|
141
|
+
}
|
|
142
|
+
_initializeStarArray() {
|
|
143
|
+
this.starArray.set(Array.from({ length: this.stars() }, (_, i) => i));
|
|
144
|
+
}
|
|
145
|
+
static {
|
|
146
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
147
|
+
minVersion: "12.0.0",
|
|
148
|
+
version: "22.2.3",
|
|
149
|
+
ngImport: i0,
|
|
150
|
+
type: CmatRatingComponent,
|
|
151
|
+
deps: [],
|
|
152
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
static {
|
|
156
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
157
|
+
minVersion: "17.0.0",
|
|
158
|
+
version: "22.2.3",
|
|
159
|
+
type: CmatRatingComponent,
|
|
160
|
+
isStandalone: true,
|
|
161
|
+
selector: "cmat-rating",
|
|
162
|
+
inputs: {
|
|
163
|
+
stars: {
|
|
164
|
+
classPropertyName: "stars",
|
|
165
|
+
publicName: "stars",
|
|
166
|
+
isSignal: true,
|
|
167
|
+
isRequired: false,
|
|
168
|
+
transformFunction: null
|
|
169
|
+
},
|
|
170
|
+
readonly: {
|
|
171
|
+
classPropertyName: "readonly",
|
|
172
|
+
publicName: "readonly",
|
|
173
|
+
isSignal: true,
|
|
174
|
+
isRequired: false,
|
|
175
|
+
transformFunction: null
|
|
176
|
+
},
|
|
177
|
+
hover: {
|
|
178
|
+
classPropertyName: "hover",
|
|
179
|
+
publicName: "hover",
|
|
180
|
+
isSignal: true,
|
|
181
|
+
isRequired: false,
|
|
182
|
+
transformFunction: null
|
|
183
|
+
},
|
|
184
|
+
half: {
|
|
185
|
+
classPropertyName: "half",
|
|
186
|
+
publicName: "half",
|
|
187
|
+
isSignal: true,
|
|
188
|
+
isRequired: false,
|
|
189
|
+
transformFunction: null
|
|
190
|
+
},
|
|
191
|
+
color: {
|
|
192
|
+
classPropertyName: "color",
|
|
193
|
+
publicName: "color",
|
|
194
|
+
isSignal: true,
|
|
195
|
+
isRequired: false,
|
|
196
|
+
transformFunction: null
|
|
197
|
+
},
|
|
198
|
+
showMode: {
|
|
199
|
+
classPropertyName: "showMode",
|
|
200
|
+
publicName: "showMode",
|
|
201
|
+
isSignal: true,
|
|
202
|
+
isRequired: false,
|
|
203
|
+
transformFunction: null
|
|
204
|
+
},
|
|
205
|
+
placeholder: {
|
|
206
|
+
classPropertyName: "placeholder",
|
|
207
|
+
publicName: "placeholder",
|
|
208
|
+
isSignal: false,
|
|
209
|
+
isRequired: false,
|
|
210
|
+
transformFunction: null
|
|
211
|
+
},
|
|
212
|
+
value: {
|
|
213
|
+
classPropertyName: "value",
|
|
214
|
+
publicName: "value",
|
|
215
|
+
isSignal: false,
|
|
216
|
+
isRequired: false,
|
|
217
|
+
transformFunction: null
|
|
218
|
+
},
|
|
219
|
+
required: {
|
|
220
|
+
classPropertyName: "required",
|
|
221
|
+
publicName: "required",
|
|
222
|
+
isSignal: false,
|
|
223
|
+
isRequired: false,
|
|
224
|
+
transformFunction: null
|
|
225
|
+
},
|
|
226
|
+
disabled: {
|
|
227
|
+
classPropertyName: "disabled",
|
|
228
|
+
publicName: "disabled",
|
|
229
|
+
isSignal: false,
|
|
230
|
+
isRequired: false,
|
|
231
|
+
transformFunction: null
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
outputs: { valueChange: "valueChange" },
|
|
235
|
+
host: { properties: { "attr.id": "id" } },
|
|
236
|
+
providers: [{
|
|
237
|
+
provide: MatFormFieldControl,
|
|
238
|
+
useExisting: CmatRatingComponent
|
|
239
|
+
}],
|
|
240
|
+
viewQueries: [{
|
|
241
|
+
propertyName: "_ratingElementRef",
|
|
242
|
+
first: true,
|
|
243
|
+
predicate: ["rating"],
|
|
244
|
+
descendants: true,
|
|
245
|
+
isSignal: true
|
|
246
|
+
}],
|
|
247
|
+
exportAs: ["cmatRating"],
|
|
248
|
+
ngImport: i0,
|
|
249
|
+
template: "<div\r\n #rating\r\n class=\"flex\"\r\n [class.cmat-rating-readonly]=\"readonly() || disabled\"\r\n [ngClass]=\"{\r\n 'flex-col': showMode() === 'vertical',\r\n 'flex-row': showMode() === 'horizontal',\r\n }\"\r\n (focus)=\"onFocus()\"\r\n (mouseleave)=\"onMouseleave()\"\r\n>\r\n @for (star of starArray(); track $index; let i = $index) {\r\n <div class=\"cmat-rating-item\">\r\n @if (half()) {\r\n <div\r\n role=\"presentation\"\r\n class=\"cmat-rating-half\"\r\n [ngStyle]=\"{ opacity: isIn(i) ? 1 : 0 }\"\r\n (focus)=\"onFocus()\"\r\n (mouseover)=\"onMouseover($event, i, true)\"\r\n (click)=\"onClick($event, i, true)\"\r\n >\r\n <mat-icon\r\n [ngClass]=\"{ 'text-current': !color() }\"\r\n [color]=\"color()\"\r\n [svgIcon]=\"\r\n 'mat_outline:' + (!value || i >= value ? 'star_border' : 'star')\r\n \"\r\n >\r\n </mat-icon>\r\n </div>\r\n }\r\n <div\r\n role=\"presentation\"\r\n (mouseover)=\"onMouseover($event, i)\"\r\n (click)=\"onClick($event, i)\"\r\n (focus)=\"onFocus()\"\r\n >\r\n <mat-icon\r\n [color]=\"color()\"\r\n [ngClass]=\"{ 'text-current': !color() }\"\r\n [svgIcon]=\"\r\n 'mat_outline:' +\r\n ((half() && isIn(i)) || !value || i >= value\r\n ? 'star_border'\r\n : 'star')\r\n \"\r\n >\r\n </mat-icon>\r\n </div>\r\n </div>\r\n }\r\n</div>",
|
|
250
|
+
styles: ["cmat-rating{display:flex;align-items:center}cmat-rating .cmat-rating-item{position:relative;cursor:pointer;line-height:0}cmat-rating .cmat-rating-item div{display:inline-block;font-size:1rem;padding:0 .1rem}cmat-rating .cmat-rating-item .cmat-rating-half{position:absolute;top:0;left:0;width:45%;z-index:10;opacity:0;overflow:hidden;padding-right:0}cmat-rating .cmat-rating-readonly .cmat-rating-item{cursor:not-allowed}\n"],
|
|
251
|
+
dependencies: [
|
|
252
|
+
{
|
|
253
|
+
kind: "ngmodule",
|
|
254
|
+
type: MatIconModule
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
kind: "component",
|
|
258
|
+
type: i1.MatIcon,
|
|
259
|
+
selector: "mat-icon",
|
|
260
|
+
inputs: [
|
|
261
|
+
"color",
|
|
262
|
+
"inline",
|
|
263
|
+
"svgIcon",
|
|
264
|
+
"fontSet",
|
|
265
|
+
"fontIcon"
|
|
266
|
+
],
|
|
267
|
+
exportAs: ["matIcon"]
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
kind: "directive",
|
|
271
|
+
type: NgStyle,
|
|
272
|
+
selector: "[ngStyle]",
|
|
273
|
+
inputs: ["ngStyle"]
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
kind: "directive",
|
|
277
|
+
type: NgClass,
|
|
278
|
+
selector: "[ngClass]",
|
|
279
|
+
inputs: ["class", "ngClass"]
|
|
280
|
+
}
|
|
281
|
+
],
|
|
282
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
283
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
288
|
+
minVersion: "12.0.0",
|
|
289
|
+
version: "22.2.3",
|
|
290
|
+
ngImport: i0,
|
|
291
|
+
type: CmatRatingComponent,
|
|
292
|
+
decorators: [{
|
|
293
|
+
type: Component,
|
|
294
|
+
args: [{
|
|
295
|
+
selector: "cmat-rating",
|
|
296
|
+
providers: [{
|
|
297
|
+
provide: MatFormFieldControl,
|
|
298
|
+
useExisting: CmatRatingComponent
|
|
299
|
+
}],
|
|
300
|
+
encapsulation: ViewEncapsulation.None,
|
|
301
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
302
|
+
exportAs: "cmatRating",
|
|
303
|
+
imports: [
|
|
304
|
+
MatIconModule,
|
|
305
|
+
NgStyle,
|
|
306
|
+
NgClass
|
|
307
|
+
],
|
|
308
|
+
host: { "[attr.id]": "id" },
|
|
309
|
+
template: "<div\r\n #rating\r\n class=\"flex\"\r\n [class.cmat-rating-readonly]=\"readonly() || disabled\"\r\n [ngClass]=\"{\r\n 'flex-col': showMode() === 'vertical',\r\n 'flex-row': showMode() === 'horizontal',\r\n }\"\r\n (focus)=\"onFocus()\"\r\n (mouseleave)=\"onMouseleave()\"\r\n>\r\n @for (star of starArray(); track $index; let i = $index) {\r\n <div class=\"cmat-rating-item\">\r\n @if (half()) {\r\n <div\r\n role=\"presentation\"\r\n class=\"cmat-rating-half\"\r\n [ngStyle]=\"{ opacity: isIn(i) ? 1 : 0 }\"\r\n (focus)=\"onFocus()\"\r\n (mouseover)=\"onMouseover($event, i, true)\"\r\n (click)=\"onClick($event, i, true)\"\r\n >\r\n <mat-icon\r\n [ngClass]=\"{ 'text-current': !color() }\"\r\n [color]=\"color()\"\r\n [svgIcon]=\"\r\n 'mat_outline:' + (!value || i >= value ? 'star_border' : 'star')\r\n \"\r\n >\r\n </mat-icon>\r\n </div>\r\n }\r\n <div\r\n role=\"presentation\"\r\n (mouseover)=\"onMouseover($event, i)\"\r\n (click)=\"onClick($event, i)\"\r\n (focus)=\"onFocus()\"\r\n >\r\n <mat-icon\r\n [color]=\"color()\"\r\n [ngClass]=\"{ 'text-current': !color() }\"\r\n [svgIcon]=\"\r\n 'mat_outline:' +\r\n ((half() && isIn(i)) || !value || i >= value\r\n ? 'star_border'\r\n : 'star')\r\n \"\r\n >\r\n </mat-icon>\r\n </div>\r\n </div>\r\n }\r\n</div>",
|
|
310
|
+
styles: ["cmat-rating{display:flex;align-items:center}cmat-rating .cmat-rating-item{position:relative;cursor:pointer;line-height:0}cmat-rating .cmat-rating-item div{display:inline-block;font-size:1rem;padding:0 .1rem}cmat-rating .cmat-rating-item .cmat-rating-half{position:absolute;top:0;left:0;width:45%;z-index:10;opacity:0;overflow:hidden;padding-right:0}cmat-rating .cmat-rating-readonly .cmat-rating-item{cursor:not-allowed}\n"]
|
|
311
|
+
}]
|
|
312
|
+
}],
|
|
313
|
+
ctorParameters: () => [],
|
|
314
|
+
propDecorators: {
|
|
315
|
+
_ratingElementRef: [{
|
|
316
|
+
type: i0.ViewChild,
|
|
317
|
+
args: ["rating", { isSignal: true }]
|
|
318
|
+
}],
|
|
319
|
+
stars: [{
|
|
320
|
+
type: i0.Input,
|
|
321
|
+
args: [{
|
|
322
|
+
isSignal: true,
|
|
323
|
+
alias: "stars",
|
|
324
|
+
required: false
|
|
325
|
+
}]
|
|
326
|
+
}],
|
|
327
|
+
readonly: [{
|
|
328
|
+
type: i0.Input,
|
|
329
|
+
args: [{
|
|
330
|
+
isSignal: true,
|
|
331
|
+
alias: "readonly",
|
|
332
|
+
required: false
|
|
333
|
+
}]
|
|
334
|
+
}],
|
|
335
|
+
hover: [{
|
|
336
|
+
type: i0.Input,
|
|
337
|
+
args: [{
|
|
338
|
+
isSignal: true,
|
|
339
|
+
alias: "hover",
|
|
340
|
+
required: false
|
|
341
|
+
}]
|
|
342
|
+
}],
|
|
343
|
+
half: [{
|
|
344
|
+
type: i0.Input,
|
|
345
|
+
args: [{
|
|
346
|
+
isSignal: true,
|
|
347
|
+
alias: "half",
|
|
348
|
+
required: false
|
|
349
|
+
}]
|
|
350
|
+
}],
|
|
351
|
+
color: [{
|
|
352
|
+
type: i0.Input,
|
|
353
|
+
args: [{
|
|
354
|
+
isSignal: true,
|
|
355
|
+
alias: "color",
|
|
356
|
+
required: false
|
|
357
|
+
}]
|
|
358
|
+
}],
|
|
359
|
+
showMode: [{
|
|
360
|
+
type: i0.Input,
|
|
361
|
+
args: [{
|
|
362
|
+
isSignal: true,
|
|
363
|
+
alias: "showMode",
|
|
364
|
+
required: false
|
|
365
|
+
}]
|
|
366
|
+
}],
|
|
367
|
+
valueChange: [{
|
|
368
|
+
type: i0.Output,
|
|
369
|
+
args: ["valueChange"]
|
|
370
|
+
}],
|
|
371
|
+
placeholder: [{ type: Input }],
|
|
372
|
+
value: [{ type: Input }],
|
|
373
|
+
required: [{ type: Input }],
|
|
374
|
+
disabled: [{ type: Input }]
|
|
375
|
+
}
|
|
376
|
+
});
|
|
204
377
|
export { CmatRatingComponent };
|
|
205
|
-
|
|
378
|
+
|
|
379
|
+
//# sourceMappingURL=cmat-components-rating.mjs.map
|