@zanichelli/albe-web-components 12.3.1-RC → 12.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/z-chip.cjs.entry.js +1 -1
- package/dist/cjs/z-dragdrop-area_2.cjs.entry.js +1 -1
- package/dist/cjs/z-file-upload.cjs.entry.js +5 -5
- package/dist/cjs/z-select.cjs.entry.js +3 -3
- package/dist/collection/components/buttons/z-chip/index.js +1 -1
- package/dist/collection/components/file-upload/z-dragdrop-area/styles.css +1 -0
- package/dist/collection/components/file-upload/z-file-upload/index.js +4 -4
- package/dist/collection/components/file-upload/z-file-upload/styles.css +11 -0
- package/dist/collection/components/inputs/z-select/index.js +2 -2
- package/dist/collection/components/inputs/z-select/styles.css +43 -5
- package/dist/esm/z-chip.entry.js +1 -1
- package/dist/esm/z-dragdrop-area_2.entry.js +1 -1
- package/dist/esm/z-file-upload.entry.js +5 -5
- package/dist/esm/z-select.entry.js +3 -3
- package/dist/types/beans/index.d.ts +1 -0
- package/dist/web-components-library/p-5c63b09c.entry.js +1 -0
- package/dist/web-components-library/p-5d19e5ef.entry.js +1 -0
- package/dist/web-components-library/p-8053b752.entry.js +1 -0
- package/dist/web-components-library/p-dc854830.entry.js +1 -0
- package/dist/web-components-library/web-components-library.esm.js +1 -1
- package/package.json +1 -1
- package/www/build/p-5c63b09c.entry.js +1 -0
- package/www/build/p-5d19e5ef.entry.js +1 -0
- package/www/build/p-8053b752.entry.js +1 -0
- package/www/build/{p-92d5fd28.js → p-8c5fa7fd.js} +1 -1
- package/www/build/p-dc854830.entry.js +1 -0
- package/www/build/web-components-library.esm.js +1 -1
- package/www/index.html +1 -1
- package/CHANGELOG.md +0 -2865
- package/dist/web-components-library/p-07d0e902.entry.js +0 -1
- package/dist/web-components-library/p-51bfa8ba.entry.js +0 -1
- package/dist/web-components-library/p-7c5ddeb0.entry.js +0 -1
- package/dist/web-components-library/p-bbd6cbca.entry.js +0 -1
- package/src-react/index.ts +0 -1
- package/www/build/p-07d0e902.entry.js +0 -1
- package/www/build/p-51bfa8ba.entry.js +0 -1
- package/www/build/p-7c5ddeb0.entry.js +0 -1
- package/www/build/p-bbd6cbca.entry.js +0 -1
|
@@ -23,7 +23,7 @@ const ZChip = class {
|
|
|
23
23
|
"z-chip-container": true,
|
|
24
24
|
"z-chip-interactive": !!this.interactiveIcon,
|
|
25
25
|
[this.type]: true,
|
|
26
|
-
}, "aria-disabled": this.disabled }, this.icon && index.h("z-icon", { name: this.icon }), index.h("slot", null), this.interactiveIcon && (index.h("button", { type: "button", onClick: () => this.interactiveIconClick.emit(),
|
|
26
|
+
}, "aria-disabled": this.disabled }, this.icon && index.h("z-icon", { name: this.icon }), index.h("slot", null), this.interactiveIcon && (index.h("button", { type: "button", onClick: () => this.interactiveIconClick.emit(), "aria-label": this.ariaLabel, disabled: this.disabled }, index.h("z-icon", { class: "interactive-icon", name: this.interactiveIcon })))));
|
|
27
27
|
}
|
|
28
28
|
get el() { return index.getElement(this); }
|
|
29
29
|
};
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-195ca522.js');
|
|
6
6
|
const index$1 = require('./index-cf9497bc.js');
|
|
7
7
|
|
|
8
|
-
const stylesCss$1 = ":host{font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>.dragdrop{position:relative;display:flex;height:228px;flex-direction:column;border-color:var(--color-surface04);background-color:var(--color-surface02);background-image:url(\"data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='2' ry='2' stroke='%23CACCCEFF' stroke-width='2' stroke-dasharray='15%2c 10%2c 14%2c 11' stroke-dashoffset='3' stroke-linecap='square'/%3e%3c/svg%3e\");border-radius:2px;color:var(--color-text01)}:host>.dragdrop.dragover *{pointer-events:none}:host>.dragdrop .dragover-container{position:absolute;z-index:10;top:0;left:0;display:none;width:100%;height:100%;background-color:var(--color-primary03);box-shadow:var(--shadow-focus-primary)}:host>.dragdrop .dragover-container .dragover-message{padding:10px 28px;background-color:var(--color-link-primary);color:var(--color-text04)}:host>.dragdrop.dragover .dragover-container{display:flex;align-items:center;justify-content:center}";
|
|
8
|
+
const stylesCss$1 = ":host{font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>.dragdrop{position:relative;display:flex;height:228px;flex-direction:column;padding:calc(var(--space-unit) * 2);border-color:var(--color-surface04);background-color:var(--color-surface02);background-image:url(\"data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='2' ry='2' stroke='%23CACCCEFF' stroke-width='2' stroke-dasharray='15%2c 10%2c 14%2c 11' stroke-dashoffset='3' stroke-linecap='square'/%3e%3c/svg%3e\");border-radius:2px;color:var(--color-text01)}:host>.dragdrop.dragover *{pointer-events:none}:host>.dragdrop .dragover-container{position:absolute;z-index:10;top:0;left:0;display:none;width:100%;height:100%;background-color:var(--color-primary03);box-shadow:var(--shadow-focus-primary)}:host>.dragdrop .dragover-container .dragover-message{padding:10px 28px;background-color:var(--color-link-primary);color:var(--color-text04)}:host>.dragdrop.dragover .dragover-container{display:flex;align-items:center;justify-content:center}";
|
|
9
9
|
|
|
10
10
|
const ZDragdropArea = class {
|
|
11
11
|
constructor(hostRef) {
|
|
@@ -7,7 +7,7 @@ const index$1 = require('./index-cf9497bc.js');
|
|
|
7
7
|
const utils = require('./utils-ee86db4f.js');
|
|
8
8
|
require('./breakpoints-ebe1a437.js');
|
|
9
9
|
|
|
10
|
-
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}: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}}";
|
|
10
|
+
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)}}";
|
|
11
11
|
|
|
12
12
|
const ZFileUpload = class {
|
|
13
13
|
constructor(hostRef) {
|
|
@@ -79,7 +79,7 @@ const ZFileUpload = class {
|
|
|
79
79
|
}
|
|
80
80
|
checkFiles(files) {
|
|
81
81
|
const errors = new Map();
|
|
82
|
-
const sizeErrorString = `supera
|
|
82
|
+
const sizeErrorString = `supera il limite di ${this.fileMaxSize}MB`;
|
|
83
83
|
const formatErrorString = " ha un'estensione non prevista";
|
|
84
84
|
files.forEach((file) => {
|
|
85
85
|
const fileSize = file.size / 1024 / 1024;
|
|
@@ -171,8 +171,8 @@ const ZFileUpload = class {
|
|
|
171
171
|
}
|
|
172
172
|
formatErrorString(key, value) {
|
|
173
173
|
var _a, _b;
|
|
174
|
-
const bothErrors = value[0] && value[1] ? ", " : "";
|
|
175
|
-
return `Il file ${key} ${(_a = value[0]) !== null && _a !== void 0 ? _a : ""}${bothErrors}
|
|
174
|
+
const bothErrors = value[0] && value[1] ? ", ed " : "";
|
|
175
|
+
return `Il file ${key} ${(_a = value[0]) !== null && _a !== void 0 ? _a : ""}${bothErrors}${(_b = value[1]) !== null && _b !== void 0 ? _b : ""}.`;
|
|
176
176
|
}
|
|
177
177
|
handleErrorModalContent() {
|
|
178
178
|
return (index.h("div", { slot: "modalContent" }, index.h("div", { class: "modal-wrapper" }, index.h("div", { class: "files" }, Array.from(this.invalidFiles).map(([key, value]) => {
|
|
@@ -180,7 +180,7 @@ const ZFileUpload = class {
|
|
|
180
180
|
})))));
|
|
181
181
|
}
|
|
182
182
|
render() {
|
|
183
|
-
return (index.h(index.Host, null, index.h("div", { tabIndex: 0, class: `container ${this.getType()}` }, this.mainTitle && this.renderTitle(), this.getType() == index$1.ZFileUploadType.DEFAULT ? this.renderDefaultMode() : this.renderDragDropMode()), !!this.invalidFiles.size && (index.h("z-modal", { tabIndex: 0, ref: (val) => (this.errorModal = val), modaltitle: "Attenzione", onModalClose: () => (this.invalidFiles = new Map()), onModalBackgroundClick: () => (this.invalidFiles = new Map()) }, this.handleErrorModalContent()))));
|
|
183
|
+
return (index.h(index.Host, null, index.h("div", { tabIndex: 0, class: `container ${this.getType()}` }, this.mainTitle && this.renderTitle(), this.getType() == index$1.ZFileUploadType.DEFAULT ? this.renderDefaultMode() : this.renderDragDropMode()), !!this.invalidFiles.size && (index.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()))));
|
|
184
184
|
}
|
|
185
185
|
get el() { return index.getElement(this); }
|
|
186
186
|
};
|
|
@@ -7,7 +7,7 @@ const index$1 = require('./index-cf9497bc.js');
|
|
|
7
7
|
const utils = require('./utils-ee86db4f.js');
|
|
8
8
|
require('./breakpoints-ebe1a437.js');
|
|
9
9
|
|
|
10
|
-
const stylesCss = ".sc-z-select-h{display:inline-block;width:inherit;color:var(--color-text02);font-family:var(--font-family-sans);font-size:var(--font-size-3);font-weight:var(--font-rg)}[size=\"small\"].sc-z-select-h,[size=\"x-small\"].sc-z-select-h{font-size:var(--font-size-2)}.select-wrapper.sc-z-select>z-input.sc-z-select{width:100%}.select-wrapper.sc-z-select>div.sc-z-select{position:relative}.select-wrapper.sc-z-select>div.closed.sc-z-select{overflow:hidden;height:0}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select{position:absolute;width:100%;box-sizing:border-box;padding:calc(var(--space-unit) * 0.5) var(--space-unit);border:var(--border-size-small) solid var(--gray200);border-top:none;background:var(--color-surface01);outline:none}.select-wrapper.sc-z-select .closed.sc-z-select .ul-scroll-wrapper.sc-z-select{z-index:10}.select-wrapper.sc-z-select .open.sc-z-select .ul-scroll-wrapper.sc-z-select{z-index:20}.select-wrapper.sc-z-select .ul-scroll-wrapper.fixed.sc-z-select{position:static}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select{position:relative;overflow:auto;max-height:240px;padding:calc(var(--space-unit) * 0.5);outline:none;scrollbar-color:var(--color-primary01) transparent}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select::-webkit-scrollbar{width:10px;background:linear-gradient(to right, transparent 0 3px, var(--gray200) 3px 7px, transparent 7px 10px);border-radius:var(--border-radius)}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select::-webkit-scrollbar-track{background-color:transparent}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select::-webkit-scrollbar-thumb{width:10px;background-color:var(--color-primary01);border-radius:var(--border-radius)}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select::-webkit-scrollbar-thumb:hover{background-color:var(--color-hover-primary)}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select .list-element-content.sc-z-select{display:block;padding:calc(var(--space-unit) * 0.5) calc(var(--space-unit) *
|
|
10
|
+
const stylesCss = ".sc-z-select-h{display:inline-block;width:inherit;color:var(--color-text02);font-family:var(--font-family-sans);font-size:var(--font-size-3);font-weight:var(--font-rg)}[size=\"small\"].sc-z-select-h,[size=\"x-small\"].sc-z-select-h{font-size:var(--font-size-2)}.select-wrapper.sc-z-select>z-input.sc-z-select{width:100%}.select-wrapper.sc-z-select>div.sc-z-select{position:relative}.select-wrapper.sc-z-select>div.closed.sc-z-select{overflow:hidden;height:0}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select{position:absolute;width:100%;box-sizing:border-box;padding:calc(var(--space-unit) * 0.5) var(--space-unit);border:var(--border-size-small) solid var(--gray200);border-top:none;background:var(--color-surface01);outline:none}.select-wrapper.sc-z-select .closed.sc-z-select .ul-scroll-wrapper.sc-z-select{z-index:10}.select-wrapper.sc-z-select .open.sc-z-select .ul-scroll-wrapper.sc-z-select{z-index:20}.select-wrapper.sc-z-select .ul-scroll-wrapper.fixed.sc-z-select{position:static}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select{position:relative;overflow:auto;max-height:240px;padding:calc(var(--space-unit) * 0.5);outline:none;scrollbar-color:var(--color-primary01) transparent}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select::-webkit-scrollbar{width:10px;background:linear-gradient(to right, transparent 0 3px, var(--gray200) 3px 7px, transparent 7px 10px);border-radius:var(--border-radius)}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select::-webkit-scrollbar-track{background-color:transparent}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select::-webkit-scrollbar-thumb{width:10px;background-color:var(--color-primary01);border-radius:var(--border-radius)}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select::-webkit-scrollbar-thumb:hover{background-color:var(--color-hover-primary)}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select .list-element-container.sc-z-select{display:flex;align-items:center;padding-left:calc(var(--space-unit) * 1.5)}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select .list-element-container.sc-z-select .list-element-content.sc-z-select{display:block;padding:calc(var(--space-unit) * 0.5) 0}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select .list-element-container.sc-z-select>z-icon.sc-z-select+.list-element-content.sc-z-select{display:block;padding:calc(var(--space-unit) * 0.5) var(--space-unit)}[size=\"x-small\"].sc-z-select-h .select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select .list-element-container.sc-z-select .list-element-content.sc-z-select{padding:0}[size=\"small\"].sc-z-select-h .select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select .list-element-container.sc-z-select>z-icon.sc-z-select{--z-icon-width:16px;--z-icon-height:16px}[size=\"x-small\"].sc-z-select-h .select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select .list-element-container.sc-z-select>z-icon.sc-z-select{--z-icon-width:14px;--z-icon-height:14px}[size=\"x-small\"].sc-z-select-h .select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select .list-element-container.sc-z-select>z-icon.sc-z-select+.list-element-content.sc-z-select{padding:0 var(--space-unit)}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select .list-element-container.sc-z-select .list-element-content.selected.sc-z-select{font-weight:bold}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select .no-results.sc-z-select z-icon.sc-z-select{margin-right:var(--space-unit)}.z-list-group-title.sc-z-select{color:var(--gray800)}.reset-item.sc-z-select{color:var(--color-primary01);fill:var(--color-primary01)}.reset-item-content.sc-z-select{display:flex;align-items:center}.reset-item.reset-item-margin.sc-z-select .reset-item-content.sc-z-select{margin-left:calc(var(--space-unit))}.reset-item.sc-z-select .reset-item-content.sc-z-select>z-icon.sc-z-select{margin-right:var(--space-unit)}.reset-item.hide.sc-z-select{display:none}";
|
|
11
11
|
|
|
12
12
|
const ZSelect = class {
|
|
13
13
|
constructor(hostRef) {
|
|
@@ -275,10 +275,10 @@ const ZSelect = class {
|
|
|
275
275
|
}, onKeyDown: (e) => this.arrowsSelectNav(e, 0) }, index.h("div", { class: "reset-item-content" }, index.h("z-icon", { name: "multiply-circled" }), index.h("span", null, this.resetItem))));
|
|
276
276
|
}
|
|
277
277
|
renderItem(item, key, lastItem) {
|
|
278
|
-
return (index.h("z-list-element", { clickable: !item.disabled, disabled: item.disabled, dividerType: lastItem ? index$1.ListDividerType.HEADER : index$1.ListDividerType.ELEMENT, role: "option", tabindex: item.disabled || !this.isOpen ? -1 : 0, "aria-selected": item.selected ? "true" : "false", id: `${this.htmlid}_${key}`, size: this.listSizeType(), onClickItem: () => this.selectItem(item, true), onKeyDown: (e) => this.arrowsSelectNav(e, key) }, index.h("span", { class: {
|
|
278
|
+
return (index.h("z-list-element", { clickable: !item.disabled, disabled: item.disabled, dividerType: lastItem ? index$1.ListDividerType.HEADER : index$1.ListDividerType.ELEMENT, role: "option", tabindex: item.disabled || !this.isOpen ? -1 : 0, "aria-selected": item.selected ? "true" : "false", id: `${this.htmlid}_${key}`, size: this.listSizeType(), onClickItem: () => this.selectItem(item, true), onKeyDown: (e) => this.arrowsSelectNav(e, key) }, index.h("div", { class: "list-element-container" }, item.icon && index.h("z-icon", { name: item.icon }), index.h("span", { class: {
|
|
279
279
|
"selected": !!item.selected,
|
|
280
280
|
"list-element-content": true,
|
|
281
|
-
}, innerHTML: item.name })));
|
|
281
|
+
}, innerHTML: item.name }))));
|
|
282
282
|
}
|
|
283
283
|
listSizeType() {
|
|
284
284
|
if (this.size === index$1.ControlSize.SMALL || this.size === index$1.ControlSize.X_SMALL) {
|
|
@@ -14,7 +14,7 @@ export class ZChip {
|
|
|
14
14
|
"z-chip-container": true,
|
|
15
15
|
"z-chip-interactive": !!this.interactiveIcon,
|
|
16
16
|
[this.type]: true,
|
|
17
|
-
}, "aria-disabled": this.disabled }, this.icon && h("z-icon", { name: this.icon }), h("slot", null), this.interactiveIcon && (h("button", { type: "button", onClick: () => this.interactiveIconClick.emit(),
|
|
17
|
+
}, "aria-disabled": this.disabled }, this.icon && h("z-icon", { name: this.icon }), h("slot", null), this.interactiveIcon && (h("button", { type: "button", onClick: () => this.interactiveIconClick.emit(), "aria-label": this.ariaLabel, disabled: this.disabled }, h("z-icon", { class: "interactive-icon", name: this.interactiveIcon })))));
|
|
18
18
|
}
|
|
19
19
|
static get is() { return "z-chip"; }
|
|
20
20
|
static get encapsulation() { return "scoped"; }
|
|
@@ -69,7 +69,7 @@ export class ZFileUpload {
|
|
|
69
69
|
}
|
|
70
70
|
checkFiles(files) {
|
|
71
71
|
const errors = new Map();
|
|
72
|
-
const sizeErrorString = `supera
|
|
72
|
+
const sizeErrorString = `supera il limite di ${this.fileMaxSize}MB`;
|
|
73
73
|
const formatErrorString = " ha un'estensione non prevista";
|
|
74
74
|
files.forEach((file) => {
|
|
75
75
|
const fileSize = file.size / 1024 / 1024;
|
|
@@ -161,8 +161,8 @@ export class ZFileUpload {
|
|
|
161
161
|
}
|
|
162
162
|
formatErrorString(key, value) {
|
|
163
163
|
var _a, _b;
|
|
164
|
-
const bothErrors = value[0] && value[1] ? ", " : "";
|
|
165
|
-
return `Il file ${key} ${(_a = value[0]) !== null && _a !== void 0 ? _a : ""}${bothErrors}
|
|
164
|
+
const bothErrors = value[0] && value[1] ? ", ed " : "";
|
|
165
|
+
return `Il file ${key} ${(_a = value[0]) !== null && _a !== void 0 ? _a : ""}${bothErrors}${(_b = value[1]) !== null && _b !== void 0 ? _b : ""}.`;
|
|
166
166
|
}
|
|
167
167
|
handleErrorModalContent() {
|
|
168
168
|
return (h("div", { slot: "modalContent" }, h("div", { class: "modal-wrapper" }, h("div", { class: "files" }, Array.from(this.invalidFiles).map(([key, value]) => {
|
|
@@ -170,7 +170,7 @@ export class ZFileUpload {
|
|
|
170
170
|
})))));
|
|
171
171
|
}
|
|
172
172
|
render() {
|
|
173
|
-
return (h(Host, null, h("div", { tabIndex: 0, class: `container ${this.getType()}` }, this.mainTitle && this.renderTitle(), this.getType() == ZFileUploadType.DEFAULT ? this.renderDefaultMode() : this.renderDragDropMode()), !!this.invalidFiles.size && (h("z-modal", { tabIndex: 0, ref: (val) => (this.errorModal = val), modaltitle: "Attenzione", onModalClose: () => (this.invalidFiles = new Map()), onModalBackgroundClick: () => (this.invalidFiles = new Map()) }, this.handleErrorModalContent()))));
|
|
173
|
+
return (h(Host, null, h("div", { 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()))));
|
|
174
174
|
}
|
|
175
175
|
static get is() { return "z-file-upload"; }
|
|
176
176
|
static get encapsulation() { return "shadow"; }
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
display: flex;
|
|
14
14
|
align-items: center;
|
|
15
15
|
justify-content: center;
|
|
16
|
+
padding: calc(var(--space-unit) * 2);
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
:host .modal-wrapper > .files-wrapper {
|
|
@@ -94,4 +95,14 @@ input#file-elem {
|
|
|
94
95
|
:host > .container > z-button {
|
|
95
96
|
align-self: flex-start;
|
|
96
97
|
}
|
|
98
|
+
|
|
99
|
+
:host .modal-wrapper {
|
|
100
|
+
padding: calc(var(--space-unit) * 3);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@media only screen and (min-width: 1152px) {
|
|
105
|
+
:host .modal-wrapper {
|
|
106
|
+
padding: calc(var(--space-unit) * 4);
|
|
107
|
+
}
|
|
97
108
|
}
|
|
@@ -264,10 +264,10 @@ export class ZSelect {
|
|
|
264
264
|
}, onKeyDown: (e) => this.arrowsSelectNav(e, 0) }, h("div", { class: "reset-item-content" }, h("z-icon", { name: "multiply-circled" }), h("span", null, this.resetItem))));
|
|
265
265
|
}
|
|
266
266
|
renderItem(item, key, lastItem) {
|
|
267
|
-
return (h("z-list-element", { clickable: !item.disabled, disabled: item.disabled, dividerType: lastItem ? ListDividerType.HEADER : ListDividerType.ELEMENT, role: "option", tabindex: item.disabled || !this.isOpen ? -1 : 0, "aria-selected": item.selected ? "true" : "false", id: `${this.htmlid}_${key}`, size: this.listSizeType(), onClickItem: () => this.selectItem(item, true), onKeyDown: (e) => this.arrowsSelectNav(e, key) }, h("span", { class: {
|
|
267
|
+
return (h("z-list-element", { clickable: !item.disabled, disabled: item.disabled, dividerType: lastItem ? ListDividerType.HEADER : ListDividerType.ELEMENT, role: "option", tabindex: item.disabled || !this.isOpen ? -1 : 0, "aria-selected": item.selected ? "true" : "false", id: `${this.htmlid}_${key}`, size: this.listSizeType(), onClickItem: () => this.selectItem(item, true), onKeyDown: (e) => this.arrowsSelectNav(e, key) }, h("div", { class: "list-element-container" }, item.icon && h("z-icon", { name: item.icon }), h("span", { class: {
|
|
268
268
|
"selected": !!item.selected,
|
|
269
269
|
"list-element-content": true,
|
|
270
|
-
}, innerHTML: item.name })));
|
|
270
|
+
}, innerHTML: item.name }))));
|
|
271
271
|
}
|
|
272
272
|
listSizeType() {
|
|
273
273
|
if (this.size === ControlSize.SMALL || this.size === ControlSize.X_SMALL) {
|
|
@@ -79,16 +79,54 @@
|
|
|
79
79
|
background-color: var(--color-hover-primary);
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
.select-wrapper .ul-scroll-wrapper z-list z-list-element .list-element-
|
|
82
|
+
.select-wrapper .ul-scroll-wrapper z-list z-list-element .list-element-container {
|
|
83
|
+
display: flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
padding-left: calc(var(--space-unit) * 1.5);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.select-wrapper .ul-scroll-wrapper z-list z-list-element .list-element-container .list-element-content {
|
|
89
|
+
display: block;
|
|
90
|
+
padding: calc(var(--space-unit) * 0.5) 0;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.select-wrapper .ul-scroll-wrapper z-list z-list-element .list-element-container > z-icon + .list-element-content {
|
|
83
94
|
display: block;
|
|
84
|
-
padding: calc(var(--space-unit) * 0.5)
|
|
95
|
+
padding: calc(var(--space-unit) * 0.5) var(--space-unit);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
:host([size="x-small"])
|
|
99
|
+
.select-wrapper
|
|
100
|
+
.ul-scroll-wrapper
|
|
101
|
+
z-list
|
|
102
|
+
z-list-element
|
|
103
|
+
.list-element-container
|
|
104
|
+
.list-element-content {
|
|
105
|
+
padding: 0;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
:host([size="small"]) .select-wrapper .ul-scroll-wrapper z-list z-list-element .list-element-container > z-icon {
|
|
109
|
+
--z-icon-width: 16px;
|
|
110
|
+
--z-icon-height: 16px;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
:host([size="x-small"]) .select-wrapper .ul-scroll-wrapper z-list z-list-element .list-element-container > z-icon {
|
|
114
|
+
--z-icon-width: 14px;
|
|
115
|
+
--z-icon-height: 14px;
|
|
85
116
|
}
|
|
86
117
|
|
|
87
|
-
:host([size="x-small"])
|
|
88
|
-
|
|
118
|
+
:host([size="x-small"])
|
|
119
|
+
.select-wrapper
|
|
120
|
+
.ul-scroll-wrapper
|
|
121
|
+
z-list
|
|
122
|
+
z-list-element
|
|
123
|
+
.list-element-container
|
|
124
|
+
> z-icon
|
|
125
|
+
+ .list-element-content {
|
|
126
|
+
padding: 0 var(--space-unit);
|
|
89
127
|
}
|
|
90
128
|
|
|
91
|
-
.select-wrapper .ul-scroll-wrapper z-list z-list-element .list-element-content.selected {
|
|
129
|
+
.select-wrapper .ul-scroll-wrapper z-list z-list-element .list-element-container .list-element-content.selected {
|
|
92
130
|
font-weight: bold;
|
|
93
131
|
}
|
|
94
132
|
|
package/dist/esm/z-chip.entry.js
CHANGED
|
@@ -19,7 +19,7 @@ const ZChip = class {
|
|
|
19
19
|
"z-chip-container": true,
|
|
20
20
|
"z-chip-interactive": !!this.interactiveIcon,
|
|
21
21
|
[this.type]: true,
|
|
22
|
-
}, "aria-disabled": this.disabled }, this.icon && h("z-icon", { name: this.icon }), h("slot", null), this.interactiveIcon && (h("button", { type: "button", onClick: () => this.interactiveIconClick.emit(),
|
|
22
|
+
}, "aria-disabled": this.disabled }, this.icon && h("z-icon", { name: this.icon }), h("slot", null), this.interactiveIcon && (h("button", { type: "button", onClick: () => this.interactiveIconClick.emit(), "aria-label": this.ariaLabel, disabled: this.disabled }, h("z-icon", { class: "interactive-icon", name: this.interactiveIcon })))));
|
|
23
23
|
}
|
|
24
24
|
get el() { return getElement(this); }
|
|
25
25
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-4968ce56.js';
|
|
2
2
|
import { g as KeyboardCode } from './index-47f23745.js';
|
|
3
3
|
|
|
4
|
-
const stylesCss$1 = ":host{font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>.dragdrop{position:relative;display:flex;height:228px;flex-direction:column;border-color:var(--color-surface04);background-color:var(--color-surface02);background-image:url(\"data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='2' ry='2' stroke='%23CACCCEFF' stroke-width='2' stroke-dasharray='15%2c 10%2c 14%2c 11' stroke-dashoffset='3' stroke-linecap='square'/%3e%3c/svg%3e\");border-radius:2px;color:var(--color-text01)}:host>.dragdrop.dragover *{pointer-events:none}:host>.dragdrop .dragover-container{position:absolute;z-index:10;top:0;left:0;display:none;width:100%;height:100%;background-color:var(--color-primary03);box-shadow:var(--shadow-focus-primary)}:host>.dragdrop .dragover-container .dragover-message{padding:10px 28px;background-color:var(--color-link-primary);color:var(--color-text04)}:host>.dragdrop.dragover .dragover-container{display:flex;align-items:center;justify-content:center}";
|
|
4
|
+
const stylesCss$1 = ":host{font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>.dragdrop{position:relative;display:flex;height:228px;flex-direction:column;padding:calc(var(--space-unit) * 2);border-color:var(--color-surface04);background-color:var(--color-surface02);background-image:url(\"data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='2' ry='2' stroke='%23CACCCEFF' stroke-width='2' stroke-dasharray='15%2c 10%2c 14%2c 11' stroke-dashoffset='3' stroke-linecap='square'/%3e%3c/svg%3e\");border-radius:2px;color:var(--color-text01)}:host>.dragdrop.dragover *{pointer-events:none}:host>.dragdrop .dragover-container{position:absolute;z-index:10;top:0;left:0;display:none;width:100%;height:100%;background-color:var(--color-primary03);box-shadow:var(--shadow-focus-primary)}:host>.dragdrop .dragover-container .dragover-message{padding:10px 28px;background-color:var(--color-link-primary);color:var(--color-text04)}:host>.dragdrop.dragover .dragover-container{display:flex;align-items:center;justify-content:center}";
|
|
5
5
|
|
|
6
6
|
const ZDragdropArea = class {
|
|
7
7
|
constructor(hostRef) {
|
|
@@ -3,7 +3,7 @@ import { w as ZFileUploadType, p as Device, D as DividerSize } from './index-47f
|
|
|
3
3
|
import { g as getDevice } from './utils-2a4ef29d.js';
|
|
4
4
|
import './breakpoints-9b81eb1b.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}: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}}";
|
|
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
|
|
|
8
8
|
const ZFileUpload = class {
|
|
9
9
|
constructor(hostRef) {
|
|
@@ -75,7 +75,7 @@ const ZFileUpload = class {
|
|
|
75
75
|
}
|
|
76
76
|
checkFiles(files) {
|
|
77
77
|
const errors = new Map();
|
|
78
|
-
const sizeErrorString = `supera
|
|
78
|
+
const sizeErrorString = `supera il limite di ${this.fileMaxSize}MB`;
|
|
79
79
|
const formatErrorString = " ha un'estensione non prevista";
|
|
80
80
|
files.forEach((file) => {
|
|
81
81
|
const fileSize = file.size / 1024 / 1024;
|
|
@@ -167,8 +167,8 @@ const ZFileUpload = class {
|
|
|
167
167
|
}
|
|
168
168
|
formatErrorString(key, value) {
|
|
169
169
|
var _a, _b;
|
|
170
|
-
const bothErrors = value[0] && value[1] ? ", " : "";
|
|
171
|
-
return `Il file ${key} ${(_a = value[0]) !== null && _a !== void 0 ? _a : ""}${bothErrors}
|
|
170
|
+
const bothErrors = value[0] && value[1] ? ", ed " : "";
|
|
171
|
+
return `Il file ${key} ${(_a = value[0]) !== null && _a !== void 0 ? _a : ""}${bothErrors}${(_b = value[1]) !== null && _b !== void 0 ? _b : ""}.`;
|
|
172
172
|
}
|
|
173
173
|
handleErrorModalContent() {
|
|
174
174
|
return (h("div", { slot: "modalContent" }, h("div", { class: "modal-wrapper" }, h("div", { class: "files" }, Array.from(this.invalidFiles).map(([key, value]) => {
|
|
@@ -176,7 +176,7 @@ const ZFileUpload = class {
|
|
|
176
176
|
})))));
|
|
177
177
|
}
|
|
178
178
|
render() {
|
|
179
|
-
return (h(Host, null, h("div", { tabIndex: 0, class: `container ${this.getType()}` }, this.mainTitle && this.renderTitle(), this.getType() == ZFileUploadType.DEFAULT ? this.renderDefaultMode() : this.renderDragDropMode()), !!this.invalidFiles.size && (h("z-modal", { tabIndex: 0, ref: (val) => (this.errorModal = val), modaltitle: "Attenzione", onModalClose: () => (this.invalidFiles = new Map()), onModalBackgroundClick: () => (this.invalidFiles = new Map()) }, this.handleErrorModalContent()))));
|
|
179
|
+
return (h(Host, null, h("div", { 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()))));
|
|
180
180
|
}
|
|
181
181
|
get el() { return getElement(this); }
|
|
182
182
|
};
|
|
@@ -3,7 +3,7 @@ import { e as ControlSize, g as KeyboardCode, l as ListDividerType, i as ListSiz
|
|
|
3
3
|
import { r as randomId, b as boolean, d as getElementTree, a as handleKeyboardSubmit, e as getClickedElement } from './utils-2a4ef29d.js';
|
|
4
4
|
import './breakpoints-9b81eb1b.js';
|
|
5
5
|
|
|
6
|
-
const stylesCss = ".sc-z-select-h{display:inline-block;width:inherit;color:var(--color-text02);font-family:var(--font-family-sans);font-size:var(--font-size-3);font-weight:var(--font-rg)}[size=\"small\"].sc-z-select-h,[size=\"x-small\"].sc-z-select-h{font-size:var(--font-size-2)}.select-wrapper.sc-z-select>z-input.sc-z-select{width:100%}.select-wrapper.sc-z-select>div.sc-z-select{position:relative}.select-wrapper.sc-z-select>div.closed.sc-z-select{overflow:hidden;height:0}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select{position:absolute;width:100%;box-sizing:border-box;padding:calc(var(--space-unit) * 0.5) var(--space-unit);border:var(--border-size-small) solid var(--gray200);border-top:none;background:var(--color-surface01);outline:none}.select-wrapper.sc-z-select .closed.sc-z-select .ul-scroll-wrapper.sc-z-select{z-index:10}.select-wrapper.sc-z-select .open.sc-z-select .ul-scroll-wrapper.sc-z-select{z-index:20}.select-wrapper.sc-z-select .ul-scroll-wrapper.fixed.sc-z-select{position:static}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select{position:relative;overflow:auto;max-height:240px;padding:calc(var(--space-unit) * 0.5);outline:none;scrollbar-color:var(--color-primary01) transparent}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select::-webkit-scrollbar{width:10px;background:linear-gradient(to right, transparent 0 3px, var(--gray200) 3px 7px, transparent 7px 10px);border-radius:var(--border-radius)}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select::-webkit-scrollbar-track{background-color:transparent}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select::-webkit-scrollbar-thumb{width:10px;background-color:var(--color-primary01);border-radius:var(--border-radius)}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select::-webkit-scrollbar-thumb:hover{background-color:var(--color-hover-primary)}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select .list-element-content.sc-z-select{display:block;padding:calc(var(--space-unit) * 0.5) calc(var(--space-unit) *
|
|
6
|
+
const stylesCss = ".sc-z-select-h{display:inline-block;width:inherit;color:var(--color-text02);font-family:var(--font-family-sans);font-size:var(--font-size-3);font-weight:var(--font-rg)}[size=\"small\"].sc-z-select-h,[size=\"x-small\"].sc-z-select-h{font-size:var(--font-size-2)}.select-wrapper.sc-z-select>z-input.sc-z-select{width:100%}.select-wrapper.sc-z-select>div.sc-z-select{position:relative}.select-wrapper.sc-z-select>div.closed.sc-z-select{overflow:hidden;height:0}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select{position:absolute;width:100%;box-sizing:border-box;padding:calc(var(--space-unit) * 0.5) var(--space-unit);border:var(--border-size-small) solid var(--gray200);border-top:none;background:var(--color-surface01);outline:none}.select-wrapper.sc-z-select .closed.sc-z-select .ul-scroll-wrapper.sc-z-select{z-index:10}.select-wrapper.sc-z-select .open.sc-z-select .ul-scroll-wrapper.sc-z-select{z-index:20}.select-wrapper.sc-z-select .ul-scroll-wrapper.fixed.sc-z-select{position:static}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select{position:relative;overflow:auto;max-height:240px;padding:calc(var(--space-unit) * 0.5);outline:none;scrollbar-color:var(--color-primary01) transparent}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select::-webkit-scrollbar{width:10px;background:linear-gradient(to right, transparent 0 3px, var(--gray200) 3px 7px, transparent 7px 10px);border-radius:var(--border-radius)}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select::-webkit-scrollbar-track{background-color:transparent}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select::-webkit-scrollbar-thumb{width:10px;background-color:var(--color-primary01);border-radius:var(--border-radius)}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select::-webkit-scrollbar-thumb:hover{background-color:var(--color-hover-primary)}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select .list-element-container.sc-z-select{display:flex;align-items:center;padding-left:calc(var(--space-unit) * 1.5)}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select .list-element-container.sc-z-select .list-element-content.sc-z-select{display:block;padding:calc(var(--space-unit) * 0.5) 0}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select .list-element-container.sc-z-select>z-icon.sc-z-select+.list-element-content.sc-z-select{display:block;padding:calc(var(--space-unit) * 0.5) var(--space-unit)}[size=\"x-small\"].sc-z-select-h .select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select .list-element-container.sc-z-select .list-element-content.sc-z-select{padding:0}[size=\"small\"].sc-z-select-h .select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select .list-element-container.sc-z-select>z-icon.sc-z-select{--z-icon-width:16px;--z-icon-height:16px}[size=\"x-small\"].sc-z-select-h .select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select .list-element-container.sc-z-select>z-icon.sc-z-select{--z-icon-width:14px;--z-icon-height:14px}[size=\"x-small\"].sc-z-select-h .select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select .list-element-container.sc-z-select>z-icon.sc-z-select+.list-element-content.sc-z-select{padding:0 var(--space-unit)}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select .list-element-container.sc-z-select .list-element-content.selected.sc-z-select{font-weight:bold}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select .no-results.sc-z-select z-icon.sc-z-select{margin-right:var(--space-unit)}.z-list-group-title.sc-z-select{color:var(--gray800)}.reset-item.sc-z-select{color:var(--color-primary01);fill:var(--color-primary01)}.reset-item-content.sc-z-select{display:flex;align-items:center}.reset-item.reset-item-margin.sc-z-select .reset-item-content.sc-z-select{margin-left:calc(var(--space-unit))}.reset-item.sc-z-select .reset-item-content.sc-z-select>z-icon.sc-z-select{margin-right:var(--space-unit)}.reset-item.hide.sc-z-select{display:none}";
|
|
7
7
|
|
|
8
8
|
const ZSelect = class {
|
|
9
9
|
constructor(hostRef) {
|
|
@@ -271,10 +271,10 @@ const ZSelect = class {
|
|
|
271
271
|
}, onKeyDown: (e) => this.arrowsSelectNav(e, 0) }, h("div", { class: "reset-item-content" }, h("z-icon", { name: "multiply-circled" }), h("span", null, this.resetItem))));
|
|
272
272
|
}
|
|
273
273
|
renderItem(item, key, lastItem) {
|
|
274
|
-
return (h("z-list-element", { clickable: !item.disabled, disabled: item.disabled, dividerType: lastItem ? ListDividerType.HEADER : ListDividerType.ELEMENT, role: "option", tabindex: item.disabled || !this.isOpen ? -1 : 0, "aria-selected": item.selected ? "true" : "false", id: `${this.htmlid}_${key}`, size: this.listSizeType(), onClickItem: () => this.selectItem(item, true), onKeyDown: (e) => this.arrowsSelectNav(e, key) }, h("span", { class: {
|
|
274
|
+
return (h("z-list-element", { clickable: !item.disabled, disabled: item.disabled, dividerType: lastItem ? ListDividerType.HEADER : ListDividerType.ELEMENT, role: "option", tabindex: item.disabled || !this.isOpen ? -1 : 0, "aria-selected": item.selected ? "true" : "false", id: `${this.htmlid}_${key}`, size: this.listSizeType(), onClickItem: () => this.selectItem(item, true), onKeyDown: (e) => this.arrowsSelectNav(e, key) }, h("div", { class: "list-element-container" }, item.icon && h("z-icon", { name: item.icon }), h("span", { class: {
|
|
275
275
|
"selected": !!item.selected,
|
|
276
276
|
"list-element-content": true,
|
|
277
|
-
}, innerHTML: item.name })));
|
|
277
|
+
}, innerHTML: item.name }))));
|
|
278
278
|
}
|
|
279
279
|
listSizeType() {
|
|
280
280
|
if (this.size === ControlSize.SMALL || this.size === ControlSize.X_SMALL) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as o,h as i,g as e}from"./p-81006561.js";import{g as n}from"./p-f976f29f.js";const r=class{constructor(i){t(this,i),this.fileDropped=o(this,"fileDropped",7)}fileDroppedHandler(t){this.fileDropped.emit(t)}renderOnDragOverMessage(){return i("div",{class:"dragover-container"},i("div",{class:"dragover-message"},i("span",{class:"body-2-sb"},this.dragAndDropLabel)))}render(){return i("div",{tabIndex:0,ref:t=>this.dragDropContainer=t,class:"dragdrop",onDragOver:t=>{t.preventDefault(),this.dragDropContainer.classList.add("dragover")},onDragLeave:()=>{this.dragDropContainer.classList.remove("dragover")},onDrop:t=>{t.preventDefault(),t.dataTransfer.files.length&&(this.dragDropContainer.classList.remove("dragover"),this.fileDroppedHandler(t.dataTransfer.files))}},this.renderOnDragOverMessage(),i("slot",null))}};r.style=":host{font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>.dragdrop{position:relative;display:flex;height:228px;flex-direction:column;padding:calc(var(--space-unit) * 2);border-color:var(--color-surface04);background-color:var(--color-surface02);background-image:url(\"data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='2' ry='2' stroke='%23CACCCEFF' stroke-width='2' stroke-dasharray='15%2c 10%2c 14%2c 11' stroke-dashoffset='3' stroke-linecap='square'/%3e%3c/svg%3e\");border-radius:2px;color:var(--color-text01)}:host>.dragdrop.dragover *{pointer-events:none}:host>.dragdrop .dragover-container{position:absolute;z-index:10;top:0;left:0;display:none;width:100%;height:100%;background-color:var(--color-primary03);box-shadow:var(--shadow-focus-primary)}:host>.dragdrop .dragover-container .dragover-message{padding:10px 28px;background-color:var(--color-link-primary);color:var(--color-text04)}:host>.dragdrop.dragover .dragover-container{display:flex;align-items:center;justify-content:center}";var a=window.CustomEvent;function s(t,o){var i="on"+o.type.toLowerCase();return"function"==typeof t[i]&&t[i](o),t.dispatchEvent(o)}function d(t){for(;t;){if("dialog"===t.localName)return t;t=t.parentElement?t.parentElement:t.parentNode?t.parentNode.host:null}return null}function l(t){for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;t&&t.blur&&t!==document.body&&t.blur()}function c(t,o){for(var i=0;i<t.length;++i)if(t[i]===o)return!0;return!1}function h(t){return!(!t||!t.hasAttribute("method"))&&"dialog"===t.getAttribute("method").toLowerCase()}function u(t){var o=["button","input","keygen","select","textarea"].map((function(t){return t+":not([disabled])"}));o.push('[tabindex]:not([disabled]):not([tabindex=""])');var i=t.querySelector(o.join(", "));if(!i&&"attachShadow"in Element.prototype)for(var e=t.querySelectorAll("*"),n=0;n<e.length&&!(e[n].tagName&&e[n].shadowRoot&&(i=u(e[n].shadowRoot)));n++);return i}function m(t){return t.isConnected||document.body.contains(t)}function f(t){if(t.submitter)return t.submitter;var o=t.target;if(!(o instanceof HTMLFormElement))return null;var i=p.formSubmitter;if(!i){var e=t.target;i=("getRootNode"in e&&e.getRootNode()||document).activeElement}return i&&i.form===o?i:null}function v(t){if(!t.defaultPrevented){var o=t.target,i=p.imagemapUseValue,e=f(t);null===i&&e&&(i=e.value);var n=d(o);n&&"dialog"===(e&&e.getAttribute("formmethod")||o.getAttribute("method"))&&(t.preventDefault(),null!=i?n.close(i):n.close())}}function g(t){if(this.dialog_=t,this.replacedStyleTop_=!1,this.openAsModal_=!1,t.hasAttribute("role")||t.setAttribute("role","dialog"),t.show=this.show.bind(this),t.showModal=this.showModal.bind(this),t.close=this.close.bind(this),t.addEventListener("submit",v,!1),"returnValue"in t||(t.returnValue=""),"MutationObserver"in window)new MutationObserver(this.maybeHideModal.bind(this)).observe(t,{attributes:!0,attributeFilter:["open"]});else{var o,i=!1,e=function(){i?this.downgradeModal():this.maybeHideModal(),i=!1}.bind(this),n=function(n){if(n.target===t){var r="DOMNodeRemoved";i|=n.type.substr(0,r.length)===r,window.clearTimeout(o),o=window.setTimeout(e,0)}};["DOMAttrModified","DOMNodeRemoved","DOMNodeRemovedFromDocument"].forEach((function(o){t.addEventListener(o,n)}))}Object.defineProperty(t,"open",{set:this.setOpen.bind(this),get:t.hasAttribute.bind(t,"open")}),this.backdrop_=document.createElement("div"),this.backdrop_.className="backdrop",this.backdrop_.addEventListener("mouseup",this.backdropMouseEvent_.bind(this)),this.backdrop_.addEventListener("mousedown",this.backdropMouseEvent_.bind(this)),this.backdrop_.addEventListener("click",this.backdropMouseEvent_.bind(this))}a&&"object"!=typeof a||((a=function(t,o){o=o||{};var i=document.createEvent("CustomEvent");return i.initCustomEvent(t,!!o.bubbles,!!o.cancelable,o.detail||null),i}).prototype=window.Event.prototype),g.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute("open")&&m(this.dialog_)||this.downgradeModal()},downgradeModal:function(){this.openAsModal_&&(this.openAsModal_=!1,this.dialog_.style.zIndex="",this.replacedStyleTop_&&(this.dialog_.style.top="",this.replacedStyleTop_=!1),this.backdrop_.parentNode&&this.backdrop_.parentNode.removeChild(this.backdrop_),p.dm.removeDialog(this))},setOpen:function(t){t?this.dialog_.hasAttribute("open")||this.dialog_.setAttribute("open",""):(this.dialog_.removeAttribute("open"),this.maybeHideModal())},backdropMouseEvent_:function(t){if(this.dialog_.hasAttribute("tabindex"))this.dialog_.focus();else{var o=document.createElement("div");this.dialog_.insertBefore(o,this.dialog_.firstChild),o.tabIndex=-1,o.focus(),this.dialog_.removeChild(o)}var i=document.createEvent("MouseEvents");i.initMouseEvent(t.type,t.bubbles,t.cancelable,window,t.detail,t.screenX,t.screenY,t.clientX,t.clientY,t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget),this.dialog_.dispatchEvent(i),t.stopPropagation()},focus_:function(){var t=this.dialog_.querySelector("[autofocus]:not([disabled])");!t&&this.dialog_.tabIndex>=0&&(t=this.dialog_),t||(t=u(this.dialog_)),l(document.activeElement),t&&t.focus()},updateZIndex:function(t,o){if(t<o)throw new Error("dialogZ should never be < backdropZ");this.dialog_.style.zIndex=t,this.backdrop_.style.zIndex=o},show:function(){this.dialog_.open||(this.setOpen(!0),this.focus_())},showModal:function(){if(this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'showModal' on dialog: The element is already open, and therefore cannot be opened modally.");if(!m(this.dialog_))throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.");if(!p.dm.pushDialog(this))throw new Error("Failed to execute 'showModal' on dialog: There are too many open modal dialogs.");(function(t){for(;t&&t!==document.body;){var o=window.getComputedStyle(t),i=function(t,i){return!(void 0===o[t]||o[t]===i)};if(o.opacity<1||i("zIndex","auto")||i("transform","none")||i("mixBlendMode","normal")||i("filter","none")||i("perspective","none")||"isolate"===o.isolation||"fixed"===o.position||"touch"===o.webkitOverflowScrolling)return!0;t=t.parentElement}return!1})(this.dialog_.parentElement)&&console.warn("A dialog is being shown inside a stacking context. This may cause it to be unusable. For more information, see this link: https://github.com/GoogleChrome/dialog-polyfill/#stacking-context"),this.setOpen(!0),this.openAsModal_=!0,p.needsCentering(this.dialog_)?(p.reposition(this.dialog_),this.replacedStyleTop_=!0):this.replacedStyleTop_=!1,this.dialog_.parentNode.insertBefore(this.backdrop_,this.dialog_.nextSibling),this.focus_()},close:function(t){if(!this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'close' on dialog: The element does not have an 'open' attribute, and therefore cannot be closed.");this.setOpen(!1),void 0!==t&&(this.dialog_.returnValue=t);var o=new a("close",{bubbles:!1,cancelable:!1});s(this.dialog_,o)}};var p={reposition:function(t){var o=document.body.scrollTop||document.documentElement.scrollTop,i=o+(window.innerHeight-t.offsetHeight)/2;t.style.top=Math.max(o,i)+"px"},isInlinePositionSetByStylesheet:function(t){for(var o=0;o<document.styleSheets.length;++o){var i=document.styleSheets[o],e=null;try{e=i.cssRules}catch(t){}if(e)for(var n=0;n<e.length;++n){var r=e[n],a=null;try{a=document.querySelectorAll(r.selectorText)}catch(t){}if(a&&c(a,t)){var s=r.style.getPropertyValue("top"),d=r.style.getPropertyValue("bottom");if(s&&"auto"!==s||d&&"auto"!==d)return!0}}}return!1},needsCentering:function(t){return!("absolute"!==window.getComputedStyle(t).position||"auto"!==t.style.top&&""!==t.style.top||"auto"!==t.style.bottom&&""!==t.style.bottom||p.isInlinePositionSetByStylesheet(t))},forceRegisterDialog:function(t){if((window.HTMLDialogElement||t.showModal)&&console.warn("This browser already supports <dialog>, the polyfill may not work correctly",t),"dialog"!==t.localName)throw new Error("Failed to register dialog: The element is not a dialog.");new g(t)},registerDialog:function(t){t.showModal||p.forceRegisterDialog(t)},DialogManager:function(){this.pendingDialogStack=[];var t=this.checkDOM_.bind(this);this.overlay=document.createElement("div"),this.overlay.className="_dialog_overlay",this.overlay.addEventListener("click",function(o){this.forwardTab_=void 0,o.stopPropagation(),t([])}.bind(this)),this.handleKey_=this.handleKey_.bind(this),this.handleFocus_=this.handleFocus_.bind(this),this.zIndexLow_=1e5,this.zIndexHigh_=100150,this.forwardTab_=void 0,"MutationObserver"in window&&(this.mo_=new MutationObserver((function(o){var i=[];o.forEach((function(t){for(var o,e=0;o=t.removedNodes[e];++e)o instanceof Element&&("dialog"===o.localName&&i.push(o),i=i.concat(o.querySelectorAll("dialog")))})),i.length&&t(i)})))}};if(p.DialogManager.prototype.blockDocument=function(){document.documentElement.addEventListener("focus",this.handleFocus_,!0),document.addEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.observe(document,{childList:!0,subtree:!0})},p.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()},p.DialogManager.prototype.updateStacking=function(){for(var t,o=this.zIndexHigh_,i=0;t=this.pendingDialogStack[i];++i)t.updateZIndex(--o,--o),0===i&&(this.overlay.style.zIndex=--o);var e=this.pendingDialogStack[0];e?(e.dialog.parentNode||document.body).appendChild(this.overlay):this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)},p.DialogManager.prototype.containedByTopDialog_=function(t){for(;t=d(t);){for(var o,i=0;o=this.pendingDialogStack[i];++i)if(o.dialog===t)return 0===i;t=t.parentElement}return!1},p.DialogManager.prototype.handleFocus_=function(t){var o=t.composedPath?t.composedPath()[0]:t.target;if(!this.containedByTopDialog_(o)&&document.activeElement!==document.documentElement&&(t.preventDefault(),t.stopPropagation(),l(o),void 0!==this.forwardTab_)){var i=this.pendingDialogStack[0];return i.dialog.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?i.focus_():o!==document.documentElement&&document.documentElement.focus()),!1}},p.DialogManager.prototype.handleKey_=function(t){if(this.forwardTab_=void 0,27===t.keyCode){t.preventDefault(),t.stopPropagation();var o=new a("cancel",{bubbles:!1,cancelable:!0}),i=this.pendingDialogStack[0];i&&s(i.dialog,o)&&i.dialog.close()}else 9===t.keyCode&&(this.forwardTab_=!t.shiftKey)},p.DialogManager.prototype.checkDOM_=function(t){this.pendingDialogStack.slice().forEach((function(o){-1!==t.indexOf(o.dialog)?o.downgradeModal():o.maybeHideModal()}))},p.DialogManager.prototype.pushDialog=function(t){return!(this.pendingDialogStack.length>=(this.zIndexHigh_-this.zIndexLow_)/2-1||(1===this.pendingDialogStack.unshift(t)&&this.blockDocument(),this.updateStacking(),0))},p.DialogManager.prototype.removeDialog=function(t){var o=this.pendingDialogStack.indexOf(t);-1!==o&&(this.pendingDialogStack.splice(o,1),0===this.pendingDialogStack.length&&this.unblockDocument(),this.updateStacking())},p.dm=new p.DialogManager,p.formSubmitter=null,p.imagemapUseValue=null,void 0===window.HTMLDialogElement){var b=document.createElement("form");if(b.setAttribute("method","dialog"),"dialog"!==b.method){var w=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method");if(w){var y=w.get;w.get=function(){return h(this)?"dialog":y.call(this)};var x=w.set;w.set=function(t){return"string"==typeof t&&"dialog"===t.toLowerCase()?this.setAttribute("method",t):x.call(this,t)},Object.defineProperty(HTMLFormElement.prototype,"method",w)}}document.addEventListener("click",(function(t){if(p.formSubmitter=null,p.imagemapUseValue=null,!t.defaultPrevented){var o=t.target;if("composedPath"in t&&(o=t.composedPath().shift()||o),o&&h(o.form)){if(!("submit"===o.type&&["button","input"].indexOf(o.localName)>-1)){if("input"!==o.localName||"image"!==o.type)return;p.imagemapUseValue=t.offsetX+","+t.offsetY}d(o)&&(p.formSubmitter=o)}}}),!1),document.addEventListener("submit",(function(t){var o=t.target;if(!d(o)){var i=f(t);"dialog"===(i&&i.getAttribute("formmethod")||o.getAttribute("method"))&&t.preventDefault()}}));var k=HTMLFormElement.prototype.submit;HTMLFormElement.prototype.submit=function(){if(!h(this))return k.call(this);var t=d(this);t&&t.close()}}const M=':is(button, input, select, textarea, [contenteditable=""], [contenteditable="true"], a[href], [tabindex], summary):not([disabled], [disabled=""], [tabindex="-1"], [aria-hidden="true"], [hidden])',z=class{constructor(i){t(this,i),this.modalClose=o(this,"modalClose",7),this.modalHeaderActive=o(this,"modalHeaderActive",7),this.modalBackgroundClick=o(this,"modalBackgroundClick",7),this.closeButtonLabel="chiudi modale",this.alertdialog=!1,this.closable=!0,this.scrollInside=!0}emitModalClose(){this.closable&&this.modalClose.emit({modalid:this.modalid})}emitModalHeaderActive(){this.modalHeaderActive.emit({modalid:this.modalid})}emitBackgroundClick(){this.closable&&this.modalBackgroundClick.emit({modalid:this.modalid})}componentDidLoad(){"function"!=typeof HTMLDialogElement?(p.registerDialog(this.dialog),this.dialog.setAttribute("open","true")):this.open()}async open(){var t;null===(t=this.dialog)||void 0===t||t.showModal()}async close(){var t;this.closable&&(null===(t=this.dialog)||void 0===t||t.close())}get focusableElements(){return[...Array.from(this.host.shadowRoot.querySelectorAll(M)),...Array.from(this.host.querySelectorAll(M))].filter((t=>"none"!==getComputedStyle(t).display))}handleKeyDown(t){if(t.code!==n.TAB)return;const o=this.focusableElements,i=this.host.shadowRoot.activeElement,e=this.host.ownerDocument.activeElement,r=o[0],a=o[o.length-1];!t.shiftKey||i!=r&&e!=r?t.shiftKey||i!=a&&e!=a||(t.preventDefault(),r.focus()):(t.preventDefault(),a.focus())}closeButtonSlot(){if(this.closable)return i("slot",{name:"modalCloseButton"},i("button",{"aria-label":this.closeButtonLabel,onClick:()=>this.close()},i("z-icon",{name:"multiply-circle-filled"})))}handleEscape(t){this.closable||t.preventDefault()}render(){return i("dialog",{class:{"modal-dialog":!this.scrollInside},"aria-labelledby":"modal-title","aria-describedby":"modal-content",role:this.alertdialog?"alertdialog":void 0,ref:t=>this.dialog=t,onClose:()=>this.emitModalClose(),onCancel:t=>this.handleEscape(t)},i("div",{class:{"modal-container":!0,"modal-container-scroll-inside":this.scrollInside,"modal-container-scroll-outside":!this.scrollInside},id:this.modalid},i("header",{onClick:this.emitModalHeaderActive.bind(this)},i("div",null,this.modaltitle&&i("h1",{id:"modal-title"},this.modaltitle),this.closeButtonSlot()),this.modalsubtitle&&i("h2",{id:"modal-subtitle"},this.modalsubtitle)),i("div",{class:{"modal-content-scroll-inside":this.scrollInside,"modal-content-scroll-outside":!this.scrollInside},id:"modal-content"},i("slot",{name:"modalContent"}))),i("div",{class:{"modal-background":!0,"modal-background-scroll-outside":!this.scrollInside},"data-action":"modalBackground","data-modal":this.modalid,onClick:()=>{this.emitBackgroundClick(),this.close()}}))}get host(){return e(this)}};z.style=':host{font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>dialog{padding:0;border:none;margin:0;background-color:transparent}:host>dialog:modal{width:100%;max-width:100%;max-height:100%}:host>dialog::backdrop{display:none}:host>dialog+.backdrop{display:none}:host>dialog:not([open]){display:none}:host>dialog[open]{display:block}.modal-container{z-index:1010;display:flex;overflow:-moz-scrollbars-none;width:100%;height:100vh;flex-direction:column}.modal-container>.modal-content-scroll-outside{overflow:auto;background:var(--color-surface01)}.modal-container>header{padding:calc(var(--space-unit) * 2 - 2px) calc(var(--space-unit) * 2);background:var(--color-surface02)}.modal-container>header button{padding:0;border:none;margin:0;margin-left:auto;background:transparent;cursor:pointer}.modal-container>header z-icon{--z-icon-width:calc(var(--space-unit) * 2.5);--z-icon-height:calc(var(--space-unit) * 2.5);display:flex;fill:var(--color-icon01)}.modal-container>header>div{display:flex;width:100%;align-items:center;margin-right:calc(var(--space-unit) * 2)}.modal-container>header h1,.modal-container>header h2{padding:0;margin:0;color:var(--color-text01);font-weight:var(--font-rg)}.modal-container>header h1{font-size:var(--font-size-5);letter-spacing:0;line-height:1.4}.modal-container>header h2{font-size:var(--font-size-3);letter-spacing:0;line-height:1.5}.modal-container>header>div>h1 *:empty{display:none}.modal-container>header h1+h2{margin-top:calc(var(--space-unit) * 0.5)}.modal-container-scroll-inside>.modal-content-scroll-inside{overflow:hidden auto;flex:1 auto;background:var(--color-surface01)}.modal-container-scroll-inside>.modal-content-scroll-inside::-webkit-scrollbar,.modal-container-scroll-outside>.modal-content-scroll-outside::-webkit-scrollbar{width:10px;background:linear-gradient(to right, transparent 0 3px, var(--gray200) 3px 7px, transparent 7px 10px);border-radius:var(--border-radius)}.modal-container-scroll-inside>.modal-content-scroll-inside::-webkit-scrollbar-thumb,.modal-container-scroll-outside>.modal-content-scroll-outside::-webkit-scrollbar-thumb{width:10px;background-color:var(--color-primary01)}.modal-container-scroll-inside>.modal-content-scroll-inside::-webkit-scrollbar-thumb:hover,.modal-container-scroll-outside>.modal-content-scroll-outside::-webkit-scrollbar-thumb:hover{background-color:var(--color-hover-primary)}.modal-container-scroll-inside .modal-content-scroll-inside,.modal-container-scroll-outside .modal-content-scroll-outside{scrollbar-color:var(--color-primary01) transparent}@media only screen and (min-width: 768px){.modal-background{position:fixed;top:0;left:0;overflow:hidden;width:100vw;height:100vh;background-color:var(--gray900);opacity:0.7}.modal-background.modal-background-scroll-outside{position:sticky}.modal-container-scroll-inside{position:fixed;top:calc(var(--space-unit) * 6);left:50%;overflow:hidden;width:auto;min-width:calc(var(--space-unit) * 40);height:auto;min-height:calc(var(--space-unit) * 40);max-height:calc(100vh - calc(var(--space-unit) * 6 * 2));border-radius:var(--border-radius);transform:translateX(-50%)}.modal-container-scroll-outside{position:absolute;top:calc(var(--space-unit) * 6);left:50%;display:block;overflow:initial;width:auto;min-width:calc(var(--space-unit) * 40);height:auto;min-height:calc(var(--space-unit) * 40);max-height:calc(100vh - calc(var(--space-unit) * 6 * 2));transform:translateX(-50%)}.modal-container>.modal-content-scroll-outside{overflow:initial}.modal-container-scroll-outside>header,.modal-container-scroll-inside>header{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius)}.modal-container-scroll-outside::after{display:block;height:calc(var(--space-unit) * 6);content:" "}.modal-dialog{position:fixed;top:0;left:0;height:auto;overflow-x:hidden;overflow-y:auto}.modal-content-scroll-outside{border-bottom-left-radius:var(--border-radius);border-bottom-right-radius:var(--border-radius)}.modal-dialog::-webkit-scrollbar{display:none}.modal-container>header z-icon{--z-icon-width:calc(var(--space-unit) * 3);--z-icon-height:calc(var(--space-unit) * 3)}}@media only screen and (min-width: 768px) and (max-width: 1151px){.modal-container>header{padding:calc(var(--space-unit) * 3 - 2px) calc(var(--space-unit) * 3)}}@media only screen and (min-width: 1152px){.modal-container>header{padding:calc(var(--space-unit) * 4 - 4px) calc(var(--space-unit) * 4)}.modal-container>header h1{font-size:var(--font-size-6);letter-spacing:0;line-height:1.33}.modal-container>header h2{font-size:var(--font-size-4);letter-spacing:0;line-height:1.5}.modal-container>header h1+h2{margin-top:0}}';export{r as z_dragdrop_area,z as z_modal}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,c as t,h as s,g as i}from"./p-81006561.js";import{e as l,g as c,l as r,i as n}from"./p-f976f29f.js";import{r as a,b as o,d as h,a as p,e as z}from"./p-a01baa71.js";import"./p-b497e33e.js";const d=class{constructor(s){e(this,s),this.optionSelect=t(this,"optionSelect",7),this.resetSelect=t(this,"resetSelect",7),this.htmlid=`id-${a()}`,this.ariaLabel="",this.disabled=!1,this.readonly=!1,this.message=!0,this.autocomplete=!1,this.noresultslabel="Nessun risultato",this.isfixed=!1,this.size=l.BIG,this.isOpen=!1,this.selectedItem=null,this.itemsList=[],this.toggleSelectUl=this.toggleSelectUl.bind(this),this.selectItem=this.selectItem.bind(this),this.handleSelectFocus=this.handleSelectFocus.bind(this)}watchItems(){this.itemsList=this.getInitialItemsArray(),this.selectedItem=this.itemsList.find((e=>e.selected))}getFocusedItemHandler(e){this.focusedItemId=e.target.id}async getSelectedItem(){return this.selectedItem}async getValue(){return this.getSelectedValue()}async setValue(e){let t=[];"string"==typeof e?t.push(e):t=e,this.selectedItem=this.itemsList.find((e=>t.includes(e.id)))}emitOptionSelect(){this.optionSelect.emit({id:this.htmlid,selected:this.getSelectedValue()})}emitResetSelect(){this.resetSelect.emit({id:this.htmlid})}componentWillLoad(){this.watchItems()}componentWillRender(){this.filterItems(this.searchString)}getInitialItemsArray(){return"string"==typeof this.items?JSON.parse(this.items):this.items}mapSelectedItemToItemsArray(){return this.getInitialItemsArray().map((e=>{var t;return e.selected=e.id===(null===(t=this.selectedItem)||void 0===t?void 0:t.id),e}))}getSelectedValue(){var e;return null===(e=this.selectedItem)||void 0===e?void 0:e.id}filterItems(e){const t=this.mapSelectedItemToItemsArray();this.itemsList=(null==e?void 0:e.length)?t.filter((t=>t.name.toUpperCase().includes(e.toUpperCase()))).map((t=>{const s=t.name.toUpperCase().indexOf(e.toUpperCase()),i=s+e.length,l=t.name.substring(0,s)+`<strong>${t.name.substring(s,i)}</strong>`+t.name.substring(i,t.name.length);return t.name=l,t})):t}hasAutocomplete(){return!0===o(this.autocomplete)}handleInputChange(e){this.searchString=e.detail.value,this.isOpen||this.toggleSelectUl()}selectItem(e,t){e&&e.disabled||(this.itemsList=this.mapSelectedItemToItemsArray(),this.itemsList=this.itemsList.map((s=>(s.selected=!1,s.id===(null==e?void 0:e.id)&&(s.selected=t),s))),this.selectedItem=this.itemsList.find((e=>e.selected)),this.emitOptionSelect(),this.searchString&&(this.searchString=null))}arrowsSelectNav(e,t){const s=this.resetItem&&!!this.selectedItem;if(![c.ARROW_DOWN,c.ARROW_UP].includes(e.key))return;let i;e.preventDefault(),e.stopPropagation(),this.isOpen||this.toggleSelectUl(),this.resetItem&&(e.key===c.ARROW_DOWN?i=t+1===this.itemsList.length+1?+!s:t+1:e.key===c.ARROW_UP&&(i=t<=+!s?this.itemsList.length:t-1)),this.resetItem||(e.key===c.ARROW_DOWN?i=t+1===this.itemsList.length?0:t+1:e.key===c.ARROW_UP&&(i=t<=0?this.itemsList.length-1:t-1)),this.focusSelectItem(i)}focusSelectItem(e){const t=this.element.querySelector(`#${this.htmlid}_${e}`);t&&t.focus()}toggleSelectUl(e=!1){this.disabled||this.readonly||(this.isOpen?(document.removeEventListener("click",this.handleSelectFocus),document.removeEventListener("keyup",this.handleSelectFocus),e&&this.element.querySelector(`#${this.htmlid}_input`).focus()):(document.addEventListener("click",this.handleSelectFocus),document.addEventListener("keyup",this.handleSelectFocus)),this.focusedItemId="",this.isOpen=!this.isOpen)}handleInputClick(e){e.composedPath().find((e=>e.classList&&e.classList.contains("reset-icon")))?e.stopPropagation():this.toggleSelectUl()}handleSelectFocus(e){if(e instanceof KeyboardEvent&&e.key===c.ESC)return e.stopPropagation(),this.toggleSelectUl(!0);e instanceof KeyboardEvent&&e.key!==c.TAB&&e.key!==c.ENTER||h(z()).find((e=>"z-input"===e.nodeName.toLowerCase()&&e.id===`${this.htmlid}_input`))||this.toggleSelectUl(e instanceof MouseEvent)}scrollToLetter(e){const t=this.itemsList.find((t=>t.name.charAt(0)===e));t&&this.focusSelectItem(this.itemsList.indexOf(t))}renderInput(){return s("z-input",{class:{"active-select":this.isOpen,"cursor-select":!this.autocomplete},id:`${this.htmlid}_input`,htmlid:`${this.htmlid}_select_input`,placeholder:this.placeholder,value:!this.isOpen&&this.selectedItem?this.selectedItem.name.replace(/<[^>]+>/g,""):null,label:this.label,"aria-expanded":this.isOpen?"true":"false","aria-label":this.ariaLabel,"aria-controls":`${this.htmlid}_list`,"aria-autocomplete":this.hasAutocomplete()?"list":"none","aria-activedescendant":this.isOpen?this.focusedItemId:"",icon:this.isOpen?"caret-up":"caret-down",hasclearicon:this.hasAutocomplete(),message:!1,disabled:this.disabled,readonly:this.readonly||!this.hasAutocomplete()&&this.isOpen,status:this.isOpen?void 0:this.status,role:"combobox",size:this.size,onClick:e=>{this.handleInputClick(e)},onKeyUp:e=>{13!==e.keyCode&&e.preventDefault(),p(e,this.toggleSelectUl)},onKeyDown:e=>this.arrowsSelectNav(e,this.selectedItem?this.itemsList.indexOf(this.selectedItem):this.resetItem?0:-1),onInputChange:e=>{this.handleInputChange(e)},onKeyPress:e=>{this.hasAutocomplete()||(e.preventDefault(),this.scrollToLetter(String.fromCharCode(e.keyCode)))}})}renderSelectUl(){return s("div",{class:this.isOpen?"open":"closed",tabindex:"-1"},s("div",{class:{"ul-scroll-wrapper":!0,fixed:this.isfixed},tabindex:"-1"},s("z-list",{role:"listbox","aria-label":this.ariaLabel||this.label,tabindex:this.disabled||this.readonly||!this.isOpen?-1:0,id:`${this.htmlid}_list`,"aria-multiselectable":!1,size:this.listSizeType(),class:{disabled:this.disabled,readonly:this.readonly,filled:!!this.selectedItem,[`input-${this.status}`]:!this.isOpen&&!!this.status}},this.resetItem&&this.renderResetItem(),this.renderSelectUlItems())))}renderResetItem(){return s("z-list-element",{class:{hide:!this.selectedItem||!this.resetItem,"reset-item":!0,"reset-item-margin":!this.hasGroupItems},clickable:!0,disabled:!1,dividerType:r.ELEMENT,role:"option",tabindex:"0","aria-selected":"false",id:`${this.htmlid}_${this.resetItem?"0":"none"}`,size:this.listSizeType(),onClickItem:()=>{this.selectedItem=null,this.searchString=null,this.emitResetSelect()},onKeyDown:e=>this.arrowsSelectNav(e,0)},s("div",{class:"reset-item-content"},s("z-icon",{name:"multiply-circled"}),s("span",null,this.resetItem)))}renderItem(e,t,i){return s("z-list-element",{clickable:!e.disabled,disabled:e.disabled,dividerType:i?r.HEADER:r.ELEMENT,role:"option",tabindex:e.disabled||!this.isOpen?-1:0,"aria-selected":e.selected?"true":"false",id:`${this.htmlid}_${t}`,size:this.listSizeType(),onClickItem:()=>this.selectItem(e,!0),onKeyDown:e=>this.arrowsSelectNav(e,t)},s("div",{class:"list-element-container"},e.icon&&s("z-icon",{name:e.icon}),s("span",{class:{selected:!!e.selected,"list-element-content":!0},innerHTML:e.name})))}listSizeType(){return this.size===l.SMALL||this.size===l.X_SMALL?n.SMALL:n.MEDIUM}renderSelectUlItems(){return this.itemsList.length?this.hasGroupItems?this.renderSelectGroupItems():this.itemsList.map(((e,t,s)=>this.renderItem(e,this.resetItem?t+1:t,s.length===t+1))):this.renderNoSearchResults()}renderSelectGroupItems(){const e=this.itemsList.reduce(((e,t,s,i)=>{var l;const{category:c}=t,r=this.renderItem(t,this.resetItem?s+1:s,i.length===s+1);return e[c]=null!==(l=e[c])&&void 0!==l?l:[],e[c].push(r),e}),{});return Object.entries(e).map((([e,t])=>s("z-list-group",{"divider-type":r.ELEMENT},s("span",{class:"body-3-sb z-list-group-title",slot:"header-title"},e),t.map((e=>e)))))}renderNoSearchResults(){return s("z-list-element",{color:"blue500",class:"no-results",size:this.listSizeType()},s("z-icon",{name:"multiply-circle",fill:"blue500"}),this.noresultslabel)}renderMessage(){if(!1!==o(this.message))return s("z-input-message",{message:!0===o(this.message)?void 0:this.message,status:this.status,class:this.size})}render(){return s("div",{class:"select-wrapper"},this.renderInput(),this.renderSelectUl(),this.renderMessage())}get element(){return i(this)}static get watchers(){return{items:["watchItems"]}}};d.style='.sc-z-select-h{display:inline-block;width:inherit;color:var(--color-text02);font-family:var(--font-family-sans);font-size:var(--font-size-3);font-weight:var(--font-rg)}[size="small"].sc-z-select-h,[size="x-small"].sc-z-select-h{font-size:var(--font-size-2)}.select-wrapper.sc-z-select>z-input.sc-z-select{width:100%}.select-wrapper.sc-z-select>div.sc-z-select{position:relative}.select-wrapper.sc-z-select>div.closed.sc-z-select{overflow:hidden;height:0}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select{position:absolute;width:100%;box-sizing:border-box;padding:calc(var(--space-unit) * 0.5) var(--space-unit);border:var(--border-size-small) solid var(--gray200);border-top:none;background:var(--color-surface01);outline:none}.select-wrapper.sc-z-select .closed.sc-z-select .ul-scroll-wrapper.sc-z-select{z-index:10}.select-wrapper.sc-z-select .open.sc-z-select .ul-scroll-wrapper.sc-z-select{z-index:20}.select-wrapper.sc-z-select .ul-scroll-wrapper.fixed.sc-z-select{position:static}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select{position:relative;overflow:auto;max-height:240px;padding:calc(var(--space-unit) * 0.5);outline:none;scrollbar-color:var(--color-primary01) transparent}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select::-webkit-scrollbar{width:10px;background:linear-gradient(to right, transparent 0 3px, var(--gray200) 3px 7px, transparent 7px 10px);border-radius:var(--border-radius)}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select::-webkit-scrollbar-track{background-color:transparent}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select::-webkit-scrollbar-thumb{width:10px;background-color:var(--color-primary01);border-radius:var(--border-radius)}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select::-webkit-scrollbar-thumb:hover{background-color:var(--color-hover-primary)}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select .list-element-container.sc-z-select{display:flex;align-items:center;padding-left:calc(var(--space-unit) * 1.5)}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select .list-element-container.sc-z-select .list-element-content.sc-z-select{display:block;padding:calc(var(--space-unit) * 0.5) 0}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select .list-element-container.sc-z-select>z-icon.sc-z-select+.list-element-content.sc-z-select{display:block;padding:calc(var(--space-unit) * 0.5) var(--space-unit)}[size="x-small"].sc-z-select-h .select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select .list-element-container.sc-z-select .list-element-content.sc-z-select{padding:0}[size="small"].sc-z-select-h .select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select .list-element-container.sc-z-select>z-icon.sc-z-select{--z-icon-width:16px;--z-icon-height:16px}[size="x-small"].sc-z-select-h .select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select .list-element-container.sc-z-select>z-icon.sc-z-select{--z-icon-width:14px;--z-icon-height:14px}[size="x-small"].sc-z-select-h .select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select .list-element-container.sc-z-select>z-icon.sc-z-select+.list-element-content.sc-z-select{padding:0 var(--space-unit)}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select .list-element-container.sc-z-select .list-element-content.selected.sc-z-select{font-weight:bold}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select .no-results.sc-z-select z-icon.sc-z-select{margin-right:var(--space-unit)}.z-list-group-title.sc-z-select{color:var(--gray800)}.reset-item.sc-z-select{color:var(--color-primary01);fill:var(--color-primary01)}.reset-item-content.sc-z-select{display:flex;align-items:center}.reset-item.reset-item-margin.sc-z-select .reset-item-content.sc-z-select{margin-left:calc(var(--space-unit))}.reset-item.sc-z-select .reset-item-content.sc-z-select>z-icon.sc-z-select{margin-right:var(--space-unit)}.reset-item.hide.sc-z-select{display:none}';export{d as z_select}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as i,h as e,H as a,g as n}from"./p-81006561.js";import{w as s,p as r,D as o}from"./p-f976f29f.js";import{g as l}from"./p-a01baa71.js";import"./p-b497e33e.js";const c=class{constructor(e){t(this,e),this.fileInput=i(this,"fileInput",7),this.type=s.DEFAULT,this.files=[],this.uploadBtnLabel="allega",this.dragAndDropLabel="Rilascia i file in questa area per allegarli.",this.inputAttributes={type:"file",id:"file-elem",multiple:!0}}removeFileListener(t){const i=this.files,e=i.find((i=>i.name===t.detail.fileName));if(e){const t=i.indexOf(e);t>=0&&(i.splice(t,1),this.files=[...i])}}fileDroppedListener(t){this.input.files=t.detail,this.fileInputHandler()}componentDidUpdate(){this.handleAccessibility(),this.invalidFiles.size&&this.errorModal.focus()}componentWillLoad(){this.invalidFiles=new Map}fileInputHandler(){this.input.files.length&&(this.invalidFiles=this.checkFiles(Array.from(this.input.files)))}async getFiles(){return this.files}getType(){return l()!==r.DESKTOP&&l()!==r.DESKTOP_WIDE?s.DEFAULT:this.type}handleAccessibility(){const t=this.el.querySelector("z-file:last-child z-chip button");this.files.length>0&&t?t.focus():this.getType()===s.DEFAULT?this.button.querySelector("button").focus():this.uploadLink.focus()}checkFiles(t){const i=new Map,e=`supera il limite di ${this.fileMaxSize}MB`;return t.forEach((t=>{const a=t.size/1024/1024,n=this.acceptedFormat.split(",").some((i=>t.name.toLowerCase().endsWith(i.trim()))),s=a<=this.fileMaxSize;s&&n?this.files.find((i=>i.name===t.name))||(this.files.push(t),this.fileInput.emit(t),this.input.value=""):(i.set(t.name,[]),s||i.get(t.name).push(e),n||i.get(t.name).push(" ha un'estensione non prevista"))})),i}renderTitle(){return e("span",{id:"title"},this.mainTitle)}renderDescription(t){return e("span",{class:t},this.description)}renderAllowedFileExtensions(){let t="",i="";return this.acceptedFormat&&(t=` nei formati ${this.acceptedFormat.split(", ").map((t=>t.substring(1).toUpperCase())).join(", ")}`),this.fileMaxSize&&(i=` per un massimo di ${this.fileMaxSize}MB di peso`),e("span",{class:"body-3"},t||i?`Puoi allegare file${t}${i}.`:null)}renderFileSection(){return e("section",{class:"files-container "+(this.files.length?"":"hidden")},e("span",{class:"heading-4-sb"},"File appena caricati"),e("div",{class:"files-wrapper"},e("slot",{name:"files"})),e("z-divider",{size:o.MEDIUM}))}renderInput(){return e("input",Object.assign({},this.inputAttributes,{onChange:()=>this.fileInputHandler(),accept:this.acceptedFormat,ref:t=>this.input=t}))}renderUploadButton(){return[this.renderInput(),e("z-button",{onClick:()=>this.input.click(),onKeyPress:t=>{"Space"!=t.code&&"Enter"!=t.code||(t.preventDefault(),this.input.click())},id:"fileSelect",variant:this.buttonVariant,icon:"upload",ref:t=>this.button=t},this.uploadBtnLabel)]}renderUploadLink(){return[this.renderInput(),e("span",{class:"body-1 upload-link-text"},"Trascina o"," ",e("span",{tabIndex:0,class:"body-1-sb upload-link",onClick:()=>this.input.click(),onKeyPress:t=>{"Space"!=t.code&&"Enter"!=t.code||(t.preventDefault(),this.input.click())},ref:t=>this.uploadLink=t},"carica")," ","dal tuo computer")]}renderDefaultMode(){return[this.renderDescription("body-3-sb"),this.renderAllowedFileExtensions(),this.renderFileSection(),this.renderUploadButton()]}renderDragDropMode(){return[this.renderFileSection(),e("z-dragdrop-area",{"drag-and-drop-label":this.dragAndDropLabel},e("div",{class:"text-container"},this.renderDescription("body-1"),this.renderUploadLink(),this.renderAllowedFileExtensions()))]}formatErrorString(t,i){var e,a;return`Il file ${t} ${null!==(e=i[0])&&void 0!==e?e:""}${i[0]&&i[1]?", ed ":""}${null!==(a=i[1])&&void 0!==a?a:""}.`}handleErrorModalContent(){return e("div",{slot:"modalContent"},e("div",{class:"modal-wrapper"},e("div",{class:"files"},Array.from(this.invalidFiles).map((([t,i])=>e("span",{class:"body-3"},this.formatErrorString(t,i)))))))}render(){return e(a,null,e("div",{tabIndex:0,class:`container ${this.getType()}`},this.mainTitle&&this.renderTitle(),this.getType()==s.DEFAULT?this.renderDefaultMode():this.renderDragDropMode()),!!this.invalidFiles.size&&e("z-modal",{modalid:`file-upload-${this.type}-error-modal`,tabIndex:0,ref:t=>this.errorModal=t,modaltitle:"Attenzione",onModalClose:()=>this.invalidFiles=new Map,onModalBackgroundClick:()=>this.invalidFiles=new Map},this.handleErrorModalContent()))}get el(){return n(this)}};c.style=':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)}}';export{c as z_file_upload}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i,c,h,g as r}from"./p-81006561.js";import{x as s}from"./p-f976f29f.js";const o=class{constructor(h){i(this,h),this.interactiveIconClick=c(this,"interactiveIconClick",7),this.type=s.DEFAULT,this.disabled=!1,this.ariaLabel=""}render(){return h("div",{class:{"z-chip-container":!0,"z-chip-interactive":!!this.interactiveIcon,[this.type]:!0},"aria-disabled":this.disabled},this.icon&&h("z-icon",{name:this.icon}),h("slot",null),this.interactiveIcon&&h("button",{type:"button",onClick:()=>this.interactiveIconClick.emit(),"aria-label":this.ariaLabel,disabled:this.disabled},h("z-icon",{class:"interactive-icon",name:this.interactiveIcon})))}get el(){return r(this)}};o.style=".sc-z-chip-h>.z-chip-container.sc-z-chip{display:inline-flex;min-height:28px;align-items:center;padding:0 calc(var(--space-unit) * 1.5);border:var(--border-size-small) solid var(--gray400);background-color:var(--color-surface01);border-radius:14px;color:var(--color-text01);fill:var(--color-text01);font-family:var(--font-family-sans);font-size:14px;line-height:28px}.sc-z-chip-h>.z-chip-interactive.sc-z-chip{font-weight:var(--font-sb)}.sc-z-chip-h>.z-chip-container.sc-z-chip>button.sc-z-chip{padding:0;border:none;margin-left:var(--space-unit);background-color:transparent;cursor:pointer}.sc-z-chip-h>.z-chip-container.sc-z-chip>z-icon.sc-z-chip:first-child{margin-right:calc(var(--space-unit) / 2)}.sc-z-chip-h>.z-chip-container.sc-z-chip:not([aria-disabled]):hover>z-icon.sc-z-chip:first-child{fill:var(--color-icon02)}.sc-z-chip-h>.z-chip-container.sc-z-chip .interactive-icon.sc-z-chip{fill:var(--color-primary01)}.sc-z-chip-h>.z-chip-container.sc-z-chip:not([aria-disabled]) .interactive-icon.sc-z-chip:hover{color:var(--color-hover-primary);fill:var(--color-hover-primary)}.sc-z-chip-h>.z-chip-container[aria-disabled].sc-z-chip,.sc-z-chip-h>.z-chip-container[aria-disabled].sc-z-chip z-icon.sc-z-chip{color:var(--color-disabled03);cursor:auto;fill:var(--color-disabled03)}.sc-z-chip-h>.z-chip-container[aria-disabled].sc-z-chip{border:var(--border-size-small) solid var(--color-disabled01)}.sc-z-chip-h>.z-chip-container.sc-z-chip>button.sc-z-chip:focus:focus-visible{border-radius:100%;box-shadow:var(--shadow-focus-primary);outline:none}.sc-z-chip-h>button.sc-z-chip:not([disabled]):active:hover .interactive-icon.sc-z-chip{color:var(--color-primary01);fill:var(--color-primary01)}.sc-z-chip-h>.z-chip-container.sc-z-chip>z-icon.sc-z-chip,.sc-z-chip-h>.z-chip-container.sc-z-chip .interactive-icon.sc-z-chip{--z-icon-width:22px;--z-icon-height:22px}.sc-z-chip-h>.z-chip-container.default.sc-z-chip{min-height:44px;border-radius:22px;line-height:44px}.sc-z-chip-h>.z-chip-container.medium.sc-z-chip{min-height:40px;border-radius:22px;line-height:40px}.sc-z-chip-h>.z-chip-container.small.sc-z-chip{min-height:36px;border-radius:22px;line-height:36px}@media (min-width: 1152px){.sc-z-chip-h>.z-chip-container.sc-z-chip{font-size:12px}.sc-z-chip-h>.z-chip-container.default.sc-z-chip{min-height:32px;border-radius:16px;line-height:32px}.sc-z-chip-h>.z-chip-container.medium.sc-z-chip{min-height:28px;border-radius:16px;line-height:28px}.sc-z-chip-h>.z-chip-container.small.sc-z-chip{min-height:24px;border-radius:16px;line-height:24px}.sc-z-chip-h>.z-chip-container.sc-z-chip>z-icon.sc-z-chip,.sc-z-chip-h>.z-chip-container.sc-z-chip .interactive-icon.sc-z-chip{--z-icon-width:14px;--z-icon-height:14px}}";export{o as z_chip}
|