@duetds/components 10.5.0 → 10.6.0
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/hydrate/index.js +501 -263
- package/hydrate/index.mjs +501 -263
- package/lib/cjs/{a11y-utils-DaAO4N9d.js → a11y-utils-CgWjS7yq.js} +1 -1
- package/lib/cjs/{app-globals-CHNvdfQj.js → app-globals-D68ciWsb.js} +1 -1
- package/lib/cjs/duet-action-button.cjs.entry.js +6 -6
- package/lib/cjs/duet-alert.cjs.entry.js +4 -4
- package/lib/cjs/duet-badge.cjs.entry.js +7 -7
- package/lib/cjs/duet-banner.cjs.entry.js +15 -16
- package/lib/cjs/duet-breadcrumb.cjs.entry.js +7 -7
- package/lib/cjs/duet-breadcrumbs.cjs.entry.js +7 -7
- package/lib/cjs/duet-button_2.cjs.entry.js +8 -8
- package/lib/cjs/duet-callout.cjs.entry.js +5 -5
- package/lib/cjs/duet-caption_4.cjs.entry.js +11 -11
- package/lib/cjs/duet-card.cjs.entry.js +21 -10
- package/lib/cjs/duet-checkbox.cjs.entry.js +3 -3
- package/lib/cjs/duet-checkmark.cjs.entry.js +4 -4
- package/lib/cjs/duet-chip.cjs.entry.js +28 -12
- package/lib/cjs/duet-choice_2.cjs.entry.js +7 -7
- package/lib/cjs/duet-collapsible.cjs.entry.js +4 -4
- package/lib/cjs/duet-combobox.cjs.entry.js +6 -6
- package/lib/cjs/duet-contact-card.cjs.entry.js +17 -7
- package/lib/cjs/duet-cookie-consent.cjs.entry.js +3 -3
- package/lib/cjs/duet-date-picker.cjs.entry.js +127 -14
- package/lib/cjs/duet-divider_2.cjs.entry.js +5 -5
- package/lib/cjs/duet-editable-table_3.cjs.entry.js +15 -15
- package/lib/cjs/duet-empty-state.cjs.entry.js +2 -2
- package/lib/cjs/duet-fieldset.cjs.entry.js +6 -6
- package/lib/cjs/duet-file-chooser.cjs.entry.js +2 -2
- package/lib/cjs/duet-footer.cjs.entry.js +5 -5
- package/lib/cjs/duet-grid_2.cjs.entry.js +4 -4
- package/lib/cjs/duet-header_2.cjs.entry.js +7 -7
- package/lib/cjs/duet-hero.cjs.entry.js +22 -21
- package/lib/cjs/duet-icon.cjs.entry.js +7 -7
- package/lib/cjs/duet-indicator.cjs.entry.js +5 -5
- package/lib/cjs/duet-input_2.cjs.entry.js +70 -18
- package/lib/cjs/duet-layout.cjs.entry.js +7 -7
- package/lib/cjs/duet-list_2.cjs.entry.js +5 -5
- package/lib/cjs/duet-menu-bar-button.cjs.entry.js +4 -4
- package/lib/cjs/duet-menu-bar-dropdown-link.cjs.entry.js +5 -5
- package/lib/cjs/duet-menu-bar-dropdown.cjs.entry.js +7 -7
- package/lib/cjs/duet-menu-bar-item.cjs.entry.js +7 -7
- package/lib/cjs/duet-menu-bar-link.cjs.entry.js +4 -4
- package/lib/cjs/duet-menu-bar.cjs.entry.js +6 -6
- package/lib/cjs/duet-modal.cjs.entry.js +15 -15
- package/lib/cjs/duet-multiselect.cjs.entry.js +11 -11
- package/lib/cjs/duet-nav.cjs.entry.js +3 -3
- package/lib/cjs/duet-notification_2.cjs.entry.js +10 -10
- package/lib/cjs/duet-number-input.cjs.entry.js +9 -9
- package/lib/cjs/duet-overlay.cjs.entry.js +3 -3
- package/lib/cjs/duet-page-heading.cjs.entry.js +6 -6
- package/lib/cjs/duet-pagination_2.cjs.entry.js +19 -19
- package/lib/cjs/duet-panel.cjs.entry.js +4 -4
- package/lib/cjs/duet-phone-input.cjs.entry.js +11 -6
- package/lib/cjs/duet-popup-menu_2.cjs.entry.js +10 -10
- package/lib/cjs/duet-progress.cjs.entry.js +3 -3
- package/lib/cjs/duet-promo-card.cjs.entry.js +20 -8
- package/lib/cjs/duet-radio_2.cjs.entry.js +7 -7
- package/lib/cjs/duet-range-slider.cjs.entry.js +8 -8
- package/lib/cjs/duet-scrollable_3.cjs.entry.js +18 -18
- package/lib/cjs/duet-section-layout.cjs.entry.js +4 -4
- package/lib/cjs/duet-select.cjs.entry.js +9 -9
- package/lib/cjs/duet-shaped-image.cjs.entry.js +4 -4
- package/lib/cjs/duet-share-chart-item.cjs.entry.js +2 -2
- package/lib/cjs/duet-share-chart.cjs.entry.js +8 -8
- package/lib/cjs/duet-show-more.cjs.entry.js +6 -6
- package/lib/cjs/duet-slideout-lang.cjs.entry.js +4 -4
- package/lib/cjs/duet-slideout-link.cjs.entry.js +7 -7
- package/lib/cjs/duet-slideout-panel-dropdown.cjs.entry.js +6 -6
- package/lib/cjs/duet-slideout-panel.cjs.entry.js +13 -13
- package/lib/cjs/duet-slideout.cjs.entry.js +20 -14
- package/lib/cjs/duet-status-icon.cjs.entry.js +3 -3
- package/lib/cjs/duet-step_2.cjs.entry.js +7 -7
- package/lib/cjs/duet-submenu-bar-dropdown-link.cjs.entry.js +5 -5
- package/lib/cjs/duet-submenu-bar-dropdown.cjs.entry.js +7 -7
- package/lib/cjs/duet-submenu-bar-item.cjs.entry.js +7 -7
- package/lib/cjs/duet-submenu-bar-link.cjs.entry.js +4 -4
- package/lib/cjs/duet-submenu-bar.cjs.entry.js +7 -7
- package/lib/cjs/duet-textarea.cjs.entry.js +8 -8
- package/lib/cjs/duet-toggle.cjs.entry.js +9 -9
- package/lib/cjs/duet-toolbar-dropdown-link.cjs.entry.js +5 -5
- package/lib/cjs/duet-toolbar-dropdown.cjs.entry.js +7 -7
- package/lib/cjs/duet-toolbar-item.cjs.entry.js +8 -8
- package/lib/cjs/duet-toolbar-link.cjs.entry.js +4 -4
- package/lib/cjs/duet-toolbar.cjs.entry.js +4 -4
- package/lib/cjs/duet-tooltip-button_2.cjs.entry.js +10 -10
- package/lib/cjs/duet-tooltip.cjs.entry.js +5 -5
- package/lib/cjs/duet-tray.cjs.entry.js +7 -7
- package/lib/cjs/duet-upload-aria-status.cjs.entry.js +2 -2
- package/lib/cjs/duet-upload-item.cjs.entry.js +6 -6
- package/lib/cjs/duet-visually-hidden.cjs.entry.js +2 -2
- package/lib/cjs/duet.cjs.js +3 -3
- package/lib/cjs/{errorcodes.utils-Dkf_MfrJ.js → errorcodes.utils-C0tQ3k6Z.js} +1 -1
- package/lib/cjs/{focus-utils-BuGg0Oha.js → focus-utils-tCoGOO7d.js} +1 -1
- package/lib/cjs/{index-ZxE6MB5V.js → index-BeiMjjVl.js} +9 -9
- package/lib/cjs/{keyboard-utils-D9UlHbik.js → keyboard-utils-DibQafwg.js} +2 -0
- package/lib/cjs/{label-CpPOBfjS.js → label-Cu4DNShe.js} +1 -1
- package/lib/cjs/{language-utils-C7Z0KYg-.js → language-utils-B3NubUDr.js} +1 -1
- package/lib/cjs/loader.cjs.js +3 -3
- package/lib/cjs/picture-utils-D_HVgfq5.js +15 -0
- package/lib/cjs/{slot-utils-BXdHT3A1.js → slot-utils-Dny6EJ_G.js} +1 -1
- package/lib/cjs/{themeable-component-CIDaln0Z.js → themeable-component-Csdvrnsd.js} +1 -1
- package/lib/cjs/{token-utils-DY3-olMV.js → token-utils-ZISdNshf.js} +1 -1
- package/lib/cjs/{tokens.module-CTbvyezn.js → tokens.module-CGRpZaa1.js} +2 -1
- package/lib/collection/components/duet-action-button/duet-action-button.js +2 -2
- package/lib/collection/components/duet-alert/duet-alert.js +1 -1
- package/lib/collection/components/duet-badge/duet-badge.js +2 -2
- package/lib/collection/components/duet-banner/duet-banner.css +12 -0
- package/lib/collection/components/duet-banner/duet-banner.js +30 -5
- package/lib/collection/components/duet-breadcrumbs/duet-breadcrumb.js +4 -4
- package/lib/collection/components/duet-breadcrumbs/duet-breadcrumbs.js +2 -2
- package/lib/collection/components/duet-button/duet-button.js +8 -8
- package/lib/collection/components/duet-callout/duet-callout.js +2 -2
- package/lib/collection/components/duet-caption/duet-caption.js +1 -1
- package/lib/collection/components/duet-card/duet-card.css +3 -0
- package/lib/collection/components/duet-card/duet-card.js +43 -7
- package/lib/collection/components/duet-checkbox/duet-checkbox.js +3 -3
- package/lib/collection/components/duet-chip/duet-chip.js +53 -17
- package/lib/collection/components/duet-choice/duet-checkmark.js +2 -2
- package/lib/collection/components/duet-choice/duet-choice.js +3 -3
- package/lib/collection/components/duet-choice-group/duet-choice-group.js +2 -2
- package/lib/collection/components/duet-collapsible/duet-collapsible.js +3 -3
- package/lib/collection/components/duet-combobox/duet-combobox.js +3 -3
- package/lib/collection/components/duet-contact-card/duet-contact-card.css +3 -0
- package/lib/collection/components/duet-contact-card/duet-contact-card.js +38 -2
- package/lib/collection/components/duet-cookie-consent/duet-cookie-consent.js +1 -1
- package/lib/collection/components/duet-date-picker/date-picker-month.js +4 -2
- package/lib/collection/components/duet-date-picker/date-utils.js +7 -0
- package/lib/collection/components/duet-date-picker/disallowed-days.js +23 -0
- package/lib/collection/components/duet-date-picker/duet-date-picker.js +100 -10
- package/lib/collection/components/duet-date-picker/finnish-bank-holidays.js +66 -0
- package/lib/collection/components/duet-divider/duet-divider.js +1 -1
- package/lib/collection/components/duet-editable-table/duet-editable-table.js +5 -5
- package/lib/collection/components/duet-empty-state/duet-empty-state.js +3 -3
- package/lib/collection/components/duet-fieldset/duet-fieldset.js +3 -3
- package/lib/collection/components/duet-file-chooser/duet-file-chooser.js +1 -1
- package/lib/collection/components/duet-footer/duet-footer.js +7 -7
- package/lib/collection/components/duet-grid/duet-grid.js +3 -3
- package/lib/collection/components/duet-grid-item/duet-grid-item.js +2 -2
- package/lib/collection/components/duet-header/duet-header.js +15 -15
- package/lib/collection/components/duet-heading/duet-heading.js +1 -1
- package/lib/collection/components/duet-hero/duet-hero.css +92 -14
- package/lib/collection/components/duet-hero/duet-hero.js +47 -21
- package/lib/collection/components/duet-icon/duet-icon.js +3 -3
- package/lib/collection/components/duet-indicator/duet-indicator.js +3 -3
- package/lib/collection/components/duet-input/duet-input.js +73 -20
- package/lib/collection/components/duet-label/duet-label.js +2 -2
- package/lib/collection/components/duet-layout/duet-layout.js +6 -6
- package/lib/collection/components/duet-link/duet-link.js +2 -2
- package/lib/collection/components/duet-list/duet-list.js +4 -4
- package/lib/collection/components/duet-list-item/duet-list-item.js +2 -2
- package/lib/collection/components/duet-logo/duet-logo.js +2 -2
- package/lib/collection/components/duet-menu-bar/duet-menu-bar.js +4 -4
- package/lib/collection/components/duet-menu-bar-button/duet-menu-bar-button.js +2 -2
- package/lib/collection/components/duet-menu-bar-dropdown/duet-menu-bar-dropdown.js +4 -4
- package/lib/collection/components/duet-menu-bar-dropdown-link/duet-menu-bar-dropdown-link.js +2 -2
- package/lib/collection/components/duet-menu-bar-item/duet-menu-bar-item.js +2 -2
- package/lib/collection/components/duet-menu-bar-link/duet-menu-bar-link.js +2 -2
- package/lib/collection/components/duet-modal/duet-modal.js +11 -11
- package/lib/collection/components/duet-multiselect/duet-multiselect.js +11 -11
- package/lib/collection/components/duet-nav/duet-nav.js +1 -1
- package/lib/collection/components/duet-notification/duet-notification.js +2 -2
- package/lib/collection/components/duet-notification-drawer/duet-notification-drawer.js +4 -4
- package/lib/collection/components/duet-number-input/duet-number-input.js +8 -8
- package/lib/collection/components/duet-overlay/duet-overlay.js +2 -2
- package/lib/collection/components/duet-page-heading/duet-page-heading.js +3 -3
- package/lib/collection/components/duet-pagination/duet-pagination.js +13 -13
- package/lib/collection/components/duet-panel/duet-panel.js +3 -3
- package/lib/collection/components/duet-paragraph/duet-paragraph.js +5 -5
- package/lib/collection/components/duet-phone-input/duet-phone-input.js +30 -5
- package/lib/collection/components/duet-popup-menu/duet-popup-menu.js +1 -1
- package/lib/collection/components/duet-popup-menu-item/duet-popup-menu-item.js +4 -4
- package/lib/collection/components/duet-promo-card/duet-promo-card.css +4 -0
- package/lib/collection/components/duet-promo-card/duet-promo-card.js +39 -2
- package/lib/collection/components/duet-radio/duet-radio.js +6 -6
- package/lib/collection/components/duet-radio-group/duet-radio-group.js +1 -1
- package/lib/collection/components/duet-range-slider/duet-range-slider.js +4 -4
- package/lib/collection/components/duet-range-stepper/duet-range-stepper.js +3 -3
- package/lib/collection/components/duet-scrollable/duet-scrollable.js +5 -5
- package/lib/collection/components/duet-section-layout/duet-section-layout.js +3 -3
- package/lib/collection/components/duet-select/duet-select.js +10 -10
- package/lib/collection/components/duet-shaped-image/duet-shaped-image.js +2 -2
- package/lib/collection/components/duet-share-chart/duet-share-chart.js +2 -2
- package/lib/collection/components/duet-share-chart-item/duet-share-chart-item.js +1 -1
- package/lib/collection/components/duet-show-more/duet-show-more.js +3 -3
- package/lib/collection/components/duet-slideout/duet-slideout.js +12 -6
- package/lib/collection/components/duet-slideout-lang/duet-slideout-lang.js +1 -1
- package/lib/collection/components/duet-slideout-link/duet-slideout-link.js +2 -2
- package/lib/collection/components/duet-slideout-panel/duet-slideout-panel.js +6 -6
- package/lib/collection/components/duet-slideout-panel-dropdown/duet-slideout-panel-dropdown.js +4 -4
- package/lib/collection/components/duet-spacer/duet-spacer.js +3 -3
- package/lib/collection/components/duet-spinner/duet-spinner.js +2 -2
- package/lib/collection/components/duet-status-icon/duet-status-icon.js +2 -2
- package/lib/collection/components/duet-step/duet-step.js +4 -4
- package/lib/collection/components/duet-stepper/duet-stepper.js +2 -2
- package/lib/collection/components/duet-submenu-bar/duet-submenu-bar.js +5 -5
- package/lib/collection/components/duet-submenu-bar-dropdown/duet-submenu-bar-dropdown.js +4 -4
- package/lib/collection/components/duet-submenu-bar-dropdown-link/duet-submenu-bar-dropdown-link.js +2 -2
- package/lib/collection/components/duet-submenu-bar-item/duet-submenu-bar-item.js +1 -1
- package/lib/collection/components/duet-submenu-bar-link/duet-submenu-bar-link.js +1 -1
- package/lib/collection/components/duet-tab/duet-tab.js +2 -2
- package/lib/collection/components/duet-tab-group/duet-tab-group.js +9 -9
- package/lib/collection/components/duet-table/duet-table-styles.js +5 -5
- package/lib/collection/components/duet-table/duet-table.js +2 -2
- package/lib/collection/components/duet-textarea/duet-textarea.js +7 -7
- package/lib/collection/components/duet-toggle/duet-toggle.js +4 -4
- package/lib/collection/components/duet-toolbar/duet-toolbar.js +2 -2
- package/lib/collection/components/duet-toolbar-dropdown/duet-toolbar-dropdown.js +4 -4
- package/lib/collection/components/duet-toolbar-dropdown-link/duet-toolbar-dropdown-link.js +2 -2
- package/lib/collection/components/duet-toolbar-item/duet-toolbar-item.js +3 -3
- package/lib/collection/components/duet-toolbar-link/duet-toolbar-link.js +2 -2
- package/lib/collection/components/duet-tooltip/duet-tooltip-button.js +3 -3
- package/lib/collection/components/duet-tooltip/duet-tooltip-popup.js +3 -3
- package/lib/collection/components/duet-tooltip/duet-tooltip.js +1 -1
- package/lib/collection/components/duet-tray/duet-tray.js +2 -2
- package/lib/collection/components/duet-upload/duet-upload.js +16 -16
- package/lib/collection/components/duet-upload-aria-status/duet-upload-aria-status.js +1 -1
- package/lib/collection/components/duet-upload-item/duet-upload-item.js +4 -4
- package/lib/collection/components/duet-visually-hidden/duet-visually-hidden.js +1 -1
- package/lib/collection/utils/keyboard-utils.js +1 -0
- package/lib/duet/duet.esm.js +1 -1
- package/lib/duet/p-054c334d.entry.js +4 -0
- package/lib/duet/{p-3277233e.entry.js → p-0e10e36b.entry.js} +1 -1
- package/lib/duet/{p-9ae7aaef.entry.js → p-12d7fdf6.entry.js} +1 -1
- package/lib/duet/{p-3f7afd87.entry.js → p-1579bdf5.entry.js} +1 -1
- package/lib/duet/{p-7eea47d5.entry.js → p-174935bc.entry.js} +1 -1
- package/lib/duet/{p-42ec7305.entry.js → p-1d7a9425.entry.js} +1 -1
- package/lib/duet/{p-317e81f3.entry.js → p-20066df8.entry.js} +1 -1
- package/lib/duet/{p-3690576a.entry.js → p-20c8226c.entry.js} +1 -1
- package/lib/duet/{p-19863cdf.entry.js → p-210bc161.entry.js} +1 -1
- package/lib/duet/{p-b747f6e9.entry.js → p-244bfbf9.entry.js} +1 -1
- package/lib/duet/{p-38973524.entry.js → p-264688ae.entry.js} +1 -1
- package/lib/duet/{p-93ff8fe4.entry.js → p-2bf78fe4.entry.js} +1 -1
- package/lib/duet/{p-9e1a59d1.entry.js → p-2e44c6b8.entry.js} +1 -1
- package/lib/duet/{p-c1afac0d.entry.js → p-304a9a55.entry.js} +1 -1
- package/lib/duet/{p-516397ba.entry.js → p-30d8a1e4.entry.js} +1 -1
- package/lib/duet/p-3445529c.entry.js +4 -0
- package/lib/duet/{p-2f8a47e2.entry.js → p-3533d6ee.entry.js} +1 -1
- package/lib/duet/{p-fe829b53.entry.js → p-374b48f6.entry.js} +1 -1
- package/lib/duet/{p-7353ee4c.entry.js → p-3b9d7f6a.entry.js} +1 -1
- package/lib/duet/{p-5f5f72d4.entry.js → p-3def9480.entry.js} +1 -1
- package/lib/duet/p-3fbe466a.entry.js +4 -0
- package/lib/duet/{p-d3b5c997.entry.js → p-407d4e5a.entry.js} +1 -1
- package/lib/duet/p-41230630.entry.js +4 -0
- package/lib/duet/p-44e53564.entry.js +4 -0
- package/lib/duet/p-46287d85.entry.js +4 -0
- package/lib/duet/p-48e77341.entry.js +4 -0
- package/lib/duet/{p-a8876b3d.entry.js → p-4a041c60.entry.js} +1 -1
- package/lib/duet/{p-efa4eecc.entry.js → p-4a251661.entry.js} +1 -1
- package/lib/duet/{p-407f7f03.entry.js → p-4a4e5bb5.entry.js} +1 -1
- package/lib/duet/{p-b1326cbb.entry.js → p-4acdc586.entry.js} +1 -1
- package/lib/duet/{p-8ace1eb4.entry.js → p-4b07ce36.entry.js} +1 -1
- package/lib/duet/{p-e7f2359a.entry.js → p-4cee693b.entry.js} +1 -1
- package/lib/duet/{p-3f35fce3.entry.js → p-4e1c2676.entry.js} +1 -1
- package/lib/duet/{p-40fa7371.entry.js → p-4e5532c8.entry.js} +1 -1
- package/lib/duet/{p-7fd39204.entry.js → p-512d18c8.entry.js} +1 -1
- package/lib/duet/{p-6ef683d5.entry.js → p-555e0c78.entry.js} +1 -1
- package/lib/duet/{p-cb6c4158.entry.js → p-5b322a86.entry.js} +1 -1
- package/lib/duet/p-5f72134e.entry.js +4 -0
- package/lib/duet/{p-dedf6a32.entry.js → p-61abccd4.entry.js} +1 -1
- package/lib/duet/{p-443af533.entry.js → p-6a11ba26.entry.js} +1 -1
- package/lib/duet/{p-f040706c.entry.js → p-6bd78205.entry.js} +1 -1
- package/lib/duet/p-6c239923.entry.js +4 -0
- package/lib/duet/{p-bdbf0fae.entry.js → p-6ce82324.entry.js} +1 -1
- package/lib/duet/{p-268b3066.entry.js → p-6d1d1199.entry.js} +1 -1
- package/lib/duet/p-81c5d3e3.entry.js +4 -0
- package/lib/duet/p-829bccb7.entry.js +4 -0
- package/lib/duet/{p-c2026c6b.entry.js → p-83dcbb64.entry.js} +1 -1
- package/lib/duet/{p-461d4089.entry.js → p-84f8bee8.entry.js} +1 -1
- package/lib/duet/{p-d6f0afa5.entry.js → p-8927ccc1.entry.js} +1 -1
- package/lib/duet/{p-3b2fba0f.entry.js → p-8bdcfd1f.entry.js} +1 -1
- package/lib/duet/{p-833802f9.entry.js → p-8fbcea55.entry.js} +1 -1
- package/lib/duet/{p-20a8ef81.entry.js → p-914ee7ac.entry.js} +1 -1
- package/lib/duet/{p-d3baa815.entry.js → p-95bb2a8d.entry.js} +1 -1
- package/lib/duet/{p-cbcee3e2.entry.js → p-985213bb.entry.js} +1 -1
- package/lib/duet/{p-52beb436.entry.js → p-9889218e.entry.js} +1 -1
- package/lib/duet/{p-30108edc.entry.js → p-9b2731b9.entry.js} +1 -1
- package/lib/duet/{p-829db926.entry.js → p-9b448008.entry.js} +1 -1
- package/lib/duet/p-9c41f1d5.entry.js +4 -0
- package/lib/duet/p-BDgGHTHh.js +4 -0
- package/lib/duet/p-BZev46O8.js +4 -0
- package/lib/duet/p-BaefVzkx.js +4 -0
- package/lib/duet/p-CcoGR9T9.js +4 -0
- package/lib/duet/{p-R3pTP2Oy.js → p-CyfEm8iD.js} +1 -1
- package/lib/duet/p-D3450NfA.js +5 -0
- package/lib/duet/{p-CFqvB5PA.js → p-D9N9LBeD.js} +1 -1
- package/lib/duet/{p-C5Yfx2kd.js → p-DI7IXBXp.js} +1 -1
- package/lib/duet/{p-D2ly4TZR.js → p-DYmL1tSl.js} +1 -1
- package/lib/duet/p-Dk60lC7n.js +4 -0
- package/lib/duet/p-JFwTD5kM.js +4 -0
- package/lib/duet/{p-BzYmwX5_.js → p-KbNgo0QF.js} +1 -1
- package/lib/duet/{p-110c7572.entry.js → p-a01f3141.entry.js} +1 -1
- package/lib/duet/{p-43e076b5.entry.js → p-a49b5d93.entry.js} +1 -1
- package/lib/duet/p-a6dbe893.entry.js +4 -0
- package/lib/duet/{p-1da7703d.entry.js → p-aa1256f9.entry.js} +1 -1
- package/lib/duet/{p-a068c086.entry.js → p-aa7e4c81.entry.js} +1 -1
- package/lib/duet/{p-70612314.entry.js → p-ac4fc44c.entry.js} +1 -1
- package/lib/duet/{p-61ec0e1c.entry.js → p-ae382e2e.entry.js} +1 -1
- package/lib/duet/{p-a483117e.entry.js → p-bc41d13d.entry.js} +1 -1
- package/lib/duet/{p-734249e0.entry.js → p-c54ecb23.entry.js} +1 -1
- package/lib/duet/{p-70961edb.entry.js → p-d72dee5d.entry.js} +1 -1
- package/lib/duet/p-d7abb7fa.entry.js +4 -0
- package/lib/duet/{p-8b0dfbd7.entry.js → p-dbb9e1d4.entry.js} +1 -1
- package/lib/duet/{p-317a1fc0.entry.js → p-e40d9c21.entry.js} +1 -1
- package/lib/duet/{p-06297bd8.entry.js → p-e43df9c2.entry.js} +1 -1
- package/lib/duet/{p-02d8e844.entry.js → p-e442943d.entry.js} +1 -1
- package/lib/duet/p-eb7bc989.entry.js +4 -0
- package/lib/duet/{p-a9104184.entry.js → p-ec1d2e0a.entry.js} +1 -1
- package/lib/duet/p-edcdf0b7.entry.js +4 -0
- package/lib/duet/{p-e08dce92.entry.js → p-ee369233.entry.js} +1 -1
- package/lib/duet/{p-8012c7bc.entry.js → p-f297f8f2.entry.js} +1 -1
- package/lib/duet/{p-c54be349.entry.js → p-f30c3cfe.entry.js} +1 -1
- package/lib/duet/{p-a5177d32.entry.js → p-f4538e9d.entry.js} +1 -1
- package/lib/duet/{p-c216e746.entry.js → p-f4de7ac0.entry.js} +1 -1
- package/lib/duet/{p-4b7f1244.entry.js → p-f8d640ba.entry.js} +1 -1
- package/lib/duet/{p-2dd7d75e.entry.js → p-f9db8670.entry.js} +1 -1
- package/lib/duet/p-fc1a18f8.entry.js +4 -0
- package/lib/duet/{p-d779fe42.entry.js → p-fc2be136.entry.js} +1 -1
- package/lib/duet/p-fdc4a97c.entry.js +4 -0
- package/lib/duet/p-kkZE1C6Z.js +4 -0
- package/lib/esm/{a11y-utils-ChN5Nhxh.js → a11y-utils--wwGTL0T.js} +1 -1
- package/lib/esm/{app-globals-4kCk2rkO.js → app-globals-Diuuep9d.js} +1 -1
- package/lib/esm/duet-action-button.entry.js +6 -6
- package/lib/esm/duet-alert.entry.js +4 -4
- package/lib/esm/duet-badge.entry.js +7 -7
- package/lib/esm/duet-banner.entry.js +15 -16
- package/lib/esm/duet-breadcrumb.entry.js +7 -7
- package/lib/esm/duet-breadcrumbs.entry.js +7 -7
- package/lib/esm/duet-button_2.entry.js +8 -8
- package/lib/esm/duet-callout.entry.js +5 -5
- package/lib/esm/duet-caption_4.entry.js +11 -11
- package/lib/esm/duet-card.entry.js +22 -11
- package/lib/esm/duet-checkbox.entry.js +3 -3
- package/lib/esm/duet-checkmark.entry.js +4 -4
- package/lib/esm/duet-chip.entry.js +28 -12
- package/lib/esm/duet-choice_2.entry.js +7 -7
- package/lib/esm/duet-collapsible.entry.js +4 -4
- package/lib/esm/duet-combobox.entry.js +6 -6
- package/lib/esm/duet-contact-card.entry.js +17 -7
- package/lib/esm/duet-cookie-consent.entry.js +3 -3
- package/lib/esm/duet-date-picker.entry.js +127 -14
- package/lib/esm/duet-divider_2.entry.js +5 -5
- package/lib/esm/duet-editable-table_3.entry.js +15 -15
- package/lib/esm/duet-empty-state.entry.js +2 -2
- package/lib/esm/duet-fieldset.entry.js +6 -6
- package/lib/esm/duet-file-chooser.entry.js +2 -2
- package/lib/esm/duet-footer.entry.js +5 -5
- package/lib/esm/duet-grid_2.entry.js +4 -4
- package/lib/esm/duet-header_2.entry.js +7 -7
- package/lib/esm/duet-hero.entry.js +22 -21
- package/lib/esm/duet-icon.entry.js +7 -7
- package/lib/esm/duet-indicator.entry.js +5 -5
- package/lib/esm/duet-input_2.entry.js +70 -18
- package/lib/esm/duet-layout.entry.js +7 -7
- package/lib/esm/duet-list_2.entry.js +5 -5
- package/lib/esm/duet-menu-bar-button.entry.js +4 -4
- package/lib/esm/duet-menu-bar-dropdown-link.entry.js +5 -5
- package/lib/esm/duet-menu-bar-dropdown.entry.js +7 -7
- package/lib/esm/duet-menu-bar-item.entry.js +7 -7
- package/lib/esm/duet-menu-bar-link.entry.js +4 -4
- package/lib/esm/duet-menu-bar.entry.js +6 -6
- package/lib/esm/duet-modal.entry.js +15 -15
- package/lib/esm/duet-multiselect.entry.js +11 -11
- package/lib/esm/duet-nav.entry.js +3 -3
- package/lib/esm/duet-notification_2.entry.js +10 -10
- package/lib/esm/duet-number-input.entry.js +9 -9
- package/lib/esm/duet-overlay.entry.js +3 -3
- package/lib/esm/duet-page-heading.entry.js +6 -6
- package/lib/esm/duet-pagination_2.entry.js +19 -19
- package/lib/esm/duet-panel.entry.js +4 -4
- package/lib/esm/duet-phone-input.entry.js +11 -6
- package/lib/esm/duet-popup-menu_2.entry.js +10 -10
- package/lib/esm/duet-progress.entry.js +3 -3
- package/lib/esm/duet-promo-card.entry.js +20 -8
- package/lib/esm/duet-radio_2.entry.js +7 -7
- package/lib/esm/duet-range-slider.entry.js +8 -8
- package/lib/esm/duet-scrollable_3.entry.js +18 -18
- package/lib/esm/duet-section-layout.entry.js +4 -4
- package/lib/esm/duet-select.entry.js +9 -9
- package/lib/esm/duet-shaped-image.entry.js +4 -4
- package/lib/esm/duet-share-chart-item.entry.js +2 -2
- package/lib/esm/duet-share-chart.entry.js +8 -8
- package/lib/esm/duet-show-more.entry.js +6 -6
- package/lib/esm/duet-slideout-lang.entry.js +4 -4
- package/lib/esm/duet-slideout-link.entry.js +7 -7
- package/lib/esm/duet-slideout-panel-dropdown.entry.js +6 -6
- package/lib/esm/duet-slideout-panel.entry.js +13 -13
- package/lib/esm/duet-slideout.entry.js +20 -14
- package/lib/esm/duet-status-icon.entry.js +3 -3
- package/lib/esm/duet-step_2.entry.js +7 -7
- package/lib/esm/duet-submenu-bar-dropdown-link.entry.js +5 -5
- package/lib/esm/duet-submenu-bar-dropdown.entry.js +7 -7
- package/lib/esm/duet-submenu-bar-item.entry.js +7 -7
- package/lib/esm/duet-submenu-bar-link.entry.js +4 -4
- package/lib/esm/duet-submenu-bar.entry.js +7 -7
- package/lib/esm/duet-textarea.entry.js +8 -8
- package/lib/esm/duet-toggle.entry.js +9 -9
- package/lib/esm/duet-toolbar-dropdown-link.entry.js +5 -5
- package/lib/esm/duet-toolbar-dropdown.entry.js +7 -7
- package/lib/esm/duet-toolbar-item.entry.js +8 -8
- package/lib/esm/duet-toolbar-link.entry.js +4 -4
- package/lib/esm/duet-toolbar.entry.js +4 -4
- package/lib/esm/duet-tooltip-button_2.entry.js +10 -10
- package/lib/esm/duet-tooltip.entry.js +5 -5
- package/lib/esm/duet-tray.entry.js +7 -7
- package/lib/esm/duet-upload-aria-status.entry.js +2 -2
- package/lib/esm/duet-upload-item.entry.js +6 -6
- package/lib/esm/duet-visually-hidden.entry.js +2 -2
- package/lib/esm/duet.js +4 -4
- package/lib/esm/{errorcodes.utils-DuFCu_27.js → errorcodes.utils-S_WrUPeV.js} +1 -1
- package/lib/esm/{focus-utils-CFswdkeD.js → focus-utils-C4oaajGr.js} +1 -1
- package/lib/esm/{index-B2cboDWM.js → index-D3450NfA.js} +9 -9
- package/lib/esm/{keyboard-utils-Db8rvjPI.js → keyboard-utils-BaefVzkx.js} +2 -1
- package/lib/esm/{label-CJxIWUOT.js → label-C1HF2o4Y.js} +1 -1
- package/lib/esm/{language-utils-C4M4ASkT.js → language-utils-D4WVl8Ph.js} +1 -1
- package/lib/esm/loader.js +4 -4
- package/lib/esm/picture-utils-MSeJTkDk.js +13 -0
- package/lib/esm/{slot-utils--sNK1DNn.js → slot-utils-Dxcjtmp3.js} +1 -1
- package/lib/esm/{themeable-component-BBi3552X.js → themeable-component-QHdUfcat.js} +1 -1
- package/lib/esm/{token-utils-B0KAgyj_.js → token-utils-BILzD7LX.js} +1 -1
- package/lib/esm/{tokens.module-DEzE2U5T.js → tokens.module-kkZE1C6Z.js} +1 -1
- package/lib/types/components/duet-banner/duet-banner.d.ts +5 -1
- package/lib/types/components/duet-button/duet-button.d.ts +1 -1
- package/lib/types/components/duet-card/duet-card.d.ts +5 -0
- package/lib/types/components/duet-chip/duet-chip.d.ts +15 -8
- package/lib/types/components/duet-contact-card/duet-contact-card.d.ts +5 -0
- package/lib/types/components/duet-date-picker/date-picker-month.d.ts +3 -0
- package/lib/types/components/duet-date-picker/date-utils.d.ts +4 -0
- package/lib/types/components/duet-date-picker/disallowed-days.d.ts +9 -0
- package/lib/types/components/duet-date-picker/duet-date-picker.d.ts +14 -0
- package/lib/types/components/duet-date-picker/finnish-bank-holidays.d.ts +11 -0
- package/lib/types/components/duet-hero/duet-hero.d.ts +5 -0
- package/lib/types/components/duet-input/duet-input.d.ts +11 -0
- package/lib/types/components/duet-phone-input/duet-phone-input.d.ts +5 -0
- package/lib/types/components/duet-promo-card/duet-promo-card.d.ts +6 -0
- package/lib/types/components.d.ts +104 -12
- package/lib/types/utils/keyboard-utils.d.ts +1 -0
- package/package.json +5 -5
- package/lib/duet/p-0c04f9f5.entry.js +0 -4
- package/lib/duet/p-18a8ea12.entry.js +0 -4
- package/lib/duet/p-1bca9931.entry.js +0 -4
- package/lib/duet/p-3f3c6e64.entry.js +0 -4
- package/lib/duet/p-4af6a8ed.entry.js +0 -4
- package/lib/duet/p-5284c707.entry.js +0 -4
- package/lib/duet/p-5c9f443c.entry.js +0 -4
- package/lib/duet/p-5lFzA17H.js +0 -4
- package/lib/duet/p-6b469225.entry.js +0 -4
- package/lib/duet/p-7294c37d.entry.js +0 -4
- package/lib/duet/p-72b504ef.entry.js +0 -4
- package/lib/duet/p-74aac967.entry.js +0 -4
- package/lib/duet/p-7c08fd87.entry.js +0 -4
- package/lib/duet/p-83238bf3.entry.js +0 -4
- package/lib/duet/p-86ffd3cb.entry.js +0 -4
- package/lib/duet/p-871620d3.entry.js +0 -4
- package/lib/duet/p-9c9811ba.entry.js +0 -4
- package/lib/duet/p-B2cboDWM.js +0 -5
- package/lib/duet/p-B8-N_qjs.js +0 -4
- package/lib/duet/p-Cg4m_WHe.js +0 -4
- package/lib/duet/p-DEzE2U5T.js +0 -4
- package/lib/duet/p-Db8rvjPI.js +0 -4
- package/lib/duet/p-d5f90dbc.entry.js +0 -4
- package/lib/duet/p-fa13ffe9.entry.js +0 -4
- package/lib/duet/p-s8EL6NG5.js +0 -4
|
@@ -853,7 +853,7 @@ export class DuetCombobox {
|
|
|
853
853
|
"references": {
|
|
854
854
|
"DuetComboboxItem": {
|
|
855
855
|
"location": "local",
|
|
856
|
-
"path": "/Users/
|
|
856
|
+
"path": "/Users/kasimir/projects/lahitapiola/duet-design-system/packages/components/src/components/duet-combobox/duet-combobox.tsx",
|
|
857
857
|
"id": "src/components/duet-combobox/duet-combobox.tsx::DuetComboboxItem"
|
|
858
858
|
}
|
|
859
859
|
}
|
|
@@ -983,7 +983,7 @@ export class DuetCombobox {
|
|
|
983
983
|
"references": {
|
|
984
984
|
"DuetComboboxEvent": {
|
|
985
985
|
"location": "local",
|
|
986
|
-
"path": "/Users/
|
|
986
|
+
"path": "/Users/kasimir/projects/lahitapiola/duet-design-system/packages/components/src/components/duet-combobox/duet-combobox.tsx",
|
|
987
987
|
"id": "src/components/duet-combobox/duet-combobox.tsx::DuetComboboxEvent"
|
|
988
988
|
}
|
|
989
989
|
}
|
|
@@ -1007,7 +1007,7 @@ export class DuetCombobox {
|
|
|
1007
1007
|
},
|
|
1008
1008
|
"DuetComboboxItem": {
|
|
1009
1009
|
"location": "local",
|
|
1010
|
-
"path": "/Users/
|
|
1010
|
+
"path": "/Users/kasimir/projects/lahitapiola/duet-design-system/packages/components/src/components/duet-combobox/duet-combobox.tsx",
|
|
1011
1011
|
"id": "src/components/duet-combobox/duet-combobox.tsx::DuetComboboxItem"
|
|
1012
1012
|
}
|
|
1013
1013
|
},
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
import { h, Host } from "@stencil/core";
|
|
5
5
|
import { inheritGlobalTheme } from "../../common";
|
|
6
6
|
import { connectLanguageChangeObserver, disconnectLanguageChangeObserver, getLanguage, } from "../../utils/language-utils";
|
|
7
|
+
import { DuetPicture } from "../../utils/picture-utils";
|
|
8
|
+
import { parsePossibleJSON } from "../../utils/string-utils";
|
|
7
9
|
export class DuetContactCard {
|
|
8
10
|
constructor() {
|
|
9
11
|
/**
|
|
@@ -47,10 +49,19 @@ export class DuetContactCard {
|
|
|
47
49
|
render() {
|
|
48
50
|
const isTurva = this.theme === "turva";
|
|
49
51
|
const theme = isTurva ? "turva" : "default";
|
|
50
|
-
|
|
52
|
+
const pictureSource = {
|
|
53
|
+
img: {
|
|
54
|
+
src: this.image,
|
|
55
|
+
alt: this.name || "",
|
|
56
|
+
loading: "lazy",
|
|
57
|
+
class: "image",
|
|
58
|
+
},
|
|
59
|
+
sources: parsePossibleJSON(this.sources),
|
|
60
|
+
};
|
|
61
|
+
return (h(Host, { key: 'f64dabbe00a4d4f03132a6adc7bc3b95bdd6042a', class: { "duet-m-0": this.margin === "none" } }, h("div", { key: '0f5bf8d1828462b3f5e6aa9f5d7e11b338a2b61c', class: {
|
|
51
62
|
"duet-contact-card": true,
|
|
52
63
|
"duet-theme-turva": this.theme === "turva",
|
|
53
|
-
}, role: "group", "aria-label": this.name }, this.image ? h(
|
|
64
|
+
}, role: "group", "aria-label": this.name }, this.image ? h(DuetPicture, Object.assign({}, pictureSource)) : h("div", null), h("div", { key: 'c7f1a34d6324e755b84db0dc4da6ccfe23c2caea' }, this.name && (h("duet-heading", { key: 'b5e344e3a442dd32b215a64c5ac5050004205cd2', class: "name", level: "h3", margin: "none", theme: theme }, this.name)), this.description && (h("duet-paragraph", { key: 'c0691195632640e79ff0138fd59b974764f4e653', class: "description", margin: "none", theme: theme }, this.description)), this.email && (h("div", { key: '69b2e8b159c01ac6a10b0e9f5db6484e24d7ba88', class: "email" }, h("duet-icon", { key: '610229dce2bd62cdd469f1507a3d7ab2fb9bbf2e', name: "navigation-message", size: "x-small", color: "primary-dark", margin: "none", theme: theme }), h("duet-link", { key: 'b8de1672468624fb4d187f2284d59057abc6fc02', url: `mailto:${this.email}`, accessibleLabel: `Email: ${this.email}`, theme: theme }, this.email))), this.phone && (h("div", { key: 'f1f0f4cb51fb389b4af742d8aff457575ba2fea8', class: "phone" }, h("duet-icon", { key: 'bf01da4d50e3c15d6e5e6578e560746cd0290cdc', name: "form-tel", size: "x-small", color: "primary-dark", margin: "none", theme: theme }), h("duet-link", { key: 'b13decd3ea2cbe80e5eb96f4214db65bcf318918', url: `tel:${this.phone}`, accessibleLabel: `${this.phoneLabel[this.language]}: ${this.phone}`, theme: theme }, this.phone)))), this.buttonUrl && this.buttonText && (h("div", { key: 'e9d62c80a434400828e323a802e873df327e9c28', class: "call-to-action" }, h("duet-button", { key: '5603fe9f97b490a96cfb04cb6efbc98093d8e216', variation: "default", icon: this.buttonIcon, fixed: true, margin: "none", url: this.buttonUrl, theme: theme }, this.buttonText))), h("div", { key: '6fd00f636dd39f1ad02f62fa2a63cfe7f00f67b2' }), h("slot", { key: 'f91dc7abe608519b46f5bf421f09258cabdda749' }))));
|
|
54
65
|
}
|
|
55
66
|
static get is() { return "duet-contact-card"; }
|
|
56
67
|
static get encapsulation() { return "shadow"; }
|
|
@@ -137,6 +148,31 @@ export class DuetContactCard {
|
|
|
137
148
|
"setter": false,
|
|
138
149
|
"reflect": false
|
|
139
150
|
},
|
|
151
|
+
"sources": {
|
|
152
|
+
"type": "string",
|
|
153
|
+
"attribute": "sources",
|
|
154
|
+
"mutable": false,
|
|
155
|
+
"complexType": {
|
|
156
|
+
"original": "DuetSource[] | string",
|
|
157
|
+
"resolved": "DuetSource[] | string",
|
|
158
|
+
"references": {
|
|
159
|
+
"DuetSource": {
|
|
160
|
+
"location": "import",
|
|
161
|
+
"path": "../../utils/picture-utils",
|
|
162
|
+
"id": "src/utils/picture-utils.tsx::DuetSource"
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
"required": false,
|
|
167
|
+
"optional": false,
|
|
168
|
+
"docs": {
|
|
169
|
+
"tags": [],
|
|
170
|
+
"text": "Array of sources for responsive images. Sources have the properties of <source> element."
|
|
171
|
+
},
|
|
172
|
+
"getter": false,
|
|
173
|
+
"setter": false,
|
|
174
|
+
"reflect": false
|
|
175
|
+
},
|
|
140
176
|
"name": {
|
|
141
177
|
"type": "string",
|
|
142
178
|
"attribute": "name",
|
|
@@ -127,7 +127,7 @@ export class DuetCookieConsent {
|
|
|
127
127
|
"references": {
|
|
128
128
|
"DuetCookieConsentEvent": {
|
|
129
129
|
"location": "local",
|
|
130
|
-
"path": "/Users/
|
|
130
|
+
"path": "/Users/kasimir/projects/lahitapiola/duet-design-system/packages/components/src/components/duet-cookie-consent/duet-cookie-consent.tsx",
|
|
131
131
|
"id": "src/components/duet-cookie-consent/duet-cookie-consent.tsx::DuetCookieConsentEvent"
|
|
132
132
|
}
|
|
133
133
|
}
|
|
@@ -5,8 +5,9 @@ import { h } from "@stencil/core";
|
|
|
5
5
|
import i18n from "./date-i18n";
|
|
6
6
|
import { DatePickerDay } from "./date-picker-day";
|
|
7
7
|
import { getViewOfMonth, inRange, isEqual } from "./date-utils";
|
|
8
|
+
import { isDateDisallowed } from "./disallowed-days";
|
|
8
9
|
import { chunk } from "./utils";
|
|
9
|
-
export const DatePickerMonth = ({ selectedDate, focusedDate, labelledById, theme, language, min, max, onDateSelect, onKeyboardNavigation, focusedDayRef, onFocusEnter, onFocusExit, }) => {
|
|
10
|
+
export const DatePickerMonth = ({ selectedDate, focusedDate, labelledById, theme, language, min, max, disallowWeekends, disallowBankHolidays, disallowedDates, onDateSelect, onKeyboardNavigation, focusedDayRef, onFocusEnter, onFocusExit, }) => {
|
|
10
11
|
const { dayLabels } = i18n[language];
|
|
11
12
|
const today = new Date();
|
|
12
13
|
const days = getViewOfMonth(focusedDate);
|
|
@@ -19,7 +20,8 @@ export const DatePickerMonth = ({ selectedDate, focusedDate, labelledById, theme
|
|
|
19
20
|
}
|
|
20
21
|
return (h("div", { role: "application" }, h("table", { role: "presentation", class: { "duet-date-table": true, "duet-theme-turva": theme === "turva" }, "aria-labelledby": labelledById,
|
|
21
22
|
// @ts-ignore
|
|
22
|
-
onFocusin: onFocusEnter, onFocusout: handleFocusOut }, h("thead", null, h("tr", null, dayLabels.map(label => (h("th", { scope: "col" }, h("span", { "aria-hidden": "true" }, label.substr(0, 2))))))), h("tbody", null, chunk(days, 7).map(week => (h("tr", { class: "duet-date-table-row" }, week.map(day => (h(DatePickerDay, { day: day, today: today, language: language, focusedDay: focusedDate, inRange: inRange(day, min, max)
|
|
23
|
+
onFocusin: onFocusEnter, onFocusout: handleFocusOut }, h("thead", null, h("tr", null, dayLabels.map(label => (h("th", { scope: "col" }, h("span", { "aria-hidden": "true" }, label.substr(0, 2))))))), h("tbody", null, chunk(days, 7).map(week => (h("tr", { class: "duet-date-table-row" }, week.map(day => (h(DatePickerDay, { day: day, today: today, language: language, focusedDay: focusedDate, inRange: inRange(day, min, max) &&
|
|
24
|
+
!isDateDisallowed(day, { disallowWeekends, disallowBankHolidays, disallowedDates }), isSelected: isEqual(day, selectedDate), onDaySelect: onDateSelect, onKeyboardNavigation: onKeyboardNavigation, ref: el => {
|
|
23
25
|
if (el && isEqual(day, focusedDate)) {
|
|
24
26
|
focusedDayRef(el);
|
|
25
27
|
}
|
|
@@ -140,6 +140,13 @@ export function setYear(date, year) {
|
|
|
140
140
|
d.setFullYear(year);
|
|
141
141
|
return d;
|
|
142
142
|
}
|
|
143
|
+
/**
|
|
144
|
+
* Check if date falls on a Saturday or Sunday
|
|
145
|
+
*/
|
|
146
|
+
export function isWeekend(date) {
|
|
147
|
+
const day = date.getDay();
|
|
148
|
+
return day === 0 || day === 6;
|
|
149
|
+
}
|
|
143
150
|
/**
|
|
144
151
|
* Check if date is within a min and max
|
|
145
152
|
*/
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built with Duet Design System
|
|
3
|
+
*/
|
|
4
|
+
import { isEqual, isWeekend, parseISODate } from "./date-utils";
|
|
5
|
+
import { isFinnishBankHoliday } from "./finnish-bank-holidays";
|
|
6
|
+
function parseDisallowedDates(disallowedDates) {
|
|
7
|
+
if (!disallowedDates) {
|
|
8
|
+
return [];
|
|
9
|
+
}
|
|
10
|
+
return Array.isArray(disallowedDates) ? disallowedDates : disallowedDates.split(",").map(date => date.trim());
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Check if a date is disallowed by any of the given weekend/bank-holiday/explicit-date rules
|
|
14
|
+
*/
|
|
15
|
+
export function isDateDisallowed(date, options) {
|
|
16
|
+
if (options.disallowWeekends && isWeekend(date)) {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
if (options.disallowBankHolidays && isFinnishBankHoliday(date)) {
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
return parseDisallowedDates(options.disallowedDates).some(isoDate => isEqual(parseISODate(isoDate), date));
|
|
23
|
+
}
|
|
@@ -12,6 +12,7 @@ import i18n from "./date-i18n";
|
|
|
12
12
|
import { DatePickerInput } from "./date-picker-input";
|
|
13
13
|
import { DatePickerMonth } from "./date-picker-month";
|
|
14
14
|
import { addDays, clamp, endOfMonth, endOfWeek, inRange, isEqual, parseDate, parseISODate, printDate, printISODate, setMonth, setYear, startOfMonth, startOfWeek, } from "./date-utils";
|
|
15
|
+
import { isDateDisallowed } from "./disallowed-days";
|
|
15
16
|
import { createShortcuts, range } from "./utils";
|
|
16
17
|
/**
|
|
17
18
|
* @slot tooltip - Use to place a tooltip alongside the label.
|
|
@@ -46,6 +47,11 @@ export class DuetDatePicker {
|
|
|
46
47
|
fi: "Päivämäärä vaaditaan",
|
|
47
48
|
sv: "Datum krävs",
|
|
48
49
|
},
|
|
50
|
+
customError: {
|
|
51
|
+
en: "Date not allowed",
|
|
52
|
+
fi: "Päivämäärä ei sallittu",
|
|
53
|
+
sv: "Datum inte tillåtet",
|
|
54
|
+
},
|
|
49
55
|
};
|
|
50
56
|
this.open = false;
|
|
51
57
|
this.focusedDay = new Date();
|
|
@@ -154,6 +160,19 @@ export class DuetDatePicker {
|
|
|
154
160
|
* This setting can be used alone or together with the min property.
|
|
155
161
|
*/
|
|
156
162
|
this.max = "";
|
|
163
|
+
/**
|
|
164
|
+
* Disallow selecting Saturdays and Sundays.
|
|
165
|
+
*/
|
|
166
|
+
this.disallowWeekends = false;
|
|
167
|
+
/**
|
|
168
|
+
* Disallow selecting Finnish bank holidays, including Easter-based dates and Midsummer Eve.
|
|
169
|
+
*/
|
|
170
|
+
this.disallowBankHolidays = false;
|
|
171
|
+
/**
|
|
172
|
+
* Disallow selecting specific dates. Accepts an array of ISO-8601 (YYYY-MM-DD) dates,
|
|
173
|
+
* or a comma-separated string of the same when set as an HTML attribute.
|
|
174
|
+
*/
|
|
175
|
+
this.disallowedDates = [];
|
|
157
176
|
/**
|
|
158
177
|
* Increment to add to years, defaults to 10 for simplicity, if you need a larger selectionspace you can set it to 100
|
|
159
178
|
*/
|
|
@@ -256,7 +275,7 @@ export class DuetDatePicker {
|
|
|
256
275
|
this.handleDaySelect = (_event, day) => {
|
|
257
276
|
const min = parseISODate(this.min);
|
|
258
277
|
const max = parseISODate(this.max);
|
|
259
|
-
if (inRange(day, min, max)) {
|
|
278
|
+
if (inRange(day, min, max) && !isDateDisallowed(day, this)) {
|
|
260
279
|
this.setValue(day);
|
|
261
280
|
this.hide();
|
|
262
281
|
}
|
|
@@ -277,6 +296,7 @@ export class DuetDatePicker {
|
|
|
277
296
|
* This offers information relating to the current validity of the component.
|
|
278
297
|
* It follow as closely as possible the behaviour of the native date input.
|
|
279
298
|
* Useful properties to inspect are badInput, valueMissing, rangeOverflow, rangeUnderflow.
|
|
299
|
+
* For disallowed dates property customError is set true.
|
|
280
300
|
*/
|
|
281
301
|
get validity() {
|
|
282
302
|
this.determineValidity();
|
|
@@ -401,9 +421,10 @@ export class DuetDatePicker {
|
|
|
401
421
|
const valueMissing = !valueAsDate && this.required;
|
|
402
422
|
const rangeOverflow = valueAsDate ? !inRange(valueAsDate, null, parseISODate(this.max)) : false;
|
|
403
423
|
const rangeUnderflow = valueAsDate ? !inRange(valueAsDate, parseISODate(this.min)) : false;
|
|
424
|
+
const customError = valueAsDate ? isDateDisallowed(valueAsDate, this) : false;
|
|
404
425
|
this._validity = {
|
|
405
426
|
patternMismatch: false,
|
|
406
|
-
customError
|
|
427
|
+
customError,
|
|
407
428
|
stepMismatch: false,
|
|
408
429
|
tooLong: false,
|
|
409
430
|
tooShort: false,
|
|
@@ -412,7 +433,7 @@ export class DuetDatePicker {
|
|
|
412
433
|
rangeUnderflow,
|
|
413
434
|
rangeOverflow,
|
|
414
435
|
valueMissing,
|
|
415
|
-
valid: !(valueMissing || badInput || rangeUnderflow || rangeOverflow),
|
|
436
|
+
valid: !(valueMissing || badInput || rangeUnderflow || rangeOverflow || customError),
|
|
416
437
|
};
|
|
417
438
|
if (this._validity.valid) {
|
|
418
439
|
this.error = "";
|
|
@@ -475,13 +496,13 @@ export class DuetDatePicker {
|
|
|
475
496
|
if (maxDate) {
|
|
476
497
|
maxYear = Math.min(maxYear, maxDate.getFullYear());
|
|
477
498
|
}
|
|
478
|
-
return (h(Host, { key: '
|
|
499
|
+
return (h(Host, { key: '574a2e443eb79af37f178f46845a206f561cba2e', class: { "duet-expand": this.expand, "duet-m-0": this.margin === "none" } }, h("div", { key: '62fa53292d9b464c3bfce84805c61abbc729b32c', class: "duet-date" }, h(DatePickerInput, { key: 'fd44ced264f1b867ffa5642a110d118cfd8a7977', hasFocus: this.inputHasFocus, value: this.value, valueAsDate: valueAsDate, formattedValue: this.inputValue, language: this.language, onInput: this.handleInputChange, onBlur: this.handleBlur, onFocus: this.handleFocus, onClick: this.toggleOpen, name: this.name, disabled: this.disabled, error: this.error, role: this.role, required: this.required, theme: this.theme, tooltip: this.tooltip, tooltipDirection: this.tooltipDirection, labelHidden: this.labelHidden, placeholder: this.placeholder, inputLabel: this.label, identifier: this.identifier, buttonRef: element => (this.datePickerButton = element), inputRef: element => (this.datePickerInput = element), accessibleActiveDescendant: this.accessibleActiveDescendant, accessibleControls: this.accessibleControls, accessibleOwns: this.accessibleOwns, accessibleDescribedBy: this.accessibleDescribedBy, accessibleLiveError: this.accessibleLiveError, echoPlaceholder: this.echoPlaceholder, caption: this.caption })), h("div", { key: '7db19721a17bc48c0f232de5a91e9aee49435f6b', class: {
|
|
479
500
|
"duet-theme-turva": this.theme === "turva",
|
|
480
501
|
"duet-date-dialog": true,
|
|
481
502
|
left: this.direction === "left",
|
|
482
503
|
error: !!this.error,
|
|
483
504
|
active: this.open,
|
|
484
|
-
}, role: "dialog", "aria-modal": "true", "aria-hidden": this.open ? "false" : "true", "aria-labelledby": this.dialogLabelId, onTouchMove: this.handleTouchMove, onTouchStart: this.handleTouchStart, onTouchEnd: this.handleTouchEnd }, h("duet-overlay", { key: '
|
|
505
|
+
}, role: "dialog", "aria-modal": "true", "aria-hidden": this.open ? "false" : "true", "aria-labelledby": this.dialogLabelId, onTouchMove: this.handleTouchMove, onTouchStart: this.handleTouchStart, onTouchEnd: this.handleTouchEnd }, h("duet-overlay", { key: 'b762f7971ef0f3cfdba4338da8b66ddd932d739c', visible: this.open, "display-device": "x-small" }), h(FocusGuard, { key: '116f8a028515e1cabbdfe6c7c4fbe46a366e8417', moveFocusTo: this.focusedDayNode }), h("div", { key: '46df5dc4188ca94f1e9288cc94b369a56a951ee1', class: "duet-date-dialog-wrapper", onKeyDown: this.handleEscKey, ref: element => (this.dialogWrapperNode = element) }, h("duet-visually-hidden", { key: '1de44e1f4c44b9c97adb419fa7abf60f937b0fa2', "aria-live": "polite" }, text.keyboardInstruction), h("div", { key: '4a36684eab5f83211dcd9f04f240ad535f781376', class: "duet-date-dialog-mobile-header" }, h(DuetInternalLabel, { key: 'ef9877f7fc10b63428437a0ddbc07a787792617b', margin: "none" }, this.label), h("button", { key: '52b087991727aa7c32178aef85a7ff6a88b33f6e', class: "duet-date-picker-close", ref: element => (this.closeButtonNode = element), onClick: () => this.hide(), type: "button" }, h("duet-icon", { key: '9434a8ab91835101fca28fb28d3ba3b5fc768583', name: "navigation-close-small", margin: "none", color: "currentColor", size: "xx-small" }), h("duet-visually-hidden", { key: 'eaa01ae0b3e0270af1ee5b7777c4bf1c823ed55d' }, text.closeLabel))), h("div", { key: '8f59e259985eb3628f23dd8aa4edd90eab33ce45', class: "duet-date-dialog-header" }, h("div", { key: 'fd9e2ffede5b19a2008684f5587663372a769b0f', class: "duet-date-dialog-dropdowns" }, h("duet-visually-hidden", { key: '9bfda8777868d3a1a0b5dfb1146d4bd22ece9b9d' }, h("h2", { key: '4f8171f8b0bfabeb8ef0d44f604c668810572ba8', id: this.dialogLabelId, "aria-live": "polite", "aria-atomic": "true" }, text.monthLabels[focusedMonth], " ", this.focusedDay.getFullYear())), h("duet-visually-hidden", { key: 'f55f26894bef3e11233e3d72b62d70ff5f4f30fc' }, h("label", { key: '01d6cda898862ee9c82f018e4a875a54c8a4454c', htmlFor: this.monthSelectId }, text.monthSelectLabel)), h("div", { key: '758b166665674a916ab6d6b2c9fd78b6f51f27fd', class: "duet-date-dialog-select" }, h("select", { key: '548b2e7615f581454c64c30fe8e8c8d6dfe0d969', id: this.monthSelectId, class: "duet-date-month-select", ref: element => (this.monthSelectNode = element), onChange: this.handleMonthSelect }, text.monthLabels.map((month, i) => (h("option", { key: month, value: i, selected: i === focusedMonth, disabled: !inRange(new Date(focusedYear, i, 1), minDate ? startOfMonth(minDate) : null, maxDate ? endOfMonth(maxDate) : null) }, month)))), h("div", { key: '34d1e610de1d9f1c1436fdf1ffb2294742269696', class: "duet-date-dialog-select-label", "aria-hidden": "true" }, h("span", { key: '84d57f82660038e7fb7d631e6eb03be0ef9c4315' }, text.monthLabelsShort[focusedMonth]), h("duet-icon", { key: 'f706752d81c80ae05bf13a19ed6cfa3b2d7262cc', name: "action-arrow-down-small", color: "currentColor", margin: "none", size: "xxx-small" }))), h("duet-visually-hidden", { key: 'fb67730ced2246377442fb2fd2ebf5086db34fbd' }, h("label", { key: '0d3d28925711a15b919004ad2384c719b9832f7d', htmlFor: this.yearSelectId }, text.yearSelectLabel)), h("div", { key: '371bb8461b655460da25e9982e17c0385fab8f71', class: "duet-date-dialog-select" }, h("select", { key: 'c466eed369426ad7cc78fbed3278a0523529920c', id: this.yearSelectId, class: "duet-date-year-select", onChange: this.handleYearSelect }, range(minYear, maxYear).map(year => (h("option", { key: year, selected: year === focusedYear }, year)))), h("div", { key: '78db254ed00d0d7b5104f4932415d970ff17e1f4', class: "duet-date-dialog-select-label", "aria-hidden": "true" }, h("span", { key: '9a66b0dad5bf39fd769cd851cb529b4568310d9d' }, this.focusedDay.getFullYear()), h("duet-icon", { key: 'a68a8da9385f631020ba28389caf1b611def6676', name: "action-arrow-down-small", color: "currentColor", margin: "none", size: "xxx-small" })))), h("div", { key: 'd1dd09f7da7f1e9d50cdd79ae97d13ba4d89be25', class: "duet-date-dialog-buttons" }, h("duet-action-button", { key: 'e7b3c41d7d56f2c24b4e69db80e4c8fc2e0395a2', accessibleLabel: i18n[this.language].prevMonthLabel, actionName: i18n[this.language].prevMonthLabel, class: "duet-date-dialog-prev", onClick: this.handlePreviousMonthClick, disabled: prevMonthDisabled, "icon-name": "action-arrow-left-small" }, text.prevMonthLabel), h("duet-action-button", { key: '980a6a1316a3f0b64a0ae62dd80d3494ea855ae8', accessibleLabel: i18n[this.language].nextMonthLabel, actionName: i18n[this.language].nextMonthLabel, class: "duet-date-dialog-next", onClick: this.handleNextMonthClick, disabled: nextMonthDisabled, "icon-name": "action-arrow-right-small" }, text.nextMonthLabel))), h(DatePickerMonth, { key: '8524700a8665fe9b8edc04bd6b90b4aacc1eeea0', selectedDate: valueAsDate, focusedDate: this.focusedDay, onDateSelect: this.handleDaySelect, onKeyboardNavigation: this.handleKeyboardNavigation, labelledById: this.dialogLabelId, language: this.language, theme: this.theme, min: minDate, max: maxDate, disallowWeekends: this.disallowWeekends, disallowBankHolidays: this.disallowBankHolidays, disallowedDates: this.disallowedDates, focusedDayRef: element => (this.focusedDayNode = element), onFocusEnter: this.enableActiveFocus, onFocusExit: this.disableActiveFocus })), h(FocusGuard, { key: '8b92a3d7d025848e2e3c976e9c091364b52b7f96', moveFocusTo: this.closeButtonNode }))));
|
|
485
506
|
}
|
|
486
507
|
static get is() { return "duet-date-picker"; }
|
|
487
508
|
static get encapsulation() { return "shadow"; }
|
|
@@ -957,7 +978,7 @@ export class DuetDatePicker {
|
|
|
957
978
|
"references": {
|
|
958
979
|
"DuetDatePickerDirection": {
|
|
959
980
|
"location": "local",
|
|
960
|
-
"path": "/Users/
|
|
981
|
+
"path": "/Users/kasimir/projects/lahitapiola/duet-design-system/packages/components/src/components/duet-date-picker/duet-date-picker.tsx",
|
|
961
982
|
"id": "src/components/duet-date-picker/duet-date-picker.tsx::DuetDatePickerDirection"
|
|
962
983
|
}
|
|
963
984
|
}
|
|
@@ -1079,6 +1100,66 @@ export class DuetDatePicker {
|
|
|
1079
1100
|
"reflect": false,
|
|
1080
1101
|
"defaultValue": "\"\""
|
|
1081
1102
|
},
|
|
1103
|
+
"disallowWeekends": {
|
|
1104
|
+
"type": "boolean",
|
|
1105
|
+
"attribute": "disallow-weekends",
|
|
1106
|
+
"mutable": false,
|
|
1107
|
+
"complexType": {
|
|
1108
|
+
"original": "boolean",
|
|
1109
|
+
"resolved": "boolean",
|
|
1110
|
+
"references": {}
|
|
1111
|
+
},
|
|
1112
|
+
"required": false,
|
|
1113
|
+
"optional": false,
|
|
1114
|
+
"docs": {
|
|
1115
|
+
"tags": [],
|
|
1116
|
+
"text": "Disallow selecting Saturdays and Sundays."
|
|
1117
|
+
},
|
|
1118
|
+
"getter": false,
|
|
1119
|
+
"setter": false,
|
|
1120
|
+
"reflect": false,
|
|
1121
|
+
"defaultValue": "false"
|
|
1122
|
+
},
|
|
1123
|
+
"disallowBankHolidays": {
|
|
1124
|
+
"type": "boolean",
|
|
1125
|
+
"attribute": "disallow-bank-holidays",
|
|
1126
|
+
"mutable": false,
|
|
1127
|
+
"complexType": {
|
|
1128
|
+
"original": "boolean",
|
|
1129
|
+
"resolved": "boolean",
|
|
1130
|
+
"references": {}
|
|
1131
|
+
},
|
|
1132
|
+
"required": false,
|
|
1133
|
+
"optional": false,
|
|
1134
|
+
"docs": {
|
|
1135
|
+
"tags": [],
|
|
1136
|
+
"text": "Disallow selecting Finnish bank holidays, including Easter-based dates and Midsummer Eve."
|
|
1137
|
+
},
|
|
1138
|
+
"getter": false,
|
|
1139
|
+
"setter": false,
|
|
1140
|
+
"reflect": false,
|
|
1141
|
+
"defaultValue": "false"
|
|
1142
|
+
},
|
|
1143
|
+
"disallowedDates": {
|
|
1144
|
+
"type": "string",
|
|
1145
|
+
"attribute": "disallowed-dates",
|
|
1146
|
+
"mutable": false,
|
|
1147
|
+
"complexType": {
|
|
1148
|
+
"original": "string | string[]",
|
|
1149
|
+
"resolved": "string | string[]",
|
|
1150
|
+
"references": {}
|
|
1151
|
+
},
|
|
1152
|
+
"required": false,
|
|
1153
|
+
"optional": false,
|
|
1154
|
+
"docs": {
|
|
1155
|
+
"tags": [],
|
|
1156
|
+
"text": "Disallow selecting specific dates. Accepts an array of ISO-8601 (YYYY-MM-DD) dates,\nor a comma-separated string of the same when set as an HTML attribute."
|
|
1157
|
+
},
|
|
1158
|
+
"getter": false,
|
|
1159
|
+
"setter": false,
|
|
1160
|
+
"reflect": false,
|
|
1161
|
+
"defaultValue": "[]"
|
|
1162
|
+
},
|
|
1082
1163
|
"incrementYears": {
|
|
1083
1164
|
"type": "number",
|
|
1084
1165
|
"attribute": "increment",
|
|
@@ -1117,7 +1198,7 @@ export class DuetDatePicker {
|
|
|
1117
1198
|
"optional": false,
|
|
1118
1199
|
"docs": {
|
|
1119
1200
|
"tags": [],
|
|
1120
|
-
"text": "This offers information relating to the current validity of the component.\nIt follow as closely as possible the behaviour of the native date input.\nUseful properties to inspect are badInput, valueMissing, rangeOverflow, rangeUnderflow."
|
|
1201
|
+
"text": "This offers information relating to the current validity of the component.\nIt follow as closely as possible the behaviour of the native date input.\nUseful properties to inspect are badInput, valueMissing, rangeOverflow, rangeUnderflow.\nFor disallowed dates property customError is set true."
|
|
1121
1202
|
},
|
|
1122
1203
|
"getter": true,
|
|
1123
1204
|
"setter": false
|
|
@@ -1169,7 +1250,7 @@ export class DuetDatePicker {
|
|
|
1169
1250
|
"references": {
|
|
1170
1251
|
"DuetDatePickerChangeEvent": {
|
|
1171
1252
|
"location": "local",
|
|
1172
|
-
"path": "/Users/
|
|
1253
|
+
"path": "/Users/kasimir/projects/lahitapiola/duet-design-system/packages/components/src/components/duet-date-picker/duet-date-picker.tsx",
|
|
1173
1254
|
"id": "src/components/duet-date-picker/duet-date-picker.tsx::DuetDatePickerChangeEvent"
|
|
1174
1255
|
}
|
|
1175
1256
|
}
|
|
@@ -1190,7 +1271,7 @@ export class DuetDatePicker {
|
|
|
1190
1271
|
"references": {
|
|
1191
1272
|
"DuetDatePickerFocusEvent": {
|
|
1192
1273
|
"location": "local",
|
|
1193
|
-
"path": "/Users/
|
|
1274
|
+
"path": "/Users/kasimir/projects/lahitapiola/duet-design-system/packages/components/src/components/duet-date-picker/duet-date-picker.tsx",
|
|
1194
1275
|
"id": "src/components/duet-date-picker/duet-date-picker.tsx::DuetDatePickerFocusEvent"
|
|
1195
1276
|
}
|
|
1196
1277
|
}
|
|
@@ -1211,7 +1292,7 @@ export class DuetDatePicker {
|
|
|
1211
1292
|
"references": {
|
|
1212
1293
|
"DuetDatePickerFocusEvent": {
|
|
1213
1294
|
"location": "local",
|
|
1214
|
-
"path": "/Users/
|
|
1295
|
+
"path": "/Users/kasimir/projects/lahitapiola/duet-design-system/packages/components/src/components/duet-date-picker/duet-date-picker.tsx",
|
|
1215
1296
|
"id": "src/components/duet-date-picker/duet-date-picker.tsx::DuetDatePickerFocusEvent"
|
|
1216
1297
|
}
|
|
1217
1298
|
}
|
|
@@ -1302,6 +1383,15 @@ export class DuetDatePicker {
|
|
|
1302
1383
|
}, {
|
|
1303
1384
|
"propName": "inputValue",
|
|
1304
1385
|
"methodName": "updateValidity"
|
|
1386
|
+
}, {
|
|
1387
|
+
"propName": "disallowWeekends",
|
|
1388
|
+
"methodName": "updateValidity"
|
|
1389
|
+
}, {
|
|
1390
|
+
"propName": "disallowBankHolidays",
|
|
1391
|
+
"methodName": "updateValidity"
|
|
1392
|
+
}, {
|
|
1393
|
+
"propName": "disallowedDates",
|
|
1394
|
+
"methodName": "updateValidity"
|
|
1305
1395
|
}, {
|
|
1306
1396
|
"propName": "value",
|
|
1307
1397
|
"methodName": "updateInternalValue"
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built with Duet Design System
|
|
3
|
+
*/
|
|
4
|
+
import { addDays, isEqual } from "./date-utils";
|
|
5
|
+
const holidaysByYear = new Map();
|
|
6
|
+
/**
|
|
7
|
+
* Calculate the date of Easter Sunday for a given year using the
|
|
8
|
+
* Meeus/Jones/Butcher Gregorian algorithm.
|
|
9
|
+
*/
|
|
10
|
+
export function getEasterSunday(year) {
|
|
11
|
+
const a = year % 19;
|
|
12
|
+
const b = Math.floor(year / 100);
|
|
13
|
+
const c = year % 100;
|
|
14
|
+
const d = Math.floor(b / 4);
|
|
15
|
+
const e = b % 4;
|
|
16
|
+
const f = Math.floor((b + 8) / 25);
|
|
17
|
+
const g = Math.floor((b - f + 1) / 3);
|
|
18
|
+
const h = (19 * a + b - d - g + 15) % 30;
|
|
19
|
+
const i = Math.floor(c / 4);
|
|
20
|
+
const k = c % 4;
|
|
21
|
+
const l = (32 + 2 * e + 2 * i - h - k) % 7;
|
|
22
|
+
const m = Math.floor((a + 11 * h + 22 * l) / 451);
|
|
23
|
+
const monthAndDay = h + l - 7 * m + 114;
|
|
24
|
+
const month = Math.floor(monthAndDay / 31);
|
|
25
|
+
const day = (monthAndDay % 31) + 1;
|
|
26
|
+
return new Date(year, month - 1, day);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Midsummer Eve is the Friday falling between 19 and 25 June (inclusive).
|
|
30
|
+
*/
|
|
31
|
+
function getMidsummerEve(year) {
|
|
32
|
+
for (let day = 19; day <= 25; day++) {
|
|
33
|
+
const date = new Date(year, 5, day);
|
|
34
|
+
if (date.getDay() === 5) {
|
|
35
|
+
return date;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Finnish bank holidays for a given year, as published by the Bank of Finland:
|
|
41
|
+
* https://www.suomenpankki.fi/en/money-and-payments/bank-holidays/
|
|
42
|
+
*/
|
|
43
|
+
export function getFinnishBankHolidays(year) {
|
|
44
|
+
if (holidaysByYear.has(year)) {
|
|
45
|
+
return holidaysByYear.get(year);
|
|
46
|
+
}
|
|
47
|
+
const easterSunday = getEasterSunday(year);
|
|
48
|
+
const holidays = [
|
|
49
|
+
new Date(year, 0, 1), // New Year's Day
|
|
50
|
+
new Date(year, 0, 6), // Epiphany
|
|
51
|
+
addDays(easterSunday, -2), // Good Friday
|
|
52
|
+
addDays(easterSunday, 1), // Easter Monday
|
|
53
|
+
new Date(year, 4, 1), // May Day
|
|
54
|
+
addDays(easterSunday, 39), // Ascension Day
|
|
55
|
+
getMidsummerEve(year), // Midsummer Eve
|
|
56
|
+
new Date(year, 11, 6), // Independence Day
|
|
57
|
+
new Date(year, 11, 24), // Christmas Eve
|
|
58
|
+
new Date(year, 11, 25), // Christmas Day
|
|
59
|
+
new Date(year, 11, 26), // Boxing Day
|
|
60
|
+
];
|
|
61
|
+
holidaysByYear.set(year, holidays);
|
|
62
|
+
return holidays;
|
|
63
|
+
}
|
|
64
|
+
export function isFinnishBankHoliday(date) {
|
|
65
|
+
return getFinnishBankHolidays(date.getFullYear()).some(holiday => isEqual(holiday, date));
|
|
66
|
+
}
|
|
@@ -89,7 +89,7 @@ export class DuetDivider {
|
|
|
89
89
|
"references": {
|
|
90
90
|
"DuetDividerMargin": {
|
|
91
91
|
"location": "local",
|
|
92
|
-
"path": "/Users/
|
|
92
|
+
"path": "/Users/kasimir/projects/lahitapiola/duet-design-system/packages/components/src/components/duet-divider/duet-divider.tsx",
|
|
93
93
|
"id": "src/components/duet-divider/duet-divider.tsx::DuetDividerMargin"
|
|
94
94
|
}
|
|
95
95
|
}
|
|
@@ -366,7 +366,7 @@ export class DuetEditableTable {
|
|
|
366
366
|
"references": {
|
|
367
367
|
"DuetEditableTableActions": {
|
|
368
368
|
"location": "local",
|
|
369
|
-
"path": "/Users/
|
|
369
|
+
"path": "/Users/kasimir/projects/lahitapiola/duet-design-system/packages/components/src/components/duet-editable-table/duet-editable-table.tsx",
|
|
370
370
|
"id": "src/components/duet-editable-table/duet-editable-table.tsx::DuetEditableTableActions"
|
|
371
371
|
}
|
|
372
372
|
}
|
|
@@ -394,7 +394,7 @@ export class DuetEditableTable {
|
|
|
394
394
|
"references": {
|
|
395
395
|
"DuetEditableTableColumns": {
|
|
396
396
|
"location": "local",
|
|
397
|
-
"path": "/Users/
|
|
397
|
+
"path": "/Users/kasimir/projects/lahitapiola/duet-design-system/packages/components/src/components/duet-editable-table/duet-editable-table.tsx",
|
|
398
398
|
"id": "src/components/duet-editable-table/duet-editable-table.tsx::DuetEditableTableColumns"
|
|
399
399
|
}
|
|
400
400
|
}
|
|
@@ -422,7 +422,7 @@ export class DuetEditableTable {
|
|
|
422
422
|
"references": {
|
|
423
423
|
"DuetEditableTableRows": {
|
|
424
424
|
"location": "local",
|
|
425
|
-
"path": "/Users/
|
|
425
|
+
"path": "/Users/kasimir/projects/lahitapiola/duet-design-system/packages/components/src/components/duet-editable-table/duet-editable-table.tsx",
|
|
426
426
|
"id": "src/components/duet-editable-table/duet-editable-table.tsx::DuetEditableTableRows"
|
|
427
427
|
}
|
|
428
428
|
}
|
|
@@ -570,7 +570,7 @@ export class DuetEditableTable {
|
|
|
570
570
|
"references": {
|
|
571
571
|
"DuetTableToggleEvent": {
|
|
572
572
|
"location": "local",
|
|
573
|
-
"path": "/Users/
|
|
573
|
+
"path": "/Users/kasimir/projects/lahitapiola/duet-design-system/packages/components/src/components/duet-editable-table/duet-editable-table.tsx",
|
|
574
574
|
"id": "src/components/duet-editable-table/duet-editable-table.tsx::DuetTableToggleEvent"
|
|
575
575
|
}
|
|
576
576
|
}
|
|
@@ -591,7 +591,7 @@ export class DuetEditableTable {
|
|
|
591
591
|
"references": {
|
|
592
592
|
"DuetTableMenuEvent": {
|
|
593
593
|
"location": "local",
|
|
594
|
-
"path": "/Users/
|
|
594
|
+
"path": "/Users/kasimir/projects/lahitapiola/duet-design-system/packages/components/src/components/duet-editable-table/duet-editable-table.tsx",
|
|
595
595
|
"id": "src/components/duet-editable-table/duet-editable-table.tsx::DuetTableMenuEvent"
|
|
596
596
|
}
|
|
597
597
|
}
|
|
@@ -111,7 +111,7 @@ export class DuetEmptyState {
|
|
|
111
111
|
"references": {
|
|
112
112
|
"DuetEmptyStateStatus": {
|
|
113
113
|
"location": "local",
|
|
114
|
-
"path": "/Users/
|
|
114
|
+
"path": "/Users/kasimir/projects/lahitapiola/duet-design-system/packages/components/src/components/duet-empty-state/duet-empty-state.tsx",
|
|
115
115
|
"id": "src/components/duet-empty-state/duet-empty-state.tsx::DuetEmptyStateStatus"
|
|
116
116
|
}
|
|
117
117
|
}
|
|
@@ -203,7 +203,7 @@ export class DuetEmptyState {
|
|
|
203
203
|
"references": {
|
|
204
204
|
"DuetEmptyStatePadding": {
|
|
205
205
|
"location": "local",
|
|
206
|
-
"path": "/Users/
|
|
206
|
+
"path": "/Users/kasimir/projects/lahitapiola/duet-design-system/packages/components/src/components/duet-empty-state/duet-empty-state.tsx",
|
|
207
207
|
"id": "src/components/duet-empty-state/duet-empty-state.tsx::DuetEmptyStatePadding"
|
|
208
208
|
}
|
|
209
209
|
}
|
|
@@ -229,7 +229,7 @@ export class DuetEmptyState {
|
|
|
229
229
|
"references": {
|
|
230
230
|
"DuetEmptyStateSize": {
|
|
231
231
|
"location": "local",
|
|
232
|
-
"path": "/Users/
|
|
232
|
+
"path": "/Users/kasimir/projects/lahitapiola/duet-design-system/packages/components/src/components/duet-empty-state/duet-empty-state.tsx",
|
|
233
233
|
"id": "src/components/duet-empty-state/duet-empty-state.tsx::DuetEmptyStateSize"
|
|
234
234
|
}
|
|
235
235
|
}
|
|
@@ -75,20 +75,20 @@ export class DuetFieldset {
|
|
|
75
75
|
* Always the last one in the class.
|
|
76
76
|
*/
|
|
77
77
|
render() {
|
|
78
|
-
return (h(Host, { key: '
|
|
78
|
+
return (h(Host, { key: 'dfc4801eaf8c1165b778701dffc06cb6c6729dab', class: { "duet-m-0": this.margin === "none" } }, h("fieldset", { key: '720a2326b5106d5a7665528aedf93a351173abd0', "aria-labelledby": this.labelId, "aria-describedby": this.error ? this.errorId : null,
|
|
79
79
|
// NVDA and VoiceOver do not yet support aria-errormessage
|
|
80
80
|
// once they do, we can remove errors from the aria-describedby
|
|
81
81
|
// aria-errormessage={this.error ? this.errorId : null}
|
|
82
82
|
class: {
|
|
83
83
|
"duet-fieldset": true,
|
|
84
84
|
"duet-theme-turva": this.theme === "turva",
|
|
85
|
-
} }, h("legend", { key: '
|
|
85
|
+
} }, h("legend", { key: 'a3e0f5a2079c07462370fe5b4953029868a34128', id: this.labelId }, h(this.labelHeadingLevel, { key: '8b09fc7c58d0cb9ce5228f420c16b7e753cbff32' }, this.label), this.caption && h("span", { key: '5505e5ff8f0fb05d0de2100a606281efc89de10d' }, this.caption)), h("div", { key: 'c283e26732c4a1a23ab92f2f69c470f8576a1295', class: {
|
|
86
86
|
"duet-legend-wrapper": true,
|
|
87
87
|
"duet-legend-has-caption": !!this.caption,
|
|
88
88
|
"duet-legend-has-tooltip": this.hasTooltip,
|
|
89
89
|
"duet-legend-hidden": this.labelHidden,
|
|
90
90
|
"duet-legend-compact": this.compactLabel,
|
|
91
|
-
} }, h("div", { key: '
|
|
91
|
+
} }, h("div", { key: '1ffa47a6b399b46b218a71a35e645f3c7f3e4699', class: "duet-fieldset-label" }, h("span", { key: '8f13839c07004cfa7b57c7e90a56a9416e5318cd', "aria-hidden": "true" }, this.label), h("slot", { key: '48871bac950c808682971d71b05bffb3e4d2f423', onSlotchange: this.checkHasTooltip, name: "tooltip" })), this.caption && (h("div", { key: '9a67fb599acf90e1b6711421f08b5f76776c9c2a', class: "duet-fieldset-caption", "aria-hidden": "true" }, h("duet-caption", { key: '4b40741c7e05704d6c7d8226a926a6a38ceff851', theme: this.theme, margin: "none" }, this.caption)))), h("slot", { key: 'f57fd8b8ab64c31c89e7daf22baa9c9ae1251cfa' }), h("span", { key: '3fc490294c332706136999063ea7b3091c95676d', class: "duet-fieldset-help duet-fieldset-error", id: this.errorId, "aria-atomic": "true", "aria-live": this.accessibleLiveError, "aria-relevant": "additions removals" }, this.error && h("span", { key: 'f8b4d8ccd2a8d7b1b0ef640f55520278995fe80b', class: { "duet-m-0": this.lastItemIsChip } }, this.error)))));
|
|
92
92
|
}
|
|
93
93
|
static get is() { return "duet-fieldset"; }
|
|
94
94
|
static get encapsulation() { return "shadow"; }
|
|
@@ -153,7 +153,7 @@ export class DuetUploadItem {
|
|
|
153
153
|
"references": {
|
|
154
154
|
"DuetFileChooserEvent": {
|
|
155
155
|
"location": "local",
|
|
156
|
-
"path": "/Users/
|
|
156
|
+
"path": "/Users/kasimir/projects/lahitapiola/duet-design-system/packages/components/src/components/duet-file-chooser/duet-file-chooser.tsx",
|
|
157
157
|
"id": "src/components/duet-file-chooser/duet-file-chooser.tsx::DuetFileChooserEvent"
|
|
158
158
|
}
|
|
159
159
|
}
|