@duetds/components 5.3.2 → 5.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/hydrate/index.js +72 -38
- package/lib/cjs/duet-action-button.cjs.entry.js +1 -1
- package/lib/cjs/duet-alert.cjs.entry.js +1 -1
- package/lib/cjs/duet-badge.cjs.entry.js +1 -1
- package/lib/cjs/duet-breadcrumb.cjs.entry.js +1 -1
- package/lib/cjs/duet-breadcrumbs.cjs.entry.js +1 -1
- package/lib/cjs/duet-button_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-caption_4.cjs.entry.js +1 -1
- package/lib/cjs/duet-card.cjs.entry.js +1 -1
- package/lib/cjs/duet-checkbox.cjs.entry.js +1 -1
- package/lib/cjs/duet-choice_2.cjs.entry.js +2 -2
- package/lib/cjs/duet-collapsible.cjs.entry.js +1 -1
- package/lib/cjs/duet-combobox.cjs.entry.js +1 -1
- package/lib/cjs/duet-cookie-consent.cjs.entry.js +1 -1
- package/lib/cjs/duet-date-picker.cjs.entry.js +2 -2
- package/lib/cjs/duet-divider_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-editable-table_3.cjs.entry.js +72 -40
- package/lib/cjs/duet-empty-state.cjs.entry.js +1 -1
- package/lib/cjs/duet-fieldset.cjs.entry.js +1 -1
- package/lib/cjs/duet-footer.cjs.entry.js +1 -1
- package/lib/cjs/duet-grid_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-header_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-hero.cjs.entry.js +1 -1
- package/lib/cjs/duet-icon.cjs.entry.js +1 -1
- package/lib/cjs/duet-input_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-layout.cjs.entry.js +1 -1
- package/lib/cjs/duet-list_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-modal.cjs.entry.js +2 -2
- package/lib/cjs/duet-notification_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-number-input.cjs.entry.js +1 -1
- package/lib/cjs/duet-pagination_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-progress.cjs.entry.js +1 -1
- package/lib/cjs/duet-radio_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-range-slider.cjs.entry.js +1 -1
- package/lib/cjs/duet-scrollable_3.cjs.entry.js +1 -1
- package/lib/cjs/duet-select.cjs.entry.js +1 -1
- package/lib/cjs/duet-step_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-textarea.cjs.entry.js +1 -1
- package/lib/cjs/duet-toggle.cjs.entry.js +1 -1
- package/lib/cjs/duet-tooltip.cjs.entry.js +1 -1
- package/lib/cjs/duet-tray.cjs.entry.js +1 -1
- package/lib/cjs/duet-upload-aria-status.cjs.entry.js +1 -1
- package/lib/cjs/duet-visually-hidden.cjs.entry.js +1 -1
- package/lib/cjs/duet.cjs.js +2 -2
- package/lib/cjs/{focus-utils-1de1fb9e.js → focus-utils-54bf88c4.js} +1 -1
- package/lib/cjs/{index-e25673c3.js → index-d74701f0.js} +1 -1
- package/lib/cjs/loader.cjs.js +2 -2
- package/lib/collection/components/duet-upload/duet-upload.css +3 -3
- package/lib/collection/components/duet-upload/duet-upload.js +110 -24
- package/lib/collection/components/duet-upload/errorcodes.utils.js +5 -4
- package/lib/collection/components/duet-upload/mock.helpers.js +16 -5
- package/lib/collection/components/duet-upload/upload-editable-item-error.js +4 -4
- package/lib/collection/components/duet-upload/upload-editable-item-inprogres.js +5 -2
- package/lib/collection/components/duet-upload/upload-editable-item-pending.js +4 -3
- package/lib/collection/components/duet-upload/upload-validators.js +5 -5
- package/lib/collection/components/duet-upload/xhr.helpers.js +1 -0
- package/lib/custom-elements-bundle/index.js +72 -40
- package/lib/duet/duet.esm.js +1 -1
- package/lib/duet/duet.js +1 -1
- package/lib/duet/{p-76502a6e.system.entry.js → p-017c8f85.system.entry.js} +1 -1
- package/lib/duet/{p-06d6fcbb.entry.js → p-05093845.entry.js} +1 -1
- package/lib/duet/{p-606f0e3e.system.entry.js → p-09f8d68b.system.entry.js} +1 -1
- package/lib/duet/{p-a00567c5.entry.js → p-0c2a368b.entry.js} +1 -1
- package/lib/duet/{p-096d3138.system.entry.js → p-0ed8f525.system.entry.js} +1 -1
- package/lib/duet/{p-a79524ea.system.entry.js → p-0fe15b1c.system.entry.js} +1 -1
- package/lib/duet/{p-44430576.entry.js → p-10dd6a3a.entry.js} +1 -1
- package/lib/duet/{p-e1dc474f.entry.js → p-1463ec25.entry.js} +1 -1
- package/lib/duet/{p-96bd5181.entry.js → p-187dac44.entry.js} +1 -1
- package/lib/duet/{p-3b90bf38.system.entry.js → p-1b971cb4.system.entry.js} +1 -1
- package/lib/duet/{p-e60b6064.system.entry.js → p-263d5c73.system.entry.js} +1 -1
- package/lib/duet/{p-83ccb4d1.system.entry.js → p-29b78a88.system.entry.js} +1 -1
- package/lib/duet/{p-9518a50d.entry.js → p-2ae81abd.entry.js} +1 -1
- package/lib/duet/{p-195cbb65.system.js → p-310cc65a.system.js} +1 -1
- package/lib/duet/{p-eed733d0.entry.js → p-31ee57ef.entry.js} +1 -1
- package/lib/duet/{p-7f720f3d.system.entry.js → p-323af601.system.entry.js} +1 -1
- package/lib/duet/{p-27e1329c.system.entry.js → p-334e765b.system.entry.js} +1 -1
- package/lib/duet/{p-eda03e7a.system.entry.js → p-3357023c.system.entry.js} +1 -1
- package/lib/duet/{p-bd361dca.entry.js → p-351c4ca8.entry.js} +1 -1
- package/lib/duet/{p-e8a19b86.system.entry.js → p-3d4098a1.system.entry.js} +1 -1
- package/lib/duet/{p-3a196674.entry.js → p-4390278a.entry.js} +1 -1
- package/lib/duet/{p-58f4df49.entry.js → p-4407c77f.entry.js} +1 -1
- package/lib/duet/{p-a2f33ea2.entry.js → p-4be003ee.entry.js} +1 -1
- package/lib/duet/{p-18f1a32e.js → p-4bfb3001.js} +1 -1
- package/lib/duet/{p-7acbb1cf.entry.js → p-4f4e6e7a.entry.js} +1 -1
- package/lib/duet/{p-ed86e7b8.system.entry.js → p-5231f09f.system.entry.js} +1 -1
- package/lib/duet/{p-27df7993.entry.js → p-52cd446d.entry.js} +1 -1
- package/lib/duet/{p-4eca850e.system.entry.js → p-53feaad0.system.entry.js} +1 -1
- package/lib/duet/{p-de007928.system.entry.js → p-54adb28a.system.entry.js} +1 -1
- package/lib/duet/{p-cd55d122.entry.js → p-5a134750.entry.js} +1 -1
- package/lib/duet/{p-6c4bb84d.system.entry.js → p-60903f76.system.entry.js} +1 -1
- package/lib/duet/{p-e5541622.entry.js → p-707e6bde.entry.js} +1 -1
- package/lib/duet/{p-f62c6c1a.entry.js → p-711c5825.entry.js} +1 -1
- package/lib/duet/{p-324c6a7f.system.entry.js → p-7a803a0f.system.entry.js} +1 -1
- package/lib/duet/{p-e53b41b1.js → p-7b37a578.js} +1 -1
- package/lib/duet/{p-b2351491.entry.js → p-7b776a5f.entry.js} +1 -1
- package/lib/duet/{p-60bc3fd1.entry.js → p-7ce0b78c.entry.js} +1 -1
- package/lib/duet/{p-94a68b9a.entry.js → p-7ee40ef2.entry.js} +1 -1
- package/lib/duet/{p-0a399341.system.entry.js → p-80db2a1e.system.entry.js} +1 -1
- package/lib/duet/{p-943a6f4f.entry.js → p-8ea1558f.entry.js} +1 -1
- package/lib/duet/{p-bc4dbe8f.system.entry.js → p-9195e263.system.entry.js} +1 -1
- package/lib/duet/{p-dfec73ab.system.entry.js → p-933b5471.system.entry.js} +1 -1
- package/lib/duet/{p-f68f4f90.entry.js → p-97395d40.entry.js} +1 -1
- package/lib/duet/{p-9b762624.entry.js → p-98aa8c7e.entry.js} +1 -1
- package/lib/duet/{p-c33d40b4.entry.js → p-997ef66e.entry.js} +1 -1
- package/lib/duet/{p-195f6e6b.system.entry.js → p-9db6c3ef.system.entry.js} +1 -1
- package/lib/duet/{p-40ba3e58.entry.js → p-9e8acf0a.entry.js} +1 -1
- package/lib/duet/{p-1147c2f3.system.entry.js → p-9e979cae.system.entry.js} +1 -1
- package/lib/duet/{p-b046cc6d.entry.js → p-a07b994c.entry.js} +1 -1
- package/lib/duet/{p-9e9a00fa.entry.js → p-a21321dc.entry.js} +1 -1
- package/lib/duet/{p-05503430.system.entry.js → p-a77df5a4.system.entry.js} +1 -1
- package/lib/duet/{p-14532cbb.system.entry.js → p-ac356267.system.entry.js} +1 -1
- package/lib/duet/{p-eab71bc1.entry.js → p-aea395e2.entry.js} +1 -1
- package/lib/duet/{p-47a3d44a.entry.js → p-aebf923d.entry.js} +1 -1
- package/lib/duet/p-b0053a35.entry.js +4 -0
- package/lib/duet/{p-a164b64d.entry.js → p-b112ecc7.entry.js} +1 -1
- package/lib/duet/{p-8e84cb24.system.entry.js → p-b52d2351.system.entry.js} +1 -1
- package/lib/duet/{p-efd2027f.system.entry.js → p-b717297c.system.entry.js} +1 -1
- package/lib/duet/{p-2980439e.system.entry.js → p-b786f4a1.system.entry.js} +1 -1
- package/lib/duet/{p-f36d233f.entry.js → p-b9f2984d.entry.js} +1 -1
- package/lib/duet/{p-13b08905.system.entry.js → p-badcd20b.system.entry.js} +1 -1
- package/lib/duet/{p-a541f140.entry.js → p-bd697adb.entry.js} +1 -1
- package/lib/duet/{p-07a4933d.system.entry.js → p-bd97848c.system.entry.js} +1 -1
- package/lib/duet/{p-6d6af360.entry.js → p-c0dea844.entry.js} +1 -1
- package/lib/duet/{p-7f501fed.system.entry.js → p-c2a4820d.system.entry.js} +1 -1
- package/lib/duet/p-cd0b0258.system.entry.js +4 -0
- package/lib/duet/{p-dd1cebc6.system.entry.js → p-cfc5df00.system.entry.js} +1 -1
- package/lib/duet/{p-781803f9.system.entry.js → p-d03be8d0.system.entry.js} +1 -1
- package/lib/duet/{p-c5353e57.system.entry.js → p-d06ccc00.system.entry.js} +1 -1
- package/lib/duet/{p-62f76416.entry.js → p-d0eceac9.entry.js} +1 -1
- package/lib/duet/{p-3e8e00aa.system.entry.js → p-d11db0d5.system.entry.js} +1 -1
- package/lib/duet/{p-f1ac8970.entry.js → p-d28243a8.entry.js} +1 -1
- package/lib/duet/{p-7065da4f.entry.js → p-d3d3538f.entry.js} +1 -1
- package/lib/duet/{p-b7a56046.entry.js → p-d749146f.entry.js} +1 -1
- package/lib/duet/{p-d2eec878.entry.js → p-d77dcab2.entry.js} +1 -1
- package/lib/duet/{p-cd6016c3.system.entry.js → p-daa9880c.system.entry.js} +1 -1
- package/lib/duet/{p-b15a7acd.entry.js → p-dadfe56f.entry.js} +1 -1
- package/lib/duet/{p-3a587bea.system.entry.js → p-dcfa2ae4.system.entry.js} +1 -1
- package/lib/duet/{p-29f6749b.system.js → p-e56acd55.system.js} +1 -1
- package/lib/duet/{p-abb3619b.entry.js → p-e58d06d9.entry.js} +1 -1
- package/lib/duet/{p-5f751350.entry.js → p-e6b88a4b.entry.js} +1 -1
- package/lib/duet/{p-fc847cc0.system.js → p-e97c0bf3.system.js} +1 -1
- package/lib/duet/{p-be2cc769.system.entry.js → p-efa06b0e.system.entry.js} +1 -1
- package/lib/duet/{p-dfa83a7b.entry.js → p-f23108a0.entry.js} +1 -1
- package/lib/duet/{p-8544ac3e.system.entry.js → p-f640e49b.system.entry.js} +1 -1
- package/lib/duet/{p-99fc1806.system.entry.js → p-f67a994f.system.entry.js} +1 -1
- package/lib/duet/{p-fdfa9d96.system.entry.js → p-f94cb455.system.entry.js} +1 -1
- package/lib/duet/{p-b2d8afd1.system.entry.js → p-f9787dbb.system.entry.js} +1 -1
- package/lib/duet/{p-fe7a158d.system.entry.js → p-fb761b8d.system.entry.js} +1 -1
- package/lib/esm/duet-action-button.entry.js +1 -1
- package/lib/esm/duet-alert.entry.js +1 -1
- package/lib/esm/duet-badge.entry.js +1 -1
- package/lib/esm/duet-breadcrumb.entry.js +1 -1
- package/lib/esm/duet-breadcrumbs.entry.js +1 -1
- package/lib/esm/duet-button_2.entry.js +1 -1
- package/lib/esm/duet-caption_4.entry.js +1 -1
- package/lib/esm/duet-card.entry.js +1 -1
- package/lib/esm/duet-checkbox.entry.js +1 -1
- package/lib/esm/duet-choice_2.entry.js +2 -2
- package/lib/esm/duet-collapsible.entry.js +1 -1
- package/lib/esm/duet-combobox.entry.js +1 -1
- package/lib/esm/duet-cookie-consent.entry.js +1 -1
- package/lib/esm/duet-date-picker.entry.js +2 -2
- package/lib/esm/duet-divider_2.entry.js +1 -1
- package/lib/esm/duet-editable-table_3.entry.js +72 -40
- package/lib/esm/duet-empty-state.entry.js +1 -1
- package/lib/esm/duet-fieldset.entry.js +1 -1
- package/lib/esm/duet-footer.entry.js +1 -1
- package/lib/esm/duet-grid_2.entry.js +1 -1
- package/lib/esm/duet-header_2.entry.js +1 -1
- package/lib/esm/duet-hero.entry.js +1 -1
- package/lib/esm/duet-icon.entry.js +1 -1
- package/lib/esm/duet-input_2.entry.js +1 -1
- package/lib/esm/duet-layout.entry.js +1 -1
- package/lib/esm/duet-list_2.entry.js +1 -1
- package/lib/esm/duet-modal.entry.js +2 -2
- package/lib/esm/duet-notification_2.entry.js +1 -1
- package/lib/esm/duet-number-input.entry.js +1 -1
- package/lib/esm/duet-pagination_2.entry.js +1 -1
- package/lib/esm/duet-progress.entry.js +1 -1
- package/lib/esm/duet-radio_2.entry.js +1 -1
- package/lib/esm/duet-range-slider.entry.js +1 -1
- package/lib/esm/duet-scrollable_3.entry.js +1 -1
- package/lib/esm/duet-select.entry.js +1 -1
- package/lib/esm/duet-step_2.entry.js +1 -1
- package/lib/esm/duet-textarea.entry.js +1 -1
- package/lib/esm/duet-toggle.entry.js +1 -1
- package/lib/esm/duet-tooltip.entry.js +1 -1
- package/lib/esm/duet-tray.entry.js +1 -1
- package/lib/esm/duet-upload-aria-status.entry.js +1 -1
- package/lib/esm/duet-visually-hidden.entry.js +1 -1
- package/lib/esm/duet.js +2 -2
- package/lib/esm/{focus-utils-634e7bc9.js → focus-utils-2632e19f.js} +1 -1
- package/lib/esm/{index-59261780.js → index-ab50bfb2.js} +1 -1
- package/lib/esm/loader.js +2 -2
- package/lib/esm-es5/duet-action-button.entry.js +1 -1
- package/lib/esm-es5/duet-alert.entry.js +1 -1
- package/lib/esm-es5/duet-badge.entry.js +1 -1
- package/lib/esm-es5/duet-breadcrumb.entry.js +1 -1
- package/lib/esm-es5/duet-breadcrumbs.entry.js +1 -1
- package/lib/esm-es5/duet-button_2.entry.js +1 -1
- package/lib/esm-es5/duet-caption_4.entry.js +1 -1
- package/lib/esm-es5/duet-card.entry.js +1 -1
- package/lib/esm-es5/duet-checkbox.entry.js +1 -1
- package/lib/esm-es5/duet-choice_2.entry.js +1 -1
- package/lib/esm-es5/duet-collapsible.entry.js +1 -1
- package/lib/esm-es5/duet-combobox.entry.js +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-footer.entry.js +1 -1
- package/lib/esm-es5/duet-grid_2.entry.js +1 -1
- package/lib/esm-es5/duet-header_2.entry.js +1 -1
- package/lib/esm-es5/duet-hero.entry.js +1 -1
- package/lib/esm-es5/duet-icon.entry.js +1 -1
- package/lib/esm-es5/duet-input_2.entry.js +1 -1
- package/lib/esm-es5/duet-layout.entry.js +1 -1
- package/lib/esm-es5/duet-list_2.entry.js +1 -1
- package/lib/esm-es5/duet-modal.entry.js +1 -1
- package/lib/esm-es5/duet-notification_2.entry.js +1 -1
- package/lib/esm-es5/duet-number-input.entry.js +1 -1
- package/lib/esm-es5/duet-pagination_2.entry.js +1 -1
- package/lib/esm-es5/duet-progress.entry.js +1 -1
- package/lib/esm-es5/duet-radio_2.entry.js +1 -1
- package/lib/esm-es5/duet-range-slider.entry.js +1 -1
- package/lib/esm-es5/duet-scrollable_3.entry.js +1 -1
- package/lib/esm-es5/duet-select.entry.js +1 -1
- package/lib/esm-es5/duet-step_2.entry.js +1 -1
- package/lib/esm-es5/duet-textarea.entry.js +1 -1
- package/lib/esm-es5/duet-toggle.entry.js +1 -1
- package/lib/esm-es5/duet-tooltip.entry.js +1 -1
- package/lib/esm-es5/duet-tray.entry.js +1 -1
- package/lib/esm-es5/duet-upload-aria-status.entry.js +1 -1
- package/lib/esm-es5/duet-visually-hidden.entry.js +1 -1
- package/lib/esm-es5/duet.js +1 -1
- package/lib/esm-es5/{focus-utils-634e7bc9.js → focus-utils-2632e19f.js} +1 -1
- package/lib/esm-es5/{index-59261780.js → index-ab50bfb2.js} +1 -1
- package/lib/esm-es5/loader.js +1 -1
- package/lib/types/components/duet-upload/duet-upload.d.ts +22 -1
- package/lib/types/components/duet-upload/errorcodes.utils.d.ts +3 -2
- package/lib/types/components/duet-upload/mock.helpers.d.ts +0 -1
- package/lib/types/components/duet-upload/upload-editable-item-error.d.ts +2 -0
- package/lib/types/components/duet-upload/upload-validators.d.ts +2 -1
- package/lib/types/components.d.ts +22 -1
- package/package.json +5 -5
- package/lib/duet/p-2bc92bf3.entry.js +0 -4
- package/lib/duet/p-8342d3f7.system.entry.js +0 -4
package/hydrate/index.js
CHANGED
|
@@ -17095,12 +17095,13 @@ var errorCodes = [
|
|
|
17095
17095
|
}
|
|
17096
17096
|
];
|
|
17097
17097
|
|
|
17098
|
-
const getError = (code) => {
|
|
17098
|
+
const getError = (code, errorCodes) => {
|
|
17099
17099
|
let error = {
|
|
17100
17100
|
type: undefined,
|
|
17101
17101
|
system_message: undefined,
|
|
17102
17102
|
message: undefined,
|
|
17103
17103
|
};
|
|
17104
|
+
errorCodes = parsePossibleJSON(errorCodes);
|
|
17104
17105
|
error = errorCodes.filter(errorItem => {
|
|
17105
17106
|
// the == is intentional we may be comparing numbers to strings - and that is ok here
|
|
17106
17107
|
return errorItem.type == code;
|
|
@@ -17112,8 +17113,8 @@ const getError = (code) => {
|
|
|
17112
17113
|
}
|
|
17113
17114
|
return error;
|
|
17114
17115
|
};
|
|
17115
|
-
const getI18nError = (errorCode) => {
|
|
17116
|
-
const errorFromJson = getError(errorCode);
|
|
17116
|
+
const getI18nError = (errorCode, errorCodes) => {
|
|
17117
|
+
const errorFromJson = getError(errorCode, errorCodes);
|
|
17117
17118
|
const i18String = getLocaleString(errorFromJson.message);
|
|
17118
17119
|
if (i18String === "" || !i18String) {
|
|
17119
17120
|
return errorFromJson.system_message;
|
|
@@ -17123,25 +17124,29 @@ const getI18nError = (errorCode) => {
|
|
|
17123
17124
|
}
|
|
17124
17125
|
};
|
|
17125
17126
|
|
|
17126
|
-
const ErrorItem = ({ data }) => {
|
|
17127
|
+
const ErrorItem = ({ data, errorCodes }) => {
|
|
17127
17128
|
const { item, error } = data;
|
|
17128
17129
|
const { name } = item;
|
|
17129
17130
|
const { type } = error;
|
|
17130
17131
|
return (hAsync("span", { class: "duet-upload-item-error", role: "status" },
|
|
17131
17132
|
hAsync("duet-paragraph", { class: "duet-upload-item-name", color: "danger", margin: "none", weight: "semi-bold" },
|
|
17132
|
-
hAsync("duet-icon", { margin: "none", size: "
|
|
17133
|
-
" ",
|
|
17133
|
+
hAsync("duet-icon", { margin: "none", size: "x-small", name: "messaging-attachment" }),
|
|
17134
|
+
hAsync("duet-spacer", { size: "xx-small", direction: "horizontal" }),
|
|
17134
17135
|
name),
|
|
17135
|
-
hAsync("duet-paragraph", { class: "duet-upload-item-error-label", size: "small", margin: "none", color: "danger" }, getI18nError(type))));
|
|
17136
|
+
hAsync("duet-paragraph", { class: "duet-upload-item-error-label", size: "small", margin: "none", color: "danger" }, getI18nError(type, errorCodes))));
|
|
17136
17137
|
};
|
|
17137
17138
|
|
|
17138
|
-
const ProgressItem = ({ progress, name }) => (hAsync("span",
|
|
17139
|
-
hAsync("duet-
|
|
17139
|
+
const ProgressItem = ({ progress, name }) => (hAsync("span", { class: "duet-upload-item-name" },
|
|
17140
|
+
hAsync("duet-icon", { margin: "none", size: "x-small", name: "messaging-attachment" }),
|
|
17141
|
+
hAsync("duet-spacer", { size: "xx-small", direction: "horizontal" }),
|
|
17142
|
+
name,
|
|
17143
|
+
hAsync("br", null),
|
|
17140
17144
|
hAsync("duet-progress", { progress: Math.ceil(progress), "aria-hidden": true })));
|
|
17141
17145
|
|
|
17142
|
-
const PendingItem = ({ name }) => (hAsync("span",
|
|
17143
|
-
hAsync("duet-
|
|
17144
|
-
hAsync("duet-spacer", { size: "xx-small" })
|
|
17146
|
+
const PendingItem = ({ name }) => (hAsync("span", { class: "duet-upload-item-name" },
|
|
17147
|
+
hAsync("duet-icon", { margin: "none", size: "x-small", name: "messaging-attachment" }),
|
|
17148
|
+
hAsync("duet-spacer", { size: "xx-small", direction: "horizontal" }),
|
|
17149
|
+
name));
|
|
17145
17150
|
|
|
17146
17151
|
const formatBytes = (bytes, decimals = 2) => {
|
|
17147
17152
|
if (bytes === 0) {
|
|
@@ -17210,23 +17215,23 @@ const validateFileSize = (size, maxBytes) => {
|
|
|
17210
17215
|
}
|
|
17211
17216
|
return maxBytes >= size;
|
|
17212
17217
|
};
|
|
17213
|
-
const validateFile = (item, validators) => {
|
|
17218
|
+
const validateFile = (item, validators, errorCodes) => {
|
|
17214
17219
|
const { allowedMimetypes, allowedExtensions, maxBytes } = validators;
|
|
17215
17220
|
let valid = false;
|
|
17216
|
-
let errorMessage = getError("default");
|
|
17221
|
+
let errorMessage = getError("default", errorCodes);
|
|
17217
17222
|
if (item) {
|
|
17218
17223
|
const { name, type, size } = item;
|
|
17219
17224
|
const mime = validateFileMime(type, allowedMimetypes);
|
|
17220
17225
|
const ext = validateFileExtension(name.toLowerCase(), allowedExtensions);
|
|
17221
17226
|
const bytes = validateFileSize(size, maxBytes);
|
|
17222
17227
|
if (!mime) {
|
|
17223
|
-
errorMessage = getError("duet-upload-101");
|
|
17228
|
+
errorMessage = getError("duet-upload-101", errorCodes);
|
|
17224
17229
|
}
|
|
17225
17230
|
if (!ext) {
|
|
17226
|
-
errorMessage = getError("duet-upload-100");
|
|
17231
|
+
errorMessage = getError("duet-upload-100", errorCodes);
|
|
17227
17232
|
}
|
|
17228
17233
|
if (!bytes) {
|
|
17229
|
-
errorMessage = getError("duet-upload-201");
|
|
17234
|
+
errorMessage = getError("duet-upload-201", errorCodes);
|
|
17230
17235
|
}
|
|
17231
17236
|
valid = mime && ext && bytes;
|
|
17232
17237
|
}
|
|
@@ -17270,6 +17275,7 @@ const validateTotalAmountIsAboveMax = (filelist, maxFiles) => {
|
|
|
17270
17275
|
};
|
|
17271
17276
|
|
|
17272
17277
|
const makeXhrRequest = ({ payload, options, onFailure, onSuccess, onProgress }) => {
|
|
17278
|
+
// @ts-ignore
|
|
17273
17279
|
const { type = "POST", xhr, uri, argument = null, headers = null } = options;
|
|
17274
17280
|
xhr.open(type, `${uri}${argument || ""}`, true);
|
|
17275
17281
|
const { data, name } = payload;
|
|
@@ -17297,7 +17303,7 @@ const makeXhrRequest = ({ payload, options, onFailure, onSuccess, onProgress })
|
|
|
17297
17303
|
return xhr;
|
|
17298
17304
|
};
|
|
17299
17305
|
|
|
17300
|
-
const duetUploadCss = "/*!@*,\n*::after,\n*::before*/*.sc-duet-upload,*.sc-duet-upload::after,*.sc-duet-upload::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}/*!@:host*/.sc-duet-upload-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}/*!@::slotted([slot=header])*/.sc-duet-upload-s>[slot=header]{margin-bottom:16px}/*!@::slotted([slot=fileheader])*/.sc-duet-upload-s>[slot=fileheader]{margin:16px 0 0 0}/*!@::slotted([slot=filefooter])*/.sc-duet-upload-s>[slot=filefooter]{margin-top:16px}/*!@.duet-upload*/.duet-upload.sc-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*/.duet-upload-item-size.sc-duet-upload{font-size:0.75rem;font-weight:400}/*!@.duet-upload-filelist*/.duet-upload-filelist.sc-duet-upload{margin-bottom:25px}/*!@.duet-upload-filelist-empty*/.duet-upload-filelist-empty.sc-duet-upload{display:flex;align-items:center;justify-content:center;width:100%;height:75px;margin:0 auto;font-size:1rem;font-weight:400;background-color:#f5f8fa}/*!@.duet-upload-filelist-empty-label*/.duet-upload-filelist-empty-label.sc-duet-upload{font-size:1rem;font-weight:400}/*!@.duet-upload-editable-table-header-hidden*/.duet-upload-editable-table-header-hidden.sc-duet-upload{display:none}/*!@.duet-upload-editable-table tbody .duet-upload-editable-table-data*/.duet-upload-editable-table.sc-duet-upload tbody.sc-duet-upload .duet-upload-editable-table-data.sc-duet-upload{padding:0 !important;border:0}/*!@.duet-upload-editable-table duet-editable-table tfoot,\n.duet-upload-editable-table duet-editable-table thead*/.duet-upload-editable-table.sc-duet-upload duet-editable-table.sc-duet-upload tfoot.sc-duet-upload,.duet-upload-editable-table.sc-duet-upload duet-editable-table.sc-duet-upload thead.sc-duet-upload{display:none}/*!@.duet-upload-editable-table duet-editable-table .duet-editable-table-content*/.duet-upload-editable-table.sc-duet-upload duet-editable-table.sc-duet-upload .duet-editable-table-content.sc-duet-upload{padding-right:0 !important;padding-left:0 !important}/*!@.duet-upload-editable-table duet-editable-table duet-table .duet-table-action-row td*/.duet-upload-editable-table.sc-duet-upload duet-editable-table.sc-duet-upload duet-table.sc-duet-upload .duet-table-action-row.sc-duet-upload td.sc-duet-upload{padding:1rem 0 !important}/*!@.duet-upload-editable-table duet-editable-table duet-table .duet-table-action-row td:last-child*/.duet-upload-editable-table.sc-duet-upload duet-editable-table.sc-duet-upload duet-table.sc-duet-upload .duet-table-action-row.sc-duet-upload td.sc-duet-upload:last-child{padding-right:0 !important}/*!@.duet-upload-editable-table duet-editable-table .duet-editable-table-row-inprogress*/.duet-upload-editable-table.sc-duet-upload duet-editable-table.sc-duet-upload .duet-editable-table-row-inprogress.sc-duet-upload{position:relative}/*!@.duet-upload-editable-table duet-editable-table .duet-editable-table-row-inprogress duet-progress*/.duet-upload-editable-table.sc-duet-upload duet-editable-table.sc-duet-upload .duet-editable-table-row-inprogress.sc-duet-upload duet-progress.sc-duet-upload{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.sc-duet-upload duet-editable-table.sc-duet-upload .duet-editable-table-row-inprogress.sc-duet-upload duet-action-button.sc-duet-upload::part(button){border:0}/*!@.duet-upload-editable-table .duet-upload-item-name duet-icon*/.duet-upload-editable-table.sc-duet-upload .duet-upload-item-name.sc-duet-upload duet-icon.sc-duet-upload{position:relative;top:2px}/*!@duet-paragraph::part(duet-paragraph)*/duet-paragraph.sc-duet-upload::part(duet-paragraph){word-break:break-word}";
|
|
17306
|
+
const duetUploadCss = "/*!@*,\n*::after,\n*::before*/*.sc-duet-upload,*.sc-duet-upload::after,*.sc-duet-upload::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}/*!@:host*/.sc-duet-upload-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}/*!@::slotted([slot=header])*/.sc-duet-upload-s>[slot=header]{margin-bottom:16px}/*!@::slotted([slot=fileheader])*/.sc-duet-upload-s>[slot=fileheader]{margin:16px 0 0 0}/*!@::slotted([slot=filefooter])*/.sc-duet-upload-s>[slot=filefooter]{margin-top:16px}/*!@.duet-upload*/.duet-upload.sc-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*/.duet-upload-item-size.sc-duet-upload{font-size:0.75rem;font-weight:400}/*!@.duet-upload-filelist*/.duet-upload-filelist.sc-duet-upload{margin-bottom:25px}/*!@.duet-upload-filelist-empty*/.duet-upload-filelist-empty.sc-duet-upload{display:flex;align-items:center;justify-content:center;width:100%;height:75px;margin:0 auto;font-size:1rem;font-weight:400;background-color:#f5f8fa}/*!@.duet-upload-filelist-empty-label*/.duet-upload-filelist-empty-label.sc-duet-upload{font-size:1rem;font-weight:400}/*!@.duet-upload-editable-table-header-hidden*/.duet-upload-editable-table-header-hidden.sc-duet-upload{display:none}/*!@.duet-upload-editable-table tbody .duet-upload-editable-table-data*/.duet-upload-editable-table.sc-duet-upload tbody.sc-duet-upload .duet-upload-editable-table-data.sc-duet-upload{padding:0 !important;border:0}/*!@.duet-upload-editable-table duet-editable-table tfoot,\n.duet-upload-editable-table duet-editable-table thead*/.duet-upload-editable-table.sc-duet-upload duet-editable-table.sc-duet-upload tfoot.sc-duet-upload,.duet-upload-editable-table.sc-duet-upload duet-editable-table.sc-duet-upload thead.sc-duet-upload{display:none}/*!@.duet-upload-editable-table duet-editable-table .duet-editable-table-content*/.duet-upload-editable-table.sc-duet-upload duet-editable-table.sc-duet-upload .duet-editable-table-content.sc-duet-upload{padding-right:0 !important;padding-left:0 !important}/*!@.duet-upload-editable-table duet-editable-table duet-table .duet-table-action-row td*/.duet-upload-editable-table.sc-duet-upload duet-editable-table.sc-duet-upload duet-table.sc-duet-upload .duet-table-action-row.sc-duet-upload td.sc-duet-upload{padding:1rem 0 !important}/*!@.duet-upload-editable-table duet-editable-table duet-table .duet-table-action-row td:last-child*/.duet-upload-editable-table.sc-duet-upload duet-editable-table.sc-duet-upload duet-table.sc-duet-upload .duet-table-action-row.sc-duet-upload td.sc-duet-upload: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*/.duet-upload-editable-table.sc-duet-upload duet-editable-table.sc-duet-upload .duet-editable-table-row-inprogress.sc-duet-upload,.duet-upload-editable-table.sc-duet-upload duet-editable-table.sc-duet-upload .duet-editable-table-row-pending.sc-duet-upload{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*/.duet-upload-editable-table.sc-duet-upload duet-editable-table.sc-duet-upload .duet-editable-table-row-inprogress.sc-duet-upload duet-progress.sc-duet-upload,.duet-upload-editable-table.sc-duet-upload duet-editable-table.sc-duet-upload .duet-editable-table-row-pending.sc-duet-upload duet-progress.sc-duet-upload{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)*/.duet-upload-editable-table.sc-duet-upload duet-editable-table.sc-duet-upload .duet-editable-table-row-inprogress.sc-duet-upload duet-action-button.sc-duet-upload::part(button),.duet-upload-editable-table.sc-duet-upload duet-editable-table.sc-duet-upload .duet-editable-table-row-pending.sc-duet-upload duet-action-button.sc-duet-upload::part(button){border:0}/*!@.duet-upload-editable-table .duet-upload-item-name duet-icon*/.duet-upload-editable-table.sc-duet-upload .duet-upload-item-name.sc-duet-upload duet-icon.sc-duet-upload{position:relative;top:2px}/*!@duet-paragraph::part(duet-paragraph)*/duet-paragraph.sc-duet-upload::part(duet-paragraph){word-break:break-word}";
|
|
17301
17307
|
|
|
17302
17308
|
/**
|
|
17303
17309
|
* @slot header - named slot - to place content after description / caption
|
|
@@ -17313,6 +17319,7 @@ class DuetUpload {
|
|
|
17313
17319
|
this.duetChange = createEvent$2(this, "duetChange", 3);
|
|
17314
17320
|
this.duetBlur = createEvent$2(this, "duetBlur", 7);
|
|
17315
17321
|
this.duetFocus = createEvent$2(this, "duetFocus", 7);
|
|
17322
|
+
this.duetReady = createEvent$2(this, "duetReady", 7);
|
|
17316
17323
|
this.duetDone = createEvent$2(this, "duetDone", 3);
|
|
17317
17324
|
this.duetState = createEvent$2(this, "duetState", 3);
|
|
17318
17325
|
this.duetDelete = createEvent$2(this, "duetDelete", 3);
|
|
@@ -17328,6 +17335,10 @@ class DuetUpload {
|
|
|
17328
17335
|
* it will be up to you to handle the upload and return progress information to the upload-component
|
|
17329
17336
|
*/
|
|
17330
17337
|
this.external = false;
|
|
17338
|
+
/**
|
|
17339
|
+
* If internal upload method is used, and this has been set to a function - it will be called with the XHR options before the reqeust is sent, return an updated XHR options object in order to manipulate the request
|
|
17340
|
+
*/
|
|
17341
|
+
this.middleware = null;
|
|
17331
17342
|
/**
|
|
17332
17343
|
* If defer-upload is true, duet-upload will not (as recommended) instantly upload files but await a call to uploadPending()
|
|
17333
17344
|
*/
|
|
@@ -17347,7 +17358,7 @@ class DuetUpload {
|
|
|
17347
17358
|
size: "x-small",
|
|
17348
17359
|
background: "gray-lightest",
|
|
17349
17360
|
name: "delete",
|
|
17350
|
-
map: ["success", "failure"
|
|
17361
|
+
map: ["success", "failure"],
|
|
17351
17362
|
label: {
|
|
17352
17363
|
fi: "Poista tiedosto",
|
|
17353
17364
|
en: "Poista tiedosto",
|
|
@@ -17360,7 +17371,7 @@ class DuetUpload {
|
|
|
17360
17371
|
size: "x-small",
|
|
17361
17372
|
background: "gray-lightest",
|
|
17362
17373
|
name: "cancel",
|
|
17363
|
-
map: ["inprogress"],
|
|
17374
|
+
map: ["inprogress", "pending"],
|
|
17364
17375
|
label: {
|
|
17365
17376
|
fi: "Keskeytä lähetys",
|
|
17366
17377
|
en: "Cancel the upload",
|
|
@@ -17554,6 +17565,10 @@ class DuetUpload {
|
|
|
17554
17565
|
* Display the input in error state along with an error message.
|
|
17555
17566
|
*/
|
|
17556
17567
|
this.error = "";
|
|
17568
|
+
/**
|
|
17569
|
+
* Default errorcodes used by the component, modifiable via javascript
|
|
17570
|
+
*/
|
|
17571
|
+
this.errorCodes = errorCodes;
|
|
17557
17572
|
/**
|
|
17558
17573
|
* Use maxBytes to specify the maximum size in Bytes of a file that can be uploaded.
|
|
17559
17574
|
*/
|
|
@@ -17709,7 +17724,7 @@ class DuetUpload {
|
|
|
17709
17724
|
return hAsync(PendingItem, { name: data.item.name });
|
|
17710
17725
|
}
|
|
17711
17726
|
else if (group === this.DefaultGroups.failure) {
|
|
17712
|
-
return hAsync(ErrorItem, { data: data });
|
|
17727
|
+
return hAsync(ErrorItem, { data: data, errorCodes: this.errorCodes });
|
|
17713
17728
|
}
|
|
17714
17729
|
else if (data.group) {
|
|
17715
17730
|
return data.html;
|
|
@@ -17824,7 +17839,7 @@ class DuetUpload {
|
|
|
17824
17839
|
this.updateValueInMap(name, "valid", false, true);
|
|
17825
17840
|
};
|
|
17826
17841
|
this.transferFailed = name => {
|
|
17827
|
-
this.updateValueInMap(name, "error",
|
|
17842
|
+
this.updateValueInMap(name, "error", getI18nError("duet-upload-001", this.errorCodes));
|
|
17828
17843
|
};
|
|
17829
17844
|
this.transferCanceled = name => {
|
|
17830
17845
|
this.files.delete(name);
|
|
@@ -17835,10 +17850,10 @@ class DuetUpload {
|
|
|
17835
17850
|
const isTotalSizeOverMaxSize = validateTotalSizeIsAboveMax(this.files, this.maxBytesTotal);
|
|
17836
17851
|
const isTotalFileAmountAboveMax = validateTotalAmountIsAboveMax(this.files, this.maxFiles);
|
|
17837
17852
|
if (isTotalSizeOverMaxSize && name) {
|
|
17838
|
-
this.updateValueInMap(name, "error",
|
|
17853
|
+
this.updateValueInMap(name, "error", getI18nError("duet-upload-202", this.errorCodes), false);
|
|
17839
17854
|
}
|
|
17840
17855
|
if (isTotalFileAmountAboveMax && name) {
|
|
17841
|
-
this.updateValueInMap(name, "error",
|
|
17856
|
+
this.updateValueInMap(name, "error", getI18nError("duet-upload-301", this.errorCodes), false);
|
|
17842
17857
|
}
|
|
17843
17858
|
this.bytesMaxReached = isTotalSizeOverMaxSize;
|
|
17844
17859
|
this.fileMaxReached = isTotalFileAmountAboveMax;
|
|
@@ -17919,7 +17934,9 @@ class DuetUpload {
|
|
|
17919
17934
|
this.files.delete(retrievedKey);
|
|
17920
17935
|
if (!this.external) {
|
|
17921
17936
|
const { xhr } = cancelledItem;
|
|
17922
|
-
xhr
|
|
17937
|
+
if (xhr) {
|
|
17938
|
+
xhr.abort();
|
|
17939
|
+
}
|
|
17923
17940
|
}
|
|
17924
17941
|
else {
|
|
17925
17942
|
this.kick();
|
|
@@ -17960,6 +17977,11 @@ class DuetUpload {
|
|
|
17960
17977
|
component: "duet-upload",
|
|
17961
17978
|
});
|
|
17962
17979
|
};
|
|
17980
|
+
this.onReady = () => {
|
|
17981
|
+
this.duetReady.emit({
|
|
17982
|
+
component: "duet-upload",
|
|
17983
|
+
});
|
|
17984
|
+
};
|
|
17963
17985
|
this.onDone = () => {
|
|
17964
17986
|
this.duetDone.emit({
|
|
17965
17987
|
component: "duet-upload",
|
|
@@ -18066,6 +18088,7 @@ class DuetUpload {
|
|
|
18066
18088
|
}
|
|
18067
18089
|
inheritGlobalTheme(this);
|
|
18068
18090
|
this.listenForActionEvents();
|
|
18091
|
+
this.onReady();
|
|
18069
18092
|
}
|
|
18070
18093
|
componentWillRender() {
|
|
18071
18094
|
// listen to the events from the component
|
|
@@ -18135,7 +18158,7 @@ class DuetUpload {
|
|
|
18135
18158
|
"duet-upload-filelist-filled": this.files.size,
|
|
18136
18159
|
}, id: this.labelId, for: identifier }, hAsync("span", { class: {
|
|
18137
18160
|
"duet-upload-filelist-empty-label": !this.files.size,
|
|
18138
|
-
} }, this.fileListEmpty))), !!this.files.size && hAsync("slot", { name: "fileheader" }), !!this.files.size && (hAsync("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.renderEditableTableGroups(), !!this.files.size && hAsync("slot", { name: "filefooter" }), hAsync("duet-spacer", { size: "large" }), !this.hideButton && (hAsync("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)), hAsync("duet-spacer", { size: "medium" }), (this.fileMaxReached || this.bytesMaxReached) && (hAsync("duet-alert", { part: this.identifier ? `${this.identifier}-error-notification` : "duet-upload-error-notification" }, this.fileMaxReached && getI18nError("duet-upload-301"), this.bytesMaxReached && getI18nError("duet-upload-202"))), hAsync("duet-spacer", { size: "medium" }), hAsync("duet-visually-hidden", null, hAsync("input", { ref: input => {
|
|
18161
|
+
} }, this.fileListEmpty))), !!this.files.size && hAsync("slot", { name: "fileheader" }), !!this.files.size && (hAsync("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.renderEditableTableGroups(), !!this.files.size && hAsync("slot", { name: "filefooter" }), hAsync("duet-spacer", { size: "large" }), !this.hideButton && (hAsync("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)), hAsync("duet-spacer", { size: "medium" }), (this.fileMaxReached || this.bytesMaxReached) && (hAsync("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))), hAsync("duet-spacer", { size: "medium" }), hAsync("duet-visually-hidden", null, hAsync("input", { ref: input => {
|
|
18139
18162
|
this.nativeInput = input;
|
|
18140
18163
|
}, accept: !this.limitSelection ? undefined : `${this.allowedMimetypes},${this.allowedExtensions}`, onBlur: this.onBlur, onFocus: this.onFocus, onChange: e => this.onChange(e), type: "file", class: {
|
|
18141
18164
|
"duet-upload": true,
|
|
@@ -18159,34 +18182,43 @@ class DuetUpload {
|
|
|
18159
18182
|
xhr.upload.addEventListener("abort", () => {
|
|
18160
18183
|
this.transferCanceled(name);
|
|
18161
18184
|
});
|
|
18162
|
-
|
|
18185
|
+
let options = {
|
|
18163
18186
|
payload: { data, name },
|
|
18164
|
-
options: { type: "POST", uri: this.uri, xhr, argument: null, headers:
|
|
18187
|
+
options: { type: "POST", uri: this.uri, xhr, argument: null, headers: undefined },
|
|
18165
18188
|
onFailure: this.transferDoneWithFailure,
|
|
18166
18189
|
onSuccess: this.transferDone,
|
|
18167
18190
|
onProgress: this.trackProgress,
|
|
18168
|
-
}
|
|
18191
|
+
};
|
|
18192
|
+
if (this.middleware) {
|
|
18193
|
+
options = this.middleware(options);
|
|
18194
|
+
}
|
|
18195
|
+
return makeXhrRequest(options);
|
|
18169
18196
|
}
|
|
18170
18197
|
makeXHRDeleteRequest(data) {
|
|
18171
18198
|
const { uid, item } = data;
|
|
18172
18199
|
const xhr = new XMLHttpRequest();
|
|
18173
|
-
|
|
18174
|
-
|
|
18200
|
+
const headers = {
|
|
18201
|
+
"x-fileuid": uid,
|
|
18202
|
+
"x-filename": item.name,
|
|
18203
|
+
};
|
|
18204
|
+
let options = {
|
|
18175
18205
|
payload: { data: null, name },
|
|
18176
18206
|
options: {
|
|
18177
18207
|
type: "DELETE",
|
|
18178
18208
|
xhr,
|
|
18179
18209
|
uri: this.uri,
|
|
18180
|
-
|
|
18181
|
-
headers
|
|
18182
|
-
"x-fileuid": uid,
|
|
18183
|
-
"x-filename": item.name,
|
|
18184
|
-
},
|
|
18210
|
+
argument: `?key=${uid}&name=${item.name}`,
|
|
18211
|
+
headers,
|
|
18185
18212
|
},
|
|
18186
18213
|
onFailure: this.transferDoneWithFailure,
|
|
18187
18214
|
onSuccess: this.transferDone,
|
|
18188
18215
|
onProgress: this.trackProgress,
|
|
18189
|
-
}
|
|
18216
|
+
};
|
|
18217
|
+
if (this.middleware) {
|
|
18218
|
+
options = this.middleware(options);
|
|
18219
|
+
}
|
|
18220
|
+
// don't present server issues to user on deletes, just remove them from the visible list
|
|
18221
|
+
return makeXhrRequest(options);
|
|
18190
18222
|
}
|
|
18191
18223
|
/**
|
|
18192
18224
|
* Component event handling.
|
|
@@ -18203,7 +18235,7 @@ class DuetUpload {
|
|
|
18203
18235
|
maxBytes: this.maxBytes,
|
|
18204
18236
|
allowedExtensions: this.allowedExtensions,
|
|
18205
18237
|
allowedMimetypes: this.allowedMimetypes,
|
|
18206
|
-
});
|
|
18238
|
+
}, this.errorCodes);
|
|
18207
18239
|
const uid = this.genHashName();
|
|
18208
18240
|
const fileListItem = {
|
|
18209
18241
|
uid,
|
|
@@ -18271,6 +18303,7 @@ class DuetUpload {
|
|
|
18271
18303
|
"accessibleControls": [1, "accessible-controls"],
|
|
18272
18304
|
"accessibleOwns": [1, "accessible-owns"],
|
|
18273
18305
|
"external": [4],
|
|
18306
|
+
"middleware": [16],
|
|
18274
18307
|
"deferUpload": [4, "defer-upload"],
|
|
18275
18308
|
"hideButton": [4, "hide-upload-button"],
|
|
18276
18309
|
"actions": [16],
|
|
@@ -18298,6 +18331,7 @@ class DuetUpload {
|
|
|
18298
18331
|
"fileListEmptyDefaults": [1, "list-empty-default"],
|
|
18299
18332
|
"fileListEmpty": [1, "file-list-empty"],
|
|
18300
18333
|
"error": [1],
|
|
18334
|
+
"errorCodes": [16],
|
|
18301
18335
|
"name": [1],
|
|
18302
18336
|
"maxBytes": [2, "max-bytes"],
|
|
18303
18337
|
"maxBytesTotal": [2, "max-bytes-total"],
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
|
-
const index = require('./index-
|
|
8
|
+
const index = require('./index-d74701f0.js');
|
|
9
9
|
const themeableComponent = require('./themeable-component-fdeaef9f.js');
|
|
10
10
|
const createId = require('./create-id-c3b984b1.js');
|
|
11
11
|
const jsUtils = require('./js-utils-be1d29ae.js');
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
|
-
const index = require('./index-
|
|
8
|
+
const index = require('./index-d74701f0.js');
|
|
9
9
|
const themeableComponent = require('./themeable-component-fdeaef9f.js');
|
|
10
10
|
const languageUtils = require('./language-utils-4f62a7db.js');
|
|
11
11
|
require('./string-utils-5cadd058.js');
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
|
-
const index = require('./index-
|
|
8
|
+
const index = require('./index-d74701f0.js');
|
|
9
9
|
const themeableComponent = require('./themeable-component-fdeaef9f.js');
|
|
10
10
|
|
|
11
11
|
const duetBadgeCss = "*,*::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;margin-right:4px !important;margin-bottom:2px !important;display:inline-block;width:auto;vertical-align:middle}:host:last-child,:host:last-of-type{margin-right:0 !important}:host(.duet-m-0){margin:0 !important}.duet-badge{width:100%;padding:4.4444444444px 12px 5.4444444444px;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:0.75rem;font-style:normal;font-weight:600;line-height:1.25;color:#00294d;text-align:center;word-break:break-word;vertical-align:middle;background:#e6f1f7;border-radius:20rem}.duet-badge.duet-p-0{padding:0 !important}.duet-badge.duet-m-0{margin:0 !important}.duet-badge.duet-theme-turva{padding:5.4444444444px 12px 4.4444444444px;font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-weight:700;color:#171c3a;background:#e8e8eb}.duet-badge.warning{background:#fef3df}.duet-badge.warning.duet-theme-turva{background:#fef1db}.duet-badge.danger{background:#fce9ef}.duet-badge.danger.duet-theme-turva{background:#fceae7}.duet-badge.success{background:#e6f3ef}.duet-badge.success.duet-theme-turva{background:#e6f3ed}";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
|
-
const index = require('./index-
|
|
8
|
+
const index = require('./index-d74701f0.js');
|
|
9
9
|
const themeableComponent = require('./themeable-component-fdeaef9f.js');
|
|
10
10
|
|
|
11
11
|
const duetBreadcrumbCss = "*,*::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;display:block;width:100%}.duet-breadcrumb{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;height:100%;font-size:0.875rem;color:#00294d;text-decoration:none}.duet-breadcrumb:hover{color:#004d80}.duet-breadcrumb.duet-theme-turva{color:#171c3a}.duet-breadcrumb.duet-theme-turva:hover{color:#940925}.duet-breadcrumb:focus{outline:0}.duet-breadcrumb:active{opacity:0.75}:host(.user-is-tabbing) .duet-breadcrumb:focus{box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}:host(.user-is-tabbing) .duet-breadcrumb.duet-theme-turva:focus{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
|
-
const index = require('./index-
|
|
8
|
+
const index = require('./index-d74701f0.js');
|
|
9
9
|
const themeableComponent = require('./themeable-component-fdeaef9f.js');
|
|
10
10
|
const languageUtils = require('./language-utils-4f62a7db.js');
|
|
11
11
|
require('./string-utils-5cadd058.js');
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
|
-
const index = require('./index-
|
|
8
|
+
const index = require('./index-d74701f0.js');
|
|
9
9
|
const themeableComponent = require('./themeable-component-fdeaef9f.js');
|
|
10
10
|
const commonStrings = require('./common-strings-de17f887.js');
|
|
11
11
|
const languageUtils = require('./language-utils-4f62a7db.js');
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
|
-
const index = require('./index-
|
|
8
|
+
const index = require('./index-d74701f0.js');
|
|
9
9
|
const themeableComponent = require('./themeable-component-fdeaef9f.js');
|
|
10
10
|
const stringUtils = require('./string-utils-5cadd058.js');
|
|
11
11
|
const tokenUtils = require('./token-utils-50a1f7e2.js');
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
|
-
const index = require('./index-
|
|
8
|
+
const index = require('./index-d74701f0.js');
|
|
9
9
|
const themeableComponent = require('./themeable-component-fdeaef9f.js');
|
|
10
10
|
const createId = require('./create-id-c3b984b1.js');
|
|
11
11
|
const keyboardUtils = require('./keyboard-utils-bb32119b.js');
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
|
-
const index = require('./index-
|
|
8
|
+
const index = require('./index-d74701f0.js');
|
|
9
9
|
const themeableComponent = require('./themeable-component-fdeaef9f.js');
|
|
10
10
|
const createId = require('./create-id-c3b984b1.js');
|
|
11
11
|
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
|
-
const index = require('./index-
|
|
8
|
+
const index = require('./index-d74701f0.js');
|
|
9
9
|
const themeableComponent = require('./themeable-component-fdeaef9f.js');
|
|
10
10
|
const commonStrings = require('./common-strings-de17f887.js');
|
|
11
11
|
const createId = require('./create-id-c3b984b1.js');
|
|
12
|
-
const focusUtils = require('./focus-utils-
|
|
12
|
+
const focusUtils = require('./focus-utils-54bf88c4.js');
|
|
13
13
|
const keyboardUtils = require('./keyboard-utils-bb32119b.js');
|
|
14
14
|
const languageUtils = require('./language-utils-4f62a7db.js');
|
|
15
15
|
const watchOptions = require('./watch-options-d88afac0.js');
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
|
-
const index = require('./index-
|
|
8
|
+
const index = require('./index-d74701f0.js');
|
|
9
9
|
const actionArrowDownSmall = require('./action-arrow-down-small-ef77a2d1.js');
|
|
10
10
|
const tokens = require('./tokens-29450bcb.js');
|
|
11
11
|
const themeableComponent = require('./themeable-component-fdeaef9f.js');
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
|
-
const index = require('./index-
|
|
8
|
+
const index = require('./index-d74701f0.js');
|
|
9
9
|
const themeableComponent = require('./themeable-component-fdeaef9f.js');
|
|
10
10
|
const jsUtils = require('./js-utils-be1d29ae.js');
|
|
11
11
|
const keyboardUtils = require('./keyboard-utils-bb32119b.js');
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
|
-
const index = require('./index-
|
|
8
|
+
const index = require('./index-d74701f0.js');
|
|
9
9
|
const themeableComponent = require('./themeable-component-fdeaef9f.js');
|
|
10
10
|
|
|
11
11
|
const duetCookieConsentCss = "*,*::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;position:fixed;right:0;bottom:0;left:0;z-index:950;display:block;width:100%;box-shadow:0 2px 20px 0 rgba(0, 0, 0, 0.2)}@media (min-width: 48em){:host{right:28px;bottom:28px;left:auto;width:25rem}}:host(:focus){outline:0}:host(.user-is-tabbing:focus){border-radius:4px;box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}:host(.user-is-tabbing.duet-theme-turva:focus){box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}.duet-cookie-consent{padding:20px;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:0.875rem;color:white !important;background-color:rgba(0, 21, 39, 0.9)}@supports (-webkit-backdrop-filter: none) or (backdrop-filter: none){.duet-cookie-consent{background:rgba(0, 21, 39, 0.8);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}}.duet-cookie-consent.duet-theme-turva{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";background-color:rgba(12, 14, 29, 0.9)}@supports (-webkit-backdrop-filter: none) or (backdrop-filter: none){.duet-cookie-consent.duet-theme-turva{background:rgba(12, 14, 29, 0.8)}}@media (min-width: 48em){.duet-cookie-consent{padding:20px;border-radius:4px}}.duet-cookie-consent-content{display:flex;align-items:center;max-width:1110px;margin:0 auto}.duet-cookie-consent-content .expand{flex:1}::slotted(a){font-weight:600;color:white !important;text-decoration:underline;white-space:nowrap}::slotted(a[target=_blank]){padding-right:16px;background:url(\"data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjZmZmIiB2aWV3Qm94PSIwIDAgMjQgMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEwLjUgMmExLjUgMS41IDAgMDEuMTQgM0gzLjc1Yy0uMzggMC0uNy4yOC0uNzQuNjVsLS4wMS4xdjE0LjVjMCAuMzguMjguNy42NS43NGwuMS4wMWgxNC41Yy4zOCAwIC43LS4yOC43NC0uNjVsLjAxLS4xdi02Ljg5YTEuNSAxLjUgMCAwMTMgMHY2Ljg5QTMuNzUgMy43NSAwIDAxMTguMjUgMjRIMy43NUEzLjc1IDMuNzUgMCAwMTAgMjAuMjVWNS43NUEzLjc1IDMuNzUgMCAwMTMuNzUgMnptMTItMmMuNzggMCAxLjQyLjYgMS41IDEuMzZWNy41YTEuNSAxLjUgMCAwMS0zIC4xNFY1LjEybC01LjQ0IDUuNDRhMS41IDEuNSAwIDAxLTIuMjItMmwuMS0uMTJMMTguODggM0gxNi41QTEuNSAxLjUgMCAwMTE1IDEuNjRWMS41YzAtLjc4LjYtMS40MiAxLjM2LTEuNWguMTR6Ii8+PC9zdmc+\") no-repeat right 50%;background-size:12px 10px}::slotted(a:focus){outline:0;box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}.duet-theme-turva ::slotted(a:focus){outline:0;box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}";
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
|
-
const index = require('./index-
|
|
8
|
+
const index = require('./index-d74701f0.js');
|
|
9
9
|
const themeableComponent = require('./themeable-component-fdeaef9f.js');
|
|
10
10
|
const createId = require('./create-id-c3b984b1.js');
|
|
11
|
-
const focusUtils = require('./focus-utils-
|
|
11
|
+
const focusUtils = require('./focus-utils-54bf88c4.js');
|
|
12
12
|
const languageUtils = require('./language-utils-4f62a7db.js');
|
|
13
13
|
require('./string-utils-5cadd058.js');
|
|
14
14
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
|
-
const index = require('./index-
|
|
8
|
+
const index = require('./index-d74701f0.js');
|
|
9
9
|
const themeableComponent = require('./themeable-component-fdeaef9f.js');
|
|
10
10
|
|
|
11
11
|
const duetDividerCss = "*,*::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;display:block;width:100%}.duet-divider{-webkit-user-select:none;user-select:none;display:block;width:100%;height:1px;margin-top:36px !important;margin-bottom:28px;background:#e1e3e6}.duet-divider.duet-p-0{padding:0 !important}.duet-divider.duet-m-0{margin:0 !important}.duet-divider.duet-m-s{margin-bottom:16px !important;margin-top:0 !important}.duet-divider.duet-theme-turva{background:#e4e4e6}";
|