@designsystem-se/af 39.2.1 → 39.2.2

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 (126) hide show
  1. package/components/digi-bar-chart.js +67 -17
  2. package/components/digi-calendar-datepicker.js +1 -1
  3. package/components/digi-calendar-week-view.js +51 -6
  4. package/components/digi-calendar.js +1 -1
  5. package/components/digi-chart-line.js +57 -14
  6. package/components/digi-navigation-vertical-menu.js +27 -13
  7. package/components/digi-tablist.js +36 -13
  8. package/components/{p-CrUxQ9d0.js → p-C5A2t93y.js} +1 -1
  9. package/dist/cjs/{calendar-week-view-heading-level.enum-NEkm5SUq.js → calendar-week-view-heading-level.enum-BI2f9bbk.js} +7 -0
  10. package/dist/cjs/digi-arbetsformedlingen.cjs.js +1 -1
  11. package/dist/cjs/{digi-button_5.cjs.entry.js → digi-badge-notification_8.cjs.entry.js} +436 -7
  12. package/dist/cjs/digi-bar-chart.cjs.entry.js +67 -17
  13. package/dist/cjs/digi-calendar-datepicker.cjs.entry.js +1 -2
  14. package/dist/cjs/digi-calendar_2.cjs.entry.js +1 -1
  15. package/dist/cjs/digi-chart-line.cjs.entry.js +57 -14
  16. package/dist/cjs/digi-code-block_3.cjs.entry.js +1 -2
  17. package/dist/cjs/digi-dialog.cjs.entry.js +1 -2
  18. package/dist/cjs/digi-footer.cjs.entry.js +1 -2
  19. package/dist/cjs/digi-form-error-list.cjs.entry.js +1 -2
  20. package/dist/cjs/digi-form-receipt.cjs.entry.js +1 -2
  21. package/dist/cjs/digi-form-select-filter.cjs.entry.js +1 -2
  22. package/dist/cjs/digi-header-navigation.cjs.entry.js +1 -2
  23. package/dist/cjs/digi-header.cjs.entry.js +1 -2
  24. package/dist/cjs/digi-navigation-pagination.cjs.entry.js +1 -2
  25. package/dist/cjs/digi-navigation-vertical-menu.cjs.entry.js +27 -13
  26. package/dist/cjs/digi-notification-alert.cjs.entry.js +1 -2
  27. package/dist/cjs/digi-notification-error-page.cjs.entry.js +1 -2
  28. package/dist/cjs/digi-title-logo.cjs.entry.js +1 -2
  29. package/dist/cjs/digi-tools-feedback.cjs.entry.js +1 -2
  30. package/dist/cjs/index-Cn1hHaSy.js +2 -14
  31. package/dist/cjs/index.cjs.js +6 -7
  32. package/dist/cjs/loader.cjs.js +1 -1
  33. package/dist/collection/components/_calendar/calendar/calendar.css +5 -6
  34. package/dist/collection/components/_calendar/week-view/calendar-week-view.js +53 -8
  35. package/dist/collection/components/_chart/bar-chart/bar-chart.css +1 -1
  36. package/dist/collection/components/_chart/bar-chart/bar-chart.js +66 -16
  37. package/dist/collection/components/_chart/chart-line/chart-line.js +57 -14
  38. package/dist/collection/components/_navigation/navigation-tablist/navigation-tablist.js +36 -13
  39. package/dist/collection/components/_navigation/navigation-vertical-menu/navigation-vertical-menu.js +27 -13
  40. package/dist/collection/design-tokens/components/_logo.variables.scss +2 -0
  41. package/dist/digi-arbetsformedlingen/digi-arbetsformedlingen.esm.js +1 -1
  42. package/dist/digi-arbetsformedlingen/index.esm.js +1 -1
  43. package/dist/digi-arbetsformedlingen/p-0f7e995a.entry.js +1 -0
  44. package/dist/digi-arbetsformedlingen/p-26f6a310.entry.js +1 -0
  45. package/dist/digi-arbetsformedlingen/p-3b42582a.entry.js +1 -0
  46. package/dist/digi-arbetsformedlingen/p-4384644b.entry.js +1 -0
  47. package/dist/digi-arbetsformedlingen/p-47513f97.entry.js +1 -0
  48. package/dist/digi-arbetsformedlingen/p-569c628c.entry.js +1 -0
  49. package/dist/digi-arbetsformedlingen/p-668d38d9.entry.js +1 -0
  50. package/dist/digi-arbetsformedlingen/p-66f34ca5.entry.js +1 -0
  51. package/dist/digi-arbetsformedlingen/p-6cb1c6ea.entry.js +1 -0
  52. package/dist/digi-arbetsformedlingen/p-6e256f0c.entry.js +1 -0
  53. package/dist/digi-arbetsformedlingen/p-71a8478d.entry.js +1 -0
  54. package/dist/digi-arbetsformedlingen/p-9df345c4.entry.js +1 -0
  55. package/dist/digi-arbetsformedlingen/p-BBOpiDGx.js +1 -0
  56. package/dist/digi-arbetsformedlingen/p-a1deddb1.entry.js +1 -0
  57. package/dist/digi-arbetsformedlingen/p-beebbc90.entry.js +1 -0
  58. package/dist/digi-arbetsformedlingen/{p-ee58a938.entry.js → p-c7ade486.entry.js} +1 -1
  59. package/dist/digi-arbetsformedlingen/p-d065e751.entry.js +1 -0
  60. package/dist/digi-arbetsformedlingen/p-d150094c.entry.js +1 -0
  61. package/dist/digi-arbetsformedlingen/p-df8efa59.entry.js +1 -0
  62. package/dist/digi-arbetsformedlingen/p-e2b0b070.entry.js +1 -0
  63. package/dist/esm/{calendar-week-view-heading-level.enum-DH_-wpLB.js → calendar-week-view-heading-level.enum-BBOpiDGx.js} +8 -1
  64. package/dist/esm/digi-arbetsformedlingen.js +1 -1
  65. package/dist/esm/{digi-button_5.entry.js → digi-badge-notification_8.entry.js} +435 -9
  66. package/dist/esm/digi-bar-chart.entry.js +67 -17
  67. package/dist/esm/digi-calendar-datepicker.entry.js +1 -2
  68. package/dist/esm/digi-calendar_2.entry.js +1 -1
  69. package/dist/esm/digi-chart-line.entry.js +57 -14
  70. package/dist/esm/digi-code-block_3.entry.js +1 -2
  71. package/dist/esm/digi-dialog.entry.js +1 -2
  72. package/dist/esm/digi-footer.entry.js +1 -2
  73. package/dist/esm/digi-form-error-list.entry.js +1 -2
  74. package/dist/esm/digi-form-receipt.entry.js +1 -2
  75. package/dist/esm/digi-form-select-filter.entry.js +1 -2
  76. package/dist/esm/digi-header-navigation.entry.js +1 -2
  77. package/dist/esm/digi-header.entry.js +1 -2
  78. package/dist/esm/digi-navigation-pagination.entry.js +1 -2
  79. package/dist/esm/digi-navigation-vertical-menu.entry.js +27 -13
  80. package/dist/esm/digi-notification-alert.entry.js +1 -2
  81. package/dist/esm/digi-notification-error-page.entry.js +1 -2
  82. package/dist/esm/digi-title-logo.entry.js +1 -2
  83. package/dist/esm/digi-tools-feedback.entry.js +1 -2
  84. package/dist/esm/index-BnKuq1L7.js +2 -14
  85. package/dist/esm/index.js +1 -2
  86. package/dist/esm/loader.js +1 -1
  87. package/dist/types/components/_calendar/week-view/calendar-week-view.d.ts +4 -2
  88. package/dist/types/components/_chart/bar-chart/bar-chart.d.ts +4 -2
  89. package/dist/types/components/_chart/chart-line/chart-line.d.ts +3 -1
  90. package/dist/types/components/_navigation/navigation-tablist/navigation-tablist.d.ts +4 -2
  91. package/dist/types/components/_navigation/navigation-vertical-menu/navigation-vertical-menu.d.ts +7 -2
  92. package/dist/types/components.d.ts +3 -3
  93. package/hydrate/index.js +236 -64
  94. package/hydrate/index.mjs +236 -64
  95. package/package.json +1 -1
  96. package/dist/cjs/badge-notification-shape.enum-CEyEo2G5.js +0 -8
  97. package/dist/cjs/digi-badge-notification.cjs.entry.js +0 -65
  98. package/dist/cjs/digi-tablist-panel.cjs.entry.js +0 -20
  99. package/dist/cjs/digi-tablist.cjs.entry.js +0 -289
  100. package/dist/digi-arbetsformedlingen/p-0394e694.entry.js +0 -1
  101. package/dist/digi-arbetsformedlingen/p-09b52191.entry.js +0 -1
  102. package/dist/digi-arbetsformedlingen/p-0c88f210.entry.js +0 -1
  103. package/dist/digi-arbetsformedlingen/p-151248bf.entry.js +0 -1
  104. package/dist/digi-arbetsformedlingen/p-26099889.entry.js +0 -1
  105. package/dist/digi-arbetsformedlingen/p-52a27991.entry.js +0 -1
  106. package/dist/digi-arbetsformedlingen/p-5ee5766d.entry.js +0 -1
  107. package/dist/digi-arbetsformedlingen/p-626c1bf5.entry.js +0 -1
  108. package/dist/digi-arbetsformedlingen/p-674a7a94.entry.js +0 -1
  109. package/dist/digi-arbetsformedlingen/p-6c1fd994.entry.js +0 -1
  110. package/dist/digi-arbetsformedlingen/p-7682ad6f.entry.js +0 -1
  111. package/dist/digi-arbetsformedlingen/p-7f180ce2.entry.js +0 -1
  112. package/dist/digi-arbetsformedlingen/p-88bec555.entry.js +0 -1
  113. package/dist/digi-arbetsformedlingen/p-CKoZU0-H.js +0 -1
  114. package/dist/digi-arbetsformedlingen/p-DH_-wpLB.js +0 -1
  115. package/dist/digi-arbetsformedlingen/p-a556608d.entry.js +0 -1
  116. package/dist/digi-arbetsformedlingen/p-b3410fbd.entry.js +0 -1
  117. package/dist/digi-arbetsformedlingen/p-e002ceb8.entry.js +0 -1
  118. package/dist/digi-arbetsformedlingen/p-e6ee5a17.entry.js +0 -1
  119. package/dist/digi-arbetsformedlingen/p-ec6dd177.entry.js +0 -1
  120. package/dist/digi-arbetsformedlingen/p-eee1b91f.entry.js +0 -1
  121. package/dist/digi-arbetsformedlingen/p-fea63204.entry.js +0 -1
  122. package/dist/digi-arbetsformedlingen/p-ff73fa2f.entry.js +0 -1
  123. package/dist/esm/badge-notification-shape.enum-CKoZU0-H.js +0 -8
  124. package/dist/esm/digi-badge-notification.entry.js +0 -63
  125. package/dist/esm/digi-tablist-panel.entry.js +0 -18
  126. package/dist/esm/digi-tablist.entry.js +0 -287
package/hydrate/index.mjs CHANGED
@@ -10905,7 +10905,7 @@ const _t = Object.assign(Object.assign({}, common), { calendar,
10905
10905
  progressList,
10906
10906
  time });
10907
10907
 
