@duetds/components 4.30.1 → 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/hydrate/index.js +230 -1038
- package/lib/cjs/duet-alert.cjs.entry.js +4 -2
- package/lib/cjs/duet-badge.cjs.entry.js +2 -2
- package/lib/cjs/duet-button_2.cjs.entry.js +4 -3
- package/lib/cjs/duet-caption_4.cjs.entry.js +7 -8
- package/lib/cjs/duet-card.cjs.entry.js +4 -4
- package/lib/cjs/duet-checkbox.cjs.entry.js +1 -1
- package/lib/cjs/duet-choice_2.cjs.entry.js +4 -3
- package/lib/cjs/duet-collapsible.cjs.entry.js +2 -2
- package/lib/cjs/duet-cookie-consent.cjs.entry.js +1 -1
- package/lib/cjs/duet-date-picker.cjs.entry.js +22 -12
- package/lib/cjs/duet-divider_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-empty-state.cjs.entry.js +1 -1
- package/lib/cjs/duet-fieldset.cjs.entry.js +1 -1
- package/lib/cjs/duet-footer.cjs.entry.js +4 -4
- package/lib/cjs/duet-grid_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-header_2.cjs.entry.js +25 -9
- package/lib/cjs/duet-hero.cjs.entry.js +6 -6
- package/lib/cjs/duet-icon.cjs.entry.js +3 -3
- package/lib/cjs/duet-input_2.cjs.entry.js +2 -2
- package/lib/cjs/duet-layout.cjs.entry.js +1 -1
- package/lib/cjs/duet-list_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-modal.cjs.entry.js +8 -7
- package/lib/cjs/duet-notification_2.cjs.entry.js +6 -5
- package/lib/cjs/duet-number-input.cjs.entry.js +36 -15
- package/lib/cjs/duet-radio_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-range-slider.cjs.entry.js +1 -1
- package/lib/cjs/duet-select.cjs.entry.js +2 -2
- package/lib/cjs/duet-step_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-tab_2.cjs.entry.js +11 -5
- package/lib/cjs/duet-table.cjs.entry.js +1 -1
- package/lib/cjs/duet-textarea.cjs.entry.js +1 -1
- package/lib/cjs/duet-toggle.cjs.entry.js +1 -1
- package/lib/cjs/duet-tooltip.cjs.entry.js +21 -10
- package/lib/cjs/duet-tray.cjs.entry.js +20 -9
- package/lib/cjs/duet-visually-hidden.cjs.entry.js +1 -1
- package/lib/cjs/duet.cjs.js +2 -2
- package/lib/cjs/{focus-utils-7605778f.js → focus-utils-bd331feb.js} +1 -1
- package/lib/cjs/{index-0c949193.js → index-113c2add.js} +0 -3
- package/lib/cjs/{language-utils-70d6a9a4.js → language-utils-48b8860b.js} +23 -8
- package/lib/cjs/loader.cjs.js +2 -2
- package/lib/cjs/{string-utils-a6de43d8.js → string-utils-267e3dbb.js} +7 -0
- package/lib/collection/collection-manifest.json +0 -6
- package/lib/collection/components/duet-alert/duet-alert.js +10 -4
- package/lib/collection/components/duet-badge/duet-badge.css +1 -0
- package/lib/collection/components/duet-button/duet-button.js +7 -5
- package/lib/collection/components/duet-card/duet-card.css +10 -7
- package/lib/collection/components/duet-card/duet-card.js +3 -5
- package/lib/collection/components/duet-choice/duet-choice.js +5 -3
- package/lib/collection/components/duet-choice-group/duet-choice-group.css +1 -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 +73 -38
- package/lib/collection/components/duet-footer/duet-footer.js +7 -5
- package/lib/collection/components/duet-header/duet-header.js +46 -21
- package/lib/collection/components/duet-heading/duet-heading.css +1 -0
- package/lib/collection/components/duet-hero/duet-hero.js +14 -9
- package/lib/collection/components/duet-icon/icon-utils.js +1 -1
- package/lib/collection/components/duet-label/duet-label.css +2 -0
- package/lib/collection/components/duet-link/duet-link.js +10 -11
- package/lib/collection/components/duet-modal/duet-modal.js +16 -11
- package/lib/collection/components/duet-notification-drawer/duet-notification-drawer.js +14 -9
- package/lib/collection/components/duet-number-input/duet-number-input.js +141 -17
- package/lib/collection/components/duet-tab-group/duet-tab-group.js +35 -4
- package/lib/collection/components/duet-tooltip/duet-tooltip.js +72 -10
- package/lib/collection/components/duet-tray/duet-tray.js +71 -9
- package/lib/collection/utils/fixture-utils.js +7 -5
- package/lib/collection/utils/language-utils.js +22 -8
- package/lib/collection/utils/string-utils.js +6 -0
- package/lib/custom-elements-bundle/index.d.ts +0 -6
- package/lib/custom-elements-bundle/index.js +224 -995
- package/lib/duet/duet.esm.js +1 -1
- package/lib/duet/duet.js +1 -1
- package/lib/duet/p-0058512b.js +4 -0
- package/lib/duet/p-0224db45.entry.js +4 -0
- package/lib/duet/{p-345ea4f2.system.entry.js → p-02ad46a0.system.entry.js} +1 -1
- package/lib/duet/{p-62806bb6.system.entry.js → p-07263910.system.entry.js} +1 -1
- package/lib/duet/{p-f82709ba.entry.js → p-1bfbc988.entry.js} +1 -1
- 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-c0b95b58.entry.js → p-202bbd70.entry.js} +1 -1
- package/lib/duet/{p-d1817efe.system.entry.js → p-22f56356.system.entry.js} +1 -1
- package/lib/duet/{p-f81d8534.entry.js → p-28b67b94.entry.js} +1 -1
- package/lib/duet/{p-b4374f0e.entry.js → p-33426ddc.entry.js} +1 -1
- 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-2a1a9f9f.entry.js → p-44ffb960.entry.js} +1 -1
- package/lib/duet/{p-dee41056.system.entry.js → p-453955cc.system.entry.js} +1 -1
- package/lib/duet/{p-66dde4d2.entry.js → p-4670a654.entry.js} +1 -1
- package/lib/duet/p-47645ea8.system.entry.js +4 -0
- package/lib/duet/p-504dbf8f.system.entry.js +4 -0
- package/lib/duet/{p-62c294d6.system.entry.js → p-5230ee3c.system.entry.js} +1 -1
- package/lib/duet/{p-bbc229d8.system.entry.js → p-56e172f5.system.entry.js} +1 -1
- package/lib/duet/{p-de2be65b.system.js → p-57ea2576.system.js} +1 -1
- package/lib/duet/p-5aa0d34d.entry.js +4 -0
- package/lib/duet/p-5fc7e1f7.system.entry.js +4 -0
- package/lib/duet/{p-3dc9d15d.system.entry.js → p-605bc214.system.entry.js} +1 -1
- package/lib/duet/{p-4a7911fd.entry.js → p-60ab57d4.entry.js} +1 -1
- package/lib/duet/p-64109493.entry.js +4 -0
- package/lib/duet/{p-7e108b7e.entry.js → p-69a5dc6b.entry.js} +1 -1
- package/lib/duet/{p-8cfce39e.system.entry.js → p-6a230911.system.entry.js} +1 -1
- package/lib/duet/p-6a760b8a.entry.js +4 -0
- package/lib/duet/{p-c9303f9a.entry.js → p-6d2da245.entry.js} +1 -1
- package/lib/duet/{p-ceb75b35.system.entry.js → p-712e7dde.system.entry.js} +1 -1
- package/lib/duet/{p-f71f12ed.entry.js → p-746655ba.entry.js} +1 -1
- package/lib/duet/p-7b6db837.system.entry.js +4 -0
- package/lib/duet/p-7d080785.system.entry.js +4 -0
- package/lib/duet/{p-4095dba5.entry.js → p-82dc2e0b.entry.js} +1 -1
- package/lib/duet/p-8c8e82aa.system.js +4 -0
- package/lib/duet/{p-fc397e03.system.entry.js → p-8c980350.system.entry.js} +1 -1
- package/lib/duet/{p-1cfe38b1.system.entry.js → p-8cb47a70.system.entry.js} +1 -1
- package/lib/duet/{p-7ee52f58.entry.js → p-8f03c3eb.entry.js} +1 -1
- package/lib/duet/p-91fa68a5.js +4 -0
- package/lib/duet/{p-e26116e0.system.entry.js → p-92d38668.system.entry.js} +1 -1
- package/lib/duet/p-95626e7e.system.entry.js +4 -0
- package/lib/duet/p-96808a2e.system.entry.js +4 -0
- package/lib/duet/{p-8ffe1461.system.entry.js → p-96c103b2.system.entry.js} +1 -1
- package/lib/duet/p-986779fb.js +4 -0
- package/lib/duet/{p-35e45c19.system.js → p-9a945278.system.js} +1 -1
- package/lib/duet/{p-2d2c45f9.entry.js → p-9c94be45.entry.js} +1 -1
- package/lib/duet/p-9ce1baab.system.entry.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-b03a46b6.entry.js +4 -0
- package/lib/duet/{p-a88df408.entry.js → p-b1b8e510.entry.js} +1 -1
- 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-c3688975.entry.js → p-ba205dca.entry.js} +1 -1
- package/lib/duet/{p-f71e337e.system.entry.js → p-bcae23fc.system.entry.js} +1 -1
- package/lib/duet/{p-5c5bdb06.system.entry.js → p-be19c57b.system.entry.js} +1 -1
- package/lib/duet/{p-a321a98c.entry.js → p-c4737f88.entry.js} +1 -1
- package/lib/duet/p-c5beceed.js +4 -0
- package/lib/duet/{p-27d538f7.system.entry.js → p-c5f10483.system.entry.js} +1 -1
- package/lib/duet/{p-a6096b05.system.entry.js → p-d35fd913.system.entry.js} +1 -1
- package/lib/duet/p-d4b4bfa6.entry.js +4 -0
- package/lib/duet/p-d7623eb8.system.entry.js +4 -0
- package/lib/duet/{p-36007600.entry.js → p-dc85d2a4.entry.js} +1 -1
- package/lib/duet/p-de093c16.entry.js +4 -0
- package/lib/duet/p-de842863.entry.js +4 -0
- package/lib/duet/{p-59a07cf9.entry.js → p-e08b8909.entry.js} +1 -1
- package/lib/duet/p-e39471b6.entry.js +4 -0
- package/lib/duet/p-e834c8d5.system.entry.js +4 -0
- package/lib/duet/{p-ce1374a4.system.entry.js → p-ef45cfe9.system.entry.js} +1 -1
- package/lib/duet/{p-031c2cd8.system.entry.js → p-f0b1850a.system.entry.js} +1 -1
- package/lib/duet/p-f53c8019.entry.js +4 -0
- package/lib/duet/{p-4265de16.system.entry.js → p-f96c4093.system.entry.js} +1 -1
- package/lib/duet/p-fbd83d67.entry.js +4 -0
- package/lib/duet/{p-1c41525a.entry.js → p-fdecaf46.entry.js} +1 -1
- package/lib/esm/duet-alert.entry.js +4 -2
- package/lib/esm/duet-badge.entry.js +2 -2
- package/lib/esm/duet-button_2.entry.js +4 -3
- package/lib/esm/duet-caption_4.entry.js +7 -8
- package/lib/esm/duet-card.entry.js +4 -4
- package/lib/esm/duet-checkbox.entry.js +1 -1
- package/lib/esm/duet-choice_2.entry.js +4 -3
- package/lib/esm/duet-collapsible.entry.js +2 -2
- package/lib/esm/duet-cookie-consent.entry.js +1 -1
- package/lib/esm/duet-date-picker.entry.js +22 -12
- package/lib/esm/duet-divider_2.entry.js +1 -1
- package/lib/esm/duet-empty-state.entry.js +1 -1
- package/lib/esm/duet-fieldset.entry.js +1 -1
- package/lib/esm/duet-footer.entry.js +4 -4
- package/lib/esm/duet-grid_2.entry.js +1 -1
- package/lib/esm/duet-header_2.entry.js +25 -9
- package/lib/esm/duet-hero.entry.js +6 -6
- package/lib/esm/duet-icon.entry.js +3 -3
- package/lib/esm/duet-input_2.entry.js +2 -2
- package/lib/esm/duet-layout.entry.js +1 -1
- package/lib/esm/duet-list_2.entry.js +1 -1
- package/lib/esm/duet-modal.entry.js +8 -7
- package/lib/esm/duet-notification_2.entry.js +6 -5
- package/lib/esm/duet-number-input.entry.js +36 -15
- package/lib/esm/duet-radio_2.entry.js +1 -1
- package/lib/esm/duet-range-slider.entry.js +1 -1
- package/lib/esm/duet-select.entry.js +2 -2
- package/lib/esm/duet-step_2.entry.js +1 -1
- package/lib/esm/duet-tab_2.entry.js +11 -5
- package/lib/esm/duet-table.entry.js +1 -1
- package/lib/esm/duet-textarea.entry.js +1 -1
- package/lib/esm/duet-toggle.entry.js +1 -1
- package/lib/esm/duet-tooltip.entry.js +21 -10
- package/lib/esm/duet-tray.entry.js +20 -9
- package/lib/esm/duet-visually-hidden.entry.js +1 -1
- package/lib/esm/duet.js +2 -2
- package/lib/esm/{focus-utils-0b12f0df.js → focus-utils-1995e5a9.js} +1 -1
- package/lib/esm/{index-f70ddc7f.js → index-6e246691.js} +0 -3
- package/lib/esm/{language-utils-ab9c3afc.js → language-utils-d5c38f65.js} +23 -8
- package/lib/esm/loader.js +2 -2
- package/lib/esm/{string-utils-69cf0d09.js → string-utils-2f1793b8.js} +7 -1
- package/lib/esm-es5/duet-alert.entry.js +1 -1
- package/lib/esm-es5/duet-badge.entry.js +1 -1
- package/lib/esm-es5/duet-button_2.entry.js +1 -1
- package/lib/esm-es5/duet-caption_4.entry.js +1 -1
- package/lib/esm-es5/duet-card.entry.js +1 -1
- package/lib/esm-es5/duet-checkbox.entry.js +1 -1
- package/lib/esm-es5/duet-choice_2.entry.js +1 -1
- package/lib/esm-es5/duet-collapsible.entry.js +1 -1
- package/lib/esm-es5/duet-cookie-consent.entry.js +1 -1
- package/lib/esm-es5/duet-date-picker.entry.js +1 -1
- package/lib/esm-es5/duet-divider_2.entry.js +1 -1
- package/lib/esm-es5/duet-empty-state.entry.js +1 -1
- package/lib/esm-es5/duet-fieldset.entry.js +1 -1
- package/lib/esm-es5/duet-footer.entry.js +1 -1
- package/lib/esm-es5/duet-grid_2.entry.js +1 -1
- package/lib/esm-es5/duet-header_2.entry.js +1 -1
- package/lib/esm-es5/duet-hero.entry.js +1 -1
- package/lib/esm-es5/duet-icon.entry.js +1 -1
- package/lib/esm-es5/duet-input_2.entry.js +1 -1
- package/lib/esm-es5/duet-layout.entry.js +1 -1
- package/lib/esm-es5/duet-list_2.entry.js +1 -1
- package/lib/esm-es5/duet-modal.entry.js +1 -1
- package/lib/esm-es5/duet-notification_2.entry.js +1 -1
- package/lib/esm-es5/duet-number-input.entry.js +2 -2
- package/lib/esm-es5/duet-radio_2.entry.js +1 -1
- package/lib/esm-es5/duet-range-slider.entry.js +1 -1
- package/lib/esm-es5/duet-select.entry.js +1 -1
- package/lib/esm-es5/duet-step_2.entry.js +1 -1
- package/lib/esm-es5/duet-tab_2.entry.js +1 -1
- package/lib/esm-es5/duet-table.entry.js +1 -1
- package/lib/esm-es5/duet-textarea.entry.js +1 -1
- package/lib/esm-es5/duet-toggle.entry.js +1 -1
- package/lib/esm-es5/duet-tooltip.entry.js +1 -1
- package/lib/esm-es5/duet-tray.entry.js +1 -1
- package/lib/esm-es5/duet-visually-hidden.entry.js +1 -1
- package/lib/esm-es5/duet.js +1 -1
- package/lib/esm-es5/focus-utils-1995e5a9.js +4 -0
- package/lib/esm-es5/{index-f70ddc7f.js → index-6e246691.js} +1 -1
- package/lib/esm-es5/language-utils-d5c38f65.js +4 -0
- package/lib/esm-es5/loader.js +1 -1
- package/lib/esm-es5/{string-utils-69cf0d09.js → string-utils-2f1793b8.js} +1 -1
- package/lib/html.html-data.json +4489 -0
- package/lib/types/components/duet-alert/duet-alert.d.ts +2 -1
- package/lib/types/components/duet-button/duet-button.d.ts +1 -1
- package/lib/types/components/duet-choice/duet-choice.d.ts +1 -1
- package/lib/types/components/duet-date-picker/duet-date-picker.d.ts +13 -7
- package/lib/types/components/duet-footer/duet-footer.d.ts +1 -1
- package/lib/types/components/duet-header/duet-header.d.ts +21 -5
- package/lib/types/components/duet-hero/duet-hero.d.ts +3 -3
- package/lib/types/components/duet-link/duet-link.d.ts +2 -3
- package/lib/types/components/duet-modal/duet-modal.d.ts +3 -3
- package/lib/types/components/duet-notification-drawer/duet-notification-drawer.d.ts +3 -3
- package/lib/types/components/duet-number-input/duet-number-input.d.ts +21 -0
- package/lib/types/components/duet-tab-group/duet-tab-group.d.ts +6 -0
- package/lib/types/components/duet-tooltip/duet-tooltip.d.ts +11 -0
- package/lib/types/components/duet-tray/duet-tray.d.ts +11 -0
- package/lib/types/components.d.ts +146 -384
- package/lib/types/utils/language-utils.d.ts +3 -2
- package/lib/types/utils/string-utils.d.ts +1 -0
- package/package.json +18 -14
- package/lib/cjs/duet-upload.cjs.entry.js +0 -866
- package/lib/collection/components/duet-upload/duet-upload-file-list.js +0 -49
- package/lib/collection/components/duet-upload/duet-upload-validators.js +0 -93
- package/lib/collection/components/duet-upload/duet-upload.css +0 -133
- package/lib/collection/components/duet-upload/duet-upload.js +0 -1440
- package/lib/collection/components/duet-upload/errorcodes.utils.js +0 -20
- package/lib/collection/components/duet-upload/mock.helpers.js +0 -91
- package/lib/collection/components/duet-upload/upload.helpers.js +0 -13
- package/lib/collection/components/duet-upload/xhr.helpers.js +0 -34
- package/lib/duet/p-0733c303.system.entry.js +0 -4
- package/lib/duet/p-095060cc.js +0 -4
- package/lib/duet/p-156864a1.system.entry.js +0 -4
- package/lib/duet/p-1911dfe7.system.entry.js +0 -4
- package/lib/duet/p-2834a302.entry.js +0 -4
- package/lib/duet/p-28a3d38f.system.entry.js +0 -4
- package/lib/duet/p-2a4d7c5b.system.entry.js +0 -4
- package/lib/duet/p-4289b543.entry.js +0 -4
- package/lib/duet/p-46a3ae43.system.js +0 -4
- package/lib/duet/p-4a38cf9d.entry.js +0 -4
- package/lib/duet/p-4be8e814.entry.js +0 -4
- package/lib/duet/p-591b2137.entry.js +0 -4
- package/lib/duet/p-5f70e318.entry.js +0 -4
- package/lib/duet/p-6c2729da.js +0 -4
- package/lib/duet/p-6f107847.system.entry.js +0 -4
- package/lib/duet/p-77a5fe4c.system.js +0 -4
- package/lib/duet/p-7809e78b.system.entry.js +0 -4
- package/lib/duet/p-7a36d76f.system.entry.js +0 -4
- package/lib/duet/p-884693f1.entry.js +0 -4
- package/lib/duet/p-8977b722.entry.js +0 -4
- package/lib/duet/p-89db3b94.entry.js +0 -4
- package/lib/duet/p-9381c2d4.entry.js +0 -4
- package/lib/duet/p-9a450c9a.entry.js +0 -4
- package/lib/duet/p-9bbfe606.system.entry.js +0 -4
- package/lib/duet/p-a0a066cb.system.entry.js +0 -4
- package/lib/duet/p-a89d5d7c.entry.js +0 -4
- package/lib/duet/p-b07055fd.system.entry.js +0 -4
- package/lib/duet/p-b456d684.system.entry.js +0 -4
- package/lib/duet/p-bd18c93f.js +0 -4
- package/lib/duet/p-bddb1c15.system.entry.js +0 -4
- package/lib/duet/p-c4d183e6.entry.js +0 -4
- package/lib/duet/p-cd4e8ccf.js +0 -4
- package/lib/duet/p-cf243bcb.system.entry.js +0 -4
- package/lib/duet/p-d37c8a05.system.js +0 -4
- package/lib/duet/p-d989af11.entry.js +0 -4
- package/lib/duet/p-e6128d82.system.entry.js +0 -4
- package/lib/duet/p-e86cdc17.entry.js +0 -4
- package/lib/duet/p-eadb29c7.entry.js +0 -4
- package/lib/duet/p-f30b14d6.system.entry.js +0 -4
- package/lib/duet/p-f79f8da1.entry.js +0 -4
- package/lib/esm/duet-upload.entry.js +0 -862
- package/lib/esm-es5/duet-upload.entry.js +0 -4
- package/lib/esm-es5/focus-utils-0b12f0df.js +0 -4
- package/lib/esm-es5/language-utils-ab9c3afc.js +0 -4
- package/lib/types/components/duet-upload/duet-upload-file-list.d.ts +0 -9
- package/lib/types/components/duet-upload/duet-upload-validators.d.ts +0 -12
- package/lib/types/components/duet-upload/duet-upload.d.ts +0 -311
- package/lib/types/components/duet-upload/errorcodes.utils.d.ts +0 -7
- package/lib/types/components/duet-upload/mock.helpers.d.ts +0 -2
- package/lib/types/components/duet-upload/upload.helpers.d.ts +0 -1
- package/lib/types/components/duet-upload/xhr.helpers.d.ts +0 -12
|
@@ -28,37 +28,52 @@ export class DuetNumberInput {
|
|
|
28
28
|
*/
|
|
29
29
|
this.unit = getLocale(this.language).money;
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
32
|
-
* The string {current} is replaced with the current amount.
|
|
31
|
+
* Defaults for accessibleLive
|
|
33
32
|
* @default {fi: "{current} euroa valittuna", en: "{current} euros selected", sv: "{current} valda euro"}
|
|
34
33
|
*/
|
|
35
|
-
this.
|
|
34
|
+
this.accessibleLiveDefaults = {
|
|
36
35
|
fi: "{current} euroa valittuna",
|
|
37
36
|
en: "{current} euros selected",
|
|
38
37
|
sv: "{current} euro valt",
|
|
39
|
-
}
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Format of message used to announce current amount when switching between amounts.
|
|
41
|
+
* The string {current} is replaced with the current amount.
|
|
42
|
+
* @default {fi: "{current} euroa valittuna", en: "{current} euros selected", sv: "{current} valda euro"}
|
|
43
|
+
*/
|
|
44
|
+
this.accessibleLive = getLocaleString(this.accessibleLiveDefaults, this.language);
|
|
40
45
|
/**
|
|
41
46
|
* Disables the aria-live messaging used internally in this component. This could be useful when you want to use custom aria-live messages instead.
|
|
42
47
|
*/
|
|
43
48
|
this.accessibleLiveEnabled = true;
|
|
44
49
|
/**
|
|
45
|
-
*
|
|
50
|
+
* Defaults for accessibleAdd
|
|
46
51
|
* @default {fi: "Lisää summaan", en: "Add to the amount", sv: "Lägg till beloppet"}
|
|
47
52
|
*/
|
|
48
|
-
this.
|
|
53
|
+
this.accessibleAddDefaults = {
|
|
49
54
|
fi: "Lisää summaan",
|
|
50
55
|
en: "Add to the amount",
|
|
51
56
|
sv: "Lägg till beloppet",
|
|
52
|
-
}
|
|
57
|
+
};
|
|
53
58
|
/**
|
|
54
|
-
* Accessible label for the
|
|
59
|
+
* Accessible label for the add button that is read for screen reader users.
|
|
60
|
+
* @default {fi: "Lisää summaan", en: "Add to the amount", sv: "Lägg till beloppet"}
|
|
61
|
+
*/
|
|
62
|
+
this.accessibleAdd = getLocaleString(this.accessibleAddDefaults, this.language);
|
|
63
|
+
/**
|
|
64
|
+
* Defaults for accessibleSubtract
|
|
55
65
|
* @default {fi: "Vähennä summasta", en: "Subtract from the amount", sv: "Dra från beloppet"}
|
|
56
66
|
*/
|
|
57
|
-
this.
|
|
67
|
+
this.accessibleSubtractDefaults = {
|
|
58
68
|
fi: "Vähennä summasta",
|
|
59
69
|
en: "Subtract from the amount",
|
|
60
70
|
sv: "Dra från beloppet",
|
|
61
|
-
}
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Accessible label for the subtract button that is read for screen reader users.
|
|
74
|
+
* @default {fi: "Vähennä summasta", en: "Subtract from the amount", sv: "Dra från beloppet"}
|
|
75
|
+
*/
|
|
76
|
+
this.accessibleSubtract = getLocaleString(this.accessibleSubtractDefaults, this.language);
|
|
62
77
|
/**
|
|
63
78
|
* Theme of the input.
|
|
64
79
|
*/
|
|
@@ -76,14 +91,19 @@ export class DuetNumberInput {
|
|
|
76
91
|
*/
|
|
77
92
|
this.min = 0;
|
|
78
93
|
/**
|
|
79
|
-
*
|
|
94
|
+
* Defaults for Label
|
|
80
95
|
* @default {fi: "Etiketti", en: "Label", sv: "Märka"}
|
|
81
96
|
*/
|
|
82
|
-
this.
|
|
97
|
+
this.labelDefaults = {
|
|
83
98
|
fi: "Nimilappu",
|
|
84
99
|
en: "Label",
|
|
85
100
|
sv: "Etikett",
|
|
86
|
-
}
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Label for the number input.
|
|
104
|
+
* @default {fi: "Etiketti", en: "Label", sv: "Märka"}
|
|
105
|
+
*/
|
|
106
|
+
this.label = getLocaleString(this.labelDefaults, this.language);
|
|
87
107
|
/**
|
|
88
108
|
* Visually hide the label, but still show it to screen readers.
|
|
89
109
|
*/
|
|
@@ -471,6 +491,32 @@ export class DuetNumberInput {
|
|
|
471
491
|
"attribute": "accessible-described-by",
|
|
472
492
|
"reflect": false
|
|
473
493
|
},
|
|
494
|
+
"accessibleLiveDefaults": {
|
|
495
|
+
"type": "string",
|
|
496
|
+
"mutable": false,
|
|
497
|
+
"complexType": {
|
|
498
|
+
"original": "DuetLangObject | string",
|
|
499
|
+
"resolved": "DuetLangObject | string",
|
|
500
|
+
"references": {
|
|
501
|
+
"DuetLangObject": {
|
|
502
|
+
"location": "import",
|
|
503
|
+
"path": "../../utils/language-utils"
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
},
|
|
507
|
+
"required": false,
|
|
508
|
+
"optional": false,
|
|
509
|
+
"docs": {
|
|
510
|
+
"tags": [{
|
|
511
|
+
"text": "{fi: \"{current} euroa valittuna\", en: \"{current} euros selected\", sv: \"{current} valda euro\"}",
|
|
512
|
+
"name": "default"
|
|
513
|
+
}],
|
|
514
|
+
"text": "Defaults for accessibleLive"
|
|
515
|
+
},
|
|
516
|
+
"attribute": "accessible-live-default",
|
|
517
|
+
"reflect": false,
|
|
518
|
+
"defaultValue": "{\n fi: \"{current} euroa valittuna\",\n en: \"{current} euros selected\",\n sv: \"{current} euro valt\",\n }"
|
|
519
|
+
},
|
|
474
520
|
"accessibleLive": {
|
|
475
521
|
"type": "string",
|
|
476
522
|
"mutable": false,
|
|
@@ -490,7 +536,7 @@ export class DuetNumberInput {
|
|
|
490
536
|
},
|
|
491
537
|
"attribute": "accessible-live",
|
|
492
538
|
"reflect": false,
|
|
493
|
-
"defaultValue": "getLocaleString(
|
|
539
|
+
"defaultValue": "getLocaleString(this.accessibleLiveDefaults, this.language)"
|
|
494
540
|
},
|
|
495
541
|
"accessibleLiveEnabled": {
|
|
496
542
|
"type": "boolean",
|
|
@@ -510,6 +556,32 @@ export class DuetNumberInput {
|
|
|
510
556
|
"reflect": false,
|
|
511
557
|
"defaultValue": "true"
|
|
512
558
|
},
|
|
559
|
+
"accessibleAddDefaults": {
|
|
560
|
+
"type": "string",
|
|
561
|
+
"mutable": false,
|
|
562
|
+
"complexType": {
|
|
563
|
+
"original": "DuetLangObject | string",
|
|
564
|
+
"resolved": "DuetLangObject | string",
|
|
565
|
+
"references": {
|
|
566
|
+
"DuetLangObject": {
|
|
567
|
+
"location": "import",
|
|
568
|
+
"path": "../../utils/language-utils"
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
},
|
|
572
|
+
"required": false,
|
|
573
|
+
"optional": false,
|
|
574
|
+
"docs": {
|
|
575
|
+
"tags": [{
|
|
576
|
+
"text": "{fi: \"Lis\u00E4\u00E4 summaan\", en: \"Add to the amount\", sv: \"L\u00E4gg till beloppet\"}",
|
|
577
|
+
"name": "default"
|
|
578
|
+
}],
|
|
579
|
+
"text": "Defaults for accessibleAdd"
|
|
580
|
+
},
|
|
581
|
+
"attribute": "accessible-add-default",
|
|
582
|
+
"reflect": false,
|
|
583
|
+
"defaultValue": "{\n fi: \"Lis\u00E4\u00E4 summaan\",\n en: \"Add to the amount\",\n sv: \"L\u00E4gg till beloppet\",\n }"
|
|
584
|
+
},
|
|
513
585
|
"accessibleAdd": {
|
|
514
586
|
"type": "string",
|
|
515
587
|
"mutable": false,
|
|
@@ -529,7 +601,33 @@ export class DuetNumberInput {
|
|
|
529
601
|
},
|
|
530
602
|
"attribute": "accessible-add",
|
|
531
603
|
"reflect": false,
|
|
532
|
-
"defaultValue": "getLocaleString(
|
|
604
|
+
"defaultValue": "getLocaleString(this.accessibleAddDefaults, this.language)"
|
|
605
|
+
},
|
|
606
|
+
"accessibleSubtractDefaults": {
|
|
607
|
+
"type": "string",
|
|
608
|
+
"mutable": false,
|
|
609
|
+
"complexType": {
|
|
610
|
+
"original": "DuetLangObject | string",
|
|
611
|
+
"resolved": "DuetLangObject | string",
|
|
612
|
+
"references": {
|
|
613
|
+
"DuetLangObject": {
|
|
614
|
+
"location": "import",
|
|
615
|
+
"path": "../../utils/language-utils"
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
},
|
|
619
|
+
"required": false,
|
|
620
|
+
"optional": false,
|
|
621
|
+
"docs": {
|
|
622
|
+
"tags": [{
|
|
623
|
+
"text": "{fi: \"V\u00E4henn\u00E4 summasta\", en: \"Subtract from the amount\", sv: \"Dra fr\u00E5n beloppet\"}",
|
|
624
|
+
"name": "default"
|
|
625
|
+
}],
|
|
626
|
+
"text": "Defaults for accessibleSubtract"
|
|
627
|
+
},
|
|
628
|
+
"attribute": "accessible-subtract-defaults",
|
|
629
|
+
"reflect": false,
|
|
630
|
+
"defaultValue": "{\n fi: \"V\u00E4henn\u00E4 summasta\",\n en: \"Subtract from the amount\",\n sv: \"Dra fr\u00E5n beloppet\",\n }"
|
|
533
631
|
},
|
|
534
632
|
"accessibleSubtract": {
|
|
535
633
|
"type": "string",
|
|
@@ -550,7 +648,7 @@ export class DuetNumberInput {
|
|
|
550
648
|
},
|
|
551
649
|
"attribute": "accessible-subtract",
|
|
552
650
|
"reflect": false,
|
|
553
|
-
"defaultValue": "getLocaleString(
|
|
651
|
+
"defaultValue": "getLocaleString(this.accessibleSubtractDefaults, this.language)"
|
|
554
652
|
},
|
|
555
653
|
"theme": {
|
|
556
654
|
"type": "string",
|
|
@@ -651,6 +749,32 @@ export class DuetNumberInput {
|
|
|
651
749
|
"reflect": false,
|
|
652
750
|
"defaultValue": "0"
|
|
653
751
|
},
|
|
752
|
+
"labelDefaults": {
|
|
753
|
+
"type": "string",
|
|
754
|
+
"mutable": false,
|
|
755
|
+
"complexType": {
|
|
756
|
+
"original": "DuetLangObject | string",
|
|
757
|
+
"resolved": "DuetLangObject | string",
|
|
758
|
+
"references": {
|
|
759
|
+
"DuetLangObject": {
|
|
760
|
+
"location": "import",
|
|
761
|
+
"path": "../../utils/language-utils"
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
},
|
|
765
|
+
"required": false,
|
|
766
|
+
"optional": false,
|
|
767
|
+
"docs": {
|
|
768
|
+
"tags": [{
|
|
769
|
+
"text": "{fi: \"Etiketti\", en: \"Label\", sv: \"M\u00E4rka\"}",
|
|
770
|
+
"name": "default"
|
|
771
|
+
}],
|
|
772
|
+
"text": "Defaults for Label"
|
|
773
|
+
},
|
|
774
|
+
"attribute": "label-default",
|
|
775
|
+
"reflect": false,
|
|
776
|
+
"defaultValue": "{\n fi: \"Nimilappu\",\n en: \"Label\",\n sv: \"Etikett\",\n }"
|
|
777
|
+
},
|
|
654
778
|
"label": {
|
|
655
779
|
"type": "string",
|
|
656
780
|
"mutable": false,
|
|
@@ -670,7 +794,7 @@ export class DuetNumberInput {
|
|
|
670
794
|
},
|
|
671
795
|
"attribute": "label",
|
|
672
796
|
"reflect": false,
|
|
673
|
-
"defaultValue": "getLocaleString(
|
|
797
|
+
"defaultValue": "getLocaleString(this.labelDefaults, this.language)"
|
|
674
798
|
},
|
|
675
799
|
"labelHidden": {
|
|
676
800
|
"type": "boolean",
|
|
@@ -31,14 +31,19 @@ export class DuetTabGroup {
|
|
|
31
31
|
*/
|
|
32
32
|
this.language = getLanguage();
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
34
|
+
* Defaults for Label
|
|
35
35
|
* @default {fi: "Valitse", en: "Choose", sv: "Välja"}
|
|
36
36
|
*/
|
|
37
|
-
this.
|
|
37
|
+
this.labelDefaults = {
|
|
38
38
|
fi: "Valitse",
|
|
39
39
|
en: "Choose",
|
|
40
40
|
sv: "Välj",
|
|
41
|
-
}
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Label for the select element which gets shown on mobile.
|
|
44
|
+
* @default {fi: "Valitse", en: "Choose", sv: "Välja"}
|
|
45
|
+
*/
|
|
46
|
+
this.label = getLocaleString(this.labelDefaults, this.language);
|
|
42
47
|
/**
|
|
43
48
|
* Determines whether the label for the select element shown on mobile is visually hidden.
|
|
44
49
|
*/
|
|
@@ -258,6 +263,32 @@ export class DuetTabGroup {
|
|
|
258
263
|
"reflect": false,
|
|
259
264
|
"defaultValue": "getLanguage()"
|
|
260
265
|
},
|
|
266
|
+
"labelDefaults": {
|
|
267
|
+
"type": "string",
|
|
268
|
+
"mutable": false,
|
|
269
|
+
"complexType": {
|
|
270
|
+
"original": "DuetLangObject | string",
|
|
271
|
+
"resolved": "DuetLangObject | string",
|
|
272
|
+
"references": {
|
|
273
|
+
"DuetLangObject": {
|
|
274
|
+
"location": "import",
|
|
275
|
+
"path": "../../utils/language-utils"
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
"required": false,
|
|
280
|
+
"optional": false,
|
|
281
|
+
"docs": {
|
|
282
|
+
"tags": [{
|
|
283
|
+
"text": "{fi: \"Valitse\", en: \"Choose\", sv: \"V\u00E4lja\"}",
|
|
284
|
+
"name": "default"
|
|
285
|
+
}],
|
|
286
|
+
"text": "Defaults for Label"
|
|
287
|
+
},
|
|
288
|
+
"attribute": "label-default",
|
|
289
|
+
"reflect": false,
|
|
290
|
+
"defaultValue": "{\n fi: \"Valitse\",\n en: \"Choose\",\n sv: \"V\u00E4lj\",\n }"
|
|
291
|
+
},
|
|
261
292
|
"label": {
|
|
262
293
|
"type": "string",
|
|
263
294
|
"mutable": false,
|
|
@@ -277,7 +308,7 @@ export class DuetTabGroup {
|
|
|
277
308
|
},
|
|
278
309
|
"attribute": "label",
|
|
279
310
|
"reflect": false,
|
|
280
|
-
"defaultValue": "getLocaleString(
|
|
311
|
+
"defaultValue": "getLocaleString(this.labelDefaults, this.language)"
|
|
281
312
|
},
|
|
282
313
|
"labelHidden": {
|
|
283
314
|
"type": "boolean",
|
|
@@ -29,25 +29,35 @@ export class DuetTooltip {
|
|
|
29
29
|
*/
|
|
30
30
|
this.language = getLanguage();
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
33
|
-
* readers. This property is always required to create an accessible interface!
|
|
32
|
+
* Default language strings for the accessibleLabel
|
|
34
33
|
* @default {fi: "Näytä lisätietoja", en: "See more information", sv: "Se mer information"}
|
|
35
34
|
*/
|
|
36
|
-
this.
|
|
35
|
+
this.accessibleLabelDefault = {
|
|
37
36
|
fi: "Näytä lisätietoja",
|
|
38
37
|
en: "Show more information",
|
|
39
38
|
sv: "Visa mer tilläggsuppgifter",
|
|
40
|
-
}
|
|
39
|
+
};
|
|
41
40
|
/**
|
|
42
|
-
* Adds accessible label for the
|
|
43
|
-
* readers. This property is always required to create an
|
|
41
|
+
* Adds accessible label for the info icon that is only shown for screen
|
|
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"}
|
|
44
|
+
*/
|
|
45
|
+
this.accessibleLabel = getLocaleString(this.accessibleLabelDefault, this.language);
|
|
46
|
+
/**
|
|
47
|
+
* Default language strings for the accessibleCloseLabel
|
|
44
48
|
* @default {fi: "Sulje lisätiedot", en: "Close details", sv: "Stäng detaljer"}
|
|
45
49
|
*/
|
|
46
|
-
this.
|
|
50
|
+
this.accessibleCloseLabelDefault = {
|
|
47
51
|
fi: "Sulje lisätiedot",
|
|
48
52
|
en: "Close details",
|
|
49
53
|
sv: "Stäng tilläggsuppgifter",
|
|
50
|
-
}
|
|
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);
|
|
51
61
|
/**
|
|
52
62
|
* Label of the tooltip. If used, replaces the accessibleLabel option.
|
|
53
63
|
*/
|
|
@@ -282,6 +292,32 @@ export class DuetTooltip {
|
|
|
282
292
|
"reflect": false,
|
|
283
293
|
"defaultValue": "getLanguage()"
|
|
284
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
|
+
},
|
|
285
321
|
"accessibleLabel": {
|
|
286
322
|
"type": "string",
|
|
287
323
|
"mutable": false,
|
|
@@ -301,7 +337,7 @@ export class DuetTooltip {
|
|
|
301
337
|
},
|
|
302
338
|
"attribute": "accessible-label",
|
|
303
339
|
"reflect": false,
|
|
304
|
-
"defaultValue": "getLocaleString(
|
|
340
|
+
"defaultValue": "getLocaleString(this.accessibleLabelDefault, this.language)"
|
|
305
341
|
},
|
|
306
342
|
"accessibleInputLabel": {
|
|
307
343
|
"type": "string",
|
|
@@ -323,6 +359,32 @@ export class DuetTooltip {
|
|
|
323
359
|
"attribute": "accessible-input-label",
|
|
324
360
|
"reflect": false
|
|
325
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
|
+
},
|
|
326
388
|
"accessibleCloseLabel": {
|
|
327
389
|
"type": "string",
|
|
328
390
|
"mutable": false,
|
|
@@ -342,7 +404,7 @@ export class DuetTooltip {
|
|
|
342
404
|
},
|
|
343
405
|
"attribute": "accessible-close-label",
|
|
344
406
|
"reflect": false,
|
|
345
|
-
"defaultValue": "getLocaleString(
|
|
407
|
+
"defaultValue": "getLocaleString(this.accessibleCloseLabelDefault, this.language)"
|
|
346
408
|
},
|
|
347
409
|
"label": {
|
|
348
410
|
"type": "string",
|
|
@@ -31,25 +31,35 @@ export class DuetTray {
|
|
|
31
31
|
*/
|
|
32
32
|
this.language = getLanguage();
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
35
|
-
* close toggle. Not visible for normal users.
|
|
34
|
+
* Defaults for accessibleCloseLabel
|
|
36
35
|
* @default {fi: "Sulje", en: "Close", sv: "Stänga"}
|
|
37
36
|
*/
|
|
38
|
-
this.
|
|
37
|
+
this.accessibleCloseLabelDefaults = {
|
|
39
38
|
fi: "Sulje",
|
|
40
39
|
en: "Close",
|
|
41
40
|
sv: "Stäng",
|
|
42
|
-
}
|
|
41
|
+
};
|
|
43
42
|
/**
|
|
44
43
|
* Accessible label that is shown for screen reader users in the expandable
|
|
45
|
-
*
|
|
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
|
|
46
50
|
* @default {fi: "Avaa", en: "Open", sv: "Öppen"}
|
|
47
51
|
*/
|
|
48
|
-
this.
|
|
52
|
+
this.accessibleOpenLabelDefaults = {
|
|
49
53
|
fi: "Avaa",
|
|
50
54
|
en: "Open",
|
|
51
55
|
sv: "Öppna",
|
|
52
|
-
}
|
|
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);
|
|
53
63
|
/**
|
|
54
64
|
* Theme of the info panel.
|
|
55
65
|
*/
|
|
@@ -163,6 +173,32 @@ export class DuetTray {
|
|
|
163
173
|
"reflect": false,
|
|
164
174
|
"defaultValue": "getLanguage()"
|
|
165
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
|
+
},
|
|
166
202
|
"accessibleCloseLabel": {
|
|
167
203
|
"type": "string",
|
|
168
204
|
"mutable": false,
|
|
@@ -182,7 +218,33 @@ export class DuetTray {
|
|
|
182
218
|
},
|
|
183
219
|
"attribute": "accessible-close-label",
|
|
184
220
|
"reflect": false,
|
|
185
|
-
"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 }"
|
|
186
248
|
},
|
|
187
249
|
"accessibleOpenLabel": {
|
|
188
250
|
"type": "string",
|
|
@@ -203,7 +265,7 @@ export class DuetTray {
|
|
|
203
265
|
},
|
|
204
266
|
"attribute": "accessible-open-label",
|
|
205
267
|
"reflect": false,
|
|
206
|
-
"defaultValue": "getLocaleString(
|
|
268
|
+
"defaultValue": "getLocaleString(this.accessibleOpenLabelDefaults, this.language)"
|
|
207
269
|
},
|
|
208
270
|
"theme": {
|
|
209
271
|
"type": "string",
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built with Duet Design System
|
|
3
3
|
*/
|
|
4
|
+
require("dotenv").config();
|
|
5
|
+
const port = process.env.KOA_PROXY_PORT ? parseInt(process.env.KOA_PROXY_PORT) : 3334;
|
|
4
6
|
import * as fs from "fs";
|
|
5
7
|
import * as path from "path";
|
|
6
8
|
import { createPage } from "./test-utils";
|
|
@@ -37,7 +39,7 @@ function getAllFixturesFiles(dirPath, fixPath = "fixtures", skipFixture = []) {
|
|
|
37
39
|
/**
|
|
38
40
|
* Generate automatic fixture testing for jest
|
|
39
41
|
*/
|
|
40
|
-
const htmlFragment = (fixtureHtml, theme = "", minHeight = "0px") => {
|
|
42
|
+
const htmlFragment = (fixtureHtml, theme = "", minHeight = "0px", lang = "fi") => {
|
|
41
43
|
let fontFile = "localtapiola";
|
|
42
44
|
let className = "";
|
|
43
45
|
if (theme === "turva") {
|
|
@@ -45,7 +47,7 @@ const htmlFragment = (fixtureHtml, theme = "", minHeight = "0px") => {
|
|
|
45
47
|
className = "duet-theme-turva";
|
|
46
48
|
}
|
|
47
49
|
return `
|
|
48
|
-
<html class="${className}" lang="
|
|
50
|
+
<html class="${className}" lang="${lang}" style="min-height: auto">
|
|
49
51
|
<head>
|
|
50
52
|
<meta charset="utf-8" />
|
|
51
53
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
@@ -70,9 +72,9 @@ const htmlFragment = (fixtureHtml, theme = "", minHeight = "0px") => {
|
|
|
70
72
|
}
|
|
71
73
|
|
|
72
74
|
</style>
|
|
73
|
-
<link rel="stylesheet" href="http://
|
|
74
|
-
<link rel="stylesheet" href="http://
|
|
75
|
-
<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" />
|
|
76
78
|
</head>
|
|
77
79
|
<body style="min-height: ${minHeight} !important; margin: 8px">
|
|
78
80
|
${fixtureHtml}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built with Duet Design System
|
|
3
3
|
*/
|
|
4
|
+
import { convertHtmlQuotes } from "./string-utils";
|
|
4
5
|
const localeLookUpTable = {
|
|
5
6
|
fi: "fi-FI",
|
|
6
7
|
en: "en-GB",
|
|
@@ -15,13 +16,13 @@ const localeMonetarySignifierLookUpTable = {
|
|
|
15
16
|
};
|
|
16
17
|
const defLanguageArray = ["fi", "en", "sv"];
|
|
17
18
|
const defaultLanguage = "fi";
|
|
18
|
-
const
|
|
19
|
-
? document.documentElement.lang.toLowerCase()
|
|
20
|
-
|
|
19
|
+
export const getCurrentLanguage = () => {
|
|
20
|
+
return document.documentElement.lang ? document.documentElement.lang.toLowerCase() : defaultLanguage;
|
|
21
|
+
};
|
|
21
22
|
export const isOfTypeLanguage = (keyInput) => {
|
|
22
23
|
return defLanguageArray.includes(keyInput);
|
|
23
24
|
};
|
|
24
|
-
const checkForLanguage = (languageString =
|
|
25
|
+
const checkForLanguage = (languageString = getCurrentLanguage()) => {
|
|
25
26
|
if (isOfTypeLanguage(languageString)) {
|
|
26
27
|
return languageString;
|
|
27
28
|
}
|
|
@@ -35,7 +36,7 @@ const checkForLanguage = (languageString = currentLanguage) => {
|
|
|
35
36
|
* @param {string} lang=fi - "fi" | "sv" | "en"
|
|
36
37
|
* @default {string} "fi"
|
|
37
38
|
*/
|
|
38
|
-
export const getLanguage = (languageString =
|
|
39
|
+
export const getLanguage = (languageString = getCurrentLanguage()) => checkForLanguage(languageString);
|
|
39
40
|
/**
|
|
40
41
|
* Returns the current language and locale
|
|
41
42
|
* If language is not fi|sv|en it will default to "fi"
|
|
@@ -53,20 +54,33 @@ export const getLocale = (lang) => {
|
|
|
53
54
|
}
|
|
54
55
|
throw new Error(`Locale for "${lang}" not found`);
|
|
55
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
|
+
};
|
|
56
69
|
/**
|
|
57
70
|
* Returns the current string / object from a given translation object
|
|
58
71
|
* If language is not fi|sv|en it will default to "fi"
|
|
59
72
|
* special case where lang can be ALSO be "us" in addition to other types - if user decides to override local language
|
|
60
|
-
* @param {object} langObject - {fi: "finnish", sv: "swedish", en: "english"}
|
|
73
|
+
* @param {object} langObject - {fi: "finnish", sv: "swedish", en: "english"} | string will get JSON.parsed
|
|
61
74
|
* @param {boolean} languageOverride = false - in case you want to override the actual language set in html tag
|
|
62
75
|
* @default {object} {locale: "fi-FI", money: "€"}
|
|
63
76
|
* @returns {(string|Object)} given example contains {fi:"something"} and langua===fi this will return "something"
|
|
64
77
|
*/
|
|
65
78
|
export const getLocaleString = (langObject, languageOverride) => {
|
|
79
|
+
const obj = sanitizeString(langObject);
|
|
66
80
|
if (languageOverride) {
|
|
67
|
-
return
|
|
81
|
+
return obj[checkForLanguage(languageOverride)];
|
|
68
82
|
}
|
|
69
83
|
else {
|
|
70
|
-
return
|
|
84
|
+
return obj[getLanguage()];
|
|
71
85
|
}
|
|
72
86
|
};
|