@duetds/components 4.30.1 → 4.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/hydrate/index.js +230 -1038
- package/lib/cjs/duet-alert.cjs.entry.js +4 -2
- package/lib/cjs/duet-badge.cjs.entry.js +2 -2
- package/lib/cjs/duet-button_2.cjs.entry.js +4 -3
- package/lib/cjs/duet-caption_4.cjs.entry.js +7 -8
- package/lib/cjs/duet-card.cjs.entry.js +4 -4
- package/lib/cjs/duet-checkbox.cjs.entry.js +1 -1
- package/lib/cjs/duet-choice_2.cjs.entry.js +4 -3
- package/lib/cjs/duet-collapsible.cjs.entry.js +2 -2
- package/lib/cjs/duet-cookie-consent.cjs.entry.js +1 -1
- package/lib/cjs/duet-date-picker.cjs.entry.js +22 -12
- package/lib/cjs/duet-divider_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-empty-state.cjs.entry.js +1 -1
- package/lib/cjs/duet-fieldset.cjs.entry.js +1 -1
- package/lib/cjs/duet-footer.cjs.entry.js +4 -4
- package/lib/cjs/duet-grid_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-header_2.cjs.entry.js +25 -9
- package/lib/cjs/duet-hero.cjs.entry.js +6 -6
- package/lib/cjs/duet-icon.cjs.entry.js +3 -3
- package/lib/cjs/duet-input_2.cjs.entry.js +2 -2
- package/lib/cjs/duet-layout.cjs.entry.js +1 -1
- package/lib/cjs/duet-list_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-modal.cjs.entry.js +8 -7
- package/lib/cjs/duet-notification_2.cjs.entry.js +6 -5
- package/lib/cjs/duet-number-input.cjs.entry.js +36 -15
- package/lib/cjs/duet-radio_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-range-slider.cjs.entry.js +1 -1
- package/lib/cjs/duet-select.cjs.entry.js +2 -2
- package/lib/cjs/duet-step_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-tab_2.cjs.entry.js +11 -5
- package/lib/cjs/duet-table.cjs.entry.js +1 -1
- package/lib/cjs/duet-textarea.cjs.entry.js +1 -1
- package/lib/cjs/duet-toggle.cjs.entry.js +1 -1
- package/lib/cjs/duet-tooltip.cjs.entry.js +21 -10
- package/lib/cjs/duet-tray.cjs.entry.js +20 -9
- package/lib/cjs/duet-visually-hidden.cjs.entry.js +1 -1
- package/lib/cjs/duet.cjs.js +2 -2
- package/lib/cjs/{focus-utils-7605778f.js → focus-utils-bd331feb.js} +1 -1
- package/lib/cjs/{index-0c949193.js → index-113c2add.js} +0 -3
- package/lib/cjs/{language-utils-70d6a9a4.js → language-utils-48b8860b.js} +23 -8
- package/lib/cjs/loader.cjs.js +2 -2
- package/lib/cjs/{string-utils-a6de43d8.js → string-utils-267e3dbb.js} +7 -0
- package/lib/collection/collection-manifest.json +0 -6
- package/lib/collection/components/duet-alert/duet-alert.js +10 -4
- package/lib/collection/components/duet-badge/duet-badge.css +1 -0
- package/lib/collection/components/duet-button/duet-button.js +7 -5
- package/lib/collection/components/duet-card/duet-card.css +10 -7
- package/lib/collection/components/duet-card/duet-card.js +3 -5
- package/lib/collection/components/duet-choice/duet-choice.js +5 -3
- package/lib/collection/components/duet-choice-group/duet-choice-group.css +1 -0
- package/lib/collection/components/duet-date-picker/duet-date-picker.css +1 -1
- package/lib/collection/components/duet-date-picker/duet-date-picker.js +73 -38
- package/lib/collection/components/duet-footer/duet-footer.js +7 -5
- package/lib/collection/components/duet-header/duet-header.js +46 -21
- package/lib/collection/components/duet-heading/duet-heading.css +1 -0
- package/lib/collection/components/duet-hero/duet-hero.js +14 -9
- package/lib/collection/components/duet-icon/icon-utils.js +1 -1
- package/lib/collection/components/duet-label/duet-label.css +2 -0
- package/lib/collection/components/duet-link/duet-link.js +10 -11
- package/lib/collection/components/duet-modal/duet-modal.js +16 -11
- package/lib/collection/components/duet-notification-drawer/duet-notification-drawer.js +14 -9
- package/lib/collection/components/duet-number-input/duet-number-input.js +141 -17
- package/lib/collection/components/duet-tab-group/duet-tab-group.js +35 -4
- package/lib/collection/components/duet-tooltip/duet-tooltip.js +72 -10
- package/lib/collection/components/duet-tray/duet-tray.js +71 -9
- package/lib/collection/utils/fixture-utils.js +7 -5
- package/lib/collection/utils/language-utils.js +22 -8
- package/lib/collection/utils/string-utils.js +6 -0
- package/lib/custom-elements-bundle/index.d.ts +0 -6
- package/lib/custom-elements-bundle/index.js +224 -995
- package/lib/duet/duet.esm.js +1 -1
- package/lib/duet/duet.js +1 -1
- package/lib/duet/p-0058512b.js +4 -0
- package/lib/duet/p-0224db45.entry.js +4 -0
- package/lib/duet/{p-345ea4f2.system.entry.js → p-02ad46a0.system.entry.js} +1 -1
- package/lib/duet/{p-62806bb6.system.entry.js → p-07263910.system.entry.js} +1 -1
- package/lib/duet/{p-f82709ba.entry.js → p-1bfbc988.entry.js} +1 -1
- package/lib/duet/p-1cd7177f.entry.js +4 -0
- package/lib/duet/p-1cec5a70.system.entry.js +4 -0
- package/lib/duet/p-1e7222c2.entry.js +4 -0
- package/lib/duet/{p-c0b95b58.entry.js → p-202bbd70.entry.js} +1 -1
- package/lib/duet/{p-d1817efe.system.entry.js → p-22f56356.system.entry.js} +1 -1
- package/lib/duet/{p-f81d8534.entry.js → p-28b67b94.entry.js} +1 -1
- package/lib/duet/{p-b4374f0e.entry.js → p-33426ddc.entry.js} +1 -1
- package/lib/duet/p-33cf6ed1.entry.js +4 -0
- package/lib/duet/p-3d3f773d.system.entry.js +4 -0
- package/lib/duet/p-3e1ef509.system.entry.js +4 -0
- package/lib/duet/p-3f78a826.system.js +4 -0
- package/lib/duet/{p-2a1a9f9f.entry.js → p-44ffb960.entry.js} +1 -1
- package/lib/duet/{p-dee41056.system.entry.js → p-453955cc.system.entry.js} +1 -1
- package/lib/duet/{p-66dde4d2.entry.js → p-4670a654.entry.js} +1 -1
- package/lib/duet/p-47645ea8.system.entry.js +4 -0
- package/lib/duet/p-504dbf8f.system.entry.js +4 -0
- package/lib/duet/{p-62c294d6.system.entry.js → p-5230ee3c.system.entry.js} +1 -1
- package/lib/duet/{p-bbc229d8.system.entry.js → p-56e172f5.system.entry.js} +1 -1
- package/lib/duet/{p-de2be65b.system.js → p-57ea2576.system.js} +1 -1
- package/lib/duet/p-5aa0d34d.entry.js +4 -0
- package/lib/duet/p-5fc7e1f7.system.entry.js +4 -0
- package/lib/duet/{p-3dc9d15d.system.entry.js → p-605bc214.system.entry.js} +1 -1
- package/lib/duet/{p-4a7911fd.entry.js → p-60ab57d4.entry.js} +1 -1
- package/lib/duet/p-64109493.entry.js +4 -0
- package/lib/duet/{p-7e108b7e.entry.js → p-69a5dc6b.entry.js} +1 -1
- package/lib/duet/{p-8cfce39e.system.entry.js → p-6a230911.system.entry.js} +1 -1
- package/lib/duet/p-6a760b8a.entry.js +4 -0
- package/lib/duet/{p-c9303f9a.entry.js → p-6d2da245.entry.js} +1 -1
- package/lib/duet/{p-ceb75b35.system.entry.js → p-712e7dde.system.entry.js} +1 -1
- package/lib/duet/{p-f71f12ed.entry.js → p-746655ba.entry.js} +1 -1
- package/lib/duet/p-7b6db837.system.entry.js +4 -0
- package/lib/duet/p-7d080785.system.entry.js +4 -0
- package/lib/duet/{p-4095dba5.entry.js → p-82dc2e0b.entry.js} +1 -1
- package/lib/duet/p-8c8e82aa.system.js +4 -0
- package/lib/duet/{p-fc397e03.system.entry.js → p-8c980350.system.entry.js} +1 -1
- package/lib/duet/{p-1cfe38b1.system.entry.js → p-8cb47a70.system.entry.js} +1 -1
- package/lib/duet/{p-7ee52f58.entry.js → p-8f03c3eb.entry.js} +1 -1
- package/lib/duet/p-91fa68a5.js +4 -0
- package/lib/duet/{p-e26116e0.system.entry.js → p-92d38668.system.entry.js} +1 -1
- package/lib/duet/p-95626e7e.system.entry.js +4 -0
- package/lib/duet/p-96808a2e.system.entry.js +4 -0
- package/lib/duet/{p-8ffe1461.system.entry.js → p-96c103b2.system.entry.js} +1 -1
- package/lib/duet/p-986779fb.js +4 -0
- package/lib/duet/{p-35e45c19.system.js → p-9a945278.system.js} +1 -1
- package/lib/duet/{p-2d2c45f9.entry.js → p-9c94be45.entry.js} +1 -1
- package/lib/duet/p-9ce1baab.system.entry.js +4 -0
- package/lib/duet/p-9ff25646.entry.js +4 -0
- package/lib/duet/p-a1d12e94.system.entry.js +4 -0
- package/lib/duet/p-b03a46b6.entry.js +4 -0
- package/lib/duet/{p-a88df408.entry.js → p-b1b8e510.entry.js} +1 -1
- package/lib/duet/p-b694cbf5.system.js +4 -0
- package/lib/duet/p-b7e50cfa.entry.js +4 -0
- package/lib/duet/p-b82927b0.system.entry.js +4 -0
- package/lib/duet/{p-c3688975.entry.js → p-ba205dca.entry.js} +1 -1
- package/lib/duet/{p-f71e337e.system.entry.js → p-bcae23fc.system.entry.js} +1 -1
- package/lib/duet/{p-5c5bdb06.system.entry.js → p-be19c57b.system.entry.js} +1 -1
- package/lib/duet/{p-a321a98c.entry.js → p-c4737f88.entry.js} +1 -1
- package/lib/duet/p-c5beceed.js +4 -0
- package/lib/duet/{p-27d538f7.system.entry.js → p-c5f10483.system.entry.js} +1 -1
- package/lib/duet/{p-a6096b05.system.entry.js → p-d35fd913.system.entry.js} +1 -1
- package/lib/duet/p-d4b4bfa6.entry.js +4 -0
- package/lib/duet/p-d7623eb8.system.entry.js +4 -0
- package/lib/duet/{p-36007600.entry.js → p-dc85d2a4.entry.js} +1 -1
- package/lib/duet/p-de093c16.entry.js +4 -0
- package/lib/duet/p-de842863.entry.js +4 -0
- package/lib/duet/{p-59a07cf9.entry.js → p-e08b8909.entry.js} +1 -1
- package/lib/duet/p-e39471b6.entry.js +4 -0
- package/lib/duet/p-e834c8d5.system.entry.js +4 -0
- package/lib/duet/{p-ce1374a4.system.entry.js → p-ef45cfe9.system.entry.js} +1 -1
- package/lib/duet/{p-031c2cd8.system.entry.js → p-f0b1850a.system.entry.js} +1 -1
- package/lib/duet/p-f53c8019.entry.js +4 -0
- package/lib/duet/{p-4265de16.system.entry.js → p-f96c4093.system.entry.js} +1 -1
- package/lib/duet/p-fbd83d67.entry.js +4 -0
- package/lib/duet/{p-1c41525a.entry.js → p-fdecaf46.entry.js} +1 -1
- package/lib/esm/duet-alert.entry.js +4 -2
- package/lib/esm/duet-badge.entry.js +2 -2
- package/lib/esm/duet-button_2.entry.js +4 -3
- package/lib/esm/duet-caption_4.entry.js +7 -8
- package/lib/esm/duet-card.entry.js +4 -4
- package/lib/esm/duet-checkbox.entry.js +1 -1
- package/lib/esm/duet-choice_2.entry.js +4 -3
- package/lib/esm/duet-collapsible.entry.js +2 -2
- package/lib/esm/duet-cookie-consent.entry.js +1 -1
- package/lib/esm/duet-date-picker.entry.js +22 -12
- package/lib/esm/duet-divider_2.entry.js +1 -1
- package/lib/esm/duet-empty-state.entry.js +1 -1
- package/lib/esm/duet-fieldset.entry.js +1 -1
- package/lib/esm/duet-footer.entry.js +4 -4
- package/lib/esm/duet-grid_2.entry.js +1 -1
- package/lib/esm/duet-header_2.entry.js +25 -9
- package/lib/esm/duet-hero.entry.js +6 -6
- package/lib/esm/duet-icon.entry.js +3 -3
- package/lib/esm/duet-input_2.entry.js +2 -2
- package/lib/esm/duet-layout.entry.js +1 -1
- package/lib/esm/duet-list_2.entry.js +1 -1
- package/lib/esm/duet-modal.entry.js +8 -7
- package/lib/esm/duet-notification_2.entry.js +6 -5
- package/lib/esm/duet-number-input.entry.js +36 -15
- package/lib/esm/duet-radio_2.entry.js +1 -1
- package/lib/esm/duet-range-slider.entry.js +1 -1
- package/lib/esm/duet-select.entry.js +2 -2
- package/lib/esm/duet-step_2.entry.js +1 -1
- package/lib/esm/duet-tab_2.entry.js +11 -5
- package/lib/esm/duet-table.entry.js +1 -1
- package/lib/esm/duet-textarea.entry.js +1 -1
- package/lib/esm/duet-toggle.entry.js +1 -1
- package/lib/esm/duet-tooltip.entry.js +21 -10
- package/lib/esm/duet-tray.entry.js +20 -9
- package/lib/esm/duet-visually-hidden.entry.js +1 -1
- package/lib/esm/duet.js +2 -2
- package/lib/esm/{focus-utils-0b12f0df.js → focus-utils-1995e5a9.js} +1 -1
- package/lib/esm/{index-f70ddc7f.js → index-6e246691.js} +0 -3
- package/lib/esm/{language-utils-ab9c3afc.js → language-utils-d5c38f65.js} +23 -8
- package/lib/esm/loader.js +2 -2
- package/lib/esm/{string-utils-69cf0d09.js → string-utils-2f1793b8.js} +7 -1
- package/lib/esm-es5/duet-alert.entry.js +1 -1
- package/lib/esm-es5/duet-badge.entry.js +1 -1
- package/lib/esm-es5/duet-button_2.entry.js +1 -1
- package/lib/esm-es5/duet-caption_4.entry.js +1 -1
- package/lib/esm-es5/duet-card.entry.js +1 -1
- package/lib/esm-es5/duet-checkbox.entry.js +1 -1
- package/lib/esm-es5/duet-choice_2.entry.js +1 -1
- package/lib/esm-es5/duet-collapsible.entry.js +1 -1
- package/lib/esm-es5/duet-cookie-consent.entry.js +1 -1
- package/lib/esm-es5/duet-date-picker.entry.js +1 -1
- package/lib/esm-es5/duet-divider_2.entry.js +1 -1
- package/lib/esm-es5/duet-empty-state.entry.js +1 -1
- package/lib/esm-es5/duet-fieldset.entry.js +1 -1
- package/lib/esm-es5/duet-footer.entry.js +1 -1
- package/lib/esm-es5/duet-grid_2.entry.js +1 -1
- package/lib/esm-es5/duet-header_2.entry.js +1 -1
- package/lib/esm-es5/duet-hero.entry.js +1 -1
- package/lib/esm-es5/duet-icon.entry.js +1 -1
- package/lib/esm-es5/duet-input_2.entry.js +1 -1
- package/lib/esm-es5/duet-layout.entry.js +1 -1
- package/lib/esm-es5/duet-list_2.entry.js +1 -1
- package/lib/esm-es5/duet-modal.entry.js +1 -1
- package/lib/esm-es5/duet-notification_2.entry.js +1 -1
- package/lib/esm-es5/duet-number-input.entry.js +2 -2
- package/lib/esm-es5/duet-radio_2.entry.js +1 -1
- package/lib/esm-es5/duet-range-slider.entry.js +1 -1
- package/lib/esm-es5/duet-select.entry.js +1 -1
- package/lib/esm-es5/duet-step_2.entry.js +1 -1
- package/lib/esm-es5/duet-tab_2.entry.js +1 -1
- package/lib/esm-es5/duet-table.entry.js +1 -1
- package/lib/esm-es5/duet-textarea.entry.js +1 -1
- package/lib/esm-es5/duet-toggle.entry.js +1 -1
- package/lib/esm-es5/duet-tooltip.entry.js +1 -1
- package/lib/esm-es5/duet-tray.entry.js +1 -1
- package/lib/esm-es5/duet-visually-hidden.entry.js +1 -1
- package/lib/esm-es5/duet.js +1 -1
- package/lib/esm-es5/focus-utils-1995e5a9.js +4 -0
- package/lib/esm-es5/{index-f70ddc7f.js → index-6e246691.js} +1 -1
- package/lib/esm-es5/language-utils-d5c38f65.js +4 -0
- package/lib/esm-es5/loader.js +1 -1
- package/lib/esm-es5/{string-utils-69cf0d09.js → string-utils-2f1793b8.js} +1 -1
- package/lib/html.html-data.json +4489 -0
- package/lib/types/components/duet-alert/duet-alert.d.ts +2 -1
- package/lib/types/components/duet-button/duet-button.d.ts +1 -1
- package/lib/types/components/duet-choice/duet-choice.d.ts +1 -1
- package/lib/types/components/duet-date-picker/duet-date-picker.d.ts +13 -7
- package/lib/types/components/duet-footer/duet-footer.d.ts +1 -1
- package/lib/types/components/duet-header/duet-header.d.ts +21 -5
- package/lib/types/components/duet-hero/duet-hero.d.ts +3 -3
- package/lib/types/components/duet-link/duet-link.d.ts +2 -3
- package/lib/types/components/duet-modal/duet-modal.d.ts +3 -3
- package/lib/types/components/duet-notification-drawer/duet-notification-drawer.d.ts +3 -3
- package/lib/types/components/duet-number-input/duet-number-input.d.ts +21 -0
- package/lib/types/components/duet-tab-group/duet-tab-group.d.ts +6 -0
- package/lib/types/components/duet-tooltip/duet-tooltip.d.ts +11 -0
- package/lib/types/components/duet-tray/duet-tray.d.ts +11 -0
- package/lib/types/components.d.ts +146 -384
- package/lib/types/utils/language-utils.d.ts +3 -2
- package/lib/types/utils/string-utils.d.ts +1 -0
- package/package.json +18 -14
- package/lib/cjs/duet-upload.cjs.entry.js +0 -866
- package/lib/collection/components/duet-upload/duet-upload-file-list.js +0 -49
- package/lib/collection/components/duet-upload/duet-upload-validators.js +0 -93
- package/lib/collection/components/duet-upload/duet-upload.css +0 -133
- package/lib/collection/components/duet-upload/duet-upload.js +0 -1440
- package/lib/collection/components/duet-upload/errorcodes.utils.js +0 -20
- package/lib/collection/components/duet-upload/mock.helpers.js +0 -91
- package/lib/collection/components/duet-upload/upload.helpers.js +0 -13
- package/lib/collection/components/duet-upload/xhr.helpers.js +0 -34
- package/lib/duet/p-0733c303.system.entry.js +0 -4
- package/lib/duet/p-095060cc.js +0 -4
- package/lib/duet/p-156864a1.system.entry.js +0 -4
- package/lib/duet/p-1911dfe7.system.entry.js +0 -4
- package/lib/duet/p-2834a302.entry.js +0 -4
- package/lib/duet/p-28a3d38f.system.entry.js +0 -4
- package/lib/duet/p-2a4d7c5b.system.entry.js +0 -4
- package/lib/duet/p-4289b543.entry.js +0 -4
- package/lib/duet/p-46a3ae43.system.js +0 -4
- package/lib/duet/p-4a38cf9d.entry.js +0 -4
- package/lib/duet/p-4be8e814.entry.js +0 -4
- package/lib/duet/p-591b2137.entry.js +0 -4
- package/lib/duet/p-5f70e318.entry.js +0 -4
- package/lib/duet/p-6c2729da.js +0 -4
- package/lib/duet/p-6f107847.system.entry.js +0 -4
- package/lib/duet/p-77a5fe4c.system.js +0 -4
- package/lib/duet/p-7809e78b.system.entry.js +0 -4
- package/lib/duet/p-7a36d76f.system.entry.js +0 -4
- package/lib/duet/p-884693f1.entry.js +0 -4
- package/lib/duet/p-8977b722.entry.js +0 -4
- package/lib/duet/p-89db3b94.entry.js +0 -4
- package/lib/duet/p-9381c2d4.entry.js +0 -4
- package/lib/duet/p-9a450c9a.entry.js +0 -4
- package/lib/duet/p-9bbfe606.system.entry.js +0 -4
- package/lib/duet/p-a0a066cb.system.entry.js +0 -4
- package/lib/duet/p-a89d5d7c.entry.js +0 -4
- package/lib/duet/p-b07055fd.system.entry.js +0 -4
- package/lib/duet/p-b456d684.system.entry.js +0 -4
- package/lib/duet/p-bd18c93f.js +0 -4
- package/lib/duet/p-bddb1c15.system.entry.js +0 -4
- package/lib/duet/p-c4d183e6.entry.js +0 -4
- package/lib/duet/p-cd4e8ccf.js +0 -4
- package/lib/duet/p-cf243bcb.system.entry.js +0 -4
- package/lib/duet/p-d37c8a05.system.js +0 -4
- package/lib/duet/p-d989af11.entry.js +0 -4
- package/lib/duet/p-e6128d82.system.entry.js +0 -4
- package/lib/duet/p-e86cdc17.entry.js +0 -4
- package/lib/duet/p-eadb29c7.entry.js +0 -4
- package/lib/duet/p-f30b14d6.system.entry.js +0 -4
- package/lib/duet/p-f79f8da1.entry.js +0 -4
- package/lib/esm/duet-upload.entry.js +0 -862
- package/lib/esm-es5/duet-upload.entry.js +0 -4
- package/lib/esm-es5/focus-utils-0b12f0df.js +0 -4
- package/lib/esm-es5/language-utils-ab9c3afc.js +0 -4
- package/lib/types/components/duet-upload/duet-upload-file-list.d.ts +0 -9
- package/lib/types/components/duet-upload/duet-upload-validators.d.ts +0 -12
- package/lib/types/components/duet-upload/duet-upload.d.ts +0 -311
- package/lib/types/components/duet-upload/errorcodes.utils.d.ts +0 -7
- package/lib/types/components/duet-upload/mock.helpers.d.ts +0 -2
- package/lib/types/components/duet-upload/upload.helpers.d.ts +0 -1
- package/lib/types/components/duet-upload/xhr.helpers.d.ts +0 -12
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Duet Design System
|
|
3
|
-
*/
|
|
4
|
-
import { h } from "@stencil/core";
|
|
5
|
-
import { formatBytes } from "./upload.helpers";
|
|
6
|
-
export const DuetUploadFileList = ({ data, onDelete, onCancel, getError }) => {
|
|
7
|
-
if (data.invalid.length === 0 && data.valid.length === 0) {
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
return (h("ol", { class: "duet-upload-filelist" },
|
|
11
|
-
data.valid.length !== 0 && (h("li", null,
|
|
12
|
-
h("duet-visually-hidden", null, "Files"),
|
|
13
|
-
h("ul", null, data.valid.length !== 0 &&
|
|
14
|
-
data.valid.map(e => (h("li", { class: "duet-upload-file" },
|
|
15
|
-
h("div", { class: "duet-upload-file-container" },
|
|
16
|
-
h("div", { class: "duet-upload-file-link" }, e.url ? (h("duet-button", { variation: "plain", icon: "messaging-attachment", url: e.url },
|
|
17
|
-
e.item.name,
|
|
18
|
-
" (",
|
|
19
|
-
formatBytes(e.item.size),
|
|
20
|
-
")")) : (`${e.item.name} (${formatBytes(e.item.size)})`)),
|
|
21
|
-
h("ul", { class: "duet-upload-file-actions", role: "menubar", "aria-label": "file actions" },
|
|
22
|
-
e.progress < 100 && (h("li", { role: "none" },
|
|
23
|
-
h("duet-button", { role: "menuitem", variation: "plain", icon: "messaging-declined", "icon-only": true, "icon-size": "large", margin: "none", onClick: ev => onCancel(e.item.name, ev) }))),
|
|
24
|
-
e.progress === 100 && (h("li", { role: "none" },
|
|
25
|
-
h("duet-button", { role: "menuitem", variation: "destructive", icon: "action-delete", "icon-only": true, "icon-size": "large", margin: "none", onClick: ev => onDelete(e.item.name, ev) }))))),
|
|
26
|
-
e.progress < 100 && (h("div", { class: "duet-upload-file-progress" },
|
|
27
|
-
h("progress", { value: e.progress, max: "100" },
|
|
28
|
-
h("div", { class: "progress-bar" },
|
|
29
|
-
h("span", { style: { width: `${e.progress}%;` } },
|
|
30
|
-
"Progress: ",
|
|
31
|
-
e.progress,
|
|
32
|
-
"%"))))))))))),
|
|
33
|
-
data.invalid.length !== 0 && (h("li", null,
|
|
34
|
-
h("duet-visually-hidden", null, "Files with Errors"),
|
|
35
|
-
h("ul", null, data.invalid.map(e => {
|
|
36
|
-
return (h("li", { class: "duet-upload-file duet-upload-file-errors" },
|
|
37
|
-
h("div", { class: "duet-upload-file-container" },
|
|
38
|
-
h("div", { class: "duet-upload-file-link duet-upload-file-link-error" },
|
|
39
|
-
h("div", null,
|
|
40
|
-
e.item.name,
|
|
41
|
-
" (",
|
|
42
|
-
formatBytes(e.item.size),
|
|
43
|
-
")"),
|
|
44
|
-
h("div", { "data-error-type": e.error.type, "data-error-message": e.error.system_message }, getError(e.error.type))),
|
|
45
|
-
h("ul", { class: "duet-upload-file-actions", role: "menubar", "aria-label": "file actions" },
|
|
46
|
-
h("li", { role: "none" },
|
|
47
|
-
h("duet-button", { role: "menuitem", variation: "destructive", icon: "action-delete", "icon-only": true, "icon-size": "large", margin: "none", onClick: ev => onDelete(e.item.name, ev) }))))));
|
|
48
|
-
}))))));
|
|
49
|
-
};
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Duet Design System
|
|
3
|
-
*/
|
|
4
|
-
import { getLocaleString } from "../../utils/language-utils";
|
|
5
|
-
import { getError } from "./errorcodes.utils";
|
|
6
|
-
export const validateFileExtension = (name, allowedExtensions) => {
|
|
7
|
-
if (!allowedExtensions) {
|
|
8
|
-
return true;
|
|
9
|
-
}
|
|
10
|
-
const ext = name.split(".");
|
|
11
|
-
const validExtension = allowedExtensions.split(",");
|
|
12
|
-
const extension = ext[ext.length - 1];
|
|
13
|
-
return validExtension.includes(extension);
|
|
14
|
-
};
|
|
15
|
-
export const validateFileMime = (type, allowedMimetypes) => {
|
|
16
|
-
if (!allowedMimetypes || !type) {
|
|
17
|
-
return true;
|
|
18
|
-
}
|
|
19
|
-
const validMimeTypes = allowedMimetypes.split(",");
|
|
20
|
-
let valid = false;
|
|
21
|
-
validMimeTypes.forEach(mimeType => {
|
|
22
|
-
const allowedTypes = mimeType.split("/");
|
|
23
|
-
const fileType = type.split("/");
|
|
24
|
-
if (allowedTypes[0] === fileType[0] && (allowedTypes[1] === fileType[1] || allowedTypes[1] === "*")) {
|
|
25
|
-
valid = true;
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
return valid;
|
|
29
|
-
};
|
|
30
|
-
export const validateFileSize = (size, maxBytes) => {
|
|
31
|
-
if (!maxBytes || !size) {
|
|
32
|
-
return true;
|
|
33
|
-
}
|
|
34
|
-
return maxBytes >= size;
|
|
35
|
-
};
|
|
36
|
-
export const validateFile = (item, validators) => {
|
|
37
|
-
const { allowedMimetypes, allowedExtensions, maxBytes } = validators;
|
|
38
|
-
let valid = false;
|
|
39
|
-
let errorMessage = getError("default");
|
|
40
|
-
if (item) {
|
|
41
|
-
const { name, type, size } = item;
|
|
42
|
-
const mime = validateFileMime(type, allowedMimetypes);
|
|
43
|
-
const ext = validateFileExtension(name, allowedExtensions);
|
|
44
|
-
const bytes = validateFileSize(size, maxBytes);
|
|
45
|
-
if (!mime) {
|
|
46
|
-
errorMessage = getError("duet-upload-101");
|
|
47
|
-
}
|
|
48
|
-
if (!ext) {
|
|
49
|
-
errorMessage = getError("duet-upload-100");
|
|
50
|
-
}
|
|
51
|
-
if (!bytes) {
|
|
52
|
-
errorMessage = getError("duet-upload-201");
|
|
53
|
-
}
|
|
54
|
-
valid = mime && ext && bytes;
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
valid = false;
|
|
58
|
-
}
|
|
59
|
-
return {
|
|
60
|
-
valid,
|
|
61
|
-
errorMessage: valid ? undefined : getLocaleString(errorMessage.message),
|
|
62
|
-
errorSystem: valid ? undefined : errorMessage.system_message,
|
|
63
|
-
errorType: valid ? undefined : errorMessage.type,
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
export const validateTotalSizeIsAboveMax = (filelist, maxTotalBytes) => {
|
|
67
|
-
let total = 0;
|
|
68
|
-
if (maxTotalBytes) {
|
|
69
|
-
filelist.forEach(item => {
|
|
70
|
-
if (item.valid && item.size) {
|
|
71
|
-
total += item.size;
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
if (total < maxTotalBytes) {
|
|
75
|
-
return true;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
return false;
|
|
79
|
-
};
|
|
80
|
-
export const validateTotalAmountIsAboveMax = (filelist, maxFiles) => {
|
|
81
|
-
let total = 0;
|
|
82
|
-
if (maxFiles) {
|
|
83
|
-
filelist.forEach(item => {
|
|
84
|
-
if (item.valid) {
|
|
85
|
-
total++;
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
if (total > maxFiles) {
|
|
89
|
-
return true;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
return false;
|
|
93
|
-
};
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
*,
|
|
2
|
-
*::after,
|
|
3
|
-
*::before {
|
|
4
|
-
box-sizing: border-box;
|
|
5
|
-
padding: 0;
|
|
6
|
-
margin: 0;
|
|
7
|
-
background: transparent;
|
|
8
|
-
border: 0;
|
|
9
|
-
-moz-appearance: none;
|
|
10
|
-
-webkit-appearance: none;
|
|
11
|
-
appearance: none;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
:host {
|
|
15
|
-
box-sizing: border-box;
|
|
16
|
-
padding: 0;
|
|
17
|
-
margin: 0;
|
|
18
|
-
background: transparent;
|
|
19
|
-
border: 0;
|
|
20
|
-
-moz-appearance: none;
|
|
21
|
-
-webkit-appearance: none;
|
|
22
|
-
appearance: none;
|
|
23
|
-
}
|
|
24
|
-
:host li {
|
|
25
|
-
list-style: none;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.duet-upload {
|
|
29
|
-
box-sizing: border-box;
|
|
30
|
-
padding: 0;
|
|
31
|
-
margin: 0;
|
|
32
|
-
background: transparent;
|
|
33
|
-
border: 0;
|
|
34
|
-
-moz-appearance: none;
|
|
35
|
-
-webkit-appearance: none;
|
|
36
|
-
appearance: none;
|
|
37
|
-
}
|
|
38
|
-
.duet-upload li {
|
|
39
|
-
list-style: none;
|
|
40
|
-
}
|
|
41
|
-
.duet-upload-file-errors {
|
|
42
|
-
padding: 20px 0;
|
|
43
|
-
color: #de2362;
|
|
44
|
-
}
|
|
45
|
-
.duet-upload-filelist {
|
|
46
|
-
margin-bottom: 25px;
|
|
47
|
-
}
|
|
48
|
-
.duet-upload-filelist-empty {
|
|
49
|
-
display: flex;
|
|
50
|
-
align-items: center;
|
|
51
|
-
justify-content: center;
|
|
52
|
-
width: 100%;
|
|
53
|
-
height: 75px;
|
|
54
|
-
margin: 0 auto;
|
|
55
|
-
background-color: #f3f9fc;
|
|
56
|
-
}
|
|
57
|
-
.duet-upload-file {
|
|
58
|
-
display: flex;
|
|
59
|
-
flex-flow: column;
|
|
60
|
-
justify-content: center;
|
|
61
|
-
min-height: 50px;
|
|
62
|
-
border-bottom: 1px solid #e1e3e6;
|
|
63
|
-
}
|
|
64
|
-
.duet-upload-file:first-of-type:not(.duet-upload-file-errors) {
|
|
65
|
-
border-top: 1px solid #e1e3e6;
|
|
66
|
-
}
|
|
67
|
-
.duet-upload-file-container {
|
|
68
|
-
display: flex;
|
|
69
|
-
place-items: center;
|
|
70
|
-
width: 100%;
|
|
71
|
-
}
|
|
72
|
-
.duet-upload-file-link {
|
|
73
|
-
display: flex;
|
|
74
|
-
flex-grow: 2;
|
|
75
|
-
place-items: center;
|
|
76
|
-
}
|
|
77
|
-
.duet-upload-file-link-error {
|
|
78
|
-
flex-direction: column;
|
|
79
|
-
place-items: flex-start;
|
|
80
|
-
}
|
|
81
|
-
.duet-upload-file-link duet-button {
|
|
82
|
-
position: relative;
|
|
83
|
-
top: 6px;
|
|
84
|
-
}
|
|
85
|
-
.duet-upload-file-actions {
|
|
86
|
-
display: flex;
|
|
87
|
-
transform: scale(0.8);
|
|
88
|
-
}
|
|
89
|
-
.duet-upload-file-progress {
|
|
90
|
-
/* fallback design of the default appearance */
|
|
91
|
-
}
|
|
92
|
-
.duet-upload-file-progress .progress-bar {
|
|
93
|
-
position: relative;
|
|
94
|
-
display: block;
|
|
95
|
-
width: 100%;
|
|
96
|
-
height: 15px;
|
|
97
|
-
background-color: #f3f9fc;
|
|
98
|
-
border-radius: 0;
|
|
99
|
-
box-shadow: none;
|
|
100
|
-
}
|
|
101
|
-
.duet-upload-file-progress .progress-bar > span {
|
|
102
|
-
display: block;
|
|
103
|
-
text-indent: -9999px;
|
|
104
|
-
background-color: #0077b3;
|
|
105
|
-
border-radius: 0;
|
|
106
|
-
}
|
|
107
|
-
.duet-upload-file-progress progress[value] {
|
|
108
|
-
display: flex;
|
|
109
|
-
width: 100%;
|
|
110
|
-
height: 15px;
|
|
111
|
-
/* For IE10 */
|
|
112
|
-
color: #0077b3;
|
|
113
|
-
/* Get rid of default border in Firefox. */
|
|
114
|
-
border: 0 none;
|
|
115
|
-
/* Reset the default appearance */
|
|
116
|
-
-webkit-appearance: none;
|
|
117
|
-
-moz-appearance: none;
|
|
118
|
-
appearance: none;
|
|
119
|
-
}
|
|
120
|
-
.duet-upload-file-progress progress[value]::-webkit-progress-bar {
|
|
121
|
-
background-color: #f3f9fc;
|
|
122
|
-
border-radius: 0;
|
|
123
|
-
}
|
|
124
|
-
.duet-upload-file-progress progress[value]::-webkit-progress-value {
|
|
125
|
-
background-color: #0077b3;
|
|
126
|
-
background-size: 35px 20px, 100% 100%, 100% 100%;
|
|
127
|
-
border-radius: 0;
|
|
128
|
-
-webkit-animation: animate-stripes 5s linear infinite;
|
|
129
|
-
animation: animate-stripes 5s linear infinite;
|
|
130
|
-
}
|
|
131
|
-
.duet-upload-file-progress progress[value] ::-moz-progress-bar {
|
|
132
|
-
background-color: #f3f9fc;
|
|
133
|
-
}
|