@zanichelli/albe-web-components 6.9.0 → 6.10.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.
Files changed (86) hide show
  1. package/dist/cjs/index-e3299e0a.js +22 -2
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/web-components-library.cjs.js +1 -1
  4. package/dist/cjs/z-app-header_2.cjs.entry.js +153 -0
  5. package/dist/cjs/z-body_2.cjs.entry.js +42 -0
  6. package/dist/cjs/z-combobox.cjs.entry.js +1 -1
  7. package/dist/cjs/z-divider.cjs.entry.js +26 -0
  8. package/dist/cjs/z-input_2.cjs.entry.js +266 -0
  9. package/dist/cjs/z-list_3.cjs.entry.js +261 -0
  10. package/dist/cjs/z-select.cjs.entry.js +325 -0
  11. package/dist/collection/components/inputs/z-combobox/styles.css +14 -4
  12. package/dist/collection/components/inputs/z-input/styles.css +19 -6
  13. package/dist/collection/components/inputs/z-select/index.js +28 -2
  14. package/dist/collection/components/inputs/z-select/styles.css +4 -0
  15. package/dist/esm/index-a2ca4b97.js +22 -2
  16. package/dist/esm/index.js +1 -1
  17. package/dist/esm/loader.js +1 -1
  18. package/dist/esm/{utils-5445d989.js → utils-6cf7efe2.js} +1 -1
  19. package/dist/esm/web-components-library.js +1 -1
  20. package/dist/esm/z-app-header_2.entry.js +148 -0
  21. package/dist/esm/z-body_2.entry.js +37 -0
  22. package/dist/esm/z-chip.entry.js +1 -1
  23. package/dist/esm/z-combobox.entry.js +2 -2
  24. package/dist/esm/z-divider.entry.js +22 -0
  25. package/dist/esm/z-file-upload.entry.js +1 -1
  26. package/dist/esm/z-input_2.entry.js +261 -0
  27. package/dist/esm/z-list_3.entry.js +255 -0
  28. package/dist/esm/z-myz-card-info.entry.js +1 -1
  29. package/dist/esm/z-myz-list-item.entry.js +1 -1
  30. package/dist/esm/z-pocket_3.entry.js +1 -1
  31. package/dist/esm/z-searchbar.entry.js +1 -1
  32. package/dist/esm/z-select.entry.js +321 -0
  33. package/dist/esm/z-skip-to-content.entry.js +1 -1
  34. package/dist/esm/z-slideshow.entry.js +1 -1
  35. package/dist/esm/z-table-header.entry.js +1 -1
  36. package/dist/esm/z-toggle-switch.entry.js +1 -1
  37. package/dist/types/components/inputs/z-select/index.d.ts +2 -0
  38. package/dist/types/components.d.ts +8 -0
  39. package/dist/web-components-library/index.esm.js +1 -1
  40. package/dist/web-components-library/{p-48d3f650.entry.js → p-26033729.entry.js} +1 -1
  41. package/dist/web-components-library/p-33352f9e.entry.js +1 -0
  42. package/dist/web-components-library/{p-229e17af.entry.js → p-53065788.entry.js} +1 -1
  43. package/dist/web-components-library/{p-51333b32.entry.js → p-54b18f6e.entry.js} +1 -1
  44. package/dist/web-components-library/{p-28b288a8.entry.js → p-5c62387a.entry.js} +1 -1
  45. package/dist/web-components-library/p-6acb48e3.entry.js +1 -0
  46. package/dist/web-components-library/{p-102d82ee.entry.js → p-6c163539.entry.js} +1 -1
  47. package/dist/web-components-library/{p-d0accfc5.entry.js → p-7b3b99ee.entry.js} +1 -1
  48. package/{www/build/p-00481c22.js → dist/web-components-library/p-8ebe4adf.js} +1 -1
  49. package/dist/web-components-library/{p-db77ef4e.entry.js → p-93142fac.entry.js} +1 -1
  50. package/dist/web-components-library/p-9c338aeb.entry.js +1 -0
  51. package/dist/web-components-library/{p-669f14ae.entry.js → p-a05ce0a6.entry.js} +1 -1
  52. package/dist/web-components-library/{p-933efc27.entry.js → p-a6c0f149.entry.js} +1 -1
  53. package/dist/web-components-library/p-a79d1412.entry.js +1 -0
  54. package/dist/web-components-library/{p-5bbbda4e.entry.js → p-bb92c90f.entry.js} +1 -1
  55. package/dist/web-components-library/{p-169b9762.entry.js → p-d2127d84.entry.js} +1 -1
  56. package/dist/web-components-library/p-d9a6a204.entry.js +1 -0
  57. package/dist/web-components-library/p-ff27c534.entry.js +1 -0
  58. package/dist/web-components-library/web-components-library.esm.js +1 -1
  59. package/package.json +1 -1
  60. package/www/build/index.esm.js +1 -1
  61. package/www/build/{p-48d3f650.entry.js → p-26033729.entry.js} +1 -1
  62. package/www/build/p-33352f9e.entry.js +1 -0
  63. package/www/build/{p-229e17af.entry.js → p-53065788.entry.js} +1 -1
  64. package/www/build/{p-51333b32.entry.js → p-54b18f6e.entry.js} +1 -1
  65. package/www/build/{p-28b288a8.entry.js → p-5c62387a.entry.js} +1 -1
  66. package/www/build/p-6acb48e3.entry.js +1 -0
  67. package/www/build/{p-102d82ee.entry.js → p-6c163539.entry.js} +1 -1
  68. package/www/build/{p-d0accfc5.entry.js → p-7b3b99ee.entry.js} +1 -1
  69. package/{dist/web-components-library/p-00481c22.js → www/build/p-8ebe4adf.js} +1 -1
  70. package/www/build/{p-db77ef4e.entry.js → p-93142fac.entry.js} +1 -1
  71. package/www/build/p-9c338aeb.entry.js +1 -0
  72. package/www/build/{p-669f14ae.entry.js → p-a05ce0a6.entry.js} +1 -1
  73. package/www/build/{p-933efc27.entry.js → p-a6c0f149.entry.js} +1 -1
  74. package/www/build/p-a79d1412.entry.js +1 -0
  75. package/www/build/{p-5bbbda4e.entry.js → p-bb92c90f.entry.js} +1 -1
  76. package/www/build/{p-169b9762.entry.js → p-d2127d84.entry.js} +1 -1
  77. package/www/build/p-d9a6a204.entry.js +1 -0
  78. package/www/build/p-de48bd49.js +1 -0
  79. package/www/build/p-ff27c534.entry.js +1 -0
  80. package/www/build/web-components-library.esm.js +1 -1
  81. package/www/index.html +1 -1
  82. package/dist/cjs/z-app-header_11.cjs.entry.js +0 -1030
  83. package/dist/esm/z-app-header_11.entry.js +0 -1016
  84. package/dist/web-components-library/p-4bdf6a9b.entry.js +0 -1
  85. package/www/build/p-4bdf6a9b.entry.js +0 -1
  86. package/www/build/p-e9b88186.js +0 -1
