@zanichelli/albe-web-components 13.1.2 → 13.2.0-rc1
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/CHANGELOG.md +0 -6
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/web-components-library.cjs.js +1 -1
- package/dist/cjs/z-app-header_12.cjs.entry.js +12 -6
- package/dist/cjs/z-app-header_12.cjs.entry.js.map +1 -1
- package/dist/cjs/z-carousel.cjs.entry.js +2 -3
- package/dist/cjs/z-carousel.cjs.entry.js.map +1 -1
- package/dist/cjs/z-combobox.cjs.entry.js +145 -38
- package/dist/cjs/z-combobox.cjs.entry.js.map +1 -1
- package/dist/cjs/z-file-upload.cjs.entry.js +14 -25
- package/dist/cjs/z-file-upload.cjs.entry.js.map +1 -1
- package/dist/cjs/z-popover.cjs.entry.js +3 -3
- package/dist/cjs/z-popover.cjs.entry.js.map +1 -1
- package/dist/cjs/z-table.cjs.entry.js +2 -3
- package/dist/cjs/z-table.cjs.entry.js.map +1 -1
- package/dist/collection/components/file-upload/z-file-upload/index.js +13 -63
- package/dist/collection/components/file-upload/z-file-upload/index.js.map +1 -1
- package/dist/collection/components/file-upload/z-file-upload/styles.css +0 -12
- package/dist/collection/components/inputs/z-combobox/index.js +149 -41
- package/dist/collection/components/inputs/z-combobox/index.js.map +1 -1
- package/dist/collection/components/inputs/z-combobox/index.spec.js +185 -155
- package/dist/collection/components/inputs/z-combobox/index.spec.js.map +1 -1
- package/dist/collection/components/inputs/z-combobox/styles.css +10 -10
- package/dist/collection/components/inputs/z-input/index.js +41 -5
- package/dist/collection/components/inputs/z-input/index.js.map +1 -1
- package/dist/collection/components/list/z-list-element/index.js +20 -1
- package/dist/collection/components/list/z-list-element/index.js.map +1 -1
- package/dist/collection/components/table/z-table/index.js +2 -3
- package/dist/collection/components/table/z-table/index.js.map +1 -1
- package/dist/collection/components/z-carousel/index.js +1 -2
- package/dist/collection/components/z-carousel/index.js.map +1 -1
- package/dist/collection/components/z-carousel/styles.css +0 -1
- package/dist/collection/components/z-popover/index.js +4 -4
- package/dist/collection/components/z-popover/index.js.map +1 -1
- package/dist/components/index10.js +11 -5
- package/dist/components/index10.js.map +1 -1
- package/dist/components/index13.js +3 -1
- package/dist/components/index13.js.map +1 -1
- package/dist/components/index25.js +3 -3
- package/dist/components/index25.js.map +1 -1
- package/dist/components/z-carousel.js +2 -3
- package/dist/components/z-carousel.js.map +1 -1
- package/dist/components/z-combobox.js +163 -49
- package/dist/components/z-combobox.js.map +1 -1
- package/dist/components/z-file-upload.js +15 -28
- package/dist/components/z-file-upload.js.map +1 -1
- package/dist/components/z-table.js +2 -3
- package/dist/components/z-table.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/web-components-library.js +1 -1
- package/dist/esm/z-app-header_12.entry.js +12 -6
- package/dist/esm/z-app-header_12.entry.js.map +1 -1
- package/dist/esm/z-carousel.entry.js +2 -3
- package/dist/esm/z-carousel.entry.js.map +1 -1
- package/dist/esm/z-combobox.entry.js +147 -40
- package/dist/esm/z-combobox.entry.js.map +1 -1
- package/dist/esm/z-file-upload.entry.js +14 -25
- package/dist/esm/z-file-upload.entry.js.map +1 -1
- package/dist/esm/z-popover.entry.js +3 -3
- package/dist/esm/z-popover.entry.js.map +1 -1
- package/dist/esm/z-table.entry.js +2 -3
- package/dist/esm/z-table.entry.js.map +1 -1
- package/dist/types/components/file-upload/z-file-upload/index.d.ts +0 -5
- package/dist/types/components/inputs/z-combobox/index.d.ts +14 -1
- package/dist/types/components/inputs/z-input/index.d.ts +5 -0
- package/dist/types/components/list/z-list-element/index.d.ts +2 -0
- package/dist/types/components/z-popover/index.d.ts +0 -1
- package/dist/types/components.d.ts +23 -14
- package/dist/web-components-library/{p-3796ca7c.entry.js → p-158b6dda.entry.js} +2 -2
- package/dist/web-components-library/p-158b6dda.entry.js.map +1 -0
- package/dist/web-components-library/{p-f7607ce7.entry.js → p-2637ab23.entry.js} +2 -2
- package/dist/web-components-library/p-2637ab23.entry.js.map +1 -0
- package/{www/build/p-91a7c5a9.entry.js → dist/web-components-library/p-2b2cb566.entry.js} +2 -2
- package/dist/web-components-library/p-2b2cb566.entry.js.map +1 -0
- package/dist/web-components-library/p-2df884ef.entry.js +2 -0
- package/dist/web-components-library/p-2df884ef.entry.js.map +1 -0
- package/dist/web-components-library/p-5023f7d5.entry.js +2 -0
- package/dist/web-components-library/p-5023f7d5.entry.js.map +1 -0
- package/dist/web-components-library/p-93cb103f.entry.js +2 -0
- package/dist/web-components-library/p-93cb103f.entry.js.map +1 -0
- package/dist/web-components-library/web-components-library.esm.js +1 -1
- package/dist/web-components-library/web-components-library.esm.js.map +1 -1
- package/package.json +1 -1
- package/www/build/{p-3796ca7c.entry.js → p-158b6dda.entry.js} +2 -2
- package/www/build/p-158b6dda.entry.js.map +1 -0
- package/www/build/{p-f7607ce7.entry.js → p-2637ab23.entry.js} +2 -2
- package/www/build/p-2637ab23.entry.js.map +1 -0
- package/{dist/web-components-library/p-91a7c5a9.entry.js → www/build/p-2b2cb566.entry.js} +2 -2
- package/www/build/p-2b2cb566.entry.js.map +1 -0
- package/www/build/p-2df884ef.entry.js +2 -0
- package/www/build/p-2df884ef.entry.js.map +1 -0
- package/www/build/p-32cd9d9b.js +2 -0
- package/www/build/p-5023f7d5.entry.js +2 -0
- package/www/build/p-5023f7d5.entry.js.map +1 -0
- package/www/build/p-93cb103f.entry.js +2 -0
- package/www/build/p-93cb103f.entry.js.map +1 -0
- package/www/build/web-components-library.esm.js +1 -1
- package/www/build/web-components-library.esm.js.map +1 -1
- package/www/index.html +1 -1
- package/dist/web-components-library/p-3796ca7c.entry.js.map +0 -1
- package/dist/web-components-library/p-91a7c5a9.entry.js.map +0 -1
- package/dist/web-components-library/p-9a42f04c.entry.js +0 -2
- package/dist/web-components-library/p-9a42f04c.entry.js.map +0 -1
- package/dist/web-components-library/p-9b52dea5.entry.js +0 -2
- package/dist/web-components-library/p-9b52dea5.entry.js.map +0 -1
- package/dist/web-components-library/p-ba8e67ee.entry.js +0 -2
- package/dist/web-components-library/p-ba8e67ee.entry.js.map +0 -1
- package/dist/web-components-library/p-f7607ce7.entry.js.map +0 -1
- package/www/build/p-3796ca7c.entry.js.map +0 -1
- package/www/build/p-83f1ed74.js +0 -2
- package/www/build/p-91a7c5a9.entry.js.map +0 -1
- package/www/build/p-9a42f04c.entry.js +0 -2
- package/www/build/p-9a42f04c.entry.js.map +0 -1
- package/www/build/p-9b52dea5.entry.js +0 -2
- package/www/build/p-9b52dea5.entry.js.map +0 -1
- package/www/build/p-ba8e67ee.entry.js +0 -2
- package/www/build/p-ba8e67ee.entry.js.map +0 -1
- package/www/build/p-f7607ce7.entry.js.map +0 -1
|
@@ -3,7 +3,7 @@ import { w as ZFileUploadType, p as Device, D as DividerSize } from './index-225
|
|
|
3
3
|
import { g as getDevice } from './utils-7983d02c.js';
|
|
4
4
|
import './breakpoints-680e0e56.js';
|
|
5
5
|
|
|
6
|
-
const stylesCss = ":host{color:var(--color-text01);font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>.container{display:flex;flex-direction:column}:host .modal-wrapper{display:flex;align-items:center;justify-content:center;padding:calc(var(--space-unit) * 2)}:host .modal-wrapper>.files-wrapper{display:flex;flex-direction:column;margin:calc(var(--space-unit) * 4);gap:var(--space-unit)}:host .text-container{display:flex;flex-direction:column;margin:auto}:host .text-container .body-1{text-align:center}:host .text-container .upload-link{color:var(--color-link-primary);cursor:pointer}:host .text-container .upload-link-text{margin-bottom:var(--space-unit)}input#file-elem{display:none}#title{display:inline-block;margin:calc(var(--space-unit) * 2.5) 0 calc(var(--space-unit) * 4);font-size:calc(var(--space-unit) * 3);font-weight:var(--font-sb)}:host>.container>z-button{display:inline-block;margin-top:calc(var(--space-unit) * 3)}:host>.container>.files-container.hidden{display:none}:host>.container>.files-container>.heading-4-sb{display:inline-block;margin:calc(var(--space-unit) * 3) 0;font-size:calc(var(--space-unit) * 2);font-weight:var(--font-sb)}:host([type=\"dragdrop\"])>.container>.files-container>.heading-4-sb{margin-top:0;margin-bottom:calc(var(--space-unit) * 3)}:host>.container>.files-container>.files-wrapper{display:flex;flex-wrap:wrap;column-gap:calc(var(--space-unit) * 2);row-gap:calc(var(--space-unit) * 2)}:host>.container>.files-container>z-divider{margin-top:calc(var(--space-unit) * 3);margin-bottom:0}:host([type=\"dragdrop\"])>.container>.files-container>z-divider{margin:calc(var(--space-unit) * 3) 0}
|
|
6
|
+
const stylesCss = ":host{color:var(--color-text01);font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>.container{display:flex;flex-direction:column}:host .modal-wrapper{display:flex;align-items:center;justify-content:center;padding:calc(var(--space-unit) * 2)}:host .modal-wrapper>.files-wrapper{display:flex;flex-direction:column;margin:calc(var(--space-unit) * 4);gap:var(--space-unit)}:host .text-container{display:flex;flex-direction:column;margin:auto}:host .text-container .body-1{text-align:center}:host .text-container .upload-link{color:var(--color-link-primary);cursor:pointer}:host .text-container .upload-link-text{margin-bottom:var(--space-unit)}input#file-elem{display:none}#title{display:inline-block;margin:calc(var(--space-unit) * 2.5) 0 calc(var(--space-unit) * 4);font-size:calc(var(--space-unit) * 3);font-weight:var(--font-sb)}:host>.container>z-button{display:inline-block;margin-top:calc(var(--space-unit) * 3)}:host>.container>.files-container.hidden{display:none}:host>.container>.files-container>.heading-4-sb{display:inline-block;margin:calc(var(--space-unit) * 3) 0;font-size:calc(var(--space-unit) * 2);font-weight:var(--font-sb)}:host([type=\"dragdrop\"])>.container>.files-container>.heading-4-sb{margin-top:0;margin-bottom:calc(var(--space-unit) * 3)}:host>.container>.files-container>.files-wrapper{display:flex;flex-wrap:wrap;column-gap:calc(var(--space-unit) * 2);row-gap:calc(var(--space-unit) * 2)}:host>.container>.files-container>z-divider{margin-top:calc(var(--space-unit) * 3);margin-bottom:0}:host([type=\"dragdrop\"])>.container>.files-container>z-divider{margin:calc(var(--space-unit) * 3) 0}@media only screen and (min-width: 768px){:host>.container>z-button{align-self:flex-start}:host .modal-wrapper{padding:calc(var(--space-unit) * 3)}}@media only screen and (min-width: 1152px){:host .modal-wrapper{padding:calc(var(--space-unit) * 4)}}";
|
|
7
7
|
const ZFileUploadStyle0 = stylesCss;
|
|
8
8
|
|
|
9
9
|
const ZFileUpload = class {
|
|
@@ -24,12 +24,19 @@ const ZFileUpload = class {
|
|
|
24
24
|
this.files = [];
|
|
25
25
|
this.uploadBtnLabel = "allega";
|
|
26
26
|
this.dragAndDropLabel = "Rilascia i file in questa area per allegarli.";
|
|
27
|
-
this.hasFileSection = true;
|
|
28
27
|
this.invalidFiles = undefined;
|
|
29
28
|
}
|
|
30
29
|
/** Listen removeFile event sent from z-file component */
|
|
31
30
|
removeFileListener(e) {
|
|
32
|
-
this.
|
|
31
|
+
const files = this.files;
|
|
32
|
+
const file = files.find((file) => file.name === e.detail.fileName);
|
|
33
|
+
if (file) {
|
|
34
|
+
const index = files.indexOf(file);
|
|
35
|
+
if (index >= 0) {
|
|
36
|
+
files.splice(index, 1);
|
|
37
|
+
this.files = [...files];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
33
40
|
}
|
|
34
41
|
/** Listen fileDropped event sent from z-dragdrop-area component */
|
|
35
42
|
fileDroppedListener(e) {
|
|
@@ -52,21 +59,6 @@ const ZFileUpload = class {
|
|
|
52
59
|
async getFiles() {
|
|
53
60
|
return this.files;
|
|
54
61
|
}
|
|
55
|
-
/** remove file from the array */
|
|
56
|
-
async removeFile(fileName) {
|
|
57
|
-
this.removeFileHandler(fileName);
|
|
58
|
-
}
|
|
59
|
-
removeFileHandler(fileName) {
|
|
60
|
-
const files = this.files;
|
|
61
|
-
const file = files.find((file) => file.name === fileName);
|
|
62
|
-
if (file) {
|
|
63
|
-
const index = files.indexOf(file);
|
|
64
|
-
if (index >= 0) {
|
|
65
|
-
files.splice(index, 1);
|
|
66
|
-
this.files = [...files];
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
62
|
getType() {
|
|
71
63
|
if (getDevice() !== Device.DESKTOP && getDevice() !== Device.DESKTOP_WIDE) {
|
|
72
64
|
return ZFileUploadType.DEFAULT;
|
|
@@ -87,7 +79,7 @@ const ZFileUpload = class {
|
|
|
87
79
|
checkFiles(files) {
|
|
88
80
|
const errors = new Map();
|
|
89
81
|
const sizeErrorString = `supera il limite di ${this.fileMaxSize}MB`;
|
|
90
|
-
const formatErrorString = " ha un
|
|
82
|
+
const formatErrorString = " ha un'estensione non prevista";
|
|
91
83
|
files.forEach((file) => {
|
|
92
84
|
const fileSize = file.size / 1024 / 1024;
|
|
93
85
|
const fileFormatOk = this.acceptedFormat
|
|
@@ -135,9 +127,6 @@ const ZFileUpload = class {
|
|
|
135
127
|
return h("span", { class: "body-3" }, fileFormatString || fileWeightString ? finalString : null);
|
|
136
128
|
}
|
|
137
129
|
renderFileSection() {
|
|
138
|
-
if (!this.hasFileSection) {
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
130
|
return (h("section", { class: `files-container ${!this.files.length ? "hidden" : ""}` }, h("span", { class: "heading-4-sb" }, "File appena caricati"), h("div", { class: "files-wrapper" }, h("slot", { name: "files" })), h("z-divider", { size: DividerSize.MEDIUM })));
|
|
142
131
|
}
|
|
143
132
|
renderInput() {
|
|
@@ -181,8 +170,8 @@ const ZFileUpload = class {
|
|
|
181
170
|
}
|
|
182
171
|
formatErrorString(key, value) {
|
|
183
172
|
var _a, _b;
|
|
184
|
-
const bothErrors = value[0] && value[1] ? "
|
|
185
|
-
return
|
|
173
|
+
const bothErrors = value[0] && value[1] ? ", ed " : "";
|
|
174
|
+
return `Il file ${key} ${(_a = value[0]) !== null && _a !== void 0 ? _a : ""}${bothErrors}${(_b = value[1]) !== null && _b !== void 0 ? _b : ""}.`;
|
|
186
175
|
}
|
|
187
176
|
handleErrorModalContent() {
|
|
188
177
|
return (h("div", { slot: "modalContent" }, h("div", { class: "modal-wrapper" }, h("div", { class: "files" }, Array.from(this.invalidFiles).map(([key, value]) => {
|
|
@@ -190,7 +179,7 @@ const ZFileUpload = class {
|
|
|
190
179
|
})))));
|
|
191
180
|
}
|
|
192
181
|
render() {
|
|
193
|
-
return (h(Host, { key: '
|
|
182
|
+
return (h(Host, { key: 'b098b42d074787675ee266cc25746d479c202c5b' }, h("div", { key: '642c0c1c5e470dcbb57ce9975fd89ca138c196f4', tabIndex: 0, class: `container ${this.getType()}` }, this.mainTitle && this.renderTitle(), this.getType() == ZFileUploadType.DEFAULT ? this.renderDefaultMode() : this.renderDragDropMode()), !!this.invalidFiles.size && (h("z-modal", { modalid: `file-upload-${this.type}-error-modal`, tabIndex: 0, ref: (val) => (this.errorModal = val), modaltitle: "Attenzione", onModalClose: () => (this.invalidFiles = new Map()), onModalBackgroundClick: () => (this.invalidFiles = new Map()) }, this.handleErrorModalContent()))));
|
|
194
183
|
}
|
|
195
184
|
get el() { return getElement(this); }
|
|
196
185
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"z-file-upload.entry.js","mappings":";;;;;AAAA,MAAM,SAAS,GAAG,w/DAAw/D,CAAC;AAC3gE,0BAAe,SAAS;;MCQX,WAAW;;;;QAuDd,oBAAe,GAAG;YACxB,IAAI,EAAE,MAAM;YACZ,EAAE,EAAE,WAAW;YACf,QAAQ,EAAE,IAAI;SACf,CAAC;oBAxDsB,eAAe,CAAC,OAAO;;;;;;qBAwB/B,EAAE;8BAIQ,QAAQ;gCAIN,+CAA+C;8BAIhD,IAAI;;;;IAwB/B,kBAAkB,CAAC,CAAc;QAC/B,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;KAClC;;IAID,mBAAmB,CAAC,CAAc;QAChC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,gBAAgB,EAAE,CAAC;KACzB;IAED,kBAAkB;QAChB,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,IAAI,CAAC,YAAY,CAAC,IAAI,IAAI,IAAI,CAAC,UAAU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H;IAEO,uBAAuB;QAC7B,QACE,WAAK,IAAI,EAAC,cAAc,IACtB,WAAK,KAAK,EAAC,eAAe,IACxB,WAAK,KAAK,EAAC,OAAO,IACf,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC;YAC9C,OAAO,YAAM,KAAK,EAAC,QAAQ,IAAE,IAAI,CAAC,iBAAiB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAQ,CAAC;SACzE,CAAC,CACE,CACF,CACF,EACN;KACH;IAED,MAAM;QACJ,QACE,EAAC,IAAI,uDACH,4DACE,QAAQ,EAAE,CAAC,EACX,KAAK,EAAE,aAAa,IAAI,CAAC,OAAO,EAAE,EAAE,IAEnC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,WAAW,EAAE,EACpC,IAAI,CAAC,OAAO,EAAE,IAAI,eAAe,CAAC,OAAO,GAAG,IAAI,CAAC,iBAAiB,EAAE,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAC7F,EACL,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,KACvB,eACE,OAAO,EAAE,eAAe,IAAI,CAAC,IAAI,cAAc,EAC/C,QAAQ,EAAE,CAAC,EACX,GAAG,EAAE,CAAC,GAAG,MAAM,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC,EACrC,UAAU,EAAC,uBAAuB,EAClC,YAAY,EAAE,OAAO,IAAI,CAAC,YAAY,GAAG,IAAI,GAAG,EAAoB,CAAC,EACrE,sBAAsB,EAAE,OAAO,IAAI,CAAC,YAAY,GAAG,IAAI,GAAG,EAAoB,CAAC,IAE9E,IAAI,CAAC,uBAAuB,EAAE,CACvB,CACX,CACI,EACP;KACH;;;;;;;","names":[],"sources":["src/components/file-upload/z-file-upload/styles.css?tag=z-file-upload&encapsulation=shadow","src/components/file-upload/z-file-upload/index.tsx"],"sourcesContent":[":host {\n color: var(--color-text01);\n font-family: var(--font-family-sans);\n font-weight: var(--font-rg);\n}\n\n:host > .container {\n display: flex;\n flex-direction: column;\n}\n\n:host .modal-wrapper {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: calc(var(--space-unit) * 2);\n}\n\n:host .modal-wrapper > .files-wrapper {\n display: flex;\n flex-direction: column;\n margin: calc(var(--space-unit) * 4);\n gap: var(--space-unit);\n}\n\n:host .text-container {\n display: flex;\n flex-direction: column;\n margin: auto;\n}\n\n:host .text-container .body-1 {\n text-align: center;\n}\n\n:host .text-container .upload-link {\n color: var(--color-link-primary);\n cursor: pointer;\n}\n\n:host .text-container .upload-link-text {\n margin-bottom: var(--space-unit);\n}\n\ninput#file-elem {\n display: none;\n}\n\n#title {\n display: inline-block;\n margin: calc(var(--space-unit) * 2.5) 0 calc(var(--space-unit) * 4);\n font-size: calc(var(--space-unit) * 3);\n font-weight: var(--font-sb);\n}\n\n:host > .container > z-button {\n display: inline-block;\n margin-top: calc(var(--space-unit) * 3);\n}\n\n:host > .container > .files-container.hidden {\n display: none;\n}\n\n:host > .container > .files-container > .heading-4-sb {\n display: inline-block;\n margin: calc(var(--space-unit) * 3) 0;\n font-size: calc(var(--space-unit) * 2);\n font-weight: var(--font-sb);\n}\n\n:host([type=\"dragdrop\"]) > .container > .files-container > .heading-4-sb {\n margin-top: 0;\n margin-bottom: calc(var(--space-unit) * 3);\n}\n\n:host > .container > .files-container > .files-wrapper {\n display: flex;\n flex-wrap: wrap;\n column-gap: calc(var(--space-unit) * 2);\n row-gap: calc(var(--space-unit) * 2);\n}\n\n:host > .container > .files-container > z-divider {\n margin-top: calc(var(--space-unit) * 3);\n margin-bottom: 0;\n}\n\n:host([type=\"dragdrop\"]) > .container > .files-container > z-divider {\n margin: calc(var(--space-unit) * 3) 0;\n}\n\n:host .error-message {\n font-size: 14px;\n font-weight: 400;\n letter-spacing: 0.16%;\n line-height: 20px;\n text-align: left;\n}\n\n:host .error-message > .file-name {\n font-weight: 600;\n}\n\n/* Tablet breakpoint */\n@media only screen and (min-width: 768px) {\n :host > .container > z-button {\n align-self: flex-start;\n }\n\n :host .modal-wrapper {\n padding: calc(var(--space-unit) * 3);\n }\n}\n\n@media only screen and (min-width: 1152px) {\n :host .modal-wrapper {\n padding: calc(var(--space-unit) * 4);\n }\n}\n","import {Component, Prop, h, EventEmitter, Event, State, Listen, Element, Host, Method} from \"@stencil/core\";\nimport {ButtonVariant, Device, DividerSize, ZFileUploadType} from \"../../../beans\";\nimport {getDevice} from \"../../../utils/utils\";\n\n@Component({\n tag: \"z-file-upload\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZFileUpload {\n /** Prop indicating the file upload type - can be default or dragdrop */\n @Prop({reflect: true})\n type: ZFileUploadType = ZFileUploadType.DEFAULT;\n\n /** Prop indicating the button variant*/\n @Prop()\n buttonVariant?: ButtonVariant;\n\n /** Prop indicating the accepted file type: ex \".pdf, .doc, .jpg\" */\n @Prop()\n acceptedFormat?: string;\n\n /** Max file dimension in Megabyte */\n @Prop()\n fileMaxSize?: number;\n\n /** Title */\n @Prop()\n mainTitle?: string;\n\n /** Description */\n @Prop()\n description?: string;\n\n /** Files added by the user */\n @State()\n files: File[] = [];\n\n /** upoload button label */\n @Prop()\n uploadBtnLabel?: string = \"allega\";\n\n /** drag & drop button label */\n @Prop()\n dragAndDropLabel?: string = \"Rilascia i file in questa area per allegarli.\";\n\n /** uploaded files history rendering */\n @Prop()\n hasFileSection?: boolean = true;\n\n /** List of files not allowed to be uploaded */\n @State()\n invalidFiles: Map<string, string[]>;\n\n @Element() el: HTMLZFileUploadElement;\n\n private input: HTMLInputElement;\n\n private button: HTMLZButtonElement;\n\n private errorModal: HTMLZModalElement;\n\n private uploadLink: HTMLSpanElement;\n\n private inputAttributes = {\n type: \"file\",\n id: \"file-elem\",\n multiple: true,\n };\n\n /** Listen removeFile event sent from z-file component */\n @Listen(\"removeFile\")\n removeFileListener(e: CustomEvent): void {\n this.removeFileHandler(e.detail);\n }\n\n /** Listen fileDropped event sent from z-dragdrop-area component */\n @Listen(\"fileDropped\")\n fileDroppedListener(e: CustomEvent): void {\n this.input.files = e.detail;\n this.fileInputHandler();\n }\n\n componentDidUpdate(): void {\n this.handleAccessibility();\n this.invalidFiles.size && this.errorModal.focus();\n }\n\n componentWillLoad(): void {\n this.invalidFiles = new Map<string, string[]>();\n }\n\n /** Emitted when user select one or more files */\n @Event()\n fileInput: EventEmitter;\n\n private fileInputHandler(): void {\n if (this.input.files.length) {\n this.invalidFiles = this.checkFiles(Array.from(this.input.files));\n }\n }\n\n /** get array of uploaded files */\n @Method()\n async getFiles(): Promise<File[]> {\n return this.files;\n }\n\n /** remove file from the array */\n @Method()\n async removeFile(fileName: string): Promise<void> {\n this.removeFileHandler(fileName);\n }\n\n private removeFileHandler(fileName: string): void {\n const files = this.files;\n const file = files.find((file) => file.name === fileName);\n if (file) {\n const index = files.indexOf(file);\n if (index >= 0) {\n files.splice(index, 1);\n this.files = [...files];\n }\n }\n }\n\n private getType(): ZFileUploadType {\n if (getDevice() !== Device.DESKTOP && getDevice() !== Device.DESKTOP_WIDE) {\n return ZFileUploadType.DEFAULT;\n }\n\n return this.type;\n }\n\n private handleAccessibility(): void {\n const lastFile = this.el.querySelector(\"z-file:last-child z-chip button\");\n if (this.files.length > 0 && lastFile) {\n (lastFile as HTMLElement).focus();\n } else {\n this.getType() === ZFileUploadType.DEFAULT\n ? this.button.querySelector(\"button\").focus()\n : this.uploadLink.focus();\n }\n }\n\n private checkFiles(files: File[]): Map<string, string[]> {\n const errors = new Map<string, string[]>();\n const sizeErrorString = `supera il limite di ${this.fileMaxSize}MB`;\n const formatErrorString = \" ha un formato non supportato\";\n files.forEach((file: File) => {\n const fileSize = file.size / 1024 / 1024;\n const fileFormatOk = this.acceptedFormat\n .split(\",\")\n .some((ext: string) => file.name.toLowerCase().endsWith(ext.trim()));\n const fileSizeOk = fileSize <= this.fileMaxSize;\n if (fileSizeOk && fileFormatOk) {\n if (!this.files.find((f) => f.name === file.name)) {\n this.files.push(file);\n this.fileInput.emit(file);\n this.input.value = \"\";\n }\n\n return;\n }\n errors.set(file.name, []);\n if (!fileSizeOk) {\n errors.get(file.name).push(sizeErrorString);\n }\n if (!fileFormatOk) {\n errors.get(file.name).push(formatErrorString);\n }\n });\n\n return errors;\n }\n\n private renderTitle(): HTMLElement {\n return <span id=\"title\">{this.mainTitle}</span>;\n }\n\n private renderDescription(cssClass): HTMLElement {\n return <span class={cssClass}>{this.description}</span>;\n }\n\n private renderAllowedFileExtensions(): HTMLElement {\n let fileFormatString = \"\";\n let fileWeightString = \"\";\n\n if (this.acceptedFormat) {\n const fileFormat = this.acceptedFormat\n .split(\", \")\n .map((string) => string.substring(1).toUpperCase())\n .join(\", \");\n fileFormatString = ` nei formati ${fileFormat}`;\n }\n\n if (this.fileMaxSize) {\n fileWeightString = ` per un massimo di ${this.fileMaxSize}MB di peso`;\n }\n\n const finalString = `Puoi allegare file${fileFormatString}${fileWeightString}.`;\n\n return <span class=\"body-3\">{fileFormatString || fileWeightString ? finalString : null}</span>;\n }\n\n private renderFileSection(): HTMLElement {\n if (!this.hasFileSection) {\n return;\n }\n\n return (\n <section class={`files-container ${!this.files.length ? \"hidden\" : \"\"}`}>\n <span class=\"heading-4-sb\">File appena caricati</span>\n <div class=\"files-wrapper\">\n <slot name=\"files\" />\n </div>\n <z-divider size={DividerSize.MEDIUM} />\n </section>\n );\n }\n\n private renderInput(): HTMLInputElement {\n return (\n <input\n {...this.inputAttributes}\n onChange={() => this.fileInputHandler()}\n accept={this.acceptedFormat}\n ref={(val) => (this.input = val)}\n />\n );\n }\n\n private renderUploadButton(): unknown[] {\n return [\n this.renderInput(),\n <z-button\n onClick={() => this.input.click()}\n onKeyPress={(e) => {\n if (e.code == \"Space\" || e.code == \"Enter\") {\n e.preventDefault();\n this.input.click();\n }\n }}\n id=\"fileSelect\"\n variant={this.buttonVariant}\n icon=\"upload\"\n ref={(val) => (this.button = val)}\n >\n {this.uploadBtnLabel}\n </z-button>,\n ];\n }\n\n private renderUploadLink(): unknown[] {\n return [\n this.renderInput(),\n <span class=\"body-1 upload-link-text\">\n Trascina o{\" \"}\n <span\n tabIndex={0}\n class=\"body-1-sb upload-link\"\n onClick={() => this.input.click()}\n onKeyPress={(e) => {\n if (e.code == \"Space\" || e.code == \"Enter\") {\n e.preventDefault();\n this.input.click();\n }\n }}\n ref={(val) => (this.uploadLink = val)}\n >\n carica\n </span>{\" \"}\n dal tuo computer\n </span>,\n ];\n }\n\n private renderDefaultMode(): unknown[] {\n return [\n this.renderDescription(\"body-3-sb\"),\n this.renderAllowedFileExtensions(),\n this.renderFileSection(),\n this.renderUploadButton(),\n ];\n }\n\n private renderDragDropMode(): unknown[] {\n return [\n this.renderFileSection(),\n <z-dragdrop-area drag-and-drop-label={this.dragAndDropLabel}>\n <div class=\"text-container\">\n {this.renderDescription(\"body-1\")}\n {this.renderUploadLink()}\n {this.renderAllowedFileExtensions()}\n </div>\n </z-dragdrop-area>,\n ];\n }\n\n private formatErrorString(key, value): string {\n const bothErrors = value[0] && value[1] ? \" e \" : \"\";\n\n return (\n <span class=\"error-message\">\n Il file <span class=\"file-name\">{key}</span> {value[1] ?? \"\"}\n {bothErrors}\n {value[0] ?? \"\"}.\n </span>\n );\n }\n\n private handleErrorModalContent(): HTMLDivElement {\n return (\n <div slot=\"modalContent\">\n <div class=\"modal-wrapper\">\n <div class=\"files\">\n {Array.from(this.invalidFiles).map(([key, value]) => {\n return <span class=\"body-3\">{this.formatErrorString(key, value)}</span>;\n })}\n </div>\n </div>\n </div>\n );\n }\n\n render(): HTMLZFileUploadElement {\n return (\n <Host>\n <div\n tabIndex={0}\n class={`container ${this.getType()}`}\n >\n {this.mainTitle && this.renderTitle()}\n {this.getType() == ZFileUploadType.DEFAULT ? this.renderDefaultMode() : this.renderDragDropMode()}\n </div>\n {!!this.invalidFiles.size && (\n <z-modal\n modalid={`file-upload-${this.type}-error-modal`}\n tabIndex={0}\n ref={(val) => (this.errorModal = val)}\n modaltitle=\"Errore di caricamento\"\n onModalClose={() => (this.invalidFiles = new Map<string, string[]>())}\n onModalBackgroundClick={() => (this.invalidFiles = new Map<string, string[]>())}\n >\n {this.handleErrorModalContent()}\n </z-modal>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"z-file-upload.entry.js","mappings":";;;;;AAAA,MAAM,SAAS,GAAG,81DAA81D,CAAC;AACj3D,0BAAe,SAAS;;MCQX,WAAW;;;;QAmDd,oBAAe,GAAG;YACxB,IAAI,EAAE,MAAM;YACZ,EAAE,EAAE,WAAW;YACf,QAAQ,EAAE,IAAI;SACf,CAAC;oBApDsB,eAAe,CAAC,OAAO;;;;;;qBAwB/B,EAAE;8BAIQ,QAAQ;gCAIN,+CAA+C;;;;IAwB3E,kBAAkB,CAAC,CAAc;QAC/B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACzB,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACnE,IAAI,IAAI,EAAE;YACR,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAClC,IAAI,KAAK,IAAI,CAAC,EAAE;gBACd,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;gBACvB,IAAI,CAAC,KAAK,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC;aACzB;SACF;KACF;;IAID,mBAAmB,CAAC,CAAc;QAChC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,gBAAgB,EAAE,CAAC;KACzB;IAED,kBAAkB;QAChB,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,IAAI,CAAC,YAAY,CAAC,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;KACnD;IAED,iBAAiB;QAC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CAAC,IAAI,KACvB,eACE,OAAO,EAAE,eAAe,IAAI,CAAC,IAAI,cAAc,EAC/C,QAAQ,EAAE,CAAC,EACX,GAAG,EAAE,CAAC,GAAG,MAAM,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC,EACrC,UAAU,EAAC,YAAY,EACvB,YAAY,EAAE,OAAO,IAAI,CAAC,YAAY,GAAG,IAAI,GAAG,EAAoB,CAAC,EACrE,sBAAsB,EAAE,OAAO,IAAI,CAAC,YAAY,GAAG,IAAI,GAAG,EAAoB,CAAC,IAE9E,IAAI,CAAC,uBAAuB,EAAE,CACvB,CACX,CACI,EACP;KACH;;;;;;;","names":[],"sources":["src/components/file-upload/z-file-upload/styles.css?tag=z-file-upload&encapsulation=shadow","src/components/file-upload/z-file-upload/index.tsx"],"sourcesContent":[":host {\n color: var(--color-text01);\n font-family: var(--font-family-sans);\n font-weight: var(--font-rg);\n}\n\n:host > .container {\n display: flex;\n flex-direction: column;\n}\n\n:host .modal-wrapper {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: calc(var(--space-unit) * 2);\n}\n\n:host .modal-wrapper > .files-wrapper {\n display: flex;\n flex-direction: column;\n margin: calc(var(--space-unit) * 4);\n gap: var(--space-unit);\n}\n\n:host .text-container {\n display: flex;\n flex-direction: column;\n margin: auto;\n}\n\n:host .text-container .body-1 {\n text-align: center;\n}\n\n:host .text-container .upload-link {\n color: var(--color-link-primary);\n cursor: pointer;\n}\n\n:host .text-container .upload-link-text {\n margin-bottom: var(--space-unit);\n}\n\ninput#file-elem {\n display: none;\n}\n\n#title {\n display: inline-block;\n margin: calc(var(--space-unit) * 2.5) 0 calc(var(--space-unit) * 4);\n font-size: calc(var(--space-unit) * 3);\n font-weight: var(--font-sb);\n}\n\n:host > .container > z-button {\n display: inline-block;\n margin-top: calc(var(--space-unit) * 3);\n}\n\n:host > .container > .files-container.hidden {\n display: none;\n}\n\n:host > .container > .files-container > .heading-4-sb {\n display: inline-block;\n margin: calc(var(--space-unit) * 3) 0;\n font-size: calc(var(--space-unit) * 2);\n font-weight: var(--font-sb);\n}\n\n:host([type=\"dragdrop\"]) > .container > .files-container > .heading-4-sb {\n margin-top: 0;\n margin-bottom: calc(var(--space-unit) * 3);\n}\n\n:host > .container > .files-container > .files-wrapper {\n display: flex;\n flex-wrap: wrap;\n column-gap: calc(var(--space-unit) * 2);\n row-gap: calc(var(--space-unit) * 2);\n}\n\n:host > .container > .files-container > z-divider {\n margin-top: calc(var(--space-unit) * 3);\n margin-bottom: 0;\n}\n\n:host([type=\"dragdrop\"]) > .container > .files-container > z-divider {\n margin: calc(var(--space-unit) * 3) 0;\n}\n\n/* Tablet breakpoint */\n@media only screen and (min-width: 768px) {\n :host > .container > z-button {\n align-self: flex-start;\n }\n\n :host .modal-wrapper {\n padding: calc(var(--space-unit) * 3);\n }\n}\n\n@media only screen and (min-width: 1152px) {\n :host .modal-wrapper {\n padding: calc(var(--space-unit) * 4);\n }\n}\n","import {Component, Prop, h, EventEmitter, Event, State, Listen, Element, Host, Method} from \"@stencil/core\";\nimport {ButtonVariant, Device, DividerSize, ZFileUploadType} from \"../../../beans\";\nimport {getDevice} from \"../../../utils/utils\";\n\n@Component({\n tag: \"z-file-upload\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZFileUpload {\n /** Prop indicating the file upload type - can be default or dragdrop */\n @Prop({reflect: true})\n type: ZFileUploadType = ZFileUploadType.DEFAULT;\n\n /** Prop indicating the button variant*/\n @Prop()\n buttonVariant?: ButtonVariant;\n\n /** Prop indicating the accepted file type: ex \".pdf, .doc, .jpg\" */\n @Prop()\n acceptedFormat?: string;\n\n /** Max file dimension in Megabyte */\n @Prop()\n fileMaxSize?: number;\n\n /** Title */\n @Prop()\n mainTitle?: string;\n\n /** Description */\n @Prop()\n description?: string;\n\n /** Files added by the user */\n @State()\n files: File[] = [];\n\n /** upoload button label */\n @Prop()\n uploadBtnLabel?: string = \"allega\";\n\n /** drag & drop button label */\n @Prop()\n dragAndDropLabel?: string = \"Rilascia i file in questa area per allegarli.\";\n\n /** List of files not allowed to be uploaded */\n @State()\n invalidFiles: Map<string, string[]>;\n\n @Element() el: HTMLZFileUploadElement;\n\n private input: HTMLInputElement;\n\n private button: HTMLZButtonElement;\n\n private errorModal: HTMLZModalElement;\n\n private uploadLink: HTMLSpanElement;\n\n private inputAttributes = {\n type: \"file\",\n id: \"file-elem\",\n multiple: true,\n };\n\n /** Listen removeFile event sent from z-file component */\n @Listen(\"removeFile\")\n removeFileListener(e: CustomEvent): void {\n const files = this.files;\n const file = files.find((file) => file.name === e.detail.fileName);\n if (file) {\n const index = files.indexOf(file);\n if (index >= 0) {\n files.splice(index, 1);\n this.files = [...files];\n }\n }\n }\n\n /** Listen fileDropped event sent from z-dragdrop-area component */\n @Listen(\"fileDropped\")\n fileDroppedListener(e: CustomEvent): void {\n this.input.files = e.detail;\n this.fileInputHandler();\n }\n\n componentDidUpdate(): void {\n this.handleAccessibility();\n this.invalidFiles.size && this.errorModal.focus();\n }\n\n componentWillLoad(): void {\n this.invalidFiles = new Map<string, string[]>();\n }\n\n /** Emitted when user select one or more files */\n @Event()\n fileInput: EventEmitter;\n\n private fileInputHandler(): void {\n if (this.input.files.length) {\n this.invalidFiles = this.checkFiles(Array.from(this.input.files));\n }\n }\n\n /** get array of uploaded files */\n @Method()\n async getFiles(): Promise<File[]> {\n return this.files;\n }\n\n private getType(): ZFileUploadType {\n if (getDevice() !== Device.DESKTOP && getDevice() !== Device.DESKTOP_WIDE) {\n return ZFileUploadType.DEFAULT;\n }\n\n return this.type;\n }\n\n private handleAccessibility(): void {\n const lastFile = this.el.querySelector(\"z-file:last-child z-chip button\");\n if (this.files.length > 0 && lastFile) {\n (lastFile as HTMLElement).focus();\n } else {\n this.getType() === ZFileUploadType.DEFAULT\n ? this.button.querySelector(\"button\").focus()\n : this.uploadLink.focus();\n }\n }\n\n private checkFiles(files: File[]): Map<string, string[]> {\n const errors = new Map<string, string[]>();\n const sizeErrorString = `supera il limite di ${this.fileMaxSize}MB`;\n const formatErrorString = \" ha un'estensione non prevista\";\n files.forEach((file: File) => {\n const fileSize = file.size / 1024 / 1024;\n const fileFormatOk = this.acceptedFormat\n .split(\",\")\n .some((ext: string) => file.name.toLowerCase().endsWith(ext.trim()));\n const fileSizeOk = fileSize <= this.fileMaxSize;\n if (fileSizeOk && fileFormatOk) {\n if (!this.files.find((f) => f.name === file.name)) {\n this.files.push(file);\n this.fileInput.emit(file);\n this.input.value = \"\";\n }\n\n return;\n }\n errors.set(file.name, []);\n if (!fileSizeOk) {\n errors.get(file.name).push(sizeErrorString);\n }\n if (!fileFormatOk) {\n errors.get(file.name).push(formatErrorString);\n }\n });\n\n return errors;\n }\n\n private renderTitle(): HTMLElement {\n return <span id=\"title\">{this.mainTitle}</span>;\n }\n\n private renderDescription(cssClass): HTMLElement {\n return <span class={cssClass}>{this.description}</span>;\n }\n\n private renderAllowedFileExtensions(): HTMLElement {\n let fileFormatString = \"\";\n let fileWeightString = \"\";\n\n if (this.acceptedFormat) {\n const fileFormat = this.acceptedFormat\n .split(\", \")\n .map((string) => string.substring(1).toUpperCase())\n .join(\", \");\n fileFormatString = ` nei formati ${fileFormat}`;\n }\n\n if (this.fileMaxSize) {\n fileWeightString = ` per un massimo di ${this.fileMaxSize}MB di peso`;\n }\n\n const finalString = `Puoi allegare file${fileFormatString}${fileWeightString}.`;\n\n return <span class=\"body-3\">{fileFormatString || fileWeightString ? finalString : null}</span>;\n }\n\n private renderFileSection(): HTMLElement {\n return (\n <section class={`files-container ${!this.files.length ? \"hidden\" : \"\"}`}>\n <span class=\"heading-4-sb\">File appena caricati</span>\n <div class=\"files-wrapper\">\n <slot name=\"files\" />\n </div>\n <z-divider size={DividerSize.MEDIUM} />\n </section>\n );\n }\n\n private renderInput(): HTMLInputElement {\n return (\n <input\n {...this.inputAttributes}\n onChange={() => this.fileInputHandler()}\n accept={this.acceptedFormat}\n ref={(val) => (this.input = val)}\n />\n );\n }\n\n private renderUploadButton(): unknown[] {\n return [\n this.renderInput(),\n <z-button\n onClick={() => this.input.click()}\n onKeyPress={(e) => {\n if (e.code == \"Space\" || e.code == \"Enter\") {\n e.preventDefault();\n this.input.click();\n }\n }}\n id=\"fileSelect\"\n variant={this.buttonVariant}\n icon=\"upload\"\n ref={(val) => (this.button = val)}\n >\n {this.uploadBtnLabel}\n </z-button>,\n ];\n }\n\n private renderUploadLink(): unknown[] {\n return [\n this.renderInput(),\n <span class=\"body-1 upload-link-text\">\n Trascina o{\" \"}\n <span\n tabIndex={0}\n class=\"body-1-sb upload-link\"\n onClick={() => this.input.click()}\n onKeyPress={(e) => {\n if (e.code == \"Space\" || e.code == \"Enter\") {\n e.preventDefault();\n this.input.click();\n }\n }}\n ref={(val) => (this.uploadLink = val)}\n >\n carica\n </span>{\" \"}\n dal tuo computer\n </span>,\n ];\n }\n\n private renderDefaultMode(): unknown[] {\n return [\n this.renderDescription(\"body-3-sb\"),\n this.renderAllowedFileExtensions(),\n this.renderFileSection(),\n this.renderUploadButton(),\n ];\n }\n\n private renderDragDropMode(): unknown[] {\n return [\n this.renderFileSection(),\n <z-dragdrop-area drag-and-drop-label={this.dragAndDropLabel}>\n <div class=\"text-container\">\n {this.renderDescription(\"body-1\")}\n {this.renderUploadLink()}\n {this.renderAllowedFileExtensions()}\n </div>\n </z-dragdrop-area>,\n ];\n }\n\n private formatErrorString(key, value): string {\n const bothErrors = value[0] && value[1] ? \", ed \" : \"\";\n\n return `Il file ${key} ${value[0] ?? \"\"}${bothErrors}${value[1] ?? \"\"}.`;\n }\n\n private handleErrorModalContent(): HTMLDivElement {\n return (\n <div slot=\"modalContent\">\n <div class=\"modal-wrapper\">\n <div class=\"files\">\n {Array.from(this.invalidFiles).map(([key, value]) => {\n return <span class=\"body-3\">{this.formatErrorString(key, value)}</span>;\n })}\n </div>\n </div>\n </div>\n );\n }\n\n render(): HTMLZFileUploadElement {\n return (\n <Host>\n <div\n tabIndex={0}\n class={`container ${this.getType()}`}\n >\n {this.mainTitle && this.renderTitle()}\n {this.getType() == ZFileUploadType.DEFAULT ? this.renderDefaultMode() : this.renderDragDropMode()}\n </div>\n {!!this.invalidFiles.size && (\n <z-modal\n modalid={`file-upload-${this.type}-error-modal`}\n tabIndex={0}\n ref={(val) => (this.errorModal = val)}\n modaltitle=\"Attenzione\"\n onModalClose={() => (this.invalidFiles = new Map<string, string[]>())}\n onModalBackgroundClick={() => (this.invalidFiles = new Map<string, string[]>())}\n >\n {this.handleErrorModalContent()}\n </z-modal>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -115,7 +115,7 @@ const ZPopover = class {
|
|
|
115
115
|
}
|
|
116
116
|
if (!e.composedPath().includes(this.host)) {
|
|
117
117
|
const target = e.target;
|
|
118
|
-
const triggerElemClicked = this.bindTo instanceof HTMLElement ? this.bindTo.contains(target) : target.closest(this.bindTo);
|
|
118
|
+
const triggerElemClicked = this.bindTo instanceof HTMLElement ? this.bindTo.contains(target) : target.closest(CSS.escape(this.bindTo));
|
|
119
119
|
if (triggerElemClicked) {
|
|
120
120
|
e.stopPropagation();
|
|
121
121
|
}
|
|
@@ -159,7 +159,7 @@ const ZPopover = class {
|
|
|
159
159
|
setPosition() {
|
|
160
160
|
let element;
|
|
161
161
|
if (typeof this.bindTo === "string") {
|
|
162
|
-
element = this.host.ownerDocument.querySelector(this.bindTo);
|
|
162
|
+
element = this.host.ownerDocument.querySelector(CSS.escape(this.bindTo));
|
|
163
163
|
}
|
|
164
164
|
else if (this.bindTo) {
|
|
165
165
|
element = this.bindTo;
|
|
@@ -300,7 +300,7 @@ const ZPopover = class {
|
|
|
300
300
|
this.onOpen();
|
|
301
301
|
}
|
|
302
302
|
render() {
|
|
303
|
-
return h("slot", { key: '
|
|
303
|
+
return h("slot", { key: '70c742e7871fbf8a871165a4de625dda200ae024' });
|
|
304
304
|
}
|
|
305
305
|
get host() { return getElement(this); }
|
|
306
306
|
static get watchers() { return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"z-popover.entry.js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],"sources":["src/components/z-popover/styles.css?tag=z-popover&encapsulation=shadow","src/components/z-popover/index.tsx"],"sourcesContent":[":host {\n --z-popover-theme--surface: var(--color-surface01);\n --z-popover-theme--text: var(--color-text01);\n --z-popover-padding: 0;\n --z-popover-shadow-filter: drop-shadow(0 1px 2px var(--shadow-color-base));\n\n position: relative;\n display: none;\n min-width: calc(var(--space-unit) * 8);\n min-height: calc(var(--space-unit) * 4);\n align-items: center;\n justify-content: center;\n padding: var(--z-popover-padding);\n background: var(--z-popover-theme--surface);\n border-radius: var(--border-radius-small);\n color: var(--z-popover-theme--text);\n fill: currentcolor;\n filter: var(--z-popover-shadow-filter);\n font-family: var(--font-family-sans);\n text-align: center;\n}\n\n:host([open][current-position]),\n:host([open=\"true\"][current-position]) {\n display: flex;\n}\n\n:host([center][current-position=\"top\"]),\n:host([center][current-position=\"bottom\"]) {\n transform: translateX(-50%);\n}\n\n:host([center][current-position=\"right\"]),\n:host([center][current-position=\"left\"]) {\n transform: translateY(-50%);\n}\n\n:host([current-position^=\"top\"]) {\n margin: 0 0 var(--space-unit);\n}\n\n:host([current-position^=\"bottom\"]) {\n margin: var(--space-unit) 0 0;\n}\n\n:host([current-position^=\"left\"]) {\n margin: 0 var(--space-unit) 0 0;\n}\n\n:host([current-position^=\"right\"]) {\n margin: 0 0 0 var(--space-unit);\n}\n\n/* Arrow style */\n\n:host([current-position])::before {\n --arrow-size: 6px;\n --arrow-edge-offset: calc(100% - var(--space-unit) - (var(--arrow-size) / 2));\n --arrow-center-x-offset: calc(50% - (var(--arrow-size) / 2));\n --arrow-center-y-offset: calc(100% - (var(--arrow-size) / 2));\n\n position: absolute;\n display: block;\n width: var(--arrow-size);\n height: var(--arrow-size);\n background: var(--z-popover-theme--surface);\n content: \"\";\n transform: rotate(45deg);\n}\n\n:host([show-arrow=\"false\"])::before,\n:host(:not([show-arrow]))::before {\n display: none;\n}\n\n:host([current-position^=\"top\"])::before {\n top: var(--arrow-center-y-offset);\n}\n\n:host([current-position^=\"bottom\"])::before {\n bottom: var(--arrow-center-y-offset);\n}\n\n:host([current-position=\"top\"])::before,\n:host([current-position=\"bottom\"])::before {\n right: var(--arrow-edge-offset);\n}\n\n:host([current-position=\"right\"])::before,\n:host([current-position=\"left\"])::before {\n bottom: var(--arrow-edge-offset);\n}\n\n:host([current-position=\"right\"])::before {\n right: var(--arrow-center-y-offset);\n}\n\n:host([current-position=\"left\"])::before {\n left: var(--arrow-center-y-offset);\n}\n\n:host([current-position=\"top_right\"])::before,\n:host([current-position=\"bottom_right\"])::before {\n right: var(--arrow-edge-offset);\n}\n\n:host([current-position=\"top_left\"])::before,\n:host([current-position=\"bottom_left\"])::before {\n left: var(--arrow-edge-offset);\n}\n\n:host([current-position=\"right_top\"])::before,\n:host([current-position=\"left_top\"])::before {\n top: var(--arrow-edge-offset);\n}\n\n:host([current-position=\"right_top\"])::before,\n:host([current-position=\"right_bottom\"])::before {\n right: var(--arrow-center-y-offset);\n}\n\n:host([current-position=\"left_top\"])::before,\n:host([current-position=\"left_bottom\"])::before {\n left: var(--arrow-center-y-offset);\n}\n\n:host([current-position=\"right_bottom\"])::before,\n:host([current-position=\"left_bottom\"])::before {\n bottom: var(--arrow-edge-offset);\n}\n\n:host([center][current-position=\"top\"])::before,\n:host([center][current-position=\"bottom\"])::before {\n right: auto;\n left: var(--arrow-center-x-offset);\n}\n\n:host([center][current-position=\"right\"])::before,\n:host([center][current-position=\"left\"])::before {\n top: var(--arrow-center-x-offset);\n bottom: auto;\n}\n\n::slotted(*) {\n overflow: auto;\n flex: 1 auto;\n}\n","import {Component, Prop, h, Watch, Listen, Element, State, Event, EventEmitter} from \"@stencil/core\";\nimport {PopoverPosition, KeyboardCode} from \"../../beans\";\n\nconst DOCUMENT_ELEMENT = document.documentElement;\n\nfunction getParentElement(element: Element): ShadowRoot[\"host\"] {\n if ((element.parentNode as ShadowRoot).host) {\n return (element.parentNode as ShadowRoot).host;\n }\n\n return element.parentNode as Element;\n}\n\n/**\n * Find the closest scrollable parent of a node.\n *\n * @param {Element} element The node\n */\nfunction findScrollableParent(element: Element): Element {\n let parent = getParentElement(element);\n\n while (parent && parent !== DOCUMENT_ELEMENT) {\n const {overflow, overflowX, overflowY} = window.getComputedStyle(parent);\n if (overflow === \"hidden\" || overflowY === \"hidden\" || overflowX === \"hidden\") {\n return parent;\n }\n\n if (\n (parent.scrollHeight > parent.clientHeight && overflow !== \"visible\" && overflowY !== \"visible\") ||\n (parent.scrollWidth > parent.clientWidth && overflow !== \"visible\" && overflowX !== \"visible\")\n ) {\n return parent;\n }\n\n parent = getParentElement(parent);\n }\n\n return DOCUMENT_ELEMENT;\n}\n\n/**\n * Calculate computed offset.\n * It includes matrix transformations.\n * @param element The target element.\n * @param targetParentOffset The relative offset parent.\n * @return A client rect object.\n */\nfunction computeOffset(element: HTMLElement, targetParentOffset?: HTMLElement): Record<string, number> {\n const rect = element.getBoundingClientRect();\n const width = rect.width;\n const height = rect.height;\n\n let top = 0;\n let left = 0;\n let offsetParent = element;\n while (offsetParent && offsetParent != targetParentOffset) {\n left += offsetParent.offsetLeft;\n\n // document.body sometimes has offsetTop == 0 but still has an\n // offset because of children margins!\n if (offsetParent === document.body) {\n top += offsetParent.getBoundingClientRect().top + window.scrollY;\n } else {\n top += offsetParent.offsetTop;\n }\n\n if (window.DOMMatrix) {\n const style = window.getComputedStyle(offsetParent);\n const transform = style.transform || style.webkitTransform;\n const domMatrix = new DOMMatrix(transform);\n if (domMatrix) {\n left += domMatrix.m41;\n if (offsetParent !== document.body) {\n top += domMatrix.m42;\n }\n }\n }\n\n if (!offsetParent.offsetParent) {\n break;\n }\n\n offsetParent = offsetParent.offsetParent as HTMLElement;\n }\n\n let parentWidth: number;\n let parentHeight: number;\n if (offsetParent === document.body) {\n parentWidth = window.innerWidth;\n parentHeight = window.innerHeight;\n } else {\n parentWidth = offsetParent.offsetWidth;\n parentHeight = offsetParent.offsetHeight;\n }\n\n const right = parentWidth - left - rect.width;\n const bottom = parentHeight - top - rect.height;\n\n return {top, right, bottom, left, width, height};\n}\n\n/**\n * Popover component.\n *\n * @cssprop --z-popover-theme--surface - background color of the popover.\n * @cssprop --z-popover-theme--text - foreground color of the popover.\n * @cssprop --z-popover-padding - padding of the popover.\n * @cssprop --z-popover-shadow-filter - drop-shadow filter of the popover. Defaults to `drop-shadow(0 1px 2px var(--shadow-color-base))`.\n */\n@Component({\n tag: \"z-popover\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZPopover {\n /** Popover position. */\n @Prop({reflect: true})\n position: PopoverPosition = PopoverPosition.AUTO;\n\n /**\n * The open state of the popover.\n */\n @Prop({reflect: true, mutable: true})\n open = false;\n\n /**\n * The selector or the element bound with the popover.\n * If string css selector is provided make sure to use a valid selector.\n */\n @Prop()\n bindTo?: string | HTMLElement;\n\n /**\n * Whether to show popover's arrow.\n */\n @Prop({reflect: true})\n showArrow = false;\n\n /**\n * Whether to center the popup on the main side (according to \"position\").\n */\n @Prop({reflect: true})\n center = false;\n\n /**\n * If true, the popover can be closed by clicking outside of it or pressing the escape key.\n * Otherwise, it will be closed only programmatically (by setting `open` to `false`).\n */\n @Prop()\n closable = true;\n\n /**\n * The current position of the popover.\n */\n @State()\n currentPosition?: PopoverPosition;\n\n /**\n * Position change event.\n */\n @Event()\n positionChange: EventEmitter;\n\n /**\n * Open change event.\n */\n @Event()\n openChange: EventEmitter;\n\n @Element() host: HTMLZPopoverElement;\n\n private animationFrameRequestId?: number;\n\n @Listen(\"keyup\", {target: \"window\"})\n closePopoverWithKeyboard(e: KeyboardEvent): void {\n if (this.closable && e.key === KeyboardCode.ESC) {\n this.open = false;\n }\n }\n\n /**\n * Close the popover when clicking outside of its content.\n * Stop event propagation if the click was fired by popover's trigger element,\n * to prevent close and reopen glitches.\n * @param {MouseEvent} e\n */\n @Listen(\"click\", {target: \"body\", capture: true})\n handleOutsideClick(e: MouseEvent): void {\n if (!this.closable || !this.open) {\n return;\n }\n\n if (!e.composedPath().includes(this.host)) {\n const target = e.target as HTMLElement;\n const triggerElemClicked =\n this.bindTo instanceof HTMLElement ? this.bindTo.contains(target) : target.closest(this.bindTo);\n if (triggerElemClicked) {\n e.stopPropagation();\n }\n\n this.open = false;\n this.positionChange.emit({position: this.currentPosition});\n }\n }\n\n @Watch(\"position\")\n validatePosition(newValue: PopoverPosition): void {\n if (newValue && !Object.values(PopoverPosition).includes(newValue as PopoverPosition)) {\n this.position = PopoverPosition.AUTO;\n }\n\n this.currentPosition = this.position;\n this.positionChange.emit({position: this.currentPosition});\n }\n\n /**\n * Setup popover behaviors on opening.\n */\n @Watch(\"open\")\n onOpen(): void {\n cancelAnimationFrame(this.animationFrameRequestId);\n if (this.open) {\n const setPosition = (): void => {\n if (this.open) {\n this.setPosition();\n this.animationFrameRequestId = requestAnimationFrame(setPosition);\n }\n };\n\n setPosition();\n } else if (this.host.hasAttribute(\"current-position\")) {\n this.host.removeAttribute(\"current-position\");\n this.currentPosition = undefined;\n }\n\n this.openChange.emit({open: this.open});\n }\n\n disconnectedCallback(): void {\n cancelAnimationFrame(this.animationFrameRequestId);\n }\n\n /**\n * Set the position of the popover.\n */\n private setPosition(): void {\n let element: HTMLElement;\n if (typeof this.bindTo === \"string\") {\n element = this.host.ownerDocument.querySelector(this.bindTo) as HTMLElement;\n } else if (this.bindTo) {\n element = this.bindTo;\n } else {\n element = this.host.parentElement as HTMLElement;\n }\n\n if (!element) {\n return;\n }\n\n const scrollContainer = findScrollableParent(element) as HTMLElement;\n const scrollingBoundingRect = scrollContainer.getBoundingClientRect();\n const offsetContainer = this.host.offsetParent as HTMLElement;\n\n const relativeBoundingRect = offsetContainer\n ? computeOffset(offsetContainer, scrollContainer)\n : {top: 0, right: 0, bottom: 0, left: 0};\n const boundingRect = computeOffset(element, scrollContainer);\n\n const top = boundingRect.top - scrollContainer.scrollTop;\n const bottom = scrollingBoundingRect.height - (boundingRect.top + boundingRect.height) + scrollContainer.scrollTop;\n const left = boundingRect.left - scrollContainer.scrollLeft;\n const right = scrollingBoundingRect.width - (boundingRect.left + boundingRect.width) + scrollContainer.scrollLeft;\n\n const overflowBottom = Math.max(0, scrollingBoundingRect.top + scrollingBoundingRect.height - window.innerHeight);\n const overflowRight = Math.max(0, scrollingBoundingRect.left + scrollingBoundingRect.width - window.innerWidth);\n\n const availableTop = Math.min(top, top + scrollingBoundingRect.top);\n const availableBottom = Math.min(bottom, bottom - overflowBottom);\n const availableLeft = Math.min(left, left + scrollingBoundingRect.left);\n const availableRight = Math.min(right, right - overflowRight);\n\n const availableHeight = availableTop + availableBottom + boundingRect.height;\n const availableWidth = availableLeft + availableRight + boundingRect.width;\n\n let position = this.currentPosition;\n const positions: PopoverPosition[] = [];\n if (this.position === PopoverPosition.AUTO) {\n /**\n * The `AUTO` position tries to place the popover in the 'safest' area,\n * where there's more space available.\n */\n if (availableLeft / availableWidth > 0.6) {\n positions.push(PopoverPosition.LEFT);\n } else if (availableLeft / availableWidth < 0.4) {\n positions.push(PopoverPosition.RIGHT);\n }\n\n if (availableTop / availableHeight > 0.9) {\n positions.unshift(PopoverPosition.TOP);\n } else if (availableTop / availableHeight > 0.6) {\n positions.push(PopoverPosition.TOP);\n } else if (availableTop / availableHeight < 0.1) {\n positions.unshift(PopoverPosition.BOTTOM);\n } else {\n positions.push(PopoverPosition.BOTTOM);\n }\n\n position = positions.join(\"_\") as PopoverPosition;\n }\n\n const style = this.host.style;\n style.position = \"absolute\";\n\n const offsetTop = boundingRect.top - relativeBoundingRect.top;\n const offsetRight = boundingRect.right - relativeBoundingRect.right;\n const offsetBottom = boundingRect.bottom - relativeBoundingRect.bottom;\n const offsetLeft = boundingRect.left - relativeBoundingRect.left;\n const offsetModifier = this.center ? 0.5 : 0;\n const sizeModifier = this.center ? 0.5 : 0;\n\n if (position === PopoverPosition.TOP || position === PopoverPosition.TOP_RIGHT) {\n style.top = \"auto\";\n style.right = \"auto\";\n style.bottom = `${offsetBottom + boundingRect.height}px`;\n\n style.left = `${offsetLeft + boundingRect.width * offsetModifier}px`;\n style.maxHeight = `${availableTop}px`;\n if (position === PopoverPosition.TOP_RIGHT) {\n style.maxWidth = `${availableRight + boundingRect.width * sizeModifier}px`;\n }\n } else if (position === PopoverPosition.TOP_LEFT) {\n style.top = \"auto\";\n style.right = `${offsetRight + boundingRect.width * offsetModifier}px`;\n style.bottom = `${offsetBottom + boundingRect.height}px`;\n style.left = \"auto\";\n style.maxWidth = `${availableLeft}px`;\n style.maxHeight = `${availableTop}px`;\n } else if (position === PopoverPosition.BOTTOM || position === PopoverPosition.BOTTOM_RIGHT) {\n style.top = `${offsetTop + boundingRect.height}px`;\n style.right = \"auto\";\n style.bottom = \"auto\";\n style.left = `${offsetLeft + boundingRect.width * offsetModifier}px`;\n style.maxHeight = `${availableBottom}px`;\n if (position === PopoverPosition.BOTTOM_RIGHT) {\n style.maxWidth = `${availableRight + boundingRect.width * sizeModifier}px`;\n }\n } else if (position === PopoverPosition.BOTTOM_LEFT) {\n style.top = `${offsetTop + boundingRect.height}px`;\n style.right = `${offsetRight + boundingRect.width * offsetModifier}px`;\n style.bottom = \"auto\";\n style.left = \"auto\";\n style.maxWidth = `${availableLeft}px`;\n style.maxHeight = `${availableBottom}px`;\n } else if (position === PopoverPosition.RIGHT || position === PopoverPosition.RIGHT_BOTTOM) {\n style.top = `${offsetTop + boundingRect.height * offsetModifier}px`;\n style.right = \"auto\";\n style.bottom = \"auto\";\n style.left = `${offsetLeft + boundingRect.width}px`;\n style.maxWidth = `${availableRight}px`;\n style.maxHeight = `${availableBottom + boundingRect.height * sizeModifier}px`;\n } else if (position === PopoverPosition.RIGHT_TOP) {\n style.top = \"auto\";\n style.right = \"auto\";\n style.bottom = `${offsetBottom + boundingRect.height * offsetModifier}px`;\n style.left = `${offsetLeft + boundingRect.width}px`;\n style.maxWidth = `${availableRight}px`;\n style.maxHeight = `${availableTop + boundingRect.height * sizeModifier}px`;\n } else if (position === PopoverPosition.LEFT || position === PopoverPosition.LEFT_BOTTOM) {\n style.top = `${offsetTop + boundingRect.height * offsetModifier}px`;\n style.right = `${offsetRight + boundingRect.width}px`;\n style.bottom = \"auto\";\n style.left = \"auto\";\n style.maxWidth = `${availableLeft}px`;\n style.maxHeight = `${availableBottom + boundingRect.height * sizeModifier}px`;\n } else if (position === PopoverPosition.LEFT_TOP) {\n style.top = \"auto\";\n style.right = `${offsetRight + boundingRect.width}px`;\n style.bottom = `${offsetBottom + boundingRect.height * offsetModifier}px`;\n style.left = \"auto\";\n style.maxWidth = `${availableLeft}px`;\n style.maxHeight = `${availableTop + boundingRect.height * sizeModifier}px`;\n }\n\n this.currentPosition = position || this.position;\n this.host.setAttribute(\"current-position\", this.currentPosition);\n }\n\n componentWillLoad(): void {\n this.validatePosition(this.position);\n this.onOpen();\n }\n\n render(): HTMLSlotElement {\n return <slot></slot>;\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"z-popover.entry.js","mappings":";;;AAAA,MAAM,SAAS,GAAG,sxGAAsxG,CAAC;AACzyG,uBAAe,SAAS;;ACExB,MAAM,gBAAgB,GAAG,QAAQ,CAAC,eAAe,CAAC;AAElD,SAAS,gBAAgB,CAAC,OAAgB;IACxC,IAAK,OAAO,CAAC,UAAyB,CAAC,IAAI,EAAE;QAC3C,OAAQ,OAAO,CAAC,UAAyB,CAAC,IAAI,CAAC;KAChD;IAED,OAAO,OAAO,CAAC,UAAqB,CAAC;AACvC,CAAC;AAED;;;;;AAKA,SAAS,oBAAoB,CAAC,OAAgB;IAC5C,IAAI,MAAM,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAEvC,OAAO,MAAM,IAAI,MAAM,KAAK,gBAAgB,EAAE;QAC5C,MAAM,EAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAC,GAAG,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;QACzE,IAAI,QAAQ,KAAK,QAAQ,IAAI,SAAS,KAAK,QAAQ,IAAI,SAAS,KAAK,QAAQ,EAAE;YAC7E,OAAO,MAAM,CAAC;SACf;QAED,IACE,CA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G,YAAY,GAAG,YAAY,CAAC,MAAM,GAAG,cAAc,IAAI,CAAC;YAC1E,KAAK,CAAC,IAAI,GAAG,MAAM,CAAC;YACpB,KAAK,CAAC,QAAQ,GAAG,GAAG,aAAa,IAAI,CAAC;YACtC,KAAK,CAAC,SAAS,GAAG,GAAG,YAAY,GAAG,YAAY,CAAC,MAAM,GAAG,YAAY,IAAI,CAAC;SAC5E;QAED,IAAI,CAAC,eAAe,GAAG,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC;QACjD,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,kBAAkB,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;KAClE;IAED,iBAAiB;QACf,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACrC,IAAI,CAAC,MAAM,EAAE,CAAC;KACf;IAED,MAAM;QACJ,OAAO,8DAAa,CAAC;KACtB;;;;;;;;;;;","names":[],"sources":["src/components/z-popover/styles.css?tag=z-popover&encapsulation=shadow","src/components/z-popover/index.tsx"],"sourcesContent":[":host {\n --z-popover-theme--surface: var(--color-surface01);\n --z-popover-theme--text: var(--color-text01);\n --z-popover-padding: 0;\n --z-popover-shadow-filter: drop-shadow(0 1px 2px var(--shadow-color-base));\n\n position: relative;\n display: none;\n min-width: calc(var(--space-unit) * 8);\n min-height: calc(var(--space-unit) * 4);\n align-items: center;\n justify-content: center;\n padding: var(--z-popover-padding);\n background: var(--z-popover-theme--surface);\n border-radius: var(--border-radius-small);\n color: var(--z-popover-theme--text);\n fill: currentcolor;\n filter: var(--z-popover-shadow-filter);\n font-family: var(--font-family-sans);\n text-align: center;\n}\n\n:host([open][current-position]),\n:host([open=\"true\"][current-position]) {\n display: flex;\n}\n\n:host([center][current-position=\"top\"]),\n:host([center][current-position=\"bottom\"]) {\n transform: translateX(-50%);\n}\n\n:host([center][current-position=\"right\"]),\n:host([center][current-position=\"left\"]) {\n transform: translateY(-50%);\n}\n\n:host([current-position^=\"top\"]) {\n margin: 0 0 var(--space-unit);\n}\n\n:host([current-position^=\"bottom\"]) {\n margin: var(--space-unit) 0 0;\n}\n\n:host([current-position^=\"left\"]) {\n margin: 0 var(--space-unit) 0 0;\n}\n\n:host([current-position^=\"right\"]) {\n margin: 0 0 0 var(--space-unit);\n}\n\n/* Arrow style */\n\n:host([current-position])::before {\n --arrow-size: 6px;\n --arrow-edge-offset: calc(100% - var(--space-unit) - (var(--arrow-size) / 2));\n --arrow-center-x-offset: calc(50% - (var(--arrow-size) / 2));\n --arrow-center-y-offset: calc(100% - (var(--arrow-size) / 2));\n\n position: absolute;\n display: block;\n width: var(--arrow-size);\n height: var(--arrow-size);\n background: var(--z-popover-theme--surface);\n content: \"\";\n transform: rotate(45deg);\n}\n\n:host([show-arrow=\"false\"])::before,\n:host(:not([show-arrow]))::before {\n display: none;\n}\n\n:host([current-position^=\"top\"])::before {\n top: var(--arrow-center-y-offset);\n}\n\n:host([current-position^=\"bottom\"])::before {\n bottom: var(--arrow-center-y-offset);\n}\n\n:host([current-position=\"top\"])::before,\n:host([current-position=\"bottom\"])::before {\n right: var(--arrow-edge-offset);\n}\n\n:host([current-position=\"right\"])::before,\n:host([current-position=\"left\"])::before {\n bottom: var(--arrow-edge-offset);\n}\n\n:host([current-position=\"right\"])::before {\n right: var(--arrow-center-y-offset);\n}\n\n:host([current-position=\"left\"])::before {\n left: var(--arrow-center-y-offset);\n}\n\n:host([current-position=\"top_right\"])::before,\n:host([current-position=\"bottom_right\"])::before {\n right: var(--arrow-edge-offset);\n}\n\n:host([current-position=\"top_left\"])::before,\n:host([current-position=\"bottom_left\"])::before {\n left: var(--arrow-edge-offset);\n}\n\n:host([current-position=\"right_top\"])::before,\n:host([current-position=\"left_top\"])::before {\n top: var(--arrow-edge-offset);\n}\n\n:host([current-position=\"right_top\"])::before,\n:host([current-position=\"right_bottom\"])::before {\n right: var(--arrow-center-y-offset);\n}\n\n:host([current-position=\"left_top\"])::before,\n:host([current-position=\"left_bottom\"])::before {\n left: var(--arrow-center-y-offset);\n}\n\n:host([current-position=\"right_bottom\"])::before,\n:host([current-position=\"left_bottom\"])::before {\n bottom: var(--arrow-edge-offset);\n}\n\n:host([center][current-position=\"top\"])::before,\n:host([center][current-position=\"bottom\"])::before {\n right: auto;\n left: var(--arrow-center-x-offset);\n}\n\n:host([center][current-position=\"right\"])::before,\n:host([center][current-position=\"left\"])::before {\n top: var(--arrow-center-x-offset);\n bottom: auto;\n}\n\n::slotted(*) {\n overflow: auto;\n flex: 1 auto;\n}\n","import {Component, Prop, h, Watch, Listen, Element, State, Event, EventEmitter} from \"@stencil/core\";\nimport {PopoverPosition, KeyboardCode} from \"../../beans\";\n\nconst DOCUMENT_ELEMENT = document.documentElement;\n\nfunction getParentElement(element: Element): ShadowRoot[\"host\"] {\n if ((element.parentNode as ShadowRoot).host) {\n return (element.parentNode as ShadowRoot).host;\n }\n\n return element.parentNode as Element;\n}\n\n/**\n * Find the closest scrollable parent of a node.\n *\n * @param {Element} element The node\n */\nfunction findScrollableParent(element: Element): Element {\n let parent = getParentElement(element);\n\n while (parent && parent !== DOCUMENT_ELEMENT) {\n const {overflow, overflowX, overflowY} = window.getComputedStyle(parent);\n if (overflow === \"hidden\" || overflowY === \"hidden\" || overflowX === \"hidden\") {\n return parent;\n }\n\n if (\n (parent.scrollHeight > parent.clientHeight && overflow !== \"visible\" && overflowY !== \"visible\") ||\n (parent.scrollWidth > parent.clientWidth && overflow !== \"visible\" && overflowX !== \"visible\")\n ) {\n return parent;\n }\n\n parent = getParentElement(parent);\n }\n\n return DOCUMENT_ELEMENT;\n}\n\n/**\n * Calculate computed offset.\n * It includes matrix transformations.\n * @param element The target element.\n * @param targetParentOffset The relative offset parent.\n * @return A client rect object.\n */\nfunction computeOffset(element: HTMLElement, targetParentOffset?: HTMLElement): Record<string, number> {\n const rect = element.getBoundingClientRect();\n const width = rect.width;\n const height = rect.height;\n\n let top = 0;\n let left = 0;\n let offsetParent = element;\n while (offsetParent && offsetParent != targetParentOffset) {\n left += offsetParent.offsetLeft;\n\n // document.body sometimes has offsetTop == 0 but still has an\n // offset because of children margins!\n if (offsetParent === document.body) {\n top += offsetParent.getBoundingClientRect().top + window.scrollY;\n } else {\n top += offsetParent.offsetTop;\n }\n\n if (window.DOMMatrix) {\n const style = window.getComputedStyle(offsetParent);\n const transform = style.transform || style.webkitTransform;\n const domMatrix = new DOMMatrix(transform);\n if (domMatrix) {\n left += domMatrix.m41;\n if (offsetParent !== document.body) {\n top += domMatrix.m42;\n }\n }\n }\n\n if (!offsetParent.offsetParent) {\n break;\n }\n\n offsetParent = offsetParent.offsetParent as HTMLElement;\n }\n\n let parentWidth: number;\n let parentHeight: number;\n if (offsetParent === document.body) {\n parentWidth = window.innerWidth;\n parentHeight = window.innerHeight;\n } else {\n parentWidth = offsetParent.offsetWidth;\n parentHeight = offsetParent.offsetHeight;\n }\n\n const right = parentWidth - left - rect.width;\n const bottom = parentHeight - top - rect.height;\n\n return {top, right, bottom, left, width, height};\n}\n\n/**\n * Popover component.\n *\n * @cssprop --z-popover-theme--surface - background color of the popover.\n * @cssprop --z-popover-theme--text - foreground color of the popover.\n * @cssprop --z-popover-padding - padding of the popover.\n * @cssprop --z-popover-shadow-filter - drop-shadow filter of the popover. Defaults to `drop-shadow(0 1px 2px var(--shadow-color-base))`.\n */\n@Component({\n tag: \"z-popover\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZPopover {\n /** Popover position. */\n @Prop({reflect: true})\n position: PopoverPosition = PopoverPosition.AUTO;\n\n /**\n * The open state of the popover.\n */\n @Prop({reflect: true, mutable: true})\n open = false;\n\n /**\n * The selector or the element bound with the popover.\n */\n @Prop()\n bindTo?: string | HTMLElement;\n\n /**\n * Whether to show popover's arrow.\n */\n @Prop({reflect: true})\n showArrow = false;\n\n /**\n * Whether to center the popup on the main side (according to \"position\").\n */\n @Prop({reflect: true})\n center = false;\n\n /**\n * If true, the popover can be closed by clicking outside of it or pressing the escape key.\n * Otherwise, it will be closed only programmatically (by setting `open` to `false`).\n */\n @Prop()\n closable = true;\n\n /**\n * The current position of the popover.\n */\n @State()\n currentPosition?: PopoverPosition;\n\n /**\n * Position change event.\n */\n @Event()\n positionChange: EventEmitter;\n\n /**\n * Open change event.\n */\n @Event()\n openChange: EventEmitter;\n\n @Element() host: HTMLZPopoverElement;\n\n private animationFrameRequestId?: number;\n\n @Listen(\"keyup\", {target: \"window\"})\n closePopoverWithKeyboard(e: KeyboardEvent): void {\n if (this.closable && e.key === KeyboardCode.ESC) {\n this.open = false;\n }\n }\n\n /**\n * Close the popover when clicking outside of its content.\n * Stop event propagation if the click was fired by popover's trigger element,\n * to prevent close and reopen glitches.\n * @param {MouseEvent} e\n */\n @Listen(\"click\", {target: \"body\", capture: true})\n handleOutsideClick(e: MouseEvent): void {\n if (!this.closable || !this.open) {\n return;\n }\n\n if (!e.composedPath().includes(this.host)) {\n const target = e.target as HTMLElement;\n const triggerElemClicked =\n this.bindTo instanceof HTMLElement ? this.bindTo.contains(target) : target.closest(CSS.escape(this.bindTo));\n if (triggerElemClicked) {\n e.stopPropagation();\n }\n\n this.open = false;\n this.positionChange.emit({position: this.currentPosition});\n }\n }\n\n @Watch(\"position\")\n validatePosition(newValue: PopoverPosition): void {\n if (newValue && !Object.values(PopoverPosition).includes(newValue as PopoverPosition)) {\n this.position = PopoverPosition.AUTO;\n }\n\n this.currentPosition = this.position;\n this.positionChange.emit({position: this.currentPosition});\n }\n\n /**\n * Setup popover behaviors on opening.\n */\n @Watch(\"open\")\n onOpen(): void {\n cancelAnimationFrame(this.animationFrameRequestId);\n if (this.open) {\n const setPosition = (): void => {\n if (this.open) {\n this.setPosition();\n this.animationFrameRequestId = requestAnimationFrame(setPosition);\n }\n };\n\n setPosition();\n } else if (this.host.hasAttribute(\"current-position\")) {\n this.host.removeAttribute(\"current-position\");\n this.currentPosition = undefined;\n }\n\n this.openChange.emit({open: this.open});\n }\n\n disconnectedCallback(): void {\n cancelAnimationFrame(this.animationFrameRequestId);\n }\n\n /**\n * Set the position of the popover.\n */\n private setPosition(): void {\n let element: HTMLElement;\n if (typeof this.bindTo === \"string\") {\n element = this.host.ownerDocument.querySelector(CSS.escape(this.bindTo)) as HTMLElement;\n } else if (this.bindTo) {\n element = this.bindTo;\n } else {\n element = this.host.parentElement as HTMLElement;\n }\n\n if (!element) {\n return;\n }\n\n const scrollContainer = findScrollableParent(element) as HTMLElement;\n const scrollingBoundingRect = scrollContainer.getBoundingClientRect();\n const offsetContainer = this.host.offsetParent as HTMLElement;\n\n const relativeBoundingRect = offsetContainer\n ? computeOffset(offsetContainer, scrollContainer)\n : {top: 0, right: 0, bottom: 0, left: 0};\n const boundingRect = computeOffset(element, scrollContainer);\n\n const top = boundingRect.top - scrollContainer.scrollTop;\n const bottom = scrollingBoundingRect.height - (boundingRect.top + boundingRect.height) + scrollContainer.scrollTop;\n const left = boundingRect.left - scrollContainer.scrollLeft;\n const right = scrollingBoundingRect.width - (boundingRect.left + boundingRect.width) + scrollContainer.scrollLeft;\n\n const overflowBottom = Math.max(0, scrollingBoundingRect.top + scrollingBoundingRect.height - window.innerHeight);\n const overflowRight = Math.max(0, scrollingBoundingRect.left + scrollingBoundingRect.width - window.innerWidth);\n\n const availableTop = Math.min(top, top + scrollingBoundingRect.top);\n const availableBottom = Math.min(bottom, bottom - overflowBottom);\n const availableLeft = Math.min(left, left + scrollingBoundingRect.left);\n const availableRight = Math.min(right, right - overflowRight);\n\n const availableHeight = availableTop + availableBottom + boundingRect.height;\n const availableWidth = availableLeft + availableRight + boundingRect.width;\n\n let position = this.currentPosition;\n const positions: PopoverPosition[] = [];\n if (this.position === PopoverPosition.AUTO) {\n /**\n * The `AUTO` position tries to place the popover in the 'safest' area,\n * where there's more space available.\n */\n if (availableLeft / availableWidth > 0.6) {\n positions.push(PopoverPosition.LEFT);\n } else if (availableLeft / availableWidth < 0.4) {\n positions.push(PopoverPosition.RIGHT);\n }\n\n if (availableTop / availableHeight > 0.9) {\n positions.unshift(PopoverPosition.TOP);\n } else if (availableTop / availableHeight > 0.6) {\n positions.push(PopoverPosition.TOP);\n } else if (availableTop / availableHeight < 0.1) {\n positions.unshift(PopoverPosition.BOTTOM);\n } else {\n positions.push(PopoverPosition.BOTTOM);\n }\n\n position = positions.join(\"_\") as PopoverPosition;\n }\n\n const style = this.host.style;\n style.position = \"absolute\";\n\n const offsetTop = boundingRect.top - relativeBoundingRect.top;\n const offsetRight = boundingRect.right - relativeBoundingRect.right;\n const offsetBottom = boundingRect.bottom - relativeBoundingRect.bottom;\n const offsetLeft = boundingRect.left - relativeBoundingRect.left;\n const offsetModifier = this.center ? 0.5 : 0;\n const sizeModifier = this.center ? 0.5 : 0;\n\n if (position === PopoverPosition.TOP || position === PopoverPosition.TOP_RIGHT) {\n style.top = \"auto\";\n style.right = \"auto\";\n style.bottom = `${offsetBottom + boundingRect.height}px`;\n\n style.left = `${offsetLeft + boundingRect.width * offsetModifier}px`;\n style.maxHeight = `${availableTop}px`;\n if (position === PopoverPosition.TOP_RIGHT) {\n style.maxWidth = `${availableRight + boundingRect.width * sizeModifier}px`;\n }\n } else if (position === PopoverPosition.TOP_LEFT) {\n style.top = \"auto\";\n style.right = `${offsetRight + boundingRect.width * offsetModifier}px`;\n style.bottom = `${offsetBottom + boundingRect.height}px`;\n style.left = \"auto\";\n style.maxWidth = `${availableLeft}px`;\n style.maxHeight = `${availableTop}px`;\n } else if (position === PopoverPosition.BOTTOM || position === PopoverPosition.BOTTOM_RIGHT) {\n style.top = `${offsetTop + boundingRect.height}px`;\n style.right = \"auto\";\n style.bottom = \"auto\";\n style.left = `${offsetLeft + boundingRect.width * offsetModifier}px`;\n style.maxHeight = `${availableBottom}px`;\n if (position === PopoverPosition.BOTTOM_RIGHT) {\n style.maxWidth = `${availableRight + boundingRect.width * sizeModifier}px`;\n }\n } else if (position === PopoverPosition.BOTTOM_LEFT) {\n style.top = `${offsetTop + boundingRect.height}px`;\n style.right = `${offsetRight + boundingRect.width * offsetModifier}px`;\n style.bottom = \"auto\";\n style.left = \"auto\";\n style.maxWidth = `${availableLeft}px`;\n style.maxHeight = `${availableBottom}px`;\n } else if (position === PopoverPosition.RIGHT || position === PopoverPosition.RIGHT_BOTTOM) {\n style.top = `${offsetTop + boundingRect.height * offsetModifier}px`;\n style.right = \"auto\";\n style.bottom = \"auto\";\n style.left = `${offsetLeft + boundingRect.width}px`;\n style.maxWidth = `${availableRight}px`;\n style.maxHeight = `${availableBottom + boundingRect.height * sizeModifier}px`;\n } else if (position === PopoverPosition.RIGHT_TOP) {\n style.top = \"auto\";\n style.right = \"auto\";\n style.bottom = `${offsetBottom + boundingRect.height * offsetModifier}px`;\n style.left = `${offsetLeft + boundingRect.width}px`;\n style.maxWidth = `${availableRight}px`;\n style.maxHeight = `${availableTop + boundingRect.height * sizeModifier}px`;\n } else if (position === PopoverPosition.LEFT || position === PopoverPosition.LEFT_BOTTOM) {\n style.top = `${offsetTop + boundingRect.height * offsetModifier}px`;\n style.right = `${offsetRight + boundingRect.width}px`;\n style.bottom = \"auto\";\n style.left = \"auto\";\n style.maxWidth = `${availableLeft}px`;\n style.maxHeight = `${availableBottom + boundingRect.height * sizeModifier}px`;\n } else if (position === PopoverPosition.LEFT_TOP) {\n style.top = \"auto\";\n style.right = `${offsetRight + boundingRect.width}px`;\n style.bottom = `${offsetBottom + boundingRect.height * offsetModifier}px`;\n style.left = \"auto\";\n style.maxWidth = `${availableLeft}px`;\n style.maxHeight = `${availableTop + boundingRect.height * sizeModifier}px`;\n }\n\n this.currentPosition = position || this.position;\n this.host.setAttribute(\"current-position\", this.currentPosition);\n }\n\n componentWillLoad(): void {\n this.validatePosition(this.position);\n this.onOpen();\n }\n\n render(): HTMLSlotElement {\n return <slot></slot>;\n }\n}\n"],"version":3}
|
|
@@ -37,11 +37,10 @@ const ZTable = class {
|
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
disconnectedCallback() {
|
|
40
|
-
|
|
41
|
-
(_a = this.expandableMutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
40
|
+
this.expandableMutationObserver.disconnect();
|
|
42
41
|
}
|
|
43
42
|
render() {
|
|
44
|
-
return (h(Host, { key: '
|
|
43
|
+
return (h(Host, { key: '4c33beca2ea12f899450df4a244ea271ea30c018', expandable: this.expandable }, h("div", { key: 'e5f6e45535e0251091d58b9784cfbe0b9bfc8f7e', class: "table", role: "table" }, h("slot", { key: 'd244f077dd25df7f2189f5b5f4b6f89e69db4768' }))));
|
|
45
44
|
}
|
|
46
45
|
get host() { return getElement(this); }
|
|
47
46
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"z-table.entry.js","mappings":";;;;;;;;;;;AAAA,MAAM,SAAS,GAAG,2VAA2V,CAAC;AAC9W,qBAAe,SAAS;;MCeX,MAAM;;;wBAON,KAAK;0BAMH,KAAK;;IAEV,gBAAgB;QACtB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;KAC7E;;;;IAOD,iBAAiB;QACf,IAAI,CAAC,0BAA0B,GAAG,IAAI,gBAAgB,CAAC;YACrD,IAAI,CAAC,gBAAgB,EAAE,CAAC;SACzB,CAAC,CAAC;QACH,IAAI,CAAC,0BAA0B,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE;YACjD,SAAS,EAAE,IAAI;YACf,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,IAAI;YAChB,eAAe,EAAE,CAAC,YAAY,CAAC;YAC/B,iBAAiB,EAAE,KAAK;SACzB,CAAC,CAAC;KACJ;IAED,oBAAoB
|
|
1
|
+
{"file":"z-table.entry.js","mappings":";;;;;;;;;;;AAAA,MAAM,SAAS,GAAG,2VAA2V,CAAC;AAC9W,qBAAe,SAAS;;MCeX,MAAM;;;wBAON,KAAK;0BAMH,KAAK;;IAEV,gBAAgB;QACtB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;KAC7E;;;;IAOD,iBAAiB;QACf,IAAI,CAAC,0BAA0B,GAAG,IAAI,gBAAgB,CAAC;YACrD,IAAI,CAAC,gBAAgB,EAAE,CAAC;SACzB,CAAC,CAAC;QACH,IAAI,CAAC,0BAA0B,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE;YACjD,SAAS,EAAE,IAAI;YACf,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,IAAI;YAChB,eAAe,EAAE,CAAC,YAAY,CAAC;YAC/B,iBAAiB,EAAE,KAAK;SACzB,CAAC,CAAC;KACJ;IAED,oBAAoB;QAClB,IAAI,CAAC,0BAA0B,CAAC,UAAU,EAAE,CAAC;KAC9C;IAED,MAAM;QACJ,QACE,EAAC,IAAI,qDAAC,UAAU,EAAE,IAAI,CAAC,UAAU,IAC/B,4DACE,KAAK,EAAC,OAAO,EACb,IAAI,EAAC,OAAO,IAEZ,8DAAa,CACT,CACD,EACP;KACH;;;;;;;","names":[],"sources":["src/components/table/z-table/styles.css?tag=z-table&encapsulation=shadow","src/components/table/z-table/index.tsx"],"sourcesContent":[":host {\n --z-table--cells-padding: calc(var(--space-unit) * 2);\n\n position: relative;\n display: block;\n overflow: auto;\n max-width: 100%;\n box-sizing: border-box;\n background-color: var(--color-surface01);\n}\n\n:host([expandable]) {\n --z-table--expand-button-size: 40px;\n}\n\n:host([bordered]) {\n --z-table--cell-left-border: 1px solid var(--color-surface03);\n}\n\n.table {\n min-width: max-content;\n}\n","import {Component, Element, Host, Prop, State, h} from \"@stencil/core\";\nimport \"../z-thead/index\";\nimport \"../z-tbody/index\";\nimport \"../z-tr/index\";\nimport \"../z-tfoot/index\";\n\n/**\n * ZTable component.\n * @slot - Table content (`z-thead`, `z-tbody`, `z-tfoot`, `z-tr`).\n * @cssprop --z-table--cells-padding - Padding of the cells.\n */\n@Component({\n tag: \"z-table\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZTable {\n @Element() host: HTMLZTableElement;\n\n /**\n * Whether the table cells should show a border between them.\n */\n @Prop({reflect: true})\n bordered = false;\n\n /**\n * Whether the table contains some expandable rows.\n */\n @State()\n expandable = false;\n\n private updateExpandable(): void {\n this.expandable = this.host.querySelectorAll(\"z-tr[expandable]\").length > 0;\n }\n\n private expandableMutationObserver: MutationObserver;\n\n /**\n * Setup the table creating a mutation observer for the expandable attribute.\n */\n componentWillLoad(): void {\n this.expandableMutationObserver = new MutationObserver(() => {\n this.updateExpandable();\n });\n this.expandableMutationObserver.observe(this.host, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: [\"expandable\"],\n attributeOldValue: false,\n });\n }\n\n disconnectedCallback(): void {\n this.expandableMutationObserver.disconnect();\n }\n\n render(): HTMLZTableElement {\n return (\n <Host expandable={this.expandable}>\n <div\n class=\"table\"\n role=\"table\"\n >\n <slot></slot>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -19,8 +19,6 @@ export declare class ZFileUpload {
|
|
|
19
19
|
uploadBtnLabel?: string;
|
|
20
20
|
/** drag & drop button label */
|
|
21
21
|
dragAndDropLabel?: string;
|
|
22
|
-
/** uploaded files history rendering */
|
|
23
|
-
hasFileSection?: boolean;
|
|
24
22
|
/** List of files not allowed to be uploaded */
|
|
25
23
|
invalidFiles: Map<string, string[]>;
|
|
26
24
|
el: HTMLZFileUploadElement;
|
|
@@ -40,9 +38,6 @@ export declare class ZFileUpload {
|
|
|
40
38
|
private fileInputHandler;
|
|
41
39
|
/** get array of uploaded files */
|
|
42
40
|
getFiles(): Promise<File[]>;
|
|
43
|
-
/** remove file from the array */
|
|
44
|
-
removeFile(fileName: string): Promise<void>;
|
|
45
|
-
private removeFileHandler;
|
|
46
41
|
private getType;
|
|
47
42
|
private handleAccessibility;
|
|
48
43
|
private checkFiles;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { EventEmitter } from "../../../stencil-public-runtime";
|
|
2
2
|
import { ComboItem, ControlSize } from "../../../beans";
|
|
3
3
|
export declare class ZCombobox {
|
|
4
|
+
element: HTMLZComboboxElement;
|
|
4
5
|
/** input unique id */
|
|
5
6
|
inputid: string;
|
|
6
7
|
/** list items array */
|
|
@@ -40,17 +41,28 @@ export declare class ZCombobox {
|
|
|
40
41
|
searchValue: string;
|
|
41
42
|
selectedCounter: number;
|
|
42
43
|
renderItemsList: ComboItem[];
|
|
44
|
+
focusedItemId: string;
|
|
43
45
|
private itemsList;
|
|
44
46
|
private inputType;
|
|
45
47
|
watchItems(): void;
|
|
46
48
|
watchSearchValue(): void;
|
|
47
|
-
|
|
49
|
+
getFocusedItemHandler(e: CustomEvent): void;
|
|
48
50
|
/** Emitted when value is checked/unchecked. Returns id, items. */
|
|
49
51
|
comboboxChange: EventEmitter;
|
|
50
52
|
private emitComboboxChange;
|
|
51
53
|
constructor();
|
|
52
54
|
componentWillLoad(): void;
|
|
53
55
|
componentWillRender(): void;
|
|
56
|
+
private getControlToListSize;
|
|
57
|
+
private getItemId;
|
|
58
|
+
private getCheckboxClass;
|
|
59
|
+
private getCheckAllId;
|
|
60
|
+
private hasCheckAllDisabled;
|
|
61
|
+
private resetInputTabIndex;
|
|
62
|
+
private setInputTabIndex;
|
|
63
|
+
private handleSelectArrowsNavigation;
|
|
64
|
+
private handleHeaderKeyboardEvent;
|
|
65
|
+
private focusComboboxItem;
|
|
54
66
|
private updateRenderItemsList;
|
|
55
67
|
private resetRenderItemsList;
|
|
56
68
|
private filterItems;
|
|
@@ -65,6 +77,7 @@ export declare class ZCombobox {
|
|
|
65
77
|
private renderGroups;
|
|
66
78
|
private renderNoSearchResults;
|
|
67
79
|
private renderCloseButton;
|
|
80
|
+
private getComboboxA11yAttributes;
|
|
68
81
|
private renderSearchInput;
|
|
69
82
|
private renderCheckAll;
|
|
70
83
|
render(): HTMLDivElement;
|
|
@@ -62,6 +62,8 @@ export declare class ZInput {
|
|
|
62
62
|
pattern?: string;
|
|
63
63
|
/** Available sizes: `big`, `small` and `x-small`. Defaults to `big`. */
|
|
64
64
|
size?: ControlSize;
|
|
65
|
+
/** set tabindex to input tag (optional). Defaults to native behaviour. */
|
|
66
|
+
innerTabIndex?: number;
|
|
65
67
|
isTyping: boolean;
|
|
66
68
|
passwordHidden: boolean;
|
|
67
69
|
private timer;
|
|
@@ -82,10 +84,13 @@ export declare class ZInput {
|
|
|
82
84
|
/** Emitted on checkbox check/uncheck, returns id, checked, type, name, value, validity */
|
|
83
85
|
inputCheck: EventEmitter;
|
|
84
86
|
private emitInputCheck;
|
|
87
|
+
/** set parent aria-activedescendant on focus event, returns filterid */
|
|
88
|
+
ariaDescendantFocus: EventEmitter<string>;
|
|
85
89
|
private getValidity;
|
|
86
90
|
private getTextAttributes;
|
|
87
91
|
private getNumberAttributes;
|
|
88
92
|
private getPatternAttribute;
|
|
93
|
+
private getTabIndexAttribute;
|
|
89
94
|
private getRoleAttribute;
|
|
90
95
|
private getAriaAttrubutes;
|
|
91
96
|
private renderInputText;
|
|
@@ -627,18 +627,10 @@ export namespace Components {
|
|
|
627
627
|
* get array of uploaded files
|
|
628
628
|
*/
|
|
629
629
|
"getFiles": () => Promise<File[]>;
|
|
630
|
-
/**
|
|
631
|
-
* uploaded files history rendering
|
|
632
|
-
*/
|
|
633
|
-
"hasFileSection"?: boolean;
|
|
634
630
|
/**
|
|
635
631
|
* Title
|
|
636
632
|
*/
|
|
637
633
|
"mainTitle"?: string;
|
|
638
|
-
/**
|
|
639
|
-
* remove file from the array
|
|
640
|
-
*/
|
|
641
|
-
"removeFile": (fileName: string) => Promise<void>;
|
|
642
634
|
/**
|
|
643
635
|
* Prop indicating the file upload type - can be default or dragdrop
|
|
644
636
|
*/
|
|
@@ -745,6 +737,10 @@ export namespace Components {
|
|
|
745
737
|
* render icon (optional): available for text
|
|
746
738
|
*/
|
|
747
739
|
"icon"?: string;
|
|
740
|
+
/**
|
|
741
|
+
* set tabindex to input tag (optional). Defaults to native behaviour.
|
|
742
|
+
*/
|
|
743
|
+
"innerTabIndex"?: number;
|
|
748
744
|
/**
|
|
749
745
|
* get checked status
|
|
750
746
|
*/
|
|
@@ -936,6 +932,10 @@ export namespace Components {
|
|
|
936
932
|
* [optional] Sets expandable style to element.
|
|
937
933
|
*/
|
|
938
934
|
"expandableStyle"?: ExpandableListStyle;
|
|
935
|
+
/**
|
|
936
|
+
* set tabindex to Host tag (optional). Defaults to 0.
|
|
937
|
+
*/
|
|
938
|
+
"htmlTabindex"?: number | null;
|
|
939
939
|
/**
|
|
940
940
|
* [optional] List element id.
|
|
941
941
|
*/
|
|
@@ -1496,7 +1496,7 @@ export namespace Components {
|
|
|
1496
1496
|
*/
|
|
1497
1497
|
interface ZPopover {
|
|
1498
1498
|
/**
|
|
1499
|
-
* The selector or the element bound with the popover.
|
|
1499
|
+
* The selector or the element bound with the popover.
|
|
1500
1500
|
*/
|
|
1501
1501
|
"bindTo"?: string | HTMLElement;
|
|
1502
1502
|
/**
|
|
@@ -2545,6 +2545,7 @@ declare global {
|
|
|
2545
2545
|
"startTyping": any;
|
|
2546
2546
|
"stopTyping": any;
|
|
2547
2547
|
"inputCheck": any;
|
|
2548
|
+
"ariaDescendantFocus": string;
|
|
2548
2549
|
}
|
|
2549
2550
|
interface HTMLZInputElement extends Components.ZInput, HTMLStencilElement {
|
|
2550
2551
|
addEventListener<K extends keyof HTMLZInputElementEventMap>(type: K, listener: (this: HTMLZInputElement, ev: ZInputCustomEvent<HTMLZInputElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
@@ -4013,10 +4014,6 @@ declare namespace LocalJSX {
|
|
|
4013
4014
|
* Max file dimension in Megabyte
|
|
4014
4015
|
*/
|
|
4015
4016
|
"fileMaxSize"?: number;
|
|
4016
|
-
/**
|
|
4017
|
-
* uploaded files history rendering
|
|
4018
|
-
*/
|
|
4019
|
-
"hasFileSection"?: boolean;
|
|
4020
4017
|
/**
|
|
4021
4018
|
* Title
|
|
4022
4019
|
*/
|
|
@@ -4135,6 +4132,10 @@ declare namespace LocalJSX {
|
|
|
4135
4132
|
* render icon (optional): available for text
|
|
4136
4133
|
*/
|
|
4137
4134
|
"icon"?: string;
|
|
4135
|
+
/**
|
|
4136
|
+
* set tabindex to input tag (optional). Defaults to native behaviour.
|
|
4137
|
+
*/
|
|
4138
|
+
"innerTabIndex"?: number;
|
|
4138
4139
|
/**
|
|
4139
4140
|
* the input label
|
|
4140
4141
|
*/
|
|
@@ -4167,6 +4168,10 @@ declare namespace LocalJSX {
|
|
|
4167
4168
|
* the input name
|
|
4168
4169
|
*/
|
|
4169
4170
|
"name"?: string;
|
|
4171
|
+
/**
|
|
4172
|
+
* set parent aria-activedescendant on focus event, returns filterid
|
|
4173
|
+
*/
|
|
4174
|
+
"onAriaDescendantFocus"?: (event: ZInputCustomEvent<string>) => void;
|
|
4170
4175
|
/**
|
|
4171
4176
|
* Emitted on input value change, returns value, validity
|
|
4172
4177
|
*/
|
|
@@ -4342,6 +4347,10 @@ declare namespace LocalJSX {
|
|
|
4342
4347
|
* [optional] Sets expandable style to element.
|
|
4343
4348
|
*/
|
|
4344
4349
|
"expandableStyle"?: ExpandableListStyle;
|
|
4350
|
+
/**
|
|
4351
|
+
* set tabindex to Host tag (optional). Defaults to 0.
|
|
4352
|
+
*/
|
|
4353
|
+
"htmlTabindex"?: number | null;
|
|
4345
4354
|
/**
|
|
4346
4355
|
* [optional] List element id.
|
|
4347
4356
|
*/
|
|
@@ -4982,7 +4991,7 @@ declare namespace LocalJSX {
|
|
|
4982
4991
|
*/
|
|
4983
4992
|
interface ZPopover {
|
|
4984
4993
|
/**
|
|
4985
|
-
* The selector or the element bound with the popover.
|
|
4994
|
+
* The selector or the element bound with the popover.
|
|
4986
4995
|
*/
|
|
4987
4996
|
"bindTo"?: string | HTMLElement;
|
|
4988
4997
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as e,h as t,a,g as s}from"./p-10bb4f4b.js";import"./p-04fdb6fa.js";import"./p-2aa42d09.js";import"./p-f76d0247.js";import"./p-ac768eff.js";import"./p-955da62e.js";import"./p-025f494e.js";import"./p-2c886e8b.js";import"./p-88cf27cf.js";import"./p-c0bfa87d.js";const r=":host{--z-table--cells-padding:calc(var(--space-unit) * 2);position:relative;display:block;overflow:auto;max-width:100%;box-sizing:border-box;background-color:var(--color-surface01)}:host([expandable]){--z-table--expand-button-size:40px}:host([bordered]){--z-table--cell-left-border:1px solid var(--color-surface03)}.table{min-width:max-content}";const o=r;const i=class{constructor(t){e(this,t);this.bordered=false;this.expandable=false}updateExpandable(){this.expandable=this.host.querySelectorAll("z-tr[expandable]").length>0}componentWillLoad(){this.expandableMutationObserver=new MutationObserver((()=>{this.updateExpandable()}));this.expandableMutationObserver.observe(this.host,{childList:true,subtree:true,attributes:true,attributeFilter:["expandable"],attributeOldValue:false})}disconnectedCallback(){this.expandableMutationObserver.disconnect()}render(){return t(a,{key:"4c33beca2ea12f899450df4a244ea271ea30c018",expandable:this.expandable},t("div",{key:"e5f6e45535e0251091d58b9784cfbe0b9bfc8f7e",class:"table",role:"table"},t("slot",{key:"d244f077dd25df7f2189f5b5f4b6f89e69db4768"})))}get host(){return s(this)}};i.style=o;export{i as z_table};
|
|
2
|
+
//# sourceMappingURL=p-158b6dda.entry.js.map
|