@oiz/stzh-components 2.9.0-beta → 2.9.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/dist/cjs/{app-globals-51c074d3.js → app-globals-ac2e4efd.js} +2 -2
- package/dist/cjs/{app-globals-51c074d3.js.map → app-globals-ac2e4efd.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/stzh-components.cjs.js +1 -1
- package/dist/cjs/stzh-pagebottom.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-upload.cjs.entry.js +63 -35
- package/dist/cjs/stzh-upload.cjs.entry.js.map +1 -1
- package/dist/collection/assets/i18n/de.json +2 -1
- package/dist/collection/assets/i18n/en.json +2 -1
- package/dist/collection/components/stzh-cspace/stzh-cspace.stories.js +1 -1
- package/dist/collection/components/stzh-page-skiplinks/stzh-page-skiplinks.stories.js +1 -1
- package/dist/collection/components/stzh-pagebottom/stzh-pagebottom.js.map +1 -1
- package/dist/collection/components/stzh-pagebottom/stzh-pagebottom.stories.js +1 -1
- package/dist/collection/components/stzh-ratio/stzh-ratio.stories.js +1 -1
- package/dist/collection/components/stzh-upload/stzh-upload.css +7 -2
- package/dist/collection/components/stzh-upload/stzh-upload.js +63 -35
- package/dist/collection/components/stzh-upload/stzh-upload.js.map +1 -1
- package/dist/collection/components/stzh-upload/stzh-upload.localization.js.map +1 -1
- package/dist/collection/utils/story-utils.js +2 -1
- package/dist/collection/utils/story-utils.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/stzh-pagebottom.js.map +1 -1
- package/dist/components/stzh-upload.js +63 -35
- package/dist/components/stzh-upload.js.map +1 -1
- package/dist/custom-elements.json +6362 -0
- package/dist/esm/{app-globals-b350c01d.js → app-globals-6921f653.js} +2 -2
- package/dist/esm/{app-globals-b350c01d.js.map → app-globals-6921f653.js.map} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/stzh-components.js +1 -1
- package/dist/esm/stzh-pagebottom.entry.js.map +1 -1
- package/dist/esm/stzh-upload.entry.js +63 -35
- package/dist/esm/stzh-upload.entry.js.map +1 -1
- package/dist/esm-es5/{app-globals-b350c01d.js → app-globals-6921f653.js} +2 -2
- package/dist/esm-es5/{app-globals-b350c01d.js.map → app-globals-6921f653.js.map} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/stzh-components.js +1 -1
- package/dist/esm-es5/stzh-pagebottom.entry.js.map +1 -1
- package/dist/esm-es5/stzh-upload.entry.js +1 -1
- package/dist/esm-es5/stzh-upload.entry.js.map +1 -1
- package/dist/stzh-components/assets/i18n/de.json +2 -1
- package/dist/stzh-components/assets/i18n/en.json +2 -1
- package/dist/stzh-components/p-2e77c845.system.entry.js.map +1 -1
- package/dist/stzh-components/p-ae6a75cc.entry.js.map +1 -1
- package/dist/stzh-components/{p-ace81cde.js → p-b7be3f1d.js} +2 -2
- package/dist/stzh-components/{p-ace81cde.js.map → p-b7be3f1d.js.map} +1 -1
- package/dist/stzh-components/{p-5a34a1d8.entry.js → p-c98cfc88.entry.js} +2 -2
- package/dist/stzh-components/p-c98cfc88.entry.js.map +1 -0
- package/dist/stzh-components/{p-3692ab41.system.entry.js → p-ccc38fcc.system.entry.js} +2 -2
- package/dist/stzh-components/p-ccc38fcc.system.entry.js.map +1 -0
- package/dist/stzh-components/{p-0e061116.system.js → p-d47ab627.system.js} +2 -2
- package/dist/stzh-components/{p-0e061116.system.js.map → p-d47ab627.system.js.map} +1 -1
- package/dist/stzh-components/{p-35ec50a1.system.js → p-e72565dc.system.js} +2 -2
- package/dist/stzh-components/stzh-components.esm.js +1 -1
- package/dist/stzh-components/stzh-components.js +1 -1
- package/dist/types/components/stzh-upload/stzh-upload.localization.d.ts +2 -1
- package/package.json +4 -3
- package/dist/stzh-components/p-3692ab41.system.entry.js.map +0 -1
- package/dist/stzh-components/p-5a34a1d8.entry.js.map +0 -1
- /package/dist/stzh-components/{p-35ec50a1.system.js.map → p-e72565dc.system.js.map} +0 -0
|
@@ -96,11 +96,12 @@
|
|
|
96
96
|
"upload": {
|
|
97
97
|
"description": "Um Dateien zu uploaden, ziehen Sie die Dateien in diesen Bereich.",
|
|
98
98
|
"button": "Dateien auswählen",
|
|
99
|
-
"download": "Download",
|
|
100
99
|
"cancelUpload": "Upload abbrechen",
|
|
101
100
|
"uploadCanceled": "Upload abgebrochen.",
|
|
102
101
|
"cancelUploadConfirmation": "Sind Sie sicher, dass Sie den Upload abbrechen wollen?",
|
|
103
102
|
"removeFile": "Datei entfernen",
|
|
103
|
+
"deleteFile": "Hochgeladene Datei löschen",
|
|
104
|
+
"downloadFile": "Datei downloaden",
|
|
104
105
|
"maxFilesExceeded": "Sie können keine weiteren Dateien uploaden.",
|
|
105
106
|
"serverError": "Server derzeit nicht verfügbar, bitte versuchen Sie es später erneut.",
|
|
106
107
|
"accessError": "Sie haben keine Berechtigung zum Hochladen von Dateien.",
|
|
@@ -96,11 +96,12 @@
|
|
|
96
96
|
"upload": {
|
|
97
97
|
"description": "To upload files drag & drop them in this area.",
|
|
98
98
|
"button": "Choose files",
|
|
99
|
-
"download": "Download",
|
|
100
99
|
"cancelUpload": "Cancel upload",
|
|
101
100
|
"uploadCanceled": "Upload canceled.",
|
|
102
101
|
"cancelUploadConfirmation": "Are you sure you want to cancel this upload?",
|
|
103
102
|
"removeFile": "Remove file",
|
|
103
|
+
"deleteFile": "Delete uploaded file",
|
|
104
|
+
"downloadFile": "Download file",
|
|
104
105
|
"maxFilesExceeded": "You can not upload any more files.",
|
|
105
106
|
"serverError": "Server currently not available, please try again later.",
|
|
106
107
|
"accessError": "You have no authorization for uploading files.",
|
|
@@ -2,7 +2,7 @@ import { createComponentStory } from '../../utils/story-utils';
|
|
|
2
2
|
import { withActions } from '@storybook/addon-actions/decorator';
|
|
3
3
|
import readme from './readme.md?raw';
|
|
4
4
|
|
|
5
|
-
const COMPONENT_NAME = 'stzh-
|
|
5
|
+
const COMPONENT_NAME = 'stzh-cspace';
|
|
6
6
|
const story = createComponentStory(COMPONENT_NAME);
|
|
7
7
|
|
|
8
8
|
const TEMPLATE = `
|
|
@@ -4,7 +4,7 @@ import readme from './readme.md?raw';
|
|
|
4
4
|
import { withDesign } from 'storybook-addon-designs';
|
|
5
5
|
import { getFigmaLink } from '../../../figma';
|
|
6
6
|
|
|
7
|
-
const COMPONENT_NAME = 'stzh-
|
|
7
|
+
const COMPONENT_NAME = 'stzh-page-skiplinks';
|
|
8
8
|
const story = createComponentStory(COMPONENT_NAME);
|
|
9
9
|
|
|
10
10
|
const TEMPLATE = `
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stzh-pagebottom.js","sourceRoot":"","sources":["../../../src/components/stzh-pagebottom/stzh-pagebottom.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,CAAC,EACD,OAAO,EACP,IAAI,GACL,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C;;GAEG;AAMH,MAAM,OAAO,cAAc;;sBAEI,EAAE;;;yBAYE,KAAK;oBAGX,8BAA8B;;sBAU3B,KAAK;;EAInC,MAAM;IACJ,MAAM,QAAQ,GAAY,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAExD,MAAM,OAAO,GAAG;MACd,iBAAiB,EAAE,IAAI;MACvB,6BAA6B,EAAE,IAAI,CAAC,UAAU;KAC/C,CAAC;IAEF,OAAO,CACL,EAAC,IAAI;MACH,WAAK,KAAK,EAAE,OAAO;QAChB,CAAC,IAAI,CAAC,aAAa;UAClB,WAAK,KAAK,EAAC,gCAAgC;YACxC,IAAI,CAAC,UAAU;cACd,WAAK,KAAK,EAAC,8BAA8B,IAAE,IAAI,CAAC,UAAU,CAAO;YAEnE,kBAAY,GAAG,EAAE,IAAI,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC,aAAa,GAAe,CACvE;QAGP,QAAQ;UACP,WAAK,KAAK,EAAC,uBAAuB;YAChC,SACE,IAAI,EAAE,IAAI,CAAC,QAAQ,EACnB,KAAK,EAAC,4BAA4B,iBACrB,IAAI,CAAC,eAAe,IAAI,aAAa;cAElD,YAAM,IAAI,EAAC,MAAM,GAAQ,CACvB,CACA,CAEJ,CACD,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Host,\n h,\n Element,\n Prop,\n} from \"@stencil/core\";\n\nimport { ShareService } from \"../../index\";\nimport { hasSlot } from \"../../utils/utils\";\n\n/**\n * @slot logo - Slot for a logo image\n */\n@Component({\n tag: \"stzh-pagebottom\",\n styleUrl: \"stzh-pagebottom.scss\",\n scoped: true\n})\nexport class StzhPagebottom {\n /** Share Title */\n @Prop() shareTitle: string = \"\";\n\n /** URL of current site (uses full URL by default) */\n @Prop() shareUrl: string;\n\n /**\n * Array of enabled share buttons.\n * Possible services: `facebook` / `twitter` / `linkedin` / `xing` / `mail`\n */\n
|
|
1
|
+
{"version":3,"file":"stzh-pagebottom.js","sourceRoot":"","sources":["../../../src/components/stzh-pagebottom/stzh-pagebottom.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,CAAC,EACD,OAAO,EACP,IAAI,GACL,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C;;GAEG;AAMH,MAAM,OAAO,cAAc;;sBAEI,EAAE;;;yBAYE,KAAK;oBAGX,8BAA8B;;sBAU3B,KAAK;;EAInC,MAAM;IACJ,MAAM,QAAQ,GAAY,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAExD,MAAM,OAAO,GAAG;MACd,iBAAiB,EAAE,IAAI;MACvB,6BAA6B,EAAE,IAAI,CAAC,UAAU;KAC/C,CAAC;IAEF,OAAO,CACL,EAAC,IAAI;MACH,WAAK,KAAK,EAAE,OAAO;QAChB,CAAC,IAAI,CAAC,aAAa;UAClB,WAAK,KAAK,EAAC,gCAAgC;YACxC,IAAI,CAAC,UAAU;cACd,WAAK,KAAK,EAAC,8BAA8B,IAAE,IAAI,CAAC,UAAU,CAAO;YAEnE,kBAAY,GAAG,EAAE,IAAI,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC,aAAa,GAAe,CACvE;QAGP,QAAQ;UACP,WAAK,KAAK,EAAC,uBAAuB;YAChC,SACE,IAAI,EAAE,IAAI,CAAC,QAAQ,EACnB,KAAK,EAAC,4BAA4B,iBACrB,IAAI,CAAC,eAAe,IAAI,aAAa;cAElD,YAAM,IAAI,EAAC,MAAM,GAAQ,CACvB,CACA,CAEJ,CACD,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Host,\n h,\n Element,\n Prop,\n} from \"@stencil/core\";\n\nimport { ShareService } from \"../../index\";\nimport { hasSlot } from \"../../utils/utils\";\n\n/**\n * @slot logo - Slot for a logo image\n */\n@Component({\n tag: \"stzh-pagebottom\",\n styleUrl: \"stzh-pagebottom.scss\",\n scoped: true\n})\nexport class StzhPagebottom {\n /** Share Title */\n @Prop() shareTitle: string = \"\";\n\n /** URL of current site (uses full URL by default) */\n @Prop() shareUrl: string;\n\n /**\n * Array of enabled share buttons.\n * Possible services: `facebook` / `twitter` / `linkedin` / `xing` / `mail`\n */\n @Prop() shareServices: ShareService[] | string;\n\n /** Whether to show share */\n @Prop() shareDisabled: boolean = false;\n\n /** Logo href */\n @Prop() logoHref: string = \"https://www.stadt-zuerich.ch\";\n\n /**\n * For Adobe Analytics.\n * Will be rendered as value of `s-object-id` attribute to the logo link element.\n * Default value will be \"Footer Logo\"\n */\n @Prop() logoAnalyticsId: string;\n\n /** Whether to display border */\n @Prop() withBorder: boolean = false;\n\n @Element() element: HTMLStzhPagebottomElement;\n\n render() {\n const logoUsed: boolean = hasSlot(this.element, \"logo\");\n\n const classes = {\n \"stzh-pagebottom\": true,\n \"stzh-pagebottom--has-border\": this.withBorder\n };\n\n return (\n <Host>\n <div class={classes}>\n {!this.shareDisabled &&\n <div class=\"stzh-pagebottom__share-wrapper\">\n {this.shareTitle &&\n <div class=\"stzh-pagebottom__share-title\">{this.shareTitle}</div>\n }\n <stzh-share url={this.shareUrl} services={this.shareServices}></stzh-share>\n </div>\n }\n\n {logoUsed &&\n <div class=\"stzh-pagebottom__logo\">\n <a\n href={this.logoHref}\n class=\"stzh-pagebottom__logo-link\"\n s-object-id={this.logoAnalyticsId || \"Footer Logo\"}\n >\n <slot name=\"logo\"></slot>\n </a>\n </div>\n }\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -4,7 +4,7 @@ import readme from './readme.md?raw';
|
|
|
4
4
|
import { withDesign } from 'storybook-addon-designs';
|
|
5
5
|
import { getFigmaLink } from '../../../figma';
|
|
6
6
|
|
|
7
|
-
const COMPONENT_NAME = 'stzh-
|
|
7
|
+
const COMPONENT_NAME = 'stzh-ratio';
|
|
8
8
|
const story = createComponentStory(COMPONENT_NAME);
|
|
9
9
|
|
|
10
10
|
const TEMPLATE = `
|
|
@@ -311,7 +311,7 @@ stzh-upload .stzh-fylingfocus-focused::-moz-focus-inner {
|
|
|
311
311
|
.stzh-upload__preview:not(.dz-error):last-child, .stzh-upload__errors:last-child .stzh-upload__preview:last-child {
|
|
312
312
|
border-bottom: 0.0625rem solid var(--stzh-base-border-color);
|
|
313
313
|
}
|
|
314
|
-
.stzh-upload__errors .stzh-upload__preview:first-child, .stzh-upload__errors:empty + .stzh-upload__preview {
|
|
314
|
+
.stzh-upload__errors .stzh-upload__preview:first-child, .stzh-upload__errors:empty + .stzh-upload__previews > .stzh-upload__preview {
|
|
315
315
|
border-top-left-radius: var(--stzh-button-border-radius);
|
|
316
316
|
border-top-right-radius: var(--stzh-button-border-radius);
|
|
317
317
|
}
|
|
@@ -319,7 +319,7 @@ stzh-upload .stzh-fylingfocus-focused::-moz-focus-inner {
|
|
|
319
319
|
border-bottom-left-radius: var(--stzh-button-border-radius);
|
|
320
320
|
border-bottom-right-radius: var(--stzh-button-border-radius);
|
|
321
321
|
}
|
|
322
|
-
.stzh-upload:has(> .stzh-upload__preview) .stzh-upload__errors .stzh-upload__preview:last-child {
|
|
322
|
+
.stzh-upload:has(.stzh-upload__previews > .stzh-upload__preview) .stzh-upload__errors .stzh-upload__preview:last-child {
|
|
323
323
|
border-bottom-left-radius: 0;
|
|
324
324
|
border-bottom-right-radius: 0;
|
|
325
325
|
}
|
|
@@ -355,6 +355,11 @@ stzh-upload .stzh-fylingfocus-focused::-moz-focus-inner {
|
|
|
355
355
|
display: flex;
|
|
356
356
|
overflow: hidden;
|
|
357
357
|
}
|
|
358
|
+
.stzh-upload__info-wrapper {
|
|
359
|
+
flex-grow: 1;
|
|
360
|
+
display: flex;
|
|
361
|
+
overflow: hidden;
|
|
362
|
+
}
|
|
358
363
|
.stzh-upload__info-wrapper-processing, .stzh-upload__info-wrapper-complete {
|
|
359
364
|
flex-grow: 1;
|
|
360
365
|
display: flex;
|
|
@@ -8,8 +8,12 @@ const ATTR_TYPE = "data-dz-type";
|
|
|
8
8
|
const ATTR_SIZE = "data-dz-size";
|
|
9
9
|
const ATTR_LINK = "data-dz-link";
|
|
10
10
|
const ATTR_EXTENSION = "data-dz-extension";
|
|
11
|
+
const ATTR_META_ID = "data-dz-meta-id";
|
|
12
|
+
const ATTR_ERROR_MESSAGE_ID = "data-dz-error-message-id";
|
|
11
13
|
const ATTR_PROGRESS_TEXT = "data-dz-progress-text";
|
|
14
|
+
const ATTR_REMOVE = "data-dz-remove";
|
|
12
15
|
let uploadCounter = 0;
|
|
16
|
+
let previewCounter = 0;
|
|
13
17
|
// Most properties taken over from:
|
|
14
18
|
// https://github.com/dropzone/dropzone/blob/v5.9.3/src/options.js
|
|
15
19
|
// Possible events to listen to:
|
|
@@ -38,6 +42,9 @@ export class StzhUpload {
|
|
|
38
42
|
}
|
|
39
43
|
return `<strong>${selectedSize}</strong> ${this.options.dictFileSizeUnits[selectedUnit]}`;
|
|
40
44
|
};
|
|
45
|
+
this.filePreviewId = function (file) {
|
|
46
|
+
return `${this.uploadId}-${file._id}`;
|
|
47
|
+
};
|
|
41
48
|
this.existingFiles = [];
|
|
42
49
|
this.label = "";
|
|
43
50
|
this.description = "";
|
|
@@ -149,11 +156,15 @@ export class StzhUpload {
|
|
|
149
156
|
node.setAttribute("href", fileHref);
|
|
150
157
|
node.setAttribute("download", file.name);
|
|
151
158
|
const isStzh = isStzhElement(node);
|
|
152
|
-
|
|
159
|
+
const fileId = self.filePreviewId(file);
|
|
160
|
+
node.setAttribute(isStzh ? "analytics-id" : "s-object-id", `${self.localization.downloadFile} ${file.name}`);
|
|
161
|
+
node.setAttribute(isStzh ? "a11y-label" : "aria-label", `${self.localization.downloadFile} ${file.name}`);
|
|
162
|
+
node.setAttribute(isStzh ? "a11y-describedby" : "aria-describedby", `${fileId}-error-message ${fileId}-meta`);
|
|
153
163
|
}
|
|
154
164
|
}
|
|
155
165
|
}
|
|
156
166
|
this.dropzone = new window.Dropzone(this.dropzoneElement, {
|
|
167
|
+
previewsContainer: this.previewsElement,
|
|
157
168
|
url: this.url,
|
|
158
169
|
method: this.method,
|
|
159
170
|
withCredentials: this.withCredentials,
|
|
@@ -181,6 +192,7 @@ export class StzhUpload {
|
|
|
181
192
|
dictRemoveFileConfirmation: null,
|
|
182
193
|
dictMaxFilesExceeded: this.localization.maxFilesExceeded,
|
|
183
194
|
dictRemoveFile: this.localization.removeFile,
|
|
195
|
+
dictDeleteFile: this.localization.deleteFile,
|
|
184
196
|
dictCancelUploadConfirmation: this.localization.cancelUploadConfirmation,
|
|
185
197
|
dictUploadCanceled: this.localization.uploadCanceled,
|
|
186
198
|
dictCancelUpload: this.localization.cancelUpload,
|
|
@@ -191,6 +203,7 @@ export class StzhUpload {
|
|
|
191
203
|
// Receives `file`
|
|
192
204
|
// Taken from https://github.com/dropzone/dropzone/blob/v5.9.3/src/options.js#L594
|
|
193
205
|
addedfile(file) {
|
|
206
|
+
file._id = previewCounter++;
|
|
194
207
|
if (this.element === this.previewsContainer) {
|
|
195
208
|
this.element.classList.add("dz-started");
|
|
196
209
|
}
|
|
@@ -207,8 +220,14 @@ export class StzhUpload {
|
|
|
207
220
|
for (node of file.previewElement.querySelectorAll(`[${ATTR_SIZE}]`)) {
|
|
208
221
|
node.innerHTML = self.filesize.call(this, file.size);
|
|
209
222
|
}
|
|
223
|
+
for (node of file.previewElement.querySelectorAll(`[${ATTR_META_ID}]`)) {
|
|
224
|
+
node.setAttribute("id", `${self.filePreviewId(file)}-meta`);
|
|
225
|
+
}
|
|
226
|
+
for (node of file.previewElement.querySelectorAll(`[${ATTR_ERROR_MESSAGE_ID}]`)) {
|
|
227
|
+
node.setAttribute("id", `${self.filePreviewId(file)}-error-message`);
|
|
228
|
+
}
|
|
210
229
|
if (this.options.addRemoveLinks) {
|
|
211
|
-
file._removeLink = window.Dropzone.createElement(`<a class="dz-remove" href="javascript:undefined;"
|
|
230
|
+
file._removeLink = window.Dropzone.createElement(`<a class="dz-remove" href="javascript:undefined;" ${ATTR_REMOVE}>
|
|
212
231
|
${this.options.dictRemoveFile}
|
|
213
232
|
</a>`);
|
|
214
233
|
file.previewElement.appendChild(file._removeLink);
|
|
@@ -228,10 +247,13 @@ export class StzhUpload {
|
|
|
228
247
|
}
|
|
229
248
|
}
|
|
230
249
|
};
|
|
231
|
-
for (let removeLink of file.previewElement.querySelectorAll(
|
|
250
|
+
for (let removeLink of file.previewElement.querySelectorAll(`[${ATTR_REMOVE}]`)) {
|
|
232
251
|
removeLink.addEventListener("click", removeFileEvent);
|
|
233
252
|
const isStzh = isStzhElement(removeLink);
|
|
234
|
-
|
|
253
|
+
const fileId = self.filePreviewId(file);
|
|
254
|
+
removeLink.setAttribute(isStzh ? "analytics-id" : "s-object-id", `${this.options.dictRemoveFile}`);
|
|
255
|
+
removeLink.setAttribute(isStzh ? "a11y-label" : "aria-label", `${this.options.dictRemoveFile} ${file.name}`);
|
|
256
|
+
removeLink.setAttribute(isStzh ? "a11y-describedby" : "aria-describedby", `${fileId}-error-message ${fileId}-meta`);
|
|
235
257
|
}
|
|
236
258
|
if (!self.downloadDisabled && !self.downloadDisabledWhileProcessing) {
|
|
237
259
|
enableDownload(file);
|
|
@@ -241,9 +263,13 @@ export class StzhUpload {
|
|
|
241
263
|
// When the upload is finished, either with success or an error.
|
|
242
264
|
// Taken from https://github.com/dropzone/dropzone/blob/v5.9.3/src/options.js#L752
|
|
243
265
|
complete(file) {
|
|
244
|
-
for (let node of file.previewElement.querySelectorAll(
|
|
245
|
-
|
|
246
|
-
|
|
266
|
+
for (let node of file.previewElement.querySelectorAll(`[${ATTR_REMOVE}]`)) {
|
|
267
|
+
const hasErrorState = (file.status === "error");
|
|
268
|
+
const removeOrDeleteLabel = hasErrorState ? this.options.dictRemoveFile : this.options.dictDeleteFile;
|
|
269
|
+
const isStzh = isStzhElement(node);
|
|
270
|
+
const fileId = self.filePreviewId(file);
|
|
271
|
+
node.setAttribute(isStzh ? "a11y-label" : "aria-label", `${removeOrDeleteLabel} ${file.name}`);
|
|
272
|
+
node.setAttribute(isStzh ? "a11y-describedby" : "aria-describedby", `${fileId}-error-message ${fileId}-meta`);
|
|
247
273
|
}
|
|
248
274
|
// move file uploads with errors to another element, so they are grouped together
|
|
249
275
|
if (file.status === "error") {
|
|
@@ -306,38 +332,40 @@ export class StzhUpload {
|
|
|
306
332
|
</div>
|
|
307
333
|
|
|
308
334
|
<div class="stzh-upload__details">
|
|
309
|
-
<div class="stzh-upload__info-wrapper
|
|
310
|
-
<div class="stzh-
|
|
311
|
-
<div class="stzh-
|
|
312
|
-
<
|
|
335
|
+
<div class="stzh-upload__info-wrapper">
|
|
336
|
+
<div class="stzh-upload__info-wrapper-processing">
|
|
337
|
+
<div class="stzh-upload__infos">
|
|
338
|
+
<div class="stzh-upload__subtitle">
|
|
339
|
+
<a class="stzh-upload__link" ${ATTR_NAME} ${ATTR_LINK}></a>
|
|
340
|
+
</div>
|
|
341
|
+
<div class="stzh-upload__progress-text">
|
|
342
|
+
<span ${ATTR_PROGRESS_TEXT}></span>
|
|
343
|
+
</div>
|
|
313
344
|
</div>
|
|
314
|
-
<div class="stzh-
|
|
315
|
-
<span ${
|
|
345
|
+
<div class="stzh-upload__meta">
|
|
346
|
+
<span class="stzh-upload__extension" ${ATTR_EXTENSION}></span>
|
|
347
|
+
<span class="stzh-upload__size" ${ATTR_SIZE}></span>
|
|
348
|
+
</div>
|
|
349
|
+
<div class="stzh-upload__progress">
|
|
350
|
+
<span class="stzh-upload__progress-bar" data-dz-uploadprogress></span>
|
|
316
351
|
</div>
|
|
317
352
|
</div>
|
|
318
|
-
<div class="stzh-
|
|
319
|
-
<
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
</div>
|
|
330
|
-
<div class="stzh-upload__meta">
|
|
331
|
-
<span class="stzh-upload__extension" ${ATTR_EXTENSION}></span>
|
|
332
|
-
<span class="stzh-upload__size" ${ATTR_SIZE}></span>
|
|
333
|
-
</div>
|
|
334
|
-
<div class="stzh-upload__error-message">
|
|
335
|
-
<span data-dz-errormessage></span>
|
|
353
|
+
<div class="stzh-upload__info-wrapper-complete">
|
|
354
|
+
<div class="stzh-upload__title">
|
|
355
|
+
<a class="stzh-upload__link" ${ATTR_NAME} ${ATTR_LINK}></a>
|
|
356
|
+
</div>
|
|
357
|
+
<div class="stzh-upload__meta" ${ATTR_META_ID}>
|
|
358
|
+
<span class="stzh-upload__extension" ${ATTR_EXTENSION}></span>
|
|
359
|
+
<span class="stzh-upload__size" ${ATTR_SIZE}></span>
|
|
360
|
+
</div>
|
|
361
|
+
<div class="stzh-upload__error-message" ${ATTR_ERROR_MESSAGE_ID}>
|
|
362
|
+
<span data-dz-errormessage></span>
|
|
363
|
+
</div>
|
|
336
364
|
</div>
|
|
337
365
|
</div>
|
|
338
366
|
<div class="stzh-upload__actions">
|
|
339
|
-
<stzh-button variant="tertiary" size="tiny" icon-only icon="download" class="stzh-upload__download" ${ATTR_LINK}
|
|
340
|
-
<stzh-button variant="tertiary" size="tiny" icon-only class="stzh-upload__delete"
|
|
367
|
+
<stzh-button variant="tertiary" size="tiny" icon-only icon="download" class="stzh-upload__download" ${ATTR_LINK}></stzh-button>
|
|
368
|
+
<stzh-button variant="tertiary" size="tiny" icon-only class="stzh-upload__delete" ${ATTR_REMOVE}>
|
|
341
369
|
<stzh-icon slot="icon" class="stzh-upload__delete-icon" name="delete"></stzh-icon>
|
|
342
370
|
<stzh-icon slot="icon" class="stzh-upload__delete-icon-error" name="close"></stzh-icon>
|
|
343
371
|
</stzh-button>
|
|
@@ -438,7 +466,7 @@ export class StzhUpload {
|
|
|
438
466
|
"stzh-upload--has-error": errorUsed,
|
|
439
467
|
"stzh-upload--has-instructions": !!this.description || !!this.localization.description
|
|
440
468
|
};
|
|
441
|
-
return (h(Host, null, h("div", { class: classes, ref: (el) => (this.dropzoneElement = el) }, h("div", { ref: (el) => (this.hiddenInputContainerElement = el) }), h("div", { id: `${this.uploadId}-label` }, this.label && h("div", { class: "stzh-upload__label" }, this.label)), h("div", { class: "stzh-upload__clickarea", ref: (el) => (this.clickareaElement = el) }, h("div", { class: "stzh-upload__instructions", id: `${this.uploadId}-instruction` }, this.description ? this.description : this.localization.description), h("stzh-button", { size: "small", class: "stzh-upload__button", ref: (el) => (this.buttonElement = el), a11yDescribedby: `${this.uploadId}-label ${this.uploadId}-instruction ${this.uploadId}-description`, disabled: this.disabled }, this.button ? this.button : this.localization.button)), h(StzhInputDescription, { classPrefix: "stzh-upload", id: `${this.uploadId}-description`, error: this._error }), h("div", { class: "stzh-upload__errors", ref: (el) => (this.errorsElement = el) }))));
|
|
469
|
+
return (h(Host, null, h("div", { class: classes, ref: (el) => (this.dropzoneElement = el) }, h("div", { ref: (el) => (this.hiddenInputContainerElement = el) }), h("div", { id: `${this.uploadId}-label` }, this.label && h("div", { class: "stzh-upload__label" }, this.label)), h("div", { class: "stzh-upload__clickarea", ref: (el) => (this.clickareaElement = el) }, h("div", { class: "stzh-upload__instructions", id: `${this.uploadId}-instruction` }, this.description ? this.description : this.localization.description), h("stzh-button", { size: "small", class: "stzh-upload__button", ref: (el) => (this.buttonElement = el), a11yDescribedby: `${this.uploadId}-label ${this.uploadId}-instruction ${this.uploadId}-description`, disabled: this.disabled, a11yControls: `${this.uploadId}-previews` }, this.button ? this.button : this.localization.button)), h(StzhInputDescription, { classPrefix: "stzh-upload", id: `${this.uploadId}-description`, error: this._error }), h("div", { id: `${this.uploadId}-previews` }, h("div", { class: "stzh-upload__errors", ref: (el) => (this.errorsElement = el) }), h("div", { class: "stzh-upload__previews dropzone-previews", ref: (el) => (this.previewsElement = el) })))));
|
|
442
470
|
}
|
|
443
471
|
static get is() { return "stzh-upload"; }
|
|
444
472
|
static get originalStyleUrls() {
|
|
@@ -1051,7 +1079,7 @@ export class StzhUpload {
|
|
|
1051
1079
|
"mutable": false,
|
|
1052
1080
|
"complexType": {
|
|
1053
1081
|
"original": "StzhUploadLocalizedText",
|
|
1054
|
-
"resolved": "StzhLocaleComponent & { description: string; button: string;
|
|
1082
|
+
"resolved": "StzhLocaleComponent & { description: string; button: string; cancelUpload: string; uploadCanceled: string; cancelUploadConfirmation: string; removeFile: string; deleteFile: string; downloadFile: string; maxFilesExceeded: string; serverError: string; accessError: string; responseError: string; invalidFileType: string; fileTooBig: string; fileTooBigServer: string; }",
|
|
1055
1083
|
"references": {
|
|
1056
1084
|
"StzhUploadLocalizedText": {
|
|
1057
1085
|
"location": "import",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stzh-upload.js","sourceRoot":"","sources":["../../../src/components/stzh-upload/stzh-upload.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,CAAC,EACD,OAAO,EACP,IAAI,EACJ,MAAM,EACN,KAAK,EACL,KAAK,EAEN,MAAM,eAAe,CAAC;AAyBvB,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAE5E,OAAO,mCAAmC,CAAC;AAC3C,MAAM,CAAC,QAAQ,CAAC,YAAY,GAAG,KAAK,CAAC;AAErC,MAAM,SAAS,GAAG,cAAc,CAAC;AACjC,MAAM,SAAS,GAAG,cAAc,CAAC;AACjC,MAAM,SAAS,GAAG,cAAc,CAAC;AACjC,MAAM,SAAS,GAAG,cAAc,CAAC;AACjC,MAAM,cAAc,GAAG,mBAAmB,CAAC;AAC3C,MAAM,kBAAkB,GAAG,uBAAuB,CAAC;AAEnD,IAAI,aAAa,GAAG,CAAC,CAAC;AAEtB,mCAAmC;AACnC,kEAAkE;AAElE,gCAAgC;AAChC,uEAAuE;AAEvE;;GAEG;AAKH,MAAM,OAAO,UAAU;;IAOb,mBAAc,GAA0B,EAAE,CAAC;IAmU3C,aAAQ,GAAG,UAAS,IAAI;MAC9B,IAAI,YAAY,GAAG,CAAC,CAAC;MACrB,IAAI,YAAY,GAAG,GAAG,CAAC;MAEvB,IAAI,IAAI,GAAG,CAAC,EAAE;QACZ,IAAI,KAAK,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;QAE1C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Host,\n h,\n Element,\n Prop,\n Method,\n Watch,\n Event,\n EventEmitter\n} from \"@stencil/core\";\n\nimport {\n StzhUploadFilesItem,\n StzhUploadFile,\n StzhUploadFileAddedEvent,\n StzhUploadFilesAddedEvent,\n StzhUploadFileRemoveEvent,\n StzhUploadFileRemovedEvent,\n StzhUploadSendingEvent,\n StzhUploadSendingMultipleEvent,\n StzhUploadProcessingEvent,\n StzhUploadProcessingMultipleEvent,\n StzhUploadProgressEvent,\n StzhUploadProgressTotalEvent,\n StzhUploadErrorEvent,\n StzhUploadErrorMultipleEvent,\n StzhUploadSuccessEvent,\n StzhUploadSuccessMultipleEvent,\n StzhUploadCanceledEvent,\n StzhUploadCanceledMultipleEvent,\n StzhUploadCompleteEvent,\n StzhUploadCompleteMultipleEvent\n} from \"../../index\";\n\nimport { hasSlot, isStzhElement } from \"../../utils/utils\";\nimport { StzhUploadLocalizedText } from './stzh-upload.localization';\nimport { StzhInputDescription } from \"../stzh-input/stzh-input-description\";\n\nimport \"../../libraries/dropzone/dropzone\";\nwindow.Dropzone.autoDiscover = false;\n\nconst ATTR_NAME = \"data-dz-name\";\nconst ATTR_TYPE = \"data-dz-type\";\nconst ATTR_SIZE = \"data-dz-size\";\nconst ATTR_LINK = \"data-dz-link\";\nconst ATTR_EXTENSION = \"data-dz-extension\";\nconst ATTR_PROGRESS_TEXT = \"data-dz-progress-text\";\n\nlet uploadCounter = 0;\n\n// Most properties taken over from:\n// https://github.com/dropzone/dropzone/blob/v5.9.3/src/options.js\n\n// Possible events to listen to:\n// https://github.com/dropzone/dropzone/blob/v5.9.3/src/dropzone.js#L17\n\n/**\n * @slot error - Slot for error\n */\n@Component({\n tag: \"stzh-upload\",\n styleUrl: \"stzh-upload.scss\"\n})\nexport class StzhUpload {\n /**\n * Initially pre existing files (e.g. already uploaded by the user).\n * Array of objects that must at least include `name` and `size` attribute:\n * `[{\"name\":\"file1.txt\", \"size\": 12345}, {\"name\":\"file2.txt\", \"size\": 12345}]`\n */\n @Prop() existingFiles: StzhUploadFilesItem[] | string = [];\n private _existingFiles: StzhUploadFilesItem[] = [];\n\n /** Label */\n @Prop() label: string = \"\";\n\n /** Description */\n @Prop() description: string = \"\";\n\n /** Button text */\n @Prop() button: string = \"\";\n\n /**\n * URL the files are processed to.\n *\n * You can also provide a function that will be called with `files` and\n * `dataBlocks` and must return the url as string.\n */\n @Prop() url: string | Function = \"\";\n\n /**\n * Can be changed to `\"put\"` if necessary. You can also provide a function\n * that will be called with `files` and must return the method.\n */\n @Prop() method: \"post\" | \"put\" | Function = \"post\";\n\n /**\n * Will be set on the XHRequest.\n */\n @Prop() withCredentials: boolean = false;\n\n /**\n * Whether the upload is disabled or not.\n */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /**\n * Whether the upload is marked as invalid.\n */\n @Prop({ reflect: true }) invalid: boolean = false;\n\n /** Whether download functionality should be disabled. */\n @Prop() downloadDisabled: boolean = false;\n\n /** Whether download functionality should only be shown to completed files. */\n @Prop() downloadDisabledWhileProcessing: boolean = false;\n\n /** One or multiple error message (use error slot as alternative) */\n @Prop() error: string | string[];\n private _error: string[];\n\n /**\n * The default implementation of `accept` checks the file's mime type or\n * extension against this list. This is a comma separated list of mime\n * types or file extensions.\n *\n * Eg.: `image/*,application/pdf,.psd`\n *\n * This option will also be used as\n * [`accept`](https://developer.mozilla.org/en-US/docs/HTML/Element/input#attr-accept)\n * parameter on the hidden file input as well.\n */\n @Prop() acceptedFiles: string | null = null;\n\n /**\n * If false, files will be added to the queue but the queue will not be\n * processed automatically.\n * This can be useful if you need some additional user input before sending\n * files (or if you want want all files sent at once).\n * If you're ready to send the file simply call `element.processQueue()`.\n */\n @Prop() autoProcessQueue: boolean = true;\n\n /**\n * Hide progress (bars and text).\n */\n @Prop() hideProgress: boolean = false;\n\n /**\n * Hide progress (bars) only while idle (will show them as soon as upload starts).\n * Can be used together with `autoProcessQueue`, e.g. if files are uploaded at form submit to prevent showing empty progressbar.\n */\n @Prop() hideProgressWhileIdle: boolean = false;\n\n /**\n * If not `null` defines how many files this dropzone handles. If it exceeds,\n * the event `stzhMaxfilesexceeded` will be called.\n */\n @Prop() maxFiles: number | null = null;\n\n /**\n * The maximum filesize (in MiB) that is allowed to be uploaded.\n */\n @Prop() maxFilesize: number = 25;\n\n /**\n * How many file uploads to process in parallel.\n */\n @Prop() parallelUploads: number = 2;\n\n /**\n * Whether to send multiple files in one request. If\n * this it set to true, then the fallback file input element will\n * have the `multiple` attribute as well. This option will\n * also trigger additional events (like `stzhSuccessMultiple`). See the events\n * documentation section for more information.\n */\n @Prop() uploadMultiple: boolean = false;\n\n /**\n * Whether you want files to be uploaded in chunks to your server. This can't be\n * used in combination with `uploadMultiple`.\n *\n * See `chunksUploaded` prop for the callback to finalise an upload.\n */\n @Prop() chunking: boolean = false;\n\n /**\n * If `chunking` is enabled, this defines whether **every** file should be chunked,\n * even if the file size is below chunkSize. This means, that the additional chunk\n * form data will be submitted and the `chunksUploaded` callback will be invoked.\n */\n @Prop() forceChunking: boolean = false;\n\n /**\n * If `chunking` is `true`, then this defines the chunk size in bytes.\n */\n @Prop() chunkSize: number = 2 * 1024 * 1024;\n\n /**\n * If `true`, the individual chunks of a file are being uploaded simultaneously.\n */\n @Prop() parallelChunkUploads: boolean = false;\n\n /**\n * Whether a chunk should be retried if it fails.\n */\n @Prop() retryChunks: boolean = false;\n\n /**\n * If `retryChunks` is true, how many times should it be retried.\n */\n @Prop() retryChunksLimit: number = 3;\n\n /**\n * The base that is used to calculate the **displayed** filesize. You can\n * change this to 1024 if you would rather display kibibytes, mebibytes,\n * etc... 1024 is technically incorrect, because `1024 bytes` are `1 kibibyte`\n * not `1 kilobyte`. You can change this to `1024` if you don't care about\n * validity.\n */\n @Prop() filesizeBase: number = 1024;\n\n /**\n * An optional object to send additional headers to the server. Eg:\n * `{ \"My-Awesome-Header\": \"header value\" }`\n */\n @Prop() headers: object | null = null;\n\n /**\n * Should the default headers be set or not?\n * Accept: application/json <- for requesting json response\n * Cache-Control: no-cache <- Request shouldnt be cached\n * X-Requested-With: XMLHttpRequest <- We sent the request via XMLHttpRequest\n */\n @Prop() defaultHeaders: boolean = true;\n\n /**\n * A function that gets a [file](https://developer.mozilla.org/en-US/docs/DOM/File)\n * and a `done` function as parameters.\n *\n * If the done function is invoked without arguments, the file is \"accepted\" and will\n * be processed. If you pass an error message, the file is rejected, and the error\n * message will be displayed.\n * This function will not be called if the file is too big or doesn't match the mime types.\n */\n @Prop() accept: Function = function(_file, done) {\n return done();\n };\n\n /**\n * The callback that will be invoked when all chunks have been uploaded for a file.\n * It gets the file for which the chunks have been uploaded as the first parameter,\n * and the `done` function as second. `done()` needs to be invoked when everything\n * needed to finish the upload process is done.\n */\n @Prop() chunksUploaded: Function = function(_file, done) {\n done();\n };\n\n /**\n * This is the element the hidden input field (which is used when clicking on the\n * dropzone to trigger file selection) will be appended to. This might\n * be important in case you use frameworks to switch the content of your page.\n *\n * Can be a selector string, or an element directly. Will be rendered into element by default.\n */\n @Prop() hiddenInputContainer: string | HTMLElement;\n\n /** Translation strings. */\n @Prop() localization: StzhUploadLocalizedText;\n\n @Element() element: HTMLStzhUploadElement;\n\n @Watch(\"existingFiles\")\n existingFilesWatcher(newValue: StzhUploadFilesItem[] | string) {\n if (typeof newValue === \"string\") {\n this._existingFiles = JSON.parse(newValue);\n } else {\n this._existingFiles = newValue;\n }\n }\n\n @Watch(\"disabled\")\n disabledWatcher() {\n if (!this.dropzone) {\n return;\n }\n\n if (this.disabled) {\n this.dropzone.disable();\n } else {\n this.dropzone.enable();\n }\n }\n\n @Watch(\"error\")\n errorWatcher(newValue: string | string[]) {\n if (typeof newValue === \"string\") {\n try {\n this._error = JSON.parse(newValue);\n } catch (e) {\n if (newValue) {\n this._error = [newValue];\n } else {\n this._error = [];\n }\n }\n } else if (newValue) {\n this._error = newValue;\n } else {\n this._error = [];\n }\n\n this.invalid = this._error.length > 0;\n }\n\n /** File added */\n @Event() stzhFileAdded: EventEmitter<StzhUploadFileAddedEvent>;\n\n /** Files added (multiple) */\n @Event() stzhFilesAdded: EventEmitter<StzhUploadFilesAddedEvent>;\n\n /** File remove (before, cancelable) */\n @Event() stzhFileRemove: EventEmitter<StzhUploadFileRemoveEvent>;\n\n /** File removed */\n @Event() stzhFileRemoved: EventEmitter<StzhUploadFileRemovedEvent>;\n\n /** Before sending file (add additional data before request if necessary) */\n @Event() stzhSending: EventEmitter<StzhUploadSendingEvent>;\n\n /** Before sending multiple files (add additional data before request if necessary) */\n @Event() stzhSendingMultiple: EventEmitter<StzhUploadSendingMultipleEvent>;\n\n /** Files starting to get processed */\n @Event() stzhProcessing: EventEmitter<StzhUploadProcessingEvent>;\n\n /** Files starting to get processed (multiple) */\n @Event() stzhProcessingMultiple: EventEmitter<StzhUploadProcessingMultipleEvent>;\n\n /** Upload file progress during upload */\n @Event() stzhProgress: EventEmitter<StzhUploadProgressEvent>;\n\n /** Upload total file progress during upload */\n @Event() stzhProgressTotal: EventEmitter<StzhUploadProgressTotalEvent>;\n\n /** File error */\n @Event() stzhError: EventEmitter<StzhUploadErrorEvent>;\n\n /** Files error (multiple files) */\n @Event() stzhErrorMultiple: EventEmitter<StzhUploadErrorMultipleEvent>;\n\n /** File successfully uploaded */\n @Event() stzhSuccess: EventEmitter<StzhUploadSuccessEvent>;\n\n /** Files successfully uploaded (multiple files) */\n @Event() stzhSuccessMultiple: EventEmitter<StzhUploadSuccessMultipleEvent>;\n\n /** Canceled file upload */\n @Event() stzhCanceled: EventEmitter<StzhUploadCanceledEvent>;\n\n /** Canceled file upload (multiple files) */\n @Event() stzhCanceledMultiple: EventEmitter<StzhUploadCanceledMultipleEvent>;\n\n /** Completed upload (successfully or with error) */\n @Event() stzhComplete: EventEmitter<StzhUploadCompleteEvent>;\n\n /** Completed upload (successfully or with error, multiple files) */\n @Event() stzhCompleteMultiple: EventEmitter<StzhUploadCompleteMultipleEvent>;\n\n @Method()\n async processQueue() {\n return this.dropzone.processQueue();\n }\n\n @Method()\n async removeFile(file, force = false) {\n return this.dropzone.removeFile(file, force);\n }\n\n @Method()\n async removeAllFiles(onlyCancelCurrentlyUploadingFiles = false, force = false) {\n return this.dropzone.removeAllFiles(onlyCancelCurrentlyUploadingFiles, force);\n }\n\n private dropzone: any;\n private dropzoneElement: HTMLElement;\n private buttonElement: HTMLStzhButtonElement;\n private clickareaElement: HTMLElement;\n private errorsElement: HTMLElement;\n private hiddenInputContainerElement: HTMLElement;\n private uploadId: string;\n\n private filesize = function(size) {\n let selectedSize = 0;\n let selectedUnit = \"b\";\n\n if (size > 0) {\n let units = [\"tb\", \"gb\", \"mb\", \"kb\", \"b\"];\n\n for (let i = 0; i < units.length; i++) {\n let unit = units[i];\n let cutoff = Math.pow(this.options.filesizeBase, 4 - i) / 10;\n\n if (size >= cutoff) {\n selectedSize = size / Math.pow(this.options.filesizeBase, 4 - i);\n selectedUnit = unit;\n break;\n }\n }\n\n selectedSize = Math.round(selectedSize * 100) / 100; // Cutting of digits\n }\n\n return `<strong>${selectedSize}</strong> ${this.options.dictFileSizeUnits[selectedUnit]}`;\n }\n\n async componentWillLoad() {\n this.uploadId = `stzh-upload-${uploadCounter++}`;\n\n this.existingFilesWatcher(this.existingFiles);\n this.errorWatcher(this.error);\n\n if (!this.localization) {\n this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, 'upload');\n }\n }\n\n componentDidRender() {\n if (this.dropzone) {\n return;\n }\n\n const self = this;\n\n function enableDownload(file) {\n let fileHref = file.url || '';\n\n if (file.upload) {\n fileHref = URL.createObjectURL(file);\n }\n\n if (fileHref) {\n for (var node of file.previewElement.querySelectorAll(`[${ATTR_LINK}]`)) {\n node.setAttribute(\"href\", fileHref);\n node.setAttribute(\"download\", file.name);\n\n const isStzh = isStzhElement(node);\n node.setAttribute(isStzh ? \"analytics-id\" : \"s-object-id\", `${self.localization.download} ${file.name}`);\n }\n }\n }\n\n this.dropzone = new window.Dropzone(this.dropzoneElement, {\n url: this.url,\n method: this.method,\n withCredentials: this.withCredentials,\n clickable: [this.clickareaElement],\n acceptedFiles: this.acceptedFiles,\n accept: this.accept,\n maxFiles: this.maxFiles,\n maxFilesize: this.maxFilesize,\n filesizeBase: this.filesizeBase,\n parallelUploads: this.parallelUploads,\n uploadMultiple: this.uploadMultiple,\n autoProcessQueue: this.autoProcessQueue,\n headers: this.headers,\n defaultHeaders: this.defaultHeaders,\n chunking: this.chunking,\n chunkSize: this.chunkSize,\n chunksUploaded: this.chunksUploaded,\n forceChunking: this.forceChunking,\n parallelChunkUploads: this.parallelChunkUploads,\n retryChunks: this.retryChunks,\n retryChunksLimit: this.retryChunksLimit,\n createImageThumbnails: false,\n hiddenInputContainer: this.hiddenInputContainer ? this.hiddenInputContainer : this.hiddenInputContainerElement,\n dictFileSizeUnits: { tb: \"TiB\", gb: \"GiB\", mb: \"MiB\", kb: \"KiB\", b: \"b\" },\n dictRemoveFileConfirmation: null,\n dictMaxFilesExceeded: this.localization.maxFilesExceeded,\n dictRemoveFile: this.localization.removeFile,\n dictCancelUploadConfirmation: this.localization.cancelUploadConfirmation,\n dictUploadCanceled: this.localization.uploadCanceled,\n dictCancelUpload: this.localization.cancelUpload,\n dictResponseError: this.localization.responseError,\n dictInvalidFileType: this.localization.invalidFileType,\n dictFileTooBig: this.localization.fileTooBig,\n // Called when a file is added to the queue\n // Receives `file`\n // Taken from https://github.com/dropzone/dropzone/blob/v5.9.3/src/options.js#L594\n addedfile(file) {\n if (this.element === this.previewsContainer) {\n this.element.classList.add(\"dz-started\");\n }\n\n if (this.previewsContainer && !this.options.disablePreviews) {\n file.previewElement = window.Dropzone.createElement(\n this.options.previewTemplate.trim()\n );\n file.previewTemplate = file.previewElement; // Backwards compatibility\n\n this.previewsContainer.appendChild(file.previewElement);\n\n if (!file.size) {\n file.previewElement.classList.add(\"dz-empty\");\n }\n\n for (var node of file.previewElement.querySelectorAll(`[${ATTR_NAME}]`)) {\n node.textContent = file.name;\n }\n\n for (node of file.previewElement.querySelectorAll(`[${ATTR_SIZE}]`)) {\n node.innerHTML = self.filesize.call(this, file.size);\n }\n\n if (this.options.addRemoveLinks) {\n file._removeLink = window.Dropzone.createElement(\n `<a class=\"dz-remove\" href=\"javascript:undefined;\" data-dz-remove>\n ${this.options.dictRemoveFile}\n </a>`\n );\n file.previewElement.appendChild(file._removeLink);\n }\n\n let removeFileEvent = (e) => {\n e.preventDefault();\n e.stopPropagation();\n if (file.status === window.Dropzone.UPLOADING) {\n return window.Dropzone.confirm(\n this.options.dictCancelUploadConfirmation,\n () => this.removeFile(file)\n );\n } else {\n if (this.options.dictRemoveFileConfirmation) {\n return window.Dropzone.confirm(\n this.options.dictRemoveFileConfirmation,\n () => this.removeFile(file)\n );\n } else {\n return this.removeFile(file);\n }\n }\n };\n\n for (let removeLink of file.previewElement.querySelectorAll(\n \"[data-dz-remove]\"\n )) {\n removeLink.addEventListener(\"click\", removeFileEvent);\n\n const isStzh = isStzhElement(removeLink);\n removeLink.setAttribute(isStzh ? \"analytics-id\" : \"s-object-id\", `${this.options.dictRemoveFile} ${file.name}`);\n }\n\n if (!self.downloadDisabled && !self.downloadDisabledWhileProcessing) {\n enableDownload(file);\n }\n }\n },\n // When the upload is finished, either with success or an error.\n // Taken from https://github.com/dropzone/dropzone/blob/v5.9.3/src/options.js#L752\n complete(file) {\n for (let node of file.previewElement.querySelectorAll(\"[data-dz-remove]\")) {\n node.setAttribute(\"title\", this.options.dictRemoveFile);\n node.setAttribute(\"aria-label\", this.options.dictRemoveFile);\n }\n\n // move file uploads with errors to another element, so they are grouped together\n if (file.status === \"error\") {\n self.errorsElement.appendChild(file.previewElement);\n } else if (!self.downloadDisabled && self.downloadDisabledWhileProcessing) {\n enableDownload(file);\n }\n\n if (file._removeLink) {\n file._removeLink.innerHTML = this.options.dictRemoveFile;\n }\n\n if (file.previewElement) {\n return file.previewElement.classList.add(\"dz-complete\");\n }\n },\n // Called whenever a file is removed.\n // Taken fom https://github.com/dropzone/dropzone/blob/v5.9.3/src/options.js#L649\n removedfile(file) {\n if (file.previewElement != null && file.previewElement.parentNode != null) {\n file.previewElement.parentNode.removeChild(file.previewElement);\n }\n\n // set focus to upload\n self.buttonElement.setFocus();\n\n return this._updateMaxFilesReachedClass();\n },\n error(file, message, xhr) {\n if (file.previewElement) {\n file.previewElement.classList.add(\"dz-error\");\n\n if (typeof message !== \"string\" && message.error) {\n message = message.error;\n } else if (xhr) {\n if (xhr.status === 401 || xhr.status === 403) {\n message = self.localization.accessError;\n } else if (xhr.status === 413) {\n message = self.localization.fileTooBigServer;\n } else if (xhr.status === 415) {\n message = self.localization.invalidFileType;\n } else if (xhr.status >= 500) {\n message = self.localization.serverError;\n } else {\n const defaultError = self.localization.responseError\n .replace(\"{{statusCode}}\", xhr.status);\n\n message = defaultError;\n }\n }\n\n for (let node of file.previewElement.querySelectorAll(\"[data-dz-errormessage]\")) {\n node.textContent = message;\n }\n }\n },\n previewTemplate: `\n <div class=\"stzh-upload__preview\">\n <div class=\"stzh-upload__image\">\n <img data-dz-thumbnail />\n </div>\n\n <div class=\"stzh-upload__details\">\n <div class=\"stzh-upload__info-wrapper-processing\">\n <div class=\"stzh-upload__infos\">\n <div class=\"stzh-upload__subtitle\">\n <a class=\"stzh-upload__link\" ${ATTR_NAME} ${ATTR_LINK}></a>\n </div>\n <div class=\"stzh-upload__progress-text\">\n <span ${ATTR_PROGRESS_TEXT}></span>\n </div>\n </div>\n <div class=\"stzh-upload__meta\">\n <span class=\"stzh-upload__extension\" ${ATTR_EXTENSION}></span>\n <span class=\"stzh-upload__size\" ${ATTR_SIZE}></span>\n </div>\n <div class=\"stzh-upload__progress\">\n <span class=\"stzh-upload__progress-bar\" data-dz-uploadprogress></span>\n </div>\n </div>\n <div class=\"stzh-upload__info-wrapper-complete\">\n <div class=\"stzh-upload__title\">\n <a class=\"stzh-upload__link\" ${ATTR_NAME} ${ATTR_LINK}></a>\n </div>\n <div class=\"stzh-upload__meta\">\n <span class=\"stzh-upload__extension\" ${ATTR_EXTENSION}></span>\n <span class=\"stzh-upload__size\" ${ATTR_SIZE}></span>\n </div>\n <div class=\"stzh-upload__error-message\">\n <span data-dz-errormessage></span>\n </div>\n </div>\n <div class=\"stzh-upload__actions\">\n <stzh-button variant=\"tertiary\" size=\"tiny\" icon-only icon=\"download\" class=\"stzh-upload__download\" ${ATTR_LINK} aria-label=\"${this.localization.download}\" title=\"${this.localization.download}\"></stzh-button>\n <stzh-button variant=\"tertiary\" size=\"tiny\" icon-only class=\"stzh-upload__delete\" data-dz-remove aria-label=\"${this.localization.cancelUpload}\" title=\"${this.localization.cancelUpload}\">\n <stzh-icon slot=\"icon\" class=\"stzh-upload__delete-icon\" name=\"delete\"></stzh-icon>\n <stzh-icon slot=\"icon\" class=\"stzh-upload__delete-icon-error\" name=\"close\"></stzh-icon>\n </stzh-button>\n </div>\n </div>\n </div>\n `\n });\n\n this.disabledWatcher();\n\n this.dropzone.on(\"addedfile\", (file: StzhUploadFile) => this.stzhFileAdded.emit({\n component: \"stzh-upload\", file\n }));\n\n this.dropzone.on(\"addedfiles\", (files: StzhUploadFile[]) => this.stzhFilesAdded.emit({\n component: \"stzh-upload\", files\n }));\n\n this.dropzone.on(\"removefile\", (file: StzhUploadFile) => this.stzhFileRemove.emit({\n component: \"stzh-upload\", file\n }).defaultPrevented === false);\n\n this.dropzone.on(\"removedfile\", (file: StzhUploadFile, force: boolean) => this.stzhFileRemoved.emit({\n component: \"stzh-upload\", file, force\n }));\n\n this.dropzone.on(\"sending\", (file: StzhUploadFile, xhr: XMLHttpRequest, formData: FormData) => this.stzhSending.emit({\n component: \"stzh-upload\", file, xhr, formData\n }));\n\n this.dropzone.on(\"sendingmultiple\", (files: StzhUploadFile[], xhr: XMLHttpRequest, formData: FormData) => this.stzhSendingMultiple.emit({\n component: \"stzh-upload\", files, xhr, formData\n }));\n\n this.dropzone.on(\"processing\", (file: StzhUploadFile) => this.stzhProcessing.emit({\n component: \"stzh-upload\", file\n }));\n\n this.dropzone.on(\"processingmultiple\", (files: StzhUploadFile[]) => this.stzhProcessingMultiple.emit({\n component: \"stzh-upload\", files\n }));\n\n this.dropzone.on(\"uploadprogress\", (file: StzhUploadFile, progress: number, bytesSent: number) => this.stzhProgress.emit({\n component: \"stzh-upload\", file, progress, bytesSent\n }));\n\n this.dropzone.on(\"totaluploadprogress\", (totalUploadProgress: number, totalBytes: number, totalBytesSent: number) => this.stzhProgressTotal.emit({\n component: \"stzh-upload\", totalUploadProgress, totalBytes, totalBytesSent\n }));\n\n this.dropzone.on(\"error\", (file: StzhUploadFile, message: string, xhr: XMLHttpRequest) => this.stzhError.emit({\n component: \"stzh-upload\", file, message, xhr\n }));\n\n this.dropzone.on(\"errormultiple\", (files: StzhUploadFile[], message: string, xhr: XMLHttpRequest) => this.stzhErrorMultiple.emit({\n component: \"stzh-upload\", files, message, xhr\n }));\n\n this.dropzone.on(\"success\", (file: StzhUploadFile, responseText: string, event: ProgressEvent) => this.stzhSuccess.emit({\n component: \"stzh-upload\", file, responseText, event\n }));\n\n this.dropzone.on(\"successmultiple\", (files: StzhUploadFile[], responseText: string, event: ProgressEvent) => this.stzhSuccessMultiple.emit({\n component: \"stzh-upload\", files, responseText, event\n }));\n\n this.dropzone.on(\"canceled\", (file: StzhUploadFile) => this.stzhCanceled.emit({\n component: \"stzh-upload\", file\n }));\n\n this.dropzone.on(\"canceledmultiple\", (files: StzhUploadFile[]) => this.stzhCanceledMultiple.emit({\n component: \"stzh-upload\", files\n }));\n\n this.dropzone.on(\"complete\", (file: StzhUploadFile) => this.stzhComplete.emit({\n component: \"stzh-upload\", file\n }));\n\n this.dropzone.on(\"completemultiple\", (files: StzhUploadFile[]) => this.stzhCompleteMultiple.emit({\n component: \"stzh-upload\", files\n }));\n\n this.dropzone.on(\"addedfile\", (file: StzhUploadFile) => {\n file.previewElement.querySelectorAll(`[${ATTR_NAME}]`).forEach((name: HTMLElement) => {\n name.setAttribute(\"title\", file.name);\n });\n\n file.previewElement.querySelectorAll(`[${ATTR_TYPE}]`).forEach((type: HTMLElement) => {\n type.innerText = file.type;\n });\n\n file.previewElement.querySelectorAll(`[${ATTR_EXTENSION}]`).forEach((extension: HTMLElement) => {\n extension.innerText = file.name.split(\".\").pop();\n })\n });\n\n this.dropzone.on(\"uploadprogress\", (file: StzhUploadFile, progress: number) => {\n file.previewElement.querySelectorAll(`[${ATTR_PROGRESS_TEXT}]`).forEach((progressText: HTMLElement) => {\n progressText.innerText = `${progress.toString()}%`;\n });\n });\n\n this._existingFiles.forEach((file) => {\n this.dropzone.displayExistingFile(file, null, null, null, null);\n });\n }\n\n disconnectedCallback() {\n if (this.dropzone) {\n this.dropzone.destroy();\n this.dropzone = null;\n }\n }\n\n render() {\n const errorUsed = hasSlot(this.element, 'error') || !!this.error;\n\n const classes = {\n \"stzh-upload\": true,\n \"stzh-upload--is-invalid\": this.invalid,\n \"stzh-upload--is-disabled\": this.disabled,\n \"stzh-upload--has-hidden-progress\": this.hideProgress,\n \"stzh-upload--has-hidden-progress-while-idle\": this.hideProgressWhileIdle,\n \"stzh-upload--has-error\": errorUsed,\n \"stzh-upload--has-instructions\": !!this.description || !!this.localization.description\n };\n\n return (\n <Host>\n <div\n class={classes}\n ref={(el) => (this.dropzoneElement = el as HTMLDivElement)}\n >\n <div ref={(el) => (this.hiddenInputContainerElement = el as HTMLElement)}></div>\n\n <div id={`${this.uploadId}-label`}>\n {this.label && <div class=\"stzh-upload__label\">{this.label}</div>}\n </div>\n\n <div\n class=\"stzh-upload__clickarea\"\n ref={(el) => (this.clickareaElement = el as HTMLDivElement)}\n >\n <div class=\"stzh-upload__instructions\" id={`${this.uploadId}-instruction`}>\n {this.description ? this.description : this.localization.description}\n </div>\n <stzh-button\n size=\"small\"\n class=\"stzh-upload__button\"\n ref={(el) => (this.buttonElement = el as HTMLStzhButtonElement)}\n a11yDescribedby={`${this.uploadId}-label ${this.uploadId}-instruction ${this.uploadId}-description`}\n disabled={this.disabled}\n >\n {this.button ? this.button : this.localization.button}\n </stzh-button>\n </div>\n\n <StzhInputDescription\n classPrefix=\"stzh-upload\"\n id={`${this.uploadId}-description`}\n error={this._error}\n />\n\n <div\n class=\"stzh-upload__errors\"\n ref={(el) => (this.errorsElement = el as HTMLElement)}\n ></div>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"stzh-upload.js","sourceRoot":"","sources":["../../../src/components/stzh-upload/stzh-upload.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,CAAC,EACD,OAAO,EACP,IAAI,EACJ,MAAM,EACN,KAAK,EACL,KAAK,EAEN,MAAM,eAAe,CAAC;AAyBvB,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAE5E,OAAO,mCAAmC,CAAC;AAC3C,MAAM,CAAC,QAAQ,CAAC,YAAY,GAAG,KAAK,CAAC;AAErC,MAAM,SAAS,GAAG,cAAc,CAAC;AACjC,MAAM,SAAS,GAAG,cAAc,CAAC;AACjC,MAAM,SAAS,GAAG,cAAc,CAAC;AACjC,MAAM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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Host,\n h,\n Element,\n Prop,\n Method,\n Watch,\n Event,\n EventEmitter\n} from \"@stencil/core\";\n\nimport {\n StzhUploadFilesItem,\n StzhUploadFile,\n StzhUploadFileAddedEvent,\n StzhUploadFilesAddedEvent,\n StzhUploadFileRemoveEvent,\n StzhUploadFileRemovedEvent,\n StzhUploadSendingEvent,\n StzhUploadSendingMultipleEvent,\n StzhUploadProcessingEvent,\n StzhUploadProcessingMultipleEvent,\n StzhUploadProgressEvent,\n StzhUploadProgressTotalEvent,\n StzhUploadErrorEvent,\n StzhUploadErrorMultipleEvent,\n StzhUploadSuccessEvent,\n StzhUploadSuccessMultipleEvent,\n StzhUploadCanceledEvent,\n StzhUploadCanceledMultipleEvent,\n StzhUploadCompleteEvent,\n StzhUploadCompleteMultipleEvent\n} from \"../../index\";\n\nimport { hasSlot, isStzhElement } from \"../../utils/utils\";\nimport { StzhUploadLocalizedText } from './stzh-upload.localization';\nimport { StzhInputDescription } from \"../stzh-input/stzh-input-description\";\n\nimport \"../../libraries/dropzone/dropzone\";\nwindow.Dropzone.autoDiscover = false;\n\nconst ATTR_NAME = \"data-dz-name\";\nconst ATTR_TYPE = \"data-dz-type\";\nconst ATTR_SIZE = \"data-dz-size\";\nconst ATTR_LINK = \"data-dz-link\";\nconst ATTR_EXTENSION = \"data-dz-extension\";\nconst ATTR_META_ID = \"data-dz-meta-id\";\nconst ATTR_ERROR_MESSAGE_ID = \"data-dz-error-message-id\";\nconst ATTR_PROGRESS_TEXT = \"data-dz-progress-text\";\nconst ATTR_REMOVE = \"data-dz-remove\";\n\nlet uploadCounter = 0;\nlet previewCounter = 0;\n\n// Most properties taken over from:\n// https://github.com/dropzone/dropzone/blob/v5.9.3/src/options.js\n\n// Possible events to listen to:\n// https://github.com/dropzone/dropzone/blob/v5.9.3/src/dropzone.js#L17\n\n/**\n * @slot error - Slot for error\n */\n@Component({\n tag: \"stzh-upload\",\n styleUrl: \"stzh-upload.scss\"\n})\nexport class StzhUpload {\n /**\n * Initially pre existing files (e.g. already uploaded by the user).\n * Array of objects that must at least include `name` and `size` attribute:\n * `[{\"name\":\"file1.txt\", \"size\": 12345}, {\"name\":\"file2.txt\", \"size\": 12345}]`\n */\n @Prop() existingFiles: StzhUploadFilesItem[] | string = [];\n private _existingFiles: StzhUploadFilesItem[] = [];\n\n /** Label */\n @Prop() label: string = \"\";\n\n /** Description */\n @Prop() description: string = \"\";\n\n /** Button text */\n @Prop() button: string = \"\";\n\n /**\n * URL the files are processed to.\n *\n * You can also provide a function that will be called with `files` and\n * `dataBlocks` and must return the url as string.\n */\n @Prop() url: string | Function = \"\";\n\n /**\n * Can be changed to `\"put\"` if necessary. You can also provide a function\n * that will be called with `files` and must return the method.\n */\n @Prop() method: \"post\" | \"put\" | Function = \"post\";\n\n /**\n * Will be set on the XHRequest.\n */\n @Prop() withCredentials: boolean = false;\n\n /**\n * Whether the upload is disabled or not.\n */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /**\n * Whether the upload is marked as invalid.\n */\n @Prop({ reflect: true }) invalid: boolean = false;\n\n /** Whether download functionality should be disabled. */\n @Prop() downloadDisabled: boolean = false;\n\n /** Whether download functionality should only be shown to completed files. */\n @Prop() downloadDisabledWhileProcessing: boolean = false;\n\n /** One or multiple error message (use error slot as alternative) */\n @Prop() error: string | string[];\n private _error: string[];\n\n /**\n * The default implementation of `accept` checks the file's mime type or\n * extension against this list. This is a comma separated list of mime\n * types or file extensions.\n *\n * Eg.: `image/*,application/pdf,.psd`\n *\n * This option will also be used as\n * [`accept`](https://developer.mozilla.org/en-US/docs/HTML/Element/input#attr-accept)\n * parameter on the hidden file input as well.\n */\n @Prop() acceptedFiles: string | null = null;\n\n /**\n * If false, files will be added to the queue but the queue will not be\n * processed automatically.\n * This can be useful if you need some additional user input before sending\n * files (or if you want want all files sent at once).\n * If you're ready to send the file simply call `element.processQueue()`.\n */\n @Prop() autoProcessQueue: boolean = true;\n\n /**\n * Hide progress (bars and text).\n */\n @Prop() hideProgress: boolean = false;\n\n /**\n * Hide progress (bars) only while idle (will show them as soon as upload starts).\n * Can be used together with `autoProcessQueue`, e.g. if files are uploaded at form submit to prevent showing empty progressbar.\n */\n @Prop() hideProgressWhileIdle: boolean = false;\n\n /**\n * If not `null` defines how many files this dropzone handles. If it exceeds,\n * the event `stzhMaxfilesexceeded` will be called.\n */\n @Prop() maxFiles: number | null = null;\n\n /**\n * The maximum filesize (in MiB) that is allowed to be uploaded.\n */\n @Prop() maxFilesize: number = 25;\n\n /**\n * How many file uploads to process in parallel.\n */\n @Prop() parallelUploads: number = 2;\n\n /**\n * Whether to send multiple files in one request. If\n * this it set to true, then the fallback file input element will\n * have the `multiple` attribute as well. This option will\n * also trigger additional events (like `stzhSuccessMultiple`). See the events\n * documentation section for more information.\n */\n @Prop() uploadMultiple: boolean = false;\n\n /**\n * Whether you want files to be uploaded in chunks to your server. This can't be\n * used in combination with `uploadMultiple`.\n *\n * See `chunksUploaded` prop for the callback to finalise an upload.\n */\n @Prop() chunking: boolean = false;\n\n /**\n * If `chunking` is enabled, this defines whether **every** file should be chunked,\n * even if the file size is below chunkSize. This means, that the additional chunk\n * form data will be submitted and the `chunksUploaded` callback will be invoked.\n */\n @Prop() forceChunking: boolean = false;\n\n /**\n * If `chunking` is `true`, then this defines the chunk size in bytes.\n */\n @Prop() chunkSize: number = 2 * 1024 * 1024;\n\n /**\n * If `true`, the individual chunks of a file are being uploaded simultaneously.\n */\n @Prop() parallelChunkUploads: boolean = false;\n\n /**\n * Whether a chunk should be retried if it fails.\n */\n @Prop() retryChunks: boolean = false;\n\n /**\n * If `retryChunks` is true, how many times should it be retried.\n */\n @Prop() retryChunksLimit: number = 3;\n\n /**\n * The base that is used to calculate the **displayed** filesize. You can\n * change this to 1024 if you would rather display kibibytes, mebibytes,\n * etc... 1024 is technically incorrect, because `1024 bytes` are `1 kibibyte`\n * not `1 kilobyte`. You can change this to `1024` if you don't care about\n * validity.\n */\n @Prop() filesizeBase: number = 1024;\n\n /**\n * An optional object to send additional headers to the server. Eg:\n * `{ \"My-Awesome-Header\": \"header value\" }`\n */\n @Prop() headers: object | null = null;\n\n /**\n * Should the default headers be set or not?\n * Accept: application/json <- for requesting json response\n * Cache-Control: no-cache <- Request shouldnt be cached\n * X-Requested-With: XMLHttpRequest <- We sent the request via XMLHttpRequest\n */\n @Prop() defaultHeaders: boolean = true;\n\n /**\n * A function that gets a [file](https://developer.mozilla.org/en-US/docs/DOM/File)\n * and a `done` function as parameters.\n *\n * If the done function is invoked without arguments, the file is \"accepted\" and will\n * be processed. If you pass an error message, the file is rejected, and the error\n * message will be displayed.\n * This function will not be called if the file is too big or doesn't match the mime types.\n */\n @Prop() accept: Function = function(_file, done) {\n return done();\n };\n\n /**\n * The callback that will be invoked when all chunks have been uploaded for a file.\n * It gets the file for which the chunks have been uploaded as the first parameter,\n * and the `done` function as second. `done()` needs to be invoked when everything\n * needed to finish the upload process is done.\n */\n @Prop() chunksUploaded: Function = function(_file, done) {\n done();\n };\n\n /**\n * This is the element the hidden input field (which is used when clicking on the\n * dropzone to trigger file selection) will be appended to. This might\n * be important in case you use frameworks to switch the content of your page.\n *\n * Can be a selector string, or an element directly. Will be rendered into element by default.\n */\n @Prop() hiddenInputContainer: string | HTMLElement;\n\n /** Translation strings. */\n @Prop() localization: StzhUploadLocalizedText;\n\n @Element() element: HTMLStzhUploadElement;\n\n @Watch(\"existingFiles\")\n existingFilesWatcher(newValue: StzhUploadFilesItem[] | string) {\n if (typeof newValue === \"string\") {\n this._existingFiles = JSON.parse(newValue);\n } else {\n this._existingFiles = newValue;\n }\n }\n\n @Watch(\"disabled\")\n disabledWatcher() {\n if (!this.dropzone) {\n return;\n }\n\n if (this.disabled) {\n this.dropzone.disable();\n } else {\n this.dropzone.enable();\n }\n }\n\n @Watch(\"error\")\n errorWatcher(newValue: string | string[]) {\n if (typeof newValue === \"string\") {\n try {\n this._error = JSON.parse(newValue);\n } catch (e) {\n if (newValue) {\n this._error = [newValue];\n } else {\n this._error = [];\n }\n }\n } else if (newValue) {\n this._error = newValue;\n } else {\n this._error = [];\n }\n\n this.invalid = this._error.length > 0;\n }\n\n /** File added */\n @Event() stzhFileAdded: EventEmitter<StzhUploadFileAddedEvent>;\n\n /** Files added (multiple) */\n @Event() stzhFilesAdded: EventEmitter<StzhUploadFilesAddedEvent>;\n\n /** File remove (before, cancelable) */\n @Event() stzhFileRemove: EventEmitter<StzhUploadFileRemoveEvent>;\n\n /** File removed */\n @Event() stzhFileRemoved: EventEmitter<StzhUploadFileRemovedEvent>;\n\n /** Before sending file (add additional data before request if necessary) */\n @Event() stzhSending: EventEmitter<StzhUploadSendingEvent>;\n\n /** Before sending multiple files (add additional data before request if necessary) */\n @Event() stzhSendingMultiple: EventEmitter<StzhUploadSendingMultipleEvent>;\n\n /** Files starting to get processed */\n @Event() stzhProcessing: EventEmitter<StzhUploadProcessingEvent>;\n\n /** Files starting to get processed (multiple) */\n @Event() stzhProcessingMultiple: EventEmitter<StzhUploadProcessingMultipleEvent>;\n\n /** Upload file progress during upload */\n @Event() stzhProgress: EventEmitter<StzhUploadProgressEvent>;\n\n /** Upload total file progress during upload */\n @Event() stzhProgressTotal: EventEmitter<StzhUploadProgressTotalEvent>;\n\n /** File error */\n @Event() stzhError: EventEmitter<StzhUploadErrorEvent>;\n\n /** Files error (multiple files) */\n @Event() stzhErrorMultiple: EventEmitter<StzhUploadErrorMultipleEvent>;\n\n /** File successfully uploaded */\n @Event() stzhSuccess: EventEmitter<StzhUploadSuccessEvent>;\n\n /** Files successfully uploaded (multiple files) */\n @Event() stzhSuccessMultiple: EventEmitter<StzhUploadSuccessMultipleEvent>;\n\n /** Canceled file upload */\n @Event() stzhCanceled: EventEmitter<StzhUploadCanceledEvent>;\n\n /** Canceled file upload (multiple files) */\n @Event() stzhCanceledMultiple: EventEmitter<StzhUploadCanceledMultipleEvent>;\n\n /** Completed upload (successfully or with error) */\n @Event() stzhComplete: EventEmitter<StzhUploadCompleteEvent>;\n\n /** Completed upload (successfully or with error, multiple files) */\n @Event() stzhCompleteMultiple: EventEmitter<StzhUploadCompleteMultipleEvent>;\n\n @Method()\n async processQueue() {\n return this.dropzone.processQueue();\n }\n\n @Method()\n async removeFile(file, force = false) {\n return this.dropzone.removeFile(file, force);\n }\n\n @Method()\n async removeAllFiles(onlyCancelCurrentlyUploadingFiles = false, force = false) {\n return this.dropzone.removeAllFiles(onlyCancelCurrentlyUploadingFiles, force);\n }\n\n private dropzone: any;\n private dropzoneElement: HTMLElement;\n private buttonElement: HTMLStzhButtonElement;\n private clickareaElement: HTMLElement;\n private previewsElement: HTMLElement;\n private errorsElement: HTMLElement;\n private hiddenInputContainerElement: HTMLElement;\n private uploadId: string;\n\n private filesize = function(size) {\n let selectedSize = 0;\n let selectedUnit = \"b\";\n\n if (size > 0) {\n let units = [\"tb\", \"gb\", \"mb\", \"kb\", \"b\"];\n\n for (let i = 0; i < units.length; i++) {\n let unit = units[i];\n let cutoff = Math.pow(this.options.filesizeBase, 4 - i) / 10;\n\n if (size >= cutoff) {\n selectedSize = size / Math.pow(this.options.filesizeBase, 4 - i);\n selectedUnit = unit;\n break;\n }\n }\n\n selectedSize = Math.round(selectedSize * 100) / 100; // Cutting of digits\n }\n\n return `<strong>${selectedSize}</strong> ${this.options.dictFileSizeUnits[selectedUnit]}`;\n }\n\n private filePreviewId = function(file): string {\n return `${this.uploadId}-${file._id}`\n }\n\n async componentWillLoad() {\n this.uploadId = `stzh-upload-${uploadCounter++}`;\n\n this.existingFilesWatcher(this.existingFiles);\n this.errorWatcher(this.error);\n\n if (!this.localization) {\n this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, 'upload');\n }\n }\n\n componentDidRender() {\n if (this.dropzone) {\n return;\n }\n\n const self = this;\n\n function enableDownload(file) {\n let fileHref = file.url || '';\n\n if (file.upload) {\n fileHref = URL.createObjectURL(file);\n }\n\n if (fileHref) {\n for (var node of file.previewElement.querySelectorAll(`[${ATTR_LINK}]`)) {\n node.setAttribute(\"href\", fileHref);\n node.setAttribute(\"download\", file.name);\n\n const isStzh = isStzhElement(node);\n const fileId = self.filePreviewId(file);\n\n node.setAttribute(isStzh ? \"analytics-id\" : \"s-object-id\", `${self.localization.downloadFile} ${file.name}`);\n node.setAttribute(isStzh ? \"a11y-label\" : \"aria-label\", `${self.localization.downloadFile} ${file.name}`);\n node.setAttribute(isStzh ? \"a11y-describedby\" : \"aria-describedby\", `${fileId}-error-message ${fileId}-meta`);\n }\n }\n }\n\n this.dropzone = new window.Dropzone(this.dropzoneElement, {\n previewsContainer: this.previewsElement,\n url: this.url,\n method: this.method,\n withCredentials: this.withCredentials,\n clickable: [this.clickareaElement],\n acceptedFiles: this.acceptedFiles,\n accept: this.accept,\n maxFiles: this.maxFiles,\n maxFilesize: this.maxFilesize,\n filesizeBase: this.filesizeBase,\n parallelUploads: this.parallelUploads,\n uploadMultiple: this.uploadMultiple,\n autoProcessQueue: this.autoProcessQueue,\n headers: this.headers,\n defaultHeaders: this.defaultHeaders,\n chunking: this.chunking,\n chunkSize: this.chunkSize,\n chunksUploaded: this.chunksUploaded,\n forceChunking: this.forceChunking,\n parallelChunkUploads: this.parallelChunkUploads,\n retryChunks: this.retryChunks,\n retryChunksLimit: this.retryChunksLimit,\n createImageThumbnails: false,\n hiddenInputContainer: this.hiddenInputContainer ? this.hiddenInputContainer : this.hiddenInputContainerElement,\n dictFileSizeUnits: { tb: \"TiB\", gb: \"GiB\", mb: \"MiB\", kb: \"KiB\", b: \"b\" },\n dictRemoveFileConfirmation: null,\n dictMaxFilesExceeded: this.localization.maxFilesExceeded,\n dictRemoveFile: this.localization.removeFile,\n dictDeleteFile: this.localization.deleteFile,\n dictCancelUploadConfirmation: this.localization.cancelUploadConfirmation,\n dictUploadCanceled: this.localization.uploadCanceled,\n dictCancelUpload: this.localization.cancelUpload,\n dictResponseError: this.localization.responseError,\n dictInvalidFileType: this.localization.invalidFileType,\n dictFileTooBig: this.localization.fileTooBig,\n // Called when a file is added to the queue\n // Receives `file`\n // Taken from https://github.com/dropzone/dropzone/blob/v5.9.3/src/options.js#L594\n addedfile(file) {\n file._id = previewCounter++;\n\n if (this.element === this.previewsContainer) {\n this.element.classList.add(\"dz-started\");\n }\n\n if (this.previewsContainer && !this.options.disablePreviews) {\n file.previewElement = window.Dropzone.createElement(\n this.options.previewTemplate.trim()\n );\n file.previewTemplate = file.previewElement; // Backwards compatibility\n this.previewsContainer.appendChild(file.previewElement);\n\n if (!file.size) {\n file.previewElement.classList.add(\"dz-empty\");\n }\n\n for (var node of file.previewElement.querySelectorAll(`[${ATTR_NAME}]`)) {\n node.textContent = file.name;\n }\n\n for (node of file.previewElement.querySelectorAll(`[${ATTR_SIZE}]`)) {\n node.innerHTML = self.filesize.call(this, file.size);\n }\n\n for (node of file.previewElement.querySelectorAll(`[${ATTR_META_ID}]`)) {\n node.setAttribute(\"id\", `${self.filePreviewId(file)}-meta`);\n }\n\n for (node of file.previewElement.querySelectorAll(`[${ATTR_ERROR_MESSAGE_ID}]`)) {\n node.setAttribute(\"id\", `${self.filePreviewId(file)}-error-message`);\n }\n\n if (this.options.addRemoveLinks) {\n file._removeLink = window.Dropzone.createElement(\n `<a class=\"dz-remove\" href=\"javascript:undefined;\" ${ATTR_REMOVE}>\n ${this.options.dictRemoveFile}\n </a>`\n );\n file.previewElement.appendChild(file._removeLink);\n }\n\n let removeFileEvent = (e) => {\n e.preventDefault();\n e.stopPropagation();\n if (file.status === window.Dropzone.UPLOADING) {\n return window.Dropzone.confirm(\n this.options.dictCancelUploadConfirmation,\n () => this.removeFile(file)\n );\n } else {\n if (this.options.dictRemoveFileConfirmation) {\n return window.Dropzone.confirm(\n this.options.dictRemoveFileConfirmation,\n () => this.removeFile(file)\n );\n } else {\n return this.removeFile(file);\n }\n }\n };\n\n for (let removeLink of file.previewElement.querySelectorAll(\n `[${ATTR_REMOVE}]`\n )) {\n removeLink.addEventListener(\"click\", removeFileEvent);\n\n const isStzh = isStzhElement(removeLink);\n const fileId = self.filePreviewId(file);\n\n removeLink.setAttribute(isStzh ? \"analytics-id\" : \"s-object-id\", `${this.options.dictRemoveFile}`);\n removeLink.setAttribute(isStzh ? \"a11y-label\" : \"aria-label\", `${this.options.dictRemoveFile} ${file.name}`);\n removeLink.setAttribute(isStzh ? \"a11y-describedby\" : \"aria-describedby\", `${fileId}-error-message ${fileId}-meta`);\n }\n\n if (!self.downloadDisabled && !self.downloadDisabledWhileProcessing) {\n enableDownload(file);\n }\n }\n },\n // When the upload is finished, either with success or an error.\n // Taken from https://github.com/dropzone/dropzone/blob/v5.9.3/src/options.js#L752\n complete(file) {\n for (let node of file.previewElement.querySelectorAll(`[${ATTR_REMOVE}]`)) {\n const hasErrorState = (file.status === \"error\");\n const removeOrDeleteLabel = hasErrorState ? this.options.dictRemoveFile : this.options.dictDeleteFile;\n const isStzh = isStzhElement(node);\n const fileId = self.filePreviewId(file);\n\n node.setAttribute(isStzh ? \"a11y-label\" : \"aria-label\", `${removeOrDeleteLabel} ${file.name}`);\n node.setAttribute(isStzh ? \"a11y-describedby\" : \"aria-describedby\", `${fileId}-error-message ${fileId}-meta`);\n }\n\n // move file uploads with errors to another element, so they are grouped together\n if (file.status === \"error\") {\n self.errorsElement.appendChild(file.previewElement);\n } else if (!self.downloadDisabled && self.downloadDisabledWhileProcessing) {\n enableDownload(file);\n }\n\n if (file._removeLink) {\n file._removeLink.innerHTML = this.options.dictRemoveFile;\n }\n\n if (file.previewElement) {\n return file.previewElement.classList.add(\"dz-complete\");\n }\n },\n // Called whenever a file is removed.\n // Taken fom https://github.com/dropzone/dropzone/blob/v5.9.3/src/options.js#L649\n removedfile(file) {\n if (file.previewElement != null && file.previewElement.parentNode != null) {\n file.previewElement.parentNode.removeChild(file.previewElement);\n }\n\n // set focus to upload\n self.buttonElement.setFocus();\n\n return this._updateMaxFilesReachedClass();\n },\n error(file, message, xhr) {\n if (file.previewElement) {\n file.previewElement.classList.add(\"dz-error\");\n\n if (typeof message !== \"string\" && message.error) {\n message = message.error;\n } else if (xhr) {\n if (xhr.status === 401 || xhr.status === 403) {\n message = self.localization.accessError;\n } else if (xhr.status === 413) {\n message = self.localization.fileTooBigServer;\n } else if (xhr.status === 415) {\n message = self.localization.invalidFileType;\n } else if (xhr.status >= 500) {\n message = self.localization.serverError;\n } else {\n const defaultError = self.localization.responseError\n .replace(\"{{statusCode}}\", xhr.status);\n\n message = defaultError;\n }\n }\n\n for (let node of file.previewElement.querySelectorAll(\"[data-dz-errormessage]\")) {\n node.textContent = message;\n }\n }\n },\n previewTemplate: `\n <div class=\"stzh-upload__preview\">\n <div class=\"stzh-upload__image\">\n <img data-dz-thumbnail />\n </div>\n\n <div class=\"stzh-upload__details\">\n <div class=\"stzh-upload__info-wrapper\">\n <div class=\"stzh-upload__info-wrapper-processing\">\n <div class=\"stzh-upload__infos\">\n <div class=\"stzh-upload__subtitle\">\n <a class=\"stzh-upload__link\" ${ATTR_NAME} ${ATTR_LINK}></a>\n </div>\n <div class=\"stzh-upload__progress-text\">\n <span ${ATTR_PROGRESS_TEXT}></span>\n </div>\n </div>\n <div class=\"stzh-upload__meta\">\n <span class=\"stzh-upload__extension\" ${ATTR_EXTENSION}></span>\n <span class=\"stzh-upload__size\" ${ATTR_SIZE}></span>\n </div>\n <div class=\"stzh-upload__progress\">\n <span class=\"stzh-upload__progress-bar\" data-dz-uploadprogress></span>\n </div>\n </div>\n <div class=\"stzh-upload__info-wrapper-complete\">\n <div class=\"stzh-upload__title\">\n <a class=\"stzh-upload__link\" ${ATTR_NAME} ${ATTR_LINK}></a>\n </div>\n <div class=\"stzh-upload__meta\" ${ATTR_META_ID}>\n <span class=\"stzh-upload__extension\" ${ATTR_EXTENSION}></span>\n <span class=\"stzh-upload__size\" ${ATTR_SIZE}></span>\n </div>\n <div class=\"stzh-upload__error-message\" ${ATTR_ERROR_MESSAGE_ID}>\n <span data-dz-errormessage></span>\n </div>\n </div>\n </div>\n <div class=\"stzh-upload__actions\">\n <stzh-button variant=\"tertiary\" size=\"tiny\" icon-only icon=\"download\" class=\"stzh-upload__download\" ${ATTR_LINK}></stzh-button>\n <stzh-button variant=\"tertiary\" size=\"tiny\" icon-only class=\"stzh-upload__delete\" ${ATTR_REMOVE}>\n <stzh-icon slot=\"icon\" class=\"stzh-upload__delete-icon\" name=\"delete\"></stzh-icon>\n <stzh-icon slot=\"icon\" class=\"stzh-upload__delete-icon-error\" name=\"close\"></stzh-icon>\n </stzh-button>\n </div>\n </div>\n </div>\n `\n });\n\n this.disabledWatcher();\n\n this.dropzone.on(\"addedfile\", (file: StzhUploadFile) => this.stzhFileAdded.emit({\n component: \"stzh-upload\", file\n }));\n\n this.dropzone.on(\"addedfiles\", (files: StzhUploadFile[]) => this.stzhFilesAdded.emit({\n component: \"stzh-upload\", files\n }));\n\n this.dropzone.on(\"removefile\", (file: StzhUploadFile) => this.stzhFileRemove.emit({\n component: \"stzh-upload\", file\n }).defaultPrevented === false);\n\n this.dropzone.on(\"removedfile\", (file: StzhUploadFile, force: boolean) => this.stzhFileRemoved.emit({\n component: \"stzh-upload\", file, force\n }));\n\n this.dropzone.on(\"sending\", (file: StzhUploadFile, xhr: XMLHttpRequest, formData: FormData) => this.stzhSending.emit({\n component: \"stzh-upload\", file, xhr, formData\n }));\n\n this.dropzone.on(\"sendingmultiple\", (files: StzhUploadFile[], xhr: XMLHttpRequest, formData: FormData) => this.stzhSendingMultiple.emit({\n component: \"stzh-upload\", files, xhr, formData\n }));\n\n this.dropzone.on(\"processing\", (file: StzhUploadFile) => this.stzhProcessing.emit({\n component: \"stzh-upload\", file\n }));\n\n this.dropzone.on(\"processingmultiple\", (files: StzhUploadFile[]) => this.stzhProcessingMultiple.emit({\n component: \"stzh-upload\", files\n }));\n\n this.dropzone.on(\"uploadprogress\", (file: StzhUploadFile, progress: number, bytesSent: number) => this.stzhProgress.emit({\n component: \"stzh-upload\", file, progress, bytesSent\n }));\n\n this.dropzone.on(\"totaluploadprogress\", (totalUploadProgress: number, totalBytes: number, totalBytesSent: number) => this.stzhProgressTotal.emit({\n component: \"stzh-upload\", totalUploadProgress, totalBytes, totalBytesSent\n }));\n\n this.dropzone.on(\"error\", (file: StzhUploadFile, message: string, xhr: XMLHttpRequest) => this.stzhError.emit({\n component: \"stzh-upload\", file, message, xhr\n }));\n\n this.dropzone.on(\"errormultiple\", (files: StzhUploadFile[], message: string, xhr: XMLHttpRequest) => this.stzhErrorMultiple.emit({\n component: \"stzh-upload\", files, message, xhr\n }));\n\n this.dropzone.on(\"success\", (file: StzhUploadFile, responseText: string, event: ProgressEvent) => this.stzhSuccess.emit({\n component: \"stzh-upload\", file, responseText, event\n }));\n\n this.dropzone.on(\"successmultiple\", (files: StzhUploadFile[], responseText: string, event: ProgressEvent) => this.stzhSuccessMultiple.emit({\n component: \"stzh-upload\", files, responseText, event\n }));\n\n this.dropzone.on(\"canceled\", (file: StzhUploadFile) => this.stzhCanceled.emit({\n component: \"stzh-upload\", file\n }));\n\n this.dropzone.on(\"canceledmultiple\", (files: StzhUploadFile[]) => this.stzhCanceledMultiple.emit({\n component: \"stzh-upload\", files\n }));\n\n this.dropzone.on(\"complete\", (file: StzhUploadFile) => this.stzhComplete.emit({\n component: \"stzh-upload\", file\n }));\n\n this.dropzone.on(\"completemultiple\", (files: StzhUploadFile[]) => this.stzhCompleteMultiple.emit({\n component: \"stzh-upload\", files\n }));\n\n this.dropzone.on(\"addedfile\", (file: StzhUploadFile) => {\n file.previewElement.querySelectorAll(`[${ATTR_NAME}]`).forEach((name: HTMLElement) => {\n name.setAttribute(\"title\", file.name);\n });\n\n file.previewElement.querySelectorAll(`[${ATTR_TYPE}]`).forEach((type: HTMLElement) => {\n type.innerText = file.type;\n });\n\n file.previewElement.querySelectorAll(`[${ATTR_EXTENSION}]`).forEach((extension: HTMLElement) => {\n extension.innerText = file.name.split(\".\").pop();\n })\n });\n\n this.dropzone.on(\"uploadprogress\", (file: StzhUploadFile, progress: number) => {\n file.previewElement.querySelectorAll(`[${ATTR_PROGRESS_TEXT}]`).forEach((progressText: HTMLElement) => {\n progressText.innerText = `${progress.toString()}%`;\n });\n });\n\n this._existingFiles.forEach((file) => {\n this.dropzone.displayExistingFile(file, null, null, null, null);\n });\n }\n\n disconnectedCallback() {\n if (this.dropzone) {\n this.dropzone.destroy();\n this.dropzone = null;\n }\n }\n\n render() {\n const errorUsed = hasSlot(this.element, 'error') || !!this.error;\n\n const classes = {\n \"stzh-upload\": true,\n \"stzh-upload--is-invalid\": this.invalid,\n \"stzh-upload--is-disabled\": this.disabled,\n \"stzh-upload--has-hidden-progress\": this.hideProgress,\n \"stzh-upload--has-hidden-progress-while-idle\": this.hideProgressWhileIdle,\n \"stzh-upload--has-error\": errorUsed,\n \"stzh-upload--has-instructions\": !!this.description || !!this.localization.description\n };\n\n return (\n <Host>\n <div\n class={classes}\n ref={(el) => (this.dropzoneElement = el as HTMLDivElement)}\n >\n <div ref={(el) => (this.hiddenInputContainerElement = el as HTMLElement)}></div>\n\n <div id={`${this.uploadId}-label`}>\n {this.label && <div class=\"stzh-upload__label\">{this.label}</div>}\n </div>\n\n <div\n class=\"stzh-upload__clickarea\"\n ref={(el) => (this.clickareaElement = el as HTMLDivElement)}\n >\n <div class=\"stzh-upload__instructions\" id={`${this.uploadId}-instruction`}>\n {this.description ? this.description : this.localization.description}\n </div>\n <stzh-button\n size=\"small\"\n class=\"stzh-upload__button\"\n ref={(el) => (this.buttonElement = el as HTMLStzhButtonElement)}\n a11yDescribedby={`${this.uploadId}-label ${this.uploadId}-instruction ${this.uploadId}-description`}\n disabled={this.disabled}\n a11yControls={`${this.uploadId}-previews`}\n >\n {this.button ? this.button : this.localization.button}\n </stzh-button>\n </div>\n\n <StzhInputDescription\n classPrefix=\"stzh-upload\"\n id={`${this.uploadId}-description`}\n error={this._error}\n />\n\n <div id={`${this.uploadId}-previews`}>\n <div\n class=\"stzh-upload__errors\"\n ref={(el) => (this.errorsElement = el as HTMLElement)}\n ></div>\n\n <div\n class=\"stzh-upload__previews dropzone-previews\"\n ref={(el) => (this.previewsElement = el as HTMLElement)}\n ></div>\n </div>\n\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stzh-upload.localization.js","sourceRoot":"","sources":["../../../src/components/stzh-upload/stzh-upload.localization.ts"],"names":[],"mappings":"","sourcesContent":["import { StzhLocaleComponent } from \"../../utils/translation-utils\";\n\nexport type StzhUploadLocalizedText = StzhLocaleComponent & {\n description: string\n button: string\n
|
|
1
|
+
{"version":3,"file":"stzh-upload.localization.js","sourceRoot":"","sources":["../../../src/components/stzh-upload/stzh-upload.localization.ts"],"names":[],"mappings":"","sourcesContent":["import { StzhLocaleComponent } from \"../../utils/translation-utils\";\n\nexport type StzhUploadLocalizedText = StzhLocaleComponent & {\n description: string\n button: string\n cancelUpload: string\n uploadCanceled: string\n cancelUploadConfirmation: string\n removeFile: string\n deleteFile: string\n downloadFile: string\n maxFilesExceeded: string\n serverError: string\n accessError: string\n responseError: string\n invalidFileType: string\n fileTooBig: string\n fileTooBigServer: string\n}\n"]}
|
|
@@ -10,6 +10,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
}
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
|
+
import { camelCase } from "./string-utils";
|
|
13
14
|
export function createComponentStory(name) {
|
|
14
15
|
return function (args, template, selector = null) {
|
|
15
16
|
const tempElement = document.createElement('div');
|
|
@@ -39,7 +40,7 @@ const setAttributeOrProperty = (element, name, value, stringifyProperty = false)
|
|
|
39
40
|
element.setAttribute(name, JSON.stringify(value));
|
|
40
41
|
}
|
|
41
42
|
else {
|
|
42
|
-
element[name] = value;
|
|
43
|
+
element[camelCase(name)] = value;
|
|
43
44
|
}
|
|
44
45
|
}
|
|
45
46
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"story-utils.js","sourceRoot":"","sources":["../../src/utils/story-utils.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,MAAM,UAAU,oBAAoB,CAAC,IAAY;EAC/C,OAAO,UAAS,IAAI,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAC7C,MAAM,WAAW,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAClD,WAAW,CAAC,SAAS,GAAG,QAAQ,CAAC;IAEjC,MAAM,gBAAgB,GAAG,WAAW,CAAC,aAAa,CAAC,QAAQ,IAAI,IAAI,CAAC,CAAC;IAErE,MAAM,EAAE,oBAAoB,KAAoB,IAAI,EAAnB,UAAU,UAAK,IAAI,EAA9C,wBAAuC,CAAO,CAAC;IAErD,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,M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;SAAM,IAAI,iBAAiB,IAAI,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,OAAO,KAAK,CAAC,EAAE;MACjE,OAAO,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;KACnD;SAAM;MACL,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC;KAClC;GACF;AACH,CAAC,CAAC","sourcesContent":["import { camelCase } from \"./string-utils\";\n\nexport function createComponentStory(name: string) {\n return function(args, template, selector = null) {\n const tempElement = document.createElement('div');\n tempElement.innerHTML = template;\n\n const componentElement = tempElement.querySelector(selector || name);\n\n const { $stringifyProperties, ...attributes } = args;\n\n for (const [key, value] of Object.entries(attributes)) {\n setAttributeOrProperty(componentElement, key, value, $stringifyProperties);\n }\n\n return tempElement.firstElementChild;\n }\n}\n\nconst setAttributeOrProperty = (\n element: HTMLElement | SVGElement,\n name: string,\n value: any,\n stringifyProperty: boolean = false\n): void => {\n if (value === undefined || value === null) {\n return;\n }\n\n // Naive support for xlink namespace\n // Full list: https://github.com/facebook/react/blob/1843f87/src/renderers/dom/shared/SVGDOMPropertyConfig.js#L258-L264\n if (/^xlink[AHRST]/.test(name)) {\n element.setAttributeNS(\n \"http://www.w3.org/1999/xlink\",\n name.replace(\"xlink\", \"xlink:\").toLowerCase(),\n value\n );\n } else {\n if ([\"string\", \"number\", \"bigint\", \"boolean\"].includes(typeof value) || name.startsWith('.')) {\n element.setAttribute(name, value);\n } else if (stringifyProperty && [\"object\"].includes(typeof value)) {\n element.setAttribute(name, JSON.stringify(value));\n } else {\n element[camelCase(name)] = value;\n }\n }\n};\n"]}
|