10908
- const calendarCss = () => `.sc-digi-calendar-h{--digi--calendar--display:inline-block;--digi--calendar--header--font-family:var(--digi--global--typography--font-family--default);--digi--calendar--header--font-weight:var(--digi--global--typography--font-weight--semibold);--digi--calendar--header--display:flex;--digi--calendar--header--align-items:center;--digi--calendar--header--justify-content:space-between;--digi--calendar--header--text-align:center;--digi--calendar--header--button--padding:var(--digi--gutter--medium) var(--digi--gutter--largest);--digi--calendar--header--button--background:transparent;--digi--calendar--header--button--box-shadow:none;--digi--calendar--header--button--background--hover:var(--digi--color--background--interactive--hover--secondary);--digi--calendar--table--border-spacing:0;--digi--calendar--table--border-collapse:collapse;--digi--calendar--table--font-family:var(--digi--global--typography--font-family--default);--digi--calendar--table--font-weight:var(--digi--global--typography--font-weight--semibold);--digi--calendar--table-header--padding:var(--digi--gutter--larger) 0;--digi--calendar--table-header--font-weight-normal:var(--digi--typography--body--font-weight--desktop);--digi--calendar--date--border-color:none;--digi--calendar--date--box-shadow:none;--digi--calendar--date--background-color:var(--digi--color--background--interactive--default--secondary);--digi--calendar--date--background-color--hover:var(--digi--color--background--interactive--hover--secondary);--digi--calendar--date--padding:var(--digi--gutter--large);--digi--calendar--date--color:var(--digi--color--text--primary);--digi--calendar--date--focused--background-color:var(--digi--color--background--interactive--hover--secondary);--digi--calendar--date--today--circle-border:2px solid var(--digi--color--marking--indication--secondary);--digi--calendar--date--today--circle-margin:10%;--digi--calendar--date--selected--color:var(--digi--color--text--interactive--secondary);--digi--calendar--date--selected--background-color:var(--digi--color--background--interactive--selected--primary);--digi--calendar--date--not-selectable-strike--color:var(--digi--color--marking--indication--tertiary);--digi--calendar--week--font-style:italic;--digi--calendar--week--font-size:var(--digi--global--typography--font-size--small);--digi--calendar--week--border-color:var(--digi--color--divider--primary);--digi--calendar--week--border-width:var(--digi--border-width--primary)}.sc-digi-calendar-h .digi-calendar.sc-digi-calendar{display:var(--digi--calendar--display);background:var(--digi--calendar--header--button--background);padding:0px 1px 3px 1px;overflow:hidden;max-width:23.4375rem}.sc-digi-calendar-h .digi-calendar--hide.sc-digi-calendar{--digi--calendar--display:none}.sc-digi-calendar-h .digi-calendar__header.sc-digi-calendar{display:var(--digi--calendar--header--display);align-items:var(--digi--calendar--header--align-items);justify-content:var(--digi--calendar--header--justify-content);text-align:var(--digi--calendar--header--text-align);font-size:var(--digi--global--typography--font-size--base);font-family:var(--digi--calendar--header--font-family);font-weight:var(--digi--calendar--header--font-weight)}.sc-digi-calendar-h .digi-calendar__header--year-select.sc-digi-calendar{display:inherit;justify-content:center;margin:0 auto}.sc-digi-calendar-h .digi-calendar__header--year-select.sc-digi-calendar digi-form-select.sc-digi-calendar:first-child{margin-right:var(--digi--padding--smaller)}.sc-digi-calendar-h .digi-calendar__header--year-select.sc-digi-calendar digi-form-select.sc-digi-calendar:last-child{width:5rem}.sc-digi-calendar-h .digi-calendar__header--year-select.sc-digi-calendar digi-form-select.sc-digi-calendar select.sc-digi-calendar{padding-inline-end:2rem}.sc-digi-calendar-h .digi-calendar__header--month-step.sc-digi-calendar{flex:auto;display:inherit;align-items:inherit;justify-content:inherit}.sc-digi-calendar-h .digi-calendar__header--month-step.sc-digi-calendar .digi-calendar__month-select-name.sc-digi-calendar{padding-inline:var(--digi--padding--smaller)}.sc-digi-calendar-h .digi-calendar__header--month-step.sc-digi-calendar .digi-calendar__month-select-button.sc-digi-calendar{font-family:inherit;font-size:inherit;font-weight:inherit;color:var(--digi--calendar--date--color);display:flex;align-items:center;background:var(--digi--calendar--header--button--background);border:var(--digi--calendar--date--box-shadow);padding:var(--digi--calendar--header--button--padding)}.sc-digi-calendar-h .digi-calendar__header--month-step.sc-digi-calendar .digi-calendar__month-select-button.sc-digi-calendar:last-child{border-radius:0 4px 0 0}.sc-digi-calendar-h .digi-calendar__header--month-step.sc-digi-calendar .digi-calendar__month-select-button.sc-digi-calendar:first-child{border-radius:4px 0 0 0}.sc-digi-calendar-h .digi-calendar__header--month-step.sc-digi-calendar .digi-calendar__month-select-button.sc-digi-calendar:focus-visible:not(.digi-calendar__date--not-selectable),.sc-digi-calendar-h .digi-calendar__header--month-step.sc-digi-calendar .digi-calendar__month-select-button.sc-digi-calendar:active:not(.digi-calendar__date--not-selectable){--digi--calendar--header--button--background:var( --digi--calendar--header--button--background--hover );text-decoration:underline;cursor:pointer}@media (any-hover: hover){.sc-digi-calendar-h .digi-calendar__header--month-step.sc-digi-calendar .digi-calendar__month-select-button.sc-digi-calendar:hover:not(.digi-calendar__date--not-selectable){--digi--calendar--header--button--background:var( --digi--calendar--header--button--background--hover );text-decoration:underline;cursor:pointer}}.sc-digi-calendar-h .digi-calendar__header--month-step.sc-digi-calendar .digi-calendar__month-select-button.sc-digi-calendar:focus-visible{outline:2px solid black;outline-offset:-3px;box-shadow:0px 0px 0px 5px inset white}.sc-digi-calendar-h .digi-calendar__table.sc-digi-calendar{border-collapse:var(--digi--calendar--table--border-collapse);border-spacing:var(--digi--calendar--table--border-spacing);font-family:var(--digi--calendar--table--font-family);table-layout:fixed;margin-bottom:var(--digi--margin--medium)}.sc-digi-calendar-h .digi-calendar__table-header-week.sc-digi-calendar{font-style:italic;padding:var(--digi--calendar--table-header--padding);font-weight:var(--digi--calendar--table-header--font-weight-normal);width:50px}.sc-digi-calendar-h .digi-calendar__table-header.sc-digi-calendar{padding:var(--digi--calendar--table-header--padding);font-weight:var(--digi--calendar--table--font-weight);width:46px}.sc-digi-calendar-h .digi-calendar__td-week.sc-digi-calendar{border-right:var(--digi--calendar--week--border-width) solid var(--digi--calendar--week--border-color)}.sc-digi-calendar-h .digi-calendar__td.sc-digi-calendar{text-align:right}.sc-digi-calendar-h .digi-calendar__date--week-number.sc-digi-calendar{font-style:var(--digi--calendar--week--font-style);font-size:var(--digi--calendar--week--font-size);display:table-cell;text-align:center}.sc-digi-calendar-h .digi-calendar__date--week-number.sc-digi-calendar:hover{cursor:default}.sc-digi-calendar-h .digi-calendar__date.sc-digi-calendar{position:relative;padding:var(--digi--calendar--date--padding);color:var(--digi--calendar--date--color);background-color:var(--digi--calendar--date--background-color);border-color:var(--digi--calendar--date--border-color);border-radius:var(--digi--border-radius--secondary);font-family:inherit;font-size:inherit;font-weight:inherit;text-align:center;border:none;width:44px;height:44px}.sc-digi-calendar-h .digi-calendar__date--disabled.sc-digi-calendar{--digi--calendar--date--color:transparent;pointer-events:none}.sc-digi-calendar-h .digi-calendar__date--today.sc-digi-calendar{position:relative}.sc-digi-calendar-h .digi-calendar__date--today.sc-digi-calendar::after{display:block;content:" ";position:absolute;top:var(--digi--calendar--date--today--circle-margin);bottom:var(--digi--calendar--date--today--circle-margin);left:var(--digi--calendar--date--today--circle-margin);right:var(--digi--calendar--date--today--circle-margin);border:var(--digi--calendar--date--today--circle-border);border-radius:50%}.sc-digi-calendar-h .digi-calendar__date--today.digi-calendar__date--selected.sc-digi-calendar::after{border-color:var(--digi--color--icon--secondary)}@media (any-hover: hover){.sc-digi-calendar-h .digi-calendar__date.sc-digi-calendar:hover:not(.digi-calendar__date--not-selectable){cursor:pointer}.sc-digi-calendar-h .digi-calendar__date.sc-digi-calendar:hover:not(.digi-calendar__date--not-selectable):not(.digi-calendar__date--selected){--digi--calendar--date--box-shadow:var(--digi--calendar--date--box-shadow--hover);--digi--calendar--date--background-color:var(--digi--calendar--date--background-color--hover)}.sc-digi-calendar-h .digi-calendar__date.sc-digi-calendar:hover:not(.digi-calendar__date--not-selectable) span.sc-digi-calendar{text-decoration:underline}}.sc-digi-calendar-h .digi-calendar__date--selected.sc-digi-calendar{--digi--calendar--date--background-color:var(--digi--calendar--date--selected--background-color);--digi--calendar--date--color:var(--digi--calendar--date--selected--color)}.sc-digi-calendar-h .digi-calendar__date--selected.sc-digi-calendar:hover{--digi--calendar--date--background-color:var(--digi--calendar--date--selected--background-color)}.sc-digi-calendar-h .digi-calendar__date--selected.sc-digi-calendar:hover span.sc-digi-calendar{text-decoration:none}.sc-digi-calendar-h .digi-calendar__date--selected.sc-digi-calendar:focus-visible{outline:2px solid black;outline-offset:-3px;box-shadow:0px 0px 0px 5px inset white}.sc-digi-calendar-h .digi-calendar__date--not-selectable.sc-digi-calendar{cursor:not-allowed}.sc-digi-calendar-h .digi-calendar__date--not-selectable.sc-digi-calendar::after{display:block;content:" ";width:0px;height:100%;border:1px solid #757575;transform:rotate(-45deg);position:absolute;top:0%;left:50%}.sc-digi-calendar-h .digi-calendar__date--focused.sc-digi-calendar:focus-visible:not(.digi-calendar__date--selected):not(.digi-calendar__date--not-selectable){--digi--calendar--date--background-color:var(--digi--calendar--date--focused--background-color);outline:2px solid black;outline-offset:-3px;box-shadow:0px 0px 0px 5px inset white}.sc-digi-calendar-s digi-form-label{border:0;clip:rect(1px, 1px, 1px, 1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}`;
10908
+ const calendarCss = () => `.sc-digi-calendar-h{--digi--calendar--display:inline-block;--digi--calendar--header--font-family:var(--digi--global--typography--font-family--default);--digi--calendar--header--font-weight:var(--digi--global--typography--font-weight--semibold);--digi--calendar--header--display:flex;--digi--calendar--header--align-items:center;--digi--calendar--header--justify-content:space-between;--digi--calendar--header--text-align:center;--digi--calendar--header--button--padding:var(--digi--gutter--medium) var(--digi--gutter--largest);--digi--calendar--header--button--background:transparent;--digi--calendar--header--button--box-shadow:none;--digi--calendar--header--button--background--hover:var(--digi--color--background--interactive--hover--secondary);--digi--calendar--table--border-spacing:0;--digi--calendar--table--border-collapse:collapse;--digi--calendar--table--font-family:var(--digi--global--typography--font-family--default);--digi--calendar--table--font-weight:var(--digi--global--typography--font-weight--semibold);--digi--calendar--table-header--padding:var(--digi--gutter--larger) 0;--digi--calendar--table-header--font-weight-normal:var(--digi--typography--body--font-weight--desktop);--digi--calendar--date--border-color:none;--digi--calendar--date--box-shadow:none;--digi--calendar--date--background-color:var(--digi--color--background--interactive--default--secondary);--digi--calendar--date--background-color--hover:var(--digi--color--background--interactive--hover--secondary);--digi--calendar--date--padding:var(--digi--gutter--large);--digi--calendar--date--color:var(--digi--color--text--primary);--digi--calendar--date--focused--background-color:var(--digi--color--background--interactive--hover--secondary);--digi--calendar--date--today--circle-border:2px solid var(--digi--color--marking--indication--secondary);--digi--calendar--date--today--circle-margin:10%;--digi--calendar--date--selected--color:var(--digi--color--text--interactive--secondary);--digi--calendar--date--selected--background-color:var(--digi--color--background--interactive--selected--primary);--digi--calendar--date--not-selectable-strike--color:var(--digi--color--marking--indication--tertiary);--digi--calendar--week--font-style:italic;--digi--calendar--week--font-size:var(--digi--global--typography--font-size--small);--digi--calendar--week--border-color:var(--digi--color--divider--primary);--digi--calendar--week--border-width:var(--digi--border-width--primary)}.sc-digi-calendar-h .digi-calendar.sc-digi-calendar{display:var(--digi--calendar--display);background:var(--digi--calendar--header--button--background);padding:0px 1px 3px 1px;overflow:hidden;max-width:23.4375rem}.sc-digi-calendar-h .digi-calendar--hide.sc-digi-calendar{--digi--calendar--display:none}.sc-digi-calendar-h .digi-calendar__header.sc-digi-calendar{display:var(--digi--calendar--header--display);align-items:var(--digi--calendar--header--align-items);justify-content:var(--digi--calendar--header--justify-content);text-align:var(--digi--calendar--header--text-align);font-size:var(--digi--global--typography--font-size--base);font-family:var(--digi--calendar--header--font-family);font-weight:var(--digi--calendar--header--font-weight)}.sc-digi-calendar-h .digi-calendar__header--year-select.sc-digi-calendar{display:inherit;justify-content:center;margin:0 auto}.sc-digi-calendar-h .digi-calendar__header--year-select.sc-digi-calendar digi-form-select.sc-digi-calendar:first-child{margin-right:var(--digi--padding--smaller)}.sc-digi-calendar-h .digi-calendar__header--year-select.sc-digi-calendar digi-form-select.sc-digi-calendar:last-child{width:5rem}.sc-digi-calendar-h .digi-calendar__header--year-select.sc-digi-calendar digi-form-select.sc-digi-calendar select.sc-digi-calendar{padding-inline-end:2rem}.sc-digi-calendar-h .digi-calendar__header--month-step.sc-digi-calendar{flex:auto;display:inherit;align-items:inherit;justify-content:inherit}.sc-digi-calendar-h .digi-calendar__header--month-step.sc-digi-calendar .digi-calendar__month-select-name.sc-digi-calendar{padding-inline:var(--digi--padding--smaller)}.sc-digi-calendar-h .digi-calendar__header--month-step.sc-digi-calendar .digi-calendar__month-select-button.sc-digi-calendar{font-family:inherit;font-size:inherit;font-weight:inherit;color:var(--digi--calendar--date--color);display:flex;align-items:center;background:var(--digi--calendar--header--button--background);border:var(--digi--calendar--date--box-shadow);padding:var(--digi--calendar--header--button--padding)}.sc-digi-calendar-h .digi-calendar__header--month-step.sc-digi-calendar .digi-calendar__month-select-button.sc-digi-calendar:last-child{border-radius:0 4px 0 0}.sc-digi-calendar-h .digi-calendar__header--month-step.sc-digi-calendar .digi-calendar__month-select-button.sc-digi-calendar:first-child{border-radius:4px 0 0 0}.sc-digi-calendar-h .digi-calendar__header--month-step.sc-digi-calendar .digi-calendar__month-select-button.sc-digi-calendar:focus-visible:not(.digi-calendar__date--not-selectable),.sc-digi-calendar-h .digi-calendar__header--month-step.sc-digi-calendar .digi-calendar__month-select-button.sc-digi-calendar:active:not(.digi-calendar__date--not-selectable){--digi--calendar--header--button--background:var(--digi--calendar--header--button--background--hover);text-decoration:underline;cursor:pointer}@media (any-hover: hover){.sc-digi-calendar-h .digi-calendar__header--month-step.sc-digi-calendar .digi-calendar__month-select-button.sc-digi-calendar:hover:not(.digi-calendar__date--not-selectable){--digi--calendar--header--button--background:var(--digi--calendar--header--button--background--hover);text-decoration:underline;cursor:pointer}}.sc-digi-calendar-h .digi-calendar__header--month-step.sc-digi-calendar .digi-calendar__month-select-button.sc-digi-calendar:focus-visible{outline:2px solid black;outline-offset:-3px;box-shadow:0px 0px 0px 5px inset white}.sc-digi-calendar-h .digi-calendar__table.sc-digi-calendar{border-collapse:var(--digi--calendar--table--border-collapse);border-spacing:var(--digi--calendar--table--border-spacing);font-family:var(--digi--calendar--table--font-family);table-layout:fixed;margin-bottom:var(--digi--margin--medium)}.sc-digi-calendar-h .digi-calendar__table.sc-digi-calendar th.sc-digi-calendar{text-align:center}.sc-digi-calendar-h .digi-calendar__table-header-week.sc-digi-calendar{font-style:italic;padding:var(--digi--calendar--table-header--padding);font-weight:var(--digi--calendar--table-header--font-weight-normal);width:50px}.sc-digi-calendar-h .digi-calendar__table-header.sc-digi-calendar{padding:var(--digi--calendar--table-header--padding);font-weight:var(--digi--calendar--table--font-weight);width:46px}.sc-digi-calendar-h .digi-calendar__td-week.sc-digi-calendar{border-right:var(--digi--calendar--week--border-width) solid var(--digi--calendar--week--border-color)}.sc-digi-calendar-h .digi-calendar__td.sc-digi-calendar{text-align:right}.sc-digi-calendar-h .digi-calendar__date--week-number.sc-digi-calendar{font-style:var(--digi--calendar--week--font-style);font-size:var(--digi--calendar--week--font-size);display:table-cell;text-align:center}.sc-digi-calendar-h .digi-calendar__date--week-number.sc-digi-calendar:hover{cursor:default}.sc-digi-calendar-h .digi-calendar__date.sc-digi-calendar{position:relative;padding:var(--digi--calendar--date--padding);color:var(--digi--calendar--date--color);background-color:var(--digi--calendar--date--background-color);border-color:var(--digi--calendar--date--border-color);border-radius:var(--digi--border-radius--secondary);font-family:inherit;font-size:inherit;font-weight:inherit;text-align:center;border:none;width:44px;height:44px}.sc-digi-calendar-h .digi-calendar__date--disabled.sc-digi-calendar{--digi--calendar--date--color:transparent;pointer-events:none}.sc-digi-calendar-h .digi-calendar__date--today.sc-digi-calendar{position:relative}.sc-digi-calendar-h .digi-calendar__date--today.sc-digi-calendar::after{display:block;content:" ";position:absolute;top:var(--digi--calendar--date--today--circle-margin);bottom:var(--digi--calendar--date--today--circle-margin);left:var(--digi--calendar--date--today--circle-margin);right:var(--digi--calendar--date--today--circle-margin);border:var(--digi--calendar--date--today--circle-border);border-radius:50%}.sc-digi-calendar-h .digi-calendar__date--today.digi-calendar__date--selected.sc-digi-calendar::after{border-color:var(--digi--color--icon--secondary)}@media (any-hover: hover){.sc-digi-calendar-h .digi-calendar__date.sc-digi-calendar:hover:not(.digi-calendar__date--not-selectable){cursor:pointer}.sc-digi-calendar-h .digi-calendar__date.sc-digi-calendar:hover:not(.digi-calendar__date--not-selectable):not(.digi-calendar__date--selected){--digi--calendar--date--box-shadow:var(--digi--calendar--date--box-shadow--hover);--digi--calendar--date--background-color:var(--digi--calendar--date--background-color--hover)}.sc-digi-calendar-h .digi-calendar__date.sc-digi-calendar:hover:not(.digi-calendar__date--not-selectable) span.sc-digi-calendar{text-decoration:underline}}.sc-digi-calendar-h .digi-calendar__date--selected.sc-digi-calendar{--digi--calendar--date--background-color:var(--digi--calendar--date--selected--background-color);--digi--calendar--date--color:var(--digi--calendar--date--selected--color)}.sc-digi-calendar-h .digi-calendar__date--selected.sc-digi-calendar:hover{--digi--calendar--date--background-color:var(--digi--calendar--date--selected--background-color)}.sc-digi-calendar-h .digi-calendar__date--selected.sc-digi-calendar:hover span.sc-digi-calendar{text-decoration:none}.sc-digi-calendar-h .digi-calendar__date--selected.sc-digi-calendar:focus-visible{outline:2px solid black;outline-offset:-3px;box-shadow:0px 0px 0px 5px inset white}.sc-digi-calendar-h .digi-calendar__date--not-selectable.sc-digi-calendar{cursor:not-allowed}.sc-digi-calendar-h .digi-calendar__date--not-selectable.sc-digi-calendar::after{display:block;content:" ";width:0px;height:100%;border:1px solid #757575;transform:rotate(-45deg);position:absolute;top:0%;left:50%}.sc-digi-calendar-h .digi-calendar__date--focused.sc-digi-calendar:focus-visible:not(.digi-calendar__date--selected):not(.digi-calendar__date--not-selectable){--digi--calendar--date--background-color:var(--digi--calendar--date--focused--background-color);outline:2px solid black;outline-offset:-3px;box-shadow:0px 0px 0px 5px inset white}.sc-digi-calendar-s digi-form-label{border:0;clip:rect(1px, 1px, 1px, 1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}`;
10909
10909
 
