@4sh/ui-kit 0.15.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.
Files changed (220) hide show
  1. package/README.fr.md +18 -10
  2. package/README.md +18 -10
  3. package/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs +542 -150
  4. package/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs.map +1 -1
  5. package/fesm2022/4sh-ui-kit-actions-ui-button.mjs +622 -248
  6. package/fesm2022/4sh-ui-kit-actions-ui-button.mjs.map +1 -1
  7. package/fesm2022/4sh-ui-kit-actions-ui-link.mjs +385 -152
  8. package/fesm2022/4sh-ui-kit-actions-ui-link.mjs.map +1 -1
  9. package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs +748 -433
  10. package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs.map +1 -1
  11. package/fesm2022/4sh-ui-kit-base-ui-icon.mjs +227 -135
  12. package/fesm2022/4sh-ui-kit-base-ui-icon.mjs.map +1 -1
  13. package/fesm2022/4sh-ui-kit-base-ui-image.mjs +1200 -633
  14. package/fesm2022/4sh-ui-kit-base-ui-image.mjs.map +1 -1
  15. package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs +1675 -953
  16. package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs.map +1 -1
  17. package/fesm2022/4sh-ui-kit-forms-ui-checkbox.mjs +243 -117
  18. package/fesm2022/4sh-ui-kit-forms-ui-checkbox.mjs.map +1 -1
  19. package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs +2294 -2039
  20. package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs.map +1 -1
  21. package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs +1058 -1113
  22. package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs.map +1 -1
  23. package/fesm2022/4sh-ui-kit-forms-ui-field-sign.mjs +1108 -0
  24. package/fesm2022/4sh-ui-kit-forms-ui-field-sign.mjs.map +1 -0
  25. package/fesm2022/4sh-ui-kit-forms-ui-field.mjs +397 -141
  26. package/fesm2022/4sh-ui-kit-forms-ui-field.mjs.map +1 -1
  27. package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs +1529 -583
  28. package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs.map +1 -1
  29. package/fesm2022/4sh-ui-kit-forms-ui-input-date.mjs +383 -224
  30. package/fesm2022/4sh-ui-kit-forms-ui-input-date.mjs.map +1 -1
  31. package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs +345 -177
  32. package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs.map +1 -1
  33. package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs +280 -130
  34. package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs.map +1 -1
  35. package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs +507 -246
  36. package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs.map +1 -1
  37. package/fesm2022/4sh-ui-kit-forms-ui-input-otp.mjs +401 -291
  38. package/fesm2022/4sh-ui-kit-forms-ui-input-otp.mjs.map +1 -1
  39. package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs +1277 -697
  40. package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs.map +1 -1
  41. package/fesm2022/4sh-ui-kit-forms-ui-input.mjs +467 -194
  42. package/fesm2022/4sh-ui-kit-forms-ui-input.mjs.map +1 -1
  43. package/fesm2022/4sh-ui-kit-forms-ui-knob.mjs +394 -270
  44. package/fesm2022/4sh-ui-kit-forms-ui-knob.mjs.map +1 -1
  45. package/fesm2022/4sh-ui-kit-forms-ui-label.mjs +140 -60
  46. package/fesm2022/4sh-ui-kit-forms-ui-label.mjs.map +1 -1
  47. package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs +386 -167
  48. package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs.map +1 -1
  49. package/fesm2022/4sh-ui-kit-forms-ui-radio.mjs +150 -87
  50. package/fesm2022/4sh-ui-kit-forms-ui-radio.mjs.map +1 -1
  51. package/fesm2022/4sh-ui-kit-forms-ui-rating.mjs +345 -180
  52. package/fesm2022/4sh-ui-kit-forms-ui-rating.mjs.map +1 -1
  53. package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs +582 -392
  54. package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs.map +1 -1
  55. package/fesm2022/4sh-ui-kit-forms-ui-select.mjs +1552 -888
  56. package/fesm2022/4sh-ui-kit-forms-ui-select.mjs.map +1 -1
  57. package/fesm2022/4sh-ui-kit-forms-ui-slider.mjs +485 -338
  58. package/fesm2022/4sh-ui-kit-forms-ui-slider.mjs.map +1 -1
  59. package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs +503 -311
  60. package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs.map +1 -1
  61. package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs +271 -131
  62. package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs.map +1 -1
  63. package/fesm2022/4sh-ui-kit-forms-ui-toggle-block.mjs +457 -214
  64. package/fesm2022/4sh-ui-kit-forms-ui-toggle-block.mjs.map +1 -1
  65. package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs +711 -371
  66. package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs.map +1 -1
  67. package/fesm2022/4sh-ui-kit-forms-ui-toggle.mjs +235 -121
  68. package/fesm2022/4sh-ui-kit-forms-ui-toggle.mjs.map +1 -1
  69. package/fesm2022/4sh-ui-kit-forms.mjs +723 -596
  70. package/fesm2022/4sh-ui-kit-forms.mjs.map +1 -1
  71. package/fesm2022/4sh-ui-kit-informative-ui-accordion.mjs +546 -242
  72. package/fesm2022/4sh-ui-kit-informative-ui-accordion.mjs.map +1 -1
  73. package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs +335 -157
  74. package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs.map +1 -1
  75. package/fesm2022/4sh-ui-kit-informative-ui-avatar-group.mjs +53 -33
  76. package/fesm2022/4sh-ui-kit-informative-ui-avatar-group.mjs.map +1 -1
  77. package/fesm2022/4sh-ui-kit-informative-ui-avatar.mjs +218 -121
  78. package/fesm2022/4sh-ui-kit-informative-ui-avatar.mjs.map +1 -1
  79. package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs +192 -100
  80. package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs.map +1 -1
  81. package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs +456 -204
  82. package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs.map +1 -1
  83. package/fesm2022/4sh-ui-kit-informative-ui-empty-state.mjs +314 -147
  84. package/fesm2022/4sh-ui-kit-informative-ui-empty-state.mjs.map +1 -1
  85. package/fesm2022/4sh-ui-kit-informative-ui-helper.mjs +179 -82
  86. package/fesm2022/4sh-ui-kit-informative-ui-helper.mjs.map +1 -1
  87. package/fesm2022/4sh-ui-kit-informative-ui-progress-bar.mjs +268 -123
  88. package/fesm2022/4sh-ui-kit-informative-ui-progress-bar.mjs.map +1 -1
  89. package/fesm2022/4sh-ui-kit-informative-ui-read-only.mjs +391 -146
  90. package/fesm2022/4sh-ui-kit-informative-ui-read-only.mjs.map +1 -1
  91. package/fesm2022/4sh-ui-kit-informative-ui-separator.mjs +158 -76
  92. package/fesm2022/4sh-ui-kit-informative-ui-separator.mjs.map +1 -1
  93. package/fesm2022/4sh-ui-kit-informative-ui-skeleton.mjs +159 -80
  94. package/fesm2022/4sh-ui-kit-informative-ui-skeleton.mjs.map +1 -1
  95. package/fesm2022/4sh-ui-kit-informative-ui-spinner.mjs +295 -131
  96. package/fesm2022/4sh-ui-kit-informative-ui-spinner.mjs.map +1 -1
  97. package/fesm2022/4sh-ui-kit-informative-ui-tag.mjs +211 -83
  98. package/fesm2022/4sh-ui-kit-informative-ui-tag.mjs.map +1 -1
  99. package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs +784 -414
  100. package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs.map +1 -1
  101. package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs +822 -476
  102. package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs.map +1 -1
  103. package/fesm2022/4sh-ui-kit-layout-ui-bottom-sheet.mjs +1014 -599
  104. package/fesm2022/4sh-ui-kit-layout-ui-bottom-sheet.mjs.map +1 -1
  105. package/fesm2022/4sh-ui-kit-layout-ui-card.mjs +403 -189
  106. package/fesm2022/4sh-ui-kit-layout-ui-card.mjs.map +1 -1
  107. package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs +707 -272
  108. package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs.map +1 -1
  109. package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs +1146 -568
  110. package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs.map +1 -1
  111. package/fesm2022/4sh-ui-kit-layout-ui-popover.mjs +519 -308
  112. package/fesm2022/4sh-ui-kit-layout-ui-popover.mjs.map +1 -1
  113. package/fesm2022/4sh-ui-kit-motion.mjs +252 -150
  114. package/fesm2022/4sh-ui-kit-motion.mjs.map +1 -1
  115. package/fesm2022/4sh-ui-kit-navigation-ui-bottom-tab-bar.mjs +793 -341
  116. package/fesm2022/4sh-ui-kit-navigation-ui-bottom-tab-bar.mjs.map +1 -1
  117. package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs +351 -194
  118. package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs.map +1 -1
  119. package/fesm2022/4sh-ui-kit-navigation-ui-context-menu.mjs +511 -220
  120. package/fesm2022/4sh-ui-kit-navigation-ui-context-menu.mjs.map +1 -1
  121. package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs +910 -548
  122. package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs.map +1 -1
  123. package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs +1128 -555
  124. package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs.map +1 -1
  125. package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs +915 -470
  126. package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs.map +1 -1
  127. package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs +931 -474
  128. package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs.map +1 -1
  129. package/fesm2022/4sh-ui-kit-overlay.mjs +26 -109
  130. package/fesm2022/4sh-ui-kit-overlay.mjs.map +1 -1
  131. package/fesm2022/4sh-ui-kit-ripple.mjs +329 -290
  132. package/fesm2022/4sh-ui-kit-ripple.mjs.map +1 -1
  133. package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs +709 -248
  134. package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs.map +1 -1
  135. package/fesm2022/4sh-ui-kit-table-ui-table.mjs +2633 -1370
  136. package/fesm2022/4sh-ui-kit-table-ui-table.mjs.map +1 -1
  137. package/fesm2022/4sh-ui-kit-theming.mjs +112 -113
  138. package/fesm2022/4sh-ui-kit-theming.mjs.map +1 -1
  139. package/fesm2022/4sh-ui-kit-types.mjs +0 -12
  140. package/fesm2022/4sh-ui-kit.mjs +3 -15
  141. package/fesm2022/4sh-ui-kit.mjs.map +1 -1
  142. package/mcp/data/component-api.json +313 -2
  143. package/mcp/data/text-search-docs.json +177 -17
  144. package/mcp/data/ui-config.json +378 -1
  145. package/mcp/index.js +8190 -2876
  146. package/mcp/package.json +1 -1
  147. package/package.json +5 -1
  148. package/styles/component-vars.scss +22 -1
  149. package/styles/utils/_mixins.scss +11 -0
  150. package/types/4sh-ui-kit-actions-ui-button-split.d.ts +198 -87
  151. package/types/4sh-ui-kit-actions-ui-button.d.ts +240 -116
  152. package/types/4sh-ui-kit-actions-ui-link.d.ts +136 -67
  153. package/types/4sh-ui-kit-actions-ui-speed-dial.d.ts +287 -180
  154. package/types/4sh-ui-kit-base-ui-icon.d.ts +92 -58
  155. package/types/4sh-ui-kit-base-ui-image.d.ts +406 -205
  156. package/types/4sh-ui-kit-forms-ui-autocomplete.d.ts +577 -367
  157. package/types/4sh-ui-kit-forms-ui-checkbox.d.ts +77 -42
  158. package/types/4sh-ui-kit-forms-ui-datepicker.d.ts +953 -700
  159. package/types/4sh-ui-kit-forms-ui-editor.d.ts +374 -340
  160. package/types/4sh-ui-kit-forms-ui-field-sign.d.ts +325 -0
  161. package/types/4sh-ui-kit-forms-ui-field.d.ts +150 -64
  162. package/types/4sh-ui-kit-forms-ui-file-upload.d.ts +583 -241
  163. package/types/4sh-ui-kit-forms-ui-input-date.d.ts +152 -103
  164. package/types/4sh-ui-kit-forms-ui-input-group.d.ts +109 -63
  165. package/types/4sh-ui-kit-forms-ui-input-mask.d.ts +93 -57
  166. package/types/4sh-ui-kit-forms-ui-input-number.d.ts +171 -93
  167. package/types/4sh-ui-kit-forms-ui-input-otp.d.ts +137 -100
  168. package/types/4sh-ui-kit-forms-ui-input-tags.d.ts +469 -309
  169. package/types/4sh-ui-kit-forms-ui-input.d.ts +198 -116
  170. package/types/4sh-ui-kit-forms-ui-knob.d.ts +132 -80
  171. package/types/4sh-ui-kit-forms-ui-label.d.ts +47 -22
  172. package/types/4sh-ui-kit-forms-ui-nudger.d.ts +134 -67
  173. package/types/4sh-ui-kit-forms-ui-radio.d.ts +48 -33
  174. package/types/4sh-ui-kit-forms-ui-rating.d.ts +120 -86
  175. package/types/4sh-ui-kit-forms-ui-segment-control.d.ts +221 -147
  176. package/types/4sh-ui-kit-forms-ui-select.d.ts +561 -357
  177. package/types/4sh-ui-kit-forms-ui-slider.d.ts +156 -105
  178. package/types/4sh-ui-kit-forms-ui-swatch-picker.d.ts +133 -97
  179. package/types/4sh-ui-kit-forms-ui-textarea.d.ts +90 -54
  180. package/types/4sh-ui-kit-forms-ui-toggle-block.d.ts +158 -94
  181. package/types/4sh-ui-kit-forms-ui-toggle-button.d.ts +314 -178
  182. package/types/4sh-ui-kit-forms-ui-toggle.d.ts +88 -54
  183. package/types/4sh-ui-kit-forms.d.ts +291 -186
  184. package/types/4sh-ui-kit-informative-ui-accordion.d.ts +162 -92
  185. package/types/4sh-ui-kit-informative-ui-alert.d.ts +128 -62
  186. package/types/4sh-ui-kit-informative-ui-avatar-group.d.ts +8 -8
  187. package/types/4sh-ui-kit-informative-ui-avatar.d.ts +81 -44
  188. package/types/4sh-ui-kit-informative-ui-badge.d.ts +71 -41
  189. package/types/4sh-ui-kit-informative-ui-chip.d.ts +194 -99
  190. package/types/4sh-ui-kit-informative-ui-empty-state.d.ts +105 -65
  191. package/types/4sh-ui-kit-informative-ui-helper.d.ts +64 -34
  192. package/types/4sh-ui-kit-informative-ui-progress-bar.d.ts +120 -65
  193. package/types/4sh-ui-kit-informative-ui-read-only.d.ts +147 -67
  194. package/types/4sh-ui-kit-informative-ui-separator.d.ts +65 -35
  195. package/types/4sh-ui-kit-informative-ui-skeleton.d.ts +62 -32
  196. package/types/4sh-ui-kit-informative-ui-spinner.d.ts +111 -50
  197. package/types/4sh-ui-kit-informative-ui-tag.d.ts +77 -37
  198. package/types/4sh-ui-kit-informative-ui-toast.d.ts +300 -180
  199. package/types/4sh-ui-kit-informative-ui-tooltip.d.ts +269 -141
  200. package/types/4sh-ui-kit-layout-ui-bottom-sheet.d.ts +360 -221
  201. package/types/4sh-ui-kit-layout-ui-card.d.ts +119 -79
  202. package/types/4sh-ui-kit-layout-ui-drawer.d.ts +244 -120
  203. package/types/4sh-ui-kit-layout-ui-modal.d.ts +409 -222
  204. package/types/4sh-ui-kit-layout-ui-popover.d.ts +149 -91
  205. package/types/4sh-ui-kit-motion.d.ts +117 -67
  206. package/types/4sh-ui-kit-navigation-ui-bottom-tab-bar.d.ts +279 -145
  207. package/types/4sh-ui-kit-navigation-ui-breadcrumb.d.ts +134 -96
  208. package/types/4sh-ui-kit-navigation-ui-context-menu.d.ts +148 -89
  209. package/types/4sh-ui-kit-navigation-ui-menu.d.ts +282 -201
  210. package/types/4sh-ui-kit-navigation-ui-sidebar.d.ts +425 -261
  211. package/types/4sh-ui-kit-navigation-ui-stepper.d.ts +279 -183
  212. package/types/4sh-ui-kit-navigation-ui-tabs.d.ts +275 -173
  213. package/types/4sh-ui-kit-overlay.d.ts +6 -6
  214. package/types/4sh-ui-kit-ripple.d.ts +99 -74
  215. package/types/4sh-ui-kit-table-ui-paginator.d.ts +237 -133
  216. package/types/4sh-ui-kit-table-ui-table.d.ts +769 -470
  217. package/types/4sh-ui-kit-theming.d.ts +27 -29
  218. package/types/4sh-ui-kit-types.d.ts +6 -5
  219. package/types/4sh-ui-kit.d.ts +4 -3
  220. package/fesm2022/4sh-ui-kit-types.mjs.map +0 -1
