@i-cell/ids-angular 0.1.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 (324) hide show
  1. package/README.md +24 -0
  2. package/accordion/accordion-animations.d.ts +1 -0
  3. package/accordion/accordion-defaults.d.ts +18 -0
  4. package/accordion/accordion-item/accordion-item.component.d.ts +27 -0
  5. package/accordion/accordion.component.d.ts +29 -0
  6. package/accordion/index.d.ts +5 -0
  7. package/accordion/public-api.d.ts +5 -0
  8. package/accordion/types/accordion-appearance.type.d.ts +5 -0
  9. package/avatar/avatar-defaults.d.ts +12 -0
  10. package/avatar/avatar-image.directive.d.ts +5 -0
  11. package/avatar/avatar.component.d.ts +28 -0
  12. package/avatar/index.d.ts +5 -0
  13. package/avatar/public-api.d.ts +6 -0
  14. package/avatar/tokens/avatar-parent.d.ts +6 -0
  15. package/avatar/types/avatar-type.type.d.ts +6 -0
  16. package/avatar/types/avatar-variant.type.d.ts +8 -0
  17. package/button/button-defaults.d.ts +11 -0
  18. package/button/button-group-defaults.d.ts +7 -0
  19. package/button/button-group.component.d.ts +11 -0
  20. package/button/button.component.d.ts +23 -0
  21. package/button/index.d.ts +5 -0
  22. package/button/public-api.d.ts +7 -0
  23. package/button/tokens/button-parent.d.ts +6 -0
  24. package/button/types/button-appearance.type.d.ts +6 -0
  25. package/button/types/button-variant.type.d.ts +14 -0
  26. package/card/card-body.directive.d.ts +6 -0
  27. package/card/card-defaults.d.ts +12 -0
  28. package/card/card-footer.directive.d.ts +6 -0
  29. package/card/card-header.component.d.ts +6 -0
  30. package/card/card-media.directive.d.ts +7 -0
  31. package/card/card-section-base.directive.d.ts +9 -0
  32. package/card/card-subtitle.directive.d.ts +5 -0
  33. package/card/card-title.directive.d.ts +5 -0
  34. package/card/card.component.d.ts +21 -0
  35. package/card/index.d.ts +5 -0
  36. package/card/public-api.d.ts +10 -0
  37. package/card/types/card-appearances.type.d.ts +6 -0
  38. package/card/types/card-variant.type.d.ts +13 -0
  39. package/checkbox/checkbox-defaults.d.ts +9 -0
  40. package/checkbox/checkbox-group-defaults.d.ts +9 -0
  41. package/checkbox/checkbox-group.component.d.ts +28 -0
  42. package/checkbox/checkbox.component.d.ts +68 -0
  43. package/checkbox/index.d.ts +5 -0
  44. package/checkbox/public-api.d.ts +7 -0
  45. package/checkbox/types/checkbox-events.class.d.ts +6 -0
  46. package/checkbox/types/checkbox-group-child.d.ts +7 -0
  47. package/checkbox/types/checkbox-parent.d.ts +8 -0
  48. package/checkbox/types/checkbox-state.type.d.ts +6 -0
  49. package/checkbox/types/checkbox-variant.type.d.ts +6 -0
  50. package/chip/chip-defaults.d.ts +12 -0
  51. package/chip/chip-group-defaults.d.ts +9 -0
  52. package/chip/chip-group.component.d.ts +14 -0
  53. package/chip/chip.component.d.ts +35 -0
  54. package/chip/index.d.ts +5 -0
  55. package/chip/public-api.d.ts +7 -0
  56. package/chip/types/chip-appearance.type.d.ts +5 -0
  57. package/chip/types/chip-events.type.d.ts +4 -0
  58. package/chip/types/chip-variant.type.d.ts +8 -0
  59. package/core/base-classes/component-base.d.ts +13 -0
  60. package/core/base-classes/directive-base.d.ts +16 -0
  61. package/core/directives/detect-scrollable.directive.d.ts +11 -0
  62. package/core/index.d.ts +5 -0
  63. package/core/pipes/sentence-case.pipe.d.ts +7 -0
  64. package/core/public-api.d.ts +17 -0
  65. package/core/services/resize-observer.service.d.ts +13 -0
  66. package/core/types/orientation.type.d.ts +5 -0
  67. package/core/types/position.type.d.ts +39 -0
  68. package/core/types/size-collection.type.d.ts +5 -0
  69. package/core/types/size.type.d.ts +7 -0
  70. package/core/utils/class-prefix.d.ts +2 -0
  71. package/core/utils/class.d.ts +2 -0
  72. package/core/utils/coercion.d.ts +6 -0
  73. package/core/utils/compare.d.ts +1 -0
  74. package/core/utils/date.d.ts +1 -0
  75. package/core/utils/even-odd.d.ts +2 -0
  76. package/core/utils/fallback-value.d.ts +1 -0
  77. package/core/utils/string.d.ts +1 -0
  78. package/dialog/custom-dialog-base.d.ts +15 -0
  79. package/dialog/dialog-defaults.d.ts +9 -0
  80. package/dialog/dialog-header.directive.d.ts +7 -0
  81. package/dialog/dialog.component.d.ts +22 -0
  82. package/dialog/dialog.service.d.ts +17 -0
  83. package/dialog/index.d.ts +5 -0
  84. package/dialog/public-api.d.ts +5 -0
  85. package/divider/divider-defaults.d.ts +12 -0
  86. package/divider/divider.component.d.ts +18 -0
  87. package/divider/index.d.ts +5 -0
  88. package/divider/public-api.d.ts +3 -0
  89. package/divider/types/divider-variant.type.d.ts +13 -0
  90. package/fesm2022/i-cell-ids-angular-accordion.mjs +223 -0
  91. package/fesm2022/i-cell-ids-angular-accordion.mjs.map +1 -0
  92. package/fesm2022/i-cell-ids-angular-avatar.mjs +125 -0
  93. package/fesm2022/i-cell-ids-angular-avatar.mjs.map +1 -0
  94. package/fesm2022/i-cell-ids-angular-button.mjs +117 -0
  95. package/fesm2022/i-cell-ids-angular-button.mjs.map +1 -0
  96. package/fesm2022/i-cell-ids-angular-card.mjs +222 -0
  97. package/fesm2022/i-cell-ids-angular-card.mjs.map +1 -0
  98. package/fesm2022/i-cell-ids-angular-checkbox.mjs +346 -0
  99. package/fesm2022/i-cell-ids-angular-checkbox.mjs.map +1 -0
  100. package/fesm2022/i-cell-ids-angular-chip.mjs +166 -0
  101. package/fesm2022/i-cell-ids-angular-chip.mjs.map +1 -0
  102. package/fesm2022/i-cell-ids-angular-core.mjs +266 -0
  103. package/fesm2022/i-cell-ids-angular-core.mjs.map +1 -0
  104. package/fesm2022/i-cell-ids-angular-dialog.mjs +157 -0
  105. package/fesm2022/i-cell-ids-angular-dialog.mjs.map +1 -0
  106. package/fesm2022/i-cell-ids-angular-divider.mjs +76 -0
  107. package/fesm2022/i-cell-ids-angular-divider.mjs.map +1 -0
  108. package/fesm2022/i-cell-ids-angular-forms.mjs +871 -0
  109. package/fesm2022/i-cell-ids-angular-forms.mjs.map +1 -0
  110. package/fesm2022/i-cell-ids-angular-icon-button.mjs +81 -0
  111. package/fesm2022/i-cell-ids-angular-icon-button.mjs.map +1 -0
  112. package/fesm2022/i-cell-ids-angular-icon.mjs +149 -0
  113. package/fesm2022/i-cell-ids-angular-icon.mjs.map +1 -0
  114. package/fesm2022/i-cell-ids-angular-menu.mjs +108 -0
  115. package/fesm2022/i-cell-ids-angular-menu.mjs.map +1 -0
  116. package/fesm2022/i-cell-ids-angular-notification.mjs +167 -0
  117. package/fesm2022/i-cell-ids-angular-notification.mjs.map +1 -0
  118. package/fesm2022/i-cell-ids-angular-overlay-panel.mjs +72 -0
  119. package/fesm2022/i-cell-ids-angular-overlay-panel.mjs.map +1 -0
  120. package/fesm2022/i-cell-ids-angular-paginator.mjs +319 -0
  121. package/fesm2022/i-cell-ids-angular-paginator.mjs.map +1 -0
  122. package/fesm2022/i-cell-ids-angular-radio.mjs +312 -0
  123. package/fesm2022/i-cell-ids-angular-radio.mjs.map +1 -0
  124. package/fesm2022/i-cell-ids-angular-segmented-control-toggle.mjs +264 -0
  125. package/fesm2022/i-cell-ids-angular-segmented-control-toggle.mjs.map +1 -0
  126. package/fesm2022/i-cell-ids-angular-segmented-control.mjs +283 -0
  127. package/fesm2022/i-cell-ids-angular-segmented-control.mjs.map +1 -0
  128. package/fesm2022/i-cell-ids-angular-select.mjs +550 -0
  129. package/fesm2022/i-cell-ids-angular-select.mjs.map +1 -0
  130. package/fesm2022/i-cell-ids-angular-snackbar.mjs +440 -0
  131. package/fesm2022/i-cell-ids-angular-snackbar.mjs.map +1 -0
  132. package/fesm2022/i-cell-ids-angular-switch.mjs +181 -0
  133. package/fesm2022/i-cell-ids-angular-switch.mjs.map +1 -0
  134. package/fesm2022/i-cell-ids-angular-tab.mjs +141 -0
  135. package/fesm2022/i-cell-ids-angular-tab.mjs.map +1 -0
  136. package/fesm2022/i-cell-ids-angular-table.mjs +663 -0
  137. package/fesm2022/i-cell-ids-angular-table.mjs.map +1 -0
  138. package/fesm2022/i-cell-ids-angular-tag.mjs +116 -0
  139. package/fesm2022/i-cell-ids-angular-tag.mjs.map +1 -0
  140. package/fesm2022/i-cell-ids-angular-tooltip.mjs +587 -0
  141. package/fesm2022/i-cell-ids-angular-tooltip.mjs.map +1 -0
  142. package/fesm2022/i-cell-ids-angular.mjs +9 -0
  143. package/fesm2022/i-cell-ids-angular.mjs.map +1 -0
  144. package/forms/common/error/error-state.d.ts +23 -0
  145. package/forms/common/success/success-state.d.ts +23 -0
  146. package/forms/components/fieldset/fieldset-defaults.d.ts +9 -0
  147. package/forms/components/fieldset/fieldset-message.directive.d.ts +5 -0
  148. package/forms/components/fieldset/fieldset-row/fieldset-row.component.d.ts +8 -0
  149. package/forms/components/fieldset/fieldset.component.d.ts +16 -0
  150. package/forms/components/form-field/form-field-control.d.ts +21 -0
  151. package/forms/components/form-field/form-field-defaults.d.ts +9 -0
  152. package/forms/components/form-field/form-field.component.d.ts +41 -0
  153. package/forms/components/form-field/tokens/form-field-control.d.ts +3 -0
  154. package/forms/components/form-field/types/form-field-variant.type.d.ts +5 -0
  155. package/forms/components/input/input-defaults.d.ts +9 -0
  156. package/forms/components/input/input.directive.d.ts +55 -0
  157. package/forms/components/input/types/input.type.d.ts +1 -0
  158. package/forms/components/message/error-message/error-message.component.d.ts +15 -0
  159. package/forms/components/message/hint-message/hint-message.component.d.ts +10 -0
  160. package/forms/components/message/message-defaults.d.ts +9 -0
  161. package/forms/components/message/success-message/success-message.component.d.ts +11 -0
  162. package/forms/components/message/types/message-parent-form-field.d.ts +9 -0
  163. package/forms/components/message/types/message-variant.type.d.ts +6 -0
  164. package/forms/components/message/types/message.type.d.ts +6 -0
  165. package/forms/components/option/option-group.component.d.ts +13 -0
  166. package/forms/components/option/option.component.d.ts +47 -0
  167. package/forms/components/option/tokens/option-group.d.ts +3 -0
  168. package/forms/components/option/tokens/option-parent.d.ts +11 -0
  169. package/forms/components/option/types/option-events.class.d.ts +7 -0
  170. package/forms/components/pseudo-checkbox/pseudo-checkbox.component.d.ts +14 -0
  171. package/forms/components/pseudo-checkbox/tokens/pseudo-checkbox-parent.d.ts +7 -0
  172. package/forms/components/pseudo-checkbox/types/pseudo-checkbox-state.type.d.ts +6 -0
  173. package/forms/directives/form-field-action.directive.d.ts +5 -0
  174. package/forms/directives/label.directive.d.ts +5 -0
  175. package/forms/directives/message-prefix.directive.d.ts +5 -0
  176. package/forms/directives/message-suffix.directive.d.ts +5 -0
  177. package/forms/directives/message.directive.d.ts +17 -0
  178. package/forms/directives/prefix.directive.d.ts +7 -0
  179. package/forms/directives/suffix.directive.d.ts +7 -0
  180. package/forms/index.d.ts +5 -0
  181. package/forms/public-api.d.ts +35 -0
  182. package/forms/validators.d.ts +9 -0
  183. package/icon/icon-defaults.d.ts +11 -0
  184. package/icon/icon.component.d.ts +32 -0
  185. package/icon/index.d.ts +5 -0
  186. package/icon/public-api.d.ts +5 -0
  187. package/icon/tokens/icon-parent.d.ts +6 -0
  188. package/icon/types/icon-source.type.d.ts +5 -0
  189. package/icon/types/icon-variant.type.d.ts +12 -0
  190. package/icon-button/icon-button-defaults.d.ts +11 -0
  191. package/icon-button/icon-button.component.d.ts +22 -0
  192. package/icon-button/index.d.ts +5 -0
  193. package/icon-button/public-api.d.ts +5 -0
  194. package/icon-button/tokens/icon-button-parent.d.ts +9 -0
  195. package/icon-button/types/icon-button-appearance.type.d.ts +6 -0
  196. package/icon-button/types/icon-button-variant.type.d.ts +13 -0
  197. package/index.d.ts +5 -0
  198. package/menu/action-menu/action-menu-trigger.directive.d.ts +12 -0
  199. package/menu/index.d.ts +5 -0
  200. package/menu/menu-item/menu-item-defaults.d.ts +11 -0
  201. package/menu/menu-item/menu-item.component.d.ts +23 -0
  202. package/menu/menu-item/types/menu-item-appearance.type.d.ts +5 -0
  203. package/menu/menu-item/types/menu-item-variant.type.d.ts +4 -0
  204. package/menu/public-api.d.ts +5 -0
  205. package/notification/index.d.ts +5 -0
  206. package/notification/notification-action-button.directive.d.ts +5 -0
  207. package/notification/notification-defaults.d.ts +15 -0
  208. package/notification/notification.component.d.ts +34 -0
  209. package/notification/public-api.d.ts +5 -0
  210. package/notification/types/notification-appearance.type.d.ts +5 -0
  211. package/notification/types/notification-variant.type.d.ts +10 -0
  212. package/overlay-panel/index.d.ts +5 -0
  213. package/overlay-panel/overlay-panel-defaults.d.ts +11 -0
  214. package/overlay-panel/overlay-panel.component.d.ts +18 -0
  215. package/overlay-panel/public-api.d.ts +4 -0
  216. package/overlay-panel/types/overlay-panel-appearance.type.d.ts +6 -0
  217. package/overlay-panel/types/overlay-panel-variant.type.d.ts +5 -0
  218. package/package.json +153 -0
  219. package/paginator/index.d.ts +5 -0
  220. package/paginator/paginator-defaults.d.ts +22 -0
  221. package/paginator/paginator-intl.d.ts +24 -0
  222. package/paginator/paginator.component.d.ts +67 -0
  223. package/paginator/public-api.d.ts +5 -0
  224. package/paginator/types/paginator-appearance.type.d.ts +4 -0
  225. package/paginator/types/paginator-events.class.d.ts +6 -0
  226. package/paginator/types/paginator-variant.type.d.ts +7 -0
  227. package/public-api.d.ts +2 -0
  228. package/radio/index.d.ts +5 -0
  229. package/radio/public-api.d.ts +5 -0
  230. package/radio/radio-defaults.d.ts +11 -0
  231. package/radio/radio-group.directive.d.ts +46 -0
  232. package/radio/radio.component.d.ts +30 -0
  233. package/radio/types/radio-events.class.d.ts +6 -0
  234. package/radio/types/radio-variant.type.d.ts +6 -0
  235. package/segmented-control/index.d.ts +5 -0
  236. package/segmented-control/public-api.d.ts +6 -0
  237. package/segmented-control/segmented-control-defaults.d.ts +11 -0
  238. package/segmented-control/segmented-control-item.component.d.ts +33 -0
  239. package/segmented-control/segmented-control.directive.d.ts +42 -0
  240. package/segmented-control/types/segmented-control-appearance.type.d.ts +4 -0
  241. package/segmented-control/types/segmented-control-item-change.class.d.ts +7 -0
  242. package/segmented-control/types/segmented-control-variant.type.d.ts +6 -0
  243. package/segmented-control-toggle/index.d.ts +5 -0
  244. package/segmented-control-toggle/public-api.d.ts +6 -0
  245. package/segmented-control-toggle/segmented-control-toggle-defaults.d.ts +12 -0
  246. package/segmented-control-toggle/segmented-control-toggle-item.component.d.ts +32 -0
  247. package/segmented-control-toggle/segmented-control-toggle.directive.d.ts +43 -0
  248. package/segmented-control-toggle/types/segmented-control-toggle-appearance.type.d.ts +5 -0
  249. package/segmented-control-toggle/types/segmented-control-toggle-item-change.class.d.ts +6 -0
  250. package/segmented-control-toggle/types/segmented-control-toggle-variant.type.d.ts +11 -0
  251. package/select/index.d.ts +5 -0
  252. package/select/public-api.d.ts +3 -0
  253. package/select/select-defaults.d.ts +9 -0
  254. package/select/select-positions.d.ts +2 -0
  255. package/select/select-trigger.directive.d.ts +5 -0
  256. package/select/select.component.d.ts +102 -0
  257. package/snackbar/animations.d.ts +2 -0
  258. package/snackbar/index.d.ts +5 -0
  259. package/snackbar/public-api.d.ts +7 -0
  260. package/snackbar/services/snackbar.service.d.ts +28 -0
  261. package/snackbar/snackbar-defaults.d.ts +16 -0
  262. package/snackbar/snackbar-group.component.d.ts +25 -0
  263. package/snackbar/snackbar-position-strategies.d.ts +4 -0
  264. package/snackbar/snackbar.component.d.ts +51 -0
  265. package/snackbar/types/snackbar-data.type.d.ts +15 -0
  266. package/snackbar/types/snackbar-inner-data.type.d.ts +4 -0
  267. package/snackbar/types/snackbar-position.type.d.ts +9 -0
  268. package/snackbar/types/snackbar-variant.type.d.ts +8 -0
  269. package/switch/index.d.ts +5 -0
  270. package/switch/public-api.d.ts +5 -0
  271. package/switch/switch-animations.d.ts +2 -0
  272. package/switch/switch-defaults.d.ts +13 -0
  273. package/switch/switch-group.component.d.ts +14 -0
  274. package/switch/switch.component.d.ts +45 -0
  275. package/switch/types/switch-positions.type.d.ts +10 -0
  276. package/switch/types/switch-variant.type.d.ts +6 -0
  277. package/tab/index.d.ts +5 -0
  278. package/tab/public-api.d.ts +6 -0
  279. package/tab/tab-group-defaults.d.ts +15 -0
  280. package/tab/tab-group.component.d.ts +29 -0
  281. package/tab/tab.component.d.ts +18 -0
  282. package/tab/types/tab-group-position.type.d.ts +6 -0
  283. package/tab/types/tab-group-variant.type.d.ts +6 -0
  284. package/tab/types/tab-indicator-position.type.d.ts +7 -0
  285. package/table/components/cell-content/cell-content.component.d.ts +25 -0
  286. package/table/datasource/server-side-datasource.d.ts +37 -0
  287. package/table/directives/cell-renderer.d.ts +13 -0
  288. package/table/directives/cell-template.d.ts +8 -0
  289. package/table/directives/row-info-holder.d.ts +9 -0
  290. package/table/index.d.ts +5 -0
  291. package/table/public-api.d.ts +18 -0
  292. package/table/table-defaults.d.ts +22 -0
  293. package/table/table-intl.d.ts +25 -0
  294. package/table/table.component.d.ts +142 -0
  295. package/table/types/pagination-params.d.ts +9 -0
  296. package/table/types/request-factory.d.ts +5 -0
  297. package/table/types/request-pagination-data.d.ts +6 -0
  298. package/table/types/response-data.d.ts +5 -0
  299. package/table/types/table-appearance.type.d.ts +6 -0
  300. package/table/types/table-cell-click-event.d.ts +6 -0
  301. package/table/types/table-column-def.d.ts +97 -0
  302. package/table/types/table-row-click-event.d.ts +4 -0
  303. package/table/types/table-row-keydown-event.d.ts +4 -0
  304. package/table/types/table-sort-direction.d.ts +6 -0
  305. package/table/types/table-sort-info.d.ts +6 -0
  306. package/table/types/table-variant.type.d.ts +6 -0
  307. package/tag/index.d.ts +5 -0
  308. package/tag/public-api.d.ts +6 -0
  309. package/tag/tag-defaults.d.ts +11 -0
  310. package/tag/tag-group-defaults.d.ts +9 -0
  311. package/tag/tag-group.component.d.ts +13 -0
  312. package/tag/tag.component.d.ts +23 -0
  313. package/tag/types/tag-appearance.type.d.ts +5 -0
  314. package/tag/types/tag-variant.type.d.ts +13 -0
  315. package/tooltip/index.d.ts +5 -0
  316. package/tooltip/public-api.d.ts +5 -0
  317. package/tooltip/tooltip-defaults.d.ts +18 -0
  318. package/tooltip/tooltip-position-strategies.d.ts +3 -0
  319. package/tooltip/tooltip.component.d.ts +31 -0
  320. package/tooltip/tooltip.directive.d.ts +60 -0
  321. package/tooltip/types/tooltip-position.type.d.ts +11 -0
  322. package/tooltip/types/tooltip-variant.type.d.ts +5 -0
  323. package/tooltip/types/tooltip.type.d.ts +2 -0
  324. package/tooltip/utils/tooltip-converters.d.ts +3 -0