10910
10910
  /**
10911
10911
  * @swedishName Kalender
@@ -13283,7 +13283,30 @@ class CalendarWeekView {
13283
13283
  this.weekDays = [...newDates];
13284
13284
  }
13285
13285
  afDatesUpdate() {
13286
- const dateList = [...JSON.parse(this.afDates)];
13286
+ // Angular/React can connect the element before afDates is set.
13287
+ if (this.afDates == null || this.afDates === '') {
13288
+ return;
13289
+ }
13290
+ const hadDates = this.dates.length > 0;
13291
+ let dateList;
13292
+ try {
13293
+ if (Array.isArray(this.afDates)) {
13294
+ dateList = [...this.afDates];
13295
+ }
13296
+ else if (typeof this.afDates === 'string') {
13297
+ dateList = JSON.parse(this.afDates);
13298
+ }
13299
+ else {
13300
+ return;
13301
+ }
13302
+ }
13303
+ catch (_a) {
13304
+ logger.warn(`Invalid JSON in "af-dates" attribute`, this.hostElement);
13305
+ return;
13306
+ }
13307
+ if (!Array.isArray(dateList)) {
13308
+ return;
13309
+ }
13287
13310
  this.dates = [
13288
13311
  ...dateList.sort((a, b) => {
13289
13312
  const c = new Date(a);
@@ -13291,6 +13314,9 @@ class CalendarWeekView {
13291
13314
  return this.getTime(c) - this.getTime(d);
13292
13315
  })
13293
13316
  ];
13317
+ if (!hadDates && this.dates.length > 0) {
13318
+ this.initDates();
13319
+ }
13294
13320
  }
13295
13321
  /**
13296
13322
  * Kan användas för att manuellt sätta om det aktiva datumet. Formatet måste vara 'yyyy-MM-dd'.
@@ -13314,6 +13340,9 @@ class CalendarWeekView {
13314
13340
  this.afOnWeekChange.emit('next');
13315
13341
  }
13316
13342
  initDates() {
13343
+ if (this.dates.length === 0) {
13344
+ return;
13345
+ }
13317
13346
  this.minDate = new Date(this.dates[0]);
13318
13347
  this.maxDate = new Date(this.dates[this.dates.length - 1]);
13319
13348
  this.selectedDate = format$1(new Date(this.dates[0]), 'yyyy-MM-dd', {
@@ -13325,9 +13354,23 @@ class CalendarWeekView {
13325
13354
  }
13326
13355
  componentWillLoad() {
13327
13356
  this.afDatesUpdate();
13328
- this.initDates();
13357
+ // Angular attaches the host first and binds `[afDates]` on the next frame
13358
+ // (Stencil 4.36+). @Watch skips that first assignment, so if dates are not
13359
+ // here yet, wait one frame. React/vanilla that already set the prop skip
13360
+ // the delay.
13361
+ if (this.dates.length === 0) {
13362
+ return new Promise((resolve) => {
13363
+ requestAnimationFrame(() => {
13364
+ this.afDatesUpdate();
13365
+ resolve();
13366
+ });
13367
+ });
13368
+ }
13329
13369
  }
13330
13370
  componentDidLoad() {
13371
+ if (this.dates.length === 0) {
13372
+ this.afDatesUpdate();
13373
+ }
13331
13374
  this.afOnReady.emit();
13332
13375
  }
13333
13376
  get prevWeekText() {
@@ -13351,7 +13394,7 @@ class CalendarWeekView {
13351
13394
  format$1(new Date(lastDate), 'MMMM yyyy', { locale: locale$1 });
13352
13395
  }
13353
13396
  render() {
13354
- return (hAsync("div", { key: '967ccb9710018973a960ae36d52157ba85dacfed', class: "digi-calendar-week-view" }, hAsync("nav", { key: '6a9137d8f8a8e652d26d099ae652cb76e5665b51', class: "digi-calendar-week-view__timepicker" }, hAsync("div", { key: 'a2b8aaeaa93e391e65847b2ea8f9b455e86474f1', class: "digi-calendar-week-view__dates" }, hAsync("div", { key: '0cc675c0cd67d042e5e27a38a6665ab30e516cea', class: "digi-calendar-week-view__flex" }, hAsync("digi-typography", { key: 'd47f59955354cb435dc80895059c6e4fd6eefa8a' }, hAsync(this.afHeadingLevel, { key: 'f01725e82afff23b8ae357b30af909b325d85279', role: "status", class: "digi-calendar-week-view__heading" }, hAsync("span", { key: 'bbfab19eec8776e640ed235654c0fd960faf5722', class: "digi-calendar-week-view__month" }, this.currentMonth), hAsync("span", { key: 'a3a52801083cd83351056d474e01df926d8b0117', class: "digi-calendar-week-view__week" }, ' ', "v.", this.currentWeek))), hAsync("ul", { key: 'a3f3703318fa5400cd32ee5d3af896900a032acd', class: "digi-calendar-week-view__date-list" }, this.weekDays.map((dateItem) => {
13397
+ return (hAsync("div", { key: '44d49828a7f43a1f3943aaf0af4139f402844bf0', class: "digi-calendar-week-view" }, hAsync("nav", { key: '44ba98a7c433077c2c11c55b150a5cc2f1d38ac2', class: "digi-calendar-week-view__timepicker" }, hAsync("div", { key: '160ce73dc293abd69193c2b1750c9fd7400b8804', class: "digi-calendar-week-view__dates" }, hAsync("div", { key: '2d60245978d9c7615f3ff5ec7b9d8d628e16f843', class: "digi-calendar-week-view__flex" }, hAsync("digi-typography", { key: '23a1c94d0575061951f67f46782144de52e5e662' }, hAsync(this.afHeadingLevel, { key: 'a183705a035f4d3d57ced74920221f40bbe6019f', role: "status", class: "digi-calendar-week-view__heading" }, hAsync("span", { key: '147910745991716f3557491c6e6aa702f479e8c7', class: "digi-calendar-week-view__month" }, this.currentMonth), hAsync("span", { key: '0d91367cd6066a2b35349edd0ff93e20b5326f04', class: "digi-calendar-week-view__week" }, ' ', "v.", this.currentWeek))), hAsync("ul", { key: 'fdff670cf241e05920e19e0ce6e601b62ae9a3f0', class: "digi-calendar-week-view__date-list" }, this.weekDays.map((dateItem) => {
13355
13398
  const date = format$1(new Date(dateItem), 'd', {
13356
13399
  locale: locale$1
13357
13400
  });
@@ -13371,16 +13414,17 @@ class CalendarWeekView {
13371
13414
  } }, day), hAsync("span", { class: "digi-calendar-week-view__date-button-date" }, date), hAsync("span", { "aria-hidden": "true", class: {
13372
13415
  'digi-calendar-week-view__date-button-circle': dateItem === this.todaysDate
13373
13416
  } })))));
13374
- })))), hAsync("digi-button", { key: '2edb685459c4cbf8a0120ab340672b17d0ea3f9f', onClick: () => this.prevWeek(), class: {
13417
+ })))), hAsync("digi-button", { key: 'dbae5227d0316a5a67febc7de83b1c4c5cfc1044', onClick: () => this.prevWeek(), class: {
13375
13418
  'digi-calendar-week-view__week-button digi-calendar-week-view__week-button--previous': true,
13376
13419
  'digi-calendar-week-view__week-button--keep-left': this.currentWeek == getISOWeek(this.maxDate),
13377
13420
  'digi-calendar-week-view__week-button--hidden': !(this.currentWeek > getISOWeek(this.minDate))
13378
- }, "af-variation": "secondary" }, hAsync("digi-icon-chevron-left", { key: '8948b12a1654f9ef46728ea8de3b1df5f40addcd', slot: "icon" }), this.prevWeekText), hAsync("digi-button", { key: '729ed8eebce68168b66c5365588a52b1279eec3f', onClick: () => this.nextWeek(), class: {
13421
+ }, "af-variation": "secondary" }, hAsync("digi-icon-chevron-left", { key: '65d0f656a0d35911d39f9b8e9ade224be54d4371', slot: "icon" }), this.prevWeekText), hAsync("digi-button", { key: '68d9b3d6c929d0185f412add980a542b3c86fbb2', onClick: () => this.nextWeek(), class: {
13379
13422
  'digi-calendar-week-view__week-button digi-calendar-week-view__week-button--next': true,
13380
13423
  'digi-calendar-week-view__week-button--keep-right': this.currentWeek == getISOWeek(this.minDate),
13381
13424
  'digi-calendar-week-view__week-button--hidden': !(this.currentWeek < getISOWeek(this.maxDate))
13382
- }, "af-variation": "secondary" }, hAsync("digi-icon-chevron-right", { key: '75bf1669a5d9dd3f618661c79202dc8e69f6c8ea', slot: "icon-secondary" }), this.nextWeekText)), hAsync("div", { key: 'c7379a321936f28783d2f7a4e1e94d0b119de471', role: "status", "aria-live": "assertive", class: "digi-calendar-week-view__result", id: `${this.afId}-result` }, hAsync("digi-typography", { key: 'f7e55435a94c5bff18a3b4b7bfa5d397291f7e8c' }, hAsync("slot", { key: '7c59e144a47c721f5f4a454b9776c708f6d2f15c' })))));
13425
+ }, "af-variation": "secondary" }, hAsync("digi-icon-chevron-right", { key: 'a9e688f815a5053aa709cfeb9359131f73df21c0', slot: "icon-secondary" }), this.nextWeekText)), hAsync("div", { key: '7d1073f6cd1982fda2ce7dcb60532c94bd1d0634', role: "status", "aria-live": "assertive", class: "digi-calendar-week-view__result", id: `${this.afId}-result` }, hAsync("digi-typography", { key: 'db7ce0ca80485df1e4ae67200f2cd90cc80938d5' }, hAsync("slot", { key: 'f08f447ae89612dfcea56c638024220bc29e7914' })))));
13383
13426
  }
13427
+ get hostElement() { return getElement(this); }
13384
13428
  static get watchers() { return {
13385
13429
  "selectedDate": [{
13386
13430
  "selectedDateChangeHandler": 0
@@ -18858,14 +18902,14 @@ class ChartLine {
18858
18902
  });
18859
18903
  };
18860
18904
  // Removes resize observer for chart and inits table
18861
- this.activateTable = (event) => {
18905
+ this.activateTable = () => {
18862
18906
  this.closeTooltip();
18863
18907
  this.lineChartObserver.disconnect();
18864
18908
  this.tableObserver.observe(this._chartDiv);
18865
18909
  this._status.innerHTML = '<p>Visas som tabell</p>';
18866
18910
  select(this._host).select('.tableButton').style('display', 'none');
18867
18911
  select(this._host).select('.chartButton').style('display', null);
18868
- event.target.nextSibling.lastChild.focus();
18912
+ this.focusHostButton('.chartButton');
18869
18913
  const duration = 150;
18870
18914
  this._svg
18871
18915
  .attr('opacity', 1)
@@ -18896,12 +18940,12 @@ class ChartLine {
18896
18940
  this.setTableDimensions();
18897
18941
  };
18898
18942
  // Removes observer and calls init functions for line chart
18899
- this.reInitChart = (event) => {
18943
+ this.reInitChart = () => {
18900
18944
  this.tableObserver.disconnect();
18901
18945
  this._status.innerHTML = '<p>Visas som diagram</p>';
18902
18946
  select(this._host).select('.tableButton').style('display', null);
18903
18947
  select(this._host).select('.chartButton').style('display', 'none');
18904
- event.target.previousSibling.lastChild.focus();
18948
+ this.focusHostButton('.tableButton');
18905
18949
  const table = select(this._tableDiv);
18906
18950
  table
18907
18951
  .style('opacity', 1)
@@ -18928,15 +18972,40 @@ class ChartLine {
18928
18972
  }
18929
18973
  afChartDataUpdate() {
18930
18974
  const data = this.afChartData;
18931
- if (typeof data === 'object') {
18932
- this._chartData = Object.assign({}, data);
18975
+ // Angular/React can connect the element before afChartData is set.
18976
+ if (data == null || data === '') {
18977
+ return;
18978
+ }
18979
+ try {
18980
+ if (typeof data === 'object') {
18981
+ this._chartData = Object.assign({}, data);
18982
+ }
18983
+ else if (typeof data === 'string') {
18984
+ this._chartData = JSON.parse(data);
18985
+ }
18986
+ else {
18987
+ return;
18988
+ }
18989
+ }
18990
+ catch (_a) {
18991
+ logger.warn(`Invalid JSON in "af-chart-data" attribute`, this.element);
18933
18992
  return;
18934
18993
  }
18935
- this._chartData = JSON.parse(data);
18936
18994
  // Making deep copy of this
18937
18995
  if (this._chartData.data)
18938
18996
  this._coreSeries = JSON.parse(JSON.stringify(this._chartData.data.series));
18939
18997
  }
18998
+ hasChartData() {
18999
+ return !!this._chartData && Object.keys(this._chartData).length > 0;
19000
+ }
19001
+ focusHostButton(selector) {
19002
+ var _a, _b;
19003
+ const host = this._host;
19004
+ const button = (_b = (_a = host === null || host === void 0 ? void 0 : host.querySelector(selector)) === null || _a === void 0 ? void 0 : _a.querySelector('button')) !== null && _b !== void 0 ? _b : host === null || host === void 0 ? void 0 : host.querySelector(selector);
19005
+ if (button && typeof button.focus === 'function') {
19006
+ button.focus();
19007
+ }
19008
+ }
18940
19009
  initSvg() {
18941
19010
  this.margin.bottom =
18942
19011
  Number(window
@@ -19400,9 +19469,24 @@ class ChartLine {
19400
19469
  }
19401
19470
  componentWillLoad() {
19402
19471
  this.afChartDataUpdate();
19472
+ // Angular attaches the host first and binds `[afChartData]` on the next
19473
+ // frame (Stencil 4.36+). @Watch skips that first assignment, so if chart
19474
+ // data is not here yet, wait one frame. React/vanilla that already set
19475
+ // the prop skip the delay.
19476
+ if (!this.hasChartData()) {
19477
+ return new Promise((resolve) => {
19478
+ requestAnimationFrame(() => {
19479
+ this.afChartDataUpdate();
19480
+ resolve();
19481
+ });
19482
+ });
19483
+ }
19403
19484
  }
19404
19485
  componentDidLoad() {
19405
- if (Object.keys(this._chartData).length === 0)
19486
+ if (!this.hasChartData()) {
19487
+ this.afChartDataUpdate();
19488
+ }
19489
+ if (!this.hasChartData())
19406
19490
  return this.initEmpty();
19407
19491
  // clearing selection
19408
19492
  this._selectedLines = [];
@@ -19418,7 +19502,7 @@ class ChartLine {
19418
19502
  this._prevHeight = select(this._titleDiv).style('height');
19419
19503
  }
19420
19504
  componentDidUpdate() {
19421
- if (Object.keys(this._chartData).length === 0)
19505
+ if (!this.hasChartData())
19422
19506
  return this.loadingState();
19423
19507
  // clearing selection
19424
19508
  this._selectedLines = [];
@@ -19575,11 +19659,13 @@ class ChartLine {
19575
19659
  }
19576
19660
  render() {
19577
19661
  let heading = '';
19578
- if (!this._chartData.subTitle)
19579
- heading = `<${this.afHeadingLevel}>${this._chartData.title}</${this.afHeadingLevel}>`;
19580
- else
19581
- heading = `<${this.afHeadingLevel}>${this._chartData.title}</${this.afHeadingLevel}><p>${this._chartData.subTitle}</p>`;
19582
- return (hAsync("host", { key: 'a21c09ee91ccabf90f91d2344d301d26710f9a60', ref: (el) => (this._host = el) }, hAsync("div", { key: 'c97af6a0bbc28675a19c843a3c355b35397e5804', class: "topWrapper", ref: (el) => (this._titleDiv = el) }, hAsync("digi-typography", { key: '76085c6924fd317d4a281e93ca4623b85f0fb867', class: "chartTitle", innerHTML: heading }), hAsync("digi-button", { key: '241e30b3094e8eea86c7c24bb2a90f67ea04ef6f', class: "buttonWrapper tableButton", "af-size": "medium", "af-variation": "function", "af-full-width": "false", onAfOnClick: this.activateTable, afAriaLabel: `Visa tabell ${this._chartData.title ? this._chartData.title.toLowerCase() : ''}` }, hAsync("digi-icon-table", { key: '5cc0d03d40d076481d14d0478390b131cdaa61f7', slot: "icon" }), "Visa tabell"), hAsync("digi-button", { key: '241d3e97b9a21f556b3e46cebc63c77ce106d26c', style: { display: 'none' }, class: "buttonWrapper chartButton", "af-size": "medium", "af-variation": "function", "af-full-width": "false", onAfOnClick: this.reInitChart, afAriaLabel: `Visa diagram ${this._chartData.title ? this._chartData.title.toLowerCase() : ''}` }, hAsync("digi-icon-chart", { key: 'f0a5c78bc5e04db994559f2ce1a13c0e7285c36d', slot: "icon" }), "Visa diagram"), hAsync("div", { key: 'f7ebab0f90d1a9f9a306470c93ccaaaf0461a9a7', class: "scChartStatus", role: "status", ref: (el) => (this._status = el) })), hAsync("div", { key: '75672c02d61a14741348dc183782df71f3a4db19', class: "chartTooltip", id: this.afId }, hAsync("div", { key: 'b4e03381d825d68af2bdbf859458896c639b6559', class: "tooltipHead" }, hAsync("digi-icon-x", { key: '1301ab00ff3818e0940e69f17aa09b296c04a86c', class: "close" }), ' '), hAsync("div", { key: 'eb01d362db4495c0a3d4396ad4c71c2a952114ad', class: "tooltipBody" })), hAsync("div", { key: 'accd6776d3db14c662ff84b2e826f6cf713ff38d', class: "chart", ref: (el) => (this._chartDiv = el) }), hAsync("div", { key: '507dfba00c88d5b371fd8304053b9b7762506d25', class: "legend", ref: (el) => (this._legendDiv = el) }), hAsync("div", { key: 'cb3fc091c6a557bfd62e8f7d59863e973da0ee53', class: "table", ref: (el) => (this._tableDiv = el) }, ' ')));
19662
+ if (this._chartData) {
19663
+ if (!this._chartData.subTitle)
19664
+ heading = `<${this.afHeadingLevel}>${this._chartData.title}</${this.afHeadingLevel}>`;
19665
+ else
19666
+ heading = `<${this.afHeadingLevel}>${this._chartData.title}</${this.afHeadingLevel}><p>${this._chartData.subTitle}</p>`;
19667
+ }
19668
+ return (hAsync("host", { key: '93603df9b78fcce8b5735b4a874f879cf7b2326e', ref: (el) => (this._host = el) }, hAsync("div", { key: '094a790864b72bbb9a802b461db06ce312c627c8', class: "topWrapper", ref: (el) => (this._titleDiv = el) }, hAsync("digi-typography", { key: '5f4bd51fdfef816b0e127d1177c60f8310952173', class: "chartTitle", innerHTML: heading }), hAsync("digi-button", { key: '8ae72950c5cf052ed71c2ba4e91b254b8d36cfd0', class: "buttonWrapper tableButton", "af-size": "medium", "af-variation": "function", "af-full-width": "false", onAfOnClick: this.activateTable, afAriaLabel: `Visa tabell ${this._chartData.title ? this._chartData.title.toLowerCase() : ''}` }, hAsync("digi-icon-table", { key: '750f1b621eb0a1a54ec810aa63624237bd98f9ea', slot: "icon" }), "Visa tabell"), hAsync("digi-button", { key: '1cf33daaaa8adf9c5352286d6172d7c258098c29', style: { display: 'none' }, class: "buttonWrapper chartButton", "af-size": "medium", "af-variation": "function", "af-full-width": "false", onAfOnClick: this.reInitChart, afAriaLabel: `Visa diagram ${this._chartData.title ? this._chartData.title.toLowerCase() : ''}` }, hAsync("digi-icon-chart", { key: '9dce5df1a96d4b818597854f7ee238fefda2c686', slot: "icon" }), "Visa diagram"), hAsync("div", { key: '204f5824b2f34b3a1a1401ed4434e1fcb16a2549', class: "scChartStatus", role: "status", ref: (el) => (this._status = el) })), hAsync("div", { key: 'b164f59f1c741db5493af57510eab2987cabefc6', class: "chartTooltip", id: this.afId }, hAsync("div", { key: 'e84bf8a85a745977006d50f296d1afee2ee35698', class: "tooltipHead" }, hAsync("digi-icon-x", { key: '77bcd0342c828dbcbe020a9ffefe4ae6f3086572', class: "close" }), ' '), hAsync("div", { key: '330f69a58082f72b528095ef49a2371fc8b0d8e5', class: "tooltipBody" })), hAsync("div", { key: '62eb27ac8f184476d50332344711ca381e8adf59', class: "chart", ref: (el) => (this._chartDiv = el) }), hAsync("div", { key: 'ad70790d3a2fd5851c4351e41f2436a34169a819', class: "legend", ref: (el) => (this._legendDiv = el) }), hAsync("div", { key: '30d4791a9b808555f03d1830aaec0221c1bc3b37', class: "table", ref: (el) => (this._tableDiv = el) }, ' ')));
19583
19669
  }
19584
19670
  get element() { return getElement(this); }
19585
19671
  static get watchers() { return {
@@ -36202,14 +36288,10 @@ class NavigationTablist {
36202
36288
  }
36203
36289
  }
36204
36290
  syncPanels() {
36205
- // side-effect
36206
- if (this.panelsRef != null) {
36207
- const panels = this.panelsRef.querySelectorAll(':scope>digi-tablist-panel');
36208
- for (let i = 0; i < panels.length; i++) {
36209
- const panel = panels[i];
36210
- const showPanel = panel.tab === this.tabs[this.activeTab].id;
36211
- panel.isVisible = showPanel;
36212
- }
36291
+ var _a;
36292
+ const activeId = (_a = this.tabs[this.activeTab]) === null || _a === void 0 ? void 0 : _a.id;
36293
+ for (const panel of this.getSlottedPanels()) {
36294
+ panel.isVisible = panel.tab === activeId;
36213
36295
  }
36214
36296
  }
36215
36297
  handleTabPropChange(tabId) {
@@ -36240,6 +36322,11 @@ class NavigationTablist {
36240
36322
  this.windowTab = tabIdx;
36241
36323
  }
36242
36324
  setupTabs(tabs) {
36325
+ // Angular/React can connect the element before afTabs is set.
36326
+ if (tabs == null || tabs === '') {
36327
+ return;
36328
+ }
36329
+ const hadTabs = this.tabs.length > 0;
36243
36330
  if (typeof tabs === 'string') {
36244
36331
  this.tabs = JSON.parse(tabs);
36245
36332
  }
@@ -36249,6 +36336,13 @@ class NavigationTablist {
36249
36336
  else {
36250
36337
  throw new Error('Invalid format or no tabs supplied');
36251
36338
  }
36339
+ if (!hadTabs) {
36340
+ this.setupInitialTab();
36341
+ }
36342
+ this.syncPanels();
36343
+ }
36344
+ getSlottedPanels() {
36345
+ return Array.from(this.hostElement.querySelectorAll('digi-tablist-panel')).filter((panel) => panel.closest('digi-tablist') === this.hostElement);
36252
36346
  }
36253
36347
  setActiveTabById(id) {
36254
36348
  const tabIdx = this.tabs.findIndex((tab) => tab.id === id);
@@ -36316,9 +36410,23 @@ class NavigationTablist {
36316
36410
  componentWillLoad() {
36317
36411
  this.setupTabs(this.afTabs);
36318
36412
  this.setupInitialTab();
36413
+ // Angular attaches the host first and binds `[afTabs]` on the next frame
36414
+ // (Stencil 4.36+). @Watch skips that first assignment, so if tabs are not
36415
+ // here yet, wait one frame. React/vanilla that already set the prop skip
36416
+ // the delay.
36417
+ if (this.tabs.length === 0) {
36418
+ return new Promise((resolve) => {
36419
+ requestAnimationFrame(() => {
36420
+ this.setupTabs(this.afTabs);
36421
+ this.setupInitialTab();
36422
+ resolve();
36423
+ });
36424
+ });
36425
+ }
36319
36426
  }
36320
36427
  componentDidLoad() {
36321
36428
  var _a, _b, _c;
36429
+ this.setupTabs(this.afTabs);
36322
36430
  // Also listen to window resize for viewport zoom changes
36323
36431
  if (window) {
36324
36432
  window.addEventListener('resize', this.handleResize, { passive: true });
@@ -36340,14 +36448,14 @@ class NavigationTablist {
36340
36448
  cancelAnimationFrame(this._requestAnimationFrame);
36341
36449
  }
36342
36450
  render() {
36343
- return (hAsync(Host, { key: '8bdab05cd034b9940aefcb9f38b16d09b6f0b0c7' }, hAsync("div", { key: '2d2266a9600dcc5817130ed4ece38868779e0b69', class: {
36451
+ return (hAsync(Host, { key: 'b2d71ff4b3f2c2fa22feffbc298360c1b3202b1d' }, hAsync("div", { key: 'df48ffc9fdabfca380675c7232af5fef80c445b9', class: {
36344
36452
  'digi-tablist': true,
36345
36453
  'digi-tablist--overflow-scroll': this.afOverflowMode === OverflowMode.Scroll,
36346
36454
  'digi-tablist--overflow-controls': this.afOverflowMode === OverflowMode.Controls
36347
- } }, hAsync("div", { key: 'a96cd5d9a2eec5b2b52f0d1a00b2810c28e8d4bd', class: "control-wrapper", style: {
36455
+ } }, hAsync("div", { key: '797f70a00aa1e3dd8a3b54d43808b9515259723c', class: "control-wrapper", style: {
36348
36456
  left: '0',
36349
36457
  visibility: this.showPrev ? 'visible' : 'hidden'
36350
- } }, hAsync("button", { key: '7a9810781c300bd44aa7ce3f3f76f651b1799023', tabIndex: -1, type: "button", "aria-hidden": "true", class: { 'tab-control-button': true }, onClick: () => this.handleTabControl(Direction.Previous) }, hAsync("digi-icon-chevron-left", { key: '8f65c019aa2a60f8d10025c147ad2448d30cdf1d' }))), hAsync("div", { key: '7be08fe744f17f71fab7358d63d010f17e5c977d', role: "tablist", ref: (ref) => (this.tablistRef = ref), "aria-labelledby": this.afAriaLabelledby, "aria-label": this.afAriaLabel }, this.tabs.map((tab) => {
36458
+ } }, hAsync("button", { key: '415237740bc65dd5cfdb0e57eb44307c9d838670', tabIndex: -1, type: "button", "aria-hidden": "true", class: { 'tab-control-button': true }, onClick: () => this.handleTabControl(Direction.Previous) }, hAsync("digi-icon-chevron-left", { key: '59f2d43ba38c7d4ebdd85a575b2e89c0fec62381' }))), hAsync("div", { key: '01602338cbd7a63f48cdcf541629e76bac46dd4c', role: "tablist", ref: (ref) => (this.tablistRef = ref), "aria-labelledby": this.afAriaLabelledby, "aria-label": this.afAriaLabel }, this.tabs.map((tab) => {
36351
36459
  const focusable = tab.id === this.tabs[this.selectedTab].id;
36352
36460
  const isActive = tab.id === this.tabs[this.activeTab].id;
36353
36461
  const Icon = `digi-icon-${tab.icon}`;
@@ -36356,11 +36464,12 @@ class NavigationTablist {
36356
36464
  'digi-tab': true,
36357
36465
  'is-active': isActive
36358
36466
  }, id: `tab-${tab.id}`, role: "tab", type: "button", tabindex: focusable ? '0' : '-1', "aria-label": tab.ariaLabel, "aria-selected": isActive.toString(), "aria-controls": `tabpanel-${tab.id}`, onClick: () => this.handleTabChange(tab) }, hAsync("div", { class: "content-wrapper" }, hAsync("span", { class: "tablist-content" }, tab.icon && hAsync(Icon, { "aria-hidden": "true" }), hAsync("span", { class: "title", "data-text": tab.title }, tab.title), tab.badgeValue && (hAsync("digi-badge-notification", { afValue: badgeValue, "aria-hidden": "true" }))), hAsync("div", { class: "indicator" }))));
36359
- })), hAsync("div", { key: 'b79ea56eb945fe5c4b2e34529d8b1985018ac46c', class: "control-wrapper", style: {
36467
+ })), hAsync("div", { key: 'db28ea61c349d7aaf057e84b607c4f851b3f6712', class: "control-wrapper", style: {
36360
36468
  right: '0',
36361
36469
  visibility: this.showNext ? 'visible' : 'hidden'
36362
- } }, hAsync("button", { key: '3d581fe07f9591f21fef85e700259d3b44332631', tabIndex: -1, type: "button", "aria-hidden": "true", class: { 'tab-control-button': true }, onClick: () => this.handleTabControl(Direction.Next) }, hAsync("digi-icon-chevron-right", { key: '1f3a564d4eff7851ad13901c492e663c5c43d384' })))), hAsync("div", { key: '2cd9aa7d409b36395febee9dfd26eb6e82b02f35', ref: (ref) => (this.panelsRef = ref), role: "presentation" }, hAsync("slot", { key: 'b9f82031b00032dfb1df2358546a8a35934033a0' }))));
36470
+ } }, hAsync("button", { key: '83513f2d64cc0578155d305f21dfb1ca4a412cc6', tabIndex: -1, type: "button", "aria-hidden": "true", class: { 'tab-control-button': true }, onClick: () => this.handleTabControl(Direction.Next) }, hAsync("digi-icon-chevron-right", { key: '9263e864c21ea5358f301214fbadda6ed7d3c74a' })))), hAsync("div", { key: '205efbbb3aab40f51f9f85f8d74a4026970c7144', role: "presentation" }, hAsync("slot", { key: 'e753d718f852072745f5c2a49f6189fb62f3645b', onSlotchange: () => this.syncPanels() }))));
36363
36471
  }
36472
+ get hostElement() { return getElement(this); }
36364
36473
  static get watchers() { return {
36365
36474
  "activeTab": [{
36366
36475
  "syncPanels": 0
@@ -36489,16 +36598,28 @@ class NavigationVerticalMenu {
36489
36598
  }
36490
36599
  }
36491
36600
  componentWillLoad() {
36492
- this.getListItems();
36493
- this.initNav();
36494
- this.setLevelClass();
36601
+ this.syncNav();
36602
+ // Angular attaches the host first and slots children on the next frame
36603
+ // (Stencil 4.36+). React/vanilla that already have slotted nodes skip
36604
+ // the delay. Do not warn here — Angular/React may still be projecting.
36605
+ if (!this.hostElement.children.length) {
36606
+ return new Promise((resolve) => {
36607
+ requestAnimationFrame(() => {
36608
+ this.syncNav();
36609
+ resolve();
36610
+ });
36611
+ });
36612
+ }
36495
36613
  }
36496
36614
  componentDidLoad() {
36497
36615
  this.initCurrentActiveLevel();
36498
36616
  this.afOnReady.emit();
36499
36617
  }
36500
36618
  componentWillUpdate() {
36501
- this.getListItems();
36619
+ this.syncNav();
36620
+ }
36621
+ syncNav(options) {
36622
+ this.getListItems(options);
36502
36623
  this.initNav();
36503
36624
  this.setLevelClass();
36504
36625
  }
@@ -36548,12 +36669,12 @@ class NavigationVerticalMenu {
36548
36669
  }
36549
36670
  }
36550
36671
  setLevelClass() {
36551
- this.hostElement
36552
- .querySelector('ul')
36553
- .classList.remove('primary', 'secondary');
36554
- this.hostElement
36555
- .querySelector('ul')
36556
- .classList.add('digi-navigation-vertical-menu__list--root', this.afVariation);
36672
+ const rootList = this.hostElement.querySelector('ul');
36673
+ if (!rootList) {
36674
+ return;
36675
+ }
36676
+ rootList.classList.remove('primary', 'secondary');
36677
+ rootList.classList.add('digi-navigation-vertical-menu__list--root', this.afVariation);
36557
36678
  }
36558
36679
  initNav() {
36559
36680
  const $ul = this.hostElement.querySelectorAll('ul');
@@ -36566,10 +36687,12 @@ class NavigationVerticalMenu {
36566
36687
  this.initNav();
36567
36688
  this.setClasses(e);
36568
36689
  }
36569
- getListItems() {
36690
+ getListItems(options) {
36570
36691
  const menuItems = this.hostElement.children;
36571
36692
  if (!menuItems || menuItems.length <= 0) {
36572
- logger.warn(`The slot contains no children elements.`, this.hostElement);
36693
+ if (options === null || options === void 0 ? void 0 : options.warnIfEmpty) {
36694
+ logger.warn(`The slot contains no children elements.`, this.hostElement);
36695
+ }
36573
36696
  return;
36574
36697
  }
36575
36698
  this.listItems = [...Array.from(menuItems)].map((filter) => {
@@ -36588,7 +36711,7 @@ class NavigationVerticalMenu {
36588
36711
  };
36589
36712
  }
36590
36713
  render() {
36591
- return (hAsync("nav", { key: '0c7b96501a70d813b8d8f5b8014dc420d472f4a9', class: Object.assign({ 'digi-navigation-vertical-menu': true }, this.cssModifiers), id: this.afId, "aria-label": this.afAriaLabel }, hAsync("slot", { key: '2b5d92cada1cde5bb5155257be77a584c2e708ec' })));
36714
+ return (hAsync("nav", { key: 'df2239de80363247c33eadf6995331a74a40966f', class: Object.assign({ 'digi-navigation-vertical-menu': true }, this.cssModifiers), id: this.afId, "aria-label": this.afAriaLabel }, hAsync("slot", { key: 'dc2e22c2cfd00786964855ea3bc2b7271879510c', onSlotchange: () => this.syncNav() })));
36592
36715
  }
36593
36716
  get hostElement() { return getElement(this); }
36594
36717
  static get style() { return navigationVerticalMenuCss(); }
@@ -39696,7 +39819,7 @@ class UtilResizeObserver {
39696
39819
  }; }
39697
39820
  }
39698
39821
 
39699
- const barChartCss = () => `.sc-digi-bar-chart-h{width:100%;display:flex;flex-direction:column;min-width:0}.sc-digi-bar-chart-h .digi-bar-chart.sc-digi-bar-chart{font-family:var(--digi--global--typography--font-family--default)}.sc-digi-bar-chart-h .svgWrap.sc-digi-bar-chart{position:relative;display:flex;min-height:20px;min-width:20px;width:100%;height:100%}.sc-digi-bar-chart-h .topWrapper.sc-digi-bar-chart,.sc-digi-bar-chart-h .chartTitle.sc-digi-bar-chart .digi-typography.sc-digi-bar-chart{display:flex;flex-direction:column;gap:0.75rem}.sc-digi-bar-chart-h .topWrapper.sc-digi-bar-chart{margin-bottom:0.75rem}.sc-digi-bar-chart-h .chartTitle.sc-digi-bar-chart{--MARGIN--HEADING-2:0;--MARGIN--HEADING-3:0;--MARGIN--HEADING-4:0;--MARGIN--HEADING-5:0;--MARGIN--HEADING-6:0;--MARGIN--BODY:0}.sc-digi-bar-chart-h .buttonWrapper.sc-digi-bar-chart{--digi--button--padding--medium:0 0 0.75rem 0}.sc-digi-bar-chart-h .chartTooltip.sc-digi-bar-chart{top:-5px;position:absolute;background-color:var(--digi--color--background--primary);color:black;padding:5px 10px;padding-right:5px;border-radius:4px;display:block;width:max-content;white-space:nowrap;filter:drop-shadow(rgba(0, 0, 0, 0.8) 0px 0px 1px);font-size:0.875rem}.sc-digi-bar-chart-h .tooltipBody.sc-digi-bar-chart{display:inline-block}.sc-digi-bar-chart-h .tooltipHead.sc-digi-bar-chart{display:flex;flex-direction:row;justify-content:space-between}.sc-digi-bar-chart-h .tooltipClose.sc-digi-bar-chart{display:inline-block;vertical-align:top;--digi--color--icon--primary:#333;cursor:pointer}.sc-digi-bar-chart-h .tooltipClose.sc-digi-bar-chart:hover{--digi--color--icon--primary:gray}.sc-digi-bar-chart-h .legendWrap.sc-digi-bar-chart{display:grid}.sc-digi-bar-chart-h .legend.sc-digi-bar-chart{display:flex;flex-direction:row;gap:1rem;min-width:0;overflow-x:auto;scrollbar-gutter:stable}.sc-digi-bar-chart-h .caret.sc-digi-bar-chart{--digi--icon--color:var(--digi--color--background--primary)}.sc-digi-bar-chart-h .scChartStatus.sc-digi-bar-chart{border:0;clip:rect(1px, 1px, 1px, 1px);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sc-digi-bar-chart-h .table.sc-digi-bar-chart{display:none;overflow-y:auto;height:auto;border-radius:4px;background:linear-gradient(white 30%, rgba(255, 255, 255, 0)) center top, linear-gradient(rgba(255, 255, 255, 0), white 70%) center bottom, radial-gradient(farthest-side at 50% 0, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0)) center top, radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0)) center bottom;background-repeat:no-repeat;background-size:100% 40px, 100% 40px, 100% 14px, 100% 14px;background-attachment:local, local, scroll, scroll}`;
39822
+ const barChartCss = () => `.sc-digi-bar-chart-h{height:100%;display:flex;flex-direction:column;min-width:0}.sc-digi-bar-chart-h .digi-bar-chart.sc-digi-bar-chart{font-family:var(--digi--global--typography--font-family--default)}.sc-digi-bar-chart-h .svgWrap.sc-digi-bar-chart{position:relative;display:flex;min-height:20px;min-width:20px;width:100%;height:100%}.sc-digi-bar-chart-h .topWrapper.sc-digi-bar-chart,.sc-digi-bar-chart-h .chartTitle.sc-digi-bar-chart .digi-typography.sc-digi-bar-chart{display:flex;flex-direction:column;gap:0.75rem}.sc-digi-bar-chart-h .topWrapper.sc-digi-bar-chart{margin-bottom:0.75rem}.sc-digi-bar-chart-h .chartTitle.sc-digi-bar-chart{--MARGIN--HEADING-2:0;--MARGIN--HEADING-3:0;--MARGIN--HEADING-4:0;--MARGIN--HEADING-5:0;--MARGIN--HEADING-6:0;--MARGIN--BODY:0}.sc-digi-bar-chart-h .buttonWrapper.sc-digi-bar-chart{--digi--button--padding--medium:0 0 0.75rem 0}.sc-digi-bar-chart-h .chartTooltip.sc-digi-bar-chart{top:-5px;position:absolute;background-color:var(--digi--color--background--primary);color:black;padding:5px 10px;padding-right:5px;border-radius:4px;display:block;width:max-content;white-space:nowrap;filter:drop-shadow(rgba(0, 0, 0, 0.8) 0px 0px 1px);font-size:0.875rem}.sc-digi-bar-chart-h .tooltipBody.sc-digi-bar-chart{display:inline-block}.sc-digi-bar-chart-h .tooltipHead.sc-digi-bar-chart{display:flex;flex-direction:row;justify-content:space-between}.sc-digi-bar-chart-h .tooltipClose.sc-digi-bar-chart{display:inline-block;vertical-align:top;--digi--color--icon--primary:#333;cursor:pointer}.sc-digi-bar-chart-h .tooltipClose.sc-digi-bar-chart:hover{--digi--color--icon--primary:gray}.sc-digi-bar-chart-h .legendWrap.sc-digi-bar-chart{display:grid}.sc-digi-bar-chart-h .legend.sc-digi-bar-chart{display:flex;flex-direction:row;gap:1rem;min-width:0;overflow-x:auto;scrollbar-gutter:stable}.sc-digi-bar-chart-h .caret.sc-digi-bar-chart{--digi--icon--color:var(--digi--color--background--primary)}.sc-digi-bar-chart-h .scChartStatus.sc-digi-bar-chart{border:0;clip:rect(1px, 1px, 1px, 1px);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sc-digi-bar-chart-h .table.sc-digi-bar-chart{display:none;overflow-y:auto;height:auto;border-radius:4px;background:linear-gradient(white 30%, rgba(255, 255, 255, 0)) center top, linear-gradient(rgba(255, 255, 255, 0), white 70%) center bottom, radial-gradient(farthest-side at 50% 0, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0)) center top, radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0)) center bottom;background-repeat:no-repeat;background-size:100% 40px, 100% 40px, 100% 14px, 100% 14px;background-attachment:local, local, scroll, scroll}`;
39700
39823
 
39701
39824
  /**
39702
39825
  *
@@ -39872,6 +39995,8 @@ class barChart {
39872
39995
  };
39873
39996
  // Resizing chart while loading
39874
39997
  this.loadingResize = () => {
39998
+ if (!this.barSelection || !this.xScale)
39999
+ return;
39875
40000
  const newHeight = this.setDims();
39876
40001
  this.barChartContainer.attr('transform', `translate(${this.margin.left + this.tickPadding + this.yTickSize},0)`);
39877
40002
  this.margin.right =
@@ -40133,6 +40258,8 @@ class barChart {
40133
40258
  return toReturn;
40134
40259
  };
40135
40260
  this.adjustBarSize = () => {
40261
+ if (!this.barSelection)
40262
+ return;
40136
40263
  this.barSelection
40137
40264
  .selectAll('.bar')
40138
40265
  .attr('x', this.xFunction)
@@ -40565,13 +40692,13 @@ class barChart {
40565
40692
  this.initBarText();
40566
40693
  };
40567
40694
  // Removes resize observer for chart and inits table
40568
- this.activateTable = (event) => {
40695
+ this.activateTable = () => {
40569
40696
  this.closeTooltip();
40570
40697
  this.barChartObserver.disconnect();
40571
40698
  this.status.innerHTML = '<p>Visas som tabell</p>';
40572
40699
  select(this.host).select('.tableButton').style('display', 'none');
40573
40700
  select(this.host).select('.chartButton').style('display', null);
40574
- event.target.nextSibling.lastChild.focus();
40701
+ this.focusHostButton('.chartButton');
40575
40702
  const duration = 150;
40576
40703
  this.svg
40577
40704
  .attr('opacity', 1)
@@ -40602,11 +40729,11 @@ class barChart {
40602
40729
  .style('opacity', 0);
40603
40730
  };
40604
40731
  // Removes observer and calls init functions for line chart
40605
- this.reInitChart = (event) => {
40732
+ this.reInitChart = () => {
40606
40733
  this.status.innerHTML = '<p>Visas som diagram</p>';
40607
40734
  select(this.host).select('.tableButton').style('display', null);
40608
40735
  select(this.host).select('.chartButton').style('display', 'none');
40609
- event.target.previousSibling.lastChild.focus();
40736
+ this.focusHostButton('.tableButton');
40610
40737
  const table = select(this.tableDiv);
40611
40738
  const duration = 150;
40612
40739
  table
@@ -40632,14 +40759,33 @@ class barChart {
40632
40759
  });
40633
40760
  };
40634
40761
  }
40635
- afChartDataUpdate(data) {
40636
- if ((typeof data === 'string' && Object.keys(JSON.parse(data)).length > 0) ||
40637
- (typeof data !== 'string' && Object.keys(data).length > 0)) {
40638
- if (typeof data != 'string')
40639
- this.chartData = data;
40640
- else
40641
- this.chartData = JSON.parse(data);
40642
- this.series = this.chartData.data.series.map((serie) => serie.title);
40762
+ afChartDataUpdate() {
40763
+ const data = this.afChartData;
40764
+ // Angular/React can connect the element before afChartData is set.
40765
+ if (data == null || data === '') {
40766
+ this.mappedData = this.reshapeData();
40767
+ return;
40768
+ }
40769
+ try {
40770
+ let parsed;
40771
+ if (typeof data === 'string') {
40772
+ parsed = JSON.parse(data);
40773
+ }
40774
+ else if (typeof data === 'object') {
40775
+ parsed = data;
40776
+ }
40777
+ else {
40778
+ this.mappedData = this.reshapeData();
40779
+ return;
40780
+ }
40781
+ if (parsed && Object.keys(parsed).length > 0) {
40782
+ this.chartData = parsed;
40783
+ this.series = this.chartData.data.series.map((serie) => serie.title);
40784
+ }
40785
+ }
40786
+ catch (_a) {
40787
+ logger.warn(`Invalid JSON in "af-chart-data" attribute`, this.hostElement);
40788
+ return;
40643
40789
  }
40644
40790
  this.mappedData = this.reshapeData();
40645
40791
  // checking for width of each tick
@@ -40650,6 +40796,17 @@ class barChart {
40650
40796
  if (this.dataWidth > 1)
40651
40797
  this.barGap = 1;
40652
40798
  }
40799
+ hasChartData() {
40800
+ return !!this.chartData && Object.keys(this.chartData).length > 0;
40801
+ }
40802
+ focusHostButton(selector) {
40803
+ var _a, _b;
40804
+ const host = this.host;
40805
+ const button = (_b = (_a = host === null || host === void 0 ? void 0 : host.querySelector(selector)) === null || _a === void 0 ? void 0 : _a.querySelector('button')) !== null && _b !== void 0 ? _b : host === null || host === void 0 ? void 0 : host.querySelector(selector);
40806
+ if (button && typeof button.focus === 'function') {
40807
+ button.focus();
40808
+ }
40809
+ }
40653
40810
  initSvg() {
40654
40811
  var _a, _b, _c, _d, _e, _f, _g;
40655
40812
  // Fetch number formatting
@@ -41211,10 +41368,25 @@ class barChart {
41211
41368
  Math.min(255, Math.max(0, parseInt(color, 16) + amount)).toString(16)).substr(-2)));
41212
41369
  }
41213
41370
  componentWillLoad() {
41214
- this.afChartDataUpdate(this.afChartData);
41371
+ this.afChartDataUpdate();
41372
+ // Angular attaches the host first and binds `[afChartData]` on the next
41373
+ // frame (Stencil 4.36+). @Watch skips that first assignment, so if chart
41374
+ // data is not here yet, wait one frame. React/vanilla that already set
41375
+ // the prop skip the delay.
41376
+ if (!this.hasChartData()) {
41377
+ return new Promise((resolve) => {
41378
+ requestAnimationFrame(() => {
41379
+ this.afChartDataUpdate();
41380
+ resolve();
41381
+ });
41382
+ });
41383
+ }
41215
41384
  }
41216
41385
  componentDidLoad() {
41217
- if (!this.chartData || Object.keys(this.chartData).length === 0) {
41386
+ if (!this.hasChartData()) {
41387
+ this.afChartDataUpdate();
41388
+ }
41389
+ if (!this.hasChartData()) {
41218
41390
  this.loading = true;
41219
41391
  return this.initEmpty();
41220
41392
  }
@@ -41233,7 +41405,7 @@ class barChart {
41233
41405
  }
41234
41406
  componentDidUpdate() {
41235
41407
  if (this.tableDiv.style['display'] != 'block' &&
41236
- Object.keys(this.chartData).length === 0) {
41408
+ !this.hasChartData()) {
41237
41409
  // Disconnect old barchartobserver while doing resizing
41238
41410
  this.barChartObserver.disconnect();
41239
41411
  return this.loadingState();
@@ -41313,7 +41485,7 @@ class barChart {
41313
41485
  if (this.chartData.infoText)
41314
41486
  heading = `${heading}<span style="display:block;margin-top:0.25rem;font-size:0.875rem;color:var(--digi--global--color--neutral--grayscale--darkest-3)">${this.chartData.infoText}</span>`;
41315
41487
  }
41316
- return (hAsync(Host, { key: 'cb70095467051cf1142891bc63694623e707d92f', ref: (el) => (this.host = el) }, hAsync("svg", { key: 'c040fe2f27d9a5e3de1471fe7e4d853757f6a754', xmlns: "http://www.w3.org/2000/svg", width: "0", height: "0" }, hAsync("defs", { key: '17fd52f2cac5a3225e097aee80e8dc1a99909840' }, hAsync("pattern", { key: '2940e729359dad1acc4635363cd5a8f3ee4d8ea1', id: "prognosis", patternUnits: "userSpaceOnUse", width: "8", height: "8", patternTransform: "rotate(45)" }, hAsync("rect", { key: '4b47d41ea9f4699a4bcc7b0f04d00b8bbd124946', width: "8", height: "8", fill: "white" }), hAsync("line", { key: 'd5c3a32fb715a5271a784771d9812ea599390fc3', x1: "0", y: "0", x2: "0", y2: "12", stroke: this.evalColorVar(this.colorPalettes[0]), "stroke-width": "8" })), hAsync("pattern", { key: '8038bb4d62fd87a118e0bcf4e750165eed48f789', id: "prognosisInactive", patternUnits: "userSpaceOnUse", width: "8", height: "8", patternTransform: "rotate(45)" }, hAsync("rect", { key: 'b1247b7d27e73836c7b5a05fb77a872e89853d3b', width: "8", height: "8", fill: "white" }), hAsync("line", { key: '14265bcba469f08b890654315a86d6278271d64d', x1: "0", y: "0", x2: "0", y2: "12", stroke: this.evalColorVar('--digi--color--background--secondary-accent'), "stroke-width": "8" })), hAsync("pattern", { key: '4069999fd742795379f093c83c00cca488b6139c', id: "prognosisHighlight", patternUnits: "userSpaceOnUse", width: "8", height: "8", patternTransform: "rotate(45)" }, hAsync("rect", { key: 'c525ae39e05acf3e7522f1b92feffdfe5221e528', width: "8", height: "8", fill: "white" }), hAsync("line", { key: 'fa183e0678f6f3794e094b97975fe96955b49e0a', x1: "0", y: "0", x2: "0", y2: "12", stroke: this.adjustColor(this.colorFunction(0), 50), "stroke-width": "8" })))), hAsync("div", { key: 'b6e46d7f4701775a177b02a98f46ca40308e9938', class: "topWrapper", ref: (el) => (this.titleDiv = el) }, hAsync("digi-typography", { key: '88d49833d43776a2bc23d7f73bb8cc9442350634', class: "chartTitle", innerHTML: heading }), hAsync("digi-button", { key: '75e2ef09c3f9f91a08b3596d02ad308b244586bb', class: "buttonWrapper tableButton", "af-size": "medium", "af-variation": "function", "af-full-width": "false", onAfOnClick: this.activateTable, afAriaLabel: `Visa tabell ${((_a = this.chartData) === null || _a === void 0 ? void 0 : _a.title) ? (_b = this.chartData) === null || _b === void 0 ? void 0 : _b.title.toLowerCase() : ''}` }, hAsync("digi-icon-table", { key: '7712b56f991bb5214aa3bebb9e380221156b6bbf', slot: "icon" }), "Visa tabell"), hAsync("digi-button", { key: 'b9d442ea0b62303c2bf1018651ce3206063f3b35', style: { display: 'none' }, class: "buttonWrapper chartButton", "af-size": "medium", "af-variation": "function", "af-full-width": "false", onAfOnClick: this.reInitChart, afAriaLabel: `Visa diagram ${((_c = this.chartData) === null || _c === void 0 ? void 0 : _c.title) ? (_d = this.chartData) === null || _d === void 0 ? void 0 : _d.title.toLowerCase() : ''}` }, hAsync("digi-icon-chart", { key: '260c432d04f8ea00216cd485b5ec3a29df4b4db1', slot: "icon" }), "Visa diagram"), hAsync("div", { key: 'a7fd6276b5738e9cf040f0e9b99e983b27ec25cf', class: "scChartStatus", role: "status", ref: (el) => (this.status = el) })), hAsync("div", { key: '705ec9e3931b91009ff565bbd8f4ba300bd8dbd7', class: "svgWrap", ref: (el) => (this.chartDiv = el) }, hAsync("div", { key: '242fd5b7afba36df00aa7fb256bd8578712d25e7', class: "chartTooltip", id: this.afId }, hAsync("div", { key: '6417cc30962396164fe4840ecfef62c4ef7591d6', class: "tooltipHead" }, hAsync("digi-icon-x", { key: 'dc4edb442bfb342fbdb64b06e70f1e19ccc5ffb1', class: "tooltipClose" })), hAsync("div", { key: 'da625c879d4c0eebffa02193dc36d794c755b768', class: "tooltipBody" }), this.afVariation === BarChartVariation.Horizontal ? (hAsync("digi-icon-caret-up", { class: "caret" })) : (hAsync("digi-icon-caret-down", { class: "caret" })))), hAsync("div", { key: 'a003a616c2ee8b848d402b38009261539ebf0c50', class: "legendWrap", ref: (el) => (this.legendDiv = el) }, hAsync("div", { key: '44a6db8daa836ccf910aafd6fd996f153c337bf4', class: "legend" })), hAsync("div", { key: 'a872281035f2799fe8aa9128a953d0c5d9f6b2cc', class: "table", ref: (el) => (this.tableDiv = el) }, ' ')));
41488
+ return (hAsync(Host, { key: '003845ddc03e2027721d5e75c82816faae5bde63', ref: (el) => (this.host = el) }, hAsync("svg", { key: '054049009c8618211f9009961d238992c3d03c0e', xmlns: "http://www.w3.org/2000/svg", width: "0", height: "0" }, hAsync("defs", { key: '16f32628ffd79e24b66e749666eccd6ae283a5b8' }, hAsync("pattern", { key: '8aa5e0923086f740eeb02d71690ed16086205b0a', id: "prognosis", patternUnits: "userSpaceOnUse", width: "8", height: "8", patternTransform: "rotate(45)" }, hAsync("rect", { key: '237569e79095a4a7c084aa91fd637dfbe385ca8b', width: "8", height: "8", fill: "white" }), hAsync("line", { key: '6edeac6a60cef51561c8fd803b2e277b19b740bf', x1: "0", y: "0", x2: "0", y2: "12", stroke: this.evalColorVar(this.colorPalettes[0]), "stroke-width": "8" })), hAsync("pattern", { key: 'bd40402b6fd33d50fc4dca709380108fe054f74c', id: "prognosisInactive", patternUnits: "userSpaceOnUse", width: "8", height: "8", patternTransform: "rotate(45)" }, hAsync("rect", { key: 'a5dcf48112b024982f3410bc51eb05002c8c8dcc', width: "8", height: "8", fill: "white" }), hAsync("line", { key: 'b76b6ae15b8a0ee9c37c28bf3f66613c9df1e9b8', x1: "0", y: "0", x2: "0", y2: "12", stroke: this.evalColorVar('--digi--color--background--secondary-accent'), "stroke-width": "8" })), hAsync("pattern", { key: 'ef4782b914f2599424d5f3e6715cb69c4f0e4728', id: "prognosisHighlight", patternUnits: "userSpaceOnUse", width: "8", height: "8", patternTransform: "rotate(45)" }, hAsync("rect", { key: '6501ba8a46f53b6c3309486d0795d348a8ec1fff', width: "8", height: "8", fill: "white" }), hAsync("line", { key: 'b184212878587e1e15ebf40a472333851270b287', x1: "0", y: "0", x2: "0", y2: "12", stroke: this.adjustColor(this.colorFunction(0), 50), "stroke-width": "8" })))), hAsync("div", { key: '02b5c9c63c327995f9603ffc84ab0455137ff43d', class: "topWrapper", ref: (el) => (this.titleDiv = el) }, hAsync("digi-typography", { key: 'd8944066ab1a86ed71af7de4a018ef422cea75e9', class: "chartTitle", innerHTML: heading }), hAsync("digi-button", { key: '6bc1e5870432720980fc8dad25abc5f2cb474daf', class: "buttonWrapper tableButton", "af-size": "medium", "af-variation": "function", "af-full-width": "false", onAfOnClick: this.activateTable, afAriaLabel: `Visa tabell ${((_a = this.chartData) === null || _a === void 0 ? void 0 : _a.title) ? (_b = this.chartData) === null || _b === void 0 ? void 0 : _b.title.toLowerCase() : ''}` }, hAsync("digi-icon-table", { key: '5a8b44b3a201b4866b89fc4328ff0b46ac47c6e1', slot: "icon" }), "Visa tabell"), hAsync("digi-button", { key: 'cd0d60a025d5fa0e62cb5f6a322cf3f97c0bd02e', style: { display: 'none' }, class: "buttonWrapper chartButton", "af-size": "medium", "af-variation": "function", "af-full-width": "false", onAfOnClick: this.reInitChart, afAriaLabel: `Visa diagram ${((_c = this.chartData) === null || _c === void 0 ? void 0 : _c.title) ? (_d = this.chartData) === null || _d === void 0 ? void 0 : _d.title.toLowerCase() : ''}` }, hAsync("digi-icon-chart", { key: '8f4e4f1bdabffd7ffd1532453b534a823ef65006', slot: "icon" }), "Visa diagram"), hAsync("div", { key: '22535e8bfb69f96152e61295019d463cb69b70c3', class: "scChartStatus", role: "status", ref: (el) => (this.status = el) })), hAsync("div", { key: '55e25140585469497ec501cd133cfc710bb88b43', class: "svgWrap", ref: (el) => (this.chartDiv = el) }, hAsync("div", { key: '4d8cd2eb832770f94fdff5eec2f084e4ba5c96b8', class: "chartTooltip", id: this.afId }, hAsync("div", { key: 'b805b20b746ce940ae5c20ef34898c3409cffecd', class: "tooltipHead" }, hAsync("digi-icon-x", { key: 'c162d2b1e6e7aafddf0ac194705b436a5b02b392', class: "tooltipClose" })), hAsync("div", { key: 'cdc876d4c88f50c7d95c22f4d0f683c2a5564235', class: "tooltipBody" }), this.afVariation === BarChartVariation.Horizontal ? (hAsync("digi-icon-caret-up", { class: "caret" })) : (hAsync("digi-icon-caret-down", { class: "caret" })))), hAsync("div", { key: '8cb986f7466fdb42f6dc840c1371b25978ae4c66', class: "legendWrap", ref: (el) => (this.legendDiv = el) }, hAsync("div", { key: '6761a567c03c8ade4206fb89cf9e7bd792c36e71', class: "legend" })), hAsync("div", { key: 'ac251b6078602f9319447cfaa6444f0129e46c0f', class: "table", ref: (el) => (this.tableDiv = el) }, ' ')));
41317
41489
  }
41318
41490
  get hostElement() { return getElement(this); }
41319
41491
  static get watchers() { return {