@4sh/ui-kit 0.16.0 → 0.17.0
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/README.fr.md +10 -10
- package/README.md +10 -10
- package/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs +542 -150
- package/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-actions-ui-button.mjs +622 -248
- package/fesm2022/4sh-ui-kit-actions-ui-button.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-actions-ui-link.mjs +385 -152
- package/fesm2022/4sh-ui-kit-actions-ui-link.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs +748 -433
- package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-base-ui-icon.mjs +227 -135
- package/fesm2022/4sh-ui-kit-base-ui-icon.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-base-ui-image.mjs +1200 -633
- package/fesm2022/4sh-ui-kit-base-ui-image.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs +1675 -1000
- package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-checkbox.mjs +243 -117
- package/fesm2022/4sh-ui-kit-forms-ui-checkbox.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs +2294 -2048
- package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs +1058 -1113
- package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-field-sign.mjs +1108 -0
- package/fesm2022/4sh-ui-kit-forms-ui-field-sign.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-forms-ui-field.mjs +397 -141
- package/fesm2022/4sh-ui-kit-forms-ui-field.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs +1529 -583
- package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-date.mjs +383 -224
- package/fesm2022/4sh-ui-kit-forms-ui-input-date.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs +345 -177
- package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs +280 -138
- package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs +507 -257
- package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-otp.mjs +401 -312
- package/fesm2022/4sh-ui-kit-forms-ui-input-otp.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs +1277 -697
- package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input.mjs +467 -199
- package/fesm2022/4sh-ui-kit-forms-ui-input.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-knob.mjs +394 -270
- package/fesm2022/4sh-ui-kit-forms-ui-knob.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-label.mjs +140 -60
- package/fesm2022/4sh-ui-kit-forms-ui-label.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs +386 -167
- package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-radio.mjs +150 -87
- package/fesm2022/4sh-ui-kit-forms-ui-radio.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-rating.mjs +345 -180
- package/fesm2022/4sh-ui-kit-forms-ui-rating.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs +582 -392
- package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-select.mjs +1552 -888
- package/fesm2022/4sh-ui-kit-forms-ui-select.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-slider.mjs +485 -338
- package/fesm2022/4sh-ui-kit-forms-ui-slider.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs +503 -311
- package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs +271 -137
- package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-toggle-block.mjs +457 -214
- package/fesm2022/4sh-ui-kit-forms-ui-toggle-block.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs +711 -371
- package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-toggle.mjs +235 -121
- package/fesm2022/4sh-ui-kit-forms-ui-toggle.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms.mjs +721 -638
- package/fesm2022/4sh-ui-kit-forms.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-accordion.mjs +546 -242
- package/fesm2022/4sh-ui-kit-informative-ui-accordion.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs +335 -157
- package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-avatar-group.mjs +53 -33
- package/fesm2022/4sh-ui-kit-informative-ui-avatar-group.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-avatar.mjs +218 -121
- package/fesm2022/4sh-ui-kit-informative-ui-avatar.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs +192 -100
- package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs +456 -204
- package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-empty-state.mjs +314 -147
- package/fesm2022/4sh-ui-kit-informative-ui-empty-state.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-helper.mjs +179 -82
- package/fesm2022/4sh-ui-kit-informative-ui-helper.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-progress-bar.mjs +268 -123
- package/fesm2022/4sh-ui-kit-informative-ui-progress-bar.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-read-only.mjs +391 -146
- package/fesm2022/4sh-ui-kit-informative-ui-read-only.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-separator.mjs +158 -76
- package/fesm2022/4sh-ui-kit-informative-ui-separator.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-skeleton.mjs +159 -80
- package/fesm2022/4sh-ui-kit-informative-ui-skeleton.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-spinner.mjs +295 -131
- package/fesm2022/4sh-ui-kit-informative-ui-spinner.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-tag.mjs +211 -83
- package/fesm2022/4sh-ui-kit-informative-ui-tag.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs +784 -414
- package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs +822 -476
- package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-layout-ui-bottom-sheet.mjs +1014 -599
- package/fesm2022/4sh-ui-kit-layout-ui-bottom-sheet.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-layout-ui-card.mjs +403 -189
- package/fesm2022/4sh-ui-kit-layout-ui-card.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs +707 -272
- package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs +1146 -568
- package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-layout-ui-popover.mjs +519 -308
- package/fesm2022/4sh-ui-kit-layout-ui-popover.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-motion.mjs +252 -150
- package/fesm2022/4sh-ui-kit-motion.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-bottom-tab-bar.mjs +793 -341
- package/fesm2022/4sh-ui-kit-navigation-ui-bottom-tab-bar.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs +351 -194
- package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-context-menu.mjs +511 -220
- package/fesm2022/4sh-ui-kit-navigation-ui-context-menu.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs +910 -548
- package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs +1128 -555
- package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs +915 -470
- package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs +931 -474
- package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-overlay.mjs +26 -109
- package/fesm2022/4sh-ui-kit-overlay.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-ripple.mjs +329 -290
- package/fesm2022/4sh-ui-kit-ripple.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs +709 -248
- package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-table-ui-table.mjs +2633 -1370
- package/fesm2022/4sh-ui-kit-table-ui-table.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-theming.mjs +112 -113
- package/fesm2022/4sh-ui-kit-theming.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-types.mjs +0 -12
- package/fesm2022/4sh-ui-kit.mjs +3 -15
- package/fesm2022/4sh-ui-kit.mjs.map +1 -1
- package/mcp/data/component-api.json +299 -2
- package/mcp/data/text-search-docs.json +149 -9
- package/mcp/data/ui-config.json +378 -1
- package/mcp/index.js +8190 -2876
- package/mcp/package.json +1 -1
- package/package.json +5 -1
- package/styles/component-vars.scss +22 -1
- package/types/4sh-ui-kit-actions-ui-button-split.d.ts +198 -87
- package/types/4sh-ui-kit-actions-ui-button.d.ts +240 -116
- package/types/4sh-ui-kit-actions-ui-link.d.ts +136 -67
- package/types/4sh-ui-kit-actions-ui-speed-dial.d.ts +287 -180
- package/types/4sh-ui-kit-base-ui-icon.d.ts +92 -58
- package/types/4sh-ui-kit-base-ui-image.d.ts +406 -205
- package/types/4sh-ui-kit-forms-ui-autocomplete.d.ts +573 -376
- package/types/4sh-ui-kit-forms-ui-checkbox.d.ts +77 -42
- package/types/4sh-ui-kit-forms-ui-datepicker.d.ts +953 -700
- package/types/4sh-ui-kit-forms-ui-editor.d.ts +374 -340
- package/types/4sh-ui-kit-forms-ui-field-sign.d.ts +325 -0
- package/types/4sh-ui-kit-forms-ui-field.d.ts +150 -64
- package/types/4sh-ui-kit-forms-ui-file-upload.d.ts +583 -241
- package/types/4sh-ui-kit-forms-ui-input-date.d.ts +152 -103
- package/types/4sh-ui-kit-forms-ui-input-group.d.ts +109 -63
- package/types/4sh-ui-kit-forms-ui-input-mask.d.ts +93 -59
- package/types/4sh-ui-kit-forms-ui-input-number.d.ts +171 -96
- package/types/4sh-ui-kit-forms-ui-input-otp.d.ts +137 -104
- package/types/4sh-ui-kit-forms-ui-input-tags.d.ts +469 -309
- package/types/4sh-ui-kit-forms-ui-input.d.ts +198 -118
- package/types/4sh-ui-kit-forms-ui-knob.d.ts +132 -80
- package/types/4sh-ui-kit-forms-ui-label.d.ts +47 -22
- package/types/4sh-ui-kit-forms-ui-nudger.d.ts +134 -67
- package/types/4sh-ui-kit-forms-ui-radio.d.ts +48 -33
- package/types/4sh-ui-kit-forms-ui-rating.d.ts +120 -86
- package/types/4sh-ui-kit-forms-ui-segment-control.d.ts +221 -147
- package/types/4sh-ui-kit-forms-ui-select.d.ts +561 -357
- package/types/4sh-ui-kit-forms-ui-slider.d.ts +156 -105
- package/types/4sh-ui-kit-forms-ui-swatch-picker.d.ts +133 -97
- package/types/4sh-ui-kit-forms-ui-textarea.d.ts +90 -56
- package/types/4sh-ui-kit-forms-ui-toggle-block.d.ts +158 -94
- package/types/4sh-ui-kit-forms-ui-toggle-button.d.ts +314 -178
- package/types/4sh-ui-kit-forms-ui-toggle.d.ts +88 -54
- package/types/4sh-ui-kit-forms.d.ts +275 -194
- package/types/4sh-ui-kit-informative-ui-accordion.d.ts +162 -92
- package/types/4sh-ui-kit-informative-ui-alert.d.ts +128 -62
- package/types/4sh-ui-kit-informative-ui-avatar-group.d.ts +8 -8
- package/types/4sh-ui-kit-informative-ui-avatar.d.ts +81 -44
- package/types/4sh-ui-kit-informative-ui-badge.d.ts +71 -41
- package/types/4sh-ui-kit-informative-ui-chip.d.ts +194 -99
- package/types/4sh-ui-kit-informative-ui-empty-state.d.ts +105 -65
- package/types/4sh-ui-kit-informative-ui-helper.d.ts +64 -34
- package/types/4sh-ui-kit-informative-ui-progress-bar.d.ts +120 -65
- package/types/4sh-ui-kit-informative-ui-read-only.d.ts +147 -67
- package/types/4sh-ui-kit-informative-ui-separator.d.ts +65 -35
- package/types/4sh-ui-kit-informative-ui-skeleton.d.ts +62 -32
- package/types/4sh-ui-kit-informative-ui-spinner.d.ts +111 -50
- package/types/4sh-ui-kit-informative-ui-tag.d.ts +77 -37
- package/types/4sh-ui-kit-informative-ui-toast.d.ts +300 -180
- package/types/4sh-ui-kit-informative-ui-tooltip.d.ts +269 -141
- package/types/4sh-ui-kit-layout-ui-bottom-sheet.d.ts +360 -221
- package/types/4sh-ui-kit-layout-ui-card.d.ts +119 -79
- package/types/4sh-ui-kit-layout-ui-drawer.d.ts +244 -120
- package/types/4sh-ui-kit-layout-ui-modal.d.ts +409 -222
- package/types/4sh-ui-kit-layout-ui-popover.d.ts +149 -91
- package/types/4sh-ui-kit-motion.d.ts +117 -67
- package/types/4sh-ui-kit-navigation-ui-bottom-tab-bar.d.ts +279 -145
- package/types/4sh-ui-kit-navigation-ui-breadcrumb.d.ts +134 -96
- package/types/4sh-ui-kit-navigation-ui-context-menu.d.ts +148 -89
- package/types/4sh-ui-kit-navigation-ui-menu.d.ts +282 -201
- package/types/4sh-ui-kit-navigation-ui-sidebar.d.ts +425 -261
- package/types/4sh-ui-kit-navigation-ui-stepper.d.ts +279 -183
- package/types/4sh-ui-kit-navigation-ui-tabs.d.ts +275 -173
- package/types/4sh-ui-kit-overlay.d.ts +6 -6
- package/types/4sh-ui-kit-ripple.d.ts +99 -74
- package/types/4sh-ui-kit-table-ui-paginator.d.ts +237 -133
- package/types/4sh-ui-kit-table-ui-table.d.ts +769 -470
- package/types/4sh-ui-kit-theming.d.ts +27 -29
- package/types/4sh-ui-kit-types.d.ts +6 -5
- package/types/4sh-ui-kit.d.ts +4 -3
- package/fesm2022/4sh-ui-kit-types.mjs.map +0 -1
|
@@ -1,313 +1,402 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
import { NgTemplateOutlet } from
|
|
4
|
-
import { NG_VALUE_ACCESSOR } from
|
|
5
|
-
import { BaseFieldControl,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Component, ElementRef, afterNextRender, booleanAttribute, computed, contentChild, effect, forwardRef, inject, input, isDevMode, numberAttribute, output, signal } from "@angular/core";
|
|
3
|
+
import { NgTemplateOutlet } from "@angular/common";
|
|
4
|
+
import { NG_VALUE_ACCESSOR } from "@angular/forms";
|
|
5
|
+
import { BaseFieldControl, UiBrowserFill, hasFocus, warnMissingAccessibleName } from "@4sh/ui-kit/forms";
|
|
6
|
+
var UiInputOtp = class UiInputOtp extends BaseFieldControl {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
this.length = input(4, {
|
|
10
|
+
...ngDevMode ? { debugName: "length" } : /* istanbul ignore next */ {},
|
|
11
|
+
transform: numberAttribute
|
|
12
|
+
});
|
|
13
|
+
this.mask = input(false, {
|
|
14
|
+
...ngDevMode ? { debugName: "mask" } : /* istanbul ignore next */ {},
|
|
15
|
+
transform: booleanAttribute
|
|
16
|
+
});
|
|
17
|
+
this.integerOnly = input(false, {
|
|
18
|
+
...ngDevMode ? { debugName: "integerOnly" } : /* istanbul ignore next */ {},
|
|
19
|
+
transform: booleanAttribute
|
|
20
|
+
});
|
|
21
|
+
this.size = input("default", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
22
|
+
this.charAriaLabel = input("Caractère", ...ngDevMode ? [{ debugName: "charAriaLabel" }] : /* istanbul ignore next */ []);
|
|
23
|
+
this.autofocus = input(false, {
|
|
24
|
+
...ngDevMode ? { debugName: "autofocus" } : /* istanbul ignore next */ {},
|
|
25
|
+
transform: booleanAttribute
|
|
26
|
+
});
|
|
27
|
+
this.valueChange = output();
|
|
28
|
+
this.completed = output();
|
|
29
|
+
this.inputTemplate = contentChild("input", ...ngDevMode ? [{ debugName: "inputTemplate" }] : /* istanbul ignore next */ []);
|
|
30
|
+
this.host = inject(ElementRef);
|
|
31
|
+
this.tokens = signal([], ...ngDevMode ? [{ debugName: "tokens" }] : /* istanbul ignore next */ []);
|
|
32
|
+
this.focusedIndex = signal(0, ...ngDevMode ? [{ debugName: "focusedIndex" }] : /* istanbul ignore next */ []);
|
|
33
|
+
this.inputType = computed(() => this.mask() ? "password" : "text", ...ngDevMode ? [{ debugName: "inputType" }] : /* istanbul ignore next */ []);
|
|
34
|
+
this.inputMode = computed(() => this.integerOnly() ? "numeric" : "text", ...ngDevMode ? [{ debugName: "inputMode" }] : /* istanbul ignore next */ []);
|
|
35
|
+
this.cells = computed(() => {
|
|
36
|
+
const tokens = this.tokens();
|
|
37
|
+
return Array.from({ length: Math.max(0, this.length()) }, (_, index) => ({
|
|
38
|
+
index,
|
|
39
|
+
id: `${this.uid}-${index}`,
|
|
40
|
+
value: tokens[index] ?? ""
|
|
41
|
+
}));
|
|
42
|
+
}, ...ngDevMode ? [{ debugName: "cells" }] : /* istanbul ignore next */ []);
|
|
43
|
+
afterNextRender(() => {
|
|
44
|
+
if (this.autofocus() && !this.isDisabled()) this.focusCell(0);
|
|
45
|
+
});
|
|
46
|
+
if (isDevMode()) effect(() => {
|
|
47
|
+
if (!this.ariaLabel() && !this.ariaLabelledBy()) warnMissingAccessibleName("ui-input-otp", "Group has no accessible name: provide `ariaLabel` (or `ariaLabelledBy`).");
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
writeValue(value) {
|
|
51
|
+
this.tokens.set(this.toTokens(value));
|
|
52
|
+
}
|
|
53
|
+
uidPrefix() {
|
|
54
|
+
return "ui-input-otp";
|
|
55
|
+
}
|
|
56
|
+
focus(options) {
|
|
57
|
+
this.focusCell(0, options);
|
|
58
|
+
}
|
|
59
|
+
tabindexFor(index) {
|
|
60
|
+
const active = Math.min(this.focusedIndex(), this.length() - 1);
|
|
61
|
+
return index === Math.max(0, active) ? 0 : -1;
|
|
62
|
+
}
|
|
63
|
+
cellValue(index) {
|
|
64
|
+
return this.tokens()[index] ?? "";
|
|
65
|
+
}
|
|
66
|
+
cellEvents(index) {
|
|
67
|
+
return {
|
|
68
|
+
input: (event) => this.onInput(event, index),
|
|
69
|
+
keydown: (event) => this.onKeydown(event, index),
|
|
70
|
+
focus: (event) => this.onFocus(event, index),
|
|
71
|
+
blur: () => {},
|
|
72
|
+
paste: (event) => this.onPaste(event, index),
|
|
73
|
+
browserFill: (event) => this.onBrowserFill(event, index)
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
onInput(event, index) {
|
|
77
|
+
if (this.readonly()) return;
|
|
78
|
+
const target = event.target;
|
|
79
|
+
const raw = this.sanitize(target.value);
|
|
80
|
+
const typed = hasFocus(target);
|
|
81
|
+
if (raw.length > 1) {
|
|
82
|
+
target.value = raw.charAt(0);
|
|
83
|
+
this.setFromIndex(index, raw, typed);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
const tokens = [...this.tokens()];
|
|
87
|
+
tokens[index] = raw;
|
|
88
|
+
target.value = raw;
|
|
89
|
+
this.commit(tokens);
|
|
90
|
+
if (!typed) return;
|
|
91
|
+
const inputType = event.inputType;
|
|
92
|
+
if (raw) this.focusCell(index + 1);
|
|
93
|
+
else if (inputType === "deleteContentBackward") this.focusCell(index - 1);
|
|
94
|
+
}
|
|
95
|
+
onBrowserFill(event, index) {
|
|
96
|
+
if (event.target.value !== this.cellValue(index)) this.onInput(event, index);
|
|
97
|
+
}
|
|
98
|
+
onKeydown(event, index) {
|
|
99
|
+
if (!(event instanceof KeyboardEvent)) return;
|
|
100
|
+
if (event.altKey || event.ctrlKey || event.metaKey) return;
|
|
101
|
+
const target = event.target;
|
|
102
|
+
switch (event.key) {
|
|
103
|
+
case "ArrowLeft":
|
|
104
|
+
event.preventDefault();
|
|
105
|
+
this.focusCell(index - 1);
|
|
106
|
+
return;
|
|
107
|
+
case "ArrowRight":
|
|
108
|
+
event.preventDefault();
|
|
109
|
+
this.focusCell(index + 1);
|
|
110
|
+
return;
|
|
111
|
+
case "Home":
|
|
112
|
+
event.preventDefault();
|
|
113
|
+
this.focusCell(0);
|
|
114
|
+
return;
|
|
115
|
+
case "End":
|
|
116
|
+
event.preventDefault();
|
|
117
|
+
this.focusCell(this.length() - 1);
|
|
118
|
+
return;
|
|
119
|
+
case "ArrowUp":
|
|
120
|
+
case "ArrowDown":
|
|
121
|
+
event.preventDefault();
|
|
122
|
+
return;
|
|
123
|
+
case "Backspace":
|
|
124
|
+
if (!target.value && !this.readonly()) {
|
|
125
|
+
event.preventDefault();
|
|
126
|
+
const tokens = [...this.tokens()];
|
|
127
|
+
if (tokens[index - 1] !== void 0) tokens[index - 1] = "";
|
|
128
|
+
this.commit(tokens);
|
|
129
|
+
this.focusCell(index - 1);
|
|
130
|
+
}
|
|
131
|
+
return;
|
|
132
|
+
default:
|
|
133
|
+
if (event.key.length !== 1) return;
|
|
134
|
+
if (this.integerOnly() && !/^\d$/.test(event.key)) event.preventDefault();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
onFocus(event, index) {
|
|
138
|
+
const cell = event.target;
|
|
139
|
+
if (!hasFocus(cell)) return;
|
|
140
|
+
this.focusedIndex.set(index);
|
|
141
|
+
cell.select?.();
|
|
142
|
+
}
|
|
143
|
+
onPaste(event, index) {
|
|
144
|
+
if (this.isDisabled() || this.readonly()) return;
|
|
145
|
+
event.preventDefault();
|
|
146
|
+
const pasted = this.sanitize(event.clipboardData?.getData("text") ?? "");
|
|
147
|
+
if (pasted) this.setFromIndex(index, pasted);
|
|
148
|
+
}
|
|
149
|
+
onFocusOut(event) {
|
|
150
|
+
const next = event.relatedTarget;
|
|
151
|
+
if (!next || !this.host.nativeElement.contains(next)) this.emitTouch();
|
|
152
|
+
}
|
|
153
|
+
setFromIndex(from, chars, moveFocus = true) {
|
|
154
|
+
const tokens = [...this.tokens()];
|
|
155
|
+
const max = this.length();
|
|
156
|
+
let i = from;
|
|
157
|
+
for (const ch of chars) {
|
|
158
|
+
if (i >= max) break;
|
|
159
|
+
tokens[i++] = ch;
|
|
160
|
+
}
|
|
161
|
+
this.commit(tokens);
|
|
162
|
+
if (moveFocus) this.focusCell(Math.min(i, max - 1));
|
|
163
|
+
}
|
|
164
|
+
commit(tokens) {
|
|
165
|
+
const trimmed = tokens.slice(0, this.length());
|
|
166
|
+
this.tokens.set(trimmed);
|
|
167
|
+
const value = trimmed.join("");
|
|
168
|
+
this.emitChange(value);
|
|
169
|
+
this.valueChange.emit(value);
|
|
170
|
+
if (value.length === this.length() && trimmed.every((c) => c !== "")) this.completed.emit(value);
|
|
171
|
+
}
|
|
172
|
+
focusCell(index, options) {
|
|
173
|
+
if (index < 0 || index >= this.length()) return;
|
|
174
|
+
this.focusedIndex.set(index);
|
|
175
|
+
const el = this.host.nativeElement.querySelectorAll("input")[index];
|
|
176
|
+
if (el) {
|
|
177
|
+
el.focus(options);
|
|
178
|
+
el.select();
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
toTokens(value) {
|
|
182
|
+
if (value === null || value === void 0 || value === "") return [];
|
|
183
|
+
return String(value).split("").slice(0, this.length());
|
|
184
|
+
}
|
|
185
|
+
sanitize(value) {
|
|
186
|
+
return this.integerOnly() ? value.replace(/\D/g, "") : value;
|
|
187
|
+
}
|
|
188
|
+
static {
|
|
189
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
190
|
+
minVersion: "12.0.0",
|
|
191
|
+
version: "22.3.0",
|
|
192
|
+
ngImport: i0,
|
|
193
|
+
type: UiInputOtp,
|
|
194
|
+
deps: [],
|
|
195
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
static {
|
|
199
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
200
|
+
minVersion: "17.0.0",
|
|
201
|
+
version: "22.3.0",
|
|
202
|
+
type: UiInputOtp,
|
|
203
|
+
isStandalone: true,
|
|
204
|
+
selector: "ui-input-otp",
|
|
205
|
+
inputs: {
|
|
206
|
+
length: {
|
|
207
|
+
classPropertyName: "length",
|
|
208
|
+
publicName: "length",
|
|
209
|
+
isSignal: true,
|
|
210
|
+
isRequired: false,
|
|
211
|
+
transformFunction: null
|
|
212
|
+
},
|
|
213
|
+
mask: {
|
|
214
|
+
classPropertyName: "mask",
|
|
215
|
+
publicName: "mask",
|
|
216
|
+
isSignal: true,
|
|
217
|
+
isRequired: false,
|
|
218
|
+
transformFunction: null
|
|
219
|
+
},
|
|
220
|
+
integerOnly: {
|
|
221
|
+
classPropertyName: "integerOnly",
|
|
222
|
+
publicName: "integerOnly",
|
|
223
|
+
isSignal: true,
|
|
224
|
+
isRequired: false,
|
|
225
|
+
transformFunction: null
|
|
226
|
+
},
|
|
227
|
+
size: {
|
|
228
|
+
classPropertyName: "size",
|
|
229
|
+
publicName: "size",
|
|
230
|
+
isSignal: true,
|
|
231
|
+
isRequired: false,
|
|
232
|
+
transformFunction: null
|
|
233
|
+
},
|
|
234
|
+
charAriaLabel: {
|
|
235
|
+
classPropertyName: "charAriaLabel",
|
|
236
|
+
publicName: "charAriaLabel",
|
|
237
|
+
isSignal: true,
|
|
238
|
+
isRequired: false,
|
|
239
|
+
transformFunction: null
|
|
240
|
+
},
|
|
241
|
+
autofocus: {
|
|
242
|
+
classPropertyName: "autofocus",
|
|
243
|
+
publicName: "autofocus",
|
|
244
|
+
isSignal: true,
|
|
245
|
+
isRequired: false,
|
|
246
|
+
transformFunction: null
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
outputs: {
|
|
250
|
+
valueChange: "valueChange",
|
|
251
|
+
completed: "completed"
|
|
252
|
+
},
|
|
253
|
+
host: {
|
|
254
|
+
attributes: { "role": "group" },
|
|
255
|
+
listeners: { "focusout": "onFocusOut($event)" },
|
|
256
|
+
properties: {
|
|
257
|
+
"class._small": "size() === 'small'",
|
|
258
|
+
"class._large": "size() === 'large'",
|
|
259
|
+
"class._disabled": "isDisabled()",
|
|
260
|
+
"class._readonly": "readonly()",
|
|
261
|
+
"class._invalid": "isInvalid()",
|
|
262
|
+
"attr.aria-label": "ariaLabel() || null",
|
|
263
|
+
"attr.aria-labelledby": "ariaLabelledBy() || null",
|
|
264
|
+
"attr.aria-invalid": "isInvalid() ? 'true' : null",
|
|
265
|
+
"attr.aria-disabled": "isDisabled() ? 'true' : null"
|
|
266
|
+
},
|
|
267
|
+
classAttribute: "ui-input-otp"
|
|
268
|
+
},
|
|
269
|
+
providers: [{
|
|
270
|
+
provide: NG_VALUE_ACCESSOR,
|
|
271
|
+
useExisting: forwardRef(() => UiInputOtp),
|
|
272
|
+
multi: true
|
|
273
|
+
}],
|
|
274
|
+
queries: [{
|
|
275
|
+
propertyName: "inputTemplate",
|
|
276
|
+
first: true,
|
|
277
|
+
predicate: ["input"],
|
|
278
|
+
descendants: true,
|
|
279
|
+
isSignal: true
|
|
280
|
+
}],
|
|
281
|
+
usesInheritance: true,
|
|
282
|
+
ngImport: i0,
|
|
283
|
+
template: "@for (cell of cells(); track cell.index) {\n @if (inputTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: cell.value,\n value: cell.value,\n index: cell.index,\n events: cellEvents(cell.index),\n tabindex: tabindexFor(cell.index),\n }\"\n />\n } @else {\n <input\n uiBrowserFill\n class=\"ui-input-otp-cell\"\n [id]=\"cell.id\"\n [type]=\"inputType()\"\n [value]=\"cell.value\"\n maxlength=\"1\"\n autocomplete=\"one-time-code\"\n [attr.inputmode]=\"inputMode()\"\n [attr.name]=\"name() ? name() + '-' + cell.index : null\"\n [attr.tabindex]=\"tabindexFor(cell.index)\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly()\"\n [attr.aria-label]=\"(ariaLabel() || charAriaLabel()) + ' ' + (cell.index + 1)\"\n [attr.aria-invalid]=\"isInvalid() ? 'true' : null\"\n (input)=\"onInput($event, cell.index)\"\n (browserFill)=\"onBrowserFill($event, cell.index)\"\n (keydown)=\"onKeydown($event, cell.index)\"\n (focus)=\"onFocus($event, cell.index)\"\n (paste)=\"onPaste($event, cell.index)\"\n />\n }\n}\n",
|
|
284
|
+
styles: [":host{display:inline-flex;align-items:center;gap:var(--ui-input-otp-gap, var(--units-sm));font-family:var(--ui-input-otp-font-family, var(--fontfamily-base))}:host .ui-input-otp-cell{inline-size:var(--ui-input-otp-cell-size, var(--size-components-default));block-size:var(--ui-input-otp-cell-size, var(--size-components-default));font-size:var(--ui-input-otp-font-size, var(--size-typography-text-default))}:host._small .ui-input-otp-cell{inline-size:var(--ui-input-otp-cell-size-small, var(--size-components-sm));block-size:var(--ui-input-otp-cell-size-small, var(--size-components-sm));font-size:var(--ui-input-otp-font-size-small, var(--size-typography-text-md))}:host._large .ui-input-otp-cell{inline-size:var(--ui-input-otp-cell-size-large, var(--size-components-xl));block-size:var(--ui-input-otp-cell-size-large, var(--size-components-xl));font-size:var(--ui-input-otp-font-size-large, var(--size-typography-text-lg))}@keyframes ui-browser-fill{0%{opacity:1}}.ui-browser-fill:-webkit-autofill{animation:ui-browser-fill 0s}.ui-input-otp-cell{--_stroke: var(--ui-input-otp-cell-stroke, var(--form-high-stroke-default));--_stroke-hover: var(--ui-input-otp-cell-stroke-hover, var(--form-high-stroke-hover));--_stroke-focus: var(--ui-input-otp-cell-stroke-focus, var(--form-high-stroke-focused));box-sizing:border-box;min-inline-size:0;margin:0;padding:0;border:var(--ui-input-otp-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) solid var(--_stroke);border-radius:var(--ui-input-otp-radius, var(--ui-form-field-radius, var(--radius-sm)));background-color:var(--ui-input-otp-cell-surface, var(--form-high-surface-default));color:var(--ui-input-otp-cell-color, var(--form-high-content-default));font-family:inherit;font-weight:var(--ui-input-otp-weight, var(--weight-bold));text-align:center;caret-color:var(--ui-input-otp-cell-color, var(--form-high-content-default));transition:background-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),border-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),box-shadow var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-input-otp-cell:hover:not(:disabled):not(:focus){border-color:var(--_stroke-hover)}.ui-input-otp-cell:focus,.ui-input-otp-cell:focus-visible{outline:none;border-color:var(--_stroke-focus);box-shadow:0 0 0 var(--ui-input-otp-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) rgb(from var(--_stroke-focus) r g b/50%)}.ui-input-otp-cell:disabled{border-color:var(--ui-input-otp-cell-stroke-disabled, var(--form-high-stroke-disabled));background-color:var(--ui-input-otp-cell-surface-disabled, var(--form-high-surface-disabled));color:var(--ui-input-otp-cell-color-disabled, var(--form-high-content-disabled));cursor:not-allowed}:host._readonly .ui-input-otp-cell{cursor:default}:host._invalid .ui-input-otp-cell{--_stroke: var(--ui-input-otp-cell-stroke-invalid, var(--form-error-stroke-default));--_stroke-hover: var(--ui-input-otp-cell-stroke-hover-invalid, var(--form-error-stroke-hover));--_stroke-focus: var(--ui-input-otp-cell-stroke-focus-invalid, var(--form-error-stroke-focused))}\n"],
|
|
285
|
+
dependencies: [{
|
|
286
|
+
kind: "directive",
|
|
287
|
+
type: NgTemplateOutlet,
|
|
288
|
+
selector: "[ngTemplateOutlet]",
|
|
289
|
+
inputs: [
|
|
290
|
+
"ngTemplateOutletContext",
|
|
291
|
+
"ngTemplateOutlet",
|
|
292
|
+
"ngTemplateOutletInjector"
|
|
293
|
+
]
|
|
294
|
+
}, {
|
|
295
|
+
kind: "directive",
|
|
296
|
+
type: UiBrowserFill,
|
|
297
|
+
selector: "[uiBrowserFill]",
|
|
298
|
+
outputs: ["browserFill"]
|
|
299
|
+
}]
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
};
|
|
303
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
304
|
+
minVersion: "12.0.0",
|
|
305
|
+
version: "22.3.0",
|
|
306
|
+
ngImport: i0,
|
|
307
|
+
type: UiInputOtp,
|
|
308
|
+
decorators: [{
|
|
309
|
+
type: Component,
|
|
310
|
+
args: [{
|
|
311
|
+
selector: "ui-input-otp",
|
|
312
|
+
imports: [NgTemplateOutlet, UiBrowserFill],
|
|
313
|
+
providers: [{
|
|
314
|
+
provide: NG_VALUE_ACCESSOR,
|
|
315
|
+
useExisting: forwardRef(() => UiInputOtp),
|
|
316
|
+
multi: true
|
|
317
|
+
}],
|
|
318
|
+
host: {
|
|
319
|
+
class: "ui-input-otp",
|
|
320
|
+
role: "group",
|
|
321
|
+
"[class._small]": "size() === 'small'",
|
|
322
|
+
"[class._large]": "size() === 'large'",
|
|
323
|
+
"[class._disabled]": "isDisabled()",
|
|
324
|
+
"[class._readonly]": "readonly()",
|
|
325
|
+
"[class._invalid]": "isInvalid()",
|
|
326
|
+
"[attr.aria-label]": "ariaLabel() || null",
|
|
327
|
+
"[attr.aria-labelledby]": "ariaLabelledBy() || null",
|
|
328
|
+
"[attr.aria-invalid]": "isInvalid() ? 'true' : null",
|
|
329
|
+
"[attr.aria-disabled]": "isDisabled() ? 'true' : null",
|
|
330
|
+
"(focusout)": "onFocusOut($event)"
|
|
331
|
+
},
|
|
332
|
+
template: "@for (cell of cells(); track cell.index) {\n @if (inputTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: cell.value,\n value: cell.value,\n index: cell.index,\n events: cellEvents(cell.index),\n tabindex: tabindexFor(cell.index),\n }\"\n />\n } @else {\n <input\n uiBrowserFill\n class=\"ui-input-otp-cell\"\n [id]=\"cell.id\"\n [type]=\"inputType()\"\n [value]=\"cell.value\"\n maxlength=\"1\"\n autocomplete=\"one-time-code\"\n [attr.inputmode]=\"inputMode()\"\n [attr.name]=\"name() ? name() + '-' + cell.index : null\"\n [attr.tabindex]=\"tabindexFor(cell.index)\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly()\"\n [attr.aria-label]=\"(ariaLabel() || charAriaLabel()) + ' ' + (cell.index + 1)\"\n [attr.aria-invalid]=\"isInvalid() ? 'true' : null\"\n (input)=\"onInput($event, cell.index)\"\n (browserFill)=\"onBrowserFill($event, cell.index)\"\n (keydown)=\"onKeydown($event, cell.index)\"\n (focus)=\"onFocus($event, cell.index)\"\n (paste)=\"onPaste($event, cell.index)\"\n />\n }\n}\n",
|
|
333
|
+
styles: [":host{display:inline-flex;align-items:center;gap:var(--ui-input-otp-gap, var(--units-sm));font-family:var(--ui-input-otp-font-family, var(--fontfamily-base))}:host .ui-input-otp-cell{inline-size:var(--ui-input-otp-cell-size, var(--size-components-default));block-size:var(--ui-input-otp-cell-size, var(--size-components-default));font-size:var(--ui-input-otp-font-size, var(--size-typography-text-default))}:host._small .ui-input-otp-cell{inline-size:var(--ui-input-otp-cell-size-small, var(--size-components-sm));block-size:var(--ui-input-otp-cell-size-small, var(--size-components-sm));font-size:var(--ui-input-otp-font-size-small, var(--size-typography-text-md))}:host._large .ui-input-otp-cell{inline-size:var(--ui-input-otp-cell-size-large, var(--size-components-xl));block-size:var(--ui-input-otp-cell-size-large, var(--size-components-xl));font-size:var(--ui-input-otp-font-size-large, var(--size-typography-text-lg))}@keyframes ui-browser-fill{0%{opacity:1}}.ui-browser-fill:-webkit-autofill{animation:ui-browser-fill 0s}.ui-input-otp-cell{--_stroke: var(--ui-input-otp-cell-stroke, var(--form-high-stroke-default));--_stroke-hover: var(--ui-input-otp-cell-stroke-hover, var(--form-high-stroke-hover));--_stroke-focus: var(--ui-input-otp-cell-stroke-focus, var(--form-high-stroke-focused));box-sizing:border-box;min-inline-size:0;margin:0;padding:0;border:var(--ui-input-otp-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) solid var(--_stroke);border-radius:var(--ui-input-otp-radius, var(--ui-form-field-radius, var(--radius-sm)));background-color:var(--ui-input-otp-cell-surface, var(--form-high-surface-default));color:var(--ui-input-otp-cell-color, var(--form-high-content-default));font-family:inherit;font-weight:var(--ui-input-otp-weight, var(--weight-bold));text-align:center;caret-color:var(--ui-input-otp-cell-color, var(--form-high-content-default));transition:background-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),border-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),box-shadow var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-input-otp-cell:hover:not(:disabled):not(:focus){border-color:var(--_stroke-hover)}.ui-input-otp-cell:focus,.ui-input-otp-cell:focus-visible{outline:none;border-color:var(--_stroke-focus);box-shadow:0 0 0 var(--ui-input-otp-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) rgb(from var(--_stroke-focus) r g b/50%)}.ui-input-otp-cell:disabled{border-color:var(--ui-input-otp-cell-stroke-disabled, var(--form-high-stroke-disabled));background-color:var(--ui-input-otp-cell-surface-disabled, var(--form-high-surface-disabled));color:var(--ui-input-otp-cell-color-disabled, var(--form-high-content-disabled));cursor:not-allowed}:host._readonly .ui-input-otp-cell{cursor:default}:host._invalid .ui-input-otp-cell{--_stroke: var(--ui-input-otp-cell-stroke-invalid, var(--form-error-stroke-default));--_stroke-hover: var(--ui-input-otp-cell-stroke-hover-invalid, var(--form-error-stroke-hover));--_stroke-focus: var(--ui-input-otp-cell-stroke-focus-invalid, var(--form-error-stroke-focused))}\n"]
|
|
334
|
+
}]
|
|
335
|
+
}],
|
|
336
|
+
ctorParameters: () => [],
|
|
337
|
+
propDecorators: {
|
|
338
|
+
length: [{
|
|
339
|
+
type: i0.Input,
|
|
340
|
+
args: [{
|
|
341
|
+
isSignal: true,
|
|
342
|
+
alias: "length",
|
|
343
|
+
required: false
|
|
344
|
+
}]
|
|
345
|
+
}],
|
|
346
|
+
mask: [{
|
|
347
|
+
type: i0.Input,
|
|
348
|
+
args: [{
|
|
349
|
+
isSignal: true,
|
|
350
|
+
alias: "mask",
|
|
351
|
+
required: false
|
|
352
|
+
}]
|
|
353
|
+
}],
|
|
354
|
+
integerOnly: [{
|
|
355
|
+
type: i0.Input,
|
|
356
|
+
args: [{
|
|
357
|
+
isSignal: true,
|
|
358
|
+
alias: "integerOnly",
|
|
359
|
+
required: false
|
|
360
|
+
}]
|
|
361
|
+
}],
|
|
362
|
+
size: [{
|
|
363
|
+
type: i0.Input,
|
|
364
|
+
args: [{
|
|
365
|
+
isSignal: true,
|
|
366
|
+
alias: "size",
|
|
367
|
+
required: false
|
|
368
|
+
}]
|
|
369
|
+
}],
|
|
370
|
+
charAriaLabel: [{
|
|
371
|
+
type: i0.Input,
|
|
372
|
+
args: [{
|
|
373
|
+
isSignal: true,
|
|
374
|
+
alias: "charAriaLabel",
|
|
375
|
+
required: false
|
|
376
|
+
}]
|
|
377
|
+
}],
|
|
378
|
+
autofocus: [{
|
|
379
|
+
type: i0.Input,
|
|
380
|
+
args: [{
|
|
381
|
+
isSignal: true,
|
|
382
|
+
alias: "autofocus",
|
|
383
|
+
required: false
|
|
384
|
+
}]
|
|
385
|
+
}],
|
|
386
|
+
valueChange: [{
|
|
387
|
+
type: i0.Output,
|
|
388
|
+
args: ["valueChange"]
|
|
389
|
+
}],
|
|
390
|
+
completed: [{
|
|
391
|
+
type: i0.Output,
|
|
392
|
+
args: ["completed"]
|
|
393
|
+
}],
|
|
394
|
+
inputTemplate: [{
|
|
395
|
+
type: i0.ContentChild,
|
|
396
|
+
args: ["input", { isSignal: true }]
|
|
397
|
+
}]
|
|
398
|
+
}
|
|
399
|
+
});
|
|
312
400
|
export { UiInputOtp };
|
|
313
|
-
|
|
401
|
+
|
|
402
|
+
//# sourceMappingURL=4sh-ui-kit-forms-ui-input-otp.mjs.map
|