@designsystem-se/af 34.2.1-beta.1 → 34.2.1-beta.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 +10 -10
- package/components/digi-form-input-search.js +1 -1
- package/dist/cjs/digi-arbetsformedlingen.cjs.js +1 -1
- package/dist/cjs/digi-bar-chart.cjs.entry.js +10 -10
- package/dist/cjs/digi-button_10.cjs.entry.js +643 -0
- package/dist/cjs/{digi-calendar_16.cjs.entry.js → digi-calendar-datepicker.cjs.entry.js} +48 -1271
- package/dist/cjs/digi-calendar-week-view.cjs.entry.js +51 -50
- package/dist/cjs/digi-calendar_2.cjs.entry.js +478 -0
- package/dist/cjs/digi-code-block_3.cjs.entry.js +5 -4
- package/dist/cjs/digi-dialog.cjs.entry.js +5 -4
- package/dist/cjs/digi-footer.cjs.entry.js +5 -4
- package/dist/cjs/digi-form-error-list.cjs.entry.js +5 -4
- package/dist/cjs/digi-form-file-upload.cjs.entry.js +10 -9
- package/dist/cjs/digi-form-receipt.cjs.entry.js +5 -4
- package/dist/cjs/digi-form-select-filter.cjs.entry.js +6 -5
- package/dist/cjs/digi-form-select_2.cjs.entry.js +176 -0
- package/dist/cjs/digi-header-navigation.cjs.entry.js +5 -4
- package/dist/cjs/digi-header.cjs.entry.js +5 -4
- package/dist/cjs/digi-icon-chevron-left.cjs.entry.js +30 -0
- package/dist/cjs/digi-icon-chevron-right.cjs.entry.js +30 -0
- package/dist/cjs/digi-navigation-pagination.cjs.entry.js +5 -4
- package/dist/cjs/digi-notification-alert.cjs.entry.js +5 -4
- package/dist/cjs/digi-notification-error-page.cjs.entry.js +5 -4
- package/dist/cjs/digi-tools-feedback.cjs.entry.js +5 -4
- package/dist/cjs/digi-util-keydown-handler.cjs.entry.js +83 -0
- package/dist/cjs/digi-util-mutation-observer.cjs.entry.js +64 -0
- package/dist/cjs/{form-validation-message-variation.enum-c5ec3e2d.js → form-file-upload-variation.enum-634cfae8.js} +0 -7
- package/dist/cjs/form-input-variation.enum-d8228d73.js +67 -0
- package/dist/cjs/form-select-variation.enum-528c1bf0.js +16 -0
- package/dist/cjs/form-validation-message-variation.enum-855ae0be.js +8 -0
- package/dist/cjs/index-81fc5a97.js +28 -12
- package/dist/cjs/{index-acb7b350.js → index-ac8e01b4.js} +19 -189
- package/dist/cjs/index-cad91a90.js +66 -0
- package/dist/cjs/index-e8333bcc.js +174 -0
- package/dist/cjs/index.cjs.js +55 -54
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{typography-variation.enum-2cf77231.js → typography-variation.enum-d6a04b47.js} +0 -43
- package/dist/collection/components/_chart/bar-chart/bar-chart.js +10 -10
- package/dist/collection/components/_form/form-input-search/form-input-search.css +4 -0
- package/dist/digi-arbetsformedlingen/digi-arbetsformedlingen.esm.js +1 -1
- package/dist/digi-arbetsformedlingen/index.esm.js +1 -1
- package/dist/digi-arbetsformedlingen/p-1aa24ef1.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-1f3345e9.js +1 -0
- package/dist/digi-arbetsformedlingen/p-25854117.js +1 -0
- package/dist/digi-arbetsformedlingen/p-3874db62.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-4ad84e73.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-4e2796b4.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-56ed4535.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-6786da6f.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-6f59033a.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-79152be3.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-7933b555.js +1 -0
- package/dist/digi-arbetsformedlingen/p-7aacd45f.js +1 -0
- package/dist/digi-arbetsformedlingen/p-7c138f6f.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-831ee484.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-84aa5804.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-867a8b3e.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-881168f2.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-905ccb30.js +1 -0
- package/dist/digi-arbetsformedlingen/p-91e65c6d.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-9f8189c0.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-9f86edca.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-a1822414.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-ae74ccf4.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-bd5122b0.js +1 -0
- package/dist/digi-arbetsformedlingen/p-c7949525.js +1 -0
- package/dist/digi-arbetsformedlingen/p-ce3531cb.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-d41834f2.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-d612e424.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-e5443d9d.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-f447b984.js +1 -0
- package/dist/digi-arbetsformedlingen/p-fee0e9e0.entry.js +1 -0
- package/dist/esm/digi-arbetsformedlingen.js +1 -1
- package/dist/esm/digi-bar-chart.entry.js +10 -10
- package/dist/esm/digi-button_10.entry.js +630 -0
- package/dist/esm/{digi-calendar_16.entry.js → digi-calendar-datepicker.entry.js} +11 -1219
- package/dist/esm/digi-calendar-week-view.entry.js +2 -1
- package/dist/esm/digi-calendar_2.entry.js +473 -0
- package/dist/esm/digi-code-block_3.entry.js +5 -4
- package/dist/esm/digi-dialog.entry.js +5 -4
- package/dist/esm/digi-footer.entry.js +5 -4
- package/dist/esm/digi-form-error-list.entry.js +5 -4
- package/dist/esm/digi-form-file-upload.entry.js +2 -1
- package/dist/esm/digi-form-receipt.entry.js +5 -4
- package/dist/esm/digi-form-select-filter.entry.js +5 -4
- package/dist/esm/digi-form-select_2.entry.js +171 -0
- package/dist/esm/digi-header-navigation.entry.js +5 -4
- package/dist/esm/digi-header.entry.js +5 -4
- package/dist/esm/digi-icon-chevron-left.entry.js +26 -0
- package/dist/esm/digi-icon-chevron-right.entry.js +26 -0
- package/dist/esm/digi-navigation-pagination.entry.js +5 -4
- package/dist/esm/digi-notification-alert.entry.js +5 -4
- package/dist/esm/digi-notification-error-page.entry.js +5 -4
- package/dist/esm/digi-tools-feedback.entry.js +5 -4
- package/dist/esm/digi-util-keydown-handler.entry.js +79 -0
- package/dist/esm/digi-util-mutation-observer.entry.js +60 -0
- package/dist/esm/{form-validation-message-variation.enum-f7835fc5.js → form-file-upload-variation.enum-9c49ec5e.js} +1 -8
- package/dist/esm/form-input-variation.enum-b78808ba.js +67 -0
- package/dist/esm/form-select-variation.enum-f2f6098d.js +16 -0
- package/dist/esm/form-validation-message-variation.enum-bcef8a9d.js +8 -0
- package/dist/esm/{index-dc6b83f7.js → index-2fce392f.js} +3 -170
- package/dist/esm/index-5b6c95c6.js +63 -0
- package/dist/esm/index-8685f88d.js +170 -0
- package/dist/esm/index-bfea2cc5.js +28 -12
- package/dist/esm/index.js +5 -4
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{typography-variation.enum-259c1751.js → typography-variation.enum-0f0f74d5.js} +1 -44
- package/hydrate/index.js +11 -11
- package/hydrate/index.mjs +11 -11
- package/package.json +1 -1
- package/dist/cjs/button-type.enum-406723db.js +0 -8
- package/dist/cjs/digi-button.cjs.entry.js +0 -130
- package/dist/cjs/digi-form-input-search.cjs.entry.js +0 -143
- package/dist/cjs/digi-icon-search.cjs.entry.js +0 -30
- package/dist/cjs/form-input-type.enum-daf781ba.js +0 -32
- package/dist/digi-arbetsformedlingen/p-0399153b.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-0ae59327.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-1158702e.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-2496eee3.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-3887bb40.js +0 -1
- package/dist/digi-arbetsformedlingen/p-403a97f3.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-4df790de.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-62534ddc.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-6f33ef76.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-8798c901.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-9092f712.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-9f124b4f.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-a105d9fe.js +0 -1
- package/dist/digi-arbetsformedlingen/p-a1bffbc3.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-bd578fbb.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-c15ba44e.js +0 -1
- package/dist/digi-arbetsformedlingen/p-c2d45a0d.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-cf75cbcd.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-d4a341f4.js +0 -1
- package/dist/digi-arbetsformedlingen/p-dc0da84c.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-df292ae0.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-e292ae3b.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-e5ca499a.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-ee9589e6.js +0 -1
- package/dist/esm/button-type.enum-5250ae0b.js +0 -8
- package/dist/esm/digi-button.entry.js +0 -126
- package/dist/esm/digi-form-input-search.entry.js +0 -139
- package/dist/esm/digi-icon-search.entry.js +0 -26
- package/dist/esm/form-input-type.enum-62a97d5d.js +0 -32
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h } from './index-bfea2cc5.js';
|
|
2
2
|
import { _ as _t } from './text-26e02c8d.js';
|
|
3
|
-
import {
|
|
3
|
+
import { t as toInteger, b as getUTCWeekYear, k as getUTCISOWeekYear, a as getUTCWeek, g as getUTCISOWeek, h as getTimezoneOffsetInMilliseconds, f as subMilliseconds, i as isProtectedWeekYearToken, d as throwProtectedError, e as isProtectedDayOfYearToken, j as defaultLocale, l as longFormatters, m as buildFormatLongFn, n as buildLocalizeFn, o as buildMatchPatternFn, p as buildMatchFn } from './index-2fce392f.js';
|
|
4
4
|
import { r as randomIdGenerator } from './randomIdGenerator.util-56406f2e.js';
|
|
5
5
|
import { B as ButtonVariation } from './button-variation.enum-94fffdd6.js';
|
|
6
6
|
import { C as CalendarWeekViewHeadingLevel } from './calendar-week-view-heading-level.enum-6774297c.js';
|
|
7
|
+
import { r as requiredArgs, t as toDate, i as isValid } from './index-8685f88d.js';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* @name addDays
|
|
@@ -0,0 +1,473 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index-bfea2cc5.js';
|
|
2
|
+
import { r as randomIdGenerator } from './randomIdGenerator.util-56406f2e.js';
|
|
3
|
+
import { d as detectClickOutside } from './detectClickOutside.util-72594957.js';
|
|
4
|
+
import { d as detectFocusOutside } from './detectFocusOutside.util-a8676bee.js';
|
|
5
|
+
import { l as logger } from './logger.util-ede3c48a.js';
|
|
6
|
+
import { _ as _t } from './text-26e02c8d.js';
|
|
7
|
+
import { i as isValid } from './index-8685f88d.js';
|
|
8
|
+
import { i as isBefore, a as isAfter } from './index-5b6c95c6.js';
|
|
9
|
+
import './detectClosest.util-58a7504f.js';
|
|
10
|
+
|
|
11
|
+
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: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:hover:not(.digi-calendar__date--not-selectable){--digi--calendar--header--button--background:var(\n --digi--calendar--header--button--background--hover\n );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.sc-digi-calendar:hover:not(.digi-calendar__date--not-selectable){--digi--calendar--date--box-shadow:var(\n --digi--calendar--date--box-shadow--hover\n );--digi--calendar--date--background-color:var(\n --digi--calendar--date--background-color--hover\n );cursor:pointer}.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(\n --digi--calendar--date--selected--background-color\n );--digi--calendar--date--color:var(\n --digi--calendar--date--selected--color\n )}.sc-digi-calendar-h .digi-calendar__date--selected.sc-digi-calendar:hover{--digi--calendar--date--background-color:var(\n --digi--calendar--date--selected--background-color\n )}.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(\n --digi--calendar--date--focused--background-color\n );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}";
|
|
12
|
+
const DigiCalendarStyle0 = calendarCss;
|
|
13
|
+
|
|
14
|
+
const Calendar = class {
|
|
15
|
+
constructor(hostRef) {
|
|
16
|
+
registerInstance(this, hostRef);
|
|
17
|
+
this.afOnDateSelectedChange = createEvent(this, "afOnDateSelectedChange", 7);
|
|
18
|
+
this.afOnFocusOutside = createEvent(this, "afOnFocusOutside", 7);
|
|
19
|
+
this.afOnClickOutside = createEvent(this, "afOnClickOutside", 7);
|
|
20
|
+
this.afOnDirty = createEvent(this, "afOnDirty", 7);
|
|
21
|
+
this.activeCalendar = [];
|
|
22
|
+
this.months = [];
|
|
23
|
+
this.selectedDates = [];
|
|
24
|
+
this.focusedDate = undefined;
|
|
25
|
+
this.dirty = false;
|
|
26
|
+
this.afId = randomIdGenerator('digi-calendar');
|
|
27
|
+
this.afInitSelectedMonth = new Date().getMonth();
|
|
28
|
+
this.afInitSelectedDate = new Date();
|
|
29
|
+
this.afShowWeekNumber = false;
|
|
30
|
+
this.afSelectedDate = undefined;
|
|
31
|
+
this.afSelectedDates = [];
|
|
32
|
+
this.afActive = true;
|
|
33
|
+
this.afMinDate = undefined;
|
|
34
|
+
this.afMaxDate = undefined;
|
|
35
|
+
this.afMultipleDates = false;
|
|
36
|
+
this.afYearSelect = false;
|
|
37
|
+
}
|
|
38
|
+
afSelectedDateChangeHandler() {
|
|
39
|
+
if (isValid(this.afSelectedDate)) {
|
|
40
|
+
this.selectedDates = [this.afSelectedDate];
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
this.selectedDates = [];
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
afSelectedDatesChangeHandler() {
|
|
47
|
+
if (this.afSelectedDates.length > 0) {
|
|
48
|
+
if (this.afMultipleDates) {
|
|
49
|
+
const invalidDate = this.afSelectedDates.find((date) => !isValid(date));
|
|
50
|
+
if (invalidDate === undefined) {
|
|
51
|
+
this.selectedDates = this.afSelectedDates;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
else if (isValid(this.afSelectedDates[0])) {
|
|
55
|
+
this.selectedDates = [this.afSelectedDates[0]];
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
this.selectedDates = [];
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
focusoutHandler(e) {
|
|
63
|
+
const target = e.target;
|
|
64
|
+
const selector = `#${this.afId}-calendar`;
|
|
65
|
+
if (detectFocusOutside(target, selector)) {
|
|
66
|
+
this.afOnFocusOutside.emit(e);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
clickHandler(e) {
|
|
70
|
+
const target = e.target;
|
|
71
|
+
const selector = `#${this.afId}-calendar`;
|
|
72
|
+
if (detectClickOutside(target, selector)) {
|
|
73
|
+
this.afOnClickOutside.emit(e);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
drawCalendar(focusedDate) {
|
|
77
|
+
const date = {
|
|
78
|
+
year: focusedDate.getFullYear(),
|
|
79
|
+
month: focusedDate.getMonth()
|
|
80
|
+
};
|
|
81
|
+
this.lastWeekOfPreviousMonth = this.getWeekDays(this.getLastDayOfPrevMonth(date));
|
|
82
|
+
this.firstWeekOfNextMonth = this.getWeekDays(this.getFirstDayOfNextMonth(date));
|
|
83
|
+
this.weeksBetween = this.getWeeksBetween(this.getLastDayOfPrevMonth(date), this.getFirstDayOfNextMonth(date));
|
|
84
|
+
this.weekDaysbetween = this.getWeekdaysOfMonth(this.weeksBetween);
|
|
85
|
+
this.months = [
|
|
86
|
+
'januari',
|
|
87
|
+
'februari',
|
|
88
|
+
'mars',
|
|
89
|
+
'april',
|
|
90
|
+
'maj',
|
|
91
|
+
'juni',
|
|
92
|
+
'juli',
|
|
93
|
+
'augusti',
|
|
94
|
+
'september',
|
|
95
|
+
'oktober',
|
|
96
|
+
'november',
|
|
97
|
+
'december'
|
|
98
|
+
];
|
|
99
|
+
this.activeCalendar = this.appendFirstWeekOfNextMonth()
|
|
100
|
+
? [
|
|
101
|
+
this.lastWeekOfPreviousMonth,
|
|
102
|
+
...this.weekDaysbetween,
|
|
103
|
+
this.appendFirstWeekOfNextMonth()
|
|
104
|
+
]
|
|
105
|
+
: [this.lastWeekOfPreviousMonth, ...this.weekDaysbetween];
|
|
106
|
+
this.appendFirstWeekOfNextMonth();
|
|
107
|
+
if (this.afShowWeekNumber) {
|
|
108
|
+
this.activeCalendar.forEach((el, i) => {
|
|
109
|
+
this.activeCalendar[i].unshift(this.getWeekNumbers(el[0]));
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
appendFirstWeekOfNextMonth() {
|
|
114
|
+
const lastArray = JSON.stringify(this.weekDaysbetween.slice(-1)[0]);
|
|
115
|
+
const stringFirstweek = JSON.stringify(this.firstWeekOfNextMonth);
|
|
116
|
+
if (!this.firstWeekOfNextMonth.some((date) => this.isSameMonth(date, this.focusedDate))) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
else if (lastArray !== stringFirstweek) {
|
|
120
|
+
return this.firstWeekOfNextMonth;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
getLastDayOfPrevMonth(date) {
|
|
124
|
+
return new Date(date.year, date.month, 0);
|
|
125
|
+
}
|
|
126
|
+
getWeekDays(date) {
|
|
127
|
+
const today = date || new Date();
|
|
128
|
+
const week = [];
|
|
129
|
+
for (let i = 1; i <= 7; i++) {
|
|
130
|
+
const first = today.getDate() - today.getDay() + i;
|
|
131
|
+
const day = new Date(today.setDate(first));
|
|
132
|
+
week.push(day);
|
|
133
|
+
}
|
|
134
|
+
return week;
|
|
135
|
+
}
|
|
136
|
+
getFirstDayOfNextMonth(date) {
|
|
137
|
+
return new Date(date.year, date.month + 1, 1);
|
|
138
|
+
}
|
|
139
|
+
getWeeksBetween(lastDayOfPrevMonth, firstDayOnNextMonth) {
|
|
140
|
+
const week = 7 * 24 * 60 * 60 * 1000;
|
|
141
|
+
const d1ms = lastDayOfPrevMonth.getTime();
|
|
142
|
+
const d2ms = firstDayOnNextMonth.getTime();
|
|
143
|
+
const diff = Math.abs(d2ms - d1ms);
|
|
144
|
+
return Math.floor(diff / week);
|
|
145
|
+
}
|
|
146
|
+
getWeekdaysOfMonth(weeksBetween) {
|
|
147
|
+
let weeks = [];
|
|
148
|
+
for (let i = 1; i <= weeksBetween; i++) {
|
|
149
|
+
weeks = [...weeks, this.getWeekDays(this.getUpcoming(i))];
|
|
150
|
+
}
|
|
151
|
+
return weeks;
|
|
152
|
+
}
|
|
153
|
+
getUpcoming(weeks) {
|
|
154
|
+
return new Date(this.focusedDate.getFullYear(), this.focusedDate.getMonth(), 7 * weeks);
|
|
155
|
+
}
|
|
156
|
+
onDirty() {
|
|
157
|
+
if (!this.dirty) {
|
|
158
|
+
this.dirty = true;
|
|
159
|
+
this.afOnDirty.emit(this.dirty);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
selectDateHandler(dateSelected) {
|
|
163
|
+
this.onDirty();
|
|
164
|
+
if (!this.isDateSelectable(dateSelected))
|
|
165
|
+
return;
|
|
166
|
+
if (this.isDateSelected(dateSelected)) {
|
|
167
|
+
this.selectedDates = this.afMultipleDates
|
|
168
|
+
? this.selectedDates.filter((d) => {
|
|
169
|
+
return !this.isSameDate(d, dateSelected);
|
|
170
|
+
})
|
|
171
|
+
: [];
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
this.selectedDates = this.afMultipleDates
|
|
175
|
+
? [...this.selectedDates, dateSelected]
|
|
176
|
+
: [dateSelected];
|
|
177
|
+
}
|
|
178
|
+
this.focusedDate = new Date(dateSelected);
|
|
179
|
+
this.afOnDateSelectedChange.emit(this.selectedDates);
|
|
180
|
+
}
|
|
181
|
+
getMonthName(monthNumber) {
|
|
182
|
+
return new Date(1992, monthNumber, 1)
|
|
183
|
+
.toLocaleDateString('default', {
|
|
184
|
+
month: 'short'
|
|
185
|
+
})
|
|
186
|
+
.replace('.', '');
|
|
187
|
+
}
|
|
188
|
+
getFullMonthName(monthNumber) {
|
|
189
|
+
return new Date(this.focusedDate.getFullYear(), monthNumber, 1).toLocaleDateString('default', {
|
|
190
|
+
month: 'long',
|
|
191
|
+
year: 'numeric'
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
// Get the week number of a specific date. Taken from https://weeknumber.com/how-to/javascript
|
|
195
|
+
getWeekNumbers(dateInput) {
|
|
196
|
+
const date = new Date(dateInput);
|
|
197
|
+
date.getTime();
|
|
198
|
+
date.setHours(0, 0, 0, 0);
|
|
199
|
+
date.setDate(date.getDate() + 3 - ((date.getDay() + 6) % 7));
|
|
200
|
+
const week1 = new Date(date.getFullYear(), 0, 4);
|
|
201
|
+
return (1 +
|
|
202
|
+
Math.round(((date.getTime() - week1.getTime()) / 86400000 -
|
|
203
|
+
3 +
|
|
204
|
+
((week1.getDay() + 6) % 7)) /
|
|
205
|
+
7));
|
|
206
|
+
}
|
|
207
|
+
isSameMonth(date, currentDate) {
|
|
208
|
+
if (date instanceof Date && date instanceof Date) {
|
|
209
|
+
return (`${date.getFullYear()}${date.getMonth()}` ===
|
|
210
|
+
`${currentDate.getFullYear()}${currentDate.getMonth()}`);
|
|
211
|
+
}
|
|
212
|
+
return false;
|
|
213
|
+
}
|
|
214
|
+
isSameDate(date, newDate) {
|
|
215
|
+
return this.getDateString(date) === this.getDateString(newDate);
|
|
216
|
+
}
|
|
217
|
+
getDateString(date) {
|
|
218
|
+
return `${date.getDate()}${date.getMonth()}${date.getFullYear()}`;
|
|
219
|
+
}
|
|
220
|
+
isDateSelected(date) {
|
|
221
|
+
return !!this.selectedDates.find((d) => this.isSameDate(date, d));
|
|
222
|
+
}
|
|
223
|
+
isDateSelectable(date) {
|
|
224
|
+
if (this.afMinDate && this.isBefore(date, this.afMinDate))
|
|
225
|
+
return false;
|
|
226
|
+
if (this.afMaxDate && this.isAfter(date, this.afMaxDate))
|
|
227
|
+
return false;
|
|
228
|
+
return true;
|
|
229
|
+
}
|
|
230
|
+
isBefore(a, b) {
|
|
231
|
+
return isBefore(this.dateWithoutTime(a), this.dateWithoutTime(b));
|
|
232
|
+
}
|
|
233
|
+
isAfter(a, b) {
|
|
234
|
+
return isAfter(this.dateWithoutTime(a), this.dateWithoutTime(b));
|
|
235
|
+
}
|
|
236
|
+
dateWithoutTime(date) {
|
|
237
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
238
|
+
}
|
|
239
|
+
isInAnotherMonth(date) {
|
|
240
|
+
return !this.isSameMonth(date, this.focusedDate);
|
|
241
|
+
}
|
|
242
|
+
subtractMonth() {
|
|
243
|
+
const month = new Date(this.focusedDate);
|
|
244
|
+
const currentDay = month.getDate();
|
|
245
|
+
month.setMonth(month.getMonth() - 1, 1);
|
|
246
|
+
const lastDayOfPrevMonth = new Date(month.getFullYear(), month.getMonth() + 1, 0).getDate();
|
|
247
|
+
month.setDate(Math.min(currentDay, lastDayOfPrevMonth));
|
|
248
|
+
this.afInitSelectedMonth = month.getMonth();
|
|
249
|
+
this.focusedDate = month;
|
|
250
|
+
}
|
|
251
|
+
addMonth() {
|
|
252
|
+
const month = new Date(this.focusedDate);
|
|
253
|
+
const currentDay = month.getDate();
|
|
254
|
+
month.setMonth(month.getMonth() + 1, 1);
|
|
255
|
+
const lastDayOfNextMonth = new Date(month.getFullYear(), month.getMonth() + 1, 0).getDate();
|
|
256
|
+
month.setDate(Math.min(currentDay, lastDayOfNextMonth));
|
|
257
|
+
this.afInitSelectedMonth = month.getMonth();
|
|
258
|
+
this.focusedDate = month;
|
|
259
|
+
}
|
|
260
|
+
getCurrent(date) {
|
|
261
|
+
return this.isSameDate(date, new Date()) ? 'date' : null;
|
|
262
|
+
}
|
|
263
|
+
setTabIndex(date) {
|
|
264
|
+
if (this.dirty) {
|
|
265
|
+
return this.isSameDate(date, this.focusedDate) ? 0 : -1;
|
|
266
|
+
}
|
|
267
|
+
else {
|
|
268
|
+
return this.isSameMonth(date, new Date())
|
|
269
|
+
? this.isSameDate(date, new Date()) && !this.isInAnotherMonth(date)
|
|
270
|
+
? 0
|
|
271
|
+
: -1
|
|
272
|
+
: this.isSameMonth(date, this.focusedDate) && date.getDate() === 1
|
|
273
|
+
? 0
|
|
274
|
+
: -1;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
navigateHandler(e, daysToAdd) {
|
|
278
|
+
!!e.detail && e.detail.preventDefault();
|
|
279
|
+
if (e.detail.key === 'Tab') {
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
this.onDirty();
|
|
283
|
+
const date = new Date(e.detail.target.dataset.date);
|
|
284
|
+
const newDate = new Date(date.setDate(date.getDate() + daysToAdd));
|
|
285
|
+
this.focusedDate = newDate;
|
|
286
|
+
this.afInitSelectedMonth = this.focusedDate.getMonth();
|
|
287
|
+
this.resetFocus();
|
|
288
|
+
}
|
|
289
|
+
shiftTabHandler() {
|
|
290
|
+
this.afYearSelect
|
|
291
|
+
? this._yearSelectInputElement.focus()
|
|
292
|
+
: this._nextButton.focus();
|
|
293
|
+
}
|
|
294
|
+
resetFocus() {
|
|
295
|
+
setTimeout(() => {
|
|
296
|
+
const dates = this._tbody.querySelectorAll('.digi-calendar__date');
|
|
297
|
+
if (dates.length <= 0) {
|
|
298
|
+
logger.warn(`Could not find an element with data-date attribute matching navigated date.`, this._tbody);
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
Array.from(dates).map((date) => {
|
|
302
|
+
const d = date;
|
|
303
|
+
d.tabIndex = -1;
|
|
304
|
+
d.classList.remove('digi-calendar__date--focused');
|
|
305
|
+
if (d.dataset.date === this.getFullDate(this.focusedDate)) {
|
|
306
|
+
d.focus();
|
|
307
|
+
d.tabIndex = 0;
|
|
308
|
+
d.classList.add('digi-calendar__date--focused');
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
}, 100);
|
|
312
|
+
}
|
|
313
|
+
getFullDate(date) {
|
|
314
|
+
return date.toLocaleString(_t.locale, {
|
|
315
|
+
day: 'numeric',
|
|
316
|
+
month: 'numeric',
|
|
317
|
+
year: 'numeric'
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
getDateName(date) {
|
|
321
|
+
return date.toLocaleString(_t.locale, {
|
|
322
|
+
year: 'numeric',
|
|
323
|
+
month: 'long',
|
|
324
|
+
day: 'numeric'
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
setFocused(date) {
|
|
328
|
+
if (this.dirty) {
|
|
329
|
+
return this.isSameDate(date, this.focusedDate);
|
|
330
|
+
}
|
|
331
|
+
else {
|
|
332
|
+
return this.isSameMonth(date, new Date())
|
|
333
|
+
? this.isSameDate(date, new Date()) && !this.isInAnotherMonth(date)
|
|
334
|
+
: this.isSameMonth(date, this.focusedDate) && date.getDate() === 1;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
ariaPressed(date) {
|
|
338
|
+
return this.selectedDates.length > 0 &&
|
|
339
|
+
!!this.selectedDates.find((d) => this.isSameDate(d, date))
|
|
340
|
+
? 'true'
|
|
341
|
+
: 'false';
|
|
342
|
+
}
|
|
343
|
+
selectMonth(evt) {
|
|
344
|
+
const tempDate = new Date(this.focusedDate);
|
|
345
|
+
const selectedMonth = parseInt(evt.target.value, 10);
|
|
346
|
+
const currentDay = tempDate.getDate();
|
|
347
|
+
tempDate.setMonth(selectedMonth, 1);
|
|
348
|
+
const lastDayOfSelectedMonth = new Date(tempDate.getFullYear(), selectedMonth + 1, 0).getDate();
|
|
349
|
+
tempDate.setDate(Math.min(currentDay, lastDayOfSelectedMonth));
|
|
350
|
+
this.afInitSelectedMonth = selectedMonth;
|
|
351
|
+
this.focusedDate = tempDate;
|
|
352
|
+
this.drawCalendar(this.focusedDate);
|
|
353
|
+
}
|
|
354
|
+
selectYear(evt) {
|
|
355
|
+
const tempDate = this.focusedDate;
|
|
356
|
+
tempDate.setFullYear(evt.target.value);
|
|
357
|
+
this.afInitSelectedDate = evt.target.value;
|
|
358
|
+
this.focusedDate = tempDate;
|
|
359
|
+
this.drawCalendar(this.focusedDate);
|
|
360
|
+
}
|
|
361
|
+
earliestSelectableYear() {
|
|
362
|
+
if (this.afMinDate)
|
|
363
|
+
return this.afMinDate.getFullYear();
|
|
364
|
+
return 1900;
|
|
365
|
+
}
|
|
366
|
+
latestSelectableYear() {
|
|
367
|
+
if (this.afMaxDate)
|
|
368
|
+
return this.afMaxDate.getFullYear();
|
|
369
|
+
return new Date(Date.now()).getFullYear() + 10;
|
|
370
|
+
}
|
|
371
|
+
allSelectableYears() {
|
|
372
|
+
const allYears = [];
|
|
373
|
+
let currentYear = this.earliestSelectableYear();
|
|
374
|
+
while (currentYear <= this.latestSelectableYear()) {
|
|
375
|
+
allYears.push(currentYear++);
|
|
376
|
+
}
|
|
377
|
+
return allYears;
|
|
378
|
+
}
|
|
379
|
+
componentWillLoad() {
|
|
380
|
+
if (this.afInitSelectedDate) {
|
|
381
|
+
this.afInitSelectedMonth = this.afInitSelectedDate.getMonth();
|
|
382
|
+
this.focusedDate = this.afInitSelectedDate;
|
|
383
|
+
this.drawCalendar(this.afInitSelectedDate);
|
|
384
|
+
}
|
|
385
|
+
else {
|
|
386
|
+
const startSelectedMonth = new Date(new Date().getFullYear(), this.afInitSelectedMonth);
|
|
387
|
+
this.focusedDate = startSelectedMonth;
|
|
388
|
+
this.drawCalendar(startSelectedMonth);
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
componentWillUpdate() {
|
|
392
|
+
this.drawCalendar(this.focusedDate);
|
|
393
|
+
}
|
|
394
|
+
async componentDidLoad() {
|
|
395
|
+
var _a;
|
|
396
|
+
if (isValid(this.afSelectedDate))
|
|
397
|
+
this.selectedDates = [this.afSelectedDate];
|
|
398
|
+
else
|
|
399
|
+
this.afSelectedDatesChangeHandler();
|
|
400
|
+
await customElements.whenDefined('digi-form-select');
|
|
401
|
+
if (this.afYearSelect)
|
|
402
|
+
this._yearSelectInputElement =
|
|
403
|
+
await ((_a = this === null || this === void 0 ? void 0 : this._yearSelect) === null || _a === void 0 ? void 0 : _a.afMGetFormControlElement());
|
|
404
|
+
}
|
|
405
|
+
cssDateModifiers(date) {
|
|
406
|
+
const shownMonth = this.focusedDate.getMonth();
|
|
407
|
+
return {
|
|
408
|
+
'digi-calendar__date--today': this.isSameDate(date, new Date()) && !this.isInAnotherMonth(date),
|
|
409
|
+
'digi-calendar__date--disabled': this.isInAnotherMonth(date),
|
|
410
|
+
'digi-calendar__date--focused': this.setFocused(date),
|
|
411
|
+
'digi-calendar__date--selected': this.isDateSelected(date) && date.getMonth() === shownMonth,
|
|
412
|
+
'digi-calendar__date--not-selectable': !this.isInAnotherMonth(date) && !this.isDateSelectable(date)
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
render() {
|
|
416
|
+
return (h("div", { key: 'dd8d041a34c874f43bc399f96c508dc170eddfc3', class: {
|
|
417
|
+
'digi-calendar': true,
|
|
418
|
+
'digi-calendar--hide': !this.afActive
|
|
419
|
+
}, id: `${this.afId}-calendar` }, this.afYearSelect && (h("div", { key: 'c53f38e0aef3675fa7b97e2dcb32a1bc9c19abd3', class: "digi-calendar__header" }, h("div", { key: '244d99b0652bfb7ad5c585078ab2af91548fa579', class: "digi-calendar__header--year-select" }, h("digi-form-select", { key: '765feb5cb8269d57bbdf1a400a3a3f3e01ca0413', afLabel: "M\u00E5nad", "af-variation": "small", afValue: this.focusedDate.getMonth().toString(), onAfOnSelect: (evt) => {
|
|
420
|
+
this.selectMonth(evt);
|
|
421
|
+
} }, this.months.map((month, index) => {
|
|
422
|
+
return h("option", { value: index }, month);
|
|
423
|
+
})), h("digi-form-select", { key: 'fe3960bc47e7a5ae27a4c1bef1a9f1b0bb56a9a8', afLabel: "\u00C5r", "af-variation": "small", afValue: this.focusedDate.getFullYear().toString(), onAfOnSelect: (evt) => {
|
|
424
|
+
this.selectYear(evt);
|
|
425
|
+
}, ref: (el) => (this._yearSelect = el) }, this.allSelectableYears().map((year) => (h("option", { value: year.toString() }, year))))))), !this.afYearSelect && (h("div", { key: 'e5fc63f78caf20e86e7c34264389aba72f69a802', class: "digi-calendar__header" }, h("div", { key: '1f4c4a04c7697efdf94ee01079eb4f86ba550374', class: "digi-calendar__header--month-step" }, h("button", { key: 'fd036825cd957402bef9433d9c0e4145ac5e39d8', class: "digi-calendar__month-select-button", type: "button", "aria-label": this.getFullMonthName(this.afInitSelectedMonth - 1) +
|
|
426
|
+
', föregående månad', onClick: () => this.subtractMonth() }, h("digi-icon-chevron-left", { key: 'bb77e1335ffd12d9e56839cbfcbe1a685f884eb2', slot: "icon", "aria-hidden": "true" }), h("span", { key: '3ca7e44aeb5c5183091b07cbb19ecd6af69ec91f', class: "digi-calendar__month-select-name" }, this.getMonthName(this.afInitSelectedMonth - 1))), h("div", { key: 'c885c4c385ee57d3c8d4dc71db03c3556e3d3ec6', class: "digi-calendar__month" }, this.getFullMonthName(this.afInitSelectedMonth)), h("button", { key: 'fc31cd40cef9e10764b93d25e54e45dd83fad5ae', class: "digi-calendar__month-select-button", type: "button", "aria-label": this.getFullMonthName(this.afInitSelectedMonth + 1) +
|
|
427
|
+
', nästa månad', onClick: () => this.addMonth(), ref: (el) => (this._nextButton = el) }, h("span", { key: 'ae0f70e300888630aee53b6d63ce5dbc29766292', class: "digi-calendar__month-select-name" }, this.getMonthName(this.afInitSelectedMonth + 1)), h("digi-icon-chevron-right", { key: '46af22c36d21f41969b06415e00aaf565d14c448', slot: "icon", "aria-hidden": "true" }))))), h("digi-util-keydown-handler", { key: '88aab0d648cc5b1dfb926275dad5eb0934185f2d', onAfOnDown: (e) => this.navigateHandler(e, 7), onAfOnUp: (e) => this.navigateHandler(e, -7), onAfOnLeft: (e) => this.navigateHandler(e, -1), onAfOnRight: (e) => this.navigateHandler(e, 1), onAfOnShiftTab: () => this.shiftTabHandler() }, h("table", { key: 'f55d1cc3c923bb1f39d1fc30f1e600b815521cab', role: "grid", class: "digi-calendar__table" }, h("thead", { key: 'e2b2c774fe7b1031a8aa587bc9927ab9fc5d7313' }, h("tr", { key: 'cd0770091bd86a269a29bbaa440f83c9eda7e273', role: "row" }, this.afShowWeekNumber && (h("th", { key: '0e11243cf38ea7d7ef3bfb87aab6f3641198d37c', role: "columnheader", abbr: _t.calendar.week, class: "digi-calendar__table-header-week" }, _t.calendar.week.toLowerCase())), Object.keys(_t.calendar.weekdays).map((day) => (h("th", { role: "columnheader", "aria-label": _t.calendar.weekdays[day], abbr: _t.calendar.weekdays[day], class: "digi-calendar__table-header" }, _t.calendar.weekdays_short[day].toLowerCase()))))), h("tbody", { key: 'af971b06248a9571260ec27f18472ef12c1de994', ref: (el) => (this._tbody = el) }, this.activeCalendar.map((week) => {
|
|
428
|
+
return (h("tr", null, week.map((day, i) => {
|
|
429
|
+
if (this.afShowWeekNumber && i === 0) {
|
|
430
|
+
return (h("th", { role: "rowheader", "aria-label": _t.calendar.week + ' ' + day, class: "digi-calendar__td-week digi-calendar__date--week-number", id: 'digi-calendar__week-' + day }, day));
|
|
431
|
+
}
|
|
432
|
+
else {
|
|
433
|
+
return this.isInAnotherMonth(day) ? (h("td", null)) : (h("td", { role: "gridcell", class: "digi-calendar__td" }, h("button", { key: this.getFullDate(day), type: "button", class: Object.assign(Object.assign({}, this.cssDateModifiers(day)), { 'digi-calendar__date': true }), onClick: () => this.selectDateHandler(day), "aria-current": this.isSameDate(day, new Date()) ? 'date' : null, "aria-label": `
|
|
434
|
+
${!this.isDateSelectable(day)
|
|
435
|
+
? _t.calendar.disabledDate
|
|
436
|
+
: ''} ${this.getDateName(day)}
|
|
437
|
+
`, "aria-disabled": !this.isDateSelectable(day) ? 'true' : null, tabindex: this.setTabIndex(day), "data-date": this.getFullDate(day), "aria-pressed": this.isDateSelectable(day)
|
|
438
|
+
? this.ariaPressed(day)
|
|
439
|
+
: null }, h("span", { "aria-hidden": "true" }, day.getDate()))));
|
|
440
|
+
}
|
|
441
|
+
})));
|
|
442
|
+
})))), h("slot", { key: '1d51fd6cf7c43cc0770b8e96692b8e3aa738acdf', name: "calendar-footer" })));
|
|
443
|
+
}
|
|
444
|
+
static get watchers() { return {
|
|
445
|
+
"afSelectedDate": ["afSelectedDateChangeHandler"],
|
|
446
|
+
"afSelectedDates": ["afSelectedDatesChangeHandler"]
|
|
447
|
+
}; }
|
|
448
|
+
};
|
|
449
|
+
Calendar.style = DigiCalendarStyle0;
|
|
450
|
+
|
|
451
|
+
const iconCalendarAltCss = ".sc-digi-icon-calendar-alt-h{--digi--icon--color:var(--digi--color--icon--primary);--digi--icon--width:initial;--digi--icon--height:auto;display:flex;min-height:1.4em;align-items:center}.sc-digi-icon-calendar-alt-h svg.sc-digi-icon-calendar-alt{color:var(--digi--icon--color);max-width:var(--digi--icon--width);max-height:var(--digi--icon--height);width:var(--digi--icon--width, auto);height:var(--digi--icon--height, auto)}";
|
|
452
|
+
const DigiIconCalendarAltStyle0 = iconCalendarAltCss;
|
|
453
|
+
|
|
454
|
+
const IconCalendarAlt = class {
|
|
455
|
+
constructor(hostRef) {
|
|
456
|
+
registerInstance(this, hostRef);
|
|
457
|
+
this.afTitle = undefined;
|
|
458
|
+
this.afDesc = undefined;
|
|
459
|
+
this.afSvgAriaHidden = true;
|
|
460
|
+
this.afSvgAriaLabelledby = undefined;
|
|
461
|
+
this.titleId = randomIdGenerator('icontitle');
|
|
462
|
+
}
|
|
463
|
+
render() {
|
|
464
|
+
return (h("svg", { key: '85ca4c57713e98799bbcf554a98d446a26c66601', class: "digi-icon-calendar-alt", width: "22", height: "26", viewBox: "0 0 22 26", "aria-hidden": this.afSvgAriaHidden ? 'true' : 'false', "aria-labelledby": this.afSvgAriaLabelledby
|
|
465
|
+
? this.afSvgAriaLabelledby
|
|
466
|
+
: this.afTitle
|
|
467
|
+
? this.titleId
|
|
468
|
+
: undefined, xmlns: "http://www.w3.org/2000/svg" }, this.afTitle && h("title", { key: 'f60681387210c607c10525b3a734e6ee9f332934', id: this.titleId }, this.afTitle), this.afDesc && h("desc", { key: '815e9187f7b608ca1c645f40fcb209d92d02dbe2' }, this.afDesc), h("path", { key: '580861f52fcd05336ada9918962980320cd37c24', class: "digi-icon-calendar-alt__shape", d: "M21.41 8.125H.59a.601.601 0 01-.59-.61V5.689C0 4.341 1.056 3.25 2.357 3.25h2.357V.61c0-.336.265-.61.59-.61h1.964c.324 0 .59.274.59.61v2.64h6.285V.61c0-.336.265-.61.59-.61h1.963c.325 0 .59.274.59.61v2.64h2.357C20.944 3.25 22 4.342 22 5.688v1.828c0 .335-.265.609-.59.609zM.59 9.75h20.82c.325 0 .59.274.59.61v13.203C22 24.907 20.944 26 19.643 26H2.357C1.056 26 0 24.908 0 23.562V10.36c0-.335.265-.609.59-.609zm5.696 10.36a.601.601 0 00-.59-.61H3.732a.601.601 0 00-.59.61v2.03c0 .336.266.61.59.61h1.964c.325 0 .59-.274.59-.61v-2.03zm0-6.5a.601.601 0 00-.59-.61H3.732a.601.601 0 00-.59.61v2.03c0 .336.266.61.59.61h1.964c.325 0 .59-.274.59-.61v-2.03zm6.285 6.5a.601.601 0 00-.589-.61h-1.964a.601.601 0 00-.59.61v2.03c0 .336.266.61.59.61h1.964c.324 0 .59-.274.59-.61v-2.03zm0-6.5a.601.601 0 00-.589-.61h-1.964a.601.601 0 00-.59.61v2.03c0 .336.266.61.59.61h1.964c.324 0 .59-.274.59-.61v-2.03zm6.286 6.5a.601.601 0 00-.59-.61h-1.963a.601.601 0 00-.59.61v2.03c0 .336.265.61.59.61h1.964c.324 0 .59-.274.59-.61v-2.03zm0-6.5a.601.601 0 00-.59-.61h-1.963a.601.601 0 00-.59.61v2.03c0 .336.265.61.59.61h1.964c.324 0 .59-.274.59-.61v-2.03z", fill: "currentColor", "fill-rule": "nonzero" })));
|
|
469
|
+
}
|
|
470
|
+
};
|
|
471
|
+
IconCalendarAlt.style = DigiIconCalendarAltStyle0;
|
|
472
|
+
|
|
473
|
+
export { Calendar as digi_calendar, IconCalendarAlt as digi_icon_calendar_alt };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { r as registerInstance, h, c as createEvent, g as getElement } from './index-bfea2cc5.js';
|
|
2
2
|
import { C as CodeBlockVariation } from './code-example-variation.enum-e9f9fced.js';
|
|
3
|
-
import { a as CodeBlockLanguage,
|
|
3
|
+
import { a as CodeBlockLanguage, g as FormRadiobuttonVariation, e as FormRadiobuttonLayout, f as FormRadiobuttonValidation } from './typography-variation.enum-0f0f74d5.js';
|
|
4
4
|
import { P as Prism } from './prism-git-92a0d5cd.js';
|
|
5
5
|
import './badge-notification-shape.enum-e15a6245.js';
|
|
6
6
|
import './badge-status-variation.enum-8d6370ff.js';
|
|
7
7
|
import { B as ButtonSize } from './button-size.enum-d5ff6ff3.js';
|
|
8
|
-
import './
|
|
8
|
+
import './form-input-variation.enum-b78808ba.js';
|
|
9
9
|
import { B as ButtonVariation } from './button-variation.enum-94fffdd6.js';
|
|
10
10
|
import './calendar-week-view-heading-level.enum-6774297c.js';
|
|
11
11
|
import './bar-chart-variation.enum-97c0b47f.js';
|
|
@@ -15,9 +15,10 @@ import './expandable-faq-item-variation.enum-a8cb225b.js';
|
|
|
15
15
|
import './expandable-faq-variation.enum-6934c367.js';
|
|
16
16
|
import './footer-card-variation.enum-cc732148.js';
|
|
17
17
|
import './form-checkbox-variation.enum-83e906fc.js';
|
|
18
|
-
import './form-
|
|
19
|
-
import './form-
|
|
18
|
+
import './form-file-upload-variation.enum-9c49ec5e.js';
|
|
19
|
+
import './form-select-variation.enum-f2f6098d.js';
|
|
20
20
|
import './form-textarea-variation.enum-05017e8e.js';
|
|
21
|
+
import './form-validation-message-variation.enum-bcef8a9d.js';
|
|
21
22
|
import './info-card-multi-type.enum-07ee124f.js';
|
|
22
23
|
import './info-card-variation.enum-2ccc52c1.js';
|
|
23
24
|
import './layout-container-max-width.enum-c40018ac.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-bfea2cc5.js';
|
|
2
|
-
import { c as DialogVariation, b as DialogSize, D as DialogHeadingLevel } from './typography-variation.enum-
|
|
2
|
+
import { c as DialogVariation, b as DialogSize, D as DialogHeadingLevel } from './typography-variation.enum-0f0f74d5.js';
|
|
3
3
|
import { r as randomIdGenerator } from './randomIdGenerator.util-56406f2e.js';
|
|
4
4
|
import './badge-notification-shape.enum-e15a6245.js';
|
|
5
5
|
import './badge-status-variation.enum-8d6370ff.js';
|
|
6
6
|
import { B as ButtonSize } from './button-size.enum-d5ff6ff3.js';
|
|
7
|
-
import './
|
|
7
|
+
import './form-input-variation.enum-b78808ba.js';
|
|
8
8
|
import { B as ButtonVariation } from './button-variation.enum-94fffdd6.js';
|
|
9
9
|
import './calendar-week-view-heading-level.enum-6774297c.js';
|
|
10
10
|
import './bar-chart-variation.enum-97c0b47f.js';
|
|
@@ -15,9 +15,10 @@ import './expandable-faq-item-variation.enum-a8cb225b.js';
|
|
|
15
15
|
import './expandable-faq-variation.enum-6934c367.js';
|
|
16
16
|
import './footer-card-variation.enum-cc732148.js';
|
|
17
17
|
import './form-checkbox-variation.enum-83e906fc.js';
|
|
18
|
-
import './form-
|
|
19
|
-
import './form-
|
|
18
|
+
import './form-file-upload-variation.enum-9c49ec5e.js';
|
|
19
|
+
import './form-select-variation.enum-f2f6098d.js';
|
|
20
20
|
import './form-textarea-variation.enum-05017e8e.js';
|
|
21
|
+
import './form-validation-message-variation.enum-bcef8a9d.js';
|
|
21
22
|
import './info-card-multi-type.enum-07ee124f.js';
|
|
22
23
|
import './info-card-variation.enum-2ccc52c1.js';
|
|
23
24
|
import './layout-container-max-width.enum-c40018ac.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, g as getElement } from './index-bfea2cc5.js';
|
|
2
|
-
import { F as FooterVariation } from './typography-variation.enum-
|
|
2
|
+
import { F as FooterVariation } from './typography-variation.enum-0f0f74d5.js';
|
|
3
3
|
import './badge-notification-shape.enum-e15a6245.js';
|
|
4
4
|
import './badge-status-variation.enum-8d6370ff.js';
|
|
5
5
|
import './button-size.enum-d5ff6ff3.js';
|
|
6
|
-
import './
|
|
6
|
+
import './form-input-variation.enum-b78808ba.js';
|
|
7
7
|
import './button-variation.enum-94fffdd6.js';
|
|
8
8
|
import './calendar-week-view-heading-level.enum-6774297c.js';
|
|
9
9
|
import './bar-chart-variation.enum-97c0b47f.js';
|
|
@@ -14,9 +14,10 @@ import './expandable-faq-item-variation.enum-a8cb225b.js';
|
|
|
14
14
|
import './expandable-faq-variation.enum-6934c367.js';
|
|
15
15
|
import './footer-card-variation.enum-cc732148.js';
|
|
16
16
|
import './form-checkbox-variation.enum-83e906fc.js';
|
|
17
|
-
import './form-
|
|
18
|
-
import './form-
|
|
17
|
+
import './form-file-upload-variation.enum-9c49ec5e.js';
|
|
18
|
+
import './form-select-variation.enum-f2f6098d.js';
|
|
19
19
|
import './form-textarea-variation.enum-05017e8e.js';
|
|
20
|
+
import './form-validation-message-variation.enum-bcef8a9d.js';
|
|
20
21
|
import './info-card-multi-type.enum-07ee124f.js';
|
|
21
22
|
import './info-card-variation.enum-2ccc52c1.js';
|
|
22
23
|
import './layout-container-max-width.enum-c40018ac.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-bfea2cc5.js';
|
|
2
2
|
import { r as randomIdGenerator } from './randomIdGenerator.util-56406f2e.js';
|
|
3
|
-
import { d as FormErrorListHeadingLevel,
|
|
3
|
+
import { d as FormErrorListHeadingLevel, p as NotificationAlertVariation, s as TypographyVariation } from './typography-variation.enum-0f0f74d5.js';
|
|
4
4
|
import { l as logger } from './logger.util-ede3c48a.js';
|
|
5
5
|
import './badge-notification-shape.enum-e15a6245.js';
|
|
6
6
|
import './badge-status-variation.enum-8d6370ff.js';
|
|
7
7
|
import './button-size.enum-d5ff6ff3.js';
|
|
8
|
-
import './
|
|
8
|
+
import './form-input-variation.enum-b78808ba.js';
|
|
9
9
|
import './button-variation.enum-94fffdd6.js';
|
|
10
10
|
import './calendar-week-view-heading-level.enum-6774297c.js';
|
|
11
11
|
import './bar-chart-variation.enum-97c0b47f.js';
|
|
@@ -16,9 +16,10 @@ import './expandable-faq-item-variation.enum-a8cb225b.js';
|
|
|
16
16
|
import './expandable-faq-variation.enum-6934c367.js';
|
|
17
17
|
import './footer-card-variation.enum-cc732148.js';
|
|
18
18
|
import './form-checkbox-variation.enum-83e906fc.js';
|
|
19
|
-
import './form-
|
|
20
|
-
import './form-
|
|
19
|
+
import './form-file-upload-variation.enum-9c49ec5e.js';
|
|
20
|
+
import './form-select-variation.enum-f2f6098d.js';
|
|
21
21
|
import './form-textarea-variation.enum-05017e8e.js';
|
|
22
|
+
import './form-validation-message-variation.enum-bcef8a9d.js';
|
|
22
23
|
import './info-card-multi-type.enum-07ee124f.js';
|
|
23
24
|
import './info-card-variation.enum-2ccc52c1.js';
|
|
24
25
|
import './layout-container-max-width.enum-c40018ac.js';
|