@duetds/components 8.0.6 → 8.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.d.ts +2 -2
- package/hydrate/index.js +19099 -17881
- package/lib/cjs/app-globals-cd75f624.js +54 -0
- package/lib/cjs/{common-strings-86913e94.js → common-strings-22c70ef0.js} +6 -6
- package/lib/cjs/create-id-1f8c438f.js +13 -0
- package/lib/cjs/duet-action-button.cjs.entry.js +133 -133
- package/lib/cjs/duet-alert.cjs.entry.js +106 -106
- package/lib/cjs/duet-badge.cjs.entry.js +29 -29
- package/lib/cjs/duet-banner.cjs.entry.js +52 -52
- package/lib/cjs/duet-breadcrumb.cjs.entry.js +41 -41
- package/lib/cjs/duet-breadcrumbs.cjs.entry.js +51 -51
- package/lib/cjs/duet-button_2.cjs.entry.js +229 -229
- package/lib/cjs/duet-callout.cjs.entry.js +28 -28
- package/lib/cjs/duet-caption_4.cjs.entry.js +187 -187
- package/lib/cjs/duet-card.cjs.entry.js +93 -93
- package/lib/cjs/duet-checkbox.cjs.entry.js +85 -85
- package/lib/cjs/duet-checkmark.cjs.entry.js +23 -23
- package/lib/cjs/duet-chip.cjs.entry.js +182 -182
- package/lib/cjs/duet-choice_2.cjs.entry.js +392 -392
- package/lib/cjs/duet-collapsible.cjs.entry.js +98 -98
- package/lib/cjs/duet-combobox.cjs.entry.js +362 -362
- package/lib/cjs/duet-contact-card.cjs.entry.js +49 -49
- package/lib/cjs/duet-cookie-consent.cjs.entry.js +35 -35
- package/lib/cjs/duet-date-picker.cjs.entry.js +610 -610
- package/lib/cjs/duet-divider_2.cjs.entry.js +53 -53
- package/lib/cjs/duet-editable-table_3.cjs.entry.js +1247 -1247
- package/lib/cjs/duet-empty-state.cjs.entry.js +26 -26
- package/lib/cjs/duet-fieldset.cjs.entry.js +50 -50
- package/lib/cjs/duet-file-chooser.cjs.entry.js +44 -44
- package/lib/cjs/duet-footer.cjs.entry.js +118 -118
- package/lib/cjs/duet-grid_2.cjs.entry.js +185 -185
- package/lib/cjs/duet-header_2.cjs.entry.js +610 -610
- package/lib/cjs/duet-hero.cjs.entry.js +172 -172
- package/lib/cjs/duet-icon.cjs.entry.js +141 -141
- package/lib/cjs/duet-input_2.cjs.entry.js +346 -346
- package/lib/cjs/duet-layout.cjs.entry.js +51 -51
- package/lib/cjs/duet-list_2.cjs.entry.js +99 -99
- package/lib/cjs/duet-menu-bar-button.cjs.entry.js +70 -70
- package/lib/cjs/duet-menu-bar-dropdown-link.cjs.entry.js +44 -44
- package/lib/cjs/duet-menu-bar-dropdown.cjs.entry.js +93 -93
- package/lib/cjs/duet-menu-bar-link.cjs.entry.js +58 -58
- package/lib/cjs/duet-menu-bar.cjs.entry.js +116 -116
- package/lib/cjs/duet-modal.cjs.entry.js +188 -188
- package/lib/cjs/duet-multiselect.cjs.entry.js +206 -206
- package/lib/cjs/duet-nav.cjs.entry.js +20 -20
- package/lib/cjs/duet-notification_2.cjs.entry.js +140 -140
- package/lib/cjs/duet-number-input.cjs.entry.js +337 -337
- package/lib/cjs/duet-page-heading.cjs.entry.js +26 -26
- package/lib/cjs/duet-pagination_2.cjs.entry.js +511 -511
- package/lib/cjs/duet-popup-menu-item.cjs.entry.js +62 -62
- package/lib/cjs/duet-popup-menu.cjs.entry.js +147 -147
- package/lib/cjs/duet-progress.cjs.entry.js +54 -54
- package/lib/cjs/duet-promo-card.cjs.entry.js +40 -40
- package/lib/cjs/duet-radio_2.cjs.entry.js +197 -197
- package/lib/cjs/duet-range-slider.cjs.entry.js +105 -105
- package/lib/cjs/duet-scrollable_3.cjs.entry.js +384 -386
- package/lib/cjs/duet-section-layout.cjs.entry.js +21 -21
- package/lib/cjs/duet-select.cjs.entry.js +156 -156
- package/lib/cjs/duet-shaped-image.cjs.entry.js +28 -28
- package/lib/cjs/duet-show-more.cjs.entry.js +98 -98
- package/lib/cjs/duet-slideout-lang.cjs.entry.js +36 -36
- package/lib/cjs/duet-slideout-link.cjs.entry.js +33 -33
- package/lib/cjs/duet-slideout-panel-dropdown.cjs.entry.js +50 -50
- package/lib/cjs/duet-slideout-panel.cjs.entry.js +120 -120
- package/lib/cjs/duet-slideout.cjs.entry.js +194 -194
- package/lib/cjs/duet-step_2.cjs.entry.js +182 -184
- package/lib/cjs/duet-submenu-bar-dropdown-link.cjs.entry.js +36 -36
- package/lib/cjs/duet-submenu-bar-dropdown.cjs.entry.js +103 -103
- package/lib/cjs/duet-submenu-bar-link.cjs.entry.js +59 -59
- package/lib/cjs/duet-submenu-bar.cjs.entry.js +110 -110
- package/lib/cjs/duet-textarea.cjs.entry.js +160 -160
- package/lib/cjs/duet-toggle.cjs.entry.js +72 -72
- package/lib/cjs/duet-toolbar-dropdown-link.cjs.entry.js +35 -35
- package/lib/cjs/duet-toolbar-dropdown.cjs.entry.js +59 -59
- package/lib/cjs/duet-toolbar-link.cjs.entry.js +31 -31
- package/lib/cjs/duet-toolbar.cjs.entry.js +34 -34
- package/lib/cjs/duet-tooltip-button_2.cjs.entry.js +98 -80
- package/lib/cjs/duet-tooltip.cjs.entry.js +185 -187
- package/lib/cjs/duet-tray.cjs.entry.js +82 -82
- package/lib/cjs/duet-upload-aria-status.cjs.entry.js +65 -65
- package/lib/cjs/duet-upload-item.cjs.entry.js +81 -81
- package/lib/cjs/duet-visually-hidden.cjs.entry.js +12 -12
- package/lib/cjs/duet.cjs.js +4 -4
- package/lib/cjs/errorcodes.utils-a86b1f94.js +39 -0
- package/lib/cjs/focus-utils-9b549956.js +21 -0
- package/lib/cjs/{index-2cce7b13.js → index-ce232ed8.js} +106 -45
- package/lib/cjs/input-utils-1096a2c5.js +56 -0
- package/lib/cjs/{is-internet-explorer-76c3b538.js → is-internet-explorer-e7f58ebc.js} +2 -2
- package/lib/cjs/{js-utils-b20cfc79.js → js-utils-92e24ba1.js} +27 -27
- package/lib/cjs/{language-utils-dc19e8b6.js → language-utils-e8a527e5.js} +74 -74
- package/lib/cjs/loader.cjs.js +3 -3
- package/lib/cjs/{slot-query-b7555763.js → slot-query-3259af5b.js} +1 -1
- package/lib/cjs/string-utils-053749ff.js +59 -0
- package/lib/cjs/teleport-e9d05bca.js +99 -0
- package/lib/cjs/themeable-component-83a2a0d4.js +15 -0
- package/lib/cjs/token-utils-84b3bca6.js +124 -0
- package/lib/cjs/watch-options-30a12622.js +61 -0
- package/lib/collection/collection-manifest.json +2 -2
- package/lib/collection/common/slot-query.js +3 -3
- package/lib/collection/common/themeable-component.js +6 -6
- package/lib/collection/common-strings.js +6 -6
- package/lib/collection/components/duet-action-button/duet-action-button.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-action-button/duet-action-button.js +570 -569
- package/lib/collection/components/duet-alert/duet-alert.a11y.e2e.js +10 -10
- package/lib/collection/components/duet-alert/duet-alert.e2e.js +47 -47
- package/lib/collection/components/duet-alert/duet-alert.js +442 -441
- package/lib/collection/components/duet-badge/duet-badge.a11y.e2e.js +10 -10
- package/lib/collection/components/duet-badge/duet-badge.e2e.js +21 -21
- package/lib/collection/components/duet-badge/duet-badge.js +134 -134
- package/lib/collection/components/duet-banner/duet-banner.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-banner/duet-banner.e2e.js +16 -16
- package/lib/collection/components/duet-banner/duet-banner.js +309 -309
- package/lib/collection/components/duet-breadcrumbs/duet-breadcrumb.js +139 -139
- package/lib/collection/components/duet-breadcrumbs/duet-breadcrumbs.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-breadcrumbs/duet-breadcrumbs.e2e.js +6 -6
- package/lib/collection/components/duet-breadcrumbs/duet-breadcrumbs.js +112 -112
- package/lib/collection/components/duet-button/duet-button.a11y.e2e.js +30 -30
- package/lib/collection/components/duet-button/duet-button.e2e.js +187 -187
- package/lib/collection/components/duet-button/duet-button.js +1068 -1067
- package/lib/collection/components/duet-callout/duet-callout.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-callout/duet-callout.e2e.js +15 -15
- package/lib/collection/components/duet-callout/duet-callout.js +88 -88
- package/lib/collection/components/duet-caption/duet-caption.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-caption/duet-caption.e2e.js +20 -20
- package/lib/collection/components/duet-caption/duet-caption.js +131 -131
- package/lib/collection/components/duet-card/duet-card.a11y.e2e.js +10 -10
- package/lib/collection/components/duet-card/duet-card.e2e.js +85 -85
- package/lib/collection/components/duet-card/duet-card.js +492 -491
- package/lib/collection/components/duet-checkbox/duet-checkbox.a11y.e2e.js +10 -10
- package/lib/collection/components/duet-checkbox/duet-checkbox.e2e.js +103 -103
- package/lib/collection/components/duet-checkbox/duet-checkbox.js +553 -549
- package/lib/collection/components/duet-chip/duet-chip.a11y.e2e.js +10 -10
- package/lib/collection/components/duet-chip/duet-chip.e2e.js +40 -40
- package/lib/collection/components/duet-chip/duet-chip.js +487 -486
- package/lib/collection/components/duet-choice/duet-checkmark.js +136 -136
- package/lib/collection/components/duet-choice/duet-choice.a11y.e2e.js +25 -25
- package/lib/collection/components/duet-choice/duet-choice.e2e.js +171 -171
- package/lib/collection/components/duet-choice/duet-choice.js +1092 -1088
- package/lib/collection/components/duet-choice-group/duet-choice-group.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-choice-group/duet-choice-group.e2e.js +63 -63
- package/lib/collection/components/duet-choice-group/duet-choice-group.js +456 -453
- package/lib/collection/components/duet-collapsible/duet-collapsible.a11y.e2e.js +10 -10
- package/lib/collection/components/duet-collapsible/duet-collapsible.e2e.js +87 -87
- package/lib/collection/components/duet-collapsible/duet-collapsible.js +363 -362
- package/lib/collection/components/duet-combobox/duet-combobox-select-single.js +2 -2
- package/lib/collection/components/duet-combobox/duet-combobox-select.js +8 -8
- package/lib/collection/components/duet-combobox/duet-combobox.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-combobox/duet-combobox.e2e.js +115 -115
- package/lib/collection/components/duet-combobox/duet-combobox.js +670 -669
- package/lib/collection/components/duet-contact-card/duet-contact-card.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-contact-card/duet-contact-card.js +255 -255
- package/lib/collection/components/duet-cookie-consent/duet-cookie-consent.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-cookie-consent/duet-cookie-consent.e2e.js +16 -16
- package/lib/collection/components/duet-cookie-consent/duet-cookie-consent.js +127 -127
- package/lib/collection/components/duet-date-picker/date-i18n.js +97 -97
- package/lib/collection/components/duet-date-picker/date-picker-day.js +9 -9
- package/lib/collection/components/duet-date-picker/date-picker-input.js +5 -5
- package/lib/collection/components/duet-date-picker/date-picker-month.js +16 -16
- package/lib/collection/components/duet-date-picker/date-utils.js +95 -95
- package/lib/collection/components/duet-date-picker/date-utils.spec.js +323 -323
- package/lib/collection/components/duet-date-picker/duet-date-picker.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-date-picker/duet-date-picker.e2e.js +618 -618
- package/lib/collection/components/duet-date-picker/duet-date-picker.js +1049 -1044
- package/lib/collection/components/duet-date-picker/utils.js +29 -29
- package/lib/collection/components/duet-divider/duet-divider.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-divider/duet-divider.e2e.js +24 -24
- package/lib/collection/components/duet-divider/duet-divider.js +112 -112
- package/lib/collection/components/duet-editable-table/duet-editable-table-tabledata.js +7 -7
- package/lib/collection/components/duet-editable-table/duet-editable-table.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-editable-table/duet-editable-table.e2e.js +19 -19
- package/lib/collection/components/duet-editable-table/duet-editable-table.js +501 -498
- package/lib/collection/components/duet-empty-state/duet-empty-state.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-empty-state/duet-empty-state.e2e.js +10 -10
- package/lib/collection/components/duet-empty-state/duet-empty-state.js +110 -110
- package/lib/collection/components/duet-fieldset/duet-fieldset.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-fieldset/duet-fieldset.e2e.js +5 -5
- package/lib/collection/components/duet-fieldset/duet-fieldset.js +245 -245
- package/lib/collection/components/duet-file-chooser/duet-file-chooser.js +179 -179
- package/lib/collection/components/duet-footer/duet-footer.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-footer/duet-footer.e2e.js +163 -163
- package/lib/collection/components/duet-footer/duet-footer.js +485 -485
- package/lib/collection/components/duet-grid/duet-grid.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-grid/duet-grid.e2e.js +36 -36
- package/lib/collection/components/duet-grid/duet-grid.js +345 -342
- package/lib/collection/components/duet-grid-item/duet-grid-item.js +233 -230
- package/lib/collection/components/duet-header/duet-header-dropdown.js +12 -12
- package/lib/collection/components/duet-header/duet-header-icon.js +2 -2
- package/lib/collection/components/duet-header/duet-header.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-header/duet-header.e2e.js +430 -430
- package/lib/collection/components/duet-header/duet-header.js +1297 -1295
- package/lib/collection/components/duet-heading/duet-heading.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-heading/duet-heading.e2e.js +21 -21
- package/lib/collection/components/duet-heading/duet-heading.js +230 -230
- package/lib/collection/components/duet-hero/duet-hero.a11y.e2e.js +15 -15
- package/lib/collection/components/duet-hero/duet-hero.e2e.js +166 -166
- package/lib/collection/components/duet-hero/duet-hero.js +814 -814
- package/lib/collection/components/duet-icon/duet-icon.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-icon/duet-icon.e2e.js +26 -26
- package/lib/collection/components/duet-icon/duet-icon.js +392 -392
- package/lib/collection/components/duet-icon/icon-utils.js +59 -59
- package/lib/collection/components/duet-icon/icon-utils.spec.js +76 -76
- package/lib/collection/components/duet-input/duet-input.a11y.e2e.js +20 -20
- package/lib/collection/components/duet-input/duet-input.e2e.js +195 -195
- package/lib/collection/components/duet-input/duet-input.js +1249 -1245
- package/lib/collection/components/duet-label/duet-label.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-label/duet-label.e2e.js +26 -26
- package/lib/collection/components/duet-label/duet-label.js +134 -131
- package/lib/collection/components/duet-layout/duet-layout.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-layout/duet-layout.e2e.js +26 -26
- package/lib/collection/components/duet-layout/duet-layout.js +207 -207
- package/lib/collection/components/duet-link/duet-link.a11y.e2e.js +15 -15
- package/lib/collection/components/duet-link/duet-link.e2e.js +47 -47
- package/lib/collection/components/duet-link/duet-link.js +436 -435
- package/lib/collection/components/duet-list/duet-list.a11y.e2e.js +11 -11
- package/lib/collection/components/duet-list/duet-list.e2e.js +50 -50
- package/lib/collection/components/duet-list/duet-list.js +292 -292
- package/lib/collection/components/duet-list-item/duet-list-item.js +81 -81
- package/lib/collection/components/duet-logo/duet-logo.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-logo/duet-logo.e2e.js +36 -36
- package/lib/collection/components/duet-logo/duet-logo.js +293 -292
- package/lib/collection/components/duet-menu-bar/duet-menu-bar.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-menu-bar/duet-menu-bar.js +261 -261
- package/lib/collection/components/duet-menu-bar-button/duet-menu-bar-button.js +347 -346
- package/lib/collection/components/duet-menu-bar-dropdown/duet-menu-bar-dropdown.js +224 -223
- package/lib/collection/components/duet-menu-bar-dropdown-link/duet-menu-bar-dropdown-link.js +133 -133
- package/lib/collection/components/duet-menu-bar-link/duet-menu-bar-link.js +170 -170
- package/lib/collection/components/duet-modal/duet-modal.a11y.e2e.js +10 -10
- package/lib/collection/components/duet-modal/duet-modal.e2e.js +78 -78
- package/lib/collection/components/duet-modal/duet-modal.js +687 -687
- package/lib/collection/components/duet-multiselect/duet-multiselect.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-multiselect/duet-multiselect.e2e.js +87 -87
- package/lib/collection/components/duet-multiselect/duet-multiselect.js +654 -653
- package/lib/collection/components/duet-nav/duet-nav.js +56 -56
- package/lib/collection/components/duet-notification/duet-notification.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-notification/duet-notification.e2e.js +6 -6
- package/lib/collection/components/duet-notification/duet-notification.js +257 -259
- package/lib/collection/components/duet-notification-drawer/duet-notification-drawer.a11y.e2e.js +10 -10
- package/lib/collection/components/duet-notification-drawer/duet-notification-drawer.e2e.js +141 -141
- package/lib/collection/components/duet-notification-drawer/duet-notification-drawer.js +379 -383
- package/lib/collection/components/duet-number-input/duet-number-input-negative.e2e.js +26 -26
- package/lib/collection/components/duet-number-input/duet-number-input.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-number-input/duet-number-input.e2e.js +232 -232
- package/lib/collection/components/duet-number-input/duet-number-input.js +1117 -1113
- package/lib/collection/components/duet-page-heading/duet-page-heading.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-page-heading/duet-page-heading.js +104 -104
- package/lib/collection/components/duet-pagination/duet-pagination-utils.js +4 -4
- package/lib/collection/components/duet-pagination/duet-pagination.a11y.e2e.js +10 -10
- package/lib/collection/components/duet-pagination/duet-pagination.e2e.js +79 -79
- package/lib/collection/components/duet-pagination/duet-pagination.js +677 -677
- package/lib/collection/components/duet-paragraph/duet-paragraph.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-paragraph/duet-paragraph.e2e.js +21 -21
- package/lib/collection/components/duet-paragraph/duet-paragraph.js +190 -190
- package/lib/collection/components/duet-popup-menu/duet-popup-menu.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-popup-menu/duet-popup-menu.js +407 -407
- package/lib/collection/components/duet-popup-menu-item/duet-popup-menu-item.js +344 -343
- package/lib/collection/components/duet-progress/duet-progress.a11y.e2e.js +7 -7
- package/lib/collection/components/duet-progress/duet-progress.e2e.js +6 -6
- package/lib/collection/components/duet-progress/duet-progress.js +276 -273
- package/lib/collection/components/duet-promo-card/duet-promo-card.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-promo-card/duet-promo-card.e2e.js +16 -16
- package/lib/collection/components/duet-promo-card/duet-promo-card.js +206 -206
- package/lib/collection/components/duet-radio/duet-radio.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-radio/duet-radio.e2e.js +126 -126
- package/lib/collection/components/duet-radio/duet-radio.js +609 -605
- package/lib/collection/components/duet-radio-group/duet-radio-group.a11y.e2e.js +10 -10
- package/lib/collection/components/duet-radio-group/duet-radio-group.e2e.js +39 -39
- package/lib/collection/components/duet-radio-group/duet-radio-group.js +423 -420
- package/lib/collection/components/duet-range-slider/duet-range-slider.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-range-slider/duet-range-slider.e2e.js +51 -51
- package/lib/collection/components/duet-range-slider/duet-range-slider.js +561 -557
- package/lib/collection/components/duet-range-stepper/duet-range-stepper.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-range-stepper/duet-range-stepper.e2e.js +46 -46
- package/lib/collection/components/duet-range-stepper/duet-range-stepper.js +341 -341
- package/lib/collection/components/duet-range-stepper/duet-range-stepper.spec.js +17 -17
- package/lib/collection/components/duet-scrollable/duet-scrollable.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-scrollable/duet-scrollable.e2e.js +6 -6
- package/lib/collection/components/duet-scrollable/duet-scrollable.js +294 -294
- package/lib/collection/components/duet-section-layout/duet-section-layout.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-section-layout/duet-section-layout.e2e.js +16 -16
- package/lib/collection/components/duet-section-layout/duet-section-layout.js +75 -75
- package/lib/collection/components/duet-select/duet-select.a11y.e2e.js +10 -10
- package/lib/collection/components/duet-select/duet-select.e2e.js +201 -201
- package/lib/collection/components/duet-select/duet-select.js +722 -718
- package/lib/collection/components/duet-shaped-image/duet-shaped-image.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-shaped-image/duet-shaped-image.js +143 -143
- package/lib/collection/components/duet-show-more/duet-show-more.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-show-more/duet-show-more.js +436 -436
- package/lib/collection/components/duet-slideout/duet-slideout.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-slideout/duet-slideout.js +408 -407
- package/lib/collection/components/duet-slideout-lang/duet-slideout-lang.js +75 -75
- package/lib/collection/components/duet-slideout-link/duet-slideout-link.js +215 -215
- package/lib/collection/components/duet-slideout-panel/duet-slideout-panel.js +282 -281
- package/lib/collection/components/duet-slideout-panel-dropdown/duet-slideout-panel-dropdown.js +177 -176
- package/lib/collection/components/duet-spacer/duet-spacer.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-spacer/duet-spacer.e2e.js +21 -21
- package/lib/collection/components/duet-spacer/duet-spacer.js +110 -110
- package/lib/collection/components/duet-spinner/duet-spinner.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-spinner/duet-spinner.e2e.js +23 -23
- package/lib/collection/components/duet-spinner/duet-spinner.js +131 -131
- package/lib/collection/components/duet-step/duet-step.e2e.js +83 -83
- package/lib/collection/components/duet-step/duet-step.js +292 -290
- package/lib/collection/components/duet-stepper/duet-stepper.a11y.e2e.js +8 -8
- package/lib/collection/components/duet-stepper/duet-stepper.e2e.js +49 -49
- package/lib/collection/components/duet-stepper/duet-stepper.js +243 -243
- package/lib/collection/components/duet-submenu-bar/duet-submenu-bar.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-submenu-bar/duet-submenu-bar.js +218 -217
- package/lib/collection/components/duet-submenu-bar-dropdown/duet-submenu-bar-dropdown.js +235 -234
- package/lib/collection/components/duet-submenu-bar-dropdown-link/duet-submenu-bar-dropdown-link.js +162 -162
- package/lib/collection/components/duet-submenu-bar-link/duet-submenu-bar-link.js +154 -154
- package/lib/collection/components/duet-tab/duet-tab.e2e.js +10 -10
- package/lib/collection/components/duet-tab/duet-tab.js +162 -161
- package/lib/collection/components/duet-tab-group/duet-tab-group.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-tab-group/duet-tab-group.e2e.js +60 -60
- package/lib/collection/components/duet-tab-group/duet-tab-group.js +633 -632
- package/lib/collection/components/duet-table/duet-table.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-table/duet-table.e2e.js +25 -25
- package/lib/collection/components/duet-table/duet-table.js +284 -281
- package/lib/collection/components/duet-textarea/duet-textarea.a11y.e2e.js +10 -10
- package/lib/collection/components/duet-textarea/duet-textarea.e2e.js +193 -193
- package/lib/collection/components/duet-textarea/duet-textarea.js +849 -845
- package/lib/collection/components/duet-toggle/duet-toggle.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-toggle/duet-toggle.e2e.js +66 -66
- package/lib/collection/components/duet-toggle/duet-toggle.js +468 -464
- package/lib/collection/components/duet-toolbar/duet-toolbar.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-toolbar/duet-toolbar.js +105 -105
- package/lib/collection/components/duet-toolbar-dropdown/duet-toolbar-dropdown.js +221 -220
- package/lib/collection/components/duet-toolbar-dropdown-link/duet-toolbar-dropdown-link.js +160 -160
- package/lib/collection/components/duet-toolbar-link/duet-toolbar-link.js +156 -156
- package/lib/collection/components/duet-tooltip/duet-tooltip-button.js +194 -164
- package/lib/collection/components/duet-tooltip/duet-tooltip-popup.js +280 -251
- package/lib/collection/components/duet-tooltip/duet-tooltip.a11y.e2e.js +14 -14
- package/lib/collection/components/duet-tooltip/duet-tooltip.e2e.js +76 -76
- package/lib/collection/components/duet-tooltip/duet-tooltip.js +533 -529
- package/lib/collection/components/duet-tray/duet-tray.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-tray/duet-tray.e2e.js +67 -67
- package/lib/collection/components/duet-tray/duet-tray.js +315 -315
- package/lib/collection/components/duet-upload/duet-upload.e2e.js +40 -40
- package/lib/collection/components/duet-upload/duet-upload.js +2282 -2276
- package/lib/collection/components/duet-upload/errorcodes.utils.js +22 -22
- package/lib/collection/components/duet-upload/mock.helpers.js +85 -85
- package/lib/collection/components/duet-upload/upload-editable-item-error.js +4 -4
- package/lib/collection/components/duet-upload/upload-editable-item-success.js +15 -15
- package/lib/collection/components/duet-upload/upload-item-category.js +2 -2
- package/lib/collection/components/duet-upload/upload-item-header.js +4 -4
- package/lib/collection/components/duet-upload/upload-validators.js +96 -96
- package/lib/collection/components/duet-upload/upload-validators.spec.js +35 -35
- package/lib/collection/components/duet-upload/upload.helpers.js +8 -8
- package/lib/collection/components/duet-upload/xhr.helpers.js +26 -26
- package/lib/collection/components/duet-upload-aria-status/duet-upload-aria-status.js +194 -194
- package/lib/collection/components/duet-upload-item/duet-upload-item.js +306 -306
- package/lib/collection/components/duet-visually-hidden/duet-visually-hidden.a11y.e2e.js +5 -5
- package/lib/collection/components/duet-visually-hidden/duet-visually-hidden.e2e.js +6 -6
- package/lib/collection/components/duet-visually-hidden/duet-visually-hidden.js +20 -20
- package/lib/collection/global/duet-global.js +22 -22
- package/lib/collection/global/log-wrapper.js +29 -29
- package/lib/collection/utils/axe-core-utils.js +24 -24
- package/lib/collection/utils/create-id.js +2 -2
- package/lib/collection/utils/create-id.spec.js +6 -6
- package/lib/collection/utils/fixture-utils.js +25 -25
- package/lib/collection/utils/focus-utils.js +7 -7
- package/lib/collection/utils/group-by.js +9 -9
- package/lib/collection/utils/input-utils.js +25 -25
- package/lib/collection/utils/is-internet-explorer.js +2 -2
- package/lib/collection/utils/js-utils.js +38 -38
- package/lib/collection/utils/js-utils.spec.js +14 -14
- package/lib/collection/utils/language-utils.js +73 -73
- package/lib/collection/utils/language-utils.spec.js +151 -151
- package/lib/collection/utils/math.utils.js +59 -59
- package/lib/collection/utils/math.utils.spec.js +130 -130
- package/lib/collection/utils/picture-utils.js +2 -2
- package/lib/collection/utils/string-utils.js +31 -31
- package/lib/collection/utils/string-utils.spec.js +32 -32
- package/lib/collection/utils/teleport.js +77 -77
- package/lib/collection/utils/template-utils.js +18 -18
- package/lib/collection/utils/template-utils.spec.js +33 -33
- package/lib/collection/utils/test-utils.js +31 -31
- package/lib/collection/utils/token-utils.js +96 -96
- package/lib/collection/utils/token-utils.spec.js +170 -170
- package/lib/collection/utils/watch-options.js +44 -44
- package/lib/dist-custom-elements/duet-action-button.d.ts +2 -2
- package/lib/dist-custom-elements/duet-action-button.js +1 -1
- package/lib/dist-custom-elements/duet-alert.d.ts +2 -2
- package/lib/dist-custom-elements/duet-alert.js +1 -1
- package/lib/dist-custom-elements/duet-badge.d.ts +2 -2
- package/lib/dist-custom-elements/duet-badge.js +1 -1
- package/lib/dist-custom-elements/duet-banner.d.ts +2 -2
- package/lib/dist-custom-elements/duet-banner.js +96 -96
- package/lib/dist-custom-elements/duet-breadcrumb.d.ts +2 -2
- package/lib/dist-custom-elements/duet-breadcrumb.js +66 -66
- package/lib/dist-custom-elements/duet-breadcrumbs.d.ts +2 -2
- package/lib/dist-custom-elements/duet-breadcrumbs.js +68 -68
- package/lib/dist-custom-elements/duet-button.d.ts +2 -2
- package/lib/dist-custom-elements/duet-button.js +1 -1
- package/lib/dist-custom-elements/duet-callout.d.ts +2 -2
- package/lib/dist-custom-elements/duet-callout.js +57 -57
- package/lib/dist-custom-elements/duet-caption.d.ts +2 -2
- package/lib/dist-custom-elements/duet-caption.js +1 -1
- package/lib/dist-custom-elements/duet-card.d.ts +2 -2
- package/lib/dist-custom-elements/duet-card.js +137 -137
- package/lib/dist-custom-elements/duet-checkbox.d.ts +2 -2
- package/lib/dist-custom-elements/duet-checkbox.js +1 -1
- package/lib/dist-custom-elements/duet-checkmark.d.ts +2 -2
- package/lib/dist-custom-elements/duet-checkmark.js +1 -1
- package/lib/dist-custom-elements/duet-chip.d.ts +2 -2
- package/lib/dist-custom-elements/duet-chip.js +219 -219
- package/lib/dist-custom-elements/duet-choice-group.d.ts +2 -2
- package/lib/dist-custom-elements/duet-choice-group.js +189 -189
- package/lib/dist-custom-elements/duet-choice.d.ts +2 -2
- package/lib/dist-custom-elements/duet-choice.js +357 -357
- package/lib/dist-custom-elements/duet-collapsible.d.ts +2 -2
- package/lib/dist-custom-elements/duet-collapsible.js +130 -130
- package/lib/dist-custom-elements/duet-combobox.d.ts +2 -2
- package/lib/dist-custom-elements/duet-combobox.js +405 -405
- package/lib/dist-custom-elements/duet-contact-card.d.ts +2 -2
- package/lib/dist-custom-elements/duet-contact-card.js +116 -116
- package/lib/dist-custom-elements/duet-cookie-consent.d.ts +2 -2
- package/lib/dist-custom-elements/duet-cookie-consent.js +82 -82
- package/lib/dist-custom-elements/duet-date-picker.d.ts +2 -2
- package/lib/dist-custom-elements/duet-date-picker.js +728 -728
- package/lib/dist-custom-elements/duet-divider.d.ts +2 -2
- package/lib/dist-custom-elements/duet-divider.js +1 -1
- package/lib/dist-custom-elements/duet-editable-table.d.ts +2 -2
- package/lib/dist-custom-elements/duet-editable-table.js +230 -230
- package/lib/dist-custom-elements/duet-empty-state.d.ts +2 -2
- package/lib/dist-custom-elements/duet-empty-state.js +1 -1
- package/lib/dist-custom-elements/duet-fieldset.d.ts +2 -2
- package/lib/dist-custom-elements/duet-fieldset.js +1 -1
- package/lib/dist-custom-elements/duet-file-chooser.d.ts +2 -2
- package/lib/dist-custom-elements/duet-file-chooser.js +70 -70
- package/lib/dist-custom-elements/duet-footer.d.ts +2 -2
- package/lib/dist-custom-elements/duet-footer.js +167 -167
- package/lib/dist-custom-elements/duet-grid-item.d.ts +2 -2
- package/lib/dist-custom-elements/duet-grid-item.js +1 -1
- package/lib/dist-custom-elements/duet-grid.d.ts +2 -2
- package/lib/dist-custom-elements/duet-grid.js +1 -1
- package/lib/dist-custom-elements/duet-header.d.ts +2 -2
- package/lib/dist-custom-elements/duet-header.js +637 -637
- package/lib/dist-custom-elements/duet-heading.d.ts +2 -2
- package/lib/dist-custom-elements/duet-heading.js +1 -1
- package/lib/dist-custom-elements/duet-hero.d.ts +2 -2
- package/lib/dist-custom-elements/duet-hero.js +270 -270
- package/lib/dist-custom-elements/duet-icon.d.ts +2 -2
- package/lib/dist-custom-elements/duet-icon.js +1 -1
- package/lib/dist-custom-elements/duet-input.d.ts +2 -2
- package/lib/dist-custom-elements/duet-input.js +1 -1
- package/lib/dist-custom-elements/duet-label.d.ts +2 -2
- package/lib/dist-custom-elements/duet-label.js +1 -1
- package/lib/dist-custom-elements/duet-layout.d.ts +2 -2
- package/lib/dist-custom-elements/duet-layout.js +73 -73
- package/lib/dist-custom-elements/duet-link.d.ts +2 -2
- package/lib/dist-custom-elements/duet-link.js +1 -1
- package/lib/dist-custom-elements/duet-list-item.d.ts +2 -2
- package/lib/dist-custom-elements/duet-list-item.js +1 -1
- package/lib/dist-custom-elements/duet-list.d.ts +2 -2
- package/lib/dist-custom-elements/duet-list.js +1 -1
- package/lib/dist-custom-elements/duet-logo.d.ts +2 -2
- package/lib/dist-custom-elements/duet-logo.js +1 -1
- package/lib/dist-custom-elements/duet-menu-bar-button.d.ts +2 -2
- package/lib/dist-custom-elements/duet-menu-bar-button.js +106 -106
- package/lib/dist-custom-elements/duet-menu-bar-dropdown-link.d.ts +2 -2
- package/lib/dist-custom-elements/duet-menu-bar-dropdown-link.js +69 -69
- package/lib/dist-custom-elements/duet-menu-bar-dropdown.d.ts +2 -2
- package/lib/dist-custom-elements/duet-menu-bar-dropdown.js +120 -120
- package/lib/dist-custom-elements/duet-menu-bar-link.d.ts +2 -2
- package/lib/dist-custom-elements/duet-menu-bar-link.js +85 -85
- package/lib/dist-custom-elements/duet-menu-bar.d.ts +2 -2
- package/lib/dist-custom-elements/duet-menu-bar.js +145 -145
- package/lib/dist-custom-elements/duet-modal.d.ts +2 -2
- package/lib/dist-custom-elements/duet-modal.js +262 -262
- package/lib/dist-custom-elements/duet-multiselect.d.ts +2 -2
- package/lib/dist-custom-elements/duet-multiselect.js +299 -299
- package/lib/dist-custom-elements/duet-nav.d.ts +2 -2
- package/lib/dist-custom-elements/duet-nav.js +36 -36
- package/lib/dist-custom-elements/duet-notification-drawer.d.ts +2 -2
- package/lib/dist-custom-elements/duet-notification-drawer.js +142 -142
- package/lib/dist-custom-elements/duet-notification.d.ts +2 -2
- package/lib/dist-custom-elements/duet-notification.js +76 -76
- package/lib/dist-custom-elements/duet-number-input.d.ts +2 -2
- package/lib/dist-custom-elements/duet-number-input.js +448 -448
- package/lib/dist-custom-elements/duet-page-heading.d.ts +2 -2
- package/lib/dist-custom-elements/duet-page-heading.js +50 -50
- package/lib/dist-custom-elements/duet-pagination.d.ts +2 -2
- package/lib/dist-custom-elements/duet-pagination.js +449 -449
- package/lib/dist-custom-elements/duet-paragraph.d.ts +2 -2
- package/lib/dist-custom-elements/duet-paragraph.js +1 -1
- package/lib/dist-custom-elements/duet-popup-menu-item.d.ts +2 -2
- package/lib/dist-custom-elements/duet-popup-menu-item.js +95 -95
- package/lib/dist-custom-elements/duet-popup-menu.d.ts +2 -2
- package/lib/dist-custom-elements/duet-popup-menu.js +176 -176
- package/lib/dist-custom-elements/duet-progress.d.ts +2 -2
- package/lib/dist-custom-elements/duet-progress.js +1 -1
- package/lib/dist-custom-elements/duet-promo-card.d.ts +2 -2
- package/lib/dist-custom-elements/duet-promo-card.js +74 -74
- package/lib/dist-custom-elements/duet-radio-group.d.ts +2 -2
- package/lib/dist-custom-elements/duet-radio-group.js +183 -183
- package/lib/dist-custom-elements/duet-radio.d.ts +2 -2
- package/lib/dist-custom-elements/duet-radio.js +130 -130
- package/lib/dist-custom-elements/duet-range-slider.d.ts +2 -2
- package/lib/dist-custom-elements/duet-range-slider.js +146 -146
- package/lib/dist-custom-elements/duet-range-stepper.d.ts +2 -2
- package/lib/dist-custom-elements/duet-range-stepper.js +206 -206
- package/lib/dist-custom-elements/duet-scrollable.d.ts +2 -2
- package/lib/dist-custom-elements/duet-scrollable.js +1 -1
- package/lib/dist-custom-elements/duet-section-layout.d.ts +2 -2
- package/lib/dist-custom-elements/duet-section-layout.js +38 -38
- package/lib/dist-custom-elements/duet-select.d.ts +2 -2
- package/lib/dist-custom-elements/duet-select.js +1 -1
- package/lib/dist-custom-elements/duet-shaped-image.d.ts +2 -2
- package/lib/dist-custom-elements/duet-shaped-image.js +48 -48
- package/lib/dist-custom-elements/duet-show-more.d.ts +2 -2
- package/lib/dist-custom-elements/duet-show-more.js +151 -151
- package/lib/dist-custom-elements/duet-slideout-lang.d.ts +2 -2
- package/lib/dist-custom-elements/duet-slideout-lang.js +58 -58
- package/lib/dist-custom-elements/duet-slideout-link.d.ts +2 -2
- package/lib/dist-custom-elements/duet-slideout-link.js +63 -63
- package/lib/dist-custom-elements/duet-slideout-panel-dropdown.d.ts +2 -2
- package/lib/dist-custom-elements/duet-slideout-panel-dropdown.js +76 -76
- package/lib/dist-custom-elements/duet-slideout-panel.d.ts +2 -2
- package/lib/dist-custom-elements/duet-slideout-panel.js +149 -149
- package/lib/dist-custom-elements/duet-slideout.d.ts +2 -2
- package/lib/dist-custom-elements/duet-slideout.js +225 -225
- package/lib/dist-custom-elements/duet-spacer.d.ts +2 -2
- package/lib/dist-custom-elements/duet-spacer.js +1 -1
- package/lib/dist-custom-elements/duet-spinner.d.ts +2 -2
- package/lib/dist-custom-elements/duet-spinner.js +1 -1
- package/lib/dist-custom-elements/duet-step.d.ts +2 -2
- package/lib/dist-custom-elements/duet-step.js +116 -118
- package/lib/dist-custom-elements/duet-stepper.d.ts +2 -2
- package/lib/dist-custom-elements/duet-stepper.js +129 -129
- package/lib/dist-custom-elements/duet-submenu-bar-dropdown-link.d.ts +2 -2
- package/lib/dist-custom-elements/duet-submenu-bar-dropdown-link.js +63 -63
- package/lib/dist-custom-elements/duet-submenu-bar-dropdown.d.ts +2 -2
- package/lib/dist-custom-elements/duet-submenu-bar-dropdown.js +131 -131
- package/lib/dist-custom-elements/duet-submenu-bar-link.d.ts +2 -2
- package/lib/dist-custom-elements/duet-submenu-bar-link.js +85 -85
- package/lib/dist-custom-elements/duet-submenu-bar.d.ts +2 -2
- package/lib/dist-custom-elements/duet-submenu-bar.js +139 -139
- package/lib/dist-custom-elements/duet-tab-group.d.ts +2 -2
- package/lib/dist-custom-elements/duet-tab-group.js +309 -309
- package/lib/dist-custom-elements/duet-tab.d.ts +2 -2
- package/lib/dist-custom-elements/duet-tab.js +50 -52
- package/lib/dist-custom-elements/duet-table.d.ts +2 -2
- package/lib/dist-custom-elements/duet-table.js +1 -1
- package/lib/dist-custom-elements/duet-textarea.d.ts +2 -2
- package/lib/dist-custom-elements/duet-textarea.js +262 -262
- package/lib/dist-custom-elements/duet-toggle.d.ts +2 -2
- package/lib/dist-custom-elements/duet-toggle.js +113 -113
- package/lib/dist-custom-elements/duet-toolbar-dropdown-link.d.ts +2 -2
- package/lib/dist-custom-elements/duet-toolbar-dropdown-link.js +62 -62
- package/lib/dist-custom-elements/duet-toolbar-dropdown.d.ts +2 -2
- package/lib/dist-custom-elements/duet-toolbar-dropdown.js +87 -87
- package/lib/dist-custom-elements/duet-toolbar-link.d.ts +2 -2
- package/lib/dist-custom-elements/duet-toolbar-link.js +58 -58
- package/lib/dist-custom-elements/duet-toolbar.d.ts +2 -2
- package/lib/dist-custom-elements/duet-toolbar.js +52 -52
- package/lib/dist-custom-elements/duet-tooltip-button.d.ts +2 -2
- package/lib/dist-custom-elements/duet-tooltip-button.js +1 -1
- package/lib/dist-custom-elements/duet-tooltip-popup.d.ts +2 -2
- package/lib/dist-custom-elements/duet-tooltip-popup.js +1 -1
- package/lib/dist-custom-elements/duet-tooltip.d.ts +2 -2
- package/lib/dist-custom-elements/duet-tooltip.js +1 -1
- package/lib/dist-custom-elements/duet-tray.d.ts +2 -2
- package/lib/dist-custom-elements/duet-tray.js +119 -119
- package/lib/dist-custom-elements/duet-upload-aria-status.d.ts +2 -2
- package/lib/dist-custom-elements/duet-upload-aria-status.js +1 -1
- package/lib/dist-custom-elements/duet-upload-item.d.ts +2 -2
- package/lib/dist-custom-elements/duet-upload-item.js +1 -1
- package/lib/dist-custom-elements/duet-upload.d.ts +2 -2
- package/lib/dist-custom-elements/duet-upload.js +1163 -1163
- package/lib/dist-custom-elements/duet-visually-hidden.d.ts +2 -2
- package/lib/dist-custom-elements/duet-visually-hidden.js +1 -1
- package/lib/dist-custom-elements/index.js +36 -36
- package/lib/dist-custom-elements/p-02eb68f2.js +123 -0
- package/lib/dist-custom-elements/p-0825cbc5.js +82 -0
- package/lib/dist-custom-elements/p-0a7c0d3d.js +205 -0
- package/lib/dist-custom-elements/p-0e052642.js +55 -0
- package/lib/{esm/slot-query-7877f18f.js → dist-custom-elements/p-11230037.js} +1 -1
- package/lib/dist-custom-elements/{p-52014bb2.js → p-1cd7077a.js} +37 -37
- package/lib/dist-custom-elements/p-247a9d01.js +174 -0
- package/lib/dist-custom-elements/p-257f2e82.js +147 -0
- package/lib/dist-custom-elements/p-2605a78e.js +62 -0
- package/lib/dist-custom-elements/{p-4883df66.js → p-2e36d5bf.js} +74 -74
- package/lib/dist-custom-elements/p-38b35e69.js +265 -0
- package/lib/dist-custom-elements/{p-d49389d2.js → p-39827833.js} +171 -171
- package/lib/dist-custom-elements/p-3a17ba0c.js +226 -0
- package/lib/dist-custom-elements/p-402e81c0.js +206 -0
- package/lib/dist-custom-elements/p-43b89e38.js +9 -0
- package/lib/dist-custom-elements/{p-274d11e3.js → p-4ab776f4.js} +6 -6
- package/lib/dist-custom-elements/p-4f43c247.js +126 -0
- package/lib/dist-custom-elements/p-57a1cba9.js +117 -0
- package/lib/dist-custom-elements/p-598731b0.js +110 -0
- package/lib/dist-custom-elements/p-5e59e970.js +11 -0
- package/lib/dist-custom-elements/{p-2b1a35cd.js → p-5fe36e8b.js} +278 -278
- package/lib/dist-custom-elements/{p-7247d0b2.js → p-6f7dcc4d.js} +65 -43
- package/lib/dist-custom-elements/{p-9dd26401.js → p-6fbb1970.js} +128 -128
- package/lib/dist-custom-elements/{p-21b815ae.js → p-70a66e96.js} +42 -42
- package/lib/dist-custom-elements/{p-180c0d2d.js → p-76b345c8.js} +174 -174
- package/lib/dist-custom-elements/p-7d8a2628.js +57 -0
- package/lib/dist-custom-elements/p-86649f25.js +465 -0
- package/lib/dist-custom-elements/p-872a2adb.js +93 -0
- package/lib/dist-custom-elements/p-98746766.js +60 -0
- package/lib/dist-custom-elements/p-9b5f8ba4.js +98 -0
- package/lib/{esm/js-utils-a35dcc8c.js → dist-custom-elements/p-9e371678.js} +27 -27
- package/lib/dist-custom-elements/{p-6c2e13f0.js → p-a45d0398.js} +56 -56
- package/lib/dist-custom-elements/p-a58bd561.js +13 -0
- package/lib/dist-custom-elements/{p-d0987122.js → p-a6e6f578.js} +48 -48
- package/lib/dist-custom-elements/p-b2e550a3.js +97 -0
- package/lib/dist-custom-elements/{p-c0af301d.js → p-ba0f907f.js} +64 -64
- package/lib/dist-custom-elements/{p-ba870310.js → p-ba9ad148.js} +47 -47
- package/lib/dist-custom-elements/p-bc3fa417.js +76 -0
- package/lib/dist-custom-elements/{p-e4355989.js → p-ce1cc5ab.js} +98 -88
- package/lib/dist-custom-elements/p-d5f3b174.js +38 -0
- package/lib/dist-custom-elements/{p-bcfb9e03.js → p-d5fc2405.js} +50 -50
- package/lib/dist-custom-elements/p-df7874f9.js +53 -0
- package/lib/dist-custom-elements/{p-3ccd454b.js → p-dfd29738.js} +43 -43
- package/lib/dist-custom-elements/p-eef66341.js +18 -0
- package/lib/dist-custom-elements/p-f91cddd9.js +269 -0
- package/lib/dist-custom-elements/p-ff387a2f.js +59 -0
- package/lib/dist-custom-elements/p-ffc7f083.js +137 -0
- package/lib/duet/duet.esm.js +1 -1
- package/lib/duet/duet.js +15 -15
- package/lib/duet/p-07af14f1.js +4 -0
- package/lib/duet/{p-dc63462c.entry.js → p-0a7c3ecf.entry.js} +1 -1
- package/lib/duet/{p-57afa4b8.system.entry.js → p-0aa1b1cd.system.entry.js} +2 -2
- package/lib/duet/{p-76b68b44.entry.js → p-105a1448.entry.js} +1 -1
- package/lib/duet/{p-4aa91f55.entry.js → p-132ea5e6.entry.js} +1 -1
- package/lib/duet/{p-33765ffd.entry.js → p-13876bc6.entry.js} +1 -1
- package/lib/duet/{p-ff7a57a9.entry.js → p-13f7d993.entry.js} +1 -1
- package/lib/duet/{p-1dadf501.entry.js → p-16db7b1e.entry.js} +1 -1
- package/lib/duet/{p-3fd4c411.entry.js → p-191959c7.entry.js} +1 -1
- package/lib/duet/p-1b11541f.entry.js +4 -0
- package/lib/duet/{p-faa6ea94.system.entry.js → p-1e587bcc.system.entry.js} +1 -1
- package/lib/duet/{p-e95d09bb.system.entry.js → p-1ea5e7e8.system.entry.js} +1 -1
- package/lib/duet/{p-566668e1.entry.js → p-1fbbf69f.entry.js} +1 -1
- package/lib/duet/{p-ded28a6e.system.entry.js → p-200089a6.system.entry.js} +1 -1
- package/lib/duet/{p-8972381a.system.js → p-224f6c46.system.js} +1 -1
- package/lib/duet/{p-604175d2.entry.js → p-226489c4.entry.js} +1 -1
- package/lib/duet/p-2349e838.entry.js +4 -0
- package/lib/duet/{p-05e3a2cc.entry.js → p-246db04a.entry.js} +1 -1
- package/lib/duet/p-24f7d6bf.entry.js +4 -0
- package/lib/duet/p-258b8732.entry.js +4 -0
- package/lib/duet/{p-6da7b933.entry.js → p-25bde810.entry.js} +1 -1
- package/lib/duet/{p-177c55aa.entry.js → p-26c85bab.entry.js} +1 -1
- package/lib/duet/{p-2b70d58a.system.entry.js → p-26f7d1b9.system.entry.js} +1 -1
- package/lib/duet/{p-8aa7771f.entry.js → p-2b9499f1.entry.js} +1 -1
- package/lib/duet/{p-afd00506.entry.js → p-2c730d40.entry.js} +1 -1
- package/lib/duet/{p-4883df66.js → p-2e36d5bf.js} +1 -1
- package/lib/duet/{p-d9353709.entry.js → p-2f0a23ae.entry.js} +1 -1
- package/lib/duet/{p-89b82e5a.entry.js → p-338ba4d2.entry.js} +1 -1
- package/lib/duet/{p-445523a8.entry.js → p-33d6e5ef.entry.js} +1 -1
- package/lib/duet/{p-089043d5.entry.js → p-342527a4.entry.js} +1 -1
- package/lib/duet/{p-fd1fb3f9.system.entry.js → p-3aa3fb24.system.entry.js} +1 -1
- package/lib/duet/{p-789365cb.system.entry.js → p-3cafacc3.system.entry.js} +1 -1
- package/lib/duet/{p-c36a1bb7.entry.js → p-3e1248d8.entry.js} +1 -1
- package/lib/duet/{p-8ba72fa0.system.entry.js → p-40ee5f5e.system.entry.js} +1 -1
- package/lib/duet/p-4212bab8.js +5 -0
- package/lib/duet/{p-80013513.system.entry.js → p-42b49430.system.entry.js} +1 -1
- package/lib/duet/{p-c3289020.system.entry.js → p-42b9c6f9.system.entry.js} +1 -1
- package/lib/duet/{p-6ae7579a.system.entry.js → p-464adc60.system.entry.js} +1 -1
- package/lib/duet/{p-18e2e6c8.system.entry.js → p-48d6a81d.system.entry.js} +1 -1
- package/lib/duet/p-4911c778.system.entry.js +4 -0
- package/lib/duet/{p-d02e3fe0.system.entry.js → p-4b272eca.system.entry.js} +1 -1
- package/lib/duet/p-4c650a9e.entry.js +4 -0
- package/lib/duet/{p-ac367891.entry.js → p-502f43bb.entry.js} +1 -1
- package/lib/duet/{p-7e1f37e2.entry.js → p-513dfe01.entry.js} +1 -1
- package/lib/duet/{p-b8db6e02.system.entry.js → p-51bdb5fd.system.entry.js} +1 -1
- package/lib/duet/{p-3b0969dc.entry.js → p-51d53e57.entry.js} +1 -1
- package/lib/duet/{p-59b9c68b.entry.js → p-542d792f.entry.js} +1 -1
- package/lib/duet/{p-07401f31.entry.js → p-55f98dc4.entry.js} +1 -1
- package/lib/duet/{p-77b43a95.entry.js → p-57a63204.entry.js} +1 -1
- package/lib/duet/{p-1e9f1c45.entry.js → p-580a7bae.entry.js} +1 -1
- package/lib/duet/{p-aa6d7d97.entry.js → p-5b86c564.entry.js} +1 -1
- package/lib/duet/{p-038ac494.system.entry.js → p-5c94249e.system.entry.js} +1 -1
- package/lib/duet/{p-4630d3cb.entry.js → p-5dccd17b.entry.js} +1 -1
- package/lib/duet/{p-0fd024c9.system.js → p-5ed00370.system.js} +1 -1
- package/lib/duet/{p-e1e89fd5.entry.js → p-5f43dbcf.entry.js} +1 -1
- package/lib/duet/{p-0d0101d9.system.entry.js → p-60cee508.system.entry.js} +1 -1
- package/lib/duet/{p-501f62eb.system.entry.js → p-61fe1543.system.entry.js} +1 -1
- package/lib/duet/{p-a7e7c277.system.entry.js → p-625f750f.system.entry.js} +1 -1
- package/lib/duet/{p-6f3f2e66.entry.js → p-6576401a.entry.js} +1 -1
- package/lib/duet/{p-3b147393.entry.js → p-65e434a5.entry.js} +1 -1
- package/lib/duet/{p-113d90cb.system.entry.js → p-69fba9fe.system.entry.js} +1 -1
- package/lib/duet/{p-9a613a25.system.entry.js → p-6a972453.system.entry.js} +1 -1
- package/lib/duet/{p-0f1ec9c0.entry.js → p-6b2876f1.entry.js} +1 -1
- package/lib/duet/{p-08f2114a.entry.js → p-6cae9d4b.entry.js} +1 -1
- package/lib/duet/{p-e90b5865.system.entry.js → p-6e6ececd.system.entry.js} +1 -1
- package/lib/duet/{p-35990684.entry.js → p-6f891451.entry.js} +1 -1
- package/lib/duet/{p-ed961bc6.system.entry.js → p-71ef1651.system.entry.js} +1 -1
- package/lib/duet/{p-5eb2a31f.system.entry.js → p-73f176dc.system.entry.js} +1 -1
- package/lib/duet/{p-56bdad28.system.entry.js → p-75243a15.system.entry.js} +1 -1
- package/lib/duet/{p-c801ebee.entry.js → p-785ff4f2.entry.js} +1 -1
- package/lib/duet/{p-3639371a.system.entry.js → p-793d7e04.system.entry.js} +1 -1
- package/lib/duet/{p-a91c8a42.system.entry.js → p-7a085479.system.entry.js} +1 -1
- package/lib/duet/{p-54fbdedf.entry.js → p-7a832531.entry.js} +1 -1
- package/lib/duet/p-7a91a53e.system.entry.js +4 -0
- package/lib/duet/{p-2c78c637.system.entry.js → p-7b5cd54a.system.entry.js} +1 -1
- package/lib/duet/{p-9cba7f04.system.entry.js → p-7b847e11.system.entry.js} +1 -1
- package/lib/duet/{p-b0ab2ead.system.entry.js → p-7bbc5a65.system.entry.js} +1 -1
- package/lib/duet/{p-9f835123.system.entry.js → p-7e833901.system.entry.js} +1 -1
- package/lib/duet/{p-4f770f51.system.entry.js → p-81230084.system.entry.js} +1 -1
- package/lib/duet/{p-f75a1805.system.entry.js → p-8920edb7.system.entry.js} +1 -1
- package/lib/duet/{p-0606cea3.entry.js → p-8a16fb3c.entry.js} +1 -1
- package/lib/duet/{p-0c702d36.entry.js → p-8bc5df74.entry.js} +1 -1
- package/lib/duet/{p-c79a0641.entry.js → p-8cf2feaa.entry.js} +1 -1
- package/lib/duet/{p-fcbb30e1.entry.js → p-8d69624a.entry.js} +1 -1
- package/lib/duet/{p-39078c27.system.entry.js → p-8d8bdf90.system.entry.js} +2 -2
- package/lib/duet/{p-301ddafe.entry.js → p-8e414050.entry.js} +1 -1
- package/lib/duet/{p-0e89cbae.system.entry.js → p-8eb82556.system.entry.js} +1 -1
- package/lib/duet/{p-e6168195.entry.js → p-903efe1d.entry.js} +1 -1
- package/lib/duet/{p-79faf440.system.entry.js → p-9192de69.system.entry.js} +1 -1
- package/lib/duet/{p-e9be64de.system.entry.js → p-9308c47c.system.entry.js} +1 -1
- package/lib/duet/{p-61d39730.entry.js → p-97488cc9.entry.js} +1 -1
- package/lib/duet/{p-a0ecfa13.system.entry.js → p-97d72f16.system.entry.js} +1 -1
- package/lib/duet/{p-a8878fd3.entry.js → p-9aa0ebba.entry.js} +1 -1
- package/lib/duet/{p-30bd8807.entry.js → p-9de9d3eb.entry.js} +1 -1
- package/lib/duet/{p-8bf363f4.system.entry.js → p-9ec69dbc.system.entry.js} +1 -1
- package/lib/duet/{p-ccef6554.system.entry.js → p-9f39d6de.system.entry.js} +1 -1
- package/lib/duet/{p-c08928e1.system.entry.js → p-9fb3e7b4.system.entry.js} +1 -1
- package/lib/duet/{p-9e2a2cf7.entry.js → p-a4dd147b.entry.js} +1 -1
- package/lib/duet/{p-fab7c1ed.entry.js → p-a5504252.entry.js} +1 -1
- package/lib/duet/{p-50ec2074.entry.js → p-a59b5059.entry.js} +1 -1
- package/lib/duet/{p-716329a7.system.entry.js → p-aa6ad573.system.entry.js} +1 -1
- package/lib/duet/{p-8855bd51.entry.js → p-ab2da6f9.entry.js} +1 -1
- package/lib/duet/{p-032a613f.system.entry.js → p-ad0179fa.system.entry.js} +1 -1
- package/lib/duet/{p-ed011021.system.entry.js → p-ad3021d3.system.entry.js} +1 -1
- package/lib/duet/{p-1a877bd1.system.entry.js → p-ad5e3c9c.system.entry.js} +1 -1
- package/lib/duet/{p-bfeeee67.system.entry.js → p-b022a3d5.system.entry.js} +2 -2
- package/lib/duet/{p-50f4319b.system.entry.js → p-b036d4f0.system.entry.js} +1 -1
- package/lib/duet/{p-98d01f1c.system.entry.js → p-b27b1902.system.entry.js} +1 -1
- package/lib/duet/{p-1b3fde48.entry.js → p-b54be005.entry.js} +1 -1
- package/lib/duet/{p-37af6296.system.entry.js → p-b5831260.system.entry.js} +1 -1
- package/lib/duet/p-b5ffa156.entry.js +4 -0
- package/lib/duet/{p-b46fa994.system.entry.js → p-b62108c8.system.entry.js} +2 -2
- package/lib/duet/{p-6205bcb4.entry.js → p-b62ed1f0.entry.js} +1 -1
- package/lib/duet/{p-bdc59646.entry.js → p-b6af2626.entry.js} +1 -1
- package/lib/duet/{p-0558a17e.system.entry.js → p-b868bb09.system.entry.js} +1 -1
- package/lib/duet/{p-ff09528c.system.entry.js → p-b8b0249f.system.entry.js} +1 -1
- package/lib/duet/{p-def3df7d.entry.js → p-bc16a555.entry.js} +1 -1
- package/lib/duet/p-bcd1e9d8.system.entry.js +4 -0
- package/lib/duet/{p-ee796d5e.system.entry.js → p-bd97fff1.system.entry.js} +1 -1
- package/lib/duet/{p-e1d3c21e.entry.js → p-bf0e9413.entry.js} +1 -1
- package/lib/duet/{p-e3ffb537.system.entry.js → p-bf3bf531.system.entry.js} +1 -1
- package/lib/duet/{p-58a08a7b.system.entry.js → p-c0152624.system.entry.js} +1 -1
- package/lib/duet/{p-6da4db52.system.entry.js → p-c0c9acd9.system.entry.js} +1 -1
- package/lib/duet/{p-7a46b4ef.system.entry.js → p-c565698d.system.entry.js} +1 -1
- package/lib/duet/p-cb69ce4a.entry.js +4 -0
- package/lib/duet/{p-64b323bf.entry.js → p-cd8177fe.entry.js} +1 -1
- package/lib/duet/{p-68f3526e.entry.js → p-cfb85117.entry.js} +1 -1
- package/lib/duet/{p-c5725fee.system.entry.js → p-d13cb6f4.system.entry.js} +1 -1
- package/lib/duet/{p-efa6152d.entry.js → p-d2681203.entry.js} +1 -1
- package/lib/duet/{p-bf3331ed.entry.js → p-d3069a7b.entry.js} +1 -1
- package/lib/duet/{p-c23bf76f.system.entry.js → p-d32e9ae1.system.entry.js} +1 -1
- package/lib/duet/{p-13915ce0.entry.js → p-d41e819d.entry.js} +1 -1
- package/lib/duet/{p-463ddc2c.system.entry.js → p-d5d57b8f.system.entry.js} +1 -1
- package/lib/duet/{p-95df823b.entry.js → p-d73f7574.entry.js} +1 -1
- package/lib/duet/{p-ed8f7cac.entry.js → p-d8104d1b.entry.js} +1 -1
- package/lib/duet/{p-d5a9cfac.entry.js → p-d8ee9cc9.entry.js} +1 -1
- package/lib/duet/{p-7671b7b7.system.js → p-da20db91.system.js} +1 -1
- package/lib/duet/{p-5311f96e.system.entry.js → p-db14fdfd.system.entry.js} +1 -1
- package/lib/duet/{p-c4e79927.entry.js → p-dce5a6f9.entry.js} +1 -1
- package/lib/duet/p-dcfe6e27.system.entry.js +4 -0
- package/lib/duet/{p-8eff5e91.system.entry.js → p-e1f6b6f3.system.entry.js} +2 -2
- package/lib/duet/p-e3574b05.entry.js +4 -0
- package/lib/duet/{p-051488a0.system.entry.js → p-e3a8dcb3.system.entry.js} +1 -1
- package/lib/duet/{p-d02b92fa.entry.js → p-e3c5663f.entry.js} +1 -1
- package/lib/duet/{p-e4aa049f.system.entry.js → p-e6bd0e51.system.entry.js} +1 -1
- package/lib/duet/p-e79bf1c2.entry.js +4 -0
- package/lib/duet/{p-995e1b11.system.entry.js → p-e96a5f8b.system.entry.js} +1 -1
- package/lib/duet/{p-cef36d14.system.entry.js → p-ebe22b98.system.entry.js} +1 -1
- package/lib/duet/{p-5c0de81a.system.entry.js → p-ec98691e.system.entry.js} +1 -1
- package/lib/duet/p-f009e108.entry.js +4 -0
- package/lib/duet/{p-5ae9b74f.entry.js → p-f0dc0a5b.entry.js} +1 -1
- package/lib/duet/{p-da9fe13c.system.entry.js → p-f1d894da.system.entry.js} +1 -1
- package/lib/duet/{p-96f66e14.system.entry.js → p-f25e57fe.system.entry.js} +1 -1
- package/lib/duet/{p-efdbddb5.system.js → p-f3bf4d40.system.js} +1 -1
- package/lib/duet/{p-80d1a5d3.entry.js → p-f4493cb6.entry.js} +1 -1
- package/lib/duet/p-f7b58d72.system.js +5 -0
- package/lib/duet/{p-e7a22d84.system.entry.js → p-f8c64564.system.entry.js} +1 -1
- package/lib/duet/p-fabb616b.js +4 -0
- package/lib/duet/{p-5c5012f6.system.entry.js → p-fb30fcb0.system.entry.js} +1 -1
- package/lib/duet/{p-d4d7d607.system.entry.js → p-fb8a5b68.system.entry.js} +1 -1
- package/lib/duet/{p-34b5285b.system.entry.js → p-fc0fe631.system.entry.js} +2 -2
- package/lib/duet/{p-e491c098.system.entry.js → p-fc4f175f.system.entry.js} +1 -1
- package/lib/duet/{p-7de467b8.entry.js → p-ff815e47.entry.js} +1 -1
- package/lib/esm/app-globals-41b37f11.js +52 -0
- package/lib/esm/{common-strings-c0ac5a0b.js → common-strings-59db6973.js} +6 -6
- package/lib/esm/create-id-149a1b6d.js +11 -0
- package/lib/esm/duet-action-button.entry.js +133 -133
- package/lib/esm/duet-alert.entry.js +106 -106
- package/lib/esm/duet-badge.entry.js +29 -29
- package/lib/esm/duet-banner.entry.js +52 -52
- package/lib/esm/duet-breadcrumb.entry.js +41 -41
- package/lib/esm/duet-breadcrumbs.entry.js +51 -51
- package/lib/esm/duet-button_2.entry.js +229 -229
- package/lib/esm/duet-callout.entry.js +28 -28
- package/lib/esm/duet-caption_4.entry.js +187 -187
- package/lib/esm/duet-card.entry.js +93 -93
- package/lib/esm/duet-checkbox.entry.js +85 -85
- package/lib/esm/duet-checkmark.entry.js +23 -23
- package/lib/esm/duet-chip.entry.js +182 -182
- package/lib/esm/duet-choice_2.entry.js +392 -392
- package/lib/esm/duet-collapsible.entry.js +98 -98
- package/lib/esm/duet-combobox.entry.js +362 -362
- package/lib/esm/duet-contact-card.entry.js +49 -49
- package/lib/esm/duet-cookie-consent.entry.js +35 -35
- package/lib/esm/duet-date-picker.entry.js +610 -610
- package/lib/esm/duet-divider_2.entry.js +53 -53
- package/lib/esm/duet-editable-table_3.entry.js +1247 -1247
- package/lib/esm/duet-empty-state.entry.js +26 -26
- package/lib/esm/duet-fieldset.entry.js +50 -50
- package/lib/esm/duet-file-chooser.entry.js +44 -44
- package/lib/esm/duet-footer.entry.js +118 -118
- package/lib/esm/duet-grid_2.entry.js +185 -185
- package/lib/esm/duet-header_2.entry.js +610 -610
- package/lib/esm/duet-hero.entry.js +172 -172
- package/lib/esm/duet-icon.entry.js +141 -141
- package/lib/esm/duet-input_2.entry.js +346 -346
- package/lib/esm/duet-layout.entry.js +51 -51
- package/lib/esm/duet-list_2.entry.js +99 -99
- package/lib/esm/duet-menu-bar-button.entry.js +70 -70
- package/lib/esm/duet-menu-bar-dropdown-link.entry.js +44 -44
- package/lib/esm/duet-menu-bar-dropdown.entry.js +93 -93
- package/lib/esm/duet-menu-bar-link.entry.js +58 -58
- package/lib/esm/duet-menu-bar.entry.js +116 -116
- package/lib/esm/duet-modal.entry.js +188 -188
- package/lib/esm/duet-multiselect.entry.js +206 -206
- package/lib/esm/duet-nav.entry.js +20 -20
- package/lib/esm/duet-notification_2.entry.js +140 -140
- package/lib/esm/duet-number-input.entry.js +337 -337
- package/lib/esm/duet-page-heading.entry.js +26 -26
- package/lib/esm/duet-pagination_2.entry.js +511 -511
- package/lib/esm/duet-popup-menu-item.entry.js +62 -62
- package/lib/esm/duet-popup-menu.entry.js +147 -147
- package/lib/esm/duet-progress.entry.js +54 -54
- package/lib/esm/duet-promo-card.entry.js +40 -40
- package/lib/esm/duet-radio_2.entry.js +197 -197
- package/lib/esm/duet-range-slider.entry.js +105 -105
- package/lib/esm/duet-scrollable_3.entry.js +384 -386
- package/lib/esm/duet-section-layout.entry.js +21 -21
- package/lib/esm/duet-select.entry.js +156 -156
- package/lib/esm/duet-shaped-image.entry.js +28 -28
- package/lib/esm/duet-show-more.entry.js +98 -98
- package/lib/esm/duet-slideout-lang.entry.js +36 -36
- package/lib/esm/duet-slideout-link.entry.js +33 -33
- package/lib/esm/duet-slideout-panel-dropdown.entry.js +50 -50
- package/lib/esm/duet-slideout-panel.entry.js +120 -120
- package/lib/esm/duet-slideout.entry.js +194 -194
- package/lib/esm/duet-step_2.entry.js +182 -184
- package/lib/esm/duet-submenu-bar-dropdown-link.entry.js +36 -36
- package/lib/esm/duet-submenu-bar-dropdown.entry.js +103 -103
- package/lib/esm/duet-submenu-bar-link.entry.js +59 -59
- package/lib/esm/duet-submenu-bar.entry.js +110 -110
- package/lib/esm/duet-textarea.entry.js +160 -160
- package/lib/esm/duet-toggle.entry.js +72 -72
- package/lib/esm/duet-toolbar-dropdown-link.entry.js +35 -35
- package/lib/esm/duet-toolbar-dropdown.entry.js +59 -59
- package/lib/esm/duet-toolbar-link.entry.js +31 -31
- package/lib/esm/duet-toolbar.entry.js +34 -34
- package/lib/esm/duet-tooltip-button_2.entry.js +98 -80
- package/lib/esm/duet-tooltip.entry.js +185 -187
- package/lib/esm/duet-tray.entry.js +82 -82
- package/lib/esm/duet-upload-aria-status.entry.js +65 -65
- package/lib/esm/duet-upload-item.entry.js +81 -81
- package/lib/esm/duet-visually-hidden.entry.js +12 -12
- package/lib/esm/duet.js +5 -5
- package/lib/esm/errorcodes.utils-e681347c.js +36 -0
- package/lib/esm/focus-utils-d54af982.js +18 -0
- package/lib/esm/{index-b3bf9761.js → index-d4489a2e.js} +106 -45
- package/lib/esm/input-utils-85681162.js +53 -0
- package/lib/esm/is-internet-explorer-2c48f686.js +9 -0
- package/lib/{dist-custom-elements/p-3d8d557b.js → esm/js-utils-9b9e0039.js} +27 -27
- package/lib/esm/{language-utils-9ff76444.js → language-utils-00ca4c55.js} +74 -74
- package/lib/esm/loader.js +4 -4
- package/lib/{dist-custom-elements/p-f8c76b25.js → esm/slot-query-022710bb.js} +1 -1
- package/lib/esm/string-utils-ca039233.js +55 -0
- package/lib/esm/teleport-4462e8c1.js +97 -0
- package/lib/esm/themeable-component-724c0f7e.js +13 -0
- package/lib/esm/token-utils-b4bd3ec7.js +117 -0
- package/lib/esm/watch-options-e96ecd92.js +57 -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-banner.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-callout.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-checkmark.entry.js +1 -1
- package/lib/esm-es5/duet-chip.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 +1 -1
- package/lib/esm-es5/duet-contact-card.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-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-file-chooser.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-menu-bar-button.entry.js +1 -1
- package/lib/esm-es5/duet-menu-bar-dropdown-link.entry.js +1 -1
- package/lib/esm-es5/duet-menu-bar-dropdown.entry.js +1 -1
- package/lib/esm-es5/duet-menu-bar-link.entry.js +1 -1
- package/lib/esm-es5/duet-menu-bar.entry.js +1 -1
- package/lib/esm-es5/duet-modal.entry.js +1 -1
- package/lib/esm-es5/duet-multiselect.entry.js +1 -1
- package/lib/esm-es5/duet-nav.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-page-heading.entry.js +1 -1
- package/lib/esm-es5/duet-pagination_2.entry.js +1 -1
- package/lib/esm-es5/duet-popup-menu-item.entry.js +1 -1
- package/lib/esm-es5/duet-popup-menu.entry.js +1 -1
- package/lib/esm-es5/duet-progress.entry.js +1 -1
- package/lib/esm-es5/duet-promo-card.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 +2 -2
- package/lib/esm-es5/duet-section-layout.entry.js +1 -1
- package/lib/esm-es5/duet-select.entry.js +1 -1
- package/lib/esm-es5/duet-shaped-image.entry.js +1 -1
- package/lib/esm-es5/duet-show-more.entry.js +1 -1
- package/lib/esm-es5/duet-slideout-lang.entry.js +1 -1
- package/lib/esm-es5/duet-slideout-link.entry.js +1 -1
- package/lib/esm-es5/duet-slideout-panel-dropdown.entry.js +1 -1
- package/lib/esm-es5/duet-slideout-panel.entry.js +1 -1
- package/lib/esm-es5/duet-slideout.entry.js +2 -2
- package/lib/esm-es5/duet-step_2.entry.js +2 -2
- package/lib/esm-es5/duet-submenu-bar-dropdown-link.entry.js +1 -1
- package/lib/esm-es5/duet-submenu-bar-dropdown.entry.js +1 -1
- package/lib/esm-es5/duet-submenu-bar-link.entry.js +1 -1
- package/lib/esm-es5/duet-submenu-bar.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-toolbar-dropdown-link.entry.js +1 -1
- package/lib/esm-es5/duet-toolbar-dropdown.entry.js +1 -1
- package/lib/esm-es5/duet-toolbar-link.entry.js +1 -1
- package/lib/esm-es5/duet-toolbar.entry.js +1 -1
- package/lib/esm-es5/duet-tooltip-button_2.entry.js +2 -2
- 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-upload-item.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/{errorcodes.utils-424b1197.js → errorcodes.utils-e681347c.js} +1 -1
- package/lib/esm-es5/focus-utils-d54af982.js +4 -0
- package/lib/esm-es5/index-d4489a2e.js +5 -0
- package/lib/esm-es5/{language-utils-9ff76444.js → language-utils-00ca4c55.js} +1 -1
- package/lib/esm-es5/loader.js +1 -1
- package/lib/types/common/a11y-component.d.ts +7 -7
- package/lib/types/common/form-components.d.ts +15 -15
- package/lib/types/common/themeable-component.d.ts +4 -4
- package/lib/types/components/duet-action-button/duet-action-button.d.ts +126 -126
- package/lib/types/components/duet-alert/duet-alert.d.ts +100 -100
- package/lib/types/components/duet-badge/duet-badge.d.ts +27 -27
- package/lib/types/components/duet-banner/duet-banner.d.ts +58 -58
- package/lib/types/components/duet-breadcrumbs/duet-breadcrumb.d.ts +32 -32
- package/lib/types/components/duet-breadcrumbs/duet-breadcrumbs.d.ts +23 -23
- package/lib/types/components/duet-button/duet-button.d.ts +219 -219
- package/lib/types/components/duet-callout/duet-callout.d.ts +19 -19
- package/lib/types/components/duet-caption/duet-caption.d.ts +26 -26
- package/lib/types/components/duet-card/duet-card.d.ts +119 -119
- package/lib/types/components/duet-checkbox/duet-checkbox.d.ts +132 -132
- package/lib/types/components/duet-chip/duet-chip.d.ts +109 -109
- package/lib/types/components/duet-choice/duet-checkmark.d.ts +27 -27
- package/lib/types/components/duet-choice/duet-choice.d.ts +259 -259
- package/lib/types/components/duet-choice-group/duet-choice-group.d.ts +103 -103
- package/lib/types/components/duet-collapsible/duet-collapsible.d.ts +88 -88
- package/lib/types/components/duet-combobox/duet-combobox-select-single.d.ts +3 -3
- package/lib/types/components/duet-combobox/duet-combobox-select.d.ts +8 -8
- package/lib/types/components/duet-combobox/duet-combobox.d.ts +135 -135
- package/lib/types/components/duet-contact-card/duet-contact-card.d.ts +60 -60
- package/lib/types/components/duet-cookie-consent/duet-cookie-consent.d.ts +29 -29
- package/lib/types/components/duet-date-picker/date-i18n.d.ts +13 -13
- package/lib/types/components/duet-date-picker/date-picker-day.d.ts +9 -9
- package/lib/types/components/duet-date-picker/date-picker-input.d.ts +28 -28
- package/lib/types/components/duet-date-picker/date-picker-month.d.ts +12 -12
- package/lib/types/components/duet-date-picker/duet-date-picker.d.ts +220 -220
- package/lib/types/components/duet-divider/duet-divider.d.ts +26 -26
- package/lib/types/components/duet-editable-table/duet-editable-table-tabledata.d.ts +3 -3
- package/lib/types/components/duet-editable-table/duet-editable-table.d.ts +133 -133
- package/lib/types/components/duet-empty-state/duet-empty-state.d.ts +22 -22
- package/lib/types/components/duet-fieldset/duet-fieldset.d.ts +60 -60
- package/lib/types/components/duet-file-chooser/duet-file-chooser.d.ts +35 -35
- package/lib/types/components/duet-footer/duet-footer.d.ts +143 -143
- package/lib/types/components/duet-grid/duet-grid.d.ts +73 -73
- package/lib/types/components/duet-grid-item/duet-grid-item.d.ts +49 -49
- package/lib/types/components/duet-header/duet-header-dropdown.d.ts +11 -11
- package/lib/types/components/duet-header/duet-header-icon.d.ts +3 -3
- package/lib/types/components/duet-header/duet-header.d.ts +347 -347
- package/lib/types/components/duet-heading/duet-heading.d.ts +49 -49
- package/lib/types/components/duet-hero/duet-hero.d.ts +198 -198
- package/lib/types/components/duet-icon/duet-icon.d.ts +79 -79
- package/lib/types/components/duet-input/duet-input.d.ts +279 -279
- package/lib/types/components/duet-label/duet-label.d.ts +26 -26
- package/lib/types/components/duet-layout/duet-layout.d.ts +48 -48
- package/lib/types/components/duet-link/duet-link.d.ts +94 -94
- package/lib/types/components/duet-list/duet-list.d.ts +60 -60
- package/lib/types/components/duet-list-item/duet-list-item.d.ts +17 -17
- package/lib/types/components/duet-logo/duet-logo.d.ts +59 -59
- package/lib/types/components/duet-menu-bar/duet-menu-bar.d.ts +68 -68
- package/lib/types/components/duet-menu-bar-button/duet-menu-bar-button.d.ts +84 -84
- package/lib/types/components/duet-menu-bar-dropdown/duet-menu-bar-dropdown.d.ts +49 -49
- package/lib/types/components/duet-menu-bar-dropdown-link/duet-menu-bar-dropdown-link.d.ts +36 -36
- package/lib/types/components/duet-menu-bar-link/duet-menu-bar-link.d.ts +44 -44
- package/lib/types/components/duet-modal/duet-modal.d.ts +155 -155
- package/lib/types/components/duet-multiselect/duet-multiselect.d.ts +153 -153
- package/lib/types/components/duet-nav/duet-nav.d.ts +20 -20
- package/lib/types/components/duet-notification/duet-notification.d.ts +55 -55
- package/lib/types/components/duet-notification-drawer/duet-notification-drawer.d.ts +83 -83
- package/lib/types/components/duet-number-input/duet-number-input.d.ts +230 -230
- package/lib/types/components/duet-page-heading/duet-page-heading.d.ts +25 -25
- package/lib/types/components/duet-pagination/duet-pagination.d.ts +129 -129
- package/lib/types/components/duet-paragraph/duet-paragraph.d.ts +38 -38
- package/lib/types/components/duet-popup-menu/duet-popup-menu.d.ts +80 -80
- package/lib/types/components/duet-popup-menu-item/duet-popup-menu-item.d.ts +73 -73
- package/lib/types/components/duet-progress/duet-progress.d.ts +71 -71
- package/lib/types/components/duet-promo-card/duet-promo-card.d.ts +42 -42
- package/lib/types/components/duet-radio/duet-radio.d.ts +145 -145
- package/lib/types/components/duet-radio-group/duet-radio-group.d.ts +93 -93
- package/lib/types/components/duet-range-slider/duet-range-slider.d.ts +130 -130
- package/lib/types/components/duet-range-stepper/duet-range-stepper.d.ts +68 -68
- package/lib/types/components/duet-scrollable/duet-scrollable.d.ts +61 -61
- package/lib/types/components/duet-section-layout/duet-section-layout.d.ts +17 -17
- package/lib/types/components/duet-select/duet-select.d.ts +179 -179
- package/lib/types/components/duet-shaped-image/duet-shaped-image.d.ts +30 -30
- package/lib/types/components/duet-show-more/duet-show-more.d.ts +83 -83
- package/lib/types/components/duet-slideout/duet-slideout.d.ts +86 -86
- package/lib/types/components/duet-slideout-lang/duet-slideout-lang.d.ts +24 -24
- package/lib/types/components/duet-slideout-link/duet-slideout-link.d.ts +55 -55
- package/lib/types/components/duet-slideout-panel/duet-slideout-panel.d.ts +55 -55
- package/lib/types/components/duet-slideout-panel-dropdown/duet-slideout-panel-dropdown.d.ts +39 -39
- package/lib/types/components/duet-spacer/duet-spacer.d.ts +18 -18
- package/lib/types/components/duet-spinner/duet-spinner.d.ts +30 -30
- package/lib/types/components/duet-step/duet-step.d.ts +66 -66
- package/lib/types/components/duet-stepper/duet-stepper.d.ts +47 -47
- package/lib/types/components/duet-submenu-bar/duet-submenu-bar.d.ts +50 -50
- package/lib/types/components/duet-submenu-bar-dropdown/duet-submenu-bar-dropdown.d.ts +47 -47
- package/lib/types/components/duet-submenu-bar-dropdown-link/duet-submenu-bar-dropdown-link.d.ts +43 -43
- package/lib/types/components/duet-submenu-bar-link/duet-submenu-bar-link.d.ts +39 -39
- package/lib/types/components/duet-tab/duet-tab.d.ts +37 -37
- package/lib/types/components/duet-tab-group/duet-tab-group.d.ts +132 -132
- package/lib/types/components/duet-table/duet-table.d.ts +66 -66
- package/lib/types/components/duet-textarea/duet-textarea.d.ts +200 -200
- package/lib/types/components/duet-toggle/duet-toggle.d.ts +113 -113
- package/lib/types/components/duet-toolbar/duet-toolbar.d.ts +30 -30
- package/lib/types/components/duet-toolbar-dropdown/duet-toolbar-dropdown.d.ts +50 -50
- package/lib/types/components/duet-toolbar-dropdown-link/duet-toolbar-dropdown-link.d.ts +43 -43
- package/lib/types/components/duet-toolbar-link/duet-toolbar-link.d.ts +42 -42
- package/lib/types/components/duet-tooltip/duet-tooltip-button.d.ts +22 -19
- package/lib/types/components/duet-tooltip/duet-tooltip-popup.d.ts +34 -31
- package/lib/types/components/duet-tooltip/duet-tooltip.d.ts +122 -122
- package/lib/types/components/duet-tray/duet-tray.d.ts +84 -84
- package/lib/types/components/duet-upload/duet-upload.d.ts +484 -484
- package/lib/types/components/duet-upload/errorcodes.utils.d.ts +3 -3
- package/lib/types/components/duet-upload/upload-editable-item-error.d.ts +2 -2
- package/lib/types/components/duet-upload/upload-editable-item-inprogres.d.ts +2 -2
- package/lib/types/components/duet-upload/upload-editable-item-pending.d.ts +1 -1
- package/lib/types/components/duet-upload/upload-editable-item-success.d.ts +2 -2
- package/lib/types/components/duet-upload/upload-item-header.d.ts +2 -2
- package/lib/types/components/duet-upload/upload-validators.d.ts +4 -4
- package/lib/types/components/duet-upload/xhr.helpers.d.ts +10 -10
- package/lib/types/components/duet-upload-aria-status/duet-upload-aria-status.d.ts +40 -40
- package/lib/types/components/duet-upload-item/duet-upload-item.d.ts +54 -54
- package/lib/types/components/duet-visually-hidden/duet-visually-hidden.d.ts +6 -6
- package/lib/types/stencil-public-runtime.d.ts +8 -0
- package/lib/types/utils/axe-core-utils.d.ts +3 -3
- package/lib/types/utils/fixture-utils.d.ts +2 -2
- package/lib/types/utils/focus-utils.d.ts +2 -2
- package/lib/types/utils/language-utils.d.ts +10 -10
- package/lib/types/utils/picture-utils.d.ts +10 -10
- package/lib/types/utils/teleport.d.ts +20 -20
- package/lib/types/utils/template-utils.d.ts +1 -1
- package/lib/types/utils/test-utils.d.ts +2 -2
- package/lib/types/utils/token-utils.d.ts +9 -9
- package/package.json +6 -6
- package/lib/cjs/app-globals-4ab83f59.js +0 -54
- package/lib/cjs/create-id-167cd350.js +0 -13
- package/lib/cjs/errorcodes.utils-8e928de5.js +0 -39
- package/lib/cjs/focus-utils-aea9f4e1.js +0 -21
- package/lib/cjs/input-utils-b4615782.js +0 -56
- package/lib/cjs/string-utils-51a2f59f.js +0 -59
- package/lib/cjs/teleport-af825e04.js +0 -99
- package/lib/cjs/themeable-component-0be6d1f4.js +0 -15
- package/lib/cjs/token-utils-dbfeff2e.js +0 -124
- package/lib/cjs/watch-options-1773d69f.js +0 -61
- package/lib/dist-custom-elements/p-03ac3eb3.js +0 -137
- package/lib/dist-custom-elements/p-1a395a8d.js +0 -55
- package/lib/dist-custom-elements/p-1ce55654.js +0 -265
- package/lib/dist-custom-elements/p-1f56e02f.js +0 -174
- package/lib/dist-custom-elements/p-24853ebf.js +0 -97
- package/lib/dist-custom-elements/p-268171f7.js +0 -9
- package/lib/dist-custom-elements/p-3049dfd5.js +0 -147
- package/lib/dist-custom-elements/p-45f71a69.js +0 -11
- package/lib/dist-custom-elements/p-4687ca41.js +0 -465
- package/lib/dist-custom-elements/p-5d8d9a52.js +0 -98
- package/lib/dist-custom-elements/p-62e68de8.js +0 -38
- package/lib/dist-custom-elements/p-64cd1abb.js +0 -93
- package/lib/dist-custom-elements/p-665418f0.js +0 -205
- package/lib/dist-custom-elements/p-759c725f.js +0 -226
- package/lib/dist-custom-elements/p-77f2dbee.js +0 -53
- package/lib/dist-custom-elements/p-80ec4336.js +0 -123
- package/lib/dist-custom-elements/p-8be301dd.js +0 -62
- package/lib/dist-custom-elements/p-9541f0b6.js +0 -59
- package/lib/dist-custom-elements/p-a1371eee.js +0 -57
- package/lib/dist-custom-elements/p-a3923b18.js +0 -126
- package/lib/dist-custom-elements/p-c5032d3a.js +0 -18
- package/lib/dist-custom-elements/p-d48735b6.js +0 -13
- package/lib/dist-custom-elements/p-e19d1e27.js +0 -117
- package/lib/dist-custom-elements/p-e6b07569.js +0 -271
- package/lib/dist-custom-elements/p-e77f7fff.js +0 -60
- package/lib/dist-custom-elements/p-f27e355b.js +0 -76
- package/lib/dist-custom-elements/p-f46be918.js +0 -110
- package/lib/dist-custom-elements/p-fd4877d1.js +0 -72
- package/lib/dist-custom-elements/p-fe8a2205.js +0 -206
- package/lib/duet/p-08764d71.entry.js +0 -4
- package/lib/duet/p-0a664ebb.entry.js +0 -4
- package/lib/duet/p-11571ab9.entry.js +0 -4
- package/lib/duet/p-4669b0af.js +0 -4
- package/lib/duet/p-486eec2d.entry.js +0 -4
- package/lib/duet/p-4dc0fff9.entry.js +0 -4
- package/lib/duet/p-52806dad.system.entry.js +0 -4
- package/lib/duet/p-6c4c0279.js +0 -5
- package/lib/duet/p-7bca584a.entry.js +0 -4
- package/lib/duet/p-7c36b779.entry.js +0 -4
- package/lib/duet/p-821c350f.system.entry.js +0 -4
- package/lib/duet/p-a0660ffa.system.js +0 -5
- package/lib/duet/p-ac9f6601.entry.js +0 -4
- package/lib/duet/p-b3ae5641.system.entry.js +0 -4
- package/lib/duet/p-c1bc9249.entry.js +0 -4
- package/lib/duet/p-d098d59c.system.entry.js +0 -4
- package/lib/duet/p-f58eb425.js +0 -4
- package/lib/duet/p-fab6160a.entry.js +0 -4
- package/lib/esm/app-globals-de2a5510.js +0 -52
- package/lib/esm/create-id-2b0cd46d.js +0 -11
- package/lib/esm/errorcodes.utils-424b1197.js +0 -36
- package/lib/esm/focus-utils-74961919.js +0 -18
- package/lib/esm/input-utils-a0225b92.js +0 -53
- package/lib/esm/is-internet-explorer-032d4dae.js +0 -9
- package/lib/esm/string-utils-59ad4cb2.js +0 -55
- package/lib/esm/teleport-15747328.js +0 -97
- package/lib/esm/themeable-component-fdce4fd7.js +0 -13
- package/lib/esm/token-utils-46c8fe31.js +0 -117
- package/lib/esm/watch-options-f189118b.js +0 -57
- package/lib/esm-es5/focus-utils-74961919.js +0 -4
- package/lib/esm-es5/index-b3bf9761.js +0 -5
- /package/lib/duet/{p-b1db3006.js → p-0782a6e5.js} +0 -0
- /package/lib/duet/{p-1a395a8d.js → p-0e052642.js} +0 -0
- /package/lib/duet/{p-f8c76b25.js → p-11230037.js} +0 -0
- /package/lib/duet/{p-0b31864f.js → p-38320af8.js} +0 -0
- /package/lib/duet/{p-c30a5f7c.system.js → p-41982d26.system.js} +0 -0
- /package/lib/duet/{p-268171f7.js → p-43b89e38.js} +0 -0
- /package/lib/duet/{p-274d11e3.js → p-4ab776f4.js} +0 -0
- /package/lib/duet/{p-77b6e4ba.system.js → p-50f4bca2.system.js} +0 -0
- /package/lib/duet/{p-45f71a69.js → p-5e59e970.js} +0 -0
- /package/lib/duet/{p-75daef16.system.js → p-634e8787.system.js} +0 -0
- /package/lib/duet/{p-719b38fe.system.js → p-67c653f9.system.js} +0 -0
- /package/lib/duet/{p-b99c00fa.system.js → p-6ef75455.system.js} +0 -0
- /package/lib/duet/{p-a1371eee.js → p-7d8a2628.js} +0 -0
- /package/lib/duet/{p-21f3a17a.system.js → p-81a6df68.system.js} +0 -0
- /package/lib/duet/{p-ecf1f6cd.system.js → p-9e36548d.system.js} +0 -0
- /package/lib/duet/{p-3d8d557b.js → p-9e371678.js} +0 -0
- /package/lib/duet/{p-d48735b6.js → p-a58bd561.js} +0 -0
- /package/lib/duet/{p-8e1da663.system.js → p-afad5fd3.system.js} +0 -0
- /package/lib/duet/{p-24853ebf.js → p-b2e550a3.js} +0 -0
- /package/lib/duet/{p-7c29d36a.system.js → p-b864159a.system.js} +0 -0
- /package/lib/duet/{p-88a50491.system.js → p-d1cedaa1.system.js} +0 -0
- /package/lib/duet/{p-77f2dbee.js → p-df7874f9.js} +0 -0
- /package/lib/duet/{p-87dd7bf3.system.js → p-e12066c8.system.js} +0 -0
- /package/lib/duet/{p-1a91e22a.system.js → p-e6b5a1c7.system.js} +0 -0
- /package/lib/esm-es5/{app-globals-de2a5510.js → app-globals-41b37f11.js} +0 -0
- /package/lib/esm-es5/{common-strings-c0ac5a0b.js → common-strings-59db6973.js} +0 -0
- /package/lib/esm-es5/{create-id-2b0cd46d.js → create-id-149a1b6d.js} +0 -0
- /package/lib/esm-es5/{input-utils-a0225b92.js → input-utils-85681162.js} +0 -0
- /package/lib/esm-es5/{is-internet-explorer-032d4dae.js → is-internet-explorer-2c48f686.js} +0 -0
- /package/lib/esm-es5/{js-utils-a35dcc8c.js → js-utils-9b9e0039.js} +0 -0
- /package/lib/esm-es5/{slot-query-7877f18f.js → slot-query-022710bb.js} +0 -0
- /package/lib/esm-es5/{string-utils-59ad4cb2.js → string-utils-ca039233.js} +0 -0
- /package/lib/esm-es5/{teleport-15747328.js → teleport-4462e8c1.js} +0 -0
- /package/lib/esm-es5/{themeable-component-fdce4fd7.js → themeable-component-724c0f7e.js} +0 -0
- /package/lib/esm-es5/{token-utils-46c8fe31.js → token-utils-b4bd3ec7.js} +0 -0
- /package/lib/esm-es5/{watch-options-f189118b.js → watch-options-e96ecd92.js} +0 -0
|
@@ -1,301 +1,301 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built with Duet Design System
|
|
3
3
|
*/
|
|
4
|
-
import { h, r as registerInstance, c as createEvent, H as Host, g as getElement, F as Fragment } from './index-
|
|
5
|
-
import { i as inheritGlobalTheme } from './themeable-component-
|
|
6
|
-
import { f as fieldSorter, d as debounce } from './js-utils-
|
|
4
|
+
import { h, r as registerInstance, c as createEvent, H as Host, g as getElement, F as Fragment } from './index-d4489a2e.js';
|
|
5
|
+
import { i as inheritGlobalTheme } from './themeable-component-724c0f7e.js';
|
|
6
|
+
import { f as fieldSorter, d as debounce } from './js-utils-9b9e0039.js';
|
|
7
7
|
import { i as isKeyboardClick } from './keyboard-utils-5746e126.js';
|
|
8
|
-
import { a as getLanguage, c as connectLanguageChangeObserver, d as disconnectLanguageChangeObserver, g as getLocaleString, s as sanitizeString } from './language-utils-
|
|
8
|
+
import { a as getLanguage, c as connectLanguageChangeObserver, d as disconnectLanguageChangeObserver, g as getLocaleString, s as sanitizeString } from './language-utils-00ca4c55.js';
|
|
9
9
|
import { p as sizeNavigation, s as sizeHeader } from './tokens.module-c7944140.js';
|
|
10
|
-
import { b as breakpointTokensUpTo, a as breakpointToToken } from './token-utils-
|
|
11
|
-
import { c as createID } from './create-id-
|
|
12
|
-
import { g as getError, a as getI18nError } from './errorcodes.utils-
|
|
13
|
-
import './string-utils-
|
|
10
|
+
import { b as breakpointTokensUpTo, a as breakpointToToken } from './token-utils-b4bd3ec7.js';
|
|
11
|
+
import { c as createID } from './create-id-149a1b6d.js';
|
|
12
|
+
import { g as getError, a as getI18nError } from './errorcodes.utils-e681347c.js';
|
|
13
|
+
import './string-utils-ca039233.js';
|
|
14
14
|
|
|
15
15
|
//simple functional component that renders the data in the table
|
|
16
16
|
const TableData = ({ data, groupId, alignment }, _children) => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
const classNames = `duet-editable-table duet-editable-table-content-${groupId}`;
|
|
18
|
+
if (typeof data === "string") {
|
|
19
|
+
return h("td", { innerHTML: data, class: classNames, part: `${groupId}content`, style: { verticalAlign: alignment } });
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
return (h("td", { class: classNames, part: `${groupId}content`, style: { verticalAlign: alignment } }, data));
|
|
23
|
+
}
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
const duetEditableTableCss = ".sc-duet-editable-table-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.duet-editable-table-actions-menu.sc-duet-editable-table{position:relative;padding:0 !important;margin:0}.duet-editable-table-actions-menu-button.sc-duet-editable-table{position:relative;right:-16px;float:right;padding:0}.duet-editable-table-actions-menu-icon.sc-duet-editable-table .duet-icon.sc-duet-editable-table{max-width:16px;max-height:16px}.duet-editable-table-row.duet-table-action-row.sc-duet-editable-table .duet-text-right.sc-duet-editable-table{text-align:right}.duet-editable-table-header.sc-duet-editable-table tr.sc-duet-editable-table .duet-editable-table-header-hidden.sc-duet-editable-table{padding:0 !important;font-size:0;border-bottom:0}";
|
|
27
27
|
|
|
28
28
|
const DuetEditableTable = class {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
29
|
+
constructor(hostRef) {
|
|
30
|
+
registerInstance(this, hostRef);
|
|
31
|
+
this.duetTableToggle = createEvent(this, "duetTableToggle", 7);
|
|
32
|
+
this.duetMenuClick = createEvent(this, "duetMenuClick", 7);
|
|
33
|
+
this.hasHeadSlotFirst = false;
|
|
34
|
+
this.hasHeadSlotLast = false;
|
|
35
|
+
this.hasFootSlot = false;
|
|
36
|
+
this.sortableDefaultLabel = {
|
|
37
|
+
fi: "Järjestä",
|
|
38
|
+
en: "Click to sort",
|
|
39
|
+
sv: "Klicka för att sortera",
|
|
40
|
+
};
|
|
41
|
+
this.actionColumnLabel = {
|
|
42
|
+
en: "Actions for rows",
|
|
43
|
+
fi: "Toiminnot rivillä",
|
|
44
|
+
sv: "Åtgärder för rader",
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Private methods.
|
|
48
|
+
*/
|
|
49
|
+
this.toggleColumn = (column, e) => {
|
|
50
|
+
e.preventDefault();
|
|
51
|
+
const { sort_order, direction, index, key } = column;
|
|
52
|
+
this.duetTableToggle.emit({
|
|
53
|
+
sort_order,
|
|
54
|
+
index,
|
|
55
|
+
direction,
|
|
56
|
+
key,
|
|
57
|
+
component: "duet-editable-table",
|
|
58
|
+
originalEvent: e,
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
this.handleKeyDown = (column, e) => {
|
|
62
|
+
if (isKeyboardClick(e)) {
|
|
63
|
+
this.toggleColumn(column, e);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
this.language = getLanguage();
|
|
67
|
+
this.margin = "auto";
|
|
68
|
+
this.variation = "striped";
|
|
69
|
+
this.sticky = false;
|
|
70
|
+
this.stickyDistance = "with-links";
|
|
71
|
+
this.breakpoint = "small";
|
|
72
|
+
this.actions = undefined;
|
|
73
|
+
this.columns = undefined;
|
|
74
|
+
this.rows = undefined;
|
|
75
|
+
this.sortable = false;
|
|
76
|
+
this.groupId = "";
|
|
77
|
+
this.theme = "";
|
|
78
|
+
this.accessibleRole = undefined;
|
|
79
|
+
this.hideHeadVisually = false;
|
|
80
|
+
}
|
|
46
81
|
/**
|
|
47
|
-
*
|
|
82
|
+
* Component lifecycle events.
|
|
48
83
|
*/
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
index,
|
|
55
|
-
direction,
|
|
56
|
-
key,
|
|
57
|
-
component: "duet-editable-table",
|
|
58
|
-
originalEvent: e,
|
|
59
|
-
});
|
|
60
|
-
};
|
|
61
|
-
this.handleKeyDown = (column, e) => {
|
|
62
|
-
if (isKeyboardClick(e)) {
|
|
63
|
-
this.toggleColumn(column, e);
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
this.language = getLanguage();
|
|
67
|
-
this.margin = "auto";
|
|
68
|
-
this.variation = "striped";
|
|
69
|
-
this.sticky = false;
|
|
70
|
-
this.stickyDistance = "with-links";
|
|
71
|
-
this.breakpoint = "small";
|
|
72
|
-
this.actions = undefined;
|
|
73
|
-
this.columns = undefined;
|
|
74
|
-
this.rows = undefined;
|
|
75
|
-
this.sortable = false;
|
|
76
|
-
this.groupId = "";
|
|
77
|
-
this.theme = "";
|
|
78
|
-
this.accessibleRole = undefined;
|
|
79
|
-
this.hideHeadVisually = false;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Component lifecycle events.
|
|
83
|
-
*/
|
|
84
|
-
componentWillLoad() {
|
|
85
|
-
inheritGlobalTheme(this);
|
|
86
|
-
this.hasHeadSlotFirst = !!this.element.querySelector("[slot='thead-first']");
|
|
87
|
-
this.hasHeadSlotLast = !!this.element.querySelector("[slot='thead-last']");
|
|
88
|
-
this.hasFootSlot = !!this.element.querySelector("[slot='tfoot']");
|
|
89
|
-
}
|
|
90
|
-
connectedCallback() {
|
|
91
|
-
connectLanguageChangeObserver(this);
|
|
92
|
-
}
|
|
93
|
-
disconnectedCallback() {
|
|
94
|
-
disconnectLanguageChangeObserver(this);
|
|
95
|
-
}
|
|
96
|
-
createLabel(column) {
|
|
97
|
-
const { sort_order, direction, index, label } = column;
|
|
98
|
-
const i18nLabel = getLocaleString(label);
|
|
99
|
-
if (!this.sortable) {
|
|
100
|
-
return i18nLabel;
|
|
84
|
+
componentWillLoad() {
|
|
85
|
+
inheritGlobalTheme(this);
|
|
86
|
+
this.hasHeadSlotFirst = !!this.element.querySelector("[slot='thead-first']");
|
|
87
|
+
this.hasHeadSlotLast = !!this.element.querySelector("[slot='thead-last']");
|
|
88
|
+
this.hasFootSlot = !!this.element.querySelector("[slot='tfoot']");
|
|
101
89
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
// "action-arrow-down-small" https://cdn.duetds.com/api/icons/2.2.12/lib/assets/action-arrow-down-small.svg
|
|
105
|
-
// "action-arrow-up-small" https://cdn.duetds.com/api/icons/2.2.12/lib/assets/action-arrow-up-small.svg
|
|
106
|
-
if (!!sort_order && direction === 1) {
|
|
107
|
-
return "action-arrow-down-small";
|
|
108
|
-
}
|
|
109
|
-
else if (!!sort_order && direction === -1) {
|
|
110
|
-
return "action-arrow-up-small";
|
|
111
|
-
}
|
|
112
|
-
return "action-subtract-small";
|
|
113
|
-
};
|
|
114
|
-
return (h("span", { class: "duet-table-label", "data-index": index }, h("duet-button", { size: "small", icon: getButtonIcon(), "icon-size": "medium-small", "accessible-label": this.sortableDefaultLabel[this.language], variation: "plain", margin: "none", "icon-right": true, onClick: event => this.toggleColumn(column, event), onKeyDown: event => this.handleKeyDown(column, event) }, i18nLabel)));
|
|
115
|
-
}
|
|
116
|
-
getSortedColumns() {
|
|
117
|
-
//create a new array from sort instead of mutating original
|
|
118
|
-
return [...this.columns].sort(fieldSorter(["index"]));
|
|
119
|
-
}
|
|
120
|
-
getRowSortOrder() {
|
|
121
|
-
//create a new array from sort instead of mutating original
|
|
122
|
-
const fields = [...this.columns].sort(fieldSorter(["sort_order"]));
|
|
123
|
-
//return only key from objects that have sort_order
|
|
124
|
-
return fields
|
|
125
|
-
.filter(column => column.sort_order)
|
|
126
|
-
.map(column => {
|
|
127
|
-
// add - in-front of descending direction (required by field-sorter)
|
|
128
|
-
return column.direction === -1 ? `-${column.key}` : column.key;
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
renderTableHeader() {
|
|
132
|
-
if (!this.columns) {
|
|
133
|
-
return;
|
|
90
|
+
connectedCallback() {
|
|
91
|
+
connectLanguageChangeObserver(this);
|
|
134
92
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
93
|
+
disconnectedCallback() {
|
|
94
|
+
disconnectLanguageChangeObserver(this);
|
|
95
|
+
}
|
|
96
|
+
createLabel(column) {
|
|
97
|
+
const { sort_order, direction, index, label } = column;
|
|
98
|
+
const i18nLabel = getLocaleString(label);
|
|
99
|
+
if (!this.sortable) {
|
|
100
|
+
return i18nLabel;
|
|
101
|
+
}
|
|
102
|
+
const getButtonIcon = () => {
|
|
103
|
+
// "action-subtract-small" https://cdn.duetds.com/api/icons/2.2.12/lib/assets/action-subtract-small.svg
|
|
104
|
+
// "action-arrow-down-small" https://cdn.duetds.com/api/icons/2.2.12/lib/assets/action-arrow-down-small.svg
|
|
105
|
+
// "action-arrow-up-small" https://cdn.duetds.com/api/icons/2.2.12/lib/assets/action-arrow-up-small.svg
|
|
106
|
+
if (!!sort_order && direction === 1) {
|
|
107
|
+
return "action-arrow-down-small";
|
|
108
|
+
}
|
|
109
|
+
else if (!!sort_order && direction === -1) {
|
|
110
|
+
return "action-arrow-up-small";
|
|
111
|
+
}
|
|
112
|
+
return "action-subtract-small";
|
|
113
|
+
};
|
|
114
|
+
return (h("span", { class: "duet-table-label", "data-index": index }, h("duet-button", { size: "small", icon: getButtonIcon(), "icon-size": "medium-small", "accessible-label": this.sortableDefaultLabel[this.language], variation: "plain", margin: "none", "icon-right": true, onClick: event => this.toggleColumn(column, event), onKeyDown: event => this.handleKeyDown(column, event) }, i18nLabel)));
|
|
115
|
+
}
|
|
116
|
+
getSortedColumns() {
|
|
117
|
+
//create a new array from sort instead of mutating original
|
|
118
|
+
return [...this.columns].sort(fieldSorter(["index"]));
|
|
119
|
+
}
|
|
120
|
+
getRowSortOrder() {
|
|
121
|
+
//create a new array from sort instead of mutating original
|
|
122
|
+
const fields = [...this.columns].sort(fieldSorter(["sort_order"]));
|
|
123
|
+
//return only key from objects that have sort_order
|
|
124
|
+
return fields
|
|
125
|
+
.filter(column => column.sort_order)
|
|
126
|
+
.map(column => {
|
|
127
|
+
// add - in-front of descending direction (required by field-sorter)
|
|
128
|
+
return column.direction === -1 ? `-${column.key}` : column.key;
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
renderTableHeader() {
|
|
132
|
+
if (!this.columns) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
const sortedColumns = this.getSortedColumns();
|
|
136
|
+
return (h("tr", { class: {
|
|
137
|
+
"duet-table-action-header": !!this.actions,
|
|
138
|
+
} }, sortedColumns.map(column => {
|
|
139
|
+
if (column.display !== false) {
|
|
140
|
+
const label = this.createLabel(column);
|
|
141
|
+
return label !== "" ? h("th", { scope: "col" }, label) : h("td", null);
|
|
142
|
+
}
|
|
143
|
+
}), this.actions && (h("th", { scope: "col", class: "duet-table-action-header-heading" }, this.actions && h("duet-visually-hidden", null, this.actionColumnLabel[this.language])))));
|
|
144
|
+
}
|
|
145
|
+
renderActions(rowItem, index) {
|
|
146
|
+
// escape early
|
|
147
|
+
if (!this.actions) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
// iterate through actions and add them in the sidebar
|
|
151
|
+
return (h("td", { class: "duet-text-right" }, this.actions.map(actionItem => {
|
|
152
|
+
return (h("duet-action-button", { actionMeta: Object.assign({}, (rowItem === null || rowItem === void 0 ? void 0 : rowItem.meta) || {}, { index }), actionId: (rowItem === null || rowItem === void 0 ? void 0 : rowItem.uid) || (rowItem === null || rowItem === void 0 ? void 0 : rowItem.id) || null, actionName: actionItem.name, theme: this.theme, iconName: actionItem.icon, iconColor: actionItem.color, iconSize: actionItem.size, background: actionItem.background, "accessible-label": `${rowItem.actionDescription || ""} ${getLocaleString(actionItem.label)} ` }));
|
|
153
|
+
})));
|
|
154
|
+
}
|
|
155
|
+
renderTableBody() {
|
|
156
|
+
const columns = this.getSortedColumns();
|
|
157
|
+
const rowSortOrder = this.getRowSortOrder();
|
|
158
|
+
const sortedRows = [...this.rows].sort(fieldSorter(rowSortOrder));
|
|
159
|
+
// return a tbody with rows for each item in sortedRows
|
|
160
|
+
return sortedRows.map((row, index) => (h("tr", { class: {
|
|
161
|
+
"duet-table-action-row": !!this.actions,
|
|
162
|
+
"duet-editable-table-row": true,
|
|
163
|
+
[`duet-editable-table-row-${this.groupId}`]: true,
|
|
164
|
+
}, "data-meta": JSON.stringify(row.meta) }, columns.map(column => {
|
|
165
|
+
//if we don't have any data for this column, try getting an item instead (for backwards compatibility
|
|
166
|
+
const value = row[column.key] ? row[column.key] : row.item;
|
|
167
|
+
if (column.display !== false) {
|
|
168
|
+
return h(TableData, { data: value, groupId: this.groupId });
|
|
169
|
+
}
|
|
170
|
+
}), this.actions && this.renderActions(row, index))));
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Render Methods
|
|
174
|
+
*/
|
|
175
|
+
render() {
|
|
176
|
+
return (h(Host, { class: {
|
|
177
|
+
[`duet-editable-table-${this.variation}`]: true,
|
|
178
|
+
"duet-editable-table": true,
|
|
179
|
+
[`duet-editable-table-${this.theme}`]: true,
|
|
180
|
+
// sticky only valid when in regular table layout
|
|
181
|
+
"duet-editable-table-scrollable": this.breakpoint === "none-scrollable",
|
|
182
|
+
"duet-editable-table-sortable": this.sortable,
|
|
183
|
+
"duet-editable-table-actions": !!this.actions,
|
|
184
|
+
"duet-m-0": this.margin === "none",
|
|
185
|
+
"duet-theme-turva": this.theme === "turva",
|
|
186
|
+
} }, h("duet-table", { class: "duet-editable-table-table", sticky: this.sticky, stickyDistance: this.stickyDistance, margin: this.margin, theme: this.theme, variation: this.variation, breakpoint: this.breakpoint, "hide-head-visually": this.hideHeadVisually }, h("table", { role: this.accessibleRole }, h("caption", null, h("slot", { name: "tcaption" })), h("thead", null, this.hasHeadSlotFirst && (h("tr", null, h("td", { class: "duet-editable-table-actions-menu", colSpan: 99 }, h("slot", { name: "thead-first" })))), this.renderTableHeader(), this.hasHeadSlotLast && (h("tr", null, h("td", { class: "duet-editable-table-actions-menu", colSpan: 99 }, h("slot", { name: "thead-last" }))))), h("tbody", null, this.renderTableBody()), this.hasFootSlot && (h("tfoot", null, h("tr", null, h("td", { class: "duet-editable-table-footer-menu", colSpan: 99 }, h("slot", { name: "tfoot" })))))))));
|
|
149
187
|
}
|
|
150
|
-
|
|
151
|
-
return (h("td", { class: "duet-text-right" }, this.actions.map(actionItem => {
|
|
152
|
-
return (h("duet-action-button", { actionMeta: Object.assign({}, (rowItem === null || rowItem === void 0 ? void 0 : rowItem.meta) || {}, { index }), actionId: (rowItem === null || rowItem === void 0 ? void 0 : rowItem.uid) || (rowItem === null || rowItem === void 0 ? void 0 : rowItem.id) || null, actionName: actionItem.name, theme: this.theme, iconName: actionItem.icon, iconColor: actionItem.color, iconSize: actionItem.size, background: actionItem.background, "accessible-label": `${rowItem.actionDescription || ""} ${getLocaleString(actionItem.label)} ` }));
|
|
153
|
-
})));
|
|
154
|
-
}
|
|
155
|
-
renderTableBody() {
|
|
156
|
-
const columns = this.getSortedColumns();
|
|
157
|
-
const rowSortOrder = this.getRowSortOrder();
|
|
158
|
-
const sortedRows = [...this.rows].sort(fieldSorter(rowSortOrder));
|
|
159
|
-
// return a tbody with rows for each item in sortedRows
|
|
160
|
-
return sortedRows.map((row, index) => (h("tr", { class: {
|
|
161
|
-
"duet-table-action-row": !!this.actions,
|
|
162
|
-
"duet-editable-table-row": true,
|
|
163
|
-
[`duet-editable-table-row-${this.groupId}`]: true,
|
|
164
|
-
}, "data-meta": JSON.stringify(row.meta) }, columns.map(column => {
|
|
165
|
-
//if we don't have any data for this column, try getting an item instead (for backwards compatibility
|
|
166
|
-
const value = row[column.key] ? row[column.key] : row.item;
|
|
167
|
-
if (column.display !== false) {
|
|
168
|
-
return h(TableData, { data: value, groupId: this.groupId });
|
|
169
|
-
}
|
|
170
|
-
}), this.actions && this.renderActions(row, index))));
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* Render Methods
|
|
174
|
-
*/
|
|
175
|
-
render() {
|
|
176
|
-
return (h(Host, { class: {
|
|
177
|
-
[`duet-editable-table-${this.variation}`]: true,
|
|
178
|
-
"duet-editable-table": true,
|
|
179
|
-
[`duet-editable-table-${this.theme}`]: true,
|
|
180
|
-
// sticky only valid when in regular table layout
|
|
181
|
-
"duet-editable-table-scrollable": this.breakpoint === "none-scrollable",
|
|
182
|
-
"duet-editable-table-sortable": this.sortable,
|
|
183
|
-
"duet-editable-table-actions": !!this.actions,
|
|
184
|
-
"duet-m-0": this.margin === "none",
|
|
185
|
-
"duet-theme-turva": this.theme === "turva",
|
|
186
|
-
} }, h("duet-table", { class: "duet-editable-table-table", sticky: this.sticky, stickyDistance: this.stickyDistance, margin: this.margin, theme: this.theme, variation: this.variation, breakpoint: this.breakpoint, "hide-head-visually": this.hideHeadVisually }, h("table", { role: this.accessibleRole }, h("caption", null, h("slot", { name: "tcaption" })), h("thead", null, this.hasHeadSlotFirst && (h("tr", null, h("td", { class: "duet-editable-table-actions-menu", colSpan: 99 }, h("slot", { name: "thead-first" })))), this.renderTableHeader(), this.hasHeadSlotLast && (h("tr", null, h("td", { class: "duet-editable-table-actions-menu", colSpan: 99 }, h("slot", { name: "thead-last" }))))), h("tbody", null, this.renderTableBody()), this.hasFootSlot && (h("tfoot", null, h("tr", null, h("td", { class: "duet-editable-table-footer-menu", colSpan: 99 }, h("slot", { name: "tfoot" })))))))));
|
|
187
|
-
}
|
|
188
|
-
get element() { return getElement(this); }
|
|
188
|
+
get element() { return getElement(this); }
|
|
189
189
|
};
|
|
190
190
|
DuetEditableTable.style = duetEditableTableCss;
|
|
191
191
|
|
|
192
192
|
const duetTableCss = "duet-table{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-bottom:20px !important;display:block;font-variant-numeric:tabular-nums}duet-table table,duet-table thead,duet-table tbody,duet-table tfoot,duet-table th,duet-table td,duet-table tr{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}duet-table.duet-m-0{margin:0 !important}duet-table table{width:100%;font-family:\"localtapiola-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-size:1rem;text-align:left;border-spacing:0;border-collapse:separate}duet-table.duet-table-hide-head-visually.duet-table-hide-head-visually thead,duet-table.duet-table-hide-head-visually.duet-table-hide-head-visually thead *{position:absolute !important;top:0;width:1px !important;height:1px !important;padding:0 !important;overflow:hidden !important;clip:rect(1px, 1px, 1px, 1px) !important;border:0 !important}duet-table.duet-theme-turva table{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"}duet-table td{-webkit-hyphens:auto;hyphens:auto;color:rgb(0, 41, 77)}duet-table.duet-theme-turva td{color:rgb(23, 28, 58)}duet-table th{font-weight:600;line-height:1.25;color:rgb(101, 119, 135);text-align:left}duet-table.duet-theme-turva th{color:rgb(116, 116, 117)}duet-table tbody th{font-weight:600;color:rgb(0, 41, 77)}duet-table.duet-theme-turva tbody th{color:rgb(23, 28, 58)}duet-table .duet-table-action-row td:last-child{justify-self:end;padding-right:20px !important;white-space:nowrap}duet-table span.duet-table-cell-heading{display:none}.duet-table-flattened table,.duet-table-flattened thead,.duet-table-flattened tbody,.duet-table-flattened tfoot,.duet-table-flattened th,.duet-table-flattened td,.duet-table-flattened tr{display:block}.duet-table-flattened thead tr{position:absolute !important;top:0;width:1px !important;height:1px !important;padding:0 !important;overflow:hidden !important;clip:rect(1px, 1px, 1px, 1px) !important;border:0 !important}.duet-table-flattened td{line-height:1.25}.duet-table-flattened td:not(:last-child){margin-bottom:16px !important}.duet-table-flattened td span.duet-table-cell-heading{margin-bottom:4px !important;display:block;font-size:1rem;font-weight:600;color:rgb(0, 41, 77)}.duet-table-flattened.duet-theme-turva td span.duet-table-cell-heading{color:rgb(23, 28, 58)}.duet-table-flattened tbody td,.duet-table-flattened tbody th,.duet-table-flattened tfoot td{padding:0 !important;text-align:left !important}.duet-table-flattened tbody th{font-weight:600;line-height:1.25;color:rgb(101, 119, 135);text-align:left}.duet-table-sticky thead th{position:sticky;top:0;background:rgb(255, 255, 255)}.duet-table-striped td,.duet-table-striped th{padding:20px !important}@media (max-width: 35.9375em){.duet-table-striped td,.duet-table-striped th{padding:20px 12px !important}}.duet-table-striped tbody th{background:rgb(255, 255, 255)}.duet-table-striped.duet-table-sticky thead th{border-bottom:1px solid rgb(225, 227, 230)}.duet-table-striped.duet-table-sticky.duet-theme-turva thead th{border-bottom-color:rgb(228, 228, 230)}.duet-table-striped tbody:not(:first-of-type) th{padding-top:40px !important}.duet-table-striped tbody:only-of-type tr:nth-of-type(odd){background:rgba(0, 80, 128, 0.04)}.duet-table-striped.duet-theme-turva tbody:only-of-type tr:nth-of-type(odd){background:rgba(23, 28, 58, 0.04)}.duet-table-striped tbody:not(:only-of-type) tr:nth-of-type(even){background:rgba(0, 80, 128, 0.04)}.duet-table-striped.duet-theme-turva tbody:not(:only-of-type) tr:nth-of-type(even){background:rgba(23, 28, 58, 0.04)}.duet-table-striped tfoot td{border-top:1px solid rgb(225, 227, 230)}.duet-table-striped.duet-theme-turva tfoot td{border-top-color:rgb(228, 228, 230)}.duet-table-striped.duet-table-flattened tbody:not(:first-of-type) th{padding-top:20px !important}.duet-table-striped.duet-table-flattened tr{padding:20px !important}.duet-table-striped.duet-table-flattened tfoot td{border-top:0}.duet-table-striped.duet-table-flattened tfoot tr{border-top:1px solid rgb(225, 227, 230)}.duet-table-striped.duet-table-flattened.duet-theme-turva tfoot tr{border-top-color:rgb(228, 228, 230)}.duet-table-fixed th,.duet-table-minimal th,.duet-table-plain th{padding:16px !important;border-bottom:1px solid rgb(101, 119, 135)}.duet-table-fixed th:first-child,.duet-table-minimal th:first-child,.duet-table-plain th:first-child{padding-left:0 !important}.duet-table-fixed th:last-child,.duet-table-minimal th:last-child,.duet-table-plain th:last-child{padding-right:0 !important}.duet-theme-turva.duet-table-fixed th,.duet-theme-turva.duet-table-minimal th,.duet-theme-turva.duet-table-plain th{border-bottom-color:rgb(68, 68, 69)}.duet-table-fixed tbody th,.duet-table-minimal tbody th,.duet-table-plain tbody th{padding-top:40px !important;border-bottom-color:rgb(225, 227, 230)}.duet-theme-turva.duet-table-fixed tbody th,.duet-theme-turva.duet-table-minimal tbody th,.duet-theme-turva.duet-table-plain tbody th{border-bottom-color:rgb(228, 228, 230)}.duet-table-fixed td,.duet-table-minimal td,.duet-table-plain td{padding:16px !important}.duet-table-fixed td:first-child,.duet-table-minimal td:first-child,.duet-table-plain td:first-child{padding-left:0 !important}.duet-table-fixed td:last-child,.duet-table-minimal td:last-child,.duet-table-plain td:last-child{padding-right:0 !important}.duet-table-fixed tbody td,.duet-table-minimal tbody td,.duet-table-plain tbody td{border-bottom:1px solid rgb(225, 227, 230)}.duet-theme-turva.duet-table-fixed tbody td,.duet-theme-turva.duet-table-minimal tbody td,.duet-theme-turva.duet-table-plain tbody td{border-bottom-color:rgb(228, 228, 230)}.duet-table-flattened.duet-table-fixed tbody:first-of-type th,.duet-table-flattened.duet-table-minimal tbody:first-of-type th,.duet-table-flattened.duet-table-plain tbody:first-of-type th{padding-top:0 !important}.duet-table-flattened.duet-table-fixed td,.duet-table-flattened.duet-table-minimal td,.duet-table-flattened.duet-table-plain td,.duet-table-flattened.duet-table-fixed tbody th,.duet-table-flattened.duet-table-minimal tbody th,.duet-table-flattened.duet-table-plain tbody th{border-bottom:0}.duet-table-flattened.duet-table-fixed tr,.duet-table-flattened.duet-table-minimal tr,.duet-table-flattened.duet-table-plain tr{padding:20px 0 !important}.duet-table-flattened.duet-table-fixed tbody th,.duet-table-flattened.duet-table-minimal tbody th,.duet-table-flattened.duet-table-plain tbody th{padding-top:20px !important}.duet-table-flattened.duet-table-fixed tfoot td,.duet-table-flattened.duet-table-minimal tfoot td,.duet-table-flattened.duet-table-plain tfoot td{margin-bottom:4px !important}.duet-table-flattened.duet-table-fixed tbody:not(:only-of-type) tr:first-child,.duet-table-flattened.duet-table-minimal tbody:not(:only-of-type) tr:first-child,.duet-table-flattened.duet-table-plain tbody:not(:only-of-type) tr:first-child{border-bottom:0}.duet-table-plain.duet-table-flattened tbody tr{border-bottom:1px solid rgb(225, 227, 230)}.duet-table-plain.duet-table-flattened.duet-theme-turva tbody tr{border-bottom-color:rgb(228, 228, 230)}.duet-table-minimal tbody tr,.duet-table-minimal tbody tr td{vertical-align:top;border-bottom:0 none}.duet-table-minimal tbody tr:last-of-type,.duet-table-minimal tbody tr:last-of-type td{border-bottom:1px solid rgb(225, 227, 230)}.duet-table-minimal.duet-table-flattened tbody tr,.duet-table-minimal.duet-table-flattened tbody tr td{border-bottom:0 none}.duet-table-minimal.duet-table-flattened tbody tr td[data-heading]::before{display:none}.duet-table-minimal.duet-table-flattened tfoot{border-top:1px solid rgb(225, 227, 230)}.duet-table-minimal.duet-table-flattened.duet-theme-turva tfoot{border-top-color:rgb(228, 228, 230)}.duet-table-fixed table{table-layout:fixed}.duet-table-fixed tbody tr,.duet-table-fixed tbody tr td,.duet-table-fixed tbody tr td:first-child{padding:4px !important;vertical-align:text-bottom;border-bottom:0 none}.duet-table-fixed thead{display:none}.duet-table-fixed tbody tr,.duet-table-fixed tbody tr td{border-bottom:0 none}.duet-table-fixed:not(.duet-table-flattened) tfoot{border-top:1px solid rgb(225, 227, 230)}.duet-table-fixed:not(.duet-table-flattened).duet-theme-turva tfoot{border-top-color:rgb(228, 228, 230)}.duet-table-scrollable{position:relative;width:100%;overflow-x:auto;background:linear-gradient(90deg, #fff 0%, rgba(255, 255, 255, 0)), linear-gradient(-90deg, #fff 0%, rgba(255, 255, 255, 0)) 100% 0, radial-gradient(farthest-side at 0% 50%, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0)), radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0)) 100% 0%;background-repeat:no-repeat;background-attachment:local, local, scroll, scroll;background-size:100px 100%, 100px 100%, 12px 100%, 12px 100%}.duet-table-selected-column{background:rgba(0, 119, 179, 0.08)}.duet-theme-turva .duet-table-selected-column{background:rgba(68, 68, 69, 0.08)}.duet-table-sortable tbody tr td:first-child,.duet-table-sortable thead tr th:first-child{padding:20px}.duet-table-sortable:not(.duet-table-flattened) tfoot{border-top:1px solid rgb(225, 227, 230)}.duet-table-sortable:not(.duet-table-flattened).duet-theme-turva tfoot{border-top-color:rgb(228, 228, 230)}.duet-table-actions table{table-layout:auto}.duet-table-actions thead th:last-child{width:1px;white-space:nowrap}.duet-editable-table-table.duet-table-flattened tr{display:grid;grid-template-columns:repeat(2, 1fr);grid-auto-rows:auto;gap:10px}.duet-editable-table-table.duet-table-flattened tr.duet-table-action-row td:last-child::before{padding:0;content:\"\"}.duet-editable-table-table.duet-table-flattened td{grid-column:1/2}.duet-editable-table-table.duet-table-flattened td:first-child{grid-row:1;grid-column:1}.duet-editable-table-table.duet-table-flattened td:last-child{grid-row:1;grid-column:2}";
|
|
193
193
|
|
|
194
194
|
const stickyTopValues = {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
195
|
+
none: 0,
|
|
196
|
+
"with-links": parseFloat(sizeNavigation) * 16, // convert rem -> px
|
|
197
|
+
"without-links": parseFloat(sizeHeader) * 16,
|
|
198
198
|
};
|
|
199
199
|
const DuetTable = class {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
}
|
|
216
|
-
watchLanguageStateHandler(newValue, oldValue) {
|
|
217
|
-
if (newValue !== oldValue) {
|
|
218
|
-
setTimeout(() => this.copyHeadingsToCells(), 50);
|
|
200
|
+
constructor(hostRef) {
|
|
201
|
+
registerInstance(this, hostRef);
|
|
202
|
+
this.headingSelector = "thead tr > :not(*.duet-editable-table-actions-menu)";
|
|
203
|
+
this.handleMediaQueryChange = (mq) => {
|
|
204
|
+
this.matchesBreakpoint = breakpointTokensUpTo.includes(this.breakpoint) ? !mq.matches : mq.matches;
|
|
205
|
+
};
|
|
206
|
+
this.matchesBreakpoint = true;
|
|
207
|
+
this.language = getLanguage();
|
|
208
|
+
this.theme = undefined;
|
|
209
|
+
this.margin = "auto";
|
|
210
|
+
this.variation = "striped";
|
|
211
|
+
this.sticky = false;
|
|
212
|
+
this.stickyDistance = "with-links";
|
|
213
|
+
this.breakpoint = "small";
|
|
214
|
+
this.hideHeadVisually = false;
|
|
219
215
|
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
this.mq.addEventListener("change", debounce(this.handleMediaQueryChange, 50));
|
|
225
|
-
this.handleMediaQueryChange(this.mq);
|
|
226
|
-
this.observer = new MutationObserver(() => debounce(this.copyHeadingsToCells(), 50));
|
|
227
|
-
this.observer.observe(this.element, {
|
|
228
|
-
childList: true,
|
|
229
|
-
subtree: true,
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
|
-
componentWillLoad() {
|
|
233
|
-
inheritGlobalTheme(this);
|
|
234
|
-
this.copyHeadingsToCells();
|
|
235
|
-
if (this.sticky && this.breakpoint === "none-scrollable") {
|
|
236
|
-
console.warn(`[DUET WARNING]: sticky and breakpoint="none-scrollable" are incompatible. Scrollable takes precedence`);
|
|
216
|
+
watchLanguageStateHandler(newValue, oldValue) {
|
|
217
|
+
if (newValue !== oldValue) {
|
|
218
|
+
setTimeout(() => this.copyHeadingsToCells(), 50);
|
|
219
|
+
}
|
|
237
220
|
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
221
|
+
connectedCallback() {
|
|
222
|
+
const token = this.breakpoint === "none" || this.breakpoint === "none-scrollable" ? "all" : breakpointToToken[this.breakpoint];
|
|
223
|
+
this.mq = matchMedia(token);
|
|
224
|
+
this.mq.addEventListener("change", debounce(this.handleMediaQueryChange, 50));
|
|
225
|
+
this.handleMediaQueryChange(this.mq);
|
|
226
|
+
this.observer = new MutationObserver(() => debounce(this.copyHeadingsToCells(), 50));
|
|
227
|
+
this.observer.observe(this.element, {
|
|
228
|
+
childList: true,
|
|
229
|
+
subtree: true,
|
|
230
|
+
});
|
|
242
231
|
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
this.observer ? this.observer.takeRecords() : null;
|
|
249
|
-
connectLanguageChangeObserver(this);
|
|
250
|
-
}
|
|
251
|
-
disconnectedCallback() {
|
|
252
|
-
this.observer.disconnect();
|
|
253
|
-
this.observer = null;
|
|
254
|
-
this.mq.removeListener(this.handleMediaQueryChange);
|
|
255
|
-
this.mq = null;
|
|
256
|
-
this.matchesBreakpoint = true;
|
|
257
|
-
disconnectLanguageChangeObserver(this);
|
|
258
|
-
}
|
|
259
|
-
/**
|
|
260
|
-
* Local methods.
|
|
261
|
-
*/
|
|
262
|
-
copyHeadingsToCells() {
|
|
263
|
-
const headingElements = this.element.querySelectorAll(this.headingSelector);
|
|
264
|
-
const rowElements = this.element.querySelectorAll("tbody tr");
|
|
265
|
-
const headings = Array.from(headingElements).map(th => th.textContent.trim());
|
|
266
|
-
rowElements.forEach(tr => {
|
|
267
|
-
tr.querySelectorAll("td").forEach((td, i) => {
|
|
268
|
-
if (headings[i]) {
|
|
269
|
-
const previousSpan = td.querySelector(".duet-table-cell-heading");
|
|
270
|
-
if (!previousSpan || previousSpan.textContent !== headings[i]) {
|
|
271
|
-
previousSpan === null || previousSpan === void 0 ? void 0 : previousSpan.remove();
|
|
272
|
-
const span = document.createElement("span");
|
|
273
|
-
span.textContent = headings[i];
|
|
274
|
-
span.classList.add("duet-table-cell-heading");
|
|
275
|
-
span.setAttribute("aria-hidden", "true");
|
|
276
|
-
span.inert = true;
|
|
277
|
-
td.prepend(span);
|
|
278
|
-
}
|
|
232
|
+
componentWillLoad() {
|
|
233
|
+
inheritGlobalTheme(this);
|
|
234
|
+
this.copyHeadingsToCells();
|
|
235
|
+
if (this.sticky && this.breakpoint === "none-scrollable") {
|
|
236
|
+
console.warn(`[DUET WARNING]: sticky and breakpoint="none-scrollable" are incompatible. Scrollable takes precedence`);
|
|
279
237
|
}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
//
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
238
|
+
if (this.sticky) {
|
|
239
|
+
const stickyTop = stickyTopValues[this.stickyDistance];
|
|
240
|
+
const headingElements = this.element.querySelectorAll(this.headingSelector);
|
|
241
|
+
headingElements.forEach(th => (th.style.top = `${stickyTop}px`));
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
componentDidLoad() {
|
|
245
|
+
// this clears all pending mutations,
|
|
246
|
+
// that way we avoid dealing with any initial changes
|
|
247
|
+
// and only get genuine mutations as rows are added/removed
|
|
248
|
+
this.observer ? this.observer.takeRecords() : null;
|
|
249
|
+
connectLanguageChangeObserver(this);
|
|
250
|
+
}
|
|
251
|
+
disconnectedCallback() {
|
|
252
|
+
this.observer.disconnect();
|
|
253
|
+
this.observer = null;
|
|
254
|
+
this.mq.removeListener(this.handleMediaQueryChange);
|
|
255
|
+
this.mq = null;
|
|
256
|
+
this.matchesBreakpoint = true;
|
|
257
|
+
disconnectLanguageChangeObserver(this);
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Local methods.
|
|
261
|
+
*/
|
|
262
|
+
copyHeadingsToCells() {
|
|
263
|
+
const headingElements = this.element.querySelectorAll(this.headingSelector);
|
|
264
|
+
const rowElements = this.element.querySelectorAll("tbody tr");
|
|
265
|
+
const headings = Array.from(headingElements).map(th => th.textContent.trim());
|
|
266
|
+
rowElements.forEach(tr => {
|
|
267
|
+
tr.querySelectorAll("td").forEach((td, i) => {
|
|
268
|
+
if (headings[i]) {
|
|
269
|
+
const previousSpan = td.querySelector(".duet-table-cell-heading");
|
|
270
|
+
if (!previousSpan || previousSpan.textContent !== headings[i]) {
|
|
271
|
+
previousSpan === null || previousSpan === void 0 ? void 0 : previousSpan.remove();
|
|
272
|
+
const span = document.createElement("span");
|
|
273
|
+
span.textContent = headings[i];
|
|
274
|
+
span.classList.add("duet-table-cell-heading");
|
|
275
|
+
span.setAttribute("aria-hidden", "true");
|
|
276
|
+
span.inert = true;
|
|
277
|
+
td.prepend(span);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
render() {
|
|
284
|
+
return (h(Host, { class: {
|
|
285
|
+
[`duet-table-${this.variation}`]: true,
|
|
286
|
+
"duet-table-flattened": !this.matchesBreakpoint,
|
|
287
|
+
// sticky only valid when in regular table layout
|
|
288
|
+
"duet-table-sticky": this.matchesBreakpoint && this.sticky,
|
|
289
|
+
"duet-table-scrollable": this.breakpoint === "none-scrollable",
|
|
290
|
+
"duet-m-0": this.margin === "none",
|
|
291
|
+
"duet-theme-turva": this.theme === "turva",
|
|
292
|
+
"duet-table-hide-head-visually": this.hideHeadVisually,
|
|
293
|
+
} }, h("slot", null)));
|
|
294
|
+
}
|
|
295
|
+
get element() { return getElement(this); }
|
|
296
|
+
static get watchers() { return {
|
|
297
|
+
"language": ["watchLanguageStateHandler"]
|
|
298
|
+
}; }
|
|
299
299
|
};
|
|
300
300
|
DuetTable.style = duetTableCss;
|
|
301
301
|
|
|
@@ -447,1042 +447,1042 @@ const errorCodes = [
|
|
|
447
447
|
];
|
|
448
448
|
|
|
449
449
|
const headerAriaLabel = {
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
450
|
+
fi: "Liiteluettelo",
|
|
451
|
+
sv: "Lista över bilagor",
|
|
452
|
+
en: "Attachments list",
|
|
453
453
|
};
|
|
454
454
|
const UploadItemHeader = ({ label, categoryLabel }) => {
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
455
|
+
return (h("div", { class: "items-header", tabindex: "-1", "aria-label": getLocaleString(headerAriaLabel) },
|
|
456
|
+
categoryLabel && (h("duet-heading", { class: "category-header", border: "solid", color: "gray-darker", level: "h3", "visual-level": "h6", weight: "semibold", margin: "none", "aria-hidden": "true" }, getLocaleString(categoryLabel))),
|
|
457
|
+
h("duet-heading", { class: { "filename-header": true, "no-category": !categoryLabel }, border: "solid", color: "gray-darker", level: "h3", "visual-level": "h6", weight: "semibold", margin: "none", "aria-hidden": "true" }, getLocaleString(label))));
|
|
458
458
|
};
|
|
459
459
|
|
|
460
460
|
const validateFileExtension = (name, allowedExtensions) => {
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
461
|
+
if (!allowedExtensions) {
|
|
462
|
+
return true;
|
|
463
|
+
}
|
|
464
|
+
const ext = name.split(".");
|
|
465
|
+
const validExtension = allowedExtensions.split(",");
|
|
466
|
+
const extension = ext[ext.length - 1];
|
|
467
|
+
return validExtension.includes(extension);
|
|
468
468
|
};
|
|
469
469
|
const validateFileMime = (type, allowedMimetypes) => {
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
}
|
|
473
|
-
const validMimeTypes = allowedMimetypes.split(",");
|
|
474
|
-
let valid = false;
|
|
475
|
-
validMimeTypes.forEach(mimeType => {
|
|
476
|
-
const allowedTypes = mimeType.split("/");
|
|
477
|
-
const fileType = type.split("/");
|
|
478
|
-
if (allowedTypes[0] === fileType[0] && (allowedTypes[1] === fileType[1] || allowedTypes[1] === "*")) {
|
|
479
|
-
valid = true;
|
|
470
|
+
if (!allowedMimetypes || !type) {
|
|
471
|
+
return true;
|
|
480
472
|
}
|
|
481
|
-
|
|
482
|
-
|
|
473
|
+
const validMimeTypes = allowedMimetypes.split(",");
|
|
474
|
+
let valid = false;
|
|
475
|
+
validMimeTypes.forEach(mimeType => {
|
|
476
|
+
const allowedTypes = mimeType.split("/");
|
|
477
|
+
const fileType = type.split("/");
|
|
478
|
+
if (allowedTypes[0] === fileType[0] && (allowedTypes[1] === fileType[1] || allowedTypes[1] === "*")) {
|
|
479
|
+
valid = true;
|
|
480
|
+
}
|
|
481
|
+
});
|
|
482
|
+
return valid;
|
|
483
483
|
};
|
|
484
484
|
const validateFileSize = (size, maxBytes) => {
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
485
|
+
if (!maxBytes || !size) {
|
|
486
|
+
return true;
|
|
487
|
+
}
|
|
488
|
+
return maxBytes >= size;
|
|
489
489
|
};
|
|
490
490
|
const validateFile = (item, validators, errorCodes) => {
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
491
|
+
const { allowedMimetypes, allowedExtensions, maxBytes } = validators;
|
|
492
|
+
let valid = false;
|
|
493
|
+
let errorMessage = getError("default", errorCodes);
|
|
494
|
+
if (item) {
|
|
495
|
+
const { name, type, size } = item;
|
|
496
|
+
const mime = validateFileMime(type, allowedMimetypes);
|
|
497
|
+
const ext = allowedExtensions === "all" ||
|
|
498
|
+
allowedExtensions === "" ||
|
|
499
|
+
allowedExtensions === " " ||
|
|
500
|
+
allowedExtensions === undefined
|
|
501
|
+
? true
|
|
502
|
+
: validateFileExtension(name.toLowerCase(), allowedExtensions);
|
|
503
|
+
const bytes = validateFileSize(size, maxBytes);
|
|
504
|
+
if (!mime) {
|
|
505
|
+
errorMessage = getError("duet-upload-101", errorCodes);
|
|
506
|
+
}
|
|
507
|
+
if (!ext) {
|
|
508
|
+
errorMessage = getError("duet-upload-100", errorCodes);
|
|
509
|
+
}
|
|
510
|
+
if (!bytes) {
|
|
511
|
+
errorMessage = getError("duet-upload-201", errorCodes);
|
|
512
|
+
}
|
|
513
|
+
valid = mime && ext && bytes;
|
|
509
514
|
}
|
|
510
|
-
|
|
511
|
-
|
|
515
|
+
else {
|
|
516
|
+
valid = false;
|
|
512
517
|
}
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
valid,
|
|
520
|
-
errorMessage: valid ? undefined : getLocaleString(errorMessage.message),
|
|
521
|
-
errorSystem: valid ? undefined : errorMessage.system_message,
|
|
522
|
-
errorType: valid ? undefined : errorMessage.type,
|
|
523
|
-
};
|
|
518
|
+
return {
|
|
519
|
+
valid,
|
|
520
|
+
errorMessage: valid ? undefined : getLocaleString(errorMessage.message),
|
|
521
|
+
errorSystem: valid ? undefined : errorMessage.system_message,
|
|
522
|
+
errorType: valid ? undefined : errorMessage.type,
|
|
523
|
+
};
|
|
524
524
|
};
|
|
525
525
|
const validateTotalSizeIsAboveMax = (filelist, maxTotalBytes) => {
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
526
|
+
let total = 0;
|
|
527
|
+
if (maxTotalBytes) {
|
|
528
|
+
filelist.forEach(item => {
|
|
529
|
+
if (item.valid && item.size) {
|
|
530
|
+
total += item.size;
|
|
531
|
+
}
|
|
532
|
+
});
|
|
533
|
+
if (total >= maxTotalBytes) {
|
|
534
|
+
return true;
|
|
535
|
+
}
|
|
535
536
|
}
|
|
536
|
-
|
|
537
|
-
return false;
|
|
537
|
+
return false;
|
|
538
538
|
};
|
|
539
539
|
const validateTotalAmountIsAboveMax = (filelist, maxFiles) => {
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
540
|
+
let total = 0;
|
|
541
|
+
if (maxFiles) {
|
|
542
|
+
filelist.forEach(item => {
|
|
543
|
+
if (item.valid) {
|
|
544
|
+
total++;
|
|
545
|
+
}
|
|
546
|
+
});
|
|
547
|
+
if (total >= maxFiles) {
|
|
548
|
+
return true;
|
|
549
|
+
}
|
|
549
550
|
}
|
|
550
|
-
|
|
551
|
-
return false;
|
|
551
|
+
return false;
|
|
552
552
|
};
|
|
553
553
|
const filesToUploadCountAboveMax = (currentFilesCount, filesToUploadCount, maxFiles) => {
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
554
|
+
if (currentFilesCount + filesToUploadCount > maxFiles) {
|
|
555
|
+
return true;
|
|
556
|
+
}
|
|
557
|
+
return false;
|
|
558
558
|
};
|
|
559
559
|
const filesToUploadTotalSizeIsAboveMax = (currentFiles, filesToUpload, maxTotalBytes) => {
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
560
|
+
let total = 0;
|
|
561
|
+
if (maxTotalBytes) {
|
|
562
|
+
currentFiles.forEach(item => {
|
|
563
|
+
if (item.valid && item.size) {
|
|
564
|
+
total += item.size;
|
|
565
|
+
}
|
|
566
|
+
});
|
|
567
|
+
filesToUpload.forEach(item => {
|
|
568
|
+
if (item.size) {
|
|
569
|
+
total += item.size;
|
|
570
|
+
}
|
|
571
|
+
});
|
|
572
|
+
if (total >= maxTotalBytes) {
|
|
573
|
+
return true;
|
|
574
|
+
}
|
|
574
575
|
}
|
|
575
|
-
|
|
576
|
-
return false;
|
|
576
|
+
return false;
|
|
577
577
|
};
|
|
578
578
|
|
|
579
579
|
const makeXhrRequest = ({ payload, options, onFailure, onSuccess, onProgress }) => {
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
580
|
+
// @ts-ignore
|
|
581
|
+
const { type = "POST", xhr, uri, argument = null, headers = null } = options;
|
|
582
|
+
xhr.open(type, `${uri}${argument || ""}`, true);
|
|
583
|
+
const { data, name } = payload;
|
|
584
|
+
// headers must be added after open
|
|
585
|
+
if (headers) {
|
|
586
|
+
Object.keys(headers).forEach(key => {
|
|
587
|
+
xhr.setRequestHeader(key, headers[key]);
|
|
588
|
+
});
|
|
589
|
+
}
|
|
590
|
+
if (type === "POST") {
|
|
591
|
+
xhr.onreadystatechange = () => {
|
|
592
|
+
// Call a function when the state changes.
|
|
593
|
+
if (xhr.readyState === XMLHttpRequest.DONE && xhr.status >= 200 && xhr.status < 300) {
|
|
594
|
+
// Request finished without errors
|
|
595
|
+
onSuccess(xhr, name, xhr.status);
|
|
596
|
+
}
|
|
597
|
+
if (xhr.readyState === XMLHttpRequest.DONE && xhr.status >= 300 && xhr.status < 999) {
|
|
598
|
+
// Request finished with errors
|
|
599
|
+
onFailure(xhr, name, xhr.status);
|
|
600
|
+
}
|
|
601
|
+
};
|
|
602
|
+
onProgress(name);
|
|
603
|
+
}
|
|
604
|
+
xhr.send(data);
|
|
605
|
+
return xhr;
|
|
606
606
|
};
|
|
607
607
|
|
|
608
608
|
const duetUploadCss = "*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}::slotted([slot=header]){margin-bottom:16px}::slotted([slot=fileheader]){margin:16px 0 0 0}::slotted([slot=filefooter]){margin-top:16px}::slotted([slot=uploadfooter]){margin-top:20px}.duet-upload{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.duet-upload-item-size{font-size:0.75rem;font-weight:400}.duet-upload-filelist{margin-bottom:25px}.duet-upload-filelist-empty{display:flex;align-items:center;justify-content:center;width:100%;height:75px;margin:0 auto;font-size:1rem;font-weight:400;background-color:rgb(245, 248, 250)}.duet-upload-filelist-empty-label{font-size:1rem;font-weight:400}.duet-upload-editable-table-header-hidden{display:none}.duet-upload-editable-table tbody .duet-upload-editable-table-data{padding:0 !important;border:0}.duet-upload-editable-table duet-editable-table tfoot,.duet-upload-editable-table duet-editable-table thead{display:none}.duet-upload-editable-table duet-editable-table .duet-editable-table-content{padding-right:0 !important;padding-left:0 !important}.duet-upload-editable-table duet-editable-table duet-table .duet-table-action-row td{padding:1rem 0 !important}.duet-upload-editable-table duet-editable-table duet-table .duet-table-action-row td:last-child{padding-right:0 !important}.duet-upload-editable-table duet-editable-table .duet-editable-table-row-inprogress,.duet-upload-editable-table duet-editable-table .duet-editable-table-row-pending{position:relative}.duet-upload-editable-table duet-editable-table .duet-editable-table-row-inprogress duet-progress,.duet-upload-editable-table duet-editable-table .duet-editable-table-row-pending duet-progress{position:absolute;bottom:0;width:100%}.duet-upload-editable-table duet-editable-table .duet-editable-table-row-inprogress duet-action-button::part(button),.duet-upload-editable-table duet-editable-table .duet-editable-table-row-pending duet-action-button::part(button){border:0}duet-paragraph::part(duet-paragraph){word-break:break-word}duet-editable-table tfoot{display:none}.upload-bottom-caption{margin-top:12px;margin-bottom:16px;line-height:1.4rem}.items-header{display:none;flex-direction:row;margin-bottom:0}@media (min-width: 36em){.items-header{display:flex}}.items-header:not(:last-child),.items-header:not(:first-child){margin-top:12px}.items-header .category-header{width:35%}.items-header .filename-header{width:65%}.items-header .filename-header.no-category{width:100%}.upload-item-row{display:flex;flex-direction:column;gap:16px;align-content:center;align-items:center;padding:16px 0 16px 0;border-bottom:1px solid rgb(225, 227, 230)}@media (min-width: 36em){.upload-item-row{flex-direction:row;gap:10px}}.upload-item-row .item-categories{width:100%}@media (min-width: 36em){.upload-item-row .item-categories{width:35%}}.upload-item-row .item-name{position:relative;bottom:2px;width:100%;text-align:left}@media (min-width: 36em){.upload-item-row .item-name{width:50%}.upload-item-row .item-name.no-category{width:85%}}.upload-item-row .item-categories .heading,.upload-item-row .item-name .heading{display:block}@media (min-width: 36em){.upload-item-row .item-categories .heading,.upload-item-row .item-name .heading{display:none}}.upload-item-row .item-actions{width:100%;margin-left:-8px;text-align:left}@media (min-width: 36em){.upload-item-row .item-actions{width:15%;padding-top:0;margin-left:auto;text-align:right}}.upload-item-row .duet-upload-item-name duet-icon{position:relative;top:4px}.upload-item-row .duet-upload-item-name duet-progress{display:block;margin-top:16px}";
|
|
609
609
|
|
|
610
610
|
const DuetUpload = class {
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
611
|
+
constructor(hostRef) {
|
|
612
|
+
registerInstance(this, hostRef);
|
|
613
|
+
this.duetChange = createEvent(this, "duetChange", 3);
|
|
614
|
+
this.duetBlur = createEvent(this, "duetBlur", 7);
|
|
615
|
+
this.duetFocus = createEvent(this, "duetFocus", 7);
|
|
616
|
+
this.duetReady = createEvent(this, "duetReady", 7);
|
|
617
|
+
this.duetDone = createEvent(this, "duetDone", 3);
|
|
618
|
+
this.duetState = createEvent(this, "duetState", 3);
|
|
619
|
+
this.duetDelete = createEvent(this, "duetDelete", 3);
|
|
620
|
+
this.duetCancel = createEvent(this, "duetCancel", 3);
|
|
621
|
+
this.duetProgress = createEvent(this, "duetProgress", 3);
|
|
622
|
+
this.duetUpload = createEvent(this, "duetUpload", 3);
|
|
623
|
+
this.linkClick = createEvent(this, "linkClick", 3);
|
|
624
|
+
/**
|
|
625
|
+
* Own Properties
|
|
626
|
+
*/
|
|
627
|
+
this.buttonId = createID("DuetButton");
|
|
628
|
+
this.labelId = createID("DuetLabel");
|
|
629
|
+
this.uploadId = createID("DuetUpload");
|
|
630
|
+
this.filesInProgress = new Map();
|
|
631
|
+
this.fileMaxReached = false;
|
|
632
|
+
this.bytesMaxReached = false;
|
|
633
|
+
this.filesToUploadExceedsLimit = false;
|
|
634
|
+
this.filesToUploadTotalSizeIsAboveMax = false;
|
|
635
|
+
this.internalStatusMessageLabel = undefined;
|
|
636
|
+
this.itemRefs = new Map();
|
|
637
|
+
/**
|
|
638
|
+
* Properties
|
|
639
|
+
*/
|
|
640
|
+
this.DefaultGroups = {
|
|
641
|
+
inprogress: "inprogress",
|
|
642
|
+
success: "success",
|
|
643
|
+
pending: "pending",
|
|
644
|
+
failure: "failure",
|
|
645
|
+
};
|
|
646
|
+
this.kick = debounce(() => {
|
|
647
|
+
this.tick = Date.now();
|
|
648
|
+
}, 30); // will trigger re-render
|
|
649
|
+
this.categoryLabel = {
|
|
650
|
+
en: "Category",
|
|
651
|
+
sv: "Filtyp",
|
|
652
|
+
fi: "Tiedostotyyppi",
|
|
653
|
+
};
|
|
654
|
+
/**
|
|
655
|
+
* Private functions
|
|
656
|
+
*/
|
|
657
|
+
this.listenForActionEvents = () => {
|
|
658
|
+
this.element.addEventListener("duetActionEvent", (e) => {
|
|
659
|
+
const detail = e.detail;
|
|
660
|
+
const { action, id, originalEvent } = detail;
|
|
661
|
+
switch (action) {
|
|
662
|
+
case "delete":
|
|
663
|
+
this.onDelete(id, originalEvent);
|
|
664
|
+
break;
|
|
665
|
+
case "cancel":
|
|
666
|
+
this.onCancel(id, originalEvent);
|
|
667
|
+
break;
|
|
668
|
+
// code block
|
|
669
|
+
}
|
|
670
|
+
});
|
|
671
|
+
};
|
|
672
|
+
this.verifyValidity = () => {
|
|
673
|
+
const { invalid, valid } = this.getFilesAsArray();
|
|
674
|
+
const oldValid = this.valid;
|
|
675
|
+
this.valid = invalid.length === 0 && valid.length !== 0;
|
|
676
|
+
if (this.valid !== oldValid) {
|
|
677
|
+
this.duetState.emit({
|
|
678
|
+
originalEvent: undefined,
|
|
679
|
+
data: { valid: this.valid, from: "componentWillRender" },
|
|
680
|
+
component: "duet-upload",
|
|
681
|
+
});
|
|
682
|
+
}
|
|
683
|
+
};
|
|
684
|
+
this.getGroupFromItemData = (item) => {
|
|
685
|
+
if (item.valid && item.progress === 100) {
|
|
686
|
+
// if the item has a group, move the file to that group instead
|
|
687
|
+
// of into the standard success group
|
|
688
|
+
return this.DefaultGroups.success;
|
|
689
|
+
}
|
|
690
|
+
else if (item.progress > 0 && item.progress !== 100) {
|
|
691
|
+
return this.DefaultGroups.inprogress;
|
|
692
|
+
}
|
|
693
|
+
else if (!item.valid) {
|
|
694
|
+
return this.DefaultGroups.failure;
|
|
695
|
+
}
|
|
696
|
+
else if (item.pending) {
|
|
697
|
+
return this.DefaultGroups.pending;
|
|
698
|
+
}
|
|
699
|
+
else if (item.group) {
|
|
700
|
+
return item.group;
|
|
701
|
+
}
|
|
702
|
+
else {
|
|
703
|
+
return "none";
|
|
704
|
+
}
|
|
705
|
+
};
|
|
706
|
+
this.mapFilesToUploadItems = (data, group, showCategory, filteredActions) => {
|
|
707
|
+
if (group === this.DefaultGroups.success) {
|
|
708
|
+
return (h("duet-upload-item", { theme: this.theme, actions: this.getActions(group, filteredActions), type: "success", data: data, showLinks: this.showLinks, linkClickEvent: this.emitEvent ? this.linkClick : undefined, categoryLabel: this.categoryLabel, label: this.uploadedItemsHeaderLabel, showCategory: showCategory, ref: item => {
|
|
709
|
+
this.itemRefs.set(data.uid, item);
|
|
710
|
+
} }));
|
|
711
|
+
}
|
|
712
|
+
else if (group === this.DefaultGroups.inprogress) {
|
|
713
|
+
return (h("duet-upload-item", { theme: this.theme, actions: this.getActions(group, filteredActions), type: "inprogress", data: data, showLinks: this.showLinks, categoryLabel: this.categoryLabel, label: this.uploadedItemsHeaderLabel, showCategory: showCategory, ref: item => {
|
|
714
|
+
this.itemRefs.set(data.uid, item);
|
|
715
|
+
} }));
|
|
716
|
+
}
|
|
717
|
+
else if (group === this.DefaultGroups.pending) {
|
|
718
|
+
return (h("duet-upload-item", { theme: this.theme, actions: this.getActions(group, filteredActions), type: "pending", data: data, showLinks: this.showLinks, categoryLabel: this.categoryLabel, label: this.uploadedItemsHeaderLabel, showCategory: showCategory, ref: item => {
|
|
719
|
+
this.itemRefs.set(data.uid, item);
|
|
720
|
+
} }));
|
|
721
|
+
}
|
|
722
|
+
else if (group === this.DefaultGroups.failure) {
|
|
723
|
+
return (h("duet-upload-item", { theme: this.theme, actions: this.getActions(group, filteredActions), type: "failure", data: data, showLinks: this.showLinks, errorCodes: this.errorCodes, categoryLabel: this.categoryLabel, label: this.uploadedItemsHeaderLabel, showCategory: showCategory, ref: item => {
|
|
724
|
+
this.itemRefs.set(data.uid, item);
|
|
725
|
+
} }));
|
|
726
|
+
}
|
|
727
|
+
else if (data.group) {
|
|
728
|
+
return data.html;
|
|
729
|
+
}
|
|
730
|
+
else {
|
|
731
|
+
return "none";
|
|
732
|
+
}
|
|
733
|
+
};
|
|
734
|
+
this.genHashName = () => Date.now().toString(36) + Math.random();
|
|
735
|
+
this.updateValueInMap = (item, key, value, kick = true) => {
|
|
736
|
+
try {
|
|
737
|
+
const fileItem = this.files.get(item);
|
|
738
|
+
fileItem[key] = value;
|
|
739
|
+
this.files.set(item, fileItem);
|
|
740
|
+
if (this.external && key !== "url") {
|
|
741
|
+
this.trackProgress(item, key === "uploaded");
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
catch (e) {
|
|
745
|
+
// if a users tries to update entries on a file that doesn't exist,
|
|
746
|
+
// this will blow up - so we're swallowing the errors here on purpose
|
|
747
|
+
// console.warn("operation on missing items")
|
|
748
|
+
}
|
|
749
|
+
if (kick) {
|
|
750
|
+
this.kick();
|
|
751
|
+
}
|
|
752
|
+
};
|
|
753
|
+
this.updateProgress = (ev, name) => {
|
|
754
|
+
const updateProgressHelper = percentComplete => {
|
|
755
|
+
this.updateValueInMap(name, "progress", percentComplete);
|
|
756
|
+
this.onProgress(name, percentComplete, ev);
|
|
757
|
+
};
|
|
758
|
+
if (ev.lengthComputable) {
|
|
759
|
+
const percentComplete = (ev.loaded / ev.total) * 100;
|
|
760
|
+
updateProgressHelper(percentComplete);
|
|
761
|
+
}
|
|
762
|
+
else {
|
|
763
|
+
console.log("cant read progress");
|
|
764
|
+
}
|
|
765
|
+
};
|
|
766
|
+
this.trackProgress = (name, remove = false) => {
|
|
767
|
+
if (remove) {
|
|
768
|
+
this.filesInProgress.delete(name);
|
|
769
|
+
}
|
|
770
|
+
else {
|
|
771
|
+
this.filesInProgress.set(name, "inprogress");
|
|
772
|
+
}
|
|
773
|
+
if (this.filesInProgress.size === 0) {
|
|
774
|
+
this.onDone();
|
|
775
|
+
}
|
|
776
|
+
};
|
|
777
|
+
this.getFilesAsArray = () => {
|
|
778
|
+
const filesInQueue = [];
|
|
779
|
+
const filesInError = [];
|
|
780
|
+
this.files.forEach(value => {
|
|
781
|
+
if (value.valid && !value.deleted) {
|
|
782
|
+
filesInQueue.push(value);
|
|
783
|
+
}
|
|
784
|
+
else if (!value.valid && !value.deleted) {
|
|
785
|
+
filesInError.push(value);
|
|
786
|
+
}
|
|
787
|
+
});
|
|
788
|
+
return { valid: filesInQueue, invalid: filesInError };
|
|
789
|
+
};
|
|
790
|
+
this.resetFormFields = () => {
|
|
791
|
+
/**
|
|
792
|
+
* You cannot modify a FileList, nor remove single items from it
|
|
793
|
+
* This completely removes all items in the FileList
|
|
794
|
+
* We reset the form fields to always be able to re-upload files
|
|
795
|
+
* and because we handle all uploads and states internally in the component (not relying on native form elements)
|
|
796
|
+
*/
|
|
797
|
+
/* TODO: it may be a good idea to just update the list so that this always matches what is in the files map,
|
|
798
|
+
* TODO: this would remove the capability of Re-uploading, unless we can catch and remove the user file from the form filelist before the upload is canceled by the browser
|
|
799
|
+
* TODO: but for now we'll just reset the form fields
|
|
800
|
+
*/
|
|
801
|
+
this.nativeInput.value = "";
|
|
802
|
+
};
|
|
803
|
+
this.startUpload = async (ev, metaData = undefined) => {
|
|
804
|
+
// validate that we haven't hit any maxfiles or maxbytes limits before we upload
|
|
805
|
+
const { bytesMaxReached, fileMaxReached } = this.validateTotals();
|
|
806
|
+
if (bytesMaxReached || fileMaxReached) {
|
|
807
|
+
this.kick();
|
|
808
|
+
return;
|
|
809
|
+
}
|
|
810
|
+
this.metaData = metaData;
|
|
811
|
+
this.nativeInput.click();
|
|
812
|
+
this.onUpload(ev, metaData);
|
|
813
|
+
ev.stopPropagation();
|
|
814
|
+
ev.preventDefault();
|
|
815
|
+
return;
|
|
816
|
+
};
|
|
817
|
+
/**
|
|
818
|
+
* Eventlisteners for the XHR requests
|
|
819
|
+
*/
|
|
820
|
+
this.transferComplete = name => {
|
|
821
|
+
this.updateValueInMap(name, "progress", 100, false);
|
|
822
|
+
this.trackProgress(name, true);
|
|
823
|
+
};
|
|
824
|
+
this.transferDone = (xhr, name, status) => {
|
|
825
|
+
this.updateValueInMap(name, "status", status, false);
|
|
826
|
+
this.updateValueInMap(name, "uploaded", true, false);
|
|
827
|
+
try {
|
|
828
|
+
const response = JSON.parse(xhr.response);
|
|
829
|
+
this.updateValueInMap(name, "url", response.url);
|
|
830
|
+
}
|
|
831
|
+
catch (e) {
|
|
832
|
+
this.updateValueInMap(name, "url", null);
|
|
833
|
+
console.error("Server did not respond with expected response {url: string}");
|
|
834
|
+
}
|
|
835
|
+
return;
|
|
836
|
+
};
|
|
837
|
+
this.transferDoneWithFailure = (xhr, name, status) => {
|
|
838
|
+
try {
|
|
839
|
+
const { error } = JSON.parse(xhr.response);
|
|
840
|
+
this.updateValueInMap(name, "error", { message: error.message, type: error.type }, false);
|
|
841
|
+
}
|
|
842
|
+
catch (e) {
|
|
843
|
+
console.error("Server did not respond with expected response error:{message: string, type: int}");
|
|
844
|
+
this.updateValueInMap(name, "error", { type: status }, false);
|
|
845
|
+
}
|
|
846
|
+
this.updateValueInMap(name, "valid", false, true);
|
|
847
|
+
};
|
|
848
|
+
this.transferFailed = name => {
|
|
849
|
+
this.updateValueInMap(name, "error", getI18nError("duet-upload-001", this.errorCodes));
|
|
850
|
+
};
|
|
851
|
+
this.transferCanceled = name => {
|
|
852
|
+
this.files.delete(name);
|
|
853
|
+
this.validateTotals(name);
|
|
854
|
+
this.kick();
|
|
855
|
+
};
|
|
856
|
+
this.validateTotals = (name) => {
|
|
857
|
+
const isTotalSizeOverMaxSize = validateTotalSizeIsAboveMax(this.files, this.maxBytesTotal);
|
|
858
|
+
const isTotalFileAmountAboveMax = validateTotalAmountIsAboveMax(this.files, this.maxFiles);
|
|
859
|
+
if (isTotalSizeOverMaxSize && name) {
|
|
860
|
+
this.updateValueInMap(name, "error", getI18nError("duet-upload-202", this.errorCodes), false);
|
|
861
|
+
}
|
|
862
|
+
if (isTotalFileAmountAboveMax && name) {
|
|
863
|
+
this.updateValueInMap(name, "error", getI18nError("duet-upload-301", this.errorCodes), false);
|
|
864
|
+
}
|
|
865
|
+
this.bytesMaxReached = isTotalSizeOverMaxSize;
|
|
866
|
+
this.fileMaxReached = isTotalFileAmountAboveMax;
|
|
867
|
+
return {
|
|
868
|
+
bytesMaxReached: isTotalSizeOverMaxSize,
|
|
869
|
+
fileMaxReached: isTotalFileAmountAboveMax,
|
|
870
|
+
};
|
|
871
|
+
};
|
|
872
|
+
this.uploadFile = async (fileListItem, force = false, key) => {
|
|
873
|
+
if (!force && this.deferUpload) {
|
|
874
|
+
this.updateValueInMap(fileListItem.item.name, "pending", true, false);
|
|
875
|
+
this.updateValueInMap(fileListItem.item.name, "group", "pending", true);
|
|
876
|
+
}
|
|
877
|
+
else if (force) {
|
|
878
|
+
this.updateValueInMap(fileListItem.item.name, "pending", false, false);
|
|
879
|
+
this.updateValueInMap(fileListItem.item.name, "group", undefined, true);
|
|
880
|
+
}
|
|
881
|
+
try {
|
|
882
|
+
if (!this.deferUpload || force) {
|
|
883
|
+
// if all is well AND external file upload handling has not been set, start upload
|
|
884
|
+
const data = new FormData();
|
|
885
|
+
data.append("file", fileListItem.item);
|
|
886
|
+
if (key) {
|
|
887
|
+
data.append("key", key);
|
|
888
|
+
}
|
|
889
|
+
data.append("uid", fileListItem.uid);
|
|
890
|
+
data.append("name", fileListItem.item.name);
|
|
891
|
+
data.append("metadata", JSON.stringify({
|
|
892
|
+
uid: fileListItem.uid,
|
|
893
|
+
url: this.uri,
|
|
894
|
+
size: fileListItem.item.size,
|
|
895
|
+
meta: fileListItem.meta,
|
|
896
|
+
}));
|
|
897
|
+
fileListItem.xhr = await this.makeXHRPostRequest(data);
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
catch (e) {
|
|
901
|
+
// in case one of the global maxes have been reached, invalidate the file
|
|
902
|
+
this.updateValueInMap(fileListItem.item.name, "valid", false, false);
|
|
903
|
+
}
|
|
904
|
+
};
|
|
905
|
+
this.uploadPendingFiles = () => {
|
|
906
|
+
for (const [key, value] of Array.from(this.files.entries())) {
|
|
907
|
+
if (value.group === "pending" && value.pending === true) {
|
|
908
|
+
this.uploadFile(value, true, key);
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
};
|
|
912
|
+
this.getItemFromUID = (uid) => {
|
|
913
|
+
for (const [key, value] of Array.from(this.files.entries())) {
|
|
914
|
+
if (value.uid === uid) {
|
|
915
|
+
return { value, key };
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
return null;
|
|
919
|
+
};
|
|
920
|
+
this.handleExternalUploadButton = (bytesMaxReached, fileMaxReached) => {
|
|
921
|
+
if (this.externalUploadButton) {
|
|
922
|
+
if (bytesMaxReached || fileMaxReached) {
|
|
923
|
+
this.externalUploadButton.disabled = true;
|
|
924
|
+
}
|
|
925
|
+
else {
|
|
926
|
+
this.externalUploadButton.disabled = false;
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
};
|
|
930
|
+
this.onDelete = (key, ev) => {
|
|
931
|
+
const item = this.getItemFromUID(key);
|
|
932
|
+
const retrievedKey = item.key;
|
|
933
|
+
const deletedItem = this.files.get(retrievedKey);
|
|
934
|
+
this.files.delete(retrievedKey);
|
|
935
|
+
const { bytesMaxReached, fileMaxReached } = this.validateTotals();
|
|
936
|
+
this.handleExternalUploadButton(bytesMaxReached, fileMaxReached);
|
|
937
|
+
this.kick();
|
|
938
|
+
this.duetDelete.emit({
|
|
939
|
+
originalEvent: ev,
|
|
940
|
+
data: { deletion: deletedItem },
|
|
941
|
+
component: "duet-upload",
|
|
942
|
+
});
|
|
943
|
+
// don't send a xhr request if the item was pending, just remove it from the list
|
|
944
|
+
if (!this.external && !deletedItem.pending) {
|
|
945
|
+
this.makeXHRDeleteRequest(deletedItem);
|
|
946
|
+
}
|
|
947
|
+
this.resetFormFields();
|
|
948
|
+
};
|
|
949
|
+
this.onCancel = (key, ev) => {
|
|
950
|
+
const retrievedKey = this.getItemFromUID(key).key;
|
|
951
|
+
const cancelledItem = this.files.get(retrievedKey);
|
|
952
|
+
this.files.delete(retrievedKey);
|
|
953
|
+
const { bytesMaxReached, fileMaxReached } = this.validateTotals();
|
|
954
|
+
this.handleExternalUploadButton(bytesMaxReached, fileMaxReached);
|
|
955
|
+
if (!this.external) {
|
|
956
|
+
const { xhr } = cancelledItem;
|
|
957
|
+
if (xhr) {
|
|
958
|
+
xhr.abort();
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
this.kick();
|
|
962
|
+
this.resetFormFields();
|
|
963
|
+
this.duetCancel.emit({
|
|
964
|
+
originalEvent: ev,
|
|
965
|
+
data: { cancelled: cancelledItem },
|
|
966
|
+
component: "duet-upload",
|
|
967
|
+
});
|
|
968
|
+
};
|
|
969
|
+
this.onUpload = (ev, metaData) => {
|
|
970
|
+
this.duetUpload.emit({
|
|
971
|
+
originalEvent: ev,
|
|
972
|
+
metaData,
|
|
973
|
+
component: "duet-upload",
|
|
974
|
+
});
|
|
975
|
+
};
|
|
976
|
+
this.onBlur = (ev) => {
|
|
977
|
+
this.duetBlur.emit({
|
|
978
|
+
originalEvent: ev,
|
|
979
|
+
component: "duet-upload",
|
|
980
|
+
});
|
|
981
|
+
};
|
|
982
|
+
this.onProgress = (key, percentComplete, ev) => {
|
|
983
|
+
this.duetChange.emit({
|
|
984
|
+
originalEvent: ev,
|
|
985
|
+
data: {
|
|
986
|
+
key,
|
|
987
|
+
percentComplete,
|
|
988
|
+
},
|
|
989
|
+
component: "duet-upload",
|
|
990
|
+
});
|
|
991
|
+
};
|
|
992
|
+
this.onFocus = (ev) => {
|
|
993
|
+
this.duetFocus.emit({
|
|
994
|
+
originalEvent: ev,
|
|
995
|
+
component: "duet-upload",
|
|
996
|
+
});
|
|
997
|
+
};
|
|
998
|
+
this.onReady = () => {
|
|
999
|
+
this.duetReady.emit({
|
|
1000
|
+
component: "duet-upload",
|
|
1001
|
+
});
|
|
1002
|
+
};
|
|
1003
|
+
this.onDone = () => {
|
|
1004
|
+
this.duetDone.emit({
|
|
1005
|
+
component: "duet-upload",
|
|
1006
|
+
data: { files: this.files },
|
|
1007
|
+
});
|
|
1008
|
+
};
|
|
1009
|
+
/**
|
|
1010
|
+
* @description This functions return sorted map items byg condition which are:
|
|
1011
|
+
*/
|
|
1012
|
+
this.filterMap = () => {
|
|
1013
|
+
const all = Array.from(this.files.values());
|
|
1014
|
+
const inprogress = [];
|
|
1015
|
+
const failure = [];
|
|
1016
|
+
const pending = [];
|
|
1017
|
+
const success = [];
|
|
1018
|
+
let hasCategory = false;
|
|
1019
|
+
all.forEach(data => {
|
|
1020
|
+
const group = this.getGroupFromItemData(data);
|
|
1021
|
+
// const item = mapFn(data, group)
|
|
1022
|
+
// const category = <UploadCategory meta={data.meta} />
|
|
1023
|
+
// const categories = data.meta?.badges?.join(",")
|
|
1024
|
+
if (data.meta && !!data.meta.badges) {
|
|
1025
|
+
hasCategory = true;
|
|
1026
|
+
}
|
|
1027
|
+
if (group === this.DefaultGroups.success) {
|
|
1028
|
+
success.push({
|
|
1029
|
+
uid: data.uid,
|
|
1030
|
+
data,
|
|
1031
|
+
});
|
|
1032
|
+
}
|
|
1033
|
+
else if (group === this.DefaultGroups.inprogress) {
|
|
1034
|
+
inprogress.push({
|
|
1035
|
+
uid: data.uid,
|
|
1036
|
+
data,
|
|
1037
|
+
});
|
|
1038
|
+
}
|
|
1039
|
+
else if (group === this.DefaultGroups.pending) {
|
|
1040
|
+
pending.push({
|
|
1041
|
+
uid: data.uid,
|
|
1042
|
+
data,
|
|
1043
|
+
});
|
|
1044
|
+
}
|
|
1045
|
+
else if (group === this.DefaultGroups.failure) {
|
|
1046
|
+
failure.push({
|
|
1047
|
+
uid: data.uid,
|
|
1048
|
+
data,
|
|
1049
|
+
});
|
|
1050
|
+
}
|
|
1051
|
+
else if (data.group) {
|
|
1052
|
+
inprogress.push({
|
|
1053
|
+
uid: data.uid,
|
|
1054
|
+
data,
|
|
1055
|
+
});
|
|
1056
|
+
}
|
|
1057
|
+
});
|
|
1058
|
+
return {
|
|
1059
|
+
pending,
|
|
1060
|
+
failure,
|
|
1061
|
+
success,
|
|
1062
|
+
inprogress,
|
|
1063
|
+
hasCategory,
|
|
1064
|
+
};
|
|
1065
|
+
};
|
|
1066
|
+
this.getActions = (id, actions) => {
|
|
1067
|
+
return actions.filter(item => item.map.includes(id));
|
|
1068
|
+
};
|
|
1069
|
+
this.renderUploadedItems = () => {
|
|
1070
|
+
this.itemRefs.clear();
|
|
1071
|
+
const filteredItems = this.filterMap();
|
|
1072
|
+
const hasCategory = filteredItems.hasCategory;
|
|
1073
|
+
const filteredActions = this.hideCancelButton
|
|
1074
|
+
? this.actions.filter(action => action.name !== "cancel")
|
|
1075
|
+
: this.actions;
|
|
1076
|
+
const ItemRows = this.groups.map(group => {
|
|
1077
|
+
const currentItems = filteredItems[group.id];
|
|
1078
|
+
if (!(currentItems === null || currentItems === void 0 ? void 0 : currentItems.length)) {
|
|
1079
|
+
return;
|
|
1080
|
+
}
|
|
1081
|
+
return (h(Fragment, null, !this.hideGroups && (h(UploadItemHeader, { categoryLabel: hasCategory ? this.categoryLabel : undefined, label: group.label })), currentItems.map(item => this.mapFilesToUploadItems(item.data, group.id, hasCategory, filteredActions))));
|
|
1082
|
+
});
|
|
1083
|
+
return (h(Fragment, null, this.showUploadedItemsHeader && (h(UploadItemHeader, { categoryLabel: hasCategory ? this.categoryLabel : undefined, label: this.uploadedItemsHeaderLabel })), ItemRows));
|
|
1084
|
+
};
|
|
1085
|
+
this.tick = Date.now();
|
|
1086
|
+
this.accessibleActiveDescendant = undefined;
|
|
1087
|
+
this.accessibleDescribedBy = undefined;
|
|
1088
|
+
this.accessibleControls = undefined;
|
|
1089
|
+
this.accessibleOwns = undefined;
|
|
1090
|
+
this.external = false;
|
|
1091
|
+
this.middleware = null;
|
|
1092
|
+
this.deferUpload = false;
|
|
1093
|
+
this.hideButton = false;
|
|
1094
|
+
this.actions = [
|
|
1095
|
+
{
|
|
1096
|
+
icon: "action-delete",
|
|
1097
|
+
color: "color-danger",
|
|
1098
|
+
size: "x-small",
|
|
1099
|
+
background: "gray-lightest",
|
|
1100
|
+
name: "delete",
|
|
1101
|
+
map: ["success", "failure"],
|
|
1102
|
+
label: {
|
|
1103
|
+
fi: "Poista tiedosto",
|
|
1104
|
+
en: "Delete the file",
|
|
1105
|
+
sv: "Ta bort filen",
|
|
1106
|
+
},
|
|
1107
|
+
},
|
|
1108
|
+
{
|
|
1109
|
+
icon: "navigation-close",
|
|
1110
|
+
color: "primary",
|
|
1111
|
+
size: "x-small",
|
|
1112
|
+
background: "gray-lightest",
|
|
1113
|
+
name: "cancel",
|
|
1114
|
+
map: ["inprogress", "pending"],
|
|
1115
|
+
label: {
|
|
1116
|
+
fi: "Keskeytä lähetys",
|
|
1117
|
+
en: "Cancel the upload",
|
|
1118
|
+
sv: "Stop överföringen",
|
|
1119
|
+
},
|
|
1120
|
+
},
|
|
1121
|
+
];
|
|
1122
|
+
this.uri = undefined;
|
|
1123
|
+
this.showLinks = false;
|
|
1124
|
+
this.caption = undefined;
|
|
1125
|
+
this.statusLabelDefaults = {
|
|
1126
|
+
fi: {
|
|
1127
|
+
inProgress: "Lähetetään {filesUploaded}, yhteensä lähetettävänä {filesTotal}.",
|
|
1128
|
+
inProgressWithErrors: "Lähetetään {filesInProgress}, lähetetty {filesUploaded}, yhteensä lähetettävänä {filesTotal}, {filesWithErrors} epäonnistui",
|
|
1129
|
+
done: "Lähetys valmis, {filesTotal} lisätty onnistuneesti",
|
|
1130
|
+
doneWithErrors: "Lähetys valmis, {filesUploaded} lisätty onnistuneesti, {filesWithErrors} epäonnistui",
|
|
1131
|
+
files: "tiedostoa",
|
|
1132
|
+
file: "tiedosto",
|
|
1133
|
+
},
|
|
1134
|
+
sv: {
|
|
1135
|
+
inProgress: "Laddar upp {filesUploaded} av {filesTotal}",
|
|
1136
|
+
inProgressWithErrors: "Laddar upp {filesInProgress}, {filesUploaded} uppladdad av {filesTotal}, {filesWithErrors} misslyckades",
|
|
1137
|
+
done: "Uppladdningen slutförd, {filesTotal} har lagts till",
|
|
1138
|
+
doneWithErrors: "Uppladdningen slutförd, {filesUploaded} har lagts till, {filesWithErrors} misslyckades",
|
|
1139
|
+
files: "filer",
|
|
1140
|
+
file: "fil",
|
|
1141
|
+
},
|
|
1142
|
+
en: {
|
|
1143
|
+
inProgress: "Uploading {filesUploaded} of {filesTotal}",
|
|
1144
|
+
inProgressWithErrors: "Uploading {filesInProgress}, {filesUploaded} uploaded of {filesTotal}, {filesWithErrors} failed",
|
|
1145
|
+
done: "Upload completed, {filesTotal} added successfully",
|
|
1146
|
+
doneWithErrors: "Upload completed, {filesUploaded} added successfully, {filesWithErrors} failed.",
|
|
1147
|
+
files: "files",
|
|
1148
|
+
file: "file",
|
|
1149
|
+
},
|
|
1150
|
+
};
|
|
1151
|
+
this.statusMessageLabel = getLocaleString(this.statusLabelDefaults);
|
|
1152
|
+
this.buttonLabelDefaults = {
|
|
1153
|
+
fi: "Lisää liite",
|
|
1154
|
+
sv: "Lägg till en bilaga",
|
|
1155
|
+
en: "Add an attachment",
|
|
1156
|
+
};
|
|
1157
|
+
this.buttonLabel = getLocaleString(this.buttonLabelDefaults);
|
|
1158
|
+
this.accessibleButtonLabel = undefined;
|
|
1159
|
+
this.theme = "";
|
|
1160
|
+
this.disabled = false;
|
|
1161
|
+
this.identifier = undefined;
|
|
1162
|
+
this.margin = "auto";
|
|
1163
|
+
this.required = false;
|
|
1164
|
+
this.alignment = "middle";
|
|
1165
|
+
this.hideGroups = false;
|
|
1166
|
+
this.files = new Map();
|
|
1167
|
+
this.valid = !this.required;
|
|
1168
|
+
this.labelDefaults = {
|
|
1169
|
+
fi: "Lisää liite",
|
|
1170
|
+
sv: "Lägg till en bilaga",
|
|
1171
|
+
en: "Add attachments",
|
|
1172
|
+
};
|
|
1173
|
+
this.label = getLocaleString(this.labelDefaults);
|
|
1174
|
+
this.descriptionDefaults = {
|
|
1175
|
+
en: "You may attach the following filetypes: {filetypes} - as well as the most common video files. You can upload {maxbytestotal} of files at a time, and add up to {maxfiles} attachments at a time each no larger than {maxbytes}.",
|
|
1176
|
+
sv: "Du kan bifoga följande filtyper: {filetypes} - samt de vanligaste videofilerna. Du kan ladda upp {maxbytestotal} av filer åt gången, och lägga till upp till {maxfiles} bilagor åt gången varje inte större än {maxbytes}.",
|
|
1177
|
+
fi: "Voit liittää seuraavat tiedostotyypit: {filetypes} - sekä yleisimmät videotiedostot. Voit lähettää {maxbytestotal} tiedostoa kerrallaan, ja lisätä enintään {maxfiles} liitettä kerrallaan, jokainen enintään {maxbytes} kokoisena.",
|
|
1178
|
+
};
|
|
1179
|
+
this.description = getLocaleString(this.descriptionDefaults);
|
|
1180
|
+
this.fileListEmptyDefaults = {
|
|
1181
|
+
fi: "Ei vielä lisättyjä tiedostoja.",
|
|
1182
|
+
sv: "Inga filer har lagts till ännu.",
|
|
1183
|
+
en: "No files added yet.",
|
|
1184
|
+
};
|
|
1185
|
+
this.fileListEmpty = getLocaleString(this.fileListEmptyDefaults);
|
|
1186
|
+
this.error = "";
|
|
1187
|
+
this.errorCodes = errorCodes;
|
|
1188
|
+
this.name = undefined;
|
|
1189
|
+
this.maxBytes = 200000000;
|
|
1190
|
+
this.maxBytesTotal = undefined;
|
|
1191
|
+
this.maxFiles = 99;
|
|
1192
|
+
this.allowedExtensions = "all";
|
|
1193
|
+
this.allowedMimetypes = "";
|
|
1194
|
+
this.multiple = true;
|
|
1195
|
+
this.limitSelection = false;
|
|
1196
|
+
this.hideCancelButton = false;
|
|
1197
|
+
this.value = undefined;
|
|
1198
|
+
this.externalUploadButtonId = undefined;
|
|
1199
|
+
this.captionOnBottom = false;
|
|
1200
|
+
this.showUploadedItemsHeader = false;
|
|
1201
|
+
this.uploadedItemsHeaderLabel = {
|
|
1202
|
+
fi: "Ladattu tiedosto",
|
|
1203
|
+
sv: "Lägg till en bilaga",
|
|
1204
|
+
en: "Uploaded file",
|
|
1205
|
+
};
|
|
1206
|
+
this.headerHeadingLevel = "h3";
|
|
1207
|
+
this.hideHeader = false;
|
|
1208
|
+
this.emitEvent = false;
|
|
1209
|
+
this.groups = [
|
|
1210
|
+
{
|
|
1211
|
+
id: this.DefaultGroups.success,
|
|
1212
|
+
label: {
|
|
1213
|
+
fi: "Valmiit tiedostot",
|
|
1214
|
+
sv: "Files success",
|
|
1215
|
+
en: "Files success",
|
|
1216
|
+
},
|
|
1217
|
+
},
|
|
1218
|
+
{
|
|
1219
|
+
id: this.DefaultGroups.failure,
|
|
1220
|
+
label: {
|
|
1221
|
+
fi: "Tiedostot, joissa on virheitä",
|
|
1222
|
+
sv: "Filer med fel",
|
|
1223
|
+
en: "Files with errors",
|
|
1224
|
+
},
|
|
1225
|
+
},
|
|
1226
|
+
{
|
|
1227
|
+
id: this.DefaultGroups.inprogress,
|
|
1228
|
+
label: {
|
|
1229
|
+
fi: "Kesken olevat tiedostot",
|
|
1230
|
+
sv: "Filer inprogress",
|
|
1231
|
+
en: "Files inprogress",
|
|
1232
|
+
},
|
|
1233
|
+
},
|
|
1234
|
+
{
|
|
1235
|
+
id: this.DefaultGroups.pending,
|
|
1236
|
+
label: {
|
|
1237
|
+
en: "Files to upload",
|
|
1238
|
+
sv: "Filer att ladda",
|
|
1239
|
+
fi: "Ladattavat tiedostot",
|
|
1240
|
+
},
|
|
1241
|
+
},
|
|
1242
|
+
];
|
|
1243
|
+
}
|
|
1244
|
+
watchValidHandler(newValue, oldValue) {
|
|
1245
|
+
if (newValue !== oldValue) {
|
|
1246
|
+
this.kick();
|
|
1247
|
+
}
|
|
1248
|
+
}
|
|
654
1249
|
/**
|
|
655
|
-
*
|
|
1250
|
+
* Component lifecycle events.
|
|
656
1251
|
*/
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
const { action, id, originalEvent } = detail;
|
|
661
|
-
switch (action) {
|
|
662
|
-
case "delete":
|
|
663
|
-
this.onDelete(id, originalEvent);
|
|
664
|
-
break;
|
|
665
|
-
case "cancel":
|
|
666
|
-
this.onCancel(id, originalEvent);
|
|
667
|
-
break;
|
|
668
|
-
// code block
|
|
669
|
-
}
|
|
670
|
-
});
|
|
671
|
-
};
|
|
672
|
-
this.verifyValidity = () => {
|
|
673
|
-
const { invalid, valid } = this.getFilesAsArray();
|
|
674
|
-
const oldValid = this.valid;
|
|
675
|
-
this.valid = invalid.length === 0 && valid.length !== 0;
|
|
676
|
-
if (this.valid !== oldValid) {
|
|
677
|
-
this.duetState.emit({
|
|
678
|
-
originalEvent: undefined,
|
|
679
|
-
data: { valid: this.valid, from: "componentWillRender" },
|
|
680
|
-
component: "duet-upload",
|
|
681
|
-
});
|
|
682
|
-
}
|
|
683
|
-
};
|
|
684
|
-
this.getGroupFromItemData = (item) => {
|
|
685
|
-
if (item.valid && item.progress === 100) {
|
|
686
|
-
// if the item has a group, move the file to that group instead
|
|
687
|
-
// of into the standard success group
|
|
688
|
-
return this.DefaultGroups.success;
|
|
689
|
-
}
|
|
690
|
-
else if (item.progress > 0 && item.progress !== 100) {
|
|
691
|
-
return this.DefaultGroups.inprogress;
|
|
692
|
-
}
|
|
693
|
-
else if (!item.valid) {
|
|
694
|
-
return this.DefaultGroups.failure;
|
|
695
|
-
}
|
|
696
|
-
else if (item.pending) {
|
|
697
|
-
return this.DefaultGroups.pending;
|
|
698
|
-
}
|
|
699
|
-
else if (item.group) {
|
|
700
|
-
return item.group;
|
|
701
|
-
}
|
|
702
|
-
else {
|
|
703
|
-
return "none";
|
|
704
|
-
}
|
|
705
|
-
};
|
|
706
|
-
this.mapFilesToUploadItems = (data, group, showCategory, filteredActions) => {
|
|
707
|
-
if (group === this.DefaultGroups.success) {
|
|
708
|
-
return (h("duet-upload-item", { theme: this.theme, actions: this.getActions(group, filteredActions), type: "success", data: data, showLinks: this.showLinks, linkClickEvent: this.emitEvent ? this.linkClick : undefined, categoryLabel: this.categoryLabel, label: this.uploadedItemsHeaderLabel, showCategory: showCategory, ref: item => {
|
|
709
|
-
this.itemRefs.set(data.uid, item);
|
|
710
|
-
} }));
|
|
711
|
-
}
|
|
712
|
-
else if (group === this.DefaultGroups.inprogress) {
|
|
713
|
-
return (h("duet-upload-item", { theme: this.theme, actions: this.getActions(group, filteredActions), type: "inprogress", data: data, showLinks: this.showLinks, categoryLabel: this.categoryLabel, label: this.uploadedItemsHeaderLabel, showCategory: showCategory, ref: item => {
|
|
714
|
-
this.itemRefs.set(data.uid, item);
|
|
715
|
-
} }));
|
|
716
|
-
}
|
|
717
|
-
else if (group === this.DefaultGroups.pending) {
|
|
718
|
-
return (h("duet-upload-item", { theme: this.theme, actions: this.getActions(group, filteredActions), type: "pending", data: data, showLinks: this.showLinks, categoryLabel: this.categoryLabel, label: this.uploadedItemsHeaderLabel, showCategory: showCategory, ref: item => {
|
|
719
|
-
this.itemRefs.set(data.uid, item);
|
|
720
|
-
} }));
|
|
721
|
-
}
|
|
722
|
-
else if (group === this.DefaultGroups.failure) {
|
|
723
|
-
return (h("duet-upload-item", { theme: this.theme, actions: this.getActions(group, filteredActions), type: "failure", data: data, showLinks: this.showLinks, errorCodes: this.errorCodes, categoryLabel: this.categoryLabel, label: this.uploadedItemsHeaderLabel, showCategory: showCategory, ref: item => {
|
|
724
|
-
this.itemRefs.set(data.uid, item);
|
|
725
|
-
} }));
|
|
726
|
-
}
|
|
727
|
-
else if (data.group) {
|
|
728
|
-
return data.html;
|
|
729
|
-
}
|
|
730
|
-
else {
|
|
731
|
-
return "none";
|
|
732
|
-
}
|
|
733
|
-
};
|
|
734
|
-
this.genHashName = () => Date.now().toString(36) + Math.random();
|
|
735
|
-
this.updateValueInMap = (item, key, value, kick = true) => {
|
|
736
|
-
try {
|
|
737
|
-
const fileItem = this.files.get(item);
|
|
738
|
-
fileItem[key] = value;
|
|
739
|
-
this.files.set(item, fileItem);
|
|
740
|
-
if (this.external && key !== "url") {
|
|
741
|
-
this.trackProgress(item, key === "uploaded");
|
|
1252
|
+
componentWillLoad() {
|
|
1253
|
+
if (typeof this.statusMessageLabel === "string") {
|
|
1254
|
+
this.internalStatusMessageLabel = sanitizeString(this.groups);
|
|
742
1255
|
}
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
// if a users tries to update entries on a file that doesn't exist,
|
|
746
|
-
// this will blow up - so we're swallowing the errors here on purpose
|
|
747
|
-
// console.warn("operation on missing items")
|
|
748
|
-
}
|
|
749
|
-
if (kick) {
|
|
750
|
-
this.kick();
|
|
751
|
-
}
|
|
752
|
-
};
|
|
753
|
-
this.updateProgress = (ev, name) => {
|
|
754
|
-
const updateProgressHelper = percentComplete => {
|
|
755
|
-
this.updateValueInMap(name, "progress", percentComplete);
|
|
756
|
-
this.onProgress(name, percentComplete, ev);
|
|
757
|
-
};
|
|
758
|
-
if (ev.lengthComputable) {
|
|
759
|
-
const percentComplete = (ev.loaded / ev.total) * 100;
|
|
760
|
-
updateProgressHelper(percentComplete);
|
|
761
|
-
}
|
|
762
|
-
else {
|
|
763
|
-
console.log("cant read progress");
|
|
764
|
-
}
|
|
765
|
-
};
|
|
766
|
-
this.trackProgress = (name, remove = false) => {
|
|
767
|
-
if (remove) {
|
|
768
|
-
this.filesInProgress.delete(name);
|
|
769
|
-
}
|
|
770
|
-
else {
|
|
771
|
-
this.filesInProgress.set(name, "inprogress");
|
|
772
|
-
}
|
|
773
|
-
if (this.filesInProgress.size === 0) {
|
|
774
|
-
this.onDone();
|
|
775
|
-
}
|
|
776
|
-
};
|
|
777
|
-
this.getFilesAsArray = () => {
|
|
778
|
-
const filesInQueue = [];
|
|
779
|
-
const filesInError = [];
|
|
780
|
-
this.files.forEach(value => {
|
|
781
|
-
if (value.valid && !value.deleted) {
|
|
782
|
-
filesInQueue.push(value);
|
|
1256
|
+
else {
|
|
1257
|
+
this.internalStatusMessageLabel = this.statusMessageLabel;
|
|
783
1258
|
}
|
|
784
|
-
|
|
785
|
-
|
|
1259
|
+
inheritGlobalTheme(this);
|
|
1260
|
+
this.listenForActionEvents();
|
|
1261
|
+
this.onReady();
|
|
1262
|
+
this.externalUploadButton = document.querySelector(`#${this.externalUploadButtonId}`);
|
|
1263
|
+
}
|
|
1264
|
+
componentWillRender() {
|
|
1265
|
+
// listen to the events from the component
|
|
1266
|
+
this.verifyValidity();
|
|
1267
|
+
}
|
|
1268
|
+
/**
|
|
1269
|
+
* Sets focus on the specified `duet-input`. Use this method instead of the global
|
|
1270
|
+
* `input.focus()`.
|
|
1271
|
+
*/
|
|
1272
|
+
async setFocus(options) {
|
|
1273
|
+
if (this.nativeInput) {
|
|
1274
|
+
this.nativeInput.focus(options);
|
|
786
1275
|
}
|
|
787
|
-
});
|
|
788
|
-
return { valid: filesInQueue, invalid: filesInError };
|
|
789
|
-
};
|
|
790
|
-
this.resetFormFields = () => {
|
|
791
|
-
/**
|
|
792
|
-
* You cannot modify a FileList, nor remove single items from it
|
|
793
|
-
* This completely removes all items in the FileList
|
|
794
|
-
* We reset the form fields to always be able to re-upload files
|
|
795
|
-
* and because we handle all uploads and states internally in the component (not relying on native form elements)
|
|
796
|
-
*/
|
|
797
|
-
/* TODO: it may be a good idea to just update the list so that this always matches what is in the files map,
|
|
798
|
-
* TODO: this would remove the capability of Re-uploading, unless we can catch and remove the user file from the form filelist before the upload is canceled by the browser
|
|
799
|
-
* TODO: but for now we'll just reset the form fields
|
|
800
|
-
*/
|
|
801
|
-
this.nativeInput.value = "";
|
|
802
|
-
};
|
|
803
|
-
this.startUpload = async (ev, metaData = undefined) => {
|
|
804
|
-
// validate that we haven't hit any maxfiles or maxbytes limits before we upload
|
|
805
|
-
const { bytesMaxReached, fileMaxReached } = this.validateTotals();
|
|
806
|
-
if (bytesMaxReached || fileMaxReached) {
|
|
807
|
-
this.kick();
|
|
808
1276
|
return;
|
|
809
|
-
|
|
810
|
-
this.metaData = metaData;
|
|
811
|
-
this.nativeInput.click();
|
|
812
|
-
this.onUpload(ev, metaData);
|
|
813
|
-
ev.stopPropagation();
|
|
814
|
-
ev.preventDefault();
|
|
815
|
-
return;
|
|
816
|
-
};
|
|
1277
|
+
}
|
|
817
1278
|
/**
|
|
818
|
-
*
|
|
1279
|
+
* Method for invoking the upload sequence
|
|
819
1280
|
*/
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
};
|
|
824
|
-
this.transferDone = (xhr, name, status) => {
|
|
825
|
-
this.updateValueInMap(name, "status", status, false);
|
|
826
|
-
this.updateValueInMap(name, "uploaded", true, false);
|
|
827
|
-
try {
|
|
828
|
-
const response = JSON.parse(xhr.response);
|
|
829
|
-
this.updateValueInMap(name, "url", response.url);
|
|
830
|
-
}
|
|
831
|
-
catch (e) {
|
|
832
|
-
this.updateValueInMap(name, "url", null);
|
|
833
|
-
console.error("Server did not respond with expected response {url: string}");
|
|
834
|
-
}
|
|
835
|
-
return;
|
|
836
|
-
};
|
|
837
|
-
this.transferDoneWithFailure = (xhr, name, status) => {
|
|
838
|
-
try {
|
|
839
|
-
const { error } = JSON.parse(xhr.response);
|
|
840
|
-
this.updateValueInMap(name, "error", { message: error.message, type: error.type }, false);
|
|
841
|
-
}
|
|
842
|
-
catch (e) {
|
|
843
|
-
console.error("Server did not respond with expected response error:{message: string, type: int}");
|
|
844
|
-
this.updateValueInMap(name, "error", { type: status }, false);
|
|
845
|
-
}
|
|
846
|
-
this.updateValueInMap(name, "valid", false, true);
|
|
847
|
-
};
|
|
848
|
-
this.transferFailed = name => {
|
|
849
|
-
this.updateValueInMap(name, "error", getI18nError("duet-upload-001", this.errorCodes));
|
|
850
|
-
};
|
|
851
|
-
this.transferCanceled = name => {
|
|
852
|
-
this.files.delete(name);
|
|
853
|
-
this.validateTotals(name);
|
|
854
|
-
this.kick();
|
|
855
|
-
};
|
|
856
|
-
this.validateTotals = (name) => {
|
|
857
|
-
const isTotalSizeOverMaxSize = validateTotalSizeIsAboveMax(this.files, this.maxBytesTotal);
|
|
858
|
-
const isTotalFileAmountAboveMax = validateTotalAmountIsAboveMax(this.files, this.maxFiles);
|
|
859
|
-
if (isTotalSizeOverMaxSize && name) {
|
|
860
|
-
this.updateValueInMap(name, "error", getI18nError("duet-upload-202", this.errorCodes), false);
|
|
861
|
-
}
|
|
862
|
-
if (isTotalFileAmountAboveMax && name) {
|
|
863
|
-
this.updateValueInMap(name, "error", getI18nError("duet-upload-301", this.errorCodes), false);
|
|
864
|
-
}
|
|
865
|
-
this.bytesMaxReached = isTotalSizeOverMaxSize;
|
|
866
|
-
this.fileMaxReached = isTotalFileAmountAboveMax;
|
|
867
|
-
return {
|
|
868
|
-
bytesMaxReached: isTotalSizeOverMaxSize,
|
|
869
|
-
fileMaxReached: isTotalFileAmountAboveMax,
|
|
870
|
-
};
|
|
871
|
-
};
|
|
872
|
-
this.uploadFile = async (fileListItem, force = false, key) => {
|
|
873
|
-
if (!force && this.deferUpload) {
|
|
874
|
-
this.updateValueInMap(fileListItem.item.name, "pending", true, false);
|
|
875
|
-
this.updateValueInMap(fileListItem.item.name, "group", "pending", true);
|
|
876
|
-
}
|
|
877
|
-
else if (force) {
|
|
878
|
-
this.updateValueInMap(fileListItem.item.name, "pending", false, false);
|
|
879
|
-
this.updateValueInMap(fileListItem.item.name, "group", undefined, true);
|
|
880
|
-
}
|
|
881
|
-
try {
|
|
882
|
-
if (!this.deferUpload || force) {
|
|
883
|
-
// if all is well AND external file upload handling has not been set, start upload
|
|
884
|
-
const data = new FormData();
|
|
885
|
-
data.append("file", fileListItem.item);
|
|
886
|
-
if (key) {
|
|
887
|
-
data.append("key", key);
|
|
888
|
-
}
|
|
889
|
-
data.append("uid", fileListItem.uid);
|
|
890
|
-
data.append("name", fileListItem.item.name);
|
|
891
|
-
data.append("metadata", JSON.stringify({
|
|
892
|
-
uid: fileListItem.uid,
|
|
893
|
-
url: this.uri,
|
|
894
|
-
size: fileListItem.item.size,
|
|
895
|
-
meta: fileListItem.meta,
|
|
896
|
-
}));
|
|
897
|
-
fileListItem.xhr = await this.makeXHRPostRequest(data);
|
|
898
|
-
}
|
|
899
|
-
}
|
|
900
|
-
catch (e) {
|
|
901
|
-
// in case one of the global maxes have been reached, invalidate the file
|
|
902
|
-
this.updateValueInMap(fileListItem.item.name, "valid", false, false);
|
|
903
|
-
}
|
|
904
|
-
};
|
|
905
|
-
this.uploadPendingFiles = () => {
|
|
906
|
-
for (const [key, value] of Array.from(this.files.entries())) {
|
|
907
|
-
if (value.group === "pending" && value.pending === true) {
|
|
908
|
-
this.uploadFile(value, true, key);
|
|
909
|
-
}
|
|
910
|
-
}
|
|
911
|
-
};
|
|
912
|
-
this.getItemFromUID = (uid) => {
|
|
913
|
-
for (const [key, value] of Array.from(this.files.entries())) {
|
|
914
|
-
if (value.uid === uid) {
|
|
915
|
-
return { value, key };
|
|
916
|
-
}
|
|
917
|
-
}
|
|
918
|
-
return null;
|
|
919
|
-
};
|
|
920
|
-
this.handleExternalUploadButton = (bytesMaxReached, fileMaxReached) => {
|
|
921
|
-
if (this.externalUploadButton) {
|
|
1281
|
+
async upload(metaData = undefined) {
|
|
1282
|
+
// validate that we haven't hit any maxfiles or maxbytes limits before we upload
|
|
1283
|
+
const { bytesMaxReached, fileMaxReached } = this.validateTotals();
|
|
922
1284
|
if (bytesMaxReached || fileMaxReached) {
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
this.externalUploadButton.disabled = false;
|
|
1285
|
+
this.handleExternalUploadButton(bytesMaxReached, fileMaxReached);
|
|
1286
|
+
this.kick();
|
|
1287
|
+
return;
|
|
927
1288
|
}
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
const retrievedKey = item.key;
|
|
933
|
-
const deletedItem = this.files.get(retrievedKey);
|
|
934
|
-
this.files.delete(retrievedKey);
|
|
935
|
-
const { bytesMaxReached, fileMaxReached } = this.validateTotals();
|
|
936
|
-
this.handleExternalUploadButton(bytesMaxReached, fileMaxReached);
|
|
937
|
-
this.kick();
|
|
938
|
-
this.duetDelete.emit({
|
|
939
|
-
originalEvent: ev,
|
|
940
|
-
data: { deletion: deletedItem },
|
|
941
|
-
component: "duet-upload",
|
|
942
|
-
});
|
|
943
|
-
// don't send a xhr request if the item was pending, just remove it from the list
|
|
944
|
-
if (!this.external && !deletedItem.pending) {
|
|
945
|
-
this.makeXHRDeleteRequest(deletedItem);
|
|
946
|
-
}
|
|
947
|
-
this.resetFormFields();
|
|
948
|
-
};
|
|
949
|
-
this.onCancel = (key, ev) => {
|
|
950
|
-
const retrievedKey = this.getItemFromUID(key).key;
|
|
951
|
-
const cancelledItem = this.files.get(retrievedKey);
|
|
952
|
-
this.files.delete(retrievedKey);
|
|
953
|
-
const { bytesMaxReached, fileMaxReached } = this.validateTotals();
|
|
954
|
-
this.handleExternalUploadButton(bytesMaxReached, fileMaxReached);
|
|
955
|
-
if (!this.external) {
|
|
956
|
-
const { xhr } = cancelledItem;
|
|
957
|
-
if (xhr) {
|
|
958
|
-
xhr.abort();
|
|
959
|
-
}
|
|
960
|
-
}
|
|
961
|
-
this.kick();
|
|
962
|
-
this.resetFormFields();
|
|
963
|
-
this.duetCancel.emit({
|
|
964
|
-
originalEvent: ev,
|
|
965
|
-
data: { cancelled: cancelledItem },
|
|
966
|
-
component: "duet-upload",
|
|
967
|
-
});
|
|
968
|
-
};
|
|
969
|
-
this.onUpload = (ev, metaData) => {
|
|
970
|
-
this.duetUpload.emit({
|
|
971
|
-
originalEvent: ev,
|
|
972
|
-
metaData,
|
|
973
|
-
component: "duet-upload",
|
|
974
|
-
});
|
|
975
|
-
};
|
|
976
|
-
this.onBlur = (ev) => {
|
|
977
|
-
this.duetBlur.emit({
|
|
978
|
-
originalEvent: ev,
|
|
979
|
-
component: "duet-upload",
|
|
980
|
-
});
|
|
981
|
-
};
|
|
982
|
-
this.onProgress = (key, percentComplete, ev) => {
|
|
983
|
-
this.duetChange.emit({
|
|
984
|
-
originalEvent: ev,
|
|
985
|
-
data: {
|
|
986
|
-
key,
|
|
987
|
-
percentComplete,
|
|
988
|
-
},
|
|
989
|
-
component: "duet-upload",
|
|
990
|
-
});
|
|
991
|
-
};
|
|
992
|
-
this.onFocus = (ev) => {
|
|
993
|
-
this.duetFocus.emit({
|
|
994
|
-
originalEvent: ev,
|
|
995
|
-
component: "duet-upload",
|
|
996
|
-
});
|
|
997
|
-
};
|
|
998
|
-
this.onReady = () => {
|
|
999
|
-
this.duetReady.emit({
|
|
1000
|
-
component: "duet-upload",
|
|
1001
|
-
});
|
|
1002
|
-
};
|
|
1003
|
-
this.onDone = () => {
|
|
1004
|
-
this.duetDone.emit({
|
|
1005
|
-
component: "duet-upload",
|
|
1006
|
-
data: { files: this.files },
|
|
1007
|
-
});
|
|
1008
|
-
};
|
|
1289
|
+
this.metaData = metaData;
|
|
1290
|
+
this.nativeInput.click();
|
|
1291
|
+
return;
|
|
1292
|
+
}
|
|
1009
1293
|
/**
|
|
1010
|
-
*
|
|
1294
|
+
* Method for uploading pending files
|
|
1011
1295
|
*/
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
const inprogress = [];
|
|
1015
|
-
const failure = [];
|
|
1016
|
-
const pending = [];
|
|
1017
|
-
const success = [];
|
|
1018
|
-
let hasCategory = false;
|
|
1019
|
-
all.forEach(data => {
|
|
1020
|
-
const group = this.getGroupFromItemData(data);
|
|
1021
|
-
// const item = mapFn(data, group)
|
|
1022
|
-
// const category = <UploadCategory meta={data.meta} />
|
|
1023
|
-
// const categories = data.meta?.badges?.join(",")
|
|
1024
|
-
if (data.meta && !!data.meta.badges) {
|
|
1025
|
-
hasCategory = true;
|
|
1026
|
-
}
|
|
1027
|
-
if (group === this.DefaultGroups.success) {
|
|
1028
|
-
success.push({
|
|
1029
|
-
uid: data.uid,
|
|
1030
|
-
data,
|
|
1031
|
-
});
|
|
1032
|
-
}
|
|
1033
|
-
else if (group === this.DefaultGroups.inprogress) {
|
|
1034
|
-
inprogress.push({
|
|
1035
|
-
uid: data.uid,
|
|
1036
|
-
data,
|
|
1037
|
-
});
|
|
1038
|
-
}
|
|
1039
|
-
else if (group === this.DefaultGroups.pending) {
|
|
1040
|
-
pending.push({
|
|
1041
|
-
uid: data.uid,
|
|
1042
|
-
data,
|
|
1043
|
-
});
|
|
1044
|
-
}
|
|
1045
|
-
else if (group === this.DefaultGroups.failure) {
|
|
1046
|
-
failure.push({
|
|
1047
|
-
uid: data.uid,
|
|
1048
|
-
data,
|
|
1049
|
-
});
|
|
1050
|
-
}
|
|
1051
|
-
else if (data.group) {
|
|
1052
|
-
inprogress.push({
|
|
1053
|
-
uid: data.uid,
|
|
1054
|
-
data,
|
|
1055
|
-
});
|
|
1056
|
-
}
|
|
1057
|
-
});
|
|
1058
|
-
return {
|
|
1059
|
-
pending,
|
|
1060
|
-
failure,
|
|
1061
|
-
success,
|
|
1062
|
-
inprogress,
|
|
1063
|
-
hasCategory,
|
|
1064
|
-
};
|
|
1065
|
-
};
|
|
1066
|
-
this.getActions = (id, actions) => {
|
|
1067
|
-
return actions.filter(item => item.map.includes(id));
|
|
1068
|
-
};
|
|
1069
|
-
this.renderUploadedItems = () => {
|
|
1070
|
-
this.itemRefs.clear();
|
|
1071
|
-
const filteredItems = this.filterMap();
|
|
1072
|
-
const hasCategory = filteredItems.hasCategory;
|
|
1073
|
-
const filteredActions = this.hideCancelButton
|
|
1074
|
-
? this.actions.filter(action => action.name !== "cancel")
|
|
1075
|
-
: this.actions;
|
|
1076
|
-
const ItemRows = this.groups.map(group => {
|
|
1077
|
-
const currentItems = filteredItems[group.id];
|
|
1078
|
-
if (!(currentItems === null || currentItems === void 0 ? void 0 : currentItems.length)) {
|
|
1079
|
-
return;
|
|
1080
|
-
}
|
|
1081
|
-
return (h(Fragment, null, !this.hideGroups && (h(UploadItemHeader, { categoryLabel: hasCategory ? this.categoryLabel : undefined, label: group.label })), currentItems.map(item => this.mapFilesToUploadItems(item.data, group.id, hasCategory, filteredActions))));
|
|
1082
|
-
});
|
|
1083
|
-
return (h(Fragment, null, this.showUploadedItemsHeader && (h(UploadItemHeader, { categoryLabel: hasCategory ? this.categoryLabel : undefined, label: this.uploadedItemsHeaderLabel })), ItemRows));
|
|
1084
|
-
};
|
|
1085
|
-
this.tick = Date.now();
|
|
1086
|
-
this.accessibleActiveDescendant = undefined;
|
|
1087
|
-
this.accessibleDescribedBy = undefined;
|
|
1088
|
-
this.accessibleControls = undefined;
|
|
1089
|
-
this.accessibleOwns = undefined;
|
|
1090
|
-
this.external = false;
|
|
1091
|
-
this.middleware = null;
|
|
1092
|
-
this.deferUpload = false;
|
|
1093
|
-
this.hideButton = false;
|
|
1094
|
-
this.actions = [
|
|
1095
|
-
{
|
|
1096
|
-
icon: "action-delete",
|
|
1097
|
-
color: "color-danger",
|
|
1098
|
-
size: "x-small",
|
|
1099
|
-
background: "gray-lightest",
|
|
1100
|
-
name: "delete",
|
|
1101
|
-
map: ["success", "failure"],
|
|
1102
|
-
label: {
|
|
1103
|
-
fi: "Poista tiedosto",
|
|
1104
|
-
en: "Delete the file",
|
|
1105
|
-
sv: "Ta bort filen",
|
|
1106
|
-
},
|
|
1107
|
-
},
|
|
1108
|
-
{
|
|
1109
|
-
icon: "navigation-close",
|
|
1110
|
-
color: "primary",
|
|
1111
|
-
size: "x-small",
|
|
1112
|
-
background: "gray-lightest",
|
|
1113
|
-
name: "cancel",
|
|
1114
|
-
map: ["inprogress", "pending"],
|
|
1115
|
-
label: {
|
|
1116
|
-
fi: "Keskeytä lähetys",
|
|
1117
|
-
en: "Cancel the upload",
|
|
1118
|
-
sv: "Stop överföringen",
|
|
1119
|
-
},
|
|
1120
|
-
},
|
|
1121
|
-
];
|
|
1122
|
-
this.uri = undefined;
|
|
1123
|
-
this.showLinks = false;
|
|
1124
|
-
this.caption = undefined;
|
|
1125
|
-
this.statusLabelDefaults = {
|
|
1126
|
-
fi: {
|
|
1127
|
-
inProgress: "Lähetetään {filesUploaded}, yhteensä lähetettävänä {filesTotal}.",
|
|
1128
|
-
inProgressWithErrors: "Lähetetään {filesInProgress}, lähetetty {filesUploaded}, yhteensä lähetettävänä {filesTotal}, {filesWithErrors} epäonnistui",
|
|
1129
|
-
done: "Lähetys valmis, {filesTotal} lisätty onnistuneesti",
|
|
1130
|
-
doneWithErrors: "Lähetys valmis, {filesUploaded} lisätty onnistuneesti, {filesWithErrors} epäonnistui",
|
|
1131
|
-
files: "tiedostoa",
|
|
1132
|
-
file: "tiedosto",
|
|
1133
|
-
},
|
|
1134
|
-
sv: {
|
|
1135
|
-
inProgress: "Laddar upp {filesUploaded} av {filesTotal}",
|
|
1136
|
-
inProgressWithErrors: "Laddar upp {filesInProgress}, {filesUploaded} uppladdad av {filesTotal}, {filesWithErrors} misslyckades",
|
|
1137
|
-
done: "Uppladdningen slutförd, {filesTotal} har lagts till",
|
|
1138
|
-
doneWithErrors: "Uppladdningen slutförd, {filesUploaded} har lagts till, {filesWithErrors} misslyckades",
|
|
1139
|
-
files: "filer",
|
|
1140
|
-
file: "fil",
|
|
1141
|
-
},
|
|
1142
|
-
en: {
|
|
1143
|
-
inProgress: "Uploading {filesUploaded} of {filesTotal}",
|
|
1144
|
-
inProgressWithErrors: "Uploading {filesInProgress}, {filesUploaded} uploaded of {filesTotal}, {filesWithErrors} failed",
|
|
1145
|
-
done: "Upload completed, {filesTotal} added successfully",
|
|
1146
|
-
doneWithErrors: "Upload completed, {filesUploaded} added successfully, {filesWithErrors} failed.",
|
|
1147
|
-
files: "files",
|
|
1148
|
-
file: "file",
|
|
1149
|
-
},
|
|
1150
|
-
};
|
|
1151
|
-
this.statusMessageLabel = getLocaleString(this.statusLabelDefaults);
|
|
1152
|
-
this.buttonLabelDefaults = {
|
|
1153
|
-
fi: "Lisää liite",
|
|
1154
|
-
sv: "Lägg till en bilaga",
|
|
1155
|
-
en: "Add an attachment",
|
|
1156
|
-
};
|
|
1157
|
-
this.buttonLabel = getLocaleString(this.buttonLabelDefaults);
|
|
1158
|
-
this.accessibleButtonLabel = undefined;
|
|
1159
|
-
this.theme = "";
|
|
1160
|
-
this.disabled = false;
|
|
1161
|
-
this.identifier = undefined;
|
|
1162
|
-
this.margin = "auto";
|
|
1163
|
-
this.required = false;
|
|
1164
|
-
this.alignment = "middle";
|
|
1165
|
-
this.hideGroups = false;
|
|
1166
|
-
this.files = new Map();
|
|
1167
|
-
this.valid = !this.required;
|
|
1168
|
-
this.labelDefaults = {
|
|
1169
|
-
fi: "Lisää liite",
|
|
1170
|
-
sv: "Lägg till en bilaga",
|
|
1171
|
-
en: "Add attachments",
|
|
1172
|
-
};
|
|
1173
|
-
this.label = getLocaleString(this.labelDefaults);
|
|
1174
|
-
this.descriptionDefaults = {
|
|
1175
|
-
en: "You may attach the following filetypes: {filetypes} - as well as the most common video files. You can upload {maxbytestotal} of files at a time, and add up to {maxfiles} attachments at a time each no larger than {maxbytes}.",
|
|
1176
|
-
sv: "Du kan bifoga följande filtyper: {filetypes} - samt de vanligaste videofilerna. Du kan ladda upp {maxbytestotal} av filer åt gången, och lägga till upp till {maxfiles} bilagor åt gången varje inte större än {maxbytes}.",
|
|
1177
|
-
fi: "Voit liittää seuraavat tiedostotyypit: {filetypes} - sekä yleisimmät videotiedostot. Voit lähettää {maxbytestotal} tiedostoa kerrallaan, ja lisätä enintään {maxfiles} liitettä kerrallaan, jokainen enintään {maxbytes} kokoisena.",
|
|
1178
|
-
};
|
|
1179
|
-
this.description = getLocaleString(this.descriptionDefaults);
|
|
1180
|
-
this.fileListEmptyDefaults = {
|
|
1181
|
-
fi: "Ei vielä lisättyjä tiedostoja.",
|
|
1182
|
-
sv: "Inga filer har lagts till ännu.",
|
|
1183
|
-
en: "No files added yet.",
|
|
1184
|
-
};
|
|
1185
|
-
this.fileListEmpty = getLocaleString(this.fileListEmptyDefaults);
|
|
1186
|
-
this.error = "";
|
|
1187
|
-
this.errorCodes = errorCodes;
|
|
1188
|
-
this.name = undefined;
|
|
1189
|
-
this.maxBytes = 200000000;
|
|
1190
|
-
this.maxBytesTotal = undefined;
|
|
1191
|
-
this.maxFiles = 99;
|
|
1192
|
-
this.allowedExtensions = "all";
|
|
1193
|
-
this.allowedMimetypes = "";
|
|
1194
|
-
this.multiple = true;
|
|
1195
|
-
this.limitSelection = false;
|
|
1196
|
-
this.hideCancelButton = false;
|
|
1197
|
-
this.value = undefined;
|
|
1198
|
-
this.externalUploadButtonId = undefined;
|
|
1199
|
-
this.captionOnBottom = false;
|
|
1200
|
-
this.showUploadedItemsHeader = false;
|
|
1201
|
-
this.uploadedItemsHeaderLabel = {
|
|
1202
|
-
fi: "Ladattu tiedosto",
|
|
1203
|
-
sv: "Lägg till en bilaga",
|
|
1204
|
-
en: "Uploaded file",
|
|
1205
|
-
};
|
|
1206
|
-
this.headerHeadingLevel = "h3";
|
|
1207
|
-
this.hideHeader = false;
|
|
1208
|
-
this.emitEvent = false;
|
|
1209
|
-
this.groups = [
|
|
1210
|
-
{
|
|
1211
|
-
id: this.DefaultGroups.success,
|
|
1212
|
-
label: {
|
|
1213
|
-
fi: "Valmiit tiedostot",
|
|
1214
|
-
sv: "Files success",
|
|
1215
|
-
en: "Files success",
|
|
1216
|
-
},
|
|
1217
|
-
},
|
|
1218
|
-
{
|
|
1219
|
-
id: this.DefaultGroups.failure,
|
|
1220
|
-
label: {
|
|
1221
|
-
fi: "Tiedostot, joissa on virheitä",
|
|
1222
|
-
sv: "Filer med fel",
|
|
1223
|
-
en: "Files with errors",
|
|
1224
|
-
},
|
|
1225
|
-
},
|
|
1226
|
-
{
|
|
1227
|
-
id: this.DefaultGroups.inprogress,
|
|
1228
|
-
label: {
|
|
1229
|
-
fi: "Kesken olevat tiedostot",
|
|
1230
|
-
sv: "Filer inprogress",
|
|
1231
|
-
en: "Files inprogress",
|
|
1232
|
-
},
|
|
1233
|
-
},
|
|
1234
|
-
{
|
|
1235
|
-
id: this.DefaultGroups.pending,
|
|
1236
|
-
label: {
|
|
1237
|
-
en: "Files to upload",
|
|
1238
|
-
sv: "Filer att ladda",
|
|
1239
|
-
fi: "Ladattavat tiedostot",
|
|
1240
|
-
},
|
|
1241
|
-
},
|
|
1242
|
-
];
|
|
1243
|
-
}
|
|
1244
|
-
watchValidHandler(newValue, oldValue) {
|
|
1245
|
-
if (newValue !== oldValue) {
|
|
1246
|
-
this.kick();
|
|
1296
|
+
async uploadPending() {
|
|
1297
|
+
this.uploadPendingFiles();
|
|
1247
1298
|
}
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
else {
|
|
1257
|
-
this.internalStatusMessageLabel = this.statusMessageLabel;
|
|
1258
|
-
}
|
|
1259
|
-
inheritGlobalTheme(this);
|
|
1260
|
-
this.listenForActionEvents();
|
|
1261
|
-
this.onReady();
|
|
1262
|
-
this.externalUploadButton = document.querySelector(`#${this.externalUploadButtonId}`);
|
|
1263
|
-
}
|
|
1264
|
-
componentWillRender() {
|
|
1265
|
-
// listen to the events from the component
|
|
1266
|
-
this.verifyValidity();
|
|
1267
|
-
}
|
|
1268
|
-
/**
|
|
1269
|
-
* Sets focus on the specified `duet-input`. Use this method instead of the global
|
|
1270
|
-
* `input.focus()`.
|
|
1271
|
-
*/
|
|
1272
|
-
async setFocus(options) {
|
|
1273
|
-
if (this.nativeInput) {
|
|
1274
|
-
this.nativeInput.focus(options);
|
|
1275
|
-
}
|
|
1276
|
-
return;
|
|
1277
|
-
}
|
|
1278
|
-
/**
|
|
1279
|
-
* Method for invoking the upload sequence
|
|
1280
|
-
*/
|
|
1281
|
-
async upload(metaData = undefined) {
|
|
1282
|
-
// validate that we haven't hit any maxfiles or maxbytes limits before we upload
|
|
1283
|
-
const { bytesMaxReached, fileMaxReached } = this.validateTotals();
|
|
1284
|
-
if (bytesMaxReached || fileMaxReached) {
|
|
1285
|
-
this.handleExternalUploadButton(bytesMaxReached, fileMaxReached);
|
|
1286
|
-
this.kick();
|
|
1287
|
-
return;
|
|
1288
|
-
}
|
|
1289
|
-
this.metaData = metaData;
|
|
1290
|
-
this.nativeInput.click();
|
|
1291
|
-
return;
|
|
1292
|
-
}
|
|
1293
|
-
/**
|
|
1294
|
-
* Method for uploading pending files
|
|
1295
|
-
*/
|
|
1296
|
-
async uploadPending() {
|
|
1297
|
-
this.uploadPendingFiles();
|
|
1298
|
-
}
|
|
1299
|
-
/**
|
|
1300
|
-
* Method for forcing a render of the upload list, element.files can be changed externally
|
|
1301
|
-
* But it will only rerender on a new Map or a top Level change - this can be used to update
|
|
1302
|
-
* the tabular data if the automatic re-render is no sufficient
|
|
1303
|
-
*/
|
|
1304
|
-
async refresh() {
|
|
1305
|
-
this.kick();
|
|
1306
|
-
await this.setFocus();
|
|
1307
|
-
}
|
|
1308
|
-
/**
|
|
1309
|
-
* Get list of files, divided in errors and valid sections
|
|
1310
|
-
*/
|
|
1311
|
-
async getFiles() {
|
|
1312
|
-
if (!this.files || this.files.size === 0) {
|
|
1313
|
-
return false;
|
|
1299
|
+
/**
|
|
1300
|
+
* Method for forcing a render of the upload list, element.files can be changed externally
|
|
1301
|
+
* But it will only rerender on a new Map or a top Level change - this can be used to update
|
|
1302
|
+
* the tabular data if the automatic re-render is no sufficient
|
|
1303
|
+
*/
|
|
1304
|
+
async refresh() {
|
|
1305
|
+
this.kick();
|
|
1306
|
+
await this.setFocus();
|
|
1314
1307
|
}
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
/**
|
|
1324
|
-
* focusActionButton.
|
|
1325
|
-
*/
|
|
1326
|
-
async focusActionButton(uid) {
|
|
1327
|
-
var _a;
|
|
1328
|
-
await ((_a = this.itemRefs.get(uid)) === null || _a === void 0 ? void 0 : _a.focusActionButton());
|
|
1329
|
-
}
|
|
1330
|
-
/**
|
|
1331
|
-
* render() function
|
|
1332
|
-
* Always the last one in the class.
|
|
1333
|
-
*/
|
|
1334
|
-
render() {
|
|
1335
|
-
const identifier = this.identifier || this.uploadId;
|
|
1336
|
-
const maxMegaBytesTotal = Math.round((this.maxBytesTotal ? this.maxBytesTotal : this.maxBytes * this.maxFiles) / 1024 / 1024);
|
|
1337
|
-
const maxMegaBytesPrFile = Math.round(this.maxBytes / 1024 / 1024);
|
|
1338
|
-
let caption = this.description.replace(/{maxfiles}/g, this.maxFiles.toString());
|
|
1339
|
-
caption = caption.replace(/{maxbytes}/g, `${maxMegaBytesPrFile.toString()} MB`);
|
|
1340
|
-
caption = caption.replace(/{maxbytestotal}/g, `${maxMegaBytesTotal.toString()} MB`);
|
|
1341
|
-
caption = caption.replace(/{filetypes}/g, this.allowedExtensions.split(",").join(", "));
|
|
1342
|
-
if (this.externalUploadButton) {
|
|
1343
|
-
this.externalUploadButton.ariaLabel = caption;
|
|
1308
|
+
/**
|
|
1309
|
+
* Get list of files, divided in errors and valid sections
|
|
1310
|
+
*/
|
|
1311
|
+
async getFiles() {
|
|
1312
|
+
if (!this.files || this.files.size === 0) {
|
|
1313
|
+
return false;
|
|
1314
|
+
}
|
|
1315
|
+
return this.getFilesAsArray();
|
|
1344
1316
|
}
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
this.nativeInput = input;
|
|
1351
|
-
}, accept: !this.limitSelection ? undefined : `${this.allowedMimetypes},${this.allowedExtensions}`, onBlur: this.onBlur, onFocus: this.onFocus, onChange: e => this.onChange(e), type: "file", class: {
|
|
1352
|
-
"duet-upload": true,
|
|
1353
|
-
}, disabled: this.disabled, "aria-hidden": "true", required: this.required, name: this.name, id: this.identifier, multiple: this.multiple, tabIndex: -1 })))));
|
|
1354
|
-
}
|
|
1355
|
-
/**
|
|
1356
|
-
* XHR request utilities
|
|
1357
|
-
*/
|
|
1358
|
-
makeXHRPostRequest(data) {
|
|
1359
|
-
const xhr = new XMLHttpRequest();
|
|
1360
|
-
const name = data.get("name");
|
|
1361
|
-
xhr.upload.addEventListener("progress", ev => {
|
|
1362
|
-
this.updateProgress(ev, name);
|
|
1363
|
-
});
|
|
1364
|
-
xhr.upload.addEventListener("load", () => {
|
|
1365
|
-
this.transferComplete(name);
|
|
1366
|
-
});
|
|
1367
|
-
xhr.upload.addEventListener("error", () => {
|
|
1368
|
-
this.transferFailed(name);
|
|
1369
|
-
});
|
|
1370
|
-
xhr.upload.addEventListener("abort", () => {
|
|
1371
|
-
this.transferCanceled(name);
|
|
1372
|
-
});
|
|
1373
|
-
let options = {
|
|
1374
|
-
payload: { data, name },
|
|
1375
|
-
options: { type: "POST", uri: this.uri, xhr, argument: null, headers: undefined },
|
|
1376
|
-
onFailure: this.transferDoneWithFailure,
|
|
1377
|
-
onSuccess: this.transferDone,
|
|
1378
|
-
onProgress: this.trackProgress,
|
|
1379
|
-
};
|
|
1380
|
-
if (this.middleware) {
|
|
1381
|
-
options = this.middleware(options);
|
|
1317
|
+
/**
|
|
1318
|
+
* Convenience method for updating the value of a key:value inside an item in the files attribute
|
|
1319
|
+
*/
|
|
1320
|
+
async updateValue(item, key, value) {
|
|
1321
|
+
this.updateValueInMap(item, key, value);
|
|
1382
1322
|
}
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
"x-fileuid": uid,
|
|
1390
|
-
"x-filename": item.name,
|
|
1391
|
-
};
|
|
1392
|
-
let options = {
|
|
1393
|
-
payload: { data: null, name },
|
|
1394
|
-
options: {
|
|
1395
|
-
type: "DELETE",
|
|
1396
|
-
xhr,
|
|
1397
|
-
uri: this.uri,
|
|
1398
|
-
argument: `?key=${uid}&name=${item.name}`,
|
|
1399
|
-
headers,
|
|
1400
|
-
},
|
|
1401
|
-
onFailure: this.transferDoneWithFailure,
|
|
1402
|
-
onSuccess: this.transferDone,
|
|
1403
|
-
onProgress: this.trackProgress,
|
|
1404
|
-
};
|
|
1405
|
-
if (this.middleware) {
|
|
1406
|
-
options = this.middleware(options);
|
|
1323
|
+
/**
|
|
1324
|
+
* focusActionButton.
|
|
1325
|
+
*/
|
|
1326
|
+
async focusActionButton(uid) {
|
|
1327
|
+
var _a;
|
|
1328
|
+
await ((_a = this.itemRefs.get(uid)) === null || _a === void 0 ? void 0 : _a.focusActionButton());
|
|
1407
1329
|
}
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1330
|
+
/**
|
|
1331
|
+
* render() function
|
|
1332
|
+
* Always the last one in the class.
|
|
1333
|
+
*/
|
|
1334
|
+
render() {
|
|
1335
|
+
const identifier = this.identifier || this.uploadId;
|
|
1336
|
+
const maxMegaBytesTotal = Math.round((this.maxBytesTotal ? this.maxBytesTotal : this.maxBytes * this.maxFiles) / 1024 / 1024);
|
|
1337
|
+
const maxMegaBytesPrFile = Math.round(this.maxBytes / 1024 / 1024);
|
|
1338
|
+
let caption = this.description.replace(/{maxfiles}/g, this.maxFiles.toString());
|
|
1339
|
+
caption = caption.replace(/{maxbytes}/g, `${maxMegaBytesPrFile.toString()} MB`);
|
|
1340
|
+
caption = caption.replace(/{maxbytestotal}/g, `${maxMegaBytesTotal.toString()} MB`);
|
|
1341
|
+
caption = caption.replace(/{filetypes}/g, this.allowedExtensions.split(",").join(", "));
|
|
1342
|
+
if (this.externalUploadButton) {
|
|
1343
|
+
this.externalUploadButton.accessibleLabel = caption;
|
|
1344
|
+
}
|
|
1345
|
+
// @ts-ignore
|
|
1346
|
+
return (h(Host, { class: { "duet-m-0": this.margin === "none" } }, h("duet-fieldset", { "label-heading-level": this.headerHeadingLevel, "label-hidden": this.hideHeader, label: this.label, caption: !this.captionOnBottom ? caption : undefined }, h("slot", { name: "header" }), !this.files.size && (h("duet-empty-state", { id: this.labelId, part: this.identifier ? `${this.identifier}-empty-state` : "duet-upload-empty-state", icon: "messaging-attachment" }, h("duet-paragraph", { margin: "none" }, this.fileListEmpty))), !!this.files.size && h("slot", { name: "fileheader" }), !!this.files.size && (h("duet-upload-aria-status", { invalid: this.getFilesAsArray().invalid.length, valid: this.getFilesAsArray().valid.length, inprogress: this.filesInProgress.size, total: this.files.size, statusMessageLabel: this.internalStatusMessageLabel })), !!this.files.size && this.renderUploadedItems(), !!this.files.size && h("slot", { name: "filefooter" }), h("slot", { name: "uploadfooter" }), this.captionOnBottom && (h("duet-caption", { margin: "none", size: "small" }, h("div", { class: "upload-bottom-caption" }, caption))), h("slot", { name: "afterfooter" }), !this.hideButton && (h(Fragment, null, h("duet-spacer", { size: "large" }), h("duet-button", { id: this.buttonId, onClick: this.startUpload, "accessible-controls": identifier, disabled: this.fileMaxReached, "accessible-label": this.accessibleButtonLabel, "accessible-owns": identifier, size: "small", variation: "secondary", fixed: true, icon: "action-add-circle", part: this.identifier ? `${this.identifier}-button-upload` : "duet-upload-button-upload" }, this.buttonLabel))), (this.fileMaxReached ||
|
|
1347
|
+
this.bytesMaxReached ||
|
|
1348
|
+
this.filesToUploadExceedsLimit ||
|
|
1349
|
+
this.filesToUploadTotalSizeIsAboveMax) && (h(Fragment, null, h("duet-spacer", { size: "medium" }), h("duet-alert", { part: this.identifier ? `${this.identifier}-error-notification` : "duet-upload-error-notification" }, this.fileMaxReached && getI18nError("duet-upload-301", this.errorCodes), this.bytesMaxReached && getI18nError("duet-upload-202", this.errorCodes), this.filesToUploadExceedsLimit && getI18nError("duet-upload-302", this.errorCodes), this.filesToUploadTotalSizeIsAboveMax && getI18nError("duet-upload-203", this.errorCodes)))), h("duet-visually-hidden", { "aria-hidden": "true" }, h("input", { ref: input => {
|
|
1350
|
+
this.nativeInput = input;
|
|
1351
|
+
}, accept: !this.limitSelection ? undefined : `${this.allowedMimetypes},${this.allowedExtensions}`, onBlur: this.onBlur, onFocus: this.onFocus, onChange: e => this.onChange(e), type: "file", class: {
|
|
1352
|
+
"duet-upload": true,
|
|
1353
|
+
}, disabled: this.disabled, "aria-hidden": "true", required: this.required, name: this.name, id: this.identifier, multiple: this.multiple, tabIndex: -1 })))));
|
|
1425
1354
|
}
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1355
|
+
/**
|
|
1356
|
+
* XHR request utilities
|
|
1357
|
+
*/
|
|
1358
|
+
makeXHRPostRequest(data) {
|
|
1359
|
+
const xhr = new XMLHttpRequest();
|
|
1360
|
+
const name = data.get("name");
|
|
1361
|
+
xhr.upload.addEventListener("progress", ev => {
|
|
1362
|
+
this.updateProgress(ev, name);
|
|
1363
|
+
});
|
|
1364
|
+
xhr.upload.addEventListener("load", () => {
|
|
1365
|
+
this.transferComplete(name);
|
|
1366
|
+
});
|
|
1367
|
+
xhr.upload.addEventListener("error", () => {
|
|
1368
|
+
this.transferFailed(name);
|
|
1369
|
+
});
|
|
1370
|
+
xhr.upload.addEventListener("abort", () => {
|
|
1371
|
+
this.transferCanceled(name);
|
|
1372
|
+
});
|
|
1373
|
+
let options = {
|
|
1374
|
+
payload: { data, name },
|
|
1375
|
+
options: { type: "POST", uri: this.uri, xhr, argument: null, headers: undefined },
|
|
1376
|
+
onFailure: this.transferDoneWithFailure,
|
|
1377
|
+
onSuccess: this.transferDone,
|
|
1378
|
+
onProgress: this.trackProgress,
|
|
1379
|
+
};
|
|
1380
|
+
if (this.middleware) {
|
|
1381
|
+
options = this.middleware(options);
|
|
1382
|
+
}
|
|
1383
|
+
return makeXhrRequest(options);
|
|
1431
1384
|
}
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
const
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
}
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
},
|
|
1452
|
-
progress: 0,
|
|
1453
|
-
deleted: false,
|
|
1454
|
-
xhr: false,
|
|
1455
|
-
url: false,
|
|
1385
|
+
makeXHRDeleteRequest(data) {
|
|
1386
|
+
const { uid, item } = data;
|
|
1387
|
+
const xhr = new XMLHttpRequest();
|
|
1388
|
+
const headers = {
|
|
1389
|
+
"x-fileuid": uid,
|
|
1390
|
+
"x-filename": item.name,
|
|
1391
|
+
};
|
|
1392
|
+
let options = {
|
|
1393
|
+
payload: { data: null, name },
|
|
1394
|
+
options: {
|
|
1395
|
+
type: "DELETE",
|
|
1396
|
+
xhr,
|
|
1397
|
+
uri: this.uri,
|
|
1398
|
+
argument: `?key=${uid}&name=${item.name}`,
|
|
1399
|
+
headers,
|
|
1400
|
+
},
|
|
1401
|
+
onFailure: this.transferDoneWithFailure,
|
|
1402
|
+
onSuccess: this.transferDone,
|
|
1403
|
+
onProgress: this.trackProgress,
|
|
1456
1404
|
};
|
|
1457
|
-
this.
|
|
1458
|
-
|
|
1459
|
-
await this.uploadFile(fileListItem);
|
|
1405
|
+
if (this.middleware) {
|
|
1406
|
+
options = this.middleware(options);
|
|
1460
1407
|
}
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1408
|
+
// don't present server issues to user on deletes, just remove them from the visible list
|
|
1409
|
+
return makeXhrRequest(options);
|
|
1410
|
+
}
|
|
1411
|
+
/**
|
|
1412
|
+
* Component event handling.
|
|
1413
|
+
*/
|
|
1414
|
+
async onChange(ev) {
|
|
1415
|
+
var _a;
|
|
1416
|
+
const selectedFiles = Array.from((_a = this.nativeInput) === null || _a === void 0 ? void 0 : _a.files);
|
|
1417
|
+
// FileList is a nice array like structure but
|
|
1418
|
+
// to ensure uniqueness of files we use a mapping structure and
|
|
1419
|
+
// key to the name (makes it easier to delete as well)
|
|
1420
|
+
this.filesToUploadExceedsLimit = false;
|
|
1421
|
+
if (filesToUploadCountAboveMax(this.files.size, selectedFiles.length, this.maxFiles)) {
|
|
1422
|
+
this.filesToUploadExceedsLimit = true;
|
|
1423
|
+
this.kick();
|
|
1424
|
+
return;
|
|
1464
1425
|
}
|
|
1465
|
-
|
|
1466
|
-
|
|
1426
|
+
this.filesToUploadTotalSizeIsAboveMax = false;
|
|
1427
|
+
if (filesToUploadTotalSizeIsAboveMax(this.files, selectedFiles, this.maxBytesTotal)) {
|
|
1428
|
+
this.filesToUploadTotalSizeIsAboveMax = true;
|
|
1429
|
+
this.kick();
|
|
1430
|
+
return;
|
|
1467
1431
|
}
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1432
|
+
if (selectedFiles) {
|
|
1433
|
+
for (const item of selectedFiles) {
|
|
1434
|
+
const { valid, errorMessage, errorType, errorSystem } = validateFile(item, {
|
|
1435
|
+
maxBytes: this.maxBytes,
|
|
1436
|
+
allowedExtensions: this.allowedExtensions,
|
|
1437
|
+
allowedMimetypes: this.allowedMimetypes,
|
|
1438
|
+
}, this.errorCodes);
|
|
1439
|
+
const uid = this.genHashName();
|
|
1440
|
+
const fileListItem = {
|
|
1441
|
+
uid,
|
|
1442
|
+
item: item,
|
|
1443
|
+
size: item.size,
|
|
1444
|
+
meta: this.metaData,
|
|
1445
|
+
uploaded: false,
|
|
1446
|
+
valid,
|
|
1447
|
+
error: {
|
|
1448
|
+
type: valid ? undefined : errorType,
|
|
1449
|
+
message: valid ? undefined : errorMessage,
|
|
1450
|
+
system_message: valid ? undefined : errorSystem,
|
|
1451
|
+
},
|
|
1452
|
+
progress: 0,
|
|
1453
|
+
deleted: false,
|
|
1454
|
+
xhr: false,
|
|
1455
|
+
url: false,
|
|
1456
|
+
};
|
|
1457
|
+
this.files.set(item.name, fileListItem);
|
|
1458
|
+
if (valid && !this.external) {
|
|
1459
|
+
await this.uploadFile(fileListItem);
|
|
1460
|
+
}
|
|
1461
|
+
else if (valid && this.external) {
|
|
1462
|
+
this.updateValueInMap(fileListItem.item.name, "pending", true, false);
|
|
1463
|
+
this.updateValueInMap(fileListItem.item.name, "group", "pending", true);
|
|
1464
|
+
}
|
|
1465
|
+
else if (!valid) {
|
|
1466
|
+
this.updateValueInMap(item.name, "valid", false, true);
|
|
1467
|
+
}
|
|
1468
|
+
// kick the stat to force update
|
|
1469
|
+
this.kick();
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1472
|
+
// reset the form, so that a user may upload a file again (with the same name)
|
|
1473
|
+
this.resetFormFields();
|
|
1474
|
+
// reset the internal metaData state
|
|
1475
|
+
this.metaData = undefined;
|
|
1476
|
+
this.duetChange.emit({
|
|
1477
|
+
originalEvent: ev,
|
|
1478
|
+
data: { files: this.files },
|
|
1479
|
+
component: "duet-upload",
|
|
1480
|
+
});
|
|
1471
1481
|
}
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
this.duetChange.emit({
|
|
1477
|
-
originalEvent: ev,
|
|
1478
|
-
data: { files: this.files },
|
|
1479
|
-
component: "duet-upload",
|
|
1480
|
-
});
|
|
1481
|
-
}
|
|
1482
|
-
get element() { return getElement(this); }
|
|
1483
|
-
static get watchers() { return {
|
|
1484
|
-
"valid": ["watchValidHandler"]
|
|
1485
|
-
}; }
|
|
1482
|
+
get element() { return getElement(this); }
|
|
1483
|
+
static get watchers() { return {
|
|
1484
|
+
"valid": ["watchValidHandler"]
|
|
1485
|
+
}; }
|
|
1486
1486
|
};
|
|
1487
1487
|
DuetUpload.style = duetUploadCss;
|
|
1488
1488
|
|