@@ -0,0 +1,321 @@
1
+ import { r as registerInstance, c as createEvent, h, g as getElement } from './index-a2ca4b97.js';
2
+ import { e as KeyboardCode, k as ListDividerType } from './index-968a240f.js';
3
+ import { r as randomId, b as boolean, a as getElementTree, h as handleKeyboardSubmit, d as getClickedElement } from './utils-6cf7efe2.js';
4
+ import './breakpoints-c386984e.js';
5
+
6
+ const stylesCss = ".sc-z-select-h{display:inline-block;width:inherit;color:var(--color-text02);font-family:var(--font-family-sans);font-size:var(--font-size-3);font-weight:var(--font-rg)}.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: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}";
7
+
8
+ const ZSelect = class {
9
+ constructor(hostRef) {
10
+ registerInstance(this, hostRef);
11
+ this.optionSelect = createEvent(this, "optionSelect", 7);
12
+ this.resetSelect = createEvent(this, "resetSelect", 7);
13
+ /** the id of the input element */
14
+ this.htmlid = `id-${randomId()}`;
15
+ /** the input aria-label */
16
+ this.ariaLabel = "";
17
+ /** the input is disabled */
18
+ this.disabled = false;
19
+ /** the input is readonly */
20
+ this.readonly = false;
21
+ /** input helper message (optional) - if set to `false` message won't be displayed */
22
+ this.message = true;
23
+ /** the input has autocomplete option */
24
+ this.autocomplete = false;
25
+ /** no result text message */
26
+ this.noresultslabel = "Nessun risultato";
27
+ /** When fixed, it occupies space and pushes down next elements. */
28
+ this.isfixed = false;
29
+ this.isOpen = false;
30
+ this.selectedItem = null;
31
+ this.itemsList = [];
32
+ this.toggleSelectUl = this.toggleSelectUl.bind(this);
33
+ this.selectItem = this.selectItem.bind(this);
34
+ this.handleSelectFocus = this.handleSelectFocus.bind(this);
35
+ }
36
+ watchItems() {
37
+ this.itemsList = this.getInitialItemsArray();
38
+ this.selectedItem = this.itemsList.find((item) => item.selected);
39
+ }
40
+ /** get the input selected options */
41
+ async getSelectedItem() {
42
+ return this.selectedItem;
43
+ }
44
+ /** get the input value */
45
+ async getValue() {
46
+ return this.getSelectedValue();
47
+ }
48
+ /** set the input value */
49
+ async setValue(value) {
50
+ let values = [];
51
+ if (typeof value === "string") {
52
+ values.push(value);
53
+ }
54
+ else {
55
+ values = value;
56
+ }
57
+ this.selectedItem = this.itemsList.find((item) => values.includes(item.id));
58
+ }
59
+ emitOptionSelect() {
60
+ this.optionSelect.emit({
61
+ id: this.htmlid,
62
+ selected: this.getSelectedValue(),
63
+ });
64
+ }
65
+ emitResetSelect() {
66
+ this.resetSelect.emit({
67
+ id: this.htmlid,
68
+ });
69
+ }
70
+ componentWillLoad() {
71
+ this.watchItems();
72
+ }
73
+ componentWillRender() {
74
+ this.filterItems(this.searchString);
75
+ }
76
+ getInitialItemsArray() {
77
+ return typeof this.items === "string" ? JSON.parse(this.items) : this.items;
78
+ }
79
+ mapSelectedItemToItemsArray() {
80
+ const initialItemsList = this.getInitialItemsArray();
81
+ return initialItemsList.map((item) => {
82
+ var _a;
83
+ item.selected = item.id === ((_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.id);
84
+ return item;
85
+ });
86
+ }
87
+ getSelectedValue() {
88
+ var _a;
89
+ return (_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.id;
90
+ }
91
+ filterItems(searchString) {
92
+ const prevList = this.mapSelectedItemToItemsArray();
93
+ if (!(searchString === null || searchString === void 0 ? void 0 : searchString.length)) {
94
+ this.itemsList = prevList;
95
+ }
96
+ else {
97
+ this.itemsList = prevList
98
+ .filter((item) => {
99
+ return item.name.toUpperCase().includes(searchString.toUpperCase());
100
+ })
101
+ .map((item) => {
102
+ const start = item.name.toUpperCase().indexOf(searchString.toUpperCase());
103
+ const end = start + searchString.length;
104
+ const newName = item.name.substring(0, start) +
105
+ `<strong>${item.name.substring(start, end)}</strong>` +
106
+ item.name.substring(end, item.name.length);
107
+ item.name = newName;
108
+ return item;
109
+ });
110
+ }
111
+ }
112
+ hasAutocomplete() {
113
+ return boolean(this.autocomplete) === true;
114
+ }
115
+ handleInputChange(e) {
116
+ this.searchString = e.detail.value;
117
+ if (!this.isOpen) {
118
+ this.toggleSelectUl();
119
+ }
120
+ }
121
+ selectItem(item, selected) {
122
+ if (item && item.disabled) {
123
+ return;
124
+ }
125
+ this.itemsList = this.mapSelectedItemToItemsArray();
126
+ this.itemsList = this.itemsList.map((i) => {
127
+ i.selected = false;
128
+ if (i.id === (item === null || item === void 0 ? void 0 : item.id)) {
129
+ i.selected = selected;
130
+ }
131
+ return i;
132
+ });
133
+ this.selectedItem = this.itemsList.find((item) => item.selected);
134
+ this.emitOptionSelect();
135
+ if (this.searchString) {
136
+ this.searchString = null;
137
+ }
138
+ }
139
+ arrowsSelectNav(e, key) {
140
+ const showResetIcon = this.resetItem && !!this.selectedItem;
141
+ const arrows = [KeyboardCode.ARROW_DOWN, KeyboardCode.ARROW_UP];
142
+ if (!arrows.includes(e.key)) {
143
+ return;
144
+ }
145
+ e.preventDefault();
146
+ e.stopPropagation();
147
+ if (!this.isOpen) {
148
+ this.toggleSelectUl();
149
+ }
150
+ let index;
151
+ if (this.resetItem) {
152
+ if (e.key === KeyboardCode.ARROW_DOWN) {
153
+ index = key + 1 === this.itemsList.length + 1 ? +!showResetIcon : key + 1;
154
+ }
155
+ else if (e.key === KeyboardCode.ARROW_UP) {
156
+ index = key <= +!showResetIcon ? this.itemsList.length : key - 1;
157
+ }
158
+ }
159
+ if (!this.resetItem) {
160
+ if (e.key === KeyboardCode.ARROW_DOWN) {
161
+ index = key + 1 === this.itemsList.length ? 0 : key + 1;
162
+ }
163
+ else if (e.key === KeyboardCode.ARROW_UP) {
164
+ index = key <= 0 ? this.itemsList.length - 1 : key - 1;
165
+ }
166
+ }
167
+ this.focusSelectItem(index);
168
+ }
169
+ focusSelectItem(index) {
170
+ const focusElem = this.element.querySelector(`#${this.htmlid}_${index}`);
171
+ if (focusElem) {
172
+ focusElem.focus();
173
+ }
174
+ }
175
+ toggleSelectUl(selfFocusOnClose = false) {
176
+ if (this.disabled || this.readonly) {
177
+ return;
178
+ }
179
+ if (!this.isOpen) {
180
+ document.addEventListener("click", this.handleSelectFocus);
181
+ document.addEventListener("keyup", this.handleSelectFocus);
182
+ }
183
+ else {
184
+ document.removeEventListener("click", this.handleSelectFocus);
185
+ document.removeEventListener("keyup", this.handleSelectFocus);
186
+ if (selfFocusOnClose) {
187
+ this.element.querySelector(`#${this.htmlid}_input`).focus();
188
+ }
189
+ }
190
+ this.isOpen = !this.isOpen;
191
+ }
192
+ handleInputClick(e) {
193
+ const cp = e.composedPath();
194
+ const clearIcon = cp.find((item) => item.classList && item.classList.contains("reset-icon"));
195
+ if (clearIcon) {
196
+ e.stopPropagation();
197
+ return;
198
+ }
199
+ this.toggleSelectUl();
200
+ }
201
+ handleSelectFocus(e) {
202
+ if (e instanceof KeyboardEvent && e.key === KeyboardCode.ESC) {
203
+ e.stopPropagation();
204
+ return this.toggleSelectUl(true);
205
+ }
206
+ if (e instanceof KeyboardEvent && e.key !== KeyboardCode.TAB && e.key !== KeyboardCode.ENTER) {
207
+ return;
208
+ }
209
+ const tree = getElementTree(getClickedElement());
210
+ const parent = tree.find((elem) => {
211
+ return elem.nodeName.toLowerCase() === "z-input" && elem.id === `${this.htmlid}_input`;
212
+ });
213
+ if (!parent) {
214
+ this.toggleSelectUl(e instanceof MouseEvent ? true : false);
215
+ }
216
+ }
217
+ scrollToLetter(letter) {
218
+ const foundItem = this.itemsList.find((item) => item.name.charAt(0) === letter);
219
+ if (foundItem) {
220
+ this.focusSelectItem(this.itemsList.indexOf(foundItem));
221
+ }
222
+ }
223
+ renderInput() {
224
+ return (h("z-input", { class: {
225
+ "active-select": this.isOpen,
226
+ "cursor-select": !this.autocomplete,
227
+ }, id: `${this.htmlid}_input`, htmlid: `${this.htmlid}_input`, placeholder: this.placeholder, value: !this.isOpen && this.selectedItem ? this.selectedItem.name.replace(/<[^>]+>/g, "") : null, label: this.label, "aria-label": this.ariaLabel, icon: this.isOpen ? "caret-up" : "caret-down", hasclearicon: this.hasAutocomplete(), message: false, disabled: this.disabled, readonly: this.readonly || (!this.hasAutocomplete() && this.isOpen), status: this.isOpen ? undefined : this.status, autocomplete: "off", onClick: (e) => {
228
+ this.handleInputClick(e);
229
+ }, onKeyUp: (e) => {
230
+ if (e.keyCode !== 13) {
231
+ e.preventDefault();
232
+ }
233
+ handleKeyboardSubmit(e, this.toggleSelectUl);
234
+ }, onKeyDown: (e) => {
235
+ return this.arrowsSelectNav(e, this.selectedItem ? this.itemsList.indexOf(this.selectedItem) : this.resetItem ? 0 : -1);
236
+ }, onInputChange: (e) => {
237
+ this.handleInputChange(e);
238
+ }, onKeyPress: (e) => {
239
+ if (!this.hasAutocomplete()) {
240
+ e.preventDefault();
241
+ this.scrollToLetter(String.fromCharCode(e.keyCode));
242
+ }
243
+ } }));
244
+ }
245
+ renderSelectUl() {
246
+ var _a;
247
+ return (h("div", { class: this.isOpen ? "open" : "closed", tabindex: "-1" }, h("div", { class: {
248
+ "ul-scroll-wrapper": true,
249
+ "fixed": this.isfixed,
250
+ }, tabindex: "-1" }, h("z-list", { role: "listbox", tabindex: this.disabled || this.readonly || !this.isOpen ? -1 : 0, id: this.htmlid, "aria-activedescendant": (_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.id, "aria-multiselectable": false, class: {
251
+ disabled: this.disabled,
252
+ readonly: this.readonly,
253
+ filled: !!this.selectedItem,
254
+ [`input-${this.status}`]: !this.isOpen && !!this.status,
255
+ } }, this.resetItem && this.renderResetItem(), this.renderSelectUlItems()))));
256
+ }
257
+ renderResetItem() {
258
+ return (h("z-list-element", { class: {
259
+ "hide": !this.selectedItem || !this.resetItem,
260
+ "reset-item": true,
261
+ "reset-item-margin": !this.hasGroupItems,
262
+ }, clickable: true, disabled: false, dividerType: ListDividerType.ELEMENT, role: "option", tabindex: "0", "aria-selected": "false", id: `${this.htmlid}_${this.resetItem ? "0" : "none"}`, onClickItem: () => {
263
+ this.selectedItem = null;
264
+ this.searchString = null;
265
+ this.emitResetSelect();
266
+ }, onKeyDown: (e) => this.arrowsSelectNav(e, 0) }, h("div", { class: "reset-item-content" }, h("z-icon", { name: "multiply-circled" }), h("span", null, this.resetItem))));
267
+ }
268
+ renderItem(item, key, lastItem) {
269
+ return (h("z-list-element", { clickable: !item.disabled, disabled: item.disabled, dividerType: lastItem ? ListDividerType.HEADER : ListDividerType.ELEMENT, role: "option", tabindex: item.disabled || !this.isOpen ? -1 : 0, "aria-selected": !!item.selected, id: `${this.htmlid}_${key}`, onClickItem: () => this.selectItem(item, true), onKeyDown: (e) => this.arrowsSelectNav(e, key) }, h("span", { class: {
270
+ "selected": !!item.selected,
271
+ "list-element-content": true,
272
+ }, innerHTML: item.name })));
273
+ }
274
+ renderSelectUlItems() {
275
+ if (!this.itemsList.length) {
276
+ return this.renderNoSearchResults();
277
+ }
278
+ if (this.hasGroupItems) {
279
+ return this.renderSelectGroupItems();
280
+ }
281
+ return this.itemsList.map((item, key, array) => {
282
+ const lastItem = array.length === key + 1;
283
+ const itemKey = this.resetItem ? key + 1 : key;
284
+ return this.renderItem(item, itemKey, lastItem);
285
+ });
286
+ }
287
+ renderSelectGroupItems() {
288
+ const newData = this.itemsList.reduce((group, item, index, array) => {
289
+ var _a;
290
+ const { category } = item;
291
+ const lastItem = array.length === index + 1;
292
+ const itemKey = this.resetItem ? index + 1 : index;
293
+ const zListItem = this.renderItem(item, itemKey, lastItem);
294
+ group[category] = (_a = group[category]) !== null && _a !== void 0 ? _a : [];
295
+ group[category].push(zListItem);
296
+ return group;
297
+ }, {});
298
+ return Object.entries(newData).map(([key, value]) => {
299
+ return (h("z-list-group", { "divider-type": ListDividerType.ELEMENT }, h("z-body", { class: "z-list-group-title", level: 3, slot: "header-title", variant: "semibold" }, key), value.map((item) => item)));
300
+ });
301
+ }
302
+ renderNoSearchResults() {
303
+ return (h("z-list-element", { color: "blue500", class: "no-results" }, h("z-icon", { name: "multiply-circle", fill: "blue500" }), this.noresultslabel));
304
+ }
305
+ renderMessage() {
306
+ if (boolean(this.message) === false) {
307
+ return;
308
+ }
309
+ return (h("z-input-message", { message: boolean(this.message) === true ? undefined : this.message, status: this.status }));
310
+ }
311
+ render() {
312
+ return (h("div", { class: "select-wrapper" }, this.renderInput(), this.renderSelectUl(), this.renderMessage()));
313
+ }
314
+ get element() { return getElement(this); }
315
+ static get watchers() { return {
316
+ "items": ["watchItems"]
317
+ }; }
318
+ };
319
+ ZSelect.style = stylesCss;
320
+
321
+ export { ZSelect as z_select };
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, h, H as Host, g as getElement } from './index-a2ca4b97.js';
2
- import { g as getElementTree, h as handleKeyboardSubmit } from './utils-5445d989.js';
2
+ import { a as getElementTree, h as handleKeyboardSubmit } from './utils-6cf7efe2.js';
3
3
  import { T as ThemeVariant } from './index-968a240f.js';
4
4
  import './breakpoints-c386984e.js';
5
5
 
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, h, g as getElement } from './index-a2ca4b97.js';
2
2
  import { o as Device } from './index-968a240f.js';
3
- import { e as convertJson, d as getDevice, h as handleKeyboardSubmit } from './utils-5445d989.js';
3
+ import { e as convertJson, g as getDevice, h as handleKeyboardSubmit } from './utils-6cf7efe2.js';
4
4
  import './breakpoints-c386984e.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-base) 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(--bg-neutral-150);border-radius:50%;pointer-events:none}footer .bullet-container .bullet.selected{background-color:var(--bg-neutral-400)}@media only screen and (min-width: 768px){footer{height:76px;border-top:var(--border-base) 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}}";
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a2ca4b97.js';
2
2
  import { h as Size, S as SortDirection, B as ButtonVariant, c as ButtonSize, P as PopoverPosition } from './index-968a240f.js';
3
- import { g as getElementTree } from './utils-5445d989.js';
3
+ import { a as getElementTree } from './utils-6cf7efe2.js';
4
4
  import './breakpoints-c386984e.js';
5
5
 
6
6
  const stylesCss = ":host{position:relative;display:table-cell;border-bottom:var(--border-size-medium) solid var(--gray200);background-color:var(--gray50);font-family:var(--dashboard-font);font-weight:var(--font-sb);text-align:start}.container{display:flex;align-items:flex-end}:host(.sortable){cursor:pointer}:host([padding=\"x-small\"]){padding:calc(var(--space-unit) * 0.5)}:host([padding=\"small\"]){padding:calc(var(--space-unit))}:host([padding=\"medium\"]){padding:calc(var(--space-unit) * 2)}:host([padding=\"large\"]){padding:calc(var(--space-unit) * 2.5)}:host([padding=\"special\"]){padding:0}.arrow{padding-left:var(--space-unit);opacity:1}.popover-container{position:absolute;top:var(--space-unit);right:var(--space-unit);display:none}.popover-container z-popover{--z-popover-theme--surface:var(--gray200);position:relative;z-index:1}.popover-container.visible{display:block}:host(:hover) .popover-container{display:block}";
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host } from './index-a2ca4b97.js';
2
- import { r as randomId } from './utils-5445d989.js';
2
+ import { r as randomId } from './utils-6cf7efe2.js';
3
3
  import { j as LabelPosition } from './index-968a240f.js';
