@zanichelli/albe-web-components 6.9.0 → 6.9.1
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 +28 -0
- package/dist/cjs/index-e3299e0a.js +32 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/web-components-library.cjs.js +1 -1
- package/dist/cjs/z-app-header_2.cjs.entry.js +153 -0
- package/dist/cjs/z-body.cjs.entry.js +18 -0
- package/dist/cjs/z-combobox.cjs.entry.js +3 -3
- package/dist/cjs/z-divider.cjs.entry.js +26 -0
- package/dist/cjs/z-dragdrop-area_2.cjs.entry.js +118 -0
- package/dist/cjs/z-file-upload.cjs.entry.js +11 -11
- package/dist/cjs/z-heading.cjs.entry.js +18 -0
- package/dist/cjs/z-input_2.cjs.entry.js +266 -0
- package/dist/cjs/z-list_3.cjs.entry.js +261 -0
- package/dist/cjs/z-select.cjs.entry.js +325 -0
- package/dist/cjs/z-table-empty-box.cjs.entry.js +1 -1
- package/dist/cjs/z-table.cjs.entry.js +1 -1
- package/dist/cjs/z-typography.cjs.entry.js +30 -0
- package/dist/collection/collection-manifest.json +3 -3
- package/dist/collection/components/file-upload/z-dragdrop-area/index.js +1 -1
- package/dist/collection/components/file-upload/z-file-upload/index.js +10 -10
- package/dist/collection/components/file-upload/z-file-upload/styles.css +2 -2
- package/dist/collection/components/inputs/z-combobox/index.js +2 -2
- package/dist/collection/components/inputs/z-combobox/styles.css +17 -7
- package/dist/collection/components/inputs/z-input/styles.css +19 -6
- package/dist/collection/components/inputs/z-select/index.js +29 -3
- package/dist/collection/components/inputs/z-select/styles.css +4 -0
- package/dist/collection/components/modal/z-modal/index.js +123 -6
- package/dist/collection/components/modal/z-modal/styles.css +9 -11
- package/dist/collection/components/z-table/z-table/index.js +1 -1
- package/dist/collection/components/z-table/z-table-empty-box/index.js +1 -1
- package/dist/collection/{components → deprecated}/typography/z-body/index.js +0 -0
- package/dist/collection/{components → deprecated}/typography/z-heading/index.js +0 -0
- package/dist/collection/{components → deprecated}/typography/z-typography/index.js +0 -0
- package/dist/collection/{components → deprecated}/typography/z-typography/styles.css +0 -0
- package/dist/esm/index-a2ca4b97.js +32 -4
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/polyfills/css-shim.js +0 -0
- package/dist/esm/{utils-5445d989.js → utils-6cf7efe2.js} +1 -1
- package/dist/esm/web-components-library.js +1 -1
- package/dist/esm/z-app-header_2.entry.js +148 -0
- package/dist/esm/z-body.entry.js +14 -0
- package/dist/esm/z-chip.entry.js +1 -1
- package/dist/esm/z-combobox.entry.js +4 -4
- package/dist/esm/z-divider.entry.js +22 -0
- package/dist/esm/z-dragdrop-area_2.entry.js +113 -0
- package/dist/esm/z-file-upload.entry.js +12 -12
- package/dist/esm/z-heading.entry.js +14 -0
- package/dist/esm/z-input_2.entry.js +261 -0
- package/dist/esm/z-list_3.entry.js +255 -0
- package/dist/esm/z-myz-card-info.entry.js +1 -1
- package/dist/esm/z-myz-list-item.entry.js +1 -1
- package/dist/esm/z-pocket_3.entry.js +1 -1
- package/dist/esm/z-searchbar.entry.js +1 -1
- package/dist/esm/z-select.entry.js +321 -0
- package/dist/esm/z-skip-to-content.entry.js +1 -1
- package/dist/esm/z-slideshow.entry.js +1 -1
- package/dist/esm/z-table-empty-box.entry.js +1 -1
- package/dist/esm/z-table-header.entry.js +1 -1
- package/dist/esm/z-table.entry.js +1 -1
- package/dist/esm/z-toggle-switch.entry.js +1 -1
- package/dist/esm/z-typography.entry.js +26 -0
- package/dist/types/beans/index.d.ts +0 -0
- package/dist/types/components/buttons/z-button/index.d.ts +0 -0
- package/dist/types/components/buttons/z-button-sort/index.d.ts +0 -0
- package/dist/types/components/buttons/z-chip/index.d.ts +0 -0
- package/dist/types/components/buttons/z-toggle-button/index.d.ts +0 -0
- package/dist/types/components/buttons/z-toggle-switch/index.d.ts +0 -0
- package/dist/types/components/date-picker/utils.d.ts +0 -0
- package/dist/types/components/date-picker/z-date-picker/index.d.ts +0 -0
- package/dist/types/components/date-picker/z-range-picker/index.d.ts +0 -0
- package/dist/types/components/file-upload/z-dragdrop-area/index.d.ts +0 -0
- package/dist/types/components/file-upload/z-file/index.d.ts +0 -0
- package/dist/types/components/file-upload/z-file-upload/index.d.ts +0 -0
- package/dist/types/components/icons/icons.d.ts +0 -0
- package/dist/types/components/icons/z-icon/index.d.ts +0 -0
- package/dist/types/components/index.d.ts +0 -0
- package/dist/types/components/indicators/z-stepper/index.d.ts +0 -0
- package/dist/types/components/indicators/z-stepper-item/index.d.ts +0 -0
- package/dist/types/components/inputs/z-combobox/index.d.ts +0 -0
- package/dist/types/components/inputs/z-input/index.d.ts +0 -0
- package/dist/types/components/inputs/z-input-message/index.d.ts +0 -0
- package/dist/types/components/inputs/z-searchbar/index.d.ts +0 -0
- package/dist/types/components/inputs/z-select/index.d.ts +2 -0
- package/dist/types/components/list/z-list/index.d.ts +0 -0
- package/dist/types/components/list/z-list-element/index.d.ts +0 -0
- package/dist/types/components/list/z-list-group/index.d.ts +0 -0
- package/dist/types/components/list/z-toast-notification-list/index.d.ts +0 -0
- package/dist/types/components/logo/z-logo/index.d.ts +0 -0
- package/dist/types/components/modal/z-modal/index.d.ts +20 -2
- package/dist/types/components/navigation/tabs/z-navigation-tab/index.d.ts +0 -0
- package/dist/types/components/navigation/tabs/z-navigation-tab-link/index.d.ts +0 -0
- package/dist/types/components/navigation/tabs/z-navigation-tabs/index.d.ts +0 -0
- package/dist/types/components/navigation/z-app-header/index.d.ts +0 -0
- package/dist/types/components/navigation/z-app-switcher/index.d.ts +0 -0
- package/dist/types/components/navigation/z-link/index.d.ts +0 -0
- package/dist/types/components/navigation/z-menu/index.d.ts +0 -0
- package/dist/types/components/navigation/z-menu-section/index.d.ts +0 -0
- package/dist/types/components/notification/z-info-box/index.d.ts +0 -0
- package/dist/types/components/notification/z-notification/index.d.ts +0 -0
- package/dist/types/components/notification/z-toast-notification/index.d.ts +0 -0
- package/dist/types/components/notification/z-tooltip/index.d.ts +0 -0
- package/dist/types/components/panel/z-panel-elem/index.d.ts +0 -0
- package/dist/types/components/z-anchor-navigation/index.d.ts +0 -0
- package/dist/types/components/z-aria-alert/index.d.ts +0 -0
- package/dist/types/components/z-avatar/index.d.ts +0 -0
- package/dist/types/components/z-card/index.d.ts +0 -0
- package/dist/types/components/z-carousel/index.d.ts +0 -0
- package/dist/types/components/z-contextual-menu/index.d.ts +0 -0
- package/dist/types/components/z-cover-hero/index.d.ts +0 -0
- package/dist/types/components/z-divider/index.d.ts +0 -0
- package/dist/types/components/z-ghost-loading/index.d.ts +0 -0
- package/dist/types/components/z-info-reveal/index.d.ts +0 -0
- package/dist/types/components/z-offcanvas/index.d.ts +0 -0
- package/dist/types/components/z-pagination/index.d.ts +0 -0
- package/dist/types/components/z-popover/index.d.ts +0 -0
- package/dist/types/components/z-section-title/index.d.ts +0 -0
- package/dist/types/components/z-skip-to-content/index.d.ts +0 -0
- package/dist/types/components/z-table/z-table/index.d.ts +0 -0
- package/dist/types/components/z-table/z-table-body/index.d.ts +0 -0
- package/dist/types/components/z-table/z-table-cell/index.d.ts +0 -0
- package/dist/types/components/z-table/z-table-empty-box/index.d.ts +0 -0
- package/dist/types/components/z-table/z-table-expanded-row/index.d.ts +0 -0
- package/dist/types/components/z-table/z-table-footer/index.d.ts +0 -0
- package/dist/types/components/z-table/z-table-head/index.d.ts +0 -0
- package/dist/types/components/z-table/z-table-header/index.d.ts +0 -0
- package/dist/types/components/z-table/z-table-header-row/index.d.ts +0 -0
- package/dist/types/components/z-table/z-table-row/index.d.ts +0 -0
- package/dist/types/components/z-table/z-table-sticky-footer/index.d.ts +0 -0
- package/dist/types/components/z-tag/index.d.ts +0 -0
- package/dist/types/components/z-visually-hidden/index.d.ts +0 -0
- package/dist/types/components.d.ts +26 -2
- package/dist/types/constants/breakpoints.d.ts +0 -0
- package/dist/types/constants/icons.d.ts +0 -0
- package/dist/types/{components → deprecated}/typography/z-body/index.d.ts +0 -0
- package/dist/types/{components → deprecated}/typography/z-heading/index.d.ts +0 -0
- package/dist/types/{components → deprecated}/typography/z-typography/index.d.ts +0 -0
- package/dist/types/index.d.ts +0 -0
- package/dist/types/snowflakes/myz/card/z-myz-card/index.d.ts +0 -0
- package/dist/types/snowflakes/myz/card/z-myz-card-alert/index.d.ts +0 -0
- package/dist/types/snowflakes/myz/card/z-myz-card-body/index.d.ts +0 -0
- package/dist/types/snowflakes/myz/card/z-myz-card-cover/index.d.ts +0 -0
- package/dist/types/snowflakes/myz/card/z-myz-card-dictionary/index.d.ts +0 -0
- package/dist/types/snowflakes/myz/card/z-myz-card-footer/index.d.ts +0 -0
- package/dist/types/snowflakes/myz/card/z-myz-card-footer-sections/index.d.ts +0 -0
- package/dist/types/snowflakes/myz/card/z-myz-card-header/index.d.ts +0 -0
- package/dist/types/snowflakes/myz/card/z-myz-card-icon/index.d.ts +0 -0
- package/dist/types/snowflakes/myz/card/z-myz-card-info/index.d.ts +0 -0
- package/dist/types/snowflakes/myz/card/z-myz-card-list/index.d.ts +0 -0
- package/dist/types/snowflakes/myz/list/z-myz-list/index.d.ts +0 -0
- package/dist/types/snowflakes/myz/list/z-myz-list-item/index.d.ts +0 -0
- package/dist/types/snowflakes/myz/pocket/z-messages-pocket/index.d.ts +0 -0
- package/dist/types/snowflakes/myz/pocket/z-pocket/index.d.ts +0 -0
- package/dist/types/snowflakes/myz/pocket/z-pocket-body/index.d.ts +0 -0
- package/dist/types/snowflakes/myz/pocket/z-pocket-header/index.d.ts +0 -0
- package/dist/types/snowflakes/myz/pocket/z-pocket-message/index.d.ts +0 -0
- package/dist/types/snowflakes/myz/z-alert/index.d.ts +0 -0
- package/dist/types/snowflakes/myz/z-otp/index.d.ts +0 -0
- package/dist/types/snowflakes/myz/z-slideshow/index.d.ts +0 -0
- package/dist/types/stencil-public-runtime.d.ts +0 -0
- package/dist/types/utils/utils.d.ts +0 -0
- package/dist/web-components-library/index.esm.js +1 -1
- package/dist/web-components-library/{p-48d3f650.entry.js → p-26033729.entry.js} +1 -1
- package/dist/web-components-library/p-33352f9e.entry.js +1 -0
- package/dist/web-components-library/p-3860061a.entry.js +1 -0
- package/dist/web-components-library/p-4367f978.entry.js +1 -0
- package/dist/web-components-library/p-52b084fb.entry.js +1 -0
- package/dist/web-components-library/{p-229e17af.entry.js → p-53065788.entry.js} +1 -1
- package/dist/web-components-library/{p-51333b32.entry.js → p-54b18f6e.entry.js} +1 -1
- package/dist/web-components-library/p-56cbd174.entry.js +1 -0
- package/dist/web-components-library/p-5ac6109d.entry.js +1 -0
- package/dist/web-components-library/{p-28b288a8.entry.js → p-5c62387a.entry.js} +1 -1
- package/dist/web-components-library/p-6acb48e3.entry.js +1 -0
- package/dist/web-components-library/{p-102d82ee.entry.js → p-6c163539.entry.js} +1 -1
- package/dist/web-components-library/p-6ea7428a.entry.js +1 -0
- package/dist/web-components-library/{p-00481c22.js → p-8ebe4adf.js} +1 -1
- package/dist/web-components-library/{p-db77ef4e.entry.js → p-93142fac.entry.js} +1 -1
- package/dist/web-components-library/p-9c338aeb.entry.js +1 -0
- package/dist/web-components-library/{p-669f14ae.entry.js → p-a05ce0a6.entry.js} +1 -1
- package/dist/web-components-library/{p-933efc27.entry.js → p-a6c0f149.entry.js} +1 -1
- package/dist/web-components-library/{p-169b9762.entry.js → p-d2127d84.entry.js} +1 -1
- package/dist/web-components-library/p-d6497e67.entry.js +1 -0
- package/dist/web-components-library/p-d9a6a204.entry.js +1 -0
- package/dist/web-components-library/p-e78ce8ec.entry.js +1 -0
- package/dist/web-components-library/p-edd53386.entry.js +1 -0
- package/dist/web-components-library/web-components-library.css +0 -0
- package/dist/web-components-library/web-components-library.esm.js +1 -1
- package/loader/cdn.js +0 -0
- package/loader/index.cjs.js +0 -0
- package/loader/index.d.ts +0 -0
- package/loader/index.es2017.js +0 -0
- package/loader/index.js +0 -0
- package/loader/package.json +0 -0
- package/package.json +1 -1
- package/www/build/index.esm.js +1 -1
- package/www/build/{p-48d3f650.entry.js → p-26033729.entry.js} +1 -1
- package/www/build/p-33352f9e.entry.js +1 -0
- package/www/build/p-3860061a.entry.js +1 -0
- package/www/build/p-4367f978.entry.js +1 -0
- package/www/build/p-52b084fb.entry.js +1 -0
- package/www/build/{p-229e17af.entry.js → p-53065788.entry.js} +1 -1
- package/www/build/{p-51333b32.entry.js → p-54b18f6e.entry.js} +1 -1
- package/www/build/p-56cbd174.entry.js +1 -0
- package/www/build/p-5ac6109d.entry.js +1 -0
- package/www/build/{p-28b288a8.entry.js → p-5c62387a.entry.js} +1 -1
- package/www/build/p-6acb48e3.entry.js +1 -0
- package/www/build/{p-102d82ee.entry.js → p-6c163539.entry.js} +1 -1
- package/www/build/p-6ea7428a.entry.js +1 -0
- package/www/build/{p-00481c22.js → p-8ebe4adf.js} +1 -1
- package/www/build/{p-db77ef4e.entry.js → p-93142fac.entry.js} +1 -1
- package/www/build/p-9c338aeb.entry.js +1 -0
- package/www/build/{p-669f14ae.entry.js → p-a05ce0a6.entry.js} +1 -1
- package/www/build/p-a240c0f4.js +1 -0
- package/www/build/{p-933efc27.entry.js → p-a6c0f149.entry.js} +1 -1
- package/www/build/{p-169b9762.entry.js → p-d2127d84.entry.js} +1 -1
- package/www/build/p-d6497e67.entry.js +1 -0
- package/www/build/p-d9a6a204.entry.js +1 -0
- package/www/build/p-e78ce8ec.entry.js +1 -0
- package/www/build/p-edd53386.entry.js +1 -0
- package/www/build/web-components-library.css +0 -0
- package/www/build/web-components-library.esm.js +1 -1
- package/www/build/web-components-library.js +0 -0
- package/www/host.config.json +0 -0
- package/www/index.html +1 -1
- package/dist/cjs/z-app-header_11.cjs.entry.js +0 -1030
- package/dist/cjs/z-dragdrop-area_3.cjs.entry.js +0 -76
- package/dist/esm/z-app-header_11.entry.js +0 -1016
- package/dist/esm/z-dragdrop-area_3.entry.js +0 -70
- package/dist/web-components-library/p-4bdf6a9b.entry.js +0 -1
- package/dist/web-components-library/p-5bbbda4e.entry.js +0 -1
- package/dist/web-components-library/p-735bdfa3.entry.js +0 -1
- package/dist/web-components-library/p-95b8f109.entry.js +0 -1
- package/dist/web-components-library/p-d0accfc5.entry.js +0 -1
- package/dist/web-components-library/p-de55c171.entry.js +0 -1
- package/www/build/p-4bdf6a9b.entry.js +0 -1
- package/www/build/p-5bbbda4e.entry.js +0 -1
- package/www/build/p-735bdfa3.entry.js +0 -1
- package/www/build/p-95b8f109.entry.js +0 -1
- package/www/build/p-d0accfc5.entry.js +0 -1
- package/www/build/p-de55c171.entry.js +0 -1
- package/www/build/p-e9b88186.js +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a2ca4b97.js';
|
|
2
2
|
import { v as ZFileUploadType, o as Device, D as DividerSize } from './index-968a240f.js';
|
|
3
|
-
import {
|
|
3
|
+
import { g as getDevice } from './utils-6cf7efe2.js';
|
|
4
4
|
import './breakpoints-c386984e.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
|
|
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-bottom:var(--space-unit)}: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}: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}@media only screen and (min-width: 768px){:host>.container>z-button{align-self:flex-start}}";
|
|
7
7
|
|
|
8
8
|
const ZFileUpload = class {
|
|
9
9
|
constructor(hostRef) {
|
|
@@ -98,10 +98,10 @@ const ZFileUpload = class {
|
|
|
98
98
|
return errors;
|
|
99
99
|
}
|
|
100
100
|
renderTitle() {
|
|
101
|
-
return (h("
|
|
101
|
+
return (h("h2", { class: "heading-2-sb", id: "title" }, this.mainTitle));
|
|
102
102
|
}
|
|
103
|
-
renderDescription(
|
|
104
|
-
return
|
|
103
|
+
renderDescription(cssClass) {
|
|
104
|
+
return h("span", { class: cssClass }, this.description);
|
|
105
105
|
}
|
|
106
106
|
renderAllowedFileExtensions() {
|
|
107
107
|
let fileFormatString = "";
|
|
@@ -117,10 +117,10 @@ const ZFileUpload = class {
|
|
|
117
117
|
fileWeightString = ` per un massimo di ${this.fileMaxSize}MB di peso`;
|
|
118
118
|
}
|
|
119
119
|
const finalString = `Puoi allegare file${fileFormatString}${fileWeightString}.`;
|
|
120
|
-
return h("
|
|
120
|
+
return h("span", { class: "body-3" }, fileFormatString || fileWeightString ? finalString : null);
|
|
121
121
|
}
|
|
122
122
|
renderFileSection() {
|
|
123
|
-
return (h("section", { class: `files-container ${!this.files.length ? "hidden" : ""}` }, h("
|
|
123
|
+
return (h("section", { class: `files-container ${!this.files.length ? "hidden" : ""}` }, h("h4", { class: "heading-4-sb" }, "File appena caricati"), h("div", { class: "files-wrapper" }, h("slot", { name: "files" })), h("z-divider", { size: DividerSize.MEDIUM })));
|
|
124
124
|
}
|
|
125
125
|
renderInput() {
|
|
126
126
|
return (h("input", Object.assign({}, this.inputAttributes, { onChange: () => this.fileInputHandler(), accept: this.acceptedFormat, ref: (val) => (this.input = val) })));
|
|
@@ -139,17 +139,17 @@ const ZFileUpload = class {
|
|
|
139
139
|
renderUploadLink() {
|
|
140
140
|
return [
|
|
141
141
|
this.renderInput(),
|
|
142
|
-
h("
|
|
142
|
+
h("span", { class: "body-1 upload-link-text" }, "Trascinalo qui o", " ", h("span", { tabIndex: 0, class: "body-1-sb upload-link", onClick: () => this.input.click(), onKeyPress: (e) => {
|
|
143
143
|
if (e.code == "Space" || e.code == "Enter") {
|
|
144
144
|
e.preventDefault();
|
|
145
145
|
this.input.click();
|
|
146
146
|
}
|
|
147
|
-
},
|
|
147
|
+
}, ref: (val) => (this.uploadLink = val) }, "caricalo"), " ", "dal tuo computer"),
|
|
148
148
|
];
|
|
149
149
|
}
|
|
150
150
|
renderDefaultMode() {
|
|
151
151
|
return [
|
|
152
|
-
this.renderDescription("
|
|
152
|
+
this.renderDescription("body-3-sb"),
|
|
153
153
|
this.renderAllowedFileExtensions(),
|
|
154
154
|
this.renderFileSection(),
|
|
155
155
|
this.renderUploadButton(),
|
|
@@ -158,7 +158,7 @@ const ZFileUpload = class {
|
|
|
158
158
|
renderDragDropMode() {
|
|
159
159
|
return [
|
|
160
160
|
this.renderFileSection(),
|
|
161
|
-
h("z-dragdrop-area", null, h("div", { class: "text-container" }, this.renderDescription("
|
|
161
|
+
h("z-dragdrop-area", null, h("div", { class: "text-container" }, this.renderDescription("body-1"), this.renderUploadLink(), this.renderAllowedFileExtensions())),
|
|
162
162
|
];
|
|
163
163
|
}
|
|
164
164
|
formatErrorString(key, value) {
|
|
@@ -168,7 +168,7 @@ const ZFileUpload = class {
|
|
|
168
168
|
}
|
|
169
169
|
handleErrorModalContent() {
|
|
170
170
|
return (h("div", { slot: "modalContent" }, h("div", { class: "modal-wrapper" }, h("div", { class: "files" }, Array.from(this.invalidFiles).map(([key, value]) => {
|
|
171
|
-
return
|
|
171
|
+
return h("span", { class: "body-3" }, this.formatErrorString(key, value));
|
|
172
172
|
})))));
|
|
173
173
|
}
|
|
174
174
|
render() {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { r as registerInstance, h } from './index-a2ca4b97.js';
|
|
2
|
+
|
|
3
|
+
const ZHeading = class {
|
|
4
|
+
constructor(hostRef) {
|
|
5
|
+
registerInstance(this, hostRef);
|
|
6
|
+
/** Font weight variant */
|
|
7
|
+
this.variant = "regular";
|
|
8
|
+
}
|
|
9
|
+
render() {
|
|
10
|
+
return (h("z-typography", { tabIndex: 0, component: this.component || `h${this.level}`, level: `h${this.level}`, variant: this.variant }, h("slot", null)));
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { ZHeading as z_heading };
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-a2ca4b97.js';
|
|
2
|
+
import { j as LabelPosition, I as InputType } from './index-968a240f.js';
|
|
3
|
+
import { r as randomId, b as boolean } from './utils-6cf7efe2.js';
|
|
4
|
+
import './breakpoints-c386984e.js';
|
|
5
|
+
|
|
6
|
+
const stylesCss$1 = ".sc-z-input-h{display:inline-block;width:inherit}input.sc-z-input::-ms-clear,input.sc-z-input::-ms-reveal{display:none}.sc-z-input-h input.sc-z-input::-ms-clear,.sc-z-input-h input.sc-z-input::-ms-reveal{display:none}input.sc-z-input,textarea.sc-z-input,.textarea-wrapper.sc-z-input{box-sizing:border-box;border:var(--border-size-small) solid var(--color-surface04);background:var(--color-input-field01);border-radius:var(--border-radius-small);color:var(--color-text01);fill:var(--color-icon02);font-family:var(--font-family-sans);font-size:var(--font-size-3);font-weight:var(--font-rg);outline:none}.cursor-select.sc-z-input-h input.sc-z-input{cursor:pointer}.sc-z-input-h:not(.active-select) input.sc-z-input:focus:focus-visible,.textarea-wrapper.sc-z-input:focus-within{box-shadow:var(--shadow-focus-primary)}input.sc-z-input:focus:focus-visible,textarea.sc-z-input:focus:focus-visible{color:var(--color-primary02)}.active-select.sc-z-input-h input.sc-z-input{border:var(--border-size-small) solid var(--blue500)}.cursor-select.sc-z-input-h input.sc-z-input:focus:focus-visible{box-shadow:var(--shadow-focus-primary)}.sc-z-input-h input[readonly].sc-z-input:focus:focus-visible{box-shadow:none;pointer-events:none}.filled.sc-z-input{border-color:var(--color-surface05)}.input-success.sc-z-input{border-color:var(--color-success01);background:var(--color-success-inverse);fill:var(--color-success01)}.input-error.sc-z-input{border-color:var(--color-error01);background:var(--color-error-inverse);fill:var(--color-error01)}.input-warning.sc-z-input{border-color:var(--color-warning01);background:var(--color-warning-inverse);fill:var(--color-warning01)}input.sc-z-input:hover,.textarea-wrapper.sc-z-input:hover{outline:var(--border-size-medium) solid var(--color-surface04);outline-offset:-2px}.sc-z-input-h:not(.active-select) input[readonly].sc-z-input,.readonly.sc-z-input{border-color:var(--color-disabled01);fill:var(--color-disabled01);pointer-events:none}[disabled].sc-z-input-h:not([disabled=\"false\"]) input.sc-z-input,[disabled].sc-z-input-h:not([disabled=\"false\"]) .textarea-wrapper.sc-z-input,[disabled].sc-z-input-h:not([disabled=\"false\"]) z-icon.sc-z-input{border-color:var(--color-disabled01);box-shadow:none;color:var(--color-disabled02);fill:var(--color-disabled01);pointer-events:none}[disabled].sc-z-input-h:not([disabled=\"false\"]) input.sc-z-input:hover{border-width:var(--border-size-small)}input.sc-z-input::placeholder,textarea.sc-z-input::placeholder{color:var(--color-text05)}.sc-z-input::-webkit-textarea-placeholder{color:var(--color-text05)}.sc-z-input:-ms-textarea-placeholder{color:var(--color-text05)}.sc-z-input::placeholder{color:var(--color-text05)}label.input-label.sc-z-input{display:block;padding-bottom:var(--space-unit);color:var(--color-text02);font-family:var(--font-family-sans);font-size:var(--font-size-1);font-weight:var(--font-sb);text-align:left;text-transform:uppercase}[disabled].sc-z-input-h:not([disabled=\"false\"]) label.input-label.sc-z-input{color:var(--color-disabled02)}.text-wrapper.sc-z-input>div.sc-z-input{position:relative;z-index:1;fill:var(--color-icon02)}.text-wrapper.sc-z-input>div.sc-z-input>input.sc-z-input{width:100%;height:calc(var(--space-unit) * 5.5);box-sizing:border-box;padding:0 calc(var(--space-unit) * 1.5);margin:0}.text-wrapper.sc-z-input>div.sc-z-input>input.has-icon.sc-z-input,.text-wrapper.sc-z-input>div.sc-z-input>input.has-clear-icon.sc-z-input{padding-right:calc(var(--space-unit) * 5.25)}.text-wrapper.sc-z-input>div.sc-z-input>input.has-icon.has-clear-icon.sc-z-input{padding-right:calc(var(--space-unit) * 8)}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input{position:absolute;z-index:2;top:50%;right:calc(var(--space-unit) * 1.5);display:flex;pointer-events:none;transform:translateY(-50%)}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.icon-button.sc-z-input{padding:0;border:0;background:none;color:inherit;font:inherit;pointer-events:initial}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.icon-button.sc-z-input+button.icon-button.sc-z-input{margin-left:calc(var(--space-unit) * 0.5)}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.icon-button.reset-icon.sc-z-input,.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.icon-button.toggle-password-icon.sc-z-input{cursor:pointer}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.icon-button.sc-z-input>z-icon.sc-z-input{--z-icon-width:18px;--z-icon-height:18px;display:block}.text-wrapper.sc-z-input>div.sc-z-input>input.sc-z-input:-webkit-autofill,.text-wrapper.sc-z-input>div.sc-z-input>input.sc-z-input:-webkit-autofill:hover,.text-wrapper.sc-z-input>div.sc-z-input>input.sc-z-input:-webkit-autofill:focus,.text-wrapper.sc-z-input>div.sc-z-input>input.sc-z-input:-webkit-autofill:active{background:var(--color-white) !important;background-clip:text !important;-webkit-transition-delay:99999s !important}.textarea-wrapper.sc-z-input{padding:calc(var(--space-unit) * 1.5);scrollbar-color:var(--color-primary01) transparent}textarea.sc-z-input::-webkit-scrollbar{width:10px;background:linear-gradient(to right, transparent 0 3px, var(--gray200) 3px 7px, transparent 7px 10px);border-radius:var(--border-radius)}textarea.sc-z-input::-webkit-scrollbar-track{background-color:transparent}textarea.sc-z-input::-webkit-scrollbar-thumb{width:10px;background-color:var(--color-primary01);border-radius:var(--border-radius)}textarea.sc-z-input::-webkit-scrollbar-thumb:hover{background-color:var(--color-hover-primary)}textarea.sc-z-input{width:100%;min-height:132px;padding:0;border:none;margin:0;resize:none}.radio-wrapper.sc-z-input,.checkbox-wrapper.sc-z-input{position:relative;display:inline-flex;flex-direction:row;align-items:center;color:var(--color-text01);fill:var(--color-primary01);font-family:var(--font-family-sans)}.radio-wrapper.sc-z-input:hover,.checkbox-wrapper.sc-z-input:hover{color:var(--color-hover-primary);fill:currentcolor}.radio-wrapper.sc-z-input>input.sc-z-input,.checkbox-wrapper.sc-z-input>input.sc-z-input{position:absolute;z-index:-1;opacity:0;pointer-events:none}.radio-wrapper.sc-z-input .radio-label.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.sc-z-input{display:inline-flex;align-items:center;margin:0;color:inherit;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:1;text-transform:inherit}.radio-wrapper.sc-z-input input.sc-z-input:not(:disabled)+.radio-label.sc-z-input,.checkbox-wrapper.sc-z-input input.sc-z-input:not(:disabled)+.checkbox-label.sc-z-input{cursor:pointer}.radio-wrapper.sc-z-input .radio-label.sc-z-input z-icon.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.sc-z-input z-icon.sc-z-input{cursor:pointer;fill:inherit}.radio-wrapper.sc-z-input .radio-label.after.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.after.sc-z-input{flex-direction:row}.radio-wrapper.sc-z-input .radio-label.before.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.before.sc-z-input{flex-direction:row-reverse}.radio-wrapper.sc-z-input .radio-label.after.sc-z-input>span.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.after.sc-z-input>span.sc-z-input{margin-left:var(--space-unit)}.radio-wrapper.sc-z-input .radio-label.before.sc-z-input>span.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.before.sc-z-input>span.sc-z-input{margin-right:var(--space-unit)}.radio-wrapper.sc-z-input>input.sc-z-input:focus:focus-visible+.radio-label.sc-z-input>z-icon.sc-z-input,.checkbox-wrapper.sc-z-input>input.sc-z-input:focus:focus-visible+.checkbox-label.sc-z-input>z-icon.sc-z-input{border-radius:var(--border-radius-small);box-shadow:var(--shadow-focus-primary)}.radio-wrapper.sc-z-input>input.sc-z-input:disabled+.radio-label.sc-z-input,.checkbox-wrapper.sc-z-input>input.sc-z-input:disabled+.checkbox-label.sc-z-input{color:var(--color-disabled02)}.radio-wrapper.sc-z-input>input.sc-z-input:disabled+.radio-label.sc-z-input>z-icon.sc-z-input,.checkbox-wrapper.sc-z-input>input.sc-z-input:disabled+.checkbox-label.sc-z-input>z-icon.sc-z-input{cursor:default;fill:var(--color-disabled01)}";
|
|
7
|
+
|
|
8
|
+
const ZInput = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
registerInstance(this, hostRef);
|
|
11
|
+
this.inputChange = createEvent(this, "inputChange", 7);
|
|
12
|
+
this.startTyping = createEvent(this, "startTyping", 7);
|
|
13
|
+
this.stopTyping = createEvent(this, "stopTyping", 7);
|
|
14
|
+
this.inputCheck = createEvent(this, "inputCheck", 7);
|
|
15
|
+
/** the id of the input element */
|
|
16
|
+
this.htmlid = `id-${randomId()}`;
|
|
17
|
+
/** the input aria-label */
|
|
18
|
+
this.ariaLabel = "";
|
|
19
|
+
/** the input is disabled */
|
|
20
|
+
this.disabled = false;
|
|
21
|
+
/** the input is readonly */
|
|
22
|
+
this.readonly = false;
|
|
23
|
+
/** the input is required (optional): available for text, password, number, email, textarea, checkbox */
|
|
24
|
+
this.required = false;
|
|
25
|
+
/** checked: available for checkbox, radio */
|
|
26
|
+
this.checked = false;
|
|
27
|
+
/** input helper message (optional): available for text, password, number, email, textarea - if set to `false` message won't be displayed */
|
|
28
|
+
this.message = true;
|
|
29
|
+
/** the input label position: available for checkbox, radio */
|
|
30
|
+
this.labelPosition = LabelPosition.RIGHT;
|
|
31
|
+
/** render clear icon when typing (optional): available for text */
|
|
32
|
+
this.hasclearicon = true;
|
|
33
|
+
this.isTyping = false;
|
|
34
|
+
this.passwordHidden = true;
|
|
35
|
+
this.typingtimeout = 300;
|
|
36
|
+
}
|
|
37
|
+
inputCheckListener(e) {
|
|
38
|
+
const data = e.detail;
|
|
39
|
+
switch (this.type) {
|
|
40
|
+
case InputType.RADIO:
|
|
41
|
+
if (data.type === InputType.RADIO && data.name === this.name && data.id !== this.htmlid) {
|
|
42
|
+
this.checked = false;
|
|
43
|
+
}
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/** get checked status */
|
|
48
|
+
async isChecked() {
|
|
49
|
+
switch (this.type) {
|
|
50
|
+
case InputType.CHECKBOX:
|
|
51
|
+
case InputType.RADIO:
|
|
52
|
+
return this.checked;
|
|
53
|
+
default:
|
|
54
|
+
console.warn("`isChecked` method is only available for type `checkbox` and `radio`");
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
emitInputChange(value) {
|
|
59
|
+
if (!this.isTyping) {
|
|
60
|
+
this.emitStartTyping();
|
|
61
|
+
}
|
|
62
|
+
let validity;
|
|
63
|
+
if (this.type === InputType.TEXTAREA) {
|
|
64
|
+
validity = this.getValidity("textarea");
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
validity = this.getValidity("input");
|
|
68
|
+
}
|
|
69
|
+
this.value = value;
|
|
70
|
+
this.inputChange.emit({ value, validity });
|
|
71
|
+
clearTimeout(this.timer);
|
|
72
|
+
this.timer = setTimeout(() => {
|
|
73
|
+
this.emitStopTyping(this.value, validity);
|
|
74
|
+
}, this.typingtimeout);
|
|
75
|
+
}
|
|
76
|
+
emitStartTyping() {
|
|
77
|
+
this.isTyping = true;
|
|
78
|
+
this.startTyping.emit();
|
|
79
|
+
}
|
|
80
|
+
emitStopTyping(value, validity) {
|
|
81
|
+
this.isTyping = false;
|
|
82
|
+
this.stopTyping.emit({
|
|
83
|
+
value: value,
|
|
84
|
+
validity: validity,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
emitInputCheck(checked) {
|
|
88
|
+
this.inputCheck.emit({
|
|
89
|
+
id: this.htmlid,
|
|
90
|
+
checked: checked,
|
|
91
|
+
type: this.type,
|
|
92
|
+
name: this.name,
|
|
93
|
+
value: this.value,
|
|
94
|
+
validity: this.getValidity("input"),
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
getValidity(type) {
|
|
98
|
+
const input = this.hostElement.querySelector(type);
|
|
99
|
+
return input.validity;
|
|
100
|
+
}
|
|
101
|
+
/* START text/password/email/number */
|
|
102
|
+
getTextAttributes() {
|
|
103
|
+
return {
|
|
104
|
+
id: this.htmlid,
|
|
105
|
+
name: this.name,
|
|
106
|
+
placeholder: this.placeholder,
|
|
107
|
+
value: this.value,
|
|
108
|
+
disabled: this.disabled,
|
|
109
|
+
readonly: this.readonly,
|
|
110
|
+
required: this.required,
|
|
111
|
+
title: this.htmltitle,
|
|
112
|
+
class: {
|
|
113
|
+
[`input-${this.status}`]: !!this.status,
|
|
114
|
+
filled: !!this.value,
|
|
115
|
+
},
|
|
116
|
+
autocomplete: this.autocomplete,
|
|
117
|
+
onInput: (e) => this.emitInputChange(e.target.value),
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
getNumberAttributes(type) {
|
|
121
|
+
if (type != InputType.NUMBER) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
return {
|
|
125
|
+
min: this.min,
|
|
126
|
+
max: this.max,
|
|
127
|
+
step: this.step,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
getPatternAttribute(type) {
|
|
131
|
+
if (type != InputType.PASSWORD &&
|
|
132
|
+
type != InputType.TEXT &&
|
|
133
|
+
type != InputType.TEL &&
|
|
134
|
+
type != InputType.SEARCH &&
|
|
135
|
+
type != InputType.URL &&
|
|
136
|
+
type != InputType.EMAIL) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
return {
|
|
140
|
+
pattern: this.pattern,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
renderInputText(type = InputType.TEXT) {
|
|
144
|
+
const ariaLabel = this.ariaLabel ? { "aria-label": this.ariaLabel } : {};
|
|
145
|
+
const attr = Object.assign(Object.assign(Object.assign(Object.assign({}, this.getTextAttributes()), this.getNumberAttributes(type)), this.getPatternAttribute(type)), ariaLabel);
|
|
146
|
+
if (this.icon || type === InputType.PASSWORD) {
|
|
147
|
+
Object.assign(attr.class, { "has-icon": true });
|
|
148
|
+
}
|
|
149
|
+
if (this.hasclearicon && type != InputType.NUMBER) {
|
|
150
|
+
Object.assign(attr.class, { "has-clear-icon": true });
|
|
151
|
+
}
|
|
152
|
+
return (h("div", { class: "text-wrapper" }, this.renderLabel(), h("div", null, h("input", Object.assign({ type: type === InputType.PASSWORD && !this.passwordHidden ? InputType.TEXT : type }, attr)), this.renderIcons()), this.renderMessage()));
|
|
153
|
+
}
|
|
154
|
+
renderLabel() {
|
|
155
|
+
if (!this.label) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
return (h("label", { class: "input-label body-5-sb", id: `${this.htmlid}_label`, htmlFor: this.htmlid }, this.label));
|
|
159
|
+
}
|
|
160
|
+
renderIcons() {
|
|
161
|
+
return (h("span", { class: "icons-wrapper" }, this.renderResetIcon(), this.renderIcon()));
|
|
162
|
+
}
|
|
163
|
+
renderIcon() {
|
|
164
|
+
if (this.type === InputType.PASSWORD) {
|
|
165
|
+
return this.renderShowHidePassword();
|
|
166
|
+
}
|
|
167
|
+
if (!this.icon) {
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
return (h("button", { type: "button", class: "icon-button input-icon", tabIndex: -1 }, h("z-icon", { name: this.icon })));
|
|
171
|
+
}
|
|
172
|
+
renderResetIcon() {
|
|
173
|
+
if (!this.hasclearicon || !this.value || this.disabled || this.readonly || this.type == InputType.NUMBER) {
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
return (h("button", { type: "button", class: "icon-button reset-icon", "aria-label": "cancella il contenuto dell'input", onClick: () => this.emitInputChange("") }, h("z-icon", { name: "multiply" })));
|
|
177
|
+
}
|
|
178
|
+
renderShowHidePassword() {
|
|
179
|
+
return (h("button", { type: "button", class: "icon-button toggle-password-icon", disabled: this.disabled, "aria-label": this.passwordHidden ? "mostra password" : "nascondi password", onClick: () => (this.passwordHidden = !this.passwordHidden) }, h("z-icon", { name: this.passwordHidden ? "view-filled" : "view-off-filled" })));
|
|
180
|
+
}
|
|
181
|
+
renderMessage() {
|
|
182
|
+
if (boolean(this.message) === false) {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
return (h("z-input-message", { message: boolean(this.message) === true ? undefined : this.message, status: this.status }));
|
|
186
|
+
}
|
|
187
|
+
/* END text/password/email/number */
|
|
188
|
+
/* START textarea */
|
|
189
|
+
renderTextarea() {
|
|
190
|
+
const attributes = this.getTextAttributes();
|
|
191
|
+
const ariaLabel = this.ariaLabel ? { "aria-label": this.ariaLabel } : {};
|
|
192
|
+
return (h("div", { class: "text-wrapper" }, this.renderLabel(), h("div", { class: Object.assign(Object.assign({}, attributes.class), { "textarea-wrapper": true, "readonly": attributes.readonly }) }, h("textarea", Object.assign({}, attributes, ariaLabel))), this.renderMessage()));
|
|
193
|
+
}
|
|
194
|
+
/* END textarea */
|
|
195
|
+
handleCheck(ev) {
|
|
196
|
+
this.checked = ev.target.checked;
|
|
197
|
+
this.emitInputCheck(this.checked);
|
|
198
|
+
}
|
|
199
|
+
/* START checkbox */
|
|
200
|
+
renderCheckbox() {
|
|
201
|
+
return (h("div", { class: "checkbox-wrapper" }, h("input", { id: this.htmlid, type: "checkbox", name: this.name, checked: this.checked, disabled: this.disabled, readonly: this.readonly, required: this.required, onChange: this.handleCheck.bind(this), value: this.value }), h("label", { htmlFor: this.htmlid, class: {
|
|
202
|
+
"checkbox-label": true,
|
|
203
|
+
"after": this.labelPosition === LabelPosition.RIGHT,
|
|
204
|
+
"before": this.labelPosition === LabelPosition.LEFT,
|
|
205
|
+
} }, h("z-icon", { name: this.checked ? "checkbox-checked" : "checkbox", "aria-hidden": "true" }), this.label && h("span", { innerHTML: this.label }))));
|
|
206
|
+
}
|
|
207
|
+
/* END checkbox */
|
|
208
|
+
/* START radio */
|
|
209
|
+
renderRadio() {
|
|
210
|
+
return (h("div", { class: "radio-wrapper" }, h("input", { id: this.htmlid, type: "radio", name: this.name, checked: this.checked, disabled: this.disabled, readonly: this.readonly, onChange: this.handleCheck.bind(this), value: this.value }), h("label", { htmlFor: this.htmlid, class: {
|
|
211
|
+
"radio-label": true,
|
|
212
|
+
"after": this.labelPosition === LabelPosition.RIGHT,
|
|
213
|
+
"before": this.labelPosition === LabelPosition.LEFT,
|
|
214
|
+
} }, h("z-icon", { name: this.checked ? "radio-button-checked" : "radio-button", "aria-hidden": "true" }), this.label && h("span", { innerHTML: this.label }))));
|
|
215
|
+
}
|
|
216
|
+
/* END radio */
|
|
217
|
+
render() {
|
|
218
|
+
switch (this.type) {
|
|
219
|
+
case InputType.TEXTAREA:
|
|
220
|
+
return this.renderTextarea();
|
|
221
|
+
case InputType.CHECKBOX:
|
|
222
|
+
return this.renderCheckbox();
|
|
223
|
+
case InputType.RADIO:
|
|
224
|
+
return this.renderRadio();
|
|
225
|
+
default:
|
|
226
|
+
return this.renderInputText(this.type);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
get hostElement() { return getElement(this); }
|
|
230
|
+
};
|
|
231
|
+
ZInput.style = stylesCss$1;
|
|
232
|
+
|
|
233
|
+
const stylesCss = ":host{display:flex;min-height:calc(var(--space-unit) * 2.5);align-items:start;margin-top:var(--space-unit);color:var(--color-text05);fill:currentcolor;font-family:var(--font-family-sans);font-size:var(--font-size-2);letter-spacing:0.16px}:host([status=\"success\"]){color:var(--color-text-success)}:host([status=\"error\"]){color:var(--color-text-error)}:host([status=\"warning\"]){color:var(--color-warning02)}:host(:focus){outline:none}:host>z-icon{--z-icon-width:calc(var(--space-unit) * 2);--z-icon-height:calc(var(--space-unit) * 2);--z-icon-right-margin:var(--space-unit)}";
|
|
234
|
+
|
|
235
|
+
const ZInputMessage = class {
|
|
236
|
+
constructor(hostRef) {
|
|
237
|
+
registerInstance(this, hostRef);
|
|
238
|
+
this.statusIcons = {
|
|
239
|
+
success: "checkmark-circle",
|
|
240
|
+
error: "multiply-circled",
|
|
241
|
+
warning: "exclamation-circle",
|
|
242
|
+
};
|
|
243
|
+
this.statusRole = {};
|
|
244
|
+
}
|
|
245
|
+
onMessageChange() {
|
|
246
|
+
this.statusRole = this.message && this.status ? { role: "alert" } : {};
|
|
247
|
+
}
|
|
248
|
+
componentWillLoad() {
|
|
249
|
+
this.onMessageChange();
|
|
250
|
+
}
|
|
251
|
+
render() {
|
|
252
|
+
return (h(Host, Object.assign({}, this.statusRole, { "aria-label": this.message }), this.statusIcons[this.status] && this.message && h("z-icon", { name: this.statusIcons[this.status] }), h("span", { innerHTML: this.message })));
|
|
253
|
+
}
|
|
254
|
+
static get watchers() { return {
|
|
255
|
+
"message": ["onMessageChange"],
|
|
256
|
+
"status": ["onMessageChange"]
|
|
257
|
+
}; }
|
|
258
|
+
};
|
|
259
|
+
ZInputMessage.style = stylesCss;
|
|
260
|
+
|
|
261
|
+
export { ZInput as z_input, ZInputMessage as z_input_message };
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-a2ca4b97.js';
|
|
2
|
+
import { g as ListSize, l as ListType, i as ExpandableListButtonAlign, k as ListDividerType, D as DividerSize, E as ExpandableListStyle, e as KeyboardCode } from './index-968a240f.js';
|
|
3
|
+
|
|
4
|
+
const stylesCss$2 = ":host{display:flex;flex-direction:column;font-family:var(--font-family-sans);font-weight:var(--font-rg)}";
|
|
5
|
+
|
|
6
|
+
const ZList = class {
|
|
7
|
+
constructor(hostRef) {
|
|
8
|
+
registerInstance(this, hostRef);
|
|
9
|
+
/**
|
|
10
|
+
* [optional] Sets size of inside elements.
|
|
11
|
+
*/
|
|
12
|
+
this.size = ListSize.MEDIUM;
|
|
13
|
+
/**
|
|
14
|
+
* [optional] type of the list marker for each element
|
|
15
|
+
*/
|
|
16
|
+
this.listType = ListType.NONE;
|
|
17
|
+
}
|
|
18
|
+
setChildrenSizeType() {
|
|
19
|
+
const children = this.host.children;
|
|
20
|
+
for (let i = 0; i < children.length; i++) {
|
|
21
|
+
children[i].setAttribute("size", this.size);
|
|
22
|
+
children[i].setAttribute("list-type", this.listType);
|
|
23
|
+
children[i].setAttribute("list-element-position", (i + 1).toString());
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
componentDidLoad() {
|
|
27
|
+
this.setChildrenSizeType();
|
|
28
|
+
}
|
|
29
|
+
render() {
|
|
30
|
+
return (h(Host, { role: "list" }, h("slot", null)));
|
|
31
|
+
}
|
|
32
|
+
get host() { return getElement(this); }
|
|
33
|
+
};
|
|
34
|
+
ZList.style = stylesCss$2;
|
|
35
|
+
|
|
36
|
+
const stylesCss$1 = ":host{outline:none}:host>.container,:host>.container-contextual-menu{--background-color-list-element:var(--bg-white);--background-hover-color-list-element:var(--color-surface02);--background-active-color-list-element:var(--color-surface02);display:flex;box-sizing:border-box;flex-direction:column;justify-content:center;font-family:var(--font-family-sans);font-weight:var(--font-rg);outline:none}:host([size=\"small\"])>.container{min-height:calc(var(--space-unit) * 4);padding:calc(var(--space-unit) / 2) 0}:host([size=\"medium\"])>.container{min-height:calc(var(--space-unit) * 5);padding:var(--space-unit) 0}:host([size=\"large\"])>.container{min-height:calc(var(--space-unit) * 7);padding:calc(var(--space-unit) * 2) 0}:host([size=\"x-large\"])>.container{min-height:calc(var(--space-unit) * 9);padding:calc(var(--space-unit) * 3) 0}:host([expandable])>.container,:host([expandable])>.container-contextual-menu,:host([clickable])>.container,:host([clickable])>.container-contextual-menu{cursor:pointer}:host([expandable]:hover)>.container,:host([expandable]:hover)>.container-contextual-menu,:host([clickable]:hover)>.container,:host([clickable]:hover)>.container-contextual-menu{background-color:var(--background-hover-color-list-element)}:host([expandable]:focus:focus-visible)>.container,:host([expandable]:focus:focus-visible)>.container-contextual-menu,:host([clickable]:focus:focus-visible)>.container,:host([clickable]:focus:focus-visible)>.container-contextual-menu{box-shadow:var(--shadow-focus-primary)}:host([clickable]:not([expandable]))>.container.clicked,:host([clickable]:not([expandable]))>.container-contextual-menu.clicked{box-shadow:var(--shadow-focus-primary)}:host([expandable]:active)>.container,:host([expandable]:active)>.container-contextual-menu,:host([clickable]:active)>.container,:host([clickable]:active)>.container-contextual-menu{background-color:var(--background-active-color-list-element)}:host([align-button=\"left\"][expandable])>.container>.z-list-element-container,:host([align-button=\"left\"][expandable])>.container-contextual-menu>.z-list-element-container{display:flex}:host([align-button=\"right\"][expandable])>.container>.z-list-element-container,:host([align-button=\"right\"][expandable])>.container-contextual-menu>.z-list-element-container{display:flex;flex-direction:row-reverse;justify-content:space-between}:host([align-button=\"left\"][expandable])>.container>.z-list-element-container>z-icon,:host([align-button=\"left\"][expandable])>.container-contextual-menu>.z-list-element-container>z-icon{margin-right:var(--space-unit)}:host([align-button=\"right\"][expandable])>.container>.z-list-element-container>z-icon,:host([align-button=\"right\"][expandable])>.container-contextual-menu>.z-list-element-container>z-icon{margin-left:var(--space-unit)}:host>.container>.z-list-element-inner-container,:host>.container-contextual-menu>.z-list-element-inner-container{display:none}:host>.container>.z-list-element-inner-container.expanded,:host>.container-contextual-menu>.z-list-element-inner-container.expanded{display:block}:host([clickable]:hover)>.container-contextual-menu{background-color:var(--color-surface03)}.container-contextual-menu:focus-visible{box-shadow:var(--shadow-focus-primary);outline:none}.z-list-content-container{display:flex;align-items:center}";
|
|
37
|
+
|
|
38
|
+
const ZListElement = class {
|
|
39
|
+
/**
|
|
40
|
+
* Constructor.
|
|
41
|
+
*/
|
|
42
|
+
constructor(hostRef) {
|
|
43
|
+
registerInstance(this, hostRef);
|
|
44
|
+
this.accessibleFocus = createEvent(this, "accessibleFocus", 7);
|
|
45
|
+
this.clickItem = createEvent(this, "clickItem", 7);
|
|
46
|
+
/**
|
|
47
|
+
* [optional] Align expandable button left or right.
|
|
48
|
+
*/
|
|
49
|
+
this.alignButton = ExpandableListButtonAlign.LEFT;
|
|
50
|
+
/**
|
|
51
|
+
* [optional] Sets element clickable.
|
|
52
|
+
*/
|
|
53
|
+
this.clickable = false;
|
|
54
|
+
/**
|
|
55
|
+
* [optional] Sets the divider color.
|
|
56
|
+
*/
|
|
57
|
+
this.dividerColor = "color-surface03";
|
|
58
|
+
/**
|
|
59
|
+
* [optional] Sets the position where to insert the divider.
|
|
60
|
+
*/
|
|
61
|
+
this.dividerType = ListDividerType.NONE;
|
|
62
|
+
/**
|
|
63
|
+
* [optional] Sets the divider size.
|
|
64
|
+
*/
|
|
65
|
+
this.dividerSize = DividerSize.SMALL;
|
|
66
|
+
/**
|
|
67
|
+
* [optional] Sets element as expandable.
|
|
68
|
+
*/
|
|
69
|
+
this.expandable = false;
|
|
70
|
+
/**
|
|
71
|
+
* [optional] Sets expandable style to element.
|
|
72
|
+
*/
|
|
73
|
+
this.expandableStyle = ExpandableListStyle.ACCORDION;
|
|
74
|
+
/**
|
|
75
|
+
* [optional] Sets size of inside elements.
|
|
76
|
+
*/
|
|
77
|
+
this.size = ListSize.MEDIUM;
|
|
78
|
+
/**
|
|
79
|
+
* [optional] Sets text color of the element.
|
|
80
|
+
*/
|
|
81
|
+
this.color = "none";
|
|
82
|
+
/**
|
|
83
|
+
* [optional] Sets disabled style of the element.
|
|
84
|
+
*/
|
|
85
|
+
this.disabled = false;
|
|
86
|
+
/**
|
|
87
|
+
* [optional] If is used in ZContextualMenu component
|
|
88
|
+
*/
|
|
89
|
+
this.isContextualMenu = false;
|
|
90
|
+
/**
|
|
91
|
+
* [optional] position of the list element inside the list or the group
|
|
92
|
+
*/
|
|
93
|
+
this.listElementPosition = "0";
|
|
94
|
+
/**
|
|
95
|
+
* [optional] type of the list marker for each element
|
|
96
|
+
*/
|
|
97
|
+
this.listType = ListType.NONE;
|
|
98
|
+
this.showInnerContent = false;
|
|
99
|
+
this.openElementConfig = {
|
|
100
|
+
accordion: {
|
|
101
|
+
open: "minus-circled",
|
|
102
|
+
close: "plus-circled",
|
|
103
|
+
},
|
|
104
|
+
menu: {
|
|
105
|
+
open: "chevron-up",
|
|
106
|
+
close: "chevron-down",
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
this.handleClick = this.handleClick.bind(this);
|
|
110
|
+
this.handleKeyDown = this.handleKeyDown.bind(this);
|
|
111
|
+
}
|
|
112
|
+
accessibleFocusHandler(e) {
|
|
113
|
+
if (this.listElementId === e.detail) {
|
|
114
|
+
const toFocus = this.host.shadowRoot.getElementById(`z-list-element-id-${e.detail}`);
|
|
115
|
+
toFocus.focus();
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Handler for click on element. If element is expandable, change state.
|
|
120
|
+
* @returns void
|
|
121
|
+
*/
|
|
122
|
+
handleClick() {
|
|
123
|
+
this.clickItem.emit(this.listElementId);
|
|
124
|
+
if (!this.expandable) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
this.showInnerContent = !this.showInnerContent;
|
|
128
|
+
}
|
|
129
|
+
calculateClass() {
|
|
130
|
+
if (this.isContextualMenu) {
|
|
131
|
+
return "container-contextual-menu";
|
|
132
|
+
}
|
|
133
|
+
return "container";
|
|
134
|
+
}
|
|
135
|
+
handleKeyDown(event) {
|
|
136
|
+
const expandByKey = event.code === KeyboardCode.ENTER;
|
|
137
|
+
switch (event.code) {
|
|
138
|
+
case KeyboardCode.ARROW_DOWN:
|
|
139
|
+
event.preventDefault();
|
|
140
|
+
this.accessibleFocus.emit(this.listElementId + 1);
|
|
141
|
+
break;
|
|
142
|
+
case KeyboardCode.ARROW_UP:
|
|
143
|
+
event.preventDefault();
|
|
144
|
+
this.accessibleFocus.emit(this.listElementId - 1);
|
|
145
|
+
break;
|
|
146
|
+
case KeyboardCode.ENTER:
|
|
147
|
+
event.preventDefault();
|
|
148
|
+
this.clickItem.emit(this.listElementId);
|
|
149
|
+
break;
|
|
150
|
+
}
|
|
151
|
+
if (!this.expandable || !expandByKey) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
this.showInnerContent = !this.showInnerContent;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Renders button to expand element.
|
|
158
|
+
* @returns expadable button
|
|
159
|
+
*/
|
|
160
|
+
renderExpandableButton() {
|
|
161
|
+
if (!this.expandable) {
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
164
|
+
return (h("z-icon", { name: this.showInnerContent
|
|
165
|
+
? this.openElementConfig[this.expandableStyle].open
|
|
166
|
+
: this.openElementConfig[this.expandableStyle].close }));
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Renders expanded content if element is expandable.
|
|
170
|
+
* @returns expanded content
|
|
171
|
+
*/
|
|
172
|
+
renderExpandedContent() {
|
|
173
|
+
if (!this.expandable) {
|
|
174
|
+
return null;
|
|
175
|
+
}
|
|
176
|
+
return (h("div", { class: {
|
|
177
|
+
"z-list-element-inner-container": true,
|
|
178
|
+
"expanded": this.showInnerContent,
|
|
179
|
+
} }, h("slot", { name: "inner-content" })));
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Renders content of the z-list-element
|
|
183
|
+
* @returns list content
|
|
184
|
+
*/
|
|
185
|
+
renderContent() {
|
|
186
|
+
if (this.listType === ListType.NONE) {
|
|
187
|
+
return h("slot", null);
|
|
188
|
+
}
|
|
189
|
+
if (this.listType === ListType.ORDERED) {
|
|
190
|
+
return (h("div", { class: "z-list-content-container" }, h("div", null, this.listElementPosition, ".\u2003"), h("slot", null)));
|
|
191
|
+
}
|
|
192
|
+
if (this.listType === ListType.UNORDERED) {
|
|
193
|
+
return (h("div", { class: "z-list-content-container" }, h("span", null, "\u2022\u2003"), h("slot", null)));
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
render() {
|
|
197
|
+
return (h(Host, { role: "listitem", "aria-expanded": this.expandable ? this.showInnerContent : null, onClick: this.handleClick, onKeyDown: this.handleKeyDown, clickable: this.clickable && !this.disabled, tabIndex: !this.isContextualMenu ? "0" : null }, h("div", { class: `${this.calculateClass()}`, style: { color: `var(--${this.color})` }, tabindex: this.isContextualMenu ? "0" : "-1", id: `z-list-element-id-${this.listElementId}` }, h("div", { class: "z-list-element-container" }, this.renderExpandableButton(), this.renderContent()), this.renderExpandedContent()), this.dividerType === ListDividerType.ELEMENT && (h("z-divider", { color: this.dividerColor, size: this.dividerSize }))));
|
|
198
|
+
}
|
|
199
|
+
get host() { return getElement(this); }
|
|
200
|
+
};
|
|
201
|
+
ZListElement.style = stylesCss$1;
|
|
202
|
+
|
|
203
|
+
const stylesCss = ":host{font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>.z-list-group-header-container{color:var(--gray700);font-size:var(--font-size-2);font-weight:var(--font-sb) !important;letter-spacing:0.16px;line-height:1.4}:host>.z-list-group-header-container.has-header{padding-top:var(--space-unit);padding-bottom:var(--space-unit)}:host>.z-list-group-header-container.has-header>z-divider{margin-top:var(--space-unit)}";
|
|
204
|
+
|
|
205
|
+
const ZListGroup = class {
|
|
206
|
+
constructor(hostRef) {
|
|
207
|
+
registerInstance(this, hostRef);
|
|
208
|
+
/**
|
|
209
|
+
* [optional] Sets size of inside elements.
|
|
210
|
+
*/
|
|
211
|
+
this.size = ListSize.MEDIUM;
|
|
212
|
+
/**
|
|
213
|
+
* [optional] Sets the position where to insert the divider.
|
|
214
|
+
*/
|
|
215
|
+
this.dividerType = ListDividerType.NONE;
|
|
216
|
+
/**
|
|
217
|
+
* [optional] Sets the divider size.
|
|
218
|
+
*/
|
|
219
|
+
this.dividerSize = DividerSize.SMALL;
|
|
220
|
+
/**
|
|
221
|
+
* [optional] Sets the divider color.
|
|
222
|
+
*/
|
|
223
|
+
this.dividerColor = "gray200";
|
|
224
|
+
/**
|
|
225
|
+
* [optional] type of the list marker for each element
|
|
226
|
+
*/
|
|
227
|
+
this.listType = ListType.NONE;
|
|
228
|
+
}
|
|
229
|
+
componentDidLoad() {
|
|
230
|
+
const children = this.host.children;
|
|
231
|
+
for (let i = 0; i < children.length; i++) {
|
|
232
|
+
if (children.length - 1 > i) {
|
|
233
|
+
children[i].setAttribute("divider-type", this.dividerType);
|
|
234
|
+
children[i].setAttribute("divider-size", this.dividerSize);
|
|
235
|
+
children[i].setAttribute("divider-color", this.dividerColor);
|
|
236
|
+
}
|
|
237
|
+
children[i].setAttribute("size", this.size);
|
|
238
|
+
children[i].setAttribute("list-type", this.listType);
|
|
239
|
+
children[i].setAttribute("list-element-position", i.toString());
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
componentWillLoad() {
|
|
243
|
+
this.hasHeader = !!this.host.querySelector('[slot="header-title"]');
|
|
244
|
+
}
|
|
245
|
+
render() {
|
|
246
|
+
return (h(Host, { role: "group" }, h("div", { class: {
|
|
247
|
+
"z-list-group-header-container": true,
|
|
248
|
+
"has-header": this.hasHeader,
|
|
249
|
+
} }, h("slot", { name: "header-title" }), this.dividerType === ListDividerType.HEADER && (h("z-divider", { color: this.dividerColor, size: this.dividerSize }))), h("slot", null)));
|
|
250
|
+
}
|
|
251
|
+
get host() { return getElement(this); }
|
|
252
|
+
};
|
|
253
|
+
ZListGroup.style = stylesCss;
|
|
254
|
+
|
|
255
|
+
export { ZList as z_list, ZListElement as z_list_element, ZListGroup as z_list_group };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h } from './index-a2ca4b97.js';
|
|
2
2
|
import { P as PopoverPosition } from './index-968a240f.js';
|
|
3
|
-
import { h as handleKeyboardSubmit } from './utils-
|
|
3
|
+
import { h as handleKeyboardSubmit } from './utils-6cf7efe2.js';
|
|
4
4
|
import './breakpoints-c386984e.js';
|
|
5
5
|
|
|
6
6
|
const stylesCss = ":host{width:100%;font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>div{position:relative;display:grid;width:calc(100% + calc(var(--space-unit) * 2));height:402px;box-sizing:border-box;padding:calc(var(--space-unit) * 2) calc(var(--space-unit) * 3);border:var(--border-size-small) solid var(--color-primary01);margin-left:calc(-1 * var(--space-unit));background:var(--color-surface01);border-radius:0;box-shadow:0 2px 4px 0 rgb(66 69 72 / 35%)}:host>div>z-icon{position:absolute;top:var(--space-unit);right:var(--space-unit);cursor:pointer;fill:var(--color-primary01)}:host>div>div.cta-wrapper{display:flex;flex-flow:column nowrap;align-self:end;justify-content:space-between}:host>div>div.content-wrapper{position:relative;overflow:hidden;align-self:stretch}:host>div>div.content-wrapper>section{box-sizing:border-box;padding:var(--space-unit) 0;border-bottom:var(--border-size-small) solid var(--color-surface04);color:var(--color-surface05);font-size:14px;line-height:20px}:host>div>div.content-wrapper>section:last-child{border-bottom:none}:host>div>div.content-wrapper>section.info-wrapper{position:relative;overflow:hidden;box-sizing:border-box}:host>div>div.content-wrapper>section.info-wrapper.hidden::after{position:absolute;top:0;right:0;bottom:0;left:0;background:linear-gradient(180deg, rgb(255 0 0 / 0%), rgb(255 0 0 / 0%) 60%, white);content:\"\";pointer-events:none}:host>div>div.content-wrapper>section>span.license-heading{display:flex;justify-content:space-between}:host>div>div.content-wrapper>section>span.license-heading>span.expired{color:var(--color-secondary02);font-size:12px;font-weight:600}:host>div>div.content-wrapper>section>span.license-heading>span.expiring{color:var(--color-warning01);font-size:12px;font-weight:600}:host>div>div.content-wrapper>z-popover{position:absolute;top:0;left:calc(var(--space-unit) * 4)}";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h } from './index-a2ca4b97.js';
|
|
2
|
-
import { h as handleKeyboardSubmit } from './utils-
|
|
2
|
+
import { h as handleKeyboardSubmit } from './utils-6cf7efe2.js';
|
|
3
3
|
import './index-968a240f.js';
|
|
4
4
|
import './breakpoints-c386984e.js';
|
|
5
5
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-a2ca4b97.js';
|
|
2
2
|
import { p as PocketStatus } from './index-968a240f.js';
|
|
3
|
-
import { h as handleKeyboardSubmit } from './utils-
|
|
3
|
+
import { h as handleKeyboardSubmit } from './utils-6cf7efe2.js';
|
|
4
4
|
import { h as hammer } from './hammer-c3266b17.js';
|
|
5
5
|
import './breakpoints-c386984e.js';
|
|
6
6
|
import './_commonjsHelpers-9943807e.js';
|