@zanichelli/albe-web-components 12.3.1-RC → 12.4.0-RC
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-195ca522.js +18 -10
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/web-components-library.cjs.js +1 -1
- package/dist/cjs/z-app-header.cjs.entry.js +185 -0
- package/dist/cjs/{z-dragdrop-area_2.cjs.entry.js → z-button_6.cjs.entry.js} +259 -2
- package/dist/cjs/z-chip.cjs.entry.js +1 -1
- package/dist/cjs/z-input_2.cjs.entry.js +289 -0
- package/dist/cjs/z-list_3.cjs.entry.js +270 -0
- package/dist/cjs/z-offcanvas_2.cjs.entry.js +281 -0
- package/dist/collection/components/buttons/z-chip/index.js +1 -1
- package/dist/collection/components/file-upload/z-dragdrop-area/styles.css +1 -0
- package/dist/collection/components/file-upload/z-file-upload/index.js +1 -1
- package/dist/collection/components/file-upload/z-file-upload/styles.css +11 -0
- package/dist/esm/index-4968ce56.js +18 -10
- package/dist/esm/{index-4d1853ea.js → index-df06f147.js} +1 -1
- package/dist/esm/{index-fb19ca57.js → index-e44342f3.js} +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{utils-2a4ef29d.js → utils-3d2372eb.js} +1 -1
- package/dist/esm/web-components-library.js +1 -1
- package/dist/esm/z-app-header.entry.js +181 -0
- package/dist/esm/z-book-card.entry.js +1 -1
- package/dist/esm/z-breadcrumb.entry.js +1 -1
- package/dist/esm/{z-dragdrop-area_2.entry.js → z-button_6.entry.js} +258 -5
- package/dist/esm/z-chip.entry.js +1 -1
- package/dist/esm/z-combobox.entry.js +1 -1
- package/dist/esm/z-input_2.entry.js +284 -0
- package/dist/esm/z-list_3.entry.js +264 -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-offcanvas_2.entry.js +276 -0
- package/dist/esm/z-pocket_3.entry.js +1 -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-deprecated.entry.js +2 -2
- package/dist/esm/z-table-header.entry.js +2 -2
- package/dist/esm/z-table.entry.js +2 -2
- package/dist/esm/z-toggle-switch.entry.js +1 -1
- package/dist/esm/z-tr.entry.js +2 -2
- package/dist/web-components-library/index.esm.js +1 -1
- package/dist/web-components-library/{p-100207d8.entry.js → p-0495fb84.entry.js} +1 -1
- package/dist/web-components-library/p-07854026.entry.js +1 -0
- package/dist/web-components-library/p-13762a32.entry.js +1 -0
- package/dist/web-components-library/{p-cc009af8.entry.js → p-17d4f729.entry.js} +1 -1
- package/dist/web-components-library/p-1b342136.entry.js +1 -0
- package/dist/web-components-library/p-1c541078.entry.js +1 -0
- package/dist/web-components-library/p-207467d2.entry.js +1 -0
- package/dist/web-components-library/p-285ec5fc.entry.js +1 -0
- package/dist/web-components-library/{p-98badafc.js → p-28b2868e.js} +1 -1
- package/dist/web-components-library/{p-5944a8f2.entry.js → p-29377b57.entry.js} +1 -1
- package/dist/web-components-library/p-29d45fe5.entry.js +1 -0
- package/dist/web-components-library/p-49d22e92.entry.js +1 -0
- package/dist/web-components-library/p-570e1a2e.entry.js +1 -0
- package/{www/build/p-485fd3db.entry.js → dist/web-components-library/p-6f281905.entry.js} +1 -1
- package/dist/web-components-library/{p-a1663ab1.entry.js → p-76e7d402.entry.js} +1 -1
- package/dist/web-components-library/p-8aaa0c34.entry.js +1 -0
- package/dist/web-components-library/{p-f5bc7dda.entry.js → p-a6af3c1d.entry.js} +1 -1
- package/dist/web-components-library/{p-f3cc3f27.entry.js → p-b0f9cf23.entry.js} +1 -1
- package/dist/web-components-library/{p-a01baa71.js → p-b921dc8d.js} +1 -1
- package/dist/web-components-library/p-d00d2e95.entry.js +1 -0
- package/dist/web-components-library/{p-cd561d69.js → p-d12d4dcd.js} +1 -1
- package/dist/web-components-library/{p-8c31e60b.entry.js → p-d51d7b44.entry.js} +1 -1
- package/dist/web-components-library/p-dc854830.entry.js +1 -0
- package/dist/web-components-library/web-components-library.esm.js +1 -1
- package/package.json +1 -1
- package/www/build/index.esm.js +1 -1
- package/www/build/{p-100207d8.entry.js → p-0495fb84.entry.js} +1 -1
- package/www/build/p-07854026.entry.js +1 -0
- package/www/build/p-13762a32.entry.js +1 -0
- package/www/build/{p-cc009af8.entry.js → p-17d4f729.entry.js} +1 -1
- package/www/build/p-1b342136.entry.js +1 -0
- package/www/build/p-1c541078.entry.js +1 -0
- package/www/build/p-207467d2.entry.js +1 -0
- package/www/build/p-285ec5fc.entry.js +1 -0
- package/www/build/{p-98badafc.js → p-28b2868e.js} +1 -1
- package/www/build/{p-5944a8f2.entry.js → p-29377b57.entry.js} +1 -1
- package/www/build/p-29d45fe5.entry.js +1 -0
- package/www/build/p-49d22e92.entry.js +1 -0
- package/www/build/p-4a7a94e2.css +1576 -0
- package/www/build/p-570e1a2e.entry.js +1 -0
- package/{dist/web-components-library/p-485fd3db.entry.js → www/build/p-6f281905.entry.js} +1 -1
- package/www/build/{p-a1663ab1.entry.js → p-76e7d402.entry.js} +1 -1
- package/www/build/p-8aaa0c34.entry.js +1 -0
- package/www/build/{p-f5bc7dda.entry.js → p-a6af3c1d.entry.js} +1 -1
- package/www/build/{p-f3cc3f27.entry.js → p-b0f9cf23.entry.js} +1 -1
- package/www/build/{p-a01baa71.js → p-b921dc8d.js} +1 -1
- package/www/build/p-ce656c1c.js +129 -0
- package/www/build/p-d00d2e95.entry.js +1 -0
- package/www/build/{p-cd561d69.js → p-d12d4dcd.js} +1 -1
- package/www/build/{p-8c31e60b.entry.js → p-d51d7b44.entry.js} +1 -1
- package/www/build/p-dc854830.entry.js +1 -0
- package/www/build/web-components-library.esm.js +1 -1
- package/www/index.html +10 -1
- package/dist/cjs/z-app-header_11.cjs.entry.js +0 -1077
- package/dist/cjs/z-file-upload.cjs.entry.js +0 -189
- package/dist/esm/z-app-header_11.entry.js +0 -1063
- package/dist/esm/z-file-upload.entry.js +0 -185
- package/dist/web-components-library/p-03b13390.entry.js +0 -1
- package/dist/web-components-library/p-07d0e902.entry.js +0 -1
- package/dist/web-components-library/p-3327e5f0.entry.js +0 -1
- package/dist/web-components-library/p-51bfa8ba.entry.js +0 -1
- package/dist/web-components-library/p-7907bdf7.entry.js +0 -1
- package/dist/web-components-library/p-7c5ddeb0.entry.js +0 -1
- package/dist/web-components-library/p-9b0bcd43.entry.js +0 -1
- package/dist/web-components-library/p-bbd6cbca.entry.js +0 -1
- package/dist/web-components-library/p-ed42ceca.entry.js +0 -1
- package/dist/web-components-library/p-ff5a6e34.entry.js +0 -1
- package/www/build/p-03b13390.entry.js +0 -1
- package/www/build/p-07d0e902.entry.js +0 -1
- package/www/build/p-21a94605.css +0 -3
- package/www/build/p-3327e5f0.entry.js +0 -1
- package/www/build/p-51bfa8ba.entry.js +0 -1
- package/www/build/p-7907bdf7.entry.js +0 -1
- package/www/build/p-7c5ddeb0.entry.js +0 -1
- package/www/build/p-92d5fd28.js +0 -1
- package/www/build/p-9b0bcd43.entry.js +0 -1
- package/www/build/p-bbd6cbca.entry.js +0 -1
- package/www/build/p-ed42ceca.entry.js +0 -1
- package/www/build/p-ff5a6e34.entry.js +0 -1
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-4968ce56.js';
|
|
2
|
+
import { i as ListSize, m as ListType, j as ExpandableListButtonAlign, l as ListDividerType, D as DividerSize, E as ExpandableListStyle, g as KeyboardCode } from './index-47f23745.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
|
+
* [optional] Sets role of the element.
|
|
19
|
+
*/
|
|
20
|
+
this.role = "list";
|
|
21
|
+
}
|
|
22
|
+
setChildrenSizeType() {
|
|
23
|
+
const children = this.host.children;
|
|
24
|
+
for (let i = 0; i < children.length; i++) {
|
|
25
|
+
children[i].setAttribute("size", this.size);
|
|
26
|
+
children[i].setAttribute("list-type", this.listType);
|
|
27
|
+
children[i].setAttribute("list-element-position", (i + 1).toString());
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
componentDidLoad() {
|
|
31
|
+
this.setChildrenSizeType();
|
|
32
|
+
}
|
|
33
|
+
render() {
|
|
34
|
+
return (h(Host, null, h("slot", null)));
|
|
35
|
+
}
|
|
36
|
+
get host() { return getElement(this); }
|
|
37
|
+
};
|
|
38
|
+
ZList.style = stylesCss$2;
|
|
39
|
+
|
|
40
|
+
const stylesCss$1 = ":host{outline:none}:host>.container,:host>.container-contextual-menu{--background-color-list-element:var(--color-surface01);--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}";
|
|
41
|
+
|
|
42
|
+
const ZListElement = class {
|
|
43
|
+
/**
|
|
44
|
+
* Constructor.
|
|
45
|
+
*/
|
|
46
|
+
constructor(hostRef) {
|
|
47
|
+
registerInstance(this, hostRef);
|
|
48
|
+
this.accessibleFocus = createEvent(this, "accessibleFocus", 7);
|
|
49
|
+
this.ariaDescendantFocus = createEvent(this, "ariaDescendantFocus", 7);
|
|
50
|
+
this.clickItem = createEvent(this, "clickItem", 7);
|
|
51
|
+
/**
|
|
52
|
+
* [optional] Align expandable button left or right.
|
|
53
|
+
*/
|
|
54
|
+
this.alignButton = ExpandableListButtonAlign.LEFT;
|
|
55
|
+
/**
|
|
56
|
+
* [optional] Sets element clickable.
|
|
57
|
+
*/
|
|
58
|
+
this.clickable = false;
|
|
59
|
+
/**
|
|
60
|
+
* [optional] Sets the divider color.
|
|
61
|
+
*/
|
|
62
|
+
this.dividerColor = "color-surface03";
|
|
63
|
+
/**
|
|
64
|
+
* [optional] Sets the position where to insert the divider.
|
|
65
|
+
*/
|
|
66
|
+
this.dividerType = ListDividerType.NONE;
|
|
67
|
+
/**
|
|
68
|
+
* [optional] Sets the divider size.
|
|
69
|
+
*/
|
|
70
|
+
this.dividerSize = DividerSize.SMALL;
|
|
71
|
+
/**
|
|
72
|
+
* [optional] Sets element as expandable.
|
|
73
|
+
*/
|
|
74
|
+
this.expandable = false;
|
|
75
|
+
/**
|
|
76
|
+
* [optional] Sets expandable style to element.
|
|
77
|
+
*/
|
|
78
|
+
this.expandableStyle = ExpandableListStyle.ACCORDION;
|
|
79
|
+
/**
|
|
80
|
+
* [optional] Sets size of inside elements.
|
|
81
|
+
*/
|
|
82
|
+
this.size = ListSize.MEDIUM;
|
|
83
|
+
/**
|
|
84
|
+
* [optional] Sets text color of the element.
|
|
85
|
+
*/
|
|
86
|
+
this.color = "none";
|
|
87
|
+
/**
|
|
88
|
+
* [optional] Sets disabled style of the element.
|
|
89
|
+
*/
|
|
90
|
+
this.disabled = false;
|
|
91
|
+
/**
|
|
92
|
+
* [optional] If is used in ZContextualMenu component
|
|
93
|
+
*/
|
|
94
|
+
this.isContextualMenu = false;
|
|
95
|
+
/**
|
|
96
|
+
* [optional] position of the list element inside the list or the group
|
|
97
|
+
*/
|
|
98
|
+
this.listElementPosition = "0";
|
|
99
|
+
/**
|
|
100
|
+
* [optional] type of the list marker for each element
|
|
101
|
+
*/
|
|
102
|
+
this.listType = ListType.NONE;
|
|
103
|
+
/**
|
|
104
|
+
* [optional] Sets element role.
|
|
105
|
+
*/
|
|
106
|
+
this.role = "listitem";
|
|
107
|
+
this.showInnerContent = false;
|
|
108
|
+
this.openElementConfig = {
|
|
109
|
+
accordion: {
|
|
110
|
+
open: "minus-circled",
|
|
111
|
+
close: "plus-circled",
|
|
112
|
+
},
|
|
113
|
+
menu: {
|
|
114
|
+
open: "chevron-up",
|
|
115
|
+
close: "chevron-down",
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
this.handleClick = this.handleClick.bind(this);
|
|
119
|
+
this.handleKeyDown = this.handleKeyDown.bind(this);
|
|
120
|
+
}
|
|
121
|
+
accessibleFocusHandler(e) {
|
|
122
|
+
if (this.listElementId === e.detail) {
|
|
123
|
+
const toFocus = this.host.shadowRoot.getElementById(`z-list-element-id-${e.detail}`);
|
|
124
|
+
toFocus.focus();
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Handler for click on element. If element is expandable, change state.
|
|
129
|
+
* @returns void
|
|
130
|
+
*/
|
|
131
|
+
handleClick() {
|
|
132
|
+
this.clickItem.emit(this.listElementId);
|
|
133
|
+
if (!this.expandable) {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
this.showInnerContent = !this.showInnerContent;
|
|
137
|
+
}
|
|
138
|
+
calculateClass() {
|
|
139
|
+
if (this.isContextualMenu) {
|
|
140
|
+
return "container-contextual-menu";
|
|
141
|
+
}
|
|
142
|
+
return "container";
|
|
143
|
+
}
|
|
144
|
+
handleKeyDown(event) {
|
|
145
|
+
const expandByKey = event.code === KeyboardCode.ENTER;
|
|
146
|
+
switch (event.code) {
|
|
147
|
+
case KeyboardCode.ARROW_DOWN:
|
|
148
|
+
event.preventDefault();
|
|
149
|
+
this.accessibleFocus.emit(this.listElementId + 1);
|
|
150
|
+
break;
|
|
151
|
+
case KeyboardCode.ARROW_UP:
|
|
152
|
+
event.preventDefault();
|
|
153
|
+
this.accessibleFocus.emit(this.listElementId - 1);
|
|
154
|
+
break;
|
|
155
|
+
case KeyboardCode.ENTER:
|
|
156
|
+
event.preventDefault();
|
|
157
|
+
this.clickItem.emit(this.listElementId);
|
|
158
|
+
break;
|
|
159
|
+
}
|
|
160
|
+
if (!this.expandable || !expandByKey) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
this.showInnerContent = !this.showInnerContent;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Renders button to expand element.
|
|
167
|
+
* @returns expadable button
|
|
168
|
+
*/
|
|
169
|
+
renderExpandableButton() {
|
|
170
|
+
if (!this.expandable) {
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
return (h("z-icon", { name: this.showInnerContent
|
|
174
|
+
? this.openElementConfig[this.expandableStyle].open
|
|
175
|
+
: this.openElementConfig[this.expandableStyle].close }));
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Renders expanded content if element is expandable.
|
|
179
|
+
* @returns expanded content
|
|
180
|
+
*/
|
|
181
|
+
renderExpandedContent() {
|
|
182
|
+
if (!this.expandable) {
|
|
183
|
+
return null;
|
|
184
|
+
}
|
|
185
|
+
return (h("div", { class: {
|
|
186
|
+
"z-list-element-inner-container": true,
|
|
187
|
+
"expanded": this.showInnerContent,
|
|
188
|
+
} }, h("slot", { name: "inner-content" })));
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Renders content of the z-list-element
|
|
192
|
+
* @returns list content
|
|
193
|
+
*/
|
|
194
|
+
renderContent() {
|
|
195
|
+
if (this.listType === ListType.NONE) {
|
|
196
|
+
return h("slot", null);
|
|
197
|
+
}
|
|
198
|
+
if (this.listType === ListType.ORDERED) {
|
|
199
|
+
return (h("div", { class: "z-list-content-container" }, h("div", null, this.listElementPosition, ".\u2003"), h("slot", null)));
|
|
200
|
+
}
|
|
201
|
+
if (this.listType === ListType.UNORDERED) {
|
|
202
|
+
return (h("div", { class: "z-list-content-container" }, h("span", null, "\u2022\u2003"), h("slot", null)));
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
render() {
|
|
206
|
+
return (h(Host, { "aria-expanded": this.expandable ? this.showInnerContent : null, onClick: this.handleClick, onFocus: () => this.ariaDescendantFocus.emit(this.listElementId), 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 }))));
|
|
207
|
+
}
|
|
208
|
+
get host() { return getElement(this); }
|
|
209
|
+
};
|
|
210
|
+
ZListElement.style = stylesCss$1;
|
|
211
|
+
|
|
212
|
+
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)}";
|
|
213
|
+
|
|
214
|
+
const ZListGroup = class {
|
|
215
|
+
constructor(hostRef) {
|
|
216
|
+
registerInstance(this, hostRef);
|
|
217
|
+
/**
|
|
218
|
+
* [optional] Sets size of inside elements.
|
|
219
|
+
*/
|
|
220
|
+
this.size = ListSize.MEDIUM;
|
|
221
|
+
/**
|
|
222
|
+
* [optional] Sets the position where to insert the divider.
|
|
223
|
+
*/
|
|
224
|
+
this.dividerType = ListDividerType.NONE;
|
|
225
|
+
/**
|
|
226
|
+
* [optional] Sets the divider size.
|
|
227
|
+
*/
|
|
228
|
+
this.dividerSize = DividerSize.SMALL;
|
|
229
|
+
/**
|
|
230
|
+
* [optional] Sets the divider color.
|
|
231
|
+
*/
|
|
232
|
+
this.dividerColor = "gray200";
|
|
233
|
+
/**
|
|
234
|
+
* [optional] type of the list marker for each element
|
|
235
|
+
*/
|
|
236
|
+
this.listType = ListType.NONE;
|
|
237
|
+
}
|
|
238
|
+
componentDidLoad() {
|
|
239
|
+
const children = this.host.children;
|
|
240
|
+
for (let i = 0; i < children.length; i++) {
|
|
241
|
+
if (children.length - 1 > i) {
|
|
242
|
+
children[i].setAttribute("divider-type", this.dividerType);
|
|
243
|
+
children[i].setAttribute("divider-size", this.dividerSize);
|
|
244
|
+
children[i].setAttribute("divider-color", this.dividerColor);
|
|
245
|
+
}
|
|
246
|
+
children[i].setAttribute("size", this.size);
|
|
247
|
+
children[i].setAttribute("list-type", this.listType);
|
|
248
|
+
children[i].setAttribute("list-element-position", i.toString());
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
componentWillLoad() {
|
|
252
|
+
this.hasHeader = !!this.host.querySelector('[slot="header-title"]');
|
|
253
|
+
}
|
|
254
|
+
render() {
|
|
255
|
+
return (h(Host, { role: "group" }, h("div", { class: {
|
|
256
|
+
"z-list-group-header-container": true,
|
|
257
|
+
"has-header": this.hasHeader,
|
|
258
|
+
} }, h("slot", { name: "header-title" }), this.dividerType === ListDividerType.HEADER && (h("z-divider", { color: this.dividerColor, size: this.dividerSize }))), h("slot", null)));
|
|
259
|
+
}
|
|
260
|
+
get host() { return getElement(this); }
|
|
261
|
+
};
|
|
262
|
+
ZListGroup.style = stylesCss;
|
|
263
|
+
|
|
264
|
+
export { ZList as z_list, ZListElement as z_list_element, ZListGroup as z_list_group };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h } from './index-4968ce56.js';
|
|
2
2
|
import { P as PopoverPosition } from './index-47f23745.js';
|
|
3
|
-
import {
|
|
3
|
+
import { h as handleKeyboardSubmit } from './utils-3d2372eb.js';
|
|
4
4
|
import './breakpoints-9b81eb1b.js';
|
|
5
5
|
|
|
6
6
|
const stylesCss = ":host{width:100%;font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>div{position:relative;display:grid;width:calc(100% + calc(var(--space-unit) * 2));height:402px;box-sizing:border-box;padding:calc(var(--space-unit) * 2) calc(var(--space-unit) * 3);border:var(--border-size-small) solid var(--color-primary01);margin-left:calc(-1 * var(--space-unit));background:var(--color-surface01);border-radius:0;box-shadow:0 2px 4px 0 rgb(66 69 72 / 35%)}:host>div>z-icon{position:absolute;top:var(--space-unit);right:var(--space-unit);cursor:pointer;fill:var(--color-primary01)}:host>div>div.cta-wrapper{display:flex;flex-flow:column nowrap;align-self:end;justify-content:space-between}:host>div>div.content-wrapper{position:relative;overflow:hidden;align-self:stretch}:host>div>div.content-wrapper>section{box-sizing:border-box;padding:var(--space-unit) 0;border-bottom:var(--border-size-small) solid var(--color-surface04);color:var(--color-surface05);font-size:14px;line-height:20px}:host>div>div.content-wrapper>section:last-child{border-bottom:none}:host>div>div.content-wrapper>section.info-wrapper{position:relative;overflow:hidden;box-sizing:border-box}:host>div>div.content-wrapper>section.info-wrapper.hidden::after{position:absolute;top:0;right:0;bottom:0;left:0;background:linear-gradient(180deg, rgb(255 0 0 / 0%), rgb(255 0 0 / 0%) 60%, white);content:\"\";pointer-events:none}:host>div>div.content-wrapper>section>span.license-heading{display:flex;justify-content:space-between}:host>div>div.content-wrapper>section>span.license-heading>span.expired{color:var(--color-secondary02);font-size:12px;font-weight:600}:host>div>div.content-wrapper>section>span.license-heading>span.expiring{color:var(--color-warning01);font-size:12px;font-weight:600}:host>div>div.content-wrapper>z-popover{position:absolute;top:0;left:calc(var(--space-unit) * 4)}";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h } from './index-4968ce56.js';
|
|
2
|
-
import {
|
|
2
|
+
import { h as handleKeyboardSubmit } from './utils-3d2372eb.js';
|
|
3
3
|
import './index-47f23745.js';
|
|
4
4
|
import './breakpoints-9b81eb1b.js';
|
|
5
5
|
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host } from './index-4968ce56.js';
|
|
2
|
+
import { O as OffCanvasVariant, v as TransitionDirection, e as ControlSize, B as ButtonVariant, l as ListDividerType } from './index-47f23745.js';
|
|
3
|
+
import { r as randomId, f as handleEnterKeydSubmit } from './utils-3d2372eb.js';
|
|
4
|
+
import './breakpoints-9b81eb1b.js';
|
|
5
|
+
|
|
6
|
+
const stylesCss$1 = ".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}";
|
|
7
|
+
|
|
8
|
+
const ZOffcanvas = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
registerInstance(this, hostRef);
|
|
11
|
+
this.canvasOpenStatusChanged = createEvent(this, "canvasOpenStatusChanged", 7);
|
|
12
|
+
/**
|
|
13
|
+
* Offcanvas variant.
|
|
14
|
+
* Can be one `overlay` or `pushcontent`.
|
|
15
|
+
* Default variant: pushcontent
|
|
16
|
+
*/
|
|
17
|
+
this.variant = OffCanvasVariant.PUSHCONTENT;
|
|
18
|
+
/** Whether the offcanvas is open. Default: false */
|
|
19
|
+
this.open = false;
|
|
20
|
+
/** open content transitioning in a specified direction left | right. Default: left */
|
|
21
|
+
this.transitiondirection = TransitionDirection.LEFT;
|
|
22
|
+
/**
|
|
23
|
+
* Whether to skip the initial animation.
|
|
24
|
+
* Useful when the initial value of the `open` prop is set to `true`.
|
|
25
|
+
*/
|
|
26
|
+
this.skipLoadAnimation = false;
|
|
27
|
+
}
|
|
28
|
+
onOpenChanged() {
|
|
29
|
+
if (!this.open && this.skipLoadAnimation) {
|
|
30
|
+
this.skipLoadAnimation = false;
|
|
31
|
+
}
|
|
32
|
+
if (this.open) {
|
|
33
|
+
this.handlePageOverflow();
|
|
34
|
+
}
|
|
35
|
+
this.canvasOpenStatusChanged.emit(this.open);
|
|
36
|
+
}
|
|
37
|
+
handlePageOverflow() {
|
|
38
|
+
const overflow = this.variant === OffCanvasVariant.OVERLAY ? "overflow-y" : "overflow-x";
|
|
39
|
+
document.body.style[overflow] = this.open ? "hidden" : "";
|
|
40
|
+
}
|
|
41
|
+
render() {
|
|
42
|
+
return (h(Host, { class: { "skip-animation": this.skipLoadAnimation } }, h("div", { role: "presentation", class: "canvas-container", onTransitionEnd: () => this.handlePageOverflow() }, 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) }))));
|
|
43
|
+
}
|
|
44
|
+
static get watchers() { return {
|
|
45
|
+
"open": ["onOpenChanged"]
|
|
46
|
+
}; }
|
|
47
|
+
};
|
|
48
|
+
ZOffcanvas.style = stylesCss$1;
|
|
49
|
+
|
|
50
|
+
const stylesCss = ":host{z-index:15;display:flex;column-gap:calc(var(--space-unit) * 2);font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host,*{box-sizing:border-box}.input-container{position:relative;display:flex;width:100%;flex-direction:column}.results-wrapper{position:absolute;top:calc(100% - 1px);left:0;width:100%;padding:calc(var(--space-unit) / 4);border:var(--border-size-small) solid var(--color-surface03);border-top:none;background:var(--color-surface01)}.results{overflow:auto;max-height:var(--z-searchbar-results-height, 540px);padding:calc(var(--space-unit) / 2) calc(var(--space-unit) * 1.5);scrollbar-color:var(--color-primary01) transparent}.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)}.results::-webkit-scrollbar-track{background-color:transparent}.results::-webkit-scrollbar-thumb{width:10px;background-color:var(--color-primary01);border-radius:var(--border-radius)}.results .category-heading{display:block;font-size:var(--font-size-2);font-weight:var(--font-rg);line-height:var(--font-size-3)}.results .category-heading>*{display:block}.results .category-heading>.category{color:var(--color-text05);font-style:italic}.results .category-heading>.subcategory{margin-top:var(--space-unit);color:var(--color-text01);text-transform:uppercase}.results z-list-element{display:block}.results .item{--z-icon-height:12px;--z-icon-width:12px;display:flex;flex-flow:row nowrap;align-items:center;justify-content:flex-start;color:var(--color-text01);column-gap:calc(var(--space-unit) * 1.5);fill:var(--color-icon02);font-size:var(--font-size-2);line-height:var(--font-size-3)}.results .item.ellipsis>.item-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.results .item>.item-label mark{background:var(--color-primary03)}.results .item.has-category{padding-left:calc(var(--space-unit) * 3)}.results .item.item-search{--z-icon-height:16px;--z-icon-width:16px}.results .item-show-all{text-align:center}.results .item-no-results{display:block;font-size:var(--font-size-2);font-style:italic;line-height:var(--font-size-5)}.results .item-no-results>ul{padding-left:calc(var(--space-unit) * 2);margin:var(--space-unit)}@media (min-width: 768px){.results .category-heading{font-size:var(--font-size-3);line-height:var(--font-size-6)}.results .item{font-size:var(--font-size-3);line-height:var(--font-size-6)}.results .item.item-search{--z-icon-height:18px;--z-icon-width:18px}.results .item.ellipsis>.item-label{height:24px}}@media (min-width: 1152px){.results .item{cursor:pointer}.results .item-no-results{cursor:default;font-size:var(--font-size-3);line-height:var(--font-size-6)}}:host([size=\"small\"]) .results :is(.item,.category-heading),:host([size=\"x-small\"]) .results :is(.item,.category-heading){font-size:var(--font-size-2)}:host([size=\"small\"]) .results .item:not(.has-category),:host([size=\"x-small\"]) .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}";
|
|
51
|
+
|
|
52
|
+
const ZSearchbar = class {
|
|
53
|
+
constructor(hostRef) {
|
|
54
|
+
registerInstance(this, hostRef);
|
|
55
|
+
this.searchSubmit = createEvent(this, "searchSubmit", 7);
|
|
56
|
+
this.searchTyping = createEvent(this, "searchTyping", 7);
|
|
57
|
+
this.searchItemClick = createEvent(this, "searchItemClick", 7);
|
|
58
|
+
/** the id of the searchbar element */
|
|
59
|
+
this.htmlid = `searchbar-${randomId()}`;
|
|
60
|
+
/** Prevent submit action */
|
|
61
|
+
this.preventSubmit = false;
|
|
62
|
+
/** Show autocomplete results */
|
|
63
|
+
this.autocomplete = false;
|
|
64
|
+
/** Minimun number of characters to dispatch typing event */
|
|
65
|
+
this.autocompleteMinChars = 3;
|
|
66
|
+
/** Truncate results to single row */
|
|
67
|
+
this.resultsEllipsis = true;
|
|
68
|
+
/** Search helper text */
|
|
69
|
+
this.searchHelperLabel = "Cerca {searchString}";
|
|
70
|
+
/** Sort autocomplete results items */
|
|
71
|
+
this.sortResultsItems = false;
|
|
72
|
+
/** Show submit button */
|
|
73
|
+
this.showSearchButton = false;
|
|
74
|
+
/** Set button icon without label*/
|
|
75
|
+
this.searchButtonIconOnly = false;
|
|
76
|
+
/** Available sizes: `big`, `small` and `x-small`. Defaults to `big`. */
|
|
77
|
+
this.size = ControlSize.BIG;
|
|
78
|
+
/** Graphical variant: `primary`, `secondary`, `tertiary`. Defaults to `primary`. */
|
|
79
|
+
this.variant = ButtonVariant.PRIMARY;
|
|
80
|
+
this.searchString = this.value;
|
|
81
|
+
this.currResultsCount = 0;
|
|
82
|
+
this.showResults = false;
|
|
83
|
+
this.resultsItemsList = null;
|
|
84
|
+
}
|
|
85
|
+
emitSearchSubmit() {
|
|
86
|
+
this.searchSubmit.emit(this.inputRef.value);
|
|
87
|
+
}
|
|
88
|
+
emitSearchTyping(search) {
|
|
89
|
+
this.searchTyping.emit(search);
|
|
90
|
+
}
|
|
91
|
+
emitSearchItemClick(item) {
|
|
92
|
+
this.searchItemClick.emit(item);
|
|
93
|
+
}
|
|
94
|
+
watchItems() {
|
|
95
|
+
this.resultsItemsList = this.getResultsItemsList();
|
|
96
|
+
}
|
|
97
|
+
watchResultsCount() {
|
|
98
|
+
this.currResultsCount = this.resultsCount;
|
|
99
|
+
}
|
|
100
|
+
watchValue() {
|
|
101
|
+
this.searchString = this.value;
|
|
102
|
+
}
|
|
103
|
+
watchSearchString() {
|
|
104
|
+
this.emitSearchTyping(this.searchString);
|
|
105
|
+
if (!this.searchString) {
|
|
106
|
+
this.currResultsCount = this.resultsCount;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
componentWillLoad() {
|
|
110
|
+
this.resultsItemsList = this.getResultsItemsList();
|
|
111
|
+
this.currResultsCount = this.resultsCount;
|
|
112
|
+
}
|
|
113
|
+
getResultsItemsList() {
|
|
114
|
+
return typeof this.resultsItems === "string" ? JSON.parse(this.resultsItems) : this.resultsItems;
|
|
115
|
+
}
|
|
116
|
+
getGroupedItems(items) {
|
|
117
|
+
const groupedItems = {};
|
|
118
|
+
items.forEach((item) => {
|
|
119
|
+
var _a;
|
|
120
|
+
const key = `${item === null || item === void 0 ? void 0 : item.category}${item === null || item === void 0 ? void 0 : item.subcategory}`;
|
|
121
|
+
groupedItems[key] = (_a = groupedItems[key]) !== null && _a !== void 0 ? _a : {
|
|
122
|
+
category: item === null || item === void 0 ? void 0 : item.category,
|
|
123
|
+
subcategory: item === null || item === void 0 ? void 0 : item.subcategory,
|
|
124
|
+
items: [],
|
|
125
|
+
};
|
|
126
|
+
groupedItems[key]["items"].push(item);
|
|
127
|
+
});
|
|
128
|
+
if (this.sortResultsItems) {
|
|
129
|
+
return Object.keys(groupedItems)
|
|
130
|
+
.sort()
|
|
131
|
+
.reduce((obj, key) => {
|
|
132
|
+
obj[key] = Object.assign(Object.assign({}, groupedItems[key]), { items: groupedItems[key]["items"].sort((a, b) => {
|
|
133
|
+
const nameA = a.label.toUpperCase();
|
|
134
|
+
const nameB = b.label.toUpperCase();
|
|
135
|
+
if (nameA < nameB) {
|
|
136
|
+
return -1;
|
|
137
|
+
}
|
|
138
|
+
if (nameA > nameB) {
|
|
139
|
+
return 1;
|
|
140
|
+
}
|
|
141
|
+
return 0;
|
|
142
|
+
}) });
|
|
143
|
+
return obj;
|
|
144
|
+
}, {});
|
|
145
|
+
}
|
|
146
|
+
return groupedItems;
|
|
147
|
+
}
|
|
148
|
+
checkResultsCount(counter) {
|
|
149
|
+
if (!this.currResultsCount || counter < this.currResultsCount) {
|
|
150
|
+
return true;
|
|
151
|
+
}
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
handleStopTyping(e) {
|
|
155
|
+
e.stopPropagation();
|
|
156
|
+
this.searchString = e.detail.value;
|
|
157
|
+
}
|
|
158
|
+
handleSubmit() {
|
|
159
|
+
if (this.preventSubmit) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
this.emitSearchSubmit();
|
|
163
|
+
}
|
|
164
|
+
handleOutsideClick(e) {
|
|
165
|
+
const cp = e.composedPath();
|
|
166
|
+
const searchbar = cp.find((elem) => elem.nodeName === "Z-SEARCHBAR");
|
|
167
|
+
if (!searchbar || searchbar.htmlid !== this.htmlid) {
|
|
168
|
+
this.showResults = false;
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
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")); })) {
|
|
172
|
+
this.showResults = true;
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
this.showResults = false;
|
|
176
|
+
}
|
|
177
|
+
renderInput() {
|
|
178
|
+
return (h("z-input", { ref: (val) => {
|
|
179
|
+
this.inputRef = val;
|
|
180
|
+
}, message: false, placeholder: this.placeholder, onStopTyping: (e) => this.handleStopTyping(e), onKeyUp: (e) => handleEnterKeydSubmit(e, () => this.handleSubmit()), value: this.value, size: this.size }));
|
|
181
|
+
}
|
|
182
|
+
renderButton() {
|
|
183
|
+
if (!this.showSearchButton) {
|
|
184
|
+
return null;
|
|
185
|
+
}
|
|
186
|
+
const iconProp = this.searchButtonIconOnly ? { icon: "search" } : null;
|
|
187
|
+
const buttonLabel = this.searchButtonIconOnly ? "" : "CERCA";
|
|
188
|
+
const defaultProps = Object.assign({ disabled: this.preventSubmit, variant: this.variant, size: this.size, onClick: () => this.handleSubmit() }, iconProp);
|
|
189
|
+
return h("z-button", Object.assign({}, defaultProps), buttonLabel);
|
|
190
|
+
}
|
|
191
|
+
renderResults() {
|
|
192
|
+
if (!this.showResults ||
|
|
193
|
+
!this.autocomplete ||
|
|
194
|
+
!this.searchString ||
|
|
195
|
+
this.searchString.length < this.autocompleteMinChars ||
|
|
196
|
+
!this.resultsItemsList) {
|
|
197
|
+
return null;
|
|
198
|
+
}
|
|
199
|
+
return (h("div", { class: "results-wrapper" }, h("div", { class: "results" }, this.renderResultsList())));
|
|
200
|
+
}
|
|
201
|
+
renderResultsList() {
|
|
202
|
+
var _a, _b;
|
|
203
|
+
if (this.preventSubmit && !((_a = this.resultsItemsList) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
204
|
+
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"))));
|
|
205
|
+
}
|
|
206
|
+
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()));
|
|
207
|
+
}
|
|
208
|
+
renderItems() {
|
|
209
|
+
var _a;
|
|
210
|
+
if (!((_a = this.resultsItemsList) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
211
|
+
return [];
|
|
212
|
+
}
|
|
213
|
+
const groupedItems = this.getGroupedItems(this.resultsItemsList);
|
|
214
|
+
const listGroups = [];
|
|
215
|
+
let counter = 0;
|
|
216
|
+
Object.values(groupedItems).forEach((groupItem, index, array) => {
|
|
217
|
+
if (this.checkResultsCount(counter)) {
|
|
218
|
+
const listGroupsElements = [];
|
|
219
|
+
groupItem.items.forEach((item, subindex, subarray) => {
|
|
220
|
+
if (this.checkResultsCount(counter)) {
|
|
221
|
+
const isLast = index === array.length - 1 && subindex === subarray.length - 1;
|
|
222
|
+
listGroupsElements.push(this.renderItem(item, subindex, !isLast));
|
|
223
|
+
}
|
|
224
|
+
counter++;
|
|
225
|
+
});
|
|
226
|
+
if (listGroupsElements.length) {
|
|
227
|
+
listGroups.push(h("z-list-group", { "divider-type": ListDividerType.ELEMENT }, this.renderItemCategory(groupItem), listGroupsElements));
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
return listGroups;
|
|
232
|
+
}
|
|
233
|
+
renderItem(item, key, divider) {
|
|
234
|
+
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) }))));
|
|
235
|
+
}
|
|
236
|
+
renderItemLabel(label) {
|
|
237
|
+
if (!this.searchString) {
|
|
238
|
+
return label;
|
|
239
|
+
}
|
|
240
|
+
return label.replace(new RegExp(this.searchString.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "gmi"), (found) => `<mark>${found}</mark>`);
|
|
241
|
+
}
|
|
242
|
+
renderItemCategory(groupItem) {
|
|
243
|
+
if (!(groupItem === null || groupItem === void 0 ? void 0 : groupItem.category)) {
|
|
244
|
+
return null;
|
|
245
|
+
}
|
|
246
|
+
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)));
|
|
247
|
+
}
|
|
248
|
+
renderSearchHelper(hasDivider = true) {
|
|
249
|
+
if (!this.autocomplete || this.preventSubmit || !this.searchString) {
|
|
250
|
+
return null;
|
|
251
|
+
}
|
|
252
|
+
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>`) }))));
|
|
253
|
+
}
|
|
254
|
+
renderShowAllResults() {
|
|
255
|
+
var _a, _b;
|
|
256
|
+
if (!this.currResultsCount ||
|
|
257
|
+
!this.searchString ||
|
|
258
|
+
!((_a = this.resultsItemsList) === null || _a === void 0 ? void 0 : _a.length) ||
|
|
259
|
+
this.currResultsCount >= ((_b = this.resultsItemsList) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
260
|
+
return null;
|
|
261
|
+
}
|
|
262
|
+
return (h("z-list-element", { role: "option", tabindex: 0, clickable: true, id: `list-item-${this.htmlid}-show-all`, onClickItem: () => (this.currResultsCount = 0), color: "color-primary01" }, h("div", { class: "item-show-all" }, "Vedi tutti i risultati")));
|
|
263
|
+
}
|
|
264
|
+
render() {
|
|
265
|
+
return (h(Host, { onFocus: () => (this.showResults = true), onClick: (e) => this.handleOutsideClick(e), class: { "has-submit": this.showSearchButton, "has-results": this.autocomplete } }, h("div", { class: "input-container" }, this.renderInput(), this.renderResults()), this.renderButton()));
|
|
266
|
+
}
|
|
267
|
+
static get watchers() { return {
|
|
268
|
+
"resultsItems": ["watchItems"],
|
|
269
|
+
"resultsCount": ["watchResultsCount"],
|
|
270
|
+
"value": ["watchValue"],
|
|
271
|
+
"searchString": ["watchSearchString"]
|
|
272
|
+
}; }
|
|
273
|
+
};
|
|
274
|
+
ZSearchbar.style = stylesCss;
|
|
275
|
+
|
|
276
|
+
export { ZOffcanvas as z_offcanvas, ZSearchbar as z_searchbar };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-4968ce56.js';
|
|
2
2
|
import { q as PocketStatus } from './index-47f23745.js';
|
|
3
|
-
import {
|
|
3
|
+
import { h as handleKeyboardSubmit } from './utils-3d2372eb.js';
|
|
4
4
|
import { h as hammer } from './hammer-c3266b17.js';
|
|
5
5
|
import './breakpoints-9b81eb1b.js';
|
|
6
6
|
import './_commonjsHelpers-9943807e.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-4968ce56.js';
|
|
2
2
|
import { e as ControlSize, g as KeyboardCode, l as ListDividerType, i as ListSize } from './index-47f23745.js';
|
|
3
|
-
import { r as randomId, b as boolean,
|
|
3
|
+
import { r as randomId, b as boolean, a as getElementTree, h as handleKeyboardSubmit, d as getClickedElement } from './utils-3d2372eb.js';
|
|
4
4
|
import './breakpoints-9b81eb1b.js';
|
|
5
5
|
|
|
6
6
|
const stylesCss = ".sc-z-select-h{display:inline-block;width:inherit;color:var(--color-text02);font-family:var(--font-family-sans);font-size:var(--font-size-3);font-weight:var(--font-rg)}[size=\"small\"].sc-z-select-h,[size=\"x-small\"].sc-z-select-h{font-size:var(--font-size-2)}.select-wrapper.sc-z-select>z-input.sc-z-select{width:100%}.select-wrapper.sc-z-select>div.sc-z-select{position:relative}.select-wrapper.sc-z-select>div.closed.sc-z-select{overflow:hidden;height:0}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select{position:absolute;width:100%;box-sizing:border-box;padding:calc(var(--space-unit) * 0.5) var(--space-unit);border:var(--border-size-small) solid var(--gray200);border-top:none;background:var(--color-surface01);outline:none}.select-wrapper.sc-z-select .closed.sc-z-select .ul-scroll-wrapper.sc-z-select{z-index:10}.select-wrapper.sc-z-select .open.sc-z-select .ul-scroll-wrapper.sc-z-select{z-index:20}.select-wrapper.sc-z-select .ul-scroll-wrapper.fixed.sc-z-select{position:static}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select{position:relative;overflow:auto;max-height:240px;padding:calc(var(--space-unit) * 0.5);outline:none;scrollbar-color:var(--color-primary01) transparent}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select::-webkit-scrollbar{width:10px;background:linear-gradient(to right, transparent 0 3px, var(--gray200) 3px 7px, transparent 7px 10px);border-radius:var(--border-radius)}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select::-webkit-scrollbar-track{background-color:transparent}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select::-webkit-scrollbar-thumb{width:10px;background-color:var(--color-primary01);border-radius:var(--border-radius)}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select::-webkit-scrollbar-thumb:hover{background-color:var(--color-hover-primary)}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select .list-element-content.sc-z-select{display:block;padding:calc(var(--space-unit) * 0.5) calc(var(--space-unit) * 1.5)}[size=\"x-small\"].sc-z-select-h .select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select .list-element-content.sc-z-select{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}";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, g as getElement } from './index-4968ce56.js';
|
|
2
|
-
import {
|
|
2
|
+
import { a as getElementTree, h as handleKeyboardSubmit } from './utils-3d2372eb.js';
|
|
3
3
|
import { T as ThemeVariant } from './index-47f23745.js';
|
|
4
4
|
import './breakpoints-9b81eb1b.js';
|
|
5
5
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, h, g as getElement } from './index-4968ce56.js';
|
|
2
2
|
import { p as Device } from './index-47f23745.js';
|
|
3
|
-
import {
|
|
3
|
+
import { e as convertJson, g as getDevice, h as handleKeyboardSubmit } from './utils-3d2372eb.js';
|
|
4
4
|
import './breakpoints-9b81eb1b.js';
|
|
5
5
|
|
|
6
6
|
const stylesCss = ":host{display:block;width:inherit;font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>div{display:flex;width:inherit;flex-direction:column}main{position:relative;overflow:hidden;width:100%}main z-icon.scroll{position:absolute;z-index:10;top:50%;width:auto;margin:0 var(--space-unit);cursor:pointer;fill:var(--color-primary01);transition:0.6s ease}main .scroll.disabled{opacity:0.5;pointer-events:none}main .scroll.right{right:0}#slides{display:flex;flex-wrap:wrap;line-height:0px;overflow-y:hidden;transition:all 300ms}footer{display:grid;width:100%;height:56px;align-items:center;border-top:var(--border-size-medium) solid var(--color-surface02);grid-template:2 / 2;grid-template-areas:\"center center\" \"left right\"}footer>div{width:100%;align-items:center}footer .footer-center{grid-area:center}footer .footer-left{grid-area:left}footer .footer-right{grid-area:right}footer .bullet-container{display:flex;min-height:60px;align-items:center;justify-content:center;margin:0 auto}footer .bullet-container .bullet{width:8px;height:8px;margin:var(--space-unit) 2px;background-color:var(--gray200);border-radius:50%;pointer-events:none}footer .bullet-container .bullet.selected{background-color:var(--gray400)}@media only screen and (min-width: 768px){footer{height:76px;border-top:var(--border-size-medium) solid var(--color-surface02);grid-template:1 / 1fr 2fr 1fr;grid-template-areas:\"left center right\"}footer .bullet-container .bullet{width:10px;height:10px;margin:var(--space-unit) 3px}}@media only screen and (min-width: 1025px){main z-icon.scroll{margin:0 10px}footer .bullet-container .bullet{width:16px;height:16px;margin:var(--space-unit) calc(var(--space-unit) * 0.5);cursor:pointer;pointer-events:auto}}";
|
|
@@ -7,11 +7,11 @@ import './index-6161978d.js';
|
|
|
7
7
|
import './index-361b27f9.js';
|
|
8
8
|
import './index-fac1fe6c.js';
|
|
9
9
|
import './index-8f7fd43f.js';
|
|
10
|
-
import './index-
|
|
10
|
+
import './index-df06f147.js';
|
|
11
11
|
import './index-816801e5.js';
|
|
12
12
|
import './index-e6ee76f0.js';
|
|
13
13
|
import './index-531501d7.js';
|
|
14
|
-
import './utils-
|
|
14
|
+
import './utils-3d2372eb.js';
|
|
15
15
|
|
|
16
16
|
const stylesCss = "z-table-deprecated{display:block;width:100%;background-color:var(--color-white);font-family:var(--font-family-sans);font-weight:var(--font-rg);overflow-x:auto}z-table-deprecated>div.table{display:table;width:100%;border-collapse:separate}z-table-deprecated>div.table-bordered>z-table-body>z-table-row>z-table-cell:not(:last-child),z-table-deprecated>div.table-bordered>z-table-head>z-table-header-row>z-table-header:not(:last-child){border-right:var(--border-size-small) solid var(--color-surface03)}z-table-deprecated>div>z-table-body>z-table-row[expandable]>z-table-cell:first-child,z-table-deprecated>div>z-table-head>z-table-header-row[expandable]>z-table-header:first-child{border-right:none}z-table-deprecated>div>z-table-body>z-table-row[expanded]>z-table-cell{background-color:var(--gray50)}z-table-deprecated>div>z-table-body>z-table-row[expanded]+z-table-expanded-row{border-bottom:1px solid var(--gray200)}z-table-deprecated>div.table-column-sticky>z-table-body>z-table-row>z-table-cell:first-child,z-table-deprecated>div.table-column-sticky>z-table-head>z-table-header-row>z-table-header:first-child{position:sticky;z-index:1;left:0;box-shadow:1px 0 4px -1px rgb(66 69 72 / 40%)}z-table-deprecated>div.table-header-sticky>z-table-head>z-table-header-row>z-table-header{position:sticky;z-index:2;top:0;box-shadow:0 2px 3px -3px rgb(66 69 72 / 40%)}z-table-deprecated>div.table-header-sticky>z-table-head>z-table-header-row>z-table-header:first-child,z-table-deprecated>div.table-column-sticky>z-table-head>z-table-header-row>z-table-header:first-child{z-index:5}z-table-body{width:auto;background-color:var(--color-white)}z-table-empty-box{display:flex;flex-direction:column;flex-grow:1;border-bottom:var(--border-size-small) solid var(--color-surface03)}z-table-empty-box.bordered{border-left:var(--border-size-small) solid var(--color-surface03)}.error-message{margin-top:calc(var(--space-unit) * 2)}.table-content{display:flex;width:100%;flex-direction:row}.error-content{display:flex;padding:calc(var(--space-unit) * 3);font-family:var(--font-family-sans)}.error-content>img{width:244px;height:188px;margin-right:calc(var(--space-unit) * 3)}@media only screen and (max-width: 768px){z-table-deprecated>div.table-empty{display:none}.error-content{display:flex;flex-direction:column}.error-content>img{width:auto;height:auto}.text{padding:calc(var(--space-unit) * 3) 0}}";
|
|
17
17
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { Z as z_table_header } from './index-
|
|
1
|
+
export { Z as z_table_header } from './index-df06f147.js';
|
|
2
2
|
import './index-4968ce56.js';
|
|
3
3
|
import './index-47f23745.js';
|
|
4
|
-
import './utils-
|
|
4
|
+
import './utils-3d2372eb.js';
|
|
5
5
|
import './breakpoints-9b81eb1b.js';
|