@designsystem-se/af 37.0.2-beta.0 → 37.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/digi-bar-chart.js +1 -1
- package/components/digi-button.js +1 -1
- package/components/digi-calendar-datepicker.js +4 -4
- package/components/digi-calendar-week-view.js +1 -1
- package/components/digi-calendar.js +1 -1
- package/components/digi-chart-line.js +1 -1
- package/components/digi-code-block.js +1 -1
- package/components/digi-code-example.js +4 -4
- package/components/digi-context-menu.js +1 -1
- package/components/digi-dialog.js +3 -3
- package/components/digi-expandable-faq-item.js +1 -1
- package/components/digi-footer.js +1 -1
- package/components/digi-form-category-filter.js +1 -1
- package/components/digi-form-checkbox.js +1 -1
- package/components/digi-form-error-list.js +3 -3
- package/components/digi-form-file-upload.js +1 -1
- package/components/digi-form-filter.js +2 -2
- package/components/digi-form-input-search.js +1 -1
- package/components/digi-form-radiobutton.js +1 -1
- package/components/digi-form-radiogroup.js +1 -1
- package/components/digi-form-receipt.js +1 -1
- package/components/digi-form-select-filter.js +3 -3
- package/components/digi-form-select.js +1 -1
- package/components/digi-header-avatar.js +1 -1
- package/components/digi-header-navigation.js +2 -2
- package/components/digi-header.js +3 -3
- package/components/digi-info-card.js +2 -2
- package/components/digi-link-internal.js +1 -1
- package/components/digi-logo.js +1 -1
- package/components/digi-navigation-pagination.js +2 -2
- package/components/digi-navigation-sidebar-button.js +1 -1
- package/components/digi-navigation-sidebar.js +1 -1
- package/components/digi-navigation-vertical-menu-item.js +1 -1
- package/components/digi-notification-alert.js +1 -1
- package/components/digi-notification-error-page.js +1 -1
- package/components/digi-progress-indicator.js +1 -1
- package/components/digi-quote.js +1 -1
- package/components/digi-tag.js +1 -1
- package/components/digi-title-logo.js +1 -1
- package/components/digi-tools-feedback.js +3 -3
- package/components/digi-tools-theme-provider.js +5 -18
- package/components/index.js +1 -1
- package/components/{p-a79e144f.js → p-2ac136a0.js} +1 -1
- package/components/{p-7d3fb535.js → p-44f143ea.js} +2 -2
- package/components/p-4bad4fb0.js +7 -0
- package/components/{p-e756fda7.js → p-62a0008b.js} +2 -2
- package/components/{p-29f63312.js → p-7ff04204.js} +2 -2
- package/components/p-8bdc6d6b.js +157 -0
- package/components/{p-117e7b18.js → p-9466c4e0.js} +1 -1
- package/components/p-9dd1da8c.js +177 -0
- package/components/p-b57677c1.js +66 -0
- package/components/p-e8fc33ed.js +165 -0
- package/components/{p-d2a95a3e.js → p-f53eb01a.js} +1 -1
- package/custom-elements.json +0 -4
- package/dist/cjs/button-size.enum-1fd86b9e.js +7 -0
- package/dist/cjs/button-type.enum-406723db.js +8 -0
- package/dist/cjs/{code-example-variation.enum-1611825e.js → code-example-variation.enum-c6557727.js} +0 -6
- package/dist/cjs/digi-arbetsformedlingen.cjs.js +1 -1
- package/dist/cjs/digi-button_2.cjs.entry.js +262 -0
- package/dist/cjs/digi-calendar-datepicker.cjs.entry.js +2603 -0
- package/dist/cjs/digi-calendar-week-view.cjs.entry.js +51 -50
- package/dist/cjs/digi-calendar_2.cjs.entry.js +464 -0
- package/dist/cjs/digi-code-block_3.cjs.entry.js +244 -0
- package/dist/cjs/digi-code-example.cjs.entry.js +5 -4
- package/dist/cjs/digi-dialog.cjs.entry.js +20 -6
- package/dist/cjs/digi-expandable-faq-item.cjs.entry.js +97 -0
- package/dist/cjs/digi-footer.cjs.entry.js +18 -4
- package/dist/cjs/digi-form-category-filter.cjs.entry.js +121 -0
- package/dist/cjs/digi-form-error-list.cjs.entry.js +18 -4
- package/dist/cjs/digi-form-file-upload.cjs.entry.js +11 -10
- package/dist/cjs/digi-form-input-search.cjs.entry.js +8 -6
- package/dist/cjs/digi-form-input.cjs.entry.js +194 -0
- package/dist/cjs/digi-form-label_3.cjs.entry.js +129 -0
- package/dist/cjs/digi-form-radiogroup.cjs.entry.js +80 -0
- package/dist/cjs/digi-form-receipt.cjs.entry.js +18 -4
- package/dist/cjs/digi-form-select-filter.cjs.entry.js +568 -0
- package/dist/cjs/digi-form-select_2.cjs.entry.js +186 -0
- package/dist/cjs/digi-header-avatar.cjs.entry.js +1 -1
- package/dist/cjs/digi-header-navigation.cjs.entry.js +18 -4
- package/dist/cjs/digi-header.cjs.entry.js +19 -5
- package/dist/cjs/digi-icon-check.cjs.entry.js +30 -0
- package/dist/cjs/digi-icon-chevron-down.cjs.entry.js +30 -0
- package/dist/cjs/digi-icon-chevron-left_2.cjs.entry.js +53 -0
- package/dist/cjs/digi-icon-copy.cjs.entry.js +30 -0
- package/dist/cjs/digi-icon-minus_2.cjs.entry.js +53 -0
- package/dist/cjs/digi-icon-validation-error_2.cjs.entry.js +53 -0
- package/dist/cjs/digi-info-card.cjs.entry.js +1 -1
- package/dist/cjs/digi-layout-block_2.cjs.entry.js +92 -0
- package/dist/cjs/digi-link-internal.cjs.entry.js +1 -1
- package/dist/cjs/digi-link.cjs.entry.js +75 -0
- package/dist/cjs/digi-navigation-pagination.cjs.entry.js +18 -4
- package/dist/cjs/digi-navigation-vertical-menu-item.cjs.entry.js +150 -0
- package/dist/cjs/digi-navigation-vertical-menu.cjs.entry.js +177 -0
- package/dist/cjs/digi-notification-alert.cjs.entry.js +18 -4
- package/dist/cjs/digi-notification-error-page.cjs.entry.js +18 -4
- package/dist/cjs/digi-progress-indicator.cjs.entry.js +137 -0
- package/dist/cjs/digi-quote.cjs.entry.js +1 -1
- package/dist/cjs/digi-title-logo.cjs.entry.js +18 -4
- package/dist/cjs/digi-tools-feedback.cjs.entry.js +21 -7
- package/dist/cjs/digi-tools-theme-provider.cjs.entry.js +28 -0
- package/dist/cjs/digi-typography-heading-jumbo.cjs.entry.js +38 -0
- package/dist/cjs/digi-typography-preamble.cjs.entry.js +20 -0
- package/dist/cjs/digi-typography.cjs.entry.js +26 -0
- 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/expandable-faq-item-variation.enum-89427195.js +18 -0
- package/dist/cjs/form-checkbox-variation.enum-d2ca879e.js +19 -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-search-variation.enum-c50239bc.js +8 -0
- package/dist/cjs/{form-input-type.enum-1fb2180a.js → form-input-type.enum-9c8ee12a.js} +0 -14
- package/dist/cjs/form-input-variation.enum-c750520c.js +29 -0
- package/dist/cjs/form-radiogroup-validation.enum-03a17d4d.js +9 -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-7a477838.js +108 -4
- 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 +166 -158
- package/dist/cjs/layout-container-max-width.enum-7e637f44.js +21 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/navigation-vertical-menu-variation.enum-c237edd3.js +13 -0
- package/dist/cjs/progress-indicator-variation.enum-7cf8e0e4.js +13 -0
- package/dist/cjs/tools-theme-provider.brand.enum-bc855272.js +7 -0
- package/dist/cjs/typography-heading-jumbo-variation.enum-8677e099.js +17 -0
- package/dist/cjs/{typography-variation.enum-e41bd69d.js → typography-variation.enum-50512a4e.js} +0 -158
- package/dist/collection/components/_button/button/button.css +6 -6
- package/dist/collection/components/_calendar/calendar/calendar.css +2 -7
- package/dist/collection/components/_calendar/calendar-datepicker/calendar-datepicker.css +102 -347
- package/dist/collection/components/_code/code-example/code-example.css +0 -6
- package/dist/collection/components/_dialog/dialog/dialog.css +1 -1
- package/dist/collection/components/_expandable/expandable-faq-item/expandable-faq-item.css +2 -2
- package/dist/collection/components/_form/form-checkbox/form-checkbox.css +110 -355
- package/dist/collection/components/_form/form-checkbox/form-checkbox.js +23 -3
- package/dist/collection/components/_form/form-file-upload/form-file-upload.css +3 -4
- package/dist/collection/components/_form/form-radiobutton/form-radiobutton.css +7 -2
- package/dist/collection/components/_form/form-radiobutton/form-radiobutton.js +23 -3
- package/dist/collection/components/_form/form-radiogroup/form-radiogroup.css +4 -0
- package/dist/collection/components/_form/form-select/form-select.css +2 -2
- package/dist/collection/components/_form/form-select-filter/form-select-filter.css +1 -1
- package/dist/collection/components/_header/header-avatar/header-avatar.css +101 -346
- package/dist/collection/components/_info-card/info-card/info-card.css +2 -2
- package/dist/collection/components/_link/link-internal/link-internal.css +101 -346
- package/dist/collection/components/_navigation/navigation-vertical-menu-item/navigation-vertical-menu-item.css +3 -3
- package/dist/collection/components/_progress/progress-indicator/progress-indicator.css +3 -4
- package/dist/collection/components/_quote/quote/quote.css +2 -2
- package/dist/collection/components/_tools/tools-feedback/tools-feedback.css +1 -1
- package/dist/collection/components/_tools/tools-theme-provider/tools-theme-provider.css +2 -113
- package/dist/collection/components/_tools/tools-theme-provider/tools-theme-provider.js +2 -43
- package/dist/collection/design-tokens/components/_button.variables.scss +6 -6
- package/dist/collection/design-tokens/components/_calendar-datepicker.variables.scss +1 -1
- package/dist/collection/design-tokens/components/_calendar.variables.scss +2 -3
- package/dist/collection/design-tokens/components/_dialog.variables.scss +1 -1
- package/dist/collection/design-tokens/components/_expandable-faq-item.variables.scss +2 -2
- package/dist/collection/design-tokens/components/_form-checkbox.variables.scss +1 -1
- package/dist/collection/design-tokens/components/_form-file-upload.variables.scss +0 -2
- package/dist/collection/design-tokens/components/_form-select-filter.variables.scss +1 -1
- package/dist/collection/design-tokens/components/_form-select.variables.scss +2 -2
- package/dist/collection/design-tokens/components/_info-card.variables.scss +2 -2
- package/dist/collection/design-tokens/components/_navigation-vertical-menu-item.variables.scss +3 -3
- package/dist/collection/design-tokens/components/_quote.variables.scss +2 -2
- package/dist/collection/design-tokens/components/_tools-feedback.variables.scss +1 -1
- package/dist/collection/enums.js +0 -1
- package/dist/collection/styles/src/_alias.mixin.scss +128 -274
- package/dist/collection/styles/src/themes/_common.mixin.scss +0 -7
- package/dist/collection/styles/src/themes/_theme-af25.mixin.scss +0 -143
- package/dist/collection/styles/src/tokens-documentation/web-AF25.json +764 -1647
- package/dist/digi-arbetsformedlingen/design-tokens/components/_button.variables.scss +6 -6
- package/dist/digi-arbetsformedlingen/design-tokens/components/_calendar-datepicker.variables.scss +1 -1
- package/dist/digi-arbetsformedlingen/design-tokens/components/_calendar.variables.scss +2 -3
- package/dist/digi-arbetsformedlingen/design-tokens/components/_dialog.variables.scss +1 -1
- package/dist/digi-arbetsformedlingen/design-tokens/components/_expandable-faq-item.variables.scss +2 -2
- package/dist/digi-arbetsformedlingen/design-tokens/components/_form-checkbox.variables.scss +1 -1
- package/dist/digi-arbetsformedlingen/design-tokens/components/_form-file-upload.variables.scss +0 -2
- package/dist/digi-arbetsformedlingen/design-tokens/components/_form-select-filter.variables.scss +1 -1
- package/dist/digi-arbetsformedlingen/design-tokens/components/_form-select.variables.scss +2 -2
- package/dist/digi-arbetsformedlingen/design-tokens/components/_info-card.variables.scss +2 -2
- package/dist/digi-arbetsformedlingen/design-tokens/components/_navigation-vertical-menu-item.variables.scss +3 -3
- package/dist/digi-arbetsformedlingen/design-tokens/components/_quote.variables.scss +2 -2
- package/dist/digi-arbetsformedlingen/design-tokens/components/_tools-feedback.variables.scss +1 -1
- package/dist/digi-arbetsformedlingen/digi-arbetsformedlingen.css +1 -1
- package/dist/digi-arbetsformedlingen/digi-arbetsformedlingen.esm.js +1 -1
- package/dist/digi-arbetsformedlingen/index.esm.js +1 -1
- package/dist/digi-arbetsformedlingen/p-00219e81.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-07985aef.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-19c30198.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-1f3345e9.js +1 -0
- package/dist/digi-arbetsformedlingen/p-1f956af8.js +1 -0
- package/dist/digi-arbetsformedlingen/p-24fe2189.js +1 -0
- package/dist/digi-arbetsformedlingen/p-260620fe.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-2693c1d8.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-2698dd2a.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-2a86cc73.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-2b7b69cd.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-300aa9ef.js +1 -0
- package/dist/digi-arbetsformedlingen/p-33349e7e.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-38627816.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-3a76bfde.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-3b20ec86.js +1 -0
- package/dist/digi-arbetsformedlingen/p-3d7fff3c.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-41bc039f.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-4bad4fb0.js +1 -0
- package/dist/digi-arbetsformedlingen/p-4e36c467.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-51149879.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-55f525dd.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-57319a80.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-57a0cc63.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-5a602122.js +1 -0
- package/dist/digi-arbetsformedlingen/p-5d3383f9.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-681e7beb.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-6bd60ab6.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-6d864e79.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-75309c9a.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-78c99e87.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-8142cc73.js +1 -0
- package/dist/digi-arbetsformedlingen/p-826ad49e.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-88b4d03a.js +1 -0
- package/dist/digi-arbetsformedlingen/p-89b457e8.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-905ccb30.js +1 -0
- package/dist/digi-arbetsformedlingen/p-93766b5e.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-95330112.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-96987381.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-9a6ea3b7.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-9b7f0707.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-9dd5d6c8.js +1 -0
- package/dist/digi-arbetsformedlingen/p-a34dfc04.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-bc3d2778.js +1 -0
- package/dist/digi-arbetsformedlingen/p-c24aab43.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-c29ab968.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-c461917d.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-c7949525.js +1 -0
- package/dist/digi-arbetsformedlingen/p-cd50f570.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-cdf86efc.js +1 -0
- package/dist/digi-arbetsformedlingen/p-d055d564.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-d1886fff.js +1 -0
- package/dist/digi-arbetsformedlingen/p-d4145a3e.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-d5376b7c.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-d7aa8315.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-dc9b6144.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-e6b65415.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-e7e39ee7.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-e844d4cc.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-e9abb2b1.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-ee4cb21a.js +1 -0
- package/dist/digi-arbetsformedlingen/p-ee9589e6.js +1 -0
- package/dist/digi-arbetsformedlingen/p-f40f4b2a.js +1 -0
- package/dist/digi-arbetsformedlingen/p-f447b984.js +1 -0
- package/dist/digi-arbetsformedlingen/p-f8391f37.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-fdecd798.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/styles/src/_alias.mixin.scss +128 -274
- package/dist/digi-arbetsformedlingen/styles/src/themes/_common.mixin.scss +0 -7
- package/dist/digi-arbetsformedlingen/styles/src/themes/_theme-af25.mixin.scss +0 -143
- package/dist/digi-arbetsformedlingen/styles/src/tokens-documentation/web-AF25.json +764 -1647
- package/dist/esm/button-size.enum-d5ff6ff3.js +7 -0
- package/dist/esm/button-type.enum-5250ae0b.js +8 -0
- package/dist/esm/{code-example-variation.enum-e656d235.js → code-example-variation.enum-e9f9fced.js} +1 -7
- package/dist/esm/digi-arbetsformedlingen.js +1 -1
- package/dist/esm/digi-button_2.entry.js +257 -0
- package/dist/esm/digi-calendar-datepicker.entry.js +2599 -0
- package/dist/esm/digi-calendar-week-view.entry.js +2 -1
- package/dist/esm/digi-calendar_2.entry.js +459 -0
- package/dist/esm/digi-code-block_3.entry.js +238 -0
- package/dist/esm/digi-code-example.entry.js +3 -2
- package/dist/esm/digi-dialog.entry.js +19 -5
- package/dist/esm/digi-expandable-faq-item.entry.js +93 -0
- package/dist/esm/digi-footer.entry.js +18 -4
- package/dist/esm/digi-form-category-filter.entry.js +117 -0
- package/dist/esm/digi-form-error-list.entry.js +18 -4
- package/dist/esm/digi-form-file-upload.entry.js +3 -2
- package/dist/esm/digi-form-input-search.entry.js +3 -1
- package/dist/esm/digi-form-input.entry.js +190 -0
- package/dist/esm/digi-form-label_3.entry.js +123 -0
- package/dist/esm/digi-form-radiogroup.entry.js +76 -0
- package/dist/esm/digi-form-receipt.entry.js +18 -4
- package/dist/esm/digi-form-select-filter.entry.js +564 -0
- package/dist/esm/digi-form-select_2.entry.js +181 -0
- package/dist/esm/digi-header-avatar.entry.js +1 -1
- package/dist/esm/digi-header-navigation.entry.js +18 -4
- package/dist/esm/digi-header.entry.js +18 -4
- package/dist/esm/digi-icon-check.entry.js +26 -0
- package/dist/esm/digi-icon-chevron-down.entry.js +26 -0
- package/dist/esm/digi-icon-chevron-left_2.entry.js +48 -0
- package/dist/esm/digi-icon-copy.entry.js +26 -0
- package/dist/esm/digi-icon-minus_2.entry.js +48 -0
- package/dist/esm/digi-icon-validation-error_2.entry.js +48 -0
- package/dist/esm/digi-info-card.entry.js +1 -1
- package/dist/esm/digi-layout-block_2.entry.js +87 -0
- package/dist/esm/digi-link-internal.entry.js +1 -1
- package/dist/esm/digi-link.entry.js +71 -0
- package/dist/esm/digi-navigation-pagination.entry.js +18 -4
- package/dist/esm/digi-navigation-vertical-menu-item.entry.js +146 -0
- package/dist/esm/digi-navigation-vertical-menu.entry.js +173 -0
- package/dist/esm/digi-notification-alert.entry.js +18 -4
- package/dist/esm/digi-notification-error-page.entry.js +18 -4
- package/dist/esm/digi-progress-indicator.entry.js +133 -0
- package/dist/esm/digi-quote.entry.js +1 -1
- package/dist/esm/digi-title-logo.entry.js +18 -4
- package/dist/esm/digi-tools-feedback.entry.js +19 -5
- package/dist/esm/digi-tools-theme-provider.entry.js +24 -0
- package/dist/esm/digi-typography-heading-jumbo.entry.js +34 -0
- package/dist/esm/digi-typography-preamble.entry.js +16 -0
- package/dist/esm/digi-typography.entry.js +22 -0
- 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/expandable-faq-item-variation.enum-a8cb225b.js +18 -0
- package/dist/esm/form-checkbox-variation.enum-83e906fc.js +19 -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-search-variation.enum-f9d669f2.js +8 -0
- package/dist/esm/{form-input-type.enum-a6bba983.js → form-input-type.enum-3da3db27.js} +1 -15
- package/dist/esm/form-input-variation.enum-64d9450f.js +29 -0
- package/dist/esm/form-radiogroup-validation.enum-d790fc66.js +9 -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-148a7577.js +108 -4
- 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.js +18 -4
- package/dist/esm/layout-container-max-width.enum-c40018ac.js +21 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/navigation-vertical-menu-variation.enum-c30b0ea9.js +13 -0
- package/dist/esm/progress-indicator-variation.enum-b12ba50a.js +13 -0
- package/dist/esm/tools-theme-provider.brand.enum-8c5a98c9.js +7 -0
- package/dist/esm/typography-heading-jumbo-variation.enum-eb737f1b.js +17 -0
- package/dist/esm/{typography-variation.enum-b07f76c9.js → typography-variation.enum-8c3ff25c.js} +1 -159
- package/dist/types/components/_form/form-checkbox/form-checkbox.d.ts +8 -0
- package/dist/types/components/_form/form-radiobutton/form-radiobutton.d.ts +8 -0
- package/dist/types/components/_tools/tools-theme-provider/tools-theme-provider.d.ts +0 -9
- package/dist/types/components.d.ts +0 -12
- package/dist/types/enums.d.ts +0 -1
- package/hydrate/index.js +57 -48
- package/hydrate/index.mjs +57 -48
- package/package.json +1 -1
- package/components/p-0d568c4b.js +0 -66
- package/components/p-5fd00d55.js +0 -143
- package/components/p-606ba731.js +0 -165
- package/components/p-d7ef9cb1.js +0 -13
- package/components/p-f77cb7ae.js +0 -163
- package/dist/cjs/digi-button_38.cjs.entry.js +0 -5759
- package/dist/cjs/digi-code-block.cjs.entry.js +0 -89
- package/dist/collection/components/_tools/tools-theme-provider/tools-theme-provider.theme.enum.js +0 -5
- package/dist/digi-arbetsformedlingen/p-0f543000.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-13120f18.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-180663ef.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-1a619dd3.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-26e8ea70.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-3887bb40.js +0 -1
- package/dist/digi-arbetsformedlingen/p-52a3c86a.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-53d9556b.js +0 -1
- package/dist/digi-arbetsformedlingen/p-54d9bd3e.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-5ca38506.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-64b65586.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-67e32cc2.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-76ec3619.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-780519ec.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-800b764b.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-82225661.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-920aee36.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-9b6e8cf8.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-a105d9fe.js +0 -1
- package/dist/digi-arbetsformedlingen/p-c64b4626.js +0 -1
- package/dist/digi-arbetsformedlingen/p-d9bcab5f.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-e540b80f.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-e5fee242.js +0 -1
- package/dist/digi-arbetsformedlingen/p-e7ee9bea.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-f601908d.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-fa44ce49.entry.js +0 -1
- package/dist/esm/digi-button_38.entry.js +0 -5718
- package/dist/esm/digi-code-block.entry.js +0 -85
- package/dist/types/components/_tools/tools-theme-provider/tools-theme-provider.theme.enum.d.ts +0 -4
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const index = require('./index-e8333bcc.js');
|
|
4
|
+
|
|
3
5
|
function toInteger(dirtyNumber) {
|
|
4
6
|
if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
|
|
5
7
|
return NaN;
|
|
@@ -14,64 +16,6 @@ function toInteger(dirtyNumber) {
|
|
|
14
16
|
return number < 0 ? Math.ceil(number) : Math.floor(number);
|
|
15
17
|
}
|
|
16
18
|
|
|
17
|
-
function requiredArgs(required, args) {
|
|
18
|
-
if (args.length < required) {
|
|
19
|
-
throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* @name toDate
|
|
25
|
-
* @category Common Helpers
|
|
26
|
-
* @summary Convert the given argument to an instance of Date.
|
|
27
|
-
*
|
|
28
|
-
* @description
|
|
29
|
-
* Convert the given argument to an instance of Date.
|
|
30
|
-
*
|
|
31
|
-
* If the argument is an instance of Date, the function returns its clone.
|
|
32
|
-
*
|
|
33
|
-
* If the argument is a number, it is treated as a timestamp.
|
|
34
|
-
*
|
|
35
|
-
* If the argument is none of the above, the function returns Invalid Date.
|
|
36
|
-
*
|
|
37
|
-
* **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
|
|
38
|
-
*
|
|
39
|
-
* @param {Date|Number} argument - the value to convert
|
|
40
|
-
* @returns {Date} the parsed date in the local time zone
|
|
41
|
-
* @throws {TypeError} 1 argument required
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* // Clone the date:
|
|
45
|
-
* const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
|
|
46
|
-
* //=> Tue Feb 11 2014 11:30:30
|
|
47
|
-
*
|
|
48
|
-
* @example
|
|
49
|
-
* // Convert the timestamp to date:
|
|
50
|
-
* const result = toDate(1392098430000)
|
|
51
|
-
* //=> Tue Feb 11 2014 11:30:30
|
|
52
|
-
*/
|
|
53
|
-
|
|
54
|
-
function toDate(argument) {
|
|
55
|
-
requiredArgs(1, arguments);
|
|
56
|
-
var argStr = Object.prototype.toString.call(argument); // Clone the date
|
|
57
|
-
|
|
58
|
-
if (argument instanceof Date || typeof argument === 'object' && argStr === '[object Date]') {
|
|
59
|
-
// Prevent the date to lose the milliseconds when passed to new Date() in IE10
|
|
60
|
-
return new Date(argument.getTime());
|
|
61
|
-
} else if (typeof argument === 'number' || argStr === '[object Number]') {
|
|
62
|
-
return new Date(argument);
|
|
63
|
-
} else {
|
|
64
|
-
if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
|
|
65
|
-
// eslint-disable-next-line no-console
|
|
66
|
-
console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"); // eslint-disable-next-line no-console
|
|
67
|
-
|
|
68
|
-
console.warn(new Error().stack);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return new Date(NaN);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
19
|
/**
|
|
76
20
|
* @name addMilliseconds
|
|
77
21
|
* @category Millisecond Helpers
|
|
@@ -96,8 +40,8 @@ function toDate(argument) {
|
|
|
96
40
|
*/
|
|
97
41
|
|
|
98
42
|
function addMilliseconds(dirtyDate, dirtyAmount) {
|
|
99
|
-
requiredArgs(2, arguments);
|
|
100
|
-
var timestamp = toDate(dirtyDate).getTime();
|
|
43
|
+
index.requiredArgs(2, arguments);
|
|
44
|
+
var timestamp = index.toDate(dirtyDate).getTime();
|
|
101
45
|
var amount = toInteger(dirtyAmount);
|
|
102
46
|
return new Date(timestamp + amount);
|
|
103
47
|
}
|
|
@@ -119,117 +63,6 @@ function getTimezoneOffsetInMilliseconds(date) {
|
|
|
119
63
|
return date.getTime() - utcDate.getTime();
|
|
120
64
|
}
|
|
121
65
|
|
|
122
|
-
/**
|
|
123
|
-
* @name isDate
|
|
124
|
-
* @category Common Helpers
|
|
125
|
-
* @summary Is the given value a date?
|
|
126
|
-
*
|
|
127
|
-
* @description
|
|
128
|
-
* Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
|
|
129
|
-
*
|
|
130
|
-
* ### v2.0.0 breaking changes:
|
|
131
|
-
*
|
|
132
|
-
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
|
|
133
|
-
*
|
|
134
|
-
* @param {*} value - the value to check
|
|
135
|
-
* @returns {boolean} true if the given value is a date
|
|
136
|
-
* @throws {TypeError} 1 arguments required
|
|
137
|
-
*
|
|
138
|
-
* @example
|
|
139
|
-
* // For a valid date:
|
|
140
|
-
* const result = isDate(new Date())
|
|
141
|
-
* //=> true
|
|
142
|
-
*
|
|
143
|
-
* @example
|
|
144
|
-
* // For an invalid date:
|
|
145
|
-
* const result = isDate(new Date(NaN))
|
|
146
|
-
* //=> true
|
|
147
|
-
*
|
|
148
|
-
* @example
|
|
149
|
-
* // For some value:
|
|
150
|
-
* const result = isDate('2014-02-31')
|
|
151
|
-
* //=> false
|
|
152
|
-
*
|
|
153
|
-
* @example
|
|
154
|
-
* // For an object:
|
|
155
|
-
* const result = isDate({})
|
|
156
|
-
* //=> false
|
|
157
|
-
*/
|
|
158
|
-
|
|
159
|
-
function isDate(value) {
|
|
160
|
-
requiredArgs(1, arguments);
|
|
161
|
-
return value instanceof Date || typeof value === 'object' && Object.prototype.toString.call(value) === '[object Date]';
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* @name isValid
|
|
166
|
-
* @category Common Helpers
|
|
167
|
-
* @summary Is the given date valid?
|
|
168
|
-
*
|
|
169
|
-
* @description
|
|
170
|
-
* Returns false if argument is Invalid Date and true otherwise.
|
|
171
|
-
* Argument is converted to Date using `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}
|
|
172
|
-
* Invalid Date is a Date, whose time value is NaN.
|
|
173
|
-
*
|
|
174
|
-
* Time value of Date: http://es5.github.io/#x15.9.1.1
|
|
175
|
-
*
|
|
176
|
-
* ### v2.0.0 breaking changes:
|
|
177
|
-
*
|
|
178
|
-
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
|
|
179
|
-
*
|
|
180
|
-
* - Now `isValid` doesn't throw an exception
|
|
181
|
-
* if the first argument is not an instance of Date.
|
|
182
|
-
* Instead, argument is converted beforehand using `toDate`.
|
|
183
|
-
*
|
|
184
|
-
* Examples:
|
|
185
|
-
*
|
|
186
|
-
* | `isValid` argument | Before v2.0.0 | v2.0.0 onward |
|
|
187
|
-
* |---------------------------|---------------|---------------|
|
|
188
|
-
* | `new Date()` | `true` | `true` |
|
|
189
|
-
* | `new Date('2016-01-01')` | `true` | `true` |
|
|
190
|
-
* | `new Date('')` | `false` | `false` |
|
|
191
|
-
* | `new Date(1488370835081)` | `true` | `true` |
|
|
192
|
-
* | `new Date(NaN)` | `false` | `false` |
|
|
193
|
-
* | `'2016-01-01'` | `TypeError` | `false` |
|
|
194
|
-
* | `''` | `TypeError` | `false` |
|
|
195
|
-
* | `1488370835081` | `TypeError` | `true` |
|
|
196
|
-
* | `NaN` | `TypeError` | `false` |
|
|
197
|
-
*
|
|
198
|
-
* We introduce this change to make *date-fns* consistent with ECMAScript behavior
|
|
199
|
-
* that try to coerce arguments to the expected type
|
|
200
|
-
* (which is also the case with other *date-fns* functions).
|
|
201
|
-
*
|
|
202
|
-
* @param {*} date - the date to check
|
|
203
|
-
* @returns {Boolean} the date is valid
|
|
204
|
-
* @throws {TypeError} 1 argument required
|
|
205
|
-
*
|
|
206
|
-
* @example
|
|
207
|
-
* // For the valid date:
|
|
208
|
-
* const result = isValid(new Date(2014, 1, 31))
|
|
209
|
-
* //=> true
|
|
210
|
-
*
|
|
211
|
-
* @example
|
|
212
|
-
* // For the value, convertable into a date:
|
|
213
|
-
* const result = isValid(1393804800000)
|
|
214
|
-
* //=> true
|
|
215
|
-
*
|
|
216
|
-
* @example
|
|
217
|
-
* // For the invalid date:
|
|
218
|
-
* const result = isValid(new Date(''))
|
|
219
|
-
* //=> false
|
|
220
|
-
*/
|
|
221
|
-
|
|
222
|
-
function isValid(dirtyDate) {
|
|
223
|
-
requiredArgs(1, arguments);
|
|
224
|
-
|
|
225
|
-
if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {
|
|
226
|
-
return false;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
var date = toDate(dirtyDate);
|
|
230
|
-
return !isNaN(Number(date));
|
|
231
|
-
}
|
|
232
|
-
|
|
233
66
|
var formatDistanceLocale = {
|
|
234
67
|
lessThanXSeconds: {
|
|
235
68
|
one: 'less than a second',
|
|
@@ -761,7 +594,7 @@ const defaultLocale = locale;
|
|
|
761
594
|
*/
|
|
762
595
|
|
|
763
596
|
function subMilliseconds(dirtyDate, dirtyAmount) {
|
|
764
|
-
requiredArgs(2, arguments);
|
|
597
|
+
index.requiredArgs(2, arguments);
|
|
765
598
|
var amount = toInteger(dirtyAmount);
|
|
766
599
|
return addMilliseconds(dirtyDate, -amount);
|
|
767
600
|
}
|
|
@@ -769,9 +602,9 @@ function subMilliseconds(dirtyDate, dirtyAmount) {
|
|
|
769
602
|
// See issue: https://github.com/date-fns/date-fns/issues/376
|
|
770
603
|
|
|
771
604
|
function startOfUTCISOWeek(dirtyDate) {
|
|
772
|
-
requiredArgs(1, arguments);
|
|
605
|
+
index.requiredArgs(1, arguments);
|
|
773
606
|
var weekStartsOn = 1;
|
|
774
|
-
var date = toDate(dirtyDate);
|
|
607
|
+
var date = index.toDate(dirtyDate);
|
|
775
608
|
var day = date.getUTCDay();
|
|
776
609
|
var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
|
|
777
610
|
date.setUTCDate(date.getUTCDate() - diff);
|
|
@@ -782,8 +615,8 @@ function startOfUTCISOWeek(dirtyDate) {
|
|
|
782
615
|
// See issue: https://github.com/date-fns/date-fns/issues/376
|
|
783
616
|
|
|
784
617
|
function getUTCISOWeekYear(dirtyDate) {
|
|
785
|
-
requiredArgs(1, arguments);
|
|
786
|
-
var date = toDate(dirtyDate);
|
|
618
|
+
index.requiredArgs(1, arguments);
|
|
619
|
+
var date = index.toDate(dirtyDate);
|
|
787
620
|
var year = date.getUTCFullYear();
|
|
788
621
|
var fourthOfJanuaryOfNextYear = new Date(0);
|
|
789
622
|
fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);
|
|
@@ -806,7 +639,7 @@ function getUTCISOWeekYear(dirtyDate) {
|
|
|
806
639
|
// See issue: https://github.com/date-fns/date-fns/issues/376
|
|
807
640
|
|
|
808
641
|
function startOfUTCISOWeekYear(dirtyDate) {
|
|
809
|
-
requiredArgs(1, arguments);
|
|
642
|
+
index.requiredArgs(1, arguments);
|
|
810
643
|
var year = getUTCISOWeekYear(dirtyDate);
|
|
811
644
|
var fourthOfJanuary = new Date(0);
|
|
812
645
|
fourthOfJanuary.setUTCFullYear(year, 0, 4);
|
|
@@ -819,8 +652,8 @@ var MILLISECONDS_IN_WEEK$1 = 604800000; // This function will be a part of publi
|
|
|
819
652
|
// See issue: https://github.com/date-fns/date-fns/issues/376
|
|
820
653
|
|
|
821
654
|
function getUTCISOWeek(dirtyDate) {
|
|
822
|
-
requiredArgs(1, arguments);
|
|
823
|
-
var date = toDate(dirtyDate);
|
|
655
|
+
index.requiredArgs(1, arguments);
|
|
656
|
+
var date = index.toDate(dirtyDate);
|
|
824
657
|
var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // Round the number of days to the nearest integer
|
|
825
658
|
// because the number of milliseconds in a week is not constant
|
|
826
659
|
// (e.g. it's different in the week of the daylight saving time clock shift)
|
|
@@ -831,7 +664,7 @@ function getUTCISOWeek(dirtyDate) {
|
|
|
831
664
|
// See issue: https://github.com/date-fns/date-fns/issues/376
|
|
832
665
|
|
|
833
666
|
function startOfUTCWeek(dirtyDate, dirtyOptions) {
|
|
834
|
-
requiredArgs(1, arguments);
|
|
667
|
+
index.requiredArgs(1, arguments);
|
|
835
668
|
var options = dirtyOptions || {};
|
|
836
669
|
var locale = options.locale;
|
|
837
670
|
var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;
|
|
@@ -842,7 +675,7 @@ function startOfUTCWeek(dirtyDate, dirtyOptions) {
|
|
|
842
675
|
throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
|
|
843
676
|
}
|
|
844
677
|
|
|
845
|
-
var date = toDate(dirtyDate);
|
|
678
|
+
var date = index.toDate(dirtyDate);
|
|
846
679
|
var day = date.getUTCDay();
|
|
847
680
|
var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
|
|
848
681
|
date.setUTCDate(date.getUTCDate() - diff);
|
|
@@ -853,8 +686,8 @@ function startOfUTCWeek(dirtyDate, dirtyOptions) {
|
|
|
853
686
|
// See issue: https://github.com/date-fns/date-fns/issues/376
|
|
854
687
|
|
|
855
688
|
function getUTCWeekYear(dirtyDate, dirtyOptions) {
|
|
856
|
-
requiredArgs(1, arguments);
|
|
857
|
-
var date = toDate(dirtyDate, dirtyOptions);
|
|
689
|
+
index.requiredArgs(1, arguments);
|
|
690
|
+
var date = index.toDate(dirtyDate, dirtyOptions);
|
|
858
691
|
var year = date.getUTCFullYear();
|
|
859
692
|
var options = dirtyOptions || {};
|
|
860
693
|
var locale = options.locale;
|
|
@@ -887,7 +720,7 @@ function getUTCWeekYear(dirtyDate, dirtyOptions) {
|
|
|
887
720
|
// See issue: https://github.com/date-fns/date-fns/issues/376
|
|
888
721
|
|
|
889
722
|
function startOfUTCWeekYear(dirtyDate, dirtyOptions) {
|
|
890
|
-
requiredArgs(1, arguments);
|
|
723
|
+
index.requiredArgs(1, arguments);
|
|
891
724
|
var options = dirtyOptions || {};
|
|
892
725
|
var locale = options.locale;
|
|
893
726
|
var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;
|
|
@@ -905,8 +738,8 @@ var MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public
|
|
|
905
738
|
// See issue: https://github.com/date-fns/date-fns/issues/376
|
|
906
739
|
|
|
907
740
|
function getUTCWeek(dirtyDate, options) {
|
|
908
|
-
requiredArgs(1, arguments);
|
|
909
|
-
var date = toDate(dirtyDate);
|
|
741
|
+
index.requiredArgs(1, arguments);
|
|
742
|
+
var date = index.toDate(dirtyDate);
|
|
910
743
|
var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // Round the number of days to the nearest integer
|
|
911
744
|
// because the number of milliseconds in a week is not constant
|
|
912
745
|
// (e.g. it's different in the week of the daylight saving time clock shift)
|
|
@@ -1043,12 +876,9 @@ exports.getUTCWeek = getUTCWeek;
|
|
|
1043
876
|
exports.getUTCWeekYear = getUTCWeekYear;
|
|
1044
877
|
exports.isProtectedDayOfYearToken = isProtectedDayOfYearToken;
|
|
1045
878
|
exports.isProtectedWeekYearToken = isProtectedWeekYearToken;
|
|
1046
|
-
exports.isValid = isValid;
|
|
1047
879
|
exports.longFormatters = longFormatters$1;
|
|
1048
|
-
exports.requiredArgs = requiredArgs;
|
|
1049
880
|
exports.startOfUTCISOWeek = startOfUTCISOWeek;
|
|
1050
881
|
exports.startOfUTCWeek = startOfUTCWeek;
|
|
1051
882
|
exports.subMilliseconds = subMilliseconds;
|
|
1052
883
|
exports.throwProtectedError = throwProtectedError;
|
|
1053
|
-
exports.toDate = toDate;
|
|
1054
884
|
exports.toInteger = toInteger;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index-e8333bcc.js');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @name isAfter
|
|
7
|
+
* @category Common Helpers
|
|
8
|
+
* @summary Is the first date after the second one?
|
|
9
|
+
*
|
|
10
|
+
* @description
|
|
11
|
+
* Is the first date after the second one?
|
|
12
|
+
*
|
|
13
|
+
* ### v2.0.0 breaking changes:
|
|
14
|
+
*
|
|
15
|
+
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
|
|
16
|
+
*
|
|
17
|
+
* @param {Date|Number} date - the date that should be after the other one to return true
|
|
18
|
+
* @param {Date|Number} dateToCompare - the date to compare with
|
|
19
|
+
* @returns {Boolean} the first date is after the second date
|
|
20
|
+
* @throws {TypeError} 2 arguments required
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* // Is 10 July 1989 after 11 February 1987?
|
|
24
|
+
* var result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11))
|
|
25
|
+
* //=> true
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
function isAfter(dirtyDate, dirtyDateToCompare) {
|
|
29
|
+
index.requiredArgs(2, arguments);
|
|
30
|
+
var date = index.toDate(dirtyDate);
|
|
31
|
+
var dateToCompare = index.toDate(dirtyDateToCompare);
|
|
32
|
+
return date.getTime() > dateToCompare.getTime();
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @name isBefore
|
|
37
|
+
* @category Common Helpers
|
|
38
|
+
* @summary Is the first date before the second one?
|
|
39
|
+
*
|
|
40
|
+
* @description
|
|
41
|
+
* Is the first date before the second one?
|
|
42
|
+
*
|
|
43
|
+
* ### v2.0.0 breaking changes:
|
|
44
|
+
*
|
|
45
|
+
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
|
|
46
|
+
*
|
|
47
|
+
* @param {Date|Number} date - the date that should be before the other one to return true
|
|
48
|
+
* @param {Date|Number} dateToCompare - the date to compare with
|
|
49
|
+
* @returns {Boolean} the first date is before the second date
|
|
50
|
+
* @throws {TypeError} 2 arguments required
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* // Is 10 July 1989 before 11 February 1987?
|
|
54
|
+
* var result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))
|
|
55
|
+
* //=> false
|
|
56
|
+
*/
|
|
57
|
+
|
|
58
|
+
function isBefore(dirtyDate, dirtyDateToCompare) {
|
|
59
|
+
index.requiredArgs(2, arguments);
|
|
60
|
+
var date = index.toDate(dirtyDate);
|
|
61
|
+
var dateToCompare = index.toDate(dirtyDateToCompare);
|
|
62
|
+
return date.getTime() < dateToCompare.getTime();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
exports.isAfter = isAfter;
|
|
66
|
+
exports.isBefore = isBefore;
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function requiredArgs(required, args) {
|
|
4
|
+
if (args.length < required) {
|
|
5
|
+
throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @name toDate
|
|
11
|
+
* @category Common Helpers
|
|
12
|
+
* @summary Convert the given argument to an instance of Date.
|
|
13
|
+
*
|
|
14
|
+
* @description
|
|
15
|
+
* Convert the given argument to an instance of Date.
|
|
16
|
+
*
|
|
17
|
+
* If the argument is an instance of Date, the function returns its clone.
|
|
18
|
+
*
|
|
19
|
+
* If the argument is a number, it is treated as a timestamp.
|
|
20
|
+
*
|
|
21
|
+
* If the argument is none of the above, the function returns Invalid Date.
|
|
22
|
+
*
|
|
23
|
+
* **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
|
|
24
|
+
*
|
|
25
|
+
* @param {Date|Number} argument - the value to convert
|
|
26
|
+
* @returns {Date} the parsed date in the local time zone
|
|
27
|
+
* @throws {TypeError} 1 argument required
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* // Clone the date:
|
|
31
|
+
* const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
|
|
32
|
+
* //=> Tue Feb 11 2014 11:30:30
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* // Convert the timestamp to date:
|
|
36
|
+
* const result = toDate(1392098430000)
|
|
37
|
+
* //=> Tue Feb 11 2014 11:30:30
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
function toDate(argument) {
|
|
41
|
+
requiredArgs(1, arguments);
|
|
42
|
+
var argStr = Object.prototype.toString.call(argument); // Clone the date
|
|
43
|
+
|
|
44
|
+
if (argument instanceof Date || typeof argument === 'object' && argStr === '[object Date]') {
|
|
45
|
+
// Prevent the date to lose the milliseconds when passed to new Date() in IE10
|
|
46
|
+
return new Date(argument.getTime());
|
|
47
|
+
} else if (typeof argument === 'number' || argStr === '[object Number]') {
|
|
48
|
+
return new Date(argument);
|
|
49
|
+
} else {
|
|
50
|
+
if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
|
|
51
|
+
// eslint-disable-next-line no-console
|
|
52
|
+
console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"); // eslint-disable-next-line no-console
|
|
53
|
+
|
|
54
|
+
console.warn(new Error().stack);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return new Date(NaN);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* @name isDate
|
|
63
|
+
* @category Common Helpers
|
|
64
|
+
* @summary Is the given value a date?
|
|
65
|
+
*
|
|
66
|
+
* @description
|
|
67
|
+
* Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
|
|
68
|
+
*
|
|
69
|
+
* ### v2.0.0 breaking changes:
|
|
70
|
+
*
|
|
71
|
+
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
|
|
72
|
+
*
|
|
73
|
+
* @param {*} value - the value to check
|
|
74
|
+
* @returns {boolean} true if the given value is a date
|
|
75
|
+
* @throws {TypeError} 1 arguments required
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* // For a valid date:
|
|
79
|
+
* const result = isDate(new Date())
|
|
80
|
+
* //=> true
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* // For an invalid date:
|
|
84
|
+
* const result = isDate(new Date(NaN))
|
|
85
|
+
* //=> true
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* // For some value:
|
|
89
|
+
* const result = isDate('2014-02-31')
|
|
90
|
+
* //=> false
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* // For an object:
|
|
94
|
+
* const result = isDate({})
|
|
95
|
+
* //=> false
|
|
96
|
+
*/
|
|
97
|
+
|
|
98
|
+
function isDate(value) {
|
|
99
|
+
requiredArgs(1, arguments);
|
|
100
|
+
return value instanceof Date || typeof value === 'object' && Object.prototype.toString.call(value) === '[object Date]';
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* @name isValid
|
|
105
|
+
* @category Common Helpers
|
|
106
|
+
* @summary Is the given date valid?
|
|
107
|
+
*
|
|
108
|
+
* @description
|
|
109
|
+
* Returns false if argument is Invalid Date and true otherwise.
|
|
110
|
+
* Argument is converted to Date using `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}
|
|
111
|
+
* Invalid Date is a Date, whose time value is NaN.
|
|
112
|
+
*
|
|
113
|
+
* Time value of Date: http://es5.github.io/#x15.9.1.1
|
|
114
|
+
*
|
|
115
|
+
* ### v2.0.0 breaking changes:
|
|
116
|
+
*
|
|
117
|
+
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
|
|
118
|
+
*
|
|
119
|
+
* - Now `isValid` doesn't throw an exception
|
|
120
|
+
* if the first argument is not an instance of Date.
|
|
121
|
+
* Instead, argument is converted beforehand using `toDate`.
|
|
122
|
+
*
|
|
123
|
+
* Examples:
|
|
124
|
+
*
|
|
125
|
+
* | `isValid` argument | Before v2.0.0 | v2.0.0 onward |
|
|
126
|
+
* |---------------------------|---------------|---------------|
|
|
127
|
+
* | `new Date()` | `true` | `true` |
|
|
128
|
+
* | `new Date('2016-01-01')` | `true` | `true` |
|
|
129
|
+
* | `new Date('')` | `false` | `false` |
|
|
130
|
+
* | `new Date(1488370835081)` | `true` | `true` |
|
|
131
|
+
* | `new Date(NaN)` | `false` | `false` |
|
|
132
|
+
* | `'2016-01-01'` | `TypeError` | `false` |
|
|
133
|
+
* | `''` | `TypeError` | `false` |
|
|
134
|
+
* | `1488370835081` | `TypeError` | `true` |
|
|
135
|
+
* | `NaN` | `TypeError` | `false` |
|
|
136
|
+
*
|
|
137
|
+
* We introduce this change to make *date-fns* consistent with ECMAScript behavior
|
|
138
|
+
* that try to coerce arguments to the expected type
|
|
139
|
+
* (which is also the case with other *date-fns* functions).
|
|
140
|
+
*
|
|
141
|
+
* @param {*} date - the date to check
|
|
142
|
+
* @returns {Boolean} the date is valid
|
|
143
|
+
* @throws {TypeError} 1 argument required
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* // For the valid date:
|
|
147
|
+
* const result = isValid(new Date(2014, 1, 31))
|
|
148
|
+
* //=> true
|
|
149
|
+
*
|
|
150
|
+
* @example
|
|
151
|
+
* // For the value, convertable into a date:
|
|
152
|
+
* const result = isValid(1393804800000)
|
|
153
|
+
* //=> true
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* // For the invalid date:
|
|
157
|
+
* const result = isValid(new Date(''))
|
|
158
|
+
* //=> false
|
|
159
|
+
*/
|
|
160
|
+
|
|
161
|
+
function isValid(dirtyDate) {
|
|
162
|
+
requiredArgs(1, arguments);
|
|
163
|
+
|
|
164
|
+
if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {
|
|
165
|
+
return false;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
var date = toDate(dirtyDate);
|
|
169
|
+
return !isNaN(Number(date));
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
exports.isValid = isValid;
|
|
173
|
+
exports.requiredArgs = requiredArgs;
|
|
174
|
+
exports.toDate = toDate;
|