@duetds/components 5.0.3 → 5.1.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 +491 -16
- package/lib/cjs/duet-action-button.cjs.entry.js +5 -5
- package/lib/cjs/duet-alert.cjs.entry.js +2 -2
- package/lib/cjs/duet-badge.cjs.entry.js +2 -2
- package/lib/cjs/duet-breadcrumb.cjs.entry.js +2 -2
- package/lib/cjs/duet-breadcrumbs.cjs.entry.js +2 -2
- package/lib/cjs/duet-button_2.cjs.entry.js +4 -4
- package/lib/cjs/duet-caption_4.cjs.entry.js +4 -4
- package/lib/cjs/duet-card.cjs.entry.js +5 -5
- package/lib/cjs/duet-checkbox.cjs.entry.js +2 -2
- package/lib/cjs/duet-choice_2.cjs.entry.js +4 -4
- package/lib/cjs/duet-collapsible.cjs.entry.js +4 -4
- package/lib/cjs/duet-combobox.cjs.entry.js +390 -0
- package/lib/cjs/duet-cookie-consent.cjs.entry.js +2 -2
- package/lib/cjs/duet-date-picker.cjs.entry.js +10 -5
- package/lib/cjs/duet-divider_2.cjs.entry.js +2 -2
- package/lib/cjs/duet-editable-table_3.cjs.entry.js +9 -7
- package/lib/cjs/duet-empty-state.cjs.entry.js +2 -2
- package/lib/cjs/duet-fieldset.cjs.entry.js +2 -2
- package/lib/cjs/duet-footer.cjs.entry.js +4 -4
- package/lib/cjs/duet-grid_2.cjs.entry.js +3 -3
- package/lib/cjs/duet-header_2.cjs.entry.js +40 -9
- package/lib/cjs/duet-hero.cjs.entry.js +2 -2
- package/lib/cjs/duet-icon.cjs.entry.js +4 -4
- package/lib/cjs/duet-input_2.cjs.entry.js +42 -4
- package/lib/cjs/duet-layout.cjs.entry.js +1 -1
- package/lib/cjs/duet-list_2.cjs.entry.js +2 -2
- package/lib/cjs/duet-modal.cjs.entry.js +4 -4
- package/lib/cjs/duet-notification_2.cjs.entry.js +2 -2
- package/lib/cjs/duet-number-input.cjs.entry.js +3 -3
- package/lib/cjs/duet-pagination_2.cjs.entry.js +3 -3
- package/lib/cjs/duet-progress.cjs.entry.js +2 -2
- package/lib/cjs/duet-radio_2.cjs.entry.js +2 -2
- package/lib/cjs/duet-range-slider.cjs.entry.js +3 -3
- package/lib/cjs/duet-scrollable_3.cjs.entry.js +3 -3
- package/lib/cjs/duet-select.cjs.entry.js +2 -2
- package/lib/cjs/duet-step_2.cjs.entry.js +3 -3
- package/lib/cjs/duet-textarea.cjs.entry.js +3 -3
- package/lib/cjs/duet-toggle.cjs.entry.js +2 -2
- package/lib/cjs/duet-tooltip.cjs.entry.js +2 -2
- package/lib/cjs/duet-tray.cjs.entry.js +3 -3
- package/lib/cjs/duet-upload-aria-status.cjs.entry.js +1 -1
- package/lib/cjs/duet-visually-hidden.cjs.entry.js +1 -1
- package/lib/cjs/duet.cjs.js +2 -2
- package/lib/cjs/{focus-utils-be11fe84.js → focus-utils-be2df924.js} +1 -1
- package/lib/cjs/{index-4be1f8f7.js → index-608ca44d.js} +1 -1
- package/lib/cjs/{input-utils-f3e3854c.js → input-utils-b5e8f524.js} +1 -1
- package/lib/cjs/{keyboard-utils-898cfe14.js → keyboard-utils-bb32119b.js} +3 -0
- package/lib/cjs/loader.cjs.js +2 -2
- package/lib/cjs/themeable-component-940d3b50.js +15 -0
- package/lib/cjs/{token-utils-ac8432d1.js → token-utils-f402e205.js} +1 -1
- package/lib/cjs/{tokens-72efc7fd.js → tokens-8596cece.js} +0 -0
- package/lib/cjs/{tokens.module-6afcc9c1.js → tokens.module-6b2df1c2.js} +0 -0
- package/lib/collection/collection-manifest.json +1 -0
- package/lib/collection/components/duet-combobox/duet-combobox-select-single.js +12 -0
- package/lib/collection/components/duet-combobox/duet-combobox-select.js +19 -0
- package/lib/collection/components/duet-combobox/duet-combobox.css +78 -0
- package/lib/collection/components/duet-combobox/duet-combobox.js +592 -0
- package/lib/collection/components/duet-date-picker/duet-date-picker.js +24 -2
- package/lib/collection/components/duet-date-picker/utils.js +1 -0
- package/lib/collection/components/duet-footer/duet-footer.js +6 -2
- package/lib/collection/components/duet-header/duet-header.css +15 -0
- package/lib/collection/components/duet-header/duet-header.js +41 -3
- package/lib/collection/components/duet-input/duet-input.js +92 -2
- package/lib/collection/components/duet-upload/duet-upload.css +12 -0
- package/lib/collection/components/duet-upload/duet-upload.js +4 -1
- package/lib/collection/components/duet-upload/upload-editable-item-success.js +1 -1
- package/lib/collection/utils/input-utils.js +1 -1
- package/lib/collection/utils/themeable-component.js +5 -2
- package/lib/custom-elements-bundle/index.d.ts +6 -0
- package/lib/custom-elements-bundle/index.js +487 -28
- package/lib/duet/duet.esm.js +1 -1
- package/lib/duet/duet.js +1 -1
- package/lib/duet/{p-74586a15.system.entry.js → p-026083dd.system.entry.js} +1 -1
- package/lib/duet/{p-cdd335a3.entry.js → p-068a3522.entry.js} +1 -1
- package/lib/duet/{p-7e8d9165.entry.js → p-06b01be8.entry.js} +1 -1
- package/lib/duet/{p-dbc85b3a.entry.js → p-08c949c2.entry.js} +1 -1
- package/lib/duet/{p-1159dab0.system.entry.js → p-0cfe2b11.system.entry.js} +1 -1
- package/lib/duet/{p-71f87732.entry.js → p-143182be.entry.js} +1 -1
- package/lib/duet/p-156538ea.system.entry.js +4 -0
- package/lib/duet/{p-b6d748a9.system.entry.js → p-1dd368a3.system.entry.js} +1 -1
- package/lib/duet/{p-b72b4f9d.entry.js → p-1feabba1.entry.js} +1 -1
- package/lib/duet/{p-79f99668.entry.js → p-206f46ba.entry.js} +1 -1
- package/lib/duet/{p-22ed4dd2.entry.js → p-2287449d.entry.js} +1 -1
- package/lib/duet/{p-0c71c685.system.entry.js → p-23a19b83.system.entry.js} +1 -1
- package/lib/duet/{p-8824199e.system.entry.js → p-2866ccc1.system.entry.js} +1 -1
- package/lib/duet/{p-8f3be2e7.system.entry.js → p-29e73d8c.system.entry.js} +1 -1
- package/lib/duet/{p-33c8d8b9.entry.js → p-2f409514.entry.js} +1 -1
- package/lib/duet/{p-2a0ae7f6.system.entry.js → p-3048d8ef.system.entry.js} +1 -1
- package/lib/duet/{p-04ad8a51.system.js → p-31bc24a2.system.js} +1 -1
- package/lib/duet/{p-5be54927.entry.js → p-383c7df0.entry.js} +1 -1
- package/lib/duet/{p-24a9e68e.system.entry.js → p-388535da.system.entry.js} +1 -1
- package/lib/duet/p-3dfcf826.entry.js +4 -0
- package/lib/duet/{p-19a632b5.system.entry.js → p-41ff8913.system.entry.js} +1 -1
- package/lib/duet/{p-4a0d062b.entry.js → p-48ea1da4.entry.js} +1 -1
- package/lib/duet/{p-e171592e.entry.js → p-4c57fe8a.entry.js} +1 -1
- package/lib/duet/{p-77acbfe4.system.js → p-4e2532c7.system.js} +1 -1
- package/lib/duet/{p-364daea3.entry.js → p-4e4cce23.entry.js} +1 -1
- package/lib/duet/p-546444b0.system.entry.js +4 -0
- package/lib/duet/{p-fb3f8bae.entry.js → p-54724f73.entry.js} +1 -1
- package/lib/duet/p-54f35a79.js +4 -0
- package/lib/duet/p-56118313.js +4 -0
- package/lib/duet/{p-b9a23922.system.entry.js → p-58c20a42.system.entry.js} +1 -1
- package/lib/duet/{p-f40ab568.entry.js → p-60e2436b.entry.js} +1 -1
- package/lib/duet/{p-3e4f8f38.entry.js → p-63ac8866.entry.js} +1 -1
- package/lib/duet/{p-d8d93e29.system.js → p-64ebe689.system.js} +1 -1
- package/lib/duet/{p-3ab1a68a.entry.js → p-65a79da5.entry.js} +1 -1
- package/lib/duet/{p-8493e747.system.entry.js → p-69c0a7f6.system.entry.js} +1 -1
- package/lib/duet/p-6b03322b.system.js +4 -0
- package/lib/duet/{p-302a1111.system.entry.js → p-6b1abf52.system.entry.js} +1 -1
- package/lib/duet/{p-9bc80a7f.js → p-6b6176f4.js} +1 -1
- package/lib/duet/{p-480d4dcf.system.entry.js → p-6ba20e72.system.entry.js} +2 -2
- package/lib/duet/{p-0047c4f5.system.entry.js → p-6f4863db.system.entry.js} +1 -1
- package/lib/duet/{p-4c3d3d98.system.entry.js → p-6f603653.system.entry.js} +1 -1
- package/lib/duet/{p-5bb0d504.system.entry.js → p-7339eb94.system.entry.js} +1 -1
- package/lib/duet/{p-5208e8c8.entry.js → p-74728a74.entry.js} +1 -1
- package/lib/duet/{p-70090114.entry.js → p-7666b058.entry.js} +1 -1
- package/lib/duet/{p-cda9e6ea.entry.js → p-7729af53.entry.js} +1 -1
- package/lib/duet/p-7754c44f.entry.js +4 -0
- package/lib/duet/{p-c44470ff.entry.js → p-7a906647.entry.js} +1 -1
- package/lib/duet/{p-8c873050.system.entry.js → p-7aa17a19.system.entry.js} +1 -1
- package/lib/duet/{p-48c23e5c.entry.js → p-7f857142.entry.js} +1 -1
- package/lib/duet/{p-d7bc0102.js → p-8143f3de.js} +0 -0
- package/lib/duet/{p-49b566b8.entry.js → p-81c4e0b8.entry.js} +1 -1
- package/lib/duet/{p-7fe35615.system.entry.js → p-84afb642.system.entry.js} +1 -1
- package/lib/duet/{p-2724a54c.entry.js → p-85fe86ef.entry.js} +1 -1
- package/lib/duet/{p-839ea534.entry.js → p-887d51ae.entry.js} +1 -1
- package/lib/duet/{p-3cfbe168.entry.js → p-8cc38bb7.entry.js} +1 -1
- package/lib/duet/{p-a008aacc.entry.js → p-8f2b3690.entry.js} +1 -1
- package/lib/duet/p-93c1b85e.system.entry.js +4 -0
- package/lib/duet/{p-0e962ab1.system.entry.js → p-9592fa1f.system.entry.js} +1 -1
- package/lib/duet/{p-f65e0de6.system.entry.js → p-99dc86ab.system.entry.js} +1 -1
- package/lib/duet/{p-afe9e9f0.system.entry.js → p-9a47fd17.system.entry.js} +1 -1
- package/lib/duet/{p-8e7c504a.entry.js → p-9b0489b4.entry.js} +1 -1
- package/lib/duet/{p-a3506401.system.entry.js → p-9b282421.system.entry.js} +2 -2
- package/lib/duet/{p-36af1d4b.system.entry.js → p-9e06a7c7.system.entry.js} +1 -1
- package/lib/duet/p-a63f753e.system.js +4 -0
- package/lib/duet/{p-419e1df7.entry.js → p-a682a6a5.entry.js} +1 -1
- package/lib/duet/{p-25b156ea.entry.js → p-aa9d165e.entry.js} +1 -1
- package/lib/duet/{p-693cec9c.system.entry.js → p-ab3a0d39.system.entry.js} +1 -1
- package/lib/duet/p-ab8e590d.system.js +4 -0
- package/lib/duet/p-abf8eaf7.js +4 -0
- package/lib/duet/{p-ed75c8b3.js → p-ad07f399.js} +0 -0
- package/lib/duet/{p-14aba051.entry.js → p-b77d4386.entry.js} +1 -1
- package/lib/duet/{p-515fe415.system.entry.js → p-b7a86acf.system.entry.js} +1 -1
- package/lib/duet/p-badc3ac3.entry.js +4 -0
- package/lib/duet/{p-995288c0.entry.js → p-bc84c679.entry.js} +1 -1
- package/lib/duet/{p-1aa9b60c.system.entry.js → p-bdc61811.system.entry.js} +1 -1
- package/lib/duet/{p-38cc1d02.system.entry.js → p-c3019850.system.entry.js} +1 -1
- package/lib/duet/{p-9a8d5b11.system.js → p-c466bad9.system.js} +1 -1
- package/lib/duet/{p-68b50c43.entry.js → p-c5429708.entry.js} +1 -1
- package/lib/duet/{p-140cf44e.entry.js → p-ca55e1f8.entry.js} +1 -1
- package/lib/duet/{p-5746d88c.js → p-cb445018.js} +1 -1
- package/lib/duet/{p-f0dba299.system.entry.js → p-cd2e4ea8.system.entry.js} +1 -1
- package/lib/duet/{p-799f35c8.system.entry.js → p-d4734090.system.entry.js} +1 -1
- package/lib/duet/{p-d5a75400.system.entry.js → p-d8ebb48c.system.entry.js} +1 -1
- package/lib/duet/{p-29c093f0.entry.js → p-dca9237d.entry.js} +1 -1
- package/lib/duet/{p-268c0abb.system.js → p-ddb6344c.system.js} +0 -0
- package/lib/duet/p-df6b0878.system.entry.js +4 -0
- package/lib/duet/{p-7afb2bcf.system.entry.js → p-e4f8e874.system.entry.js} +1 -1
- package/lib/duet/{p-76f3205a.system.entry.js → p-e50c8c08.system.entry.js} +1 -1
- package/lib/duet/{p-b6339b38.system.entry.js → p-e5f9c7b8.system.entry.js} +1 -1
- package/lib/duet/{p-dca6993f.system.entry.js → p-e8a5580c.system.entry.js} +1 -1
- package/lib/duet/{p-d1549bd1.entry.js → p-e8da9596.entry.js} +1 -1
- package/lib/duet/{p-8594bc4d.entry.js → p-ea131807.entry.js} +1 -1
- package/lib/duet/{p-2be3b1ee.entry.js → p-ec340319.entry.js} +1 -1
- package/lib/duet/{p-2345965b.system.entry.js → p-ed1ea287.system.entry.js} +1 -1
- package/lib/duet/p-f37a0b50.entry.js +4 -0
- package/lib/duet/{p-bfc93e93.system.entry.js → p-f3ed1115.system.entry.js} +1 -1
- package/lib/duet/p-f42b06ec.entry.js +4 -0
- package/lib/duet/{p-343975bc.js → p-f5ced40a.js} +1 -1
- package/lib/duet/{p-83aaed17.system.entry.js → p-f7e5404c.system.entry.js} +1 -1
- package/lib/duet/{p-636dfb04.system.entry.js → p-f9ddfbd3.system.entry.js} +1 -1
- package/lib/duet/{p-812b0905.system.js → p-fa99eaa4.system.js} +0 -0
- package/lib/esm/duet-action-button.entry.js +5 -5
- package/lib/esm/duet-alert.entry.js +2 -2
- package/lib/esm/duet-badge.entry.js +2 -2
- package/lib/esm/duet-breadcrumb.entry.js +2 -2
- package/lib/esm/duet-breadcrumbs.entry.js +2 -2
- package/lib/esm/duet-button_2.entry.js +4 -4
- package/lib/esm/duet-caption_4.entry.js +4 -4
- package/lib/esm/duet-card.entry.js +5 -5
- package/lib/esm/duet-checkbox.entry.js +2 -2
- package/lib/esm/duet-choice_2.entry.js +4 -4
- package/lib/esm/duet-collapsible.entry.js +4 -4
- package/lib/esm/duet-combobox.entry.js +386 -0
- package/lib/esm/duet-cookie-consent.entry.js +2 -2
- package/lib/esm/duet-date-picker.entry.js +10 -5
- package/lib/esm/duet-divider_2.entry.js +2 -2
- package/lib/esm/duet-editable-table_3.entry.js +9 -7
- package/lib/esm/duet-empty-state.entry.js +2 -2
- package/lib/esm/duet-fieldset.entry.js +2 -2
- package/lib/esm/duet-footer.entry.js +4 -4
- package/lib/esm/duet-grid_2.entry.js +3 -3
- package/lib/esm/duet-header_2.entry.js +40 -9
- package/lib/esm/duet-hero.entry.js +2 -2
- package/lib/esm/duet-icon.entry.js +4 -4
- package/lib/esm/duet-input_2.entry.js +42 -4
- package/lib/esm/duet-layout.entry.js +1 -1
- package/lib/esm/duet-list_2.entry.js +2 -2
- package/lib/esm/duet-modal.entry.js +4 -4
- package/lib/esm/duet-notification_2.entry.js +2 -2
- package/lib/esm/duet-number-input.entry.js +3 -3
- package/lib/esm/duet-pagination_2.entry.js +3 -3
- package/lib/esm/duet-progress.entry.js +2 -2
- package/lib/esm/duet-radio_2.entry.js +2 -2
- package/lib/esm/duet-range-slider.entry.js +3 -3
- package/lib/esm/duet-scrollable_3.entry.js +3 -3
- package/lib/esm/duet-select.entry.js +2 -2
- package/lib/esm/duet-step_2.entry.js +3 -3
- package/lib/esm/duet-textarea.entry.js +3 -3
- package/lib/esm/duet-toggle.entry.js +2 -2
- package/lib/esm/duet-tooltip.entry.js +2 -2
- package/lib/esm/duet-tray.entry.js +3 -3
- package/lib/esm/duet-upload-aria-status.entry.js +1 -1
- package/lib/esm/duet-visually-hidden.entry.js +1 -1
- package/lib/esm/duet.js +2 -2
- package/lib/esm/{focus-utils-e649bb9d.js → focus-utils-b6b1e60d.js} +1 -1
- package/lib/esm/{index-fe6fd837.js → index-0b088451.js} +1 -1
- package/lib/esm/{input-utils-f4cafee1.js → input-utils-de45e099.js} +1 -1
- package/lib/esm/{keyboard-utils-6eb55cd5.js → keyboard-utils-88ea1007.js} +2 -1
- package/lib/esm/loader.js +2 -2
- package/lib/esm/themeable-component-e8fc98bf.js +13 -0
- package/lib/esm/{token-utils-e9a0cb88.js → token-utils-e9a69acf.js} +1 -1
- package/lib/esm/{tokens-57d98824.js → tokens-e110dc89.js} +0 -0
- package/lib/esm/{tokens.module-a13e9683.js → tokens.module-49cbf963.js} +0 -0
- package/lib/esm-es5/duet-action-button.entry.js +1 -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-breadcrumb.entry.js +1 -1
- package/lib/esm-es5/duet-breadcrumbs.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-combobox.entry.js +4 -0
- 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-editable-table_3.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 +2 -2
- 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 +1 -1
- package/lib/esm-es5/duet-pagination_2.entry.js +1 -1
- package/lib/esm-es5/duet-progress.entry.js +1 -1
- 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-scrollable_3.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-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-upload-aria-status.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-b6b1e60d.js +4 -0
- package/lib/esm-es5/{index-fe6fd837.js → index-0b088451.js} +1 -1
- package/lib/esm-es5/input-utils-de45e099.js +4 -0
- package/lib/esm-es5/keyboard-utils-88ea1007.js +4 -0
- package/lib/esm-es5/loader.js +1 -1
- package/lib/esm-es5/themeable-component-e8fc98bf.js +4 -0
- package/lib/esm-es5/{token-utils-e9a0cb88.js → token-utils-e9a69acf.js} +1 -1
- package/lib/esm-es5/{tokens-57d98824.js → tokens-e110dc89.js} +0 -0
- package/lib/esm-es5/{tokens.module-a13e9683.js → tokens.module-49cbf963.js} +0 -0
- package/lib/html.html-data.json +56 -1
- package/lib/types/components/duet-combobox/duet-combobox-select-single.d.ts +8 -0
- package/lib/types/components/duet-combobox/duet-combobox-select.d.ts +14 -0
- package/lib/types/components/duet-combobox/duet-combobox.d.ts +131 -0
- package/lib/types/components/duet-date-picker/duet-date-picker.d.ts +4 -0
- package/lib/types/components/duet-footer/duet-footer.d.ts +4 -0
- package/lib/types/components/duet-header/duet-header.d.ts +8 -0
- package/lib/types/components/duet-input/duet-input.d.ts +17 -0
- package/lib/types/components.d.ts +115 -0
- package/package.json +7 -7
- package/lib/cjs/themeable-component-0c1be552.js +0 -12
- package/lib/duet/p-251ee915.system.entry.js +0 -4
- package/lib/duet/p-2759fa82.system.entry.js +0 -4
- package/lib/duet/p-2fd6f95a.system.js +0 -4
- package/lib/duet/p-35a8dcc6.entry.js +0 -4
- package/lib/duet/p-7385e892.entry.js +0 -4
- package/lib/duet/p-74780bca.system.js +0 -4
- package/lib/duet/p-898f30a5.js +0 -4
- package/lib/duet/p-9ad2878e.system.entry.js +0 -4
- package/lib/duet/p-9dfcd29a.js +0 -4
- package/lib/duet/p-a28cf57b.js +0 -4
- package/lib/duet/p-d1a4aa9c.entry.js +0 -4
- package/lib/duet/p-dc9de1e3.entry.js +0 -4
- package/lib/duet/p-efaa0c04.system.js +0 -4
- package/lib/esm/themeable-component-572685dd.js +0 -10
- package/lib/esm-es5/focus-utils-e649bb9d.js +0 -4
- package/lib/esm-es5/input-utils-f4cafee1.js +0 -4
- package/lib/esm-es5/keyboard-utils-6eb55cd5.js +0 -4
- package/lib/esm-es5/themeable-component-572685dd.js +0 -4
|
@@ -0,0 +1,592 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built with Duet Design System
|
|
3
|
+
*/
|
|
4
|
+
import { Build, Component, Element, Event, h, Host, Listen, Method, Prop, State, Watch, } from "@stencil/core";
|
|
5
|
+
import { debounce } from "../../utils/js-utils";
|
|
6
|
+
import { isArrowDownKey, isArrowUpKey, isEnterKey, isEscapeKey, isTabKey } from "../../utils/keyboard-utils";
|
|
7
|
+
import { getLanguage, getLocaleString } from "../../utils/language-utils";
|
|
8
|
+
import { parsePossibleJSON } from "../../utils/string-utils";
|
|
9
|
+
import { inheritGlobalTheme } from "../../utils/themeable-component";
|
|
10
|
+
import { DuetComboBoxSelect } from "./duet-combobox-select";
|
|
11
|
+
export class DuetCombobox {
|
|
12
|
+
constructor() {
|
|
13
|
+
// Safari doesnt properly support aria-activedecendatn, the code associated with this bool is a workaround for that,
|
|
14
|
+
// this should be removed when Safari fixes the issue
|
|
15
|
+
// see: https://a11ysupport.io/tests/apg__aria-1-2-combobox-with-list-autocomplete-example#assertion-aria-aria-activedescendant_attribute-convey_value-aria-combobox_role-vo_macos-safari
|
|
16
|
+
this.isSafari = false;
|
|
17
|
+
this.resizeObserver = new ResizeObserver(debounce(entries => {
|
|
18
|
+
var _a, _b;
|
|
19
|
+
// otherwise, something is wrong, expecting 1 element only
|
|
20
|
+
if ((entries === null || entries === void 0 ? void 0 : entries.length) === 1) {
|
|
21
|
+
const currentWidth = (_b = (_a = entries[0]) === null || _a === void 0 ? void 0 : _a.target) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect().width;
|
|
22
|
+
this.listContainer.style.width = `${currentWidth + 1}px`;
|
|
23
|
+
// this.listElement.style.width = `${currentWidth + 1}px`
|
|
24
|
+
}
|
|
25
|
+
}, 100));
|
|
26
|
+
this.processedItems = null;
|
|
27
|
+
this.inputWidth = 0;
|
|
28
|
+
this.inputValue = "";
|
|
29
|
+
this.selectionMsg = "";
|
|
30
|
+
this.listOpen = false;
|
|
31
|
+
// the selected item is based upon the DuetComboboxItem.id value
|
|
32
|
+
this.selectedItems = new Set();
|
|
33
|
+
// the activeItem number is based upon the array.index of the array stored in processedItems
|
|
34
|
+
this.activeItem = undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Placeholder defaults
|
|
37
|
+
* @default { fi: "pp.kk.vvvv", en: "dd.mm.yyyy", sv: "dd.mm.åååå" }
|
|
38
|
+
*/
|
|
39
|
+
this.accessibleLabelDefaults = {
|
|
40
|
+
en: {
|
|
41
|
+
heading: "Select:",
|
|
42
|
+
item: "{name}, ({current} of {total})",
|
|
43
|
+
itemFiltered: "{name}, ({current} of {total}, {hiddenItems} filtered)",
|
|
44
|
+
},
|
|
45
|
+
fi: {
|
|
46
|
+
heading: "Valitse:",
|
|
47
|
+
item: "{name}, ({current}/{total})",
|
|
48
|
+
itemFiltered: "{name}, ({current}/{total}, {hiddenItems} suodatettu)",
|
|
49
|
+
},
|
|
50
|
+
sv: {
|
|
51
|
+
heading: "Välj:",
|
|
52
|
+
item: "{name}, ({current} av {total})",
|
|
53
|
+
itemFiltered: "{name}, ({current} av {total}, {hiddenItems} filtrerade)",
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Hint text to display before the user types into the date picker input.
|
|
58
|
+
* @default {
|
|
59
|
+
* heading: "Valitse:",
|
|
60
|
+
* item: "{0}, ({1}/{2})",
|
|
61
|
+
* itemFiltered: "{0}, ({1}/{2} - {3} suodatettu"
|
|
62
|
+
* }
|
|
63
|
+
*/
|
|
64
|
+
this.accessibleLabels = getLocaleString(parsePossibleJSON(this.accessibleLabelDefaults), getLanguage());
|
|
65
|
+
/**
|
|
66
|
+
* Theme of the combobox.
|
|
67
|
+
*/
|
|
68
|
+
this.theme = "";
|
|
69
|
+
/**
|
|
70
|
+
* Force the user to make a selection (typing things in the input field will only be used for list search)
|
|
71
|
+
*/
|
|
72
|
+
this.force = false;
|
|
73
|
+
/**
|
|
74
|
+
* A hook to overwrite how the values are displayed in the input field after a User select an item
|
|
75
|
+
* @example (item) => `${item.name} (${item.value})`
|
|
76
|
+
* @default undefined
|
|
77
|
+
*/
|
|
78
|
+
this.formatter = (item) => item && item.name ? item.name : "";
|
|
79
|
+
}
|
|
80
|
+
activeItemHandler(state) {
|
|
81
|
+
this.input.accessibleActiveDescendant = this.listOpen && (state || state === 0) ? `active_item` : "";
|
|
82
|
+
}
|
|
83
|
+
handleDocumentClick(e) {
|
|
84
|
+
//we want to remove all user text if they have NOT selected from the dropdown
|
|
85
|
+
const path = e.composedPath();
|
|
86
|
+
const isClickOutside = path.every(el => el !== this.element);
|
|
87
|
+
if (isClickOutside) {
|
|
88
|
+
this.updateInputText(true);
|
|
89
|
+
this.listOpen = false;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Exposes a formatter function to format the item value displayed after a user selects an item
|
|
94
|
+
* @param item: DuetComboboxItem
|
|
95
|
+
*/
|
|
96
|
+
async formatItem(item) {
|
|
97
|
+
return this.formatter(item);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Component lifecycle events.
|
|
101
|
+
*/
|
|
102
|
+
componentWillLoad() {
|
|
103
|
+
inheritGlobalTheme(this);
|
|
104
|
+
}
|
|
105
|
+
connectedCallback() {
|
|
106
|
+
if (Build.isServer) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
if (/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
|
|
110
|
+
this.isSafari = true;
|
|
111
|
+
}
|
|
112
|
+
this.items = this.processedItems = parsePossibleJSON(this.items);
|
|
113
|
+
this.input = this.element.querySelector("duet-input");
|
|
114
|
+
this.input.addEventListener("duetChange", this.updateInputValue.bind(this));
|
|
115
|
+
this.input.addEventListener("click", () => {
|
|
116
|
+
this.inputValue.length ? (this.listOpen = true) : (this.listOpen = false);
|
|
117
|
+
});
|
|
118
|
+
this.element.addEventListener("keydown", this.handleInputKeyDownEvent.bind(this));
|
|
119
|
+
//add correct aria attributes to the input element
|
|
120
|
+
this.input.accessibleAutocomplete = "list";
|
|
121
|
+
this.input.accessibleControls = "duet-combobox-list-element";
|
|
122
|
+
}
|
|
123
|
+
disconnectedCallback() {
|
|
124
|
+
if (Build.isServer) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
this.input.removeEventListener("duetChange", this.updateInputValue.bind(this));
|
|
128
|
+
this.input.removeEventListener("click", () => this.inputValue.length ? (this.listOpen = true) : (this.listOpen = false));
|
|
129
|
+
this.element.removeEventListener("keydown", this.handleInputKeyDownEvent.bind(this));
|
|
130
|
+
this.listElement.removeEventListener("click", e => {
|
|
131
|
+
e.stopPropagation();
|
|
132
|
+
});
|
|
133
|
+
this.resizeObserver.disconnect();
|
|
134
|
+
}
|
|
135
|
+
componentDidLoad() {
|
|
136
|
+
// observe resize events to dynamically adjust size of dropdown area
|
|
137
|
+
this.resizeObserver.observe(this.input);
|
|
138
|
+
this.listElement.addEventListener("click", e => {
|
|
139
|
+
e.stopPropagation();
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Updates the input text based on the selected/clicked items.
|
|
144
|
+
* @param event - event
|
|
145
|
+
*'param item: DuetComboboxItem - the item that was selected
|
|
146
|
+
*/
|
|
147
|
+
onListClick(e, item) {
|
|
148
|
+
e.preventDefault();
|
|
149
|
+
// update selected item with id
|
|
150
|
+
this.updateSelectedItems(item.id);
|
|
151
|
+
this.listOpen = false;
|
|
152
|
+
return this.listOpen;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Helper function that checks inputs in the field, compares it with the item list and returns true when inputvalue matches selectedItem id
|
|
156
|
+
* TODO: this should be disabled in multiple mode
|
|
157
|
+
*/
|
|
158
|
+
shouldListBeFiltered() {
|
|
159
|
+
if (this.selectedItems.size && this.input.value === this.inputValue) {
|
|
160
|
+
const item = this.items.filter(item => this.selectedItems.has(item.id));
|
|
161
|
+
return !(this.formatter(item).toLowerCase() === this.input.value.toLowerCase());
|
|
162
|
+
}
|
|
163
|
+
return true;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Helper function that return correct collection depending on filter status returend by shouldListBeFiltered
|
|
167
|
+
*/
|
|
168
|
+
returnFilteredOrNonFiltered() {
|
|
169
|
+
return this.processedItems
|
|
170
|
+
? this.shouldListBeFiltered()
|
|
171
|
+
? this.getFilteredItems()
|
|
172
|
+
: this.sortFilteredItems(this.processedItems)
|
|
173
|
+
: [];
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Updates the selected items based on the item id.
|
|
177
|
+
* @param id
|
|
178
|
+
* @private
|
|
179
|
+
*/
|
|
180
|
+
async updateSelectedItems(id) {
|
|
181
|
+
// for a multiple scenario wrap this in an if/else and just don't clear here
|
|
182
|
+
this.selectedItems.clear();
|
|
183
|
+
if (this.selectedItems) {
|
|
184
|
+
if (this.selectedItems.has(id)) {
|
|
185
|
+
this.selectedItems.delete(id);
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
this.selectedItems.add(id);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
await this.updateInputText();
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Updates the input text based on the selected/clicked items.
|
|
195
|
+
* @param bool -override to clear if invoked by "click outside"
|
|
196
|
+
*/
|
|
197
|
+
async updateInputText(isBlurred = false) {
|
|
198
|
+
const item = this.selectedItems.size === 0 ? [] : this.items.filter(item => this.selectedItems.has(item.id));
|
|
199
|
+
if (this.selectedItems.size === 1) {
|
|
200
|
+
this.input.value = ""; // set value to empty so that cursor position follows accordingly
|
|
201
|
+
this.input.value = await this.formatItem(item[0]);
|
|
202
|
+
this.input.scrollLeft = this.input.scrollWidth;
|
|
203
|
+
this.activeItem = undefined;
|
|
204
|
+
this.value = await this.formatItem(item[0]);
|
|
205
|
+
this.duetChange.emit({
|
|
206
|
+
value: item[0].value,
|
|
207
|
+
item: item[0],
|
|
208
|
+
component: "duet-combobox",
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
else if (isBlurred && this.selectedItems.size === 0) {
|
|
212
|
+
//if nothing is selected and a user clicks outside, we want the input field to clearly illustrate that nothing was selected
|
|
213
|
+
if (this.force) {
|
|
214
|
+
this.inputValue = "";
|
|
215
|
+
this.input.value = "";
|
|
216
|
+
}
|
|
217
|
+
this.activeItem = undefined;
|
|
218
|
+
}
|
|
219
|
+
this.listOpen = false;
|
|
220
|
+
}
|
|
221
|
+
updateInputValue(e) {
|
|
222
|
+
var _a;
|
|
223
|
+
this.inputValue = e.detail.value;
|
|
224
|
+
this.listOpen = String(this.inputValue).length > 0 && ((_a = this.getFilteredItems()) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
225
|
+
}
|
|
226
|
+
handleInputKeyDownEvent(e) {
|
|
227
|
+
//if selection is made, close the list and update internal and external values
|
|
228
|
+
// this should be set to undefined on everything BUT up/down arrow according to the aria 1.1 specs
|
|
229
|
+
// https://www.w3.org/TR/wai-aria-practices-1.1/#combobox
|
|
230
|
+
this.input.accessibleActiveDescendant = undefined;
|
|
231
|
+
if (isEnterKey(e)) {
|
|
232
|
+
e.preventDefault();
|
|
233
|
+
this.selectActiveItem();
|
|
234
|
+
this.listOpen = false;
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
//tabbing out or escaping, restore initial state
|
|
238
|
+
if (isEscapeKey(e) || isTabKey(e)) {
|
|
239
|
+
this.updateInputText(true);
|
|
240
|
+
this.listOpen = false;
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
//handle arrow up/down navigation
|
|
244
|
+
let nextActiveItem = this.activeItem;
|
|
245
|
+
if (isArrowUpKey(e)) {
|
|
246
|
+
e.preventDefault();
|
|
247
|
+
nextActiveItem = this.activeItem - 1;
|
|
248
|
+
}
|
|
249
|
+
else if (isArrowDownKey(e)) {
|
|
250
|
+
e.preventDefault();
|
|
251
|
+
nextActiveItem = this.listOpen ? this.activeItem + 1 : this.activeItem;
|
|
252
|
+
this.listOpen = true;
|
|
253
|
+
}
|
|
254
|
+
if (isArrowDownKey(e) || isArrowUpKey(e)) {
|
|
255
|
+
const listItems = this.shouldListBeFiltered() ? this.getFilteredItems() : this.processedItems;
|
|
256
|
+
if (nextActiveItem < 0 || !nextActiveItem) {
|
|
257
|
+
nextActiveItem = 0;
|
|
258
|
+
}
|
|
259
|
+
if (nextActiveItem >= listItems.length) {
|
|
260
|
+
nextActiveItem = listItems.length - 1;
|
|
261
|
+
}
|
|
262
|
+
// this should be set to undefined on everything BUT up/down arrow according to the aria 1.1 specs
|
|
263
|
+
// https://www.w3.org/TR/wai-aria-practices-1.1/#combobox
|
|
264
|
+
this.input.accessibleActiveDescendant = "active_item";
|
|
265
|
+
this.activeItem = nextActiveItem;
|
|
266
|
+
this.scrollToActive();
|
|
267
|
+
}
|
|
268
|
+
this.announceActive();
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
selectActiveItem() {
|
|
272
|
+
if (this.activeItem === undefined) {
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
const filteredItem = this.returnFilteredOrNonFiltered();
|
|
276
|
+
const item = filteredItem[this.activeItem];
|
|
277
|
+
this.updateSelectedItems(item.id);
|
|
278
|
+
}
|
|
279
|
+
announceActive(items) {
|
|
280
|
+
if (!items) {
|
|
281
|
+
items = this.returnFilteredOrNonFiltered();
|
|
282
|
+
}
|
|
283
|
+
if (this.activeItem === undefined || this.activeItem === -1) {
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
const item = items[this.activeItem];
|
|
287
|
+
this.selectionMsg = this.formatLabel(item, items.length, this.items.length);
|
|
288
|
+
}
|
|
289
|
+
//function that scrolls to the li element with the class "active"
|
|
290
|
+
scrollToActive() {
|
|
291
|
+
const activeElement = this.listElement.querySelector(".active");
|
|
292
|
+
if (activeElement) {
|
|
293
|
+
activeElement.scrollIntoView({
|
|
294
|
+
behavior: "smooth",
|
|
295
|
+
block: "center",
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
formatLabel(item, length, itemsLength) {
|
|
300
|
+
if (!item || itemsLength === undefined) {
|
|
301
|
+
return "";
|
|
302
|
+
}
|
|
303
|
+
const labelString = length === itemsLength ? this.accessibleLabels.item : this.accessibleLabels.itemFiltered;
|
|
304
|
+
return labelString
|
|
305
|
+
.replace("{name}", String(item.name))
|
|
306
|
+
.replace("{current}", String(this.activeItem + 1))
|
|
307
|
+
.replace("{total}", String(length))
|
|
308
|
+
.replace("{hiddenItems}", String(itemsLength - length));
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Filter the items based on the input value
|
|
312
|
+
*/
|
|
313
|
+
getFilteredItems() {
|
|
314
|
+
// filter items based on user inputs
|
|
315
|
+
const filteredItems = this.processedItems.filter(item =>
|
|
316
|
+
// filter by name and value
|
|
317
|
+
// if value contains inputvalue
|
|
318
|
+
String(item.value).toLowerCase().includes(this.inputValue.toLowerCase()) ||
|
|
319
|
+
// if name contains input value
|
|
320
|
+
String(item.name).toLowerCase().includes(this.inputValue.toLowerCase()) ||
|
|
321
|
+
// if the item is selected
|
|
322
|
+
this.selectedItems.has(item.id));
|
|
323
|
+
return this.sortFilteredItems(filteredItems);
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Sort the return from getFilteredItems so that any item with and item.id that matches this.selectedItems is placed first
|
|
327
|
+
*/
|
|
328
|
+
sortFilteredItems(items) {
|
|
329
|
+
if (items.length > 0) {
|
|
330
|
+
items
|
|
331
|
+
.filter(item => this.selectedItems.has(item.id))
|
|
332
|
+
.forEach(item => {
|
|
333
|
+
const index = items.indexOf(item);
|
|
334
|
+
items.splice(index, 1);
|
|
335
|
+
items.unshift(item);
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
return items;
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* render() function
|
|
342
|
+
* Always the last one in the class.
|
|
343
|
+
*/
|
|
344
|
+
render() {
|
|
345
|
+
const selectElements = this.returnFilteredOrNonFiltered();
|
|
346
|
+
return (h(Host, { role: "combobox", "aria-expanded": this.listOpen ? "true" : "false", "aria-owns": this.listOpen ? "duet-combobox-list-element" : undefined, "aria-haspopup": "listbox", class: {
|
|
347
|
+
"duet-combobox": true,
|
|
348
|
+
[`duet-theme-${this.theme}`]: true,
|
|
349
|
+
} },
|
|
350
|
+
h("slot", null),
|
|
351
|
+
this.isSafari && (h("duet-visually-hidden", { "aria-live": "assertive", "aria-atomic": "true", "aria-relevant": "all" }, this.selectionMsg)),
|
|
352
|
+
h("div", { role: "list", class: {
|
|
353
|
+
"duet-combobox-list": true,
|
|
354
|
+
open: this.listOpen,
|
|
355
|
+
}, ref: el => (this.listContainer = el) },
|
|
356
|
+
h("ul", { role: "listbox", ref: el => (this.listElement = el), id: "duet-combobox-list-element", class: "listbox" }, this.processedItems &&
|
|
357
|
+
selectElements.map((item, index) => {
|
|
358
|
+
return (h(DuetComboBoxSelect, { item: item, active: index === this.activeItem, selected: this.selectedItems.has(item.id), search: this.inputValue, total: selectElements.length, clickHandler: e => this.onListClick(e, item), label: this.formatLabel(item, this.returnFilteredOrNonFiltered().length, this.items.length) }));
|
|
359
|
+
})))));
|
|
360
|
+
}
|
|
361
|
+
static get is() { return "duet-combobox"; }
|
|
362
|
+
static get encapsulation() { return "scoped"; }
|
|
363
|
+
static get originalStyleUrls() { return {
|
|
364
|
+
"$": ["duet-combobox.scss"]
|
|
365
|
+
}; }
|
|
366
|
+
static get styleUrls() { return {
|
|
367
|
+
"$": ["duet-combobox.css"]
|
|
368
|
+
}; }
|
|
369
|
+
static get properties() { return {
|
|
370
|
+
"accessibleLabelDefaults": {
|
|
371
|
+
"type": "string",
|
|
372
|
+
"mutable": false,
|
|
373
|
+
"complexType": {
|
|
374
|
+
"original": "DuetLangObject | string",
|
|
375
|
+
"resolved": "DuetLangObject | string",
|
|
376
|
+
"references": {
|
|
377
|
+
"DuetLangObject": {
|
|
378
|
+
"location": "import",
|
|
379
|
+
"path": "../../utils/language-utils"
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
},
|
|
383
|
+
"required": false,
|
|
384
|
+
"optional": false,
|
|
385
|
+
"docs": {
|
|
386
|
+
"tags": [{
|
|
387
|
+
"name": "default",
|
|
388
|
+
"text": "{ fi: \"pp.kk.vvvv\", en: \"dd.mm.yyyy\", sv: \"dd.mm.\u00E5\u00E5\u00E5\u00E5\" }"
|
|
389
|
+
}],
|
|
390
|
+
"text": "Placeholder defaults"
|
|
391
|
+
},
|
|
392
|
+
"attribute": "accessible-label-defaults",
|
|
393
|
+
"reflect": false,
|
|
394
|
+
"defaultValue": "{\n en: {\n heading: \"Select:\",\n item: \"{name}, ({current} of {total})\",\n itemFiltered: \"{name}, ({current} of {total}, {hiddenItems} filtered)\",\n },\n fi: {\n heading: \"Valitse:\",\n item: \"{name}, ({current}/{total})\",\n itemFiltered: \"{name}, ({current}/{total}, {hiddenItems} suodatettu)\",\n },\n sv: {\n heading: \"V\u00E4lj:\",\n item: \"{name}, ({current} av {total})\",\n itemFiltered: \"{name}, ({current} av {total}, {hiddenItems} filtrerade)\",\n },\n }"
|
|
395
|
+
},
|
|
396
|
+
"accessibleLabels": {
|
|
397
|
+
"type": "unknown",
|
|
398
|
+
"mutable": false,
|
|
399
|
+
"complexType": {
|
|
400
|
+
"original": "Record<string, string>",
|
|
401
|
+
"resolved": "{ [x: string]: string; }",
|
|
402
|
+
"references": {
|
|
403
|
+
"Record": {
|
|
404
|
+
"location": "global"
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
},
|
|
408
|
+
"required": false,
|
|
409
|
+
"optional": false,
|
|
410
|
+
"docs": {
|
|
411
|
+
"tags": [{
|
|
412
|
+
"name": "default",
|
|
413
|
+
"text": "{\nheading: \"Valitse:\",\nitem: \"{0}, ({1}/{2})\",\nitemFiltered: \"{0}, ({1}/{2} - {3} suodatettu\"\n}"
|
|
414
|
+
}],
|
|
415
|
+
"text": "Hint text to display before the user types into the date picker input."
|
|
416
|
+
},
|
|
417
|
+
"defaultValue": "getLocaleString(\n parsePossibleJSON(this.accessibleLabelDefaults),\n getLanguage()\n )"
|
|
418
|
+
},
|
|
419
|
+
"theme": {
|
|
420
|
+
"type": "string",
|
|
421
|
+
"mutable": true,
|
|
422
|
+
"complexType": {
|
|
423
|
+
"original": "DuetTheme",
|
|
424
|
+
"resolved": "\"\" | \"default\" | \"turva\"",
|
|
425
|
+
"references": {
|
|
426
|
+
"DuetTheme": {
|
|
427
|
+
"location": "import",
|
|
428
|
+
"path": "../../common-types"
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
},
|
|
432
|
+
"required": false,
|
|
433
|
+
"optional": false,
|
|
434
|
+
"docs": {
|
|
435
|
+
"tags": [],
|
|
436
|
+
"text": "Theme of the combobox."
|
|
437
|
+
},
|
|
438
|
+
"attribute": "theme",
|
|
439
|
+
"reflect": false,
|
|
440
|
+
"defaultValue": "\"\""
|
|
441
|
+
},
|
|
442
|
+
"force": {
|
|
443
|
+
"type": "boolean",
|
|
444
|
+
"mutable": false,
|
|
445
|
+
"complexType": {
|
|
446
|
+
"original": "boolean",
|
|
447
|
+
"resolved": "boolean",
|
|
448
|
+
"references": {}
|
|
449
|
+
},
|
|
450
|
+
"required": false,
|
|
451
|
+
"optional": false,
|
|
452
|
+
"docs": {
|
|
453
|
+
"tags": [],
|
|
454
|
+
"text": "Force the user to make a selection (typing things in the input field will only be used for list search)"
|
|
455
|
+
},
|
|
456
|
+
"attribute": "force",
|
|
457
|
+
"reflect": false,
|
|
458
|
+
"defaultValue": "false"
|
|
459
|
+
},
|
|
460
|
+
"items": {
|
|
461
|
+
"type": "any",
|
|
462
|
+
"mutable": true,
|
|
463
|
+
"complexType": {
|
|
464
|
+
"original": "any",
|
|
465
|
+
"resolved": "any",
|
|
466
|
+
"references": {}
|
|
467
|
+
},
|
|
468
|
+
"required": false,
|
|
469
|
+
"optional": false,
|
|
470
|
+
"docs": {
|
|
471
|
+
"tags": [],
|
|
472
|
+
"text": "Array of item objects."
|
|
473
|
+
},
|
|
474
|
+
"attribute": "items",
|
|
475
|
+
"reflect": false
|
|
476
|
+
},
|
|
477
|
+
"formatter": {
|
|
478
|
+
"type": "unknown",
|
|
479
|
+
"mutable": false,
|
|
480
|
+
"complexType": {
|
|
481
|
+
"original": "(item: DuetComboboxItem) => string",
|
|
482
|
+
"resolved": "(item: DuetComboboxItem) => string",
|
|
483
|
+
"references": {
|
|
484
|
+
"DuetComboboxItem": {
|
|
485
|
+
"location": "local"
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
},
|
|
489
|
+
"required": false,
|
|
490
|
+
"optional": false,
|
|
491
|
+
"docs": {
|
|
492
|
+
"tags": [{
|
|
493
|
+
"name": "example",
|
|
494
|
+
"text": "(item) => `${item.name} (${item.value})`"
|
|
495
|
+
}, {
|
|
496
|
+
"name": "default",
|
|
497
|
+
"text": "undefined"
|
|
498
|
+
}],
|
|
499
|
+
"text": "A hook to overwrite how the values are displayed in the input field after a User select an item"
|
|
500
|
+
},
|
|
501
|
+
"defaultValue": "(item: DuetComboboxItem) =>\n item && item.name ? item.name : \"\""
|
|
502
|
+
},
|
|
503
|
+
"value": {
|
|
504
|
+
"type": "string",
|
|
505
|
+
"mutable": true,
|
|
506
|
+
"complexType": {
|
|
507
|
+
"original": "string",
|
|
508
|
+
"resolved": "string",
|
|
509
|
+
"references": {}
|
|
510
|
+
},
|
|
511
|
+
"required": false,
|
|
512
|
+
"optional": false,
|
|
513
|
+
"docs": {
|
|
514
|
+
"tags": [],
|
|
515
|
+
"text": "Object containing selected item/s"
|
|
516
|
+
},
|
|
517
|
+
"attribute": "value",
|
|
518
|
+
"reflect": true
|
|
519
|
+
}
|
|
520
|
+
}; }
|
|
521
|
+
static get states() { return {
|
|
522
|
+
"processedItems": {},
|
|
523
|
+
"inputWidth": {},
|
|
524
|
+
"inputValue": {},
|
|
525
|
+
"selectionMsg": {},
|
|
526
|
+
"listOpen": {},
|
|
527
|
+
"selectedItems": {},
|
|
528
|
+
"activeItem": {}
|
|
529
|
+
}; }
|
|
530
|
+
static get events() { return [{
|
|
531
|
+
"method": "duetChange",
|
|
532
|
+
"name": "duetChange",
|
|
533
|
+
"bubbles": false,
|
|
534
|
+
"cancelable": true,
|
|
535
|
+
"composed": true,
|
|
536
|
+
"docs": {
|
|
537
|
+
"tags": [],
|
|
538
|
+
"text": "Emitted when a keyboard input occurred."
|
|
539
|
+
},
|
|
540
|
+
"complexType": {
|
|
541
|
+
"original": "DuetComboboxEvent",
|
|
542
|
+
"resolved": "{ originalEvent?: Event; component: \"duet-combobox\"; value: any; item: DuetComboboxItem; }",
|
|
543
|
+
"references": {
|
|
544
|
+
"DuetComboboxEvent": {
|
|
545
|
+
"location": "local"
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
}]; }
|
|
550
|
+
static get methods() { return {
|
|
551
|
+
"formatItem": {
|
|
552
|
+
"complexType": {
|
|
553
|
+
"signature": "(item: DuetComboboxItem) => Promise<string>",
|
|
554
|
+
"parameters": [{
|
|
555
|
+
"tags": [{
|
|
556
|
+
"name": "param",
|
|
557
|
+
"text": "item : DuetComboboxItem"
|
|
558
|
+
}],
|
|
559
|
+
"text": ": DuetComboboxItem"
|
|
560
|
+
}],
|
|
561
|
+
"references": {
|
|
562
|
+
"Promise": {
|
|
563
|
+
"location": "global"
|
|
564
|
+
},
|
|
565
|
+
"DuetComboboxItem": {
|
|
566
|
+
"location": "local"
|
|
567
|
+
}
|
|
568
|
+
},
|
|
569
|
+
"return": "Promise<string>"
|
|
570
|
+
},
|
|
571
|
+
"docs": {
|
|
572
|
+
"text": "Exposes a formatter function to format the item value displayed after a user selects an item",
|
|
573
|
+
"tags": [{
|
|
574
|
+
"name": "param",
|
|
575
|
+
"text": "item : DuetComboboxItem"
|
|
576
|
+
}]
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
}; }
|
|
580
|
+
static get elementRef() { return "element"; }
|
|
581
|
+
static get watchers() { return [{
|
|
582
|
+
"propName": "activeItem",
|
|
583
|
+
"methodName": "activeItemHandler"
|
|
584
|
+
}]; }
|
|
585
|
+
static get listeners() { return [{
|
|
586
|
+
"name": "click",
|
|
587
|
+
"method": "handleDocumentClick",
|
|
588
|
+
"target": "document",
|
|
589
|
+
"capture": false,
|
|
590
|
+
"passive": false
|
|
591
|
+
}]; }
|
|
592
|
+
}
|
|
@@ -121,6 +121,10 @@ export class DuetDatePicker {
|
|
|
121
121
|
* This setting can be used alone or together with the min property.
|
|
122
122
|
*/
|
|
123
123
|
this.max = "";
|
|
124
|
+
/**
|
|
125
|
+
* Increment to add to years, defaults to 10 for simplicity, if you need a larger selectionspace you can set it to 100
|
|
126
|
+
*/
|
|
127
|
+
this.incrementYears = 10;
|
|
124
128
|
this.enableActiveFocus = () => {
|
|
125
129
|
this.focusTarget = "day-button";
|
|
126
130
|
};
|
|
@@ -386,8 +390,8 @@ export class DuetDatePicker {
|
|
|
386
390
|
const maxDate = parseISODate(this.max);
|
|
387
391
|
const prevMonthDisabled = minDate != null && minDate.getMonth() === focusedMonth && minDate.getFullYear() === focusedYear;
|
|
388
392
|
const nextMonthDisabled = maxDate != null && maxDate.getMonth() === focusedMonth && maxDate.getFullYear() === focusedYear;
|
|
389
|
-
let minYear = selectedYear -
|
|
390
|
-
let maxYear = selectedYear +
|
|
393
|
+
let minYear = selectedYear - this.incrementYears;
|
|
394
|
+
let maxYear = selectedYear + this.incrementYears;
|
|
391
395
|
if (minDate) {
|
|
392
396
|
minYear = Math.max(minYear, minDate.getFullYear());
|
|
393
397
|
}
|
|
@@ -951,6 +955,24 @@ export class DuetDatePicker {
|
|
|
951
955
|
"reflect": false,
|
|
952
956
|
"defaultValue": "\"\""
|
|
953
957
|
},
|
|
958
|
+
"incrementYears": {
|
|
959
|
+
"type": "number",
|
|
960
|
+
"mutable": false,
|
|
961
|
+
"complexType": {
|
|
962
|
+
"original": "number",
|
|
963
|
+
"resolved": "number",
|
|
964
|
+
"references": {}
|
|
965
|
+
},
|
|
966
|
+
"required": false,
|
|
967
|
+
"optional": false,
|
|
968
|
+
"docs": {
|
|
969
|
+
"tags": [],
|
|
970
|
+
"text": "Increment to add to years, defaults to 10 for simplicity, if you need a larger selectionspace you can set it to 100"
|
|
971
|
+
},
|
|
972
|
+
"attribute": "increment",
|
|
973
|
+
"reflect": false,
|
|
974
|
+
"defaultValue": "10"
|
|
975
|
+
},
|
|
954
976
|
"validity": {
|
|
955
977
|
"type": "unknown",
|
|
956
978
|
"mutable": true,
|
|
@@ -19,6 +19,10 @@ const createEvent = (ev, data) => ({
|
|
|
19
19
|
data,
|
|
20
20
|
originalEvent: ev,
|
|
21
21
|
});
|
|
22
|
+
/**
|
|
23
|
+
* @part top - piercing selector for styling the top part of the footer
|
|
24
|
+
* @part menu - piercing selector for styling the menu section of the footer
|
|
25
|
+
*/
|
|
22
26
|
export class DuetFooter {
|
|
23
27
|
constructor() {
|
|
24
28
|
/**
|
|
@@ -117,7 +121,7 @@ export class DuetFooter {
|
|
|
117
121
|
"duet-footer-simple": this.variation === "simple",
|
|
118
122
|
} },
|
|
119
123
|
h("div", { class: "duet-footer-wrapper" },
|
|
120
|
-
h("div", { class: "duet-footer-top" },
|
|
124
|
+
h("div", { class: "duet-footer-top", part: "top" },
|
|
121
125
|
this.variation !== "simple" && (h("duet-logo", { href: this.logoHref, onClick: this.handleLogoClick, size: "large", inverse: true, language: this.language, theme: this.theme })),
|
|
122
126
|
this.processedItems &&
|
|
123
127
|
this.variation !== "simple" &&
|
|
@@ -129,7 +133,7 @@ export class DuetFooter {
|
|
|
129
133
|
", ",
|
|
130
134
|
this.accessibleLabelExternal),
|
|
131
135
|
h("div", { class: "duet-footer-arrow" }, item.external ? (h("duet-icon", { icon: newWindowIcon.svg, size: "xx-small", margin: "none", color: "currentColor" })) : (h("duet-icon", { icon: arrowRightIcon.svg, size: "auto", margin: "none", color: "currentColor" }))))))),
|
|
132
|
-
h("p", { class: "duet-footer-menu" },
|
|
136
|
+
h("p", { class: "duet-footer-menu", part: "menu" },
|
|
133
137
|
h("span", { class: "duet-footer-copyright" }, `${copyrightLabel} ${new Date().getFullYear()}`),
|
|
134
138
|
this.processedMenu && (h(Fragment, null,
|
|
135
139
|
h("span", { class: "duet-footer-divider", role: "presentation", "aria-hidden": "true" }, "/"),
|