@designsystem-se/af 39.2.2 → 39.2.3

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 (196) hide show
  1. package/components/digi-expandable-accordion.js +18 -11
  2. package/components/digi-expandable-faq-item.js +21 -14
  3. package/components/digi-info-card.js +3 -3
  4. package/custom-elements.json +1 -1
  5. package/dist/cjs/badge-notification-shape.enum-CEyEo2G5.js +8 -0
  6. package/dist/cjs/button-size.enum-DgyvMkwE.js +7 -0
  7. package/dist/cjs/{button-variation.enum-ngMqFLdW.js → button-variation.enum-DkUalo9f.js} +0 -6
  8. package/dist/cjs/{calendar-week-view-heading-level.enum-BI2f9bbk.js → calendar-week-view-heading-level.enum-NEkm5SUq.js} +0 -7
  9. package/dist/cjs/digi-arbetsformedlingen.cjs.js +1 -1
  10. package/dist/cjs/digi-badge-notification.cjs.entry.js +65 -0
  11. package/dist/cjs/digi-button.cjs.entry.js +131 -0
  12. package/dist/cjs/{digi-badge-notification_8.cjs.entry.js → digi-calendar-week-view.cjs.entry.js} +72 -645
  13. package/dist/cjs/{digi-calendar-datepicker.cjs.entry.js → digi-calendar_19.cjs.entry.js} +1613 -56
  14. package/dist/cjs/digi-code-block_3.cjs.entry.js +8 -13
  15. package/dist/cjs/digi-code-example.cjs.entry.js +4 -3
  16. package/dist/cjs/digi-dialog.cjs.entry.js +8 -13
  17. package/dist/cjs/digi-footer.cjs.entry.js +7 -12
  18. package/dist/cjs/digi-form-error-list.cjs.entry.js +7 -12
  19. package/dist/cjs/digi-form-file-upload.cjs.entry.js +9 -10
  20. package/dist/cjs/digi-form-input-search.cjs.entry.js +5 -6
  21. package/dist/cjs/digi-form-receipt.cjs.entry.js +7 -12
  22. package/dist/cjs/digi-form-select-filter.cjs.entry.js +8 -13
  23. package/dist/cjs/digi-header-navigation.cjs.entry.js +7 -12
  24. package/dist/cjs/digi-header.cjs.entry.js +7 -12
  25. package/dist/cjs/digi-info-card.cjs.entry.js +3 -3
  26. package/dist/cjs/digi-navigation-pagination.cjs.entry.js +7 -12
  27. package/dist/cjs/digi-notification-alert.cjs.entry.js +7 -12
  28. package/dist/cjs/digi-notification-error-page.cjs.entry.js +7 -12
  29. package/dist/cjs/digi-tablist-panel.cjs.entry.js +20 -0
  30. package/dist/cjs/digi-tablist.cjs.entry.js +312 -0
  31. package/dist/cjs/digi-title-logo.cjs.entry.js +7 -12
  32. package/dist/cjs/digi-tools-feedback.cjs.entry.js +9 -14
  33. package/dist/cjs/{form-input-type.enum-DvF_MTHK.js → form-input-type.enum-CCCcY8gv.js} +7 -0
  34. package/dist/cjs/{form-file-upload-variation.enum-xcEOoggr.js → form-validation-message-variation.enum-DgkifAnP.js} +7 -0
  35. package/dist/cjs/index-Cn1hHaSy.js +16 -40
  36. package/dist/cjs/{index-Bdlw-Iuy.js → index-DUQtADgG.js} +189 -19
  37. package/dist/cjs/index.cjs.js +64 -69
  38. package/dist/cjs/loader.cjs.js +1 -1
  39. package/dist/cjs/{typography-variation.enum-BDSt7CVI.js → typography-variation.enum-CVUvogxJ.js} +86 -0
  40. package/dist/collection/components/_expandable/expandable-accordion/expandable-accordion.js +18 -11
  41. package/dist/collection/components/_expandable/expandable-faq-item/expandable-faq-item.js +21 -14
  42. package/dist/collection/components/_info-card/info-card/info-card.js +5 -5
  43. package/dist/collection/design-tokens/components/_logo.variables.scss +0 -2
  44. package/dist/digi-arbetsformedlingen/digi-arbetsformedlingen.esm.js +1 -1
  45. package/dist/digi-arbetsformedlingen/index.esm.js +1 -1
  46. package/dist/digi-arbetsformedlingen/p-0230ec9b.entry.js +1 -0
  47. package/dist/digi-arbetsformedlingen/p-0394e694.entry.js +1 -0
  48. package/dist/digi-arbetsformedlingen/p-04bbbd14.entry.js +1 -0
  49. package/dist/digi-arbetsformedlingen/p-0cf25433.entry.js +1 -0
  50. package/dist/digi-arbetsformedlingen/p-17824a0b.entry.js +1 -0
  51. package/dist/digi-arbetsformedlingen/p-25815f15.entry.js +1 -0
  52. package/dist/digi-arbetsformedlingen/p-3d4ac22e.entry.js +1 -0
  53. package/dist/digi-arbetsformedlingen/p-4aefce1e.entry.js +1 -0
  54. package/dist/digi-arbetsformedlingen/p-5ee5766d.entry.js +1 -0
  55. package/dist/digi-arbetsformedlingen/p-870a00f8.entry.js +1 -0
  56. package/dist/digi-arbetsformedlingen/p-88dc2ed4.entry.js +1 -0
  57. package/dist/digi-arbetsformedlingen/p-9n7Okhf1.js +1 -0
  58. package/dist/digi-arbetsformedlingen/p-C6S1HfeA.js +1 -0
  59. package/dist/digi-arbetsformedlingen/p-C7xgnp99.js +1 -0
  60. package/dist/digi-arbetsformedlingen/p-CKoZU0-H.js +1 -0
  61. package/dist/digi-arbetsformedlingen/p-Cnyfh_8_.js +1 -0
  62. package/dist/digi-arbetsformedlingen/{p-DwNlf6Sh.js → p-DH_-wpLB.js} +1 -1
  63. package/dist/digi-arbetsformedlingen/p-Zivp2NJB.js +1 -0
  64. package/dist/digi-arbetsformedlingen/p-a29b6fff.entry.js +1 -0
  65. package/dist/digi-arbetsformedlingen/{p-375ea6f8.entry.js → p-ace2e5fd.entry.js} +1 -1
  66. package/dist/digi-arbetsformedlingen/p-b411a549.entry.js +1 -0
  67. package/dist/digi-arbetsformedlingen/p-b7712996.entry.js +1 -0
  68. package/dist/digi-arbetsformedlingen/p-bfccf413.entry.js +1 -0
  69. package/dist/digi-arbetsformedlingen/p-cdd65abb.entry.js +1 -0
  70. package/dist/digi-arbetsformedlingen/p-d4406627.entry.js +1 -0
  71. package/dist/digi-arbetsformedlingen/p-dd95c75e.entry.js +1 -0
  72. package/dist/digi-arbetsformedlingen/p-e5396b1e.entry.js +1 -0
  73. package/dist/digi-arbetsformedlingen/p-e7c10f6a.entry.js +1 -0
  74. package/dist/digi-arbetsformedlingen/p-f91295ac.entry.js +1 -0
  75. package/dist/digi-arbetsformedlingen/p-ffb4fac6.entry.js +1 -0
  76. package/dist/digi-arbetsformedlingen/p-y5Nm4oWF.js +1 -0
  77. package/dist/esm/badge-notification-shape.enum-CKoZU0-H.js +8 -0
  78. package/dist/esm/button-size.enum-C7xgnp99.js +7 -0
  79. package/dist/esm/{button-variation.enum-BMQm4N5I.js → button-variation.enum-y5Nm4oWF.js} +1 -7
  80. package/dist/esm/{calendar-week-view-heading-level.enum-BBOpiDGx.js → calendar-week-view-heading-level.enum-DH_-wpLB.js} +1 -8
  81. package/dist/esm/digi-arbetsformedlingen.js +1 -1
  82. package/dist/esm/digi-badge-notification.entry.js +63 -0
  83. package/dist/esm/digi-button.entry.js +129 -0
  84. package/dist/esm/{digi-badge-notification_8.entry.js → digi-calendar-week-view.entry.js} +6 -572
  85. package/dist/esm/{digi-calendar-datepicker.entry.js → digi-calendar_19.entry.js} +1557 -18
  86. package/dist/esm/digi-code-block_3.entry.js +7 -12
  87. package/dist/esm/digi-code-example.entry.js +2 -1
  88. package/dist/esm/digi-dialog.entry.js +7 -12
  89. package/dist/esm/digi-footer.entry.js +7 -12
  90. package/dist/esm/digi-form-error-list.entry.js +7 -12
  91. package/dist/esm/digi-form-file-upload.entry.js +1 -2
  92. package/dist/esm/digi-form-input-search.entry.js +1 -2
  93. package/dist/esm/digi-form-receipt.entry.js +7 -12
  94. package/dist/esm/digi-form-select-filter.entry.js +7 -12
  95. package/dist/esm/digi-header-navigation.entry.js +7 -12
  96. package/dist/esm/digi-header.entry.js +7 -12
  97. package/dist/esm/digi-info-card.entry.js +3 -3
  98. package/dist/esm/digi-navigation-pagination.entry.js +7 -12
  99. package/dist/esm/digi-notification-alert.entry.js +7 -12
  100. package/dist/esm/digi-notification-error-page.entry.js +7 -12
  101. package/dist/esm/digi-tablist-panel.entry.js +18 -0
  102. package/dist/esm/digi-tablist.entry.js +310 -0
  103. package/dist/esm/digi-title-logo.entry.js +7 -12
  104. package/dist/esm/digi-tools-feedback.entry.js +7 -12
  105. package/dist/esm/{form-input-type.enum-BSJH8Lpg.js → form-input-type.enum-C6S1HfeA.js} +8 -1
  106. package/dist/esm/{form-file-upload-variation.enum-BfyJgcLA.js → form-validation-message-variation.enum-9n7Okhf1.js} +8 -1
  107. package/dist/esm/index-BnKuq1L7.js +16 -40
  108. package/dist/esm/{index-B1Je6g2n.js → index-Cnyfh_8_.js} +170 -3
  109. package/dist/esm/index.js +7 -12
  110. package/dist/esm/loader.js +1 -1
  111. package/dist/esm/{typography-variation.enum-4smNltRI.js → typography-variation.enum-Zivp2NJB.js} +87 -1
  112. package/dist/types/components/_info-card/info-card/info-card.d.ts +2 -2
  113. package/dist/types/components.d.ts +4 -4
  114. package/hydrate/index.js +42 -28
  115. package/hydrate/index.mjs +42 -28
  116. package/package.json +1 -1
  117. package/dist/cjs/digi-calendar_2.cjs.entry.js +0 -490
  118. package/dist/cjs/digi-expandable-accordion.cjs.entry.js +0 -121
  119. package/dist/cjs/digi-expandable-faq-item.cjs.entry.js +0 -119
  120. package/dist/cjs/digi-form-input.cjs.entry.js +0 -205
  121. package/dist/cjs/digi-form-label_3.cjs.entry.js +0 -147
  122. package/dist/cjs/digi-form-select_2.cjs.entry.js +0 -201
  123. package/dist/cjs/digi-icon-chevron-down.cjs.entry.js +0 -28
  124. package/dist/cjs/digi-icon-validation-error_2.cjs.entry.js +0 -51
  125. package/dist/cjs/digi-typography-heading-jumbo.cjs.entry.js +0 -46
  126. package/dist/cjs/digi-util-keydown-handler.cjs.entry.js +0 -81
  127. package/dist/cjs/expandable-accordion-header-level.enum-CjL9V3Kt.js +0 -11
  128. package/dist/cjs/expandable-faq-item-variation.enum-aKkYAQgd.js +0 -18
  129. package/dist/cjs/form-input-search-variation.enum-VVfvlVeM.js +0 -8
  130. package/dist/cjs/form-input-variation.enum-kpoXNUuI.js +0 -29
  131. package/dist/cjs/form-select-variation.enum-e6wjWyaS.js +0 -16
  132. package/dist/cjs/form-validation-message-variation.enum-BA5nmCiw.js +0 -8
  133. package/dist/cjs/index-Snltmefx.js +0 -174
  134. package/dist/cjs/index-r0sb9TCr.js +0 -66
  135. package/dist/cjs/typography-heading-jumbo-variation.enum-Di1Jeh0G.js +0 -17
  136. package/dist/digi-arbetsformedlingen/p-037a35bd.entry.js +0 -1
  137. package/dist/digi-arbetsformedlingen/p-0f7e995a.entry.js +0 -1
  138. package/dist/digi-arbetsformedlingen/p-26f6a310.entry.js +0 -1
  139. package/dist/digi-arbetsformedlingen/p-3239fb1a.entry.js +0 -1
  140. package/dist/digi-arbetsformedlingen/p-3b42582a.entry.js +0 -1
  141. package/dist/digi-arbetsformedlingen/p-3c1f9629.entry.js +0 -1
  142. package/dist/digi-arbetsformedlingen/p-4384644b.entry.js +0 -1
  143. package/dist/digi-arbetsformedlingen/p-4ddcae7b.entry.js +0 -1
  144. package/dist/digi-arbetsformedlingen/p-4smNltRI.js +0 -1
  145. package/dist/digi-arbetsformedlingen/p-569c628c.entry.js +0 -1
  146. package/dist/digi-arbetsformedlingen/p-668d38d9.entry.js +0 -1
  147. package/dist/digi-arbetsformedlingen/p-66f34ca5.entry.js +0 -1
  148. package/dist/digi-arbetsformedlingen/p-6931825c.entry.js +0 -1
  149. package/dist/digi-arbetsformedlingen/p-6cb1c6ea.entry.js +0 -1
  150. package/dist/digi-arbetsformedlingen/p-71a8478d.entry.js +0 -1
  151. package/dist/digi-arbetsformedlingen/p-7688502e.entry.js +0 -1
  152. package/dist/digi-arbetsformedlingen/p-91265ee0.entry.js +0 -1
  153. package/dist/digi-arbetsformedlingen/p-9a4eecde.entry.js +0 -1
  154. package/dist/digi-arbetsformedlingen/p-9df345c4.entry.js +0 -1
  155. package/dist/digi-arbetsformedlingen/p-B8hpiXmh.js +0 -1
  156. package/dist/digi-arbetsformedlingen/p-BBOpiDGx.js +0 -1
  157. package/dist/digi-arbetsformedlingen/p-BMQm4N5I.js +0 -1
  158. package/dist/digi-arbetsformedlingen/p-BSJH8Lpg.js +0 -1
  159. package/dist/digi-arbetsformedlingen/p-BfyJgcLA.js +0 -1
  160. package/dist/digi-arbetsformedlingen/p-BixPaBHw.js +0 -1
  161. package/dist/digi-arbetsformedlingen/p-BvWKyXb_.js +0 -1
  162. package/dist/digi-arbetsformedlingen/p-C6B2KRZo.js +0 -1
  163. package/dist/digi-arbetsformedlingen/p-CgSR-RTl.js +0 -1
  164. package/dist/digi-arbetsformedlingen/p-DCS1KcvC.js +0 -1
  165. package/dist/digi-arbetsformedlingen/p-DNjGvZvz.js +0 -1
  166. package/dist/digi-arbetsformedlingen/p-DfWZa2Wv.js +0 -1
  167. package/dist/digi-arbetsformedlingen/p-a9a1bf57.entry.js +0 -1
  168. package/dist/digi-arbetsformedlingen/p-beebbc90.entry.js +0 -1
  169. package/dist/digi-arbetsformedlingen/p-c7ade486.entry.js +0 -1
  170. package/dist/digi-arbetsformedlingen/p-d065e751.entry.js +0 -1
  171. package/dist/digi-arbetsformedlingen/p-d07a1377.entry.js +0 -1
  172. package/dist/digi-arbetsformedlingen/p-d0b3c35b.entry.js +0 -1
  173. package/dist/digi-arbetsformedlingen/p-d150094c.entry.js +0 -1
  174. package/dist/digi-arbetsformedlingen/p-df8efa59.entry.js +0 -1
  175. package/dist/digi-arbetsformedlingen/p-e2b0b070.entry.js +0 -1
  176. package/dist/digi-arbetsformedlingen/p-e7b311da.entry.js +0 -1
  177. package/dist/digi-arbetsformedlingen/p-xwICssEK.js +0 -1
  178. package/dist/esm/digi-calendar_2.entry.js +0 -487
  179. package/dist/esm/digi-expandable-accordion.entry.js +0 -119
  180. package/dist/esm/digi-expandable-faq-item.entry.js +0 -117
  181. package/dist/esm/digi-form-input.entry.js +0 -203
  182. package/dist/esm/digi-form-label_3.entry.js +0 -143
  183. package/dist/esm/digi-form-select_2.entry.js +0 -198
  184. package/dist/esm/digi-icon-chevron-down.entry.js +0 -26
  185. package/dist/esm/digi-icon-validation-error_2.entry.js +0 -48
  186. package/dist/esm/digi-typography-heading-jumbo.entry.js +0 -44
  187. package/dist/esm/digi-util-keydown-handler.entry.js +0 -79
  188. package/dist/esm/expandable-accordion-header-level.enum-DwNlf6Sh.js +0 -11
  189. package/dist/esm/expandable-faq-item-variation.enum-C6B2KRZo.js +0 -18
  190. package/dist/esm/form-input-search-variation.enum-BvWKyXb_.js +0 -8
  191. package/dist/esm/form-input-variation.enum-DfWZa2Wv.js +0 -29
  192. package/dist/esm/form-select-variation.enum-DCS1KcvC.js +0 -16
  193. package/dist/esm/form-validation-message-variation.enum-B8hpiXmh.js +0 -8
  194. package/dist/esm/index-BixPaBHw.js +0 -170
  195. package/dist/esm/index-BsIL3T_0.js +0 -63
  196. package/dist/esm/typography-heading-jumbo-variation.enum-DNjGvZvz.js +0 -17
