@designsystem-se/af 38.2.0 → 38.2.1-beta.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 (178) hide show
  1. package/components/digi-form-select-filter.js +84 -47
  2. package/dist/cjs/digi-arbetsformedlingen.cjs.js +1 -1
  3. package/dist/cjs/digi-button_11.cjs.entry.js +1194 -0
  4. package/dist/cjs/digi-calendar-datepicker.cjs.entry.js +7 -7
  5. package/dist/cjs/digi-code-block_3.cjs.entry.js +6 -6
  6. package/dist/cjs/digi-dialog.cjs.entry.js +6 -6
  7. package/dist/cjs/digi-footer-card.cjs.entry.js +29 -0
  8. package/dist/cjs/digi-footer.cjs.entry.js +74 -0
  9. package/dist/cjs/digi-form-error-list.cjs.entry.js +6 -6
  10. package/dist/cjs/digi-form-file-upload.cjs.entry.js +9 -10
  11. package/dist/cjs/digi-form-input-search.cjs.entry.js +6 -7
  12. package/dist/cjs/digi-form-receipt.cjs.entry.js +6 -6
  13. package/dist/cjs/digi-header-avatar.cjs.entry.js +114 -0
  14. package/dist/cjs/digi-header-navigation-item.cjs.entry.js +27 -0
  15. package/dist/cjs/digi-header-navigation.cjs.entry.js +228 -0
  16. package/dist/cjs/digi-header-notification.cjs.entry.js +23 -0
  17. package/dist/cjs/digi-header.cjs.entry.js +115 -0
  18. package/dist/cjs/digi-icon-accessibility-universal.cjs.entry.js +30 -0
  19. package/dist/cjs/digi-icon-bars.cjs.entry.js +30 -0
  20. package/dist/cjs/digi-icon-bell-filled.cjs.entry.js +30 -0
  21. package/dist/cjs/digi-icon-envelope.cjs.entry.js +30 -0
  22. package/dist/cjs/{digi-link-external.cjs.entry.js → digi-icon-external-link-alt_2.cjs.entry.js} +24 -0
  23. package/dist/cjs/digi-icon-globe.cjs.entry.js +30 -0
  24. package/dist/cjs/digi-icon-sign.cjs.entry.js +30 -0
  25. package/dist/cjs/digi-icon-x.cjs.entry.js +30 -0
  26. package/dist/cjs/digi-layout-block_2.cjs.entry.js +92 -0
  27. package/dist/cjs/digi-link.cjs.entry.js +75 -0
  28. package/dist/cjs/digi-logo.cjs.entry.js +49 -0
  29. package/dist/cjs/digi-media-image_2.cjs.entry.js +167 -0
  30. package/dist/cjs/digi-navigation-pagination.cjs.entry.js +6 -6
  31. package/dist/cjs/digi-navigation-sidebar-button.cjs.entry.js +30 -0
  32. package/dist/cjs/digi-notification-alert.cjs.entry.js +6 -6
  33. package/dist/cjs/digi-notification-error-page.cjs.entry.js +6 -6
  34. package/dist/cjs/digi-title-logo.cjs.entry.js +133 -0
  35. package/dist/cjs/digi-tools-feedback.cjs.entry.js +6 -6
  36. package/dist/cjs/digi-typography.cjs.entry.js +26 -0
  37. package/dist/cjs/digi-util-breakpoint-observer.cjs.entry.js +48 -0
  38. package/dist/cjs/footer-card-variation.enum-99555edc.js +8 -0
  39. package/dist/cjs/{form-input-type.enum-9c8ee12a.js → form-input-type.enum-1fb2180a.js} +14 -0
  40. package/dist/cjs/{form-file-upload-variation.enum-634cfae8.js → form-validation-message-variation.enum-c5ec3e2d.js} +7 -0
  41. package/dist/cjs/index-7a477838.js +84 -20
  42. package/dist/cjs/index.cjs.js +73 -73
  43. package/dist/cjs/layout-container-max-width.enum-7e637f44.js +21 -0
  44. package/dist/cjs/loader.cjs.js +1 -1
  45. package/dist/cjs/logo-color.enum-76f6c506.js +7 -0
  46. package/dist/cjs/{typography-variation.enum-c0ef9190.js → typography-variation.enum-9aab5027.js} +28 -33
  47. package/dist/collection/components/_form/form-select-filter/form-select-filter.js +85 -48
  48. package/dist/digi-arbetsformedlingen/design-tokens/components/_logo.variables.scss +2 -0
  49. package/dist/digi-arbetsformedlingen/digi-arbetsformedlingen.esm.js +1 -1
  50. package/dist/digi-arbetsformedlingen/index.esm.js +1 -1
  51. package/dist/digi-arbetsformedlingen/{p-8833044b.entry.js → p-02731621.entry.js} +1 -1
  52. package/dist/digi-arbetsformedlingen/p-0ef5ec06.entry.js +1 -0
  53. package/dist/digi-arbetsformedlingen/p-10261517.entry.js +1 -0
  54. package/dist/digi-arbetsformedlingen/{p-97f66789.entry.js → p-25371300.entry.js} +1 -1
  55. package/dist/digi-arbetsformedlingen/p-2c685e4f.entry.js +1 -0
  56. package/dist/digi-arbetsformedlingen/p-300aa9ef.js +1 -0
  57. package/dist/digi-arbetsformedlingen/p-3887bb40.js +1 -0
  58. package/dist/digi-arbetsformedlingen/p-3efa2f0b.entry.js +1 -0
  59. package/dist/digi-arbetsformedlingen/p-47ab0b39.entry.js +1 -0
  60. package/dist/digi-arbetsformedlingen/p-4e9f2f05.entry.js +1 -0
  61. package/dist/digi-arbetsformedlingen/{p-ddd659bf.entry.js → p-655cda00.entry.js} +1 -1
  62. package/dist/digi-arbetsformedlingen/p-6abd8d58.entry.js +1 -0
  63. package/dist/digi-arbetsformedlingen/p-7e77bbe7.entry.js +1 -0
  64. package/dist/digi-arbetsformedlingen/p-7e85c9e3.entry.js +1 -0
  65. package/dist/digi-arbetsformedlingen/p-8713df13.entry.js +1 -0
  66. package/dist/digi-arbetsformedlingen/p-8d9f4f10.entry.js +1 -0
  67. package/dist/digi-arbetsformedlingen/p-8ef41ad9.entry.js +1 -0
  68. package/dist/digi-arbetsformedlingen/{p-18880083.entry.js → p-986a1582.entry.js} +1 -1
  69. package/dist/digi-arbetsformedlingen/p-9dd41cc4.js +1 -0
  70. package/dist/digi-arbetsformedlingen/p-a0c77dff.entry.js +1 -0
  71. package/dist/digi-arbetsformedlingen/p-a2008b0a.entry.js +1 -0
  72. package/dist/digi-arbetsformedlingen/{p-e5bd5a7e.entry.js → p-b3283953.entry.js} +1 -1
  73. package/dist/digi-arbetsformedlingen/p-beba49c2.entry.js +1 -0
  74. package/dist/digi-arbetsformedlingen/p-bf80a488.entry.js +1 -0
  75. package/dist/digi-arbetsformedlingen/{p-a186888d.entry.js → p-c3e0f6dd.entry.js} +1 -1
  76. package/dist/digi-arbetsformedlingen/p-c553b73b.entry.js +1 -0
  77. package/dist/digi-arbetsformedlingen/p-c604694f.entry.js +1 -0
  78. package/dist/digi-arbetsformedlingen/{p-7f155bd5.entry.js → p-c604a480.entry.js} +1 -1
  79. package/dist/digi-arbetsformedlingen/p-c64b4626.js +1 -0
  80. package/dist/digi-arbetsformedlingen/p-c7a512ee.entry.js +1 -0
  81. package/dist/digi-arbetsformedlingen/p-c7d079d0.entry.js +1 -0
  82. package/dist/digi-arbetsformedlingen/p-c9dfda73.js +1 -0
  83. package/dist/digi-arbetsformedlingen/p-d6d7b1d8.entry.js +1 -0
  84. package/dist/digi-arbetsformedlingen/p-db246e29.entry.js +1 -0
  85. package/dist/digi-arbetsformedlingen/{p-39468f49.entry.js → p-de22ce43.entry.js} +1 -1
  86. package/dist/digi-arbetsformedlingen/p-ecc2e481.entry.js +1 -0
  87. package/dist/digi-arbetsformedlingen/p-ee88e3f1.js +1 -0
  88. package/dist/digi-arbetsformedlingen/p-f2e16531.entry.js +1 -0
  89. package/dist/digi-arbetsformedlingen/p-f5bcd77b.entry.js +1 -0
  90. package/dist/digi-arbetsformedlingen/p-f87c0b45.entry.js +1 -0
  91. package/dist/digi-arbetsformedlingen/p-fa77fcf7.entry.js +1 -0
  92. package/dist/esm/digi-arbetsformedlingen.js +1 -1
  93. package/dist/esm/digi-button_11.entry.js +1180 -0
  94. package/dist/esm/digi-calendar-datepicker.entry.js +6 -6
  95. package/dist/esm/digi-code-block_3.entry.js +6 -6
  96. package/dist/esm/digi-dialog.entry.js +6 -6
  97. package/dist/esm/digi-footer-card.entry.js +25 -0
  98. package/dist/esm/digi-footer.entry.js +70 -0
  99. package/dist/esm/digi-form-error-list.entry.js +6 -6
  100. package/dist/esm/digi-form-file-upload.entry.js +1 -2
  101. package/dist/esm/digi-form-input-search.entry.js +1 -2
  102. package/dist/esm/digi-form-receipt.entry.js +6 -6
  103. package/dist/esm/digi-header-avatar.entry.js +110 -0
  104. package/dist/esm/digi-header-navigation-item.entry.js +23 -0
  105. package/dist/esm/digi-header-navigation.entry.js +224 -0
  106. package/dist/esm/digi-header-notification.entry.js +19 -0
  107. package/dist/esm/digi-header.entry.js +111 -0
  108. package/dist/esm/digi-icon-accessibility-universal.entry.js +26 -0
  109. package/dist/esm/digi-icon-bars.entry.js +26 -0
  110. package/dist/esm/digi-icon-bell-filled.entry.js +26 -0
  111. package/dist/esm/digi-icon-envelope.entry.js +26 -0
  112. package/dist/esm/{digi-link-external.entry.js → digi-icon-external-link-alt_2.entry.js} +25 -2
  113. package/dist/esm/digi-icon-globe.entry.js +26 -0
  114. package/dist/esm/digi-icon-sign.entry.js +26 -0
  115. package/dist/esm/digi-icon-x.entry.js +26 -0
  116. package/dist/esm/digi-layout-block_2.entry.js +87 -0
  117. package/dist/esm/digi-link.entry.js +71 -0
  118. package/dist/esm/digi-logo.entry.js +45 -0
  119. package/dist/esm/digi-media-image_2.entry.js +162 -0
  120. package/dist/esm/digi-navigation-pagination.entry.js +6 -6
  121. package/dist/esm/digi-navigation-sidebar-button.entry.js +26 -0
  122. package/dist/esm/digi-notification-alert.entry.js +6 -6
  123. package/dist/esm/digi-notification-error-page.entry.js +6 -6
  124. package/dist/esm/digi-title-logo.entry.js +129 -0
  125. package/dist/esm/digi-tools-feedback.entry.js +6 -6
  126. package/dist/esm/digi-typography.entry.js +22 -0
  127. package/dist/esm/digi-util-breakpoint-observer.entry.js +44 -0
  128. package/dist/esm/footer-card-variation.enum-cc732148.js +8 -0
  129. package/dist/esm/{form-input-type.enum-3da3db27.js → form-input-type.enum-a6bba983.js} +15 -1
  130. package/dist/esm/{form-file-upload-variation.enum-9c49ec5e.js → form-validation-message-variation.enum-f7835fc5.js} +8 -1
  131. package/dist/esm/index-148a7577.js +84 -20
  132. package/dist/esm/index.js +6 -6
  133. package/dist/esm/layout-container-max-width.enum-c40018ac.js +21 -0
  134. package/dist/esm/loader.js +1 -1
  135. package/dist/esm/logo-color.enum-8593dca6.js +7 -0
  136. package/dist/esm/{typography-variation.enum-c85d7857.js → typography-variation.enum-fdda731c.js} +29 -34
  137. package/dist/types/components/_form/form-select-filter/form-select-filter.d.ts +22 -3
  138. package/dist/types/components.d.ts +2 -2
  139. package/hydrate/index.js +84 -47
  140. package/hydrate/index.mjs +84 -47
  141. package/package.json +1 -1
  142. package/dist/cjs/digi-button_27.cjs.entry.js +0 -1380
  143. package/dist/cjs/digi-form-input.cjs.entry.js +0 -194
  144. package/dist/cjs/digi-form-label_3.cjs.entry.js +0 -129
  145. package/dist/cjs/digi-form-select-filter.cjs.entry.js +0 -564
  146. package/dist/cjs/digi-icon-check.cjs.entry.js +0 -30
  147. package/dist/cjs/digi-icon-chevron-down.cjs.entry.js +0 -30
  148. package/dist/cjs/digi-icon-validation-error_2.cjs.entry.js +0 -53
  149. package/dist/cjs/form-input-search-variation.enum-e0e025b1.js +0 -15
  150. package/dist/cjs/form-input-variation.enum-c750520c.js +0 -29
  151. package/dist/cjs/form-validation-message-variation.enum-855ae0be.js +0 -8
  152. package/dist/digi-arbetsformedlingen/p-111fb07d.entry.js +0 -1
  153. package/dist/digi-arbetsformedlingen/p-1f956af8.js +0 -1
  154. package/dist/digi-arbetsformedlingen/p-2788683e.entry.js +0 -1
  155. package/dist/digi-arbetsformedlingen/p-2d2f6950.entry.js +0 -1
  156. package/dist/digi-arbetsformedlingen/p-30dc159d.entry.js +0 -1
  157. package/dist/digi-arbetsformedlingen/p-42ae53aa.entry.js +0 -1
  158. package/dist/digi-arbetsformedlingen/p-4841b4e1.js +0 -1
  159. package/dist/digi-arbetsformedlingen/p-59073668.entry.js +0 -1
  160. package/dist/digi-arbetsformedlingen/p-7933b555.js +0 -1
  161. package/dist/digi-arbetsformedlingen/p-82611050.entry.js +0 -1
  162. package/dist/digi-arbetsformedlingen/p-82a74908.entry.js +0 -1
  163. package/dist/digi-arbetsformedlingen/p-88b4d03a.js +0 -1
  164. package/dist/digi-arbetsformedlingen/p-905ccb30.js +0 -1
  165. package/dist/digi-arbetsformedlingen/p-9c053cf8.entry.js +0 -1
  166. package/dist/digi-arbetsformedlingen/p-9dae073c.entry.js +0 -1
  167. package/dist/digi-arbetsformedlingen/p-d595e8a3.js +0 -1
  168. package/dist/digi-arbetsformedlingen/p-eda570be.entry.js +0 -1
  169. package/dist/esm/digi-button_27.entry.js +0 -1350
  170. package/dist/esm/digi-form-input.entry.js +0 -190
  171. package/dist/esm/digi-form-label_3.entry.js +0 -123
  172. package/dist/esm/digi-form-select-filter.entry.js +0 -560
  173. package/dist/esm/digi-icon-check.entry.js +0 -26
  174. package/dist/esm/digi-icon-chevron-down.entry.js +0 -26
  175. package/dist/esm/digi-icon-validation-error_2.entry.js +0 -48
  176. package/dist/esm/form-input-search-variation.enum-6d8dc10a.js +0 -15
  177. package/dist/esm/form-input-variation.enum-64d9450f.js +0 -29
  178. package/dist/esm/form-validation-message-variation.enum-bcef8a9d.js +0 -8