4
4
  import './breakpoints-c386984e.js';
5
5
 
@@ -30,6 +30,8 @@ export declare class ZSelect {
30
30
  noresultslabel?: string;
31
31
  /** */
32
32
  hasGroupItems?: boolean;
33
+ /** When fixed, it occupies space and pushes down next elements. */
34
+ isfixed?: boolean;
33
35
  /** */
34
36
  resetItem?: string;
35
37
  isOpen: boolean;
@@ -1365,6 +1365,10 @@ export namespace Components {
1365
1365
  * the input html title (optional)
1366
1366
  */
1367
1367
  "htmltitle"?: string;
1368
+ /**
1369
+ * When fixed, it occupies space and pushes down next elements.
1370
+ */
1371
+ "isfixed"?: boolean;
1368
1372
  /**
1369
1373
  * the input select options
1370
1374
  */
@@ -4009,6 +4013,10 @@ declare namespace LocalJSX {
4009
4013
  * the input html title (optional)
4010
4014
  */
4011
4015
  "htmltitle"?: string;
4016
+ /**
4017
+ * When fixed, it occupies space and pushes down next elements.
4018
+ */
4019
+ "isfixed"?: boolean;
4012
4020
  /**
4013
4021
  * the input select options
4014
4022
  */
@@ -1 +1 @@
1
- import{c as V}from"./p-00481c22.js";export{n as AlertType,A as AvatarSize,c as ButtonSize,b as ButtonType,B as ButtonVariant,C as CardVariant,Q as CarouselArrowsPosition,R as CarouselProgressMode,M as CoverHeroContentPosition,J as CoverHeroVariant,o as Device,f as DividerOrientation,D as DividerSize,i as ExpandableListButtonAlign,E as ExpandableListStyle,H as InfoRevealPosition,d as InputStatus,I as InputType,e as KeyboardCode,K as KeyboardKeyCode,j as LabelPosition,L as LicenseType,k as ListDividerType,g as ListSize,l as ListType,N as NavigationTabsOrientation,a as NavigationTabsSize,m as NotificationType,O as OffCanvasVariant,p as PocketStatus,P as PopoverPosition,h as Size,S as SortDirection,T as ThemeVariant,q as ToastNotification,s as ToastNotificationPosition,r as ToastNotificationTransition,u as TransitionDirection,t as ZAriaAlertMode,w as ZChipType,y as ZDatePickerMode,z as ZDatePickerModeValue,F as ZDatePickerPosition,v as ZFileUploadType,G as ZRangePickerMode,x as ZSectionTitleDividerPosition,Z as ZTableRowExpandedType}from"./p-a23e9115.js";import"./p-d69e14fb.js";const U={colorFromId:V};export{U as Utils}
1
+ import{c as V}from"./p-8ebe4adf.js";export{n as AlertType,A as AvatarSize,c as ButtonSize,b as ButtonType,B as ButtonVariant,C as CardVariant,Q as CarouselArrowsPosition,R as CarouselProgressMode,M as CoverHeroContentPosition,J as CoverHeroVariant,o as Device,f as DividerOrientation,D as DividerSize,i as ExpandableListButtonAlign,E as ExpandableListStyle,H as InfoRevealPosition,d as InputStatus,I as InputType,e as KeyboardCode,K as KeyboardKeyCode,j as LabelPosition,L as LicenseType,k as ListDividerType,g as ListSize,l as ListType,N as NavigationTabsOrientation,a as NavigationTabsSize,m as NotificationType,O as OffCanvasVariant,p as PocketStatus,P as PopoverPosition,h as Size,S as SortDirection,T as ThemeVariant,q as ToastNotification,s as ToastNotificationPosition,r as ToastNotificationTransition,u as TransitionDirection,t as ZAriaAlertMode,w as ZChipType,y as ZDatePickerMode,z as ZDatePickerModeValue,F as ZDatePickerPosition,v as ZFileUploadType,G as ZRangePickerMode,x as ZSectionTitleDividerPosition,Z as ZTableRowExpandedType}from"./p-a23e9115.js";import"./p-d69e14fb.js";const U={colorFromId:V};export{U as Utils}
@@ -1 +1 @@
1
- import{r as s,c as t,h as e,H as i}from"./p-d17ebc2f.js";import{r as c}from"./p-00481c22.js";import{j as l}from"./p-a23e9115.js";import"./p-d69e14fb.js";const o=class{constructor(e){s(this,e),this.toggleClick=t(this,"toggleClick",7),this.disabled=!1,this.labelPosition=l.LEFT,this.checked=!1,this.htmlid=`toggle-switch-id-${c()}`}emitToggleClick(){this.toggleClick.emit({id:this.htmlid,checked:this.checked})}handleClick(s){this.disabled||(this.checked=s.target.checked,this.emitToggleClick())}render(){return e(i,null,e("input",{id:this.htmlid,type:"checkbox",checked:this.checked,disabled:this.disabled,onChange:this.handleClick.bind(this)}),e("label",{htmlFor:this.htmlid,class:{[this.labelPosition]:!0,disabled:this.disabled}},e("span",null,e("slot",null)),e("span",{class:{container:!0,disabled:this.disabled,checked:this.checked}},e("span",{class:"circle"},this.checked&&e("z-icon",{width:12,height:12,name:"checkmark"})))))}};o.style='.sc-z-toggle-switch-h{position:relative;display:inline-flex;font-family:var(--font-family-sans);font-weight:var(--font-rg)}label.sc-z-toggle-switch{display:flex;flex-direction:row;align-items:center;cursor:pointer}label.disabled.sc-z-toggle-switch{cursor:default}label.right.sc-z-toggle-switch{flex-direction:row-reverse}label.sc-z-toggle-switch>span.sc-z-toggle-switch:first-child{color:var(--color-text01);letter-spacing:0}label.left.sc-z-toggle-switch>span.sc-z-toggle-switch:first-child{margin-right:var(--space-unit)}label.right.sc-z-toggle-switch>span.sc-z-toggle-switch:first-child{margin-left:var(--space-unit)}label.sc-z-toggle-switch>span.container.sc-z-toggle-switch{position:relative;top:1px;left:1px;display:flex;width:calc(var(--space-unit) * 4);height:18px;align-items:center;background-color:var(--gray500);border-radius:var(--space-unit);color:var(--gray500);cursor:pointer}label.sc-z-toggle-switch>span.container.disabled.sc-z-toggle-switch,label.sc-z-toggle-switch>span.container.checked.disabled.sc-z-toggle-switch{background-color:var(--color-disabled01);cursor:default}label.sc-z-toggle-switch>span.container.checked.disabled.sc-z-toggle-switch>span.circle.sc-z-toggle-switch>z-icon.sc-z-toggle-switch{fill:var(--color-disabled01)}label.sc-z-toggle-switch>span.container.checked.sc-z-toggle-switch{background-color:var(--color-primary01);fill:var(--color-primary01)}input.sc-z-toggle-switch:focus:focus-visible+label.sc-z-toggle-switch>span.container.sc-z-toggle-switch:not(.disabled){box-shadow:var(--shadow-focus-primary);outline:none}input.sc-z-toggle-switch:focus:focus-visible+label.sc-z-toggle-switch>span.container.disabled.sc-z-toggle-switch{outline:none}label.sc-z-toggle-switch>span.container.sc-z-toggle-switch:not(.disabled):hover{background-color:var(--color-hover-primary);fill:var(--color-hover-primary)}label.sc-z-toggle-switch>span.container.sc-z-toggle-switch>span.circle.sc-z-toggle-switch{position:absolute;top:1px;left:1px;display:flex;width:calc(var(--space-unit) * 2);height:calc(var(--space-unit) * 2);align-items:center;justify-content:center;margin:0;background-color:var(--color-white);border-radius:7px;box-shadow:var(--shadow-1);transition:transform 0.3s ease}label.sc-z-toggle-switch>span.container.checked.sc-z-toggle-switch>span.circle.sc-z-toggle-switch{transform:translateX(calc(100% - 2px))}input[type="checkbox"].sc-z-toggle-switch{position:absolute;z-index:-1;opacity:0;pointer-events:none}';export{o as z_toggle_switch}
1
+ import{r as s,c as t,h as e,H as i}from"./p-d17ebc2f.js";import{r as c}from"./p-8ebe4adf.js";import{j as l}from"./p-a23e9115.js";import"./p-d69e14fb.js";const o=class{constructor(e){s(this,e),this.toggleClick=t(this,"toggleClick",7),this.disabled=!1,this.labelPosition=l.LEFT,this.checked=!1,this.htmlid=`toggle-switch-id-${c()}`}emitToggleClick(){this.toggleClick.emit({id:this.htmlid,checked:this.checked})}handleClick(s){this.disabled||(this.checked=s.target.checked,this.emitToggleClick())}render(){return e(i,null,e("input",{id:this.htmlid,type:"checkbox",checked:this.checked,disabled:this.disabled,onChange:this.handleClick.bind(this)}),e("label",{htmlFor:this.htmlid,class:{[this.labelPosition]:!0,disabled:this.disabled}},e("span",null,e("slot",null)),e("span",{class:{container:!0,disabled:this.disabled,checked:this.checked}},e("span",{class:"circle"},this.checked&&e("z-icon",{width:12,height:12,name:"checkmark"})))))}};o.style='.sc-z-toggle-switch-h{position:relative;display:inline-flex;font-family:var(--font-family-sans);font-weight:var(--font-rg)}label.sc-z-toggle-switch{display:flex;flex-direction:row;align-items:center;cursor:pointer}label.disabled.sc-z-toggle-switch{cursor:default}label.right.sc-z-toggle-switch{flex-direction:row-reverse}label.sc-z-toggle-switch>span.sc-z-toggle-switch:first-child{color:var(--color-text01);letter-spacing:0}label.left.sc-z-toggle-switch>span.sc-z-toggle-switch:first-child{margin-right:var(--space-unit)}label.right.sc-z-toggle-switch>span.sc-z-toggle-switch:first-child{margin-left:var(--space-unit)}label.sc-z-toggle-switch>span.container.sc-z-toggle-switch{position:relative;top:1px;left:1px;display:flex;width:calc(var(--space-unit) * 4);height:18px;align-items:center;background-color:var(--gray500);border-radius:var(--space-unit);color:var(--gray500);cursor:pointer}label.sc-z-toggle-switch>span.container.disabled.sc-z-toggle-switch,label.sc-z-toggle-switch>span.container.checked.disabled.sc-z-toggle-switch{background-color:var(--color-disabled01);cursor:default}label.sc-z-toggle-switch>span.container.checked.disabled.sc-z-toggle-switch>span.circle.sc-z-toggle-switch>z-icon.sc-z-toggle-switch{fill:var(--color-disabled01)}label.sc-z-toggle-switch>span.container.checked.sc-z-toggle-switch{background-color:var(--color-primary01);fill:var(--color-primary01)}input.sc-z-toggle-switch:focus:focus-visible+label.sc-z-toggle-switch>span.container.sc-z-toggle-switch:not(.disabled){box-shadow:var(--shadow-focus-primary);outline:none}input.sc-z-toggle-switch:focus:focus-visible+label.sc-z-toggle-switch>span.container.disabled.sc-z-toggle-switch{outline:none}label.sc-z-toggle-switch>span.container.sc-z-toggle-switch:not(.disabled):hover{background-color:var(--color-hover-primary);fill:var(--color-hover-primary)}label.sc-z-toggle-switch>span.container.sc-z-toggle-switch>span.circle.sc-z-toggle-switch{position:absolute;top:1px;left:1px;display:flex;width:calc(var(--space-unit) * 2);height:calc(var(--space-unit) * 2);align-items:center;justify-content:center;margin:0;background-color:var(--color-white);border-radius:7px;box-shadow:var(--shadow-1);transition:transform 0.3s ease}label.sc-z-toggle-switch>span.container.checked.sc-z-toggle-switch>span.circle.sc-z-toggle-switch{transform:translateX(calc(100% - 2px))}input[type="checkbox"].sc-z-toggle-switch{position:absolute;z-index:-1;opacity:0;pointer-events:none}';export{o as z_toggle_switch}
@@ -0,0 +1 @@
1
+ import{r as i,h as r,H as d}from"./p-d17ebc2f.js";import{D as e,f as s}from"./p-a23e9115.js";const v=class{constructor(r){i(this,r),this.size=e.SMALL,this.color="gray200",this.orientation=s.HORIZONTAL}render(){return r(d,{class:`divider-${this.size} divider-${this.orientation}`,style:{backgroundColor:`var(--${this.color})`}})}};v.style=".sc-z-divider-h{display:block;padding:0;margin:0}.divider-horizontal.sc-z-divider-h{width:100%}.divider-vertical.sc-z-divider-h{height:100%}.divider-small.divider-horizontal.sc-z-divider-h{height:var(--border-size-small)}.divider-medium.divider-horizontal.sc-z-divider-h{height:var(--border-size-medium)}.divider-large.divider-horizontal.sc-z-divider-h{height:var(--border-size-large)}.divider-small.divider-vertical.sc-z-divider-h{width:var(--border-size-small)}.divider-medium.divider-vertical.sc-z-divider-h{width:var(--border-size-medium)}.divider-large.divider-vertical.sc-z-divider-h{width:var(--border-size-large)}";export{v as z_divider}
@@ -1 +1 @@
1
- import{r as t,c as s,h as i,H as a,g as o}from"./p-d17ebc2f.js";import{h as e,S as r,B as n,c as l,P as c}from"./p-a23e9115.js";import{g as p}from"./p-00481c22.js";import"./p-d69e14fb.js";const h=class{constructor(i){t(this,i),this.sort=s(this,"sort",7),this.padding=e.MEDIUM,this.defaultSortDirection=r.ASC,this.sortDirection=r.NONE,this.emitOnSort=this.emitOnSort.bind(this)}emitOnSort(){this.sort.emit({columnId:this.columnId,sortDirection:this.sortDirection})}handleSort(){this.sortable&&(this.sortDirection=(()=>{switch(this.sortDirection){case r.ASC:return r.DESC;case r.DESC:return r.ASC;case r.NONE:return this.defaultSortDirection;default:return r.NONE}})(),this.emitOnSort())}handleMenuClick(){this.popover.open=!this.popover.open}handleOutsideClick(t){!p(t.target).find((t=>"z-popover"===t.nodeName.toLowerCase()))&&this.popover&&(this.popover.open=!1)}handleClickHeaders(t){const s=t.target,i=p(s).find((t=>"z-table-header"===t.nodeName.toLowerCase()));this.sortable&&i&&i.attributes.getNamedItem("column-id").value!==this.columnId&&(s.parentNode.sortable||s.sortable)&&(this.sortDirection=r.NONE)}componentWillRender(){this.host.setAttribute("role","columnheader")}render(){return i(a,{class:{sortable:this.sortable},onClick:()=>this.handleSort()},i("div",{class:"container"},i("slot",null),this.sortable&&this.sortDirection!==r.NONE&&i("z-icon",{name:this.sortDirection===r.ASC?"arrow-up":"arrow-down",class:"arrow"})),this.showButton&&i("div",{class:"popover-container"},i("z-button",{ref:t=>this.triggerButton=t,class:"contextual-popover-button",icon:"contextual-menu",variant:n.TERTIARY,size:l.X_SMALL,onClick:()=>this.handleMenuClick()}),i("z-popover",{ref:t=>this.popover=t,position:c.BOTTOM,center:!0,bindTo:this.triggerButton},i("div",null,i("slot",{name:"contextual-menu"})))))}get host(){return o(this)}};h.style=':host{position:relative;display:table-cell;border-bottom:var(--border-size-medium) solid var(--gray200);background-color:var(--gray50);font-family:var(--dashboard-font);font-weight:var(--font-sb);text-align:start}.container{display:flex;align-items:flex-end}:host(.sortable){cursor:pointer}:host([padding="x-small"]){padding:calc(var(--space-unit) * 0.5)}:host([padding="small"]){padding:calc(var(--space-unit))}:host([padding="medium"]){padding:calc(var(--space-unit) * 2)}:host([padding="large"]){padding:calc(var(--space-unit) * 2.5)}:host([padding="special"]){padding:0}.arrow{padding-left:var(--space-unit);opacity:1}.popover-container{position:absolute;top:var(--space-unit);right:var(--space-unit);display:none}.popover-container z-popover{--z-popover-theme--surface:var(--gray200);position:relative;z-index:1}.popover-container.visible{display:block}:host(:hover) .popover-container{display:block}';export{h as z_table_header}
1
+ import{r as t,c as s,h as i,H as a,g as e}from"./p-d17ebc2f.js";import{h as o,S as r,B as n,c as l,P as c}from"./p-a23e9115.js";import{a as p}from"./p-8ebe4adf.js";import"./p-d69e14fb.js";const d=class{constructor(i){t(this,i),this.sort=s(this,"sort",7),this.padding=o.MEDIUM,this.defaultSortDirection=r.ASC,this.sortDirection=r.NONE,this.emitOnSort=this.emitOnSort.bind(this)}emitOnSort(){this.sort.emit({columnId:this.columnId,sortDirection:this.sortDirection})}handleSort(){this.sortable&&(this.sortDirection=(()=>{switch(this.sortDirection){case r.ASC:return r.DESC;case r.DESC:return r.ASC;case r.NONE:return this.defaultSortDirection;default:return r.NONE}})(),this.emitOnSort())}handleMenuClick(){this.popover.open=!this.popover.open}handleOutsideClick(t){!p(t.target).find((t=>"z-popover"===t.nodeName.toLowerCase()))&&this.popover&&(this.popover.open=!1)}handleClickHeaders(t){const s=t.target,i=p(s).find((t=>"z-table-header"===t.nodeName.toLowerCase()));this.sortable&&i&&i.attributes.getNamedItem("column-id").value!==this.columnId&&(s.parentNode.sortable||s.sortable)&&(this.sortDirection=r.NONE)}componentWillRender(){this.host.setAttribute("role","columnheader")}render(){return i(a,{class:{sortable:this.sortable},onClick:()=>this.handleSort()},i("div",{class:"container"},i("slot",null),this.sortable&&this.sortDirection!==r.NONE&&i("z-icon",{name:this.sortDirection===r.ASC?"arrow-up":"arrow-down",class:"arrow"})),this.showButton&&i("div",{class:"popover-container"},i("z-button",{ref:t=>this.triggerButton=t,class:"contextual-popover-button",icon:"contextual-menu",variant:n.TERTIARY,size:l.X_SMALL,onClick:()=>this.handleMenuClick()}),i("z-popover",{ref:t=>this.popover=t,position:c.BOTTOM,center:!0,bindTo:this.triggerButton},i("div",null,i("slot",{name:"contextual-menu"})))))}get host(){return e(this)}};d.style=':host{position:relative;display:table-cell;border-bottom:var(--border-size-medium) solid var(--gray200);background-color:var(--gray50);font-family:var(--dashboard-font);font-weight:var(--font-sb);text-align:start}.container{display:flex;align-items:flex-end}:host(.sortable){cursor:pointer}:host([padding="x-small"]){padding:calc(var(--space-unit) * 0.5)}:host([padding="small"]){padding:calc(var(--space-unit))}:host([padding="medium"]){padding:calc(var(--space-unit) * 2)}:host([padding="large"]){padding:calc(var(--space-unit) * 2.5)}:host([padding="special"]){padding:0}.arrow{padding-left:var(--space-unit);opacity:1}.popover-container{position:absolute;top:var(--space-unit);right:var(--space-unit);display:none}.popover-container z-popover{--z-popover-theme--surface:var(--gray200);position:relative;z-index:1}.popover-container.visible{display:block}:host(:hover) .popover-container{display:block}';export{d as z_table_header}
@@ -1 +1 @@
1
- import{r as t,c as i,h as s,H as e}from"./p-d17ebc2f.js";import{k as r,B as a}from"./p-a23e9115.js";import{r as l,h as o}from"./p-00481c22.js";import"./p-d69e14fb.js";const n=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-${l()}`,this.preventSubmit=!1,this.autocomplete=!1,this.autocompleteMinChars=3,this.resultsEllipsis=!0,this.searchHelperLabel="Cerca {searchString}",this.sortResultsItems=!1,this.searchString="",this.currResultsCount=0,this.showResults=!1,this.resultsItemsList=null}emitSearchSubmit(){this.searchSubmit.emit(this.searchString)}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",{message:!1,placeholder:this.placeholder,onStopTyping:t=>this.handleStopTyping(t),onKeyUp:t=>o(t,(()=>this.handleSubmit())),value:this.value})}renderButton(){return this.preventSubmit?null:s("z-button",{variant:a.PRIMARY,onClick:()=>this.handleSubmit()},"CERCA")}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 a=0;return Object.values(i).forEach(((t,i,l)=>{if(this.checkResultsCount(a)){const o=[];t.items.forEach(((t,s,e)=>{this.checkResultsCount(a)&&o.push(this.renderItem(t,s,!(i===l.length-1&&s===e.length-1))),a++})),o.length&&e.push(s("z-list-group",{"divider-type":r.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?r.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?r.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.preventSubmit,"has-results":this.autocomplete}},this.renderInput(),this.renderResults(),this.renderButton()))}static get watchers(){return{resultsItems:["watchItems"],resultsCount:["watchResultsCount"],value:["watchValue"],searchString:["watchSearchString"]}}};n.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)}}";export{n as z_searchbar}
1
+ import{r as t,c as i,h as s,H as e}from"./p-d17ebc2f.js";import{k as r,B as a}from"./p-a23e9115.js";import{r as l,h as o}from"./p-8ebe4adf.js";import"./p-d69e14fb.js";const n=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-${l()}`,this.preventSubmit=!1,this.autocomplete=!1,this.autocompleteMinChars=3,this.resultsEllipsis=!0,this.searchHelperLabel="Cerca {searchString}",this.sortResultsItems=!1,this.searchString="",this.currResultsCount=0,this.showResults=!1,this.resultsItemsList=null}emitSearchSubmit(){this.searchSubmit.emit(this.searchString)}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",{message:!1,placeholder:this.placeholder,onStopTyping:t=>this.handleStopTyping(t),onKeyUp:t=>o(t,(()=>this.handleSubmit())),value:this.value})}renderButton(){return this.preventSubmit?null:s("z-button",{variant:a.PRIMARY,onClick:()=>this.handleSubmit()},"CERCA")}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 a=0;return Object.values(i).forEach(((t,i,l)=>{if(this.checkResultsCount(a)){const o=[];t.items.forEach(((t,s,e)=>{this.checkResultsCount(a)&&o.push(this.renderItem(t,s,!(i===l.length-1&&s===e.length-1))),a++})),o.length&&e.push(s("z-list-group",{"divider-type":r.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?r.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?r.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.preventSubmit,"has-results":this.autocomplete}},this.renderInput(),this.renderResults(),this.renderButton()))}static get watchers(){return{resultsItems:["watchItems"],resultsCount:["watchResultsCount"],value:["watchValue"],searchString:["watchSearchString"]}}};n.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)}}";export{n as z_searchbar}
@@ -1 +1 @@
1
- import{r as t,c as i,h as s}from"./p-d17ebc2f.js";import{h as e}from"./p-00481c22.js";import"./p-a23e9115.js";import"./p-d69e14fb.js";const a=class{constructor(s){t(this,s),this.zListItemLinkClick=i(this,"zListItemLinkClick",7),this.zListItemClick=i(this,"zListItemClick",7),this.linktarget="_self",this.underlined=!0,this.emitZListItemLinkClick=this.emitZListItemLinkClick.bind(this),this.emitZListItemClick=this.emitZListItemClick.bind(this)}emitZListItemLinkClick(t,i){this.zListItemLinkClick.emit({e:t,linkId:i})}emitZListItemClick(t,i){this.zListItemClick.emit({e:t,listitemid:i})}render(){const t=this.listitemid?`link_${this.listitemid}`:"";return s("li",{role:"button",id:this.listitemid,"data-action":this.action,onClick:t=>this.emitZListItemClick(t,this.listitemid),onKeyPress:t=>e(t,this.emitZListItemClick,this.listitemid)},s("span",{class:this.underlined&&"border"},this.icon&&s("z-icon",{name:this.icon}),this.link?s("a",{href:this.link?this.link:null,target:this.linktarget,id:t,onClick:i=>this.emitZListItemLinkClick(i,t),onKeyPress:i=>e(i,this.emitZListItemLinkClick,t),role:this.link?"link":"button",tabindex:"0"},this.text):s("span",{innerHTML:this.text}),s("slot",null)))}};a.style=":host li{all:unset;all:reset;width:100%;line-height:14px;list-style-type:none}:host li>span{display:flex;padding:calc(var(--space-unit) * 2) 0;color:var(--text-grey-800);fill:var(--text-grey-800);font-family:var(--dashboard-font);font-size:16px;font-weight:var(--font-rg);letter-spacing:0.23px;line-height:14px}:host li>span.border{border-bottom:2px solid var(--bg-grey-200)}:host li span:hover,a:hover{color:var(--myz-blue);fill:var(--myz-blue)}a,a:visited,a:active{color:inherit;fill:inherit;text-decoration:none}:host li span z-icon{width:calc(var(--space-unit) * 2);height:calc(var(--space-unit) * 2);padding:0 calc(var(--space-unit) * 1.5) 0 0;background-repeat:no-repeat;background-size:contain;color:var(--myz-blue);fill:var(--myz-blue)}";export{a as z_myz_list_item}
1
+ import{r as t,c as i,h as s}from"./p-d17ebc2f.js";import{h as e}from"./p-8ebe4adf.js";import"./p-a23e9115.js";import"./p-d69e14fb.js";const a=class{constructor(s){t(this,s),this.zListItemLinkClick=i(this,"zListItemLinkClick",7),this.zListItemClick=i(this,"zListItemClick",7),this.linktarget="_self",this.underlined=!0,this.emitZListItemLinkClick=this.emitZListItemLinkClick.bind(this),this.emitZListItemClick=this.emitZListItemClick.bind(this)}emitZListItemLinkClick(t,i){this.zListItemLinkClick.emit({e:t,linkId:i})}emitZListItemClick(t,i){this.zListItemClick.emit({e:t,listitemid:i})}render(){const t=this.listitemid?`link_${this.listitemid}`:"";return s("li",{role:"button",id:this.listitemid,"data-action":this.action,onClick:t=>this.emitZListItemClick(t,this.listitemid),onKeyPress:t=>e(t,this.emitZListItemClick,this.listitemid)},s("span",{class:this.underlined&&"border"},this.icon&&s("z-icon",{name:this.icon}),this.link?s("a",{href:this.link?this.link:null,target:this.linktarget,id:t,onClick:i=>this.emitZListItemLinkClick(i,t),onKeyPress:i=>e(i,this.emitZListItemLinkClick,t),role:this.link?"link":"button",tabindex:"0"},this.text):s("span",{innerHTML:this.text}),s("slot",null)))}};a.style=":host li{all:unset;all:reset;width:100%;line-height:14px;list-style-type:none}:host li>span{display:flex;padding:calc(var(--space-unit) * 2) 0;color:var(--text-grey-800);fill:var(--text-grey-800);font-family:var(--dashboard-font);font-size:16px;font-weight:var(--font-rg);letter-spacing:0.23px;line-height:14px}:host li>span.border{border-bottom:2px solid var(--bg-grey-200)}:host li span:hover,a:hover{color:var(--myz-blue);fill:var(--myz-blue)}a,a:visited,a:active{color:inherit;fill:inherit;text-decoration:none}:host li span z-icon{width:calc(var(--space-unit) * 2);height:calc(var(--space-unit) * 2);padding:0 calc(var(--space-unit) * 1.5) 0 0;background-repeat:no-repeat;background-size:contain;color:var(--myz-blue);fill:var(--myz-blue)}";export{a as z_myz_list_item}
@@ -0,0 +1 @@
1
+ import{r as t,c as i,h as e,g as r,H as s}from"./p-d17ebc2f.js";import{j as n,I as a}from"./p-a23e9115.js";import{r as o,b as c}from"./p-8ebe4adf.js";import"./p-d69e14fb.js";const p=class{constructor(e){t(this,e),this.inputChange=i(this,"inputChange",7),this.startTyping=i(this,"startTyping",7),this.stopTyping=i(this,"stopTyping",7),this.inputCheck=i(this,"inputCheck",7),this.htmlid=`id-${o()}`,this.ariaLabel="",this.disabled=!1,this.readonly=!1,this.required=!1,this.checked=!1,this.message=!0,this.labelPosition=n.RIGHT,this.hasclearicon=!0,this.isTyping=!1,this.passwordHidden=!0,this.typingtimeout=300}inputCheckListener(t){const i=t.detail;switch(this.type){case a.RADIO:i.type===a.RADIO&&i.name===this.name&&i.id!==this.htmlid&&(this.checked=!1)}}async isChecked(){switch(this.type){case a.CHECKBOX:case a.RADIO:return this.checked;default:return console.warn("`isChecked` method is only available for type `checkbox` and `radio`"),!1}}emitInputChange(t){let i;this.isTyping||this.emitStartTyping(),i=this.getValidity(this.type===a.TEXTAREA?"textarea":"input"),this.value=t,this.inputChange.emit({value:t,validity:i}),clearTimeout(this.timer),this.timer=setTimeout((()=>{this.emitStopTyping(this.value,i)}),this.typingtimeout)}emitStartTyping(){this.isTyping=!0,this.startTyping.emit()}emitStopTyping(t,i){this.isTyping=!1,this.stopTyping.emit({value:t,validity:i})}emitInputCheck(t){this.inputCheck.emit({id:this.htmlid,checked:t,type:this.type,name:this.name,value:this.value,validity:this.getValidity("input")})}getValidity(t){return this.hostElement.querySelector(t).validity}getTextAttributes(){return{id:this.htmlid,name:this.name,placeholder:this.placeholder,value:this.value,disabled:this.disabled,readonly:this.readonly,required:this.required,title:this.htmltitle,class:{[`input-${this.status}`]:!!this.status,filled:!!this.value},autocomplete:this.autocomplete,onInput:t=>this.emitInputChange(t.target.value)}}getNumberAttributes(t){if(t==a.NUMBER)return{min:this.min,max:this.max,step:this.step}}getPatternAttribute(t){if(t==a.PASSWORD||t==a.TEXT||t==a.TEL||t==a.SEARCH||t==a.URL||t==a.EMAIL)return{pattern:this.pattern}}renderInputText(t=a.TEXT){const i=this.ariaLabel?{"aria-label":this.ariaLabel}:{},r=Object.assign(Object.assign(Object.assign(Object.assign({},this.getTextAttributes()),this.getNumberAttributes(t)),this.getPatternAttribute(t)),i);return(this.icon||t===a.PASSWORD)&&Object.assign(r.class,{"has-icon":!0}),this.hasclearicon&&t!=a.NUMBER&&Object.assign(r.class,{"has-clear-icon":!0}),e("div",{class:"text-wrapper"},this.renderLabel(),e("div",null,e("input",Object.assign({type:t!==a.PASSWORD||this.passwordHidden?t:a.TEXT},r)),this.renderIcons()),this.renderMessage())}renderLabel(){if(this.label)return e("label",{class:"input-label body-5-sb",id:`${this.htmlid}_label`,htmlFor:this.htmlid},this.label)}renderIcons(){return e("span",{class:"icons-wrapper"},this.renderResetIcon(),this.renderIcon())}renderIcon(){return this.type===a.PASSWORD?this.renderShowHidePassword():this.icon?e("button",{type:"button",class:"icon-button input-icon",tabIndex:-1},e("z-icon",{name:this.icon})):void 0}renderResetIcon(){if(this.hasclearicon&&this.value&&!this.disabled&&!this.readonly&&this.type!=a.NUMBER)return e("button",{type:"button",class:"icon-button reset-icon","aria-label":"cancella il contenuto dell'input",onClick:()=>this.emitInputChange("")},e("z-icon",{name:"multiply"}))}renderShowHidePassword(){return e("button",{type:"button",class:"icon-button toggle-password-icon",disabled:this.disabled,"aria-label":this.passwordHidden?"mostra password":"nascondi password",onClick:()=>this.passwordHidden=!this.passwordHidden},e("z-icon",{name:this.passwordHidden?"view-filled":"view-off-filled"}))}renderMessage(){if(!1!==c(this.message))return e("z-input-message",{message:!0===c(this.message)?void 0:this.message,status:this.status})}renderTextarea(){const t=this.getTextAttributes(),i=this.ariaLabel?{"aria-label":this.ariaLabel}:{};return e("div",{class:"text-wrapper"},this.renderLabel(),e("div",{class:Object.assign(Object.assign({},t.class),{"textarea-wrapper":!0,readonly:t.readonly})},e("textarea",Object.assign({},t,i))),this.renderMessage())}handleCheck(t){this.checked=t.target.checked,this.emitInputCheck(this.checked)}renderCheckbox(){return e("div",{class:"checkbox-wrapper"},e("input",{id:this.htmlid,type:"checkbox",name:this.name,checked:this.checked,disabled:this.disabled,readonly:this.readonly,required:this.required,onChange:this.handleCheck.bind(this),value:this.value}),e("label",{htmlFor:this.htmlid,class:{"checkbox-label":!0,after:this.labelPosition===n.RIGHT,before:this.labelPosition===n.LEFT}},e("z-icon",{name:this.checked?"checkbox-checked":"checkbox","aria-hidden":"true"}),this.label&&e("span",{innerHTML:this.label})))}renderRadio(){return e("div",{class:"radio-wrapper"},e("input",{id:this.htmlid,type:"radio",name:this.name,checked:this.checked,disabled:this.disabled,readonly:this.readonly,onChange:this.handleCheck.bind(this),value:this.value}),e("label",{htmlFor:this.htmlid,class:{"radio-label":!0,after:this.labelPosition===n.RIGHT,before:this.labelPosition===n.LEFT}},e("z-icon",{name:this.checked?"radio-button-checked":"radio-button","aria-hidden":"true"}),this.label&&e("span",{innerHTML:this.label})))}render(){switch(this.type){case a.TEXTAREA:return this.renderTextarea();case a.CHECKBOX:return this.renderCheckbox();case a.RADIO:return this.renderRadio();default:return this.renderInputText(this.type)}}get hostElement(){return r(this)}};p.style='.sc-z-input-h{display:inline-block;width:inherit}input.sc-z-input::-ms-clear,input.sc-z-input::-ms-reveal{display:none}.sc-z-input-h input.sc-z-input::-ms-clear,.sc-z-input-h input.sc-z-input::-ms-reveal{display:none}input.sc-z-input,textarea.sc-z-input,.textarea-wrapper.sc-z-input{box-sizing:border-box;border:var(--border-size-small) solid var(--color-surface04);background:var(--color-input-field01);border-radius:var(--border-radius-small);color:var(--color-text01);fill:var(--color-icon02);font-family:var(--font-family-sans);font-size:var(--font-size-3);font-weight:var(--font-rg);outline:none}.cursor-select.sc-z-input-h input.sc-z-input{cursor:pointer}.sc-z-input-h:not(.active-select) input.sc-z-input:focus:focus-visible,.textarea-wrapper.sc-z-input:focus-within{box-shadow:var(--shadow-focus-primary)}input.sc-z-input:focus:focus-visible,textarea.sc-z-input:focus:focus-visible{color:var(--color-primary02)}.active-select.sc-z-input-h input.sc-z-input{border:var(--border-size-small) solid var(--blue500)}.cursor-select.sc-z-input-h input.sc-z-input:focus:focus-visible{box-shadow:var(--shadow-focus-primary)}.sc-z-input-h input[readonly].sc-z-input:focus:focus-visible{box-shadow:none;pointer-events:none}.filled.sc-z-input{border-color:var(--color-surface05)}.input-success.sc-z-input{border-color:var(--color-success01);background:var(--color-success-inverse);fill:var(--color-success01)}.input-error.sc-z-input{border-color:var(--color-error01);background:var(--color-error-inverse);fill:var(--color-error01)}.input-warning.sc-z-input{border-color:var(--color-warning01);background:var(--color-warning-inverse);fill:var(--color-warning01)}input.sc-z-input:hover,.textarea-wrapper.sc-z-input:hover{outline:var(--border-size-medium) solid var(--color-surface04);outline-offset:-2px}.sc-z-input-h:not(.active-select) input[readonly].sc-z-input,.readonly.sc-z-input{border-color:var(--color-disabled01);fill:var(--color-disabled01);pointer-events:none}[disabled].sc-z-input-h:not([disabled="false"]) input.sc-z-input,[disabled].sc-z-input-h:not([disabled="false"]) .textarea-wrapper.sc-z-input,[disabled].sc-z-input-h:not([disabled="false"]) z-icon.sc-z-input{border-color:var(--color-disabled01);box-shadow:none;color:var(--color-disabled02);fill:var(--color-disabled01);pointer-events:none}[disabled].sc-z-input-h:not([disabled="false"]) input.sc-z-input:hover{border-width:var(--border-size-small)}input.sc-z-input::placeholder,textarea.sc-z-input::placeholder{color:var(--color-text05)}.sc-z-input::-webkit-textarea-placeholder{color:var(--color-text05)}.sc-z-input:-ms-textarea-placeholder{color:var(--color-text05)}.sc-z-input::placeholder{color:var(--color-text05)}label.input-label.sc-z-input{display:block;padding-bottom:var(--space-unit);color:var(--color-text02);font-family:var(--font-family-sans);font-size:var(--font-size-1);font-weight:var(--font-sb);text-align:left;text-transform:uppercase}[disabled].sc-z-input-h:not([disabled="false"]) label.input-label.sc-z-input{color:var(--color-disabled02)}.text-wrapper.sc-z-input>div.sc-z-input{position:relative;z-index:1;fill:var(--color-icon02)}.text-wrapper.sc-z-input>div.sc-z-input>input.sc-z-input{width:100%;height:calc(var(--space-unit) * 5.5);box-sizing:border-box;padding:0 calc(var(--space-unit) * 1.5);margin:0}.text-wrapper.sc-z-input>div.sc-z-input>input.has-icon.sc-z-input,.text-wrapper.sc-z-input>div.sc-z-input>input.has-clear-icon.sc-z-input{padding-right:calc(var(--space-unit) * 5.25)}.text-wrapper.sc-z-input>div.sc-z-input>input.has-icon.has-clear-icon.sc-z-input{padding-right:calc(var(--space-unit) * 8)}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input{position:absolute;z-index:2;top:50%;right:calc(var(--space-unit) * 1.5);display:flex;pointer-events:none;transform:translateY(-50%)}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.icon-button.sc-z-input{padding:0;border:0;background:none;color:inherit;font:inherit;pointer-events:initial}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.icon-button.sc-z-input+button.icon-button.sc-z-input{margin-left:calc(var(--space-unit) * 0.5)}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.icon-button.reset-icon.sc-z-input,.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.icon-button.toggle-password-icon.sc-z-input{cursor:pointer}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.icon-button.sc-z-input>z-icon.sc-z-input{--z-icon-width:18px;--z-icon-height:18px;display:block}.text-wrapper.sc-z-input>div.sc-z-input>input.sc-z-input:-webkit-autofill,.text-wrapper.sc-z-input>div.sc-z-input>input.sc-z-input:-webkit-autofill:hover,.text-wrapper.sc-z-input>div.sc-z-input>input.sc-z-input:-webkit-autofill:focus,.text-wrapper.sc-z-input>div.sc-z-input>input.sc-z-input:-webkit-autofill:active{background:var(--color-white) !important;background-clip:text !important;-webkit-transition-delay:99999s !important}.textarea-wrapper.sc-z-input{padding:calc(var(--space-unit) * 1.5);scrollbar-color:var(--color-primary01) transparent}textarea.sc-z-input::-webkit-scrollbar{width:10px;background:linear-gradient(to right, transparent 0 3px, var(--gray200) 3px 7px, transparent 7px 10px);border-radius:var(--border-radius)}textarea.sc-z-input::-webkit-scrollbar-track{background-color:transparent}textarea.sc-z-input::-webkit-scrollbar-thumb{width:10px;background-color:var(--color-primary01);border-radius:var(--border-radius)}textarea.sc-z-input::-webkit-scrollbar-thumb:hover{background-color:var(--color-hover-primary)}textarea.sc-z-input{width:100%;min-height:132px;padding:0;border:none;margin:0;resize:none}.radio-wrapper.sc-z-input,.checkbox-wrapper.sc-z-input{position:relative;display:inline-flex;flex-direction:row;align-items:center;color:var(--color-text01);fill:var(--color-primary01);font-family:var(--font-family-sans)}.radio-wrapper.sc-z-input:hover,.checkbox-wrapper.sc-z-input:hover{color:var(--color-hover-primary);fill:currentcolor}.radio-wrapper.sc-z-input>input.sc-z-input,.checkbox-wrapper.sc-z-input>input.sc-z-input{position:absolute;z-index:-1;opacity:0;pointer-events:none}.radio-wrapper.sc-z-input .radio-label.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.sc-z-input{display:inline-flex;align-items:center;margin:0;color:inherit;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:1;text-transform:inherit}.radio-wrapper.sc-z-input input.sc-z-input:not(:disabled)+.radio-label.sc-z-input,.checkbox-wrapper.sc-z-input input.sc-z-input:not(:disabled)+.checkbox-label.sc-z-input{cursor:pointer}.radio-wrapper.sc-z-input .radio-label.sc-z-input z-icon.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.sc-z-input z-icon.sc-z-input{cursor:pointer;fill:inherit}.radio-wrapper.sc-z-input .radio-label.after.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.after.sc-z-input{flex-direction:row}.radio-wrapper.sc-z-input .radio-label.before.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.before.sc-z-input{flex-direction:row-reverse}.radio-wrapper.sc-z-input .radio-label.after.sc-z-input>span.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.after.sc-z-input>span.sc-z-input{margin-left:var(--space-unit)}.radio-wrapper.sc-z-input .radio-label.before.sc-z-input>span.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.before.sc-z-input>span.sc-z-input{margin-right:var(--space-unit)}.radio-wrapper.sc-z-input>input.sc-z-input:focus:focus-visible+.radio-label.sc-z-input>z-icon.sc-z-input,.checkbox-wrapper.sc-z-input>input.sc-z-input:focus:focus-visible+.checkbox-label.sc-z-input>z-icon.sc-z-input{border-radius:var(--border-radius-small);box-shadow:var(--shadow-focus-primary)}.radio-wrapper.sc-z-input>input.sc-z-input:disabled+.radio-label.sc-z-input,.checkbox-wrapper.sc-z-input>input.sc-z-input:disabled+.checkbox-label.sc-z-input{color:var(--color-disabled02)}.radio-wrapper.sc-z-input>input.sc-z-input:disabled+.radio-label.sc-z-input>z-icon.sc-z-input,.checkbox-wrapper.sc-z-input>input.sc-z-input:disabled+.checkbox-label.sc-z-input>z-icon.sc-z-input{cursor:default;fill:var(--color-disabled01)}';const l=class{constructor(i){t(this,i),this.statusIcons={success:"checkmark-circle",error:"multiply-circled",warning:"exclamation-circle"},this.statusRole={}}onMessageChange(){this.statusRole=this.message&&this.status?{role:"alert"}:{}}componentWillLoad(){this.onMessageChange()}render(){return e(s,Object.assign({},this.statusRole,{"aria-label":this.message}),this.statusIcons[this.status]&&this.message&&e("z-icon",{name:this.statusIcons[this.status]}),e("span",{innerHTML:this.message}))}static get watchers(){return{message:["onMessageChange"],status:["onMessageChange"]}}};l.style=':host{display:flex;min-height:calc(var(--space-unit) * 2.5);align-items:start;margin-top:var(--space-unit);color:var(--color-text05);fill:currentcolor;font-family:var(--font-family-sans);font-size:var(--font-size-2);letter-spacing:0.16px}:host([status="success"]){color:var(--color-text-success)}:host([status="error"]){color:var(--color-text-error)}:host([status="warning"]){color:var(--color-warning02)}:host(:focus){outline:none}:host>z-icon{--z-icon-width:calc(var(--space-unit) * 2);--z-icon-height:calc(var(--space-unit) * 2);--z-icon-right-margin:var(--space-unit)}';export{p as z_input,l as z_input_message}
@@ -1 +1 @@
1
- import{r as t,c as i,h as e,g as s}from"./p-d17ebc2f.js";import{p as o}from"./p-a23e9115.js";import{h as a}from"./p-00481c22.js";import{h as r}from"./p-e43e61ac.js";import"./p-d69e14fb.js";import"./p-112455b1.js";const n=class{constructor(e){t(this,e),this.pocketToggle=i(this,"pocketToggle",7),this.status=o.PREVIEW}async open(){this.status=o.OPEN}async close(){this.status=o.CLOSED}emitPocketToggle(t,i){this.pocketToggle.emit({id:t,status:i})}handlePocketHeaderClick(t){if(t.detail.id&&t.detail.id===this.pocketid)switch(this.status){case o.PREVIEW:case o.CLOSED:this.status=o.OPEN;break;case o.OPEN:this.status=o.CLOSED}}handlePocketHeaderPan(t){t.detail.id&&t.detail.id===this.pocketid&&("up"===t.detail.direction?this.status=o.OPEN:"down"===t.detail.direction&&(this.status=o.CLOSED))}watchStatusHandler(t){this.emitPocketToggle(this.pocketid,t)}componentWillLoad(){this.emitPocketToggle(this.pocketid,this.status)}handleBackgroundClick(t){"pocketBackground"==t.target.dataset.action&&this.close()}render(){return e("div",null,e("div",{"data-action":"pocketBackground","data-pocket":this.pocketid,class:`background ${this.status}`,onClick:t=>this.handleBackgroundClick(t)}),e("div",{id:this.pocketid,class:"content-wrapper"},e("div",null,e("slot",null))))}get hostElement(){return s(this)}static get watchers(){return{status:["watchStatusHandler"]}}};n.style=":host{width:inherit;height:100%;margin:inherit;font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>div{width:inherit;height:100%;margin:inherit}:host>div>div.background{position:fixed;z-index:998;top:0;right:0;bottom:0;left:0;width:0;height:0}:host>div>div.background.open{width:100%;height:100%}:host>div>div.content-wrapper{position:fixed;z-index:999;bottom:0;left:0;width:inherit;margin:inherit}:host>div>div.content-wrapper>div{margin:calc(var(--space-unit) * 0.5) calc(var(--space-unit) * 0.5) 0 calc(var(--space-unit) * 0.5);border-radius:var(--space-unit) var(--space-unit) 0 0;box-shadow:0 -2px calc(var(--space-unit) * 0.5) 0 rgb(66 69 72 / 40%)}";const h=class{constructor(i){t(this,i),this.status=o.PREVIEW}handlePocketToggle(t){t.detail.id&&t.detail.id===this.pocketid&&(this.status=t.detail.status)}render(){return e("main",{class:this.status},e("slot",null))}};h.style=":host{display:block;width:100%;box-sizing:border-box;font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>main{overflow:auto;border-right:var(--border-size-small) solid var(--color-surface03);border-left:var(--border-size-small) solid var(--color-surface03);background:var(--color-surface01);scrollbar-width:none}:host>main.preview{max-height:225px;transition:all 200ms ease-in-out, top 200ms ease-in-out}:host>main.open{max-height:calc(100vh - 48px);transition:all 200ms ease-in-out, top 200ms ease-in-out}:host>main.closed{height:0;transition:all 200ms ease-in-out, top 200ms ease-in-out}:host ::-webkit-scrollbar{width:0}@media only screen and (min-width: 768px){:host>main.preview{max-height:157px}}";const c=class{constructor(e){t(this,e),this.pocketHeaderClick=i(this,"pocketHeaderClick",7),this.pocketHeaderPan=i(this,"pocketHeaderPan",7),this.emitPocketHeaderClick=this.emitPocketHeaderClick.bind(this)}emitPocketHeaderClick(){this.pocketHeaderClick.emit({id:this.pocketid})}emitPocketHeaderPan(t){this.pocketHeaderPan.emit({id:this.pocketid,direction:t})}componentDidLoad(){const t=new r(this.swipeWrap);t.get("pan").set({direction:r.DIRECTION_VERTICAL}),t.on("panup",(()=>this.emitPocketHeaderPan("up"))),t.on("pandown",(()=>this.emitPocketHeaderPan("down")))}render(){return e("header",{role:"button",tabindex:0,onClick:()=>this.emitPocketHeaderClick(),onKeyPress:t=>a(t,this.emitPocketHeaderClick),ref:t=>this.swipeWrap=t},e("slot",null))}};c.style=":host{display:block;width:100%;box-sizing:border-box;font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>header{display:flex;height:36px;flex-flow:row nowrap;align-items:center;justify-content:center;border:var(--border-size-small) solid var(--color-surface03);background:var(--color-surface01);border-radius:var(--space-unit) var(--space-unit) 0 0;cursor:pointer}:host>header:focus{outline:none}:host>header::-moz-focus-inner{border:0}";export{n as z_pocket,h as z_pocket_body,c as z_pocket_header}
1
+ import{r as t,c as i,h as e,g as s}from"./p-d17ebc2f.js";import{p as o}from"./p-a23e9115.js";import{h as a}from"./p-8ebe4adf.js";import{h as r}from"./p-e43e61ac.js";import"./p-d69e14fb.js";import"./p-112455b1.js";const n=class{constructor(e){t(this,e),this.pocketToggle=i(this,"pocketToggle",7),this.status=o.PREVIEW}async open(){this.status=o.OPEN}async close(){this.status=o.CLOSED}emitPocketToggle(t,i){this.pocketToggle.emit({id:t,status:i})}handlePocketHeaderClick(t){if(t.detail.id&&t.detail.id===this.pocketid)switch(this.status){case o.PREVIEW:case o.CLOSED:this.status=o.OPEN;break;case o.OPEN:this.status=o.CLOSED}}handlePocketHeaderPan(t){t.detail.id&&t.detail.id===this.pocketid&&("up"===t.detail.direction?this.status=o.OPEN:"down"===t.detail.direction&&(this.status=o.CLOSED))}watchStatusHandler(t){this.emitPocketToggle(this.pocketid,t)}componentWillLoad(){this.emitPocketToggle(this.pocketid,this.status)}handleBackgroundClick(t){"pocketBackground"==t.target.dataset.action&&this.close()}render(){return e("div",null,e("div",{"data-action":"pocketBackground","data-pocket":this.pocketid,class:`background ${this.status}`,onClick:t=>this.handleBackgroundClick(t)}),e("div",{id:this.pocketid,class:"content-wrapper"},e("div",null,e("slot",null))))}get hostElement(){return s(this)}static get watchers(){return{status:["watchStatusHandler"]}}};n.style=":host{width:inherit;height:100%;margin:inherit;font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>div{width:inherit;height:100%;margin:inherit}:host>div>div.background{position:fixed;z-index:998;top:0;right:0;bottom:0;left:0;width:0;height:0}:host>div>div.background.open{width:100%;height:100%}:host>div>div.content-wrapper{position:fixed;z-index:999;bottom:0;left:0;width:inherit;margin:inherit}:host>div>div.content-wrapper>div{margin:calc(var(--space-unit) * 0.5) calc(var(--space-unit) * 0.5) 0 calc(var(--space-unit) * 0.5);border-radius:var(--space-unit) var(--space-unit) 0 0;box-shadow:0 -2px calc(var(--space-unit) * 0.5) 0 rgb(66 69 72 / 40%)}";const h=class{constructor(i){t(this,i),this.status=o.PREVIEW}handlePocketToggle(t){t.detail.id&&t.detail.id===this.pocketid&&(this.status=t.detail.status)}render(){return e("main",{class:this.status},e("slot",null))}};h.style=":host{display:block;width:100%;box-sizing:border-box;font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>main{overflow:auto;border-right:var(--border-size-small) solid var(--color-surface03);border-left:var(--border-size-small) solid var(--color-surface03);background:var(--color-surface01);scrollbar-width:none}:host>main.preview{max-height:225px;transition:all 200ms ease-in-out, top 200ms ease-in-out}:host>main.open{max-height:calc(100vh - 48px);transition:all 200ms ease-in-out, top 200ms ease-in-out}:host>main.closed{height:0;transition:all 200ms ease-in-out, top 200ms ease-in-out}:host ::-webkit-scrollbar{width:0}@media only screen and (min-width: 768px){:host>main.preview{max-height:157px}}";const c=class{constructor(e){t(this,e),this.pocketHeaderClick=i(this,"pocketHeaderClick",7),this.pocketHeaderPan=i(this,"pocketHeaderPan",7),this.emitPocketHeaderClick=this.emitPocketHeaderClick.bind(this)}emitPocketHeaderClick(){this.pocketHeaderClick.emit({id:this.pocketid})}emitPocketHeaderPan(t){this.pocketHeaderPan.emit({id:this.pocketid,direction:t})}componentDidLoad(){const t=new r(this.swipeWrap);t.get("pan").set({direction:r.DIRECTION_VERTICAL}),t.on("panup",(()=>this.emitPocketHeaderPan("up"))),t.on("pandown",(()=>this.emitPocketHeaderPan("down")))}render(){return e("header",{role:"button",tabindex:0,onClick:()=>this.emitPocketHeaderClick(),onKeyPress:t=>a(t,this.emitPocketHeaderClick),ref:t=>this.swipeWrap=t},e("slot",null))}};c.style=":host{display:block;width:100%;box-sizing:border-box;font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>header{display:flex;height:36px;flex-flow:row nowrap;align-items:center;justify-content:center;border:var(--border-size-small) solid var(--color-surface03);background:var(--color-surface01);border-radius:var(--space-unit) var(--space-unit) 0 0;cursor:pointer}:host>header:focus{outline:none}:host>header::-moz-focus-inner{border:0}";export{n as z_pocket,h as z_pocket_body,c as z_pocket_header}
@@ -1 +1 @@
1
- import{r as t,c as e,h as i,H as n,g as s}from"./p-d17ebc2f.js";import{v as r,o as a,D as l}from"./p-a23e9115.js";import{d as o}from"./p-00481c22.js";import"./p-d69e14fb.js";const c=class{constructor(i){t(this,i),this.fileInput=e(this,"fileInput",7),this.type=r.DEFAULT,this.files=[],this.inputAttributes={type:"file",id:"file-elem",multiple:!0}}removeFileListener(t){const e=this.files,i=e.find((e=>e.name===t.detail.fileName));if(i){const t=e.indexOf(i);t>=0&&(e.splice(t,1),this.files=[...e])}}fileDroppedListener(t){this.input.files=t.detail,this.fileInputHandler()}componentDidUpdate(){this.handleAccessibility(),this.invalidFiles.size&&this.errorModal.focus()}componentWillLoad(){this.invalidFiles=new Map}fileInputHandler(){this.input.files.length&&(this.invalidFiles=this.checkFiles(Array.from(this.input.files)))}async getFiles(){return this.files}getType(){return o()!==a.DESKTOP?r.DEFAULT:this.type}handleAccessibility(){const t=this.el.querySelector("z-file:last-child z-chip button");this.files.length>0&&t?t.focus():this.getType()===r.DEFAULT?this.button.querySelector("button").focus():this.uploadLink.focus()}checkFiles(t){const e=new Map,i=`supera i ${this.fileMaxSize}MB`;return t.forEach((t=>{const n=t.size/1024/1024,s=this.acceptedFormat.split(",").some((e=>t.name.toLowerCase().endsWith(e.trim()))),r=n<=this.fileMaxSize;r&&s?this.files.find((e=>e.name===t.name))||(this.files.push(t),this.fileInput.emit(t),this.input.value=""):(e.set(t.name,[]),r||e.get(t.name).push(i),s||e.get(t.name).push(" ha un'estensione non prevista"))})),e}renderTitle(){return i("z-heading",{id:"title",variant:"semibold",level:2},this.mainTitle)}renderDescription(t,e){return i("z-body",{variant:t,level:e},this.description)}renderAllowedFileExtensions(){let t="",e="";return this.acceptedFormat&&(t=` nei formati ${this.acceptedFormat.split(", ").map((t=>t.substring(1).toUpperCase())).join(", ")}`),this.fileMaxSize&&(e=` per un massimo di ${this.fileMaxSize}MB di peso`),i("z-body",{level:3},t||e?`Puoi allegare file${t}${e}.`:null)}renderFileSection(){return i("section",{class:"files-container "+(this.files.length?"":"hidden")},i("z-heading",{variant:"semibold",level:4},"File appena caricati"),i("div",{class:"files-wrapper"},i("slot",{name:"files"})),i("z-divider",{size:l.MEDIUM}))}renderInput(){return i("input",Object.assign({},this.inputAttributes,{onChange:()=>this.fileInputHandler(),accept:this.acceptedFormat,ref:t=>this.input=t}))}renderUploadButton(){return[this.renderInput(),i("z-button",{onClick:()=>this.input.click(),onKeyPress:t=>{"Space"!=t.code&&"Enter"!=t.code||(t.preventDefault(),this.input.click())},id:"fileSelect",variant:this.buttonVariant,icon:"upload",ref:t=>this.button=t},"Allega")]}renderUploadLink(){return[this.renderInput(),i("z-body",{class:"upload-link-text",variant:"regular",level:1},"Trascinalo qui o"," ",i("z-body",{tabIndex:0,class:"upload-link",onClick:()=>this.input.click(),onKeyPress:t=>{"Space"!=t.code&&"Enter"!=t.code||(t.preventDefault(),this.input.click())},variant:"semibold",level:1,ref:t=>this.uploadLink=t},"caricalo")," ","dal tuo computer")]}renderDefaultMode(){return[this.renderDescription("semibold",3),this.renderAllowedFileExtensions(),this.renderFileSection(),this.renderUploadButton()]}renderDragDropMode(){return[this.renderFileSection(),i("z-dragdrop-area",null,i("div",{class:"text-container"},this.renderDescription("regular",1),this.renderUploadLink(),this.renderAllowedFileExtensions()))]}formatErrorString(t,e){var i,n;return`Il file ${t} ${null!==(i=e[0])&&void 0!==i?i:""}${e[0]&&e[1]?", ":""} ${null!==(n=e[1])&&void 0!==n?n:""} e non può quindi essere caricato.`}handleErrorModalContent(){return i("div",{slot:"modalContent"},i("div",{class:"modal-wrapper"},i("div",{class:"files"},Array.from(this.invalidFiles).map((([t,e])=>i("z-body",{variant:"regular",level:3},this.formatErrorString(t,e)))))))}render(){return i(n,null,i("div",{tabIndex:0,class:`container ${this.getType()}`},this.renderTitle(),this.getType()==r.DEFAULT?this.renderDefaultMode():this.renderDragDropMode()),!!this.invalidFiles.size&&i("z-modal",{tabIndex:0,ref:t=>this.errorModal=t,modaltitle:"Attenzione",onModalClose:()=>this.invalidFiles=new Map,onModalBackgroundClick:()=>this.invalidFiles=new Map},this.handleErrorModalContent()))}get el(){return s(this)}};c.style=":host{color:var(--color-text01);font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>.container{display:flex;flex-direction:column}:host .modal-wrapper{display:flex;align-items:center;justify-content:center}:host .modal-wrapper>.files-wrapper{display:flex;flex-direction:column;margin:calc(var(--space-unit) * 4);gap:var(--space-unit)}:host .text-container{display:flex;flex-direction:column;margin:auto}:host .text-container z-body{text-align:center}:host .text-container .upload-link{color:var(--color-link-primary);cursor:pointer}:host .text-container .upload-link-text{margin-bottom:var(--space-unit)}input#file-elem{display:none}#title{display:inline-block;margin-bottom:var(--space-unit)}:host>.container>z-button{display:inline-block;margin-top:calc(var(--space-unit) * 3)}:host>.container>.files-container.hidden{display:none}:host>.container>.files-container>z-heading{display:inline-block;margin:calc(var(--space-unit) * 3) 0}:host>.container>.files-container>.files-wrapper{display:flex;flex-wrap:wrap;column-gap:calc(var(--space-unit) * 2);row-gap:calc(var(--space-unit) * 2)}:host>.container>.files-container>z-divider{margin-top:calc(var(--space-unit) * 3);margin-bottom:0}@media only screen and (min-width: 768px){:host>.container>z-button{align-self:flex-start}}";export{c as z_file_upload}
1
+ import{r as t,c as e,h as i,H as n,g as s}from"./p-d17ebc2f.js";import{v as r,o as a,D as l}from"./p-a23e9115.js";import{g as o}from"./p-8ebe4adf.js";import"./p-d69e14fb.js";const c=class{constructor(i){t(this,i),this.fileInput=e(this,"fileInput",7),this.type=r.DEFAULT,this.files=[],this.inputAttributes={type:"file",id:"file-elem",multiple:!0}}removeFileListener(t){const e=this.files,i=e.find((e=>e.name===t.detail.fileName));if(i){const t=e.indexOf(i);t>=0&&(e.splice(t,1),this.files=[...e])}}fileDroppedListener(t){this.input.files=t.detail,this.fileInputHandler()}componentDidUpdate(){this.handleAccessibility(),this.invalidFiles.size&&this.errorModal.focus()}componentWillLoad(){this.invalidFiles=new Map}fileInputHandler(){this.input.files.length&&(this.invalidFiles=this.checkFiles(Array.from(this.input.files)))}async getFiles(){return this.files}getType(){return o()!==a.DESKTOP?r.DEFAULT:this.type}handleAccessibility(){const t=this.el.querySelector("z-file:last-child z-chip button");this.files.length>0&&t?t.focus():this.getType()===r.DEFAULT?this.button.querySelector("button").focus():this.uploadLink.focus()}checkFiles(t){const e=new Map,i=`supera i ${this.fileMaxSize}MB`;return t.forEach((t=>{const n=t.size/1024/1024,s=this.acceptedFormat.split(",").some((e=>t.name.toLowerCase().endsWith(e.trim()))),r=n<=this.fileMaxSize;r&&s?this.files.find((e=>e.name===t.name))||(this.files.push(t),this.fileInput.emit(t),this.input.value=""):(e.set(t.name,[]),r||e.get(t.name).push(i),s||e.get(t.name).push(" ha un'estensione non prevista"))})),e}renderTitle(){return i("z-heading",{id:"title",variant:"semibold",level:2},this.mainTitle)}renderDescription(t,e){return i("z-body",{variant:t,level:e},this.description)}renderAllowedFileExtensions(){let t="",e="";return this.acceptedFormat&&(t=` nei formati ${this.acceptedFormat.split(", ").map((t=>t.substring(1).toUpperCase())).join(", ")}`),this.fileMaxSize&&(e=` per un massimo di ${this.fileMaxSize}MB di peso`),i("z-body",{level:3},t||e?`Puoi allegare file${t}${e}.`:null)}renderFileSection(){return i("section",{class:"files-container "+(this.files.length?"":"hidden")},i("z-heading",{variant:"semibold",level:4},"File appena caricati"),i("div",{class:"files-wrapper"},i("slot",{name:"files"})),i("z-divider",{size:l.MEDIUM}))}renderInput(){return i("input",Object.assign({},this.inputAttributes,{onChange:()=>this.fileInputHandler(),accept:this.acceptedFormat,ref:t=>this.input=t}))}renderUploadButton(){return[this.renderInput(),i("z-button",{onClick:()=>this.input.click(),onKeyPress:t=>{"Space"!=t.code&&"Enter"!=t.code||(t.preventDefault(),this.input.click())},id:"fileSelect",variant:this.buttonVariant,icon:"upload",ref:t=>this.button=t},"Allega")]}renderUploadLink(){return[this.renderInput(),i("z-body",{class:"upload-link-text",variant:"regular",level:1},"Trascinalo qui o"," ",i("z-body",{tabIndex:0,class:"upload-link",onClick:()=>this.input.click(),onKeyPress:t=>{"Space"!=t.code&&"Enter"!=t.code||(t.preventDefault(),this.input.click())},variant:"semibold",level:1,ref:t=>this.uploadLink=t},"caricalo")," ","dal tuo computer")]}renderDefaultMode(){return[this.renderDescription("semibold",3),this.renderAllowedFileExtensions(),this.renderFileSection(),this.renderUploadButton()]}renderDragDropMode(){return[this.renderFileSection(),i("z-dragdrop-area",null,i("div",{class:"text-container"},this.renderDescription("regular",1),this.renderUploadLink(),this.renderAllowedFileExtensions()))]}formatErrorString(t,e){var i,n;return`Il file ${t} ${null!==(i=e[0])&&void 0!==i?i:""}${e[0]&&e[1]?", ":""} ${null!==(n=e[1])&&void 0!==n?n:""} e non può quindi essere caricato.`}handleErrorModalContent(){return i("div",{slot:"modalContent"},i("div",{class:"modal-wrapper"},i("div",{class:"files"},Array.from(this.invalidFiles).map((([t,e])=>i("z-body",{variant:"regular",level:3},this.formatErrorString(t,e)))))))}render(){return i(n,null,i("div",{tabIndex:0,class:`container ${this.getType()}`},this.renderTitle(),this.getType()==r.DEFAULT?this.renderDefaultMode():this.renderDragDropMode()),!!this.invalidFiles.size&&i("z-modal",{tabIndex:0,ref:t=>this.errorModal=t,modaltitle:"Attenzione",onModalClose:()=>this.invalidFiles=new Map,onModalBackgroundClick:()=>this.invalidFiles=new Map},this.handleErrorModalContent()))}get el(){return s(this)}};c.style=":host{color:var(--color-text01);font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>.container{display:flex;flex-direction:column}:host .modal-wrapper{display:flex;align-items:center;justify-content:center}:host .modal-wrapper>.files-wrapper{display:flex;flex-direction:column;margin:calc(var(--space-unit) * 4);gap:var(--space-unit)}:host .text-container{display:flex;flex-direction:column;margin:auto}:host .text-container z-body{text-align:center}:host .text-container .upload-link{color:var(--color-link-primary);cursor:pointer}:host .text-container .upload-link-text{margin-bottom:var(--space-unit)}input#file-elem{display:none}#title{display:inline-block;margin-bottom:var(--space-unit)}:host>.container>z-button{display:inline-block;margin-top:calc(var(--space-unit) * 3)}:host>.container>.files-container.hidden{display:none}:host>.container>.files-container>z-heading{display:inline-block;margin:calc(var(--space-unit) * 3) 0}:host>.container>.files-container>.files-wrapper{display:flex;flex-wrap:wrap;column-gap:calc(var(--space-unit) * 2);row-gap:calc(var(--space-unit) * 2)}:host>.container>.files-container>z-divider{margin-top:calc(var(--space-unit) * 3);margin-bottom:0}@media only screen and (min-width: 768px){:host>.container>z-button{align-self:flex-start}}";export{c as z_file_upload}
@@ -1 +1 @@
1
- import{e as a,o as e}from"./p-a23e9115.js";import{t,m as n}from"./p-d69e14fb.js";function r(a){switch(a){case!0:case"true":case 1:case"1":case"on":case"yes":return!0;case!1:case"false":case 0:case"0":case"off":case"no":return!1;default:return a}}function s(){return Math.random().toString(36).replace("0.","")}function c(e,t,...n){e.code!==a.ENTER&&e.code!==a.SPACE||(e.preventDefault(),t(...n))}function u(a=null){return a||(a=document.activeElement),a&&a.shadowRoot&&a.shadowRoot.activeElement?u(a=a.shadowRoot.activeElement):a}function o(a,e=[]){return e.push(a),a.parentElement?o(a=a.parentElement,e):a.parentNode&&a.parentNode.host?o(a=a.parentNode.host,e):e}function f(){switch(!0){case window.innerWidth<=n:return e.MOBILE;case window.innerWidth<=t:return e.TABLET;default:return e.DESKTOP}}function i(a){try{return JSON.parse(a)}catch(a){return!1}}function d(a){const e=Math.ceil(2**31-1)*parseFloat(`0.${a}`);let t=Math.ceil(e%1*19);return 0===t&&(t=1),`avatar-C${t.toString().padStart(2,"0")}`}export{u as a,r as b,d as c,f as d,i as e,o as g,c as h,s as r}
1
+ import{e as a,o as e}from"./p-a23e9115.js";import{t,m as n}from"./p-d69e14fb.js";function r(a){switch(a){case!0:case"true":case 1:case"1":case"on":case"yes":return!0;case!1:case"false":case 0:case"0":case"off":case"no":return!1;default:return a}}function s(){return Math.random().toString(36).replace("0.","")}function c(e,t,...n){e.code!==a.ENTER&&e.code!==a.SPACE||(e.preventDefault(),t(...n))}function u(a=null){return a||(a=document.activeElement),a&&a.shadowRoot&&a.shadowRoot.activeElement?u(a=a.shadowRoot.activeElement):a}function o(a,e=[]){return e.push(a),a.parentElement?o(a=a.parentElement,e):a.parentNode&&a.parentNode.host?o(a=a.parentNode.host,e):e}function f(){switch(!0){case window.innerWidth<=n:return e.MOBILE;case window.innerWidth<=t:return e.TABLET;default:return e.DESKTOP}}function i(a){try{return JSON.parse(a)}catch(a){return!1}}function d(a){const e=Math.ceil(2**31-1)*parseFloat(`0.${a}`);let t=Math.ceil(e%1*19);return 0===t&&(t=1),`avatar-C${t.toString().padStart(2,"0")}`}export{o as a,r as b,d as c,u as d,i as e,f as g,c as h,s as r}