@designsystem-se/af 39.2.1 → 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.
- package/components/digi-bar-chart.js +67 -17
- package/components/digi-calendar-datepicker.js +1 -1
- package/components/digi-calendar-week-view.js +51 -6
- package/components/digi-calendar.js +1 -1
- package/components/digi-chart-line.js +57 -14
- package/components/digi-expandable-accordion.js +18 -11
- package/components/digi-expandable-faq-item.js +21 -14
- package/components/digi-info-card.js +3 -3
- package/components/digi-navigation-vertical-menu.js +27 -13
- package/components/digi-tablist.js +36 -13
- package/components/{p-CrUxQ9d0.js → p-C5A2t93y.js} +1 -1
- package/custom-elements.json +1 -1
- package/dist/cjs/button-size.enum-DgyvMkwE.js +7 -0
- package/dist/cjs/{button-variation.enum-ngMqFLdW.js → button-variation.enum-DkUalo9f.js} +0 -6
- package/dist/cjs/digi-arbetsformedlingen.cjs.js +1 -1
- package/dist/cjs/digi-bar-chart.cjs.entry.js +67 -17
- package/dist/cjs/digi-button.cjs.entry.js +131 -0
- package/dist/cjs/{digi-button_5.cjs.entry.js → digi-calendar-week-view.cjs.entry.js} +117 -261
- package/dist/cjs/{digi-calendar-datepicker.cjs.entry.js → digi-calendar_19.cjs.entry.js} +1611 -55
- package/dist/cjs/digi-chart-line.cjs.entry.js +57 -14
- package/dist/cjs/digi-code-block_3.cjs.entry.js +6 -12
- package/dist/cjs/digi-code-example.cjs.entry.js +4 -3
- package/dist/cjs/digi-dialog.cjs.entry.js +6 -12
- package/dist/cjs/digi-footer.cjs.entry.js +5 -11
- package/dist/cjs/digi-form-error-list.cjs.entry.js +5 -11
- package/dist/cjs/digi-form-file-upload.cjs.entry.js +9 -10
- package/dist/cjs/digi-form-input-search.cjs.entry.js +5 -6
- package/dist/cjs/digi-form-receipt.cjs.entry.js +5 -11
- package/dist/cjs/digi-form-select-filter.cjs.entry.js +6 -12
- package/dist/cjs/digi-header-navigation.cjs.entry.js +5 -11
- package/dist/cjs/digi-header.cjs.entry.js +5 -11
- package/dist/cjs/digi-info-card.cjs.entry.js +3 -3
- package/dist/cjs/digi-navigation-pagination.cjs.entry.js +5 -11
- package/dist/cjs/digi-navigation-vertical-menu.cjs.entry.js +27 -13
- package/dist/cjs/digi-notification-alert.cjs.entry.js +5 -11
- package/dist/cjs/digi-notification-error-page.cjs.entry.js +5 -11
- package/dist/cjs/digi-tablist.cjs.entry.js +36 -13
- package/dist/cjs/digi-title-logo.cjs.entry.js +5 -11
- package/dist/cjs/digi-tools-feedback.cjs.entry.js +7 -13
- package/dist/cjs/{form-input-type.enum-DvF_MTHK.js → form-input-type.enum-CCCcY8gv.js} +7 -0
- package/dist/cjs/{form-file-upload-variation.enum-xcEOoggr.js → form-validation-message-variation.enum-DgkifAnP.js} +7 -0
- package/dist/cjs/index-Cn1hHaSy.js +6 -42
- package/dist/cjs/{index-Bdlw-Iuy.js → index-DUQtADgG.js} +189 -19
- package/dist/cjs/index.cjs.js +59 -65
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{typography-variation.enum-BDSt7CVI.js → typography-variation.enum-CVUvogxJ.js} +86 -0
- package/dist/collection/components/_calendar/calendar/calendar.css +5 -6
- package/dist/collection/components/_calendar/week-view/calendar-week-view.js +53 -8
- package/dist/collection/components/_chart/bar-chart/bar-chart.css +1 -1
- package/dist/collection/components/_chart/bar-chart/bar-chart.js +66 -16
- package/dist/collection/components/_chart/chart-line/chart-line.js +57 -14
- package/dist/collection/components/_expandable/expandable-accordion/expandable-accordion.js +18 -11
- package/dist/collection/components/_expandable/expandable-faq-item/expandable-faq-item.js +21 -14
- package/dist/collection/components/_info-card/info-card/info-card.js +5 -5
- package/dist/collection/components/_navigation/navigation-tablist/navigation-tablist.js +36 -13
- package/dist/collection/components/_navigation/navigation-vertical-menu/navigation-vertical-menu.js +27 -13
- package/dist/digi-arbetsformedlingen/digi-arbetsformedlingen.esm.js +1 -1
- package/dist/digi-arbetsformedlingen/index.esm.js +1 -1
- package/dist/digi-arbetsformedlingen/p-0230ec9b.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-04bbbd14.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-0cf25433.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-17824a0b.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-25815f15.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-3d4ac22e.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-47513f97.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-4aefce1e.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-6e256f0c.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-870a00f8.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-88dc2ed4.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-9n7Okhf1.js +1 -0
- package/dist/digi-arbetsformedlingen/p-C6S1HfeA.js +1 -0
- package/dist/digi-arbetsformedlingen/p-C7xgnp99.js +1 -0
- package/dist/digi-arbetsformedlingen/p-Cnyfh_8_.js +1 -0
- package/dist/digi-arbetsformedlingen/p-Zivp2NJB.js +1 -0
- package/dist/digi-arbetsformedlingen/p-a1deddb1.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-a29b6fff.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/{p-375ea6f8.entry.js → p-ace2e5fd.entry.js} +1 -1
- package/dist/digi-arbetsformedlingen/p-b411a549.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-b7712996.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-bfccf413.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-cdd65abb.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-d4406627.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-dd95c75e.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-e5396b1e.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-e7c10f6a.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-f91295ac.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-ffb4fac6.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-y5Nm4oWF.js +1 -0
- package/dist/esm/button-size.enum-C7xgnp99.js +7 -0
- package/dist/esm/{button-variation.enum-BMQm4N5I.js → button-variation.enum-y5Nm4oWF.js} +1 -7
- package/dist/esm/digi-arbetsformedlingen.js +1 -1
- package/dist/esm/digi-bar-chart.entry.js +67 -17
- package/dist/esm/digi-button.entry.js +129 -0
- package/dist/esm/{digi-button_5.entry.js → digi-calendar-week-view.entry.js} +56 -196
- package/dist/esm/{digi-calendar-datepicker.entry.js → digi-calendar_19.entry.js} +1555 -17
- package/dist/esm/digi-chart-line.entry.js +57 -14
- package/dist/esm/digi-code-block_3.entry.js +5 -11
- package/dist/esm/digi-code-example.entry.js +2 -1
- package/dist/esm/digi-dialog.entry.js +5 -11
- package/dist/esm/digi-footer.entry.js +5 -11
- package/dist/esm/digi-form-error-list.entry.js +5 -11
- package/dist/esm/digi-form-file-upload.entry.js +1 -2
- package/dist/esm/digi-form-input-search.entry.js +1 -2
- package/dist/esm/digi-form-receipt.entry.js +5 -11
- package/dist/esm/digi-form-select-filter.entry.js +5 -11
- package/dist/esm/digi-header-navigation.entry.js +5 -11
- package/dist/esm/digi-header.entry.js +5 -11
- package/dist/esm/digi-info-card.entry.js +3 -3
- package/dist/esm/digi-navigation-pagination.entry.js +5 -11
- package/dist/esm/digi-navigation-vertical-menu.entry.js +27 -13
- package/dist/esm/digi-notification-alert.entry.js +5 -11
- package/dist/esm/digi-notification-error-page.entry.js +5 -11
- package/dist/esm/digi-tablist.entry.js +37 -14
- package/dist/esm/digi-title-logo.entry.js +5 -11
- package/dist/esm/digi-tools-feedback.entry.js +5 -11
- package/dist/esm/{form-input-type.enum-BSJH8Lpg.js → form-input-type.enum-C6S1HfeA.js} +8 -1
- package/dist/esm/{form-file-upload-variation.enum-BfyJgcLA.js → form-validation-message-variation.enum-9n7Okhf1.js} +8 -1
- package/dist/esm/index-BnKuq1L7.js +6 -42
- package/dist/esm/{index-B1Je6g2n.js → index-Cnyfh_8_.js} +170 -3
- package/dist/esm/index.js +5 -11
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{typography-variation.enum-4smNltRI.js → typography-variation.enum-Zivp2NJB.js} +87 -1
- package/dist/types/components/_calendar/week-view/calendar-week-view.d.ts +4 -2
- package/dist/types/components/_chart/bar-chart/bar-chart.d.ts +4 -2
- package/dist/types/components/_chart/chart-line/chart-line.d.ts +3 -1
- package/dist/types/components/_info-card/info-card/info-card.d.ts +2 -2
- package/dist/types/components/_navigation/navigation-tablist/navigation-tablist.d.ts +4 -2
- package/dist/types/components/_navigation/navigation-vertical-menu/navigation-vertical-menu.d.ts +7 -2
- package/dist/types/components.d.ts +7 -7
- package/hydrate/index.js +278 -92
- package/hydrate/index.mjs +278 -92
- package/package.json +1 -1
- package/dist/cjs/digi-calendar_2.cjs.entry.js +0 -490
- package/dist/cjs/digi-expandable-accordion.cjs.entry.js +0 -121
- package/dist/cjs/digi-expandable-faq-item.cjs.entry.js +0 -119
- package/dist/cjs/digi-form-input.cjs.entry.js +0 -205
- package/dist/cjs/digi-form-label_3.cjs.entry.js +0 -147
- package/dist/cjs/digi-form-select_2.cjs.entry.js +0 -201
- package/dist/cjs/digi-icon-chevron-down.cjs.entry.js +0 -28
- package/dist/cjs/digi-icon-validation-error_2.cjs.entry.js +0 -51
- package/dist/cjs/digi-typography-heading-jumbo.cjs.entry.js +0 -46
- package/dist/cjs/digi-util-keydown-handler.cjs.entry.js +0 -81
- package/dist/cjs/expandable-accordion-header-level.enum-CjL9V3Kt.js +0 -11
- package/dist/cjs/expandable-faq-item-variation.enum-aKkYAQgd.js +0 -18
- package/dist/cjs/form-input-search-variation.enum-VVfvlVeM.js +0 -8
- package/dist/cjs/form-input-variation.enum-kpoXNUuI.js +0 -29
- package/dist/cjs/form-select-variation.enum-e6wjWyaS.js +0 -16
- package/dist/cjs/form-validation-message-variation.enum-BA5nmCiw.js +0 -8
- package/dist/cjs/index-Snltmefx.js +0 -174
- package/dist/cjs/index-r0sb9TCr.js +0 -66
- package/dist/cjs/typography-heading-jumbo-variation.enum-Di1Jeh0G.js +0 -17
- package/dist/digi-arbetsformedlingen/p-037a35bd.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-09b52191.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-0c88f210.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-151248bf.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-26099889.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-3239fb1a.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-3c1f9629.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-4ddcae7b.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-4smNltRI.js +0 -1
- package/dist/digi-arbetsformedlingen/p-52a27991.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-626c1bf5.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-674a7a94.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-6931825c.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-6c1fd994.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-7682ad6f.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-7688502e.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-7f180ce2.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-88bec555.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-91265ee0.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-9a4eecde.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-B8hpiXmh.js +0 -1
- package/dist/digi-arbetsformedlingen/p-BMQm4N5I.js +0 -1
- package/dist/digi-arbetsformedlingen/p-BSJH8Lpg.js +0 -1
- package/dist/digi-arbetsformedlingen/p-BfyJgcLA.js +0 -1
- package/dist/digi-arbetsformedlingen/p-BixPaBHw.js +0 -1
- package/dist/digi-arbetsformedlingen/p-BvWKyXb_.js +0 -1
- package/dist/digi-arbetsformedlingen/p-C6B2KRZo.js +0 -1
- package/dist/digi-arbetsformedlingen/p-CgSR-RTl.js +0 -1
- package/dist/digi-arbetsformedlingen/p-DCS1KcvC.js +0 -1
- package/dist/digi-arbetsformedlingen/p-DNjGvZvz.js +0 -1
- package/dist/digi-arbetsformedlingen/p-DfWZa2Wv.js +0 -1
- package/dist/digi-arbetsformedlingen/p-DwNlf6Sh.js +0 -1
- package/dist/digi-arbetsformedlingen/p-a556608d.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-a9a1bf57.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-b3410fbd.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-d07a1377.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-d0b3c35b.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-e002ceb8.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-e6ee5a17.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-e7b311da.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-ec6dd177.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-ee58a938.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-eee1b91f.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-fea63204.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-ff73fa2f.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-xwICssEK.js +0 -1
- package/dist/esm/digi-calendar_2.entry.js +0 -487
- package/dist/esm/digi-expandable-accordion.entry.js +0 -119
- package/dist/esm/digi-expandable-faq-item.entry.js +0 -117
- package/dist/esm/digi-form-input.entry.js +0 -203
- package/dist/esm/digi-form-label_3.entry.js +0 -143
- package/dist/esm/digi-form-select_2.entry.js +0 -198
- package/dist/esm/digi-icon-chevron-down.entry.js +0 -26
- package/dist/esm/digi-icon-validation-error_2.entry.js +0 -48
- package/dist/esm/digi-typography-heading-jumbo.entry.js +0 -44
- package/dist/esm/digi-util-keydown-handler.entry.js +0 -79
- package/dist/esm/expandable-accordion-header-level.enum-DwNlf6Sh.js +0 -11
- package/dist/esm/expandable-faq-item-variation.enum-C6B2KRZo.js +0 -18
- package/dist/esm/form-input-search-variation.enum-BvWKyXb_.js +0 -8
- package/dist/esm/form-input-variation.enum-DfWZa2Wv.js +0 -29
- package/dist/esm/form-select-variation.enum-DCS1KcvC.js +0 -16
- package/dist/esm/form-validation-message-variation.enum-B8hpiXmh.js +0 -8
- package/dist/esm/index-BixPaBHw.js +0 -170
- package/dist/esm/index-BsIL3T_0.js +0 -63
- package/dist/esm/typography-heading-jumbo-variation.enum-DNjGvZvz.js +0 -17
|
@@ -2,6 +2,7 @@ import { p as proxyCustomElement, H, h, c as Host, t as transformTag } from './p
|
|
|
2
2
|
import { o as ordinal, i as initRange, r as range, s as select, a as axisLeft, l as linear, b as axisBottom, m as max, p as polyInOut, c as min, d as linear$1 } from './p-lPbx4RHH.js';
|
|
3
3
|
import { _ as _t } from './p-DsO1BTml.js';
|
|
4
4
|
import { r as randomIdGenerator } from './p-BGaIliX6.js';
|
|
5
|
+
import { l as logger } from './p-DdB9j8uV.js';
|
|
5
6
|
import { B as BarChartVariation } from './p-DPeoHh1J.js';
|
|
6
7
|
import { d as defineCustomElement$8 } from './p-BxG1tqmk.js';
|
|
7
8
|
import { d as defineCustomElement$7 } from './p-1kIXcBRD.js';
|
|
@@ -91,7 +92,7 @@ function band() {
|
|
|
91
92
|
return initRange.apply(rescale(), arguments);
|
|
92
93
|
}
|
|
93
94
|
|
|
94
|
-
const barChartCss = () => `.sc-digi-bar-chart-h{
|
|
95
|
+
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}`;
|
|
95
96
|
|
|
96
97
|
const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
97
98
|
constructor(registerHost) {
|
|
@@ -264,6 +265,8 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
264
265
|
};
|
|
265
266
|
// Resizing chart while loading
|
|
266
267
|
this.loadingResize = () => {
|
|
268
|
+
if (!this.barSelection || !this.xScale)
|
|
269
|
+
return;
|
|
267
270
|
const newHeight = this.setDims();
|
|
268
271
|
this.barChartContainer.attr('transform', `translate(${this.margin.left + this.tickPadding + this.yTickSize},0)`);
|
|
269
272
|
this.margin.right =
|
|
@@ -525,6 +528,8 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
525
528
|
return toReturn;
|
|
526
529
|
};
|
|
527
530
|
this.adjustBarSize = () => {
|
|
531
|
+
if (!this.barSelection)
|
|
532
|
+
return;
|
|
528
533
|
this.barSelection
|
|
529
534
|
.selectAll('.bar')
|
|
530
535
|
.attr('x', this.xFunction)
|
|
@@ -957,13 +962,13 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
957
962
|
this.initBarText();
|
|
958
963
|
};
|
|
959
964
|
// Removes resize observer for chart and inits table
|
|
960
|
-
this.activateTable = (
|
|
965
|
+
this.activateTable = () => {
|
|
961
966
|
this.closeTooltip();
|
|
962
967
|
this.barChartObserver.disconnect();
|
|
963
968
|
this.status.innerHTML = '<p>Visas som tabell</p>';
|
|
964
969
|
select(this.host).select('.tableButton').style('display', 'none');
|
|
965
970
|
select(this.host).select('.chartButton').style('display', null);
|
|
966
|
-
|
|
971
|
+
this.focusHostButton('.chartButton');
|
|
967
972
|
const duration = 150;
|
|
968
973
|
this.svg
|
|
969
974
|
.attr('opacity', 1)
|
|
@@ -994,11 +999,11 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
994
999
|
.style('opacity', 0);
|
|
995
1000
|
};
|
|
996
1001
|
// Removes observer and calls init functions for line chart
|
|
997
|
-
this.reInitChart = (
|
|
1002
|
+
this.reInitChart = () => {
|
|
998
1003
|
this.status.innerHTML = '<p>Visas som diagram</p>';
|
|
999
1004
|
select(this.host).select('.tableButton').style('display', null);
|
|
1000
1005
|
select(this.host).select('.chartButton').style('display', 'none');
|
|
1001
|
-
|
|
1006
|
+
this.focusHostButton('.tableButton');
|
|
1002
1007
|
const table = select(this.tableDiv);
|
|
1003
1008
|
const duration = 150;
|
|
1004
1009
|
table
|
|
@@ -1024,14 +1029,33 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
1024
1029
|
});
|
|
1025
1030
|
};
|
|
1026
1031
|
}
|
|
1027
|
-
afChartDataUpdate(
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1032
|
+
afChartDataUpdate() {
|
|
1033
|
+
const data = this.afChartData;
|
|
1034
|
+
// Angular/React can connect the element before afChartData is set.
|
|
1035
|
+
if (data == null || data === '') {
|
|
1036
|
+
this.mappedData = this.reshapeData();
|
|
1037
|
+
return;
|
|
1038
|
+
}
|
|
1039
|
+
try {
|
|
1040
|
+
let parsed;
|
|
1041
|
+
if (typeof data === 'string') {
|
|
1042
|
+
parsed = JSON.parse(data);
|
|
1043
|
+
}
|
|
1044
|
+
else if (typeof data === 'object') {
|
|
1045
|
+
parsed = data;
|
|
1046
|
+
}
|
|
1047
|
+
else {
|
|
1048
|
+
this.mappedData = this.reshapeData();
|
|
1049
|
+
return;
|
|
1050
|
+
}
|
|
1051
|
+
if (parsed && Object.keys(parsed).length > 0) {
|
|
1052
|
+
this.chartData = parsed;
|
|
1053
|
+
this.series = this.chartData.data.series.map((serie) => serie.title);
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
catch (_a) {
|
|
1057
|
+
logger.warn(`Invalid JSON in "af-chart-data" attribute`, this.hostElement);
|
|
1058
|
+
return;
|
|
1035
1059
|
}
|
|
1036
1060
|
this.mappedData = this.reshapeData();
|
|
1037
1061
|
// checking for width of each tick
|
|
@@ -1042,6 +1066,17 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
1042
1066
|
if (this.dataWidth > 1)
|
|
1043
1067
|
this.barGap = 1;
|
|
1044
1068
|
}
|
|
1069
|
+
hasChartData() {
|
|
1070
|
+
return !!this.chartData && Object.keys(this.chartData).length > 0;
|
|
1071
|
+
}
|
|
1072
|
+
focusHostButton(selector) {
|
|
1073
|
+
var _a, _b;
|
|
1074
|
+
const host = this.host;
|
|
1075
|
+
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);
|
|
1076
|
+
if (button && typeof button.focus === 'function') {
|
|
1077
|
+
button.focus();
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1045
1080
|
initSvg() {
|
|
1046
1081
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
1047
1082
|
// Fetch number formatting
|
|
@@ -1603,10 +1638,25 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
1603
1638
|
Math.min(255, Math.max(0, parseInt(color, 16) + amount)).toString(16)).substr(-2)));
|
|
1604
1639
|
}
|
|
1605
1640
|
componentWillLoad() {
|
|
1606
|
-
this.afChartDataUpdate(
|
|
1641
|
+
this.afChartDataUpdate();
|
|
1642
|
+
// Angular attaches the host first and binds `[afChartData]` on the next
|
|
1643
|
+
// frame (Stencil 4.36+). @Watch skips that first assignment, so if chart
|
|
1644
|
+
// data is not here yet, wait one frame. React/vanilla that already set
|
|
1645
|
+
// the prop skip the delay.
|
|
1646
|
+
if (!this.hasChartData()) {
|
|
1647
|
+
return new Promise((resolve) => {
|
|
1648
|
+
requestAnimationFrame(() => {
|
|
1649
|
+
this.afChartDataUpdate();
|
|
1650
|
+
resolve();
|
|
1651
|
+
});
|
|
1652
|
+
});
|
|
1653
|
+
}
|
|
1607
1654
|
}
|
|
1608
1655
|
componentDidLoad() {
|
|
1609
|
-
if (!this.
|
|
1656
|
+
if (!this.hasChartData()) {
|
|
1657
|
+
this.afChartDataUpdate();
|
|
1658
|
+
}
|
|
1659
|
+
if (!this.hasChartData()) {
|
|
1610
1660
|
this.loading = true;
|
|
1611
1661
|
return this.initEmpty();
|
|
1612
1662
|
}
|
|
@@ -1625,7 +1675,7 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
1625
1675
|
}
|
|
1626
1676
|
componentDidUpdate() {
|
|
1627
1677
|
if (this.tableDiv.style['display'] != 'block' &&
|
|
1628
|
-
|
|
1678
|
+
!this.hasChartData()) {
|
|
1629
1679
|
// Disconnect old barchartobserver while doing resizing
|
|
1630
1680
|
this.barChartObserver.disconnect();
|
|
1631
1681
|
return this.loadingState();
|
|
@@ -1705,7 +1755,7 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
1705
1755
|
if (this.chartData.infoText)
|
|
1706
1756
|
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>`;
|
|
1707
1757
|
}
|
|
1708
|
-
return (h(Host, { key: '
|
|
1758
|
+
return (h(Host, { key: '003845ddc03e2027721d5e75c82816faae5bde63', ref: (el) => (this.host = el) }, h("svg", { key: '054049009c8618211f9009961d238992c3d03c0e', xmlns: "http://www.w3.org/2000/svg", width: "0", height: "0" }, h("defs", { key: '16f32628ffd79e24b66e749666eccd6ae283a5b8' }, h("pattern", { key: '8aa5e0923086f740eeb02d71690ed16086205b0a', id: "prognosis", patternUnits: "userSpaceOnUse", width: "8", height: "8", patternTransform: "rotate(45)" }, h("rect", { key: '237569e79095a4a7c084aa91fd637dfbe385ca8b', width: "8", height: "8", fill: "white" }), h("line", { key: '6edeac6a60cef51561c8fd803b2e277b19b740bf', x1: "0", y: "0", x2: "0", y2: "12", stroke: this.evalColorVar(this.colorPalettes[0]), "stroke-width": "8" })), h("pattern", { key: 'bd40402b6fd33d50fc4dca709380108fe054f74c', id: "prognosisInactive", patternUnits: "userSpaceOnUse", width: "8", height: "8", patternTransform: "rotate(45)" }, h("rect", { key: 'a5dcf48112b024982f3410bc51eb05002c8c8dcc', width: "8", height: "8", fill: "white" }), h("line", { key: 'b76b6ae15b8a0ee9c37c28bf3f66613c9df1e9b8', x1: "0", y: "0", x2: "0", y2: "12", stroke: this.evalColorVar('--digi--color--background--secondary-accent'), "stroke-width": "8" })), h("pattern", { key: 'ef4782b914f2599424d5f3e6715cb69c4f0e4728', id: "prognosisHighlight", patternUnits: "userSpaceOnUse", width: "8", height: "8", patternTransform: "rotate(45)" }, h("rect", { key: '6501ba8a46f53b6c3309486d0795d348a8ec1fff', width: "8", height: "8", fill: "white" }), h("line", { key: 'b184212878587e1e15ebf40a472333851270b287', x1: "0", y: "0", x2: "0", y2: "12", stroke: this.adjustColor(this.colorFunction(0), 50), "stroke-width": "8" })))), h("div", { key: '02b5c9c63c327995f9603ffc84ab0455137ff43d', class: "topWrapper", ref: (el) => (this.titleDiv = el) }, h("digi-typography", { key: 'd8944066ab1a86ed71af7de4a018ef422cea75e9', class: "chartTitle", innerHTML: heading }), h("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() : ''}` }, h("digi-icon-table", { key: '5a8b44b3a201b4866b89fc4328ff0b46ac47c6e1', slot: "icon" }), "Visa tabell"), h("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() : ''}` }, h("digi-icon-chart", { key: '8f4e4f1bdabffd7ffd1532453b534a823ef65006', slot: "icon" }), "Visa diagram"), h("div", { key: '22535e8bfb69f96152e61295019d463cb69b70c3', class: "scChartStatus", role: "status", ref: (el) => (this.status = el) })), h("div", { key: '55e25140585469497ec501cd133cfc710bb88b43', class: "svgWrap", ref: (el) => (this.chartDiv = el) }, h("div", { key: '4d8cd2eb832770f94fdff5eec2f084e4ba5c96b8', class: "chartTooltip", id: this.afId }, h("div", { key: 'b805b20b746ce940ae5c20ef34898c3409cffecd', class: "tooltipHead" }, h("digi-icon-x", { key: 'c162d2b1e6e7aafddf0ac194705b436a5b02b392', class: "tooltipClose" })), h("div", { key: 'cdc876d4c88f50c7d95c22f4d0f683c2a5564235', class: "tooltipBody" }), this.afVariation === BarChartVariation.Horizontal ? (h("digi-icon-caret-up", { class: "caret" })) : (h("digi-icon-caret-down", { class: "caret" })))), h("div", { key: '8cb986f7466fdb42f6dc840c1371b25978ae4c66', class: "legendWrap", ref: (el) => (this.legendDiv = el) }, h("div", { key: '6761a567c03c8ade4206fb89cf9e7bd792c36e71', class: "legend" })), h("div", { key: 'ac251b6078602f9319447cfaa6444f0129e46c0f', class: "table", ref: (el) => (this.tableDiv = el) }, ' ')));
|
|
1709
1759
|
}
|
|
1710
1760
|
get hostElement() { return this; }
|
|
1711
1761
|
static get watchers() { return {
|
|
@@ -52,7 +52,7 @@ import './p-rhVqmQwC.js';
|
|
|
52
52
|
import './p-DPq588Q4.js';
|
|
53
53
|
import { r as randomIdGenerator } from './p-BGaIliX6.js';
|
|
54
54
|
import { d as detectClickOutside } from './p-CZrDWyoh.js';
|
|
55
|
-
import { i as isBefore, a as isAfter, d as defineCustomElement$e } from './p-
|
|
55
|
+
import { i as isBefore, a as isAfter, d as defineCustomElement$e } from './p-C5A2t93y.js';
|
|
56
56
|
import { d as defineCustomElement$d } from './p-DdUXwmS6.js';
|
|
57
57
|
import { d as defineCustomElement$c } from './p-CAW-ueZH.js';
|
|
58
58
|
import { d as defineCustomElement$b } from './p-CBCmbVA7.js';
|
|
@@ -2,6 +2,7 @@ import { p as proxyCustomElement, H, d as createEvent, h, t as transformTag } fr
|
|
|
2
2
|
import { _ as _t } from './p-DsO1BTml.js';
|
|
3
3
|
import { t as toInteger, g as getUTCISOWeek, a as getUTCWeek, k as getUTCISOWeekYear, c as getUTCWeekYear, l as locale$1, j as getTimezoneOffsetInMilliseconds, h as subMilliseconds, d as longFormatters, i as isProtectedWeekYearToken, e as throwProtectedError, f as isProtectedDayOfYearToken, m as buildFormatLongFn, n as buildLocalizeFn, o as buildMatchFn, p as buildMatchPatternFn } from './p-DbBOgLZR.js';
|
|
4
4
|
import { r as randomIdGenerator } from './p-BGaIliX6.js';
|
|
5
|
+
import { l as logger } from './p-DdB9j8uV.js';
|
|
5
6
|
import { b as ButtonVariation } from './p-DNHRmpND.js';
|
|
6
7
|
import { C as CalendarWeekViewHeadingLevel } from './p-DH_-wpLB.js';
|
|
7
8
|
import { d as defineCustomElement$5 } from './p-BxG1tqmk.js';
|
|
@@ -2169,7 +2170,30 @@ const CalendarWeekView = /*@__PURE__*/ proxyCustomElement(class CalendarWeekView
|
|
|
2169
2170
|
this.weekDays = [...newDates];
|
|
2170
2171
|
}
|
|
2171
2172
|
afDatesUpdate() {
|
|
2172
|
-
|
|
2173
|
+
// Angular/React can connect the element before afDates is set.
|
|
2174
|
+
if (this.afDates == null || this.afDates === '') {
|
|
2175
|
+
return;
|
|
2176
|
+
}
|
|
2177
|
+
const hadDates = this.dates.length > 0;
|
|
2178
|
+
let dateList;
|
|
2179
|
+
try {
|
|
2180
|
+
if (Array.isArray(this.afDates)) {
|
|
2181
|
+
dateList = [...this.afDates];
|
|
2182
|
+
}
|
|
2183
|
+
else if (typeof this.afDates === 'string') {
|
|
2184
|
+
dateList = JSON.parse(this.afDates);
|
|
2185
|
+
}
|
|
2186
|
+
else {
|
|
2187
|
+
return;
|
|
2188
|
+
}
|
|
2189
|
+
}
|
|
2190
|
+
catch (_a) {
|
|
2191
|
+
logger.warn(`Invalid JSON in "af-dates" attribute`, this.hostElement);
|
|
2192
|
+
return;
|
|
2193
|
+
}
|
|
2194
|
+
if (!Array.isArray(dateList)) {
|
|
2195
|
+
return;
|
|
2196
|
+
}
|
|
2173
2197
|
this.dates = [
|
|
2174
2198
|
...dateList.sort((a, b) => {
|
|
2175
2199
|
const c = new Date(a);
|
|
@@ -2177,6 +2201,9 @@ const CalendarWeekView = /*@__PURE__*/ proxyCustomElement(class CalendarWeekView
|
|
|
2177
2201
|
return this.getTime(c) - this.getTime(d);
|
|
2178
2202
|
})
|
|
2179
2203
|
];
|
|
2204
|
+
if (!hadDates && this.dates.length > 0) {
|
|
2205
|
+
this.initDates();
|
|
2206
|
+
}
|
|
2180
2207
|
}
|
|
2181
2208
|
/**
|
|
2182
2209
|
* Kan användas för att manuellt sätta om det aktiva datumet. Formatet måste vara 'yyyy-MM-dd'.
|
|
@@ -2200,6 +2227,9 @@ const CalendarWeekView = /*@__PURE__*/ proxyCustomElement(class CalendarWeekView
|
|
|
2200
2227
|
this.afOnWeekChange.emit('next');
|
|
2201
2228
|
}
|
|
2202
2229
|
initDates() {
|
|
2230
|
+
if (this.dates.length === 0) {
|
|
2231
|
+
return;
|
|
2232
|
+
}
|
|
2203
2233
|
this.minDate = new Date(this.dates[0]);
|
|
2204
2234
|
this.maxDate = new Date(this.dates[this.dates.length - 1]);
|
|
2205
2235
|
this.selectedDate = format(new Date(this.dates[0]), 'yyyy-MM-dd', {
|
|
@@ -2211,9 +2241,23 @@ const CalendarWeekView = /*@__PURE__*/ proxyCustomElement(class CalendarWeekView
|
|
|
2211
2241
|
}
|
|
2212
2242
|
componentWillLoad() {
|
|
2213
2243
|
this.afDatesUpdate();
|
|
2214
|
-
|
|
2244
|
+
// Angular attaches the host first and binds `[afDates]` on the next frame
|
|
2245
|
+
// (Stencil 4.36+). @Watch skips that first assignment, so if dates are not
|
|
2246
|
+
// here yet, wait one frame. React/vanilla that already set the prop skip
|
|
2247
|
+
// the delay.
|
|
2248
|
+
if (this.dates.length === 0) {
|
|
2249
|
+
return new Promise((resolve) => {
|
|
2250
|
+
requestAnimationFrame(() => {
|
|
2251
|
+
this.afDatesUpdate();
|
|
2252
|
+
resolve();
|
|
2253
|
+
});
|
|
2254
|
+
});
|
|
2255
|
+
}
|
|
2215
2256
|
}
|
|
2216
2257
|
componentDidLoad() {
|
|
2258
|
+
if (this.dates.length === 0) {
|
|
2259
|
+
this.afDatesUpdate();
|
|
2260
|
+
}
|
|
2217
2261
|
this.afOnReady.emit();
|
|
2218
2262
|
}
|
|
2219
2263
|
get prevWeekText() {
|
|
@@ -2237,7 +2281,7 @@ const CalendarWeekView = /*@__PURE__*/ proxyCustomElement(class CalendarWeekView
|
|
|
2237
2281
|
format(new Date(lastDate), 'MMMM yyyy', { locale: locale });
|
|
2238
2282
|
}
|
|
2239
2283
|
render() {
|
|
2240
|
-
return (h("div", { key: '
|
|
2284
|
+
return (h("div", { key: '44d49828a7f43a1f3943aaf0af4139f402844bf0', class: "digi-calendar-week-view" }, h("nav", { key: '44ba98a7c433077c2c11c55b150a5cc2f1d38ac2', class: "digi-calendar-week-view__timepicker" }, h("div", { key: '160ce73dc293abd69193c2b1750c9fd7400b8804', class: "digi-calendar-week-view__dates" }, h("div", { key: '2d60245978d9c7615f3ff5ec7b9d8d628e16f843', class: "digi-calendar-week-view__flex" }, h("digi-typography", { key: '23a1c94d0575061951f67f46782144de52e5e662' }, h(this.afHeadingLevel, { key: 'a183705a035f4d3d57ced74920221f40bbe6019f', role: "status", class: "digi-calendar-week-view__heading" }, h("span", { key: '147910745991716f3557491c6e6aa702f479e8c7', class: "digi-calendar-week-view__month" }, this.currentMonth), h("span", { key: '0d91367cd6066a2b35349edd0ff93e20b5326f04', class: "digi-calendar-week-view__week" }, ' ', "v.", this.currentWeek))), h("ul", { key: 'fdff670cf241e05920e19e0ce6e601b62ae9a3f0', class: "digi-calendar-week-view__date-list" }, this.weekDays.map((dateItem) => {
|
|
2241
2285
|
const date = format(new Date(dateItem), 'd', {
|
|
2242
2286
|
locale: locale
|
|
2243
2287
|
});
|
|
@@ -2257,16 +2301,17 @@ const CalendarWeekView = /*@__PURE__*/ proxyCustomElement(class CalendarWeekView
|
|
|
2257
2301
|
} }, day), h("span", { class: "digi-calendar-week-view__date-button-date" }, date), h("span", { "aria-hidden": "true", class: {
|
|
2258
2302
|
'digi-calendar-week-view__date-button-circle': dateItem === this.todaysDate
|
|
2259
2303
|
} })))));
|
|
2260
|
-
})))), h("digi-button", { key: '
|
|
2304
|
+
})))), h("digi-button", { key: 'dbae5227d0316a5a67febc7de83b1c4c5cfc1044', onClick: () => this.prevWeek(), class: {
|
|
2261
2305
|
'digi-calendar-week-view__week-button digi-calendar-week-view__week-button--previous': true,
|
|
2262
2306
|
'digi-calendar-week-view__week-button--keep-left': this.currentWeek == getISOWeek(this.maxDate),
|
|
2263
2307
|
'digi-calendar-week-view__week-button--hidden': !(this.currentWeek > getISOWeek(this.minDate))
|
|
2264
|
-
}, "af-variation": "secondary" }, h("digi-icon-chevron-left", { key: '
|
|
2308
|
+
}, "af-variation": "secondary" }, h("digi-icon-chevron-left", { key: '65d0f656a0d35911d39f9b8e9ade224be54d4371', slot: "icon" }), this.prevWeekText), h("digi-button", { key: '68d9b3d6c929d0185f412add980a542b3c86fbb2', onClick: () => this.nextWeek(), class: {
|
|
2265
2309
|
'digi-calendar-week-view__week-button digi-calendar-week-view__week-button--next': true,
|
|
2266
2310
|
'digi-calendar-week-view__week-button--keep-right': this.currentWeek == getISOWeek(this.minDate),
|
|
2267
2311
|
'digi-calendar-week-view__week-button--hidden': !(this.currentWeek < getISOWeek(this.maxDate))
|
|
2268
|
-
}, "af-variation": "secondary" }, h("digi-icon-chevron-right", { key: '
|
|
2312
|
+
}, "af-variation": "secondary" }, h("digi-icon-chevron-right", { key: 'a9e688f815a5053aa709cfeb9359131f73df21c0', slot: "icon-secondary" }), this.nextWeekText)), h("div", { key: '7d1073f6cd1982fda2ce7dcb60532c94bd1d0634', role: "status", "aria-live": "assertive", class: "digi-calendar-week-view__result", id: `${this.afId}-result` }, h("digi-typography", { key: 'db7ce0ca80485df1e4ae67200f2cd90cc80938d5' }, h("slot", { key: 'f08f447ae89612dfcea56c638024220bc29e7914' })))));
|
|
2269
2313
|
}
|
|
2314
|
+
get hostElement() { return this; }
|
|
2270
2315
|
static get watchers() { return {
|
|
2271
2316
|
"selectedDate": [{
|
|
2272
2317
|
"selectedDateChangeHandler": 0
|
|
@@ -2,6 +2,7 @@ import { p as proxyCustomElement, H, h, t as transformTag } from './p-0pTevzmo.j
|
|
|
2
2
|
import { _ as _t } from './p-DsO1BTml.js';
|
|
3
3
|
import { s as select, e as dispatch, r as range, a as axisLeft, f as formatLocale, p as polyInOut, b as axisBottom, l as linear, m as max, c as min, o as ordinal, g as interpolate, d as linear$1 } from './p-lPbx4RHH.js';
|
|
4
4
|
import { r as randomIdGenerator } from './p-BGaIliX6.js';
|
|
5
|
+
import { l as logger } from './p-DdB9j8uV.js';
|
|
5
6
|
import { d as defineCustomElement$6 } from './p-BxG1tqmk.js';
|
|
6
7
|
import { d as defineCustomElement$5 } from './p-Br3uVgA1.js';
|
|
7
8
|
import { d as defineCustomElement$4 } from './p-C2LUp3Td.js';
|
|
@@ -1589,14 +1590,14 @@ const ChartLine = /*@__PURE__*/ proxyCustomElement(class ChartLine extends H {
|
|
|
1589
1590
|
});
|
|
1590
1591
|
};
|
|
1591
1592
|
// Removes resize observer for chart and inits table
|
|
1592
|
-
this.activateTable = (
|
|
1593
|
+
this.activateTable = () => {
|
|
1593
1594
|
this.closeTooltip();
|
|
1594
1595
|
this.lineChartObserver.disconnect();
|
|
1595
1596
|
this.tableObserver.observe(this._chartDiv);
|
|
1596
1597
|
this._status.innerHTML = '<p>Visas som tabell</p>';
|
|
1597
1598
|
select(this._host).select('.tableButton').style('display', 'none');
|
|
1598
1599
|
select(this._host).select('.chartButton').style('display', null);
|
|
1599
|
-
|
|
1600
|
+
this.focusHostButton('.chartButton');
|
|
1600
1601
|
const duration = 150;
|
|
1601
1602
|
this._svg
|
|
1602
1603
|
.attr('opacity', 1)
|
|
@@ -1627,12 +1628,12 @@ const ChartLine = /*@__PURE__*/ proxyCustomElement(class ChartLine extends H {
|
|
|
1627
1628
|
this.setTableDimensions();
|
|
1628
1629
|
};
|
|
1629
1630
|
// Removes observer and calls init functions for line chart
|
|
1630
|
-
this.reInitChart = (
|
|
1631
|
+
this.reInitChart = () => {
|
|
1631
1632
|
this.tableObserver.disconnect();
|
|
1632
1633
|
this._status.innerHTML = '<p>Visas som diagram</p>';
|
|
1633
1634
|
select(this._host).select('.tableButton').style('display', null);
|
|
1634
1635
|
select(this._host).select('.chartButton').style('display', 'none');
|
|
1635
|
-
|
|
1636
|
+
this.focusHostButton('.tableButton');
|
|
1636
1637
|
const table = select(this._tableDiv);
|
|
1637
1638
|
table
|
|
1638
1639
|
.style('opacity', 1)
|
|
@@ -1659,15 +1660,40 @@ const ChartLine = /*@__PURE__*/ proxyCustomElement(class ChartLine extends H {
|
|
|
1659
1660
|
}
|
|
1660
1661
|
afChartDataUpdate() {
|
|
1661
1662
|
const data = this.afChartData;
|
|
1662
|
-
|
|
1663
|
-
|
|
1663
|
+
// Angular/React can connect the element before afChartData is set.
|
|
1664
|
+
if (data == null || data === '') {
|
|
1665
|
+
return;
|
|
1666
|
+
}
|
|
1667
|
+
try {
|
|
1668
|
+
if (typeof data === 'object') {
|
|
1669
|
+
this._chartData = Object.assign({}, data);
|
|
1670
|
+
}
|
|
1671
|
+
else if (typeof data === 'string') {
|
|
1672
|
+
this._chartData = JSON.parse(data);
|
|
1673
|
+
}
|
|
1674
|
+
else {
|
|
1675
|
+
return;
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
catch (_a) {
|
|
1679
|
+
logger.warn(`Invalid JSON in "af-chart-data" attribute`, this.element);
|
|
1664
1680
|
return;
|
|
1665
1681
|
}
|
|
1666
|
-
this._chartData = JSON.parse(data);
|
|
1667
1682
|
// Making deep copy of this
|
|
1668
1683
|
if (this._chartData.data)
|
|
1669
1684
|
this._coreSeries = JSON.parse(JSON.stringify(this._chartData.data.series));
|
|
1670
1685
|
}
|
|
1686
|
+
hasChartData() {
|
|
1687
|
+
return !!this._chartData && Object.keys(this._chartData).length > 0;
|
|
1688
|
+
}
|
|
1689
|
+
focusHostButton(selector) {
|
|
1690
|
+
var _a, _b;
|
|
1691
|
+
const host = this._host;
|
|
1692
|
+
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);
|
|
1693
|
+
if (button && typeof button.focus === 'function') {
|
|
1694
|
+
button.focus();
|
|
1695
|
+
}
|
|
1696
|
+
}
|
|
1671
1697
|
initSvg() {
|
|
1672
1698
|
this.margin.bottom =
|
|
1673
1699
|
Number(window
|
|
@@ -2131,9 +2157,24 @@ const ChartLine = /*@__PURE__*/ proxyCustomElement(class ChartLine extends H {
|
|
|
2131
2157
|
}
|
|
2132
2158
|
componentWillLoad() {
|
|
2133
2159
|
this.afChartDataUpdate();
|
|
2160
|
+
// Angular attaches the host first and binds `[afChartData]` on the next
|
|
2161
|
+
// frame (Stencil 4.36+). @Watch skips that first assignment, so if chart
|
|
2162
|
+
// data is not here yet, wait one frame. React/vanilla that already set
|
|
2163
|
+
// the prop skip the delay.
|
|
2164
|
+
if (!this.hasChartData()) {
|
|
2165
|
+
return new Promise((resolve) => {
|
|
2166
|
+
requestAnimationFrame(() => {
|
|
2167
|
+
this.afChartDataUpdate();
|
|
2168
|
+
resolve();
|
|
2169
|
+
});
|
|
2170
|
+
});
|
|
2171
|
+
}
|
|
2134
2172
|
}
|
|
2135
2173
|
componentDidLoad() {
|
|
2136
|
-
if (
|
|
2174
|
+
if (!this.hasChartData()) {
|
|
2175
|
+
this.afChartDataUpdate();
|
|
2176
|
+
}
|
|
2177
|
+
if (!this.hasChartData())
|
|
2137
2178
|
return this.initEmpty();
|
|
2138
2179
|
// clearing selection
|
|
2139
2180
|
this._selectedLines = [];
|
|
@@ -2149,7 +2190,7 @@ const ChartLine = /*@__PURE__*/ proxyCustomElement(class ChartLine extends H {
|
|
|
2149
2190
|
this._prevHeight = select(this._titleDiv).style('height');
|
|
2150
2191
|
}
|
|
2151
2192
|
componentDidUpdate() {
|
|
2152
|
-
if (
|
|
2193
|
+
if (!this.hasChartData())
|
|
2153
2194
|
return this.loadingState();
|
|
2154
2195
|
// clearing selection
|
|
2155
2196
|
this._selectedLines = [];
|
|
@@ -2306,11 +2347,13 @@ const ChartLine = /*@__PURE__*/ proxyCustomElement(class ChartLine extends H {
|
|
|
2306
2347
|
}
|
|
2307
2348
|
render() {
|
|
2308
2349
|
let heading = '';
|
|
2309
|
-
if (
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2350
|
+
if (this._chartData) {
|
|
2351
|
+
if (!this._chartData.subTitle)
|
|
2352
|
+
heading = `<${this.afHeadingLevel}>${this._chartData.title}</${this.afHeadingLevel}>`;
|
|
2353
|
+
else
|
|
2354
|
+
heading = `<${this.afHeadingLevel}>${this._chartData.title}</${this.afHeadingLevel}><p>${this._chartData.subTitle}</p>`;
|
|
2355
|
+
}
|
|
2356
|
+
return (h("host", { key: '93603df9b78fcce8b5735b4a874f879cf7b2326e', ref: (el) => (this._host = el) }, h("div", { key: '094a790864b72bbb9a802b461db06ce312c627c8', class: "topWrapper", ref: (el) => (this._titleDiv = el) }, h("digi-typography", { key: '5f4bd51fdfef816b0e127d1177c60f8310952173', class: "chartTitle", innerHTML: heading }), h("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() : ''}` }, h("digi-icon-table", { key: '750f1b621eb0a1a54ec810aa63624237bd98f9ea', slot: "icon" }), "Visa tabell"), h("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() : ''}` }, h("digi-icon-chart", { key: '9dce5df1a96d4b818597854f7ee238fefda2c686', slot: "icon" }), "Visa diagram"), h("div", { key: '204f5824b2f34b3a1a1401ed4434e1fcb16a2549', class: "scChartStatus", role: "status", ref: (el) => (this._status = el) })), h("div", { key: 'b164f59f1c741db5493af57510eab2987cabefc6', class: "chartTooltip", id: this.afId }, h("div", { key: 'e84bf8a85a745977006d50f296d1afee2ee35698', class: "tooltipHead" }, h("digi-icon-x", { key: '77bcd0342c828dbcbe020a9ffefe4ae6f3086572', class: "close" }), ' '), h("div", { key: '330f69a58082f72b528095ef49a2371fc8b0d8e5', class: "tooltipBody" })), h("div", { key: '62eb27ac8f184476d50332344711ca381e8adf59', class: "chart", ref: (el) => (this._chartDiv = el) }), h("div", { key: 'ad70790d3a2fd5851c4351e41f2436a34169a819', class: "legend", ref: (el) => (this._legendDiv = el) }), h("div", { key: '30d4791a9b808555f03d1830aaec0221c1bc3b37', class: "table", ref: (el) => (this._tableDiv = el) }, ' ')));
|
|
2314
2357
|
}
|
|
2315
2358
|
get element() { return this; }
|
|
2316
2359
|
static get watchers() { return {
|
|
@@ -65,17 +65,21 @@ const ExpandableAccordion = /*@__PURE__*/ proxyCustomElement(class ExpandableAcc
|
|
|
65
65
|
componentDidLoad() {
|
|
66
66
|
const content = this.hostElement.querySelector(`#${this.afId}-content`);
|
|
67
67
|
if (!this.afExpanded) {
|
|
68
|
-
content.
|
|
68
|
+
content.style.visibility = 'hidden';
|
|
69
69
|
}
|
|
70
70
|
else {
|
|
71
|
-
content.
|
|
71
|
+
content.style.overflowY = 'inherit';
|
|
72
|
+
content.style.height = 'auto';
|
|
72
73
|
}
|
|
73
74
|
content.addEventListener('transitionend', () => {
|
|
74
75
|
if (!this.afExpanded) {
|
|
75
|
-
content.
|
|
76
|
+
content.style.visibility = 'hidden';
|
|
77
|
+
content.style.height = '0px';
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
content.style.height = 'auto';
|
|
81
|
+
content.style.overflowY = 'inherit';
|
|
76
82
|
}
|
|
77
|
-
else
|
|
78
|
-
content.setAttribute('style', 'height: auto');
|
|
79
83
|
});
|
|
80
84
|
}
|
|
81
85
|
animateContentHeight() {
|
|
@@ -83,22 +87,25 @@ const ExpandableAccordion = /*@__PURE__*/ proxyCustomElement(class ExpandableAcc
|
|
|
83
87
|
const sectionHeight = content.firstElementChild
|
|
84
88
|
.offsetHeight;
|
|
85
89
|
if (!this.afExpanded && content.style.height === 'auto') {
|
|
86
|
-
content.
|
|
90
|
+
content.style.height = sectionHeight + 'px';
|
|
87
91
|
setTimeout(() => {
|
|
88
|
-
content.
|
|
92
|
+
content.style.height = '0';
|
|
93
|
+
content.style.overflowY = 'hidden';
|
|
89
94
|
});
|
|
90
95
|
return;
|
|
91
96
|
}
|
|
92
97
|
if (this.afExpanded) {
|
|
93
|
-
content.
|
|
98
|
+
content.style.height = sectionHeight + 'px';
|
|
99
|
+
content.style.visibility = 'visible';
|
|
94
100
|
if (!this.afAnimation) {
|
|
95
101
|
setTimeout(() => {
|
|
96
|
-
content.
|
|
102
|
+
content.style.height = 'auto';
|
|
103
|
+
content.style.overflowY = 'inherit';
|
|
97
104
|
});
|
|
98
105
|
}
|
|
99
106
|
}
|
|
100
107
|
else {
|
|
101
|
-
content.
|
|
108
|
+
content.style.height = '0px';
|
|
102
109
|
}
|
|
103
110
|
}
|
|
104
111
|
clickToggleHandler(e, resetFocus = false) {
|
|
@@ -110,7 +117,7 @@ const ExpandableAccordion = /*@__PURE__*/ proxyCustomElement(class ExpandableAcc
|
|
|
110
117
|
this.afOnClick.emit(e);
|
|
111
118
|
}
|
|
112
119
|
render() {
|
|
113
|
-
return (h("article", { key: '
|
|
120
|
+
return (h("article", { key: '2616819e45750577fb23f430d41b2787ca2210a5', "aria-expanded": this.afExpanded ? 'true' : 'false', class: Object.assign({ 'digi-expandable-accordion': true }, this.cssModifiers) }, h("header", { key: 'c77c15183eb4bba670ea2299d5dc3c19e243ea42', class: "digi-expandable-accordion__header" }, h(this.afHeadingLevel, { key: '20dc16774240b6d258eec3d94d4b5d9b9d0a735c', class: "digi-expandable-accordion__heading" }, h("button", { key: '23c45158f203517166cd4c5efe8801b849ea04e0', type: "button", class: "digi-expandable-accordion__button", onClick: (e) => this.clickToggleHandler(e), "aria-expanded": this.afExpanded ? 'true' : 'false', "aria-controls": `${this.afId}-content`, ref: (el) => (this._button = el) }, h("digi-icon-chevron-down", { key: 'bd48367111a6aac92061bda052ffb6708d4f3967', class: "digi-expandable-accordion__toggle-icon" }), h("div", { key: '2e419d3fd48aa8fd31f33012b541a0fd86e60d78', class: "digi-expandable-accordion__heading-text" }, this.afHeading)))), h("section", { key: 'a28657a14024836c9bb1c7e825c573ed6c598eca', class: "digi-expandable-accordion__content", id: `${this.afId}-content` }, h("div", { key: 'e13b9e653c1714adefd5401300789ed89d4cc1b3' }, h("digi-typography", { key: '335442cf9f97ec3f821ab2ca296e1539b24354cf' }, h("slot", { key: '05da2edf48d9259187bb72bf73a6c60ec9077bc0' }))))));
|
|
114
121
|
}
|
|
115
122
|
get hostElement() { return this; }
|
|
116
123
|
static get watchers() { return {
|