@duetds/components 4.31.0 → 4.33.2
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 +1895 -77
- package/lib/cjs/{dom-e89ebf90.js → dom-c850c8d7.js} +1 -1
- package/lib/cjs/duet-alert.cjs.entry.js +2 -2
- package/lib/cjs/duet-badge.cjs.entry.js +1 -1
- package/lib/cjs/duet-button_2.cjs.entry.js +4 -4
- package/lib/cjs/duet-caption_4.cjs.entry.js +17 -10
- 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 +53 -24
- package/lib/cjs/duet-collapsible.cjs.entry.js +4 -449
- package/lib/cjs/duet-cookie-consent.cjs.entry.js +1 -1
- package/lib/cjs/duet-date-picker.cjs.entry.js +7 -7
- package/lib/cjs/duet-divider_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-editable-table-button.cjs.entry.js +89 -0
- package/lib/cjs/duet-editable-table_4.cjs.entry.js +1445 -0
- 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 +2 -2
- package/lib/cjs/duet-grid_2.cjs.entry.js +69 -4
- package/lib/cjs/duet-header_2.cjs.entry.js +3 -3
- package/lib/cjs/duet-hero.cjs.entry.js +2 -2
- package/lib/cjs/duet-icon.cjs.entry.js +5 -13
- package/lib/cjs/duet-input_2.cjs.entry.js +6 -6
- 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 +3 -3
- package/lib/cjs/duet-notification_2.cjs.entry.js +2 -2
- package/lib/cjs/duet-number-input.cjs.entry.js +2 -2
- package/lib/cjs/duet-progress.cjs.entry.js +75 -0
- package/lib/cjs/duet-radio_2.cjs.entry.js +2 -2
- package/lib/cjs/duet-range-slider.cjs.entry.js +2 -2
- package/lib/cjs/duet-select.cjs.entry.js +5 -5
- package/lib/cjs/duet-step_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-tab_2.cjs.entry.js +3 -3
- package/lib/cjs/duet-textarea.cjs.entry.js +5 -5
- package/lib/cjs/duet-toggle.cjs.entry.js +1 -1
- 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 +100 -0
- package/lib/cjs/duet-visually-hidden.cjs.entry.js +1 -1
- package/lib/cjs/duet.cjs.js +4 -4
- package/lib/cjs/{focus-utils-bd331feb.js → focus-utils-27c696bb.js} +1 -1
- package/lib/cjs/{index-113c2add.js → index-18b0f43a.js} +91 -77
- package/lib/cjs/{language-utils-48b8860b.js → language-utils-aa282901.js} +6 -2
- package/lib/cjs/loader.cjs.js +3 -3
- package/lib/cjs/{shadow-css-0c8c175b.js → shadow-css-e3edeed1.js} +9 -10
- package/lib/cjs/{token-utils-13e5d13e.js → token-utils-63a9c8dc.js} +1 -1
- package/lib/cjs/tokens-8596cece.js +459 -0
- package/lib/cjs/{tokens.module-53b3bd92.js → tokens.module-6b2df1c2.js} +2 -0
- package/lib/cjs/{watch-options-3877c082.js → watch-options-d88afac0.js} +29 -6
- package/lib/collection/collection-manifest.json +17 -3
- package/lib/collection/components/duet-alert/duet-alert.js +4 -4
- package/lib/collection/components/duet-button/duet-button.js +10 -10
- package/lib/collection/components/duet-card/duet-card.css +20 -0
- package/lib/collection/components/duet-card/duet-card.js +4 -1
- package/lib/collection/components/duet-checkbox/duet-checkbox.css +1 -1
- package/lib/collection/components/duet-choice/duet-choice.css +16 -3
- package/lib/collection/components/duet-choice/duet-choice.js +117 -33
- package/lib/collection/components/duet-choice-group/duet-choice-group.js +4 -4
- package/lib/collection/components/duet-date-picker/duet-date-picker.js +16 -16
- package/lib/collection/components/duet-editable-table/duet-editable-table-button.css +32 -0
- package/lib/collection/components/duet-editable-table/duet-editable-table-button.js +218 -0
- package/lib/collection/components/duet-editable-table/duet-editable-table-item.css +36 -0
- package/lib/collection/components/duet-editable-table/duet-editable-table-item.js +203 -0
- package/lib/collection/components/duet-editable-table/duet-editable-table-tabledata.js +13 -0
- package/lib/collection/components/duet-editable-table/duet-editable-table.css +16 -0
- package/lib/collection/components/duet-editable-table/duet-editable-table.js +348 -0
- package/lib/collection/components/duet-footer/duet-footer.js +10 -10
- package/lib/collection/components/duet-grid/duet-grid.js +74 -6
- package/lib/collection/components/duet-grid-item/duet-grid-item.js +4 -4
- package/lib/collection/components/duet-header/duet-header.js +16 -16
- package/lib/collection/components/duet-heading/duet-heading.css +3 -0
- package/lib/collection/components/duet-heading/duet-heading.js +7 -6
- package/lib/collection/components/duet-hero/duet-hero.js +8 -8
- package/lib/collection/components/duet-icon/icon-utils.js +5 -8
- package/lib/collection/components/duet-input/duet-input.css +15 -0
- package/lib/collection/components/duet-input/duet-input.js +4 -4
- package/lib/collection/components/duet-link/duet-link.js +8 -8
- package/lib/collection/components/duet-logo/duet-logo.js +4 -4
- package/lib/collection/components/duet-modal/duet-modal.js +8 -8
- package/lib/collection/components/duet-notification/duet-notification.js +8 -8
- package/lib/collection/components/duet-notification-drawer/duet-notification-drawer.js +8 -8
- package/lib/collection/components/duet-number-input/duet-number-input.js +20 -20
- package/lib/collection/components/duet-paragraph/duet-paragraph.css +6 -0
- package/lib/collection/components/duet-paragraph/duet-paragraph.js +34 -3
- package/lib/collection/components/duet-progress/duet-progress.css +103 -0
- package/lib/collection/components/duet-progress/duet-progress.js +240 -0
- package/lib/collection/components/duet-radio/duet-radio.js +6 -6
- package/lib/collection/components/duet-select/duet-select.css +15 -0
- package/lib/collection/components/duet-select/duet-select.js +3 -3
- package/lib/collection/components/duet-step/duet-step.js +8 -8
- package/lib/collection/components/duet-tab-group/duet-tab-group.css +2 -2
- package/lib/collection/components/duet-tab-group/duet-tab-group.js +10 -10
- package/lib/collection/components/duet-textarea/duet-textarea.css +19 -0
- package/lib/collection/components/duet-textarea/duet-textarea.js +5 -4
- package/lib/collection/components/duet-tooltip/duet-tooltip.js +14 -14
- package/lib/collection/components/duet-tray/duet-tray.js +12 -12
- package/lib/collection/components/duet-upload/duet-upload.css +64 -0
- package/lib/collection/components/duet-upload/duet-upload.js +1863 -0
- package/lib/collection/components/duet-upload/errorcodes.utils.js +32 -0
- package/lib/collection/components/duet-upload/mock.helpers.js +91 -0
- package/lib/collection/components/duet-upload/upload-editable-item-error.js +16 -0
- package/lib/collection/components/duet-upload/upload-editable-item-inprogres.js +8 -0
- package/lib/collection/components/duet-upload/upload-editable-item-success.js +30 -0
- package/lib/collection/components/duet-upload/upload-validators.js +93 -0
- package/lib/collection/components/duet-upload/upload.helpers.js +13 -0
- package/lib/collection/components/duet-upload/xhr.helpers.js +30 -0
- package/lib/collection/components/duet-upload-aria-status/duet-upload-aria-status.js +217 -0
- package/lib/collection/utils/js-utils.js +12 -0
- package/lib/collection/utils/language-utils.js +6 -3
- package/lib/collection/utils/watch-options.js +35 -6
- package/lib/custom-elements-bundle/index.d.ts +36 -0
- package/lib/custom-elements-bundle/index.js +2014 -322
- package/lib/duet/duet.esm.js +1 -1
- package/lib/duet/duet.js +1 -1
- package/lib/duet/{p-60ab57d4.entry.js → p-042ec8b1.entry.js} +1 -1
- package/lib/duet/{p-bcae23fc.system.entry.js → p-0435b54a.system.entry.js} +1 -1
- package/lib/duet/{p-dc85d2a4.entry.js → p-04b3e682.entry.js} +1 -1
- package/lib/duet/p-0ac2e60d.system.entry.js +4 -0
- package/lib/duet/p-0d22396e.system.js +16 -0
- package/lib/duet/p-1082d9f2.system.entry.js +4 -0
- package/lib/duet/p-12721178.js +4 -0
- package/lib/duet/{p-7d080785.system.entry.js → p-12fc4849.system.entry.js} +1 -1
- package/lib/duet/{p-c4737f88.entry.js → p-15fae689.entry.js} +1 -1
- package/lib/duet/p-1ad58142.entry.js +4 -0
- package/lib/duet/{p-c5f10483.system.entry.js → p-1c7d7cdd.system.entry.js} +1 -1
- package/lib/duet/p-1cf8dbc7.system.js +4 -0
- package/lib/duet/p-1dcbd837.system.entry.js +4 -0
- package/lib/duet/{p-fdecaf46.entry.js → p-1ecddc1d.entry.js} +1 -1
- package/lib/duet/p-2764f081.js +4 -0
- package/lib/duet/p-2b4bd1b2.system.entry.js +4 -0
- package/lib/duet/p-2d8e0faa.system.entry.js +4 -0
- package/lib/duet/{p-453955cc.system.entry.js → p-33538e90.system.entry.js} +1 -1
- package/lib/duet/{p-b1b8e510.entry.js → p-3364cfd2.entry.js} +1 -1
- package/lib/duet/p-350cea4e.system.entry.js +4 -0
- package/lib/duet/{p-bd9a7d8f.js → p-35a3794e.js} +0 -0
- package/lib/duet/p-39e9d638.entry.js +4 -0
- package/lib/duet/{p-1e7222c2.entry.js → p-3a7e519e.entry.js} +1 -1
- package/lib/duet/{p-9ce1baab.system.entry.js → p-3bcf2054.system.entry.js} +1 -1
- package/lib/duet/{p-322d1c38.js → p-3c1971d8.js} +1 -1
- package/lib/duet/{p-ef45cfe9.system.entry.js → p-3cad13af.system.entry.js} +1 -1
- package/lib/duet/p-408e8cdb.system.js +4 -0
- package/lib/duet/p-4a14da52.entry.js +4 -0
- package/lib/duet/{p-f96c4093.system.entry.js → p-4e17a6cb.system.entry.js} +1 -1
- package/lib/duet/{p-fbd83d67.entry.js → p-50b796eb.entry.js} +1 -1
- package/lib/duet/{p-22f56356.system.entry.js → p-5727cd82.system.entry.js} +1 -1
- package/lib/duet/{p-9c94be45.entry.js → p-582f3a2c.entry.js} +1 -1
- package/lib/duet/{p-e39471b6.entry.js → p-5b9621e2.entry.js} +1 -1
- package/lib/duet/{p-3e1ef509.system.entry.js → p-5f79eff8.system.entry.js} +1 -1
- package/lib/duet/{p-95626e7e.system.entry.js → p-60e721aa.system.entry.js} +1 -1
- package/lib/duet/{p-b03a46b6.entry.js → p-60ef3d05.entry.js} +1 -1
- package/lib/duet/{p-57ea2576.system.js → p-61fc3872.system.js} +1 -1
- package/lib/duet/{p-1cd7177f.entry.js → p-637df820.entry.js} +1 -1
- package/lib/duet/{p-07263910.system.entry.js → p-6402041d.system.entry.js} +1 -1
- package/lib/duet/p-64c0aa2a.entry.js +4 -0
- package/lib/duet/{p-28b67b94.entry.js → p-65451003.entry.js} +1 -1
- package/lib/duet/{p-1bfbc988.entry.js → p-659d6cb7.entry.js} +1 -1
- package/lib/duet/{p-91fa68a5.js → p-66fdebc5.js} +1 -1
- package/lib/duet/p-6708db8a.entry.js +4 -0
- package/lib/duet/{p-e08b8909.entry.js → p-68635a1c.entry.js} +1 -1
- package/lib/duet/p-6e363557.system.js +4 -0
- package/lib/duet/p-70fafc98.system.js +4 -0
- package/lib/duet/p-720a36f2.entry.js +4 -0
- package/lib/duet/{p-f53c8019.entry.js → p-72629304.entry.js} +1 -1
- package/lib/duet/p-75a104e3.entry.js +4 -0
- package/lib/duet/{p-02ad46a0.system.entry.js → p-75e5d4d1.system.entry.js} +1 -1
- package/lib/duet/{p-33cf6ed1.entry.js → p-7ab0bad8.entry.js} +1 -1
- package/lib/duet/{p-e834c8d5.system.entry.js → p-7ceaf4ef.system.entry.js} +1 -1
- package/lib/duet/{p-a1d12e94.system.entry.js → p-7f8cce41.system.entry.js} +1 -1
- package/lib/duet/{p-6d2da245.entry.js → p-7fed7f57.entry.js} +1 -1
- package/lib/duet/p-8143f3de.js +4 -0
- package/lib/duet/p-8c2f14d8.system.entry.js +4 -0
- package/lib/duet/{p-4670a654.entry.js → p-8c730326.entry.js} +1 -1
- package/lib/duet/{p-de093c16.entry.js → p-9125ed25.entry.js} +1 -1
- package/lib/duet/p-933c2774.system.entry.js +4 -0
- package/lib/duet/{p-b7e50cfa.entry.js → p-9584411c.entry.js} +1 -1
- package/lib/duet/p-987edcd0.js +15 -0
- package/lib/duet/p-9930e52e.entry.js +4 -0
- package/lib/duet/p-9a09ac2b.system.entry.js +4 -0
- package/lib/duet/{p-64109493.entry.js → p-a09ddd8f.entry.js} +1 -1
- package/lib/duet/{p-504dbf8f.system.entry.js → p-a2b2fa13.system.entry.js} +1 -1
- package/lib/duet/{p-2826f987.js → p-ad07f399.js} +1 -1
- package/lib/duet/{p-605bc214.system.entry.js → p-b1ad7a52.system.entry.js} +1 -1
- package/lib/duet/{p-f0b1850a.system.entry.js → p-b5dc29b8.system.entry.js} +1 -1
- package/lib/duet/p-ba6214be.entry.js +4 -0
- package/lib/duet/{p-92d38668.system.entry.js → p-be349a3d.system.entry.js} +1 -1
- package/lib/duet/{p-56e172f5.system.entry.js → p-c0f3f60f.system.entry.js} +1 -1
- package/lib/duet/{p-fd98468a.system.js → p-c18a599e.system.js} +0 -0
- package/lib/duet/p-c3c95a34.system.entry.js +4 -0
- package/lib/duet/{p-d4b4bfa6.entry.js → p-c506017d.entry.js} +1 -1
- package/lib/duet/p-c74cecf2.system.entry.js +4 -0
- package/lib/duet/p-c9a11360.entry.js +4 -0
- package/lib/duet/p-cd21755b.entry.js +4 -0
- package/lib/duet/p-cd597d62.system.entry.js +4 -0
- package/lib/duet/p-cff461b6.entry.js +4 -0
- package/lib/duet/{p-7b6db837.system.entry.js → p-d0fb19f7.system.entry.js} +1 -1
- package/lib/duet/{p-69a5dc6b.entry.js → p-d1dfa30e.entry.js} +1 -1
- package/lib/duet/{p-1cec5a70.system.entry.js → p-d4e706ac.system.entry.js} +1 -1
- package/lib/duet/{p-8cb47a70.system.entry.js → p-d5e2bb48.system.entry.js} +1 -1
- package/lib/duet/p-dd79932a.entry.js +4 -0
- package/lib/duet/p-dd9b8fcb.system.entry.js +4 -0
- package/lib/duet/p-ddb6344c.system.js +4 -0
- package/lib/duet/{p-47645ea8.system.entry.js → p-de43620d.system.entry.js} +1 -1
- package/lib/duet/p-e038da47.system.entry.js +4 -0
- package/lib/duet/p-eb55ccd2.system.js +4 -0
- package/lib/duet/p-ebc4e334.js +4 -0
- package/lib/duet/{p-5fc7e1f7.system.entry.js → p-f37ffb6f.system.entry.js} +1 -1
- package/lib/duet/p-f8744611.entry.js +4 -0
- package/lib/duet/p-fa99eaa4.system.js +4 -0
- package/lib/duet/{p-746655ba.entry.js → p-fd00b025.entry.js} +1 -1
- package/lib/esm/{dom-21034390.js → dom-58cd15f6.js} +1 -1
- package/lib/esm/duet-alert.entry.js +2 -2
- package/lib/esm/duet-badge.entry.js +1 -1
- package/lib/esm/duet-button_2.entry.js +4 -4
- package/lib/esm/duet-caption_4.entry.js +17 -10
- 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 +54 -25
- package/lib/esm/duet-collapsible.entry.js +3 -448
- package/lib/esm/duet-cookie-consent.entry.js +1 -1
- package/lib/esm/duet-date-picker.entry.js +7 -7
- package/lib/esm/duet-divider_2.entry.js +1 -1
- package/lib/esm/duet-editable-table-button.entry.js +85 -0
- package/lib/esm/duet-editable-table_4.entry.js +1438 -0
- 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 +2 -2
- package/lib/esm/duet-grid_2.entry.js +69 -4
- package/lib/esm/duet-header_2.entry.js +3 -3
- package/lib/esm/duet-hero.entry.js +2 -2
- package/lib/esm/duet-icon.entry.js +5 -13
- package/lib/esm/duet-input_2.entry.js +6 -6
- 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 +3 -3
- package/lib/esm/duet-notification_2.entry.js +2 -2
- package/lib/esm/duet-number-input.entry.js +2 -2
- package/lib/esm/duet-progress.entry.js +71 -0
- package/lib/esm/duet-radio_2.entry.js +2 -2
- package/lib/esm/duet-range-slider.entry.js +2 -2
- package/lib/esm/duet-select.entry.js +5 -5
- package/lib/esm/duet-step_2.entry.js +1 -1
- package/lib/esm/duet-tab_2.entry.js +3 -3
- package/lib/esm/duet-textarea.entry.js +5 -5
- package/lib/esm/duet-toggle.entry.js +1 -1
- 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 +96 -0
- package/lib/esm/duet-visually-hidden.entry.js +1 -1
- package/lib/esm/duet.js +4 -4
- package/lib/esm/{focus-utils-1995e5a9.js → focus-utils-c1fa24c4.js} +1 -1
- package/lib/esm/{index-6e246691.js → index-05e43a37.js} +91 -78
- package/lib/esm/{language-utils-d5c38f65.js → language-utils-344d894c.js} +6 -3
- package/lib/esm/loader.js +3 -3
- package/lib/esm/{shadow-css-31e2d504.js → shadow-css-7c726abb.js} +9 -10
- package/lib/esm/{token-utils-5a35377f.js → token-utils-590d9413.js} +1 -1
- package/lib/esm/tokens-e110dc89.js +453 -0
- package/lib/esm/{tokens.module-edb66c04.js → tokens.module-49cbf963.js} +3 -1
- package/lib/esm/watch-options-dd55bce8.js +57 -0
- package/lib/esm-es5/{dom-21034390.js → dom-58cd15f6.js} +0 -0
- 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 +2 -2
- 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 +2 -2
- 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-button.entry.js +4 -0
- package/lib/esm-es5/duet-editable-table_4.entry.js +4 -0
- 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 +2 -2
- 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 +2 -2
- 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-progress.entry.js +4 -0
- 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 +2 -2
- 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 +4 -0
- 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 → focus-utils-c1fa24c4.js} +1 -1
- package/lib/esm-es5/index-05e43a37.js +4 -0
- package/lib/esm-es5/{language-utils-d5c38f65.js → language-utils-344d894c.js} +1 -1
- package/lib/esm-es5/loader.js +1 -1
- package/lib/esm-es5/shadow-css-7c726abb.js +15 -0
- package/lib/esm-es5/{token-utils-5a35377f.js → token-utils-590d9413.js} +1 -1
- package/lib/esm-es5/tokens-e110dc89.js +4 -0
- package/lib/esm-es5/tokens.module-49cbf963.js +4 -0
- package/lib/esm-es5/watch-options-dd55bce8.js +4 -0
- package/lib/html.html-data.json +427 -10
- package/lib/types/components/duet-choice/duet-choice.d.ts +23 -4
- package/lib/types/components/duet-date-picker/duet-date-picker.d.ts +5 -5
- package/lib/types/components/duet-editable-table/duet-editable-table-button.d.ts +72 -0
- package/lib/types/components/duet-editable-table/duet-editable-table-item.d.ts +72 -0
- package/lib/types/components/duet-editable-table/duet-editable-table-tabledata.d.ts +7 -0
- package/lib/types/components/duet-editable-table/duet-editable-table.d.ts +84 -0
- package/lib/types/components/duet-grid/duet-grid.d.ts +17 -2
- package/lib/types/components/duet-heading/duet-heading.d.ts +2 -2
- package/lib/types/components/duet-paragraph/duet-paragraph.d.ts +9 -1
- package/lib/types/components/duet-progress/duet-progress.d.ts +64 -0
- package/lib/types/components/duet-upload/duet-upload.d.ts +404 -0
- package/lib/types/components/duet-upload/errorcodes.utils.d.ts +8 -0
- package/lib/types/components/duet-upload/mock.helpers.d.ts +2 -0
- package/lib/types/components/duet-upload/upload-editable-item-error.d.ts +7 -0
- package/lib/types/components/duet-upload/upload-editable-item-inprogres.d.ts +7 -0
- package/lib/types/components/duet-upload/upload-editable-item-success.d.ts +8 -0
- package/lib/types/components/duet-upload/upload-validators.d.ts +12 -0
- package/lib/types/components/duet-upload/upload.helpers.d.ts +1 -0
- package/lib/types/components/duet-upload/xhr.helpers.d.ts +18 -0
- package/lib/types/components/duet-upload-aria-status/duet-upload-aria-status.d.ts +49 -0
- package/lib/types/components.d.ts +791 -21
- package/lib/types/utils/js-utils.d.ts +1 -0
- package/lib/types/utils/language-utils.d.ts +5 -1
- package/lib/types/utils/watch-options.d.ts +2 -0
- package/package.json +6 -6
- package/lib/cjs/duet-table.cjs.entry.js +0 -132
- package/lib/duet/p-0058512b.js +0 -4
- package/lib/duet/p-0224db45.entry.js +0 -4
- package/lib/duet/p-15c15c6a.js +0 -15
- package/lib/duet/p-202bbd70.entry.js +0 -4
- package/lib/duet/p-33426ddc.entry.js +0 -4
- package/lib/duet/p-3d3f773d.system.entry.js +0 -4
- package/lib/duet/p-3f78a826.system.js +0 -4
- package/lib/duet/p-418b2ce7.system.js +0 -4
- package/lib/duet/p-43e39d98.system.js +0 -4
- package/lib/duet/p-44ffb960.entry.js +0 -4
- package/lib/duet/p-5230ee3c.system.entry.js +0 -4
- package/lib/duet/p-5aa0d34d.entry.js +0 -4
- package/lib/duet/p-6a230911.system.entry.js +0 -4
- package/lib/duet/p-6a356ab1.system.js +0 -4
- package/lib/duet/p-6a760b8a.entry.js +0 -4
- package/lib/duet/p-712e7dde.system.entry.js +0 -4
- package/lib/duet/p-82dc2e0b.entry.js +0 -4
- package/lib/duet/p-8c8e82aa.system.js +0 -4
- package/lib/duet/p-8c980350.system.entry.js +0 -4
- package/lib/duet/p-8f03c3eb.entry.js +0 -4
- package/lib/duet/p-96808a2e.system.entry.js +0 -4
- package/lib/duet/p-96c103b2.system.entry.js +0 -4
- package/lib/duet/p-9a89ec39.js +0 -4
- package/lib/duet/p-9ff25646.entry.js +0 -4
- package/lib/duet/p-b694cbf5.system.js +0 -4
- package/lib/duet/p-b82927b0.system.entry.js +0 -4
- package/lib/duet/p-ba205dca.entry.js +0 -4
- package/lib/duet/p-be19c57b.system.entry.js +0 -4
- package/lib/duet/p-c5beceed.js +0 -4
- package/lib/duet/p-d35fd913.system.entry.js +0 -4
- package/lib/duet/p-d7623eb8.system.entry.js +0 -4
- package/lib/duet/p-de842863.entry.js +0 -4
- package/lib/duet/p-e58ca7af.system.js +0 -16
- package/lib/esm/duet-table.entry.js +0 -128
- package/lib/esm/watch-options-de55ea78.js +0 -35
- package/lib/esm-es5/duet-table.entry.js +0 -4
- package/lib/esm-es5/index-6e246691.js +0 -4
- package/lib/esm-es5/shadow-css-31e2d504.js +0 -15
- package/lib/esm-es5/tokens.module-edb66c04.js +0 -4
- package/lib/esm-es5/watch-options-de55ea78.js +0 -4
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built with Duet Design System
|
|
3
|
+
*/
|
|
4
|
+
import { Component, Element, h, Host, Method, Prop, State } from "@stencil/core";
|
|
5
|
+
import { debounce } from "../../utils/js-utils";
|
|
6
|
+
import { getLocaleString, sanitizeString } from "../../utils/language-utils";
|
|
7
|
+
import { inheritGlobalTheme } from "../../utils/themeable-component";
|
|
8
|
+
export class DuetEditableTable {
|
|
9
|
+
constructor() {
|
|
10
|
+
/**
|
|
11
|
+
* State() variables
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
this.tick = Date.now();
|
|
15
|
+
/**
|
|
16
|
+
* Map of items that contain list of things.
|
|
17
|
+
*/
|
|
18
|
+
this.items = new Map();
|
|
19
|
+
/**
|
|
20
|
+
* Array of internationalized defaults for the default groups labels.
|
|
21
|
+
*/
|
|
22
|
+
this.groupsLabelDefaults = {
|
|
23
|
+
fi: "Kaikki",
|
|
24
|
+
en: "All items",
|
|
25
|
+
sv: "Alla objekt",
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Array of internationalized defaults for the default action labels.
|
|
29
|
+
*/
|
|
30
|
+
this.actionLabelDefaults = {
|
|
31
|
+
fi: "Toiminnot",
|
|
32
|
+
en: "Actions",
|
|
33
|
+
sv: "Handlingar",
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Array of group names that you want the editable table to display (can be used to hide or show groups depending on conditions).
|
|
37
|
+
* @default { id: "all", label: this.groupsLabelDefaults, actionLabel: this.actionLabelDefaults }.
|
|
38
|
+
* @example [{ id: "success", label: {fi: "Onnistunut", en: "Success", sv: "Alt klart", }}].
|
|
39
|
+
*/
|
|
40
|
+
this.groups = [
|
|
41
|
+
{ id: "all", label: this.groupsLabelDefaults, actionLabel: this.actionLabelDefaults },
|
|
42
|
+
];
|
|
43
|
+
/**
|
|
44
|
+
* Array of actions that are mapped via the map variable to the various groups defined in group.
|
|
45
|
+
* @default undefined
|
|
46
|
+
* @example [{
|
|
47
|
+
variation: "default",
|
|
48
|
+
icon: "action-edit-2",
|
|
49
|
+
id: "edit",
|
|
50
|
+
map: ["success"],
|
|
51
|
+
label: {
|
|
52
|
+
fi: " Label",
|
|
53
|
+
en: " Label",
|
|
54
|
+
sv: " Label",
|
|
55
|
+
}
|
|
56
|
+
}]
|
|
57
|
+
*/
|
|
58
|
+
this.actions = undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Shows or hides the table labels.
|
|
61
|
+
*/
|
|
62
|
+
this.hideGroups = false;
|
|
63
|
+
/**
|
|
64
|
+
* Exposes the aria role for optimizing accessibility.
|
|
65
|
+
*/
|
|
66
|
+
this.accessibleRole = undefined;
|
|
67
|
+
/**
|
|
68
|
+
* Private methods.
|
|
69
|
+
*/
|
|
70
|
+
this.kick = debounce(() => {
|
|
71
|
+
this.tick = Date.now();
|
|
72
|
+
}, 100); // will trigger re-render
|
|
73
|
+
this.filterMap = needle => {
|
|
74
|
+
if (needle === "all") {
|
|
75
|
+
return Array.from(this.items);
|
|
76
|
+
}
|
|
77
|
+
return Array.from(this.items).filter(item => needle === item[1].group);
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Component lifecycle events.
|
|
82
|
+
*/
|
|
83
|
+
componentWillLoad() {
|
|
84
|
+
if (typeof this.groups === "string") {
|
|
85
|
+
this.internalGroupArray = sanitizeString(this.groups);
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
this.internalGroupArray = this.groups;
|
|
89
|
+
}
|
|
90
|
+
if (typeof this.actions === "string") {
|
|
91
|
+
this.internalActionsArray = sanitizeString(this.actions);
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
this.internalActionsArray = this.actions;
|
|
95
|
+
}
|
|
96
|
+
inheritGlobalTheme(this);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Method to force an update of a tabular data array.
|
|
100
|
+
* when called the method will rerender the entire tabular structure.
|
|
101
|
+
*/
|
|
102
|
+
async updateTable(passedItems = undefined) {
|
|
103
|
+
this.items = new Map(passedItems || this.items);
|
|
104
|
+
this.kick();
|
|
105
|
+
}
|
|
106
|
+
render() {
|
|
107
|
+
return (h(Host, { class: {
|
|
108
|
+
"duet-theme-turva": this.theme === "turva",
|
|
109
|
+
} }, this.internalGroupArray.map(group => {
|
|
110
|
+
const currentGroup = this.filterMap(group.id);
|
|
111
|
+
if (!currentGroup.length) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
return (h("duet-table", { variation: "plain", breakpoint: "none", role: "", margin: this.hideGroups ? "none" : "auto" },
|
|
115
|
+
h("table", { class: "duet-editable-table", "aria-role": this.accessibleRole },
|
|
116
|
+
h("thead", { class: "duet-editable-table-header" },
|
|
117
|
+
h("tr", null,
|
|
118
|
+
h("th", { class: {
|
|
119
|
+
"duet-editable-table-header-hidden": this.hideGroups,
|
|
120
|
+
} }, !this.hideGroups ? (getLocaleString(group.label)) : (h("duet-visually-hidden", null, getLocaleString(group.label)))),
|
|
121
|
+
h("th", { class: {
|
|
122
|
+
"duet-editable-table-header-hidden": this.hideGroups,
|
|
123
|
+
} },
|
|
124
|
+
h("duet-visually-hidden", null, group.actionLabel
|
|
125
|
+
? getLocaleString(group.actionLabel)
|
|
126
|
+
: getLocaleString(this.actionLabelDefaults))))),
|
|
127
|
+
h("tbody", null, currentGroup.map(dataAsArray => {
|
|
128
|
+
const [key, value] = dataAsArray;
|
|
129
|
+
return (h("duet-editable-table-item", { keyName: key, data: Object.assign({}, value), groupId: group.id, part: group.id, actions: this.internalActionsArray }));
|
|
130
|
+
})))));
|
|
131
|
+
})));
|
|
132
|
+
}
|
|
133
|
+
static get is() { return "duet-editable-table"; }
|
|
134
|
+
static get encapsulation() { return "shadow"; }
|
|
135
|
+
static get originalStyleUrls() { return {
|
|
136
|
+
"$": ["duet-editable-table.scss"]
|
|
137
|
+
}; }
|
|
138
|
+
static get styleUrls() { return {
|
|
139
|
+
"$": ["duet-editable-table.css"]
|
|
140
|
+
}; }
|
|
141
|
+
static get properties() { return {
|
|
142
|
+
"items": {
|
|
143
|
+
"type": "unknown",
|
|
144
|
+
"mutable": true,
|
|
145
|
+
"complexType": {
|
|
146
|
+
"original": "DuetEditableTableItems",
|
|
147
|
+
"resolved": "Map<any, DuetEditableTableItemData>",
|
|
148
|
+
"references": {
|
|
149
|
+
"DuetEditableTableItems": {
|
|
150
|
+
"location": "local"
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"required": false,
|
|
155
|
+
"optional": false,
|
|
156
|
+
"docs": {
|
|
157
|
+
"tags": [],
|
|
158
|
+
"text": "Map of items that contain list of things."
|
|
159
|
+
},
|
|
160
|
+
"defaultValue": "new Map()"
|
|
161
|
+
},
|
|
162
|
+
"groupsLabelDefaults": {
|
|
163
|
+
"type": "unknown",
|
|
164
|
+
"mutable": false,
|
|
165
|
+
"complexType": {
|
|
166
|
+
"original": "DuetLangObject",
|
|
167
|
+
"resolved": "DuetLangObject",
|
|
168
|
+
"references": {
|
|
169
|
+
"DuetLangObject": {
|
|
170
|
+
"location": "import",
|
|
171
|
+
"path": "../../utils/language-utils"
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
"required": false,
|
|
176
|
+
"optional": false,
|
|
177
|
+
"docs": {
|
|
178
|
+
"tags": [],
|
|
179
|
+
"text": "Array of internationalized defaults for the default groups labels."
|
|
180
|
+
},
|
|
181
|
+
"defaultValue": "{\n fi: \"Kaikki\",\n en: \"All items\",\n sv: \"Alla objekt\",\n }"
|
|
182
|
+
},
|
|
183
|
+
"actionLabelDefaults": {
|
|
184
|
+
"type": "unknown",
|
|
185
|
+
"mutable": false,
|
|
186
|
+
"complexType": {
|
|
187
|
+
"original": "DuetLangObject",
|
|
188
|
+
"resolved": "DuetLangObject",
|
|
189
|
+
"references": {
|
|
190
|
+
"DuetLangObject": {
|
|
191
|
+
"location": "import",
|
|
192
|
+
"path": "../../utils/language-utils"
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
"required": false,
|
|
197
|
+
"optional": false,
|
|
198
|
+
"docs": {
|
|
199
|
+
"tags": [],
|
|
200
|
+
"text": "Array of internationalized defaults for the default action labels."
|
|
201
|
+
},
|
|
202
|
+
"defaultValue": "{\n fi: \"Toiminnot\",\n en: \"Actions\",\n sv: \"Handlingar\",\n }"
|
|
203
|
+
},
|
|
204
|
+
"groups": {
|
|
205
|
+
"type": "string",
|
|
206
|
+
"mutable": false,
|
|
207
|
+
"complexType": {
|
|
208
|
+
"original": "DuetEditableTableGroupNames | string",
|
|
209
|
+
"resolved": "string | { id: string; label: DuetLangObject; actionLabel?: DuetLangObject; }[]",
|
|
210
|
+
"references": {
|
|
211
|
+
"DuetEditableTableGroupNames": {
|
|
212
|
+
"location": "local"
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
"required": false,
|
|
217
|
+
"optional": false,
|
|
218
|
+
"docs": {
|
|
219
|
+
"tags": [{
|
|
220
|
+
"name": "default",
|
|
221
|
+
"text": "{ id: \"all\", label: this.groupsLabelDefaults, actionLabel: this.actionLabelDefaults }."
|
|
222
|
+
}, {
|
|
223
|
+
"name": "example",
|
|
224
|
+
"text": "[{ id: \"success\", label: {fi: \"Onnistunut\", en: \"Success\", sv: \"Alt klart\", }}]."
|
|
225
|
+
}],
|
|
226
|
+
"text": "Array of group names that you want the editable table to display (can be used to hide or show groups depending on conditions)."
|
|
227
|
+
},
|
|
228
|
+
"attribute": "groups",
|
|
229
|
+
"reflect": false,
|
|
230
|
+
"defaultValue": "[\n { id: \"all\", label: this.groupsLabelDefaults, actionLabel: this.actionLabelDefaults },\n ]"
|
|
231
|
+
},
|
|
232
|
+
"actions": {
|
|
233
|
+
"type": "string",
|
|
234
|
+
"mutable": false,
|
|
235
|
+
"complexType": {
|
|
236
|
+
"original": "DuetEditableTableActions | string",
|
|
237
|
+
"resolved": "string | { icon: string; color: string; color_hover: string; id: string; map?: string[]; label?: DuetLangObject; }[]",
|
|
238
|
+
"references": {
|
|
239
|
+
"DuetEditableTableActions": {
|
|
240
|
+
"location": "import",
|
|
241
|
+
"path": "./duet-editable-table-item"
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
"required": false,
|
|
246
|
+
"optional": false,
|
|
247
|
+
"docs": {
|
|
248
|
+
"tags": [{
|
|
249
|
+
"name": "default",
|
|
250
|
+
"text": "undefined"
|
|
251
|
+
}, {
|
|
252
|
+
"name": "example",
|
|
253
|
+
"text": "[{\nvariation: \"default\",\nicon: \"action-edit-2\",\nid: \"edit\",\nmap: [\"success\"],\nlabel: {\n fi: \" Label\",\n en: \" Label\",\n sv: \" Label\",\n}\n}]"
|
|
254
|
+
}],
|
|
255
|
+
"text": "Array of actions that are mapped via the map variable to the various groups defined in group."
|
|
256
|
+
},
|
|
257
|
+
"attribute": "actions",
|
|
258
|
+
"reflect": false,
|
|
259
|
+
"defaultValue": "undefined"
|
|
260
|
+
},
|
|
261
|
+
"hideGroups": {
|
|
262
|
+
"type": "boolean",
|
|
263
|
+
"mutable": false,
|
|
264
|
+
"complexType": {
|
|
265
|
+
"original": "boolean",
|
|
266
|
+
"resolved": "boolean",
|
|
267
|
+
"references": {}
|
|
268
|
+
},
|
|
269
|
+
"required": false,
|
|
270
|
+
"optional": false,
|
|
271
|
+
"docs": {
|
|
272
|
+
"tags": [],
|
|
273
|
+
"text": "Shows or hides the table labels."
|
|
274
|
+
},
|
|
275
|
+
"attribute": "hide-table-labels",
|
|
276
|
+
"reflect": false,
|
|
277
|
+
"defaultValue": "false"
|
|
278
|
+
},
|
|
279
|
+
"accessibleRole": {
|
|
280
|
+
"type": "string",
|
|
281
|
+
"mutable": false,
|
|
282
|
+
"complexType": {
|
|
283
|
+
"original": "string",
|
|
284
|
+
"resolved": "string",
|
|
285
|
+
"references": {}
|
|
286
|
+
},
|
|
287
|
+
"required": false,
|
|
288
|
+
"optional": false,
|
|
289
|
+
"docs": {
|
|
290
|
+
"tags": [],
|
|
291
|
+
"text": "Exposes the aria role for optimizing accessibility."
|
|
292
|
+
},
|
|
293
|
+
"attribute": "accessible-role",
|
|
294
|
+
"reflect": false,
|
|
295
|
+
"defaultValue": "undefined"
|
|
296
|
+
},
|
|
297
|
+
"theme": {
|
|
298
|
+
"type": "string",
|
|
299
|
+
"mutable": true,
|
|
300
|
+
"complexType": {
|
|
301
|
+
"original": "DuetTheme",
|
|
302
|
+
"resolved": "\"\" | \"default\" | \"turva\"",
|
|
303
|
+
"references": {
|
|
304
|
+
"DuetTheme": {
|
|
305
|
+
"location": "import",
|
|
306
|
+
"path": "../../common-types"
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
},
|
|
310
|
+
"required": false,
|
|
311
|
+
"optional": false,
|
|
312
|
+
"docs": {
|
|
313
|
+
"tags": [],
|
|
314
|
+
"text": "Theme of the table."
|
|
315
|
+
},
|
|
316
|
+
"attribute": "theme",
|
|
317
|
+
"reflect": false
|
|
318
|
+
}
|
|
319
|
+
}; }
|
|
320
|
+
static get states() { return {
|
|
321
|
+
"tick": {}
|
|
322
|
+
}; }
|
|
323
|
+
static get methods() { return {
|
|
324
|
+
"updateTable": {
|
|
325
|
+
"complexType": {
|
|
326
|
+
"signature": "(passedItems?: DuetEditableTableItems) => Promise<void>",
|
|
327
|
+
"parameters": [{
|
|
328
|
+
"tags": [],
|
|
329
|
+
"text": ""
|
|
330
|
+
}],
|
|
331
|
+
"references": {
|
|
332
|
+
"Promise": {
|
|
333
|
+
"location": "global"
|
|
334
|
+
},
|
|
335
|
+
"DuetEditableTableItems": {
|
|
336
|
+
"location": "local"
|
|
337
|
+
}
|
|
338
|
+
},
|
|
339
|
+
"return": "Promise<void>"
|
|
340
|
+
},
|
|
341
|
+
"docs": {
|
|
342
|
+
"text": "Method to force an update of a tabular data array.\nwhen called the method will rerender the entire tabular structure.",
|
|
343
|
+
"tags": []
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}; }
|
|
347
|
+
static get elementRef() { return "element"; }
|
|
348
|
+
}
|
|
@@ -255,11 +255,11 @@ export class DuetFooter {
|
|
|
255
255
|
"optional": false,
|
|
256
256
|
"docs": {
|
|
257
257
|
"tags": [{
|
|
258
|
-
"
|
|
259
|
-
"
|
|
258
|
+
"name": "deprecated",
|
|
259
|
+
"text": "this is now handled via the html lang tag, and is no longer used - kept to avoid breaking changes and ease unit testing"
|
|
260
260
|
}, {
|
|
261
|
-
"
|
|
262
|
-
"
|
|
261
|
+
"name": "default",
|
|
262
|
+
"text": "\"fi\""
|
|
263
263
|
}],
|
|
264
264
|
"text": "The currently active language. This setting changes the logo to match the\nchosen language."
|
|
265
265
|
},
|
|
@@ -301,8 +301,8 @@ export class DuetFooter {
|
|
|
301
301
|
"optional": false,
|
|
302
302
|
"docs": {
|
|
303
303
|
"tags": [{
|
|
304
|
-
"
|
|
305
|
-
"
|
|
304
|
+
"name": "default",
|
|
305
|
+
"text": "{fi: \"Avautuu uuteen ikkunaan\",sv: \"\u00D6ppnas i nytt f\u00F6nster\",en: \"Opens in a new window\"}"
|
|
306
306
|
}],
|
|
307
307
|
"text": "Property to change accessibleLabelExternal defaults on the component.\nnormally you would handle these strings on an application level and override @accessibleLabelExternal when needed"
|
|
308
308
|
},
|
|
@@ -322,8 +322,8 @@ export class DuetFooter {
|
|
|
322
322
|
"optional": false,
|
|
323
323
|
"docs": {
|
|
324
324
|
"tags": [{
|
|
325
|
-
"
|
|
326
|
-
"
|
|
325
|
+
"name": "default",
|
|
326
|
+
"text": "{fi: \"Avautuu uuteen ikkunaan\",sv: \"\u00D6ppnas i nytt f\u00F6nster\",en: \"Opens in a new window\"}"
|
|
327
327
|
}],
|
|
328
328
|
"text": "Adds accessible label for tooltip that is shown in external link (url & external have both been set)"
|
|
329
329
|
},
|
|
@@ -361,8 +361,8 @@ export class DuetFooter {
|
|
|
361
361
|
"composed": true,
|
|
362
362
|
"docs": {
|
|
363
363
|
"tags": [{
|
|
364
|
-
"
|
|
365
|
-
"
|
|
364
|
+
"name": "deprecated",
|
|
365
|
+
"text": "in favour of the more specific events like duetLogoClick.\nCallback for when a user is about to navigate to another page. You can prevent\nthe default browser functionality by calling **event.detail.originalEvent.preventDefault()**\ninside your listener. Additionally, the passed data is available via\n**event.detail.data**."
|
|
366
366
|
}],
|
|
367
367
|
"text": ""
|
|
368
368
|
},
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built with Duet Design System
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { media_query_large, media_query_medium, media_query_small } from "@duetds/tokens/lib/tokens.json";
|
|
5
|
+
import { Component, Element, h, Host, Prop, State, Watch } from "@stencil/core";
|
|
6
|
+
import { watchForElement, watchForOptions } from "../../utils/watch-options";
|
|
6
7
|
function isGridItem(element) {
|
|
7
8
|
return element.tagName.toLowerCase() === "duet-grid-item";
|
|
8
9
|
}
|
|
9
10
|
export class DuetGrid {
|
|
10
11
|
constructor() {
|
|
12
|
+
this.mql = [
|
|
13
|
+
window.matchMedia(media_query_large.replace(/'/g, "")),
|
|
14
|
+
window.matchMedia(media_query_medium.replace(/'/g, "")),
|
|
15
|
+
window.matchMedia(media_query_small.replace(/'/g, "")),
|
|
16
|
+
];
|
|
17
|
+
this.distributeFormElement = false;
|
|
11
18
|
/**
|
|
12
19
|
* Enable or disable the automatic responsive behaviour of the grid component.
|
|
13
20
|
* Setting this option to "true" makes sure that contents are stacked vertically
|
|
@@ -24,7 +31,9 @@ export class DuetGrid {
|
|
|
24
31
|
*/
|
|
25
32
|
this.direction = "horizontal";
|
|
26
33
|
/**
|
|
27
|
-
* Adjusts the vertical alignment of the grid items
|
|
34
|
+
* Adjusts the vertical alignment of the grid items, if set to "form_distribute"
|
|
35
|
+
* the grid will try to calculate correct paddings for any duet-input fields inside duet-grid-items,
|
|
36
|
+
* so that they align even when displaying errors.
|
|
28
37
|
*/
|
|
29
38
|
this.alignment = "top";
|
|
30
39
|
/**
|
|
@@ -36,14 +45,39 @@ export class DuetGrid {
|
|
|
36
45
|
*/
|
|
37
46
|
this.mobile = "";
|
|
38
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Private functions
|
|
50
|
+
*/
|
|
51
|
+
/**
|
|
52
|
+
* Returns the element height including margins
|
|
53
|
+
* @param element - element
|
|
54
|
+
* @returns {number}
|
|
55
|
+
*/
|
|
56
|
+
outerHeight(element) {
|
|
57
|
+
const height = element.offsetHeight, style = window.getComputedStyle(element);
|
|
58
|
+
return ["top", "bottom"]
|
|
59
|
+
.map(side => parseInt(style[`margin-${side}`]))
|
|
60
|
+
.reduce((total, side) => total + side, height);
|
|
61
|
+
}
|
|
39
62
|
/**
|
|
40
63
|
* Component lifecycle events.
|
|
41
64
|
*/
|
|
42
65
|
async connectedCallback() {
|
|
43
66
|
const el = this.element;
|
|
67
|
+
this.distributeFormElement = this.alignment === "form_distribute";
|
|
44
68
|
this.mutationO = watchForOptions(el, "duet-grid-item", () => {
|
|
45
69
|
this.updateGridItems();
|
|
46
70
|
});
|
|
71
|
+
// the next two functions are used to watch for changes in the grid items, and are process intensive - so only run when needed
|
|
72
|
+
if (this.distributeFormElement) {
|
|
73
|
+
this.mutation1 = watchForElement(el, "duet-input", () => {
|
|
74
|
+
this.updateGridItemsWithInputFields();
|
|
75
|
+
});
|
|
76
|
+
// listen for potential mediaquery changes and reset layout
|
|
77
|
+
for (let i = 0; i < this.mql.length; i++) {
|
|
78
|
+
this.mql[i].addEventListener("change", this.updateGridItemsWithInputFields.bind(this));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
47
81
|
this.updateGridItems();
|
|
48
82
|
}
|
|
49
83
|
disconnectedCallback() {
|
|
@@ -51,6 +85,14 @@ export class DuetGrid {
|
|
|
51
85
|
this.mutationO.disconnect();
|
|
52
86
|
this.mutationO = undefined;
|
|
53
87
|
}
|
|
88
|
+
if (this.mutation1) {
|
|
89
|
+
this.mutation1.disconnect();
|
|
90
|
+
this.mutation1 = undefined;
|
|
91
|
+
}
|
|
92
|
+
// listen for potential mediaquery changes and reset layout
|
|
93
|
+
for (let i = 0; i < this.mql.length; i++) {
|
|
94
|
+
this.mql[i].removeEventListener("change", this.updateGridItemsWithInputFields.bind(this));
|
|
95
|
+
}
|
|
54
96
|
}
|
|
55
97
|
/**
|
|
56
98
|
* Local methods
|
|
@@ -62,6 +104,29 @@ export class DuetGrid {
|
|
|
62
104
|
item.breakpoint = this.breakpoint;
|
|
63
105
|
});
|
|
64
106
|
}
|
|
107
|
+
async updateGridItemsWithInputFields() {
|
|
108
|
+
const items = Array.from(this.element.children).filter(isGridItem);
|
|
109
|
+
// if layout changes to columns instead of row, remove all padding
|
|
110
|
+
const hasColumnLayout = window ? window.getComputedStyle(this.element).flexDirection === "column" : false;
|
|
111
|
+
let maxHeight = 0;
|
|
112
|
+
const sizes = [];
|
|
113
|
+
items.forEach(item => {
|
|
114
|
+
const inputErrorDom = item.querySelector("span.duet-input-error");
|
|
115
|
+
const height = inputErrorDom ? this.outerHeight(inputErrorDom) : 0;
|
|
116
|
+
sizes.push(height);
|
|
117
|
+
});
|
|
118
|
+
maxHeight = Math.max(...sizes);
|
|
119
|
+
items.forEach(item => {
|
|
120
|
+
const inputErrorDom = item.querySelector("span.duet-input-error");
|
|
121
|
+
const height = inputErrorDom ? this.outerHeight(inputErrorDom) : 0;
|
|
122
|
+
if (height < maxHeight && !hasColumnLayout) {
|
|
123
|
+
item.setAttribute("style", `padding-bottom: ${maxHeight - height}px;`);
|
|
124
|
+
}
|
|
125
|
+
else if (height === maxHeight || hasColumnLayout) {
|
|
126
|
+
item.setAttribute("style", `padding-bottom: 0px;`);
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
}
|
|
65
130
|
/**
|
|
66
131
|
* render() function
|
|
67
132
|
* Always the last one in the class.
|
|
@@ -71,7 +136,7 @@ export class DuetGrid {
|
|
|
71
136
|
"duet-grid": true,
|
|
72
137
|
"duet-no-stacking": !this.responsive,
|
|
73
138
|
"duet-grid-align-top": this.alignment === "top",
|
|
74
|
-
"duet-grid-align-bottom": this.alignment === "bottom",
|
|
139
|
+
"duet-grid-align-bottom": this.alignment === "bottom" || this.alignment === "form_distribute",
|
|
75
140
|
"duet-grid-align-center": this.alignment === "center",
|
|
76
141
|
"duet-grid-align-stretch": this.alignment === "stretch",
|
|
77
142
|
"duet-grid-align-baseline": this.alignment === "baseline",
|
|
@@ -169,7 +234,7 @@ export class DuetGrid {
|
|
|
169
234
|
"mutable": false,
|
|
170
235
|
"complexType": {
|
|
171
236
|
"original": "DuetGridAlignment",
|
|
172
|
-
"resolved": "\"baseline\" | \"bottom\" | \"center\" | \"stretch\" | \"top\"",
|
|
237
|
+
"resolved": "\"baseline\" | \"bottom\" | \"center\" | \"form_distribute\" | \"stretch\" | \"top\"",
|
|
173
238
|
"references": {
|
|
174
239
|
"DuetGridAlignment": {
|
|
175
240
|
"location": "local"
|
|
@@ -180,7 +245,7 @@ export class DuetGrid {
|
|
|
180
245
|
"optional": false,
|
|
181
246
|
"docs": {
|
|
182
247
|
"tags": [],
|
|
183
|
-
"text": "Adjusts the vertical alignment of the grid items."
|
|
248
|
+
"text": "Adjusts the vertical alignment of the grid items, if set to \"form_distribute\"\nthe grid will try to calculate correct paddings for any duet-input fields inside duet-grid-items,\nso that they align even when displaying errors."
|
|
184
249
|
},
|
|
185
250
|
"attribute": "alignment",
|
|
186
251
|
"reflect": false,
|
|
@@ -231,6 +296,9 @@ export class DuetGrid {
|
|
|
231
296
|
"defaultValue": "\"\""
|
|
232
297
|
}
|
|
233
298
|
}; }
|
|
299
|
+
static get states() { return {
|
|
300
|
+
"distributeFormElement": {}
|
|
301
|
+
}; }
|
|
234
302
|
static get elementRef() { return "element"; }
|
|
235
303
|
static get watchers() { return [{
|
|
236
304
|
"propName": "responsive",
|
|
@@ -173,8 +173,8 @@ export class DuetGridItem {
|
|
|
173
173
|
"optional": false,
|
|
174
174
|
"docs": {
|
|
175
175
|
"tags": [{
|
|
176
|
-
"
|
|
177
|
-
"
|
|
176
|
+
"name": "internal",
|
|
177
|
+
"text": "Enable or disable the automatic responsive behaviour of the grid item.\nThis property is used internally by Grid, and should not be set by the developer."
|
|
178
178
|
}],
|
|
179
179
|
"text": ""
|
|
180
180
|
},
|
|
@@ -199,8 +199,8 @@ export class DuetGridItem {
|
|
|
199
199
|
"optional": false,
|
|
200
200
|
"docs": {
|
|
201
201
|
"tags": [{
|
|
202
|
-
"
|
|
203
|
-
"
|
|
202
|
+
"name": "internal",
|
|
203
|
+
"text": "Switch the breakpoint used to trigger the content stacking.\nThis property is used internally by Grid, and should not be set by the developer."
|
|
204
204
|
}],
|
|
205
205
|
"text": ""
|
|
206
206
|
},
|
|
@@ -513,11 +513,11 @@ export class DuetHeader {
|
|
|
513
513
|
"optional": false,
|
|
514
514
|
"docs": {
|
|
515
515
|
"tags": [{
|
|
516
|
-
"
|
|
517
|
-
"
|
|
516
|
+
"name": "deprecated",
|
|
517
|
+
"text": "this is now handled via the html lang tag, and is no longer used - kept to avoid breaking changes and ease unit testing"
|
|
518
518
|
}, {
|
|
519
|
-
"
|
|
520
|
-
"
|
|
519
|
+
"name": "default",
|
|
520
|
+
"text": "\"fi\""
|
|
521
521
|
}],
|
|
522
522
|
"text": "The currently active language. This setting also changes the logo to match\nthe chosen language."
|
|
523
523
|
},
|
|
@@ -548,8 +548,8 @@ export class DuetHeader {
|
|
|
548
548
|
"optional": false,
|
|
549
549
|
"docs": {
|
|
550
550
|
"tags": [{
|
|
551
|
-
"
|
|
552
|
-
"
|
|
551
|
+
"name": "default",
|
|
552
|
+
"text": "{\nfi: {\nskipLabel: \"Siirry p\u00E4\u00E4sis\u00E4lt\u00F6\u00F6n\",\nchangeLanguage: \"Vaihda kielt\u00E4\",\nactiveLanguage: \"Suomi valittuna\",\n},\nsv: {\nskipLabel: \"Hoppa till huvudinneh\u00E5ll\",\nchangeLanguage: \"\u00C4ndra Spr\u00E5k\",\nactiveLanguage: \"Svenska valt\",\n},\nen: {\nskipLabel: \"Skip to main content\",\nchangeLanguage: \"Change language\",\nactiveLanguage: \"English selected\",\n},\n}"
|
|
553
553
|
}],
|
|
554
554
|
"text": "Default strings for accessibleI18nLabels"
|
|
555
555
|
},
|
|
@@ -573,8 +573,8 @@ export class DuetHeader {
|
|
|
573
573
|
"optional": false,
|
|
574
574
|
"docs": {
|
|
575
575
|
"tags": [{
|
|
576
|
-
"
|
|
577
|
-
"
|
|
576
|
+
"name": "default",
|
|
577
|
+
"text": "{\nfi: {\nskipLabel: \"Siirry p\u00E4\u00E4sis\u00E4lt\u00F6\u00F6n\",\nchangeLanguage: \"Vaihda kielt\u00E4\",\nactiveLanguage: \"Suomi valittuna\",\n},\nsv: {\nskipLabel: \"Hoppa till huvudinneh\u00E5ll\",\nchangeLanguage: \"\u00C4ndra Spr\u00E5k\",\nactiveLanguage: \"Svenska valt\",\n},\nen: {\nskipLabel: \"Skip to main content\",\nchangeLanguage: \"Change language\",\nactiveLanguage: \"English selected\",\n},\n}"
|
|
578
578
|
}],
|
|
579
579
|
"text": "Adds i18n translations of all internally used textStrings"
|
|
580
580
|
},
|
|
@@ -597,8 +597,8 @@ export class DuetHeader {
|
|
|
597
597
|
"optional": false,
|
|
598
598
|
"docs": {
|
|
599
599
|
"tags": [{
|
|
600
|
-
"
|
|
601
|
-
"
|
|
600
|
+
"name": "default",
|
|
601
|
+
"text": "{fi: \"Avautuu uuteen ikkunaan\",sv: \"\u00D6ppnas i nytt f\u00F6nster\",en: \"Opens in a new window\"}"
|
|
602
602
|
}],
|
|
603
603
|
"text": "Property to change accessibleLabelExternal defaults on the component.\nnormally you would handle these strings on an application level and override @accessibleLabelExternal when needed"
|
|
604
604
|
},
|
|
@@ -618,8 +618,8 @@ export class DuetHeader {
|
|
|
618
618
|
"optional": false,
|
|
619
619
|
"docs": {
|
|
620
620
|
"tags": [{
|
|
621
|
-
"
|
|
622
|
-
"
|
|
621
|
+
"name": "default",
|
|
622
|
+
"text": "{fi: \"Avautuu uuteen ikkunaan\",sv: \"\u00D6ppnas i nytt f\u00F6nster\",en: \"Opens in a new window\"}"
|
|
623
623
|
}],
|
|
624
624
|
"text": "Adds accessible label for tooltip that is shown in external link (url & external have both been set)"
|
|
625
625
|
},
|
|
@@ -662,8 +662,8 @@ export class DuetHeader {
|
|
|
662
662
|
"optional": false,
|
|
663
663
|
"docs": {
|
|
664
664
|
"tags": [{
|
|
665
|
-
"
|
|
666
|
-
"
|
|
665
|
+
"name": "default",
|
|
666
|
+
"text": "{\nfi: \"Valikko\",\nsv: \"Meny\",\nen: \"Menu\",\n}"
|
|
667
667
|
}],
|
|
668
668
|
"text": "Accessible label that is shown for screen reader users in the mobile\nnavigation toggle. Not visible for normal users."
|
|
669
669
|
},
|
|
@@ -883,8 +883,8 @@ export class DuetHeader {
|
|
|
883
883
|
"composed": true,
|
|
884
884
|
"docs": {
|
|
885
885
|
"tags": [{
|
|
886
|
-
"
|
|
887
|
-
"
|
|
886
|
+
"name": "deprecated",
|
|
887
|
+
"text": "in favour of more specific events like duetLogoClick.\nCallback for when a user is about to navigate to another page. You can prevent the\ndefault browser functionality by calling **event.detail.originalEvent.preventDefault()**\ninside your listener. Additionally, the passed data is available via **event.detail.data**."
|
|
888
888
|
}],
|
|
889
889
|
"text": ""
|
|
890
890
|
},
|