@@ -0,0 +1,871 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, signal, Component, ViewEncapsulation, ChangeDetectionStrategy, InjectionToken, Directive, input, contentChildren, computed, Input, inject, Injector, ChangeDetectorRef, viewChild, contentChild, isDevMode, ElementRef, effect, output } from '@angular/core';
3
+ import { ComponentBase, IdsSize, ComponentBaseWithDefaults, coerceBooleanAttribute } from '@i-cell/ids-angular/core';
4
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
5
+ import { IdsIconComponent } from '@i-cell/ids-angular/icon';
6
+ import { startWith, Subject } from 'rxjs';
7
+ import { Validators, FormGroupDirective, NgForm, NgControl } from '@angular/forms';
8
+ import { hasModifierKey } from '@angular/cdk/keycodes';
9
+
10
+ class AbstractErrorStateMatcher {
11
+ }
12
+ class ErrorStateMatcher extends AbstractErrorStateMatcher {
13
+ isErrorState(control, form) {
14
+ return !!(control && control.invalid && (control.touched || (form && form.submitted)));
15
+ }
16
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: ErrorStateMatcher, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
17
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: ErrorStateMatcher, providedIn: 'root' }); }
18
+ }
19
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: ErrorStateMatcher, decorators: [{
20
+ type: Injectable,
21
+ args: [{ providedIn: 'root' }]
22
+ }] });
23
+ class ErrorStateTracker {
24
+ constructor(_matcher, _ngControl, _parentFormGroup, _parentForm, _stateChanges) {
25
+ this._matcher = _matcher;
26
+ this._ngControl = _ngControl;
27
+ this._parentFormGroup = _parentFormGroup;
28
+ this._parentForm = _parentForm;
29
+ this._stateChanges = _stateChanges;
30
+ /** Whether the tracker is currently in an error state. */
31
+ this.hasErrorState = false;
32
+ }
33
+ /** Updates the error state based on the provided error state matcher. */
34
+ updateErrorState() {
35
+ const oldState = this.hasErrorState;
36
+ const parent = this._parentFormGroup || this._parentForm;
37
+ const matcher = this._matcher;
38
+ const control = this._ngControl ? (this._ngControl.control) : null;
39
+ const newState = matcher?.isErrorState(control, parent) ?? false;
40
+ if (newState !== oldState) {
41
+ this.hasErrorState = newState;
42
+ this._stateChanges?.next();
43
+ }
44
+ }
45
+ }
46
+
47
+ class AbstractSuccessStateMatcher {
48
+ }
49
+ class SuccessStateMatcher extends AbstractSuccessStateMatcher {
50
+ isSuccessState(control, form) {
51
+ return !!(control && control.valid && (control.touched || (form && form.submitted)));
52
+ }
53
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: SuccessStateMatcher, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
54
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: SuccessStateMatcher, providedIn: 'root' }); }
55
+ }
56
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: SuccessStateMatcher, decorators: [{
57
+ type: Injectable,
58
+ args: [{ providedIn: 'root' }]
59
+ }] });
60
+ class SuccessStateTracker {
61
+ constructor(_matcher, _ngControl, _parentFormGroup, _parentForm, _stateChanges) {
62
+ this._matcher = _matcher;
63
+ this._ngControl = _ngControl;
64
+ this._parentFormGroup = _parentFormGroup;
65
+ this._parentForm = _parentForm;
66
+ this._stateChanges = _stateChanges;
67
+ /** Whether the tracker is currently in an success state. */
68
+ this.hasSuccessState = false;
69
+ }
70
+ /** Updates the success state based on the provided success state matcher. */
71
+ updateSuccessState() {
72
+ const oldState = this.hasSuccessState;
73
+ const parent = this._parentFormGroup || this._parentForm;
74
+ const matcher = this._matcher;
75
+ const control = this._ngControl ? (this._ngControl.control) : null;
76
+ const newState = matcher?.isSuccessState(control, parent) ?? false;
77
+ if (newState !== oldState) {
78
+ this.hasSuccessState = newState;
79
+ this._stateChanges?.next();
80
+ }
81
+ }
82
+ }
83
+
84
+ class IdsFieldsetRowComponent extends ComponentBase {
85
+ constructor() {
86
+ super(...arguments);
87
+ this._hostClasses = signal(this._getHostClasses([]));
88
+ }
89
+ get _hostName() {
90
+ return 'fieldset-row';
91
+ }
92
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsFieldsetRowComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
93
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.2", type: IdsFieldsetRowComponent, isStandalone: true, selector: "ids-fieldset-row", usesInheritance: true, ngImport: i0, template: "<ng-content />\n", changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
94
+ }
95
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsFieldsetRowComponent, decorators: [{
96
+ type: Component,
97
+ args: [{ selector: 'ids-fieldset-row', imports: [], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content />\n" }]
98
+ }] });
99
+
100
+ const IdsFormFieldVariant = {
101
+ SURFACE: 'surface',
102
+ LIGHT: 'light',
103
+ };
104
+
105
+ const IDS_FIELDSET_DEFAULT_CONFIG = new InjectionToken('IDS_FIELDSET_DEFAULT_CONFIG', {
106
+ providedIn: 'root',
107
+ factory: IDS_FIELDSET_DEFAULT_CONFIG_FACTORY,
108
+ });
109
+ function IDS_FIELDSET_DEFAULT_CONFIG_FACTORY() {
110
+ return {
111
+ size: IdsSize.COMPACT,
112
+ variant: IdsFormFieldVariant.SURFACE,
113
+ };
114
+ }
115
+
116
+ class IdsFieldsetMessageDirective {
117
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsFieldsetMessageDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
118
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.2", type: IdsFieldsetMessageDirective, isStandalone: true, selector: "[idsFieldsetMessage]", ngImport: i0 }); }
119
+ }
120
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsFieldsetMessageDirective, decorators: [{
121
+ type: Directive,
122
+ args: [{
123
+ selector: '[idsFieldsetMessage]',
124
+ standalone: true,
125
+ }]
126
+ }] });
127
+
128
+ const defaultConfig$3 = IDS_FIELDSET_DEFAULT_CONFIG_FACTORY();
129
+ class IdsFieldsetComponent extends ComponentBaseWithDefaults {
130
+ constructor() {
131
+ super(...arguments);
132
+ this._defaultConfig = this._getDefaultConfig(defaultConfig$3, IDS_FIELDSET_DEFAULT_CONFIG);
133
+ this.size = input(this._defaultConfig.size);
134
+ this.variant = input(this._defaultConfig.variant);
135
+ this.legend = input('');
136
+ this._fieldsetMessage = contentChildren(IdsFieldsetMessageDirective);
137
+ this._hasMessage = computed(() => this._fieldsetMessage().length > 0);
138
+ this._hostClasses = computed(() => this._getHostClasses([
139
+ this.size(),
140
+ this.variant(),
141
+ ]));
142
+ }
143
+ get _hostName() {
144
+ return 'fieldset';
145
+ }
146
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsFieldsetComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
147
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.2", type: IdsFieldsetComponent, isStandalone: true, selector: "fieldset[idsFieldset]", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, legend: { classPropertyName: "legend", publicName: "legend", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "_fieldsetMessage", predicate: IdsFieldsetMessageDirective, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<legend class=\"ids-fieldset-legend\">{{ legend() }}</legend>\n@if (_hasMessage()) {\n <div class=\"ids-fieldset-message\">\n <ng-content select=\"[idsFieldsetMessage]\" />\n </div>\n}\n<ng-content select=\"ids-fieldset-row\" />\n", changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
148
+ }
149
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsFieldsetComponent, decorators: [{
150
+ type: Component,
151
+ args: [{ selector: 'fieldset[idsFieldset]', imports: [], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<legend class=\"ids-fieldset-legend\">{{ legend() }}</legend>\n@if (_hasMessage()) {\n <div class=\"ids-fieldset-message\">\n <ng-content select=\"[idsFieldsetMessage]\" />\n </div>\n}\n<ng-content select=\"ids-fieldset-row\" />\n" }]
152
+ }] });
153
+
154
+ const IDS_FORM_FIELD_CONTROL = new InjectionToken('IDS_FORM_FIELD_CONTROL');
155
+
156
+ const formFieldControlClass = 'ids-form-field-control';
157
+ class IdsFormFieldControl {
158
+ }
159
+
160
+ const IDS_FORM_FIELD_DEFAULT_CONFIG = new InjectionToken('IDS_FORM_FIELD_DEFAULT_CONFIG', {
161
+ providedIn: 'root',
162
+ factory: IDS_FORM_FIELD_DEFAULT_CONFIG_FACTORY,
163
+ });
164
+ function IDS_FORM_FIELD_DEFAULT_CONFIG_FACTORY() {
165
+ return {
166
+ size: IdsSize.COMPACT,
167
+ variant: IdsFormFieldVariant.SURFACE,
168
+ };
169
+ }
170
+
171
+ class IdsFormFieldActionDirective {
172
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsFormFieldActionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
173
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.2", type: IdsFormFieldActionDirective, isStandalone: true, selector: "[idsFormFieldAction]", ngImport: i0 }); }
174
+ }
175
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsFormFieldActionDirective, decorators: [{
176
+ type: Directive,
177
+ args: [{
178
+ selector: '[idsFormFieldAction]',
179
+ standalone: true,
180
+ }]
181
+ }] });
182
+
183
+ class IdsPrefixDirective {
184
+ constructor() {
185
+ this.isLeadingIcon = false;
186
+ }
187
+ set idsLeadingIcon(value) {
188
+ this.isLeadingIcon = true;
189
+ }
190
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsPrefixDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
191
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.2", type: IdsPrefixDirective, isStandalone: true, selector: "[idsPrefix], [idsLeadingIcon]", inputs: { idsLeadingIcon: "idsLeadingIcon" }, ngImport: i0 }); }
192
+ }
193
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsPrefixDirective, decorators: [{
194
+ type: Directive,
195
+ args: [{
196
+ selector: '[idsPrefix], [idsLeadingIcon]',
197
+ standalone: true,
198
+ }]
199
+ }], propDecorators: { idsLeadingIcon: [{
200
+ type: Input,
201
+ args: ['idsLeadingIcon']
202
+ }] } });
203
+
204
+ class IdsSuffixDirective {
205
+ constructor() {
206
+ this.isTrailingIcon = false;
207
+ }
208
+ set idsTrailingIcon(value) {
209
+ this.isTrailingIcon = true;
210
+ }
211
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsSuffixDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
212
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.2", type: IdsSuffixDirective, isStandalone: true, selector: "[idsSuffix], [idsTrailingIcon]", inputs: { idsTrailingIcon: "idsTrailingIcon" }, ngImport: i0 }); }
213
+ }
214
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsSuffixDirective, decorators: [{
215
+ type: Directive,
216
+ args: [{
217
+ selector: '[idsSuffix], [idsTrailingIcon]',
218
+ standalone: true,
219
+ }]
220
+ }], propDecorators: { idsTrailingIcon: [{
221
+ type: Input,
222
+ args: ['idsTrailingIcon']
223
+ }] } });
224
+
225
+ function isEmptyInputValue(value) {
226
+ return (value == null || ((typeof value === 'string' || Array.isArray(value)) && value.length === 0));
227
+ }
228
+ class IdsValidators {
229
+ static required(control) {
230
+ return requiredValidator(control);
231
+ }
232
+ static requiredTrue(control) {
233
+ return requiredTrueValidator(control);
234
+ }
235
+ static requiredFalse(control) {
236
+ return requiredFalseValidator(control);
237
+ }
238
+ }
239
+ function requiredValidator(control) {
240
+ return isEmptyInputValue(control.value) ? { required: true } : null;
241
+ }
242
+ function requiredTrueValidator(control) {
243
+ return control.value === true ? null : { requiredTrue: true };
244
+ }
245
+ function requiredFalseValidator(control) {
246
+ return control.value === false ? null : { requiredFalse: true };
247
+ }
248
+
249
+ class IdsMessageSuffixDirective {
250
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsMessageSuffixDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
251
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.2", type: IdsMessageSuffixDirective, isStandalone: true, selector: "[idsMessageSuffix]", ngImport: i0 }); }
252
+ }
253
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsMessageSuffixDirective, decorators: [{
254
+ type: Directive,
255
+ args: [{
256
+ selector: '[idsMessageSuffix]',
257
+ standalone: true,
258
+ }]
259
+ }] });
260
+
261
+ const IdsMessageVariant = {
262
+ SURFACE: 'surface',
263
+ LIGHT: 'light',
264
+ DARK: 'dark',
265
+ };
266
+
267
+ const IDS_MESSAGE_DEFAULT_CONFIG = new InjectionToken('IDS_MESSAGE_DEFAULT_CONFIG', {
268
+ providedIn: 'root',
269
+ factory: IDS_MESSAGE_DEFAULT_CONFIG_FACTORY,
270
+ });
271
+ function IDS_MESSAGE_DEFAULT_CONFIG_FACTORY() {
272
+ return {
273
+ size: IdsSize.COMPACT,
274
+ variant: IdsMessageVariant.SURFACE,
275
+ };
276
+ }
277
+
278
+ // eslint-disable-next-line @typescript-eslint/naming-convention
279
+ const IDS_MESSAGE_PARENT_FORM_FIELD = new InjectionToken('IDS_MESSAGE_PARENT_FORM_FIELD');
280
+
281
+ const defaultConfig$2 = IDS_MESSAGE_DEFAULT_CONFIG_FACTORY();
282
+ class IdsMessageDirective extends ComponentBaseWithDefaults {
283
+ constructor() {
284
+ super(...arguments);
285
+ this._parent = inject(IDS_MESSAGE_PARENT_FORM_FIELD, { skipSelf: true, optional: true });
286
+ this._defaultConfig = this._getDefaultConfig(defaultConfig$2, IDS_MESSAGE_DEFAULT_CONFIG);
287
+ this.size = input(this._defaultConfig.size);
288
+ this.variant = input(this._defaultConfig.variant);
289
+ this._parentOrSelfSize = computed(() => this._parent?.size() ?? this.size());
290
+ this._parentOrSelfVariant = computed(() => this._parent?.variant() ?? this.variant());
291
+ this._parentDisabled = computed(() => this._parent?.disabled());
292
+ this._hostClasses = computed(() => this._getHostClasses([
293
+ this._parentOrSelfSize(),
294
+ this._parentOrSelfVariant(),
295
+ this._parentDisabled() ? 'disabled' : null,
296
+ ]));
297
+ }
298
+ get _hostName() {
299
+ return 'message';
300
+ }
301
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsMessageDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
302
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.2", type: IdsMessageDirective, isStandalone: true, selector: "[idsMessage]", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0 }); }
303
+ }
304
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsMessageDirective, decorators: [{
305
+ type: Directive,
306
+ args: [{
307
+ selector: '[idsMessage]',
308
+ standalone: true,
309
+ }]
310
+ }] });
311
+
312
+ class IdsErrorMessageComponent extends ComponentBase {
313
+ constructor() {
314
+ super(...arguments);
315
+ this._injector = inject(Injector);
316
+ this._errors = signal(null);
317
+ this._hostClasses = computed(() => this._getHostClasses([]));
318
+ this.suffixes = contentChildren(IdsMessageSuffixDirective);
319
+ }
320
+ get _hostName() {
321
+ return 'error-message';
322
+ }
323
+ ngOnInit() {
324
+ const parent = this._injector.get(IdsFormFieldComponent, null, { skipSelf: true, optional: true });
325
+ if (parent) {
326
+ const control = parent.control();
327
+ control?.statusChanges?.pipe(startWith(control.errors), takeUntilDestroyed(this._destroyRef)).subscribe(() => {
328
+ this._errors.set(control.errors);
329
+ });
330
+ }
331
+ }
332
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsErrorMessageComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
333
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.2", type: IdsErrorMessageComponent, isStandalone: true, selector: "ids-error-message", queries: [{ propertyName: "suffixes", predicate: IdsMessageSuffixDirective, isSignal: true }], usesInheritance: true, hostDirectives: [{ directive: IdsMessageDirective }], ngImport: i0, template: "<div class=\"ids-message__prefix\">\n <ng-content select=\"[idsMessagePrefix]\">\n <ids-icon aria-hidden=\"true\" fontIcon=\"exclamation-circle\" />\n </ng-content>\n</div>\n<div class=\"ids-message__text\">\n <ng-content />\n</div>\n@if (suffixes().length) {\n <div class=\"ids-message__suffix\">\n <ng-content select=\"[idsMessageSuffix]\" />\n </div>\n}\n", dependencies: [{ kind: "component", type: IdsIconComponent, selector: "ids-icon", inputs: ["size", "sizeCollection", "variant", "fontIcon", "svgIcon", "aria-hidden"] }], encapsulation: i0.ViewEncapsulation.None }); }
334
+ }
335
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsErrorMessageComponent, decorators: [{
336
+ type: Component,
337
+ args: [{ selector: 'ids-error-message', imports: [IdsIconComponent], hostDirectives: [IdsMessageDirective], encapsulation: ViewEncapsulation.None, template: "<div class=\"ids-message__prefix\">\n <ng-content select=\"[idsMessagePrefix]\">\n <ids-icon aria-hidden=\"true\" fontIcon=\"exclamation-circle\" />\n </ng-content>\n</div>\n<div class=\"ids-message__text\">\n <ng-content />\n</div>\n@if (suffixes().length) {\n <div class=\"ids-message__suffix\">\n <ng-content select=\"[idsMessageSuffix]\" />\n </div>\n}\n" }]
338
+ }] });
339
+
340
+ class IdsMessagePrefixDirective {
341
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsMessagePrefixDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
342
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.2", type: IdsMessagePrefixDirective, isStandalone: true, selector: "[idsMessagePrefix]", ngImport: i0 }); }
343
+ }
344
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsMessagePrefixDirective, decorators: [{
345
+ type: Directive,
346
+ args: [{
347
+ selector: '[idsMessagePrefix]',
348
+ standalone: true,
349
+ }]
350
+ }] });
351
+
352
+ class IdsHintMessageComponent {
353
+ constructor() {
354
+ this.prefixes = contentChildren(IdsMessagePrefixDirective);
355
+ this.suffixes = contentChildren(IdsMessageSuffixDirective);
356
+ }
357
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsHintMessageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
358
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.2", type: IdsHintMessageComponent, isStandalone: true, selector: "ids-hint-message", host: { classAttribute: "ids-hint-message" }, queries: [{ propertyName: "prefixes", predicate: IdsMessagePrefixDirective, isSignal: true }, { propertyName: "suffixes", predicate: IdsMessageSuffixDirective, isSignal: true }], hostDirectives: [{ directive: IdsMessageDirective, inputs: ["size", "size", "variant", "variant"] }], ngImport: i0, template: "@if (prefixes().length) {\n <div class=\"ids-message__prefix\">\n <ng-content select=\"[idsMessagePrefix]\" />\n </div>\n}\n<div class=\"ids-message__text\">\n <ng-content />\n</div>\n@if (suffixes().length) {\n <div class=\"ids-message__suffix\">\n <ng-content select=\"[idsMessageSuffix]\" />\n </div>\n}\n", encapsulation: i0.ViewEncapsulation.None }); }
359
+ }
360
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsHintMessageComponent, decorators: [{
361
+ type: Component,
362
+ args: [{ selector: 'ids-hint-message', imports: [], host: {
363
+ class: 'ids-hint-message',
364
+ }, hostDirectives: [
365
+ {
366
+ directive: IdsMessageDirective,
367
+ inputs: [
368
+ 'size: size',
369
+ 'variant: variant',
370
+ ],
371
+ },
372
+ ], encapsulation: ViewEncapsulation.None, template: "@if (prefixes().length) {\n <div class=\"ids-message__prefix\">\n <ng-content select=\"[idsMessagePrefix]\" />\n </div>\n}\n<div class=\"ids-message__text\">\n <ng-content />\n</div>\n@if (suffixes().length) {\n <div class=\"ids-message__suffix\">\n <ng-content select=\"[idsMessageSuffix]\" />\n </div>\n}\n" }]
373
+ }] });
374
+
375
+ class IdsSuccessMessageComponent extends ComponentBase {
376
+ constructor() {
377
+ super(...arguments);
378
+ this._hostClasses = computed(() => this._getHostClasses([]));
379
+ this.suffixes = contentChildren(IdsMessageSuffixDirective);
380
+ }
381
+ get _hostName() {
382
+ return 'success-message';
383
+ }
384
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsSuccessMessageComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
385
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.2", type: IdsSuccessMessageComponent, isStandalone: true, selector: "ids-success-message", queries: [{ propertyName: "suffixes", predicate: IdsMessageSuffixDirective, isSignal: true }], usesInheritance: true, hostDirectives: [{ directive: IdsMessageDirective }], ngImport: i0, template: "<div class=\"ids-message__prefix\">\n <ng-content select=\"[idsMessagePrefix]\">\n <ids-icon aria-hidden=\"true\" fontIcon=\"check\" />\n </ng-content>\n</div>\n<div class=\"ids-message__text\">\n <ng-content />\n</div>\n@if (suffixes().length) {\n <div class=\"ids-message__suffix\">\n <ng-content select=\"[idsMessageSuffix]\" />\n </div>\n}\n", dependencies: [{ kind: "component", type: IdsIconComponent, selector: "ids-icon", inputs: ["size", "sizeCollection", "variant", "fontIcon", "svgIcon", "aria-hidden"] }], encapsulation: i0.ViewEncapsulation.None }); }
386
+ }
387
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsSuccessMessageComponent, decorators: [{
388
+ type: Component,
389
+ args: [{ selector: 'ids-success-message', imports: [IdsIconComponent], hostDirectives: [IdsMessageDirective], encapsulation: ViewEncapsulation.None, template: "<div class=\"ids-message__prefix\">\n <ng-content select=\"[idsMessagePrefix]\">\n <ids-icon aria-hidden=\"true\" fontIcon=\"check\" />\n </ng-content>\n</div>\n<div class=\"ids-message__text\">\n <ng-content />\n</div>\n@if (suffixes().length) {\n <div class=\"ids-message__suffix\">\n <ng-content select=\"[idsMessageSuffix]\" />\n </div>\n}\n" }]
390
+ }] });
391
+
392
+ const defaultConfig$1 = IDS_FORM_FIELD_DEFAULT_CONFIG_FACTORY();
393
+ class IdsFormFieldComponent extends ComponentBaseWithDefaults {
394
+ constructor() {
395
+ super(...arguments);
396
+ this._changeDetectorRef = inject(ChangeDetectorRef);
397
+ this._parentFieldset = inject(IdsFieldsetComponent, { optional: true });
398
+ this._defaultConfig = this._getDefaultConfig(defaultConfig$1, IDS_FORM_FIELD_DEFAULT_CONFIG);
399
+ this._fieldWrapper = viewChild.required('fieldWrapper');
400
+ this._child = contentChild(IDS_FORM_FIELD_CONTROL);
401
+ this._hintMessages = contentChildren(IdsHintMessageComponent, { descendants: true });
402
+ this._successMessages = contentChildren(IdsSuccessMessageComponent, { descendants: true });
403
+ this._errorMessages = contentChildren(IdsErrorMessageComponent, { descendants: true });
404
+ this._actions = contentChildren(IdsFormFieldActionDirective);
405
+ this._prefixes = contentChildren(IdsPrefixDirective);
406
+ this._suffixes = contentChildren(IdsSuffixDirective);
407
+ this.hasActions = computed(() => Boolean(this._actions().length));
408
+ this.hasLeadingIcon = computed(() => Boolean(this._prefixes().filter((prefix) => prefix.isLeadingIcon).length));
409
+ this.hasPrefix = computed(() => Boolean(this._prefixes().filter((prefix) => !prefix.isLeadingIcon).length));
410
+ this.hasSuffix = computed(() => Boolean(this._suffixes().filter((suffix) => !suffix.isTrailingIcon).length));
411
+ this.hasTrailingIcon = computed(() => Boolean(this._suffixes().filter((suffix) => suffix.isTrailingIcon).length));
412
+ this.inputId = computed(() => this._child()?.id());
413
+ this.size = input(this._defaultConfig.size);
414
+ this.variant = input(this._defaultConfig.variant);
415
+ this.parentOrSelfSize = computed(() => this._parentFieldset?.size() ?? this.size());
416
+ this.parentOrSelfVariant = computed(() => this._parentFieldset?.variant() ?? this.variant());
417
+ this.control = computed(() => this._child()?.ngControl);
418
+ this.disabled = computed(() => Boolean(this._child()?.disabled()));
419
+ this._hasErrorState = computed(() => Boolean(this._child()?.hasErrorState()));
420
+ this._hasSuccessState = computed(() => Boolean(this._child()?.hasSuccessState()));
421
+ this._hostClasses = computed(() => this._getHostClasses([
422
+ this.parentOrSelfSize(),
423
+ this.parentOrSelfVariant(),
424
+ this.disabled() ? 'disabled' : null,
425
+ this._hasErrorState() ? 'invalid' : null,
426
+ this._hasSuccessState() ? 'valid' : null,
427
+ ]));
428
+ this.displayedMessages = computed(() => {
429
+ if (this._errorMessages().length > 0 && this._hasErrorState()) {
430
+ return 'error';
431
+ }
432
+ if (this._successMessages().length > 0 && this._hasSuccessState()) {
433
+ return 'success';
434
+ }
435
+ if (this._hintMessages().length > 0) {
436
+ return 'hint';
437
+ }
438
+ return undefined;
439
+ });
440
+ }
441
+ get _hostName() {
442
+ return 'form-field';
443
+ }
444
+ ngAfterContentInit() {
445
+ if (isDevMode() && !this._child()) {
446
+ throw this._createHostError('no form element was provided');
447
+ }
448
+ this._child()?.ngControl?.statusChanges?.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(() => {
449
+ this._changeDetectorRef.markForCheck();
450
+ });
451
+ }
452
+ get hasRequiredValidator() {
453
+ const control = this.control()?.control;
454
+ if (!control) {
455
+ return Boolean(this._child()?.required());
456
+ }
457
+ return control.hasValidator(Validators.required)
458
+ || control.hasValidator(Validators.requiredTrue)
459
+ || control.hasValidator(IdsValidators.required)
460
+ || control.hasValidator(IdsValidators.requiredTrue)
461
+ || control.hasValidator(IdsValidators.requiredFalse);
462
+ }
463
+ getConnectedOverlayOrigin() {
464
+ return this._fieldWrapper();
465
+ }
466
+ containerClick(event) {
467
+ const containerClick = this._child()?.onContainerClick;
468
+ if (containerClick) {
469
+ containerClick(event);
470
+ }
471
+ }
472
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsFormFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
473
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.2", type: IdsFormFieldComponent, isStandalone: true, selector: "ids-form-field", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "_child", first: true, predicate: IDS_FORM_FIELD_CONTROL, descendants: true, isSignal: true }, { propertyName: "_hintMessages", predicate: IdsHintMessageComponent, descendants: true, isSignal: true }, { propertyName: "_successMessages", predicate: IdsSuccessMessageComponent, descendants: true, isSignal: true }, { propertyName: "_errorMessages", predicate: IdsErrorMessageComponent, descendants: true, isSignal: true }, { propertyName: "_actions", predicate: IdsFormFieldActionDirective, isSignal: true }, { propertyName: "_prefixes", predicate: IdsPrefixDirective, isSignal: true }, { propertyName: "_suffixes", predicate: IdsSuffixDirective, isSignal: true }], viewQueries: [{ propertyName: "_fieldWrapper", first: true, predicate: ["fieldWrapper"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<label class=\"ids-form-field__label\" [for]=\"inputId()\">\n <ng-content select=\"ids-label\" />\n @if (hasRequiredValidator) {\n <span class=\"ids-form-field__required-marker\"></span>\n }\n</label>\n\n<div #fieldWrapper class=\"ids-form-field__field-wrapper\">\n <div class=\"ids-form-field__field-wrapper__container\" (click)=\"containerClick($event)\">\n @if (hasLeadingIcon()) {\n <div class=\"ids-form-field__leading-icon\">\n <ng-content select=\"ids-icon[idsLeadingIcon]\" />\n </div>\n }\n @if (hasPrefix()) {\n <div class=\"ids-form-field__prefix\">\n <ng-content select=\"[idsPrefix]\" />\n </div>\n }\n <div class=\"ids-form-field__infix\">\n <ng-content />\n </div>\n @if (hasSuffix()) {\n <div class=\"ids-form-field__suffix\">\n <ng-content select=\"[idsSuffix]\" />\n </div>\n }\n @if (hasTrailingIcon()) {\n <div class=\"ids-form-field__trailing-icon\">\n <ng-content select=\"ids-icon[idsTrailingIcon]\" />\n </div>\n }\n </div>\n @if (hasActions()) {\n <div class=\"ids-form-field__field-wrapper__action\">\n <ng-content select=\"[idsFormFieldAction]\" />\n </div>\n }\n</div>\n\n<div class=\"ids-form-field__subscript-wrapper\">\n @let messages = displayedMessages();\n @if (messages) {\n <div class=\"ids-form-field__message-container\">\n @switch (messages) {\n @case (\"error\") {\n <ng-content select=\"ids-error-message\" />\n }\n @case (\"success\") {\n <ng-content select=\"ids-success-message\" />\n }\n @case (\"hint\") {\n <ng-content select=\"ids-hint-message\" />\n }\n }\n </div>\n }\n</div>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
474
+ }
475
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsFormFieldComponent, decorators: [{
476
+ type: Component,
477
+ args: [{ selector: 'ids-form-field', imports: [], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<label class=\"ids-form-field__label\" [for]=\"inputId()\">\n <ng-content select=\"ids-label\" />\n @if (hasRequiredValidator) {\n <span class=\"ids-form-field__required-marker\"></span>\n }\n</label>\n\n<div #fieldWrapper class=\"ids-form-field__field-wrapper\">\n <div class=\"ids-form-field__field-wrapper__container\" (click)=\"containerClick($event)\">\n @if (hasLeadingIcon()) {\n <div class=\"ids-form-field__leading-icon\">\n <ng-content select=\"ids-icon[idsLeadingIcon]\" />\n </div>\n }\n @if (hasPrefix()) {\n <div class=\"ids-form-field__prefix\">\n <ng-content select=\"[idsPrefix]\" />\n </div>\n }\n <div class=\"ids-form-field__infix\">\n <ng-content />\n </div>\n @if (hasSuffix()) {\n <div class=\"ids-form-field__suffix\">\n <ng-content select=\"[idsSuffix]\" />\n </div>\n }\n @if (hasTrailingIcon()) {\n <div class=\"ids-form-field__trailing-icon\">\n <ng-content select=\"ids-icon[idsTrailingIcon]\" />\n </div>\n }\n </div>\n @if (hasActions()) {\n <div class=\"ids-form-field__field-wrapper__action\">\n <ng-content select=\"[idsFormFieldAction]\" />\n </div>\n }\n</div>\n\n<div class=\"ids-form-field__subscript-wrapper\">\n @let messages = displayedMessages();\n @if (messages) {\n <div class=\"ids-form-field__message-container\">\n @switch (messages) {\n @case (\"error\") {\n <ng-content select=\"ids-error-message\" />\n }\n @case (\"success\") {\n <ng-content select=\"ids-success-message\" />\n }\n @case (\"hint\") {\n <ng-content select=\"ids-hint-message\" />\n }\n }\n </div>\n }\n</div>\n" }]
478
+ }] });
479
+
480
+ const IDS_INPUT_DEFAULT_CONFIG = new InjectionToken('IDS_INPUT_DEFAULT_CONFIG', {
481
+ providedIn: 'root',
482
+ factory: IDS_INPUT_DEFAULT_CONFIG_FACTORY,
483
+ });
484
+ function IDS_INPUT_DEFAULT_CONFIG_FACTORY() {
485
+ return {
486
+ errorStateMatcher: ErrorStateMatcher,
487
+ successStateMatcher: SuccessStateMatcher,
488
+ };
489
+ }
490
+
491
+ const defaultConfig = IDS_INPUT_DEFAULT_CONFIG_FACTORY();
492
+ const IDS_INPUT_INVALID_TYPES = [
493
+ 'button',
494
+ 'checkbox',
495
+ 'file',
496
+ 'hidden',
497
+ 'image',
498
+ 'radio',
499
+ 'range',
500
+ 'reset',
501
+ 'submit',
502
+ ];
503
+ class IdsInputDirective extends ComponentBaseWithDefaults {
504
+ constructor() {
505
+ super(...arguments);
506
+ this._elementRef = inject(ElementRef);
507
+ this._parentFormGroup = inject(FormGroupDirective, { optional: true });
508
+ this._parentForm = inject(NgForm, { optional: true });
509
+ this._defaultConfig = this._getDefaultConfig(defaultConfig, IDS_INPUT_DEFAULT_CONFIG);
510
+ this.errorStateChanges = new Subject();
511
+ this.successStateChanges = new Subject();
512
+ this.ngControl = inject(NgControl, { optional: true });
513
+ this._focused = false;
514
+ this.placeholder = input('');
515
+ this.name = input();
516
+ this.type = input('text');
517
+ this.required = input(false, { transform: coerceBooleanAttribute });
518
+ this.readonly = input(false, { transform: coerceBooleanAttribute });
519
+ this.disabled = input(false, { transform: coerceBooleanAttribute });
520
+ this._controlDisabled = signal(false);
521
+ this.isDisabled = computed(() => this.disabled() || this._controlDisabled());
522
+ this.canHandleSuccessState = input(false);
523
+ this.errorStateMatcher = input(inject(this._defaultConfig.errorStateMatcher));
524
+ this.successStateMatcher = input(inject(this._defaultConfig.successStateMatcher));
525
+ this._hostClasses = computed(() => this._getHostClasses([], [formFieldControlClass]));
526
+ this.hasErrorState = signal(false);
527
+ this.hasSuccessState = signal(false);
528
+ this._validateTypeEffect = effect(() => {
529
+ this._validateType(this.type());
530
+ });
531
+ this._canHandleSuccessStateEffect = effect(() => {
532
+ this._setSuccessStateTracker(this.canHandleSuccessState());
533
+ });
534
+ /**
535
+ * Should be an arrow function in order to handle `this` outside of this class
536
+ */
537
+ this.onContainerClick = () => {
538
+ if (!this._focused && !this.readonly() && !this.isDisabled()) {
539
+ this.focus();
540
+ }
541
+ };
542
+ }
543
+ get _hostName() {
544
+ return 'input';
545
+ }
546
+ setDescribedByIds(ids) {
547
+ if (ids.length) {
548
+ this._elementRef.nativeElement.setAttribute('aria-describedby', ids.join(' '));
549
+ }
550
+ else {
551
+ this._elementRef.nativeElement.removeAttribute('aria-describedby');
552
+ }
553
+ }
554
+ ngOnInit() {
555
+ this._initErrorStateTracker();
556
+ }
557
+ _initErrorStateTracker() {
558
+ this._errorStateTracker = new ErrorStateTracker(this.errorStateMatcher(), this.ngControl, this._parentFormGroup, this._parentForm, this.errorStateChanges);
559
+ this._successStateSubscription = this.errorStateChanges.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(() => this.hasErrorState.set(this._errorStateTracker.hasErrorState));
560
+ }
561
+ _setSuccessStateTracker(canHandleSuccessState) {
562
+ if (canHandleSuccessState) {
563
+ this._successStateTracker = new SuccessStateTracker(this.successStateMatcher(), this.ngControl, this._parentFormGroup, this._parentForm, this.successStateChanges);
564
+ this.successStateChanges.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(() => this.hasSuccessState.set(this._successStateTracker.hasSuccessState));
565
+ }
566
+ else {
567
+ this._successStateTracker = undefined;
568
+ this._successStateSubscription?.unsubscribe();
569
+ }
570
+ }
571
+ ngDoCheck() {
572
+ if (this.ngControl) {
573
+ this.updateErrorAndSuccessState();
574
+ if (this.ngControl.disabled !== null && this.ngControl.disabled !== this.disabled()) {
575
+ this._controlDisabled.set(this.ngControl.disabled);
576
+ }
577
+ }
578
+ }
579
+ _validateType(type) {
580
+ if (isDevMode() && IDS_INPUT_INVALID_TYPES.indexOf(type) > -1) {
581
+ throw this._createHostError(`Input type ${type} is not supportedby idsInput`);
582
+ }
583
+ }
584
+ focus(options) {
585
+ this._elementRef.nativeElement.focus(options);
586
+ }
587
+ _focusChanged(isFocused) {
588
+ if (isFocused !== this._focused) {
589
+ this._focused = isFocused;
590
+ }
591
+ }
592
+ updateErrorAndSuccessState() {
593
+ this._errorStateTracker?.updateErrorState();
594
+ this._successStateTracker?.updateSuccessState();
595
+ }
596
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsInputDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
597
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.2", type: IdsInputDirective, isStandalone: true, selector: "input[idsInput][ngModel]:not([formControl]):not([formControlName]),\n input[idsInput][formControl]:not([ngModel]):not([formControlName]),\n input[idsInput][formControlName]:not([ngModel]):not([formControl]),\n textarea[idsInput][ngModel]:not([formControl]):not([formControlName]),\n textarea[idsInput][formControl]:not([ngModel]):not([formControlName]),\n textarea[idsInput][formControlName]:not([ngModel]):not([formControl])", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, canHandleSuccessState: { classPropertyName: "canHandleSuccessState", publicName: "canHandleSuccessState", isSignal: true, isRequired: false, transformFunction: null }, errorStateMatcher: { classPropertyName: "errorStateMatcher", publicName: "errorStateMatcher", isSignal: true, isRequired: false, transformFunction: null }, successStateMatcher: { classPropertyName: "successStateMatcher", publicName: "successStateMatcher", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "focus": "_focusChanged(true)", "blur": "_focusChanged(false)" }, properties: { "attr.placeholder": "placeholder()", "attr.disabled": "isDisabled() ? \"\" : null", "attr.readonly": "readonly() ? \"\" : null" } }, providers: [
598
+ {
599
+ provide: IDS_FORM_FIELD_CONTROL,
600
+ useExisting: IdsInputDirective,
601
+ },
602
+ ], exportAs: ["idsInput"], usesInheritance: true, ngImport: i0 }); }
603
+ }
604
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsInputDirective, decorators: [{
605
+ type: Directive,
606
+ args: [{
607
+ selector: `input[idsInput][ngModel]:not([formControl]):not([formControlName]),
608
+ input[idsInput][formControl]:not([ngModel]):not([formControlName]),
609
+ input[idsInput][formControlName]:not([ngModel]):not([formControl]),
610
+ textarea[idsInput][ngModel]:not([formControl]):not([formControlName]),
611
+ textarea[idsInput][formControl]:not([ngModel]):not([formControlName]),
612
+ textarea[idsInput][formControlName]:not([ngModel]):not([formControl])`,
613
+ exportAs: 'idsInput',
614
+ standalone: true,
615
+ providers: [
616
+ {
617
+ provide: IDS_FORM_FIELD_CONTROL,
618
+ useExisting: IdsInputDirective,
619
+ },
620
+ ],
621
+ host: {
622
+ '[attr.placeholder]': 'placeholder()',
623
+ '[attr.disabled]': 'isDisabled() ? "" : null',
624
+ '[attr.readonly]': 'readonly() ? "" : null',
625
+ '(focus)': '_focusChanged(true)',
626
+ '(blur)': '_focusChanged(false)',
627
+ },
628
+ }]
629
+ }] });
630
+
631
+ const Message = {
632
+ HINT: 'hint',
633
+ ERROR: 'error',
634
+ SUCCESS: 'success',
635
+ };
636
+
637
+ const IDS_OPTION_GROUP = new InjectionToken('IdsOptionGroup');
638
+
639
+ const IDS_OPTION_PARENT_COMPONENT = new InjectionToken('IDS_OPTION_PARENT_COMPONENT');
640
+
641
+ class IdsOptionSelectionChange {
642
+ constructor(source, selected, isUserInput = false) {
643
+ this.source = source;
644
+ this.selected = selected;
645
+ this.isUserInput = isUserInput;
646
+ }
647
+ }
648
+
649
+ class IdsOptionGroupComponent extends ComponentBase {
650
+ constructor() {
651
+ super(...arguments);
652
+ this._parent = inject(IDS_OPTION_PARENT_COMPONENT);
653
+ this._inert = this._parent?.inertGroups ?? false;
654
+ this.label = input();
655
+ this.disabled = input(false, { transform: coerceBooleanAttribute });
656
+ this._labelId = computed(() => `${this.id()}-label`);
657
+ this._hostClasses = computed(() => this._getHostClasses([
658
+ this.disabled() ? 'disabled' : null,
659
+ this._parent.parentSize(),
660
+ this._parent.parentVariant(),
661
+ ]));
662
+ }
663
+ get _hostName() {
664
+ return 'option-group';
665
+ }
666
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsOptionGroupComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
667
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.1.2", type: IdsOptionGroupComponent, isStandalone: true, selector: "ids-option-group", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.role": "_inert ? null : \"group\"", "attr.aria-disabled": "_inert ? null : disabled().toString()", "attr.aria-labelledby": "_inert ? null : _labelId()" } }, providers: [{ provide: IDS_OPTION_GROUP, useExisting: IdsOptionGroupComponent }], usesInheritance: true, ngImport: i0, template: "<div role=\"presentation\" class=\"ids-option-group__label\" [id]=\"_labelId()\">\n <div class=\"ids-option-group__text\">{{ label() }}</div>\n</div>\n<ng-content select=\"ids-option, ng-container\" />\n", changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
668
+ }
669
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsOptionGroupComponent, decorators: [{
670
+ type: Component,
671
+ args: [{ selector: 'ids-option-group', imports: [], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [{ provide: IDS_OPTION_GROUP, useExisting: IdsOptionGroupComponent }], host: {
672
+ '[attr.role]': '_inert ? null : "group"',
673
+ '[attr.aria-disabled]': '_inert ? null : disabled().toString()',
674
+ '[attr.aria-labelledby]': '_inert ? null : _labelId()',
675
+ }, template: "<div role=\"presentation\" class=\"ids-option-group__label\" [id]=\"_labelId()\">\n <div class=\"ids-option-group__text\">{{ label() }}</div>\n</div>\n<ng-content select=\"ids-option, ng-container\" />\n" }]
676
+ }] });
677
+
678
+ const IDS_PSEUDO_CHECKBOX_PARENT = new InjectionToken('IDS_PSEUDO_CHECKBOX_PARENT');
679
+
680
+ const IdsPseudoCheckboxState = {
681
+ UNCHECKED: 'unchecked',
682
+ CHECKED: 'checked',
683
+ INDETERMINATE: 'indeterminate',
684
+ };
685
+
686
+ class PseudoCheckboxComponent extends ComponentBase {
687
+ constructor() {
688
+ super(...arguments);
689
+ this._parent = inject(IDS_PSEUDO_CHECKBOX_PARENT, { optional: true });
690
+ this.checkboxState = input(IdsPseudoCheckboxState.UNCHECKED);
691
+ this.disabled = input(false, { transform: coerceBooleanAttribute });
692
+ this._isChecked = computed(() => this.checkboxState() === IdsPseudoCheckboxState.CHECKED);
693
+ this._isIndeterminate = computed(() => this.checkboxState() === IdsPseudoCheckboxState.INDETERMINATE);
694
+ this._hostClasses = computed(() => this._getHostClasses([
695
+ this._parent?.embeddedPseudoCheckboxSize(),
696
+ this._parent?.embeddedPseudoCheckboxVariant(),
697
+ this.disabled() ? 'disabled' : null,
698
+ ]));
699
+ }
700
+ get _hostName() {
701
+ return 'pseudo-checkbox';
702
+ }
703
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: PseudoCheckboxComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
704
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.2", type: PseudoCheckboxComponent, isStandalone: true, selector: "ids-pseudo-checkbox", inputs: { checkboxState: { classPropertyName: "checkboxState", publicName: "checkboxState", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: "<div class=\"ids-pseudo-checkbox__input-wrapper\">\n <input\n type=\"checkbox\"\n [disabled]=\"disabled()\"\n [attr.aria-checked]=\"_isIndeterminate() ? 'mixed' : null\"\n [checked]=\"_isChecked()\"\n [indeterminate]=\"_isIndeterminate()\"\n (change)=\"$event.stopPropagation()\"\n />\n <div class=\"ids-pseudo-checkbox__icon\" aria-hidden=\"true\">\n @if (_isIndeterminate()) {\n <ids-icon fontIcon=\"minus\" aria-hidden=\"true\" />\n }\n @if (_isChecked()) {\n <ids-icon fontIcon=\"check\" aria-hidden=\"true\" />\n }\n </div>\n</div>\n", dependencies: [{ kind: "component", type: IdsIconComponent, selector: "ids-icon", inputs: ["size", "sizeCollection", "variant", "fontIcon", "svgIcon", "aria-hidden"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
705
+ }
706
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: PseudoCheckboxComponent, decorators: [{
707
+ type: Component,
708
+ args: [{ selector: 'ids-pseudo-checkbox', imports: [IdsIconComponent], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"ids-pseudo-checkbox__input-wrapper\">\n <input\n type=\"checkbox\"\n [disabled]=\"disabled()\"\n [attr.aria-checked]=\"_isIndeterminate() ? 'mixed' : null\"\n [checked]=\"_isChecked()\"\n [indeterminate]=\"_isIndeterminate()\"\n (change)=\"$event.stopPropagation()\"\n />\n <div class=\"ids-pseudo-checkbox__icon\" aria-hidden=\"true\">\n @if (_isIndeterminate()) {\n <ids-icon fontIcon=\"minus\" aria-hidden=\"true\" />\n }\n @if (_isChecked()) {\n <ids-icon fontIcon=\"check\" aria-hidden=\"true\" />\n }\n </div>\n</div>\n" }]
709
+ }] });
710
+
711
+ class IdsOptionComponent extends ComponentBase {
712
+ get _hostName() {
713
+ return 'option';
714
+ }
715
+ constructor() {
716
+ super();
717
+ this._parent = inject(IDS_OPTION_PARENT_COMPONENT);
718
+ this._element = inject(ElementRef);
719
+ this.group = inject(IDS_OPTION_GROUP, { optional: true });
720
+ this._textElement = viewChild.required('text');
721
+ this.selected = signal(false);
722
+ this._active = signal(false);
723
+ this.size = computed(() => this._parent.parentSize());
724
+ this.variant = computed(() => this._parent.parentVariant());
725
+ this.value = input();
726
+ this.explicitViewValue = input(null, { alias: 'viewValue' });
727
+ this.disabledInput = input(false, { alias: 'disabled', transform: coerceBooleanAttribute });
728
+ this.disabled = false; // Do not delete this class member, until ListKeyManagerOption requires: `disabled: boolean`
729
+ this._groupOrOptionIsDisabled = computed(() => this.group?.disabled() || this.disabledInput());
730
+ this._multiSelect = Boolean(this._parent?.multiSelect());
731
+ this.onSelectionChange = output();
732
+ this.viewValue = computed(() => this._textElement().nativeElement.textContent || this.explicitViewValue() || '');
733
+ this._hostClasses = computed(() => this._getHostClasses([
734
+ this.selected() ? 'selected' : null,
735
+ this._active() ? 'active' : null,
736
+ this._groupOrOptionIsDisabled() ? 'disabled' : null,
737
+ this._multiSelect ? 'multiselect' : null,
738
+ this.size(),
739
+ this.variant(),
740
+ ]));
741
+ this._pseudoCheckboxState = computed(() => (this.selected() ? IdsPseudoCheckboxState.CHECKED : IdsPseudoCheckboxState.UNCHECKED));
742
+ this.embeddedPseudoCheckboxSize = computed(() => this.size());
743
+ this.embeddedPseudoCheckboxVariant = signal(IdsFormFieldVariant.SURFACE);
744
+ effect(() => {
745
+ this.disabled = this.disabledInput();
746
+ });
747
+ }
748
+ ngOnInit() {
749
+ const parent = this._parent;
750
+ if (parent.isOptionPreSelectedByValue(this.value())) {
751
+ this.selected.set(true);
752
+ }
753
+ }
754
+ _handleKeydown(event) {
755
+ if ((event.key === 'ENTER' || event.key === ' ') && !hasModifierKey(event)) {
756
+ this.selectViaInteraction();
757
+ event.preventDefault();
758
+ }
759
+ }
760
+ selectViaInteraction() {
761
+ if (!this._groupOrOptionIsDisabled()) {
762
+ this._emitSelectionChangeEvent(!this.selected(), true);
763
+ }
764
+ }
765
+ getHostElement() {
766
+ return this._element.nativeElement;
767
+ }
768
+ select(emitEvent = true) {
769
+ if (!this.selected()) {
770
+ if (emitEvent) {
771
+ this._emitSelectionChangeEvent(true);
772
+ }
773
+ }
774
+ }
775
+ deselect(emitEvent = true) {
776
+ if (this.selected()) {
777
+ if (emitEvent) {
778
+ this._emitSelectionChangeEvent(false);
779
+ }
780
+ }
781
+ }
782
+ focus(_origin, options) {
783
+ const element = this._element.nativeElement;
784
+ if (typeof element.focus === 'function') {
785
+ element.focus(options);
786
+ }
787
+ }
788
+ setActiveStyles() {
789
+ if (!this._active()) {
790
+ this._active.set(true);
791
+ }
792
+ }
793
+ setInactiveStyles() {
794
+ if (this._active()) {
795
+ this._active.set(false);
796
+ }
797
+ }
798
+ getLabel() {
799
+ return this.viewValue();
800
+ }
801
+ _emitSelectionChangeEvent(selected, isUserInput = false) {
802
+ if (this._multiSelect || !this.selected()) {
803
+ this.onSelectionChange.emit(new IdsOptionSelectionChange(this, selected, isUserInput));
804
+ }
805
+ }
806
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsOptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
807
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.2", type: IdsOptionComponent, isStandalone: true, selector: "ids-option", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, explicitViewValue: { classPropertyName: "explicitViewValue", publicName: "viewValue", isSignal: true, isRequired: false, transformFunction: null }, disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onSelectionChange: "onSelectionChange" }, host: { attributes: { "role": "option" }, listeners: { "click": "selectViaInteraction()", "keydown": "_handleKeydown($event)" }, properties: { "attr.aria-selected": "selected()", "attr.aria-disabled": "disabled.toString()" } }, providers: [
808
+ {
809
+ provide: IDS_PSEUDO_CHECKBOX_PARENT,
810
+ useExisting: IdsOptionComponent,
811
+ },
812
+ ], viewQueries: [{ propertyName: "_textElement", first: true, predicate: ["text"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "@if (_multiSelect) {\n <ids-pseudo-checkbox aria-hidden=\"true\" [disabled]=\"_groupOrOptionIsDisabled()\" [checkboxState]=\"_pseudoCheckboxState()\" />\n}\n\n<div #text class=\"ids-option__text\"><ng-content /></div>\n\n@if (!_multiSelect && selected()) {\n <ids-icon fontIcon=\"check\" />\n}\n", dependencies: [{ kind: "component", type: IdsIconComponent, selector: "ids-icon", inputs: ["size", "sizeCollection", "variant", "fontIcon", "svgIcon", "aria-hidden"] }, { kind: "component", type: PseudoCheckboxComponent, selector: "ids-pseudo-checkbox", inputs: ["checkboxState", "disabled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
813
+ }
814
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsOptionComponent, decorators: [{
815
+ type: Component,
816
+ args: [{ selector: 'ids-option', imports: [
817
+ IdsIconComponent,
818
+ PseudoCheckboxComponent,
819
+ ], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
820
+ {
821
+ provide: IDS_PSEUDO_CHECKBOX_PARENT,
822
+ useExisting: IdsOptionComponent,
823
+ },
824
+ ], host: {
825
+ 'role': 'option',
826
+ '[attr.aria-selected]': 'selected()',
827
+ '[attr.aria-disabled]': 'disabled.toString()',
828
+ '(click)': 'selectViaInteraction()',
829
+ '(keydown)': '_handleKeydown($event)',
830
+ }, template: "@if (_multiSelect) {\n <ids-pseudo-checkbox aria-hidden=\"true\" [disabled]=\"_groupOrOptionIsDisabled()\" [checkboxState]=\"_pseudoCheckboxState()\" />\n}\n\n<div #text class=\"ids-option__text\"><ng-content /></div>\n\n@if (!_multiSelect && selected()) {\n <ids-icon fontIcon=\"check\" />\n}\n" }]
831
+ }], ctorParameters: () => [] });
832
+ function _countGroupLabelsBeforeOption(optionIndex, options, optionGroups) {
833
+ if (optionGroups.length) {
834
+ let groupCounter = 0;
835
+ for (let i = 0; i < optionIndex + 1; i++) {
836
+ if (options[i].group && options[i].group === optionGroups[groupCounter]) {
837
+ groupCounter++;
838
+ }
839
+ }
840
+ return groupCounter;
841
+ }
842
+ return 0;
843
+ }
844
+ function _getOptionScrollPosition(optionOffset, optionHeight, currentScrollPosition, panelHeight) {
845
+ if (optionOffset < currentScrollPosition) {
846
+ return optionOffset;
847
+ }
848
+ if (optionOffset + optionHeight > currentScrollPosition + panelHeight) {
849
+ return Math.max(0, optionOffset - panelHeight + optionHeight);
850
+ }
851
+ return currentScrollPosition;
852
+ }
853
+
854
+ class IdsLabelDirective {
855
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsLabelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
856
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.2", type: IdsLabelDirective, isStandalone: true, selector: "ids-label", ngImport: i0 }); }
857
+ }
858
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsLabelDirective, decorators: [{
859
+ type: Directive,
860
+ args: [{
861
+ selector: 'ids-label',
862
+ standalone: true,
863
+ }]
864
+ }] });
865
+
866
+ /**
867
+ * Generated bundle index. Do not edit.
868
+ */
869
+
870
+ export { AbstractErrorStateMatcher, AbstractSuccessStateMatcher, ErrorStateMatcher, ErrorStateTracker, IDS_FIELDSET_DEFAULT_CONFIG, IDS_FIELDSET_DEFAULT_CONFIG_FACTORY, IDS_FORM_FIELD_CONTROL, IDS_FORM_FIELD_DEFAULT_CONFIG, IDS_FORM_FIELD_DEFAULT_CONFIG_FACTORY, IDS_INPUT_DEFAULT_CONFIG, IDS_INPUT_DEFAULT_CONFIG_FACTORY, IDS_MESSAGE_DEFAULT_CONFIG, IDS_MESSAGE_DEFAULT_CONFIG_FACTORY, IDS_OPTION_GROUP, IDS_OPTION_PARENT_COMPONENT, IDS_PSEUDO_CHECKBOX_PARENT, IdsErrorMessageComponent, IdsFieldsetComponent, IdsFieldsetMessageDirective, IdsFieldsetRowComponent, IdsFormFieldActionDirective, IdsFormFieldComponent, IdsFormFieldControl, IdsFormFieldVariant, IdsHintMessageComponent, IdsInputDirective, IdsLabelDirective, IdsMessageDirective, IdsMessagePrefixDirective, IdsMessageSuffixDirective, IdsMessageVariant, IdsOptionComponent, IdsOptionGroupComponent, IdsOptionSelectionChange, IdsPrefixDirective, IdsPseudoCheckboxState, IdsSuccessMessageComponent, IdsSuffixDirective, IdsValidators, Message, PseudoCheckboxComponent, SuccessStateMatcher, SuccessStateTracker, _countGroupLabelsBeforeOption, _getOptionScrollPosition, formFieldControlClass, requiredFalseValidator, requiredTrueValidator, requiredValidator };
871
+ //# sourceMappingURL=i-cell-ids-angular-forms.mjs.map