@@ -1,117 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h, d as getElement } from './index-BnKuq1L7.js';
2
- import { E as ExpandableFaqItemHeadingLevel, a as ExpandableFaqItemVariation } from './expandable-faq-item-variation.enum-C6B2KRZo.js';
3
- import { r as randomIdGenerator } from './randomIdGenerator.util-BGaIliX6.js';
4
-
5
- const expandableFaqItemCss = () => `.sc-digi-expandable-faq-item-h{--digi--expandable-faq-item--header--background-color--primary:var(--digi--color--background--pop-out);--digi--expandable-faq-item--header--background-color--secondary:var(--digi--color--background--secondary);--digi--expandable-faq-item--header--background-color--tertiary:var(--digi--color--background--primary);--digi--expandable-faq-item--header--toggle-icon--transition:ease-in-out var(--digi--animation--duration--base) all;--digi--expandable-faq-item--content--transition:ease-in-out var(--digi--animation--duration--base) height;--digi--expandable-faq-item--icon--size:0.875rem;--digi--expandable-faq-item--icon--margin-right:var(--digi--margin--medium);--digi--expandable-faq-item--header--font-size:var(--digi--typography--preamble--font-size--desktop);--digi--expandable-faq-item--header--font-weight:var(--digi--typography--preamble--font-weight--desktop);--digi--expandable-faq-item--border-width:var(--digi--border-width--secondary);--digi--expandable-faq-item--border-bottom-width:var(--digi--border-width--secondary);--digi--expandable-faq-item--content--padding:var(--digi--gutter--largest-2);display:block}.sc-digi-expandable-faq-item-h .digi-expandable-faq-item--primary.sc-digi-expandable-faq-item{--BACKGROUND:var(--digi--expandable-faq-item--header--background-color--primary)}.sc-digi-expandable-faq-item-h .digi-expandable-faq-item--secondary.sc-digi-expandable-faq-item{--BACKGROUND:var(--digi--expandable-faq-item--header--background-color--secondary)}.sc-digi-expandable-faq-item-h .digi-expandable-faq-item--tertiary.sc-digi-expandable-faq-item{--BACKGROUND:var(--digi--expandable-faq-item--header--background-color--tertiary)}.sc-digi-expandable-faq-item-h .digi-expandable-faq-item.sc-digi-expandable-faq-item{margin-bottom:var(--digi--global--spacing--smallest-4);font-family:var(--digi--global--typography--font-family--default)}.sc-digi-expandable-faq-item-h .digi-expandable-faq-item--expanded.sc-digi-expandable-faq-item{border-bottom-color:var(--BACKGROUND)}.sc-digi-expandable-faq-item-h .digi-expandable-faq-item__header.sc-digi-expandable-faq-item{background-color:var(--BACKGROUND);width:100%;max-width:calc(var(--digi--paragraph-width--medium) + var(--digi--padding--largest-2))}.sc-digi-expandable-faq-item-h .digi-expandable-faq-item__header.sc-digi-expandable-faq-item .digi-expandable-faq-item--fullwidth.sc-digi-expandable-faq-item{max-width:none}.sc-digi-expandable-faq-item-h .digi-expandable-faq-item__header-text.sc-digi-expandable-faq-item{max-width:var(--digi--paragraph-width--medium)}.sc-digi-expandable-faq-item-h .digi-expandable-faq-item__header.sc-digi-expandable-faq-item h1.sc-digi-expandable-faq-item,.sc-digi-expandable-faq-item-h .digi-expandable-faq-item__header.sc-digi-expandable-faq-item h2.sc-digi-expandable-faq-item,.sc-digi-expandable-faq-item-h .digi-expandable-faq-item__header.sc-digi-expandable-faq-item h3.sc-digi-expandable-faq-item,.sc-digi-expandable-faq-item-h .digi-expandable-faq-item__header.sc-digi-expandable-faq-item h4.sc-digi-expandable-faq-item,.sc-digi-expandable-faq-item-h .digi-expandable-faq-item__header.sc-digi-expandable-faq-item h5.sc-digi-expandable-faq-item,.sc-digi-expandable-faq-item-h .digi-expandable-faq-item__header.sc-digi-expandable-faq-item h6.sc-digi-expandable-faq-item{margin:0}.sc-digi-expandable-faq-item-h .digi-expandable-faq-item__header--toggle-icon.sc-digi-expandable-faq-item{margin-right:var(--digi--expandable-faq-item--icon--margin-right);transition:var(--digi--expandable-faq-item--header--toggle-icon--transition)}.sc-digi-expandable-faq-item-h .digi-expandable-faq-item__header--toggle-icon--expanded.sc-digi-expandable-faq-item{transform:rotate(-180deg)}.sc-digi-expandable-faq-item-h .digi-expandable-faq-item__header--toggle-icon.sc-digi-expandable-faq-item-s>[slot^=icon],.sc-digi-expandable-faq-item-h .digi-expandable-faq-item__header--toggle-icon .sc-digi-expandable-faq-item-s>[slot^=icon]{--digi--icon--width:var(--digi--expandable-faq-item--icon--size);--digi--icon--height:var(--digi--expandable-faq-item--icon--size)}.sc-digi-expandable-faq-item-h .digi-expandable-faq-item--fullwidth.sc-digi-expandable-faq-item .digi-expandable-faq-item__header.sc-digi-expandable-faq-item{max-width:none}.sc-digi-expandable-faq-item-h .digi-expandable-faq-item__button.sc-digi-expandable-faq-item{color:var(--digi--color--text--primary);background-color:var(--BACKGROUND);border:none;border-radius:0;padding:var(--digi--expandable-faq-item--content--padding);font-size:var(--digi--expandable-faq-item--header--font-size);font-weight:var(--digi--expandable-faq-item--header--font-weight);width:100%;display:flex;align-items:center;text-align:left;cursor:pointer;font-family:var(--digi--global--typography--font-family--default)}.sc-digi-expandable-faq-item-h .digi-expandable-faq-item__button.sc-digi-expandable-faq-item:hover{text-decoration:underline}.sc-digi-expandable-faq-item-h .digi-expandable-faq-item__button.sc-digi-expandable-faq-item:focus-visible{outline:2px solid black;outline-offset:2px;box-shadow:0px 0px 0px 5px white}.sc-digi-expandable-faq-item-h .digi-expandable-faq-item__content.sc-digi-expandable-faq-item{overflow-y:hidden}.sc-digi-expandable-faq-item-h .digi-expandable-faq-item__content.sc-digi-expandable-faq-item>div.sc-digi-expandable-faq-item{padding:var(--digi--expandable-faq-item--content--padding);box-sizing:border-box;max-width:var(--digi--paragraph-width--medium)}.sc-digi-expandable-faq-item-h .digi-expandable-faq-item__content--animation.sc-digi-expandable-faq-item{transition:var(--digi--expandable-faq-item--content--transition)}.sc-digi-expandable-faq-item-h .digi-expandable-faq-item__content--hidden.sc-digi-expandable-faq-item{height:0}`;
6
-
7
- const ExpandableFaqItem = class {
8
- constructor(hostRef) {
9
- registerInstance(this, hostRef);
10
- this.afOnClick = createEvent(this, "afOnClick", 7);
11
- /**
12
- * Sätter rubriknivå. 'h3' är förvalt.
13
- * @en Set heading level. Default is 'h3'
14
- */
15
- this.afHeadingLevel = ExpandableFaqItemHeadingLevel.H3;
16
- /**
17
- * Gör så att komponenten tar upp 100% i bredd av ytan den befinner sig i.
18
- * @en Makes the component take up 100% of the width of the surface it is in.
19
- */
20
- this.afFullWidth = false;
21
- /**
22
- * Sätter läge på FAQ-frågan om den ska vara expanderad eller ej.
23
- * @en Sets the state of the FAQ item to expanded or not.
24
- */
25
- this.afExpanded = false;
26
- /**
27
- * Sätter variant. Kan vara 'Primary' eller 'Secondary'
28
- * @en Set variation. Can be 'Primary' or 'Secondary'
29
- */
30
- this.afVariation = ExpandableFaqItemVariation.PRIMARY;
31
- /**
32
- * Ställer in ifall komponenten ska ha en animation vid utfällning. Animation är påslagen som standard.
33
- * @en Sets the state of the animation for the accordion's expanded area. Animation is on as default.
34
- */
35
- this.afAnimation = true;
36
- /**
37
- * Sätter attributet 'id'. Om inget väljs så skapas ett slumpmässigt id.
38
- * @en Set id attribute. Defaults to random string.
39
- */
40
- this.afId = randomIdGenerator('digi-expandable-faq-item');
41
- }
42
- get cssModifiers() {
43
- return {
44
- 'digi-expandable-faq-item--expanded': this.afExpanded,
45
- 'digi-expandable-faq-item--fullwidth': this.afFullWidth,
46
- 'digi-expandable-faq-item--primary': this.afVariation === ExpandableFaqItemVariation.PRIMARY,
47
- 'digi-expandable-faq-item--secondary': this.afVariation === ExpandableFaqItemVariation.SECONDARY,
48
- 'digi-expandable-faq-item--tertiary': this.afVariation === ExpandableFaqItemVariation.TERTIARY
49
- };
50
- }
51
- /**
52
- * Hämtar en höjden till innehållet i vanliga frågor och svar och animera innehållet.
53
- * @en Gets a height to the content for FAQ and animate the content.
54
- */
55
- componentDidLoad() {
56
- const content = this.hostElement.querySelector(`#${this.afId}-content`);
57
- if (!this.afExpanded) {
58
- content.setAttribute('style', 'visibility: hidden;');
59
- }
60
- else {
61
- content.setAttribute('style', 'height: auto;');
62
- }
63
- content.addEventListener('transitionend', () => {
64
- if (!this.afExpanded) {
65
- content.setAttribute('style', 'visibility: hidden; height: ' + 0 + 'px');
66
- }
67
- else
68
- content.setAttribute('style', 'height: auto');
69
- });
70
- }
71
- animateContentHeight() {
72
- const content = this.hostElement.querySelector(`#${this.afId}-content`);
73
- const sectionHeight = content.firstElementChild
74
- .offsetHeight;
75
- if (!this.afExpanded && content.style.height === 'auto') {
76
- content.setAttribute('style', 'height: ' + sectionHeight + 'px');
77
- setTimeout(() => {
78
- content.setAttribute('style', 'height: 0');
79
- });
80
- return;
81
- }
82
- if (this.afExpanded) {
83
- content.setAttribute('style', 'visibility: visible; height:' + sectionHeight + 'px');
84
- if (!this.afAnimation) {
85
- setTimeout(() => {
86
- content.setAttribute('style', 'height: auto');
87
- });
88
- }
89
- }
90
- else {
91
- content.setAttribute('style', 'height: ' + 0 + 'px');
92
- }
93
- }
94
- render() {
95
- return (h("article", { key: '6d3c64be92f3bf878a6319f8bc6a74b944b9621d', "aria-expanded": this.afExpanded ? 'true' : 'false', class: Object.assign({ 'digi-expandable-faq-item': true }, this.cssModifiers) }, h("header", { key: '7c2929a9fbef5158ba44cc9822cd4592072fdeb1', class: "digi-expandable-faq-item__header" }, h(this.afHeadingLevel, { key: '79e19f80b947765f4ec9e342849ebfef121f1694' }, h("button", { key: 'e08fe43a72da2004e977ecad16383100de0b49c7', type: "button", class: "digi-expandable-faq-item__button", onClick: (e) => {
96
- e.preventDefault();
97
- this.afExpanded = !this.afExpanded;
98
- this.afOnClick.emit(e);
99
- }, "aria-expanded": this.afExpanded ? 'true' : 'false', "aria-controls": `${this.afId}-content` }, h("digi-icon-chevron-down", { key: '245e1d2578b3e15d0fc83aaf82ca5b19a292ab20', class: {
100
- 'digi-expandable-faq-item__header--toggle-icon': true,
101
- 'digi-expandable-faq-item__header--toggle-icon--expanded': this.afExpanded
102
- } }), h("div", { key: '6b37c5b10fee03cb1e8fbaebf4afa879131fef08', class: "digi-expandable-faq-item__header-text" }, this.afHeading)))), h("section", { key: '5d0083596a6a9d8dc17db3814dd7fc5b7672def1', class: {
103
- 'digi-expandable-faq-item__content': true,
104
- 'digi-expandable-faq-item__content--animation': this.afAnimation,
105
- 'digi-expandable-faq-item__content--hidden': !this.afExpanded
106
- }, id: `${this.afId}-content` }, h("div", { key: '1c11f15e328118a0adc6c5fb0cb88b7c8f3b8470' }, h("digi-typography", { key: '0253266ad670b87a5a9291101d965899f14f0b16' }, h("slot", { key: '7c277acd32d84ccc6b1c14913aebde586a2ea148' }))))));
107
- }
108
- get hostElement() { return getElement(this); }
109
- static get watchers() { return {
110
- "afExpanded": [{
111
- "animateContentHeight": 0
112
- }]
113
- }; }
114
- };
115
- ExpandableFaqItem.style = expandableFaqItemCss();
116
-
117
- export { ExpandableFaqItem as digi_expandable_faq_item };
@@ -1,203 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h, a as Host, d as getElement } from './index-BnKuq1L7.js';
2
- import { r as randomIdGenerator } from './randomIdGenerator.util-BGaIliX6.js';
3
- import { a as FormInputType, F as FormInputButtonVariation } from './form-input-type.enum-BSJH8Lpg.js';
4
- import { F as FormInputMode, b as FormInputVariation, a as FormInputValidation } from './form-input-variation.enum-DfWZa2Wv.js';
5
-
6
- 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}`;
7
-
8
- const FormInput = class {
9
- constructor(hostRef) {
10
- registerInstance(this, hostRef);
11
- this.afOnChange = createEvent(this, "afOnChange", 7);
12
- this.afOnBlur = createEvent(this, "afOnBlur", 7);
13
- this.afOnKeyup = createEvent(this, "afOnKeyup", 7);
14
- this.afOnFocus = createEvent(this, "afOnFocus", 7);
15
- this.afOnFocusout = createEvent(this, "afOnFocusout", 7);
16
- this.afOnInput = createEvent(this, "afOnInput", 7);
17
- this.afOnDirty = createEvent(this, "afOnDirty", 7);
18
- this.afOnTouched = createEvent(this, "afOnTouched", 7);
19
- this.afOnReady = createEvent(this, "afOnReady", 3);
20
- this.hasActiveValidationMessage = false;
21
- this.dirty = false;
22
- this.touched = false;
23
- /**
24
- * Sätter attributet 'type'.
25
- * @en Input type attribute
26
- */
27
- this.afType = FormInputType.TEXT;
28
- /**
29
- * Sätter attributet 'inputmode'.
30
- * @en Inputmode type attribute
31
- */
32
- this.afInputmode = FormInputMode.DEFAULT;
33
- /**
34
- * Layout för hur inmatningsfältet ska visas då det finns en knapp
35
- * @en Input layout when there is a button
36
- */
37
- this.afButtonVariation = FormInputButtonVariation.PRIMARY;
38
- /**
39
- * Sätter variant. Kan vara 'small', 'medium' eller 'large'
40
- * @en Set input variation.
41
- */
42
- this.afVariation = FormInputVariation.MEDIUM;
43
- /**
44
- * Sätter attributet 'id'. Om inget väljs så skapas ett slumpmässigt id.
45
- * @en Input id attribute. Defaults to random string.
46
- */
47
- this.afId = randomIdGenerator('digi-form-input');
48
- /**
49
- * Sätt denna till true om formuläret innehåller fler obligatoriska fält än valfria.
50
- * @en Set this to true if the form contains more required fields than optional fields.
51
- */
52
- this.afAnnounceIfOptional = false;
53
- /**
54
- * Sätter valideringsstatus. Kan vara 'success', 'error', 'warning', 'neutral' eller ingenting.
55
- * @en Set input validation status
56
- */
57
- this.afValidation = FormInputValidation.NEUTRAL;
58
- /**
59
- * Om värdet är true får felmeddelandet attributet role="alert".
60
- * Om felet visas tillsammans med flera andra fel (till exempel efter servervalidering) ska värdet sättas till false.
61
- * @en If the value is true, the error message gets the attribute role="alert".
62
- * If the error is shown together with multiple errors (for example after server-side validation), the value should be set to false.
63
- */
64
- this.afErrorMessageIsAlert = true;
65
- }
66
- onValueChanged(value) {
67
- this.afValue = value;
68
- }
69
- onAfValueChanged(value) {
70
- this.value = value;
71
- if (this._input && this._input.value !== String(value !== null && value !== void 0 ? value : '')) {
72
- this._input.value = String(value !== null && value !== void 0 ? value : '');
73
- }
74
- }
75
- get errorMessageIsAlert() {
76
- return (this.afErrorMessageIsAlert !== false &&
77
- this.afErrorMessageIsAlert !== 'false');
78
- }
79
- afValidationTextWatch() {
80
- this.setActiveValidationMessage();
81
- }
82
- /**
83
- * Hämtar en referens till inputelementet. Bra för att t.ex. sätta fokus programmatiskt.
84
- * @en Returns a reference to the input element. Handy for setting focus programmatically.
85
- */
86
- async afMGetFormControlElement() {
87
- return this._input;
88
- }
89
- /**
90
- * Lyssnar på om fokus sätts på custom-elementet och propagerar ner det till själva input-elementet.
91
- * @en Listens for when focus is set on the custom element and propagates it down to the actual input element.
92
- */
93
- focusOnInput() {
94
- this._input.focus();
95
- }
96
- componentWillLoad() {
97
- this.afValue ? (this.value = this.afValue) : (this.afValue = this.value);
98
- this.setActiveValidationMessage();
99
- this.setHasButton();
100
- }
101
- componentWillUpdate() {
102
- this.setHasButton();
103
- }
104
- componentDidLoad() {
105
- this.afOnReady.emit();
106
- }
107
- setActiveValidationMessage() {
108
- this.hasActiveValidationMessage = !!this.afValidationText;
109
- }
110
- get cssModifiers() {
111
- return {
112
- 'digi-form-input--small': this.afVariation === FormInputVariation.SMALL,
113
- 'digi-form-input--medium': this.afVariation === FormInputVariation.MEDIUM,
114
- 'digi-form-input--large': this.afVariation === FormInputVariation.LARGE,
115
- 'digi-form-input--neutral': this.afValidation === FormInputValidation.NEUTRAL,
116
- 'digi-form-input--success': this.afValidation === FormInputValidation.SUCCESS,
117
- 'digi-form-input--error': this.afValidation === FormInputValidation.ERROR,
118
- 'digi-form-input--warning': this.afValidation === FormInputValidation.WARNING,
119
- [`digi-form-input--button-variation-${this.afButtonVariation}`]: !!this.afButtonVariation,
120
- [`digi-form-input--has-button-${this.hasButton}`]: true,
121
- 'digi-form-input--empty': !this.afValue &&
122
- (!this.afValidation ||
123
- this.afValidation === FormInputValidation.NEUTRAL)
124
- };
125
- }
126
- blurHandler(e) {
127
- const trimableTypes = [
128
- FormInputType.TEXT,
129
- FormInputType.EMAIL,
130
- FormInputType.SEARCH,
131
- FormInputType.TEL,
132
- FormInputType.URL
133
- ];
134
- const shouldTrim = this.afTrimValue && trimableTypes.includes(this.afType);
135
- if (shouldTrim && typeof e.target.value === 'string') {
136
- const trimmedValue = e.target.value.trim();
137
- if (trimmedValue !== e.target.value) {
138
- this.afValue = this.value = trimmedValue;
139
- if (this._input) {
140
- this._input.value = trimmedValue;
141
- }
142
- // Emittar afOnInput så Angulars value accessor får det trimmade värdet
143
- this.afOnInput.emit(e);
144
- }
145
- }
146
- if (!this.touched) {
147
- this.afOnTouched.emit(e);
148
- this.touched = true;
149
- }
150
- this.afOnBlur.emit(e);
151
- }
152
- changeHandler(e) {
153
- this.setActiveValidationMessage();
154
- this.afOnChange.emit(e);
155
- }
156
- focusHandler(e) {
157
- this.afOnFocus.emit(e);
158
- }
159
- focusoutHandler(e) {
160
- this.afOnFocusout.emit(e);
161
- }
162
- keyupHandler(e) {
163
- this.afOnKeyup.emit(e);
164
- }
165
- inputHandler(e) {
166
- this.afValue = this.value =
167
- this.afType === FormInputType.NUMBER
168
- ? parseFloat(e.target.value)
169
- : e.target.value;
170
- if (!this.dirty) {
171
- this.afOnDirty.emit(e);
172
- this.dirty = true;
173
- }
174
- this.setActiveValidationMessage();
175
- this.afOnInput.emit(e);
176
- }
177
- setHasButton() {
178
- this.hasButton = !!this.hostElement.querySelector('[slot="button"]');
179
- }
180
- render() {
181
- return (h(Host, { key: '2739bdd7385125581d7ea9c25a3610f5950c6a74', tabindex: -1 }, h("div", { key: '7e261c1e2fc4f37f4ddda861872a470c89181e16', class: Object.assign({ 'digi-form-input': true }, this.cssModifiers) }, 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 }), h("div", { key: '68d715181c180ebaf957dfb46afb63b19b8a8188', class: "digi-form-input__input-wrapper" }, 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 === FormInputValidation.ERROR
182
- ? 'true'
183
- : '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 == FormInputMode.DEFAULT
184
- ? {}
185
- : { inputmode: this.afInputmode }))), h("slot", { key: 'c14ae079a53099fc3928bcf3ac7f5517c20b0f36', name: "button" })), h("div", { key: '75d6afa176cd8620e31c384e169b3c84a3bb584d', class: "digi-form-input__footer" }, h("div", { key: '81029d425aae06e3c72c08afe982f2ff1a7bb81d', class: "digi-form-input__validation", "aria-atomic": "true", role: this.errorMessageIsAlert ? 'alert' : null, id: `${this.afId}--validation-message` }, this.hasActiveValidationMessage &&
186
- this.afValidation != FormInputValidation.NEUTRAL && (h("digi-form-validation-message", { key: '9a8fec12db8c78a037a9b70194b32814d7641dad', class: "digi-form-input__validation-message", "af-variation": this.afValidation }, this.afValidationText)))))));
187
- }
188
- get hostElement() { return getElement(this); }
189
- static get watchers() { return {
190
- "value": [{
191
- "onValueChanged": 0
192
- }],
193
- "afValue": [{
194
- "onAfValueChanged": 0
195
- }],
196
- "afValidationText": [{
197
- "afValidationTextWatch": 0
198
- }]
199
- }; }
200
- };
201
- FormInput.style = formInputCss();
202
-
203
- export { FormInput as digi_form_input };
@@ -1,143 +0,0 @@
1
- import { r as registerInstance, h, d as getElement } from './index-BnKuq1L7.js';
2
- import { r as randomIdGenerator } from './randomIdGenerator.util-BGaIliX6.js';
3
- import { l as logger } from './logger.util-DdB9j8uV.js';
4
- import { _ as _t } from './text-DsO1BTml.js';
5
- import { F as FormValidationMessageVariation } from './form-validation-message-variation.enum-B8hpiXmh.js';
6
-
7
- 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)}`;
8
-
9
- const FormLabel = class {
10
- constructor(hostRef) {
11
- registerInstance(this, hostRef);
12
- /**
13
- * Sätter attributet 'id'. Om inget väljs så skapas ett slumpmässigt id.
14
- * @en Set id attribute. Defaults to random string.
15
- */
16
- this.afId = randomIdGenerator('digi-form-label');
17
- /**
18
- * Sätt denna till true om formuläret innehåller fler obligatoriska fält än valfria.
19
- * @en Set this to true if the form contains more required fields than optional fields.
20
- */
21
- this.afAnnounceIfOptional = false;
22
- /**
23
- * Sätter text för afRequired.
24
- * @en Set text for afRequired.
25
- */
26
- this.afRequiredText = _t.required.toLowerCase();
27
- /**
28
- * Sätter text för afAnnounceIfOptional.
29
- * @en Set text for afAnnounceIfOptional.
30
- */
31
- this.afAnnounceIfOptionalText = _t.optional.toLowerCase();
32
- }
33
- componentWillLoad() {
34
- this.setLabelText();
35
- this.validateFor();
36
- this.handleSlotVisibility();
37
- }
38
- validateFor() {
39
- if (this.afFor == null) {
40
- logger.warn(`digi-form-label must have a for attribute. Please add a for attribute using af-for`, this.hostElement);
41
- }
42
- }
43
- setLabelText() {
44
- this.labelText = `${this.afLabel} ${this.requiredText}`;
45
- if (!this.afLabel) {
46
- logger.warn(`digi-form-label must have a label. Please add a label using af-label`, this.hostElement);
47
- }
48
- }
49
- handleSlotVisibility() {
50
- this.hasActionSlot = !!this.hostElement.querySelector('[slot="actions"]');
51
- }
52
- get requiredText() {
53
- if (this.afRequired && !this.afAnnounceIfOptional) {
54
- return this.afRequiredText ? ` (${this.afRequiredText})` : '';
55
- }
56
- else if (!this.afRequired && this.afAnnounceIfOptional) {
57
- return this.afAnnounceIfOptionalText
58
- ? ` (${this.afAnnounceIfOptionalText})`
59
- : '';
60
- }
61
- else {
62
- return '';
63
- }
64
- }
65
- render() {
66
- return (h("div", { key: 'ac9aec4d1d20cc37694af578a97a16a17291c9f3', class: "digi-form-label" }, h("div", { key: 'bf27c3012d1973798095e6b832572fc20863c5f1', class: "digi-form-label__label-group" }, this.afFor && this.afLabel && (h("label", { key: '75435e49548e4fa27330a35b033689a0ed9e99a7', class: "digi-form-label__label", htmlFor: this.afFor, id: this.afId }, h("span", { key: '0527ddcebbd2a1b215f42eaed06ba7fc28633d43', class: "digi-form-label__label--label" }, this.labelText), this.afDescription && (h("span", { key: '8a3b3e6a0ec0a97adb0760b390f0ddb34b3e0b87', class: "digi-form-label__label--description" }, this.afDescription)))), this.hasActionSlot && (h("div", { key: 'f2e6ad691a5cbc57b990416097454a393da35c01', class: "digi-form-label__actions" }, h("slot", { key: '1fab5cca94da7ad0f2b617db7f713d3b4d17c52d', name: "actions" }))))));
67
- }
68
- get hostElement() { return getElement(this); }
69
- static get watchers() { return {
70
- "afFor": [{
71
- "validateFor": 0
72
- }],
73
- "afLabel": [{
74
- "setLabelText": 0
75
- }],
76
- "afRequired": [{
77
- "setLabelText": 0
78
- }],
79
- "afAnnounceIfOptional": [{
80
- "setLabelText": 0
81
- }]
82
- }; }
83
- };
84
- FormLabel.style = formLabelCss();
85
-
86
- 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)}`;
87
-
88
- const FormValidationMessage = class {
89
- constructor(hostRef) {
90
- registerInstance(this, hostRef);
91
- /**
92
- * Sätter valideringsstatus. Kan vara 'success', 'error' eller 'warning'.
93
- * @en Set validation status
94
- */
95
- this.afVariation = FormValidationMessageVariation.SUCCESS;
96
- }
97
- get cssModifiers() {
98
- return {
99
- 'digi-form-validation-message--success': this.afVariation === FormValidationMessageVariation.SUCCESS,
100
- 'digi-form-validation-message--error': this.afVariation === FormValidationMessageVariation.ERROR,
101
- 'digi-form-validation-message--warning': this.afVariation === FormValidationMessageVariation.WARNING
102
- };
103
- }
104
- get icon() {
105
- switch (this.afVariation) {
106
- case FormValidationMessageVariation.SUCCESS:
107
- return h("digi-icon-validation-success", null);
108
- case FormValidationMessageVariation.ERROR:
109
- return h("digi-icon-validation-error", null);
110
- case FormValidationMessageVariation.WARNING:
111
- return h("digi-icon-validation-warning", { class: "warning" });
112
- }
113
- }
114
- render() {
115
- return (h("div", { key: '5c89cb2cfe7085ec0203814f2c7a43c9fe518db4', class: Object.assign({ 'digi-form-validation-message': true }, this.cssModifiers) }, h("div", { key: 'cb85b6a6e02b081710f80ad7bbbe96e182d8c353', class: "digi-form-validation-message__icon", "aria-hidden": "true" }, this.icon), h("span", { key: '9b1689dcad19fd3f033c679f496a1c94348f393b', class: "digi-form-validation-message__text" }, h("slot", { key: '794c1b1c0771cae8c0b19bd7123f7f5bc28e99b7' }))));
116
- }
117
- get hostElement() { return getElement(this); }
118
- };
119
- FormValidationMessage.style = formValidationMessageCss();
120
-
121
- 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)}`;
122
-
123
- const IconCheckCircle = class {
124
- constructor(hostRef) {
125
- registerInstance(this, hostRef);
126
- /**
127
- * För att dölja ikonen för skärmläsare. Default är satt till true.
128
- * @en Hides the icon for screen readers. Default is set to true.
129
- */
130
- this.afSvgAriaHidden = true;
131
- this.titleId = randomIdGenerator('icontitle');
132
- }
133
- render() {
134
- return (h("svg", { key: '1c9dcaf014e400504cbce24f69c67bdbb1dc0361', class: "digi-icon-validation-success", width: "25", height: "25", viewBox: "0 0 25 25", "aria-hidden": this.afSvgAriaHidden ? 'true' : 'false', "aria-labelledby": this.afSvgAriaLabelledby
135
- ? this.afSvgAriaLabelledby
136
- : this.afTitle
137
- ? this.titleId
138
- : undefined, xmlns: "http://www.w3.org/2000/svg" }, this.afTitle && h("title", { key: 'ed5b4d39b987b025d99ef2ce2153a8de749f587e', id: this.titleId }, this.afTitle), this.afDesc && h("desc", { key: '7c5175b745577dd9076170ba83fa00f8cc03c4a2' }, this.afDesc), h("path", { key: 'f9cb601de2dfbf7959b2b43023692e111f1fbf91', 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" })));
139
- }
140
- };
141
- IconCheckCircle.style = iconValidationSuccessCss();
142
-
143
- export { FormLabel as digi_form_label, FormValidationMessage as digi_form_validation_message, IconCheckCircle as digi_icon_validation_success };