@duetds/components 4.28.0 → 4.31.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/README.md +4 -4
- package/hydrate/index.js +914 -168
- package/lib/cjs/{action-arrow-down-small-ce4eddbc.js → action-arrow-down-small-ef77a2d1.js} +3 -0
- package/lib/cjs/{action-new-window-small-764927c8.js → action-new-window-small-fa51dfb9.js} +3 -0
- package/lib/cjs/{app-globals-10f3c9d9.js → app-globals-a032b236.js} +3 -0
- package/lib/cjs/{bodyScrollLock.es6-ec4c4a5c.js → bodyScrollLock.es6-6ef1142a.js} +3 -0
- package/lib/cjs/{common-strings-210be249.js → common-strings-de17f887.js} +3 -0
- package/lib/cjs/{create-id-d0d6cd15.js → create-id-c3b984b1.js} +3 -0
- package/lib/cjs/{dom-3e7d9c3b.js → dom-e89ebf90.js} +4 -1
- package/lib/cjs/duet-alert.cjs.entry.js +10 -4
- package/lib/cjs/duet-badge.cjs.entry.js +7 -4
- package/lib/cjs/duet-button_2.cjs.entry.js +17 -10
- package/lib/cjs/duet-caption_4.cjs.entry.js +23 -17
- package/lib/cjs/duet-card.cjs.entry.js +13 -10
- package/lib/cjs/duet-checkbox.cjs.entry.js +7 -4
- package/lib/cjs/duet-choice_2.cjs.entry.js +16 -11
- package/lib/cjs/duet-collapsible.cjs.entry.js +512 -8
- package/lib/cjs/duet-cookie-consent.cjs.entry.js +6 -3
- package/lib/cjs/duet-date-picker.cjs.entry.js +31 -15
- package/lib/cjs/duet-divider_2.cjs.entry.js +7 -4
- package/lib/cjs/duet-empty-state.cjs.entry.js +6 -3
- package/lib/cjs/duet-fieldset.cjs.entry.js +7 -4
- package/lib/cjs/duet-footer.cjs.entry.js +15 -8
- package/lib/cjs/duet-grid_2.cjs.entry.js +8 -5
- package/lib/cjs/duet-header_2.cjs.entry.js +68 -21
- package/lib/cjs/duet-hero.cjs.entry.js +16 -10
- package/lib/cjs/duet-icon.cjs.entry.js +22 -6
- package/lib/cjs/duet-input_2.cjs.entry.js +16 -8
- package/lib/cjs/duet-layout.cjs.entry.js +6 -3
- package/lib/cjs/duet-list_2.cjs.entry.js +8 -5
- package/lib/cjs/duet-modal.cjs.entry.js +19 -12
- package/lib/cjs/duet-notification_2.cjs.entry.js +17 -9
- package/lib/cjs/duet-number-input.cjs.entry.js +54 -24
- package/lib/cjs/duet-radio_2.cjs.entry.js +9 -6
- package/lib/cjs/duet-range-slider.cjs.entry.js +9 -6
- package/lib/cjs/duet-select.cjs.entry.js +8 -5
- package/lib/cjs/duet-step_2.cjs.entry.js +9 -6
- package/lib/cjs/duet-tab_2.cjs.entry.js +23 -11
- package/lib/cjs/duet-table.cjs.entry.js +7 -4
- package/lib/cjs/duet-textarea.cjs.entry.js +8 -5
- package/lib/cjs/duet-toggle.cjs.entry.js +7 -4
- package/lib/cjs/duet-tooltip.cjs.entry.js +33 -15
- package/lib/cjs/duet-tray.cjs.entry.js +33 -15
- package/lib/cjs/duet-visually-hidden.cjs.entry.js +5 -2
- package/lib/cjs/duet.cjs.js +8 -5
- package/lib/cjs/{focus-utils-162d8238.js → focus-utils-bd331feb.js} +4 -1
- package/lib/cjs/{index-69f4451b.js → index-113c2add.js} +11 -1
- package/lib/cjs/index.cjs.js +3 -0
- package/lib/cjs/{input-utils-712b8b32.js → input-utils-f3e3854c.js} +28 -0
- package/lib/cjs/{is-internet-explorer-cd4610fc.js → is-internet-explorer-91361c56.js} +3 -0
- package/lib/cjs/{keyboard-utils-a0b0a23c.js → keyboard-utils-b4e3d1d3.js} +3 -0
- package/lib/cjs/language-utils-48b8860b.js +93 -0
- package/lib/cjs/loader.cjs.js +7 -4
- package/lib/cjs/{shadow-css-09555044.js → shadow-css-0c8c175b.js} +4 -1
- package/lib/cjs/string-utils-267e3dbb.js +53 -0
- package/lib/cjs/{themeable-component-c462e6fd.js → themeable-component-0c1be552.js} +3 -0
- package/lib/cjs/{token-utils-4e9d1b6c.js → token-utils-13e5d13e.js} +4 -1
- package/lib/cjs/{tokens.module-6f0eaf7f.js → tokens.module-53b3bd92.js} +3 -0
- package/lib/cjs/{watch-options-edeeafd0.js → watch-options-3877c082.js} +3 -0
- package/lib/collection/collection-manifest.json +1 -1
- package/lib/collection/common-strings.js +3 -0
- package/lib/collection/components/duet-alert/duet-alert.js +19 -6
- package/lib/collection/components/duet-badge/duet-badge.css +1 -0
- package/lib/collection/components/duet-badge/duet-badge.js +4 -1
- package/lib/collection/components/duet-button/duet-button.css +3 -3
- package/lib/collection/components/duet-button/duet-button.js +28 -11
- package/lib/collection/components/duet-caption/duet-caption.js +4 -1
- package/lib/collection/components/duet-card/duet-card.css +10 -7
- package/lib/collection/components/duet-card/duet-card.js +9 -8
- package/lib/collection/components/duet-checkbox/duet-checkbox.js +4 -1
- package/lib/collection/components/duet-choice/duet-choice.css +0 -1
- package/lib/collection/components/duet-choice/duet-choice.js +17 -8
- package/lib/collection/components/duet-choice-group/duet-choice-group.css +3 -1
- package/lib/collection/components/duet-choice-group/duet-choice-group.js +5 -2
- package/lib/collection/components/duet-collapsible/duet-collapsible.js +110 -6
- package/lib/collection/components/duet-cookie-consent/duet-cookie-consent.js +4 -1
- package/lib/collection/components/duet-date-picker/date-i18n.js +3 -0
- package/lib/collection/components/duet-date-picker/date-picker-day.js +4 -1
- package/lib/collection/components/duet-date-picker/date-picker-input.js +4 -1
- package/lib/collection/components/duet-date-picker/date-picker-month.js +4 -1
- package/lib/collection/components/duet-date-picker/date-utils.js +3 -0
- package/lib/collection/components/duet-date-picker/duet-date-picker.css +1 -1
- package/lib/collection/components/duet-date-picker/duet-date-picker.js +85 -35
- package/lib/collection/components/duet-date-picker/utils.js +3 -0
- package/lib/collection/components/duet-divider/duet-divider.js +4 -1
- package/lib/collection/components/duet-empty-state/duet-empty-state.js +4 -1
- package/lib/collection/components/duet-fieldset/duet-fieldset.js +5 -2
- package/lib/collection/components/duet-footer/duet-footer.js +33 -12
- package/lib/collection/components/duet-grid/duet-grid.js +4 -1
- package/lib/collection/components/duet-grid-item/duet-grid-item.js +4 -1
- package/lib/collection/components/duet-header/duet-header.js +108 -36
- package/lib/collection/components/duet-heading/duet-heading.css +1 -0
- package/lib/collection/components/duet-heading/duet-heading.js +5 -2
- package/lib/collection/components/duet-hero/duet-hero.js +35 -15
- package/lib/collection/components/duet-icon/duet-icon.js +6 -3
- package/lib/collection/components/duet-icon/icon-utils.js +17 -1
- package/lib/collection/components/duet-input/duet-input.js +12 -4
- package/lib/collection/components/duet-label/duet-label.css +2 -0
- package/lib/collection/components/duet-label/duet-label.js +4 -1
- package/lib/collection/components/duet-layout/duet-layout.js +4 -1
- package/lib/collection/components/duet-link/duet-link.js +35 -17
- package/lib/collection/components/duet-list/duet-list.js +5 -2
- package/lib/collection/components/duet-list-item/duet-list-item.js +4 -1
- package/lib/collection/components/duet-logo/duet-logo.js +15 -4
- package/lib/collection/components/duet-modal/duet-modal.js +40 -17
- package/lib/collection/components/duet-notification/duet-notification.js +19 -4
- package/lib/collection/components/duet-notification-drawer/duet-notification-drawer.js +24 -12
- package/lib/collection/components/duet-number-input/duet-number-input.js +182 -31
- package/lib/collection/components/duet-number-input/number-input-utils.js +3 -0
- package/lib/collection/components/duet-paragraph/duet-paragraph.js +5 -2
- package/lib/collection/components/duet-radio/duet-radio.js +4 -1
- package/lib/collection/components/duet-radio-group/duet-radio-group.js +5 -2
- package/lib/collection/components/duet-range-slider/duet-range-slider.js +6 -3
- package/lib/collection/components/duet-select/duet-select.js +4 -1
- package/lib/collection/components/duet-spacer/duet-spacer.js +4 -1
- package/lib/collection/components/duet-spinner/duet-spinner.js +5 -2
- package/lib/collection/components/duet-step/duet-step.js +6 -3
- package/lib/collection/components/duet-stepper/duet-stepper.js +4 -1
- package/lib/collection/components/duet-tab/duet-tab.js +4 -1
- package/lib/collection/components/duet-tab-group/duet-tab-group.js +56 -10
- package/lib/collection/components/duet-table/duet-table.js +5 -2
- package/lib/collection/components/duet-textarea/duet-textarea.js +5 -2
- package/lib/collection/components/duet-toggle/duet-toggle.js +4 -1
- package/lib/collection/components/duet-tooltip/duet-tooltip.js +98 -17
- package/lib/collection/components/duet-tray/duet-tray.js +97 -16
- package/lib/collection/components/duet-visually-hidden/duet-visually-hidden.js +4 -1
- package/lib/collection/global/duet-global.js +3 -0
- package/lib/collection/utils/create-id.js +3 -0
- package/lib/collection/utils/fixture-utils.js +15 -5
- package/lib/collection/utils/focus-utils.js +3 -0
- package/lib/collection/utils/form-components.js +3 -0
- package/lib/collection/utils/group-by.js +3 -0
- package/lib/collection/utils/input-utils.js +27 -0
- package/lib/collection/utils/is-internet-explorer.js +3 -0
- package/lib/collection/utils/keyboard-utils.js +3 -0
- package/lib/collection/utils/language-utils.js +46 -8
- package/lib/collection/utils/string-utils.js +24 -0
- package/lib/collection/utils/test-utils.js +3 -0
- package/lib/collection/utils/themeable-component.js +3 -0
- package/lib/collection/utils/token-utils.js +3 -0
- package/lib/collection/utils/watch-options.js +3 -0
- package/lib/custom-elements-bundle/index.js +970 -222
- package/lib/duet/duet.esm.js +4 -1
- package/lib/duet/duet.js +1 -1
- package/lib/duet/index.esm.js +3 -0
- package/lib/duet/p-0058512b.js +4 -0
- package/lib/duet/p-0224db45.entry.js +4 -0
- package/lib/duet/{p-c261a84b.system.entry.js → p-02ad46a0.system.entry.js} +4 -1
- package/lib/duet/{p-ae82ab86.js → p-04f9f1bf.js} +3 -0
- package/lib/duet/{p-62b75c80.system.js → p-053b71e6.system.js} +3 -0
- package/lib/duet/{p-f5e7899b.system.entry.js → p-07263910.system.entry.js} +4 -1
- package/lib/duet/{p-6242ef49.system.js → p-0c4bbd65.system.js} +3 -0
- package/lib/duet/{p-8b9ee5b0.js → p-115c79b6.js} +3 -0
- package/lib/duet/{p-a69855b7.js → p-15c15c6a.js} +3 -0
- package/lib/duet/{p-e780bfa0.js → p-18d801be.js} +3 -0
- package/lib/duet/p-1bfbc988.entry.js +4 -0
- package/lib/duet/p-1cd7177f.entry.js +4 -0
- package/lib/duet/p-1cec5a70.system.entry.js +4 -0
- package/lib/duet/p-1e7222c2.entry.js +4 -0
- package/lib/duet/p-202bbd70.entry.js +4 -0
- package/lib/duet/{p-44d3eb2f.system.entry.js → p-22f56356.system.entry.js} +4 -1
- package/lib/duet/{p-551d38f9.js → p-2826f987.js} +3 -0
- package/lib/duet/p-28b67b94.entry.js +4 -0
- package/lib/duet/{p-01dad2d3.js → p-322d1c38.js} +4 -1
- package/lib/duet/p-33426ddc.entry.js +4 -0
- package/lib/duet/p-33cf6ed1.entry.js +4 -0
- package/lib/duet/p-3d3f773d.system.entry.js +4 -0
- package/lib/duet/p-3e1ef509.system.entry.js +4 -0
- package/lib/duet/p-3f78a826.system.js +4 -0
- package/lib/duet/{p-50e14ff9.system.js → p-418b2ce7.system.js} +3 -0
- package/lib/duet/{p-9d4322ba.system.js → p-43e39d98.system.js} +3 -0
- package/lib/duet/p-44ffb960.entry.js +4 -0
- package/lib/duet/p-453955cc.system.entry.js +4 -0
- package/lib/duet/p-4670a654.entry.js +4 -0
- package/lib/duet/p-47645ea8.system.entry.js +4 -0
- package/lib/duet/p-504dbf8f.system.entry.js +4 -0
- package/lib/duet/p-5230ee3c.system.entry.js +4 -0
- package/lib/duet/p-56e172f5.system.entry.js +4 -0
- package/lib/duet/{p-7d7a595e.system.js → p-57ea2576.system.js} +4 -1
- package/lib/duet/p-5aa0d34d.entry.js +4 -0
- package/lib/duet/{p-63b13a5f.system.js → p-5f6bd5db.system.js} +3 -0
- package/lib/duet/p-5fc7e1f7.system.entry.js +4 -0
- package/lib/duet/p-605bc214.system.entry.js +4 -0
- package/lib/duet/p-60ab57d4.entry.js +4 -0
- package/lib/duet/p-64109493.entry.js +4 -0
- package/lib/duet/p-69a5dc6b.entry.js +4 -0
- package/lib/duet/p-6a230911.system.entry.js +4 -0
- package/lib/duet/p-6a356ab1.system.js +4 -0
- package/lib/duet/p-6a760b8a.entry.js +4 -0
- package/lib/duet/p-6d2da245.entry.js +4 -0
- package/lib/duet/p-704245ef.js +4 -0
- package/lib/duet/p-712e7dde.system.entry.js +4 -0
- package/lib/duet/p-746655ba.entry.js +4 -0
- package/lib/duet/p-76f00bd5.js +4 -0
- package/lib/duet/p-7b6db837.system.entry.js +4 -0
- package/lib/duet/p-7d080785.system.entry.js +4 -0
- package/lib/duet/p-82dc2e0b.entry.js +4 -0
- package/lib/duet/p-8c8e82aa.system.js +4 -0
- package/lib/duet/{p-5fe386d7.system.entry.js → p-8c980350.system.entry.js} +4 -1
- package/lib/duet/{p-1fcc25b6.system.entry.js → p-8cb47a70.system.entry.js} +4 -1
- package/lib/duet/p-8f03c3eb.entry.js +4 -0
- package/lib/duet/{p-50ea2036.system.js → p-8faaaf5f.system.js} +3 -0
- package/lib/duet/p-91fa68a5.js +4 -0
- package/lib/duet/p-92d38668.system.entry.js +4 -0
- package/lib/duet/p-95626e7e.system.entry.js +4 -0
- package/lib/duet/p-96808a2e.system.entry.js +4 -0
- package/lib/duet/p-96c103b2.system.entry.js +4 -0
- package/lib/duet/p-986779fb.js +4 -0
- package/lib/duet/{p-a0c363a1.js → p-9a89ec39.js} +3 -0
- package/lib/duet/p-9a8d5b11.system.js +4 -0
- package/lib/duet/p-9a945278.system.js +4 -0
- package/lib/duet/p-9c94be45.entry.js +4 -0
- package/lib/duet/p-9ce1baab.system.entry.js +4 -0
- package/lib/duet/p-9dfcd29a.js +4 -0
- package/lib/duet/p-9ff25646.entry.js +4 -0
- package/lib/duet/p-a1d12e94.system.entry.js +4 -0
- package/lib/duet/{p-a78af9f5.js → p-a28cf57b.js} +3 -0
- package/lib/duet/p-b03a46b6.entry.js +4 -0
- package/lib/duet/p-b1b8e510.entry.js +4 -0
- package/lib/duet/p-b694cbf5.system.js +4 -0
- package/lib/duet/p-b7e50cfa.entry.js +4 -0
- package/lib/duet/p-b82927b0.system.entry.js +4 -0
- package/lib/duet/p-ba205dca.entry.js +4 -0
- package/lib/duet/{p-2dd28142.system.js → p-bb12b972.system.js} +3 -0
- package/lib/duet/p-bcae23fc.system.entry.js +4 -0
- package/lib/duet/{p-a0e09a50.js → p-bd779757.js} +3 -0
- package/lib/duet/{p-69599f4e.js → p-bd9a7d8f.js} +3 -0
- package/lib/duet/p-be19c57b.system.entry.js +4 -0
- package/lib/duet/{p-6e296e99.js → p-c1325e35.js} +3 -0
- package/lib/duet/p-c4737f88.entry.js +4 -0
- package/lib/duet/{p-c3058688.js → p-c5beceed.js} +4 -1
- package/lib/duet/p-c5f10483.system.entry.js +4 -0
- package/lib/duet/{p-d95998b4.system.js → p-c7ae95bd.system.js} +3 -0
- package/lib/duet/{p-31c3b93f.system.js → p-ce0892e6.system.js} +3 -0
- package/lib/duet/p-d35fd913.system.entry.js +4 -0
- package/lib/duet/p-d4b4bfa6.entry.js +4 -0
- package/lib/duet/p-d7623eb8.system.entry.js +4 -0
- package/lib/duet/p-d863e150.system.js +4 -0
- package/lib/duet/p-dc85d2a4.entry.js +4 -0
- package/lib/duet/p-de093c16.entry.js +4 -0
- package/lib/duet/p-de842863.entry.js +4 -0
- package/lib/duet/p-e08b8909.entry.js +4 -0
- package/lib/duet/p-e39471b6.entry.js +4 -0
- package/lib/duet/{p-f180f2f2.system.js → p-e566ff11.system.js} +3 -0
- package/lib/duet/{p-cd603d87.system.js → p-e58ca7af.system.js} +4 -1
- package/lib/duet/p-e834c8d5.system.entry.js +4 -0
- package/lib/duet/{p-a8a8954e.system.entry.js → p-ef45cfe9.system.entry.js} +4 -1
- package/lib/duet/{p-73baca13.system.js → p-efaa0c04.system.js} +3 -0
- package/lib/duet/{p-fd305188.system.entry.js → p-f0b1850a.system.entry.js} +4 -1
- package/lib/duet/{p-871f3440.js → p-f11208c3.js} +3 -0
- package/lib/duet/p-f53c8019.entry.js +4 -0
- package/lib/duet/{p-95253d0a.entry.js → p-f96c4093.system.entry.js} +4 -1
- package/lib/duet/p-fbd83d67.entry.js +4 -0
- package/lib/duet/{p-dbe056ce.system.js → p-fd98468a.system.js} +3 -0
- package/lib/duet/p-fdecaf46.entry.js +4 -0
- package/lib/esm/{action-arrow-down-small-c24d2c7f.js → action-arrow-down-small-82273dc8.js} +3 -0
- package/lib/esm/{action-new-window-small-d592feb6.js → action-new-window-small-1945be91.js} +3 -0
- package/lib/esm/{app-globals-2796679e.js → app-globals-6641e444.js} +3 -0
- package/lib/esm/{bodyScrollLock.es6-cf1e49b2.js → bodyScrollLock.es6-61b5e9a4.js} +3 -0
- package/lib/esm/{common-strings-d5205fd4.js → common-strings-97e04e4b.js} +3 -0
- package/lib/esm/{create-id-124e0fc4.js → create-id-981107da.js} +3 -0
- package/lib/esm/{dom-1f98a75f.js → dom-21034390.js} +4 -1
- package/lib/esm/duet-alert.entry.js +10 -4
- package/lib/esm/duet-badge.entry.js +7 -4
- package/lib/esm/duet-button_2.entry.js +17 -10
- package/lib/esm/duet-caption_4.entry.js +23 -17
- package/lib/esm/duet-card.entry.js +13 -10
- package/lib/esm/duet-checkbox.entry.js +7 -4
- package/lib/esm/duet-choice_2.entry.js +16 -11
- package/lib/esm/duet-collapsible.entry.js +512 -8
- package/lib/esm/duet-cookie-consent.entry.js +6 -3
- package/lib/esm/duet-date-picker.entry.js +31 -15
- package/lib/esm/duet-divider_2.entry.js +7 -4
- package/lib/esm/duet-empty-state.entry.js +6 -3
- package/lib/esm/duet-fieldset.entry.js +7 -4
- package/lib/esm/duet-footer.entry.js +15 -8
- package/lib/esm/duet-grid_2.entry.js +8 -5
- package/lib/esm/duet-header_2.entry.js +68 -21
- package/lib/esm/duet-hero.entry.js +16 -10
- package/lib/esm/duet-icon.entry.js +22 -6
- package/lib/esm/duet-input_2.entry.js +16 -8
- package/lib/esm/duet-layout.entry.js +6 -3
- package/lib/esm/duet-list_2.entry.js +8 -5
- package/lib/esm/duet-modal.entry.js +19 -12
- package/lib/esm/duet-notification_2.entry.js +17 -9
- package/lib/esm/duet-number-input.entry.js +54 -24
- package/lib/esm/duet-radio_2.entry.js +9 -6
- package/lib/esm/duet-range-slider.entry.js +9 -6
- package/lib/esm/duet-select.entry.js +8 -5
- package/lib/esm/duet-step_2.entry.js +9 -6
- package/lib/esm/duet-tab_2.entry.js +23 -11
- package/lib/esm/duet-table.entry.js +7 -4
- package/lib/esm/duet-textarea.entry.js +8 -5
- package/lib/esm/duet-toggle.entry.js +7 -4
- package/lib/esm/duet-tooltip.entry.js +33 -15
- package/lib/esm/duet-tray.entry.js +33 -15
- package/lib/esm/duet-visually-hidden.entry.js +5 -2
- package/lib/esm/duet.js +8 -5
- package/lib/esm/{focus-utils-e76191e8.js → focus-utils-1995e5a9.js} +4 -1
- package/lib/esm/{index-aaa7610e.js → index-6e246691.js} +11 -1
- package/lib/esm/index.js +3 -1
- package/lib/esm/{input-utils-8a4c03a1.js → input-utils-f4cafee1.js} +28 -1
- package/lib/esm/{is-internet-explorer-0b40c5fe.js → is-internet-explorer-62b3bdbd.js} +3 -0
- package/lib/esm/{keyboard-utils-956f0d36.js → keyboard-utils-584cedd7.js} +3 -0
- package/lib/esm/language-utils-d5c38f65.js +89 -0
- package/lib/esm/loader.js +7 -4
- package/lib/esm/{shadow-css-67b66845.js → shadow-css-31e2d504.js} +4 -1
- package/lib/esm/string-utils-2f1793b8.js +49 -0
- package/lib/esm/{themeable-component-2a857b64.js → themeable-component-572685dd.js} +3 -0
- package/lib/esm/{token-utils-56e2be37.js → token-utils-5a35377f.js} +4 -1
- package/lib/esm/{tokens.module-17f6088f.js → tokens.module-edb66c04.js} +3 -0
- package/lib/esm/{watch-options-8f61a365.js → watch-options-de55ea78.js} +3 -0
- package/lib/esm-es5/{action-arrow-down-small-c24d2c7f.js → action-arrow-down-small-82273dc8.js} +3 -0
- package/lib/esm-es5/{action-new-window-small-d592feb6.js → action-new-window-small-1945be91.js} +3 -0
- package/lib/esm-es5/{app-globals-2796679e.js → app-globals-6641e444.js} +3 -0
- package/lib/esm-es5/{bodyScrollLock.es6-cf1e49b2.js → bodyScrollLock.es6-61b5e9a4.js} +3 -0
- package/lib/esm-es5/{common-strings-d5205fd4.js → common-strings-97e04e4b.js} +3 -0
- package/lib/esm-es5/{create-id-124e0fc4.js → create-id-981107da.js} +3 -0
- package/lib/esm-es5/{dom-1f98a75f.js → dom-21034390.js} +3 -0
- package/lib/esm-es5/duet-alert.entry.js +4 -1
- package/lib/esm-es5/duet-badge.entry.js +4 -1
- package/lib/esm-es5/duet-button_2.entry.js +4 -1
- package/lib/esm-es5/duet-caption_4.entry.js +4 -1
- package/lib/esm-es5/duet-card.entry.js +4 -1
- package/lib/esm-es5/duet-checkbox.entry.js +4 -1
- package/lib/esm-es5/duet-choice_2.entry.js +4 -1
- package/lib/esm-es5/duet-collapsible.entry.js +4 -1
- package/lib/esm-es5/duet-cookie-consent.entry.js +4 -1
- package/lib/esm-es5/duet-date-picker.entry.js +4 -1
- package/lib/esm-es5/duet-divider_2.entry.js +4 -1
- package/lib/esm-es5/duet-empty-state.entry.js +4 -1
- package/lib/esm-es5/duet-fieldset.entry.js +4 -1
- package/lib/esm-es5/duet-footer.entry.js +4 -1
- package/lib/esm-es5/duet-grid_2.entry.js +4 -1
- package/lib/esm-es5/duet-header_2.entry.js +4 -1
- package/lib/esm-es5/duet-hero.entry.js +4 -1
- package/lib/esm-es5/duet-icon.entry.js +4 -1
- package/lib/esm-es5/duet-input_2.entry.js +4 -1
- package/lib/esm-es5/duet-layout.entry.js +4 -1
- package/lib/esm-es5/duet-list_2.entry.js +4 -1
- package/lib/esm-es5/duet-modal.entry.js +4 -1
- package/lib/esm-es5/duet-notification_2.entry.js +4 -1
- package/lib/esm-es5/duet-number-input.entry.js +4 -1
- package/lib/esm-es5/duet-radio_2.entry.js +4 -1
- package/lib/esm-es5/duet-range-slider.entry.js +4 -1
- package/lib/esm-es5/duet-select.entry.js +4 -1
- package/lib/esm-es5/duet-step_2.entry.js +4 -1
- package/lib/esm-es5/duet-tab_2.entry.js +4 -1
- package/lib/esm-es5/duet-table.entry.js +4 -1
- package/lib/esm-es5/duet-textarea.entry.js +4 -1
- package/lib/esm-es5/duet-toggle.entry.js +4 -1
- package/lib/esm-es5/duet-tooltip.entry.js +4 -1
- package/lib/esm-es5/duet-tray.entry.js +4 -1
- package/lib/esm-es5/duet-visually-hidden.entry.js +4 -1
- package/lib/esm-es5/duet.js +4 -1
- package/lib/esm-es5/{focus-utils-e76191e8.js → focus-utils-1995e5a9.js} +4 -1
- package/lib/esm-es5/index-6e246691.js +4 -0
- package/lib/esm-es5/index.js +3 -0
- package/lib/esm-es5/input-utils-f4cafee1.js +4 -0
- package/lib/esm-es5/{is-internet-explorer-0b40c5fe.js → is-internet-explorer-62b3bdbd.js} +3 -0
- package/lib/esm-es5/{keyboard-utils-956f0d36.js → keyboard-utils-584cedd7.js} +3 -0
- package/lib/esm-es5/language-utils-d5c38f65.js +4 -0
- package/lib/esm-es5/loader.js +4 -1
- package/lib/esm-es5/{shadow-css-67b66845.js → shadow-css-31e2d504.js} +3 -0
- package/lib/esm-es5/string-utils-2f1793b8.js +4 -0
- package/lib/esm-es5/{themeable-component-2a857b64.js → themeable-component-572685dd.js} +3 -0
- package/lib/esm-es5/{token-utils-56e2be37.js → token-utils-5a35377f.js} +4 -1
- package/lib/esm-es5/{tokens.module-17f6088f.js → tokens.module-edb66c04.js} +3 -0
- package/lib/esm-es5/{watch-options-8f61a365.js → watch-options-de55ea78.js} +3 -0
- package/lib/html.html-data.json +140 -2
- package/lib/loader/cdn.js +3 -1
- package/lib/loader/index.cjs.js +3 -1
- package/lib/loader/index.d.ts +0 -1
- package/lib/loader/index.es2017.js +3 -1
- package/lib/loader/index.js +3 -1
- package/lib/types/components/duet-alert/duet-alert.d.ts +4 -2
- package/lib/types/components/duet-badge/duet-badge.d.ts +1 -1
- package/lib/types/components/duet-button/duet-button.d.ts +6 -3
- package/lib/types/components/duet-caption/duet-caption.d.ts +1 -1
- package/lib/types/components/duet-card/duet-card.d.ts +1 -1
- package/lib/types/components/duet-checkbox/duet-checkbox.d.ts +1 -1
- package/lib/types/components/duet-choice/duet-choice.d.ts +5 -4
- package/lib/types/components/duet-collapsible/duet-collapsible.d.ts +24 -1
- package/lib/types/components/duet-date-picker/date-picker-month.d.ts +1 -1
- package/lib/types/components/duet-date-picker/duet-date-picker.d.ts +16 -7
- package/lib/types/components/duet-divider/duet-divider.d.ts +1 -1
- package/lib/types/components/duet-empty-state/duet-empty-state.d.ts +1 -1
- package/lib/types/components/duet-fieldset/duet-fieldset.d.ts +1 -1
- package/lib/types/components/duet-footer/duet-footer.d.ts +7 -3
- package/lib/types/components/duet-grid-item/duet-grid-item.d.ts +1 -1
- package/lib/types/components/duet-header/duet-header.d.ts +50 -8
- package/lib/types/components/duet-heading/duet-heading.d.ts +1 -1
- package/lib/types/components/duet-hero/duet-hero.d.ts +8 -5
- package/lib/types/components/duet-icon/duet-icon.d.ts +1 -1
- package/lib/types/components/duet-input/duet-input.d.ts +2 -2
- package/lib/types/components/duet-link/duet-link.d.ts +8 -5
- package/lib/types/components/duet-list/duet-list.d.ts +1 -1
- package/lib/types/components/duet-logo/duet-logo.d.ts +3 -1
- package/lib/types/components/duet-modal/duet-modal.d.ts +11 -5
- package/lib/types/components/duet-notification/duet-notification.d.ts +4 -1
- package/lib/types/components/duet-notification-drawer/duet-notification-drawer.d.ts +6 -5
- package/lib/types/components/duet-number-input/duet-number-input.d.ts +29 -2
- package/lib/types/components/duet-paragraph/duet-paragraph.d.ts +1 -1
- package/lib/types/components/duet-radio/duet-radio.d.ts +2 -2
- package/lib/types/components/duet-range-slider/duet-range-slider.d.ts +2 -2
- package/lib/types/components/duet-select/duet-select.d.ts +1 -1
- package/lib/types/components/duet-step/duet-step.d.ts +1 -1
- package/lib/types/components/duet-stepper/duet-stepper.d.ts +1 -1
- package/lib/types/components/duet-tab-group/duet-tab-group.d.ts +10 -1
- package/lib/types/components/duet-textarea/duet-textarea.d.ts +2 -2
- package/lib/types/components/duet-toggle/duet-toggle.d.ts +2 -2
- package/lib/types/components/duet-tooltip/duet-tooltip.d.ts +16 -1
- package/lib/types/components/duet-tray/duet-tray.d.ts +15 -0
- package/lib/types/components.d.ts +265 -33
- package/lib/types/utils/input-utils.d.ts +9 -0
- package/lib/types/utils/language-utils.d.ts +26 -3
- package/lib/types/utils/string-utils.d.ts +1 -0
- package/lib/types/utils/test-utils.d.ts +1 -1
- package/package.json +39 -23
- package/lib/cjs/language-utils-0f4f60f1.js +0 -54
- package/lib/cjs/string-utils-0336d6da.js +0 -28
- package/lib/duet/p-00914fa8.entry.js +0 -1
- package/lib/duet/p-08b10b1b.entry.js +0 -1
- package/lib/duet/p-0a5bdffc.entry.js +0 -1
- package/lib/duet/p-117e6a2d.system.entry.js +0 -1
- package/lib/duet/p-11f650f9.system.entry.js +0 -1
- package/lib/duet/p-120f15f9.entry.js +0 -1
- package/lib/duet/p-1270fad1.entry.js +0 -1
- package/lib/duet/p-15c4ae87.system.entry.js +0 -1
- package/lib/duet/p-19d86321.system.js +0 -1
- package/lib/duet/p-1a544f89.js +0 -1
- package/lib/duet/p-1a773ea3.system.entry.js +0 -1
- package/lib/duet/p-1f18716e.entry.js +0 -1
- package/lib/duet/p-2141f564.system.js +0 -1
- package/lib/duet/p-23f2a281.entry.js +0 -1
- package/lib/duet/p-28072b15.entry.js +0 -1
- package/lib/duet/p-2ce3a1bc.entry.js +0 -1
- package/lib/duet/p-2f56c5d0.entry.js +0 -1
- package/lib/duet/p-330725c5.js +0 -1
- package/lib/duet/p-378186a8.entry.js +0 -1
- package/lib/duet/p-393dc5f0.system.entry.js +0 -1
- package/lib/duet/p-4486ae28.system.entry.js +0 -1
- package/lib/duet/p-45713f8a.system.entry.js +0 -1
- package/lib/duet/p-4e4d8137.system.entry.js +0 -1
- package/lib/duet/p-4f4895e0.entry.js +0 -1
- package/lib/duet/p-51f89eec.entry.js +0 -1
- package/lib/duet/p-545f6a97.entry.js +0 -1
- package/lib/duet/p-568ab60b.system.entry.js +0 -1
- package/lib/duet/p-598ba79a.js +0 -1
- package/lib/duet/p-598edf9e.system.entry.js +0 -1
- package/lib/duet/p-5e6a5340.entry.js +0 -1
- package/lib/duet/p-64fd394a.entry.js +0 -1
- package/lib/duet/p-66c75914.system.entry.js +0 -1
- package/lib/duet/p-6dc51621.system.entry.js +0 -1
- package/lib/duet/p-6f41124b.system.js +0 -1
- package/lib/duet/p-6f6b2cc5.system.entry.js +0 -1
- package/lib/duet/p-700243af.entry.js +0 -1
- package/lib/duet/p-770d46e6.entry.js +0 -1
- package/lib/duet/p-8498e753.system.entry.js +0 -1
- package/lib/duet/p-852e96c1.system.js +0 -1
- package/lib/duet/p-86de511c.system.entry.js +0 -1
- package/lib/duet/p-8db7a844.system.entry.js +0 -1
- package/lib/duet/p-91255671.js +0 -1
- package/lib/duet/p-921afc00.entry.js +0 -1
- package/lib/duet/p-9ac41fbc.system.entry.js +0 -1
- package/lib/duet/p-9b6adcb3.system.entry.js +0 -1
- package/lib/duet/p-9b9cb411.system.entry.js +0 -1
- package/lib/duet/p-9ff8c7c4.entry.js +0 -1
- package/lib/duet/p-a4d8b2c4.entry.js +0 -1
- package/lib/duet/p-a92bdc1c.system.entry.js +0 -1
- package/lib/duet/p-b6e261ef.js +0 -1
- package/lib/duet/p-b761ef2d.entry.js +0 -1
- package/lib/duet/p-b87ce8c9.system.entry.js +0 -1
- package/lib/duet/p-bdf5fe15.entry.js +0 -1
- package/lib/duet/p-c0c1bcba.system.js +0 -1
- package/lib/duet/p-c5fe3120.system.entry.js +0 -1
- package/lib/duet/p-c6d19c6c.system.entry.js +0 -1
- package/lib/duet/p-c8068a31.entry.js +0 -1
- package/lib/duet/p-cb073c9b.entry.js +0 -1
- package/lib/duet/p-cb49c05a.system.js +0 -1
- package/lib/duet/p-cb62f051.entry.js +0 -1
- package/lib/duet/p-ce55045f.js +0 -1
- package/lib/duet/p-d20651ba.entry.js +0 -1
- package/lib/duet/p-d7c57e6c.entry.js +0 -1
- package/lib/duet/p-da0df691.system.entry.js +0 -1
- package/lib/duet/p-dc2d2635.system.entry.js +0 -1
- package/lib/duet/p-dcd0f562.system.entry.js +0 -1
- package/lib/duet/p-dd4281d5.entry.js +0 -1
- package/lib/duet/p-e374aba6.entry.js +0 -1
- package/lib/duet/p-e693d73a.system.entry.js +0 -1
- package/lib/duet/p-e7bef783.entry.js +0 -1
- package/lib/duet/p-ec326c4c.system.entry.js +0 -1
- package/lib/duet/p-efa3e05d.entry.js +0 -1
- package/lib/duet/p-f2cca5cc.system.js +0 -1
- package/lib/duet/p-f3d07b69.entry.js +0 -1
- package/lib/duet/p-fbeb43e8.entry.js +0 -1
- package/lib/esm/language-utils-c7ce7c0e.js +0 -50
- package/lib/esm/string-utils-9ef35d2a.js +0 -25
- package/lib/esm-es5/index-aaa7610e.js +0 -1
- package/lib/esm-es5/input-utils-8a4c03a1.js +0 -1
- package/lib/esm-es5/language-utils-c7ce7c0e.js +0 -1
- package/lib/esm-es5/string-utils-9ef35d2a.js +0 -1
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* Built with Duet Design System
|
|
3
|
+
*/
|
|
4
|
+
import { Component, Element, h, Host, Listen, Prop, State, Watch } from "@stencil/core";
|
|
2
5
|
import { createID } from "../../utils/create-id";
|
|
3
|
-
import { inheritGlobalTheme } from "../../utils/themeable-component";
|
|
4
6
|
import { getLanguage, getLocaleString } from "../../utils/language-utils";
|
|
7
|
+
import { inheritGlobalTheme } from "../../utils/themeable-component";
|
|
5
8
|
export class DuetTooltip {
|
|
6
9
|
constructor() {
|
|
7
10
|
/**
|
|
@@ -21,26 +24,40 @@ export class DuetTooltip {
|
|
|
21
24
|
/**
|
|
22
25
|
* The currently active language. This setting changes the accessible labels to match the
|
|
23
26
|
* chosen language.
|
|
27
|
+
* @deprecated this is now handled via the html lang tag, and is no longer used - kept to avoid breaking changes and ease unit testing
|
|
28
|
+
* @default "fi"
|
|
24
29
|
*/
|
|
25
30
|
this.language = getLanguage();
|
|
31
|
+
/**
|
|
32
|
+
* Default language strings for the accessibleLabel
|
|
33
|
+
* @default {fi: "Näytä lisätietoja", en: "See more information", sv: "Se mer information"}
|
|
34
|
+
*/
|
|
35
|
+
this.accessibleLabelDefault = {
|
|
36
|
+
fi: "Näytä lisätietoja",
|
|
37
|
+
en: "Show more information",
|
|
38
|
+
sv: "Visa mer tilläggsuppgifter",
|
|
39
|
+
};
|
|
26
40
|
/**
|
|
27
41
|
* Adds accessible label for the info icon that is only shown for screen
|
|
28
42
|
* readers. This property is always required to create an accessible interface!
|
|
43
|
+
* @default {fi: "Näytä lisätietoja", en: "See more information", sv: "Se mer information"}
|
|
29
44
|
*/
|
|
30
|
-
this.accessibleLabel = getLocaleString(
|
|
31
|
-
fi: "Näytä lisätietoja",
|
|
32
|
-
en: "See more information",
|
|
33
|
-
sv: "Se mer information",
|
|
34
|
-
}, this.language);
|
|
45
|
+
this.accessibleLabel = getLocaleString(this.accessibleLabelDefault, this.language);
|
|
35
46
|
/**
|
|
36
|
-
*
|
|
37
|
-
*
|
|
47
|
+
* Default language strings for the accessibleCloseLabel
|
|
48
|
+
* @default {fi: "Sulje lisätiedot", en: "Close details", sv: "Stäng detaljer"}
|
|
38
49
|
*/
|
|
39
|
-
this.
|
|
50
|
+
this.accessibleCloseLabelDefault = {
|
|
40
51
|
fi: "Sulje lisätiedot",
|
|
41
52
|
en: "Close details",
|
|
42
|
-
sv: "Stäng
|
|
43
|
-
}
|
|
53
|
+
sv: "Stäng tilläggsuppgifter",
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Adds accessible label for the close icon that is only shown for screen
|
|
57
|
+
* readers. This property is always required to create an accessibly interface!
|
|
58
|
+
* @default {fi: "Sulje lisätiedot", en: "Close details", sv: "Stäng detaljer"}
|
|
59
|
+
*/
|
|
60
|
+
this.accessibleCloseLabel = getLocaleString(this.accessibleCloseLabelDefault, this.language);
|
|
44
61
|
/**
|
|
45
62
|
* Label of the tooltip. If used, replaces the accessibleLabel option.
|
|
46
63
|
*/
|
|
@@ -262,13 +279,45 @@ export class DuetTooltip {
|
|
|
262
279
|
"required": false,
|
|
263
280
|
"optional": false,
|
|
264
281
|
"docs": {
|
|
265
|
-
"tags": [
|
|
282
|
+
"tags": [{
|
|
283
|
+
"text": "this is now handled via the html lang tag, and is no longer used - kept to avoid breaking changes and ease unit testing",
|
|
284
|
+
"name": "deprecated"
|
|
285
|
+
}, {
|
|
286
|
+
"text": "\"fi\"",
|
|
287
|
+
"name": "default"
|
|
288
|
+
}],
|
|
266
289
|
"text": "The currently active language. This setting changes the accessible labels to match the\nchosen language."
|
|
267
290
|
},
|
|
268
291
|
"attribute": "language",
|
|
269
292
|
"reflect": false,
|
|
270
293
|
"defaultValue": "getLanguage()"
|
|
271
294
|
},
|
|
295
|
+
"accessibleLabelDefault": {
|
|
296
|
+
"type": "string",
|
|
297
|
+
"mutable": false,
|
|
298
|
+
"complexType": {
|
|
299
|
+
"original": "DuetLangObject | string",
|
|
300
|
+
"resolved": "DuetLangObject | string",
|
|
301
|
+
"references": {
|
|
302
|
+
"DuetLangObject": {
|
|
303
|
+
"location": "import",
|
|
304
|
+
"path": "../../utils/language-utils"
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
"required": false,
|
|
309
|
+
"optional": false,
|
|
310
|
+
"docs": {
|
|
311
|
+
"tags": [{
|
|
312
|
+
"text": "{fi: \"N\u00E4yt\u00E4 lis\u00E4tietoja\", en: \"See more information\", sv: \"Se mer information\"}",
|
|
313
|
+
"name": "default"
|
|
314
|
+
}],
|
|
315
|
+
"text": "Default language strings for the accessibleLabel"
|
|
316
|
+
},
|
|
317
|
+
"attribute": "accessible-label-default",
|
|
318
|
+
"reflect": false,
|
|
319
|
+
"defaultValue": "{\n fi: \"N\u00E4yt\u00E4 lis\u00E4tietoja\",\n en: \"Show more information\",\n sv: \"Visa mer till\u00E4ggsuppgifter\",\n }"
|
|
320
|
+
},
|
|
272
321
|
"accessibleLabel": {
|
|
273
322
|
"type": "string",
|
|
274
323
|
"mutable": false,
|
|
@@ -280,12 +329,15 @@ export class DuetTooltip {
|
|
|
280
329
|
"required": false,
|
|
281
330
|
"optional": false,
|
|
282
331
|
"docs": {
|
|
283
|
-
"tags": [
|
|
332
|
+
"tags": [{
|
|
333
|
+
"text": "{fi: \"N\u00E4yt\u00E4 lis\u00E4tietoja\", en: \"See more information\", sv: \"Se mer information\"}",
|
|
334
|
+
"name": "default"
|
|
335
|
+
}],
|
|
284
336
|
"text": "Adds accessible label for the info icon that is only shown for screen\nreaders. This property is always required to create an accessible interface!"
|
|
285
337
|
},
|
|
286
338
|
"attribute": "accessible-label",
|
|
287
339
|
"reflect": false,
|
|
288
|
-
"defaultValue": "getLocaleString(
|
|
340
|
+
"defaultValue": "getLocaleString(this.accessibleLabelDefault, this.language)"
|
|
289
341
|
},
|
|
290
342
|
"accessibleInputLabel": {
|
|
291
343
|
"type": "string",
|
|
@@ -307,6 +359,32 @@ export class DuetTooltip {
|
|
|
307
359
|
"attribute": "accessible-input-label",
|
|
308
360
|
"reflect": false
|
|
309
361
|
},
|
|
362
|
+
"accessibleCloseLabelDefault": {
|
|
363
|
+
"type": "string",
|
|
364
|
+
"mutable": false,
|
|
365
|
+
"complexType": {
|
|
366
|
+
"original": "DuetLangObject | string",
|
|
367
|
+
"resolved": "DuetLangObject | string",
|
|
368
|
+
"references": {
|
|
369
|
+
"DuetLangObject": {
|
|
370
|
+
"location": "import",
|
|
371
|
+
"path": "../../utils/language-utils"
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
},
|
|
375
|
+
"required": false,
|
|
376
|
+
"optional": false,
|
|
377
|
+
"docs": {
|
|
378
|
+
"tags": [{
|
|
379
|
+
"text": "{fi: \"Sulje lis\u00E4tiedot\", en: \"Close details\", sv: \"St\u00E4ng detaljer\"}",
|
|
380
|
+
"name": "default"
|
|
381
|
+
}],
|
|
382
|
+
"text": "Default language strings for the accessibleCloseLabel"
|
|
383
|
+
},
|
|
384
|
+
"attribute": "accessible-close-label-default",
|
|
385
|
+
"reflect": false,
|
|
386
|
+
"defaultValue": "{\n fi: \"Sulje lis\u00E4tiedot\",\n en: \"Close details\",\n sv: \"St\u00E4ng till\u00E4ggsuppgifter\",\n }"
|
|
387
|
+
},
|
|
310
388
|
"accessibleCloseLabel": {
|
|
311
389
|
"type": "string",
|
|
312
390
|
"mutable": false,
|
|
@@ -318,12 +396,15 @@ export class DuetTooltip {
|
|
|
318
396
|
"required": false,
|
|
319
397
|
"optional": false,
|
|
320
398
|
"docs": {
|
|
321
|
-
"tags": [
|
|
399
|
+
"tags": [{
|
|
400
|
+
"text": "{fi: \"Sulje lis\u00E4tiedot\", en: \"Close details\", sv: \"St\u00E4ng detaljer\"}",
|
|
401
|
+
"name": "default"
|
|
402
|
+
}],
|
|
322
403
|
"text": "Adds accessible label for the close icon that is only shown for screen\nreaders. This property is always required to create an accessibly interface!"
|
|
323
404
|
},
|
|
324
405
|
"attribute": "accessible-close-label",
|
|
325
406
|
"reflect": false,
|
|
326
|
-
"defaultValue": "getLocaleString(
|
|
407
|
+
"defaultValue": "getLocaleString(this.accessibleCloseLabelDefault, this.language)"
|
|
327
408
|
},
|
|
328
409
|
"label": {
|
|
329
410
|
"type": "string",
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* Built with Duet Design System
|
|
3
|
+
*/
|
|
3
4
|
import { sizeHeader } from "@duetds/tokens";
|
|
5
|
+
import { Component, Element, Fragment, h, Listen, Prop, State } from "@stencil/core";
|
|
4
6
|
import { createID } from "../../utils/create-id";
|
|
5
7
|
import { getLanguage, getLocaleString } from "../../utils/language-utils";
|
|
8
|
+
import { inheritGlobalTheme } from "../../utils/themeable-component";
|
|
6
9
|
const topOffset = parseFloat(sizeHeader) * 2 * 16; // convert rem -> px
|
|
7
10
|
/**
|
|
8
11
|
* @slot unnamed default slot - The component’s primary content. All child nodes that do not have a slot attribute defined are inserted into this primary slot.
|
|
@@ -23,26 +26,40 @@ export class DuetTray {
|
|
|
23
26
|
/**
|
|
24
27
|
* The currently active language. This setting changes the accessible labels to match the
|
|
25
28
|
* chosen language.
|
|
29
|
+
* @deprecated this is now handled via the html lang tag, and is no longer used - kept to avoid breaking changes and ease unit testing
|
|
30
|
+
* @default "fi"
|
|
26
31
|
*/
|
|
27
32
|
this.language = getLanguage();
|
|
28
33
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
34
|
+
* Defaults for accessibleCloseLabel
|
|
35
|
+
* @default {fi: "Sulje", en: "Close", sv: "Stänga"}
|
|
31
36
|
*/
|
|
32
|
-
this.
|
|
37
|
+
this.accessibleCloseLabelDefaults = {
|
|
33
38
|
fi: "Sulje",
|
|
34
39
|
en: "Close",
|
|
35
|
-
sv: "
|
|
36
|
-
}
|
|
40
|
+
sv: "Stäng",
|
|
41
|
+
};
|
|
37
42
|
/**
|
|
38
43
|
* Accessible label that is shown for screen reader users in the expandable
|
|
39
|
-
*
|
|
44
|
+
* close toggle. Not visible for normal users.
|
|
45
|
+
* @default {fi: "Sulje", en: "Close", sv: "Stänga"}
|
|
46
|
+
*/
|
|
47
|
+
this.accessibleCloseLabel = getLocaleString(this.accessibleCloseLabelDefaults, this.language);
|
|
48
|
+
/**
|
|
49
|
+
* Defaults for accessibleOpenLabel
|
|
50
|
+
* @default {fi: "Avaa", en: "Open", sv: "Öppen"}
|
|
40
51
|
*/
|
|
41
|
-
this.
|
|
52
|
+
this.accessibleOpenLabelDefaults = {
|
|
42
53
|
fi: "Avaa",
|
|
43
54
|
en: "Open",
|
|
44
|
-
sv: "
|
|
45
|
-
}
|
|
55
|
+
sv: "Öppna",
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Accessible label that is shown for screen reader users in the expandable
|
|
59
|
+
* open toggle. Not visible for normal users.
|
|
60
|
+
* @default {fi: "Avaa", en: "Open", sv: "Öppen"}
|
|
61
|
+
*/
|
|
62
|
+
this.accessibleOpenLabel = getLocaleString(this.accessibleOpenLabelDefaults, this.language);
|
|
46
63
|
/**
|
|
47
64
|
* Theme of the info panel.
|
|
48
65
|
*/
|
|
@@ -143,13 +160,45 @@ export class DuetTray {
|
|
|
143
160
|
"required": false,
|
|
144
161
|
"optional": false,
|
|
145
162
|
"docs": {
|
|
146
|
-
"tags": [
|
|
163
|
+
"tags": [{
|
|
164
|
+
"text": "this is now handled via the html lang tag, and is no longer used - kept to avoid breaking changes and ease unit testing",
|
|
165
|
+
"name": "deprecated"
|
|
166
|
+
}, {
|
|
167
|
+
"text": "\"fi\"",
|
|
168
|
+
"name": "default"
|
|
169
|
+
}],
|
|
147
170
|
"text": "The currently active language. This setting changes the accessible labels to match the\nchosen language."
|
|
148
171
|
},
|
|
149
172
|
"attribute": "language",
|
|
150
173
|
"reflect": false,
|
|
151
174
|
"defaultValue": "getLanguage()"
|
|
152
175
|
},
|
|
176
|
+
"accessibleCloseLabelDefaults": {
|
|
177
|
+
"type": "string",
|
|
178
|
+
"mutable": false,
|
|
179
|
+
"complexType": {
|
|
180
|
+
"original": "DuetLangObject | string",
|
|
181
|
+
"resolved": "DuetLangObject | string",
|
|
182
|
+
"references": {
|
|
183
|
+
"DuetLangObject": {
|
|
184
|
+
"location": "import",
|
|
185
|
+
"path": "../../utils/language-utils"
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
"required": false,
|
|
190
|
+
"optional": false,
|
|
191
|
+
"docs": {
|
|
192
|
+
"tags": [{
|
|
193
|
+
"text": "{fi: \"Sulje\", en: \"Close\", sv: \"St\u00E4nga\"}",
|
|
194
|
+
"name": "default"
|
|
195
|
+
}],
|
|
196
|
+
"text": "Defaults for accessibleCloseLabel"
|
|
197
|
+
},
|
|
198
|
+
"attribute": "accessible-close-label-default",
|
|
199
|
+
"reflect": false,
|
|
200
|
+
"defaultValue": "{\n fi: \"Sulje\",\n en: \"Close\",\n sv: \"St\u00E4ng\",\n }"
|
|
201
|
+
},
|
|
153
202
|
"accessibleCloseLabel": {
|
|
154
203
|
"type": "string",
|
|
155
204
|
"mutable": false,
|
|
@@ -161,12 +210,41 @@ export class DuetTray {
|
|
|
161
210
|
"required": false,
|
|
162
211
|
"optional": false,
|
|
163
212
|
"docs": {
|
|
164
|
-
"tags": [
|
|
213
|
+
"tags": [{
|
|
214
|
+
"text": "{fi: \"Sulje\", en: \"Close\", sv: \"St\u00E4nga\"}",
|
|
215
|
+
"name": "default"
|
|
216
|
+
}],
|
|
165
217
|
"text": "Accessible label that is shown for screen reader users in the expandable\nclose toggle. Not visible for normal users."
|
|
166
218
|
},
|
|
167
219
|
"attribute": "accessible-close-label",
|
|
168
220
|
"reflect": false,
|
|
169
|
-
"defaultValue": "getLocaleString(
|
|
221
|
+
"defaultValue": "getLocaleString(this.accessibleCloseLabelDefaults, this.language)"
|
|
222
|
+
},
|
|
223
|
+
"accessibleOpenLabelDefaults": {
|
|
224
|
+
"type": "string",
|
|
225
|
+
"mutable": false,
|
|
226
|
+
"complexType": {
|
|
227
|
+
"original": "DuetLangObject | string",
|
|
228
|
+
"resolved": "DuetLangObject | string",
|
|
229
|
+
"references": {
|
|
230
|
+
"DuetLangObject": {
|
|
231
|
+
"location": "import",
|
|
232
|
+
"path": "../../utils/language-utils"
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
"required": false,
|
|
237
|
+
"optional": false,
|
|
238
|
+
"docs": {
|
|
239
|
+
"tags": [{
|
|
240
|
+
"text": "{fi: \"Avaa\", en: \"Open\", sv: \"\u00D6ppen\"}",
|
|
241
|
+
"name": "default"
|
|
242
|
+
}],
|
|
243
|
+
"text": "Defaults for accessibleOpenLabel"
|
|
244
|
+
},
|
|
245
|
+
"attribute": "accessible-open-label-default",
|
|
246
|
+
"reflect": false,
|
|
247
|
+
"defaultValue": "{\n fi: \"Avaa\",\n en: \"Open\",\n sv: \"\u00D6ppna\",\n }"
|
|
170
248
|
},
|
|
171
249
|
"accessibleOpenLabel": {
|
|
172
250
|
"type": "string",
|
|
@@ -179,12 +257,15 @@ export class DuetTray {
|
|
|
179
257
|
"required": false,
|
|
180
258
|
"optional": false,
|
|
181
259
|
"docs": {
|
|
182
|
-
"tags": [
|
|
260
|
+
"tags": [{
|
|
261
|
+
"text": "{fi: \"Avaa\", en: \"Open\", sv: \"\u00D6ppen\"}",
|
|
262
|
+
"name": "default"
|
|
263
|
+
}],
|
|
183
264
|
"text": "Accessible label that is shown for screen reader users in the expandable\nopen toggle. Not visible for normal users."
|
|
184
265
|
},
|
|
185
266
|
"attribute": "accessible-open-label",
|
|
186
267
|
"reflect": false,
|
|
187
|
-
"defaultValue": "getLocaleString(
|
|
268
|
+
"defaultValue": "getLocaleString(this.accessibleOpenLabelDefaults, this.language)"
|
|
188
269
|
},
|
|
189
270
|
"theme": {
|
|
190
271
|
"type": "string",
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built with Duet Design System
|
|
3
|
+
*/
|
|
4
|
+
require("dotenv").config();
|
|
5
|
+
const port = process.env.KOA_PROXY_PORT ? parseInt(process.env.KOA_PROXY_PORT) : 3334;
|
|
1
6
|
import * as fs from "fs";
|
|
2
7
|
import * as path from "path";
|
|
3
8
|
import { createPage } from "./test-utils";
|
|
@@ -34,7 +39,7 @@ function getAllFixturesFiles(dirPath, fixPath = "fixtures", skipFixture = []) {
|
|
|
34
39
|
/**
|
|
35
40
|
* Generate automatic fixture testing for jest
|
|
36
41
|
*/
|
|
37
|
-
const htmlFragment = (fixtureHtml, theme = "", minHeight = "0px") => {
|
|
42
|
+
const htmlFragment = (fixtureHtml, theme = "", minHeight = "0px", lang = "fi") => {
|
|
38
43
|
let fontFile = "localtapiola";
|
|
39
44
|
let className = "";
|
|
40
45
|
if (theme === "turva") {
|
|
@@ -42,7 +47,7 @@ const htmlFragment = (fixtureHtml, theme = "", minHeight = "0px") => {
|
|
|
42
47
|
className = "duet-theme-turva";
|
|
43
48
|
}
|
|
44
49
|
return `
|
|
45
|
-
<html class="${className}" lang="
|
|
50
|
+
<html class="${className}" lang="${lang}" style="min-height: auto">
|
|
46
51
|
<head>
|
|
47
52
|
<meta charset="utf-8" />
|
|
48
53
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
@@ -67,14 +72,15 @@ const htmlFragment = (fixtureHtml, theme = "", minHeight = "0px") => {
|
|
|
67
72
|
}
|
|
68
73
|
|
|
69
74
|
</style>
|
|
70
|
-
<link rel="stylesheet" href="http://
|
|
71
|
-
<link rel="stylesheet" href="http://
|
|
72
|
-
<link rel="stylesheet" href="http://
|
|
75
|
+
<link rel="stylesheet" href="http://0.0.0.0:${port}/fonts/lib/${fontFile}.css" />
|
|
76
|
+
<link rel="stylesheet" href="http://0.0.0.0:${port}/tokens/lib/tokens.custom-properties.css" />
|
|
77
|
+
<link rel="stylesheet" href="http://0.0.0.0:${port}/css/lib/duet.css" />
|
|
73
78
|
</head>
|
|
74
79
|
<body style="min-height: ${minHeight} !important; margin: 8px">
|
|
75
80
|
${fixtureHtml}
|
|
76
81
|
</body>
|
|
77
82
|
</html>
|
|
83
|
+
|
|
78
84
|
`;
|
|
79
85
|
};
|
|
80
86
|
// getFixturesAndTest returns fixtures object and creates synthetic tests
|
|
@@ -93,10 +99,14 @@ export const fixtureTests = (componentFixtures, minHeight) => {
|
|
|
93
99
|
const html = componentFixtures.fixtures[fixtureName];
|
|
94
100
|
it(`${fixtureName} renders correctly with Turva theme`, async () => {
|
|
95
101
|
const page = await createPage(htmlFragment(html, "turva", minHeight));
|
|
102
|
+
// Configure the navigation timeout
|
|
103
|
+
await page.setDefaultNavigationTimeout(0);
|
|
96
104
|
expect(await page.screenshot()).toMatchImageSnapshot();
|
|
97
105
|
});
|
|
98
106
|
it(`${fixtureName} renders correctly with Lahitapiola theme`, async () => {
|
|
99
107
|
const page = await createPage(htmlFragment(html, "default", minHeight));
|
|
108
|
+
// Configure the navigation timeout
|
|
109
|
+
await page.setDefaultNavigationTimeout(0);
|
|
100
110
|
expect(await page.screenshot()).toMatchImageSnapshot();
|
|
101
111
|
});
|
|
102
112
|
});
|
|
@@ -1,3 +1,30 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built with Duet Design System
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* This function restores cursor position after changing input
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* const resetCursor = storeAndResetCursor(this.input.selectionStart,this.input.selectionEnd)
|
|
9
|
+
* this.input.changeValueAndForceUpdateOfCursoPosition()
|
|
10
|
+
* resetCursor()
|
|
11
|
+
*/
|
|
12
|
+
export function resetCursor(domElement) {
|
|
13
|
+
if (domElement && domElement.selectionStart) {
|
|
14
|
+
const start = domElement.selectionStart;
|
|
15
|
+
const end = domElement.selectionEnd;
|
|
16
|
+
return function () {
|
|
17
|
+
if (start === end) {
|
|
18
|
+
domElement.selectionStart = start;
|
|
19
|
+
domElement.selectionEnd = end;
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
domElement.setSelectionRange(start, end);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
return () => console.log("domElement not valid");
|
|
27
|
+
}
|
|
1
28
|
/**
|
|
2
29
|
* Given an input and a regex, remove any characters from the input's value
|
|
3
30
|
* which match the regex, *whilst* maintaining cursor position.
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built with Duet Design System
|
|
3
|
+
*/
|
|
4
|
+
import { convertHtmlQuotes } from "./string-utils";
|
|
1
5
|
const localeLookUpTable = {
|
|
2
6
|
fi: "fi-FI",
|
|
3
7
|
en: "en-GB",
|
|
@@ -12,13 +16,13 @@ const localeMonetarySignifierLookUpTable = {
|
|
|
12
16
|
};
|
|
13
17
|
const defLanguageArray = ["fi", "en", "sv"];
|
|
14
18
|
const defaultLanguage = "fi";
|
|
15
|
-
const
|
|
16
|
-
? document.documentElement.lang.toLowerCase()
|
|
17
|
-
|
|
19
|
+
export const getCurrentLanguage = () => {
|
|
20
|
+
return document.documentElement.lang ? document.documentElement.lang.toLowerCase() : defaultLanguage;
|
|
21
|
+
};
|
|
18
22
|
export const isOfTypeLanguage = (keyInput) => {
|
|
19
23
|
return defLanguageArray.includes(keyInput);
|
|
20
24
|
};
|
|
21
|
-
const checkForLanguage = (languageString =
|
|
25
|
+
const checkForLanguage = (languageString = getCurrentLanguage()) => {
|
|
22
26
|
if (isOfTypeLanguage(languageString)) {
|
|
23
27
|
return languageString;
|
|
24
28
|
}
|
|
@@ -26,8 +30,20 @@ const checkForLanguage = (languageString = currentLanguage) => {
|
|
|
26
30
|
return defaultLanguage;
|
|
27
31
|
}
|
|
28
32
|
};
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Returns the current language as a string representation (taken from html lang attribute)
|
|
35
|
+
* If language is not fi|sv|en it will default to "fi"
|
|
36
|
+
* @param {string} lang=fi - "fi" | "sv" | "en"
|
|
37
|
+
* @default {string} "fi"
|
|
38
|
+
*/
|
|
39
|
+
export const getLanguage = (languageString = getCurrentLanguage()) => checkForLanguage(languageString);
|
|
40
|
+
/**
|
|
41
|
+
* Returns the current language and locale
|
|
42
|
+
* If language is not fi|sv|en it will default to "fi"
|
|
43
|
+
* special case where lang can be ALSO be "us" in addition to other types - if user decides to override local language
|
|
44
|
+
* @param {string} lang="fi" - "fi" | "sv" | "en" | "us"
|
|
45
|
+
* @default {object} {locale: "fi-FI", money: "€"}
|
|
46
|
+
*/
|
|
31
47
|
export const getLocale = (lang) => {
|
|
32
48
|
const returnObj = {
|
|
33
49
|
locale: localeLookUpTable[lang],
|
|
@@ -38,11 +54,33 @@ export const getLocale = (lang) => {
|
|
|
38
54
|
}
|
|
39
55
|
throw new Error(`Locale for "${lang}" not found`);
|
|
40
56
|
};
|
|
57
|
+
const sanitizeString = (string) => {
|
|
58
|
+
const argIsString = typeof string === "string";
|
|
59
|
+
if (argIsString) {
|
|
60
|
+
try {
|
|
61
|
+
return JSON.parse(convertHtmlQuotes(string));
|
|
62
|
+
}
|
|
63
|
+
catch (e) {
|
|
64
|
+
console.log("getLocaleString received a string, that didnt parse to json object", string, e);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return string;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Returns the current string / object from a given translation object
|
|
71
|
+
* If language is not fi|sv|en it will default to "fi"
|
|
72
|
+
* special case where lang can be ALSO be "us" in addition to other types - if user decides to override local language
|
|
73
|
+
* @param {object} langObject - {fi: "finnish", sv: "swedish", en: "english"} | string will get JSON.parsed
|
|
74
|
+
* @param {boolean} languageOverride = false - in case you want to override the actual language set in html tag
|
|
75
|
+
* @default {object} {locale: "fi-FI", money: "€"}
|
|
76
|
+
* @returns {(string|Object)} given example contains {fi:"something"} and langua===fi this will return "something"
|
|
77
|
+
*/
|
|
41
78
|
export const getLocaleString = (langObject, languageOverride) => {
|
|
79
|
+
const obj = sanitizeString(langObject);
|
|
42
80
|
if (languageOverride) {
|
|
43
|
-
return
|
|
81
|
+
return obj[checkForLanguage(languageOverride)];
|
|
44
82
|
}
|
|
45
83
|
else {
|
|
46
|
-
return
|
|
84
|
+
return obj[getLanguage()];
|
|
47
85
|
}
|
|
48
86
|
};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built with Duet Design System
|
|
3
|
+
*/
|
|
1
4
|
function isObject(maybeObj) {
|
|
2
5
|
return Object.prototype.toString.call(maybeObj) === "[object Object]";
|
|
3
6
|
}
|
|
@@ -17,7 +20,28 @@ export const parsePossibleJSON = (maybeJSON) => {
|
|
|
17
20
|
// so we use it here to signal invalid input
|
|
18
21
|
return undefined;
|
|
19
22
|
};
|
|
23
|
+
/**
|
|
24
|
+
* Format string, via simplistic sprintf equivalent
|
|
25
|
+
* @example String.format('{0} is super, but {1} is best! {{0}}', 'Duet', 'Coffee'); -> "Duet is super, but Coffee ist best! {0}"
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
// @ts-ignore
|
|
29
|
+
if (!String.format) {
|
|
30
|
+
// @ts-ignore
|
|
31
|
+
String.format = function (format) {
|
|
32
|
+
var args = Array.prototype.slice.call(arguments, 1);
|
|
33
|
+
return format.replace(/\{\{|\}\}|\{(\d+)\}/g, function (curlyBrack, index) {
|
|
34
|
+
return curlyBrack == "{{" ? "{" : curlyBrack == "}}" ? "}" : args[index];
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
}
|
|
20
38
|
const MATCH_DISALLOWED_CHARS = /[^a-z0-9áéíóúñüöäå \.,_-]/gim;
|
|
21
39
|
export function sanitizeString(string) {
|
|
22
40
|
return string.replace(MATCH_DISALLOWED_CHARS, "").trim();
|
|
23
41
|
}
|
|
42
|
+
export const convertHtmlQuotes = string => {
|
|
43
|
+
if (typeof string === "string") {
|
|
44
|
+
return string.replace(/"/g, '"').replace(/'/g, '"');
|
|
45
|
+
}
|
|
46
|
+
return string;
|
|
47
|
+
};
|