@zanichelli/albe-web-components 7.3.1 → 7.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index-e3299e0a.js +6 -30
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/web-components-library.cjs.js +1 -1
- package/dist/cjs/z-app-header_11.cjs.entry.js +1052 -0
- package/dist/cjs/z-dragdrop-area_2.cjs.entry.js +865 -2
- package/dist/cjs/z-menu-section.cjs.entry.js +1 -1
- package/dist/cjs/z-menu.cjs.entry.js +1 -1
- package/dist/cjs/z-popover.cjs.entry.js +2 -1
- package/dist/cjs/z-tooltip.cjs.entry.js +8 -2
- package/dist/collection/components/inputs/z-searchbar/index.js +6 -17
- package/dist/collection/components/inputs/z-searchbar/styles.css +46 -95
- package/dist/collection/components/modal/z-modal/index.js +8 -1
- package/dist/collection/components/modal/z-modal/styles.css +13 -0
- package/dist/collection/components/navigation/z-app-header/index.js +171 -47
- package/dist/collection/components/navigation/z-app-header/index.stories.js +393 -0
- package/dist/collection/components/navigation/z-app-header/styles.css +167 -166
- package/dist/collection/components/navigation/z-menu/index.js +1 -0
- package/dist/collection/components/navigation/z-menu/styles.css +7 -7
- package/dist/collection/components/navigation/z-menu-section/styles.css +8 -9
- package/dist/collection/components/notification/z-tooltip/index.js +28 -4
- package/dist/collection/components/notification/z-tooltip/styles.css +1 -0
- package/dist/collection/components/z-offcanvas/index.js +34 -50
- package/dist/collection/components/z-popover/index.js +3 -2
- package/dist/esm/index-a2ca4b97.js +6 -30
- 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-970ac457.js → utils-a52a81ba.js} +1 -1
- package/dist/esm/web-components-library.js +1 -1
- package/dist/esm/z-app-header_11.entry.js +1038 -0
- package/dist/esm/z-chip.entry.js +1 -1
- package/dist/esm/z-combobox.entry.js +1 -1
- package/dist/esm/z-dragdrop-area_2.entry.js +865 -2
- package/dist/esm/z-file-upload.entry.js +1 -1
- package/dist/esm/z-menu-section.entry.js +1 -1
- package/dist/esm/z-menu.entry.js +1 -1
- 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-popover.entry.js +2 -1
- package/dist/esm/z-select.entry.js +1 -1
- 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-header.entry.js +1 -1
- package/dist/esm/z-toggle-switch.entry.js +1 -1
- package/dist/esm/z-tooltip.entry.js +8 -2
- 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 -2
- package/dist/types/components/inputs/z-select/index.d.ts +0 -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 +0 -0
- 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 +49 -17
- package/dist/types/components/navigation/z-link/index.d.ts +0 -0
- package/dist/types/components/navigation/z-menu/index.d.ts +1 -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 +9 -3
- 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 +10 -12
- package/dist/types/components/z-pagination/index.d.ts +0 -0
- package/dist/types/components/z-popover/index.d.ts +2 -1
- 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 +51 -15
- package/dist/types/constants/breakpoints.d.ts +0 -0
- package/dist/types/constants/icons.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-1f259ec0.entry.js → p-0bf3a704.entry.js} +1 -1
- package/{www/build/p-d982fc4c.entry.js → dist/web-components-library/p-10e036e4.entry.js} +1 -1
- package/dist/web-components-library/p-161a4e84.entry.js +1 -0
- package/dist/web-components-library/{p-dfc69cc3.js → p-1c6b0e09.js} +1 -1
- package/dist/web-components-library/{p-10625725.entry.js → p-1e71778f.entry.js} +1 -1
- package/dist/web-components-library/{p-068951a7.entry.js → p-1eaef57d.entry.js} +1 -1
- package/dist/web-components-library/p-27441384.entry.js +1 -0
- package/dist/web-components-library/{p-779c8d20.entry.js → p-378e3fd3.entry.js} +1 -1
- package/dist/web-components-library/{p-e2758870.entry.js → p-5c5a2680.entry.js} +1 -1
- package/dist/web-components-library/p-6d377fcb.entry.js +1 -0
- package/{www/build/p-191c9901.entry.js → dist/web-components-library/p-84b23d4b.entry.js} +1 -1
- package/dist/web-components-library/p-8ff45f5f.entry.js +1 -0
- package/dist/web-components-library/p-a7249453.entry.js +1 -0
- package/dist/web-components-library/p-b36fc3db.entry.js +1 -0
- package/dist/web-components-library/{p-bca446ef.entry.js → p-c9bb584c.entry.js} +1 -1
- package/dist/web-components-library/{p-59b1f1e9.entry.js → p-d986024a.entry.js} +1 -1
- package/dist/web-components-library/p-eefde77a.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 +3 -2
- package/www/build/index.esm.js +1 -1
- package/www/build/{p-1f259ec0.entry.js → p-0bf3a704.entry.js} +1 -1
- package/{dist/web-components-library/p-d982fc4c.entry.js → www/build/p-10e036e4.entry.js} +1 -1
- package/www/build/p-161a4e84.entry.js +1 -0
- package/www/build/{p-dfc69cc3.js → p-1c6b0e09.js} +1 -1
- package/www/build/{p-10625725.entry.js → p-1e71778f.entry.js} +1 -1
- package/www/build/{p-068951a7.entry.js → p-1eaef57d.entry.js} +1 -1
- package/www/build/p-27441384.entry.js +1 -0
- package/www/build/{p-779c8d20.entry.js → p-378e3fd3.entry.js} +1 -1
- package/www/build/{p-e2758870.entry.js → p-5c5a2680.entry.js} +1 -1
- package/www/build/p-6d377fcb.entry.js +1 -0
- package/www/build/p-70021fac.js +1 -0
- package/{dist/web-components-library/p-191c9901.entry.js → www/build/p-84b23d4b.entry.js} +1 -1
- package/www/build/p-8ff45f5f.entry.js +1 -0
- package/www/build/p-a7249453.entry.js +1 -0
- package/www/build/p-b36fc3db.entry.js +1 -0
- package/www/build/{p-bca446ef.entry.js → p-c9bb584c.entry.js} +1 -1
- package/www/build/{p-59b1f1e9.entry.js → p-d986024a.entry.js} +1 -1
- package/www/build/p-eefde77a.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/CHANGELOG.md +0 -2439
- package/dist/cjs/z-app-header_2.cjs.entry.js +0 -152
- package/dist/cjs/z-button.cjs.entry.js +0 -43
- package/dist/cjs/z-divider.cjs.entry.js +0 -26
- package/dist/cjs/z-input_2.cjs.entry.js +0 -273
- package/dist/cjs/z-list_3.cjs.entry.js +0 -261
- package/dist/cjs/z-offcanvas.cjs.entry.js +0 -57
- package/dist/cjs/z-searchbar.cjs.entry.js +0 -248
- package/dist/esm/z-app-header_2.entry.js +0 -147
- package/dist/esm/z-button.entry.js +0 -39
- package/dist/esm/z-divider.entry.js +0 -22
- package/dist/esm/z-input_2.entry.js +0 -268
- package/dist/esm/z-list_3.entry.js +0 -255
- package/dist/esm/z-offcanvas.entry.js +0 -53
- package/dist/esm/z-searchbar.entry.js +0 -244
- package/dist/web-components-library/p-1570917d.entry.js +0 -1
- package/dist/web-components-library/p-157aea3b.entry.js +0 -1
- package/dist/web-components-library/p-1c8e7c24.entry.js +0 -1
- package/dist/web-components-library/p-20682781.entry.js +0 -1
- package/dist/web-components-library/p-3d0f5e36.entry.js +0 -1
- package/dist/web-components-library/p-4f266607.entry.js +0 -1
- package/dist/web-components-library/p-51c946a5.entry.js +0 -1
- package/dist/web-components-library/p-975afabe.entry.js +0 -1
- package/dist/web-components-library/p-af283478.entry.js +0 -1
- package/dist/web-components-library/p-bae1911e.entry.js +0 -1
- package/dist/web-components-library/p-d0760bb1.entry.js +0 -1
- package/dist/web-components-library/p-deda8776.entry.js +0 -1
- package/dist/web-components-library/p-f3a8cc14.entry.js +0 -1
- package/src-react/index.ts +0 -1
- package/www/build/p-1570917d.entry.js +0 -1
- package/www/build/p-157aea3b.entry.js +0 -1
- package/www/build/p-1c8e7c24.entry.js +0 -1
- package/www/build/p-20682781.entry.js +0 -1
- package/www/build/p-3d0f5e36.entry.js +0 -1
- package/www/build/p-4f266607.entry.js +0 -1
- package/www/build/p-51c946a5.entry.js +0 -1
- package/www/build/p-77d28b14.js +0 -1
- package/www/build/p-975afabe.entry.js +0 -1
- package/www/build/p-af283478.entry.js +0 -1
- package/www/build/p-bae1911e.entry.js +0 -1
- package/www/build/p-d0760bb1.entry.js +0 -1
- package/www/build/p-deda8776.entry.js +0 -1
- package/www/build/p-f3a8cc14.entry.js +0 -1
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-a2ca4b97.js';
|
|
2
|
-
import { h as ListSize, m as ListType, j as ExpandableListButtonAlign, l as ListDividerType, D as DividerSize, E as ExpandableListStyle, f as KeyboardCode } from './index-e36ec4a4.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}`, part: "list-item-container" }, 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,53 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a2ca4b97.js';
|
|
2
|
-
import { O as OffCanvasVariant, v as TransitionDirection } from './index-e36ec4a4.js';
|
|
3
|
-
|
|
4
|
-
const stylesCss = ".sc-z-offcanvas-h{--z-offcanvas--container-width:375px;--z-offcanvas--top-space:0;min-width:100%;height:100%;font-family:var(--font-family-sans);font-weight:var(--font-rg);visibility:hidden}.canvas-container.sc-z-offcanvas{display:flex;overflow:-moz-scrollbars-none;overflow:hidden;min-width:100%;height:100%;flex-direction:column;background:var(--color-surface01)}[variant=\"pushcontent\"].sc-z-offcanvas-h{display:none}[open].sc-z-offcanvas-h{display:flex;visibility:visible}[variant=\"overlay\"].sc-z-offcanvas-h{position:fixed;z-index:1000;top:var(--z-offcanvas--top-space);right:0;bottom:0;left:0;display:flex;height:calc(100% - var(--z-offcanvas--top-space))}[variant=\"overlay\"][transitiondirection=\"left\"].sc-z-offcanvas-h{justify-content:end}[variant=\"overlay\"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas{z-index:1010}[variant=\"overlay\"].sc-z-offcanvas-h .canvas-background.sc-z-offcanvas{position:absolute;left:0;width:100%;height:100%;background-color:var(--gray900);opacity:0.7}.canvas-container.sc-z-offcanvas>.canvas-content.sc-z-offcanvas{overflow:auto;flex:1 auto;padding:0 calc(var(--space-unit) * 2);margin:calc(var(--space-unit) * 2) calc(var(--space-unit) / 2) calc(var(--space-unit) * 2) 0;overflow-x:hidden}[variant=\"overlay\"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas>.canvas-content.sc-z-offcanvas{padding:0 calc(var(--space-unit) * 2) calc(var(--space-unit) * 2) calc(var(--space-unit) * 2);margin:calc(var(--space-unit) * 2) calc(var(--space-unit) / 2) 0 0}.canvas-container.sc-z-offcanvas .canvas-content.sc-z-offcanvas::-webkit-scrollbar{width:10px;background:linear-gradient(to right, transparent 0 3px, var(--gray200) 3px 7px, transparent 7px 10px);border-radius:var(--border-radius)}.canvas-container.sc-z-offcanvas .canvas-content.sc-z-offcanvas::-webkit-scrollbar-track{background-color:transparent}.canvas-container.sc-z-offcanvas .canvas-content.sc-z-offcanvas::-webkit-scrollbar-thumb{width:10px;background-color:var(--color-primary01);border-radius:var(--border-radius)}.canvas-container.sc-z-offcanvas .canvas-content.sc-z-offcanvas::-webkit-scrollbar-thumb:hover{background-color:var(--color-hover-primary)}.canvas-container.sc-z-offcanvas .canvas-content.sc-z-offcanvas{scrollbar-color:var(--color-primary01) transparent}@media only screen and (max-width: 768px){[open][transitiondirection=\"left\"].sc-z-offcanvas-h:not(.skip-animation)>.canvas-container.sc-z-offcanvas{animation:enter-right 0.4s ease-out}[open][transitiondirection=\"right\"].sc-z-offcanvas-h:not(.skip-animation)>.canvas-container.sc-z-offcanvas{animation:enter-left 0.4s ease-out}}@media only screen and (min-width: 768px){.sc-z-offcanvas-h{min-width:auto}.canvas-container.sc-z-offcanvas{width:auto;min-width:max(var(--z-offcanvas--container-width), 375px);max-width:max(var(--z-offcanvas--container-width), 375px);height:auto;min-height:calc(var(--space-unit) * 40)}.sc-z-offcanvas-h:not([variant=\"overlay\"])[open]:not(.skip-animation){width:auto;animation:grow 0.4s ease-out}}@keyframes grow{from{width:0}to{width:max(var(--z-offcanvas--container-width), 375px)}}@keyframes enter-left{from{transform:translateX(-100%)}to{transform:translateX(0)}}@keyframes enter-right{from{transform:translateX(100%)}to{transform:translateX(0)}}[open][variant=\"overlay\"][transitiondirection=\"left\"].sc-z-offcanvas-h:not(.skip-animation)>.canvas-container.sc-z-offcanvas{animation:enter-right 0.4s ease-out}[open][transitiondirection=\"right\"].sc-z-offcanvas-h:not(.skip-animation)>.canvas-container.sc-z-offcanvas{animation:enter-left 0.4s ease-out}.sc-z-offcanvas-h:not([open])[variant=\"overlay\"][transitiondirection=\"right\"]>.canvas-container.sc-z-offcanvas{transform:translateX(-100%);transition:visibility 0.4s ease-out, transform 0.4s ease-out}.sc-z-offcanvas-h:not([open])[variant=\"overlay\"][transitiondirection=\"left\"]>.canvas-container.sc-z-offcanvas{transform:translateX(100%);transition:visibility 0.4s ease-out, transform 0.4s ease-out}.sc-z-offcanvas-h:not([open])[variant=\"overlay\"] .canvas-background.sc-z-offcanvas{transition:visibility 0.4s ease-out;visibility:hidden}";
|
|
5
|
-
|
|
6
|
-
const ZOffcanvas = class {
|
|
7
|
-
constructor(hostRef) {
|
|
8
|
-
registerInstance(this, hostRef);
|
|
9
|
-
this.canvasOpenStatusChanged = createEvent(this, "canvasOpenStatusChanged", 7);
|
|
10
|
-
/**
|
|
11
|
-
* Offcanvas variant.
|
|
12
|
-
* Can be one of "overlay", "pushcontent"
|
|
13
|
-
* Default variant: pushcontent
|
|
14
|
-
*/
|
|
15
|
-
this.variant = OffCanvasVariant.PUSHCONTENT;
|
|
16
|
-
/** open component. Default: false */
|
|
17
|
-
this.open = false;
|
|
18
|
-
/** open content transitioning in a specified direction left | right. Default: left */
|
|
19
|
-
this.transitiondirection = TransitionDirection.LEFT;
|
|
20
|
-
/** manages the skip for the entry animation*/
|
|
21
|
-
this.skipanimationonload = false;
|
|
22
|
-
}
|
|
23
|
-
/** this method allows you to skip the page loading animation, to be used with the prop set to true */
|
|
24
|
-
async setSkipAanimationOnLoad(value) {
|
|
25
|
-
this.skipanimationonload = value;
|
|
26
|
-
}
|
|
27
|
-
onOpenChanged() {
|
|
28
|
-
if (!this.open && this.skipanimationonload) {
|
|
29
|
-
this.skipanimationonload = false;
|
|
30
|
-
}
|
|
31
|
-
if (this.open) {
|
|
32
|
-
this.handleOverflowProperty();
|
|
33
|
-
}
|
|
34
|
-
this.canvasOpenStatusChanged.emit(this.open);
|
|
35
|
-
}
|
|
36
|
-
handleOverflowProperty() {
|
|
37
|
-
const overflow = this.variant === OffCanvasVariant.OVERLAY ? "overflow-y" : "overflow-x";
|
|
38
|
-
document.body.style[overflow] = this.open ? "hidden" : "";
|
|
39
|
-
}
|
|
40
|
-
handledTransitionEnd() {
|
|
41
|
-
this.handleOverflowProperty();
|
|
42
|
-
}
|
|
43
|
-
render() {
|
|
44
|
-
return (h(Host, { class: { "skip-animation": this.skipanimationonload } }, h("div", { role: "presentation", class: "canvas-container", onTransitionEnd: () => this.handledTransitionEnd() }, h("div", { role: "presentation", class: "canvas-content" }, h("slot", { name: "canvasContent" }))), this.variant == OffCanvasVariant.OVERLAY && (h("div", { class: "canvas-background", "data-action": "canvasBackground", onClick: () => (this.open = false) }))));
|
|
45
|
-
}
|
|
46
|
-
get hostElement() { return getElement(this); }
|
|
47
|
-
static get watchers() { return {
|
|
48
|
-
"open": ["onOpenChanged"]
|
|
49
|
-
}; }
|
|
50
|
-
};
|
|
51
|
-
ZOffcanvas.style = stylesCss;
|
|
52
|
-
|
|
53
|
-
export { ZOffcanvas as z_offcanvas };
|
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host } from './index-a2ca4b97.js';
|
|
2
|
-
import { d as ControlSize, B as ButtonVariant, l as ListDividerType } from './index-e36ec4a4.js';
|
|
3
|
-
import { r as randomId, a as handleEnterKeydSubmit } from './utils-970ac457.js';
|
|
4
|
-
import './breakpoints-c386984e.js';
|
|
5
|
-
|
|
6
|
-
const stylesCss = ":host{position:relative;z-index:5;display:block;width:inherit;height:44px;font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>div{position:absolute;z-index:10;display:grid;width:100%;gap:0 calc(var(--space-unit) * 2);grid-template-columns:auto;grid-template-rows:auto}:host>div.has-submit{grid-template-columns:auto min-content}:host>div.has-results{grid-template-rows:auto auto}:host>div>z-input{width:100%;grid-column:1;grid-row:1}:host>div>z-button{grid-column:2;grid-row:1}:host>div>div.results-wrapper{overflow:auto;padding:calc(var(--space-unit) / 4);padding-bottom:calc(var(--space-unit) / 4);border:var(--border-size-small) solid var(--color-surface03);border-top:none;margin-top:-1px;background:var(--color-surface01);grid-column:1;grid-row:2}:host>div>div.results-wrapper>div.results{overflow:auto;max-height:var(--z-searchbar-results-height, 540px);padding:var(--space-unit) calc(var(--space-unit) * 1.5);padding-bottom:calc(var(--space-unit) / 2);scrollbar-color:var(--color-primary01) transparent}:host>div>div.results-wrapper>div.results::-webkit-scrollbar{width:10px;background:linear-gradient(to right, transparent 0 3px, var(--gray200) 3px 7px, transparent 7px 10px);border-radius:var(--border-radius)}:host>div>div.results-wrapper>div.results::-webkit-scrollbar-track{background-color:transparent}:host>div>div.results-wrapper>div.results::-webkit-scrollbar-thumb{width:10px;background-color:var(--color-primary01);border-radius:var(--border-radius)}:host>div>div.results-wrapper>div.results .category-heading{display:block;font-size:var(--font-size-2);font-weight:var(--font-rg);line-height:var(--font-size-3)}:host>div>div.results-wrapper>div.results .category-heading>*{display:block}:host>div>div.results-wrapper>div.results span.category-heading>span.category{color:var(--color-text05);font-style:italic}:host>div>div.results-wrapper>div.results span.category-heading>span.subcategory{margin-top:8px;color:var(--color-text01);text-transform:uppercase}:host>div>div.results-wrapper>div.results z-list-element{display:block}:host>div>div.results-wrapper>div.results z-list-element:focus{box-shadow:var(--shadow-focus-primary)}:host>div>div.results-wrapper>div.results .item{--z-icon-height:12px;--z-icon-width:12px;display:flex;flex-flow:row nowrap;align-content:stretch;align-items:flex-start;justify-content:flex-start;color:var(--color-text01);fill:var(--color-icon02);font-size:var(--font-size-2);line-height:var(--font-size-3)}:host>div>div.results-wrapper>div.results .item.ellipsis>span.item-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host>div>div.results-wrapper>div.results .item>span.item-label>mark,:host>div>div.results-wrapper>div.results .item>span.item-label>*>mark{background:var(--color-primary03)}:host>div>div.results-wrapper>div.results .item.has-category{padding-left:calc(var(--space-unit) * 3)}:host>div>div.results-wrapper>div.results .item>z-icon.item-icon{padding:2px 0;margin-right:calc(var(--space-unit) * 1.5)}:host>div>div.results-wrapper>div.results .item.item-search{--z-icon-height:16px;--z-icon-width:16px}:host>div>div.results-wrapper>div.results .item.item-search>z-icon{margin-right:var(--space-unit)}:host>div>div.results-wrapper>div.results .item-show-all{display:block;text-align:center}:host>div>div.results-wrapper>div.results .item-no-results{display:block;font-size:var(--font-size-2);font-style:italic;line-height:var(--font-size-5)}:host>div>div.results-wrapper>div.results .item-no-results>ul{padding-left:calc(var(--space-unit) * 2);margin:var(--space-unit)}@media (min-width: 768px){:host>div>div.results-wrapper>div.results .category-heading{font-size:var(--font-size-3);line-height:var(--font-size-6)}:host>div>div.results-wrapper>div.results .item{--z-icon-height:12px;--z-icon-width:12px;font-size:var(--font-size-3);line-height:var(--font-size-6)}:host>div>div.results-wrapper>div.results .item.item-search{--z-icon-height:18px;--z-icon-width:18px}:host>div>div.results-wrapper>div.results .item.item-search>z-icon{margin-top:calc(var(--space-unit) / 4)}:host>div>div.results-wrapper>div.results .item.ellipsis>span.item-label{height:24px}:host>div>div.results-wrapper>div.results .item>z-icon.item-icon{padding:6px 0}}@media (min-width: 1152px){:host>div>div.results-wrapper>div.results .item{cursor:pointer}:host>div>div.results-wrapper>div.results .item-no-results{cursor:default;font-size:var(--font-size-3);line-height:var(--font-size-6)}}:host([size=\"small\"])>div>div.results-wrapper>div.results .item,:host([size=\"x-small\"])>div>div.results-wrapper>div.results .item,:host([size=\"small\"])>div>div.results-wrapper>div.results .category-heading,:host([size=\"x-small\"])>div>div.results-wrapper>div.results .category-heading{font-size:var(--font-size-2)}:host([size=\"small\"])>div>div.results-wrapper>div.results .item:not(.has-category),:host([size=\"x-small\"])>div>div.results-wrapper>div.results .item:not(.has-category){--z-icon-height:16px;--z-icon-width:16px}:host([size=\"small\"])::part(list-item-container){min-height:calc(var(--space-unit) * 4.5);padding:0}:host([size=\"x-small\"])::part(list-item-container){min-height:calc(var(--space-unit) * 4);padding:0}";
|
|
7
|
-
|
|
8
|
-
const ZSearchbar = class {
|
|
9
|
-
constructor(hostRef) {
|
|
10
|
-
registerInstance(this, hostRef);
|
|
11
|
-
this.searchSubmit = createEvent(this, "searchSubmit", 7);
|
|
12
|
-
this.searchTyping = createEvent(this, "searchTyping", 7);
|
|
13
|
-
this.searchItemClick = createEvent(this, "searchItemClick", 7);
|
|
14
|
-
/** the id of the searchbar element */
|
|
15
|
-
this.htmlid = `searchbar-${randomId()}`;
|
|
16
|
-
/** Prevent submit action */
|
|
17
|
-
this.preventSubmit = false;
|
|
18
|
-
/** Show autocomplete results */
|
|
19
|
-
this.autocomplete = false;
|
|
20
|
-
/** Minimun number of characters to dispatch typing event */
|
|
21
|
-
this.autocompleteMinChars = 3;
|
|
22
|
-
/** Truncate results to single row */
|
|
23
|
-
this.resultsEllipsis = true;
|
|
24
|
-
/** Search helper text */
|
|
25
|
-
this.searchHelperLabel = "Cerca {searchString}";
|
|
26
|
-
/** Sort autocomplete results items */
|
|
27
|
-
this.sortResultsItems = false;
|
|
28
|
-
/** Show submit button */
|
|
29
|
-
this.showSearchButton = false;
|
|
30
|
-
/** Set button icon without label*/
|
|
31
|
-
this.searchButtonIconOnly = false;
|
|
32
|
-
/** Available sizes: `big`, `small` and `x-small`. Defaults to `big`. */
|
|
33
|
-
this.size = ControlSize.BIG;
|
|
34
|
-
/** Graphical variant: `primary`, `secondary`, `tertiary`. Defaults to `primary`. */
|
|
35
|
-
this.variant = ButtonVariant.PRIMARY;
|
|
36
|
-
this.searchString = "";
|
|
37
|
-
this.currResultsCount = 0;
|
|
38
|
-
this.showResults = false;
|
|
39
|
-
this.resultsItemsList = null;
|
|
40
|
-
}
|
|
41
|
-
emitSearchSubmit() {
|
|
42
|
-
this.searchSubmit.emit(this.inputRef.value);
|
|
43
|
-
}
|
|
44
|
-
emitSearchTyping(search) {
|
|
45
|
-
this.searchTyping.emit(search);
|
|
46
|
-
}
|
|
47
|
-
emitSearchItemClick(item) {
|
|
48
|
-
this.searchItemClick.emit(item);
|
|
49
|
-
}
|
|
50
|
-
watchItems() {
|
|
51
|
-
this.resultsItemsList = this.getResultsItemsList();
|
|
52
|
-
}
|
|
53
|
-
watchResultsCount() {
|
|
54
|
-
this.currResultsCount = this.resultsCount;
|
|
55
|
-
}
|
|
56
|
-
watchValue() {
|
|
57
|
-
this.handleInput(this.value);
|
|
58
|
-
}
|
|
59
|
-
watchSearchString() {
|
|
60
|
-
this.emitSearchTyping(this.searchString);
|
|
61
|
-
if (!this.searchString) {
|
|
62
|
-
this.currResultsCount = this.resultsCount;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
clickListener(e) {
|
|
66
|
-
this.handleOutsideClick(e);
|
|
67
|
-
}
|
|
68
|
-
componentWillLoad() {
|
|
69
|
-
this.resultsItemsList = this.getResultsItemsList();
|
|
70
|
-
this.currResultsCount = this.resultsCount;
|
|
71
|
-
this.handleInput(this.value);
|
|
72
|
-
}
|
|
73
|
-
getResultsItemsList() {
|
|
74
|
-
return typeof this.resultsItems === "string" ? JSON.parse(this.resultsItems) : this.resultsItems;
|
|
75
|
-
}
|
|
76
|
-
getGroupedItems(items) {
|
|
77
|
-
const groupedItems = {};
|
|
78
|
-
items.forEach((item) => {
|
|
79
|
-
var _a;
|
|
80
|
-
const key = `${item === null || item === void 0 ? void 0 : item.category}${item === null || item === void 0 ? void 0 : item.subcategory}`;
|
|
81
|
-
groupedItems[key] = (_a = groupedItems[key]) !== null && _a !== void 0 ? _a : {
|
|
82
|
-
category: item === null || item === void 0 ? void 0 : item.category,
|
|
83
|
-
subcategory: item === null || item === void 0 ? void 0 : item.subcategory,
|
|
84
|
-
items: [],
|
|
85
|
-
};
|
|
86
|
-
groupedItems[key]["items"].push(item);
|
|
87
|
-
});
|
|
88
|
-
if (this.sortResultsItems) {
|
|
89
|
-
return Object.keys(groupedItems)
|
|
90
|
-
.sort()
|
|
91
|
-
.reduce((obj, key) => {
|
|
92
|
-
obj[key] = Object.assign(Object.assign({}, groupedItems[key]), { items: groupedItems[key]["items"].sort((a, b) => {
|
|
93
|
-
const nameA = a.label.toUpperCase();
|
|
94
|
-
const nameB = b.label.toUpperCase();
|
|
95
|
-
if (nameA < nameB) {
|
|
96
|
-
return -1;
|
|
97
|
-
}
|
|
98
|
-
if (nameA > nameB) {
|
|
99
|
-
return 1;
|
|
100
|
-
}
|
|
101
|
-
return 0;
|
|
102
|
-
}) });
|
|
103
|
-
return obj;
|
|
104
|
-
}, {});
|
|
105
|
-
}
|
|
106
|
-
return groupedItems;
|
|
107
|
-
}
|
|
108
|
-
checkResultsCount(counter) {
|
|
109
|
-
if (!this.currResultsCount || counter < this.currResultsCount) {
|
|
110
|
-
return true;
|
|
111
|
-
}
|
|
112
|
-
return false;
|
|
113
|
-
}
|
|
114
|
-
handleStopTyping(e) {
|
|
115
|
-
e.stopPropagation();
|
|
116
|
-
this.handleInput(e.detail.value);
|
|
117
|
-
}
|
|
118
|
-
handleInput(value) {
|
|
119
|
-
if ((value === null || value === void 0 ? void 0 : value.length) >= this.autocompleteMinChars) {
|
|
120
|
-
this.searchString = value;
|
|
121
|
-
}
|
|
122
|
-
else if (this.searchString) {
|
|
123
|
-
this.searchString = "";
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
handleSubmit() {
|
|
127
|
-
if (this.preventSubmit) {
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
this.emitSearchSubmit();
|
|
131
|
-
}
|
|
132
|
-
handleOutsideClick(e) {
|
|
133
|
-
const cp = e.composedPath();
|
|
134
|
-
const searchbar = cp.find((elem) => elem.nodeName === "Z-SEARCHBAR");
|
|
135
|
-
if (!searchbar || searchbar.htmlid !== this.htmlid) {
|
|
136
|
-
this.showResults = false;
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
if (cp.find((elem) => { var _a; return (elem === null || elem === void 0 ? void 0 : elem.nodeName) === "Z-INPUT" || ((_a = elem === null || elem === void 0 ? void 0 : elem.classList) === null || _a === void 0 ? void 0 : _a.contains("results")); })) {
|
|
140
|
-
this.showResults = true;
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
this.showResults = false;
|
|
144
|
-
}
|
|
145
|
-
renderInput() {
|
|
146
|
-
return (h("z-input", { ref: (val) => {
|
|
147
|
-
this.inputRef = val;
|
|
148
|
-
}, message: false, placeholder: this.placeholder, onStopTyping: (e) => this.handleStopTyping(e), onKeyUp: (e) => handleEnterKeydSubmit(e, () => this.handleSubmit()), value: this.value, size: this.size }));
|
|
149
|
-
}
|
|
150
|
-
renderButton() {
|
|
151
|
-
if (!this.showSearchButton) {
|
|
152
|
-
return null;
|
|
153
|
-
}
|
|
154
|
-
const iconProp = this.searchButtonIconOnly ? { icon: "search" } : null;
|
|
155
|
-
const buttonLabel = this.searchButtonIconOnly ? "" : "CERCA";
|
|
156
|
-
const defaultProps = Object.assign({ disabled: this.preventSubmit, variant: this.variant, size: this.size, onClick: () => this.handleSubmit() }, iconProp);
|
|
157
|
-
return h("z-button", Object.assign({}, defaultProps), buttonLabel);
|
|
158
|
-
}
|
|
159
|
-
renderResults() {
|
|
160
|
-
if (!this.showResults ||
|
|
161
|
-
!this.autocomplete ||
|
|
162
|
-
!this.searchString ||
|
|
163
|
-
this.searchString.length < this.autocompleteMinChars ||
|
|
164
|
-
!this.resultsItemsList) {
|
|
165
|
-
return null;
|
|
166
|
-
}
|
|
167
|
-
return (h("div", { class: "results-wrapper" }, h("div", { class: "results" }, this.renderResultsList())));
|
|
168
|
-
}
|
|
169
|
-
renderResultsList() {
|
|
170
|
-
var _a, _b;
|
|
171
|
-
if (this.preventSubmit && !((_a = this.resultsItemsList) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
172
|
-
return (h("span", { class: "item item-no-results" }, "Non abbiamo trovato risultati per ", h("b", null, this.searchString), h("br", null), h("br", null), "Cosa puoi fare?", h("ul", null, h("li", null, "Verificare di aver scritto bene"), h("li", null, "Provare a cercare un'altra parola"), h("li", null, "Provare a cercare qualcosa di pi\u00F9 generico"))));
|
|
173
|
-
}
|
|
174
|
-
return (h("z-list", { role: "listbox", id: `list-${this.htmlid}` }, this.renderSearchHelper(!!((_b = this.resultsItemsList) === null || _b === void 0 ? void 0 : _b.length)), this.renderItems(), this.renderShowAllResults()));
|
|
175
|
-
}
|
|
176
|
-
renderItems() {
|
|
177
|
-
var _a;
|
|
178
|
-
if (!((_a = this.resultsItemsList) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
179
|
-
return [];
|
|
180
|
-
}
|
|
181
|
-
const groupedItems = this.getGroupedItems(this.resultsItemsList);
|
|
182
|
-
const listGroups = [];
|
|
183
|
-
let counter = 0;
|
|
184
|
-
Object.values(groupedItems).forEach((groupItem, index, array) => {
|
|
185
|
-
if (this.checkResultsCount(counter)) {
|
|
186
|
-
const listGroupsElements = [];
|
|
187
|
-
groupItem.items.forEach((item, subindex, subarray) => {
|
|
188
|
-
if (this.checkResultsCount(counter)) {
|
|
189
|
-
const isLast = index === array.length - 1 && subindex === subarray.length - 1;
|
|
190
|
-
listGroupsElements.push(this.renderItem(item, subindex, !isLast));
|
|
191
|
-
}
|
|
192
|
-
counter++;
|
|
193
|
-
});
|
|
194
|
-
if (listGroupsElements.length) {
|
|
195
|
-
listGroups.push(h("z-list-group", { "divider-type": ListDividerType.ELEMENT }, this.renderItemCategory(groupItem), listGroupsElements));
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
});
|
|
199
|
-
return listGroups;
|
|
200
|
-
}
|
|
201
|
-
renderItem(item, key, divider) {
|
|
202
|
-
return (h("z-list-element", { id: `list-item-${this.htmlid}-${key}`, role: "option", tabindex: 0, dividerType: divider ? ListDividerType.ELEMENT : undefined, clickable: true, onClickItem: () => this.emitSearchItemClick(item) }, h("span", { class: { "item": true, "ellipsis": this.resultsEllipsis, "has-category": !!item.category } }, (item === null || item === void 0 ? void 0 : item.icon) && (h("z-icon", { class: "item-icon", name: item.icon })), h("span", { class: "item-label", title: item.label, innerHTML: this.renderItemLabel(item.label) }))));
|
|
203
|
-
}
|
|
204
|
-
renderItemLabel(label) {
|
|
205
|
-
if (!this.searchString) {
|
|
206
|
-
return label;
|
|
207
|
-
}
|
|
208
|
-
return label.replace(new RegExp(this.searchString.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "gmi"), (found) => `<mark>${found}</mark>`);
|
|
209
|
-
}
|
|
210
|
-
renderItemCategory(groupItem) {
|
|
211
|
-
if (!(groupItem === null || groupItem === void 0 ? void 0 : groupItem.category)) {
|
|
212
|
-
return null;
|
|
213
|
-
}
|
|
214
|
-
return (h("span", { class: "category-heading", slot: "header-title" }, h("span", { class: "category" }, groupItem.category), (groupItem === null || groupItem === void 0 ? void 0 : groupItem.subcategory) && h("span", { class: "subcategory" }, groupItem.subcategory)));
|
|
215
|
-
}
|
|
216
|
-
renderSearchHelper(hasDivider = true) {
|
|
217
|
-
if (!this.autocomplete || this.preventSubmit || !this.searchString) {
|
|
218
|
-
return null;
|
|
219
|
-
}
|
|
220
|
-
return (h("z-list-element", { role: "option", tabindex: 0, dividerType: hasDivider ? ListDividerType.ELEMENT : undefined, clickable: true, id: `list-item-${this.htmlid}-search`, onClickItem: () => this.emitSearchSubmit() }, h("span", { class: "item item-search" }, h("z-icon", { class: "search-icon", name: "left-magnifying-glass" }), h("span", { class: "item-label", innerHTML: this.searchHelperLabel.replace("{searchString}", `<mark>${this.searchString}</mark>`) }))));
|
|
221
|
-
}
|
|
222
|
-
renderShowAllResults() {
|
|
223
|
-
var _a, _b;
|
|
224
|
-
if (!this.currResultsCount ||
|
|
225
|
-
!this.searchString ||
|
|
226
|
-
!((_a = this.resultsItemsList) === null || _a === void 0 ? void 0 : _a.length) ||
|
|
227
|
-
this.currResultsCount >= ((_b = this.resultsItemsList) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
228
|
-
return null;
|
|
229
|
-
}
|
|
230
|
-
return (h("z-list-element", { role: "option", tabindex: 0, clickable: true, id: `list-item-${this.htmlid}-show-all`, onClickItem: () => (this.currResultsCount = 0) }, h("span", { class: "item-show-all" }, h("z-link", null, "Vedi tutti i risultati"))));
|
|
231
|
-
}
|
|
232
|
-
render() {
|
|
233
|
-
return (h(Host, { onFocus: () => (this.showResults = true), onClick: (e) => this.handleOutsideClick(e) }, h("div", { class: { "has-submit": this.showSearchButton, "has-results": this.autocomplete } }, this.renderInput(), this.renderResults(), this.renderButton())));
|
|
234
|
-
}
|
|
235
|
-
static get watchers() { return {
|
|
236
|
-
"resultsItems": ["watchItems"],
|
|
237
|
-
"resultsCount": ["watchResultsCount"],
|
|
238
|
-
"value": ["watchValue"],
|
|
239
|
-
"searchString": ["watchSearchString"]
|
|
240
|
-
}; }
|
|
241
|
-
};
|
|
242
|
-
ZSearchbar.style = stylesCss;
|
|
243
|
-
|
|
244
|
-
export { ZSearchbar as z_searchbar };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,c as t,h as a,H as r,g as i}from"./p-d17ebc2f.js";import{I as n}from"./p-bb85c467.js";const o="undefined"!=typeof IntersectionObserver,s=class{constructor(a){e(this,a),this.sticking=t(this,"sticking",7),this.stuck=!1,this.overlay=!1,this.flow="auto",this.drawerOpen=!1,this._stuck=!1,this.observer=o&&new IntersectionObserver((([e])=>{this._stuck=!e.isIntersecting}),{threshold:.5}),this.openDrawer=this.openDrawer.bind(this),this.closeDrawer=this.closeDrawer.bind(this),this.collectMenuElements=this.collectMenuElements.bind(this)}emitStickingEvent(){this.sticking.emit(this._stuck)}openDrawer(){this.drawerOpen=!0}closeDrawer(){this.drawerOpen=!1}componentDidLoad(){this.collectMenuElements(),this.onStuckMode()}get title(){const e=this.hostElement.querySelector('[slot="title"]');return null===e?"":e.textContent.trim()}get scrollParent(){const e=this.hostElement.offsetParent;return e===document.body||e===document.documentElement?window:e}collectMenuElements(){const e=this.menuElements=this.hostElement.querySelectorAll('[slot="menu"]');this.menuLength=e.length,this.setMenuFloatingMode()}onStuckMode(){this.stuck?this.enableStuckObserver():this.disableStuckMode()}enableStuckObserver(){this.observer&&this.observer.observe(this.container)}disableStuckMode(){this._stuck=!1,this.observer&&this.observer.unobserve(this.container)}onStuck(){this.scrollParent&&this.emitStickingEvent()}setMenuFloatingMode(){0!==this.menuElements.length&&this.menuElements.forEach((e=>{e.open=!1,e.floating=!this.drawerOpen,e.verticalContext=this.drawerOpen}))}render(){return a(r,{"menu-length":this.menuLength},a("div",{class:"heading-panel",ref:e=>this.container=e},a("div",{class:"hero-container"},a("slot",{name:"hero"},this.hero&&a("img",{alt:"",src:this.hero}))),a("div",{class:"heading-container"},a("div",{class:"heading-title"},this.menuLength>0&&a("button",{class:"drawer-trigger","aria-label":"Apri menu",onClick:this.openDrawer},a("z-icon",{name:"burger-menu"})),a("slot",{name:"title"})),a("div",{class:"heading-subtitle"},a("slot",{name:"subtitle"}))),a("div",{class:"menu-container"},!this.drawerOpen&&"offcanvas"!==this.flow&&a("slot",{name:"menu",onSlotchange:this.collectMenuElements}))),a("div",{class:"drawer-container"},a("div",{class:"drawer-overlay",onClick:this.closeDrawer}),a("div",{class:"drawer-panel"},a("button",{class:"drawer-close","aria-label":"Chiudi menu",onClick:this.closeDrawer},a("z-icon",{name:"close"})),a("div",{class:"drawer-content"},this.drawerOpen&&a("slot",{name:"menu",onSlotchange:this.collectMenuElements})))),this._stuck&&a("div",{class:"heading-stuck"},a("div",{class:"heading-stuck-content"},this.menuLength>0&&a("button",{class:"drawer-trigger","aria-label":"Apri menu",onClick:this.openDrawer},a("z-icon",{name:"burger-menu"})),a("div",{class:"heading-title"},a("slot",{name:"stucked-title"},this.title)))))}get hostElement(){return i(this)}static get watchers(){return{stuck:["onStuckMode"],_stuck:["onStuck"],drawerOpen:["setMenuFloatingMode"]}}};s.style=':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}}';const h=class{constructor(t){e(this,t)}selectPathOrPolygon(e){return(null==e?void 0:e.startsWith("M"))?a("path",{d:n[this.name]}):a("polygon",{points:n[this.name]})}render(){return a(r,{"aria-hidden":"true"},a("svg",{viewBox:"0 0 1000 1000",width:this.width,height:this.height,id:this.iconid,fill:this.fill?`var(--${this.fill})`:""},this.selectPathOrPolygon(n[this.name])))}};h.style=":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)}";export{s as z_app_header,h as z_icon}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,h as r,g as t}from"./p-d17ebc2f.js";import{b as a,B as n,d as c}from"./p-e1ac5c4e.js";const e=class{constructor(r){o(this,r),this.ariaLabel="",this.disabled=!1,this.type=a.BUTTON,this.variant=n.PRIMARY,this.size=c.BIG}getAttributes(){return{id:this.htmlid,class:{"z-button--container":!0,"z-button--has-text":!!this.hostElement.textContent.trim()}}}render(){return this.href?r("a",Object.assign({},this.getAttributes(),{"aria-label":this.ariaLabel,href:this.href,target:this.target}),this.icon&&r("z-icon",{name:this.icon,width:16,height:16}),r("slot",null)):r("button",Object.assign({},this.getAttributes(),{"aria-label":this.ariaLabel,name:this.name,type:this.type,disabled:this.disabled}),this.icon&&r("z-icon",{name:this.icon,width:16,height:16}),r("slot",null))}get hostElement(){return t(this)}};e.style='.sc-z-button-h{display:inline-block;--z-icon-width:16px;--z-icon-height:16px;--z-icon-right-margin:0}[disabled].sc-z-button-h:not([disabled="false"]){pointer-events:none}.sc-z-button-h .z-button--container.sc-z-button{display:inline-flex;width:100%;box-sizing:border-box;align-items:center;justify-content:center;padding:0;border-width:var(--border-size-medium);border-style:solid;border-radius:var(--border-radius);cursor:pointer;fill:currentcolor;font-family:var(--font-family-sans);font-size:14px;font-weight:var(--font-sb);letter-spacing:0.3px;line-height:1;outline:none;text-decoration:none;text-transform:uppercase;white-space:nowrap}.sc-z-button-h .z-button--container.sc-z-button:focus:focus-visible{box-shadow:var(--shadow-focus-primary)}.sc-z-button-h .z-button--container.z-button--has-text.sc-z-button{min-width:calc(var(--space-unit) * 8);padding:0 calc(var(--space-unit) * 2)}.sc-z-button-h .z-button--container.z-button--has-text.sc-z-button z-icon.sc-z-button{--z-icon-right-margin:var(--space-unit)}[size="big"].sc-z-button-h .z-button--container.sc-z-button{min-width:44px;height:44px}[size="small"].sc-z-button-h .z-button--container.sc-z-button{min-width:36px;height:36px}[size="x-small"].sc-z-button-h .z-button--container.sc-z-button{min-width:32px;height:32px}[variant="primary"].sc-z-button-h .z-button--container.sc-z-button{border-color:var(--color-primary01);background-color:var(--color-primary01);color:var(--color-text-inverse)}@media (hover: hover){[variant="primary"].sc-z-button-h .z-button--container.sc-z-button:hover{border-color:var(--color-hover-primary);background-color:var(--color-hover-primary);color:var(--color-text-inverse)}}[variant="primary"].sc-z-button-h .z-button--container.sc-z-button:active{border-color:var(--color-pressed-primary);background-color:var(--color-pressed-primary);box-shadow:var(--shadow-2);color:var(--color-text-inverse)}[variant="primary"][disabled].sc-z-button-h:not([disabled="false"]) .z-button--container.sc-z-button{border-color:var(--color-disabled01);background-color:var(--color-disabled01);color:var(--color-disabled02)}[variant="secondary"].sc-z-button-h .z-button--container.sc-z-button{border-color:var(--color-primary01);background-color:var(--color-surface01);color:var(--color-primary01)}@media (hover: hover){[variant="secondary"].sc-z-button-h .z-button--container.sc-z-button:hover{border-color:var(--color-hover-primary);background-color:var(--color-surface01);color:var(--color-hover-primary)}}[variant="secondary"].sc-z-button-h .z-button--container.sc-z-button:active{border-color:var(--color-pressed-primary);background-color:var(--color-surface01);box-shadow:var(--shadow-2);color:var(--color-pressed-primary)}[variant="secondary"][disabled].sc-z-button-h:not([disabled="false"]) .z-button--container.sc-z-button{border-color:var(--color-disabled01);background-color:var(--color-surface01);color:var(--color-disabled02)}[variant="tertiary"].sc-z-button-h .z-button--container.sc-z-button{border-color:transparent;background-color:transparent;color:var(--color-primary01)}@media (hover: hover){[variant="tertiary"].sc-z-button-h .z-button--container.sc-z-button:hover{border-color:var(--color-primary03);background-color:var(--color-primary03);color:var(--color-hover-primary)}}[variant="tertiary"].sc-z-button-h .z-button--container.sc-z-button:focus:focus-visible{border-color:var(--color-surface01);background-color:var(--color-surface01);color:var(--color-primary01)}[variant="tertiary"].sc-z-button-h .z-button--container.sc-z-button:active{border-color:var(--color-surface01);background-color:var(--color-surface01);box-shadow:var(--shadow-2);color:var(--color-primary01)}[variant="tertiary"][disabled].sc-z-button-h:not([disabled="false"]) .z-button--container.sc-z-button{border-color:transparent;background-color:transparent;color:var(--color-disabled02)}';export{e as z_button}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,H as e}from"./p-d17ebc2f.js";import{d as r,B as a,l}from"./p-e1ac5c4e.js";import{r as o,a as n}from"./p-dfc69cc3.js";import"./p-d69e14fb.js";const h=class{constructor(s){t(this,s),this.searchSubmit=i(this,"searchSubmit",7),this.searchTyping=i(this,"searchTyping",7),this.searchItemClick=i(this,"searchItemClick",7),this.htmlid=`searchbar-${o()}`,this.preventSubmit=!1,this.autocomplete=!1,this.autocompleteMinChars=3,this.resultsEllipsis=!0,this.searchHelperLabel="Cerca {searchString}",this.sortResultsItems=!1,this.showSearchButton=!1,this.searchButtonIconOnly=!1,this.size=r.BIG,this.variant=a.PRIMARY,this.searchString="",this.currResultsCount=0,this.showResults=!1,this.resultsItemsList=null}emitSearchSubmit(){this.searchSubmit.emit(this.inputRef.value)}emitSearchTyping(t){this.searchTyping.emit(t)}emitSearchItemClick(t){this.searchItemClick.emit(t)}watchItems(){this.resultsItemsList=this.getResultsItemsList()}watchResultsCount(){this.currResultsCount=this.resultsCount}watchValue(){this.handleInput(this.value)}watchSearchString(){this.emitSearchTyping(this.searchString),this.searchString||(this.currResultsCount=this.resultsCount)}clickListener(t){this.handleOutsideClick(t)}componentWillLoad(){this.resultsItemsList=this.getResultsItemsList(),this.currResultsCount=this.resultsCount,this.handleInput(this.value)}getResultsItemsList(){return"string"==typeof this.resultsItems?JSON.parse(this.resultsItems):this.resultsItems}getGroupedItems(t){const i={};return t.forEach((t=>{var s;const e=`${null==t?void 0:t.category}${null==t?void 0:t.subcategory}`;i[e]=null!==(s=i[e])&&void 0!==s?s:{category:null==t?void 0:t.category,subcategory:null==t?void 0:t.subcategory,items:[]},i[e].items.push(t)})),this.sortResultsItems?Object.keys(i).sort().reduce(((t,s)=>(t[s]=Object.assign(Object.assign({},i[s]),{items:i[s].items.sort(((t,i)=>{const s=t.label.toUpperCase(),e=i.label.toUpperCase();return s<e?-1:s>e?1:0}))}),t)),{}):i}checkResultsCount(t){return!this.currResultsCount||t<this.currResultsCount}handleStopTyping(t){t.stopPropagation(),this.handleInput(t.detail.value)}handleInput(t){(null==t?void 0:t.length)>=this.autocompleteMinChars?this.searchString=t:this.searchString&&(this.searchString="")}handleSubmit(){this.preventSubmit||this.emitSearchSubmit()}handleOutsideClick(t){const i=t.composedPath(),s=i.find((t=>"Z-SEARCHBAR"===t.nodeName));this.showResults=!(!s||s.htmlid!==this.htmlid||!i.find((t=>{var i;return"Z-INPUT"===(null==t?void 0:t.nodeName)||(null===(i=null==t?void 0:t.classList)||void 0===i?void 0:i.contains("results"))})))}renderInput(){return s("z-input",{ref:t=>{this.inputRef=t},message:!1,placeholder:this.placeholder,onStopTyping:t=>this.handleStopTyping(t),onKeyUp:t=>n(t,(()=>this.handleSubmit())),value:this.value,size:this.size})}renderButton(){if(!this.showSearchButton)return null;const t=this.searchButtonIconOnly?"":"CERCA",i=Object.assign({disabled:this.preventSubmit,variant:this.variant,size:this.size,onClick:()=>this.handleSubmit()},this.searchButtonIconOnly?{icon:"search"}:null);return s("z-button",Object.assign({},i),t)}renderResults(){return this.showResults&&this.autocomplete&&this.searchString&&!(this.searchString.length<this.autocompleteMinChars)&&this.resultsItemsList?s("div",{class:"results-wrapper"},s("div",{class:"results"},this.renderResultsList())):null}renderResultsList(){var t,i;return this.preventSubmit&&!(null===(t=this.resultsItemsList)||void 0===t?void 0:t.length)?s("span",{class:"item item-no-results"},"Non abbiamo trovato risultati per ",s("b",null,this.searchString),s("br",null),s("br",null),"Cosa puoi fare?",s("ul",null,s("li",null,"Verificare di aver scritto bene"),s("li",null,"Provare a cercare un'altra parola"),s("li",null,"Provare a cercare qualcosa di più generico"))):s("z-list",{role:"listbox",id:`list-${this.htmlid}`},this.renderSearchHelper(!!(null===(i=this.resultsItemsList)||void 0===i?void 0:i.length)),this.renderItems(),this.renderShowAllResults())}renderItems(){var t;if(!(null===(t=this.resultsItemsList)||void 0===t?void 0:t.length))return[];const i=this.getGroupedItems(this.resultsItemsList),e=[];let r=0;return Object.values(i).forEach(((t,i,a)=>{if(this.checkResultsCount(r)){const o=[];t.items.forEach(((t,s,e)=>{this.checkResultsCount(r)&&o.push(this.renderItem(t,s,!(i===a.length-1&&s===e.length-1))),r++})),o.length&&e.push(s("z-list-group",{"divider-type":l.ELEMENT},this.renderItemCategory(t),o))}})),e}renderItem(t,i,e){return s("z-list-element",{id:`list-item-${this.htmlid}-${i}`,role:"option",tabindex:0,dividerType:e?l.ELEMENT:void 0,clickable:!0,onClickItem:()=>this.emitSearchItemClick(t)},s("span",{class:{item:!0,ellipsis:this.resultsEllipsis,"has-category":!!t.category}},(null==t?void 0:t.icon)&&s("z-icon",{class:"item-icon",name:t.icon}),s("span",{class:"item-label",title:t.label,innerHTML:this.renderItemLabel(t.label)})))}renderItemLabel(t){return this.searchString?t.replace(new RegExp(this.searchString.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gmi"),(t=>`<mark>${t}</mark>`)):t}renderItemCategory(t){return(null==t?void 0:t.category)?s("span",{class:"category-heading",slot:"header-title"},s("span",{class:"category"},t.category),(null==t?void 0:t.subcategory)&&s("span",{class:"subcategory"},t.subcategory)):null}renderSearchHelper(t=!0){return this.autocomplete&&!this.preventSubmit&&this.searchString?s("z-list-element",{role:"option",tabindex:0,dividerType:t?l.ELEMENT:void 0,clickable:!0,id:`list-item-${this.htmlid}-search`,onClickItem:()=>this.emitSearchSubmit()},s("span",{class:"item item-search"},s("z-icon",{class:"search-icon",name:"left-magnifying-glass"}),s("span",{class:"item-label",innerHTML:this.searchHelperLabel.replace("{searchString}",`<mark>${this.searchString}</mark>`)}))):null}renderShowAllResults(){var t,i;return!this.currResultsCount||!this.searchString||!(null===(t=this.resultsItemsList)||void 0===t?void 0:t.length)||this.currResultsCount>=(null===(i=this.resultsItemsList)||void 0===i?void 0:i.length)?null:s("z-list-element",{role:"option",tabindex:0,clickable:!0,id:`list-item-${this.htmlid}-show-all`,onClickItem:()=>this.currResultsCount=0},s("span",{class:"item-show-all"},s("z-link",null,"Vedi tutti i risultati")))}render(){return s(e,{onFocus:()=>this.showResults=!0,onClick:t=>this.handleOutsideClick(t)},s("div",{class:{"has-submit":this.showSearchButton,"has-results":this.autocomplete}},this.renderInput(),this.renderResults(),this.renderButton()))}static get watchers(){return{resultsItems:["watchItems"],resultsCount:["watchResultsCount"],value:["watchValue"],searchString:["watchSearchString"]}}};h.style=':host{position:relative;z-index:5;display:block;width:inherit;height:44px;font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>div{position:absolute;z-index:10;display:grid;width:100%;gap:0 calc(var(--space-unit) * 2);grid-template-columns:auto;grid-template-rows:auto}:host>div.has-submit{grid-template-columns:auto min-content}:host>div.has-results{grid-template-rows:auto auto}:host>div>z-input{width:100%;grid-column:1;grid-row:1}:host>div>z-button{grid-column:2;grid-row:1}:host>div>div.results-wrapper{overflow:auto;padding:calc(var(--space-unit) / 4);padding-bottom:calc(var(--space-unit) / 4);border:var(--border-size-small) solid var(--color-surface03);border-top:none;margin-top:-1px;background:var(--color-surface01);grid-column:1;grid-row:2}:host>div>div.results-wrapper>div.results{overflow:auto;max-height:var(--z-searchbar-results-height, 540px);padding:var(--space-unit) calc(var(--space-unit) * 1.5);padding-bottom:calc(var(--space-unit) / 2);scrollbar-color:var(--color-primary01) transparent}:host>div>div.results-wrapper>div.results::-webkit-scrollbar{width:10px;background:linear-gradient(to right, transparent 0 3px, var(--gray200) 3px 7px, transparent 7px 10px);border-radius:var(--border-radius)}:host>div>div.results-wrapper>div.results::-webkit-scrollbar-track{background-color:transparent}:host>div>div.results-wrapper>div.results::-webkit-scrollbar-thumb{width:10px;background-color:var(--color-primary01);border-radius:var(--border-radius)}:host>div>div.results-wrapper>div.results .category-heading{display:block;font-size:var(--font-size-2);font-weight:var(--font-rg);line-height:var(--font-size-3)}:host>div>div.results-wrapper>div.results .category-heading>*{display:block}:host>div>div.results-wrapper>div.results span.category-heading>span.category{color:var(--color-text05);font-style:italic}:host>div>div.results-wrapper>div.results span.category-heading>span.subcategory{margin-top:8px;color:var(--color-text01);text-transform:uppercase}:host>div>div.results-wrapper>div.results z-list-element{display:block}:host>div>div.results-wrapper>div.results z-list-element:focus{box-shadow:var(--shadow-focus-primary)}:host>div>div.results-wrapper>div.results .item{--z-icon-height:12px;--z-icon-width:12px;display:flex;flex-flow:row nowrap;align-content:stretch;align-items:flex-start;justify-content:flex-start;color:var(--color-text01);fill:var(--color-icon02);font-size:var(--font-size-2);line-height:var(--font-size-3)}:host>div>div.results-wrapper>div.results .item.ellipsis>span.item-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host>div>div.results-wrapper>div.results .item>span.item-label>mark,:host>div>div.results-wrapper>div.results .item>span.item-label>*>mark{background:var(--color-primary03)}:host>div>div.results-wrapper>div.results .item.has-category{padding-left:calc(var(--space-unit) * 3)}:host>div>div.results-wrapper>div.results .item>z-icon.item-icon{padding:2px 0;margin-right:calc(var(--space-unit) * 1.5)}:host>div>div.results-wrapper>div.results .item.item-search{--z-icon-height:16px;--z-icon-width:16px}:host>div>div.results-wrapper>div.results .item.item-search>z-icon{margin-right:var(--space-unit)}:host>div>div.results-wrapper>div.results .item-show-all{display:block;text-align:center}:host>div>div.results-wrapper>div.results .item-no-results{display:block;font-size:var(--font-size-2);font-style:italic;line-height:var(--font-size-5)}:host>div>div.results-wrapper>div.results .item-no-results>ul{padding-left:calc(var(--space-unit) * 2);margin:var(--space-unit)}@media (min-width: 768px){:host>div>div.results-wrapper>div.results .category-heading{font-size:var(--font-size-3);line-height:var(--font-size-6)}:host>div>div.results-wrapper>div.results .item{--z-icon-height:12px;--z-icon-width:12px;font-size:var(--font-size-3);line-height:var(--font-size-6)}:host>div>div.results-wrapper>div.results .item.item-search{--z-icon-height:18px;--z-icon-width:18px}:host>div>div.results-wrapper>div.results .item.item-search>z-icon{margin-top:calc(var(--space-unit) / 4)}:host>div>div.results-wrapper>div.results .item.ellipsis>span.item-label{height:24px}:host>div>div.results-wrapper>div.results .item>z-icon.item-icon{padding:6px 0}}@media (min-width: 1152px){:host>div>div.results-wrapper>div.results .item{cursor:pointer}:host>div>div.results-wrapper>div.results .item-no-results{cursor:default;font-size:var(--font-size-3);line-height:var(--font-size-6)}}:host([size="small"])>div>div.results-wrapper>div.results .item,:host([size="x-small"])>div>div.results-wrapper>div.results .item,:host([size="small"])>div>div.results-wrapper>div.results .category-heading,:host([size="x-small"])>div>div.results-wrapper>div.results .category-heading{font-size:var(--font-size-2)}:host([size="small"])>div>div.results-wrapper>div.results .item:not(.has-category),:host([size="x-small"])>div>div.results-wrapper>div.results .item:not(.has-category){--z-icon-height:16px;--z-icon-width:16px}:host([size="small"])::part(list-item-container){min-height:calc(var(--space-unit) * 4.5);padding:0}:host([size="x-small"])::part(list-item-container){min-height:calc(var(--space-unit) * 4);padding:0}';export{h as z_searchbar}
|