@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,119 +0,0 @@
1
- 'use strict';
2
-
3
- var index = require('./index-Cn1hHaSy.js');
4
- var expandableFaqItemVariation_enum = require('./expandable-faq-item-variation.enum-aKkYAQgd.js');
5
- var randomIdGenerator_util = require('./randomIdGenerator.util-C8XR2Tn1.js');
6
-
7
- 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}`;
8
-
9
- const ExpandableFaqItem = class {
10
- constructor(hostRef) {
11
- index.registerInstance(this, hostRef);
12
- this.afOnClick = index.createEvent(this, "afOnClick", 7);
13
- /**
14
- * Sätter rubriknivå. 'h3' är förvalt.
15
- * @en Set heading level. Default is 'h3'
16
- */
17
- this.afHeadingLevel = expandableFaqItemVariation_enum.ExpandableFaqItemHeadingLevel.H3;
18
- /**
19
- * Gör så att komponenten tar upp 100% i bredd av ytan den befinner sig i.
20
- * @en Makes the component take up 100% of the width of the surface it is in.
21
- */
22
- this.afFullWidth = false;
23
- /**
24
- * Sätter läge på FAQ-frågan om den ska vara expanderad eller ej.
25
- * @en Sets the state of the FAQ item to expanded or not.
26
- */
27
- this.afExpanded = false;
28
- /**
29
- * Sätter variant. Kan vara 'Primary' eller 'Secondary'
30
- * @en Set variation. Can be 'Primary' or 'Secondary'
31
- */
32
- this.afVariation = expandableFaqItemVariation_enum.ExpandableFaqItemVariation.PRIMARY;
33
- /**
34
- * Ställer in ifall komponenten ska ha en animation vid utfällning. Animation är påslagen som standard.
35
- * @en Sets the state of the animation for the accordion's expanded area. Animation is on as default.
36
- */
37
- this.afAnimation = true;
38
- /**
39
- * Sätter attributet 'id'. Om inget väljs så skapas ett slumpmässigt id.
40
- * @en Set id attribute. Defaults to random string.
41
- */
42
- this.afId = randomIdGenerator_util.randomIdGenerator('digi-expandable-faq-item');
43
- }
44
- get cssModifiers() {
45
- return {
46
- 'digi-expandable-faq-item--expanded': this.afExpanded,
47
- 'digi-expandable-faq-item--fullwidth': this.afFullWidth,
48
- 'digi-expandable-faq-item--primary': this.afVariation === expandableFaqItemVariation_enum.ExpandableFaqItemVariation.PRIMARY,
49
- 'digi-expandable-faq-item--secondary': this.afVariation === expandableFaqItemVariation_enum.ExpandableFaqItemVariation.SECONDARY,
50
- 'digi-expandable-faq-item--tertiary': this.afVariation === expandableFaqItemVariation_enum.ExpandableFaqItemVariation.TERTIARY
51
- };
52
- }
53
- /**
54
- * Hämtar en höjden till innehållet i vanliga frågor och svar och animera innehållet.
55
- * @en Gets a height to the content for FAQ and animate the content.
56
- */
57
- componentDidLoad() {
58
- const content = this.hostElement.querySelector(`#${this.afId}-content`);
59
- if (!this.afExpanded) {
60
- content.setAttribute('style', 'visibility: hidden;');
61
- }
62
- else {
63
- content.setAttribute('style', 'height: auto;');
64
- }
65
- content.addEventListener('transitionend', () => {
66
- if (!this.afExpanded) {
67
- content.setAttribute('style', 'visibility: hidden; height: ' + 0 + 'px');
68
- }
69
- else
70
- content.setAttribute('style', 'height: auto');
71
- });
72
- }
73
- animateContentHeight() {
74
- const content = this.hostElement.querySelector(`#${this.afId}-content`);
75
- const sectionHeight = content.firstElementChild
76
- .offsetHeight;
77
- if (!this.afExpanded && content.style.height === 'auto') {
78
- content.setAttribute('style', 'height: ' + sectionHeight + 'px');
79
- setTimeout(() => {
80
- content.setAttribute('style', 'height: 0');
81
- });
82
- return;
83
- }
84
- if (this.afExpanded) {
85
- content.setAttribute('style', 'visibility: visible; height:' + sectionHeight + 'px');
86
- if (!this.afAnimation) {
87
- setTimeout(() => {
88
- content.setAttribute('style', 'height: auto');
89
- });
90
- }
91
- }
92
- else {
93
- content.setAttribute('style', 'height: ' + 0 + 'px');
94
- }
95
- }
96
- render() {
97
- return (index.h("article", { key: '6d3c64be92f3bf878a6319f8bc6a74b944b9621d', "aria-expanded": this.afExpanded ? 'true' : 'false', class: Object.assign({ 'digi-expandable-faq-item': true }, this.cssModifiers) }, index.h("header", { key: '7c2929a9fbef5158ba44cc9822cd4592072fdeb1', class: "digi-expandable-faq-item__header" }, index.h(this.afHeadingLevel, { key: '79e19f80b947765f4ec9e342849ebfef121f1694' }, index.h("button", { key: 'e08fe43a72da2004e977ecad16383100de0b49c7', type: "button", class: "digi-expandable-faq-item__button", onClick: (e) => {
98
- e.preventDefault();
99
- this.afExpanded = !this.afExpanded;
100
- this.afOnClick.emit(e);
101
- }, "aria-expanded": this.afExpanded ? 'true' : 'false', "aria-controls": `${this.afId}-content` }, index.h("digi-icon-chevron-down", { key: '245e1d2578b3e15d0fc83aaf82ca5b19a292ab20', class: {
102
- 'digi-expandable-faq-item__header--toggle-icon': true,
103
- 'digi-expandable-faq-item__header--toggle-icon--expanded': this.afExpanded
104
- } }), index.h("div", { key: '6b37c5b10fee03cb1e8fbaebf4afa879131fef08', class: "digi-expandable-faq-item__header-text" }, this.afHeading)))), index.h("section", { key: '5d0083596a6a9d8dc17db3814dd7fc5b7672def1', class: {
105
- 'digi-expandable-faq-item__content': true,
106
- 'digi-expandable-faq-item__content--animation': this.afAnimation,
107
- 'digi-expandable-faq-item__content--hidden': !this.afExpanded
108
- }, id: `${this.afId}-content` }, index.h("div", { key: '1c11f15e328118a0adc6c5fb0cb88b7c8f3b8470' }, index.h("digi-typography", { key: '0253266ad670b87a5a9291101d965899f14f0b16' }, index.h("slot", { key: '7c277acd32d84ccc6b1c14913aebde586a2ea148' }))))));
109
- }
110
- get hostElement() { return index.getElement(this); }
111
- static get watchers() { return {
112
- "afExpanded": [{
113
- "animateContentHeight": 0
114
- }]
115
- }; }
116
- };
117
- ExpandableFaqItem.style = expandableFaqItemCss();
118
-
119
- exports.digi_expandable_faq_item = ExpandableFaqItem;
@@ -1,205 +0,0 @@
1
- 'use strict';
2
-
3
- var index = require('./index-Cn1hHaSy.js');
4
- var randomIdGenerator_util = require('./randomIdGenerator.util-C8XR2Tn1.js');
5
- var formInputType_enum = require('./form-input-type.enum-DvF_MTHK.js');
6
- var formInputVariation_enum = require('./form-input-variation.enum-kpoXNUuI.js');
7
-
8
- 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}`;
9
-
10
- const FormInput = class {
11
- constructor(hostRef) {
12
- index.registerInstance(this, hostRef);
13
- this.afOnChange = index.createEvent(this, "afOnChange", 7);
14
- this.afOnBlur = index.createEvent(this, "afOnBlur", 7);
15
- this.afOnKeyup = index.createEvent(this, "afOnKeyup", 7);
16
- this.afOnFocus = index.createEvent(this, "afOnFocus", 7);
17
- this.afOnFocusout = index.createEvent(this, "afOnFocusout", 7);
18
- this.afOnInput = index.createEvent(this, "afOnInput", 7);
19
- this.afOnDirty = index.createEvent(this, "afOnDirty", 7);
20
- this.afOnTouched = index.createEvent(this, "afOnTouched", 7);
21
- this.afOnReady = index.createEvent(this, "afOnReady", 3);
22
- this.hasActiveValidationMessage = false;
23
- this.dirty = false;
24
- this.touched = false;
25
- /**
26
- * Sätter attributet 'type'.
27
- * @en Input type attribute
28
- */
29
- this.afType = formInputType_enum.FormInputType.TEXT;
30
- /**
31
- * Sätter attributet 'inputmode'.
32
- * @en Inputmode type attribute
33
- */
34
- this.afInputmode = formInputVariation_enum.FormInputMode.DEFAULT;
35
- /**
36
- * Layout för hur inmatningsfältet ska visas då det finns en knapp
37
- * @en Input layout when there is a button
38
- */
39
- this.afButtonVariation = formInputType_enum.FormInputButtonVariation.PRIMARY;
40
- /**
41
- * Sätter variant. Kan vara 'small', 'medium' eller 'large'
42
- * @en Set input variation.
43
- */
44
- this.afVariation = formInputVariation_enum.FormInputVariation.MEDIUM;
45
- /**
46
- * Sätter attributet 'id'. Om inget väljs så skapas ett slumpmässigt id.
47
- * @en Input id attribute. Defaults to random string.
48
- */
49
- this.afId = randomIdGenerator_util.randomIdGenerator('digi-form-input');
50
- /**
51
- * Sätt denna till true om formuläret innehåller fler obligatoriska fält än valfria.
52
- * @en Set this to true if the form contains more required fields than optional fields.
53
- */
54
- this.afAnnounceIfOptional = false;
55
- /**
56
- * Sätter valideringsstatus. Kan vara 'success', 'error', 'warning', 'neutral' eller ingenting.
57
- * @en Set input validation status
58
- */
59
- this.afValidation = formInputVariation_enum.FormInputValidation.NEUTRAL;
60
- /**
61
- * Om värdet är true får felmeddelandet attributet role="alert".
62
- * Om felet visas tillsammans med flera andra fel (till exempel efter servervalidering) ska värdet sättas till false.
63
- * @en If the value is true, the error message gets the attribute role="alert".
64
- * If the error is shown together with multiple errors (for example after server-side validation), the value should be set to false.
65
- */
66
- this.afErrorMessageIsAlert = true;
67
- }
68
- onValueChanged(value) {
69
- this.afValue = value;
70
- }
71
- onAfValueChanged(value) {
72
- this.value = value;
73
- if (this._input && this._input.value !== String(value !== null && value !== void 0 ? value : '')) {
74
- this._input.value = String(value !== null && value !== void 0 ? value : '');
75
- }
76
- }
77
- get errorMessageIsAlert() {
78
- return (this.afErrorMessageIsAlert !== false &&
79
- this.afErrorMessageIsAlert !== 'false');
80
- }
81
- afValidationTextWatch() {
82
- this.setActiveValidationMessage();
83
- }
84
- /**
85
- * Hämtar en referens till inputelementet. Bra för att t.ex. sätta fokus programmatiskt.
86
- * @en Returns a reference to the input element. Handy for setting focus programmatically.
87
- */
88
- async afMGetFormControlElement() {
89
- return this._input;
90
- }
91
- /**
92
- * Lyssnar på om fokus sätts på custom-elementet och propagerar ner det till själva input-elementet.
93
- * @en Listens for when focus is set on the custom element and propagates it down to the actual input element.
94
- */
95
- focusOnInput() {
96
- this._input.focus();
97
- }
98
- componentWillLoad() {
99
- this.afValue ? (this.value = this.afValue) : (this.afValue = this.value);
100
- this.setActiveValidationMessage();
101
- this.setHasButton();
102
- }
103
- componentWillUpdate() {
104
- this.setHasButton();
105
- }
106
- componentDidLoad() {
107
- this.afOnReady.emit();
108
- }
109
- setActiveValidationMessage() {
110
- this.hasActiveValidationMessage = !!this.afValidationText;
111
- }
112
- get cssModifiers() {
113
- return {
114
- 'digi-form-input--small': this.afVariation === formInputVariation_enum.FormInputVariation.SMALL,
115
- 'digi-form-input--medium': this.afVariation === formInputVariation_enum.FormInputVariation.MEDIUM,
116
- 'digi-form-input--large': this.afVariation === formInputVariation_enum.FormInputVariation.LARGE,
117
- 'digi-form-input--neutral': this.afValidation === formInputVariation_enum.FormInputValidation.NEUTRAL,
118
- 'digi-form-input--success': this.afValidation === formInputVariation_enum.FormInputValidation.SUCCESS,
119
- 'digi-form-input--error': this.afValidation === formInputVariation_enum.FormInputValidation.ERROR,
120
- 'digi-form-input--warning': this.afValidation === formInputVariation_enum.FormInputValidation.WARNING,
121
- [`digi-form-input--button-variation-${this.afButtonVariation}`]: !!this.afButtonVariation,
122
- [`digi-form-input--has-button-${this.hasButton}`]: true,
123
- 'digi-form-input--empty': !this.afValue &&
124
- (!this.afValidation ||
125
- this.afValidation === formInputVariation_enum.FormInputValidation.NEUTRAL)
126
- };
127
- }
128
- blurHandler(e) {
129
- const trimableTypes = [
130
- formInputType_enum.FormInputType.TEXT,
131
- formInputType_enum.FormInputType.EMAIL,
132
- formInputType_enum.FormInputType.SEARCH,
133
- formInputType_enum.FormInputType.TEL,
134
- formInputType_enum.FormInputType.URL
135
- ];
136
- const shouldTrim = this.afTrimValue && trimableTypes.includes(this.afType);
137
- if (shouldTrim && typeof e.target.value === 'string') {
138
- const trimmedValue = e.target.value.trim();
139
- if (trimmedValue !== e.target.value) {
140
- this.afValue = this.value = trimmedValue;
141
- if (this._input) {
142
- this._input.value = trimmedValue;
143
- }
144
- // Emittar afOnInput så Angulars value accessor får det trimmade värdet
145
- this.afOnInput.emit(e);
146
- }
147
- }
148
- if (!this.touched) {
149
- this.afOnTouched.emit(e);
150
- this.touched = true;
151
- }
152
- this.afOnBlur.emit(e);
153
- }
154
- changeHandler(e) {
155
- this.setActiveValidationMessage();
156
- this.afOnChange.emit(e);
157
- }
158
- focusHandler(e) {
159
- this.afOnFocus.emit(e);
160
- }
161
- focusoutHandler(e) {
162
- this.afOnFocusout.emit(e);
163
- }
164
- keyupHandler(e) {
165
- this.afOnKeyup.emit(e);
166
- }
167
- inputHandler(e) {
168
- this.afValue = this.value =
169
- this.afType === formInputType_enum.FormInputType.NUMBER
170
- ? parseFloat(e.target.value)
171
- : e.target.value;
172
- if (!this.dirty) {
173
- this.afOnDirty.emit(e);
174
- this.dirty = true;
175
- }
176
- this.setActiveValidationMessage();
177
- this.afOnInput.emit(e);
178
- }
179
- setHasButton() {
180
- this.hasButton = !!this.hostElement.querySelector('[slot="button"]');
181
- }
182
- render() {
183
- 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 === formInputVariation_enum.FormInputValidation.ERROR
184
- ? 'true'
185
- : '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 == formInputVariation_enum.FormInputMode.DEFAULT
186
- ? {}
187
- : { 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 &&
188
- this.afValidation != formInputVariation_enum.FormInputValidation.NEUTRAL && (index.h("digi-form-validation-message", { key: '9a8fec12db8c78a037a9b70194b32814d7641dad', class: "digi-form-input__validation-message", "af-variation": this.afValidation }, this.afValidationText)))))));
189
- }
190
- get hostElement() { return index.getElement(this); }
191
- static get watchers() { return {
192
- "value": [{
193
- "onValueChanged": 0
194
- }],
195
- "afValue": [{
196
- "onAfValueChanged": 0
197
- }],
198
- "afValidationText": [{
199
- "afValidationTextWatch": 0
200
- }]
201
- }; }
202
- };
203
- FormInput.style = formInputCss();
204
-
205
- exports.digi_form_input = FormInput;
@@ -1,147 +0,0 @@
1
- 'use strict';
2
-
3
- var index = require('./index-Cn1hHaSy.js');
4
- var randomIdGenerator_util = require('./randomIdGenerator.util-C8XR2Tn1.js');
5
- var logger_util = require('./logger.util-DUhrcCTY.js');
6
- var text = require('./text-Cu3CaHGj.js');
7
- var formValidationMessageVariation_enum = require('./form-validation-message-variation.enum-BA5nmCiw.js');
8
-
9
- 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)}`;
10
-
11
- const FormLabel = class {
12
- constructor(hostRef) {
13
- index.registerInstance(this, hostRef);
14
- /**
15
- * Sätter attributet 'id'. Om inget väljs så skapas ett slumpmässigt id.
16
- * @en Set id attribute. Defaults to random string.
17
- */
18
- this.afId = randomIdGenerator_util.randomIdGenerator('digi-form-label');
19
- /**
20
- * Sätt denna till true om formuläret innehåller fler obligatoriska fält än valfria.
21
- * @en Set this to true if the form contains more required fields than optional fields.
22
- */
23
- this.afAnnounceIfOptional = false;
24
- /**
25
- * Sätter text för afRequired.
26
- * @en Set text for afRequired.
27
- */
28
- this.afRequiredText = text._t.required.toLowerCase();
29
- /**
30
- * Sätter text för afAnnounceIfOptional.
31
- * @en Set text for afAnnounceIfOptional.
32
- */
33
- this.afAnnounceIfOptionalText = text._t.optional.toLowerCase();
34
- }
35
- componentWillLoad() {
36
- this.setLabelText();
37
- this.validateFor();
38
- this.handleSlotVisibility();
39
- }
40
- validateFor() {
41
- if (this.afFor == null) {
42
- logger_util.logger.warn(`digi-form-label must have a for attribute. Please add a for attribute using af-for`, this.hostElement);
43
- }
44
- }
45
- setLabelText() {
46
- this.labelText = `${this.afLabel} ${this.requiredText}`;
47
- if (!this.afLabel) {
48
- logger_util.logger.warn(`digi-form-label must have a label. Please add a label using af-label`, this.hostElement);
49
- }
50
- }
51
- handleSlotVisibility() {
52
- this.hasActionSlot = !!this.hostElement.querySelector('[slot="actions"]');
53
- }
54
- get requiredText() {
55
- if (this.afRequired && !this.afAnnounceIfOptional) {
56
- return this.afRequiredText ? ` (${this.afRequiredText})` : '';
57
- }
58
- else if (!this.afRequired && this.afAnnounceIfOptional) {
59
- return this.afAnnounceIfOptionalText
60
- ? ` (${this.afAnnounceIfOptionalText})`
61
- : '';
62
- }
63
- else {
64
- return '';
65
- }
66
- }
67
- render() {
68
- 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" }))))));
69
- }
70
- get hostElement() { return index.getElement(this); }
71
- static get watchers() { return {
72
- "afFor": [{
73
- "validateFor": 0
74
- }],
75
- "afLabel": [{
76
- "setLabelText": 0
77
- }],
78
- "afRequired": [{
79
- "setLabelText": 0
80
- }],
81
- "afAnnounceIfOptional": [{
82
- "setLabelText": 0
83
- }]
84
- }; }
85
- };
86
- FormLabel.style = formLabelCss();
87
-
88
- 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)}`;
89
-
90
- const FormValidationMessage = class {
91
- constructor(hostRef) {
92
- index.registerInstance(this, hostRef);
93
- /**
94
- * Sätter valideringsstatus. Kan vara 'success', 'error' eller 'warning'.
95
- * @en Set validation status
96
- */
97
- this.afVariation = formValidationMessageVariation_enum.FormValidationMessageVariation.SUCCESS;
98
- }
99
- get cssModifiers() {
100
- return {
101
- 'digi-form-validation-message--success': this.afVariation === formValidationMessageVariation_enum.FormValidationMessageVariation.SUCCESS,
102
- 'digi-form-validation-message--error': this.afVariation === formValidationMessageVariation_enum.FormValidationMessageVariation.ERROR,
103
- 'digi-form-validation-message--warning': this.afVariation === formValidationMessageVariation_enum.FormValidationMessageVariation.WARNING
104
- };
105
- }
106
- get icon() {
107
- switch (this.afVariation) {
108
- case formValidationMessageVariation_enum.FormValidationMessageVariation.SUCCESS:
109
- return index.h("digi-icon-validation-success", null);
110
- case formValidationMessageVariation_enum.FormValidationMessageVariation.ERROR:
111
- return index.h("digi-icon-validation-error", null);
112
- case formValidationMessageVariation_enum.FormValidationMessageVariation.WARNING:
113
- return index.h("digi-icon-validation-warning", { class: "warning" });
114
- }
115
- }
116
- render() {
117
- return (index.h("div", { key: '5c89cb2cfe7085ec0203814f2c7a43c9fe518db4', class: Object.assign({ 'digi-form-validation-message': true }, this.cssModifiers) }, index.h("div", { key: 'cb85b6a6e02b081710f80ad7bbbe96e182d8c353', class: "digi-form-validation-message__icon", "aria-hidden": "true" }, this.icon), index.h("span", { key: '9b1689dcad19fd3f033c679f496a1c94348f393b', class: "digi-form-validation-message__text" }, index.h("slot", { key: '794c1b1c0771cae8c0b19bd7123f7f5bc28e99b7' }))));
118
- }
119
- get hostElement() { return index.getElement(this); }
120
- };
121
- FormValidationMessage.style = formValidationMessageCss();
122
-
123
- 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)}`;
124
-
125
- const IconCheckCircle = class {
126
- constructor(hostRef) {
127
- index.registerInstance(this, hostRef);
128
- /**
129
- * För att dölja ikonen för skärmläsare. Default är satt till true.
130
- * @en Hides the icon for screen readers. Default is set to true.
131
- */
132
- this.afSvgAriaHidden = true;
133
- this.titleId = randomIdGenerator_util.randomIdGenerator('icontitle');
134
- }
135
- render() {
136
- return (index.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
137
- ? this.afSvgAriaLabelledby
138
- : this.afTitle
139
- ? this.titleId
140
- : undefined, xmlns: "http://www.w3.org/2000/svg" }, this.afTitle && index.h("title", { key: 'ed5b4d39b987b025d99ef2ce2153a8de749f587e', id: this.titleId }, this.afTitle), this.afDesc && index.h("desc", { key: '7c5175b745577dd9076170ba83fa00f8cc03c4a2' }, this.afDesc), index.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" })));
141
- }
142
- };
143
- IconCheckCircle.style = iconValidationSuccessCss();
144
-
145
- exports.digi_form_label = FormLabel;
146
- exports.digi_form_validation_message = FormValidationMessage;
147
- exports.digi_icon_validation_success = IconCheckCircle;