@@ -1,339 +1,486 @@
1
- import * as i0 from '@angular/core';
2
- import { input, numberAttribute, booleanAttribute, output, viewChild, viewChildren, signal, computed, isDevMode, effect, forwardRef, Component } from '@angular/core';
3
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
4
- import { BaseFieldControl, warnMissingAccessibleName } from '@4sh/ui-kit/forms';
5
-
6
- /**
7
- * ui-slider — headless slider to pick a numeric value (or a range) by dragging
8
- * a handle along a track.
9
- *
10
- * Built on the WAI-ARIA slider pattern: each handle is a `role="slider"` element
11
- * exposing `aria-valuemin/max/now` and `aria-orientation`, fully keyboard driven
12
- * (arrows, Page Up/Down, Home/End). Pointer events cover mouse, touch and pen
13
- * with a single code path. Interactive states (hover/focus/pressed/disabled) are
14
- * pure CSS driven by `actions.*` / `form.*` design tokens.
15
- *
16
- * Works standalone, with `[(ngModel)]`, Reactive Forms or Signal Forms
17
- * (`[formField]`) — it is a `ControlValueAccessor`. In `range` mode the model is a
18
- * two-item array, otherwise a single number.
19
- */
20
- class UiSlider extends BaseFieldControl {
21
- constructor() {
22
- super();
23
- /** Minimum boundary value. */
24
- this.min = input(0, { ...(ngDevMode ? { debugName: "min" } : /* istanbul ignore next */ {}), transform: numberAttribute });
25
- /** Maximum boundary value. */
26
- this.max = input(100, { ...(ngDevMode ? { debugName: "max" } : /* istanbul ignore next */ {}), transform: numberAttribute });
27
- /** Increment/decrement granularity (drag snapping + keyboard step). */
28
- this.step = input(1, { ...(ngDevMode ? { debugName: "step" } : /* istanbul ignore next */ {}), transform: numberAttribute });
29
- /** Two handles selecting a `[start, end]` range (the model becomes an array). */
30
- this.range = input(false, { ...(ngDevMode ? { debugName: "range" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
31
- /** Minimum number of steps kept between the two handles (range mode only). */
32
- this.minStepsBetweenHandles = input(0, { ...(ngDevMode ? { debugName: "minStepsBetweenHandles" } : /* istanbul ignore next */ {}), transform: numberAttribute });
33
- /** Renders a tick for every step along the track. */
34
- this.marks = input(false, { ...(ngDevMode ? { debugName: "marks" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
35
- /** Orientation of the slider (drives the arrow keys and layout). */
36
- this.orientation = input('horizontal', /* @ts-ignore */
37
- ...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
38
- /** Accessible name of the start (lower) handle in `range` mode — falls back to `ariaLabel`. */
39
- this.ariaLabelStart = input(/* @ts-ignore */
40
- ...(ngDevMode ? [undefined, { debugName: "ariaLabelStart" }] : /* istanbul ignore next */ []));
41
- /** Accessible name of the end (upper) handle in `range` mode — falls back to `ariaLabel`. */
42
- this.ariaLabelEnd = input(/* @ts-ignore */
43
- ...(ngDevMode ? [undefined, { debugName: "ariaLabelEnd" }] : /* istanbul ignore next */ []));
44
- /** Emitted continuously while the value changes (drag, keyboard, track click). */
45
- this.sliderChange = output();
46
- /** Emitted once a drag (or track click) completes — mirrors PrimeNG `onSlideEnd`. */
47
- this.slideEnd = output();
48
- /** Emitted when a handle receives focus. */
49
- this.sliderFocus = output();
50
- /** Emitted when a handle loses focus. */
51
- this.sliderBlur = output();
52
- /** @ignore Positioned root: the pointer target and % reference for handles. */
53
- this.root = viewChild.required('root', /* @ts-ignore */
54
- ...(ngDevMode ? [{ debugName: "root" }] : /* istanbul ignore next */ []));
55
- /** @ignore The handle elements (one, or two in range mode). */
56
- this.handleEls = viewChildren('handle', /* @ts-ignore */
57
- ...(ngDevMode ? [{ debugName: "handleEls" }] : /* istanbul ignore next */ []));
58
- /** @ignore Current model value (written by the form or by user interaction).
59
- * Redeclared over the base signal: a slider always has a numeric value (never `undefined`). */
60
- this.modelValue = signal(0, /* @ts-ignore */
61
- ...(ngDevMode ? [{ debugName: "modelValue" }] : /* istanbul ignore next */ []));
62
- /** @ignore Index of the handle currently being dragged (null when idle). */
63
- this.activeHandle = signal(null, /* @ts-ignore */
64
- ...(ngDevMode ? [{ debugName: "activeHandle" }] : /* istanbul ignore next */ []));
65
- /** @ignore Normalized `[start, end]` values (range mode). */
66
- this.rangeValues = computed(() => {
67
- const v = this.modelValue();
68
- if (Array.isArray(v))
69
- return [v[0] ?? this.min(), v[1] ?? this.max()];
70
- return [this.min(), this.max()];
71
- }, /* @ts-ignore */
72
- ...(ngDevMode ? [{ debugName: "rangeValues" }] : /* istanbul ignore next */ []));
73
- /** @ignore Normalized single value (non-range mode). */
74
- this.singleValue = computed(() => {
75
- const v = this.modelValue();
76
- if (typeof v === 'number')
77
- return v;
78
- return Array.isArray(v) ? (v[0] ?? this.min()) : this.min();
79
- }, /* @ts-ignore */
80
- ...(ngDevMode ? [{ debugName: "singleValue" }] : /* istanbul ignore next */ []));
81
- /** @ignore Handles projected to the view (value + position). */
82
- this.handles = computed(() => {
83
- if (this.range()) {
84
- const [a, b] = this.rangeValues();
85
- return [
86
- { index: 0, value: a, percent: this.toPercent(a) },
87
- { index: 1, value: b, percent: this.toPercent(b) },
88
- ];
89
- }
90
- const v = this.singleValue();
91
- return [{ index: 0, value: v, percent: this.toPercent(v) }];
92
- }, /* @ts-ignore */
93
- ...(ngDevMode ? [{ debugName: "handles" }] : /* istanbul ignore next */ []));
94
- /** @ignore Filled portion of the track (offset % + length %). */
95
- this.fill = computed(() => {
96
- if (this.range()) {
97
- const [a, b] = this.handles().map((h) => h.percent);
98
- return { start: Math.min(a, b), size: Math.abs(b - a) };
99
- }
100
- return { start: 0, size: this.handles()[0].percent };
101
- }, /* @ts-ignore */
102
- ...(ngDevMode ? [{ debugName: "fill" }] : /* istanbul ignore next */ []));
103
- /** @ignore Step ticks (only when `marks`, capped to keep the DOM sane). */
104
- this.markList = computed(() => {
105
- if (!this.marks())
106
- return [];
107
- const step = this.stepSize();
108
- const min = this.min();
109
- const max = this.max();
110
- const count = Math.floor((max - min) / step);
111
- if (count < 1 || count > 100)
112
- return [];
113
- const [lo, hi] = this.range() ? this.rangeValues() : [min, this.singleValue()];
114
- return Array.from({ length: count + 1 }, (_, i) => {
115
- const value = this.round(min + i * step);
116
- return { value, percent: this.toPercent(value), active: value >= lo && value <= hi };
117
- });
118
- }, /* @ts-ignore */
119
- ...(ngDevMode ? [{ debugName: "markList" }] : /* istanbul ignore next */ []));
120
- /** @ignore */
121
- this.classes = computed(() => {
122
- const c = ['ui-slider'];
123
- if (this.orientation() === 'vertical')
124
- c.push('_vertical');
125
- if (this.range())
126
- c.push('_range');
127
- if (this.isDisabled())
128
- c.push('_disabled');
129
- if (this.readonly())
130
- c.push('_readonly');
131
- if (this.isInvalid())
132
- c.push('_invalid');
133
- return c.join(' ');
134
- }, /* @ts-ignore */
135
- ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
136
- // A11y safeguard: a slider needs an accessible name.
137
- if (isDevMode()) {
138
- effect(() => {
139
- if (!this.ariaLabel() && !this.ariaLabelledBy()) {
140
- warnMissingAccessibleName('ui-slider', 'No accessible name: provide `ariaLabel` (or `ariaLabelledBy`).');
141
- }
142
- if (this.range() &&
143
- !this.ariaLabelStart() &&
144
- !this.ariaLabelEnd() &&
145
- !this.ariaLabelledBy()) {
146
- warnMissingAccessibleName('ui-slider', 'Range mode: set `ariaLabelStart`/`ariaLabelEnd` so each handle has a distinct name.');
147
- }
148
- });
149
- }
150
- }
151
- writeValue(value) {
152
- if (this.range()) {
153
- this.modelValue.set(Array.isArray(value) ? value : [this.min(), this.max()]);
154
- }
155
- else {
156
- this.modelValue.set(typeof value === 'number' ? value : this.min());
157
- }
158
- }
159
- /** @ignore */
160
- uidPrefix() {
161
- return 'ui-slider';
162
- }
163
- /** Focus the first handle programmatically. */
164
- focus(options) {
165
- this.handleEls()[0]?.nativeElement.focus(options);
166
- }
167
- // --- Pointer interaction (mouse / touch / pen) -----------------------
168
- /** @ignore Start dragging: pick the closest handle, capture the pointer, seed the value. */
169
- onPointerDown(event) {
170
- if (this.isDisabled() || this.readonly())
171
- return;
172
- const value = this.valueFromPointer(event);
173
- const index = this.range() ? this.nearestHandle(value) : 0;
174
- this.activeHandle.set(index);
175
- this.root().nativeElement.setPointerCapture(event.pointerId);
176
- this.updateValue(index, value);
177
- this.handleEls()[index]?.nativeElement.focus();
178
- event.preventDefault();
179
- }
180
- /** @ignore */
181
- onPointerMove(event) {
182
- const index = this.activeHandle();
183
- if (index === null)
184
- return;
185
- this.updateValue(index, this.valueFromPointer(event));
186
- }
187
- /** @ignore End of drag: release capture and fire `slideEnd`. */
188
- onPointerUp(event) {
189
- if (this.activeHandle() === null)
190
- return;
191
- this.activeHandle.set(null);
192
- this.root().nativeElement.releasePointerCapture?.(event.pointerId);
193
- this.slideEnd.emit(this.modelValue());
194
- }
195
- // --- Keyboard --------------------------------------------------------
196
- /** @ignore Arrow / Page / Home / End move the focused handle. */
197
- onKeyDown(event, index) {
198
- if (this.isDisabled() || this.readonly())
199
- return;
200
- const step = this.stepSize();
201
- const current = this.range() ? this.rangeValues()[index] : this.singleValue();
202
- let next;
203
- switch (event.key) {
204
- case 'ArrowLeft':
205
- case 'ArrowDown':
206
- next = current - step;
207
- break;
208
- case 'ArrowRight':
209
- case 'ArrowUp':
210
- next = current + step;
211
- break;
212
- case 'PageDown':
213
- next = current - step * 10;
214
- break;
215
- case 'PageUp':
216
- next = current + step * 10;
217
- break;
218
- case 'Home':
219
- next = this.min();
220
- break;
221
- case 'End':
222
- next = this.max();
223
- break;
224
- default:
225
- return;
226
- }
227
- event.preventDefault();
228
- this.updateValue(index, next);
229
- }
230
- /** @ignore */
231
- onFocus(event) {
232
- this.sliderFocus.emit(event);
233
- }
234
- /** @ignore */
235
- onBlur(event) {
236
- this.emitTouch();
237
- this.sliderBlur.emit(event);
238
- }
239
- // --- Value helpers ---------------------------------------------------
240
- /** @ignore Effective step (never 0). */
241
- stepSize() {
242
- const s = this.step();
243
- return s > 0 ? s : 1;
244
- }
245
- /** @ignore Value → track position as a 0–100% ratio. */
246
- toPercent(value) {
247
- const min = this.min();
248
- const span = this.max() - min;
249
- if (span <= 0)
250
- return 0;
251
- return Math.min(100, Math.max(0, ((value - min) / span) * 100));
252
- }
253
- /** @ignore Pointer coordinate → raw value in [min, max]. */
254
- valueFromPointer(event) {
255
- const rect = this.root().nativeElement.getBoundingClientRect();
256
- const ratio = this.orientation() === 'horizontal'
257
- ? (event.clientX - rect.left) / rect.width
258
- : (rect.bottom - event.clientY) / rect.height;
259
- const clamped = Math.min(1, Math.max(0, ratio));
260
- return this.min() + clamped * (this.max() - this.min());
261
- }
262
- /** @ignore Closest handle to a value (range mode). */
263
- nearestHandle(value) {
264
- const [a, b] = this.rangeValues();
265
- return Math.abs(value - a) <= Math.abs(value - b) ? 0 : 1;
266
- }
267
- /** @ignore Accessible name of a given handle (distinct per handle in range mode). */
268
- handleAriaLabel(index) {
269
- if (!this.range())
270
- return this.ariaLabel();
271
- return (index === 0 ? this.ariaLabelStart() : this.ariaLabelEnd()) ?? this.ariaLabel();
272
- }
273
- /** @ignore Snap to the step grid, relative to `min`. */
274
- snap(value) {
275
- const step = this.stepSize();
276
- const min = this.min();
277
- return this.round(min + Math.round((value - min) / step) * step);
278
- }
279
- /** @ignore Round to the step's decimal precision (avoids float drift). */
280
- round(value) {
281
- const step = this.stepSize();
282
- const decimals = Number.isInteger(step) ? 0 : (step.toString().split('.')[1]?.length ?? 0);
283
- return decimals > 0 ? +value.toFixed(decimals) : Math.round(value);
284
- }
285
- /** @ignore Clamp to [min, max]. */
286
- clamp(value) {
287
- return Math.min(this.max(), Math.max(this.min(), value));
288
- }
289
- /** @ignore Snap + clamp + range-gap enforcement, then commit if changed. */
290
- updateValue(index, raw) {
291
- if (this.isDisabled() || this.readonly())
292
- return;
293
- let value = this.clamp(this.snap(raw));
294
- if (this.range()) {
295
- const values = [...this.rangeValues()];
296
- const gap = this.minStepsBetweenHandles() * this.stepSize();
297
- if (index === 0)
298
- value = Math.min(value, values[1] - gap);
299
- else
300
- value = Math.max(value, values[0] + gap);
301
- value = this.clamp(value);
302
- if (values[index] === value)
303
- return;
304
- values[index] = value;
305
- this.commit(values);
306
- }
307
- else {
308
- if (this.singleValue() === value)
309
- return;
310
- this.commit(value);
311
- }
312
- }
313
- /** @ignore Update the model + propagate to the form and the output. */
314
- commit(value) {
315
- this.modelValue.set(value);
316
- this.emitChange(value);
317
- this.sliderChange.emit(value);
318
- }
319
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiSlider, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
320
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: UiSlider, isStandalone: true, selector: "ui-slider", inputs: { min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, range: { classPropertyName: "range", publicName: "range", isSignal: true, isRequired: false, transformFunction: null }, minStepsBetweenHandles: { classPropertyName: "minStepsBetweenHandles", publicName: "minStepsBetweenHandles", isSignal: true, isRequired: false, transformFunction: null }, marks: { classPropertyName: "marks", publicName: "marks", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelStart: { classPropertyName: "ariaLabelStart", publicName: "ariaLabelStart", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelEnd: { classPropertyName: "ariaLabelEnd", publicName: "ariaLabelEnd", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sliderChange: "sliderChange", slideEnd: "slideEnd", sliderFocus: "sliderFocus", sliderBlur: "sliderBlur" }, host: { properties: { "style.display": "orientation() === 'vertical' ? 'inline-block' : 'block'", "style.width": "orientation() === 'vertical' ? null : '100%'" } }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiSlider), multi: true }], viewQueries: [{ propertyName: "root", first: true, predicate: ["root"], descendants: true, isSignal: true }, { propertyName: "handleEls", predicate: ["handle"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div\n #root\n [class]=\"classes()\"\n (pointerdown)=\"onPointerDown($event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerUp($event)\"\n>\n <!-- Rail + filled portion -->\n <div class=\"ui-slider-track\">\n <div\n class=\"ui-slider-range\"\n [style.inset-inline-start]=\"orientation() === 'horizontal' ? fill().start + '%' : null\"\n [style.width]=\"orientation() === 'horizontal' ? fill().size + '%' : null\"\n [style.bottom]=\"orientation() === 'vertical' ? fill().start + '%' : null\"\n [style.height]=\"orientation() === 'vertical' ? fill().size + '%' : null\"\n ></div>\n </div>\n\n <!-- Step ticks (decorative) -->\n @if (markList().length) {\n <div class=\"ui-slider-marks\" aria-hidden=\"true\">\n @for (mark of markList(); track mark.value) {\n <span\n class=\"ui-slider-mark\"\n [class._active]=\"mark.active\"\n [style.inset-inline-start]=\"orientation() === 'horizontal' ? mark.percent + '%' : null\"\n [style.bottom]=\"orientation() === 'vertical' ? mark.percent + '%' : null\"\n ></span>\n }\n </div>\n }\n\n <!-- Handles (WAI-ARIA slider pattern) -->\n @for (handle of handles(); track handle.index) {\n <div\n #handle\n class=\"ui-slider-handle\"\n role=\"slider\"\n [attr.id]=\"handle.index === 0 ? resolvedId() : null\"\n [attr.tabindex]=\"isDisabled() ? -1 : (tabindex() ?? 0)\"\n [attr.aria-valuemin]=\"min()\"\n [attr.aria-valuemax]=\"max()\"\n [attr.aria-valuenow]=\"handle.value\"\n [attr.aria-orientation]=\"orientation()\"\n [attr.aria-label]=\"handleAriaLabel(handle.index)\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-disabled]=\"isDisabled() ? true : null\"\n [attr.aria-readonly]=\"readonly() ? true : null\"\n [style.inset-inline-start]=\"orientation() === 'horizontal' ? handle.percent + '%' : null\"\n [style.bottom]=\"orientation() === 'vertical' ? handle.percent + '%' : null\"\n (keydown)=\"onKeyDown($event, handle.index)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n ></div>\n }\n</div>\n", styles: [".ui-slider{position:relative;display:flex;align-items:center;width:100%;min-height:var(--ui-slider-handle-size, 1.375rem);touch-action:none;cursor:pointer;-webkit-user-select:none;user-select:none}.ui-slider-track{position:relative;width:100%;height:var(--ui-slider-thickness, .5rem);border-radius:var(--ui-slider-track-radius, var(--radius-full));background-color:var(--ui-slider-track-surface, var(--global-background-muted))}.ui-slider-range{position:absolute;top:0;height:100%;border-radius:var(--ui-slider-track-radius, var(--radius-full));background-color:var(--ui-slider-range-surface, var(--actions-high-surface-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)))}.ui-slider-handle{position:absolute;top:50%;width:var(--ui-slider-handle-size, 1.375rem);height:var(--ui-slider-handle-size, 1.375rem);transform:translate(-50%,-50%);box-sizing:border-box;border:var(--ui-slider-handle-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) solid var(--ui-slider-handle-stroke, var(--actions-high-stroke-default));border-radius:var(--ui-slider-handle-radius, var(--radius-full));background-color:var(--ui-slider-handle-surface, var(--actions-high-surface-default));cursor:grab;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-slider-handle:hover{background-color:var(--ui-slider-handle-surface-hover, var(--actions-high-surface-hover))}.ui-slider-handle:focus-visible{outline:none;border-color:var(--ui-slider-handle-stroke-focus, var(--actions-high-stroke-focused));box-shadow:0 0 0 var(--ui-slider-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--ui-slider-handle-stroke-focus, var(--actions-high-stroke-focused))}.ui-slider-handle:active{background-color:var(--ui-slider-handle-surface-pressed, var(--actions-high-surface-pressed));cursor:grabbing}.ui-slider-marks{position:absolute;inset:0;pointer-events:none}.ui-slider-mark{position:absolute;top:50%;width:var(--ui-slider-mark-size, .375rem);height:var(--ui-slider-mark-size, .375rem);transform:translate(-50%,-50%);border-radius:var(--ui-slider-mark-radius, var(--radius-full));background-color:var(--ui-slider-mark-surface, var(--informative-defaulthigh-surface-default))}.ui-slider-mark._active{background-color:var(--ui-slider-mark-surface-active, var(--actions-high-content-default))}.ui-slider._vertical{flex-direction:column;width:auto;min-width:var(--ui-slider-handle-size, 1.375rem);height:var(--ui-slider-length, 12rem);min-height:0}.ui-slider._vertical .ui-slider-track{width:var(--ui-slider-thickness, .5rem);height:100%}.ui-slider._vertical .ui-slider-range{top:auto;bottom:0;width:100%;height:auto}.ui-slider._vertical .ui-slider-handle,.ui-slider._vertical .ui-slider-mark{top:auto;left:50%;transform:translate(-50%,50%)}.ui-slider._disabled{cursor:not-allowed}.ui-slider._disabled .ui-slider-range{background-color:var(--ui-slider-range-surface-disabled, var(--actions-high-surface-disabled))}.ui-slider._disabled .ui-slider-handle{cursor:not-allowed;background-color:var(--ui-slider-handle-surface-disabled, var(--actions-high-surface-disabled))}.ui-slider._disabled .ui-slider-handle:hover{background-color:var(--ui-slider-handle-surface-disabled, var(--actions-high-surface-disabled))}.ui-slider._readonly,.ui-slider._readonly .ui-slider-handle{cursor:default}.ui-slider._invalid .ui-slider-range{background-color:var(--ui-slider-range-surface-invalid, var(--form-error-content-default))}.ui-slider._invalid .ui-slider-handle{background-color:var(--ui-slider-handle-surface-invalid, var(--form-error-content-default))}.ui-slider._invalid .ui-slider-handle:hover{background-color:var(--ui-slider-handle-surface-hover-invalid, var(--form-error-content-hover))}.ui-slider._invalid .ui-slider-handle:focus-visible{border-color:var(--ui-slider-handle-stroke-focus-invalid, var(--form-error-stroke-focused));box-shadow:0 0 0 var(--ui-slider-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--ui-slider-handle-stroke-focus-invalid, var(--form-error-stroke-focused))}\n"] }); }
321
- }
322
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiSlider, decorators: [{
323
- type: Component,
324
- args: [{ selector: 'ui-slider', standalone: true, host: {
325
- '[style.display]': "orientation() === 'vertical' ? 'inline-block' : 'block'",
326
- '[style.width]': "orientation() === 'vertical' ? null : '100%'",
327
- }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiSlider), multi: true }], template: "<div\n #root\n [class]=\"classes()\"\n (pointerdown)=\"onPointerDown($event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerUp($event)\"\n>\n <!-- Rail + filled portion -->\n <div class=\"ui-slider-track\">\n <div\n class=\"ui-slider-range\"\n [style.inset-inline-start]=\"orientation() === 'horizontal' ? fill().start + '%' : null\"\n [style.width]=\"orientation() === 'horizontal' ? fill().size + '%' : null\"\n [style.bottom]=\"orientation() === 'vertical' ? fill().start + '%' : null\"\n [style.height]=\"orientation() === 'vertical' ? fill().size + '%' : null\"\n ></div>\n </div>\n\n <!-- Step ticks (decorative) -->\n @if (markList().length) {\n <div class=\"ui-slider-marks\" aria-hidden=\"true\">\n @for (mark of markList(); track mark.value) {\n <span\n class=\"ui-slider-mark\"\n [class._active]=\"mark.active\"\n [style.inset-inline-start]=\"orientation() === 'horizontal' ? mark.percent + '%' : null\"\n [style.bottom]=\"orientation() === 'vertical' ? mark.percent + '%' : null\"\n ></span>\n }\n </div>\n }\n\n <!-- Handles (WAI-ARIA slider pattern) -->\n @for (handle of handles(); track handle.index) {\n <div\n #handle\n class=\"ui-slider-handle\"\n role=\"slider\"\n [attr.id]=\"handle.index === 0 ? resolvedId() : null\"\n [attr.tabindex]=\"isDisabled() ? -1 : (tabindex() ?? 0)\"\n [attr.aria-valuemin]=\"min()\"\n [attr.aria-valuemax]=\"max()\"\n [attr.aria-valuenow]=\"handle.value\"\n [attr.aria-orientation]=\"orientation()\"\n [attr.aria-label]=\"handleAriaLabel(handle.index)\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-disabled]=\"isDisabled() ? true : null\"\n [attr.aria-readonly]=\"readonly() ? true : null\"\n [style.inset-inline-start]=\"orientation() === 'horizontal' ? handle.percent + '%' : null\"\n [style.bottom]=\"orientation() === 'vertical' ? handle.percent + '%' : null\"\n (keydown)=\"onKeyDown($event, handle.index)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n ></div>\n }\n</div>\n", styles: [".ui-slider{position:relative;display:flex;align-items:center;width:100%;min-height:var(--ui-slider-handle-size, 1.375rem);touch-action:none;cursor:pointer;-webkit-user-select:none;user-select:none}.ui-slider-track{position:relative;width:100%;height:var(--ui-slider-thickness, .5rem);border-radius:var(--ui-slider-track-radius, var(--radius-full));background-color:var(--ui-slider-track-surface, var(--global-background-muted))}.ui-slider-range{position:absolute;top:0;height:100%;border-radius:var(--ui-slider-track-radius, var(--radius-full));background-color:var(--ui-slider-range-surface, var(--actions-high-surface-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)))}.ui-slider-handle{position:absolute;top:50%;width:var(--ui-slider-handle-size, 1.375rem);height:var(--ui-slider-handle-size, 1.375rem);transform:translate(-50%,-50%);box-sizing:border-box;border:var(--ui-slider-handle-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) solid var(--ui-slider-handle-stroke, var(--actions-high-stroke-default));border-radius:var(--ui-slider-handle-radius, var(--radius-full));background-color:var(--ui-slider-handle-surface, var(--actions-high-surface-default));cursor:grab;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-slider-handle:hover{background-color:var(--ui-slider-handle-surface-hover, var(--actions-high-surface-hover))}.ui-slider-handle:focus-visible{outline:none;border-color:var(--ui-slider-handle-stroke-focus, var(--actions-high-stroke-focused));box-shadow:0 0 0 var(--ui-slider-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--ui-slider-handle-stroke-focus, var(--actions-high-stroke-focused))}.ui-slider-handle:active{background-color:var(--ui-slider-handle-surface-pressed, var(--actions-high-surface-pressed));cursor:grabbing}.ui-slider-marks{position:absolute;inset:0;pointer-events:none}.ui-slider-mark{position:absolute;top:50%;width:var(--ui-slider-mark-size, .375rem);height:var(--ui-slider-mark-size, .375rem);transform:translate(-50%,-50%);border-radius:var(--ui-slider-mark-radius, var(--radius-full));background-color:var(--ui-slider-mark-surface, var(--informative-defaulthigh-surface-default))}.ui-slider-mark._active{background-color:var(--ui-slider-mark-surface-active, var(--actions-high-content-default))}.ui-slider._vertical{flex-direction:column;width:auto;min-width:var(--ui-slider-handle-size, 1.375rem);height:var(--ui-slider-length, 12rem);min-height:0}.ui-slider._vertical .ui-slider-track{width:var(--ui-slider-thickness, .5rem);height:100%}.ui-slider._vertical .ui-slider-range{top:auto;bottom:0;width:100%;height:auto}.ui-slider._vertical .ui-slider-handle,.ui-slider._vertical .ui-slider-mark{top:auto;left:50%;transform:translate(-50%,50%)}.ui-slider._disabled{cursor:not-allowed}.ui-slider._disabled .ui-slider-range{background-color:var(--ui-slider-range-surface-disabled, var(--actions-high-surface-disabled))}.ui-slider._disabled .ui-slider-handle{cursor:not-allowed;background-color:var(--ui-slider-handle-surface-disabled, var(--actions-high-surface-disabled))}.ui-slider._disabled .ui-slider-handle:hover{background-color:var(--ui-slider-handle-surface-disabled, var(--actions-high-surface-disabled))}.ui-slider._readonly,.ui-slider._readonly .ui-slider-handle{cursor:default}.ui-slider._invalid .ui-slider-range{background-color:var(--ui-slider-range-surface-invalid, var(--form-error-content-default))}.ui-slider._invalid .ui-slider-handle{background-color:var(--ui-slider-handle-surface-invalid, var(--form-error-content-default))}.ui-slider._invalid .ui-slider-handle:hover{background-color:var(--ui-slider-handle-surface-hover-invalid, var(--form-error-content-hover))}.ui-slider._invalid .ui-slider-handle:focus-visible{border-color:var(--ui-slider-handle-stroke-focus-invalid, var(--form-error-stroke-focused));box-shadow:0 0 0 var(--ui-slider-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--ui-slider-handle-stroke-focus-invalid, var(--form-error-stroke-focused))}\n"] }]
328
- }], ctorParameters: () => [], propDecorators: { min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], range: [{ type: i0.Input, args: [{ isSignal: true, alias: "range", required: false }] }], minStepsBetweenHandles: [{ type: i0.Input, args: [{ isSignal: true, alias: "minStepsBetweenHandles", required: false }] }], marks: [{ type: i0.Input, args: [{ isSignal: true, alias: "marks", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], ariaLabelStart: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelStart", required: false }] }], ariaLabelEnd: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelEnd", required: false }] }], sliderChange: [{ type: i0.Output, args: ["sliderChange"] }], slideEnd: [{ type: i0.Output, args: ["slideEnd"] }], sliderFocus: [{ type: i0.Output, args: ["sliderFocus"] }], sliderBlur: [{ type: i0.Output, args: ["sliderBlur"] }], root: [{ type: i0.ViewChild, args: ['root', { isSignal: true }] }], handleEls: [{ type: i0.ViewChildren, args: ['handle', { isSignal: true }] }] } });
329
-
330
- /*
331
- * Public API Surface of ui-kit/ui-slider
332
- */
333
-
334
- /**
335
- * Generated bundle index. Do not edit.
336
- */
337
-
1
+ import * as i0 from "@angular/core";
2
+ import { Component, booleanAttribute, computed, effect, forwardRef, input, isDevMode, numberAttribute, output, signal, viewChild, viewChildren } from "@angular/core";
3
+ import { NG_VALUE_ACCESSOR } from "@angular/forms";
4
+ import { BaseFieldControl, warnMissingAccessibleName } from "@4sh/ui-kit/forms";
5
+ var UiSlider = class UiSlider extends BaseFieldControl {
6
+ constructor() {
7
+ super();
8
+ this.min = input(0, {
9
+ ...ngDevMode ? { debugName: "min" } : /* istanbul ignore next */ {},
10
+ transform: numberAttribute
11
+ });
12
+ this.max = input(100, {
13
+ ...ngDevMode ? { debugName: "max" } : /* istanbul ignore next */ {},
14
+ transform: numberAttribute
15
+ });
16
+ this.step = input(1, {
17
+ ...ngDevMode ? { debugName: "step" } : /* istanbul ignore next */ {},
18
+ transform: numberAttribute
19
+ });
20
+ this.range = input(false, {
21
+ ...ngDevMode ? { debugName: "range" } : /* istanbul ignore next */ {},
22
+ transform: booleanAttribute
23
+ });
24
+ this.minStepsBetweenHandles = input(0, {
25
+ ...ngDevMode ? { debugName: "minStepsBetweenHandles" } : /* istanbul ignore next */ {},
26
+ transform: numberAttribute
27
+ });
28
+ this.marks = input(false, {
29
+ ...ngDevMode ? { debugName: "marks" } : /* istanbul ignore next */ {},
30
+ transform: booleanAttribute
31
+ });
32
+ this.orientation = input("horizontal", ...ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []);
33
+ this.ariaLabelStart = input(...ngDevMode ? [void 0, { debugName: "ariaLabelStart" }] : /* istanbul ignore next */ []);
34
+ this.ariaLabelEnd = input(...ngDevMode ? [void 0, { debugName: "ariaLabelEnd" }] : /* istanbul ignore next */ []);
35
+ this.sliderChange = output();
36
+ this.slideEnd = output();
37
+ this.sliderFocus = output();
38
+ this.sliderBlur = output();
39
+ this.root = viewChild.required("root", ...ngDevMode ? [{ debugName: "root" }] : /* istanbul ignore next */ []);
40
+ this.handleEls = viewChildren("handle", ...ngDevMode ? [{ debugName: "handleEls" }] : /* istanbul ignore next */ []);
41
+ this.modelValue = signal(0, ...ngDevMode ? [{ debugName: "modelValue" }] : /* istanbul ignore next */ []);
42
+ this.activeHandle = signal(null, ...ngDevMode ? [{ debugName: "activeHandle" }] : /* istanbul ignore next */ []);
43
+ this.rangeValues = computed(() => {
44
+ const v = this.modelValue();
45
+ if (Array.isArray(v)) return [v[0] ?? this.min(), v[1] ?? this.max()];
46
+ return [this.min(), this.max()];
47
+ }, ...ngDevMode ? [{ debugName: "rangeValues" }] : /* istanbul ignore next */ []);
48
+ this.singleValue = computed(() => {
49
+ const v = this.modelValue();
50
+ if (typeof v === "number") return v;
51
+ return Array.isArray(v) ? v[0] ?? this.min() : this.min();
52
+ }, ...ngDevMode ? [{ debugName: "singleValue" }] : /* istanbul ignore next */ []);
53
+ this.handles = computed(() => {
54
+ if (this.range()) {
55
+ const [a, b] = this.rangeValues();
56
+ return [{
57
+ index: 0,
58
+ value: a,
59
+ percent: this.toPercent(a)
60
+ }, {
61
+ index: 1,
62
+ value: b,
63
+ percent: this.toPercent(b)
64
+ }];
65
+ }
66
+ const v = this.singleValue();
67
+ return [{
68
+ index: 0,
69
+ value: v,
70
+ percent: this.toPercent(v)
71
+ }];
72
+ }, ...ngDevMode ? [{ debugName: "handles" }] : /* istanbul ignore next */ []);
73
+ this.fill = computed(() => {
74
+ if (this.range()) {
75
+ const [a, b] = this.handles().map((h) => h.percent);
76
+ return {
77
+ start: Math.min(a, b),
78
+ size: Math.abs(b - a)
79
+ };
80
+ }
81
+ return {
82
+ start: 0,
83
+ size: this.handles()[0].percent
84
+ };
85
+ }, ...ngDevMode ? [{ debugName: "fill" }] : /* istanbul ignore next */ []);
86
+ this.markList = computed(() => {
87
+ if (!this.marks()) return [];
88
+ const step = this.stepSize();
89
+ const min = this.min();
90
+ const max = this.max();
91
+ const count = Math.floor((max - min) / step);
92
+ if (count < 1 || count > 100) return [];
93
+ const [lo, hi] = this.range() ? this.rangeValues() : [min, this.singleValue()];
94
+ return Array.from({ length: count + 1 }, (_, i) => {
95
+ const value = this.round(min + i * step);
96
+ return {
97
+ value,
98
+ percent: this.toPercent(value),
99
+ active: value >= lo && value <= hi
100
+ };
101
+ });
102
+ }, ...ngDevMode ? [{ debugName: "markList" }] : /* istanbul ignore next */ []);
103
+ this.classes = computed(() => {
104
+ const c = ["ui-slider"];
105
+ if (this.orientation() === "vertical") c.push("_vertical");
106
+ if (this.range()) c.push("_range");
107
+ if (this.isDisabled()) c.push("_disabled");
108
+ if (this.readonly()) c.push("_readonly");
109
+ if (this.isInvalid()) c.push("_invalid");
110
+ return c.join(" ");
111
+ }, ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
112
+ if (isDevMode()) effect(() => {
113
+ if (!this.ariaLabel() && !this.ariaLabelledBy()) warnMissingAccessibleName("ui-slider", "No accessible name: provide `ariaLabel` (or `ariaLabelledBy`).");
114
+ if (this.range() && !this.ariaLabelStart() && !this.ariaLabelEnd() && !this.ariaLabelledBy()) warnMissingAccessibleName("ui-slider", "Range mode: set `ariaLabelStart`/`ariaLabelEnd` so each handle has a distinct name.");
115
+ });
116
+ }
117
+ writeValue(value) {
118
+ if (this.range()) this.modelValue.set(Array.isArray(value) ? value : [this.min(), this.max()]);
119
+ else this.modelValue.set(typeof value === "number" ? value : this.min());
120
+ }
121
+ uidPrefix() {
122
+ return "ui-slider";
123
+ }
124
+ focus(options) {
125
+ this.handleEls()[0]?.nativeElement.focus(options);
126
+ }
127
+ onPointerDown(event) {
128
+ if (this.isDisabled() || this.readonly()) return;
129
+ const value = this.valueFromPointer(event);
130
+ const index = this.range() ? this.nearestHandle(value) : 0;
131
+ this.activeHandle.set(index);
132
+ this.root().nativeElement.setPointerCapture(event.pointerId);
133
+ this.updateValue(index, value);
134
+ this.handleEls()[index]?.nativeElement.focus();
135
+ event.preventDefault();
136
+ }
137
+ onPointerMove(event) {
138
+ const index = this.activeHandle();
139
+ if (index === null) return;
140
+ this.updateValue(index, this.valueFromPointer(event));
141
+ }
142
+ onPointerUp(event) {
143
+ if (this.activeHandle() === null) return;
144
+ this.activeHandle.set(null);
145
+ this.root().nativeElement.releasePointerCapture?.(event.pointerId);
146
+ this.slideEnd.emit(this.modelValue());
147
+ }
148
+ onKeyDown(event, index) {
149
+ if (this.isDisabled() || this.readonly()) return;
150
+ const step = this.stepSize();
151
+ const current = this.range() ? this.rangeValues()[index] : this.singleValue();
152
+ let next;
153
+ switch (event.key) {
154
+ case "ArrowLeft":
155
+ case "ArrowDown":
156
+ next = current - step;
157
+ break;
158
+ case "ArrowRight":
159
+ case "ArrowUp":
160
+ next = current + step;
161
+ break;
162
+ case "PageDown":
163
+ next = current - step * 10;
164
+ break;
165
+ case "PageUp":
166
+ next = current + step * 10;
167
+ break;
168
+ case "Home":
169
+ next = this.min();
170
+ break;
171
+ case "End":
172
+ next = this.max();
173
+ break;
174
+ default: return;
175
+ }
176
+ event.preventDefault();
177
+ this.updateValue(index, next);
178
+ }
179
+ onFocus(event) {
180
+ this.sliderFocus.emit(event);
181
+ }
182
+ onBlur(event) {
183
+ this.emitTouch();
184
+ this.sliderBlur.emit(event);
185
+ }
186
+ stepSize() {
187
+ const s = this.step();
188
+ return s > 0 ? s : 1;
189
+ }
190
+ toPercent(value) {
191
+ const min = this.min();
192
+ const span = this.max() - min;
193
+ if (span <= 0) return 0;
194
+ return Math.min(100, Math.max(0, (value - min) / span * 100));
195
+ }
196
+ valueFromPointer(event) {
197
+ const rect = this.root().nativeElement.getBoundingClientRect();
198
+ const ratio = this.orientation() === "horizontal" ? (event.clientX - rect.left) / rect.width : (rect.bottom - event.clientY) / rect.height;
199
+ const clamped = Math.min(1, Math.max(0, ratio));
200
+ return this.min() + clamped * (this.max() - this.min());
201
+ }
202
+ nearestHandle(value) {
203
+ const [a, b] = this.rangeValues();
204
+ return Math.abs(value - a) <= Math.abs(value - b) ? 0 : 1;
205
+ }
206
+ handleAriaLabel(index) {
207
+ if (!this.range()) return this.ariaLabel();
208
+ return (index === 0 ? this.ariaLabelStart() : this.ariaLabelEnd()) ?? this.ariaLabel();
209
+ }
210
+ snap(value) {
211
+ const step = this.stepSize();
212
+ const min = this.min();
213
+ return this.round(min + Math.round((value - min) / step) * step);
214
+ }
215
+ round(value) {
216
+ const step = this.stepSize();
217
+ const decimals = Number.isInteger(step) ? 0 : step.toString().split(".")[1]?.length ?? 0;
218
+ return decimals > 0 ? +value.toFixed(decimals) : Math.round(value);
219
+ }
220
+ clamp(value) {
221
+ return Math.min(this.max(), Math.max(this.min(), value));
222
+ }
223
+ updateValue(index, raw) {
224
+ if (this.isDisabled() || this.readonly()) return;
225
+ let value = this.clamp(this.snap(raw));
226
+ if (this.range()) {
227
+ const values = [...this.rangeValues()];
228
+ const gap = this.minStepsBetweenHandles() * this.stepSize();
229
+ if (index === 0) value = Math.min(value, values[1] - gap);
230
+ else value = Math.max(value, values[0] + gap);
231
+ value = this.clamp(value);
232
+ if (values[index] === value) return;
233
+ values[index] = value;
234
+ this.commit(values);
235
+ } else {
236
+ if (this.singleValue() === value) return;
237
+ this.commit(value);
238
+ }
239
+ }
240
+ commit(value) {
241
+ this.modelValue.set(value);
242
+ this.emitChange(value);
243
+ this.sliderChange.emit(value);
244
+ }
245
+ static {
246
+ this.ɵfac = i0.ɵɵngDeclareFactory({
247
+ minVersion: "12.0.0",
248
+ version: "22.3.0",
249
+ ngImport: i0,
250
+ type: UiSlider,
251
+ deps: [],
252
+ target: i0.ɵɵFactoryTarget.Component
253
+ });
254
+ }
255
+ static {
256
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
257
+ minVersion: "17.0.0",
258
+ version: "22.3.0",
259
+ type: UiSlider,
260
+ isStandalone: true,
261
+ selector: "ui-slider",
262
+ inputs: {
263
+ min: {
264
+ classPropertyName: "min",
265
+ publicName: "min",
266
+ isSignal: true,
267
+ isRequired: false,
268
+ transformFunction: null
269
+ },
270
+ max: {
271
+ classPropertyName: "max",
272
+ publicName: "max",
273
+ isSignal: true,
274
+ isRequired: false,
275
+ transformFunction: null
276
+ },
277
+ step: {
278
+ classPropertyName: "step",
279
+ publicName: "step",
280
+ isSignal: true,
281
+ isRequired: false,
282
+ transformFunction: null
283
+ },
284
+ range: {
285
+ classPropertyName: "range",
286
+ publicName: "range",
287
+ isSignal: true,
288
+ isRequired: false,
289
+ transformFunction: null
290
+ },
291
+ minStepsBetweenHandles: {
292
+ classPropertyName: "minStepsBetweenHandles",
293
+ publicName: "minStepsBetweenHandles",
294
+ isSignal: true,
295
+ isRequired: false,
296
+ transformFunction: null
297
+ },
298
+ marks: {
299
+ classPropertyName: "marks",
300
+ publicName: "marks",
301
+ isSignal: true,
302
+ isRequired: false,
303
+ transformFunction: null
304
+ },
305
+ orientation: {
306
+ classPropertyName: "orientation",
307
+ publicName: "orientation",
308
+ isSignal: true,
309
+ isRequired: false,
310
+ transformFunction: null
311
+ },
312
+ ariaLabelStart: {
313
+ classPropertyName: "ariaLabelStart",
314
+ publicName: "ariaLabelStart",
315
+ isSignal: true,
316
+ isRequired: false,
317
+ transformFunction: null
318
+ },
319
+ ariaLabelEnd: {
320
+ classPropertyName: "ariaLabelEnd",
321
+ publicName: "ariaLabelEnd",
322
+ isSignal: true,
323
+ isRequired: false,
324
+ transformFunction: null
325
+ }
326
+ },
327
+ outputs: {
328
+ sliderChange: "sliderChange",
329
+ slideEnd: "slideEnd",
330
+ sliderFocus: "sliderFocus",
331
+ sliderBlur: "sliderBlur"
332
+ },
333
+ host: { properties: {
334
+ "style.display": "orientation() === 'vertical' ? 'inline-block' : 'block'",
335
+ "style.width": "orientation() === 'vertical' ? null : '100%'"
336
+ } },
337
+ providers: [{
338
+ provide: NG_VALUE_ACCESSOR,
339
+ useExisting: forwardRef(() => UiSlider),
340
+ multi: true
341
+ }],
342
+ viewQueries: [{
343
+ propertyName: "root",
344
+ first: true,
345
+ predicate: ["root"],
346
+ descendants: true,
347
+ isSignal: true
348
+ }, {
349
+ propertyName: "handleEls",
350
+ predicate: ["handle"],
351
+ descendants: true,
352
+ isSignal: true
353
+ }],
354
+ usesInheritance: true,
355
+ ngImport: i0,
356
+ template: "<div\n #root\n [class]=\"classes()\"\n (pointerdown)=\"onPointerDown($event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerUp($event)\"\n>\n <!-- Rail + filled portion -->\n <div class=\"ui-slider-track\">\n <div\n class=\"ui-slider-range\"\n [style.inset-inline-start]=\"orientation() === 'horizontal' ? fill().start + '%' : null\"\n [style.width]=\"orientation() === 'horizontal' ? fill().size + '%' : null\"\n [style.bottom]=\"orientation() === 'vertical' ? fill().start + '%' : null\"\n [style.height]=\"orientation() === 'vertical' ? fill().size + '%' : null\"\n ></div>\n </div>\n\n <!-- Step ticks (decorative) -->\n @if (markList().length) {\n <div class=\"ui-slider-marks\" aria-hidden=\"true\">\n @for (mark of markList(); track mark.value) {\n <span\n class=\"ui-slider-mark\"\n [class._active]=\"mark.active\"\n [style.inset-inline-start]=\"orientation() === 'horizontal' ? mark.percent + '%' : null\"\n [style.bottom]=\"orientation() === 'vertical' ? mark.percent + '%' : null\"\n ></span>\n }\n </div>\n }\n\n <!-- Handles (WAI-ARIA slider pattern) -->\n @for (handle of handles(); track handle.index) {\n <div\n #handle\n class=\"ui-slider-handle\"\n role=\"slider\"\n [attr.id]=\"handle.index === 0 ? resolvedId() : null\"\n [attr.tabindex]=\"isDisabled() ? -1 : (tabindex() ?? 0)\"\n [attr.aria-valuemin]=\"min()\"\n [attr.aria-valuemax]=\"max()\"\n [attr.aria-valuenow]=\"handle.value\"\n [attr.aria-orientation]=\"orientation()\"\n [attr.aria-label]=\"handleAriaLabel(handle.index)\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-disabled]=\"isDisabled() ? true : null\"\n [attr.aria-readonly]=\"readonly() ? true : null\"\n [style.inset-inline-start]=\"orientation() === 'horizontal' ? handle.percent + '%' : null\"\n [style.bottom]=\"orientation() === 'vertical' ? handle.percent + '%' : null\"\n (keydown)=\"onKeyDown($event, handle.index)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n ></div>\n }\n</div>\n",
357
+ styles: [".ui-slider{position:relative;display:flex;align-items:center;width:100%;min-height:var(--ui-slider-handle-size, 1.375rem);touch-action:none;cursor:pointer;-webkit-user-select:none;user-select:none}.ui-slider-track{position:relative;width:100%;height:var(--ui-slider-thickness, .5rem);border-radius:var(--ui-slider-track-radius, var(--radius-full));background-color:var(--ui-slider-track-surface, var(--global-background-muted))}.ui-slider-range{position:absolute;top:0;height:100%;border-radius:var(--ui-slider-track-radius, var(--radius-full));background-color:var(--ui-slider-range-surface, var(--actions-high-surface-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)))}.ui-slider-handle{position:absolute;top:50%;width:var(--ui-slider-handle-size, 1.375rem);height:var(--ui-slider-handle-size, 1.375rem);transform:translate(-50%,-50%);box-sizing:border-box;border:var(--ui-slider-handle-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) solid var(--ui-slider-handle-stroke, var(--actions-high-stroke-default));border-radius:var(--ui-slider-handle-radius, var(--radius-full));background-color:var(--ui-slider-handle-surface, var(--actions-high-surface-default));cursor:grab;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-slider-handle:hover{background-color:var(--ui-slider-handle-surface-hover, var(--actions-high-surface-hover))}.ui-slider-handle:focus-visible{outline:none;border-color:var(--ui-slider-handle-stroke-focus, var(--actions-high-stroke-focused));box-shadow:0 0 0 var(--ui-slider-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--ui-slider-handle-stroke-focus, var(--actions-high-stroke-focused))}.ui-slider-handle:active{background-color:var(--ui-slider-handle-surface-pressed, var(--actions-high-surface-pressed));cursor:grabbing}.ui-slider-marks{position:absolute;inset:0;pointer-events:none}.ui-slider-mark{position:absolute;top:50%;width:var(--ui-slider-mark-size, .375rem);height:var(--ui-slider-mark-size, .375rem);transform:translate(-50%,-50%);border-radius:var(--ui-slider-mark-radius, var(--radius-full));background-color:var(--ui-slider-mark-surface, var(--informative-defaulthigh-surface-default))}.ui-slider-mark._active{background-color:var(--ui-slider-mark-surface-active, var(--actions-high-content-default))}.ui-slider._vertical{flex-direction:column;width:auto;min-width:var(--ui-slider-handle-size, 1.375rem);height:var(--ui-slider-length, 12rem);min-height:0}.ui-slider._vertical .ui-slider-track{width:var(--ui-slider-thickness, .5rem);height:100%}.ui-slider._vertical .ui-slider-range{top:auto;bottom:0;width:100%;height:auto}.ui-slider._vertical .ui-slider-handle,.ui-slider._vertical .ui-slider-mark{top:auto;left:50%;transform:translate(-50%,50%)}.ui-slider._disabled{cursor:not-allowed}.ui-slider._disabled .ui-slider-range{background-color:var(--ui-slider-range-surface-disabled, var(--actions-high-surface-disabled))}.ui-slider._disabled .ui-slider-handle{cursor:not-allowed;background-color:var(--ui-slider-handle-surface-disabled, var(--actions-high-surface-disabled))}.ui-slider._disabled .ui-slider-handle:hover{background-color:var(--ui-slider-handle-surface-disabled, var(--actions-high-surface-disabled))}.ui-slider._readonly,.ui-slider._readonly .ui-slider-handle{cursor:default}.ui-slider._invalid .ui-slider-range{background-color:var(--ui-slider-range-surface-invalid, var(--form-error-content-default))}.ui-slider._invalid .ui-slider-handle{background-color:var(--ui-slider-handle-surface-invalid, var(--form-error-content-default))}.ui-slider._invalid .ui-slider-handle:hover{background-color:var(--ui-slider-handle-surface-hover-invalid, var(--form-error-content-hover))}.ui-slider._invalid .ui-slider-handle:focus-visible{border-color:var(--ui-slider-handle-stroke-focus-invalid, var(--form-error-stroke-focused));box-shadow:0 0 0 var(--ui-slider-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--ui-slider-handle-stroke-focus-invalid, var(--form-error-stroke-focused))}\n"]
358
+ });
359
+ }
360
+ };
361
+ i0.ɵɵngDeclareClassMetadata({
362
+ minVersion: "12.0.0",
363
+ version: "22.3.0",
364
+ ngImport: i0,
365
+ type: UiSlider,
366
+ decorators: [{
367
+ type: Component,
368
+ args: [{
369
+ selector: "ui-slider",
370
+ standalone: true,
371
+ host: {
372
+ "[style.display]": "orientation() === 'vertical' ? 'inline-block' : 'block'",
373
+ "[style.width]": "orientation() === 'vertical' ? null : '100%'"
374
+ },
375
+ providers: [{
376
+ provide: NG_VALUE_ACCESSOR,
377
+ useExisting: forwardRef(() => UiSlider),
378
+ multi: true
379
+ }],
380
+ template: "<div\n #root\n [class]=\"classes()\"\n (pointerdown)=\"onPointerDown($event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerUp($event)\"\n>\n <!-- Rail + filled portion -->\n <div class=\"ui-slider-track\">\n <div\n class=\"ui-slider-range\"\n [style.inset-inline-start]=\"orientation() === 'horizontal' ? fill().start + '%' : null\"\n [style.width]=\"orientation() === 'horizontal' ? fill().size + '%' : null\"\n [style.bottom]=\"orientation() === 'vertical' ? fill().start + '%' : null\"\n [style.height]=\"orientation() === 'vertical' ? fill().size + '%' : null\"\n ></div>\n </div>\n\n <!-- Step ticks (decorative) -->\n @if (markList().length) {\n <div class=\"ui-slider-marks\" aria-hidden=\"true\">\n @for (mark of markList(); track mark.value) {\n <span\n class=\"ui-slider-mark\"\n [class._active]=\"mark.active\"\n [style.inset-inline-start]=\"orientation() === 'horizontal' ? mark.percent + '%' : null\"\n [style.bottom]=\"orientation() === 'vertical' ? mark.percent + '%' : null\"\n ></span>\n }\n </div>\n }\n\n <!-- Handles (WAI-ARIA slider pattern) -->\n @for (handle of handles(); track handle.index) {\n <div\n #handle\n class=\"ui-slider-handle\"\n role=\"slider\"\n [attr.id]=\"handle.index === 0 ? resolvedId() : null\"\n [attr.tabindex]=\"isDisabled() ? -1 : (tabindex() ?? 0)\"\n [attr.aria-valuemin]=\"min()\"\n [attr.aria-valuemax]=\"max()\"\n [attr.aria-valuenow]=\"handle.value\"\n [attr.aria-orientation]=\"orientation()\"\n [attr.aria-label]=\"handleAriaLabel(handle.index)\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-disabled]=\"isDisabled() ? true : null\"\n [attr.aria-readonly]=\"readonly() ? true : null\"\n [style.inset-inline-start]=\"orientation() === 'horizontal' ? handle.percent + '%' : null\"\n [style.bottom]=\"orientation() === 'vertical' ? handle.percent + '%' : null\"\n (keydown)=\"onKeyDown($event, handle.index)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n ></div>\n }\n</div>\n",
381
+ styles: [".ui-slider{position:relative;display:flex;align-items:center;width:100%;min-height:var(--ui-slider-handle-size, 1.375rem);touch-action:none;cursor:pointer;-webkit-user-select:none;user-select:none}.ui-slider-track{position:relative;width:100%;height:var(--ui-slider-thickness, .5rem);border-radius:var(--ui-slider-track-radius, var(--radius-full));background-color:var(--ui-slider-track-surface, var(--global-background-muted))}.ui-slider-range{position:absolute;top:0;height:100%;border-radius:var(--ui-slider-track-radius, var(--radius-full));background-color:var(--ui-slider-range-surface, var(--actions-high-surface-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)))}.ui-slider-handle{position:absolute;top:50%;width:var(--ui-slider-handle-size, 1.375rem);height:var(--ui-slider-handle-size, 1.375rem);transform:translate(-50%,-50%);box-sizing:border-box;border:var(--ui-slider-handle-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) solid var(--ui-slider-handle-stroke, var(--actions-high-stroke-default));border-radius:var(--ui-slider-handle-radius, var(--radius-full));background-color:var(--ui-slider-handle-surface, var(--actions-high-surface-default));cursor:grab;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-slider-handle:hover{background-color:var(--ui-slider-handle-surface-hover, var(--actions-high-surface-hover))}.ui-slider-handle:focus-visible{outline:none;border-color:var(--ui-slider-handle-stroke-focus, var(--actions-high-stroke-focused));box-shadow:0 0 0 var(--ui-slider-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--ui-slider-handle-stroke-focus, var(--actions-high-stroke-focused))}.ui-slider-handle:active{background-color:var(--ui-slider-handle-surface-pressed, var(--actions-high-surface-pressed));cursor:grabbing}.ui-slider-marks{position:absolute;inset:0;pointer-events:none}.ui-slider-mark{position:absolute;top:50%;width:var(--ui-slider-mark-size, .375rem);height:var(--ui-slider-mark-size, .375rem);transform:translate(-50%,-50%);border-radius:var(--ui-slider-mark-radius, var(--radius-full));background-color:var(--ui-slider-mark-surface, var(--informative-defaulthigh-surface-default))}.ui-slider-mark._active{background-color:var(--ui-slider-mark-surface-active, var(--actions-high-content-default))}.ui-slider._vertical{flex-direction:column;width:auto;min-width:var(--ui-slider-handle-size, 1.375rem);height:var(--ui-slider-length, 12rem);min-height:0}.ui-slider._vertical .ui-slider-track{width:var(--ui-slider-thickness, .5rem);height:100%}.ui-slider._vertical .ui-slider-range{top:auto;bottom:0;width:100%;height:auto}.ui-slider._vertical .ui-slider-handle,.ui-slider._vertical .ui-slider-mark{top:auto;left:50%;transform:translate(-50%,50%)}.ui-slider._disabled{cursor:not-allowed}.ui-slider._disabled .ui-slider-range{background-color:var(--ui-slider-range-surface-disabled, var(--actions-high-surface-disabled))}.ui-slider._disabled .ui-slider-handle{cursor:not-allowed;background-color:var(--ui-slider-handle-surface-disabled, var(--actions-high-surface-disabled))}.ui-slider._disabled .ui-slider-handle:hover{background-color:var(--ui-slider-handle-surface-disabled, var(--actions-high-surface-disabled))}.ui-slider._readonly,.ui-slider._readonly .ui-slider-handle{cursor:default}.ui-slider._invalid .ui-slider-range{background-color:var(--ui-slider-range-surface-invalid, var(--form-error-content-default))}.ui-slider._invalid .ui-slider-handle{background-color:var(--ui-slider-handle-surface-invalid, var(--form-error-content-default))}.ui-slider._invalid .ui-slider-handle:hover{background-color:var(--ui-slider-handle-surface-hover-invalid, var(--form-error-content-hover))}.ui-slider._invalid .ui-slider-handle:focus-visible{border-color:var(--ui-slider-handle-stroke-focus-invalid, var(--form-error-stroke-focused));box-shadow:0 0 0 var(--ui-slider-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--ui-slider-handle-stroke-focus-invalid, var(--form-error-stroke-focused))}\n"]
382
+ }]
383
+ }],
384
+ ctorParameters: () => [],
385
+ propDecorators: {
386
+ min: [{
387
+ type: i0.Input,
388
+ args: [{
389
+ isSignal: true,
390
+ alias: "min",
391
+ required: false
392
+ }]
393
+ }],
394
+ max: [{
395
+ type: i0.Input,
396
+ args: [{
397
+ isSignal: true,
398
+ alias: "max",
399
+ required: false
400
+ }]
401
+ }],
402
+ step: [{
403
+ type: i0.Input,
404
+ args: [{
405
+ isSignal: true,
406
+ alias: "step",
407
+ required: false
408
+ }]
409
+ }],
410
+ range: [{
411
+ type: i0.Input,
412
+ args: [{
413
+ isSignal: true,
414
+ alias: "range",
415
+ required: false
416
+ }]
417
+ }],
418
+ minStepsBetweenHandles: [{
419
+ type: i0.Input,
420
+ args: [{
421
+ isSignal: true,
422
+ alias: "minStepsBetweenHandles",
423
+ required: false
424
+ }]
425
+ }],
426
+ marks: [{
427
+ type: i0.Input,
428
+ args: [{
429
+ isSignal: true,
430
+ alias: "marks",
431
+ required: false
432
+ }]
433
+ }],
434
+ orientation: [{
435
+ type: i0.Input,
436
+ args: [{
437
+ isSignal: true,
438
+ alias: "orientation",
439
+ required: false
440
+ }]
441
+ }],
442
+ ariaLabelStart: [{
443
+ type: i0.Input,
444
+ args: [{
445
+ isSignal: true,
446
+ alias: "ariaLabelStart",
447
+ required: false
448
+ }]
449
+ }],
450
+ ariaLabelEnd: [{
451
+ type: i0.Input,
452
+ args: [{
453
+ isSignal: true,
454
+ alias: "ariaLabelEnd",
455
+ required: false
456
+ }]
457
+ }],
458
+ sliderChange: [{
459
+ type: i0.Output,
460
+ args: ["sliderChange"]
461
+ }],
462
+ slideEnd: [{
463
+ type: i0.Output,
464
+ args: ["slideEnd"]
465
+ }],
466
+ sliderFocus: [{
467
+ type: i0.Output,
468
+ args: ["sliderFocus"]
469
+ }],
470
+ sliderBlur: [{
471
+ type: i0.Output,
472
+ args: ["sliderBlur"]
473
+ }],
474
+ root: [{
475
+ type: i0.ViewChild,
476
+ args: ["root", { isSignal: true }]
477
+ }],
478
+ handleEls: [{
479
+ type: i0.ViewChildren,
480
+ args: ["handle", { isSignal: true }]
481
+ }]
482
+ }
483
+ });
338
484
  export { UiSlider };
339
- //# sourceMappingURL=4sh-ui-kit-forms-ui-slider.mjs.map
485
+
486
+ //# sourceMappingURL=4sh-ui-kit-forms-ui-slider.mjs.map