@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,1030 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-e3299e0a.js');
|
|
6
|
-
const index$1 = require('./index-fa110f37.js');
|
|
7
|
-
const icons = require('./icons-9e555ff7.js');
|
|
8
|
-
const utils = require('./utils-600bad93.js');
|
|
9
|
-
require('./breakpoints-88c4fd6c.js');
|
|
10
|
-
|
|
11
|
-
const stylesCss$9 = ":host{--app-header-content-max-width:100%;--app-header-height:auto;--app-header-typography-1-size:24px;--app-header-typography-2-size:28px;--app-header-typography-3-size:32px;--app-header-typography-4-size:36px;--app-header-typography-5-size:42px;--app-header-typography-6-size:48px;--app-header-typography-7-size:54px;--app-header-typography-8-size:60px;--app-header-typography-9-size:68px;--app-header-typography-10-size:76px;--app-header-typography-11-size:84px;--app-header-typography-12-size:92px;--app-header-typography-1-lineheight:1.33;--app-header-typography-2-lineheight:1.29;--app-header-typography-3-lineheight:1.25;--app-header-typography-4-lineheight:1.24;--app-header-typography-5-lineheight:1.24;--app-header-typography-6-lineheight:1.25;--app-header-typography-7-lineheight:1.2;--app-header-typography-8-lineheight:1.26;--app-header-typography-9-lineheight:1.24;--app-header-typography-10-lineheight:1.26;--app-header-typography-11-lineheight:1.2;--app-header-typography-12-lineheight:1.2;--app-header-typography-1-tracking:calc(-0.2 / 1em);--app-header-typography-2-tracking:calc(-0.4 / 1em);--app-header-typography-3-tracking:calc(-0.6 / 1em);--app-header-typography-4-tracking:calc(-0.8 / 1em);--app-header-typography-5-tracking:calc(-1 / 1em);--app-header-typography-6-tracking:calc(-1.2 / 1em);--app-header-typography-7-tracking:calc(-1.4 / 1em);--app-header-typography-8-tracking:calc(-1.6 / 1em);--app-header-typography-9-tracking:calc(-1.8 / 1em);--app-header-typography-10-tracking:calc(-2 / 1em);--app-header-typography-11-tracking:calc(-2.2 / 1em);--app-header-typography-12-tracking:calc(-2.4 / 1em);--app-header-top-offset:48px;--app-header-drawer-trigger-size:calc(var(--space-unit) * 4);--app-header-bg:var(--color-white);--app-header-stucked-bg:var(--color-white);--app-header-text-color:var(--gray800);--app-header-stucked-text-color:var(--gray800);display:block;color:var(--app-header-text-color)}:host,*{box-sizing:border-box}.heading-panel{position:relative;display:flex;width:100%;max-width:var(--app-header-content-max-width);height:var(--app-header-height);flex-direction:column;flex-grow:0;flex-shrink:0;align-items:baseline;justify-content:flex-start;padding:var(--grid-margin);margin:0 auto;background:var(--app-header-bg)}:host(:empty) .heading-panel{padding:0}.heading-title{display:flex;max-width:100%;flex-direction:row;align-items:center}:host(:not([menu-length=\"0\"])) .heading-subtitle{padding-left:calc(var(--app-header-drawer-trigger-size) + (var(--space-unit) * 1.5))}.heading-stuck{position:fixed;z-index:20;top:var(--app-header-top-offset);left:0;width:100%;max-width:100%;animation:slide-stuck-heading-in 250ms ease-out;background:var(--app-header-stucked-bg);box-shadow:var(--shadow-2);color:var(--app-header-stucked-text-color)}.heading-stuck-content{display:flex;max-width:var(--app-header-content-max-width);padding:var(--space-unit) var(--grid-margin);margin:0 auto}.heading-stuck .heading-title,.heading-stuck .heading-title>*,.heading-stuck .heading-title ::slotted([slot=\"stucked-title\"]){display:block;overflow:hidden;line-height:1.2;text-overflow:ellipsis;white-space:nowrap}.heading-stuck .heading-title>*,::slotted([slot=\"title\"]),::slotted([slot=\"stucked-title\"]){margin:0;font-family:\"IBM Plex Serif\", serif;font-size:var(--app-header-typography-3-size);font-weight:700;letter-spacing:var(--app-header-typography-3-tracking)}::slotted([slot=\"title\"]){line-height:1}::slotted([slot=\"subtitle\"]){margin:var(--space-unit) 0 0;font-family:var(--font-family-sans);font-size:20px;font-style:italic;font-weight:500;line-height:1.2}.heading-container{position:relative;z-index:1;display:flex;max-width:100%;flex-direction:column;align-items:flex-start;justify-content:flex-start;margin-right:auto}.menu-container{display:none;flex-flow:row wrap;align-items:baseline}.menu-container ::slotted([open]){position:relative;z-index:3}.menu-container ::slotted(*:not(:last-of-type)){margin-right:calc(var(--space-unit) * 4.5)}.drawer-trigger{padding:0;border:0;margin:0 calc(var(--space-unit) * 1.5) 0 0;appearance:none;background:none;border-radius:0;color:inherit;cursor:pointer}.drawer-trigger z-icon{--z-icon-width:var(--app-header-drawer-trigger-size);--z-icon-height:var(--app-header-drawer-trigger-size);fill:currentcolor}.drawer-container{position:fixed;z-index:100;top:var(--app-header-top-offset);left:0;width:100%;height:100%;pointer-events:none}.drawer-container .drawer-overlay{position:absolute;z-index:1;top:0;left:0;display:block;width:100%;height:100%;background:var(--gray900);opacity:0;pointer-events:none;transition:opacity 400ms ease-out}.drawer-panel{position:absolute;z-index:2;top:0;left:0;display:flex;width:375px;max-width:100%;height:100%;flex-direction:column;align-items:flex-start;padding:calc(var(--space-unit) * 2) var(--space-unit);background:var(--color-white);color:var(--gray800);pointer-events:none;transform:translate3d(-100%, 0, 0);transition:transform 400ms ease-out}.drawer-content{display:flex;overflow:auto;width:100%;flex:1 auto;flex-direction:column;padding:calc(var(--space-unit) * 0.5) var(--space-unit)}.drawer-content::-webkit-scrollbar{width:10px;background:linear-gradient(to right, transparent 0 3px, var(--gray200) 3px 7px, transparent 7px 10px);border-radius:var(--border-radius)}.drawer-content::-webkit-scrollbar-track{background-color:transparent}.drawer-content::-webkit-scrollbar-thumb{width:10px;background-color:var(--color-primary01);border-radius:var(--border-radius)}.drawer-content::-webkit-scrollbar-thumb:hover{background-color:var(--color-hover-primary)}.drawer-content ::slotted(z-menu){width:100%}.drawer-content ::slotted(z-menu:not(:last-of-type)){margin-bottom:calc(var(--space-unit) * 2.5)}.drawer-close{--z-icon-width:var(--app-header-drawer-trigger-size);--z-icon-height:var(--app-header-drawer-trigger-size);padding:0;border:0;margin:0 0 calc(var(--space-unit) * 2.5) var(--space-unit);appearance:none;background:transparent;border-radius:0;color:inherit;cursor:pointer;fill:currentcolor;font-size:inherit;outline:none}.drawer-close:focus-visible{box-shadow:var(--shadow-focus-primary)}:host([drawer-open]) .drawer-container .drawer-overlay{opacity:0.7;pointer-events:all}:host([drawer-open]) .drawer-container .drawer-panel{pointer-events:all;transform:none}.hero-container{position:absolute;z-index:0;top:0;left:0;width:100%;height:100%}:host([overlay]) .heading-panel .drawer-trigger z-icon,:host([overlay]) .heading-panel .heading-container,:host([overlay]) .heading-panel .menu-container{color:var(--color-white);fill:var(--color-white)}:host([overlay]) .heading-panel .menu-container ::slotted(z-menu:not([open])){--color-surface05:var(--color-white)}:host([overlay]) .hero-container::after{position:absolute;z-index:0;top:0;left:0;width:100%;height:100%;background:var(--color-black);content:\"\";opacity:0.5}.hero-container img,.hero-container ::slotted(*){position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover;object-position:top center;-webkit-user-drag:none}@media (min-width: 768px){:host(:not([flow=\"offcanvas\"])) .heading-subtitle{padding-left:0}:host(:not([flow=\"offcanvas\"])) .menu-container{display:flex}:host(:not([flow=\"offcanvas\"])) .heading-container .drawer-trigger{display:none}:host(:not([flow=\"offcanvas\"],[menu-length=\"0\"])) .heading-container:not(:last-child){margin-bottom:calc(var(--space-unit) * 3)}::slotted([slot=\"title\"]){font-size:var(--app-header-typography-6-size);letter-spacing:var(--app-header-typography-6-tracking)}::slotted([slot=\"subtitle\"]){margin-top:calc(var(--space-unit) * 1.5)}}@media (min-width: 1152px){:host(:not([flow=\"stack\"])) .heading-panel{flex-flow:row wrap}::slotted([slot=\"title\"]){margin-right:var(--grid-gutter);font-size:var(--app-header-typography-7-size);letter-spacing:var(--app-header-typography-7-tracking)}:host(:not([flow=\"offcanvas\"],[menu-length=\"0\"])) .heading-container:not(:last-child){margin-bottom:calc(var(--space-unit) * 2)}.menu-container{margin-top:var(--space-unit)}}@media (min-width: 1366px){::slotted([slot=\"title\"]){font-size:var(--app-header-typography-9-size);letter-spacing:var(--app-header-typography-9-tracking)}:host(:not([flow=\"offcanvas\"],[menu-length=\"0\"])) .heading-container:not(:last-child){margin-bottom:0}}@keyframes slide-stuck-heading-in{0%{transform:translate3d(0, -100%, 0)}100%{transform:none}}";
|
|
12
|
-
|
|
13
|
-
const SUPPORT_INTERSECTION_OBSERVER = typeof IntersectionObserver !== "undefined";
|
|
14
|
-
const ZAppHeader = class {
|
|
15
|
-
constructor(hostRef) {
|
|
16
|
-
index.registerInstance(this, hostRef);
|
|
17
|
-
this.sticking = index.createEvent(this, "sticking", 7);
|
|
18
|
-
/**
|
|
19
|
-
* Stuck mode for the header.
|
|
20
|
-
* You can programmatically set it using an IntersectionObserver.
|
|
21
|
-
* **Optional**
|
|
22
|
-
*/
|
|
23
|
-
this.stuck = false;
|
|
24
|
-
/**
|
|
25
|
-
* Should place an overlay over the hero image.
|
|
26
|
-
* Useful for legibility purpose.
|
|
27
|
-
* **Optional**
|
|
28
|
-
*/
|
|
29
|
-
this.overlay = false;
|
|
30
|
-
/**
|
|
31
|
-
* Control menu bar position in the header.
|
|
32
|
-
* - auto: the menu bar is positioned near the title
|
|
33
|
-
* - stack: the menu bar is positioned below the title
|
|
34
|
-
* - offcanvas: the menu bar is not displayed and a burger icon appears to open the offcanvas menu
|
|
35
|
-
*
|
|
36
|
-
* **Optional**
|
|
37
|
-
*/
|
|
38
|
-
this.flow = "auto";
|
|
39
|
-
/**
|
|
40
|
-
* The opening state of the drawer.
|
|
41
|
-
*/
|
|
42
|
-
this.drawerOpen = false;
|
|
43
|
-
/**
|
|
44
|
-
* The stuck state of the bar.
|
|
45
|
-
*/
|
|
46
|
-
this._stuck = false;
|
|
47
|
-
this.observer = SUPPORT_INTERSECTION_OBSERVER &&
|
|
48
|
-
new IntersectionObserver(([entry]) => {
|
|
49
|
-
this._stuck = !entry.isIntersecting;
|
|
50
|
-
}, {
|
|
51
|
-
threshold: 0.5,
|
|
52
|
-
});
|
|
53
|
-
this.openDrawer = this.openDrawer.bind(this);
|
|
54
|
-
this.closeDrawer = this.closeDrawer.bind(this);
|
|
55
|
-
this.collectMenuElements.bind(this);
|
|
56
|
-
}
|
|
57
|
-
emitStickingEvent() {
|
|
58
|
-
this.sticking.emit(this._stuck);
|
|
59
|
-
}
|
|
60
|
-
componentDidLoad() {
|
|
61
|
-
this.collectMenuElements();
|
|
62
|
-
this.onStuckMode();
|
|
63
|
-
}
|
|
64
|
-
get title() {
|
|
65
|
-
const titleElement = this.hostElement.querySelector('[slot="title"]');
|
|
66
|
-
if (titleElement === null) {
|
|
67
|
-
return "";
|
|
68
|
-
}
|
|
69
|
-
return titleElement.textContent.trim();
|
|
70
|
-
}
|
|
71
|
-
get scrollParent() {
|
|
72
|
-
const parent = this.hostElement.offsetParent;
|
|
73
|
-
if (parent === document.body || parent === document.documentElement) {
|
|
74
|
-
return window;
|
|
75
|
-
}
|
|
76
|
-
return parent;
|
|
77
|
-
}
|
|
78
|
-
collectMenuElements() {
|
|
79
|
-
const menuElements = (this.menuElements = this.hostElement.querySelectorAll('[slot="menu"]'));
|
|
80
|
-
this.menuLength = menuElements.length;
|
|
81
|
-
this.setMenuFloatingMode();
|
|
82
|
-
}
|
|
83
|
-
onStuckMode() {
|
|
84
|
-
if (this.stuck) {
|
|
85
|
-
this.enableStuckObserver();
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
this.disableStuckMode();
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
enableStuckObserver() {
|
|
92
|
-
if (this.observer) {
|
|
93
|
-
this.observer.observe(this.container);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
disableStuckMode() {
|
|
97
|
-
this._stuck = false;
|
|
98
|
-
if (this.observer) {
|
|
99
|
-
this.observer.unobserve(this.container);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
onStuck() {
|
|
103
|
-
const scrollParent = this.scrollParent;
|
|
104
|
-
if (!scrollParent) {
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
this.emitStickingEvent();
|
|
108
|
-
}
|
|
109
|
-
setMenuFloatingMode() {
|
|
110
|
-
if (this.menuElements.length === 0) {
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
const elements = this.menuElements;
|
|
114
|
-
for (let i = 0, len = elements.length; i < len; i++) {
|
|
115
|
-
elements[i].open = false;
|
|
116
|
-
elements[i].floating = !this.drawerOpen;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
render() {
|
|
120
|
-
return (index.h(index.Host, { "menu-length": this.menuLength }, index.h("div", { class: "heading-panel", ref: (el) => (this.container = el) }, index.h("div", { class: "hero-container" }, index.h("slot", { name: "hero" }, this.hero && (index.h("img", { alt: "", src: this.hero })))), index.h("div", { class: "heading-container" }, index.h("div", { class: "heading-title" }, this.menuLength > 0 && (index.h("button", { class: "drawer-trigger", "aria-label": "Apri menu", onClick: this.openDrawer }, index.h("z-icon", { name: "burger-menu" }))), index.h("slot", { name: "title" })), index.h("div", { class: "heading-subtitle" }, index.h("slot", { name: "subtitle" }))), index.h("div", { class: "menu-container" }, !this.drawerOpen && this.flow !== "offcanvas" && (index.h("slot", { name: "menu", onSlotchange: () => this.collectMenuElements() })))), index.h("div", { class: "drawer-container" }, index.h("div", { class: "drawer-overlay", onClick: this.closeDrawer }), index.h("div", { class: "drawer-panel" }, index.h("button", { class: "drawer-close", "aria-label": "Chiudi menu", onClick: this.closeDrawer }, index.h("z-icon", { name: "close" })), index.h("div", { class: "drawer-content" }, this.drawerOpen && (index.h("slot", { name: "menu", onSlotchange: () => this.collectMenuElements() }))))), this._stuck && (index.h("div", { class: "heading-stuck" }, index.h("div", { class: "heading-stuck-content" }, this.menuLength > 0 && (index.h("button", { class: "drawer-trigger", "aria-label": "Apri menu", onClick: this.openDrawer }, index.h("z-icon", { name: "burger-menu" }))), index.h("div", { class: "heading-title" }, index.h("slot", { name: "stucked-title" }, this.title)))))));
|
|
121
|
-
}
|
|
122
|
-
openDrawer() {
|
|
123
|
-
this.drawerOpen = true;
|
|
124
|
-
}
|
|
125
|
-
closeDrawer() {
|
|
126
|
-
this.drawerOpen = false;
|
|
127
|
-
}
|
|
128
|
-
get hostElement() { return index.getElement(this); }
|
|
129
|
-
static get watchers() { return {
|
|
130
|
-
"stuck": ["onStuckMode"],
|
|
131
|
-
"_stuck": ["onStuck"],
|
|
132
|
-
"drawerOpen": ["setMenuFloatingMode"]
|
|
133
|
-
}; }
|
|
134
|
-
};
|
|
135
|
-
ZAppHeader.style = stylesCss$9;
|
|
136
|
-
|
|
137
|
-
const ZBody = class {
|
|
138
|
-
constructor(hostRef) {
|
|
139
|
-
index.registerInstance(this, hostRef);
|
|
140
|
-
/** Font weight variant */
|
|
141
|
-
this.variant = "regular";
|
|
142
|
-
}
|
|
143
|
-
render() {
|
|
144
|
-
return (index.h("z-typography", { tabIndex: 0, component: this.component || "span", level: `b${this.level}`, variant: this.variant }, index.h("slot", null)));
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
const stylesCss$8 = ".sc-z-divider-h{display:block;padding:0;margin:0}.divider-horizontal.sc-z-divider-h{width:100%}.divider-vertical.sc-z-divider-h{height:100%}.divider-small.divider-horizontal.sc-z-divider-h{height:var(--border-size-small)}.divider-medium.divider-horizontal.sc-z-divider-h{height:var(--border-size-medium)}.divider-large.divider-horizontal.sc-z-divider-h{height:var(--border-size-large)}.divider-small.divider-vertical.sc-z-divider-h{width:var(--border-size-small)}.divider-medium.divider-vertical.sc-z-divider-h{width:var(--border-size-medium)}.divider-large.divider-vertical.sc-z-divider-h{width:var(--border-size-large)}";
|
|
149
|
-
|
|
150
|
-
const ZDivider = class {
|
|
151
|
-
constructor(hostRef) {
|
|
152
|
-
index.registerInstance(this, hostRef);
|
|
153
|
-
/** [optional] Divider size */
|
|
154
|
-
this.size = index$1.DividerSize.SMALL;
|
|
155
|
-
/** [optional] Divider color */
|
|
156
|
-
this.color = "gray200";
|
|
157
|
-
/** [optional] Divider orintation */
|
|
158
|
-
this.orientation = index$1.DividerOrientation.HORIZONTAL;
|
|
159
|
-
}
|
|
160
|
-
render() {
|
|
161
|
-
return (index.h(index.Host, { class: `divider-${this.size} divider-${this.orientation}`, style: { backgroundColor: `var(--${this.color})` } }));
|
|
162
|
-
}
|
|
163
|
-
};
|
|
164
|
-
ZDivider.style = stylesCss$8;
|
|
165
|
-
|
|
166
|
-
const stylesCss$7 = ":host{margin-right:var(--z-icon-right-margin, 0);margin-left:var(--z-icon-left-margin, 0);line-height:0;vertical-align:middle}:host svg:not([width]){width:var(--z-icon-width, 18px)}:host svg:not([height]){height:var(--z-icon-height, 18px)}";
|
|
167
|
-
|
|
168
|
-
const ZIcon = class {
|
|
169
|
-
constructor(hostRef) {
|
|
170
|
-
index.registerInstance(this, hostRef);
|
|
171
|
-
}
|
|
172
|
-
selectPathOrPolygon(iconValue) {
|
|
173
|
-
if (iconValue === null || iconValue === void 0 ? void 0 : iconValue.startsWith("M")) {
|
|
174
|
-
return index.h("path", { d: icons.ICONS[this.name] });
|
|
175
|
-
}
|
|
176
|
-
return index.h("polygon", { points: icons.ICONS[this.name] });
|
|
177
|
-
}
|
|
178
|
-
render() {
|
|
179
|
-
return (index.h(index.Host, { "aria-hidden": "true" }, index.h("svg", { viewBox: "0 0 1000 1000", width: this.width, height: this.height, id: this.iconid, fill: this.fill ? `var(--${this.fill})` : "" }, this.selectPathOrPolygon(icons.ICONS[this.name]))));
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
ZIcon.style = stylesCss$7;
|
|
183
|
-
|
|
184
|
-
const stylesCss$6 = ".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}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)}.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}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)}.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)}";
|
|
185
|
-
|
|
186
|
-
const ZInput = class {
|
|
187
|
-
constructor(hostRef) {
|
|
188
|
-
index.registerInstance(this, hostRef);
|
|
189
|
-
this.inputChange = index.createEvent(this, "inputChange", 7);
|
|
190
|
-
this.startTyping = index.createEvent(this, "startTyping", 7);
|
|
191
|
-
this.stopTyping = index.createEvent(this, "stopTyping", 7);
|
|
192
|
-
this.inputCheck = index.createEvent(this, "inputCheck", 7);
|
|
193
|
-
/** the id of the input element */
|
|
194
|
-
this.htmlid = `id-${utils.randomId()}`;
|
|
195
|
-
/** the input aria-label */
|
|
196
|
-
this.ariaLabel = "";
|
|
197
|
-
/** the input is disabled */
|
|
198
|
-
this.disabled = false;
|
|
199
|
-
/** the input is readonly */
|
|
200
|
-
this.readonly = false;
|
|
201
|
-
/** the input is required (optional): available for text, password, number, email, textarea, checkbox */
|
|
202
|
-
this.required = false;
|
|
203
|
-
/** checked: available for checkbox, radio */
|
|
204
|
-
this.checked = false;
|
|
205
|
-
/** input helper message (optional): available for text, password, number, email, textarea - if set to `false` message won't be displayed */
|
|
206
|
-
this.message = true;
|
|
207
|
-
/** the input label position: available for checkbox, radio */
|
|
208
|
-
this.labelPosition = index$1.LabelPosition.RIGHT;
|
|
209
|
-
/** render clear icon when typing (optional): available for text */
|
|
210
|
-
this.hasclearicon = true;
|
|
211
|
-
this.isTyping = false;
|
|
212
|
-
this.passwordHidden = true;
|
|
213
|
-
this.typingtimeout = 300;
|
|
214
|
-
}
|
|
215
|
-
inputCheckListener(e) {
|
|
216
|
-
const data = e.detail;
|
|
217
|
-
switch (this.type) {
|
|
218
|
-
case index$1.InputType.RADIO:
|
|
219
|
-
if (data.type === index$1.InputType.RADIO && data.name === this.name && data.id !== this.htmlid) {
|
|
220
|
-
this.checked = false;
|
|
221
|
-
}
|
|
222
|
-
break;
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
/** get checked status */
|
|
226
|
-
async isChecked() {
|
|
227
|
-
switch (this.type) {
|
|
228
|
-
case index$1.InputType.CHECKBOX:
|
|
229
|
-
case index$1.InputType.RADIO:
|
|
230
|
-
return this.checked;
|
|
231
|
-
default:
|
|
232
|
-
console.warn("`isChecked` method is only available for type `checkbox` and `radio`");
|
|
233
|
-
return false;
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
emitInputChange(value) {
|
|
237
|
-
if (!this.isTyping) {
|
|
238
|
-
this.emitStartTyping();
|
|
239
|
-
}
|
|
240
|
-
let validity;
|
|
241
|
-
if (this.type === index$1.InputType.TEXTAREA) {
|
|
242
|
-
validity = this.getValidity("textarea");
|
|
243
|
-
}
|
|
244
|
-
else {
|
|
245
|
-
validity = this.getValidity("input");
|
|
246
|
-
}
|
|
247
|
-
this.value = value;
|
|
248
|
-
this.inputChange.emit({ value, validity });
|
|
249
|
-
clearTimeout(this.timer);
|
|
250
|
-
this.timer = setTimeout(() => {
|
|
251
|
-
this.emitStopTyping(this.value, validity);
|
|
252
|
-
}, this.typingtimeout);
|
|
253
|
-
}
|
|
254
|
-
emitStartTyping() {
|
|
255
|
-
this.isTyping = true;
|
|
256
|
-
this.startTyping.emit();
|
|
257
|
-
}
|
|
258
|
-
emitStopTyping(value, validity) {
|
|
259
|
-
this.isTyping = false;
|
|
260
|
-
this.stopTyping.emit({
|
|
261
|
-
value: value,
|
|
262
|
-
validity: validity,
|
|
263
|
-
});
|
|
264
|
-
}
|
|
265
|
-
emitInputCheck(checked) {
|
|
266
|
-
this.inputCheck.emit({
|
|
267
|
-
id: this.htmlid,
|
|
268
|
-
checked: checked,
|
|
269
|
-
type: this.type,
|
|
270
|
-
name: this.name,
|
|
271
|
-
value: this.value,
|
|
272
|
-
validity: this.getValidity("input"),
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
getValidity(type) {
|
|
276
|
-
const input = this.hostElement.querySelector(type);
|
|
277
|
-
return input.validity;
|
|
278
|
-
}
|
|
279
|
-
/* START text/password/email/number */
|
|
280
|
-
getTextAttributes() {
|
|
281
|
-
return {
|
|
282
|
-
id: this.htmlid,
|
|
283
|
-
name: this.name,
|
|
284
|
-
placeholder: this.placeholder,
|
|
285
|
-
value: this.value,
|
|
286
|
-
disabled: this.disabled,
|
|
287
|
-
readonly: this.readonly,
|
|
288
|
-
required: this.required,
|
|
289
|
-
title: this.htmltitle,
|
|
290
|
-
class: {
|
|
291
|
-
[`input-${this.status}`]: !!this.status,
|
|
292
|
-
filled: !!this.value,
|
|
293
|
-
},
|
|
294
|
-
autocomplete: this.autocomplete,
|
|
295
|
-
onInput: (e) => this.emitInputChange(e.target.value),
|
|
296
|
-
};
|
|
297
|
-
}
|
|
298
|
-
getNumberAttributes(type) {
|
|
299
|
-
if (type != index$1.InputType.NUMBER) {
|
|
300
|
-
return;
|
|
301
|
-
}
|
|
302
|
-
return {
|
|
303
|
-
min: this.min,
|
|
304
|
-
max: this.max,
|
|
305
|
-
step: this.step,
|
|
306
|
-
};
|
|
307
|
-
}
|
|
308
|
-
getPatternAttribute(type) {
|
|
309
|
-
if (type != index$1.InputType.PASSWORD &&
|
|
310
|
-
type != index$1.InputType.TEXT &&
|
|
311
|
-
type != index$1.InputType.TEL &&
|
|
312
|
-
type != index$1.InputType.SEARCH &&
|
|
313
|
-
type != index$1.InputType.URL &&
|
|
314
|
-
type != index$1.InputType.EMAIL) {
|
|
315
|
-
return;
|
|
316
|
-
}
|
|
317
|
-
return {
|
|
318
|
-
pattern: this.pattern,
|
|
319
|
-
};
|
|
320
|
-
}
|
|
321
|
-
renderInputText(type = index$1.InputType.TEXT) {
|
|
322
|
-
const ariaLabel = this.ariaLabel ? { "aria-label": this.ariaLabel } : {};
|
|
323
|
-
const attr = Object.assign(Object.assign(Object.assign(Object.assign({}, this.getTextAttributes()), this.getNumberAttributes(type)), this.getPatternAttribute(type)), ariaLabel);
|
|
324
|
-
if (this.icon || type === index$1.InputType.PASSWORD) {
|
|
325
|
-
Object.assign(attr.class, { "has-icon": true });
|
|
326
|
-
}
|
|
327
|
-
if (this.hasclearicon && type != index$1.InputType.NUMBER) {
|
|
328
|
-
Object.assign(attr.class, { "has-clear-icon": true });
|
|
329
|
-
}
|
|
330
|
-
return (index.h("div", { class: "text-wrapper" }, this.renderLabel(), index.h("div", null, index.h("input", Object.assign({ type: type === index$1.InputType.PASSWORD && !this.passwordHidden ? index$1.InputType.TEXT : type }, attr)), this.renderIcons()), this.renderMessage()));
|
|
331
|
-
}
|
|
332
|
-
renderLabel() {
|
|
333
|
-
if (!this.label) {
|
|
334
|
-
return;
|
|
335
|
-
}
|
|
336
|
-
return (index.h("label", { class: "input-label body-5-sb", id: `${this.htmlid}_label`, htmlFor: this.htmlid }, this.label));
|
|
337
|
-
}
|
|
338
|
-
renderIcons() {
|
|
339
|
-
return (index.h("span", { class: "icons-wrapper" }, this.renderResetIcon(), this.renderIcon()));
|
|
340
|
-
}
|
|
341
|
-
renderIcon() {
|
|
342
|
-
if (this.type === index$1.InputType.PASSWORD) {
|
|
343
|
-
return this.renderShowHidePassword();
|
|
344
|
-
}
|
|
345
|
-
if (!this.icon) {
|
|
346
|
-
return;
|
|
347
|
-
}
|
|
348
|
-
return (index.h("button", { type: "button", class: "icon-button input-icon", tabIndex: -1 }, index.h("z-icon", { name: this.icon })));
|
|
349
|
-
}
|
|
350
|
-
renderResetIcon() {
|
|
351
|
-
if (!this.hasclearicon || !this.value || this.disabled || this.readonly || this.type == index$1.InputType.NUMBER) {
|
|
352
|
-
return;
|
|
353
|
-
}
|
|
354
|
-
return (index.h("button", { type: "button", class: "icon-button reset-icon", "aria-label": "cancella il contenuto dell'input", onClick: () => this.emitInputChange("") }, index.h("z-icon", { name: "multiply" })));
|
|
355
|
-
}
|
|
356
|
-
renderShowHidePassword() {
|
|
357
|
-
return (index.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) }, index.h("z-icon", { name: this.passwordHidden ? "view-filled" : "view-off-filled" })));
|
|
358
|
-
}
|
|
359
|
-
renderMessage() {
|
|
360
|
-
if (utils.boolean(this.message) === false) {
|
|
361
|
-
return;
|
|
362
|
-
}
|
|
363
|
-
return (index.h("z-input-message", { message: utils.boolean(this.message) === true ? undefined : this.message, status: this.status }));
|
|
364
|
-
}
|
|
365
|
-
/* END text/password/email/number */
|
|
366
|
-
/* START textarea */
|
|
367
|
-
renderTextarea() {
|
|
368
|
-
const attributes = this.getTextAttributes();
|
|
369
|
-
const ariaLabel = this.ariaLabel ? { "aria-label": this.ariaLabel } : {};
|
|
370
|
-
return (index.h("div", { class: "text-wrapper" }, this.renderLabel(), index.h("div", { class: Object.assign(Object.assign({}, attributes.class), { "textarea-wrapper": true, "readonly": attributes.readonly }) }, index.h("textarea", Object.assign({}, attributes, ariaLabel))), this.renderMessage()));
|
|
371
|
-
}
|
|
372
|
-
/* END textarea */
|
|
373
|
-
handleCheck(ev) {
|
|
374
|
-
this.checked = ev.target.checked;
|
|
375
|
-
this.emitInputCheck(this.checked);
|
|
376
|
-
}
|
|
377
|
-
/* START checkbox */
|
|
378
|
-
renderCheckbox() {
|
|
379
|
-
return (index.h("div", { class: "checkbox-wrapper" }, index.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 }), index.h("label", { htmlFor: this.htmlid, class: {
|
|
380
|
-
"checkbox-label": true,
|
|
381
|
-
"after": this.labelPosition === index$1.LabelPosition.RIGHT,
|
|
382
|
-
"before": this.labelPosition === index$1.LabelPosition.LEFT,
|
|
383
|
-
} }, index.h("z-icon", { name: this.checked ? "checkbox-checked" : "checkbox", "aria-hidden": "true" }), this.label && index.h("span", { innerHTML: this.label }))));
|
|
384
|
-
}
|
|
385
|
-
/* END checkbox */
|
|
386
|
-
/* START radio */
|
|
387
|
-
renderRadio() {
|
|
388
|
-
return (index.h("div", { class: "radio-wrapper" }, index.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 }), index.h("label", { htmlFor: this.htmlid, class: {
|
|
389
|
-
"radio-label": true,
|
|
390
|
-
"after": this.labelPosition === index$1.LabelPosition.RIGHT,
|
|
391
|
-
"before": this.labelPosition === index$1.LabelPosition.LEFT,
|
|
392
|
-
} }, index.h("z-icon", { name: this.checked ? "radio-button-checked" : "radio-button", "aria-hidden": "true" }), this.label && index.h("span", { innerHTML: this.label }))));
|
|
393
|
-
}
|
|
394
|
-
/* END radio */
|
|
395
|
-
render() {
|
|
396
|
-
switch (this.type) {
|
|
397
|
-
case index$1.InputType.TEXTAREA:
|
|
398
|
-
return this.renderTextarea();
|
|
399
|
-
case index$1.InputType.CHECKBOX:
|
|
400
|
-
return this.renderCheckbox();
|
|
401
|
-
case index$1.InputType.RADIO:
|
|
402
|
-
return this.renderRadio();
|
|
403
|
-
default:
|
|
404
|
-
return this.renderInputText(this.type);
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
get hostElement() { return index.getElement(this); }
|
|
408
|
-
};
|
|
409
|
-
ZInput.style = stylesCss$6;
|
|
410
|
-
|
|
411
|
-
const stylesCss$5 = ":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)}";
|
|
412
|
-
|
|
413
|
-
const ZInputMessage = class {
|
|
414
|
-
constructor(hostRef) {
|
|
415
|
-
index.registerInstance(this, hostRef);
|
|
416
|
-
this.statusIcons = {
|
|
417
|
-
success: "checkmark-circle",
|
|
418
|
-
error: "multiply-circled",
|
|
419
|
-
warning: "exclamation-circle",
|
|
420
|
-
};
|
|
421
|
-
this.statusRole = {};
|
|
422
|
-
}
|
|
423
|
-
onMessageChange() {
|
|
424
|
-
this.statusRole = this.message && this.status ? { role: "alert" } : {};
|
|
425
|
-
}
|
|
426
|
-
componentWillLoad() {
|
|
427
|
-
this.onMessageChange();
|
|
428
|
-
}
|
|
429
|
-
render() {
|
|
430
|
-
return (index.h(index.Host, Object.assign({}, this.statusRole, { "aria-label": this.message }), this.statusIcons[this.status] && this.message && index.h("z-icon", { name: this.statusIcons[this.status] }), index.h("span", { innerHTML: this.message })));
|
|
431
|
-
}
|
|
432
|
-
static get watchers() { return {
|
|
433
|
-
"message": ["onMessageChange"],
|
|
434
|
-
"status": ["onMessageChange"]
|
|
435
|
-
}; }
|
|
436
|
-
};
|
|
437
|
-
ZInputMessage.style = stylesCss$5;
|
|
438
|
-
|
|
439
|
-
const stylesCss$4 = ":host{display:flex;flex-direction:column;font-family:var(--font-family-sans);font-weight:var(--font-rg)}";
|
|
440
|
-
|
|
441
|
-
const ZList = class {
|
|
442
|
-
constructor(hostRef) {
|
|
443
|
-
index.registerInstance(this, hostRef);
|
|
444
|
-
/**
|
|
445
|
-
* [optional] Sets size of inside elements.
|
|
446
|
-
*/
|
|
447
|
-
this.size = index$1.ListSize.MEDIUM;
|
|
448
|
-
/**
|
|
449
|
-
* [optional] type of the list marker for each element
|
|
450
|
-
*/
|
|
451
|
-
this.listType = index$1.ListType.NONE;
|
|
452
|
-
}
|
|
453
|
-
setChildrenSizeType() {
|
|
454
|
-
const children = this.host.children;
|
|
455
|
-
for (let i = 0; i < children.length; i++) {
|
|
456
|
-
children[i].setAttribute("size", this.size);
|
|
457
|
-
children[i].setAttribute("list-type", this.listType);
|
|
458
|
-
children[i].setAttribute("list-element-position", (i + 1).toString());
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
componentDidLoad() {
|
|
462
|
-
this.setChildrenSizeType();
|
|
463
|
-
}
|
|
464
|
-
render() {
|
|
465
|
-
return (index.h(index.Host, { role: "list" }, index.h("slot", null)));
|
|
466
|
-
}
|
|
467
|
-
get host() { return index.getElement(this); }
|
|
468
|
-
};
|
|
469
|
-
ZList.style = stylesCss$4;
|
|
470
|
-
|
|
471
|
-
const stylesCss$3 = ":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}";
|
|
472
|
-
|
|
473
|
-
const ZListElement = class {
|
|
474
|
-
/**
|
|
475
|
-
* Constructor.
|
|
476
|
-
*/
|
|
477
|
-
constructor(hostRef) {
|
|
478
|
-
index.registerInstance(this, hostRef);
|
|
479
|
-
this.accessibleFocus = index.createEvent(this, "accessibleFocus", 7);
|
|
480
|
-
this.clickItem = index.createEvent(this, "clickItem", 7);
|
|
481
|
-
/**
|
|
482
|
-
* [optional] Align expandable button left or right.
|
|
483
|
-
*/
|
|
484
|
-
this.alignButton = index$1.ExpandableListButtonAlign.LEFT;
|
|
485
|
-
/**
|
|
486
|
-
* [optional] Sets element clickable.
|
|
487
|
-
*/
|
|
488
|
-
this.clickable = false;
|
|
489
|
-
/**
|
|
490
|
-
* [optional] Sets the divider color.
|
|
491
|
-
*/
|
|
492
|
-
this.dividerColor = "color-surface03";
|
|
493
|
-
/**
|
|
494
|
-
* [optional] Sets the position where to insert the divider.
|
|
495
|
-
*/
|
|
496
|
-
this.dividerType = index$1.ListDividerType.NONE;
|
|
497
|
-
/**
|
|
498
|
-
* [optional] Sets the divider size.
|
|
499
|
-
*/
|
|
500
|
-
this.dividerSize = index$1.DividerSize.SMALL;
|
|
501
|
-
/**
|
|
502
|
-
* [optional] Sets element as expandable.
|
|
503
|
-
*/
|
|
504
|
-
this.expandable = false;
|
|
505
|
-
/**
|
|
506
|
-
* [optional] Sets expandable style to element.
|
|
507
|
-
*/
|
|
508
|
-
this.expandableStyle = index$1.ExpandableListStyle.ACCORDION;
|
|
509
|
-
/**
|
|
510
|
-
* [optional] Sets size of inside elements.
|
|
511
|
-
*/
|
|
512
|
-
this.size = index$1.ListSize.MEDIUM;
|
|
513
|
-
/**
|
|
514
|
-
* [optional] Sets text color of the element.
|
|
515
|
-
*/
|
|
516
|
-
this.color = "none";
|
|
517
|
-
/**
|
|
518
|
-
* [optional] Sets disabled style of the element.
|
|
519
|
-
*/
|
|
520
|
-
this.disabled = false;
|
|
521
|
-
/**
|
|
522
|
-
* [optional] If is used in ZContextualMenu component
|
|
523
|
-
*/
|
|
524
|
-
this.isContextualMenu = false;
|
|
525
|
-
/**
|
|
526
|
-
* [optional] position of the list element inside the list or the group
|
|
527
|
-
*/
|
|
528
|
-
this.listElementPosition = "0";
|
|
529
|
-
/**
|
|
530
|
-
* [optional] type of the list marker for each element
|
|
531
|
-
*/
|
|
532
|
-
this.listType = index$1.ListType.NONE;
|
|
533
|
-
this.showInnerContent = false;
|
|
534
|
-
this.openElementConfig = {
|
|
535
|
-
accordion: {
|
|
536
|
-
open: "minus-circled",
|
|
537
|
-
close: "plus-circled",
|
|
538
|
-
},
|
|
539
|
-
menu: {
|
|
540
|
-
open: "chevron-up",
|
|
541
|
-
close: "chevron-down",
|
|
542
|
-
},
|
|
543
|
-
};
|
|
544
|
-
this.handleClick = this.handleClick.bind(this);
|
|
545
|
-
this.handleKeyDown = this.handleKeyDown.bind(this);
|
|
546
|
-
}
|
|
547
|
-
accessibleFocusHandler(e) {
|
|
548
|
-
if (this.listElementId === e.detail) {
|
|
549
|
-
const toFocus = this.host.shadowRoot.getElementById(`z-list-element-id-${e.detail}`);
|
|
550
|
-
toFocus.focus();
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
/**
|
|
554
|
-
* Handler for click on element. If element is expandable, change state.
|
|
555
|
-
* @returns void
|
|
556
|
-
*/
|
|
557
|
-
handleClick() {
|
|
558
|
-
this.clickItem.emit(this.listElementId);
|
|
559
|
-
if (!this.expandable) {
|
|
560
|
-
return;
|
|
561
|
-
}
|
|
562
|
-
this.showInnerContent = !this.showInnerContent;
|
|
563
|
-
}
|
|
564
|
-
calculateClass() {
|
|
565
|
-
if (this.isContextualMenu) {
|
|
566
|
-
return "container-contextual-menu";
|
|
567
|
-
}
|
|
568
|
-
return "container";
|
|
569
|
-
}
|
|
570
|
-
handleKeyDown(event) {
|
|
571
|
-
const expandByKey = event.code === index$1.KeyboardCode.ENTER;
|
|
572
|
-
switch (event.code) {
|
|
573
|
-
case index$1.KeyboardCode.ARROW_DOWN:
|
|
574
|
-
event.preventDefault();
|
|
575
|
-
this.accessibleFocus.emit(this.listElementId + 1);
|
|
576
|
-
break;
|
|
577
|
-
case index$1.KeyboardCode.ARROW_UP:
|
|
578
|
-
event.preventDefault();
|
|
579
|
-
this.accessibleFocus.emit(this.listElementId - 1);
|
|
580
|
-
break;
|
|
581
|
-
case index$1.KeyboardCode.ENTER:
|
|
582
|
-
event.preventDefault();
|
|
583
|
-
this.clickItem.emit(this.listElementId);
|
|
584
|
-
break;
|
|
585
|
-
}
|
|
586
|
-
if (!this.expandable || !expandByKey) {
|
|
587
|
-
return;
|
|
588
|
-
}
|
|
589
|
-
this.showInnerContent = !this.showInnerContent;
|
|
590
|
-
}
|
|
591
|
-
/**
|
|
592
|
-
* Renders button to expand element.
|
|
593
|
-
* @returns expadable button
|
|
594
|
-
*/
|
|
595
|
-
renderExpandableButton() {
|
|
596
|
-
if (!this.expandable) {
|
|
597
|
-
return null;
|
|
598
|
-
}
|
|
599
|
-
return (index.h("z-icon", { name: this.showInnerContent
|
|
600
|
-
? this.openElementConfig[this.expandableStyle].open
|
|
601
|
-
: this.openElementConfig[this.expandableStyle].close }));
|
|
602
|
-
}
|
|
603
|
-
/**
|
|
604
|
-
* Renders expanded content if element is expandable.
|
|
605
|
-
* @returns expanded content
|
|
606
|
-
*/
|
|
607
|
-
renderExpandedContent() {
|
|
608
|
-
if (!this.expandable) {
|
|
609
|
-
return null;
|
|
610
|
-
}
|
|
611
|
-
return (index.h("div", { class: {
|
|
612
|
-
"z-list-element-inner-container": true,
|
|
613
|
-
"expanded": this.showInnerContent,
|
|
614
|
-
} }, index.h("slot", { name: "inner-content" })));
|
|
615
|
-
}
|
|
616
|
-
/**
|
|
617
|
-
* Renders content of the z-list-element
|
|
618
|
-
* @returns list content
|
|
619
|
-
*/
|
|
620
|
-
renderContent() {
|
|
621
|
-
if (this.listType === index$1.ListType.NONE) {
|
|
622
|
-
return index.h("slot", null);
|
|
623
|
-
}
|
|
624
|
-
if (this.listType === index$1.ListType.ORDERED) {
|
|
625
|
-
return (index.h("div", { class: "z-list-content-container" }, index.h("div", null, this.listElementPosition, ".\u2003"), index.h("slot", null)));
|
|
626
|
-
}
|
|
627
|
-
if (this.listType === index$1.ListType.UNORDERED) {
|
|
628
|
-
return (index.h("div", { class: "z-list-content-container" }, index.h("span", null, "\u2022\u2003"), index.h("slot", null)));
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
render() {
|
|
632
|
-
return (index.h(index.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 }, index.h("div", { class: `${this.calculateClass()}`, style: { color: `var(--${this.color})` }, tabindex: this.isContextualMenu ? "0" : "-1", id: `z-list-element-id-${this.listElementId}` }, index.h("div", { class: "z-list-element-container" }, this.renderExpandableButton(), this.renderContent()), this.renderExpandedContent()), this.dividerType === index$1.ListDividerType.ELEMENT && (index.h("z-divider", { color: this.dividerColor, size: this.dividerSize }))));
|
|
633
|
-
}
|
|
634
|
-
get host() { return index.getElement(this); }
|
|
635
|
-
};
|
|
636
|
-
ZListElement.style = stylesCss$3;
|
|
637
|
-
|
|
638
|
-
const stylesCss$2 = ":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)}";
|
|
639
|
-
|
|
640
|
-
const ZListGroup = class {
|
|
641
|
-
constructor(hostRef) {
|
|
642
|
-
index.registerInstance(this, hostRef);
|
|
643
|
-
/**
|
|
644
|
-
* [optional] Sets size of inside elements.
|
|
645
|
-
*/
|
|
646
|
-
this.size = index$1.ListSize.MEDIUM;
|
|
647
|
-
/**
|
|
648
|
-
* [optional] Sets the position where to insert the divider.
|
|
649
|
-
*/
|
|
650
|
-
this.dividerType = index$1.ListDividerType.NONE;
|
|
651
|
-
/**
|
|
652
|
-
* [optional] Sets the divider size.
|
|
653
|
-
*/
|
|
654
|
-
this.dividerSize = index$1.DividerSize.SMALL;
|
|
655
|
-
/**
|
|
656
|
-
* [optional] Sets the divider color.
|
|
657
|
-
*/
|
|
658
|
-
this.dividerColor = "gray200";
|
|
659
|
-
/**
|
|
660
|
-
* [optional] type of the list marker for each element
|
|
661
|
-
*/
|
|
662
|
-
this.listType = index$1.ListType.NONE;
|
|
663
|
-
}
|
|
664
|
-
componentDidLoad() {
|
|
665
|
-
const children = this.host.children;
|
|
666
|
-
for (let i = 0; i < children.length; i++) {
|
|
667
|
-
if (children.length - 1 > i) {
|
|
668
|
-
children[i].setAttribute("divider-type", this.dividerType);
|
|
669
|
-
children[i].setAttribute("divider-size", this.dividerSize);
|
|
670
|
-
children[i].setAttribute("divider-color", this.dividerColor);
|
|
671
|
-
}
|
|
672
|
-
children[i].setAttribute("size", this.size);
|
|
673
|
-
children[i].setAttribute("list-type", this.listType);
|
|
674
|
-
children[i].setAttribute("list-element-position", i.toString());
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
componentWillLoad() {
|
|
678
|
-
this.hasHeader = !!this.host.querySelector('[slot="header-title"]');
|
|
679
|
-
}
|
|
680
|
-
render() {
|
|
681
|
-
return (index.h(index.Host, { role: "group" }, index.h("div", { class: {
|
|
682
|
-
"z-list-group-header-container": true,
|
|
683
|
-
"has-header": this.hasHeader,
|
|
684
|
-
} }, index.h("slot", { name: "header-title" }), this.dividerType === index$1.ListDividerType.HEADER && (index.h("z-divider", { color: this.dividerColor, size: this.dividerSize }))), index.h("slot", null)));
|
|
685
|
-
}
|
|
686
|
-
get host() { return index.getElement(this); }
|
|
687
|
-
};
|
|
688
|
-
ZListGroup.style = stylesCss$2;
|
|
689
|
-
|
|
690
|
-
const stylesCss$1 = ".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)}.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.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:0 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-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}";
|
|
691
|
-
|
|
692
|
-
const ZSelect = class {
|
|
693
|
-
constructor(hostRef) {
|
|
694
|
-
index.registerInstance(this, hostRef);
|
|
695
|
-
this.optionSelect = index.createEvent(this, "optionSelect", 7);
|
|
696
|
-
this.resetSelect = index.createEvent(this, "resetSelect", 7);
|
|
697
|
-
/** the id of the input element */
|
|
698
|
-
this.htmlid = `id-${utils.randomId()}`;
|
|
699
|
-
/** the input aria-label */
|
|
700
|
-
this.ariaLabel = "";
|
|
701
|
-
/** the input is disabled */
|
|
702
|
-
this.disabled = false;
|
|
703
|
-
/** the input is readonly */
|
|
704
|
-
this.readonly = false;
|
|
705
|
-
/** input helper message (optional) - if set to `false` message won't be displayed */
|
|
706
|
-
this.message = true;
|
|
707
|
-
/** the input has autocomplete option */
|
|
708
|
-
this.autocomplete = false;
|
|
709
|
-
/** no result text message */
|
|
710
|
-
this.noresultslabel = "Nessun risultato";
|
|
711
|
-
this.isOpen = false;
|
|
712
|
-
this.selectedItem = null;
|
|
713
|
-
this.itemsList = [];
|
|
714
|
-
this.toggleSelectUl = this.toggleSelectUl.bind(this);
|
|
715
|
-
this.selectItem = this.selectItem.bind(this);
|
|
716
|
-
this.handleSelectFocus = this.handleSelectFocus.bind(this);
|
|
717
|
-
}
|
|
718
|
-
watchItems() {
|
|
719
|
-
this.itemsList = this.getInitialItemsArray();
|
|
720
|
-
this.selectedItem = this.itemsList.find((item) => item.selected);
|
|
721
|
-
}
|
|
722
|
-
/** get the input selected options */
|
|
723
|
-
async getSelectedItem() {
|
|
724
|
-
return this.selectedItem;
|
|
725
|
-
}
|
|
726
|
-
/** get the input value */
|
|
727
|
-
async getValue() {
|
|
728
|
-
return this.getSelectedValue();
|
|
729
|
-
}
|
|
730
|
-
/** set the input value */
|
|
731
|
-
async setValue(value) {
|
|
732
|
-
let values = [];
|
|
733
|
-
if (typeof value === "string") {
|
|
734
|
-
values.push(value);
|
|
735
|
-
}
|
|
736
|
-
else {
|
|
737
|
-
values = value;
|
|
738
|
-
}
|
|
739
|
-
this.selectedItem = this.itemsList.find((item) => values.includes(item.id));
|
|
740
|
-
}
|
|
741
|
-
emitOptionSelect() {
|
|
742
|
-
this.optionSelect.emit({
|
|
743
|
-
id: this.htmlid,
|
|
744
|
-
selected: this.getSelectedValue(),
|
|
745
|
-
});
|
|
746
|
-
}
|
|
747
|
-
emitResetSelect() {
|
|
748
|
-
this.resetSelect.emit({
|
|
749
|
-
id: this.htmlid,
|
|
750
|
-
});
|
|
751
|
-
}
|
|
752
|
-
componentWillLoad() {
|
|
753
|
-
this.watchItems();
|
|
754
|
-
}
|
|
755
|
-
componentWillRender() {
|
|
756
|
-
this.filterItems(this.searchString);
|
|
757
|
-
}
|
|
758
|
-
getInitialItemsArray() {
|
|
759
|
-
return typeof this.items === "string" ? JSON.parse(this.items) : this.items;
|
|
760
|
-
}
|
|
761
|
-
mapSelectedItemToItemsArray() {
|
|
762
|
-
const initialItemsList = this.getInitialItemsArray();
|
|
763
|
-
return initialItemsList.map((item) => {
|
|
764
|
-
var _a;
|
|
765
|
-
item.selected = item.id === ((_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.id);
|
|
766
|
-
return item;
|
|
767
|
-
});
|
|
768
|
-
}
|
|
769
|
-
getSelectedValue() {
|
|
770
|
-
var _a;
|
|
771
|
-
return (_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.id;
|
|
772
|
-
}
|
|
773
|
-
filterItems(searchString) {
|
|
774
|
-
const prevList = this.mapSelectedItemToItemsArray();
|
|
775
|
-
if (!(searchString === null || searchString === void 0 ? void 0 : searchString.length)) {
|
|
776
|
-
this.itemsList = prevList;
|
|
777
|
-
}
|
|
778
|
-
else {
|
|
779
|
-
this.itemsList = prevList
|
|
780
|
-
.filter((item) => {
|
|
781
|
-
return item.name.toUpperCase().includes(searchString.toUpperCase());
|
|
782
|
-
})
|
|
783
|
-
.map((item) => {
|
|
784
|
-
const start = item.name.toUpperCase().indexOf(searchString.toUpperCase());
|
|
785
|
-
const end = start + searchString.length;
|
|
786
|
-
const newName = item.name.substring(0, start) +
|
|
787
|
-
`<strong>${item.name.substring(start, end)}</strong>` +
|
|
788
|
-
item.name.substring(end, item.name.length);
|
|
789
|
-
item.name = newName;
|
|
790
|
-
return item;
|
|
791
|
-
});
|
|
792
|
-
}
|
|
793
|
-
}
|
|
794
|
-
hasAutocomplete() {
|
|
795
|
-
return utils.boolean(this.autocomplete) === true;
|
|
796
|
-
}
|
|
797
|
-
handleInputChange(e) {
|
|
798
|
-
this.searchString = e.detail.value;
|
|
799
|
-
if (!this.isOpen) {
|
|
800
|
-
this.toggleSelectUl();
|
|
801
|
-
}
|
|
802
|
-
}
|
|
803
|
-
selectItem(item, selected) {
|
|
804
|
-
if (item && item.disabled) {
|
|
805
|
-
return;
|
|
806
|
-
}
|
|
807
|
-
this.itemsList = this.mapSelectedItemToItemsArray();
|
|
808
|
-
this.itemsList = this.itemsList.map((i) => {
|
|
809
|
-
i.selected = false;
|
|
810
|
-
if (i.id === (item === null || item === void 0 ? void 0 : item.id)) {
|
|
811
|
-
i.selected = selected;
|
|
812
|
-
}
|
|
813
|
-
return i;
|
|
814
|
-
});
|
|
815
|
-
this.selectedItem = this.itemsList.find((item) => item.selected);
|
|
816
|
-
this.emitOptionSelect();
|
|
817
|
-
if (this.searchString) {
|
|
818
|
-
this.searchString = null;
|
|
819
|
-
}
|
|
820
|
-
}
|
|
821
|
-
arrowsSelectNav(e, key) {
|
|
822
|
-
const showResetIcon = this.resetItem && !!this.selectedItem;
|
|
823
|
-
const arrows = [index$1.KeyboardCode.ARROW_DOWN, index$1.KeyboardCode.ARROW_UP];
|
|
824
|
-
if (!arrows.includes(e.key)) {
|
|
825
|
-
return;
|
|
826
|
-
}
|
|
827
|
-
e.preventDefault();
|
|
828
|
-
e.stopPropagation();
|
|
829
|
-
if (!this.isOpen) {
|
|
830
|
-
this.toggleSelectUl();
|
|
831
|
-
}
|
|
832
|
-
let index;
|
|
833
|
-
if (this.resetItem) {
|
|
834
|
-
if (e.key === index$1.KeyboardCode.ARROW_DOWN) {
|
|
835
|
-
index = key + 1 === this.itemsList.length + 1 ? +!showResetIcon : key + 1;
|
|
836
|
-
}
|
|
837
|
-
else if (e.key === index$1.KeyboardCode.ARROW_UP) {
|
|
838
|
-
index = key <= +!showResetIcon ? this.itemsList.length : key - 1;
|
|
839
|
-
}
|
|
840
|
-
}
|
|
841
|
-
if (!this.resetItem) {
|
|
842
|
-
if (e.key === index$1.KeyboardCode.ARROW_DOWN) {
|
|
843
|
-
index = key + 1 === this.itemsList.length ? 0 : key + 1;
|
|
844
|
-
}
|
|
845
|
-
else if (e.key === index$1.KeyboardCode.ARROW_UP) {
|
|
846
|
-
index = key <= 0 ? this.itemsList.length - 1 : key - 1;
|
|
847
|
-
}
|
|
848
|
-
}
|
|
849
|
-
this.focusSelectItem(index);
|
|
850
|
-
}
|
|
851
|
-
focusSelectItem(index) {
|
|
852
|
-
const focusElem = this.element.querySelector(`#${this.htmlid}_${index}`);
|
|
853
|
-
if (focusElem) {
|
|
854
|
-
focusElem.focus();
|
|
855
|
-
}
|
|
856
|
-
}
|
|
857
|
-
toggleSelectUl(selfFocusOnClose = false) {
|
|
858
|
-
if (this.disabled || this.readonly) {
|
|
859
|
-
return;
|
|
860
|
-
}
|
|
861
|
-
if (!this.isOpen) {
|
|
862
|
-
document.addEventListener("click", this.handleSelectFocus);
|
|
863
|
-
document.addEventListener("keyup", this.handleSelectFocus);
|
|
864
|
-
}
|
|
865
|
-
else {
|
|
866
|
-
document.removeEventListener("click", this.handleSelectFocus);
|
|
867
|
-
document.removeEventListener("keyup", this.handleSelectFocus);
|
|
868
|
-
if (selfFocusOnClose) {
|
|
869
|
-
this.element.querySelector(`#${this.htmlid}_input`).focus();
|
|
870
|
-
}
|
|
871
|
-
}
|
|
872
|
-
this.isOpen = !this.isOpen;
|
|
873
|
-
}
|
|
874
|
-
handleInputClick(e) {
|
|
875
|
-
const cp = e.composedPath();
|
|
876
|
-
const clearIcon = cp.find((item) => item.classList && item.classList.contains("reset-icon"));
|
|
877
|
-
if (clearIcon) {
|
|
878
|
-
e.stopPropagation();
|
|
879
|
-
return;
|
|
880
|
-
}
|
|
881
|
-
this.toggleSelectUl();
|
|
882
|
-
}
|
|
883
|
-
handleSelectFocus(e) {
|
|
884
|
-
if (e instanceof KeyboardEvent && e.key === index$1.KeyboardCode.ESC) {
|
|
885
|
-
e.stopPropagation();
|
|
886
|
-
return this.toggleSelectUl(true);
|
|
887
|
-
}
|
|
888
|
-
if (e instanceof KeyboardEvent && e.key !== index$1.KeyboardCode.TAB && e.key !== index$1.KeyboardCode.ENTER) {
|
|
889
|
-
return;
|
|
890
|
-
}
|
|
891
|
-
const tree = utils.getElementTree(utils.getClickedElement());
|
|
892
|
-
const parent = tree.find((elem) => {
|
|
893
|
-
return elem.nodeName.toLowerCase() === "z-input" && elem.id === `${this.htmlid}_input`;
|
|
894
|
-
});
|
|
895
|
-
if (!parent) {
|
|
896
|
-
this.toggleSelectUl(e instanceof MouseEvent ? true : false);
|
|
897
|
-
}
|
|
898
|
-
}
|
|
899
|
-
scrollToLetter(letter) {
|
|
900
|
-
const foundItem = this.itemsList.find((item) => item.name.charAt(0) === letter);
|
|
901
|
-
if (foundItem) {
|
|
902
|
-
this.focusSelectItem(this.itemsList.indexOf(foundItem));
|
|
903
|
-
}
|
|
904
|
-
}
|
|
905
|
-
renderInput() {
|
|
906
|
-
return (index.h("z-input", { id: `${this.htmlid}_input`, htmlid: `${this.htmlid}_input`, placeholder: this.placeholder, value: !this.isOpen && this.selectedItem ? this.selectedItem.name.replace(/<[^>]+>/g, "") : null, label: this.label, "aria-label": this.ariaLabel, icon: this.isOpen ? "caret-up" : "caret-down", hasclearicon: this.hasAutocomplete(), message: false, disabled: this.disabled, readonly: this.readonly || (!this.hasAutocomplete() && this.isOpen), status: this.isOpen ? undefined : this.status, autocomplete: "off", onClick: (e) => {
|
|
907
|
-
this.handleInputClick(e);
|
|
908
|
-
}, onKeyUp: (e) => {
|
|
909
|
-
if (e.keyCode !== 13) {
|
|
910
|
-
e.preventDefault();
|
|
911
|
-
}
|
|
912
|
-
utils.handleKeyboardSubmit(e, this.toggleSelectUl);
|
|
913
|
-
}, onKeyDown: (e) => {
|
|
914
|
-
return this.arrowsSelectNav(e, this.selectedItem ? this.itemsList.indexOf(this.selectedItem) : this.resetItem ? 0 : -1);
|
|
915
|
-
}, onInputChange: (e) => {
|
|
916
|
-
this.handleInputChange(e);
|
|
917
|
-
}, onKeyPress: (e) => {
|
|
918
|
-
if (!this.hasAutocomplete()) {
|
|
919
|
-
e.preventDefault();
|
|
920
|
-
this.scrollToLetter(String.fromCharCode(e.keyCode));
|
|
921
|
-
}
|
|
922
|
-
} }));
|
|
923
|
-
}
|
|
924
|
-
renderSelectUl() {
|
|
925
|
-
var _a;
|
|
926
|
-
return (index.h("div", { class: this.isOpen ? "open" : "closed", tabindex: "-1" }, index.h("div", { class: "ul-scroll-wrapper", tabindex: "-1" }, index.h("z-list", { role: "listbox", tabindex: this.disabled || this.readonly || !this.isOpen ? -1 : 0, id: this.htmlid, "aria-activedescendant": (_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.id, "aria-multiselectable": false, class: {
|
|
927
|
-
disabled: this.disabled,
|
|
928
|
-
readonly: this.readonly,
|
|
929
|
-
filled: !!this.selectedItem,
|
|
930
|
-
[`input-${this.status}`]: !this.isOpen && !!this.status,
|
|
931
|
-
} }, this.resetItem && this.renderResetItem(), this.renderSelectUlItems()))));
|
|
932
|
-
}
|
|
933
|
-
renderResetItem() {
|
|
934
|
-
return (index.h("z-list-element", { class: {
|
|
935
|
-
"hide": !this.selectedItem || !this.resetItem,
|
|
936
|
-
"reset-item": true,
|
|
937
|
-
"reset-item-margin": !this.hasGroupItems,
|
|
938
|
-
}, clickable: true, disabled: false, dividerType: index$1.ListDividerType.ELEMENT, role: "option", tabindex: "0", "aria-selected": "false", id: `${this.htmlid}_${this.resetItem ? "0" : "none"}`, onClickItem: () => {
|
|
939
|
-
this.selectedItem = null;
|
|
940
|
-
this.searchString = null;
|
|
941
|
-
this.emitResetSelect();
|
|
942
|
-
}, 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))));
|
|
943
|
-
}
|
|
944
|
-
renderItem(item, key, lastItem) {
|
|
945
|
-
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, id: `${this.htmlid}_${key}`, onClickItem: () => this.selectItem(item, true), onKeyDown: (e) => this.arrowsSelectNav(e, key) }, index.h("span", { class: {
|
|
946
|
-
"selected": !!item.selected,
|
|
947
|
-
"list-element-content": true,
|
|
948
|
-
}, innerHTML: item.name })));
|
|
949
|
-
}
|
|
950
|
-
renderSelectUlItems() {
|
|
951
|
-
if (!this.itemsList.length) {
|
|
952
|
-
return this.renderNoSearchResults();
|
|
953
|
-
}
|
|
954
|
-
if (this.hasGroupItems) {
|
|
955
|
-
return this.renderSelectGroupItems();
|
|
956
|
-
}
|
|
957
|
-
return this.itemsList.map((item, key, array) => {
|
|
958
|
-
const lastItem = array.length === key + 1;
|
|
959
|
-
const itemKey = this.resetItem ? key + 1 : key;
|
|
960
|
-
return this.renderItem(item, itemKey, lastItem);
|
|
961
|
-
});
|
|
962
|
-
}
|
|
963
|
-
renderSelectGroupItems() {
|
|
964
|
-
const newData = this.itemsList.reduce((group, item, index, array) => {
|
|
965
|
-
var _a;
|
|
966
|
-
const { category } = item;
|
|
967
|
-
const lastItem = array.length === index + 1;
|
|
968
|
-
const itemKey = this.resetItem ? index + 1 : index;
|
|
969
|
-
const zListItem = this.renderItem(item, itemKey, lastItem);
|
|
970
|
-
group[category] = (_a = group[category]) !== null && _a !== void 0 ? _a : [];
|
|
971
|
-
group[category].push(zListItem);
|
|
972
|
-
return group;
|
|
973
|
-
}, {});
|
|
974
|
-
return Object.entries(newData).map(([key, value]) => {
|
|
975
|
-
return (index.h("z-list-group", { "divider-type": index$1.ListDividerType.ELEMENT }, index.h("z-body", { class: "z-list-group-title", level: 3, slot: "header-title", variant: "semibold" }, key), value.map((item) => item)));
|
|
976
|
-
});
|
|
977
|
-
}
|
|
978
|
-
renderNoSearchResults() {
|
|
979
|
-
return (index.h("z-list-element", { color: "blue500", class: "no-results" }, index.h("z-icon", { name: "multiply-circle", fill: "blue500" }), this.noresultslabel));
|
|
980
|
-
}
|
|
981
|
-
renderMessage() {
|
|
982
|
-
if (utils.boolean(this.message) === false) {
|
|
983
|
-
return;
|
|
984
|
-
}
|
|
985
|
-
return (index.h("z-input-message", { message: utils.boolean(this.message) === true ? undefined : this.message, status: this.status }));
|
|
986
|
-
}
|
|
987
|
-
render() {
|
|
988
|
-
return (index.h("div", { class: "select-wrapper" }, this.renderInput(), this.renderSelectUl(), this.renderMessage()));
|
|
989
|
-
}
|
|
990
|
-
get element() { return index.getElement(this); }
|
|
991
|
-
static get watchers() { return {
|
|
992
|
-
"items": ["watchItems"]
|
|
993
|
-
}; }
|
|
994
|
-
};
|
|
995
|
-
ZSelect.style = stylesCss$1;
|
|
996
|
-
|
|
997
|
-
const stylesCss = ":host>*{margin:0;font-family:var(--dashboard-font)}:host(.regular)>*{font-weight:var(--font-rg)}:host(.semibold)>*{font-weight:600}:host(.light)>*{font-weight:300}:host(.h1)>*{font-size:32px;line-height:40px}:host(.h2)>*{font-size:28px;line-height:36px}:host(.h3)>*{font-size:24px;line-height:32px}:host(.h4)>*{font-size:20px;line-height:28px}:host(.b1)>*{font-size:20px;line-height:28px}:host(.b2)>*{font-size:18px;line-height:28px}:host(.b3)>*{font-size:16px;line-height:24px}:host(.b4)>*{font-size:14px;line-height:20px}:host(.b5)>*{font-size:12px;line-height:16px}:host(:focus-visible){outline:none}";
|
|
998
|
-
|
|
999
|
-
const ZTypography = class {
|
|
1000
|
-
constructor(hostRef) {
|
|
1001
|
-
index.registerInstance(this, hostRef);
|
|
1002
|
-
/** Font weight variant */
|
|
1003
|
-
this.variant = "regular";
|
|
1004
|
-
}
|
|
1005
|
-
render() {
|
|
1006
|
-
const el = document.createElement(this.component || "span");
|
|
1007
|
-
el.innerHTML = `<slot />`;
|
|
1008
|
-
this.hostElement.shadowRoot.appendChild(el);
|
|
1009
|
-
return (index.h(index.Host, { class: {
|
|
1010
|
-
[this.level]: Boolean(this.level),
|
|
1011
|
-
regular: this.variant === "regular",
|
|
1012
|
-
semibold: this.variant === "semibold",
|
|
1013
|
-
light: this.variant === "light",
|
|
1014
|
-
} }));
|
|
1015
|
-
}
|
|
1016
|
-
get hostElement() { return index.getElement(this); }
|
|
1017
|
-
};
|
|
1018
|
-
ZTypography.style = stylesCss;
|
|
1019
|
-
|
|
1020
|
-
exports.z_app_header = ZAppHeader;
|
|
1021
|
-
exports.z_body = ZBody;
|
|
1022
|
-
exports.z_divider = ZDivider;
|
|
1023
|
-
exports.z_icon = ZIcon;
|
|
1024
|
-
exports.z_input = ZInput;
|
|
1025
|
-
exports.z_input_message = ZInputMessage;
|
|
1026
|
-
exports.z_list = ZList;
|
|
1027
|
-
exports.z_list_element = ZListElement;
|
|
1028
|
-
exports.z_list_group = ZListGroup;
|
|
1029
|
-
exports.z_select = ZSelect;
|
|
1030
|
-
exports.z_typography = ZTypography;
|