@educarehq/solaris-ui 0.2.0 → 0.3.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 (225) hide show
  1. package/esm2022/index.js +40 -1
  2. package/esm2022/index.js.map +1 -1
  3. package/esm2022/lib/components/actions/button/index.js +3 -0
  4. package/esm2022/lib/components/actions/button/index.js.map +1 -0
  5. package/esm2022/lib/components/data-display/badge/index.js +3 -0
  6. package/esm2022/lib/components/data-display/badge/index.js.map +1 -0
  7. package/esm2022/lib/components/data-display/divider/component/divider.component.js +46 -0
  8. package/esm2022/lib/components/data-display/divider/component/divider.component.js.map +1 -0
  9. package/esm2022/lib/components/data-display/divider/index.js +2 -0
  10. package/esm2022/lib/components/data-display/divider/index.js.map +1 -0
  11. package/esm2022/lib/components/data-display/divider/model/divider.types.js +1 -0
  12. package/esm2022/lib/components/data-display/divider/model/divider.types.js.map +1 -0
  13. package/esm2022/lib/components/feedback/toast/component/toast.component.js +268 -0
  14. package/esm2022/lib/components/feedback/toast/component/toast.component.js.map +1 -0
  15. package/esm2022/lib/components/feedback/toast/container/toast-container.component.js +24 -0
  16. package/esm2022/lib/components/feedback/toast/container/toast-container.component.js.map +1 -0
  17. package/esm2022/lib/components/feedback/toast/model/toast.types.js +1 -0
  18. package/esm2022/lib/components/feedback/toast/model/toast.types.js.map +1 -0
  19. package/esm2022/lib/components/feedback/toast/provider/provide-solaris-toast.js +17 -0
  20. package/esm2022/lib/components/feedback/toast/provider/provide-solaris-toast.js.map +1 -0
  21. package/esm2022/lib/components/feedback/toast/service/toast.service.js +219 -0
  22. package/esm2022/lib/components/feedback/toast/service/toast.service.js.map +1 -0
  23. package/esm2022/lib/components/feedback/toast/token/toast.tokens.js +13 -0
  24. package/esm2022/lib/components/feedback/toast/token/toast.tokens.js.map +1 -0
  25. package/esm2022/lib/components/forms/email-field/component/email-field.component.js +5 -4
  26. package/esm2022/lib/components/forms/email-field/component/email-field.component.js.map +1 -1
  27. package/esm2022/lib/components/forms/form-field/component/form-field.component.js +50 -2
  28. package/esm2022/lib/components/forms/form-field/component/form-field.component.js.map +1 -1
  29. package/esm2022/lib/components/forms/form-field/directives/form-field-trigger.directive.js.map +1 -1
  30. package/esm2022/lib/components/forms/form-field/index.js.map +1 -1
  31. package/esm2022/lib/components/forms/multi-select/component/multi-select.component.js +11 -28
  32. package/esm2022/lib/components/forms/multi-select/component/multi-select.component.js.map +1 -1
  33. package/esm2022/lib/components/forms/multi-select/model/multi-select.types.js.map +1 -1
  34. package/esm2022/lib/components/forms/option/component/option.component.js +2 -2
  35. package/esm2022/lib/components/forms/option/component/option.component.js.map +1 -1
  36. package/esm2022/lib/components/forms/password-field/component/password-field.component.js +2 -2
  37. package/esm2022/lib/components/forms/password-field/component/password-field.component.js.map +1 -1
  38. package/esm2022/lib/components/forms/radio/component/radio.component.js +2 -2
  39. package/esm2022/lib/components/forms/select/component/select.component.js +4 -8
  40. package/esm2022/lib/components/forms/select/component/select.component.js.map +1 -1
  41. package/esm2022/lib/components/icon/component/solaris-icon.component.js +2 -2
  42. package/esm2022/lib/components/icon/component/solaris-icon.component.js.map +1 -1
  43. package/esm2022/lib/components/interaction/dropdown-menu/component/dropdown-menu-group.component.js +27 -0
  44. package/esm2022/lib/components/interaction/dropdown-menu/component/dropdown-menu-group.component.js.map +1 -0
  45. package/esm2022/lib/components/interaction/dropdown-menu/component/dropdown-menu-item.component.js +96 -0
  46. package/esm2022/lib/components/interaction/dropdown-menu/component/dropdown-menu-item.component.js.map +1 -0
  47. package/esm2022/lib/components/interaction/dropdown-menu/component/dropdown-menu-label.component.js +22 -0
  48. package/esm2022/lib/components/interaction/dropdown-menu/component/dropdown-menu-label.component.js.map +1 -0
  49. package/esm2022/lib/components/interaction/dropdown-menu/component/dropdown-menu.component.js +105 -0
  50. package/esm2022/lib/components/interaction/dropdown-menu/component/dropdown-menu.component.js.map +1 -0
  51. package/esm2022/lib/components/interaction/dropdown-menu/component/dropdown-submenu-trigger.component.js +95 -0
  52. package/esm2022/lib/components/interaction/dropdown-menu/component/dropdown-submenu-trigger.component.js.map +1 -0
  53. package/esm2022/lib/components/interaction/dropdown-menu/component/dropdown-submenu.component.js +631 -0
  54. package/esm2022/lib/components/interaction/dropdown-menu/component/dropdown-submenu.component.js.map +1 -0
  55. package/esm2022/lib/components/interaction/dropdown-menu/directives/dropdown-menu-trigger.directive.js +365 -0
  56. package/esm2022/lib/components/interaction/dropdown-menu/directives/dropdown-menu-trigger.directive.js.map +1 -0
  57. package/esm2022/lib/components/interaction/dropdown-menu/index.js +8 -0
  58. package/esm2022/lib/components/interaction/dropdown-menu/index.js.map +1 -0
  59. package/esm2022/lib/components/interaction/dropdown-menu/model/dropdown-menu-navigation.js +3 -0
  60. package/esm2022/lib/components/interaction/dropdown-menu/model/dropdown-menu-navigation.js.map +1 -0
  61. package/esm2022/lib/components/interaction/dropdown-menu/model/dropdown-menu.types.js +1 -0
  62. package/esm2022/lib/components/interaction/dropdown-menu/model/dropdown-menu.types.js.map +1 -0
  63. package/esm2022/lib/components/interaction/dropdown-menu/model/dropdown-submenu.types.js +1 -0
  64. package/esm2022/lib/components/interaction/dropdown-menu/model/dropdown-submenu.types.js.map +1 -0
  65. package/esm2022/lib/components/interaction/popover/component/popover-panel.component.js +2 -2
  66. package/esm2022/lib/components/interaction/popover/component/popover-panel.component.js.map +1 -1
  67. package/esm2022/lib/components/interaction/popover/directives/popover-trigger.directive.js +28 -20
  68. package/esm2022/lib/components/interaction/popover/directives/popover-trigger.directive.js.map +1 -1
  69. package/esm2022/lib/components/interaction/tooltip/component/tooltip-panel.component.js.map +1 -1
  70. package/esm2022/lib/components/interaction/tooltip/directive/tooltip.directive.js.map +1 -1
  71. package/esm2022/lib/components/interaction/tooltip/model/tooltip-position.js.map +1 -1
  72. package/esm2022/lib/components/navigation/editable-tabs/component/editable-tabs.component.js +323 -0
  73. package/esm2022/lib/components/navigation/editable-tabs/component/editable-tabs.component.js.map +1 -0
  74. package/esm2022/lib/components/navigation/editable-tabs/editable-tab/editable-tab.component.js +34 -0
  75. package/esm2022/lib/components/navigation/editable-tabs/editable-tab/editable-tab.component.js.map +1 -0
  76. package/esm2022/lib/components/navigation/editable-tabs/model/editable-tabs.types.js +1 -0
  77. package/esm2022/lib/components/navigation/editable-tabs/model/editable-tabs.types.js.map +1 -0
  78. package/esm2022/lib/components/navigation/segmented-control/component/segmented-control.component.js +242 -0
  79. package/esm2022/lib/components/navigation/segmented-control/component/segmented-control.component.js.map +1 -0
  80. package/esm2022/lib/components/navigation/segmented-control/item/segmented-item.component.js +197 -0
  81. package/esm2022/lib/components/navigation/segmented-control/item/segmented-item.component.js.map +1 -0
  82. package/esm2022/lib/components/navigation/segmented-control/model/segmented-control.types.js +1 -0
  83. package/esm2022/lib/components/navigation/segmented-control/model/segmented-control.types.js.map +1 -0
  84. package/esm2022/lib/components/navigation/segmented-control/token/segmented-control.tokens.js +3 -0
  85. package/esm2022/lib/components/navigation/segmented-control/token/segmented-control.tokens.js.map +1 -0
  86. package/esm2022/lib/components/navigation/stepper/actions/stepper-actions.component.js +15 -0
  87. package/esm2022/lib/components/navigation/stepper/actions/stepper-actions.component.js.map +1 -0
  88. package/esm2022/lib/components/navigation/stepper/component/stepper.component.js +99 -0
  89. package/esm2022/lib/components/navigation/stepper/component/stepper.component.js.map +1 -0
  90. package/esm2022/lib/components/navigation/stepper/content/stepper-content.component.js +13 -0
  91. package/esm2022/lib/components/navigation/stepper/content/stepper-content.component.js.map +1 -0
  92. package/esm2022/lib/components/navigation/stepper/model/stepper.types.js +1 -0
  93. package/esm2022/lib/components/navigation/stepper/model/stepper.types.js.map +1 -0
  94. package/esm2022/lib/components/navigation/stepper/step/step.component.js +91 -0
  95. package/esm2022/lib/components/navigation/stepper/step/step.component.js.map +1 -0
  96. package/esm2022/lib/components/navigation/stepper/token/stepper.tokens.js +3 -0
  97. package/esm2022/lib/components/navigation/stepper/token/stepper.tokens.js.map +1 -0
  98. package/esm2022/lib/components/navigation/tabs/component/tabs.component.js +169 -0
  99. package/esm2022/lib/components/navigation/tabs/component/tabs.component.js.map +1 -0
  100. package/esm2022/lib/components/navigation/tabs/index.js +5 -0
  101. package/esm2022/lib/components/navigation/tabs/index.js.map +1 -0
  102. package/esm2022/lib/components/navigation/tabs/model/tabs.types.js +1 -0
  103. package/esm2022/lib/components/navigation/tabs/model/tabs.types.js.map +1 -0
  104. package/esm2022/lib/components/navigation/tabs/tab/tab.component.js +195 -0
  105. package/esm2022/lib/components/navigation/tabs/tab/tab.component.js.map +1 -0
  106. package/esm2022/lib/components/navigation/tabs/tab-panel/tab-panel.component.js +55 -0
  107. package/esm2022/lib/components/navigation/tabs/tab-panel/tab-panel.component.js.map +1 -0
  108. package/esm2022/lib/components/navigation/tabs/token/tabs.tokens.js +3 -0
  109. package/esm2022/lib/components/navigation/tabs/token/tabs.tokens.js.map +1 -0
  110. package/esm2022/lib/components/overlay/dialog/component/dialog.component.js +49 -0
  111. package/esm2022/lib/components/overlay/dialog/component/dialog.component.js.map +1 -0
  112. package/esm2022/lib/components/overlay/dialog/components/dialog-actions.component.js +37 -0
  113. package/esm2022/lib/components/overlay/dialog/components/dialog-actions.component.js.map +1 -0
  114. package/esm2022/lib/components/overlay/dialog/components/dialog-content.component.js +13 -0
  115. package/esm2022/lib/components/overlay/dialog/components/dialog-content.component.js.map +1 -0
  116. package/esm2022/lib/components/overlay/dialog/components/dialog-header.component.js +32 -0
  117. package/esm2022/lib/components/overlay/dialog/components/dialog-header.component.js.map +1 -0
  118. package/esm2022/lib/components/overlay/dialog/container/dialog-container.component.js +142 -0
  119. package/esm2022/lib/components/overlay/dialog/container/dialog-container.component.js.map +1 -0
  120. package/esm2022/lib/components/overlay/dialog/flow/dialog-flow.component.js +56 -0
  121. package/esm2022/lib/components/overlay/dialog/flow/dialog-flow.component.js.map +1 -0
  122. package/esm2022/lib/components/overlay/dialog/flow/dialog-step.component.js +20 -0
  123. package/esm2022/lib/components/overlay/dialog/flow/dialog-step.component.js.map +1 -0
  124. package/esm2022/lib/components/overlay/dialog/model/dialog.types.js +1 -0
  125. package/esm2022/lib/components/overlay/dialog/model/dialog.types.js.map +1 -0
  126. package/esm2022/lib/components/overlay/dialog/provider/provide-solaris-dialog.js +13 -0
  127. package/esm2022/lib/components/overlay/dialog/provider/provide-solaris-dialog.js.map +1 -0
  128. package/esm2022/lib/components/overlay/dialog/service/dialog-ref.js +23 -0
  129. package/esm2022/lib/components/overlay/dialog/service/dialog-ref.js.map +1 -0
  130. package/esm2022/lib/components/overlay/dialog/service/dialog.service.js +111 -0
  131. package/esm2022/lib/components/overlay/dialog/service/dialog.service.js.map +1 -0
  132. package/esm2022/lib/components/overlay/dialog/token/dialog-data.token.js +4 -0
  133. package/esm2022/lib/components/overlay/dialog/token/dialog-data.token.js.map +1 -0
  134. package/esm2022/lib/components/overlay/dialog/token/dialog.tokens.js +15 -0
  135. package/esm2022/lib/components/overlay/dialog/token/dialog.tokens.js.map +1 -0
  136. package/esm2022/lib/services/icon/icons/groups/actions.js +242 -0
  137. package/esm2022/lib/services/icon/icons/groups/actions.js.map +1 -0
  138. package/esm2022/lib/services/icon/icons/groups/data.js +129 -0
  139. package/esm2022/lib/services/icon/icons/groups/data.js.map +1 -0
  140. package/esm2022/lib/services/icon/icons/groups/layout.js +50 -0
  141. package/esm2022/lib/services/icon/icons/groups/layout.js.map +1 -0
  142. package/esm2022/lib/services/icon/icons/groups/navigation.js +354 -0
  143. package/esm2022/lib/services/icon/icons/groups/navigation.js.map +1 -0
  144. package/esm2022/lib/services/icon/icons/groups/status.js +70 -0
  145. package/esm2022/lib/services/icon/icons/groups/status.js.map +1 -0
  146. package/esm2022/lib/services/icon/icons/groups/theme.js +49 -0
  147. package/esm2022/lib/services/icon/icons/groups/theme.js.map +1 -0
  148. package/esm2022/lib/services/icon/icons/solaris-built-in-icons.js +12 -204
  149. package/esm2022/lib/services/icon/icons/solaris-built-in-icons.js.map +1 -1
  150. package/esm2022/lib/services/icon/model/solaris-icon-definition.interface.js.map +1 -1
  151. package/esm2022/lib/services/icon/model/solaris-icon.types.js.map +1 -1
  152. package/esm2022/lib/services/translation/model/solaris-translate-defaults.js +56 -0
  153. package/esm2022/lib/services/translation/model/solaris-translate-defaults.js.map +1 -1
  154. package/index.d.ts +92 -1
  155. package/lib/components/actions/button/index.d.ts +3 -0
  156. package/lib/components/data-display/badge/index.d.ts +3 -0
  157. package/lib/components/data-display/divider/component/divider.component.d.ts +17 -0
  158. package/lib/components/data-display/divider/index.d.ts +2 -0
  159. package/lib/components/data-display/divider/model/divider.types.d.ts +5 -0
  160. package/lib/components/feedback/toast/component/toast.component.d.ts +62 -0
  161. package/lib/components/feedback/toast/container/toast-container.component.d.ts +10 -0
  162. package/lib/components/feedback/toast/model/toast.types.d.ts +106 -0
  163. package/lib/components/feedback/toast/provider/provide-solaris-toast.d.ts +3 -0
  164. package/lib/components/feedback/toast/service/toast.service.d.ts +36 -0
  165. package/lib/components/feedback/toast/token/toast.tokens.d.ts +5 -0
  166. package/lib/components/forms/email-field/component/email-field.component.d.ts +2 -1
  167. package/lib/components/forms/form-field/component/form-field.component.d.ts +6 -0
  168. package/lib/components/forms/multi-select/component/multi-select.component.d.ts +4 -7
  169. package/lib/components/forms/select/component/select.component.d.ts +2 -2
  170. package/lib/components/interaction/dropdown-menu/component/dropdown-menu-group.component.d.ts +10 -0
  171. package/lib/components/interaction/dropdown-menu/component/dropdown-menu-item.component.d.ts +28 -0
  172. package/lib/components/interaction/dropdown-menu/component/dropdown-menu-label.component.d.ts +7 -0
  173. package/lib/components/interaction/dropdown-menu/component/dropdown-menu.component.d.ts +21 -0
  174. package/lib/components/interaction/dropdown-menu/component/dropdown-submenu-trigger.component.d.ts +21 -0
  175. package/lib/components/interaction/dropdown-menu/component/dropdown-submenu.component.d.ts +68 -0
  176. package/lib/components/interaction/dropdown-menu/directives/dropdown-menu-trigger.directive.d.ts +61 -0
  177. package/lib/components/interaction/dropdown-menu/index.d.ts +9 -0
  178. package/lib/components/interaction/dropdown-menu/model/dropdown-menu-navigation.d.ts +8 -0
  179. package/lib/components/interaction/dropdown-menu/model/dropdown-menu.types.d.ts +11 -0
  180. package/lib/components/interaction/dropdown-menu/model/dropdown-submenu.types.d.ts +2 -0
  181. package/lib/components/navigation/editable-tabs/component/editable-tabs.component.d.ts +69 -0
  182. package/lib/components/navigation/editable-tabs/editable-tab/editable-tab.component.d.ts +20 -0
  183. package/lib/components/navigation/editable-tabs/model/editable-tabs.types.d.ts +60 -0
  184. package/lib/components/navigation/segmented-control/component/segmented-control.component.d.ts +64 -0
  185. package/lib/components/navigation/segmented-control/item/segmented-item.component.d.ts +35 -0
  186. package/lib/components/navigation/segmented-control/model/segmented-control.types.d.ts +12 -0
  187. package/lib/components/navigation/segmented-control/token/segmented-control.tokens.d.ts +22 -0
  188. package/lib/components/navigation/stepper/actions/stepper-actions.component.d.ts +7 -0
  189. package/lib/components/navigation/stepper/component/stepper.component.d.ts +36 -0
  190. package/lib/components/navigation/stepper/content/stepper-content.component.d.ts +5 -0
  191. package/lib/components/navigation/stepper/model/stepper.types.d.ts +15 -0
  192. package/lib/components/navigation/stepper/step/step.component.d.ts +27 -0
  193. package/lib/components/navigation/stepper/token/stepper.tokens.d.ts +13 -0
  194. package/lib/components/navigation/tabs/component/tabs.component.d.ts +47 -0
  195. package/lib/components/navigation/tabs/index.d.ts +6 -0
  196. package/lib/components/navigation/tabs/model/tabs.types.d.ts +17 -0
  197. package/lib/components/navigation/tabs/tab/tab.component.d.ts +38 -0
  198. package/lib/components/navigation/tabs/tab-panel/tab-panel.component.d.ts +15 -0
  199. package/lib/components/navigation/tabs/token/tabs.tokens.d.ts +19 -0
  200. package/lib/components/overlay/dialog/component/dialog.component.d.ts +29 -0
  201. package/lib/components/overlay/dialog/components/dialog-actions.component.d.ts +12 -0
  202. package/lib/components/overlay/dialog/components/dialog-content.component.d.ts +5 -0
  203. package/lib/components/overlay/dialog/components/dialog-header.component.d.ts +19 -0
  204. package/lib/components/overlay/dialog/container/dialog-container.component.d.ts +32 -0
  205. package/lib/components/overlay/dialog/flow/dialog-flow.component.d.ts +19 -0
  206. package/lib/components/overlay/dialog/flow/dialog-step.component.d.ts +7 -0
  207. package/lib/components/overlay/dialog/model/dialog.types.d.ts +87 -0
  208. package/lib/components/overlay/dialog/provider/provide-solaris-dialog.d.ts +3 -0
  209. package/lib/components/overlay/dialog/service/dialog-ref.d.ts +11 -0
  210. package/lib/components/overlay/dialog/service/dialog.service.d.ts +20 -0
  211. package/lib/components/overlay/dialog/token/dialog-data.token.d.ts +4 -0
  212. package/lib/components/overlay/dialog/token/dialog.tokens.d.ts +4 -0
  213. package/lib/services/icon/icons/groups/actions.d.ts +2 -0
  214. package/lib/services/icon/icons/groups/data.d.ts +2 -0
  215. package/lib/services/icon/icons/groups/layout.d.ts +2 -0
  216. package/lib/services/icon/icons/groups/navigation.d.ts +2 -0
  217. package/lib/services/icon/icons/groups/status.d.ts +2 -0
  218. package/lib/services/icon/icons/groups/theme.d.ts +2 -0
  219. package/lib/services/icon/model/solaris-icon-definition.interface.d.ts +10 -1
  220. package/lib/services/icon/model/solaris-icon.types.d.ts +1 -1
  221. package/package.json +1 -1
  222. package/styles/_dropdown-menu.scss +72 -0
  223. package/styles/_popover.scss +24 -19
  224. package/styles/_toast.scss +9 -0
  225. package/styles/_tooltip.scss +3 -3
