@duetds/components 10.5.0 → 10.7.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 +658 -282
- package/hydrate/index.mjs +658 -282
- package/lib/cjs/{a11y-utils-DaAO4N9d.js → a11y-utils-DmCjy3Q3.js} +1 -1
- package/lib/cjs/{app-globals-CHNvdfQj.js → app-globals-D1tikFob.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 +17 -18
- 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 +22 -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 +7 -17
- package/lib/cjs/duet-contact-card.cjs.entry.js +18 -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 +12 -8
- package/lib/cjs/duet-header_2.cjs.entry.js +7 -7
- package/lib/cjs/duet-hero.cjs.entry.js +27 -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-teaser.cjs.entry.js +110 -0
- 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-Di-nO8ua.js} +1 -1
- package/lib/cjs/{focus-utils-BuGg0Oha.js → focus-utils-uEO1pi2O.js} +1 -1
- package/lib/cjs/{index-ZxE6MB5V.js → index-BGRMvA4R.js} +13 -9
- package/lib/cjs/{keyboard-utils-D9UlHbik.js → keyboard-utils-DibQafwg.js} +2 -0
- package/lib/cjs/{label-CpPOBfjS.js → label-CwgdRt0Q.js} +1 -1
- package/lib/cjs/{language-utils-C7Z0KYg-.js → language-utils-CrB5zNlc.js} +1 -1
- package/lib/cjs/loader.cjs.js +3 -3
- package/lib/cjs/picture-utils-CZhgDlXJ.js +20 -0
- package/lib/cjs/{slot-utils-BXdHT3A1.js → slot-utils-4v5bqyQh.js} +1 -1
- package/lib/cjs/{themeable-component-CIDaln0Z.js → themeable-component-I4SEm6nQ.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/collection-manifest.json +1 -0
- 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 +51 -7
- 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 +63 -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 +4 -16
- package/lib/collection/components/duet-contact-card/duet-contact-card.css +3 -0
- package/lib/collection/components/duet-contact-card/duet-contact-card.js +58 -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.css +22 -0
- package/lib/collection/components/duet-grid/duet-grid.js +17 -8
- 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 +235 -144
- package/lib/collection/components/duet-hero/duet-hero.js +72 -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 +58 -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-teaser/duet-teaser.css +127 -0
- package/lib/collection/components/duet-teaser/duet-teaser.js +462 -0
- 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/collection/utils/picture-utils.js +6 -1
- package/lib/duet/duet.esm.js +1 -1
- package/lib/duet/{p-61ec0e1c.entry.js → p-017873ec.entry.js} +1 -1
- package/lib/duet/{p-b1326cbb.entry.js → p-047af1e2.entry.js} +1 -1
- package/lib/duet/{p-516397ba.entry.js → p-058fcc72.entry.js} +1 -1
- package/lib/duet/p-05a6360b.entry.js +4 -0
- package/lib/duet/p-05b5ef84.entry.js +4 -0
- package/lib/duet/{p-6ef683d5.entry.js → p-07d43c60.entry.js} +1 -1
- package/lib/duet/{p-52beb436.entry.js → p-0ab559fb.entry.js} +1 -1
- package/lib/duet/{p-fe829b53.entry.js → p-0acf9bcf.entry.js} +1 -1
- package/lib/duet/{p-d3baa815.entry.js → p-0c42cc61.entry.js} +1 -1
- package/lib/duet/{p-443af533.entry.js → p-0df7094e.entry.js} +1 -1
- package/lib/duet/p-10baba94.entry.js +4 -0
- package/lib/duet/{p-30108edc.entry.js → p-1358a396.entry.js} +1 -1
- package/lib/duet/{p-70961edb.entry.js → p-1498e4a8.entry.js} +1 -1
- package/lib/duet/p-16d5dd2c.entry.js +4 -0
- package/lib/duet/p-1ec31f22.entry.js +4 -0
- package/lib/duet/{p-d6f0afa5.entry.js → p-2013545d.entry.js} +1 -1
- package/lib/duet/p-2265c46a.entry.js +4 -0
- package/lib/duet/{p-f040706c.entry.js → p-2394b3cd.entry.js} +1 -1
- package/lib/duet/{p-d779fe42.entry.js → p-2b17c517.entry.js} +1 -1
- package/lib/duet/{p-c54be349.entry.js → p-2f0f3a4a.entry.js} +1 -1
- package/lib/duet/{p-a9104184.entry.js → p-3ce04abc.entry.js} +1 -1
- package/lib/duet/{p-dedf6a32.entry.js → p-420df0aa.entry.js} +1 -1
- package/lib/duet/{p-c216e746.entry.js → p-430fad4e.entry.js} +1 -1
- package/lib/duet/p-453001ea.entry.js +4 -0
- package/lib/duet/{p-fa13ffe9.entry.js → p-4695398d.entry.js} +1 -1
- package/lib/duet/p-4bc7198d.entry.js +4 -0
- package/lib/duet/p-4e028274.entry.js +4 -0
- package/lib/duet/{p-8b0dfbd7.entry.js → p-5be103d0.entry.js} +1 -1
- package/lib/duet/{p-407f7f03.entry.js → p-5e5b6dc7.entry.js} +1 -1
- package/lib/duet/{p-42ec7305.entry.js → p-5fc88879.entry.js} +1 -1
- package/lib/duet/{p-e08dce92.entry.js → p-6865e880.entry.js} +1 -1
- package/lib/duet/{p-cb6c4158.entry.js → p-68a9ffb5.entry.js} +1 -1
- package/lib/duet/{p-b747f6e9.entry.js → p-69bcb076.entry.js} +1 -1
- package/lib/duet/p-71da8fbe.entry.js +4 -0
- package/lib/duet/{p-20a8ef81.entry.js → p-76e2c659.entry.js} +1 -1
- package/lib/duet/{p-74aac967.entry.js → p-7f5387dd.entry.js} +1 -1
- package/lib/duet/{p-110c7572.entry.js → p-84ed366e.entry.js} +1 -1
- package/lib/duet/{p-a8876b3d.entry.js → p-868647de.entry.js} +1 -1
- package/lib/duet/{p-a483117e.entry.js → p-8ad4bb4c.entry.js} +1 -1
- package/lib/duet/{p-3690576a.entry.js → p-8b9ffff4.entry.js} +1 -1
- package/lib/duet/{p-461d4089.entry.js → p-8da66626.entry.js} +1 -1
- package/lib/duet/{p-9ae7aaef.entry.js → p-8ea85c31.entry.js} +1 -1
- package/lib/duet/p-940a87e7.entry.js +4 -0
- package/lib/duet/{p-268b3066.entry.js → p-99550717.entry.js} +1 -1
- package/lib/duet/{p-8ace1eb4.entry.js → p-9987420d.entry.js} +1 -1
- package/lib/duet/{p-833802f9.entry.js → p-9d41df85.entry.js} +1 -1
- package/lib/duet/{p-3f7afd87.entry.js → p-9dee0205.entry.js} +1 -1
- package/lib/duet/{p-CFqvB5PA.js → p-B0XOGsB6.js} +1 -1
- package/lib/duet/p-B44ykle6.js +4 -0
- package/lib/duet/{p-R3pTP2Oy.js → p-B5SMAn1G.js} +1 -1
- package/lib/duet/p-BAiGBGTO.js +4 -0
- package/lib/duet/p-BWz_ChlU.js +4 -0
- package/lib/duet/p-BaefVzkx.js +4 -0
- package/lib/duet/{p-B8-N_qjs.js → p-Bnup2-sN.js} +1 -1
- package/lib/duet/p-C6rGA5IU.js +4 -0
- package/lib/duet/p-D4MpGrUR.js +5 -0
- package/lib/duet/p-DSNAI2Lx.js +4 -0
- package/lib/duet/{p-D2ly4TZR.js → p-DYmL1tSl.js} +1 -1
- package/lib/duet/{p-C5Yfx2kd.js → p-DtprEjjN.js} +1 -1
- package/lib/duet/{p-38973524.entry.js → p-a2106abd.entry.js} +1 -1
- package/lib/duet/p-a2a2f775.entry.js +4 -0
- package/lib/duet/{p-3277233e.entry.js → p-a2f7ef35.entry.js} +1 -1
- package/lib/duet/{p-829db926.entry.js → p-a62e6d8d.entry.js} +1 -1
- package/lib/duet/{p-40fa7371.entry.js → p-a6dc8c7d.entry.js} +1 -1
- package/lib/duet/{p-02d8e844.entry.js → p-a944ffff.entry.js} +1 -1
- package/lib/duet/{p-4b7f1244.entry.js → p-aebcf484.entry.js} +1 -1
- package/lib/duet/{p-bdbf0fae.entry.js → p-b2f0905a.entry.js} +1 -1
- package/lib/duet/p-b3a7ef62.entry.js +4 -0
- package/lib/duet/{p-70612314.entry.js → p-b4a1c719.entry.js} +1 -1
- package/lib/duet/p-b5204ec2.entry.js +4 -0
- package/lib/duet/{p-8012c7bc.entry.js → p-b58cfa18.entry.js} +1 -1
- package/lib/duet/{p-2dd7d75e.entry.js → p-b69946d4.entry.js} +1 -1
- package/lib/duet/{p-317e81f3.entry.js → p-b7351bfd.entry.js} +1 -1
- package/lib/duet/{p-3b2fba0f.entry.js → p-b7bb7472.entry.js} +1 -1
- package/lib/duet/{p-d3b5c997.entry.js → p-b9e97305.entry.js} +1 -1
- package/lib/duet/p-bb7fa0cf.entry.js +4 -0
- package/lib/duet/p-bef7eed7.entry.js +4 -0
- package/lib/duet/p-bffae8f6.entry.js +4 -0
- package/lib/duet/{p-c1afac0d.entry.js → p-c26e2123.entry.js} +1 -1
- package/lib/duet/{p-e7f2359a.entry.js → p-c49a72ad.entry.js} +1 -1
- package/lib/duet/{p-1da7703d.entry.js → p-c5c63d0f.entry.js} +1 -1
- package/lib/duet/{p-43e076b5.entry.js → p-c9a12663.entry.js} +1 -1
- package/lib/duet/{p-a5177d32.entry.js → p-ccaf5c28.entry.js} +1 -1
- package/lib/duet/{p-7fd39204.entry.js → p-d78923f9.entry.js} +1 -1
- package/lib/duet/p-d8383f1a.entry.js +4 -0
- package/lib/duet/{p-3f35fce3.entry.js → p-e3d91f53.entry.js} +1 -1
- package/lib/duet/p-e78af675.entry.js +4 -0
- package/lib/duet/{p-9e1a59d1.entry.js → p-e9a7215b.entry.js} +1 -1
- package/lib/duet/p-ebe55a34.entry.js +4 -0
- package/lib/duet/{p-efa4eecc.entry.js → p-ef340dc6.entry.js} +1 -1
- package/lib/duet/{p-317a1fc0.entry.js → p-f17438c7.entry.js} +1 -1
- package/lib/duet/{p-7353ee4c.entry.js → p-f264879d.entry.js} +1 -1
- package/lib/duet/p-f61ebeb1.entry.js +4 -0
- package/lib/duet/p-f647f09e.entry.js +4 -0
- package/lib/duet/p-f89da74c.entry.js +4 -0
- package/lib/duet/{p-2f8a47e2.entry.js → p-f959ca52.entry.js} +1 -1
- package/lib/duet/{p-19863cdf.entry.js → p-fb0f6212.entry.js} +1 -1
- package/lib/duet/p-fb59f80d.entry.js +4 -0
- package/lib/duet/{p-7eea47d5.entry.js → p-feae1702.entry.js} +1 -1
- package/lib/duet/p-kkZE1C6Z.js +4 -0
- package/lib/esm/{a11y-utils-ChN5Nhxh.js → a11y-utils-DZqe1lDK.js} +1 -1
- package/lib/esm/{app-globals-4kCk2rkO.js → app-globals-Byl9AdI1.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 +17 -18
- 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 +23 -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 +7 -17
- package/lib/esm/duet-contact-card.entry.js +18 -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 +12 -8
- package/lib/esm/duet-header_2.entry.js +7 -7
- package/lib/esm/duet-hero.entry.js +27 -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-teaser.entry.js +108 -0
- 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-KA3z1KuW.js} +1 -1
- package/lib/esm/{focus-utils-CFswdkeD.js → focus-utils-id9x3opi.js} +1 -1
- package/lib/esm/{index-B2cboDWM.js → index-D4MpGrUR.js} +13 -9
- package/lib/esm/{keyboard-utils-Db8rvjPI.js → keyboard-utils-BaefVzkx.js} +2 -1
- package/lib/esm/{label-CJxIWUOT.js → label-Caev3m-F.js} +1 -1
- package/lib/esm/{language-utils-C4M4ASkT.js → language-utils-DTyUbpD-.js} +1 -1
- package/lib/esm/loader.js +4 -4
- package/lib/esm/picture-utils-4PMNZDR2.js +18 -0
- package/lib/esm/{slot-utils--sNK1DNn.js → slot-utils-BhEk4zKY.js} +1 -1
- package/lib/esm/{themeable-component-BBi3552X.js → themeable-component-B_d7Klmd.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 +10 -1
- package/lib/types/components/duet-button/duet-button.d.ts +1 -1
- package/lib/types/components/duet-card/duet-card.d.ts +10 -0
- package/lib/types/components/duet-chip/duet-chip.d.ts +15 -8
- package/lib/types/components/duet-combobox/duet-combobox.d.ts +0 -1
- package/lib/types/components/duet-contact-card/duet-contact-card.d.ts +10 -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-grid/duet-grid.d.ts +2 -1
- package/lib/types/components/duet-hero/duet-hero.d.ts +10 -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 +11 -0
- package/lib/types/components/duet-teaser/duet-teaser.d.ts +93 -0
- package/lib/types/components.d.ts +291 -14
- package/lib/types/utils/keyboard-utils.d.ts +1 -0
- package/lib/types/utils/picture-utils.d.ts +4 -0
- package/package.json +5 -5
- package/lib/duet/p-06297bd8.entry.js +0 -4
- 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-5f5f72d4.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-734249e0.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-93ff8fe4.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-BzYmwX5_.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-a068c086.entry.js +0 -4
- package/lib/duet/p-c2026c6b.entry.js +0 -4
- package/lib/duet/p-cbcee3e2.entry.js +0 -4
- package/lib/duet/p-d5f90dbc.entry.js +0 -4
- package/lib/duet/p-s8EL6NG5.js +0 -4
|
@@ -28,9 +28,11 @@ export class DuetChip {
|
|
|
28
28
|
/**
|
|
29
29
|
* Variation of the chip.
|
|
30
30
|
* Button should be used to present a list of actions or suggestions. It behaves like a button and must be used
|
|
31
|
-
* together with a click handler. Filter acts like a checkbox, it can be toggled on or off, and it should be
|
|
32
|
-
*
|
|
33
|
-
*
|
|
31
|
+
* together with a click handler. Filter acts like a checkbox, it can be toggled on or off, and it should be used with
|
|
32
|
+
* a value. Filter can also be used with a popup-menu - then the initial text describes the type of category of
|
|
33
|
+
* filtering, and the selection from the popup-menu sets the filter value. Input represents items input by the user,
|
|
34
|
+
* and the chip can be removed with a click. Radio behaves like a radio button, it can be toggled on or off in a group,
|
|
35
|
+
* and it should be used with a value and name.
|
|
34
36
|
*/
|
|
35
37
|
this.variation = "button";
|
|
36
38
|
/**
|
|
@@ -64,6 +66,10 @@ export class DuetChip {
|
|
|
64
66
|
* Use this property to add an aria-haspopup attribute.
|
|
65
67
|
*/
|
|
66
68
|
this.accessiblePopup = "false";
|
|
69
|
+
/**
|
|
70
|
+
* Indicates the id or a string of space seperated ids of a component(s) that describes the input.
|
|
71
|
+
*/
|
|
72
|
+
this.accessibleDescribedBy = "";
|
|
67
73
|
this.enforceNoDisabledSelected = () => {
|
|
68
74
|
if (this.disabled && this.checked) {
|
|
69
75
|
console.error("Duet error: pre-selected chip may not be disabled");
|
|
@@ -95,6 +101,9 @@ export class DuetChip {
|
|
|
95
101
|
radioInput.value = this.value;
|
|
96
102
|
radioInput.checked = this.checked;
|
|
97
103
|
radioInput.ariaLabel = this.element.textContent;
|
|
104
|
+
if (!!this.accessibleDescribedBy) {
|
|
105
|
+
radioInput.setAttribute("aria-describedby", this.accessibleDescribedBy);
|
|
106
|
+
}
|
|
98
107
|
if (slotInput) {
|
|
99
108
|
this.radioInputListenersRemove(radioInput);
|
|
100
109
|
}
|
|
@@ -104,13 +113,15 @@ export class DuetChip {
|
|
|
104
113
|
this.radioInputListenersAdd(radioInput);
|
|
105
114
|
this.focusableElement = radioInput;
|
|
106
115
|
};
|
|
116
|
+
this.originalFilterChipText = "";
|
|
117
|
+
this.originalFilterChipValue = "";
|
|
107
118
|
this.popupSetUp = () => {
|
|
108
119
|
const popup = document.querySelector(`duet-popup-menu#${this.popup}`);
|
|
109
120
|
if (popup) {
|
|
110
121
|
this.popupElement = popup;
|
|
111
122
|
popup.controller = this.element;
|
|
112
|
-
|
|
113
|
-
|
|
123
|
+
this.originalFilterChipText = this.element.textContent;
|
|
124
|
+
this.originalFilterChipValue = this.value;
|
|
114
125
|
if (!popup.id) {
|
|
115
126
|
popup.id = "popup-menu";
|
|
116
127
|
}
|
|
@@ -135,8 +146,8 @@ export class DuetChip {
|
|
|
135
146
|
}
|
|
136
147
|
else {
|
|
137
148
|
clearActive();
|
|
138
|
-
this.element.textContent =
|
|
139
|
-
this.value =
|
|
149
|
+
this.element.textContent = this.originalFilterChipText;
|
|
150
|
+
this.value = this.originalFilterChipValue;
|
|
140
151
|
this.checked = false;
|
|
141
152
|
}
|
|
142
153
|
this.emitChange(evt);
|
|
@@ -287,6 +298,11 @@ export class DuetChip {
|
|
|
287
298
|
getAccessibleInputChipLabel() {
|
|
288
299
|
return `${this.element.textContent}${this.selected ? ` (${getLocaleString(this.selectedForDeletionLabels)}) ` : ""},`;
|
|
289
300
|
}
|
|
301
|
+
getAccessibleFilterLabel() {
|
|
302
|
+
return this.value !== this.originalFilterChipValue
|
|
303
|
+
? `${this.originalFilterChipText}: ${this.element.textContent}`
|
|
304
|
+
: undefined;
|
|
305
|
+
}
|
|
290
306
|
/**
|
|
291
307
|
* Sets focus. Use this method instead of the global focus().
|
|
292
308
|
*/
|
|
@@ -331,7 +347,7 @@ export class DuetChip {
|
|
|
331
347
|
onBlur: this.onBlur,
|
|
332
348
|
ref: el => (this.focusableElement = el),
|
|
333
349
|
};
|
|
334
|
-
return (h(Host, { key: '
|
|
350
|
+
return (h(Host, { key: '84203a4f6d7de284823eb560bfb95b2aec1ac5e4', class: { [this.variation]: true } }, this.variation === "button" && (h("span", { key: '3c735a109cf161c40ff2eb4cdd3ab6ae9ccd07f1', class: classes }, h("button", Object.assign({ key: 'd91978a69db645b988514f9fe147ff6a0e618f06', id: identifier, "aria-label": this.accessibleLabel, "aria-describedby": this.accessibleDescribedBy || undefined, "aria-haspopup": this.getAccessiblePopup(), "aria-expanded": this.getAccessibleExpanded(), "aria-disabled": this.disabled ? "true" : undefined, name: this.name, value: this.value, onClick: this.disabled ? evt => evt.stopPropagation() : undefined }, focusHandlers), h("span", { key: '00a9bfa1e9b1654a6b1bdbd47298f54ccdc445f5', class: "duet-chip-icon-container" }, this.icon && (h("duet-icon", { key: '2f8756f5ffb41e04e5842dab15f1b908086c753d', name: this.icon, size: "x-small", margin: "none", color: "currentColor" }))), h("slot", { key: '2e791bd8bab1495608208ad696fe9150ddc28e34' })))), this.variation === "input" && (h("span", { key: 'd6a9ece4abe8ebac562a31e3970255bbe4f8eadd', class: classes }, h("button", Object.assign({ key: 'dbb7a3ee7849bb53b58bae7dcb6373ec685de638', id: identifier, class: "duet-chip-input-button", value: this.value, "aria-label": this.getAccessibleInputChipLabel(), "aria-describedby": this.accessibleDescribedBy, onMouseOver: () => (this.inputChipHover = true), onMouseOut: () => (this.inputChipHover = false), onClick: () => (this.selected = !this.selected) }, focusHandlers), h("span", { key: '1e0b295b70924c7bbaf945ba1af950f63668c5a8', class: "duet-chip-icon-container" }, this.icon && (h("duet-icon", { key: '1d5ec89006c85f4b8a630215a19055d863c67416', name: this.icon, size: "x-small", margin: "none", color: "currentColor" }))), h("slot", { key: '5f52df5a6d4d675f24a6bd927593e336612997f5' })), h("button", { key: 'f056e733dcc146eed6228a060736690a33c40311', class: "duet-chip-remove-button", "aria-label": this.getAccessibleDeleteLabel(), onClick: this.onRemoveClick, onFocus: () => (this.inputChipDeleteFocus = true), onBlur: () => (this.inputChipDeleteFocus = false), ref: el => (this.deleteButtonElement = el) }, h("duet-icon", { key: '6f052eca141e3eea229954f7034c479d14c38d6f', name: "activity-close", size: "xx-small", margin: "none", color: "currentColor" })))), this.variation === "filter" && (h("span", { key: 'b573900d3ad93f1e8f49bb1f27e7d1d5e87f1ad3', class: classes }, h("input", Object.assign({ key: 'd558bee064252fff70ef6db2b7292d8e5019bd78', "aria-haspopup": this.getAccessiblePopup(), "aria-controls": (_a = this.popupElement) === null || _a === void 0 ? void 0 : _a.id, "aria-expanded": this.getAccessibleExpanded(), "aria-disabled": this.disabled ? "true" : undefined, "aria-label": this.getAccessibleFilterLabel(), "aria-describedby": this.accessibleDescribedBy || undefined, id: identifier, type: "checkbox", name: this.name, value: this.value, checked: this.checked, onClick: this.onFilterClick, onChange: this.onFilterChange }, focusHandlers)), h("label", { key: '7f88107a9734bd1142d00dc26ce1ceed694b0904', htmlFor: identifier }, this.icon && (h("span", { key: '35559b51d65f9d609edebe6d641c11f936b43bd2', class: "duet-chip-icon-container" }, h("duet-icon", { key: 'a1a51b616e4fb7c9d949bfca74a6cb1a7fa549a5', name: this.icon, size: this.size === "large" ? "small" : "x-small", margin: "none", color: "currentColor" }), h("duet-icon", { key: '320133b510ed5702a9fd1a30f01deb9b266531f8', name: "messaging-checked-small", size: this.size === "large" ? "x-small" : "xx-small", margin: "none", color: "currentColor", class: "check-mark" }))), h("slot", { key: 'b1133a5c686b6c8fc8a6f7d16281b25a584f8943' }), this.popupElement && (h("span", { key: 'd6d6785289ba11bfcb83877c45f85e9ad9f43683', class: "duet-chip-popup-disclosure" }, h("duet-icon", { key: '3c930adbf23abfeee3d2c5fcbbb151878a4b9a39', name: "action-arrow-down-small", size: this.size === "large" ? "xx-small" : "xxx-small", margin: "none", color: "currentColor" })))))), this.variation === "radio" && (h("span", { key: 'aa5035fea2416069bc01fe07a28b3da134fdd886', class: classes }, h("slot", { key: 'f861682874396c57779c427fb4f89556884f9434', name: "input" }), h("label", { key: '80a7465dae485bf1cdcbee5b10210dc158c6425b', htmlFor: identifier }, this.icon && (h("span", { key: 'dc5ffe43af42a08253de88bdc17a16022cd3a40d', class: "duet-chip-icon-container" }, h("duet-icon", { key: 'c0b3326871d1f440b1196fdef2d6a6961b8b883f', name: this.icon, size: this.size === "large" ? "small" : "x-small", margin: "none", color: "currentColor" }), h("duet-icon", { key: 'f6d6f16565393969a6945d11f00736726e95aef1', name: "messaging-checked-small", size: "xx-small", margin: "none", color: "currentColor", class: "check-mark" }))), h("slot", { key: '8ba0c81daff6bc6f966afd5f75582a89f932e8b1' }))))));
|
|
335
351
|
}
|
|
336
352
|
static get is() { return "duet-chip"; }
|
|
337
353
|
static get encapsulation() { return "shadow"; }
|
|
@@ -360,7 +376,7 @@ export class DuetChip {
|
|
|
360
376
|
"optional": false,
|
|
361
377
|
"docs": {
|
|
362
378
|
"tags": [],
|
|
363
|
-
"text": "Adds accessible label for the chip that is
|
|
379
|
+
"text": "Adds accessible label for the chip that is used by screen readers and other assistive technology. Has effect only\nwith \"button\" variation as for the other variations the accessible label is automatically generated."
|
|
364
380
|
},
|
|
365
381
|
"getter": false,
|
|
366
382
|
"setter": false,
|
|
@@ -376,7 +392,7 @@ export class DuetChip {
|
|
|
376
392
|
"references": {
|
|
377
393
|
"DuetChipVariation": {
|
|
378
394
|
"location": "local",
|
|
379
|
-
"path": "/Users/
|
|
395
|
+
"path": "/Users/kasimir/projects/lahitapiola/duet-design-system/packages/components/src/components/duet-chip/duet-chip.tsx",
|
|
380
396
|
"id": "src/components/duet-chip/duet-chip.tsx::DuetChipVariation"
|
|
381
397
|
}
|
|
382
398
|
}
|
|
@@ -385,7 +401,7 @@ export class DuetChip {
|
|
|
385
401
|
"optional": false,
|
|
386
402
|
"docs": {
|
|
387
403
|
"tags": [],
|
|
388
|
-
"text": "Variation of the chip.\nButton should be used to present a list of actions or suggestions. It behaves like a button and must be used\ntogether with a click handler. Filter acts like a checkbox, it can be toggled on or off, and it should be\
|
|
404
|
+
"text": "Variation of the chip.\nButton should be used to present a list of actions or suggestions. It behaves like a button and must be used\ntogether with a click handler. Filter acts like a checkbox, it can be toggled on or off, and it should be used with\na value. Filter can also be used with a popup-menu - then the initial text describes the type of category of\nfiltering, and the selection from the popup-menu sets the filter value. Input represents items input by the user,\nand the chip can be removed with a click. Radio behaves like a radio button, it can be toggled on or off in a group,\nand it should be used with a value and name."
|
|
389
405
|
},
|
|
390
406
|
"getter": false,
|
|
391
407
|
"setter": false,
|
|
@@ -402,7 +418,7 @@ export class DuetChip {
|
|
|
402
418
|
"references": {
|
|
403
419
|
"DuetChipSize": {
|
|
404
420
|
"location": "local",
|
|
405
|
-
"path": "/Users/
|
|
421
|
+
"path": "/Users/kasimir/projects/lahitapiola/duet-design-system/packages/components/src/components/duet-chip/duet-chip.tsx",
|
|
406
422
|
"id": "src/components/duet-chip/duet-chip.tsx::DuetChipSize"
|
|
407
423
|
}
|
|
408
424
|
}
|
|
@@ -431,7 +447,7 @@ export class DuetChip {
|
|
|
431
447
|
"optional": false,
|
|
432
448
|
"docs": {
|
|
433
449
|
"tags": [],
|
|
434
|
-
"text": "Id of the DuetPopupMenu that is controlled by the chip."
|
|
450
|
+
"text": "Id of the DuetPopupMenu that is controlled by the chip. Works only with \"filter\" variation."
|
|
435
451
|
},
|
|
436
452
|
"getter": false,
|
|
437
453
|
"setter": false,
|
|
@@ -647,6 +663,26 @@ export class DuetChip {
|
|
|
647
663
|
"setter": false,
|
|
648
664
|
"reflect": true,
|
|
649
665
|
"defaultValue": "\"false\""
|
|
666
|
+
},
|
|
667
|
+
"accessibleDescribedBy": {
|
|
668
|
+
"type": "string",
|
|
669
|
+
"attribute": "accessible-described-by",
|
|
670
|
+
"mutable": false,
|
|
671
|
+
"complexType": {
|
|
672
|
+
"original": "string",
|
|
673
|
+
"resolved": "string",
|
|
674
|
+
"references": {}
|
|
675
|
+
},
|
|
676
|
+
"required": false,
|
|
677
|
+
"optional": false,
|
|
678
|
+
"docs": {
|
|
679
|
+
"tags": [],
|
|
680
|
+
"text": "Indicates the id or a string of space seperated ids of a component(s) that describes the input."
|
|
681
|
+
},
|
|
682
|
+
"getter": false,
|
|
683
|
+
"setter": false,
|
|
684
|
+
"reflect": false,
|
|
685
|
+
"defaultValue": "\"\""
|
|
650
686
|
}
|
|
651
687
|
};
|
|
652
688
|
}
|
|
@@ -676,7 +712,7 @@ export class DuetChip {
|
|
|
676
712
|
"references": {
|
|
677
713
|
"DuetChipEvent": {
|
|
678
714
|
"location": "local",
|
|
679
|
-
"path": "/Users/
|
|
715
|
+
"path": "/Users/kasimir/projects/lahitapiola/duet-design-system/packages/components/src/components/duet-chip/duet-chip.tsx",
|
|
680
716
|
"id": "src/components/duet-chip/duet-chip.tsx::DuetChipEvent"
|
|
681
717
|
}
|
|
682
718
|
}
|
|
@@ -697,7 +733,7 @@ export class DuetChip {
|
|
|
697
733
|
"references": {
|
|
698
734
|
"DuetChipEvent": {
|
|
699
735
|
"location": "local",
|
|
700
|
-
"path": "/Users/
|
|
736
|
+
"path": "/Users/kasimir/projects/lahitapiola/duet-design-system/packages/components/src/components/duet-chip/duet-chip.tsx",
|
|
701
737
|
"id": "src/components/duet-chip/duet-chip.tsx::DuetChipEvent"
|
|
702
738
|
}
|
|
703
739
|
}
|
|
@@ -718,7 +754,7 @@ export class DuetChip {
|
|
|
718
754
|
"references": {
|
|
719
755
|
"DuetChipEvent": {
|
|
720
756
|
"location": "local",
|
|
721
|
-
"path": "/Users/
|
|
757
|
+
"path": "/Users/kasimir/projects/lahitapiola/duet-design-system/packages/components/src/components/duet-chip/duet-chip.tsx",
|
|
722
758
|
"id": "src/components/duet-chip/duet-chip.tsx::DuetChipEvent"
|
|
723
759
|
}
|
|
724
760
|
}
|
|
@@ -739,7 +775,7 @@ export class DuetChip {
|
|
|
739
775
|
"references": {
|
|
740
776
|
"DuetChipEvent": {
|
|
741
777
|
"location": "local",
|
|
742
|
-
"path": "/Users/
|
|
778
|
+
"path": "/Users/kasimir/projects/lahitapiola/duet-design-system/packages/components/src/components/duet-chip/duet-chip.tsx",
|
|
743
779
|
"id": "src/components/duet-chip/duet-chip.tsx::DuetChipEvent"
|
|
744
780
|
}
|
|
745
781
|
}
|
|
@@ -33,11 +33,11 @@ export class DuetCheckmark {
|
|
|
33
33
|
inheritGlobalTheme(this);
|
|
34
34
|
}
|
|
35
35
|
render() {
|
|
36
|
-
return (h(Host, { key: '
|
|
36
|
+
return (h(Host, { key: '599968da32eca61083a4709ce013889772213f97', class: { "duet-theme-turva": this.theme === "turva" } }, h("div", { key: '57f28c3d631c55101a557422617bbd4507ccd2cc', role: this.presentationOnly ? "presentation" : null, class: { checked: this.checked } }, h("div", { key: '6dcd9490f08a532578bd12aa808e40ff5014597d', class: {
|
|
37
37
|
"duet-checkmark-container": true,
|
|
38
38
|
center: this.center,
|
|
39
39
|
"duet-checkmark-radio": this.type === "radio",
|
|
40
|
-
} }, this.checked && h("div", { key: '
|
|
40
|
+
} }, this.checked && h("div", { key: '8c27e1f31cf9e1625838308435b62ac73421d350', class: "duet-checkmark" })))));
|
|
41
41
|
}
|
|
42
42
|
static get is() { return "duet-checkmark"; }
|
|
43
43
|
static get originalStyleUrls() {
|
|
@@ -1221,7 +1221,7 @@ export class DuetChoice {
|
|
|
1221
1221
|
"references": {
|
|
1222
1222
|
"DuetChoiceEvent": {
|
|
1223
1223
|
"location": "local",
|
|
1224
|
-
"path": "/Users/
|
|
1224
|
+
"path": "/Users/kasimir/projects/lahitapiola/duet-design-system/packages/components/src/components/duet-choice/duet-choice.tsx",
|
|
1225
1225
|
"id": "src/components/duet-choice/duet-choice.tsx::DuetChoiceEvent"
|
|
1226
1226
|
}
|
|
1227
1227
|
}
|
|
@@ -1242,7 +1242,7 @@ export class DuetChoice {
|
|
|
1242
1242
|
"references": {
|
|
1243
1243
|
"DuetChoiceEvent": {
|
|
1244
1244
|
"location": "local",
|
|
1245
|
-
"path": "/Users/
|
|
1245
|
+
"path": "/Users/kasimir/projects/lahitapiola/duet-design-system/packages/components/src/components/duet-choice/duet-choice.tsx",
|
|
1246
1246
|
"id": "src/components/duet-choice/duet-choice.tsx::DuetChoiceEvent"
|
|
1247
1247
|
}
|
|
1248
1248
|
}
|
|
@@ -1263,7 +1263,7 @@ export class DuetChoice {
|
|
|
1263
1263
|
"references": {
|
|
1264
1264
|
"DuetChoiceEvent": {
|
|
1265
1265
|
"location": "local",
|
|
1266
|
-
"path": "/Users/
|
|
1266
|
+
"path": "/Users/kasimir/projects/lahitapiola/duet-design-system/packages/components/src/components/duet-choice/duet-choice.tsx",
|
|
1267
1267
|
"id": "src/components/duet-choice/duet-choice.tsx::DuetChoiceEvent"
|
|
1268
1268
|
}
|
|
1269
1269
|
}
|
|
@@ -181,14 +181,14 @@ export class DuetChoiceGroup {
|
|
|
181
181
|
* Always the last one in the class.
|
|
182
182
|
*/
|
|
183
183
|
render() {
|
|
184
|
-
return (h(Host, { key: '
|
|
184
|
+
return (h(Host, { key: 'd310a51e8554b474adaaa10b91392effcac7e189', onDuetChange: this.onSelect, onDuetChoiceReady: this.onChoiceReady, class: {
|
|
185
185
|
horizontal: this.direction === "horizontal",
|
|
186
186
|
"duet-choice-group-breakpoint-x-small": this.responsive && this.breakpoint === "x-small",
|
|
187
187
|
"duet-choice-group-breakpoint-small": this.responsive && this.breakpoint === "small",
|
|
188
188
|
"duet-choice-group-breakpoint-medium": this.responsive && this.breakpoint === "medium",
|
|
189
189
|
"duet-choice-group-breakpoint-large": this.responsive && this.breakpoint === "large",
|
|
190
190
|
"duet-choice-group-breakpoint-x-large": this.responsive && this.breakpoint === "x-large",
|
|
191
|
-
} }, h("duet-fieldset", { key: '
|
|
191
|
+
} }, h("duet-fieldset", { key: 'a107c1b68c3227d3236020bb9721218f1be052fd', label: this.label, labelHidden: this.labelHidden, compactLabel: true, caption: this.caption, error: this.error, margin: this.margin, theme: this.theme, "accessible-live-error": this.accessibleLiveError }, this.tooltip && (h("duet-tooltip", { key: '0e45f60e7b2ebe7f30f0f87216bbcc176244f80a', slot: "tooltip", direction: this.tooltipDirection, accessibleInputLabel: this.label }, this.tooltip)), h("slot", { key: 'd129fc812d0be8450b08588910c30be0b4db8a02', name: "tooltip", slot: "tooltip" }), h("div", { key: 'e2ca5fd41342dd4b38442fbb718f2a06c1ba3237', class: { [this.choiceGroupName]: true, "duet-no-stacking": !this.responsive } }, h("slot", { key: '12f74fdf5360122b6d5fef83495ba68dede524da' })))));
|
|
192
192
|
}
|
|
193
193
|
static get is() { return "duet-choice-group"; }
|
|
194
194
|
static get encapsulation() { return "shadow"; }
|
|
@@ -356,7 +356,7 @@ export class DuetCollapsible {
|
|
|
356
356
|
"references": {
|
|
357
357
|
"DuetCollapsibleWeight": {
|
|
358
358
|
"location": "local",
|
|
359
|
-
"path": "/Users/
|
|
359
|
+
"path": "/Users/kasimir/projects/lahitapiola/duet-design-system/packages/components/src/components/duet-collapsible/duet-collapsible.tsx",
|
|
360
360
|
"id": "src/components/duet-collapsible/duet-collapsible.tsx::DuetCollapsibleWeight"
|
|
361
361
|
}
|
|
362
362
|
}
|
|
@@ -382,7 +382,7 @@ export class DuetCollapsible {
|
|
|
382
382
|
"references": {
|
|
383
383
|
"DuetCollapsibleHeadingFontSize": {
|
|
384
384
|
"location": "local",
|
|
385
|
-
"path": "/Users/
|
|
385
|
+
"path": "/Users/kasimir/projects/lahitapiola/duet-design-system/packages/components/src/components/duet-collapsible/duet-collapsible.tsx",
|
|
386
386
|
"id": "src/components/duet-collapsible/duet-collapsible.tsx::DuetCollapsibleHeadingFontSize"
|
|
387
387
|
}
|
|
388
388
|
}
|
|
@@ -489,7 +489,7 @@ export class DuetCollapsible {
|
|
|
489
489
|
"references": {
|
|
490
490
|
"DuetCollapsibleToggleEvent": {
|
|
491
491
|
"location": "local",
|
|
492
|
-
"path": "/Users/
|
|
492
|
+
"path": "/Users/kasimir/projects/lahitapiola/duet-design-system/packages/components/src/components/duet-collapsible/duet-collapsible.tsx",
|
|
493
493
|
"id": "src/components/duet-collapsible/duet-collapsible.tsx::DuetCollapsibleToggleEvent"
|
|
494
494
|
}
|
|
495
495
|
}
|
|
@@ -137,7 +137,7 @@ export class DuetCombobox {
|
|
|
137
137
|
if (!this.force && !this.multiple && this.selectedItems.size > 0 && newValue !== this.getSelectedItemLabel()) {
|
|
138
138
|
this.selectedItems.clear();
|
|
139
139
|
}
|
|
140
|
-
if (!this.
|
|
140
|
+
if (!this.multiple && newValue === "") {
|
|
141
141
|
this.value = undefined;
|
|
142
142
|
}
|
|
143
143
|
this.listOpen = String(newValue).length >= this.minCharacters && ((_a = this.getFilteredItems()) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
@@ -245,15 +245,6 @@ export class DuetCombobox {
|
|
|
245
245
|
}
|
|
246
246
|
this.activeItemAnnouncement = "";
|
|
247
247
|
}
|
|
248
|
-
inputValueHandler() {
|
|
249
|
-
setTimeout(async () => {
|
|
250
|
-
const label = await this.getSelectedItemLabel();
|
|
251
|
-
if (this.input.value == "" && label) {
|
|
252
|
-
this.input.value = "";
|
|
253
|
-
this.value = undefined;
|
|
254
|
-
}
|
|
255
|
-
}, 200);
|
|
256
|
-
}
|
|
257
248
|
handleDocumentClick(e) {
|
|
258
249
|
//we want to remove all user text if they have NOT selected from the dropdown
|
|
259
250
|
const path = e.composedPath();
|
|
@@ -853,7 +844,7 @@ export class DuetCombobox {
|
|
|
853
844
|
"references": {
|
|
854
845
|
"DuetComboboxItem": {
|
|
855
846
|
"location": "local",
|
|
856
|
-
"path": "/Users/
|
|
847
|
+
"path": "/Users/kasimir/projects/lahitapiola/duet-design-system/packages/components/src/components/duet-combobox/duet-combobox.tsx",
|
|
857
848
|
"id": "src/components/duet-combobox/duet-combobox.tsx::DuetComboboxItem"
|
|
858
849
|
}
|
|
859
850
|
}
|
|
@@ -983,7 +974,7 @@ export class DuetCombobox {
|
|
|
983
974
|
"references": {
|
|
984
975
|
"DuetComboboxEvent": {
|
|
985
976
|
"location": "local",
|
|
986
|
-
"path": "/Users/
|
|
977
|
+
"path": "/Users/kasimir/projects/lahitapiola/duet-design-system/packages/components/src/components/duet-combobox/duet-combobox.tsx",
|
|
987
978
|
"id": "src/components/duet-combobox/duet-combobox.tsx::DuetComboboxEvent"
|
|
988
979
|
}
|
|
989
980
|
}
|
|
@@ -1007,7 +998,7 @@ export class DuetCombobox {
|
|
|
1007
998
|
},
|
|
1008
999
|
"DuetComboboxItem": {
|
|
1009
1000
|
"location": "local",
|
|
1010
|
-
"path": "/Users/
|
|
1001
|
+
"path": "/Users/kasimir/projects/lahitapiola/duet-design-system/packages/components/src/components/duet-combobox/duet-combobox.tsx",
|
|
1011
1002
|
"id": "src/components/duet-combobox/duet-combobox.tsx::DuetComboboxItem"
|
|
1012
1003
|
}
|
|
1013
1004
|
},
|
|
@@ -1031,9 +1022,6 @@ export class DuetCombobox {
|
|
|
1031
1022
|
}, {
|
|
1032
1023
|
"propName": "activeItem",
|
|
1033
1024
|
"methodName": "activeItemHandler"
|
|
1034
|
-
}, {
|
|
1035
|
-
"propName": "inputValue",
|
|
1036
|
-
"methodName": "inputValueHandler"
|
|
1037
1025
|
}, {
|
|
1038
1026
|
"propName": "items",
|
|
1039
1027
|
"methodName": "processItems"
|
|
@@ -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,20 @@ 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: this.imagePriority === "high" ? "eager" : "lazy",
|
|
57
|
+
fetchpriority: this.imagePriority,
|
|
58
|
+
class: "image",
|
|
59
|
+
},
|
|
60
|
+
sources: parsePossibleJSON(this.sources),
|
|
61
|
+
};
|
|
62
|
+
return (h(Host, { key: 'e33b5a9345cc0e38336978b22b5a5e833bb03bb9', class: { "duet-m-0": this.margin === "none" } }, h("div", { key: '836de470febdb6a96d024a08f55a25a62392b350', class: {
|
|
51
63
|
"duet-contact-card": true,
|
|
52
64
|
"duet-theme-turva": this.theme === "turva",
|
|
53
|
-
}, role: "group", "aria-label": this.name }, this.image ? h(
|
|
65
|
+
}, role: "group", "aria-label": this.name }, this.image ? h(DuetPicture, Object.assign({}, pictureSource)) : h("div", null), h("div", { key: '7b0b31acf238f0b6c8a8579bc22f5f819fa794a3' }, this.name && (h("duet-heading", { key: '03c95063f1c164feeee6d7ffec8050e76a863065', class: "name", level: "h3", margin: "none", theme: theme }, this.name)), this.description && (h("duet-paragraph", { key: '35343cc1d650f5f6f83d1c98db2e7d5d8df32232', class: "description", margin: "none", theme: theme }, this.description)), this.email && (h("div", { key: 'a4565eeb9a17b36e5cb086f4a7a071f7da471958', class: "email" }, h("duet-icon", { key: '622531d9bba0fb9991aa5d15577d906aa637fb97', name: "navigation-message", size: "x-small", color: "primary-dark", margin: "none", theme: theme }), h("duet-link", { key: 'dc454c0170ea57a3e9e9a1c891cda1852c20330c', url: `mailto:${this.email}`, accessibleLabel: `Email: ${this.email}`, theme: theme }, this.email))), this.phone && (h("div", { key: '8df6d3ba05579ea713093fb7a254c85ea2827f17', class: "phone" }, h("duet-icon", { key: 'c0551285cbe9b64e23ca131cbc6be05efab7bbe1', name: "form-tel", size: "x-small", color: "primary-dark", margin: "none", theme: theme }), h("duet-link", { key: 'd3f01bfb37c0120280514925cb386a75f660ee26', url: `tel:${this.phone}`, accessibleLabel: `${this.phoneLabel[this.language]}: ${this.phone}`, theme: theme }, this.phone)))), this.buttonUrl && this.buttonText && (h("div", { key: 'df56d1a6ac897401fa74b40da6f163908dedd2db', class: "call-to-action" }, h("duet-button", { key: 'be684b20bf8f7f976cc2b8934b10650c09dc824d', variation: "default", icon: this.buttonIcon, fixed: true, margin: "none", url: this.buttonUrl, theme: theme }, this.buttonText))), h("div", { key: 'c1719ef0b401fd6d6a189a68ad61a6339f1299c9' }), h("slot", { key: '59366556e70ea407134c67f51da830cab886171d' }))));
|
|
54
66
|
}
|
|
55
67
|
static get is() { return "duet-contact-card"; }
|
|
56
68
|
static get encapsulation() { return "shadow"; }
|
|
@@ -137,6 +149,50 @@ export class DuetContactCard {
|
|
|
137
149
|
"setter": false,
|
|
138
150
|
"reflect": false
|
|
139
151
|
},
|
|
152
|
+
"imagePriority": {
|
|
153
|
+
"type": "string",
|
|
154
|
+
"attribute": "image-priority",
|
|
155
|
+
"mutable": false,
|
|
156
|
+
"complexType": {
|
|
157
|
+
"original": "\"high\" | \"low\"",
|
|
158
|
+
"resolved": "\"high\" | \"low\"",
|
|
159
|
+
"references": {}
|
|
160
|
+
},
|
|
161
|
+
"required": false,
|
|
162
|
+
"optional": false,
|
|
163
|
+
"docs": {
|
|
164
|
+
"tags": [],
|
|
165
|
+
"text": "Make the image load with higher or lower priority. Value \"high\" sets the img's attributes fetchpriority and loading to\n\"high\" and \"eager\", while value \"low\" sets those attributes to \"low\" and \"lazy\""
|
|
166
|
+
},
|
|
167
|
+
"getter": false,
|
|
168
|
+
"setter": false,
|
|
169
|
+
"reflect": false
|
|
170
|
+
},
|
|
171
|
+
"sources": {
|
|
172
|
+
"type": "string",
|
|
173
|
+
"attribute": "sources",
|
|
174
|
+
"mutable": false,
|
|
175
|
+
"complexType": {
|
|
176
|
+
"original": "DuetSource[] | string",
|
|
177
|
+
"resolved": "DuetSource[] | string",
|
|
178
|
+
"references": {
|
|
179
|
+
"DuetSource": {
|
|
180
|
+
"location": "import",
|
|
181
|
+
"path": "../../utils/picture-utils",
|
|
182
|
+
"id": "src/utils/picture-utils.tsx::DuetSource"
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
"required": false,
|
|
187
|
+
"optional": false,
|
|
188
|
+
"docs": {
|
|
189
|
+
"tags": [],
|
|
190
|
+
"text": "Array of sources for responsive images. Sources have the properties of <source> element."
|
|
191
|
+
},
|
|
192
|
+
"getter": false,
|
|
193
|
+
"setter": false,
|
|
194
|
+
"reflect": false
|
|
195
|
+
},
|
|
140
196
|
"name": {
|
|
141
197
|
"type": "string",
|
|
142
198
|
"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
|
+
}
|