@oiz/stzh-components 4.1.1-beta2 → 4.1.1-beta3
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-4591a5a9.js → app-globals-6b2bb7e2.js} +2 -2
- package/dist/cjs/{app-globals-4591a5a9.js.map → app-globals-6b2bb7e2.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-upload.cjs.entry.js +23 -37
- package/dist/cjs/stzh-upload.cjs.entry.js.map +1 -1
- package/dist/collection/components/stzh-upload/stzh-upload.e2e.js +6 -2
- package/dist/collection/components/stzh-upload/stzh-upload.e2e.js.map +1 -1
- package/dist/collection/components/stzh-upload/stzh-upload.js +24 -38
- package/dist/collection/components/stzh-upload/stzh-upload.js.map +1 -1
- package/dist/collection/components/stzh-upload/stzh-upload.stories.js +524 -28
- package/dist/components/index.js +1 -1
- package/dist/components/stzh-upload.js +23 -37
- package/dist/components/stzh-upload.js.map +1 -1
- package/dist/esm/{app-globals-b6c1c47f.js → app-globals-d150c886.js} +2 -2
- package/dist/esm/{app-globals-b6c1c47f.js.map → app-globals-d150c886.js.map} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/stzh-components.js +1 -1
- package/dist/esm/stzh-upload.entry.js +23 -37
- package/dist/esm/stzh-upload.entry.js.map +1 -1
- package/dist/stzh-components/{p-0895d027.js → p-cac56a03.js} +2 -2
- package/dist/stzh-components/{p-f91f7483.entry.js → p-e4bf1c8d.entry.js} +2 -2
- package/dist/stzh-components/p-e4bf1c8d.entry.js.map +1 -0
- package/dist/stzh-components/stzh-components.esm.js +1 -1
- package/dist/types/components/stzh-upload/stzh-upload.d.ts +3 -2
- package/dist/types/components.d.ts +2 -2
- package/dist/vscode-data.json +1 -1
- package/package.json +1 -1
- package/dist/stzh-components/p-f91f7483.entry.js.map +0 -1
- /package/dist/stzh-components/{p-0895d027.js.map → p-cac56a03.js.map} +0 -0
|
@@ -13281,7 +13281,8 @@ const StzhUpload$1 = /*@__PURE__*/ proxyCustomElement(class StzhUpload extends H
|
|
|
13281
13281
|
this.removeAllFiles(true);
|
|
13282
13282
|
};
|
|
13283
13283
|
this.closePhotographingWebsocketConnection = () => {
|
|
13284
|
-
|
|
13284
|
+
var _a;
|
|
13285
|
+
(_a = this.photographingWebsocket) === null || _a === void 0 ? void 0 : _a.close();
|
|
13285
13286
|
};
|
|
13286
13287
|
this.onButtonScanClick = event => {
|
|
13287
13288
|
event.preventDefault();
|
|
@@ -13628,6 +13629,23 @@ const StzhUpload$1 = /*@__PURE__*/ proxyCustomElement(class StzhUpload extends H
|
|
|
13628
13629
|
return `${window.location.origin}`;
|
|
13629
13630
|
}
|
|
13630
13631
|
}
|
|
13632
|
+
removeFileFromState(file) {
|
|
13633
|
+
var _a;
|
|
13634
|
+
this.totalFilesState = this.totalFilesState.filter(f => f._id !== file._id);
|
|
13635
|
+
// remove from hiddenInputFiles, falls relevant
|
|
13636
|
+
if (this.preventHiddenInputClear) {
|
|
13637
|
+
this.hiddenInputFiles = this.hiddenInputFiles.filter(trackedFile => trackedFile.name !== file.name);
|
|
13638
|
+
// Aktualisiere das hidden file input Feld:
|
|
13639
|
+
const hiddenFileInput = (_a = this.hiddenInputContainerElement) === null || _a === void 0 ? void 0 : _a.querySelector("input");
|
|
13640
|
+
if (hiddenFileInput) {
|
|
13641
|
+
const dataTransfer = new DataTransfer();
|
|
13642
|
+
this.hiddenInputFiles.forEach(trackedFile => {
|
|
13643
|
+
dataTransfer.items.add(trackedFile);
|
|
13644
|
+
});
|
|
13645
|
+
hiddenFileInput.files = dataTransfer.files;
|
|
13646
|
+
}
|
|
13647
|
+
}
|
|
13648
|
+
}
|
|
13631
13649
|
async componentWillLoad() {
|
|
13632
13650
|
this.uploadId = `stzh-upload-${uploadCounter++}`;
|
|
13633
13651
|
this.existingFilesWatcher(this.existingFiles);
|
|
@@ -13759,14 +13777,7 @@ const StzhUpload$1 = /*@__PURE__*/ proxyCustomElement(class StzhUpload extends H
|
|
|
13759
13777
|
async addedfile(file) {
|
|
13760
13778
|
var _a;
|
|
13761
13779
|
file._id = previewCounter++;
|
|
13762
|
-
self.totalFilesState.push(file);
|
|
13763
|
-
let sessCheck = sessionStorage.getItem("totalFilesState");
|
|
13764
|
-
if (!sessCheck) {
|
|
13765
|
-
sessionStorage.setItem("totalFilesState", JSON.stringify(file));
|
|
13766
|
-
}
|
|
13767
|
-
else {
|
|
13768
|
-
sessionStorage.setItem("totalFilesState", JSON.stringify(self.totalFilesState));
|
|
13769
|
-
}
|
|
13780
|
+
self.totalFilesState.push(...self.totalFilesState, file);
|
|
13770
13781
|
// Preserve files in hidden input when preventHiddenInputClear is true
|
|
13771
13782
|
if (self.preventHiddenInputClear) {
|
|
13772
13783
|
const hiddenFileInput = (_a = self.hiddenInputContainerElement) === null || _a === void 0 ? void 0 : _a.querySelector("input");
|
|
@@ -13811,10 +13822,6 @@ const StzhUpload$1 = /*@__PURE__*/ proxyCustomElement(class StzhUpload extends H
|
|
|
13811
13822
|
self.totalTooBigMessageBody = self.localization.fileTooBigTotal.replace("{{totalFilesize}}", `${(self.totalFileSize + fileSizeInMiB).toFixed(1)}`);
|
|
13812
13823
|
self.totalTooBigMessageBody2 = self.localization.fileTooBigTotal2.replace("{{maxFilesizeTotal}}", `${self.maxFilesizeTotal}`);
|
|
13813
13824
|
self.totalFilesState = self.totalFilesState.filter(f => f.name !== file.name);
|
|
13814
|
-
let sessCheck = sessionStorage.getItem("totalFilesState");
|
|
13815
|
-
if (sessCheck) {
|
|
13816
|
-
sessionStorage.setItem("totalFilesState", JSON.stringify(self.totalFilesState));
|
|
13817
|
-
}
|
|
13818
13825
|
return;
|
|
13819
13826
|
}
|
|
13820
13827
|
else {
|
|
@@ -14009,28 +14016,7 @@ const StzhUpload$1 = /*@__PURE__*/ proxyCustomElement(class StzhUpload extends H
|
|
|
14009
14016
|
files
|
|
14010
14017
|
}));
|
|
14011
14018
|
this.dropzone.on("removefile", (file) => {
|
|
14012
|
-
|
|
14013
|
-
this.totalFilesState = this.totalFilesState.filter(f => f._id !== file._id);
|
|
14014
|
-
if (sessionStorage.getItem("totalFilesState")) {
|
|
14015
|
-
let oldStorage = JSON.parse(sessionStorage.getItem("totalFilesState"));
|
|
14016
|
-
let newStorage = oldStorage.filter((f) => f._id !== file._id);
|
|
14017
|
-
sessionStorage.setItem("totalFilesState", JSON.stringify(newStorage));
|
|
14018
|
-
}
|
|
14019
|
-
else {
|
|
14020
|
-
sessionStorage.setItem("totalFilesState", JSON.stringify(this.totalFilesState));
|
|
14021
|
-
}
|
|
14022
|
-
if (this.preventHiddenInputClear) {
|
|
14023
|
-
// Remove the file from our tracked array
|
|
14024
|
-
this.hiddenInputFiles = this.hiddenInputFiles.filter(trackedFile => trackedFile.name !== file.name);
|
|
14025
|
-
const hiddenFileInput = (_a = this.hiddenInputContainerElement) === null || _a === void 0 ? void 0 : _a.querySelector("input");
|
|
14026
|
-
if (hiddenFileInput) {
|
|
14027
|
-
const dataTransfer = new DataTransfer();
|
|
14028
|
-
this.hiddenInputFiles.forEach(trackedFile => {
|
|
14029
|
-
dataTransfer.items.add(trackedFile);
|
|
14030
|
-
});
|
|
14031
|
-
hiddenFileInput.files = dataTransfer.files;
|
|
14032
|
-
}
|
|
14033
|
-
}
|
|
14019
|
+
this.removeFileFromState(file);
|
|
14034
14020
|
return (this.stzhFileRemove.emit({
|
|
14035
14021
|
component: "stzh-upload",
|
|
14036
14022
|
file
|
|
@@ -14169,9 +14155,9 @@ const StzhUpload$1 = /*@__PURE__*/ proxyCustomElement(class StzhUpload extends H
|
|
|
14169
14155
|
"stzh-upload--has-instructions": !!this.description || !!this.localization.description
|
|
14170
14156
|
};
|
|
14171
14157
|
const descriptionTotalFileSizeLimit = this.localization.descriptionTotalFileSizeLimit;
|
|
14172
|
-
return (h(Host, { key: '
|
|
14158
|
+
return (h(Host, { key: '75aa0dd41df988d305aa84fa234845f381021a4a', "is-invalid": this.invalid || errorUsed }, h("stzh-toastbar", { key: 'e384a88e33c9b231dc95dffcd78e84632574b89a' }), h("div", { key: '96e4f6f5dde87da36298cd8564f5a44b39b849d9', class: classes, ref: el => (this.dropzoneElement = el) }, h("div", { key: 'ed299d4f5849b0401756f2eb0295b799759f44a3', ref: el => (this.hiddenInputContainerElement = el) }), h("div", { key: '08473a500435b33ea41316eb750a5672a18a4fdd', id: `${this.uploadId}-label` }, this.label && h("div", { key: '99745fac88ee1df5b7d789199bc837e672a287c4', class: "stzh-upload__label" }, this.label)), h("div", { key: 'cdac7a72c20872761dd0802c02f0d5c35da7436a', class: "stzh-upload__clickarea", ref: el => (this.clickareaElement = el) }, h("div", { key: '1fd97d997cc0da144060b9d444ccaa087372c813', class: "stzh-upload__heading-wrapper" }, h("div", { key: '7ef945872a7b994b2d12dd3d4823195af631b4d4', class: "stzh-upload__heading-inner-wrapper" }, h("div", { key: '72dffa8c21176e1cc18d8a74e95f6b9120997203', class: "stzh-upload__heading" }, this.heading ? this.heading : this.localization.heading), h("div", { key: 'fc3dc86c665314cb60477daeccf077c75851fb33', class: "stzh-upload__buttons-wrapper" }, h("stzh-button", { key: 'c1930d7252980e78a3a48d612a9367632a53da82', class: "stzh-upload__button", variant: "secondary", size: "small", ref: el => (this.linkElement = el), label: this.button ? this.button : this.localization.button, a11yDescribedby: `${this.uploadId}-label ${this.uploadId}-instruction` + (((_b = this._error) === null || _b === void 0 ? void 0 : _b.length) > 0 ? ` ${this.uploadId}-description` : ""), disabled: this.disabled, a11yControls: `${this.uploadId}-previews` }, h("stzh-icon", { key: '24424022052170398b4cf00a6e254c907a3ee289', slot: "icon", name: "upload" })), this.isPhotographingAvailable && (h("stzh-button", { key: 'ef497accd0d1f7c00e953e8fde2d3ad9627e36dd', class: "stzh-upload__button-scan", variant: "secondary", size: "small", label: this.buttonScan ? this.buttonScan : this.localization.buttonScan, onClick: this.onButtonScanClick }, h("stzh-icon", { key: 'f72fce67cc573f140ebfa1b509e5c60cf65a7250', slot: "icon", name: "camera" })))), h("div", { key: '441fe723c3eda8324f66165024a5ede2f1301a23', class: "stzh-upload__hint-wrapper" }, h("span", { key: '6e6826bebae45786826e72eb8a3ca66af87da846' }, this.localization.buttonIntro)))), h("div", { key: '29c072540722229af02c6dabec8b4c892aa38d9d', class: "stzh-upload__instructions", id: `${this.uploadId}-instruction` }, h("p", { key: '720297f6757ff03483c13793cc98baa68e7f1545' }, description
|
|
14173
14159
|
.replace("{{fileformats}}", this.acceptedFiles)
|
|
14174
|
-
.replace("{{filesize}}", `${this.maxFilesize}`), h("br", { key: '
|
|
14160
|
+
.replace("{{filesize}}", `${this.maxFilesize}`), h("br", { key: 'e839e9a5e392a9122c5768eb6b996a192d907a2e' }), descriptionTotalFileSizeLimit.replace("{{maxFilesizeTotal}}", `${this.maxFilesizeTotal}`)))), ((_c = this._error) === null || _c === void 0 ? void 0 : _c.length) > 0 && (h("div", { key: 'e4b21e7a9951aa0c2516490c59cb9f3cc7bcece7', class: "stzh-upload__description-wrapper" }, h(StzhInputDescription, { key: '34ca4465a38d1fb255546023ffbcce7ca598bdab', classPrefix: "stzh-upload", id: `${this.uploadId}-description`, error: this._error }))), h("div", { key: '3147f2d4164a36765abc7757e8d5a0ceb96f82a9', id: `${this.uploadId}-previews`, class: "stzh-upload__previews-wrapper" }, h("div", { key: 'ecf5f962753e7a6de99a860d5ba4b4e4b3c5d948', class: "stzh-upload__previews-inner-wrapper" }, h("div", { key: '1e2021b2790d7642e8eaa5756677c7509d93cc15', class: "stzh-upload__errors", ref: el => (this.errorsElement = el) }), h("div", { key: 'd80dd75e46adeee51a148e7a0d7e9f51e68304b5', class: "stzh-upload__previews dropzone-previews", ref: el => (this.previewsElement = el) })))), this.duplicateDetected && (h("div", { key: 'ea64f656909123b1a617a22c2cb10995b90580de', class: "stzh-upload__previews-message-wrapper" }, h("stzh-message", { key: 'b5860731a53a4a1afbe04bc53fc3fc857ed4db91', type: "error", label: this.localization.duplicateFileUploadHeading, onStzhClose: () => this.duplicateDetected = false }, h("stzh-text", { key: '225b69ebf9295ae128778b2c86d6c9fe12dd3ecd' }, h("p", { key: 'e9985d75d911ef9004b3021a04ee28421c420175' }, "\u00AB", this.duplicateFileName, "\u00BB (", this.duplicateFileSize, ")"), h("p", { key: 'ef5b4644fd017f87a06d7bc576422d0ac74de7bd' }, this.localization.duplicateFileUploadParagraph))))), this.totalTooBig && (h("div", { key: 'c3973a34d351ad81dfb0f97526ad8898a1984c78', class: "stzh-upload__previews-message-wrapper" }, h("stzh-message", { key: '92f91a561a448c603dfe8dbafc1cac78d34a4ddc', type: "warning", label: this.totalTooBigMessageHeading, onStzhClose: () => this.totalTooBig = false }, h("stzh-text", { key: '125d609e70be58db13083ed75deb9dd5b4e0c71f' }, h("p", { key: 'd5464f329509eb35fbf04116de310518ae62fe3c' }, this.totalTooBigMessageBody, " ", this.totalTooBigMessageBody2))))), h("stzh-dialog", { key: '6e3c7fe7ace437241c9dca030e1acc984928b49c', ref: el => (this.photographingOverlayElement = el), onStzhClose: this.closePhotographingWebsocketConnection, class: this.isPhotographingAvailable && "stzh-dialog--fit-content", heading: this.localization.photographingTitle1 }, h("stzh-button", { key: '93851966664342966bf50b382e5d90df384ee6ba', class: "stzh-upload-photographing__back-button", icon: "arrow-left", size: "small", variant: "tertiary-plain", "no-padding-left": "true", "no-padding-right": "true", onClick: this.closePhotographingOverlay }, this.localization.back), this.isPhotographingAvailable && (h(Fragment, { key: '44270227198a852c359191bcd05dec0969ced593' }, h("div", { key: '1ddb6f4288c9cc87b7ab6893d725fa3b64061ffb', class: "stzh-upload-photographing__info" }, h("div", { key: 'a0d23409adbc23d7263683080e114f7a6250312b', class: "stzh-upload-photographing__text-qrcode" }, h("div", { key: 'c5cc76a3dbecec3c2fb1eff8c21a5786dfbaeed2', class: "stzh-upload-photographing-qrlink-container" }, h("stzh-text", { key: '385ff854f52afb9f8b3d3514fa4c62ddb7dc3c21' }, this.localization.photographingText1)), h("div", { key: '50b5b04ecfdfb65a6544c331d4d9f861343ed8dd', class: "stzh-upload-photographing-qrcode-container" }, h("canvas", { key: '3457dea2caa437c2bd39ef06eeb63fbd7312851f', class: "stzh-upload-photographing-qrcode", ref: el => (this.photographingQrcodeElement = el) })))), h("div", { key: '4cf41425eff6101bc2fc042cff7cee93c8b66a84', class: "stzh-upload-photographing__info" }, h("stzh-heading", { key: '23fcc679fca9dd513d85aca9ffa3fd14f5253b92', level: "3" }, this.localization.photographingTitle2), h("stzh-text", { key: '23b67b78bfba0ba200d39c23f700a065a78c17a8' }, this.localization.photographingText2)), h("div", { key: '594fd4602a28892ba149b14b0dbe2cd42cf5a5cd', class: "stzh-upload-photographing__continue" }, !!this.photographingUrlDetails && (h("stzh-link", { key: '789e17cdcab1bbd55b7c7c413f55cdbb945f59fe', class: "stzh-upload-photographing-link", href: this.photographingUrlDetails.url + "&label=" + this.cleanLabel(this.label), target: "_blank" }, this.localization.photographingContinue))))))));
|
|
14175
14161
|
}
|
|
14176
14162
|
get element() { return this; }
|
|
14177
14163
|
static get watchers() { return {
|