@@ -0,0 +1,242 @@
1
+ import { Component, input, output, model, contentChildren, computed, signal, inject, ChangeDetectionStrategy, effect, ElementRef, NgZone, Injector, forwardRef, } from '@angular/core';
2
+ import { NG_VALUE_ACCESSOR } from '@angular/forms';
3
+ import { SolarisSegmentedItemComponent } from '../item/segmented-item.component';
4
+ import { SolarisTranslateService } from '../../../../services/translation';
5
+ import { SOLARIS_SEGMENTED_CONTROL, } from '../token/segmented-control.tokens';
6
+ import * as i0 from "@angular/core";
7
+ let nextInstanceId = 0;
8
+ export class SolarisSegmentedControlComponent {
9
+ translateService = inject(SolarisTranslateService, {
10
+ optional: true,
11
+ });
12
+ elementRef = inject(ElementRef);
13
+ injector = inject(Injector);
14
+ ngZone = inject(NgZone);
15
+ items = contentChildren(SolarisSegmentedItemComponent, ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
16
+ invalid = input(false, ...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
17
+ indicator = input(true, ...(ngDevMode ? [{ debugName: "indicator" }] : /* istanbul ignore next */ []));
18
+ disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
19
+ readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
20
+ required = input(false, ...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
21
+ fullWidth = input(false, ...(ngDevMode ? [{ debugName: "fullWidth" }] : /* istanbul ignore next */ []));
22
+ equalWidth = input(false, ...(ngDevMode ? [{ debugName: "equalWidth" }] : /* istanbul ignore next */ []));
23
+ value = model(undefined, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
24
+ defaultValue = input(undefined, ...(ngDevMode ? [{ debugName: "defaultValue" }] : /* istanbul ignore next */ []));
25
+ compareFn = computed(() => this.compareWith(), ...(ngDevMode ? [{ debugName: "compareFn" }] : /* istanbul ignore next */ []));
26
+ ariaLabel = input(undefined, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
27
+ ariaLabelKey = input(undefined, ...(ngDevMode ? [{ debugName: "ariaLabelKey" }] : /* istanbul ignore next */ []));
28
+ ariaLabelledby = input(undefined, ...(ngDevMode ? [{ debugName: "ariaLabelledby" }] : /* istanbul ignore next */ []));
29
+ size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
30
+ radius = input('md', ...(ngDevMode ? [{ debugName: "radius" }] : /* istanbul ignore next */ []));
31
+ compareWith = input(Object.is, ...(ngDevMode ? [{ debugName: "compareWith" }] : /* istanbul ignore next */ []));
32
+ density = input('comfortable', ...(ngDevMode ? [{ debugName: "density" }] : /* istanbul ignore next */ []));
33
+ appearance = input('surface', ...(ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []));
34
+ orientation = input('horizontal', ...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
35
+ valueChange = output();
36
+ segmentedChange = output();
37
+ instanceId = `solaris-segmented-control-${nextInstanceId++}`;
38
+ touched = signal(false, ...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
39
+ indicatorWidth = signal('0', ...(ngDevMode ? [{ debugName: "indicatorWidth" }] : /* istanbul ignore next */ []));
40
+ indicatorHeight = signal('0', ...(ngDevMode ? [{ debugName: "indicatorHeight" }] : /* istanbul ignore next */ []));
41
+ indicatorReady = signal(false, ...(ngDevMode ? [{ debugName: "indicatorReady" }] : /* istanbul ignore next */ []));
42
+ internalDisabled = signal(false, ...(ngDevMode ? [{ debugName: "internalDisabled" }] : /* istanbul ignore next */ []));
43
+ indicatorTransformX = signal('translateX(0)', ...(ngDevMode ? [{ debugName: "indicatorTransformX" }] : /* istanbul ignore next */ []));
44
+ indicatorTransformY = signal('translateY(0)', ...(ngDevMode ? [{ debugName: "indicatorTransformY" }] : /* istanbul ignore next */ []));
45
+ onChange = () => undefined;
46
+ onTouched = () => undefined;
47
+ resizeObserver = null;
48
+ contentObserver = null;
49
+ isEffectivelyDisabled = computed(() => {
50
+ return this.disabled() || this.internalDisabled();
51
+ }, ...(ngDevMode ? [{ debugName: "isEffectivelyDisabled" }] : /* istanbul ignore next */ []));
52
+ hasValue = computed(() => {
53
+ return this.value() !== undefined && this.value() !== null;
54
+ }, ...(ngDevMode ? [{ debugName: "hasValue" }] : /* istanbul ignore next */ []));
55
+ resolvedAriaLabel = computed(() => {
56
+ if (this.ariaLabel())
57
+ return this.ariaLabel();
58
+ const ariaLabelKey = this.ariaLabelKey();
59
+ if (ariaLabelKey && this.translateService) {
60
+ return this.translateService.translate(ariaLabelKey);
61
+ }
62
+ return ariaLabelKey ?? undefined;
63
+ }, ...(ngDevMode ? [{ debugName: "resolvedAriaLabel" }] : /* istanbul ignore next */ []));
64
+ constructor() {
65
+ effect(() => {
66
+ const defaultValue = this.defaultValue();
67
+ const currentValue = this.value();
68
+ if (currentValue === undefined && defaultValue !== undefined) {
69
+ this.value.set(defaultValue);
70
+ }
71
+ });
72
+ }
73
+ ngAfterViewInit() {
74
+ this.setupIndicatorMeasurement();
75
+ effect(() => {
76
+ this.value();
77
+ this.appearance();
78
+ this.orientation();
79
+ this.size();
80
+ this.density();
81
+ this.radius();
82
+ this.ngZone.runOutsideAngular(() => {
83
+ requestAnimationFrame(() => this.measureIndicator());
84
+ });
85
+ }, { injector: this.injector });
86
+ }
87
+ ngOnDestroy() {
88
+ this.disconnectObserver();
89
+ }
90
+ selectItem(item) {
91
+ if (this.isEffectivelyDisabled())
92
+ return;
93
+ if (this.readonly())
94
+ return;
95
+ const previousValue = this.value();
96
+ const newValue = item.value();
97
+ if (this.compareFn()(newValue, previousValue))
98
+ return;
99
+ this.value.set(newValue);
100
+ this.valueChange.emit(newValue);
101
+ this.segmentedChange.emit({ value: newValue, previousValue });
102
+ this.onChange(newValue);
103
+ this.markAsTouched();
104
+ }
105
+ focusItem(item) {
106
+ // SECURITY_EXCEPTION: nativeElement.querySelector required to find item DOM element for programmatic focus. Standard DOM method, SSR-safe with guard.
107
+ const nativeElement = this.elementRef.nativeElement;
108
+ const itemElements = nativeElement.querySelectorAll('solaris-segmented-item');
109
+ const items = this.items();
110
+ const index = items.indexOf(item);
111
+ if (index >= 0 && itemElements[index]) {
112
+ itemElements[index].focus();
113
+ }
114
+ }
115
+ // ControlValueAccessor
116
+ writeValue(safe) {
117
+ this.value.set(safe);
118
+ this.ngZone.runOutsideAngular(() => {
119
+ requestAnimationFrame(() => this.measureIndicator());
120
+ });
121
+ }
122
+ registerOnChange(fn) {
123
+ this.onChange = fn;
124
+ }
125
+ registerOnTouched(fn) {
126
+ this.onTouched = fn;
127
+ }
128
+ setDisabledState(isDisabled) {
129
+ this.internalDisabled.set(isDisabled);
130
+ }
131
+ markAsTouched() {
132
+ if (!this.touched()) {
133
+ this.touched.set(true);
134
+ this.onTouched();
135
+ }
136
+ }
137
+ measureIndicator() {
138
+ if (!this.indicator())
139
+ return;
140
+ // SECURITY_EXCEPTION: nativeElement.querySelector required to measure indicator position for animation. Read-only measurement, SSR-safe.
141
+ const nativeEl = this.elementRef.nativeElement;
142
+ const container = nativeEl.querySelector('.solaris-segmented-control__container');
143
+ if (!container)
144
+ return;
145
+ const selectedItem = container.querySelector('solaris-segmented-item[data-selected="true"]');
146
+ if (!selectedItem)
147
+ return;
148
+ const isVertical = this.orientation() === 'vertical';
149
+ if (isVertical) {
150
+ this.indicatorTransformY.set(`translateY(${selectedItem.offsetTop}px)`);
151
+ this.indicatorHeight.set(`${selectedItem.offsetHeight}px`);
152
+ }
153
+ else {
154
+ this.indicatorTransformX.set(`translateX(${selectedItem.offsetLeft}px)`);
155
+ this.indicatorWidth.set(`${selectedItem.offsetWidth}px`);
156
+ }
157
+ if (!this.indicatorReady()) {
158
+ requestAnimationFrame(() => this.indicatorReady.set(true));
159
+ }
160
+ }
161
+ setupIndicatorMeasurement() {
162
+ if (typeof ResizeObserver !== 'undefined') {
163
+ this.resizeObserver = new ResizeObserver(() => {
164
+ this.ngZone.runOutsideAngular(() => {
165
+ requestAnimationFrame(() => this.measureIndicator());
166
+ });
167
+ });
168
+ // SECURITY_EXCEPTION: nativeElement required for ResizeObserver target. Standard DOM API, SSR-safe with typeof guard.
169
+ const nativeEl = this.elementRef.nativeElement;
170
+ this.resizeObserver.observe(nativeEl);
171
+ }
172
+ if (typeof MutationObserver !== 'undefined') {
173
+ // SECURITY_EXCEPTION: nativeElement required for MutationObserver target. Standard DOM API, SSR-safe with typeof guard.
174
+ const nativeEl = this.elementRef.nativeElement;
175
+ this.contentObserver = new MutationObserver(() => {
176
+ this.ngZone.runOutsideAngular(() => {
177
+ requestAnimationFrame(() => this.measureIndicator());
178
+ });
179
+ });
180
+ this.contentObserver.observe(nativeEl, {
181
+ childList: true,
182
+ subtree: true,
183
+ characterData: true,
184
+ });
185
+ }
186
+ this.ngZone.runOutsideAngular(() => {
187
+ requestAnimationFrame(() => this.measureIndicator());
188
+ });
189
+ }
190
+ disconnectObserver() {
191
+ this.resizeObserver?.disconnect();
192
+ this.resizeObserver = null;
193
+ this.contentObserver?.disconnect();
194
+ this.contentObserver = null;
195
+ }
196
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisSegmentedControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
197
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SolarisSegmentedControlComponent, isStandalone: true, selector: "solaris-segmented-control", inputs: { invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, indicator: { classPropertyName: "indicator", publicName: "indicator", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null }, equalWidth: { classPropertyName: "equalWidth", publicName: "equalWidth", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, defaultValue: { classPropertyName: "defaultValue", publicName: "defaultValue", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelKey: { classPropertyName: "ariaLabelKey", publicName: "ariaLabelKey", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "ariaLabelledby", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, radius: { classPropertyName: "radius", publicName: "radius", isSignal: true, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "compareWith", isSignal: true, isRequired: false, transformFunction: null }, density: { classPropertyName: "density", publicName: "density", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", valueChange: "valueChange", segmentedChange: "segmentedChange" }, host: { attributes: { "role": "radiogroup" }, properties: { "attr.data-size": "size()", "attr.data-radius": "radius()", "attr.data-density": "density()", "attr.data-appearance": "appearance()", "attr.data-orientation": "orientation()", "attr.data-invalid": "invalid() || undefined", "attr.data-readonly": "readonly() || undefined", "attr.aria-required": "required() || undefined", "attr.data-full-width": "fullWidth() || undefined", "attr.data-equal-width": "equalWidth() || undefined", "attr.aria-label": "resolvedAriaLabel() || undefined", "attr.data-show-indicator": "indicator() || undefined", "attr.aria-labelledby": "ariaLabelledby() || undefined", "attr.data-disabled": "isEffectivelyDisabled() || undefined", "attr.aria-disabled": "isEffectivelyDisabled() || undefined", "attr.aria-invalid": "invalid() || (required() && touched() && !hasValue()) ? \"true\" : undefined" }, classAttribute: "solaris-segmented-control" }, providers: [
198
+ {
199
+ provide: NG_VALUE_ACCESSOR,
200
+ useExisting: forwardRef(() => SolarisSegmentedControlComponent),
201
+ multi: true,
202
+ },
203
+ {
204
+ provide: SOLARIS_SEGMENTED_CONTROL,
205
+ useExisting: SolarisSegmentedControlComponent,
206
+ },
207
+ ], queries: [{ propertyName: "items", predicate: SolarisSegmentedItemComponent, isSignal: true }], ngImport: i0, template: "<div class=\"solaris-segmented-control__container\">\n <ng-content select=\"solaris-segmented-item\" />\n\n @if (indicator() && hasValue()) {\n <div\n class=\"solaris-segmented-control__indicator\"\n [class.solaris-segmented-control__indicator--animate]=\"indicatorReady()\"\n [class.solaris-segmented-control__indicator--vertical]=\"\n orientation() === 'vertical'\n \"\n [style.transform]=\"\n orientation() === 'vertical'\n ? indicatorTransformY()\n : indicatorTransformX()\n \"\n [style.width]=\"orientation() === 'vertical' ? '' : indicatorWidth()\"\n [style.height]=\"orientation() === 'vertical' ? indicatorHeight() : ''\"\n ></div>\n }\n</div>\n", styles: [":host{--solaris-segmented-item-height: auto;--solaris-segmented-gap: var(--solaris-spacing-1);--solaris-segmented-radius: var(--solaris-radius-md);--solaris-segmented-padding: var(--solaris-spacing-1);--solaris-segmented-item-color: var(--solaris-text-default);--solaris-segmented-item-padding-y: var(--solaris-spacing-2);--solaris-segmented-item-padding-x: var(--solaris-spacing-3);--solaris-segmented-background: var(--solaris-surface-subtle);--solaris-segmented-indicator-shadow: var(--solaris-shadow-sm);--solaris-segmented-border-color: var(--solaris-border-subtle);--solaris-segmented-border-width: var(--solaris-border-width-sm);--solaris-segmented-focus-ring-color: var(--solaris-primary-base);--solaris-segmented-item-selected-color: var(--solaris-text-strong);--solaris-segmented-indicator-background: var(--solaris-surface-muted);--solaris-segmented-item-hover-background: var(--solaris-surface-muted);width:auto;display:inline-flex}:host([data-full-width]){width:100%;display:flex}.solaris-segmented-control__container{width:100%;display:flex;position:relative;align-items:stretch;box-sizing:border-box;gap:var(--solaris-segmented-gap);padding:var(--solaris-segmented-padding);border-radius:var(--solaris-segmented-radius);background:var(--solaris-segmented-background)}:host([data-orientation=horizontal]) .solaris-segmented-control__container{flex-direction:row}:host([data-orientation=vertical]) .solaris-segmented-control__container{flex-direction:column}:host([data-appearance=outline]) .solaris-segmented-control__container{background:var(--solaris-surface-base);border:var(--solaris-segmented-border-width) solid var(--solaris-segmented-border-color)}:host([data-appearance=surface]) .solaris-segmented-control__container{background:var(--solaris-segmented-background)}:host([data-radius=sm]){--solaris-segmented-radius: var(--solaris-radius-sm)}:host([data-radius=md]){--solaris-segmented-radius: var(--solaris-radius-md)}:host([data-radius=lg]){--solaris-segmented-radius: var(--solaris-radius-lg)}:host([data-radius=full]){--solaris-segmented-radius: var(--solaris-radius-full)}:host([data-size=sm]){--solaris-segmented-gap: var(--solaris-spacing-1);--solaris-segmented-padding: var(--solaris-spacing-1)}:host([data-size=md]){--solaris-segmented-gap: var(--solaris-spacing-2);--solaris-segmented-padding: var(--solaris-spacing-1)}:host([data-size=lg]){--solaris-segmented-gap: var(--solaris-spacing-3);--solaris-segmented-padding: var(--solaris-spacing-1)}:host([data-size=sm][data-density=compact]){--solaris-segmented-gap: var(--solaris-spacing-1);--solaris-segmented-padding: var(--solaris-border-width-sm)}:host([data-size=md][data-density=compact]){--solaris-segmented-gap: var(--solaris-spacing-1);--solaris-segmented-padding: var(--solaris-border-width-sm)}:host([data-size=lg][data-density=compact]){--solaris-segmented-gap: var(--solaris-spacing-2);--solaris-segmented-padding: var(--solaris-border-width-sm)}:host([data-equal-width]) .solaris-segmented-control__container>solaris-segmented-item{flex:1;justify-content:center}:host([data-disabled]){cursor:not-allowed}:host([data-disabled]) .solaris-segmented-control__indicator{opacity:.6;cursor:not-allowed}:host([data-invalid]) .solaris-segmented-control__container{outline-offset:var(--solaris-border-width-sm);outline:var(--solaris-border-width-md) solid var(--solaris-danger-base)}:host([data-invalid][data-appearance=outline]) .solaris-segmented-control__container{border-color:var(--solaris-danger-base)}.solaris-segmented-control__indicator{left:0;z-index:1;height:auto;transition:none;position:absolute;pointer-events:none;box-sizing:border-box;top:var(--solaris-segmented-padding);bottom:var(--solaris-segmented-padding);box-shadow:var(--solaris-segmented-indicator-shadow);background:var(--solaris-segmented-indicator-background);border:var(--solaris-border-width-sm) solid var(--solaris-border-subtle);border-radius:max(var(--solaris-radius-sm),var(--solaris-segmented-radius) - var(--solaris-segmented-padding),var(--solaris-segmented-padding) - var(--solaris-segmented-radius))}.solaris-segmented-control__indicator--vertical{top:0;height:0;width:auto;bottom:auto;left:var(--solaris-segmented-padding);right:var(--solaris-segmented-padding)}.solaris-segmented-control__indicator--animate{transition:transform var(--solaris-motion-duration-normal) var(--solaris-motion-easing-standard),width var(--solaris-motion-duration-normal) var(--solaris-motion-easing-standard),height var(--solaris-motion-duration-normal) var(--solaris-motion-easing-standard)}@media(prefers-reduced-motion:reduce){.solaris-segmented-control__indicator{transition:none}}:host-context([data-reduced-motion=true]) .solaris-segmented-control__indicator{transition:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
208
+ }
209
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisSegmentedControlComponent, decorators: [{
210
+ type: Component,
211
+ args: [{ selector: 'solaris-segmented-control', standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, host: {
212
+ class: 'solaris-segmented-control',
213
+ role: 'radiogroup',
214
+ '[attr.data-size]': 'size()',
215
+ '[attr.data-radius]': 'radius()',
216
+ '[attr.data-density]': 'density()',
217
+ '[attr.data-appearance]': 'appearance()',
218
+ '[attr.data-orientation]': 'orientation()',
219
+ '[attr.data-invalid]': 'invalid() || undefined',
220
+ '[attr.data-readonly]': 'readonly() || undefined',
221
+ '[attr.aria-required]': 'required() || undefined',
222
+ '[attr.data-full-width]': 'fullWidth() || undefined',
223
+ '[attr.data-equal-width]': 'equalWidth() || undefined',
224
+ '[attr.aria-label]': 'resolvedAriaLabel() || undefined',
225
+ '[attr.data-show-indicator]': 'indicator() || undefined',
226
+ '[attr.aria-labelledby]': 'ariaLabelledby() || undefined',
227
+ '[attr.data-disabled]': 'isEffectivelyDisabled() || undefined',
228
+ '[attr.aria-disabled]': 'isEffectivelyDisabled() || undefined',
229
+ '[attr.aria-invalid]': 'invalid() || (required() && touched() && !hasValue()) ? "true" : undefined',
230
+ }, providers: [
231
+ {
232
+ provide: NG_VALUE_ACCESSOR,
233
+ useExisting: forwardRef(() => SolarisSegmentedControlComponent),
234
+ multi: true,
235
+ },
236
+ {
237
+ provide: SOLARIS_SEGMENTED_CONTROL,
238
+ useExisting: SolarisSegmentedControlComponent,
239
+ },
240
+ ], template: "<div class=\"solaris-segmented-control__container\">\n <ng-content select=\"solaris-segmented-item\" />\n\n @if (indicator() && hasValue()) {\n <div\n class=\"solaris-segmented-control__indicator\"\n [class.solaris-segmented-control__indicator--animate]=\"indicatorReady()\"\n [class.solaris-segmented-control__indicator--vertical]=\"\n orientation() === 'vertical'\n \"\n [style.transform]=\"\n orientation() === 'vertical'\n ? indicatorTransformY()\n : indicatorTransformX()\n \"\n [style.width]=\"orientation() === 'vertical' ? '' : indicatorWidth()\"\n [style.height]=\"orientation() === 'vertical' ? indicatorHeight() : ''\"\n ></div>\n }\n</div>\n", styles: [":host{--solaris-segmented-item-height: auto;--solaris-segmented-gap: var(--solaris-spacing-1);--solaris-segmented-radius: var(--solaris-radius-md);--solaris-segmented-padding: var(--solaris-spacing-1);--solaris-segmented-item-color: var(--solaris-text-default);--solaris-segmented-item-padding-y: var(--solaris-spacing-2);--solaris-segmented-item-padding-x: var(--solaris-spacing-3);--solaris-segmented-background: var(--solaris-surface-subtle);--solaris-segmented-indicator-shadow: var(--solaris-shadow-sm);--solaris-segmented-border-color: var(--solaris-border-subtle);--solaris-segmented-border-width: var(--solaris-border-width-sm);--solaris-segmented-focus-ring-color: var(--solaris-primary-base);--solaris-segmented-item-selected-color: var(--solaris-text-strong);--solaris-segmented-indicator-background: var(--solaris-surface-muted);--solaris-segmented-item-hover-background: var(--solaris-surface-muted);width:auto;display:inline-flex}:host([data-full-width]){width:100%;display:flex}.solaris-segmented-control__container{width:100%;display:flex;position:relative;align-items:stretch;box-sizing:border-box;gap:var(--solaris-segmented-gap);padding:var(--solaris-segmented-padding);border-radius:var(--solaris-segmented-radius);background:var(--solaris-segmented-background)}:host([data-orientation=horizontal]) .solaris-segmented-control__container{flex-direction:row}:host([data-orientation=vertical]) .solaris-segmented-control__container{flex-direction:column}:host([data-appearance=outline]) .solaris-segmented-control__container{background:var(--solaris-surface-base);border:var(--solaris-segmented-border-width) solid var(--solaris-segmented-border-color)}:host([data-appearance=surface]) .solaris-segmented-control__container{background:var(--solaris-segmented-background)}:host([data-radius=sm]){--solaris-segmented-radius: var(--solaris-radius-sm)}:host([data-radius=md]){--solaris-segmented-radius: var(--solaris-radius-md)}:host([data-radius=lg]){--solaris-segmented-radius: var(--solaris-radius-lg)}:host([data-radius=full]){--solaris-segmented-radius: var(--solaris-radius-full)}:host([data-size=sm]){--solaris-segmented-gap: var(--solaris-spacing-1);--solaris-segmented-padding: var(--solaris-spacing-1)}:host([data-size=md]){--solaris-segmented-gap: var(--solaris-spacing-2);--solaris-segmented-padding: var(--solaris-spacing-1)}:host([data-size=lg]){--solaris-segmented-gap: var(--solaris-spacing-3);--solaris-segmented-padding: var(--solaris-spacing-1)}:host([data-size=sm][data-density=compact]){--solaris-segmented-gap: var(--solaris-spacing-1);--solaris-segmented-padding: var(--solaris-border-width-sm)}:host([data-size=md][data-density=compact]){--solaris-segmented-gap: var(--solaris-spacing-1);--solaris-segmented-padding: var(--solaris-border-width-sm)}:host([data-size=lg][data-density=compact]){--solaris-segmented-gap: var(--solaris-spacing-2);--solaris-segmented-padding: var(--solaris-border-width-sm)}:host([data-equal-width]) .solaris-segmented-control__container>solaris-segmented-item{flex:1;justify-content:center}:host([data-disabled]){cursor:not-allowed}:host([data-disabled]) .solaris-segmented-control__indicator{opacity:.6;cursor:not-allowed}:host([data-invalid]) .solaris-segmented-control__container{outline-offset:var(--solaris-border-width-sm);outline:var(--solaris-border-width-md) solid var(--solaris-danger-base)}:host([data-invalid][data-appearance=outline]) .solaris-segmented-control__container{border-color:var(--solaris-danger-base)}.solaris-segmented-control__indicator{left:0;z-index:1;height:auto;transition:none;position:absolute;pointer-events:none;box-sizing:border-box;top:var(--solaris-segmented-padding);bottom:var(--solaris-segmented-padding);box-shadow:var(--solaris-segmented-indicator-shadow);background:var(--solaris-segmented-indicator-background);border:var(--solaris-border-width-sm) solid var(--solaris-border-subtle);border-radius:max(var(--solaris-radius-sm),var(--solaris-segmented-radius) - var(--solaris-segmented-padding),var(--solaris-segmented-padding) - var(--solaris-segmented-radius))}.solaris-segmented-control__indicator--vertical{top:0;height:0;width:auto;bottom:auto;left:var(--solaris-segmented-padding);right:var(--solaris-segmented-padding)}.solaris-segmented-control__indicator--animate{transition:transform var(--solaris-motion-duration-normal) var(--solaris-motion-easing-standard),width var(--solaris-motion-duration-normal) var(--solaris-motion-easing-standard),height var(--solaris-motion-duration-normal) var(--solaris-motion-easing-standard)}@media(prefers-reduced-motion:reduce){.solaris-segmented-control__indicator{transition:none}}:host-context([data-reduced-motion=true]) .solaris-segmented-control__indicator{transition:none}\n"] }]
241
+ }], ctorParameters: () => [], propDecorators: { items: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => SolarisSegmentedItemComponent), { isSignal: true }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], indicator: [{ type: i0.Input, args: [{ isSignal: true, alias: "indicator", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], fullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidth", required: false }] }], equalWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "equalWidth", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], defaultValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultValue", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelKey", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledby", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], radius: [{ type: i0.Input, args: [{ isSignal: true, alias: "radius", required: false }] }], compareWith: [{ type: i0.Input, args: [{ isSignal: true, alias: "compareWith", required: false }] }], density: [{ type: i0.Input, args: [{ isSignal: true, alias: "density", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], segmentedChange: [{ type: i0.Output, args: ["segmentedChange"] }] } });
242
+ //# sourceMappingURL=segmented-control.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"segmented-control.component.js","sourceRoot":"","sources":["../../../../../../../../../packages/angular/src/lib/components/navigation/segmented-control/component/segmented-control.component.ts","../../../../../../../../../packages/angular/src/lib/components/navigation/segmented-control/component/segmented-control.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,EACL,MAAM,EACN,KAAK,EACL,eAAe,EACf,QAAQ,EACR,MAAM,EACN,MAAM,EACN,uBAAuB,EACvB,MAAM,EACN,UAAU,EACV,MAAM,EACN,QAAQ,EACR,UAAU,GAGX,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAA6B,MAAM,gBAAgB,CAAC;AAE9E,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAE3E,OAAO,EACL,yBAAyB,GAE1B,MAAM,mCAAmC,CAAC;;AAW3C,IAAI,cAAc,GAAG,CAAC,CAAC;AA0CvB,MAAM,OAAO,gCAAgC;IAO1B,gBAAgB,GAAG,MAAM,CAAC,uBAAuB,EAAE;QAClE,QAAQ,EAAE,IAAI;KACf,CAAC,CAAC;IACc,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;IAChC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC5B,MAAM,GAAG,MAA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kC;yBAC9C;qBACF;uHAgBgC,6BAA6B","sourcesContent":["import {\n Component,\n input,\n output,\n model,\n contentChildren,\n computed,\n signal,\n inject,\n ChangeDetectionStrategy,\n effect,\n ElementRef,\n NgZone,\n Injector,\n forwardRef,\n AfterViewInit,\n OnDestroy,\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR, type ControlValueAccessor } from '@angular/forms';\n\nimport { SolarisSegmentedItemComponent } from '../item/segmented-item.component';\nimport { SolarisTranslateService } from '../../../../services/translation';\n\nimport {\n SOLARIS_SEGMENTED_CONTROL,\n type SolarisSegmentedControlInterface,\n} from '../token/segmented-control.tokens';\n\nimport type {\n SolarisSegmentedControlOrientation,\n SolarisSegmentedControlAppearance,\n SolarisSegmentedControlSize,\n SolarisSegmentedControlDensity,\n SolarisSegmentedControlRadius,\n SolarisSegmentedControlChangeEvent,\n} from '../model/segmented-control.types';\n\nlet nextInstanceId = 0;\n\n@Component({\n selector: 'solaris-segmented-control',\n standalone: true,\n imports: [],\n templateUrl: './segmented-control.component.html',\n styleUrls: ['./segmented-control.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'solaris-segmented-control',\n role: 'radiogroup',\n '[attr.data-size]': 'size()',\n '[attr.data-radius]': 'radius()',\n '[attr.data-density]': 'density()',\n '[attr.data-appearance]': 'appearance()',\n '[attr.data-orientation]': 'orientation()',\n '[attr.data-invalid]': 'invalid() || undefined',\n '[attr.data-readonly]': 'readonly() || undefined',\n '[attr.aria-required]': 'required() || undefined',\n '[attr.data-full-width]': 'fullWidth() || undefined',\n '[attr.data-equal-width]': 'equalWidth() || undefined',\n '[attr.aria-label]': 'resolvedAriaLabel() || undefined',\n '[attr.data-show-indicator]': 'indicator() || undefined',\n '[attr.aria-labelledby]': 'ariaLabelledby() || undefined',\n '[attr.data-disabled]': 'isEffectivelyDisabled() || undefined',\n '[attr.aria-disabled]': 'isEffectivelyDisabled() || undefined',\n '[attr.aria-invalid]':\n 'invalid() || (required() && touched() && !hasValue()) ? \"true\" : undefined',\n },\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SolarisSegmentedControlComponent),\n multi: true,\n },\n {\n provide: SOLARIS_SEGMENTED_CONTROL,\n useExisting: SolarisSegmentedControlComponent,\n },\n ],\n})\nexport class SolarisSegmentedControlComponent\n implements\n SolarisSegmentedControlInterface,\n ControlValueAccessor,\n AfterViewInit,\n OnDestroy\n{\n private readonly translateService = inject(SolarisTranslateService, {\n optional: true,\n });\n private readonly elementRef = inject(ElementRef);\n private readonly injector = inject(Injector);\n private readonly ngZone = inject(NgZone);\n\n readonly items = contentChildren(SolarisSegmentedItemComponent);\n\n readonly invalid = input<boolean>(false);\n readonly indicator = input<boolean>(true);\n readonly disabled = input<boolean>(false);\n readonly readonly = input<boolean>(false);\n readonly required = input<boolean>(false);\n readonly fullWidth = input<boolean>(false);\n readonly equalWidth = input<boolean>(false);\n readonly value = model<unknown>(undefined);\n readonly defaultValue = input<unknown>(undefined);\n readonly compareFn = computed(() => this.compareWith());\n readonly ariaLabel = input<string | undefined>(undefined);\n readonly ariaLabelKey = input<string | undefined>(undefined);\n readonly ariaLabelledby = input<string | undefined>(undefined);\n readonly size = input<SolarisSegmentedControlSize>('md');\n readonly radius = input<SolarisSegmentedControlRadius>('md');\n readonly compareWith = input<(a: unknown, b: unknown) => boolean>(Object.is);\n readonly density = input<SolarisSegmentedControlDensity>('comfortable');\n readonly appearance = input<SolarisSegmentedControlAppearance>('surface');\n readonly orientation =\n input<SolarisSegmentedControlOrientation>('horizontal');\n\n readonly valueChange = output<unknown>();\n readonly segmentedChange = output<SolarisSegmentedControlChangeEvent>();\n\n protected readonly instanceId = `solaris-segmented-control-${nextInstanceId++}`;\n protected readonly touched = signal(false);\n protected readonly indicatorWidth = signal('0');\n protected readonly indicatorHeight = signal('0');\n protected readonly indicatorReady = signal(false);\n protected readonly internalDisabled = signal(false);\n protected readonly indicatorTransformX = signal('translateX(0)');\n protected readonly indicatorTransformY = signal('translateY(0)');\n\n private onChange: (value: unknown) => void = () => undefined;\n private onTouched: () => void = () => undefined;\n private resizeObserver: ResizeObserver | null = null;\n private contentObserver: MutationObserver | null = null;\n\n protected readonly isEffectivelyDisabled = computed(() => {\n return this.disabled() || this.internalDisabled();\n });\n\n protected readonly hasValue = computed(() => {\n return this.value() !== undefined && this.value() !== null;\n });\n\n protected readonly resolvedAriaLabel = computed(() => {\n if (this.ariaLabel()) return this.ariaLabel();\n const ariaLabelKey = this.ariaLabelKey();\n if (ariaLabelKey && this.translateService) {\n return this.translateService.translate(ariaLabelKey);\n }\n return ariaLabelKey ?? undefined;\n });\n\n constructor() {\n effect(() => {\n const defaultValue = this.defaultValue();\n const currentValue = this.value();\n if (currentValue === undefined && defaultValue !== undefined) {\n this.value.set(defaultValue);\n }\n });\n }\n\n ngAfterViewInit(): void {\n this.setupIndicatorMeasurement();\n\n effect(\n () => {\n this.value();\n this.appearance();\n this.orientation();\n this.size();\n this.density();\n this.radius();\n this.ngZone.runOutsideAngular(() => {\n requestAnimationFrame(() => this.measureIndicator());\n });\n },\n { injector: this.injector },\n );\n }\n\n ngOnDestroy(): void {\n this.disconnectObserver();\n }\n\n selectItem(item: SolarisSegmentedItemComponent): void {\n if (this.isEffectivelyDisabled()) return;\n if (this.readonly()) return;\n const previousValue = this.value();\n const newValue = item.value();\n if (this.compareFn()(newValue, previousValue)) return;\n this.value.set(newValue);\n this.valueChange.emit(newValue);\n this.segmentedChange.emit({ value: newValue, previousValue });\n this.onChange(newValue);\n this.markAsTouched();\n }\n\n focusItem(item: SolarisSegmentedItemComponent): void {\n // SECURITY_EXCEPTION: nativeElement.querySelector required to find item DOM element for programmatic focus. Standard DOM method, SSR-safe with guard.\n const nativeElement = this.elementRef.nativeElement as HTMLElement;\n const itemElements = nativeElement.querySelectorAll(\n 'solaris-segmented-item',\n ) as NodeListOf<HTMLElement>;\n const items = this.items();\n const index = items.indexOf(item);\n if (index >= 0 && itemElements[index]) {\n itemElements[index].focus();\n }\n }\n\n // ControlValueAccessor\n writeValue(safe: unknown): void {\n this.value.set(safe);\n this.ngZone.runOutsideAngular(() => {\n requestAnimationFrame(() => this.measureIndicator());\n });\n }\n\n registerOnChange(fn: (value: unknown) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.internalDisabled.set(isDisabled);\n }\n\n private markAsTouched(): void {\n if (!this.touched()) {\n this.touched.set(true);\n this.onTouched();\n }\n }\n\n private measureIndicator(): void {\n if (!this.indicator()) return;\n\n // SECURITY_EXCEPTION: nativeElement.querySelector required to measure indicator position for animation. Read-only measurement, SSR-safe.\n const nativeEl = this.elementRef.nativeElement as HTMLElement;\n const container = nativeEl.querySelector(\n '.solaris-segmented-control__container',\n ) as HTMLElement | null;\n if (!container) return;\n\n const selectedItem = container.querySelector(\n 'solaris-segmented-item[data-selected=\"true\"]',\n ) as HTMLElement | null;\n if (!selectedItem) return;\n\n const isVertical = this.orientation() === 'vertical';\n\n if (isVertical) {\n this.indicatorTransformY.set(`translateY(${selectedItem.offsetTop}px)`);\n this.indicatorHeight.set(`${selectedItem.offsetHeight}px`);\n } else {\n this.indicatorTransformX.set(`translateX(${selectedItem.offsetLeft}px)`);\n this.indicatorWidth.set(`${selectedItem.offsetWidth}px`);\n }\n\n if (!this.indicatorReady()) {\n requestAnimationFrame(() => this.indicatorReady.set(true));\n }\n }\n\n private setupIndicatorMeasurement(): void {\n if (typeof ResizeObserver !== 'undefined') {\n this.resizeObserver = new ResizeObserver(() => {\n this.ngZone.runOutsideAngular(() => {\n requestAnimationFrame(() => this.measureIndicator());\n });\n });\n // SECURITY_EXCEPTION: nativeElement required for ResizeObserver target. Standard DOM API, SSR-safe with typeof guard.\n const nativeEl = this.elementRef.nativeElement as HTMLElement;\n this.resizeObserver.observe(nativeEl);\n }\n\n if (typeof MutationObserver !== 'undefined') {\n // SECURITY_EXCEPTION: nativeElement required for MutationObserver target. Standard DOM API, SSR-safe with typeof guard.\n const nativeEl = this.elementRef.nativeElement as HTMLElement;\n this.contentObserver = new MutationObserver(() => {\n this.ngZone.runOutsideAngular(() => {\n requestAnimationFrame(() => this.measureIndicator());\n });\n });\n this.contentObserver.observe(nativeEl, {\n childList: true,\n subtree: true,\n characterData: true,\n });\n }\n\n this.ngZone.runOutsideAngular(() => {\n requestAnimationFrame(() => this.measureIndicator());\n });\n }\n\n private disconnectObserver(): void {\n this.resizeObserver?.disconnect();\n this.resizeObserver = null;\n this.contentObserver?.disconnect();\n this.contentObserver = null;\n }\n}\n","<div class=\"solaris-segmented-control__container\">\n <ng-content select=\"solaris-segmented-item\" />\n\n @if (indicator() && hasValue()) {\n <div\n class=\"solaris-segmented-control__indicator\"\n [class.solaris-segmented-control__indicator--animate]=\"indicatorReady()\"\n [class.solaris-segmented-control__indicator--vertical]=\"\n orientation() === 'vertical'\n \"\n [style.transform]=\"\n orientation() === 'vertical'\n ? indicatorTransformY()\n : indicatorTransformX()\n \"\n [style.width]=\"orientation() === 'vertical' ? '' : indicatorWidth()\"\n [style.height]=\"orientation() === 'vertical' ? indicatorHeight() : ''\"\n ></div>\n }\n</div>\n"]}
@@ -0,0 +1,197 @@
1
+ import { input, inject, signal, computed, Component, ElementRef, ChangeDetectionStrategy, } from '@angular/core';
2
+ import { SolarisTranslateService } from '../../../../services/translation';
3
+ import { SolarisIconComponent } from '../../../icon';
4
+ import { SOLARIS_SEGMENTED_CONTROL } from '../token/segmented-control.tokens';
5
+ import * as i0 from "@angular/core";
6
+ let nextId = 0;
7
+ export class SolarisSegmentedItemComponent {
8
+ translateService = inject(SolarisTranslateService, {
9
+ optional: true,
10
+ });
11
+ control = inject(SOLARIS_SEGMENTED_CONTROL, {
12
+ optional: true,
13
+ });
14
+ elementRef = inject(ElementRef);
15
+ hasContent = signal(false, ...(ngDevMode ? [{ debugName: "hasContent" }] : /* istanbul ignore next */ []));
16
+ value = input.required(...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
17
+ label = input(undefined, ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
18
+ labelKey = input(undefined, ...(ngDevMode ? [{ debugName: "labelKey" }] : /* istanbul ignore next */ []));
19
+ icon = input(undefined, ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
20
+ disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
21
+ ariaLabel = input(undefined, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
22
+ ariaLabelKey = input(undefined, ...(ngDevMode ? [{ debugName: "ariaLabelKey" }] : /* istanbul ignore next */ []));
23
+ instanceId = `solaris-segmented-item-${nextId++}`;
24
+ itemId = computed(() => {
25
+ const ctrl = this.control;
26
+ if (ctrl) {
27
+ return `solaris-segmented-item-${String(this.value())}`;
28
+ }
29
+ return this.instanceId;
30
+ }, ...(ngDevMode ? [{ debugName: "itemId" }] : /* istanbul ignore next */ []));
31
+ isSelected = computed(() => {
32
+ if (!this.control)
33
+ return false;
34
+ return this.control.compareFn()(this.value(), this.control.value());
35
+ }, ...(ngDevMode ? [{ debugName: "isSelected" }] : /* istanbul ignore next */ []));
36
+ isComputedDisabled = computed(() => {
37
+ return this.disabled() || (this.control?.disabled() ?? false);
38
+ }, ...(ngDevMode ? [{ debugName: "isComputedDisabled" }] : /* istanbul ignore next */ []));
39
+ isComputedReadonly = computed(() => {
40
+ return this.control?.readonly() ?? false;
41
+ }, ...(ngDevMode ? [{ debugName: "isComputedReadonly" }] : /* istanbul ignore next */ []));
42
+ isTabstop = computed(() => {
43
+ if (this.isComputedDisabled())
44
+ return false;
45
+ if (this.isSelected())
46
+ return true;
47
+ if (!this.control)
48
+ return false;
49
+ const items = this.control.items();
50
+ const firstEnabled = items.findIndex((item) => !item.isComputedDisabled());
51
+ return items.indexOf(this) === firstEnabled;
52
+ }, ...(ngDevMode ? [{ debugName: "isTabstop" }] : /* istanbul ignore next */ []));
53
+ isIconOnly = computed(() => {
54
+ return (!!this.icon() && !this.label() && !this.labelKey() && !this.hasContent());
55
+ }, ...(ngDevMode ? [{ debugName: "isIconOnly" }] : /* istanbul ignore next */ []));
56
+ ngAfterContentInit() {
57
+ this.updateHasContent();
58
+ }
59
+ updateHasContent() {
60
+ // SECURITY_EXCEPTION: nativeElement required to check projected content. SSR-safe read-only operation.
61
+ const nativeEl = this.elementRef.nativeElement;
62
+ const innerEl = nativeEl.querySelector('.solaris-segmented-item__inner');
63
+ if (!innerEl)
64
+ return;
65
+ for (const node of Array.from(innerEl.childNodes)) {
66
+ if (node.nodeType === Node.TEXT_NODE && node.textContent?.trim()) {
67
+ this.hasContent.set(true);
68
+ return;
69
+ }
70
+ if (node.nodeType === Node.ELEMENT_NODE) {
71
+ const el = node;
72
+ if (!el.classList.contains('solaris-segmented-item__icon')) {
73
+ this.hasContent.set(true);
74
+ return;
75
+ }
76
+ }
77
+ }
78
+ }
79
+ resolvedLabel = computed(() => {
80
+ if (this.label())
81
+ return this.label();
82
+ const labelKey = this.labelKey();
83
+ if (labelKey && this.translateService) {
84
+ return this.translateService.translate(labelKey);
85
+ }
86
+ return labelKey ?? undefined;
87
+ }, ...(ngDevMode ? [{ debugName: "resolvedLabel" }] : /* istanbul ignore next */ []));
88
+ resolvedAriaLabel = computed(() => {
89
+ if (this.ariaLabel())
90
+ return this.ariaLabel();
91
+ const ariaLabelKey = this.ariaLabelKey();
92
+ if (ariaLabelKey && this.translateService) {
93
+ return this.translateService.translate(ariaLabelKey);
94
+ }
95
+ return undefined;
96
+ }, ...(ngDevMode ? [{ debugName: "resolvedAriaLabel" }] : /* istanbul ignore next */ []));
97
+ index = computed(() => {
98
+ if (!this.control)
99
+ return -1;
100
+ return this.control.items().indexOf(this);
101
+ }, ...(ngDevMode ? [{ debugName: "index" }] : /* istanbul ignore next */ []));
102
+ onClick() {
103
+ if (this.isComputedDisabled())
104
+ return;
105
+ if (this.isComputedReadonly())
106
+ return;
107
+ this.control?.selectItem(this);
108
+ }
109
+ onKeydown(event) {
110
+ if (this.isComputedDisabled())
111
+ return;
112
+ const items = this.control?.items() ?? [];
113
+ const currentIndex = this.index();
114
+ if (event.key === 'Enter' || event.key === ' ') {
115
+ event.preventDefault();
116
+ if (!this.isComputedReadonly()) {
117
+ this.control?.selectItem(this);
118
+ }
119
+ return;
120
+ }
121
+ const nextIndex = this.getNextIndex(event.key, items, currentIndex);
122
+ if (nextIndex === null || nextIndex === currentIndex)
123
+ return;
124
+ event.preventDefault();
125
+ const nextItem = items[nextIndex];
126
+ this.control?.focusItem(nextItem);
127
+ }
128
+ getNextIndex(key, items, currentIndex) {
129
+ const orientation = this.control?.orientation() ?? 'horizontal';
130
+ switch (key) {
131
+ case 'ArrowRight':
132
+ return orientation === 'horizontal'
133
+ ? this.findNextEnabled(items, currentIndex, 1)
134
+ : null;
135
+ case 'ArrowLeft':
136
+ return orientation === 'horizontal'
137
+ ? this.findNextEnabled(items, currentIndex, -1)
138
+ : null;
139
+ case 'ArrowDown':
140
+ return orientation === 'vertical'
141
+ ? this.findNextEnabled(items, currentIndex, 1)
142
+ : null;
143
+ case 'ArrowUp':
144
+ return orientation === 'vertical'
145
+ ? this.findNextEnabled(items, currentIndex, -1)
146
+ : null;
147
+ case 'Home':
148
+ return this.findFirstEnabled(items);
149
+ case 'End':
150
+ return this.findLastEnabled(items);
151
+ default:
152
+ return null;
153
+ }
154
+ }
155
+ findNextEnabled(items, fromIndex, direction) {
156
+ let i = fromIndex + direction;
157
+ while (i >= 0 && i < items.length) {
158
+ if (!items[i].isComputedDisabled())
159
+ return i;
160
+ i += direction;
161
+ }
162
+ return null;
163
+ }
164
+ findFirstEnabled(items) {
165
+ for (let i = 0; i < items.length; i++) {
166
+ if (!items[i].isComputedDisabled())
167
+ return i;
168
+ }
169
+ return null;
170
+ }
171
+ findLastEnabled(items) {
172
+ for (let i = items.length - 1; i >= 0; i--) {
173
+ if (!items[i].isComputedDisabled())
174
+ return i;
175
+ }
176
+ return null;
177
+ }
178
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisSegmentedItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
179
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SolarisSegmentedItemComponent, isStandalone: true, selector: "solaris-segmented-item", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, labelKey: { classPropertyName: "labelKey", publicName: "labelKey", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelKey: { classPropertyName: "ariaLabelKey", publicName: "ariaLabelKey", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "radio" }, listeners: { "click": "onClick()", "keydown": "onKeydown($event)" }, properties: { "attr.id": "itemId()", "attr.data-selected": "isSelected()", "attr.data-disabled": "isComputedDisabled()", "attr.aria-checked": "isSelected()", "attr.aria-disabled": "isComputedDisabled() || undefined", "attr.aria-label": "resolvedAriaLabel() || undefined", "attr.tabindex": "isTabstop() ? \"0\" : \"-1\"", "class.solaris-segmented-item--icon-only": "isIconOnly()" } }, ngImport: i0, template: "<span class=\"solaris-segmented-item__inner\">\n @if (icon(); as iconName) {\n <solaris-icon\n class=\"solaris-segmented-item__icon\"\n [name]=\"iconName\"\n [decorative]=\"true\"\n />\n }\n @if (resolvedLabel(); as labelText) {\n <span class=\"solaris-segmented-item__label\">{{ labelText }}</span>\n }\n <ng-content />\n</span>\n", styles: [":host{--solaris-segmented-item-gap: var(--solaris-spacing-2);--solaris-segmented-item-radius: var(--solaris-radius-sm);--solaris-segmented-item-color: var(--solaris-text-default);--solaris-segmented-item-padding-y: var(--solaris-spacing-2);--solaris-segmented-item-padding-x: var(--solaris-spacing-2);--solaris-segmented-item-icon-size: var(--solaris-font-size-sm);--solaris-segmented-item-font-size: var(--solaris-font-size-sm);--solaris-segmented-item-selected-color: var(--solaris-text-strong);--solaris-segmented-item-font-weight: var(--solaris-font-weight-medium);--solaris-segmented-item-hover-background: var(--solaris-surface-subtle);z-index:2;border:none;cursor:pointer;-webkit-user-select:none;user-select:none;position:relative;align-items:center;white-space:nowrap;display:inline-flex;text-decoration:none;background:transparent;gap:var(--solaris-segmented-item-gap);color:var(--solaris-segmented-item-color);padding:var(--solaris-segmented-item-padding-y) var(--solaris-segmented-item-padding-x);font:var(--solaris-segmented-item-font-weight) var(--solaris-segmented-item-font-size)/1 var(--solaris-font-family-sans);border-radius:max(var(--solaris-segmented-radius) - var(--solaris-segmented-padding),var(--solaris-segmented-padding) - var(--solaris-segmented-radius));transition:color var(--solaris-motion-duration-normal) var(--solaris-motion-easing-standard),background var(--solaris-motion-duration-normal) var(--solaris-motion-easing-standard)}:host(:hover:not([data-disabled=true]):not([data-selected=true])){background:var(--solaris-segmented-item-hover-background)}:host(.solaris-segmented-item--icon-only){--solaris-segmented-item-icon-size: calc(var(--solaris-font-size-md) * 1.2)}:host:not([data-selected=true]):not([data-disabled=true]){opacity:.5}:host(:focus-visible){outline-offset:var(--solaris-border-width-md);border-radius:var(--solaris-segmented-item-radius);outline:var(--solaris-border-width-md) solid var(--solaris-primary-base)}:host([data-selected=true]){color:var(--solaris-segmented-item-selected-color)}:host([data-disabled=true]){opacity:.15;cursor:not-allowed}:host([data-disabled=true]:focus-visible){outline:none}:host([data-selected=true][data-disabled=true]){opacity:.4}:host-context([data-orientation=vertical]){width:100%;display:flex;max-width:100%;box-sizing:border-box}.solaris-segmented-item__inner{min-width:0;align-items:center;display:inline-flex;gap:var(--solaris-segmented-item-gap)}.solaris-segmented-item__icon{flex-shrink:0;width:var(--solaris-segmented-item-icon-size);height:var(--solaris-segmented-item-icon-size)}.solaris-segmented-item__label{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;line-height:var(--solaris-line-height-md)}:host-context([data-size=sm]){--solaris-segmented-item-padding-y: var(--solaris-spacing-1);--solaris-segmented-item-padding-x: var(--solaris-spacing-1);--solaris-segmented-item-icon-size: var(--solaris-font-size-xs);--solaris-segmented-item-font-size: var(--solaris-font-size-xs)}:host-context([data-size=lg]){--solaris-segmented-item-padding-y: var(--solaris-spacing-3);--solaris-segmented-item-padding-x: var(--solaris-spacing-3);--solaris-segmented-item-icon-size: var(--solaris-font-size-md);--solaris-segmented-item-font-size: var(--solaris-font-size-md)}:host-context([data-size=sm][data-density=compact]){--solaris-segmented-item-gap: var(--solaris-spacing-1);--solaris-segmented-item-padding-y: var(--solaris-spacing-1);--solaris-segmented-item-padding-x: var(--solaris-spacing-1);--solaris-segmented-item-icon-size: var(--solaris-font-size-xs);--solaris-segmented-item-font-size: var(--solaris-font-size-xs)}:host-context([data-size=md][data-density=compact]){--solaris-segmented-item-gap: var(--solaris-spacing-1);--solaris-segmented-item-padding-y: var(--solaris-spacing-1);--solaris-segmented-item-padding-x: var(--solaris-spacing-1);--solaris-segmented-item-icon-size: var(--solaris-font-size-sm);--solaris-segmented-item-font-size: var(--solaris-font-size-sm)}:host-context([data-size=lg][data-density=compact]){--solaris-segmented-item-gap: var(--solaris-spacing-1);--solaris-segmented-item-padding-y: var(--solaris-spacing-2);--solaris-segmented-item-padding-x: var(--solaris-spacing-2);--solaris-segmented-item-icon-size: var(--solaris-font-size-md);--solaris-segmented-item-font-size: var(--solaris-font-size-md)}:host-context([data-appearance=surface][data-selected=true]){--solaris-segmented-item-color: var(--solaris-text-strong)}:host-context([data-appearance=outline]){--solaris-segmented-item-color: var(--solaris-text-default)}:host-context([data-full-width=true]){flex:1;justify-content:center}:host-context([data-equal-width=true]){flex:1;justify-content:center}@media(prefers-reduced-motion:reduce){:host{transition:none}}:host-context([data-reduced-motion=true]){transition:none}\n"], dependencies: [{ kind: "component", type: SolarisIconComponent, selector: "solaris-icon", inputs: ["name", "ariaLabel", "decorative"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
180
+ }
181
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisSegmentedItemComponent, decorators: [{
182
+ type: Component,
183
+ args: [{ selector: 'solaris-segmented-item', standalone: true, imports: [SolarisIconComponent], changeDetection: ChangeDetectionStrategy.OnPush, host: {
184
+ role: 'radio',
185
+ '[attr.id]': 'itemId()',
186
+ '(click)': 'onClick()',
187
+ '(keydown)': 'onKeydown($event)',
188
+ '[attr.data-selected]': 'isSelected()',
189
+ '[attr.data-disabled]': 'isComputedDisabled()',
190
+ '[attr.aria-checked]': 'isSelected()',
191
+ '[attr.aria-disabled]': 'isComputedDisabled() || undefined',
192
+ '[attr.aria-label]': 'resolvedAriaLabel() || undefined',
193
+ '[attr.tabindex]': 'isTabstop() ? "0" : "-1"',
194
+ '[class.solaris-segmented-item--icon-only]': 'isIconOnly()',
195
+ }, template: "<span class=\"solaris-segmented-item__inner\">\n @if (icon(); as iconName) {\n <solaris-icon\n class=\"solaris-segmented-item__icon\"\n [name]=\"iconName\"\n [decorative]=\"true\"\n />\n }\n @if (resolvedLabel(); as labelText) {\n <span class=\"solaris-segmented-item__label\">{{ labelText }}</span>\n }\n <ng-content />\n</span>\n", styles: [":host{--solaris-segmented-item-gap: var(--solaris-spacing-2);--solaris-segmented-item-radius: var(--solaris-radius-sm);--solaris-segmented-item-color: var(--solaris-text-default);--solaris-segmented-item-padding-y: var(--solaris-spacing-2);--solaris-segmented-item-padding-x: var(--solaris-spacing-2);--solaris-segmented-item-icon-size: var(--solaris-font-size-sm);--solaris-segmented-item-font-size: var(--solaris-font-size-sm);--solaris-segmented-item-selected-color: var(--solaris-text-strong);--solaris-segmented-item-font-weight: var(--solaris-font-weight-medium);--solaris-segmented-item-hover-background: var(--solaris-surface-subtle);z-index:2;border:none;cursor:pointer;-webkit-user-select:none;user-select:none;position:relative;align-items:center;white-space:nowrap;display:inline-flex;text-decoration:none;background:transparent;gap:var(--solaris-segmented-item-gap);color:var(--solaris-segmented-item-color);padding:var(--solaris-segmented-item-padding-y) var(--solaris-segmented-item-padding-x);font:var(--solaris-segmented-item-font-weight) var(--solaris-segmented-item-font-size)/1 var(--solaris-font-family-sans);border-radius:max(var(--solaris-segmented-radius) - var(--solaris-segmented-padding),var(--solaris-segmented-padding) - var(--solaris-segmented-radius));transition:color var(--solaris-motion-duration-normal) var(--solaris-motion-easing-standard),background var(--solaris-motion-duration-normal) var(--solaris-motion-easing-standard)}:host(:hover:not([data-disabled=true]):not([data-selected=true])){background:var(--solaris-segmented-item-hover-background)}:host(.solaris-segmented-item--icon-only){--solaris-segmented-item-icon-size: calc(var(--solaris-font-size-md) * 1.2)}:host:not([data-selected=true]):not([data-disabled=true]){opacity:.5}:host(:focus-visible){outline-offset:var(--solaris-border-width-md);border-radius:var(--solaris-segmented-item-radius);outline:var(--solaris-border-width-md) solid var(--solaris-primary-base)}:host([data-selected=true]){color:var(--solaris-segmented-item-selected-color)}:host([data-disabled=true]){opacity:.15;cursor:not-allowed}:host([data-disabled=true]:focus-visible){outline:none}:host([data-selected=true][data-disabled=true]){opacity:.4}:host-context([data-orientation=vertical]){width:100%;display:flex;max-width:100%;box-sizing:border-box}.solaris-segmented-item__inner{min-width:0;align-items:center;display:inline-flex;gap:var(--solaris-segmented-item-gap)}.solaris-segmented-item__icon{flex-shrink:0;width:var(--solaris-segmented-item-icon-size);height:var(--solaris-segmented-item-icon-size)}.solaris-segmented-item__label{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;line-height:var(--solaris-line-height-md)}:host-context([data-size=sm]){--solaris-segmented-item-padding-y: var(--solaris-spacing-1);--solaris-segmented-item-padding-x: var(--solaris-spacing-1);--solaris-segmented-item-icon-size: var(--solaris-font-size-xs);--solaris-segmented-item-font-size: var(--solaris-font-size-xs)}:host-context([data-size=lg]){--solaris-segmented-item-padding-y: var(--solaris-spacing-3);--solaris-segmented-item-padding-x: var(--solaris-spacing-3);--solaris-segmented-item-icon-size: var(--solaris-font-size-md);--solaris-segmented-item-font-size: var(--solaris-font-size-md)}:host-context([data-size=sm][data-density=compact]){--solaris-segmented-item-gap: var(--solaris-spacing-1);--solaris-segmented-item-padding-y: var(--solaris-spacing-1);--solaris-segmented-item-padding-x: var(--solaris-spacing-1);--solaris-segmented-item-icon-size: var(--solaris-font-size-xs);--solaris-segmented-item-font-size: var(--solaris-font-size-xs)}:host-context([data-size=md][data-density=compact]){--solaris-segmented-item-gap: var(--solaris-spacing-1);--solaris-segmented-item-padding-y: var(--solaris-spacing-1);--solaris-segmented-item-padding-x: var(--solaris-spacing-1);--solaris-segmented-item-icon-size: var(--solaris-font-size-sm);--solaris-segmented-item-font-size: var(--solaris-font-size-sm)}:host-context([data-size=lg][data-density=compact]){--solaris-segmented-item-gap: var(--solaris-spacing-1);--solaris-segmented-item-padding-y: var(--solaris-spacing-2);--solaris-segmented-item-padding-x: var(--solaris-spacing-2);--solaris-segmented-item-icon-size: var(--solaris-font-size-md);--solaris-segmented-item-font-size: var(--solaris-font-size-md)}:host-context([data-appearance=surface][data-selected=true]){--solaris-segmented-item-color: var(--solaris-text-strong)}:host-context([data-appearance=outline]){--solaris-segmented-item-color: var(--solaris-text-default)}:host-context([data-full-width=true]){flex:1;justify-content:center}:host-context([data-equal-width=true]){flex:1;justify-content:center}@media(prefers-reduced-motion:reduce){:host{transition:none}}:host-context([data-reduced-motion=true]){transition:none}\n"] }]
196
+ }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], labelKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelKey", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelKey", required: false }] }] } });
197
+ //# sourceMappingURL=segmented-item.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"segmented-item.component.js","sourceRoot":"","sources":["../../../../../../../../../packages/angular/src/lib/components/navigation/segmented-control/item/segmented-item.component.ts","../../../../../../../../../packages/angular/src/lib/components/navigation/segmented-control/item/segmented-item.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,MAAM,EACN,MAAM,EACN,QAAQ,EACR,SAAS,EACT,UAAU,EAEV,uBAAuB,GACxB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;;AAE9E,IAAI,MAAM,GAAG,CAAC,CAAC;AAuBf,MAAM,OAAO,6BAA6B;IACvB,gBAAgB,GAAG,MAAM,CAAC,uBAAuB,EAAE;QAClE,QAAQ,EAAE,IAAI;KACf,CAAC,CAAC;IACc,OAAO,GAAG,MAAM,CAAC,yBAAyB,EAAE;QAC3D,QAAQ,EAAE,IAAI;KACf,CAAC,CAAC;IACc,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;IAE9B,UAAU,GAAG,MAAM,CAAC,KAAK,iFAAC,CAAC;IAErC,KAAK,GAAG,KAAK,CAAC,QAAQ,2EAAW,CAAC;IAClC,KAAK,GAAG,KAAK,CAAqB,SAAS,4EAAC,CAAC;IAC7C,QAAQ,GAAG,KAAK,CAAqB,SAAS,+EAAC,CAAC;IAChD,IAAI,GAAG,KAAK,CAAqB,SAAS,2EAAC,CAAC;IAC5C,QAAQ,GAAG,KAAK,CAAU,KAAK,+E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AAkB,EAAE;gBAAE,OAAO,CAAC,CAAC;QAC/C,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAEO,eAAe,CACrB,KAAmD;QAEnD,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YAC3C,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,kBAAkB,EAAE;gBAAE,OAAO,CAAC,CAAC;QAC/C,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;wGA1MU,6BAA6B;4FAA7B,6BAA6B,m8CCtC1C,0WAaA,8wJDOY,oBAAoB;;4FAkBnB,6BAA6B;kBArBzC,SAAS;+BACE,wBAAwB,cACtB,IAAI,WACP,CAAC,oBAAoB,CAAC,mBAGd,uBAAuB,CAAC,MAAM,QACzC;wBACJ,IAAI,EAAE,OAAO;wBACb,WAAW,EAAE,UAAU;wBACvB,SAAS,EAAE,WAAW;wBACtB,WAAW,EAAE,mBAAmB;wBAChC,sBAAsB,EAAE,cAAc;wBACtC,sBAAsB,EAAE,sBAAsB;wBAC9C,qBAAqB,EAAE,cAAc;wBACrC,sBAAsB,EAAE,mCAAmC;wBAC3D,mBAAmB,EAAE,kCAAkC;wBACvD,iBAAiB,EAAE,0BAA0B;wBAC7C,2CAA2C,EAAE,cAAc;qBAC5D","sourcesContent":["import {\n input,\n inject,\n signal,\n computed,\n Component,\n ElementRef,\n AfterContentInit,\n ChangeDetectionStrategy,\n} from '@angular/core';\n\nimport { SolarisTranslateService } from '../../../../services/translation';\nimport { SolarisIconComponent } from '../../../icon';\nimport { SOLARIS_SEGMENTED_CONTROL } from '../token/segmented-control.tokens';\n\nlet nextId = 0;\n\n@Component({\n selector: 'solaris-segmented-item',\n standalone: true,\n imports: [SolarisIconComponent],\n templateUrl: './segmented-item.component.html',\n styleUrls: ['./segmented-item.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n role: 'radio',\n '[attr.id]': 'itemId()',\n '(click)': 'onClick()',\n '(keydown)': 'onKeydown($event)',\n '[attr.data-selected]': 'isSelected()',\n '[attr.data-disabled]': 'isComputedDisabled()',\n '[attr.aria-checked]': 'isSelected()',\n '[attr.aria-disabled]': 'isComputedDisabled() || undefined',\n '[attr.aria-label]': 'resolvedAriaLabel() || undefined',\n '[attr.tabindex]': 'isTabstop() ? \"0\" : \"-1\"',\n '[class.solaris-segmented-item--icon-only]': 'isIconOnly()',\n },\n})\nexport class SolarisSegmentedItemComponent implements AfterContentInit {\n private readonly translateService = inject(SolarisTranslateService, {\n optional: true,\n });\n private readonly control = inject(SOLARIS_SEGMENTED_CONTROL, {\n optional: true,\n });\n private readonly elementRef = inject(ElementRef);\n\n protected readonly hasContent = signal(false);\n\n readonly value = input.required<unknown>();\n readonly label = input<string | undefined>(undefined);\n readonly labelKey = input<string | undefined>(undefined);\n readonly icon = input<string | undefined>(undefined);\n readonly disabled = input<boolean>(false);\n readonly ariaLabel = input<string | undefined>(undefined);\n readonly ariaLabelKey = input<string | undefined>(undefined);\n\n protected readonly instanceId = `solaris-segmented-item-${nextId++}`;\n\n protected readonly itemId = computed(() => {\n const ctrl = this.control;\n if (ctrl) {\n return `solaris-segmented-item-${String(this.value())}`;\n }\n return this.instanceId;\n });\n\n readonly isSelected = computed(() => {\n if (!this.control) return false;\n return this.control.compareFn()(this.value(), this.control.value());\n });\n\n readonly isComputedDisabled = computed(() => {\n return this.disabled() || (this.control?.disabled() ?? false);\n });\n\n readonly isComputedReadonly = computed(() => {\n return this.control?.readonly() ?? false;\n });\n\n readonly isTabstop = computed(() => {\n if (this.isComputedDisabled()) return false;\n if (this.isSelected()) return true;\n if (!this.control) return false;\n const items = this.control.items();\n const firstEnabled = items.findIndex((item) => !item.isComputedDisabled());\n return items.indexOf(this) === firstEnabled;\n });\n\n protected readonly isIconOnly = computed(() => {\n return (\n !!this.icon() && !this.label() && !this.labelKey() && !this.hasContent()\n );\n });\n\n ngAfterContentInit(): void {\n this.updateHasContent();\n }\n\n private updateHasContent(): void {\n // SECURITY_EXCEPTION: nativeElement required to check projected content. SSR-safe read-only operation.\n const nativeEl = this.elementRef.nativeElement as HTMLElement;\n const innerEl = nativeEl.querySelector('.solaris-segmented-item__inner');\n if (!innerEl) return;\n for (const node of Array.from(innerEl.childNodes)) {\n if (node.nodeType === Node.TEXT_NODE && node.textContent?.trim()) {\n this.hasContent.set(true);\n return;\n }\n if (node.nodeType === Node.ELEMENT_NODE) {\n const el = node as HTMLElement;\n if (!el.classList.contains('solaris-segmented-item__icon')) {\n this.hasContent.set(true);\n return;\n }\n }\n }\n }\n\n readonly resolvedLabel = computed(() => {\n if (this.label()) return this.label();\n const labelKey = this.labelKey();\n if (labelKey && this.translateService) {\n return this.translateService.translate(labelKey);\n }\n return labelKey ?? undefined;\n });\n\n protected readonly resolvedAriaLabel = computed(() => {\n if (this.ariaLabel()) return this.ariaLabel();\n const ariaLabelKey = this.ariaLabelKey();\n if (ariaLabelKey && this.translateService) {\n return this.translateService.translate(ariaLabelKey);\n }\n return undefined;\n });\n\n protected readonly index = computed(() => {\n if (!this.control) return -1;\n return this.control.items().indexOf(this);\n });\n\n protected onClick(): void {\n if (this.isComputedDisabled()) return;\n if (this.isComputedReadonly()) return;\n this.control?.selectItem(this);\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (this.isComputedDisabled()) return;\n\n const items = this.control?.items() ?? [];\n const currentIndex = this.index();\n\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n if (!this.isComputedReadonly()) {\n this.control?.selectItem(this);\n }\n return;\n }\n\n const nextIndex = this.getNextIndex(event.key, items, currentIndex);\n\n if (nextIndex === null || nextIndex === currentIndex) return;\n\n event.preventDefault();\n\n const nextItem = items[nextIndex];\n this.control?.focusItem(nextItem);\n }\n\n private getNextIndex(\n key: string,\n items: ReadonlyArray<SolarisSegmentedItemComponent>,\n currentIndex: number,\n ): number | null {\n const orientation = this.control?.orientation() ?? 'horizontal';\n\n switch (key) {\n case 'ArrowRight':\n return orientation === 'horizontal'\n ? this.findNextEnabled(items, currentIndex, 1)\n : null;\n\n case 'ArrowLeft':\n return orientation === 'horizontal'\n ? this.findNextEnabled(items, currentIndex, -1)\n : null;\n\n case 'ArrowDown':\n return orientation === 'vertical'\n ? this.findNextEnabled(items, currentIndex, 1)\n : null;\n\n case 'ArrowUp':\n return orientation === 'vertical'\n ? this.findNextEnabled(items, currentIndex, -1)\n : null;\n\n case 'Home':\n return this.findFirstEnabled(items);\n\n case 'End':\n return this.findLastEnabled(items);\n\n default:\n return null;\n }\n }\n\n private findNextEnabled(\n items: ReadonlyArray<SolarisSegmentedItemComponent>,\n fromIndex: number,\n direction: 1 | -1,\n ): number | null {\n let i = fromIndex + direction;\n while (i >= 0 && i < items.length) {\n if (!items[i].isComputedDisabled()) return i;\n i += direction;\n }\n return null;\n }\n\n private findFirstEnabled(\n items: ReadonlyArray<SolarisSegmentedItemComponent>,\n ): number | null {\n for (let i = 0; i < items.length; i++) {\n if (!items[i].isComputedDisabled()) return i;\n }\n return null;\n }\n\n private findLastEnabled(\n items: ReadonlyArray<SolarisSegmentedItemComponent>,\n ): number | null {\n for (let i = items.length - 1; i >= 0; i--) {\n if (!items[i].isComputedDisabled()) return i;\n }\n return null;\n }\n}\n","<span class=\"solaris-segmented-item__inner\">\n @if (icon(); as iconName) {\n <solaris-icon\n class=\"solaris-segmented-item__icon\"\n [name]=\"iconName\"\n [decorative]=\"true\"\n />\n }\n @if (resolvedLabel(); as labelText) {\n <span class=\"solaris-segmented-item__label\">{{ labelText }}</span>\n }\n <ng-content />\n</span>\n"]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=segmented-control.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"segmented-control.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/angular/src/lib/components/navigation/segmented-control/model/segmented-control.types.ts"],"names":[],"mappings":"","sourcesContent":["export type SolarisSegmentedControlOrientation = 'horizontal' | 'vertical';\n\nexport type SolarisSegmentedControlAppearance = 'surface' | 'outline';\n\nexport type SolarisSegmentedControlSize = 'sm' | 'md' | 'lg';\n\nexport type SolarisSegmentedControlDensity = 'compact' | 'comfortable';\n\nexport type SolarisSegmentedControlRadius = 'sm' | 'md' | 'lg' | 'full';\n\nexport interface SolarisSegmentedControlValueChangeEvent {\n value: unknown;\n}\n\nexport interface SolarisSegmentedControlChangeEvent {\n value: unknown;\n previousValue: unknown;\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ export const SOLARIS_SEGMENTED_CONTROL = new InjectionToken('SolarisSegmentedControl');
3
+ //# sourceMappingURL=segmented-control.tokens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"segmented-control.tokens.js","sourceRoot":"","sources":["../../../../../../../../../packages/angular/src/lib/components/navigation/segmented-control/token/segmented-control.tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAe,MAAM,eAAe,CAAC;AA8B5D,MAAM,CAAC,MAAM,yBAAyB,GACpC,IAAI,cAAc,CAChB,yBAAyB,CAC1B,CAAC","sourcesContent":["import { InjectionToken, type Signal } from '@angular/core';\n\nimport type {\n SolarisSegmentedControlOrientation,\n SolarisSegmentedControlAppearance,\n SolarisSegmentedControlSize,\n SolarisSegmentedControlDensity,\n SolarisSegmentedControlRadius,\n} from '../model/segmented-control.types';\nimport type { SolarisSegmentedItemComponent } from '../item/segmented-item.component';\n\nexport interface SolarisSegmentedControlInterface {\n value: Signal<unknown>;\n items: Signal<ReadonlyArray<SolarisSegmentedItemComponent>>;\n orientation: Signal<SolarisSegmentedControlOrientation>;\n appearance: Signal<SolarisSegmentedControlAppearance>;\n size: Signal<SolarisSegmentedControlSize>;\n density: Signal<SolarisSegmentedControlDensity>;\n radius: Signal<SolarisSegmentedControlRadius>;\n disabled: Signal<boolean>;\n readonly: Signal<boolean>;\n invalid: Signal<boolean>;\n fullWidth: Signal<boolean>;\n equalWidth: Signal<boolean>;\n indicator: Signal<boolean>;\n compareFn: Signal<(a: unknown, b: unknown) => boolean>;\n selectItem: (item: SolarisSegmentedItemComponent) => void;\n focusItem: (item: SolarisSegmentedItemComponent) => void;\n}\n\nexport const SOLARIS_SEGMENTED_CONTROL =\n new InjectionToken<SolarisSegmentedControlInterface>(\n 'SolarisSegmentedControl',\n );\n"]}
@@ -0,0 +1,15 @@
1
+ import { Component, input, ChangeDetectionStrategy } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export class SolarisStepperActionsComponent {
4
+ align = input('end', ...(ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []));
5
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisStepperActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
6
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.17", type: SolarisStepperActionsComponent, isStandalone: true, selector: "solaris-stepper-actions", inputs: { align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-align": "align()" }, classAttribute: "solaris-stepper-actions" }, ngImport: i0, template: "<ng-content />\n", styles: [":host{display:flex;gap:var(--solaris-spacing-3);padding-top:var(--solaris-spacing-6)}:host([data-align=start]){justify-content:flex-start}:host([data-align=center]){justify-content:center}:host([data-align=end]){justify-content:flex-end}:host([data-align=space-between]){justify-content:space-between}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
7
+ }
8
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisStepperActionsComponent, decorators: [{
9
+ type: Component,
10
+ args: [{ selector: 'solaris-stepper-actions', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: {
11
+ '[attr.data-align]': 'align()',
12
+ class: 'solaris-stepper-actions',
13
+ }, template: "<ng-content />\n", styles: [":host{display:flex;gap:var(--solaris-spacing-3);padding-top:var(--solaris-spacing-6)}:host([data-align=start]){justify-content:flex-start}:host([data-align=center]){justify-content:center}:host([data-align=end]){justify-content:flex-end}:host([data-align=space-between]){justify-content:space-between}\n"] }]
14
+ }], propDecorators: { align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }] } });
15
+ //# sourceMappingURL=stepper-actions.component.js.map