@@ -0,0 +1,1194 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-7a477838.js');
6
+ const randomIdGenerator_util = require('./randomIdGenerator.util-e7f4b6de.js');
7
+ const codeExampleVariation_enum = require('./code-example-variation.enum-1611825e.js');
8
+ const formInputType_enum = require('./form-input-type.enum-1fb2180a.js');
9
+ const buttonVariation_enum = require('./button-variation.enum-bc521499.js');
10
+ const typographyVariation_enum = require('./typography-variation.enum-9aab5027.js');
11
+ const logger_util = require('./logger.util-fdafc086.js');
12
+ const text = require('./text-65b1b58c.js');
13
+ const detectClickOutside_util = require('./detectClickOutside.util-3e764eb3.js');
14
+ const detectFocusOutside_util = require('./detectFocusOutside.util-03c62976.js');
15
+ require('./badge-notification-shape.enum-ff802554.js');
16
+ require('./badge-status-variation.enum-0a5adc21.js');
17
+ require('./calendar-week-view-heading-level.enum-fd0c841b.js');
18
+ require('./bar-chart-variation.enum-a4e866b6.js');
19
+ require('./code-variation.enum-c4a4e6fd.js');
20
+ require('./expandable-accordion-header-level.enum-45483252.js');
21
+ require('./expandable-faq-item-variation.enum-89427195.js');
22
+ require('./expandable-faq-variation.enum-af923f49.js');
23
+ require('./footer-card-variation.enum-99555edc.js');
24
+ require('./form-checkbox-variation.enum-d2ca879e.js');
25
+ const formValidationMessageVariation_enum = require('./form-validation-message-variation.enum-c5ec3e2d.js');
26
+ require('./form-radiogroup-validation.enum-03a17d4d.js');
27
+ require('./form-select-variation.enum-528c1bf0.js');
28
+ require('./form-textarea-variation.enum-9c90d40f.js');
29
+ require('./info-card-multi-type.enum-14746572.js');
30
+ require('./info-card-variation.enum-64cef637.js');
31
+ require('./layout-container-max-width.enum-7e637f44.js');
32
+ require('./layout-block-variation.enum-f6102119.js');
33
+ require('./layout-columns-variation.enum-65675649.js');
34
+ require('./link-button-variation.enum-137785e3.js');
35
+ require('./list-type.enum-aea4d012.js');
36
+ require('./loader-skeleton-variation.enum-d52ba55e.js');
37
+ require('./loader-spinner-size.enum-db2973f0.js');
38
+ require('./logo-color.enum-76f6c506.js');
39
+ require('./media-figure-alignment.enum-3885aba5.js');
40
+ require('./navigation-sidebar-variation.enum-1c0c3064.js');
41
+ require('./navigation-vertical-menu-variation.enum-c237edd3.js');
42
+ require('./progress-circle-role.enum-b7fdcf0c.js');
43
+ require('./progress-indicator-variation.enum-7cf8e0e4.js');
44
+ require('./progress-list-item-variation.enum-90e4c874.js');
45
+ require('./progress-list-variation.enum-06d5ce27.js');
46
+ require('./progressbar-variation.enum-aff9fa80.js');
47
+ require('./quote-image-inner-position.enum-e64e7a6d.js');
48
+ require('./table-variation.enum-25df2ad7.js');
49
+ require('./tag-media-icon.enum-372563c5.js');
50
+ require('./tag-size.enum-387c516c.js');
51
+ require('./tools-feedback-banner-type.enum-de373ba0.js');
52
+ require('./tools-feedback-rating-variation.enum-2f71e84d.js');
53
+ require('./tools-theme-provider.brand.enum-bc855272.js');
54
+ require('./typography-heading-jumbo-variation.enum-8677e099.js');
55
+ require('./typography-meta-variation.enum-13ac3538.js');
56
+ require('./typography-time-variation.enum-bce1d87e.js');
57
+ require('./util-breakpoint-observer-breakpoints.enum-e96d3a84.js');
58
+ const keyboardHandler_util = require('./keyboardHandler.util-d8600adb.js');
59
+ require('./detectClosest.util-85b3507b.js');
60
+
61
+ const buttonCss = ".sc-digi-button-h{--digi--button--color--background--primary--default:var(--digi--color--background--interactive--default--primary);--digi--button--color--background--primary--hover:var(--digi--color--background--interactive--hover--primary);--digi--button--color--background--primary--focus:var(--digi--color--background--interactive--hover--primary);--digi--button--color--background--primary--active:var(--digi--color--background--interactive--hover--primary);--digi--button--color--background--secondary--default:var(--digi--color--background--interactive--default--secondary);--digi--button--color--background--secondary--hover:var(--digi--color--background--interactive--hover--secondary);--digi--button--color--background--secondary--focus:var(--digi--color--background--interactive--hover--secondary);--digi--button--color--background--secondary--active:var(--digi--color--background--interactive--hover--secondary);--digi--button--color--background--function--default:transparent;--digi--button--color--background--function--hover:transparent;--digi--button--color--background--function--focus:transparent;--digi--button--color--background--function--active:transparent;--digi--button--color--text--primary--default:var(--digi--color--text--interactive--secondary);--digi--button--color--text--primary--hover:var(--digi--color--text--interactive--secondary);--digi--button--color--text--primary--focus:var(--digi--color--text--interactive--secondary);--digi--button--color--text--primary--active:var(--digi--color--text--interactive--secondary);--digi--button--color--text--secondary--default:var(--digi--color--text--interactive--brand-primary);--digi--button--color--text--secondary--hover:var(--digi--color--text--interactive--brand-primary);--digi--button--color--text--secondary--focus:var(--digi--color--text--interactive--brand-primary);--digi--button--color--text--secondary--active:var(--digi--color--text--interactive--brand-primary);--digi--button--color--text--function--default:var(--digi--color--text--interactive--primary);--digi--button--color--text--function--hover:var(--digi--color--text--interactive--primary);--digi--button--color--text--function--focus:var(--digi--color--text--interactive--primary);--digi--button--color--text--function--active:var(--digi--color--text--interactive--primary);--digi--button--color--border--primary--default:var(--digi--color--background--interactive--default--primary);--digi--button--color--border--primary--hover:var(--digi--color--background--interactive--hover--primary);--digi--button--color--border--primary--focus:var(--digi--color--background--interactive--default--primary);--digi--button--color--border--primary--active:var(--digi--color--background--interactive--default--primary);--digi--button--color--border--secondary--default:var(--digi--color--border--interactive--default--primary);--digi--button--color--border--secondary--hover:var(--digi--color--border--interactive--hover--secondary);--digi--button--color--border--secondary--focus:var(--digi--color--border--interactive--default--primary);--digi--button--color--border--secondary--active:var(--digi--color--border--interactive--default--primary);--digi--button--color--border--function--default:initial;--digi--button--color--border--function--hover:initial;--digi--button--color--border--function--focus:initial;--digi--button--color--border--function--active:initial;--digi--button--color--icon--primary--default:var(--digi--color--icon--secondary);--digi--button--color--icon--primary--hover:var(--digi--color--icon--secondary);--digi--button--color--icon--primary--focus:var(--digi--color--icon--secondary);--digi--button--color--icon--primary--active:var(--digi--color--icon--secondary);--digi--button--color--icon--secondary--default:var(--digi--color--icon--brand-primary);--digi--button--color--icon--secondary--hover:var(--digi--color--icon--brand-primary);--digi--button--color--icon--secondary--focus:var(--digi--color--icon--brand-primary);--digi--button--color--icon--secondary--active:var(--digi--color--icon--brand-primary);--digi--button--color--icon--function--default:var(--digi--color--icon--cta);--digi--button--color--icon--function--hover:var(--digi--color--icon--cta);--digi--button--color--icon--function--focus:var(--digi--color--icon--cta);--digi--button--color--icon--function--active:var(--digi--color--icon--cta);--digi--button--border-width--primary--default:var(--digi--border-width--primary);--digi--button--border-width--primary--hover:var(--digi--border-width--primary);--digi--button--border-width--secondary--default:var(--digi--border-width--primary);--digi--button--border-width--secondary--hover:var(--digi--border-width--primary);--digi--button--border-width--function--default:initial;--digi--button--border-width--function--hover:initial;--digi--button--border-style--primary--default:var(--digi--border-style--primary);--digi--button--border-style--primary--hover:var(--digi--border-style--primary);--digi--button--border-style--primary--focus:var(--digi--border-style--primary);--digi--button--border-style--primary--active:var(--digi--border-style--primary);--digi--button--border-style--secondary--default:var(--digi--border-style--primary);--digi--button--border-style--secondary--hover:var(--digi--border-style--primary);--digi--button--border-style--secondary--focus:var(--digi--border-style--primary);--digi--button--border-style--secondary--active:var(--digi--border-style--primary);--digi--button--border-style--function--default:var(--digi--border-style--secondary);--digi--button--border-style--function--hover:var(--digi--border-style--secondary);--digi--button--border-style--function--focus:var(--digi--border-style--secondary);--digi--button--border-style--function--active:var(--digi--border-style--secondary);--digi--button--border-radius--primary--default:var(--digi--border-radius--secondary);--digi--button--border-radius--primary--hover:var(--digi--border-radius--secondary);--digi--button--border-radius--primary--focus:var(--digi--border-radius--secondary);--digi--button--border-radius--primary--active:var(--digi--border-radius--secondary);--digi--button--border-radius--secondary--default:var(--digi--border-radius--secondary);--digi--button--border-radius--secondary--hover:var(--digi--border-radius--secondary);--digi--button--border-radius--secondary--focus:var(--digi--border-radius--secondary);--digi--button--border-radius--secondary--active:var(--digi--border-radius--secondary);--digi--button--border-radius--function--default:initial;--digi--button--border-radius--function--hover:initial;--digi--button--border-radius--function--focus:initial;--digi--button--border-radius--function--active:initial;--digi--button--padding--small:var(--digi--gutter--button-block-small) var(--digi--gutter--button-inline-small);--digi--button--padding--medium:var(--digi--gutter--button-block-medium) var(--digi--gutter--button-inline-medium);--digi--button--font-size--small:var(--digi--global--typography--font-size--interaction-small);--digi--button--font-size--medium:var(--digi--global--typography--font-size--interaction-medium);--digi--button--font-family:var(--digi--global--typography--font-family--default);--digi--button--font-weight--default:var(--digi--typography--button--font-weight--desktop);--digi--button--font-weight--function:var(--digi--typography--label--font-weight--desktop);--digi--button--width:initial;--digi--button--display:initial;--digi--button--justify-content--default:initial;--digi--button--justify-content--full-width:center;--digi--button--align-items:center;--digi--button--text-align--default:initial;--digi--button--text-align--full-width:center;--digi--button--outline--default:initial;--digi--button--outline--focus:initial;--digi--button--cursor:pointer;--digi--button--icon--spacing:var(--digi--gutter--large);--digi--button--min-height--small:unset}.sc-digi-button-h .digi-button--variation-primary.sc-digi-button{--COLOR--BACKGROUND--DEFAULT:var(--digi--button--color--background--primary--default);--COLOR--BACKGROUND--HOVER:var(--digi--button--color--background--primary--hover);--COLOR--BACKGROUND--FOCUS:var(--digi--button--color--background--primary--focus);--COLOR--BACKGROUND--ACTIVE:var(--digi--button--color--background--primary--active);--COLOR--TEXT--DEFAULT:var(--digi--button--color--text--primary--default);--COLOR--TEXT--HOVER:var(--digi--button--color--text--primary--hover);--COLOR--TEXT--FOCUS:var(--digi--button--color--text--primary--focus);--COLOR--TEXT--ACTIVE:var(--digi--button--color--text--primary--active);--COLOR--ICON--DEFAULT:var(--digi--button--color--icon--primary--default);--COLOR--ICON--HOVER:var(--digi--button--color--icon--primary--hover);--COLOR--ICON--FOCUS:var(--digi--button--color--icon--primary--focus);--COLOR--ICON--ACTIVE:var(--digi--button--color--icon--primary--active);--COLOR--BORDER--DEFAULT:var(--digi--button--color--border--primary--default);--COLOR--BORDER--HOVER:var(--digi--button--color--border--primary--hover);--COLOR--BORDER--FOCUS:var(--digi--button--color--border--primary--focus);--COLOR--BORDER--ACTIVE:var(--digi--button--color--border--primary--active);--BORDER-RADIUS--DEFAULT:var(--digi--button--border-radius--primary--default);--BORDER-RADIUS--HOVER:var(--digi--button--border-radius--primary--hover);--BORDER-RADIUS--FOCUS:var(--digi--button--border-radius--primary--focus);--BORDER-RADIUS--ACTIVE:var(--digi--button--border-radius--primary--active);--BORDER-WIDTH--DEFAULT:var(--digi--button--border-width--primary--default);--BORDER-WIDTH--HOVER:var(--digi--button--border-width--primary--hover);--BORDER-WIDTH--FOCUS:var(--digi--button--border-width--primary--focus);--BORDER-WIDTH--ACTIVE:var(--digi--button--border-width--primary--active);--BORDER-STYLE--DEFAULT:var(--digi--button--border-style--primary--default);--BORDER-STYLE--HOVER:var(--digi--button--border-style--primary--hover);--BORDER-STYLE--FOCUS:var(--digi--button--border-style--primary--focus);--BORDER-STYLE--ACTIVE:var(--digi--button--border-style--primary--active);--FONT-WEIGHT:var(--digi--button--font-weight--default)}.sc-digi-button-h .digi-button--variation-secondary.sc-digi-button{--COLOR--BACKGROUND--DEFAULT:var(--digi--button--color--background--secondary--default);--COLOR--BACKGROUND--HOVER:var(--digi--button--color--background--secondary--hover);--COLOR--BACKGROUND--FOCUS:var(--digi--button--color--background--secondary--focus);--COLOR--BACKGROUND--ACTIVE:var(--digi--button--color--background--secondary--active);--COLOR--TEXT--DEFAULT:var(--digi--button--color--text--secondary--default);--COLOR--TEXT--HOVER:var(--digi--button--color--text--secondary--hover);--COLOR--TEXT--FOCUS:var(--digi--button--color--text--secondary--focus);--COLOR--TEXT--ACTIVE:var(--digi--button--color--text--secondary--active);--COLOR--ICON--DEFAULT:var(--digi--button--color--icon--secondary--default);--COLOR--ICON--HOVER:var(--digi--button--color--icon--secondary--hover);--COLOR--ICON--FOCUS:var(--digi--button--color--icon--secondary--focus);--COLOR--ICON--ACTIVE:var(--digi--button--color--icon--secondary--active);--COLOR--BORDER--DEFAULT:var(--digi--button--color--border--secondary--default);--COLOR--BORDER--HOVER:var(--digi--button--color--border--secondary--hover);--COLOR--BORDER--FOCUS:var(--digi--button--color--border--secondary--focus);--COLOR--BORDER--ACTIVE:var(--digi--button--color--border--secondary--active);--BORDER-RADIUS--DEFAULT:var(--digi--button--border-radius--secondary--default);--BORDER-RADIUS--HOVER:var(--digi--button--border-radius--secondary--hover);--BORDER-RADIUS--FOCUS:var(--digi--button--border-radius--secondary--focus);--BORDER-RADIUS--ACTIVE:var(--digi--button--border-radius--secondary--active);--BORDER-WIDTH--DEFAULT:var(--digi--button--border-width--secondary--default);--BORDER-WIDTH--HOVER:var(--digi--button--border-width--secondary--hover);--BORDER-WIDTH--FOCUS:var(--digi--button--border-width--secondary--focus);--BORDER-WIDTH--ACTIVE:var(--digi--button--border-width--secondary--active);--BORDER-STYLE--DEFAULT:var(--digi--button--border-style--secondary--default);--BORDER-STYLE--HOVER:var(--digi--button--border-style--secondary--hover);--BORDER-STYLE--FOCUS:var(--digi--button--border-style--secondary--focus);--BORDER-STYLE--ACTIVE:var(--digi--button--border-style--secondary--active);--FONT-WEIGHT:var(--digi--button--font-weight--default)}.sc-digi-button-h .digi-button--variation-function.sc-digi-button{--COLOR--BACKGROUND--DEFAULT:var(--digi--button--color--background--function--default);--COLOR--BACKGROUND--HOVER:var(--digi--button--color--background--function--hover);--COLOR--BACKGROUND--FOCUS:var(--digi--button--color--background--function--focus);--COLOR--BACKGROUND--ACTIVE:var(--digi--button--color--background--function--active);--COLOR--TEXT--DEFAULT:var(--digi--button--color--text--function--default);--COLOR--TEXT--HOVER:var(--digi--button--color--text--function--hover);--COLOR--TEXT--FOCUS:var(--digi--button--color--text--function--focus);--COLOR--TEXT--ACTIVE:var(--digi--button--color--text--function--active);--COLOR--ICON--DEFAULT:var(--digi--button--color--icon--function--default);--COLOR--ICON--HOVER:var(--digi--button--color--icon--function--hover);--COLOR--ICON--FOCUS:var(--digi--button--color--icon--function--focus);--COLOR--ICON--ACTIVE:var(--digi--button--color--icon--function--active);--COLOR--BORDER--DEFAULT:var(--digi--button--color--border--function--default);--COLOR--BORDER--HOVER:var(--digi--button--color--border--function--hover);--COLOR--BORDER--FOCUS:var(--digi--button--color--border--function--focus);--COLOR--BORDER--ACTIVE:var(--digi--button--color--border--function--active);--BORDER-RADIUS--DEFAULT:var(--digi--button--border-radius--function--default);--BORDER-RADIUS--HOVER:var(--digi--button--border-radius--function--hover);--BORDER-RADIUS--FOCUS:var(--digi--button--border-radius--function--focus);--BORDER-RADIUS--ACTIVE:var(--digi--button--border-radius--function--active);--BORDER-WIDTH--DEFAULT:var(--digi--button--border-width--function--default);--BORDER-WIDTH--HOVER:var(--digi--button--border-width--function--hover);--BORDER-WIDTH--FOCUS:var(--digi--button--border-width--function--focus);--BORDER-WIDTH--ACTIVE:var(--digi--button--border-width--function--active);--BORDER-STYLE--DEFAULT:var(--digi--button--border-style--function--default);--BORDER-STYLE--HOVER:var(--digi--button--border-style--function--hover);--BORDER-STYLE--FOCUS:var(--digi--button--border-style--function--focus);--BORDER-STYLE--ACTIVE:var(--digi--button--border-style--function--active);--FONT-WEIGHT:var(--digi--button--font-weight--function)}.sc-digi-button-h .digi-button--variation-function.sc-digi-button:hover,.sc-digi-button-h .digi-button--variation-function.sc-digi-button:focus{text-decoration:underline}.sc-digi-button-h .digi-button--size-small.sc-digi-button{--FONT-SIZE:var(--digi--button--font-size--small);--PADDING:var(--digi--button--padding--small);--MIN-HEIGHT:var(--digi--button--min-height--small)}.sc-digi-button-h .digi-button--size-medium.sc-digi-button{--FONT-SIZE:var(--digi--button--font-size--medium);--PADDING:var(--digi--button--padding--medium);--MIN-HEIGHT:var(--digi--button--min-height--small)}.sc-digi-button-h .digi-button.sc-digi-button-s>[slot^=icon],.sc-digi-button-h .digi-button .sc-digi-button-s>[slot^=icon]{--digi--icon--height:1em;--digi--icon--width:1em;--digi--icon--color:var(--COLOR--ICON--DEFAULT);min-height:0}.sc-digi-button-h .digi-button.sc-digi-button{font-family:var(--digi--button--font-family);background:var(--COLOR--BACKGROUND--DEFAULT);color:var(--COLOR--TEXT--DEFAULT);padding:var(--PADDING);border-radius:var(--BORDER-RADIUS--DEFAULT);border-width:var(--BORDER-WIDTH--DEFAULT);border-style:var(--BORDER-STYLE--DEFAULT);border-color:var(--COLOR--BORDER--DEFAULT);font-weight:var(--FONT-WEIGHT);font-size:var(--FONT-SIZE);outline:var(--digi--button--outline--default);text-align:var(--digi--button--text-align--default);width:var(--digi--button--width);display:var(--digi--button--display);justify-content:var(--digi--button--justify-content--default);cursor:var(--digi--button--cursor);min-height:var(--MIN-HEIGHT);align-items:var(--digi--button--align-items);white-space:nowrap}@media (any-hover: hover){.sc-digi-button-h .digi-button.sc-digi-button:hover{background:var(--COLOR--BACKGROUND--HOVER);border-radius:var(--BORDER-RADIUS--HOVER);border-width:var(--BORDER-WIDTH--HOVER);border-style:var(--BORDER-STYLE--HOVER);border-color:var(--COLOR--BORDER--HOVER);color:var(--COLOR--TEXT--HOVER)}.sc-digi-button-h .digi-button:hover.sc-digi-button-s>[slot^=icon],.sc-digi-button-h .digi-button:hover .sc-digi-button-s>[slot^=icon]{--digi--icon--color:var(--COLOR--ICON--HOVER)}}.sc-digi-button-h .digi-button.sc-digi-button:focus-visible{background:var(--COLOR--BACKGROUND--FOCUS);color:var(--COLOR--TEXT--FOCUS);border-style:var(--BORDER-STYLE--FOCUS);border-color:var(--COLOR--BORDER--FOCUS);outline:2px solid black;outline-offset:2px;box-shadow:0px 0px 0px 5px white}.sc-digi-button-h .digi-button:focus-visible.sc-digi-button-s>[slot^=icon],.sc-digi-button-h .digi-button:focus-visible .sc-digi-button-s>[slot^=icon]{--digi--icon--color:var(--COLOR--ICON--FOCUS)}.sc-digi-button-h .digi-button.sc-digi-button:active{background:var(--COLOR--BACKGROUND--ACTIVE);color:var(--COLOR--TEXT--ACTIVE)}.sc-digi-button-h .digi-button:active.sc-digi-button-s>[slot^=icon],.sc-digi-button-h .digi-button:active .sc-digi-button-s>[slot^=icon]{--digi--icon--color:var(--COLOR--ICON--ACTIVE)}.sc-digi-button-h .digi-button--icon.sc-digi-button,.sc-digi-button-h .digi-button--icon-secondary.sc-digi-button{--digi--button--display:flex;align-items:center;justify-content:var(--digi--button--justify-content--default);gap:var(--digi--button--icon--spacing)}.sc-digi-button-h .digi-button--full-width.sc-digi-button{--digi--button--width:100%;--digi--button--text-align--default:var(--digi--button--text-align--full-width);--digi--button--justify-content--default:var(--digi--button--justify-content--full-width)}";
62
+ const DigiButtonStyle0 = buttonCss;
63
+
64
+ const Button = class {
65
+ constructor(hostRef) {
66
+ index.registerInstance(this, hostRef);
67
+ this.afOnClick = index.createEvent(this, "afOnClick", 7);
68
+ this.afOnFocus = index.createEvent(this, "afOnFocus", 7);
69
+ this.afOnBlur = index.createEvent(this, "afOnBlur", 7);
70
+ this.afOnReady = index.createEvent(this, "afOnReady", 3);
71
+ this.hasIcon = undefined;
72
+ this.hasIconSecondary = undefined;
73
+ this.isFullSize = undefined;
74
+ this.afSize = codeExampleVariation_enum.ButtonSize.MEDIUM;
75
+ this.afTabindex = undefined;
76
+ this.afVariation = buttonVariation_enum.ButtonVariation.PRIMARY;
77
+ this.afType = formInputType_enum.ButtonType.BUTTON;
78
+ this.afId = randomIdGenerator_util.randomIdGenerator('digi-button');
79
+ this.afAriaLabel = undefined;
80
+ this.afAriaLabelledby = undefined;
81
+ this.afAriaControls = undefined;
82
+ this.afForm = undefined;
83
+ this.afAriaPressed = undefined;
84
+ this.afAriaExpanded = undefined;
85
+ this.afAriaHaspopup = undefined;
86
+ this.afAriaCurrent = undefined;
87
+ this.afRole = undefined;
88
+ this.afAriaChecked = undefined;
89
+ this.afLang = undefined;
90
+ this.afDir = undefined;
91
+ this.afFullWidth = false;
92
+ this.afAutofocus = undefined;
93
+ this.afInputRef = undefined;
94
+ }
95
+ fullWidthHandler() {
96
+ this.isFullSize = this.afFullWidth;
97
+ }
98
+ /**
99
+ * Hämta en referens till buttonelementet. Bra för att t.ex. sätta fokus programmatiskt.
100
+ * @en Returns a reference to the button element. Handy for setting focus programmatically.
101
+ */
102
+ async afMGetButtonElement() {
103
+ return this._button;
104
+ }
105
+ componentWillLoad() {
106
+ this.setHasIcon();
107
+ this.fullWidthHandler();
108
+ }
109
+ componentWillUpdate() {
110
+ this.setHasIcon();
111
+ }
112
+ componentDidLoad() {
113
+ this.afOnReady.emit();
114
+ }
115
+ setHasIcon() {
116
+ const icon = !!this.hostElement.querySelector('[slot="icon"]');
117
+ const iconSecondary = !!this.hostElement.querySelector('[slot="icon-secondary"]');
118
+ if (icon) {
119
+ this.hasIcon = icon;
120
+ }
121
+ if (iconSecondary) {
122
+ this.hasIconSecondary = iconSecondary;
123
+ }
124
+ }
125
+ get cssModifiers() {
126
+ return {
127
+ [`digi-button--variation-${this.afVariation}`]: !!this.afVariation,
128
+ [`digi-button--size-${this.afSize}`]: !!this.afSize,
129
+ 'digi-button--icon': this.hasIcon,
130
+ 'digi-button--icon-secondary': this.hasIconSecondary,
131
+ 'digi-button--full-width': this.isFullSize
132
+ };
133
+ }
134
+ get pressedState() {
135
+ if (this.afAriaPressed === null || this.afAriaPressed === undefined) {
136
+ return;
137
+ }
138
+ return this.afAriaPressed ? 'true' : 'false';
139
+ }
140
+ get expandedState() {
141
+ if (this.afAriaExpanded === null || this.afAriaExpanded === undefined) {
142
+ return;
143
+ }
144
+ return this.afAriaExpanded ? 'true' : 'false';
145
+ }
146
+ get hasPopup() {
147
+ if (this.afAriaHaspopup === null || this.afAriaHaspopup === undefined) {
148
+ return;
149
+ }
150
+ return this.afAriaHaspopup ? 'true' : 'false';
151
+ }
152
+ clickHandler(e) {
153
+ this.afOnClick.emit(e);
154
+ }
155
+ focusHandler(e) {
156
+ this.afOnFocus.emit(e);
157
+ }
158
+ blurHandler(e) {
159
+ this.afOnBlur.emit(e);
160
+ }
161
+ render() {
162
+ return (index.h(index.Host, { key: '3a398d75ad83e3caa9ec54928544d5bf8315d30f' }, index.h("button", { key: '2159552d7e8064acbb6da5c02c28ead3d4985e85', class: Object.assign({ 'digi-button': true }, this.cssModifiers), type: this.afType, role: this.afRole, ref: (el) => {
163
+ var _a, _b, _c;
164
+ this._button = el;
165
+ (_a = this === null || this === void 0 ? void 0 : this.afInputRef) === null || _a === void 0 ? void 0 : _a.call(this, el);
166
+ // Stencil has a bug wiith form attribute so we need to set it like this
167
+ // https://github.com/ionic-team/stencil/issues/2703
168
+ this.afForm
169
+ ? (_b = this._button) === null || _b === void 0 ? void 0 : _b.setAttribute('form', this.afForm)
170
+ : (_c = this._button) === null || _c === void 0 ? void 0 : _c.removeAttribute('form');
171
+ }, id: this.afId, tabindex: this.afTabindex, "aria-label": this.afAriaLabel, "aria-labelledby": this.afAriaLabelledby, "aria-controls": this.afAriaControls, "aria-pressed": this.pressedState, "aria-expanded": this.expandedState, "aria-haspopup": this.hasPopup, "aria-current": this.afAriaCurrent, "aria-checked": this.afAriaChecked, onClick: (e) => this.clickHandler(e), onFocus: (e) => this.focusHandler(e), onBlur: (e) => this.blurHandler(e), autoFocus: this.afAutofocus ? this.afAutofocus : null, form: this.afForm, lang: this.afLang, dir: this.afDir }, this.hasIcon && (index.h("span", { key: '1188d5cb005a51e4e065b70663d06877db3a1477', class: "digi-button__icon" }, index.h("slot", { key: 'f90319563c18e1f82fa13f478b4d4d13ce3e9bf7', name: "icon" }))), index.h("span", { key: '17dce8eed2e845ca6166cf85a1c0252c2c0b8037', class: "digi-button__text" }, index.h("slot", { key: '2f637e48b837ecd0f0f2333349f328c497aee650' })), this.hasIconSecondary && (index.h("span", { key: '49ffd3361b0cc00c074e1ce332dab2de33127fcc', class: "digi-button__icon digi-button__icon--secondary" }, index.h("slot", { key: '367d3ba37e2fd0b7e83d600f35d02d4df303c1c0', name: "icon-secondary" }))))));
172
+ }
173
+ get hostElement() { return index.getElement(this); }
174
+ static get watchers() { return {
175
+ "afFullWidth": ["fullWidthHandler"]
176
+ }; }
177
+ };
178
+ Button.style = DigiButtonStyle0;
179
+
180
+ const formInputCss = ".sc-digi-form-input-h{--digi--form-input--height--small:var(--digi--input-height--small);--digi--form-input--height--medium:var(--digi--input-height--medium);--digi--form-input--height--large:var(--digi--input-height--large);--digi--form-input--border-radius:var(--digi--border-radius--input);--digi--form-input--padding:0 var(--digi--gutter--medium);--digi--form-input--background--empty:var(--digi--color--background--interactive--default--input-elements);--digi--form-input--background--neutral:var(--digi--color--background--interactive--default--input-elements);--digi--form-input--background--success:var(--digi--color--background--interactive--validation--success);--digi--form-input--background--warning:var(--digi--color--background--interactive--validation--warning);--digi--form-input--background--error:var(--digi--color--background--interactive--validation--error);--digi--form-input--border--neutral:var(--digi--border-width--input-regular) solid;--digi--form-input--border--error:var(--digi--border-width--input-validation) solid;--digi--form-input--border--success:var(--digi--border-width--input-validation) solid;--digi--form-input--border--warning:var(--digi--border-width--input-validation) solid;--digi--form-input--border-color--neutral:var(--digi--color--border--interactive--default--on-input);--digi--form-input--border-color--success:var(--digi--color--border--interactive--validation--success);--digi--form-input--border-color--warning:var(--digi--color--border--interactive--validation--warning);--digi--form-input--border-color--error:var(--digi--color--border--interactive--validation--error)}.sc-digi-form-input-h .digi-form-input.sc-digi-form-input{display:flex;flex-direction:column;gap:0.4em}.sc-digi-form-input-h .digi-form-input--small.sc-digi-form-input{--HEIGHT:var(--digi--form-input--height--small)}.sc-digi-form-input-h .digi-form-input--medium.sc-digi-form-input{--HEIGHT:var(--digi--form-input--height--medium)}.sc-digi-form-input-h .digi-form-input--large.sc-digi-form-input{--HEIGHT:var(--digi--form-input--height--large)}.sc-digi-form-input-h .digi-form-input--neutral.sc-digi-form-input{--BORDER:var(--digi--form-input--border--neutral);--BORDER-COLOR:var(--digi--form-input--border-color--neutral);--BACKGROUND:var(--digi--form-input--background--neutral)}.sc-digi-form-input-h .digi-form-input--empty.sc-digi-form-input:not(:focus-within){--BACKGROUND:var(--digi--form-input--background--empty)}.sc-digi-form-input-h .digi-form-input--success.sc-digi-form-input{--BORDER:var(--digi--form-input--border--success);--BORDER-COLOR:var(--digi--form-input--border-color--success);--BACKGROUND:var(--digi--form-input--background--success)}.sc-digi-form-input-h .digi-form-input--warning.sc-digi-form-input{--BORDER:var(--digi--form-input--border--warning);--BORDER-COLOR:var(--digi--form-input--border-color--warning);--BACKGROUND:var(--digi--form-input--background--warning)}.sc-digi-form-input-h .digi-form-input--error.sc-digi-form-input{--BORDER:var(--digi--form-input--border--error);--BORDER-COLOR:var(--digi--form-input--border-color--error);--BACKGROUND:var(--digi--form-input--background--error)}.digi-form-input__input-wrapper.sc-digi-form-input{position:relative;display:flex}.digi-form-input__input-wrapper.sc-digi-form-input-s>[slot^=button] button,.digi-form-input__input-wrapper .sc-digi-form-input-s>[slot^=button] button{--MIN-HEIGHT:100%}.digi-form-input--button-variation-primary .digi-form-input__input-wrapper.sc-digi-form-input-s>[slot^=button] button,.digi-form-input__input-wrapper .sc-digi-form-input-s>[slot^=button] button{border-start-start-radius:0;border-end-start-radius:0}.digi-form-input--button-variation-secondary.digi-form-input--has-button-true.sc-digi-form-input .digi-form-input__input-wrapper.sc-digi-form-input{gap:var(--digi--gutter--medium);flex-wrap:wrap}.digi-form-input__input.sc-digi-form-input{flex:1;height:var(--HEIGHT);font-family:var(--digi--global--typography--font-family--default);font-size:var(--digi--typography--body--font-size--desktop);padding:var(--digi--form-input--padding);color:var(--digi--color--text--primary);background:var(--BACKGROUND);border:var(--BORDER);border-color:var(--BORDER-COLOR);border-radius:var(--digi--form-input--border-radius);box-sizing:border-box}.digi-form-input__input.sc-digi-form-input:focus-visible{outline:2px solid black;outline-offset:2px;box-shadow:0px 0px 0px 5px white}.digi-form-input--button-variation-primary.digi-form-input--has-button-true.sc-digi-form-input .digi-form-input__input.sc-digi-form-input{border-end-end-radius:0;border-start-end-radius:0}";
181
+ const DigiFormInputStyle0 = formInputCss;
182
+
183
+ const FormInput = class {
184
+ constructor(hostRef) {
185
+ index.registerInstance(this, hostRef);
186
+ this.afOnChange = index.createEvent(this, "afOnChange", 7);
187
+ this.afOnBlur = index.createEvent(this, "afOnBlur", 7);
188
+ this.afOnKeyup = index.createEvent(this, "afOnKeyup", 7);
189
+ this.afOnFocus = index.createEvent(this, "afOnFocus", 7);
190
+ this.afOnFocusout = index.createEvent(this, "afOnFocusout", 7);
191
+ this.afOnInput = index.createEvent(this, "afOnInput", 7);
192
+ this.afOnDirty = index.createEvent(this, "afOnDirty", 7);
193
+ this.afOnTouched = index.createEvent(this, "afOnTouched", 7);
194
+ this.afOnReady = index.createEvent(this, "afOnReady", 3);
195
+ this.hasActiveValidationMessage = false;
196
+ this.hasButton = undefined;
197
+ this.dirty = false;
198
+ this.touched = false;
199
+ this.afLabel = undefined;
200
+ this.afLabelDescription = undefined;
201
+ this.afType = formInputType_enum.FormInputType.TEXT;
202
+ this.afInputmode = typographyVariation_enum.FormInputMode.DEFAULT;
203
+ this.afButtonVariation = formInputType_enum.FormInputButtonVariation.PRIMARY;
204
+ this.afAutofocus = undefined;
205
+ this.afVariation = typographyVariation_enum.FormInputVariation.MEDIUM;
206
+ this.afName = undefined;
207
+ this.afId = randomIdGenerator_util.randomIdGenerator('digi-form-input');
208
+ this.afMaxlength = undefined;
209
+ this.afMinlength = undefined;
210
+ this.afRequired = undefined;
211
+ this.afRequiredText = undefined;
212
+ this.afAnnounceIfOptional = false;
213
+ this.afAnnounceIfOptionalText = undefined;
214
+ this.value = undefined;
215
+ this.afValue = undefined;
216
+ this.afValidation = typographyVariation_enum.FormInputValidation.NEUTRAL;
217
+ this.afValidationText = undefined;
218
+ this.afRole = undefined;
219
+ this.afAutocomplete = undefined;
220
+ this.afMin = undefined;
221
+ this.afMax = undefined;
222
+ this.afList = undefined;
223
+ this.afStep = undefined;
224
+ this.afDirname = undefined;
225
+ this.afAriaAutocomplete = undefined;
226
+ this.afAriaActivedescendant = undefined;
227
+ this.afAriaLabelledby = undefined;
228
+ this.afAriaDescribedby = undefined;
229
+ this.afAriaControls = undefined;
230
+ this.afTrimValue = undefined;
231
+ this.afErrorMessageIsAlert = true;
232
+ }
233
+ onValueChanged(value) {
234
+ this.afValue = value;
235
+ }
236
+ onAfValueChanged(value) {
237
+ this.value = value;
238
+ if (this._input && this._input.value !== String(value !== null && value !== void 0 ? value : '')) {
239
+ this._input.value = String(value !== null && value !== void 0 ? value : '');
240
+ }
241
+ }
242
+ get errorMessageIsAlert() {
243
+ return (this.afErrorMessageIsAlert !== false &&
244
+ this.afErrorMessageIsAlert !== 'false');
245
+ }
246
+ afValidationTextWatch() {
247
+ this.setActiveValidationMessage();
248
+ }
249
+ /**
250
+ * Hämtar en referens till inputelementet. Bra för att t.ex. sätta fokus programmatiskt.
251
+ * @en Returns a reference to the input element. Handy for setting focus programmatically.
252
+ */
253
+ async afMGetFormControlElement() {
254
+ return this._input;
255
+ }
256
+ /**
257
+ * Lyssnar på om fokus sätts på custom-elementet och propagerar ner det till själva input-elementet.
258
+ * @en Listens for when focus is set on the custom element and propagates it down to the actual input element.
259
+ */
260
+ focusOnInput() {
261
+ this._input.focus();
262
+ }
263
+ componentWillLoad() {
264
+ this.afValue ? (this.value = this.afValue) : (this.afValue = this.value);
265
+ this.setActiveValidationMessage();
266
+ this.setHasButton();
267
+ }
268
+ componentWillUpdate() {
269
+ this.setHasButton();
270
+ }
271
+ componentDidLoad() {
272
+ this.afOnReady.emit();
273
+ }
274
+ setActiveValidationMessage() {
275
+ this.hasActiveValidationMessage = !!this.afValidationText;
276
+ }
277
+ get cssModifiers() {
278
+ return {
279
+ 'digi-form-input--small': this.afVariation === typographyVariation_enum.FormInputVariation.SMALL,
280
+ 'digi-form-input--medium': this.afVariation === typographyVariation_enum.FormInputVariation.MEDIUM,
281
+ 'digi-form-input--large': this.afVariation === typographyVariation_enum.FormInputVariation.LARGE,
282
+ 'digi-form-input--neutral': this.afValidation === typographyVariation_enum.FormInputValidation.NEUTRAL,
283
+ 'digi-form-input--success': this.afValidation === typographyVariation_enum.FormInputValidation.SUCCESS,
284
+ 'digi-form-input--error': this.afValidation === typographyVariation_enum.FormInputValidation.ERROR,
285
+ 'digi-form-input--warning': this.afValidation === typographyVariation_enum.FormInputValidation.WARNING,
286
+ [`digi-form-input--button-variation-${this.afButtonVariation}`]: !!this.afButtonVariation,
287
+ [`digi-form-input--has-button-${this.hasButton}`]: true,
288
+ 'digi-form-input--empty': !this.afValue &&
289
+ (!this.afValidation ||
290
+ this.afValidation === typographyVariation_enum.FormInputValidation.NEUTRAL)
291
+ };
292
+ }
293
+ blurHandler(e) {
294
+ const trimableTypes = [
295
+ formInputType_enum.FormInputType.TEXT,
296
+ formInputType_enum.FormInputType.EMAIL,
297
+ formInputType_enum.FormInputType.SEARCH,
298
+ formInputType_enum.FormInputType.TEL,
299
+ formInputType_enum.FormInputType.URL
300
+ ];
301
+ const shouldTrim = this.afTrimValue && trimableTypes.includes(this.afType);
302
+ if (shouldTrim && typeof e.target.value === 'string') {
303
+ const trimmedValue = e.target.value.trim();
304
+ if (trimmedValue !== e.target.value) {
305
+ this.afValue = this.value = trimmedValue;
306
+ if (this._input) {
307
+ this._input.value = trimmedValue;
308
+ }
309
+ // Emittar afOnInput så Angulars value accessor får det trimmade värdet
310
+ this.afOnInput.emit(e);
311
+ }
312
+ }
313
+ if (!this.touched) {
314
+ this.afOnTouched.emit(e);
315
+ this.touched = true;
316
+ }
317
+ this.afOnBlur.emit(e);
318
+ }
319
+ changeHandler(e) {
320
+ this.setActiveValidationMessage();
321
+ this.afOnChange.emit(e);
322
+ }
323
+ focusHandler(e) {
324
+ this.afOnFocus.emit(e);
325
+ }
326
+ focusoutHandler(e) {
327
+ this.afOnFocusout.emit(e);
328
+ }
329
+ keyupHandler(e) {
330
+ this.afOnKeyup.emit(e);
331
+ }
332
+ inputHandler(e) {
333
+ this.afValue = this.value =
334
+ this.afType === formInputType_enum.FormInputType.NUMBER
335
+ ? parseFloat(e.target.value)
336
+ : e.target.value;
337
+ if (!this.dirty) {
338
+ this.afOnDirty.emit(e);
339
+ this.dirty = true;
340
+ }
341
+ this.setActiveValidationMessage();
342
+ this.afOnInput.emit(e);
343
+ }
344
+ setHasButton() {
345
+ this.hasButton = !!this.hostElement.querySelector('[slot="button"]');
346
+ }
347
+ render() {
348
+ return (index.h(index.Host, { key: '2739bdd7385125581d7ea9c25a3610f5950c6a74', tabindex: -1 }, index.h("div", { key: '7e261c1e2fc4f37f4ddda861872a470c89181e16', class: Object.assign({ 'digi-form-input': true }, this.cssModifiers) }, index.h("digi-form-label", { key: '7e8fd283dedf0a851c714331ae640f7c74176bde', class: "digi-form-input__label", afFor: this.afId, afLabel: this.afLabel, afDescription: this.afLabelDescription, afRequired: this.afRequired, afAnnounceIfOptional: this.afAnnounceIfOptional, afRequiredText: this.afRequiredText, afAnnounceIfOptionalText: this.afAnnounceIfOptionalText }), index.h("div", { key: '68d715181c180ebaf957dfb46afb63b19b8a8188', class: "digi-form-input__input-wrapper" }, index.h("input", Object.assign({ key: 'e25ab871e988f9e8bd0837f75403e85f7423805f', class: "digi-form-input__input", ref: (el) => (this._input = el), onBlur: (e) => this.blurHandler(e), onChange: (e) => this.changeHandler(e), onFocus: (e) => this.focusHandler(e), onFocusout: (e) => this.focusoutHandler(e), onKeyUp: (e) => this.keyupHandler(e), onInput: (e) => this.inputHandler(e), "aria-activedescendant": this.afAriaActivedescendant, "aria-describedby": `${this.afAriaDescribedby} ${this.afId}--validation-message`, "aria-labelledby": this.afAriaLabelledby, "aria-autocomplete": this.afAriaAutocomplete, "aria-invalid": this.afValidation === typographyVariation_enum.FormInputValidation.ERROR
349
+ ? 'true'
350
+ : 'false', "aria-controls": this.afAriaControls, autocomplete: this.afAutocomplete, autofocus: this.afAutofocus ? this.afAutofocus : null, maxLength: this.afMaxlength, minLength: this.afMinlength, max: this.afMax, min: this.afMin, step: this.afStep, list: this.afList, role: this.afRole, dirName: this.afDirname, required: this.afRequired, id: this.afId, name: this.afName, type: this.afType, value: this.afValue }, (this.afInputmode == typographyVariation_enum.FormInputMode.DEFAULT
351
+ ? {}
352
+ : { inputmode: this.afInputmode }))), index.h("slot", { key: 'c14ae079a53099fc3928bcf3ac7f5517c20b0f36', name: "button" })), index.h("div", { key: '75d6afa176cd8620e31c384e169b3c84a3bb584d', class: "digi-form-input__footer" }, index.h("div", { key: '81029d425aae06e3c72c08afe982f2ff1a7bb81d', class: "digi-form-input__validation", "aria-atomic": "true", role: this.errorMessageIsAlert ? 'alert' : null, id: `${this.afId}--validation-message` }, this.hasActiveValidationMessage &&
353
+ this.afValidation != typographyVariation_enum.FormInputValidation.NEUTRAL && (index.h("digi-form-validation-message", { key: '9a8fec12db8c78a037a9b70194b32814d7641dad', class: "digi-form-input__validation-message", "af-variation": this.afValidation }, this.afValidationText)))))));
354
+ }
355
+ get hostElement() { return index.getElement(this); }
356
+ static get watchers() { return {
357
+ "value": ["onValueChanged"],
358
+ "afValue": ["onAfValueChanged"],
359
+ "afValidationText": ["afValidationTextWatch"]
360
+ }; }
361
+ };
362
+ FormInput.style = DigiFormInputStyle0;
363
+
364
+ const formLabelCss = ".sc-digi-form-label-h .digi-form-label.sc-digi-form-label{font-family:var(--digi--global--typography--font-family--default);font-size:var(--digi--typography--label--font-size--desktop);color:var(--digi--color--text--primary);display:flex;flex-direction:column}.sc-digi-form-label-h .digi-form-label__label--label.sc-digi-form-label{font-weight:var(--digi--typography--label--font-weight--desktop)}.sc-digi-form-label-h .digi-form-label__label--label.sc-digi-form-label,.sc-digi-form-label-h .digi-form-label__label--description.sc-digi-form-label{line-height:var(--digi--typography--label--line-height--desktop);cursor:pointer;display:block}.sc-digi-form-label-h .digi-form-label__label-group.sc-digi-form-label{display:inline-flex;align-items:center;gap:var(--digi--gutter--icon)}.sc-digi-form-label-h .digi-form-label__description.sc-digi-form-label{max-width:var(--digi--paragraph-width--medium);line-height:var(--digi--typography--label-description--line-height--desktop);font-size:var(--digi--typography--label-description--font-size--desktop)}";
365
+ const DigiFormLabelStyle0 = formLabelCss;
366
+
367
+ const FormLabel = class {
368
+ constructor(hostRef) {
369
+ index.registerInstance(this, hostRef);
370
+ this.labelText = undefined;
371
+ this.hasActionSlot = undefined;
372
+ this.afLabel = undefined;
373
+ this.afId = randomIdGenerator_util.randomIdGenerator('digi-form-label');
374
+ this.afFor = undefined;
375
+ this.afDescription = undefined;
376
+ this.afRequired = undefined;
377
+ this.afAnnounceIfOptional = false;
378
+ this.afRequiredText = text._t.required.toLowerCase();
379
+ this.afAnnounceIfOptionalText = text._t.optional.toLowerCase();
380
+ }
381
+ componentWillLoad() {
382
+ this.setLabelText();
383
+ this.validateFor();
384
+ this.handleSlotVisibility();
385
+ }
386
+ validateFor() {
387
+ if (this.afFor == null) {
388
+ logger_util.logger.warn(`digi-form-label must have a for attribute. Please add a for attribute using af-for`, this.hostElement);
389
+ }
390
+ }
391
+ setLabelText() {
392
+ this.labelText = `${this.afLabel} ${this.requiredText}`;
393
+ if (!this.afLabel) {
394
+ logger_util.logger.warn(`digi-form-label must have a label. Please add a label using af-label`, this.hostElement);
395
+ }
396
+ }
397
+ handleSlotVisibility() {
398
+ this.hasActionSlot = !!this.hostElement.querySelector('[slot="actions"]');
399
+ }
400
+ get requiredText() {
401
+ if (this.afRequired && !this.afAnnounceIfOptional) {
402
+ return this.afRequiredText ? ` (${this.afRequiredText})` : '';
403
+ }
404
+ else if (!this.afRequired && this.afAnnounceIfOptional) {
405
+ return this.afAnnounceIfOptionalText
406
+ ? ` (${this.afAnnounceIfOptionalText})`
407
+ : '';
408
+ }
409
+ else {
410
+ return '';
411
+ }
412
+ }
413
+ render() {
414
+ return (index.h("div", { key: 'ac9aec4d1d20cc37694af578a97a16a17291c9f3', class: "digi-form-label" }, index.h("div", { key: 'bf27c3012d1973798095e6b832572fc20863c5f1', class: "digi-form-label__label-group" }, this.afFor && this.afLabel && (index.h("label", { key: '75435e49548e4fa27330a35b033689a0ed9e99a7', class: "digi-form-label__label", htmlFor: this.afFor, id: this.afId }, index.h("span", { key: '0527ddcebbd2a1b215f42eaed06ba7fc28633d43', class: "digi-form-label__label--label" }, this.labelText), this.afDescription && (index.h("span", { key: '8a3b3e6a0ec0a97adb0760b390f0ddb34b3e0b87', class: "digi-form-label__label--description" }, this.afDescription)))), this.hasActionSlot && (index.h("div", { key: 'f2e6ad691a5cbc57b990416097454a393da35c01', class: "digi-form-label__actions" }, index.h("slot", { key: '1fab5cca94da7ad0f2b617db7f713d3b4d17c52d', name: "actions" }))))));
415
+ }
416
+ get hostElement() { return index.getElement(this); }
417
+ static get watchers() { return {
418
+ "afFor": ["validateFor"],
419
+ "afLabel": ["setLabelText"],
420
+ "afRequired": ["setLabelText"],
421
+ "afAnnounceIfOptional": ["setLabelText"]
422
+ }; }
423
+ };
424
+ FormLabel.style = DigiFormLabelStyle0;
425
+
426
+ const formSelectFilterCss = ".sc-digi-form-select-filter-h{--digi--form-select-filter--footer--background:var(--digi--color--background--secondary);--digi--form-select-filter--scroll--max-height:10.625rem;--digi--form-select-filter--scroll--padding:var(--digi--padding--small);--digi--form-select-filter--reset-button--margin-right:var(--digi--padding--small);--digi--form-select-filter--legend__border-bottom:var(--digi--border-width--primary) solid var(--digi--color--divider--primary);--digi--form-select-filter--list--margin:0;--digi--form-select-filter--list--padding:var(--digi--gutter--small) 0 0 0;--digi--form-select-filter--item--margin:var(--digi--gutter--small) 0;--digi--form-select-filter--toggle-icon--transition:ease-in-out 0.2s all;--digi--form-select-filter--dropdown--border-radius:var(--digi--border-radius--input);--digi--form-select-filter--dropdown--background:var(--digi--color--background--interactive--default--input-elements);--digi--form-select-filter--dropdown--min-width:18.75rem;--digi--form-select-filter--dropdown--margin-top:var(--digi--gutter--small);--digi--form-select-filter--dropdown--z-index:999;--digi--form-select-filter--dropdown--header--background:var(--digi--color--background--secondary-accent);--digi--form-select-filter--dropdown--item--cursor:pointer;--digi--form-select-filter--dropdown--item--height:auto;--digi--form-select-filter--dropdown--item--min-height:1.5rem;--digi--form-select-filter--dropdown--item--color:var(--digi--color--text--primary);--digi--form-select-filter--dropdown--item--font-size:var(--digi--typography--body--font-size--desktop);--digi--form-select-filter--dropdown--item--font-family:var(--digi--global--typography--font-family--default);--digi--form-select-filter--dropdown--item--font-weight--default:var(--digi--typography--link--font-weight--desktop);--digi--form-select-filter--dropdown--item--font-weight--selected:var(--digi--typography--link-bold--font-weight--desktop);--digi--form-select-filter--dropdown--item--font-weight--hover:var(--digi--typography--link-bold--font-weight--desktop);--digi--form-select-filter--dropdown--item--letter-spacing:0px;--digi--form-select-filter--dropdown--item--line-height:1.5;--digi--form-select-filter--dropdown--item--margin-bottom:0px;--digi--form-select-filter--dropdown--item--border-width:var(--digi--border-width--primary);--digi--form-select-filter--dropdown--item--border-type:var(--digi--border-style--primary);--digi--form-select-filter--dropdown--item--border-color:var(--digi--color--divider--primary);--digi--form-select-filter--dropdown--item--padding-y:var(--digi--margin--small);--digi--form-select-filter--dropdown--item--padding-x:var(--digi--margin--largest);--digi--form-select-filter--dropdown--item--multiple--padding-y:var(--digi--margin--small);--digi--form-select-filter--dropdown--item--multiple--padding-x:var(--digi--padding--largest-2);--digi--form-select-filter--dropdown--item--background-color--default:var(--digi--color--background--interactive--default--input-elements);--digi--form-select-filter--dropdown--item--background-color--focus:var(--digi--color--background--interactive--hover--quarternary);--digi--form-select-filter--dropdown--item--background-color--hover:var(--digi--color--background--interactive--hover--quarternary);--digi--form-select-filter--dropdown--item--background-color--active:var(--digi--color--background--interactive--selected--tertiary);--digi--form-select-filter--dropdown--item--background-color--selected:var(--digi--color--background--interactive--selected--tertiary);--digi--form-select-filter--dropdown--item--checkbox--background-color:var(--digi--color--background--interactive--default--input-elements);--digi--form-select-filter--dropdown--item--checkbox--background-color--selected:var(--digi--color--marking--indication--primary);--digi--form-select-filter--dropdown--item--checkbox--border-color:var(--digi--color--border--interactive--default--on-input);--digi--form-select-filter--dropdown--item--checkbox--border-width:var(--digi--border-width--primary);--digi--form-select-filter--dropdown--item--checkbox--border-style:var(--digi--border-style--primary);--digi--form-select-filter--dropdown--item--checkbox--border-radius:var(--digi--border-radius--tertiary);--digi--form-select-filter--dropdown--item--checkbox--width:1.25rem;--digi--form-select-filter--dropdown--item--checkbox--height:1.25rem;--digi--form-select-filter--toggle-button-indicator--color--default:var(--digi--color--background--interactive--default--input-elements);--digi--form-select-filter--toggle-button-indicator--color--active:var(--digi--color--marking--indication--primary);--digi--form-select-filter--toggle-button-indicator--width:1rem;--digi--form-select-filter--toggle-button-indicator--height:1rem;--digi--form-select-filter--toggle-button-indicator--margin-right:var(--digi--margin--small);--digi--form-select-filter--toggle-button-indicator--margin-left:calc(var(--digi--margin--smaller) * -1);--digi--form-select-filter--toggle-button--text--margin-right:var(--digi--margin--smaller);--digi--form-select-filter--toggle-button-indicator--color:var(--digi--color--marking--indication--primary);--digi--form-select-filter--toggle-icon--width:0.875rem;--digi--form-select-filter--toggle-icon--height:0.875rem;--digi--form-select-filter--search-input--border-radius:var(--digi--border-radius--input);--digi--form-select-filter--search-input--border-width:var(--digi--border-width--input-regular);--digi--form-select-filter--search-input--border-style:var(--digi--border-style--primary);--digi--form-select-filter--search-input--border-color:var(--digi--form-select-filter--toggle-button--border-width--neutral);--digi--form-select-filter--search-input--height:var(--digi--input-height--medium);--digi--form-select-filter--search-input--width:100%;--digi--form-select-filter--legend--font-weight:var(--digi--typography--preamble--font-weight--desktop);--digi--form-select-filter--legend--font-family:var(--digi--global--typography--font-family--default);--digi--form-select-filter--legend--font-size:var(--digi--typography--preamble--font-size--desktop);--digi--form-select-filter--toggle-button--border-width--neutral:var(--digi--border-width--input-regular);--digi--form-select-filter--toggle-button--border-color--neutral:var(--digi--color--border--interactive--default--on-input);--digi--form-select-filter--toggle-button--background--neutral:var(--digi--color--background--interactive--default--input-elements);--digi--form-select-filter--toggle-button--border-width--success:var(--digi--border-width--input-validation);--digi--form-select-filter--toggle-button--border-color--success:var(--digi--color--border--interactive--validation--success);--digi--form-select-filter--toggle-button--background--success:var(--digi--color--background--interactive--validation--success);--digi--form-select-filter--toggle-button--border-width--warning:var(--digi--border-width--input-validation);--digi--form-select-filter--toggle-button--border-color--warning:var(--digi--color--border--interactive--validation--warning);--digi--form-select-filter--toggle-button--background--warning:var(--digi--color--background--interactive--validation--warning);--digi--form-select-filter--toggle-button--border-width--error:var(--digi--border-width--input-validation);--digi--form-select-filter--toggle-button--border-color--error:var(--digi--color--border--interactive--validation--error);--digi--form-select-filter--toggle-button--background--error:var(--digi--color--background--interactive--validation--error);box-sizing:content-box}.sc-digi-form-select-filter-h .digi--a11y--sr-only.sc-digi-form-select-filter{border:0;clip:rect(1px, 1px, 1px, 1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sc-digi-form-select-filter-h .digi-form-select-filter.sc-digi-form-select-filter{display:flex;flex-direction:column;gap:0.4em;position:relative;--INDICATOR--BACKGROUND:var(--digi--form-select-filter--toggle-button-indicator--color--default);--SCROLL--MAX-HEIGHT:var(--digi--form-select-filter--scroll--max-height)}.sc-digi-form-select-filter-h .digi-form-select-filter--neutral.sc-digi-form-select-filter{--BORDER-WIDTH:var(\n --digi--form-select-filter--toggle-button--border-width--neutral\n );--BORDER-COLOR:var(\n --digi--form-select-filter--toggle-button--border-color--neutral\n );--BACKGROUND:var(\n --digi--form-select-filter--toggle-button--background--neutral\n )}.sc-digi-form-select-filter-h .digi-form-select-filter--success.sc-digi-form-select-filter{--BORDER-WIDTH:var(\n --digi--form-select-filter--toggle-button--border-width--success\n );--BORDER-COLOR:var(\n --digi--form-select-filter--toggle-button--border-color--success\n );--BACKGROUND:var(\n --digi--form-select-filter--toggle-button--background--success\n )}.sc-digi-form-select-filter-h .digi-form-select-filter--warning.sc-digi-form-select-filter{--BORDER-WIDTH:var(\n --digi--form-select-filter--toggle-button--border-width--warning\n );--BORDER-COLOR:var(\n --digi--form-select-filter--toggle-button--border-color--warning\n );--BACKGROUND:var(\n --digi--form-select-filter--toggle-button--background--warning\n )}.sc-digi-form-select-filter-h .digi-form-select-filter--error.sc-digi-form-select-filter{--BORDER-WIDTH:var(\n --digi--form-select-filter--toggle-button--border-width--error\n );--BORDER-COLOR:var(\n --digi--form-select-filter--toggle-button--border-color--error\n );--BACKGROUND:var(\n --digi--form-select-filter--toggle-button--background--error\n )}.sc-digi-form-select-filter-h .digi-form-select-filter--open.sc-digi-form-select-filter .digi-form-select-filter__toggle-icon.sc-digi-form-select-filter{transform:rotate(-180deg)}.sc-digi-form-select-filter-h .digi-form-select-filter__toggle-button.sc-digi-form-select-filter{background:var(--BACKGROUND);border:var(--BORDER-WIDTH) solid var(--BORDER-COLOR);border-radius:var(--digi--border-radius--input);color:var(--digi--color--text--primary);cursor:pointer;display:flex;justify-content:space-between;align-items:center;font-weight:400;font-size:var(--digi--typography--body--font-size--desktop);width:100%;padding:0 var(--digi--gutter--medium);min-height:var(--digi--input-height--medium);font-family:var(--digi--global--typography--font-family--default)}.sc-digi-form-select-filter-h .digi-form-select-filter__toggle-button.sc-digi-form-select-filter:focus-visible,.sc-digi-form-select-filter-h .digi-form-select-filter__toggle-button.sc-digi-form-select-filter:focus{outline:2px solid black;outline-offset:2px;box-shadow:0px 0px 0px 5px white}.sc-digi-form-select-filter-h .digi-form-select-filter__toggle-icon.sc-digi-form-select-filter{transition:var(--digi--form-select-filter--toggle-icon--transition)}.sc-digi-form-select-filter-h .digi-form-select-filter__toggle-icon.sc-digi-form-select-filter-s>[slot^=icon],.sc-digi-form-select-filter-h .digi-form-select-filter__toggle-icon .sc-digi-form-select-filter-s>[slot^=icon]{--digi--icon--width:var(--digi--form-select-filter--toggle-icon--width);--digi--icon--height:var(--digi--form-select-filter--toggle-icon--height)}.sc-digi-form-select-filter-h .digi-form-select-filter__legend.sc-digi-form-select-filter{font-weight:var(--digi--form-select-filter--legend--font-weight);font-family:var(--digi--form-select-filter--legend--font-family);font-size:var(--digi--form-select-filter--legend--font-size);border:0;padding:0;margin:0;border:0;clip:rect(1px, 1px, 1px, 1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sc-digi-form-select-filter-h .digi-form-select-filter__scroll.sc-digi-form-select-filter{max-height:var(--SCROLL--MAX-HEIGHT);overflow-y:auto}.sc-digi-form-select-filter-h .digi-form-select-filter__header.sc-digi-form-select-filter{background-color:var(--digi--form-select-filter--dropdown--header--background);padding:12px 12px 22px}.sc-digi-form-select-filter-h .digi-form-select-filter__header.sc-digi-form-select-filter input.sc-digi-form-select-filter{border-radius:var(--digi--form-select-filter--search-input--border-radius);border-width:var(--digi--form-select-filter--search-input--border-width);border-style:var(--digi--form-select-filter--search-input--border-style);border-color:var(--digi--form-select-filter--search-input--border-color);height:var(--digi--form-select-filter--search-input--height);width:var(--digi--form-select-filter--search-input--width)}.sc-digi-form-select-filter-h .digi-form-select-filter__header.sc-digi-form-select-filter legend.sc-digi-form-select-filter{width:100%;border-bottom:var(--digi--form-select-filter--legend__border-bottom)}.sc-digi-form-select-filter-h .digi-form-select-filter__footer.sc-digi-form-select-filter{display:flex;align-items:center;justify-content:center;background:var(--digi--form-select-filter--footer--background);padding:var(--digi--form-select-filter--scroll--padding)}.sc-digi-form-select-filter-h .digi-form-select-filter__reset-button.sc-digi-form-select-filter{display:inline-block;margin-right:var(--digi--form-select-filter--reset-button--margin-right)}.sc-digi-form-select-filter-h .digi-form-select-filter__dropdown.sc-digi-form-select-filter{box-shadow:0 2px 6px 0 rgba(0, 0, 0, 0.7);min-width:var(--digi--form-select-filter--dropdown--min-width);width:100%;position:absolute;z-index:var(--digi--form-select-filter--dropdown--z-index);background:var(--digi--form-select-filter--dropdown--background);border-radius:var(--digi--form-select-filter--dropdown--border-radius);overflow:hidden;margin-top:var(--digi--form-select-filter--dropdown--margin-top)}.sc-digi-form-select-filter-h .digi-form-select-filter__dropdown.sc-digi-form-select-filter fieldset.sc-digi-form-select-filter{border:none;padding:0;margin:0}@media (min-width: 48rem){.sc-digi-form-select-filter-h .digi-form-select-filter__dropdown--right.sc-digi-form-select-filter{right:0}}.sc-digi-form-select-filter-h .digi-form-select-filter__dropdown--hidden.sc-digi-form-select-filter{display:none}.sc-digi-form-select-filter-h .digi-form-select-filter__label.sc-digi-form-select-filter{display:block}.sc-digi-form-select-filter-h .digi-form-select-filter__toggle-button-wrapper--activated.sc-digi-form-select-filter{display:flex;align-items:center}.sc-digi-form-select-filter-h .digi-form-select-filter__toggle-button-indicator.sc-digi-form-select-filter{display:none;--digi--icon--color:var(--digi--form-select-filter--toggle-button-indicator--color)}.sc-digi-form-select-filter-h .digi-form-select-filter__toggle-button-indicator--active.sc-digi-form-select-filter{display:flex;margin-right:var(--digi--form-select-filter--toggle-button-indicator--margin-right);width:var(--digi--form-select-filter--toggle-button-indicator--width);height:var(--digi--form-select-filter--toggle-button-indicator--height)}.sc-digi-form-select-filter-h .digi-form-select-filter__search-status.sc-digi-form-select-filter{font-family:var(--digi--global--typography--font-family--default);font-size:var(--digi--typography--label--font-size--desktop);color:var(--digi--color--text--primary)}.sc-digi-form-select-filter-h .digi-form-select-filter__list.sc-digi-form-select-filter{margin:var(--digi--form-select-filter--list--margin);padding:0;max-width:100%}.sc-digi-form-select-filter-h .digi-form-select-filter__item.sc-digi-form-select-filter{background-color:var(--digi--form-select-filter--dropdown--item--background-color--default);border-width:0;box-sizing:border-box;border-bottom-width:var(--digi--form-select-filter--dropdown--item--border-width);border-style:var(--digi--form-select-filter--dropdown--item--border-type);border-color:var(--digi--form-select-filter--dropdown--item--border-color);cursor:var(--digi--form-select-filter--dropdown--item--cursor);color:var(--digi--form-select-filter--dropdown--item--color);display:block;font-size:var(--digi--form-select-filter--dropdown--item--font-size);font-family:var(--digi--form-select-filter--dropdown--item--font-family);font-weight:var(--digi--form-select-filter--dropdown--item--font-weight--default);padding:var(--digi--form-select-filter--dropdown--item--padding-y) var(--digi--form-select-filter--dropdown--item--padding-x);position:relative;height:var(--digi--form-select-filter--dropdown--item--height);min-height:var(--digi--form-select-filter--dropdown--item--min-height);margin-bottom:var(--digi--form-select-filter--dropdown--item--margin-bottom);letter-spacing:var(--digi--form-select-filter--dropdown--item--letter-spacing);line-height:var(--digi--form-select-filter--dropdown--item--line-height)}.sc-digi-form-select-filter-h .digi-form-select-filter__item.sc-digi-form-select-filter:focus-visible{background-color:var(--digi--form-select-filter--dropdown--item--background-color--focus);outline:2px solid black;outline-offset:-3px;box-shadow:0px 0px 0px 5px inset white}.sc-digi-form-select-filter-h .digi-form-select-filter__item.sc-digi-form-select-filter:hover{background-color:var(--digi--form-select-filter--dropdown--item--background-color--hover);font-weight:var(--digi--form-select-filter--dropdown--item--font-weight--hover)}.sc-digi-form-select-filter-h .digi-form-select-filter__item.sc-digi-form-select-filter:active{background-color:var(--digi--form-select-filter--dropdown--item--background-color--active)}.sc-digi-form-select-filter-h .digi-form-select-filter__item[aria-checked=true].sc-digi-form-select-filter{font-weight:var(--digi--form-select-filter--dropdown--item--font-weight--selected);background-color:var(--digi--form-select-filter--dropdown--item--background-color--selected)}.sc-digi-form-select-filter-h .digi-form-select-filter__item[dir=rtl].sc-digi-form-select-filter{text-align:right}.sc-digi-form-select-filter-h .digi-form-select-filter__item[role=radio].sc-digi-form-select-filter .digi-form-select-filter__item__icon.sc-digi-form-select-filter{position:absolute;width:13px;height:25px;left:7px}.sc-digi-form-select-filter-h .digi-form-select-filter__item[role=radio][dir=rtl].sc-digi-form-select-filter::before{right:3px}.sc-digi-form-select-filter-h .digi-form-select-filter__item[role=radio][dir=rtl].sc-digi-form-select-filter .digi-form-select-filter__item__icon.sc-digi-form-select-filter{left:auto;right:7px}.sc-digi-form-select-filter-h .digi-form-select-filter__item[role=checkbox].sc-digi-form-select-filter{padding:var(--digi--form-select-filter--dropdown--item--multiple--padding-y) var(--digi--form-select-filter--dropdown--item--multiple--padding-x)}.sc-digi-form-select-filter-h .digi-form-select-filter__item[role=checkbox][aria-checked=true].sc-digi-form-select-filter:before{background:var(--digi--form-select-filter--dropdown--item--checkbox--background-color--selected);border-color:var(--digi--form-select-filter--dropdown--item--checkbox--background-color--selected)}.sc-digi-form-select-filter-h .digi-form-select-filter__item[role=checkbox].sc-digi-form-select-filter::before{content:\"\";position:absolute;background-color:var(--digi--form-select-filter--dropdown--item--checkbox--background-color);border-color:var(--digi--form-select-filter--dropdown--item--checkbox--border-color);border-width:var(--digi--form-select-filter--dropdown--item--checkbox--border-width);border-style:var(--digi--form-select-filter--dropdown--item--checkbox--border-style);height:var(--digi--form-select-filter--dropdown--item--checkbox--width);width:var(--digi--form-select-filter--dropdown--item--checkbox--height);border-radius:var(--digi--form-select-filter--dropdown--item--checkbox--border-radius);left:12px;transform:translateY(1px)}.sc-digi-form-select-filter-h .digi-form-select-filter__item[role=checkbox].sc-digi-form-select-filter .digi-form-select-filter__item__icon.sc-digi-form-select-filter{position:absolute;width:13px;left:16px;--digi--icon--color:white}.sc-digi-form-select-filter-h .digi-form-select-filter__item[role=checkbox][dir=rtl].sc-digi-form-select-filter::before{right:12px}.sc-digi-form-select-filter-h .digi-form-select-filter__item[role=checkbox][dir=rtl].sc-digi-form-select-filter .digi-form-select-filter__item__icon.sc-digi-form-select-filter{left:auto;right:16px}.sc-digi-form-select-filter-h .digi-form-select-filter__toggle-button-text.sc-digi-form-select-filter{margin-right:var(--digi--form-select-filter--toggle-button--text--margin-right)}.sc-digi-form-select-filter-h .hidden.sc-digi-form-select-filter{display:none}";
427
+ const DigiFormSelectFilterStyle0 = formSelectFilterCss;
428
+
429
+ const FormSelectFilter = class {
430
+ constructor(hostRef) {
431
+ index.registerInstance(this, hostRef);
432
+ this.afOnFocusout = index.createEvent(this, "afOnFocusout", 7);
433
+ this.afOnSubmitFilters = index.createEvent(this, "afOnSubmitFilters", 7);
434
+ this.afOnFilterClosed = index.createEvent(this, "afOnFilterClosed", 7);
435
+ this.afOnResetFilters = index.createEvent(this, "afOnResetFilters", 7);
436
+ this.afOnSelect = index.createEvent(this, "afOnSelect", 7);
437
+ this.afOnQueryChanged = index.createEvent(this, "afOnQueryChanged", 7);
438
+ this._searchQuery = '';
439
+ /** True when `value` was set from outside (e.g. Angular CVA) — then value is selection master. */
440
+ this._valueIsMaster = false;
441
+ /** Guards internal `value` writes so they don't flip `_valueIsMaster`. */
442
+ this._updatingValueInternally = false;
443
+ this.isOpen = false;
444
+ this.focusListItemIndex = 0;
445
+ this.focusInList = false;
446
+ this._afListItems = undefined;
447
+ this._filteredResult = [];
448
+ this._selectedItems = [];
449
+ this.afDescription = undefined;
450
+ this.afDisableValidation = undefined;
451
+ this.afValidation = typographyVariation_enum.FormSelectFilterValidation.NEUTRAL;
452
+ this.afValidationText = undefined;
453
+ this.afRequired = undefined;
454
+ this.afRequiredText = undefined;
455
+ this.afAnnounceIfOptional = false;
456
+ this.afAnnounceIfOptionalText = undefined;
457
+ this.sortAlphabetically = true;
458
+ this.value = [];
459
+ this.afMultipleItems = false;
460
+ this.afListItems = undefined;
461
+ this.afId = randomIdGenerator_util.randomIdGenerator('digi-form-select-filter');
462
+ this.afFilterButtonTextLabel = undefined;
463
+ this.afFilterButtonText = undefined;
464
+ this.afFilterButtonTextMultipleValues = undefined;
465
+ this.afSubmitButtonText = undefined;
466
+ this.afSubmitButtonTextAriaLabel = undefined;
467
+ this.afResetButtonText = text._t.clear;
468
+ this.afResetButtonTextAriaLabel = undefined;
469
+ this.afHideResetButton = false;
470
+ this.afAlignRight = undefined;
471
+ this.afName = undefined;
472
+ this.afEmptySearchMessage = 'Inga sökträffar för';
473
+ this.afFilterButtonAriaDescribedby = undefined;
474
+ this.afErrorMessageIsAlert = true;
475
+ }
476
+ onValueChanged(newValue) {
477
+ let parsedValue;
478
+ if (typeof newValue === 'string') {
479
+ parsedValue = newValue ? JSON.parse(newValue) : [];
480
+ }
481
+ else {
482
+ parsedValue = newValue || [];
483
+ }
484
+ if (!this._updatingValueInternally) {
485
+ this._valueIsMaster = true;
486
+ }
487
+ this.value = parsedValue;
488
+ this.syncValueAndSelectedListItems('valueChange');
489
+ }
490
+ handleListItems() {
491
+ if (this.afListItems) {
492
+ try {
493
+ if (this.afListItems.constructor === Array) {
494
+ this._afListItems = this.afListItems;
495
+ }
496
+ else if (typeof this.afListItems === 'string') {
497
+ this._afListItems = JSON.parse(this.afListItems);
498
+ }
499
+ else {
500
+ throw `Invalid type in "af-list-items" attribute`;
501
+ }
502
+ this.giveItemsValueIfNoneExist();
503
+ this.sortListAlphabetically();
504
+ this.syncValueAndSelectedListItems('afListItemsChange');
505
+ this.filterResults();
506
+ }
507
+ catch (e) {
508
+ logger_util.logger.warn(`Invalid JSON in "af-list-items" attribute`, this.hostElement, e);
509
+ return;
510
+ }
511
+ }
512
+ }
513
+ get errorMessageIsAlert() {
514
+ return (this.afErrorMessageIsAlert !== false &&
515
+ this.afErrorMessageIsAlert !== 'false');
516
+ }
517
+ /**
518
+ * Funktion för att rensa valda värden från komponenten
519
+ * @en Function for clearing selected values from component
520
+ */
521
+ async afMReset() {
522
+ this.resetSelectItems();
523
+ }
524
+ /**
525
+ * Funktion för att stänga dropdownen
526
+ * @en Function for closing the dropdown
527
+ */
528
+ async afMCloseDropdown() {
529
+ this.setClosed();
530
+ }
531
+ clickHandler(e) {
532
+ const target = e.target;
533
+ const selector = `#${this.afId}-identifier`;
534
+ if (detectClickOutside_util.detectClickOutside(target, selector) && this.isOpen) {
535
+ this.emitFilterClosedEvent();
536
+ }
537
+ }
538
+ focusoutHandler(e) {
539
+ const target = e.target;
540
+ const selector = `#${this.afId}-identifier`;
541
+ const focusOutsideFilter = detectFocusOutside_util.detectFocusOutside(target, selector);
542
+ if (focusOutsideFilter && this.isOpen) {
543
+ this.emitFilterClosedEvent();
544
+ }
545
+ else {
546
+ this.focusInList = !detectFocusOutside_util.detectFocusOutside(target, `#${this.afId}-select-filter-list`);
547
+ }
548
+ }
549
+ /**
550
+ * Lyssnar på om fokus sätts på custom-elementet och propagerar ner det till toggle-knappen.
551
+ * @en Listens for when focus is set on the custom element and propagates it down to the toggle butto.
552
+ */
553
+ focusOnElement() {
554
+ this._toggleButton.focus();
555
+ }
556
+ componentWillLoad() {
557
+ /* Stencil @Watch does not run for the initial prop value.
558
+ * Given that Angular Control Value Accessors writeValue often sets `value` before willLoad —
559
+ * we need to force a value check here with bootstrapInitialValue .*/
560
+ this.bootstrapInitialValue();
561
+ this.handleListItems();
562
+ }
563
+ bootstrapInitialValue() {
564
+ if (typeof this.value === 'string') {
565
+ const parsed = this.value ? JSON.parse(this.value) : [];
566
+ this._updatingValueInternally = true;
567
+ this.value = parsed;
568
+ this._updatingValueInternally = false;
569
+ }
570
+ if (Array.isArray(this.value) && this.value.length > 0) {
571
+ this._valueIsMaster = true;
572
+ }
573
+ }
574
+ /**
575
+ * Keep `value` and `afListItems[].selected` in sync.
576
+ * - If `value` was set externally (`_valueIsMaster`), value wins on list updates.
577
+ * - Otherwise selection is seeded from `afListItems[].selected` (React/vanilla data-as-master).
578
+ * Does not emit `afOnSelect` — that is reserved for user interaction so Angular Control Value Accessors
579
+ * does not get feedback loops on prop sync.
580
+ */
581
+ syncValueAndSelectedListItems(whereDidTheChangeComeFrom) {
582
+ if (!this._afListItems) {
583
+ return;
584
+ }
585
+ if (whereDidTheChangeComeFrom === 'afListItemsChange') {
586
+ if (this._valueIsMaster) {
587
+ this.applyValueToListItems(this.value);
588
+ }
589
+ else {
590
+ this._selectedItems = this._afListItems.filter((item) => item.selected);
591
+ this.setValueInternally([...this._selectedItems]);
592
+ }
593
+ return;
594
+ }
595
+ this.applyValueToListItems(this.value);
596
+ }
597
+ applyValueToListItems(value) {
598
+ const selectedValues = new Set((value !== null && value !== void 0 ? value : []).map((item) => item.value));
599
+ this._afListItems.forEach((item) => {
600
+ item.selected = selectedValues.has(item.value);
601
+ });
602
+ this._selectedItems = this._afListItems.filter((item) => selectedValues.has(item.value));
603
+ }
604
+ setValueInternally(nextValue) {
605
+ this._updatingValueInternally = true;
606
+ this.value = nextValue;
607
+ this._updatingValueInternally = false;
608
+ }
609
+ setClosed(focusToggleButton = false) {
610
+ this.isOpen = false;
611
+ if (focusToggleButton) {
612
+ document.getElementById(`${this.afId}`).focus();
613
+ }
614
+ this.setScroll(0);
615
+ this._searchQuery = '';
616
+ this.afOnQueryChanged.emit('');
617
+ this.afOnSubmitFilters.emit(this._selectedItems);
618
+ this.filterResults();
619
+ }
620
+ setScroll(scrollY) {
621
+ document.querySelector(`#${this.afId}-dropdown-menu .digi-form-select-filter__scroll`).scrollTop = scrollY;
622
+ }
623
+ setOpen() {
624
+ this.isOpen = true;
625
+ this.focusListItemIndex = 0;
626
+ setTimeout(() => {
627
+ this.setFocusSearch();
628
+ }, 50);
629
+ }
630
+ giveItemsValueIfNoneExist() {
631
+ this._afListItems
632
+ .filter((item) => {
633
+ return item.value === undefined;
634
+ })
635
+ .forEach((item) => {
636
+ item.value = item.label;
637
+ });
638
+ }
639
+ sortListAlphabetically() {
640
+ if (!this.sortAlphabetically) {
641
+ return;
642
+ }
643
+ this._afListItems.sort((a, b) => {
644
+ if (a.label < b.label) {
645
+ return -1;
646
+ }
647
+ if (a.label > b.label) {
648
+ return 1;
649
+ }
650
+ return 0;
651
+ });
652
+ }
653
+ toggleDropdown() {
654
+ return this.isOpen ? this.setClosed() : this.setOpen();
655
+ }
656
+ inputItem(identifier, index) {
657
+ const item = this.hostElement
658
+ .querySelectorAll(`#${identifier} .digi-form-select-filter__item`)
659
+ .item(index);
660
+ return item;
661
+ }
662
+ emitFilterClosedEvent() {
663
+ this.setClosed(true);
664
+ this.afOnFilterClosed.emit();
665
+ }
666
+ setFocusItem() {
667
+ const element = this.inputItem(`${this.afId}-select-filter-list`, this.focusListItemIndex);
668
+ if (element) {
669
+ element.focus();
670
+ }
671
+ }
672
+ setFocusSearch() {
673
+ const element = this.hostElement.querySelector('input');
674
+ if (element) {
675
+ element.focus();
676
+ }
677
+ }
678
+ incrementFocusItem() {
679
+ const listLength = this.showNeutralValue
680
+ ? this._filteredResult.length
681
+ : this._filteredResult.length - 1;
682
+ if (this.focusListItemIndex < listLength) {
683
+ this.focusListItemIndex = this.focusListItemIndex + 1;
684
+ this.setFocusItem();
685
+ return;
686
+ }
687
+ else {
688
+ if (!this.afMultipleItems) {
689
+ this.focusListItemIndex = 0;
690
+ this.setFocusItem();
691
+ return;
692
+ }
693
+ }
694
+ this.tabHandler();
695
+ }
696
+ decrementFocusItem() {
697
+ if (this.focusListItemIndex === 0) {
698
+ this.setFocusSearch();
699
+ return;
700
+ }
701
+ if (this.focusListItemIndex > 0) {
702
+ this.focusListItemIndex = this.focusListItemIndex - 1;
703
+ }
704
+ this.setFocusItem();
705
+ }
706
+ downHandler(e) {
707
+ e.detail.preventDefault();
708
+ if (e.detail.code === 'ArrowDown' || e.detail.code === 'ArrowRight') {
709
+ this.incrementFocusItem();
710
+ }
711
+ }
712
+ upHandler(e) {
713
+ e.detail.preventDefault();
714
+ if (e.detail.code === 'ArrowUp' || e.detail.code === 'ArrowLeft') {
715
+ this.decrementFocusItem();
716
+ }
717
+ }
718
+ homeHandler(e) {
719
+ e.detail.preventDefault();
720
+ this.focusListItemIndex = 0;
721
+ this.setFocusItem();
722
+ }
723
+ endHandler(e) {
724
+ e.detail.preventDefault();
725
+ this.focusListItemIndex = this.showNeutralValue
726
+ ? this._filteredResult.length
727
+ : this._filteredResult.length - 1;
728
+ this.setFocusItem();
729
+ }
730
+ enterHandler(e) {
731
+ e.detail.preventDefault();
732
+ e.detail.target.click();
733
+ }
734
+ spaceHandler(e) {
735
+ e.detail.preventDefault();
736
+ e.detail.target.click();
737
+ }
738
+ escHandler() {
739
+ if (this.isOpen) {
740
+ this.setClosed(true);
741
+ }
742
+ }
743
+ tabHandler() {
744
+ if (this.isOpen && this.focusInList) {
745
+ if (this.afMultipleItems && this._submitButton) {
746
+ setTimeout(() => {
747
+ var _a;
748
+ if (this._submitButton) {
749
+ (_a = this._submitButton.querySelector('button')) === null || _a === void 0 ? void 0 : _a.focus();
750
+ }
751
+ }, 10);
752
+ }
753
+ else {
754
+ this.setClosed(true);
755
+ }
756
+ }
757
+ }
758
+ shiftHandler() {
759
+ if (this.isOpen && this.focusInList) {
760
+ if (this.afMultipleItems && this._toggleButton) {
761
+ this._toggleButton.querySelector('button').focus();
762
+ }
763
+ else {
764
+ this.setFocusSearch();
765
+ }
766
+ }
767
+ }
768
+ filterResults() {
769
+ if (this._searchQuery && this._searchQuery.length > 0) {
770
+ this._filteredResult = this._afListItems.filter((item) => {
771
+ return item.label
772
+ .toLowerCase()
773
+ .includes(this._searchQuery.toLowerCase());
774
+ });
775
+ }
776
+ else {
777
+ this._filteredResult = this._afListItems;
778
+ }
779
+ }
780
+ inputSearchKeyboardHandler(e) {
781
+ if (e.code === 'ArrowDown') {
782
+ e.preventDefault();
783
+ this.setFocusItem();
784
+ }
785
+ if (e.code === 'Enter' && this._searchQuery !== '') {
786
+ e.preventDefault();
787
+ this.setFocusItem();
788
+ }
789
+ }
790
+ inputSearchInputHandler(e) {
791
+ this._searchQuery = e.target.value;
792
+ this.afOnQueryChanged.emit(this._searchQuery);
793
+ this.filterResults();
794
+ }
795
+ resetSelectItems(close = false) {
796
+ this._selectedItems = [];
797
+ this.setValueInternally([]);
798
+ this.afOnSelect.emit([]);
799
+ this._searchQuery = '';
800
+ this.filterResults();
801
+ if (close) {
802
+ this.emitFilterClosedEvent();
803
+ }
804
+ this.afOnResetFilters.emit();
805
+ }
806
+ selectItemHandler(item) {
807
+ if (this.afMultipleItems) {
808
+ item.selected = !item.selected;
809
+ if (this._selectedItems.filter((x) => {
810
+ return x.value === item.value;
811
+ }).length > 0) {
812
+ //ITEM VALUE ALREADY EXISTS IN LIST, DELETE FROM LIST
813
+ this._selectedItems.splice(this._selectedItems.findIndex((e) => e.value === item.value), 1);
814
+ }
815
+ else {
816
+ this._selectedItems = [...this._selectedItems, item];
817
+ }
818
+ }
819
+ else {
820
+ this._selectedItems.forEach((item) => {
821
+ item.selected = false;
822
+ });
823
+ item.selected = true;
824
+ this._selectedItems = [item];
825
+ this.emitFilterClosedEvent();
826
+ }
827
+ this.setValueInternally([...this._selectedItems]);
828
+ this.afOnSelect.emit(this._selectedItems);
829
+ this.filterResults();
830
+ }
831
+ isSelected(textValue) {
832
+ if (textValue && this._selectedItems && this._selectedItems.length > 0) {
833
+ return (this._selectedItems.filter((item) => {
834
+ return item.value === textValue;
835
+ }).length > 0);
836
+ }
837
+ return false;
838
+ }
839
+ get cssModifiers() {
840
+ return {
841
+ 'digi-form-select-filter--open': this.isOpen,
842
+ 'digi-form-select-filter--neutral': this.afValidation === typographyVariation_enum.FormSelectFilterValidation.NEUTRAL,
843
+ 'digi-form-select-filter--success': this.afValidation === typographyVariation_enum.FormSelectFilterValidation.SUCCESS,
844
+ 'digi-form-select-filter--warning': this.afValidation === typographyVariation_enum.FormSelectFilterValidation.WARNING,
845
+ 'digi-form-select-filter--error': this.afValidation === typographyVariation_enum.FormSelectFilterValidation.ERROR
846
+ };
847
+ }
848
+ get cssModifiersToggleButtonIndicator() {
849
+ return {
850
+ 'digi-form-select-filter__toggle-button-indicator--active': this._selectedItems.length > 0
851
+ };
852
+ }
853
+ get cssModifiersToggleButtonWrapper() {
854
+ return {
855
+ 'digi-form-select-filter__toggle-button-wrapper--activated': this._selectedItems.length > 0
856
+ };
857
+ }
858
+ buttonText(isAriaLabel) {
859
+ const ariaLabelText = (text = '') => {
860
+ return isAriaLabel ? text : '';
861
+ };
862
+ if (this._selectedItems && this._selectedItems.length === 1) {
863
+ return (ariaLabelText(this.afFilterButtonTextLabel + ': ') +
864
+ this._selectedItems[0].label);
865
+ }
866
+ else if (this._selectedItems &&
867
+ this._selectedItems.length > 0 &&
868
+ this.afMultipleItems) {
869
+ if (this.afFilterButtonTextMultipleValues) {
870
+ return (ariaLabelText(this.afFilterButtonTextLabel + ': ') +
871
+ this.afFilterButtonTextMultipleValues.replace('{count}', this._selectedItems.length.toString()));
872
+ }
873
+ else {
874
+ return (ariaLabelText(this.afFilterButtonTextLabel + ': ') +
875
+ `${this._selectedItems.length} valda`);
876
+ }
877
+ }
878
+ else {
879
+ return (ariaLabelText(this.afFilterButtonTextLabel
880
+ ? this.afFilterButtonTextLabel + ': '
881
+ : '') + this.afFilterButtonText);
882
+ }
883
+ }
884
+ get renderButtonLabel() {
885
+ return this.buttonText(false);
886
+ }
887
+ get ariaLabel() {
888
+ return this.buttonText(true);
889
+ }
890
+ get showNeutralValue() {
891
+ return (!this.afMultipleItems &&
892
+ this.afFilterButtonText &&
893
+ this._searchQuery.length === 0);
894
+ }
895
+ showValidation() {
896
+ return !this.afDisableValidation &&
897
+ this.afValidation !== typographyVariation_enum.FormSelectFilterValidation.NEUTRAL &&
898
+ this.afValidationText
899
+ ? true
900
+ : false;
901
+ }
902
+ renderEmptyStateBox() {
903
+ let statusMessage = '';
904
+ if (this._filteredResult && this._filteredResult.length > 0) {
905
+ statusMessage = `${this._filteredResult.length} sökträff${this._filteredResult.length > 1 ? 'ar' : ''}`;
906
+ }
907
+ else if (this._filteredResult.length === 0) {
908
+ statusMessage = `${this.afEmptySearchMessage} ${this._searchQuery}`;
909
+ }
910
+ return (index.h(index.Fragment, null, index.h("div", { role: "status", id: `${this.afId}-searchstatus`, class: {
911
+ 'digi-form-select-filter__search-status': true,
912
+ 'digi--a11y--sr-only': this._filteredResult && this._filteredResult.length > 0
913
+ } }, index.h("span", null, " ", statusMessage, " "), index.h("div", { class: {
914
+ hidden: this._filteredResult && this._filteredResult.length > 0
915
+ } }, index.h("slot", { name: "empty-search-result" })))));
916
+ }
917
+ render() {
918
+ return (index.h(index.Host, { key: '1a07fd41c8f9ccc1fbd0ca768fd3f87fc719dec4', tabindex: -1 }, index.h("div", { key: '6492705706e717048243892a3f8b269fa26dc6b9', class: Object.assign({ 'digi-form-select-filter': true }, this.cssModifiers), role: "application", id: `${this.afId}-identifier` }, index.h("digi-form-label", { key: '99d0e29f7dad712882c0a3c5fd3f468af7dd5c55', afLabel: this.afFilterButtonTextLabel, afFor: `${this.afId}`, afId: `${this.afId}-label`, class: "digi-form-select-filter__label", afDescription: this.afDescription, afRequired: this.afRequired, afAnnounceIfOptional: this.afAnnounceIfOptional, afRequiredText: this.afRequiredText, afAnnounceIfOptionalText: this.afAnnounceIfOptionalText }), index.h("digi-util-keydown-handler", { key: 'a53d9d63b71557554da9442511af10870e345263', onAfOnEsc: () => this.escHandler() }, index.h("button", { key: '260c22654935d7422d5fc30a47fbd0c37ec00f0c', type: "button", id: `${this.afId}`, class: "digi-form-select-filter__toggle-button", onClick: () => this.toggleDropdown(), ref: (el) => (this._toggleButton = el), "aria-haspopup": "true", "aria-label": this.ariaLabel, "aria-describedby": `${this.afFilterButtonAriaDescribedby} ${this.afId}--validation-message`, "aria-controls": `${this.afId}-dropdown-menu`, "aria-expanded": this.isOpen }, index.h("div", { key: 'b92a13d75d3e320a39ca99128354178c01c1ff0d', class: Object.assign({ 'digi-form-filter__toggle-button-wrapper': true }, this.cssModifiersToggleButtonWrapper) }, index.h("digi-icon-check", { key: '37ab06f299d37c36516a7b809472bb300d244c18', class: Object.assign({ 'digi-form-select-filter__toggle-button-indicator': true }, this.cssModifiersToggleButtonIndicator), slot: "icon" }), index.h("span", { key: 'ca373143f83ab3da2e6579b3a0e1e145a10d2235', class: "digi-form-select-filter__toggle-button-text" }, this.renderButtonLabel)), index.h("digi-icon-chevron-down", { key: '1a62747454653ceafa650e329301a8975179d75d', class: "digi-form-select-filter__toggle-icon" })), index.h("div", { key: 'b0cafd4ce8ad8017f60e8fab88417512a6698f20', id: `${this.afId}-dropdown-menu`, tabindex: this.isOpen ? '-1' : undefined, class: {
919
+ 'digi-form-select-filter__dropdown': true,
920
+ 'digi-form-select-filter__dropdown--right': this.afAlignRight,
921
+ 'digi-form-select-filter__dropdown--hidden': !this.isOpen
922
+ } }, index.h("fieldset", { key: 'f98295e8e804f93428489daf5844df9854ed6053' }, index.h("div", { key: 'c614d142260b6eaa0b6ea643b34f135551aaf1ec', class: "digi-form-select-filter__header" }, index.h("legend", { key: 'f1c94bf0ea6e3745d8965fbe5bfdf0a298d7b4f0', class: "digi-form-select-filter__legend" }, this.afFilterButtonTextLabel), index.h("digi-form-input", { key: '6def27fd94b52e666c3e8dac4385ddf874f85bd1', afLabel: this.afName, afId: `${this.afId}-search`, afVariation: typographyVariation_enum.FormInputVariation.MEDIUM, afType: formInputType_enum.FormInputType.SEARCH, afValidation: typographyVariation_enum.FormInputValidation.NEUTRAL, onAfOnFocus: () => {
923
+ this.focusListItemIndex = 0;
924
+ }, onAfOnKeyup: (e) => {
925
+ this.inputSearchKeyboardHandler(e.detail);
926
+ }, onAfOnInput: (e) => this.inputSearchInputHandler(e.detail), afValue: this._searchQuery, class: "digi-form-select-filter__search-input", afAriaControls: `${this.afId}-select-filter-list`, afAutocomplete: "off", afAriaAutocomplete: "none" }), this.renderEmptyStateBox()), index.h("div", { key: 'bcfc446573bb4b8f88aabdde1a8b6da1a6ac51f7', class: "digi-form-select-filter__scroll" }, index.h("digi-util-keydown-handler", { key: '656253e1dba64d2906ae9b195063300fe5cbd900', onAfOnDown: (e) => this.downHandler(e), onAfOnRight: (e) => this.downHandler(e), onAfOnUp: (e) => this.upHandler(e), onAfOnLeft: (e) => this.upHandler(e), onAfOnHome: (e) => this.homeHandler(e), onAfOnEnd: (e) => this.endHandler(e), onAfOnEnter: (e) => this.enterHandler(e), onAfOnSpace: (e) => this.spaceHandler(e), onAfOnTab: () => this.tabHandler(), onAfOnShiftTab: () => this.shiftHandler() }, index.h("ul", { key: '4a42a8ee02e3921710aa00826b31558ed1f9a485', class: "digi-form-select-filter__list", "aria-labelledby": `${this.afId}`, id: `${this.afId}-select-filter-list`, role: this.afMultipleItems ? '' : 'radiogroup', "aria-invalid": this.afMultipleItems
927
+ ? 'false'
928
+ : this.afValidation ===
929
+ typographyVariation_enum.FormSelectFilterValidation.ERROR
930
+ ? 'true'
931
+ : 'false', "aria-errormessage": `${this.afId}--validation-message`, "aria-required": this.afMultipleItems
932
+ ? false
933
+ : this.afRequired
934
+ ? 'true'
935
+ : 'false' }, this.showNeutralValue && (index.h("li", { key: '40d30a579a332fec15b5c3f38865eacce0a8c2ee', class: "digi-form-select-filter__item", role: "radio", "aria-required": this.afMultipleItems
936
+ ? 'false'
937
+ : this.afRequired
938
+ ? 'true'
939
+ : 'false', "aria-checked": this._selectedItems.length === 0 ? 'true' : 'false', onClick: () => this.resetSelectItems(true), tabIndex: 0, "aria-label": this.afFilterButtonText }, this._selectedItems.length === 0 && (index.h("digi-icon-check", { key: '43f446e70c707681dd1de50e11af511e8c4d060e', class: "digi-form-select-filter__item__icon", "aria-hidden": 'true' })), this.afFilterButtonText)), this._filteredResult &&
940
+ this._filteredResult.map((item, index$1) => {
941
+ return (index.h("li", { class: "digi-form-select-filter__item", key: index$1, dir: item.dir, lang: item.lang, "aria-checked": this.isSelected(item.value) ? 'true' : 'false', role: this.afMultipleItems ? 'checkbox' : 'radio', "aria-required": this.afMultipleItems
942
+ ? 'false'
943
+ : this.afRequired
944
+ ? 'true'
945
+ : 'false', "aria-invalid": this.afMultipleItems
946
+ ? this.afValidation ===
947
+ typographyVariation_enum.FormSelectFilterValidation.ERROR
948
+ ? 'true'
949
+ : 'false'
950
+ : 'false', "aria-errormessage": `${this.afId}--validation-message`, onClick: () => this.selectItemHandler(item), tabIndex: this.showNeutralValue
951
+ ? -1
952
+ : index$1 === 0
953
+ ? 0
954
+ : -1 }, this.isSelected(item.value) && (index.h("digi-icon-check", { class: "digi-form-select-filter__item__icon", "aria-hidden": 'true' })), item.label));
955
+ }))))), this.afMultipleItems && (index.h("div", { key: 'f94a71fb292baf936c9358e33316f1ee93ce37f3', class: "digi-form-select-filter__footer" }, !this.afHideResetButton && (index.h("digi-button", { key: '305beb8e5f817d46d5f7b5364e4125c101cbaed5', "af-variation": "secondary", "af-aria-label": this.afResetButtonTextAriaLabel, onClick: () => this.resetSelectItems(), class: "digi-form-select-filter__reset-button" }, this.afResetButtonText)), index.h("digi-util-keydown-handler", { key: '3bf7f1f1bcd2a4e07fd900ba4b6377decc617cd7', onAfOnUp: () => this.setFocusItem() }, index.h("digi-button", { key: 'eaa1389239c8b5e93ecac2ed2f6ed09fcda81863', ref: (el) => (this._submitButton = el), "af-variation": "primary", "af-aria-label": this.afSubmitButtonTextAriaLabel, onClick: () => {
956
+ this.setClosed(true);
957
+ }, class: "digi-form-select-filter__submit-button" }, this.afSubmitButtonText)))))), index.h("div", { key: '213a685ba0d080e873721d526c1517e62f1779be', class: "digi-form-select__footer" }, index.h("div", { key: '81b470b19af8e472e50a789a6116448b8204359e', "aria-atomic": "true", role: this.errorMessageIsAlert ? 'alert' : null, id: `${this.afId}--validation-message` }, this.showValidation() && (index.h("digi-form-validation-message", { key: '457f29208d032eb29e7bb94c9db9fb9634866524', "af-variation": this.afValidation }, this.afValidationText)))))));
958
+ }
959
+ get hostElement() { return index.getElement(this); }
960
+ static get watchers() { return {
961
+ "value": ["onValueChanged"],
962
+ "afListItems": ["handleListItems"]
963
+ }; }
964
+ };
965
+ FormSelectFilter.style = DigiFormSelectFilterStyle0;
966
+
967
+ const formValidationMessageCss = ".sc-digi-form-validation-message-h{--digi--form-validation-message--icon-color--success:var(--digi--color--icon--validation--success);--digi--form-validation-message--icon-color--warning:var(--digi--color--icon--validation--warning);--digi--form-validation-message--icon-color--error:var(--digi--color--icon--validation--error)}.sc-digi-form-validation-message-h .digi-form-validation-message.sc-digi-form-validation-message{display:flex;flex-wrap:wrap;align-items:center}.sc-digi-form-validation-message-h .digi-form-validation-message--success.sc-digi-form-validation-message{--ICON-COLOR:var(--digi--form-validation-message--icon-color--success)}.sc-digi-form-validation-message-h .digi-form-validation-message--warning.sc-digi-form-validation-message{--ICON-COLOR:var(--digi--form-validation-message--icon-color--warning)}.sc-digi-form-validation-message-h .digi-form-validation-message--error.sc-digi-form-validation-message{--ICON-COLOR:var(--digi--form-validation-message--icon-color--error)}.sc-digi-form-validation-message-h .digi-form-validation-message__icon.sc-digi-form-validation-message{color:var(--ICON-COLOR);margin-inline-end:var(--digi--gutter--icon)}.sc-digi-form-validation-message-h .digi-form-validation-message__icon.sc-digi-form-validation-message>*.sc-digi-form-validation-message{--digi--icon--width:1.25em;--digi--icon--height:1.25em;--digi--icon--color:var(--ICON-COLOR);display:flex}.sc-digi-form-validation-message-h .digi-form-validation-message__icon.sc-digi-form-validation-message .warning.sc-digi-form-validation-message{top:3px;position:relative}.sc-digi-form-validation-message-h .digi-form-validation-message__text.sc-digi-form-validation-message{flex:1;font-family:var(--digi--global--typography--font-family--default);font-size:var(--digi--typography--tag--font-size--desktop);color:var(--digi--color--text--primary)}";
968
+ const DigiFormValidationMessageStyle0 = formValidationMessageCss;
969
+
970
+ const FormValidationMessage = class {
971
+ constructor(hostRef) {
972
+ index.registerInstance(this, hostRef);
973
+ this.afVariation = formValidationMessageVariation_enum.FormValidationMessageVariation.SUCCESS;
974
+ }
975
+ get cssModifiers() {
976
+ return {
977
+ 'digi-form-validation-message--success': this.afVariation === formValidationMessageVariation_enum.FormValidationMessageVariation.SUCCESS,
978
+ 'digi-form-validation-message--error': this.afVariation === formValidationMessageVariation_enum.FormValidationMessageVariation.ERROR,
979
+ 'digi-form-validation-message--warning': this.afVariation === formValidationMessageVariation_enum.FormValidationMessageVariation.WARNING
980
+ };
981
+ }
982
+ get icon() {
983
+ switch (this.afVariation) {
984
+ case formValidationMessageVariation_enum.FormValidationMessageVariation.SUCCESS:
985
+ return index.h("digi-icon-validation-success", null);
986
+ case formValidationMessageVariation_enum.FormValidationMessageVariation.ERROR:
987
+ return index.h("digi-icon-validation-error", null);
988
+ case formValidationMessageVariation_enum.FormValidationMessageVariation.WARNING:
989
+ return index.h("digi-icon-validation-warning", { class: "warning" });
990
+ }
991
+ }
992
+ render() {
993
+ return (index.h("div", { key: 'e19f49d6e49b2d928b3c80053fd413d6f86056e0', class: Object.assign({ 'digi-form-validation-message': true }, this.cssModifiers) }, index.h("div", { key: 'ea2cce02d7c3c98c761cfa9abc1e39428c515063', class: "digi-form-validation-message__icon", "aria-hidden": "true" }, this.icon), index.h("span", { key: 'd732a6a477a88fc3ca2e18a2199f8f1f528c8a0a', class: "digi-form-validation-message__text" }, index.h("slot", { key: '8d62d0fc0d2f3290227289b59c975b92133df852' }))));
994
+ }
995
+ get hostElement() { return index.getElement(this); }
996
+ };
997
+ FormValidationMessage.style = DigiFormValidationMessageStyle0;
998
+
999
+ const iconCheckCss = ".sc-digi-icon-check-h{--digi--icon--color:var(--digi--color--icon--primary);--digi--icon--width:initial;--digi--icon--height:auto;display:flex;min-height:1.4em;align-items:center}.sc-digi-icon-check-h svg.sc-digi-icon-check{color:var(--digi--icon--color);max-width:var(--digi--icon--width);max-height:var(--digi--icon--height);width:var(--digi--icon--width, auto);height:var(--digi--icon--height, auto)}";
1000
+ const DigiIconCheckStyle0 = iconCheckCss;
1001
+
1002
+ const IconCheck = class {
1003
+ constructor(hostRef) {
1004
+ index.registerInstance(this, hostRef);
1005
+ this.afTitle = undefined;
1006
+ this.afDesc = undefined;
1007
+ this.afSvgAriaHidden = true;
1008
+ this.afSvgAriaLabelledby = undefined;
1009
+ this.titleId = randomIdGenerator_util.randomIdGenerator('icontitle');
1010
+ }
1011
+ render() {
1012
+ return (index.h("svg", { key: '7e7362c73d293709e74cbb58d41ee14588d2a6b6', class: "digi-icon-check", width: "23", height: "18", viewBox: "0 0 23 18", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": this.afSvgAriaHidden ? 'true' : 'false', "aria-labelledby": this.afSvgAriaLabelledby
1013
+ ? this.afSvgAriaLabelledby
1014
+ : this.afTitle
1015
+ ? this.titleId
1016
+ : undefined }, this.afTitle && index.h("title", { key: '0b6cad5ad89e4df27945f378275265d370a7de32', id: this.titleId }, this.afTitle), this.afDesc && index.h("desc", { key: 'b1ae6ed14da198fdbe4c924240de976382c749c0' }, this.afDesc), index.h("path", { key: 'c9e70d7b31bc6588142208eb8acb84f8b3902820', class: "digi-icon-check__shape", d: "M20.547.18L7.315 13.627 2.453 8.686a.597.597 0 00-.853 0L.177 10.132a.62.62 0 000 .868l6.711 6.82c.236.24.618.24.854 0L22.823 2.493a.62.62 0 000-.867L21.4.18a.597.597 0 00-.853 0z", fill: "currentColor", "fill-rule": "nonzero" })));
1017
+ }
1018
+ };
1019
+ IconCheck.style = DigiIconCheckStyle0;
1020
+
1021
+ const iconChevronDownCss = ".sc-digi-icon-chevron-down-h{--digi--icon--color:var(--digi--color--icon--primary);--digi--icon--width:initial;--digi--icon--height:auto;display:flex;min-height:1.4em;align-items:center}.sc-digi-icon-chevron-down-h svg.sc-digi-icon-chevron-down{color:var(--digi--icon--color);max-width:var(--digi--icon--width);max-height:var(--digi--icon--height);width:var(--digi--icon--width, auto);height:var(--digi--icon--height, auto)}";
1022
+ const DigiIconChevronDownStyle0 = iconChevronDownCss;
1023
+
1024
+ const IconChevronDown = class {
1025
+ constructor(hostRef) {
1026
+ index.registerInstance(this, hostRef);
1027
+ this.afTitle = undefined;
1028
+ this.afDesc = undefined;
1029
+ this.afSvgAriaHidden = true;
1030
+ this.afSvgAriaLabelledby = undefined;
1031
+ this.titleId = randomIdGenerator_util.randomIdGenerator('icontitle');
1032
+ }
1033
+ render() {
1034
+ return (index.h("svg", { key: '8c1823e497c5b4b7d33f1e5527279636819b86a8', class: "digi-icon-chevron-down", width: "14", height: "8", viewBox: "0 0 14 8", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": this.afSvgAriaHidden ? 'true' : 'false', "aria-labelledby": this.afSvgAriaLabelledby
1035
+ ? this.afSvgAriaLabelledby
1036
+ : this.afTitle
1037
+ ? this.titleId
1038
+ : undefined }, this.afTitle && index.h("title", { key: '1c0a137be9ac050af93f8e52e93996555b18ae96', id: this.titleId }, this.afTitle), this.afDesc && index.h("desc", { key: 'ad8090cd6ad3607946a7bba7fd69a3e3ee7b3538' }, this.afDesc), index.h("path", { key: '5e92479bddf6b48482ba2f4d2258c6a051bc2080', class: "digi-icon-chevron-down__shape", d: "M1 1l6.074 6L13 1.147", stroke: "currentColor", "stroke-width": "2", fill: "none", "fill-rule": "evenodd" })));
1039
+ }
1040
+ };
1041
+ IconChevronDown.style = DigiIconChevronDownStyle0;
1042
+
1043
+ const iconValidationErrorCss = ".sc-digi-icon-validation-error-h{--digi--icon--color:var(--digi--color--icon--primary);--digi--icon--width:initial;--digi--icon--height:auto;display:flex;min-height:1.4em;align-items:center}.sc-digi-icon-validation-error-h svg.sc-digi-icon-validation-error{color:var(--digi--icon--color);max-width:var(--digi--icon--width);max-height:var(--digi--icon--height);width:var(--digi--icon--width, auto);height:var(--digi--icon--height, auto)}";
1044
+ const DigiIconValidationErrorStyle0 = iconValidationErrorCss;
1045
+
1046
+ const IconValidationError = class {
1047
+ constructor(hostRef) {
1048
+ index.registerInstance(this, hostRef);
1049
+ this.afTitle = undefined;
1050
+ this.afDesc = undefined;
1051
+ this.afSvgAriaHidden = true;
1052
+ this.afSvgAriaLabelledby = undefined;
1053
+ this.titleId = randomIdGenerator_util.randomIdGenerator('icontitle');
1054
+ }
1055
+ render() {
1056
+ return (index.h("svg", { key: '215ed4d45fc7125b502405f45be9b8525980c0a1', class: "digi-icon-validation-error", width: "48", height: "48", viewBox: "0 0 48 48", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": this.afSvgAriaHidden ? 'true' : 'false', "aria-labelledby": this.afSvgAriaLabelledby
1057
+ ? this.afSvgAriaLabelledby
1058
+ : this.afTitle
1059
+ ? this.titleId
1060
+ : undefined }, this.afTitle && index.h("title", { key: '50e41b34e0eac377caa84b0fcd931963843949c5', id: this.titleId }, this.afTitle), this.afDesc && index.h("desc", { key: '6884921d2dfbb0ce9af9cd2959e929aa8a351a6f' }, this.afDesc), index.h("path", { key: '18c6dbfd917e05e1d08c4aff64e2a8b7c39bfe95', class: "digi-icon-validation-error__shape", d: "M34.4328058,0 C35.5494848,0 36.5900526,0.609146757 37.1483921,1.58958113 L47.5812454,19.9104189 C48.1395849,20.8909496 48.1395849,22.1090504 47.5812454,23.0895811 L37.1483921,41.4104189 C36.5900526,42.3908532 35.5494848,43 34.4328058,43 L13.5671942,43 C12.4505152,43 11.4099474,42.3908532 10.8516079,41.4104189 L0.41875464,23.0895811 C-0.13958488,22.1090504 -0.13958488,20.8909496 0.41875464,19.9104189 L10.8516079,1.58958113 C11.4099474,0.609146757 12.4505152,0 13.5671942,0 Z M18.6736823,12.3728178 C18.2711762,11.964729 17.6203819,11.964729 17.2178757,12.3728178 L15.2825964,14.334939 C14.8800903,14.7430278 14.8800903,15.4028485 15.2825964,15.8109373 L20.6089616,21.2111779 L15.2825964,26.6114185 C14.8800903,27.0195074 14.8800903,27.6793281 15.2825964,28.0874169 L17.2178757,30.049538 C17.6203819,30.4576269 18.2711762,30.4576269 18.6736823,30.049538 L24.0000475,24.6492974 L29.3264127,30.049538 C29.7289188,30.4576269 30.3797132,30.4576269 30.7822193,30.049538 L32.7174986,28.0874169 C33.1200048,27.6793281 33.1200048,27.0195074 32.7174986,26.6114185 L27.3911334,21.2111779 L32.7174986,15.8109373 C33.1200048,15.4028485 33.1200048,14.7430278 32.7174986,14.334939 L30.7822193,12.3728178 C30.3797132,11.964729 29.7289188,11.964729 29.3264127,12.3728178 L24.0000475,17.7730584 Z", fill: "currentColor", "fill-rule": "nonzero" })));
1061
+ }
1062
+ };
1063
+ IconValidationError.style = DigiIconValidationErrorStyle0;
1064
+
1065
+ const iconValidationSuccessCss = ".sc-digi-icon-validation-success-h{--digi--icon--color:var(--digi--color--icon--primary);--digi--icon--width:initial;--digi--icon--height:auto;display:flex;min-height:1.4em;align-items:center}.sc-digi-icon-validation-success-h svg.sc-digi-icon-validation-success{color:var(--digi--icon--color);max-width:var(--digi--icon--width);max-height:var(--digi--icon--height);width:var(--digi--icon--width, auto);height:var(--digi--icon--height, auto)}";
1066
+ const DigiIconValidationSuccessStyle0 = iconValidationSuccessCss;
1067
+
1068
+ const IconCheckCircle = class {
1069
+ constructor(hostRef) {
1070
+ index.registerInstance(this, hostRef);
1071
+ this.afTitle = undefined;
1072
+ this.afDesc = undefined;
1073
+ this.afSvgAriaHidden = true;
1074
+ this.afSvgAriaLabelledby = undefined;
1075
+ this.titleId = randomIdGenerator_util.randomIdGenerator('icontitle');
1076
+ }
1077
+ render() {
1078
+ return (index.h("svg", { key: '5a97bff65735eb5dfb967a91ac6d57e724bba899', class: "digi-icon-validation-success", width: "25", height: "25", viewBox: "0 0 25 25", "aria-hidden": this.afSvgAriaHidden ? 'true' : 'false', "aria-labelledby": this.afSvgAriaLabelledby
1079
+ ? this.afSvgAriaLabelledby
1080
+ : this.afTitle
1081
+ ? this.titleId
1082
+ : undefined, xmlns: "http://www.w3.org/2000/svg" }, this.afTitle && index.h("title", { key: '3595f915b3f4a2cdbdef9216c7e5f468d631444d', id: this.titleId }, this.afTitle), this.afDesc && index.h("desc", { key: '83552998214817f66d1dc8381fa8c6d8a04a4b8e' }, this.afDesc), index.h("path", { key: 'e1a139cccf2b81927aed305f137c0fb5ba523a97', class: "digi-icon-validation-success__shape", d: "M25 12.5C25 19.404 19.404 25 12.5 25S0 19.404 0 12.5 5.596 0 12.5 0 25 5.596 25 12.5zm-13.946 6.619l9.274-9.275a.806.806 0 000-1.14l-1.14-1.14a.806.806 0 00-1.14 0l-7.564 7.563-3.531-3.531a.807.807 0 00-1.14 0l-1.141 1.14a.806.806 0 000 1.14l5.242 5.243a.806.806 0 001.14 0z", fill: "currentColor", "fill-rule": "nonzero" })));
1083
+ }
1084
+ };
1085
+ IconCheckCircle.style = DigiIconValidationSuccessStyle0;
1086
+
1087
+ const iconValidationWarningCss = ".sc-digi-icon-validation-warning-h{--digi--icon--color:var(--digi--color--icon--primary);--digi--icon--width:initial;--digi--icon--height:auto;display:flex;min-height:1.4em;align-items:center}.sc-digi-icon-validation-warning-h svg.sc-digi-icon-validation-warning{color:var(--digi--icon--color);max-width:var(--digi--icon--width);max-height:var(--digi--icon--height);width:var(--digi--icon--width, auto);height:var(--digi--icon--height, auto)}";
1088
+ const DigiIconValidationWarningStyle0 = iconValidationWarningCss;
1089
+
1090
+ const IconValidationWarning = class {
1091
+ constructor(hostRef) {
1092
+ index.registerInstance(this, hostRef);
1093
+ this.afTitle = undefined;
1094
+ this.afDesc = undefined;
1095
+ this.afSvgAriaHidden = true;
1096
+ this.afSvgAriaLabelledby = undefined;
1097
+ this.titleId = randomIdGenerator_util.randomIdGenerator('icontitle');
1098
+ }
1099
+ render() {
1100
+ return (index.h("div", { key: '0e72404fd84b522858a70020f72399924d37ec18' }, index.h("svg", { key: 'cd993cacfd3c1b6409b448f28e493dfc2bbfac60', class: "digi-icon-validation-warning", width: "18", height: "18", viewBox: "0 0 18 18", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": this.afSvgAriaHidden ? 'true' : 'false', "aria-labelledby": this.afSvgAriaLabelledby
1101
+ ? this.afSvgAriaLabelledby
1102
+ : this.afTitle
1103
+ ? this.titleId
1104
+ : undefined }, this.afTitle && index.h("title", { key: 'ecb012faa417a12dd8364cdb668d05871cbd9e2d', id: this.titleId }, this.afTitle), this.afDesc && index.h("desc", { key: '79645e3d7c66df619e6395fc230ceb168e126b55' }, this.afDesc), index.h("g", { key: 'f45dfa63c0474d9ec4d4b5761aa4d89eeec96885', fill: "none", "fill-rule": "evenodd" }, index.h("circle", { key: '51f6f20faff8a50086a66a1865ed56711e96d01c', cx: "9", cy: "9", r: "6.75", fill: "#333" }), index.h("path", { key: '45179f87b52df55eba0a3ca50113df0cd14eba9b', d: "m18 9c0 4.9717-4.0298 9-9 9-4.9702 0-9-4.0283-9-9 0-4.9688 4.0298-9 9-9 4.9702 0 9 4.0312 9 9zm-9 1.8145c-0.92196 0-1.6694 0.7474-1.6694 1.6694 0 0.92196 0.7474 1.6694 1.6694 1.6694s1.6694-0.7474 1.6694-1.6694c0-0.92196-0.7474-1.6694-1.6694-1.6694zm-1.3157-1.065c0.012593 0.23095 0.20355 0.41175 0.43483 0.41175h1.7618c0.23128 0 0.42224-0.1808 0.43483-0.41175l0.2692-4.9355c0.013609-0.24946-0.18501-0.45922-0.43483-0.45922h-2.3002c-0.24982 0-0.4484 0.20976-0.43479 0.45922l0.2692 4.9355z", fill: "#FFE200" })))));
1105
+ }
1106
+ };
1107
+ IconValidationWarning.style = DigiIconValidationWarningStyle0;
1108
+
1109
+ const UtilKeydownHandler = class {
1110
+ constructor(hostRef) {
1111
+ index.registerInstance(this, hostRef);
1112
+ this.afOnEsc = index.createEvent(this, "afOnEsc", 7);
1113
+ this.afOnEnter = index.createEvent(this, "afOnEnter", 7);
1114
+ this.afOnTab = index.createEvent(this, "afOnTab", 7);
1115
+ this.afOnSpace = index.createEvent(this, "afOnSpace", 7);
1116
+ this.afOnShiftTab = index.createEvent(this, "afOnShiftTab", 7);
1117
+ this.afOnUp = index.createEvent(this, "afOnUp", 7);
1118
+ this.afOnDown = index.createEvent(this, "afOnDown", 7);
1119
+ this.afOnLeft = index.createEvent(this, "afOnLeft", 7);
1120
+ this.afOnRight = index.createEvent(this, "afOnRight", 7);
1121
+ this.afOnHome = index.createEvent(this, "afOnHome", 7);
1122
+ this.afOnEnd = index.createEvent(this, "afOnEnd", 7);
1123
+ this.afOnKeyDown = index.createEvent(this, "afOnKeyDown", 7);
1124
+ }
1125
+ keydownHandler(e) {
1126
+ const key = keyboardHandler_util.keyboardHandler(e);
1127
+ switch (key) {
1128
+ case keyboardHandler_util.KEY_CODE.SHIFT_TAB:
1129
+ this.afOnShiftTab.emit(e);
1130
+ break;
1131
+ case keyboardHandler_util.KEY_CODE.DOWN_ARROW:
1132
+ this.afOnDown.emit(e);
1133
+ this.afOnKeyDown.emit(e);
1134
+ break;
1135
+ case keyboardHandler_util.KEY_CODE.UP_ARROW:
1136
+ this.afOnUp.emit(e);
1137
+ this.afOnKeyDown.emit(e);
1138
+ break;
1139
+ case keyboardHandler_util.KEY_CODE.LEFT_ARROW:
1140
+ this.afOnLeft.emit(e);
1141
+ this.afOnKeyDown.emit(e);
1142
+ break;
1143
+ case keyboardHandler_util.KEY_CODE.RIGHT_ARROW:
1144
+ this.afOnRight.emit(e);
1145
+ this.afOnKeyDown.emit(e);
1146
+ break;
1147
+ case keyboardHandler_util.KEY_CODE.ENTER:
1148
+ this.afOnEnter.emit(e);
1149
+ this.afOnKeyDown.emit(e);
1150
+ break;
1151
+ case keyboardHandler_util.KEY_CODE.ESCAPE:
1152
+ this.afOnEsc.emit(e);
1153
+ this.afOnKeyDown.emit(e);
1154
+ break;
1155
+ case keyboardHandler_util.KEY_CODE.TAB:
1156
+ this.afOnTab.emit(e);
1157
+ this.afOnKeyDown.emit(e);
1158
+ break;
1159
+ case keyboardHandler_util.KEY_CODE.SPACE:
1160
+ this.afOnSpace.emit(e);
1161
+ this.afOnKeyDown.emit(e);
1162
+ break;
1163
+ case keyboardHandler_util.KEY_CODE.HOME:
1164
+ this.afOnHome.emit(e);
1165
+ this.afOnKeyDown.emit(e);
1166
+ break;
1167
+ case keyboardHandler_util.KEY_CODE.END:
1168
+ this.afOnEnd.emit(e);
1169
+ this.afOnKeyDown.emit(e);
1170
+ break;
1171
+ case keyboardHandler_util.KEY_CODE.ANY:
1172
+ this.afOnKeyDown.emit(e);
1173
+ break;
1174
+ default:
1175
+ this.afOnKeyDown.emit(e);
1176
+ return;
1177
+ }
1178
+ }
1179
+ render() {
1180
+ return index.h("slot", { key: 'fcd72f74e391d6becc44f6178461db694fe9c803' });
1181
+ }
1182
+ };
1183
+
1184
+ exports.digi_button = Button;
1185
+ exports.digi_form_input = FormInput;
1186
+ exports.digi_form_label = FormLabel;
1187
+ exports.digi_form_select_filter = FormSelectFilter;
1188
+ exports.digi_form_validation_message = FormValidationMessage;
1189
+ exports.digi_icon_check = IconCheck;
1190
+ exports.digi_icon_chevron_down = IconChevronDown;
1191
+ exports.digi_icon_validation_error = IconValidationError;
1192
+ exports.digi_icon_validation_success = IconCheckCircle;
1193
+ exports.digi_icon_validation_warning = IconValidationWarning;
1194
+ exports.digi_util_keydown_handler = UtilKeydownHandler;