@zanichelli/albe-web-components 19.2.7 → 19.2.8-RC1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{utils-Ctc6JP2n.js → utils-BY7xrW7W.js} +6 -0
- package/dist/cjs/web-components-library.cjs.js +1 -1
- package/dist/cjs/z-app-header_12.cjs.entry.js +19 -17
- package/dist/cjs/z-book-card-deprecated.cjs.entry.js +1 -1
- package/dist/cjs/z-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/z-color-picker.cjs.entry.js +1 -1
- package/dist/cjs/z-combobox.cjs.entry.js +3 -3
- package/dist/cjs/z-menu.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card-info.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-list-item.cjs.entry.js +1 -1
- package/dist/cjs/z-popover.cjs.entry.js +1 -1
- package/dist/cjs/z-select.cjs.entry.js +4 -8
- package/dist/cjs/z-skip-to-content.cjs.entry.js +1 -1
- package/dist/cjs/z-slideshow.cjs.entry.js +1 -1
- package/dist/cjs/z-table.cjs.entry.js +1 -1
- package/dist/cjs/z-toast-notification.cjs.entry.js +92 -31
- package/dist/cjs/z-toggle-switch.cjs.entry.js +1 -1
- package/dist/cjs/z-tool.cjs.entry.js +1 -1
- package/dist/cjs/z-tr.cjs.entry.js +1 -1
- package/dist/collection/components/z-app-header/index.js +21 -2
- package/dist/collection/components/z-app-header/index.stories.js +25 -9
- package/dist/collection/components/z-combobox/index.js +3 -3
- package/dist/collection/components/z-input/index.js +49 -30
- package/dist/collection/components/z-searchbar/index.js +25 -3
- package/dist/collection/components/z-searchbar/index.stories.js +9 -0
- package/dist/collection/components/z-select/index.js +4 -8
- package/dist/collection/utils/utils.js +5 -0
- package/dist/components/index13.js +1 -1
- package/dist/components/index17.js +1 -1
- package/dist/components/index7.js +1 -1
- package/dist/components/utils.js +1 -1
- package/dist/components/z-app-header.js +1 -1
- package/dist/components/z-combobox.js +1 -1
- package/dist/components/z-select.js +1 -1
- package/dist/components/z-skip-to-content.js +1 -1
- package/dist/components/z-slideshow.js +1 -1
- package/dist/components/z-toast-notification.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{utils-DYd3kO0P.js → utils-BEzZQwOB.js} +6 -1
- package/dist/esm/web-components-library.js +1 -1
- package/dist/esm/z-app-header_12.entry.js +19 -17
- package/dist/esm/z-book-card-deprecated.entry.js +1 -1
- package/dist/esm/z-breadcrumb.entry.js +1 -1
- package/dist/esm/z-color-picker.entry.js +1 -1
- package/dist/esm/z-combobox.entry.js +3 -3
- package/dist/esm/z-menu.entry.js +1 -1
- package/dist/esm/z-myz-card-info.entry.js +1 -1
- package/dist/esm/z-myz-list-item.entry.js +1 -1
- package/dist/esm/z-popover.entry.js +1 -1
- package/dist/esm/z-select.entry.js +4 -8
- package/dist/esm/z-skip-to-content.entry.js +1 -1
- package/dist/esm/z-slideshow.entry.js +1 -1
- package/dist/esm/z-table.entry.js +1 -1
- package/dist/esm/z-toast-notification.entry.js +92 -31
- package/dist/esm/z-toggle-switch.entry.js +1 -1
- package/dist/esm/z-tool.entry.js +1 -1
- package/dist/esm/z-tr.entry.js +1 -1
- package/dist/types/components/z-app-header/index.d.ts +4 -0
- package/dist/types/components/z-app-header/index.stories.d.ts +7 -0
- package/dist/types/components/z-input/index.d.ts +6 -4
- package/dist/types/components/z-searchbar/index.d.ts +2 -0
- package/dist/types/components/z-searchbar/index.stories.d.ts +4 -0
- package/dist/types/components/z-select/index.d.ts +0 -1
- package/dist/types/components.d.ts +32 -3
- package/dist/types/utils/utils.d.ts +2 -0
- package/dist/web-components-library/index.esm.js +1 -1
- package/dist/web-components-library/{p-eddc2d19.entry.js → p-0105149a.entry.js} +1 -1
- package/dist/web-components-library/p-0da8eae7.entry.js +1 -0
- package/{www/build/p-1d023220.entry.js → dist/web-components-library/p-20d94cce.entry.js} +1 -1
- package/{www/build/p-14b804f9.entry.js → dist/web-components-library/p-271dfd9c.entry.js} +1 -1
- package/dist/web-components-library/{p-8a8df4f4.entry.js → p-2abf765d.entry.js} +1 -1
- package/dist/web-components-library/{p-299f0f85.entry.js → p-313fc91d.entry.js} +1 -1
- package/dist/web-components-library/p-4a434f6e.entry.js +1 -0
- package/dist/web-components-library/{p-f7e46ef2.entry.js → p-4d1b3d16.entry.js} +1 -1
- package/dist/web-components-library/p-61992f12.entry.js +1 -0
- package/dist/web-components-library/{p-2c036e17.entry.js → p-62d2247e.entry.js} +1 -1
- package/dist/web-components-library/{p-583b8152.entry.js → p-64c025f6.entry.js} +1 -1
- package/dist/web-components-library/{p-3ea03d34.entry.js → p-660737b0.entry.js} +1 -1
- package/dist/web-components-library/p-7371a543.entry.js +2 -0
- package/dist/web-components-library/{p-85cac60d.entry.js → p-89daaeb5.entry.js} +1 -1
- package/dist/web-components-library/p-B0bOjMSb.js +1 -0
- package/dist/web-components-library/{p-83da1031.entry.js → p-b01ff8e6.entry.js} +1 -1
- package/dist/web-components-library/{p-8261c869.entry.js → p-ce3bbaf2.entry.js} +1 -1
- package/dist/web-components-library/{p-e48497f0.entry.js → p-d121122f.entry.js} +1 -1
- package/dist/web-components-library/web-components-library.esm.js +1 -1
- package/package.json +5 -4
- package/www/build/index.esm.js +1 -1
- package/www/build/{p-eddc2d19.entry.js → p-0105149a.entry.js} +1 -1
- package/www/build/p-0da8eae7.entry.js +1 -0
- package/{dist/web-components-library/p-1d023220.entry.js → www/build/p-20d94cce.entry.js} +1 -1
- package/{dist/web-components-library/p-14b804f9.entry.js → www/build/p-271dfd9c.entry.js} +1 -1
- package/www/build/{p-8a8df4f4.entry.js → p-2abf765d.entry.js} +1 -1
- package/www/build/{p-299f0f85.entry.js → p-313fc91d.entry.js} +1 -1
- package/www/build/p-4a434f6e.entry.js +1 -0
- package/www/build/{p-f7e46ef2.entry.js → p-4d1b3d16.entry.js} +1 -1
- package/www/build/p-61992f12.entry.js +1 -0
- package/www/build/{p-2c036e17.entry.js → p-62d2247e.entry.js} +1 -1
- package/www/build/{p-583b8152.entry.js → p-64c025f6.entry.js} +1 -1
- package/www/build/{p-3ea03d34.entry.js → p-660737b0.entry.js} +1 -1
- package/www/build/p-7371a543.entry.js +2 -0
- package/www/build/{p-85cac60d.entry.js → p-89daaeb5.entry.js} +1 -1
- package/www/build/p-B0bOjMSb.js +1 -0
- package/www/build/{p-83da1031.entry.js → p-b01ff8e6.entry.js} +1 -1
- package/www/build/{p-23143b48.js → p-b82f3aad.js} +1 -1
- package/www/build/{p-8261c869.entry.js → p-ce3bbaf2.entry.js} +1 -1
- package/www/build/{p-e48497f0.entry.js → p-d121122f.entry.js} +1 -1
- package/www/build/web-components-library.esm.js +1 -1
- package/www/index.html +1 -1
- package/dist/web-components-library/p-37e84b71.entry.js +0 -1
- package/dist/web-components-library/p-8b026993.entry.js +0 -1
- package/dist/web-components-library/p-9d15ecdf.entry.js +0 -2
- package/dist/web-components-library/p-CPsEG702.js +0 -1
- package/dist/web-components-library/p-d10e6b1a.entry.js +0 -1
- package/www/build/p-37e84b71.entry.js +0 -1
- package/www/build/p-8b026993.entry.js +0 -1
- package/www/build/p-9d15ecdf.entry.js +0 -2
- package/www/build/p-CPsEG702.js +0 -1
- package/www/build/p-d10e6b1a.entry.js +0 -1
|
@@ -17,6 +17,8 @@ const StoryMeta = {
|
|
|
17
17
|
"--app-header-content-max-width": "100%",
|
|
18
18
|
"enableSearch": false,
|
|
19
19
|
"searchPageUrl": "",
|
|
20
|
+
"searchPlaceholder": "Digita qui quello che vuoi",
|
|
21
|
+
"searchButtonLabel": "Cliccami",
|
|
20
22
|
"enableZLogo": false,
|
|
21
23
|
"enableOffcanvas": false,
|
|
22
24
|
},
|
|
@@ -98,7 +100,7 @@ const menuTemplate = () => {
|
|
|
98
100
|
export const Title = {
|
|
99
101
|
parameters: {
|
|
100
102
|
controls: {
|
|
101
|
-
exclude: ["enableOffcanvas"],
|
|
103
|
+
exclude: ["enableOffcanvas", "searchPlaceholder", "searchButtonLabel"],
|
|
102
104
|
},
|
|
103
105
|
},
|
|
104
106
|
render: (args) => html `<z-app-header
|
|
@@ -113,7 +115,7 @@ export const Title = {
|
|
|
113
115
|
export const ProductLogo = {
|
|
114
116
|
parameters: {
|
|
115
117
|
controls: {
|
|
116
|
-
exclude: ["enableOffcanvas"],
|
|
118
|
+
exclude: ["enableOffcanvas", "searchPlaceholder", "searchButtonLabel"],
|
|
117
119
|
},
|
|
118
120
|
},
|
|
119
121
|
render: (args) => html `<z-app-header
|
|
@@ -132,7 +134,7 @@ export const ProductLogo = {
|
|
|
132
134
|
export const TopTitle = {
|
|
133
135
|
parameters: {
|
|
134
136
|
controls: {
|
|
135
|
-
exclude: ["enableOffcanvas", "enableZLogo"],
|
|
137
|
+
exclude: ["enableOffcanvas", "enableZLogo", "searchPlaceholder", "searchButtonLabel"],
|
|
136
138
|
},
|
|
137
139
|
},
|
|
138
140
|
render: (args) => html `<z-app-header
|
|
@@ -147,7 +149,7 @@ export const TopTitle = {
|
|
|
147
149
|
export const TopTitleWithProductLogo = {
|
|
148
150
|
parameters: {
|
|
149
151
|
controls: {
|
|
150
|
-
exclude: ["enableOffcanvas", "enableZLogo"],
|
|
152
|
+
exclude: ["enableOffcanvas", "enableZLogo", "searchPlaceholder", "searchButtonLabel"],
|
|
151
153
|
},
|
|
152
154
|
},
|
|
153
155
|
render: (args) => html `<z-app-header
|
|
@@ -167,7 +169,7 @@ export const TopTitleWithProductLogo = {
|
|
|
167
169
|
export const CustomMenuButton = {
|
|
168
170
|
parameters: {
|
|
169
171
|
controls: {
|
|
170
|
-
exclude: ["enableOffcanvas"],
|
|
172
|
+
exclude: ["enableOffcanvas", "searchPlaceholder", "searchButtonLabel"],
|
|
171
173
|
},
|
|
172
174
|
},
|
|
173
175
|
render: (args) => html `<z-app-header
|
|
@@ -183,7 +185,7 @@ export const CustomMenuButton = {
|
|
|
183
185
|
export const MenuWithTopTitle = {
|
|
184
186
|
parameters: {
|
|
185
187
|
controls: {
|
|
186
|
-
exclude: ["enableZLogo"],
|
|
188
|
+
exclude: ["enableZLogo", "searchPlaceholder", "searchButtonLabel"],
|
|
187
189
|
},
|
|
188
190
|
},
|
|
189
191
|
render: (args) => html `<z-app-header
|
|
@@ -200,7 +202,7 @@ export const MenuWithTopTitle = {
|
|
|
200
202
|
export const MenuWithTopTitleAndProductLogo = {
|
|
201
203
|
parameters: {
|
|
202
204
|
controls: {
|
|
203
|
-
exclude: ["enableZLogo"],
|
|
205
|
+
exclude: ["enableZLogo", "searchPlaceholder", "searchButtonLabel"],
|
|
204
206
|
},
|
|
205
207
|
},
|
|
206
208
|
render: (args) => html `<z-app-header
|
|
@@ -222,7 +224,14 @@ export const MenuWithTopTitleAndProductLogo = {
|
|
|
222
224
|
export const LongTitle = {
|
|
223
225
|
parameters: {
|
|
224
226
|
controls: {
|
|
225
|
-
exclude: [
|
|
227
|
+
exclude: [
|
|
228
|
+
"enableOffcanvas",
|
|
229
|
+
"enableZLogo",
|
|
230
|
+
"enableSearch",
|
|
231
|
+
"searchPageUrl",
|
|
232
|
+
"searchPlaceholder",
|
|
233
|
+
"searchButtonLabel",
|
|
234
|
+
],
|
|
226
235
|
},
|
|
227
236
|
},
|
|
228
237
|
render: (args) => html `<z-app-header style="--app-header-content-max-width: ${args["--app-header-content-max-width"]}">
|
|
@@ -235,6 +244,11 @@ export const OffcanvasMenu = {
|
|
|
235
244
|
args: {
|
|
236
245
|
enableOffcanvas: true,
|
|
237
246
|
},
|
|
247
|
+
parameters: {
|
|
248
|
+
controls: {
|
|
249
|
+
exclude: ["searchPlaceholder", "searchButtonLabel"],
|
|
250
|
+
},
|
|
251
|
+
},
|
|
238
252
|
render: (args) => html `<z-app-header
|
|
239
253
|
.enableOffcanvas=${args.enableOffcanvas}
|
|
240
254
|
.enableSearch=${args.enableSearch}
|
|
@@ -261,7 +275,7 @@ export const Stuck = {
|
|
|
261
275
|
},
|
|
262
276
|
},
|
|
263
277
|
controls: {
|
|
264
|
-
exclude: ["enableOffcanvas"],
|
|
278
|
+
exclude: ["enableOffcanvas", "searchPlaceholder", "searchButtonLabel"],
|
|
265
279
|
},
|
|
266
280
|
},
|
|
267
281
|
render: (args) => html `<z-app-header
|
|
@@ -292,6 +306,8 @@ export const SearchPageButton = {
|
|
|
292
306
|
render: (args) => html `<z-app-header
|
|
293
307
|
enable-search
|
|
294
308
|
.enableZLogo=${args.enableZLogo}
|
|
309
|
+
.searchPlaceholder=${args.searchPlaceholder}
|
|
310
|
+
.searchButtonLabel=${args.searchButtonLabel}
|
|
295
311
|
search-page-url="https://www.zanichelli.it"
|
|
296
312
|
style="--app-header-content-max-width: ${args["--app-header-content-max-width"]}"
|
|
297
313
|
>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
import { ControlSize, InputType, KeyboardCode, ListDividerType, ListSize } from "../../beans";
|
|
3
|
-
import { getPlainText, randomId } from "../../utils/utils";
|
|
3
|
+
import { encodeString, getPlainText, randomId } from "../../utils/utils";
|
|
4
4
|
export class ZCombobox {
|
|
5
5
|
watchItems() {
|
|
6
6
|
this.itemsList = typeof this.items === "string" ? JSON.parse(this.items) : this.items;
|
|
@@ -60,7 +60,7 @@ export class ZCombobox {
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
getOptionId(itemId) {
|
|
63
|
-
return `${this.inputid}-option-${itemId}`;
|
|
63
|
+
return `${this.inputid}-option-${encodeString(itemId)}`;
|
|
64
64
|
}
|
|
65
65
|
getCheckAllOptionId() {
|
|
66
66
|
return `${this.inputid}-check-all`;
|
|
@@ -294,7 +294,7 @@ export class ZCombobox {
|
|
|
294
294
|
return (h("z-list-element", { class: "check-all-wrapper", role: "presentation", htmlTabindex: -1, dividerType: ListDividerType.ELEMENT, dividerColor: "gray800", size: this.getControlToListSize(), disabled: !!isDisabled }, h("span", { class: "option-wrap", role: "presentation", onClick: () => this.checkOption(optionId) }, h("z-icon", { name: allChecked ? "checkbox-checked" : "checkbox", class: this.focusedItemId === optionId ? "focused" : "" }), h("span", { id: optionId, role: isDisabled ? "presentation" : "option", "aria-selected": allChecked ? "true" : "false" }, allChecked ? this.uncheckalltext : this.checkalltext))));
|
|
295
295
|
}
|
|
296
296
|
render() {
|
|
297
|
-
return (h("div", { key: '
|
|
297
|
+
return (h("div", { key: '71d248786dcd29eb5bc03bbb1d9997f4bc7d46c2', "data-action": `combo-${this.inputid}`, class: { open: this.isopen, fixed: this.isfixed, disabled: this.disabled }, id: this.inputid }, this.renderHeader(), !this.disabled && this.renderContent()));
|
|
298
298
|
}
|
|
299
299
|
static get is() { return "z-combobox"; }
|
|
300
300
|
static get encapsulation() { return "shadow"; }
|
|
@@ -145,16 +145,16 @@ export class ZInput {
|
|
|
145
145
|
pattern: this.pattern,
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
|
-
getRoleAttribute() {
|
|
149
|
-
return this.role ? { role: this.role } : {};
|
|
150
|
-
}
|
|
151
148
|
inputHasMessage() {
|
|
152
149
|
if (boolean(this.message) === false || boolean(this.message) === true) {
|
|
153
150
|
return false;
|
|
154
151
|
}
|
|
155
152
|
return true;
|
|
156
153
|
}
|
|
157
|
-
|
|
154
|
+
getAriaAttributes() {
|
|
155
|
+
return Object.assign(Object.assign(Object.assign({}, (this.role ? { role: this.role } : {})), (this.htmlAriaDescribedBy ? { "aria-describedby": this.htmlAriaDescribedBy } : {})), (this.htmlAriaLabelledby ? { "aria-labelledby": this.htmlAriaLabelledby } : {}));
|
|
156
|
+
}
|
|
157
|
+
getTextAriaAttributes() {
|
|
158
158
|
const expanded = this.htmlAriaExpanded ? { "aria-expanded": this.htmlAriaExpanded } : {};
|
|
159
159
|
const controls = this.htmlAriaControls ? { "aria-controls": this.htmlAriaControls } : {};
|
|
160
160
|
const autocomplete = this.htmlAriaAutocomplete ? { "aria-autocomplete": this.htmlAriaAutocomplete } : {};
|
|
@@ -165,7 +165,7 @@ export class ZInput {
|
|
|
165
165
|
? { "aria-describedby": this.htmlAriaDescribedBy || `${this.htmlid}-message` }
|
|
166
166
|
: {};
|
|
167
167
|
const ariaInvalid = this.status === InputStatus.ERROR ? { "aria-invalid": "true" } : {};
|
|
168
|
-
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, expanded), controls), autocomplete), activedescendant), ariaDescribedby), ariaInvalid);
|
|
168
|
+
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, this.getAriaAttributes()), expanded), controls), autocomplete), activedescendant), ariaDescribedby), ariaInvalid);
|
|
169
169
|
}
|
|
170
170
|
getFocusBlurAttributes() {
|
|
171
171
|
return {
|
|
@@ -175,7 +175,7 @@ export class ZInput {
|
|
|
175
175
|
}
|
|
176
176
|
renderInputText(type = InputType.TEXT) {
|
|
177
177
|
const ariaLabel = this.ariaLabel ? { "aria-label": this.ariaLabel } : {};
|
|
178
|
-
const attr = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(
|
|
178
|
+
const attr = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, this.getTextAttributes()), this.getNumberAttributes(type)), this.getPatternAttribute(type)), ariaLabel), this.getTextAriaAttributes()), this.getFocusBlurAttributes());
|
|
179
179
|
if (this.icon || type === InputType.PASSWORD) {
|
|
180
180
|
Object.assign(attr.class, { "has-icon": true });
|
|
181
181
|
}
|
|
@@ -225,8 +225,8 @@ export class ZInput {
|
|
|
225
225
|
/* START textarea */
|
|
226
226
|
renderTextarea() {
|
|
227
227
|
const attributes = this.getTextAttributes();
|
|
228
|
-
const ariaAttributes = this.
|
|
229
|
-
return (h(Fragment, null, this.renderLabel(), h("div", { class: Object.assign(Object.assign({}, attributes.class), { "textarea-wrapper": true, "readonly": !!attributes.readonly }) }, h("textarea", Object.assign({}, attributes, ariaAttributes, { class: Object.assign(Object.assign({}, attributes.class), { "z-scrollbar": true }), "aria-label": this.ariaLabel || undefined }
|
|
228
|
+
const ariaAttributes = this.getTextAriaAttributes();
|
|
229
|
+
return (h(Fragment, null, this.renderLabel(), h("div", { class: Object.assign(Object.assign({}, attributes.class), { "textarea-wrapper": true, "readonly": !!attributes.readonly }) }, h("textarea", Object.assign({}, attributes, ariaAttributes, { class: Object.assign(Object.assign({}, attributes.class), { "z-scrollbar": true }), "aria-label": this.ariaLabel || undefined }))), this.renderMessage()));
|
|
230
230
|
}
|
|
231
231
|
/* END textarea */
|
|
232
232
|
handleCheck(ev) {
|
|
@@ -235,7 +235,7 @@ export class ZInput {
|
|
|
235
235
|
}
|
|
236
236
|
/* START checkbox */
|
|
237
237
|
renderCheckbox() {
|
|
238
|
-
return (h("div", { class: "checkbox-wrapper" }, h("input", Object.assign({ 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 }, this.
|
|
238
|
+
return (h("div", { class: "checkbox-wrapper" }, h("input", Object.assign({ 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 }, this.getAriaAttributes(), this.getFocusBlurAttributes())), h("label", { htmlFor: this.htmlid, class: {
|
|
239
239
|
"checkbox-label": true,
|
|
240
240
|
"after": this.labelPosition === LabelPosition.RIGHT,
|
|
241
241
|
"before": this.labelPosition === LabelPosition.LEFT,
|
|
@@ -244,7 +244,7 @@ export class ZInput {
|
|
|
244
244
|
/* END checkbox */
|
|
245
245
|
/* START radio */
|
|
246
246
|
renderRadio() {
|
|
247
|
-
return (h("div", { class: "radio-wrapper" }, h("input", Object.assign({ 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 }, this.
|
|
247
|
+
return (h("div", { class: "radio-wrapper" }, h("input", Object.assign({ 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 }, this.getAriaAttributes(), this.getFocusBlurAttributes())), h("label", { htmlFor: this.htmlid, class: {
|
|
248
248
|
"radio-label": true,
|
|
249
249
|
"after": this.labelPosition === LabelPosition.RIGHT,
|
|
250
250
|
"before": this.labelPosition === LabelPosition.LEFT,
|
|
@@ -266,7 +266,7 @@ export class ZInput {
|
|
|
266
266
|
default:
|
|
267
267
|
input = this.renderInputText(this.type);
|
|
268
268
|
}
|
|
269
|
-
return h(Host, { key: '
|
|
269
|
+
return h(Host, { key: 'dfc768f25706d7b3abd219948f378ca9b733eafa' }, input);
|
|
270
270
|
}
|
|
271
271
|
static get is() { return "z-input"; }
|
|
272
272
|
static get encapsulation() { return "scoped"; }
|
|
@@ -463,6 +463,44 @@ export class ZInput {
|
|
|
463
463
|
"reflect": false,
|
|
464
464
|
"attribute": "html-aria-activedescendant"
|
|
465
465
|
},
|
|
466
|
+
"htmlAriaDescribedBy": {
|
|
467
|
+
"type": "string",
|
|
468
|
+
"mutable": false,
|
|
469
|
+
"complexType": {
|
|
470
|
+
"original": "string",
|
|
471
|
+
"resolved": "string",
|
|
472
|
+
"references": {}
|
|
473
|
+
},
|
|
474
|
+
"required": false,
|
|
475
|
+
"optional": true,
|
|
476
|
+
"docs": {
|
|
477
|
+
"tags": [],
|
|
478
|
+
"text": "the input aria-describedby (optional)"
|
|
479
|
+
},
|
|
480
|
+
"getter": false,
|
|
481
|
+
"setter": false,
|
|
482
|
+
"reflect": false,
|
|
483
|
+
"attribute": "html-aria-described-by"
|
|
484
|
+
},
|
|
485
|
+
"htmlAriaLabelledby": {
|
|
486
|
+
"type": "string",
|
|
487
|
+
"mutable": false,
|
|
488
|
+
"complexType": {
|
|
489
|
+
"original": "string",
|
|
490
|
+
"resolved": "string",
|
|
491
|
+
"references": {}
|
|
492
|
+
},
|
|
493
|
+
"required": false,
|
|
494
|
+
"optional": true,
|
|
495
|
+
"docs": {
|
|
496
|
+
"tags": [],
|
|
497
|
+
"text": "the input aria-labelledby (optional)"
|
|
498
|
+
},
|
|
499
|
+
"getter": false,
|
|
500
|
+
"setter": false,
|
|
501
|
+
"reflect": false,
|
|
502
|
+
"attribute": "html-aria-labelledby"
|
|
503
|
+
},
|
|
466
504
|
"value": {
|
|
467
505
|
"type": "string",
|
|
468
506
|
"mutable": true,
|
|
@@ -646,25 +684,6 @@ export class ZInput {
|
|
|
646
684
|
"attribute": "message",
|
|
647
685
|
"defaultValue": "true"
|
|
648
686
|
},
|
|
649
|
-
"htmlAriaDescribedBy": {
|
|
650
|
-
"type": "string",
|
|
651
|
-
"mutable": false,
|
|
652
|
-
"complexType": {
|
|
653
|
-
"original": "string",
|
|
654
|
-
"resolved": "string",
|
|
655
|
-
"references": {}
|
|
656
|
-
},
|
|
657
|
-
"required": false,
|
|
658
|
-
"optional": true,
|
|
659
|
-
"docs": {
|
|
660
|
-
"tags": [],
|
|
661
|
-
"text": "input helper message id (optional): available for text, password, number, email, textarea - if set, it will be used to populate the aria-describedby attribute, otherwise the attribute (if present) will be populated with an auto-generated value"
|
|
662
|
-
},
|
|
663
|
-
"getter": false,
|
|
664
|
-
"setter": false,
|
|
665
|
-
"reflect": false,
|
|
666
|
-
"attribute": "html-aria-described-by"
|
|
667
|
-
},
|
|
668
687
|
"labelPosition": {
|
|
669
688
|
"type": "string",
|
|
670
689
|
"mutable": false,
|
|
@@ -24,6 +24,8 @@ export class ZSearchbar {
|
|
|
24
24
|
this.showSearchButton = false;
|
|
25
25
|
/** Hide the label of the submit button, showing only the icon */
|
|
26
26
|
this.searchButtonIconOnly = false;
|
|
27
|
+
/** The label of the submit button */
|
|
28
|
+
this.searchButtonLabel = "CERCA";
|
|
27
29
|
/** Size of the `z-input` and submit `z-button` */
|
|
28
30
|
this.size = ControlSize.BIG;
|
|
29
31
|
/** Submit `z-button` variant */
|
|
@@ -204,17 +206,17 @@ export class ZSearchbar {
|
|
|
204
206
|
}
|
|
205
207
|
render() {
|
|
206
208
|
var _a, _b, _c, _d, _e;
|
|
207
|
-
return (h(Host, { key: '
|
|
209
|
+
return (h(Host, { key: 'cf8441e139a28aa53bd6d61c4b17a12739998d59', onFocus: () => (this.showResults = true), onClick: (e) => this.handleOutsideClick(e), class: { "has-submit": !!this.showSearchButton, "has-results": !!this.autocomplete } }, h("div", { key: 'b24a5060ef65a27fa1096ca0056f1f2d566c9aca', class: "input-container" }, h("z-input", { key: 'fa2648f2a11a83dedbd9c1c5d00712675713936d', ref: (el) => (this.inputRef = el), htmlid: `input-${this.htmlid}`, message: false, placeholder: this.placeholder, onStopTyping: (e) => this.handleStopTyping(e), onKeyUp: (e) => {
|
|
208
210
|
handleEnterKeydSubmit(e, () => this.handleSubmit());
|
|
209
211
|
this.handleArrowsNavigation(e);
|
|
210
212
|
}, onFocus: () => (this.showResults = true), value: this.searchString || ((_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.label), size: this.size, label: this.label, "aria-label": this.htmlAriaLabel || this.placeholder || undefined }), !!(this.showResults &&
|
|
211
213
|
this.autocomplete &&
|
|
212
214
|
this.searchString &&
|
|
213
215
|
this.searchString.length >= this.autocompleteMinChars &&
|
|
214
|
-
this.resultsItemsList) && (h("div", { key: '
|
|
216
|
+
this.resultsItemsList) && (h("div", { key: '060a4065341f54257d85e8989f55f3b6e8fe1505', class: "results z-scrollbar" }, this.preventSubmit && !((_b = this.resultsItemsList) === null || _b === void 0 ? void 0 : _b.length) ? (h("div", { class: "item-no-results body-3 mobile-body-4" }, "Non abbiamo trovato risultati per ", h("b", null, this.searchString), h("br", null), h("br", null), "Cosa puoi fare?", h("ul", null, h("li", null, "Verificare di aver scritto bene"), h("li", null, "Provare a cercare un'altra parola"), h("li", null, "Provare a cercare qualcosa di pi\u00F9 generico")))) : (h("z-list", { role: "listbox", id: `list-${this.htmlid}`, "aria-label": this.htmlAriaLabel || this.label || undefined }, this.autocomplete && !this.preventSubmit && !!this.searchString && (h("z-list-element", { role: "presentation", htmlTabindex: -1, id: `list-item-${this.htmlid}-search`, onKeyDown: (e) => this.onSearchHelperKeyDown(e), onClick: () => this.emitSearchSubmit() }, h("div", { class: "list-item item-search", role: "option", tabindex: 0 }, h("z-icon", { class: "search-icon", name: "left-magnifying-glass" }), h("div", { class: "item-label body-3 mobile-body-4", innerHTML: (_c = this.searchHelperLabel) === null || _c === void 0 ? void 0 : _c.replace("{searchString}", `<mark>${this.searchString}</mark>`) })))), this.renderItemGroups(), !!(this.searchString &&
|
|
215
217
|
((_d = this.resultsItemsList) === null || _d === void 0 ? void 0 : _d.length) &&
|
|
216
218
|
this.currResultsCount &&
|
|
217
|
-
this.currResultsCount < ((_e = this.resultsItemsList) === null || _e === void 0 ? void 0 : _e.length)) && (h("z-list-element", { role: "presentation", htmlTabindex: -1, id: `list-item-${this.htmlid}-show-all` }, h("div", { role: "option", class: "item-show-all body-3 mobile-body-4", tabindex: 0, onClick: () => (this.currResultsCount = undefined) }, "Vedi tutti i risultati")))))))), this.showSearchButton && (h("z-button", { key: '
|
|
219
|
+
this.currResultsCount < ((_e = this.resultsItemsList) === null || _e === void 0 ? void 0 : _e.length)) && (h("z-list-element", { role: "presentation", htmlTabindex: -1, id: `list-item-${this.htmlid}-show-all` }, h("div", { role: "option", class: "item-show-all body-3 mobile-body-4", tabindex: 0, onClick: () => (this.currResultsCount = undefined) }, "Vedi tutti i risultati")))))))), this.showSearchButton && (h("z-button", { key: 'e37aec8f5feb61ab23fe0c497a11290d2b121375', icon: this.searchButtonIconOnly ? "search" : undefined, "aria-label": this.searchButtonIconOnly ? this.searchButtonLabel.trim() || "CERCA" : undefined, disabled: !!this.preventSubmit, variant: this.variant, size: this.size, onClick: () => this.handleSubmit() }, this.searchButtonIconOnly ? "" : this.searchButtonLabel.trim() || "CERCA"))));
|
|
218
220
|
}
|
|
219
221
|
static get is() { return "z-searchbar"; }
|
|
220
222
|
static get encapsulation() { return "shadow"; }
|
|
@@ -511,6 +513,26 @@ export class ZSearchbar {
|
|
|
511
513
|
"attribute": "search-button-icon-only",
|
|
512
514
|
"defaultValue": "false"
|
|
513
515
|
},
|
|
516
|
+
"searchButtonLabel": {
|
|
517
|
+
"type": "string",
|
|
518
|
+
"mutable": false,
|
|
519
|
+
"complexType": {
|
|
520
|
+
"original": "string",
|
|
521
|
+
"resolved": "string",
|
|
522
|
+
"references": {}
|
|
523
|
+
},
|
|
524
|
+
"required": false,
|
|
525
|
+
"optional": true,
|
|
526
|
+
"docs": {
|
|
527
|
+
"tags": [],
|
|
528
|
+
"text": "The label of the submit button"
|
|
529
|
+
},
|
|
530
|
+
"getter": false,
|
|
531
|
+
"setter": false,
|
|
532
|
+
"reflect": false,
|
|
533
|
+
"attribute": "search-button-label",
|
|
534
|
+
"defaultValue": "\"CERCA\""
|
|
535
|
+
},
|
|
514
536
|
"size": {
|
|
515
537
|
"type": "string",
|
|
516
538
|
"mutable": false,
|
|
@@ -22,6 +22,7 @@ const StoryMeta = {
|
|
|
22
22
|
"preventSubmit": false,
|
|
23
23
|
"showSearchButton": false,
|
|
24
24
|
"searchButtonIconOnly": false,
|
|
25
|
+
"searchButtonLabel": "",
|
|
25
26
|
"autocomplete": false,
|
|
26
27
|
"autocompleteMinChars": 3,
|
|
27
28
|
"resultsCount": undefined,
|
|
@@ -46,6 +47,7 @@ export const Default = {
|
|
|
46
47
|
<z-searchbar
|
|
47
48
|
prevent-submit=${args.preventSubmit}
|
|
48
49
|
show-search-button=${args.showSearchButton}
|
|
50
|
+
search-button-label=${args.searchButtonLabel}
|
|
49
51
|
search-button-icon-only=${args.searchButtonIconOnly}
|
|
50
52
|
autocomplete=${args.autocomplete}
|
|
51
53
|
autocomplete-min-chars=${args.autocompleteMinChars}
|
|
@@ -78,6 +80,7 @@ export const SimpleSearch = {
|
|
|
78
80
|
prevent-submit="false"
|
|
79
81
|
show-search-button=${args.showSearchButton}
|
|
80
82
|
search-button-icon-only=${args.searchButtonIconOnly}
|
|
83
|
+
search-button-label=${args.searchButtonLabel}
|
|
81
84
|
autcomplete="false"
|
|
82
85
|
value=${args.value}
|
|
83
86
|
placeholder=${args.placeholder}
|
|
@@ -94,12 +97,14 @@ export const Autocomplete = {
|
|
|
94
97
|
htmlid: "myIdAutocomplete",
|
|
95
98
|
showSearchButton: false,
|
|
96
99
|
searchButtonIconOnly: false,
|
|
100
|
+
searchButtonLabel: "Cliccami",
|
|
97
101
|
},
|
|
98
102
|
render: (args) => html `
|
|
99
103
|
<z-searchbar
|
|
100
104
|
prevent-submit=${args.preventSubmit}
|
|
101
105
|
show-search-button=${args.showSearchButton}
|
|
102
106
|
search-button-icon-only=${args.searchButtonIconOnly}
|
|
107
|
+
search-button-label=${args.searchButtonLabel}
|
|
103
108
|
autocomplete=${args.autocomplete}
|
|
104
109
|
autocomplete-min-chars=${args.autocompleteMinChars}
|
|
105
110
|
results-count=${args.resultsCount}
|
|
@@ -123,6 +128,7 @@ export const AutocompleteWithComplexItems = {
|
|
|
123
128
|
htmlid: "myIdGroupedAutocomplete",
|
|
124
129
|
showSearchButton: false,
|
|
125
130
|
searchButtonIconOnly: false,
|
|
131
|
+
searchButtonLabel: "Cliccami",
|
|
126
132
|
resultsItems: [
|
|
127
133
|
{
|
|
128
134
|
label: "first item",
|
|
@@ -171,6 +177,7 @@ export const AutocompleteWithComplexItems = {
|
|
|
171
177
|
prevent-submit=${args.preventSubmit}
|
|
172
178
|
show-search-button=${args.showSearchButton}
|
|
173
179
|
search-button-icon-only=${args.searchButtonIconOnly}
|
|
180
|
+
search-button-label=${args.searchButtonLabel}
|
|
174
181
|
autocomplete=${args.autocomplete}
|
|
175
182
|
autocomplete-min-chars=${args.autocompleteMinChars}
|
|
176
183
|
results-count=${args.resultsCount}
|
|
@@ -194,6 +201,7 @@ export const AutocompleteWithComplexTreeItems = {
|
|
|
194
201
|
htmlid: "myIdGroupedAutocomplete",
|
|
195
202
|
showSearchButton: false,
|
|
196
203
|
searchButtonIconOnly: false,
|
|
204
|
+
searchButtonLabel: "Cliccami",
|
|
197
205
|
resultsItems: [
|
|
198
206
|
{
|
|
199
207
|
label: "first item",
|
|
@@ -304,6 +312,7 @@ export const AutocompleteWithComplexTreeItems = {
|
|
|
304
312
|
prevent-submit=${args.preventSubmit}
|
|
305
313
|
show-search-button=${args.showSearchButton}
|
|
306
314
|
search-button-icon-only=${args.searchButtonIconOnly}
|
|
315
|
+
search-button-label=${args.searchButtonLabel}
|
|
307
316
|
autocomplete=${args.autocomplete}
|
|
308
317
|
autocomplete-min-chars=${args.autocompleteMinChars}
|
|
309
318
|
results-count=${args.resultsCount}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h, } from "@stencil/core";
|
|
2
2
|
import { ControlSize, KeyboardCode, ListDividerType, ListSize } from "../../beans";
|
|
3
|
-
import { boolean, getClickedElement, getElementTree, getPlainText, randomId } from "../../utils/utils";
|
|
3
|
+
import { boolean, encodeString, getClickedElement, getElementTree, getPlainText, randomId } from "../../utils/utils";
|
|
4
4
|
export class ZSelect {
|
|
5
5
|
constructor() {
|
|
6
6
|
/** the id of the input element */
|
|
@@ -87,14 +87,11 @@ export class ZSelect {
|
|
|
87
87
|
return (_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.id;
|
|
88
88
|
}
|
|
89
89
|
getOptionId(item) {
|
|
90
|
-
return `${this.htmlid}_key_${item.id}`;
|
|
90
|
+
return `${this.htmlid}_key_${encodeString(item.id)}`;
|
|
91
91
|
}
|
|
92
92
|
getResetOptionId() {
|
|
93
93
|
return `${this.htmlid}_key_reset`;
|
|
94
94
|
}
|
|
95
|
-
getItemIdFromOptionId(optionId) {
|
|
96
|
-
return optionId.replace(`${this.htmlid}_key_`, ``);
|
|
97
|
-
}
|
|
98
95
|
getGroupedItems() {
|
|
99
96
|
if (!this.itemsList.length) {
|
|
100
97
|
return [];
|
|
@@ -224,8 +221,7 @@ export class ZSelect {
|
|
|
224
221
|
this.handleResetClick();
|
|
225
222
|
}
|
|
226
223
|
else {
|
|
227
|
-
const
|
|
228
|
-
const item = this.itemsList.find((e) => e.id === itemId) || null;
|
|
224
|
+
const item = this.itemsList.find((e) => this.getOptionId(e) === this.focusedItemId) || null;
|
|
229
225
|
if (item) {
|
|
230
226
|
this.selectedItem = item;
|
|
231
227
|
this.emitOptionSelect();
|
|
@@ -469,7 +465,7 @@ export class ZSelect {
|
|
|
469
465
|
return (h("z-input-message", { message: boolean(this.message) === true ? undefined : this.message, status: this.status, class: this.size, disabled: this.disabled }));
|
|
470
466
|
}
|
|
471
467
|
render() {
|
|
472
|
-
return (h("div", { key: '
|
|
468
|
+
return (h("div", { key: 'd185176ecce45cde5970a2dceb27065ef27512cb', class: "select-wrapper" }, this.renderInput(), this.renderSelectUl(), this.renderMessage()));
|
|
473
469
|
}
|
|
474
470
|
static get is() { return "z-select"; }
|
|
475
471
|
static get encapsulation() { return "scoped"; }
|
|
@@ -267,3 +267,8 @@ export const getPlainText = (html) => {
|
|
|
267
267
|
const doc = new DOMParser().parseFromString(html, "text/html");
|
|
268
268
|
return doc.body.textContent || "";
|
|
269
269
|
};
|
|
270
|
+
/** Convert string to hex */
|
|
271
|
+
export const encodeString = (string) => string
|
|
272
|
+
.split("")
|
|
273
|
+
.map((c) => c.charCodeAt(0).toString(16))
|
|
274
|
+
.join("");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as t,HTMLElement as e,createEvent as i,h as o,Host as s,transformTag as n}from"@stencil/core/internal/client";import{e as a,B as r,g as l}from"./index2.js";import{r as h,m as d}from"./utils.js";import{d as b}from"./index5.js";import{d as f}from"./index6.js";import{d as c}from"./index3.js";import{d as g}from"./index7.js";import{d as v}from"./index8.js";import{d as m}from"./index9.js";import{d as p}from"./index10.js";import{d as z}from"./index11.js";import{d as u}from"./index14.js";const w=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.searchSubmit=i(this,"searchSubmit",7),this.searchTyping=i(this,"searchTyping",7),this.searchItemClick=i(this,"searchItemClick",7),this.htmlid=`searchbar-${h()}`,this.preventSubmit=!1,this.autocomplete=!1,this.autocompleteMinChars=3,this.searchHelperLabel="Cerca {searchString}",this.sortResultsItems=!1,this.showSearchButton=!1,this.searchButtonIconOnly=!1,this.size=a.BIG,this.variant=r.PRIMARY,this.searchString=this.value,this.currResultsCount=this.resultsCount,this.showResults=!1,this.isMobile=!1,this.resultsItemsList=null}emitSearchItemClick(t){this.searchItemClick.emit(t),this.selectedItem=t,this.searchString=""}emitSearchSubmit(){this.searchSubmit.emit(this.inputRef.value)}watchItems(){this.resultsItemsList=this.getResultsItemsList()}watchResultsCount(){this.currResultsCount=this.resultsCount}watchValue(){this.searchString=this.value}watchSearchString(){this.searchTyping.emit(this.searchString),this.searchString||(this.currResultsCount=this.resultsCount)}getResultsItemsList(){return"string"==typeof this.resultsItems?JSON.parse(this.resultsItems):this.resultsItems}getGroupedItems(){const t={};return this.resultsItemsList.forEach((e=>{var i;const o=`${null==e?void 0:e.category}${null==e?void 0:e.subcategory}`;t[o]=null!==(i=t[o])&&void 0!==i?i:{category:null==e?void 0:e.category,subcategory:null==e?void 0:e.subcategory,items:[]},t[o].items.push(e)})),this.sortResultsItems?Object.keys(t).sort().reduce(((e,i)=>(e[i]=Object.assign(Object.assign({},t[i]),{items:t[i].items.sort(((t,e)=>{const i=t.label.toUpperCase(),o=e.label.toUpperCase();return i<o?-1:i>o?1:0}))}),e)),{}):t}onListItemKeyDown(t,e){if(t.key===l.ENTER)return t.preventDefault(),void this.emitSearchItemClick(e);this.handleArrowsNavigation(t)}onSearchHelperKeyDown(t){if(t.key===l.ENTER)return t.preventDefault(),void this.emitSearchSubmit();this.handleArrowsNavigation(t)}handleArrowsNavigation(t){var e,i,o,s,n,a;if(![l.ARROW_DOWN,l.ARROW_UP].includes(t.key))return;const r=t.target,h=Array.from(null!==(i=null===(e=this.host.shadowRoot)||void 0===e?void 0:e.querySelectorAll("z-list .list-item"))&&void 0!==i?i:[]),d=h.indexOf(r);if(t.key===l.ARROW_DOWN){t.preventDefault();const e=d+1;e<h.length&&h[e].focus()}if(t.key===l.ARROW_UP){t.preventDefault();const e=d-1;e<0&&(null===(s=null===(o=this.host.shadowRoot)||void 0===o?void 0:o.querySelector("input"))||void 0===s||s.focus(),null===(a=null===(n=this.host.shadowRoot)||void 0===n?void 0:n.querySelector("input"))||void 0===a||a.setSelectionRange(this.inputRef.value.length,this.inputRef.value.length)),e>=0&&h[e].focus()}}handleStopTyping(t){t.stopPropagation(),this.searchString=t.detail.value,this.selectedItem=void 0}handleSubmit(){this.preventSubmit||this.emitSearchSubmit()}handleOutsideClick(t){t.composedPath().includes(this.host)||(this.showResults=!1)}componentWillLoad(){this.resultsItemsList=this.getResultsItemsList(),this.mql=matchMedia("(max-width: 767px)"),this.onMobileViewChange=t=>this.isMobile=t.matches,this.mql.addEventListener("change",this.onMobileViewChange),this.isMobile=this.mql.matches}disconnectedCallback(){var t;null===(t=this.mql)||void 0===t||t.removeEventListener("change",this.onMobileViewChange)}renderItemLabel(t){return this.searchString?t.replace(new RegExp(this.searchString.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gmi"),(t=>`<mark>${t}</mark>`)):t}renderItem(t,e){var i;return o("z-list-element",{id:`list-item-${this.htmlid}-${e}`,role:"presentation",htmlTabindex:-1,onKeyDown:e=>this.onListItemKeyDown(e,t),onClick:()=>this.emitSearchItemClick(t)},o("div",{class:"list-item ellipsis",role:"option",tabindex:0},!!(null==t?void 0:t.icon)&&o("z-icon",{class:"item-icon",name:t.icon}),o("div",{class:"item-label body-3 mobile-body-4",title:t.label,innerHTML:this.renderItemLabel(t.label)}),!!(null==t?void 0:t.tag)&&o("z-tag",{icon:t.tag.icon},this.isMobile?"":t.tag.text)),!!(null===(i=t.children)||void 0===i?void 0:i.length)&&o("z-list",{class:"sub-list",role:"group","aria-label":t.label||void 0},t.children.map(((t,e)=>this.renderItem(t,e)))))}renderItemGroups(){var t;if(!(null===(t=this.resultsItemsList)||void 0===t?void 0:t.length))return;const e=Object.values(this.getGroupedItems()),i=[],s=!!this.currResultsCount;let n=0;for(const t of e){const e=s?this.currResultsCount-n:t.items.length;if(e<=0)break;const a=t.items.slice(0,e).map(((t,e)=>this.renderItem(t,e)));if(n+=a.length,!a.length)continue;const r=[t.category,t.subcategory].filter(Boolean).join(" ");i.push(o("z-list-group",{"aria-label":r||void 0},t.category&&o("z-list-element",{class:"category-heading body-3 mobile-body-4",slot:"header-title",role:"presentation",htmlTabindex:-1},o("div",{class:"category"},t.category),t.subcategory&&o("div",{class:"subcategory"},t.subcategory)),a))}return i}render(){var t,e,i,n,a;return o(s,{key:"ef0ac81207a219b31d80fd2091070deea1f4314a",onFocus:()=>this.showResults=!0,onClick:t=>this.handleOutsideClick(t),class:{"has-submit":!!this.showSearchButton,"has-results":!!this.autocomplete}},o("div",{key:"cb73f19a10f7c26ef0f627916fb8d7dd6a28409c",class:"input-container"},o("z-input",{key:"11c8ec74157a8a6a278d1e7928b6c819167ff3f4",ref:t=>this.inputRef=t,htmlid:`input-${this.htmlid}`,message:!1,placeholder:this.placeholder,onStopTyping:t=>this.handleStopTyping(t),onKeyUp:t=>{d(t,(()=>this.handleSubmit())),this.handleArrowsNavigation(t)},onFocus:()=>this.showResults=!0,value:this.searchString||(null===(t=this.selectedItem)||void 0===t?void 0:t.label),size:this.size,label:this.label,"aria-label":this.htmlAriaLabel||this.placeholder||void 0}),!!(this.showResults&&this.autocomplete&&this.searchString&&this.searchString.length>=this.autocompleteMinChars&&this.resultsItemsList)&&o("div",{key:"072a63a8d3f91b4325c53c0ec56fa90f925199f2",class:"results z-scrollbar"},this.preventSubmit&&!(null===(e=this.resultsItemsList)||void 0===e?void 0:e.length)?o("div",{class:"item-no-results body-3 mobile-body-4"},"Non abbiamo trovato risultati per ",o("b",null,this.searchString),o("br",null),o("br",null),"Cosa puoi fare?",o("ul",null,o("li",null,"Verificare di aver scritto bene"),o("li",null,"Provare a cercare un'altra parola"),o("li",null,"Provare a cercare qualcosa di più generico"))):o("z-list",{role:"listbox",id:`list-${this.htmlid}`,"aria-label":this.htmlAriaLabel||this.label||void 0},this.autocomplete&&!this.preventSubmit&&!!this.searchString&&o("z-list-element",{role:"presentation",htmlTabindex:-1,id:`list-item-${this.htmlid}-search`,onKeyDown:t=>this.onSearchHelperKeyDown(t),onClick:()=>this.emitSearchSubmit()},o("div",{class:"list-item item-search",role:"option",tabindex:0},o("z-icon",{class:"search-icon",name:"left-magnifying-glass"}),o("div",{class:"item-label body-3 mobile-body-4",innerHTML:null===(i=this.searchHelperLabel)||void 0===i?void 0:i.replace("{searchString}",`<mark>${this.searchString}</mark>`)}))),this.renderItemGroups(),!!(this.searchString&&(null===(n=this.resultsItemsList)||void 0===n?void 0:n.length)&&this.currResultsCount&&this.currResultsCount<(null===(a=this.resultsItemsList)||void 0===a?void 0:a.length))&&o("z-list-element",{role:"presentation",htmlTabindex:-1,id:`list-item-${this.htmlid}-show-all`},o("div",{role:"option",class:"item-show-all body-3 mobile-body-4",tabindex:0,onClick:()=>this.currResultsCount=void 0},"Vedi tutti i risultati"))))),this.showSearchButton&&o("z-button",{key:"c839b4c5fa6d46f28f9ab83e0a02b1bc3d9594bf",icon:this.searchButtonIconOnly?"search":void 0,"aria-label":this.searchButtonIconOnly?"CERCA":void 0,disabled:!!this.preventSubmit,variant:this.variant,size:this.size,onClick:()=>this.handleSubmit()},this.searchButtonIconOnly?"":"CERCA"))}get host(){return this}static get watchers(){return{resultsItems:[{watchItems:0}],resultsCount:[{watchResultsCount:0}],value:[{watchValue:0}],searchString:[{watchSearchString:0}]}}static get style(){return':host{--z-searchbar-tag-text-color:var(--color-primary03);--z-searchbar-tag-bg:var(--color-hover-primary);--z-searchbar-item-height:2.75rem;z-index:15;display:flex;column-gap:calc(var(--space-unit) * 2);font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host,*,::after,::before{box-sizing:border-box}.input-container{position:relative;display:flex;width:100%;flex-direction:column}.input-container z-input{z-index:1}.results{--item-icon-size:1rem;--z-icon-height:var(--item-icon-size);--z-icon-width:var(--item-icon-size);--item-inline-padding:calc(var(--space-unit) * 1.5);--item-col-gap:var(--space-unit);position:absolute;top:calc(100% - 1px);left:0;overflow:auto;width:100%;max-height:var(--z-searchbar-results-height, 540px);border:var(--border-size-small) solid var(--color-form-surface03);border-top:none;background:var(--color-form-background)}.results z-list-element{--background-color-list-element:var(--color-form-background);position:relative;display:block}.results>z-list>z-list-element::part(list-item-container){padding:0 var(--item-inline-padding)}.results z-list-element>.list-item{position:relative;display:flex;align-items:center;padding:calc(var(--space-unit) * 1.25) calc(var(--space-unit) / 4);background-color:transparent;color:var(--color-form-default-text);fill:var(--color-form-default-icon);gap:var(--item-col-gap)}.results z-list-element>.list-item:hover{background-color:var(--gray100);cursor:pointer}.results z-list-element>.list-item:focus-visible{z-index:1;box-shadow:var(--shadow-focus-primary);outline:none}.results>z-list>z-list-element:not(:last-child)>.list-item,.results z-list-group:not(:last-child)>z-list-element:not(.category-heading){border-bottom:1px solid var(--color-form-surface03)}.results z-list-group{padding:0 var(--item-inline-padding)}.results z-list-group>z-list-element::part(list-item-container){padding:0}.results .sub-list{padding-left:calc(var(--item-icon-size) + var(--item-col-gap))}.results .sub-list z-list-element::part(list-item-container){padding:0}.results .sub-list z-list-element>.list-item{position:relative}.results .sub-list>z-list-element:not(:last-child)::before,.results .sub-list>z-list-element>.list-item::before{position:absolute;top:0;left:calc(0px - var(--item-col-gap) - var(--item-icon-size) / 2 + 1px);border-left:1px solid var(--color-form-surface03);content:""}.results .sub-list>z-list-element:not(:last-child)::before{top:-4px;height:calc(100% + 4px)}.results .sub-list z-list-element>.list-item::before{width:14px;height:calc(var(--z-searchbar-item-height) / 2);border-bottom:1px solid var(--color-form-surface03)}.results .category-heading>.category{font-style:italic}.results .category-heading>.subcategory{text-transform:uppercase}.results z-list-element>.list-item .ellipsis{overflow:hidden}.results .ellipsis>.item-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.results .item-label mark{background:var(--color-primary03);color:var(--color-default-text)}.results .list-item>z-tag{--z-tag-bg:var(--z-searchbar-tag-bg);--z-tag-text-color:var(--z-searchbar-tag-text-color);margin-left:auto;white-space:nowrap}.results .item-show-all{width:100%;color:var(--color-primary01);cursor:pointer;text-align:center}.results .item-no-results{display:block;font-style:italic}.results .item-no-results>ul{padding-left:calc(var(--space-unit) * 2);margin:var(--space-unit)}@media (min-width: 768px){.results{--item-icon-size:1.125rem}}.z-label{display:block;padding-bottom:var(--space-unit);color:var(--color-default-text);font-family:var(--font-family-sans);font-size:var(--font-size-1);font-weight:var(--font-sb);text-align:left;text-transform:uppercase}.z-scrollbar::-webkit-scrollbar{width:6px;background:linear-gradient(to right, transparent 0 1px, var(--gray200) 1px 5px, transparent 5px 6px)}.z-scrollbar::-webkit-scrollbar-thumb{background-color:var(--color-primary01)}.z-scrollbar::-webkit-scrollbar-thumb:hover{background-color:var(--color-hover-primary)}:host([theme="dark"]) .z-scrollbar,.z-scrollbar--dark{--z-scrollbar-track-gradient:linear-gradient( to right, transparent 0 1px, var(--gray600) 1px 5px, transparent 5px 6px );--z-scrollbar-track-color:var(--gray600);--z-scrollbar-thumb-color:var(--color-primary03);--z-scrollbar-thumb-hover-color:var(--color-hover-primary);--z-scrollbar-corner-color:transparent}@supports not selector(.z-scrollbar::-webkit-scrollbar-track){.z-scrollbar{scrollbar-color:var(--color-primary01) transparent}:host([theme="dark"]) .z-scrollbar,.z-scrollbar--dark{scrollbar-color:var(--z-scrollbar-thumb-color, var(--color-primary03)) var(--z-scrollbar-track-color, var(--gray600))}}:root{--font-family-sans:"IBM Plex Sans", sans-serif;--font-family-serif:"IBM Plex Serif", serif;--font-lt:300;--font-rg:400;--font-sb:600;--font-bd:700;--font-size-1:0.75rem;--font-size-2:0.875rem;--font-size-3:1rem;--font-size-4:1.125rem;--font-size-5:1.25rem;--font-size-6:1.5rem;--font-size-7:1.75rem;--font-size-8:2rem;--font-size-9:2.25rem;--font-size-10:2.625rem;--font-size-11:3rem;--font-size-12:3.375rem;--font-size-13:3.75rem;--font-size-14:4.25rem;--font-size-15:4.75rem;--font-size-16:5.25rem;--font-size-17:5.75rem;--section-title-1:var(--font-sb) var(--font-size-11) / 1.083 var(--font-family-serif);--section-title-2:var(--font-sb) var(--font-size-10) / 1.142 var(--font-family-serif);--section-title-3:var(--font-sb) var(--font-size-9) / 1.222 var(--font-family-serif);--section-title-4:var(--font-sb) var(--font-size-8) / 1.25 var(--font-family-serif);--section-title-5:var(--font-sb) var(--font-size-7) / 1.2857 var(--font-family-serif);--section-title-6:var(--font-sb) var(--font-size-6) / 1.333 var(--font-family-serif)}.heading-1,.heading-1-sb,.heading-1-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.heading-2,.heading-2-sb,.heading-2-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.heading-3,.heading-3-sb,.heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.heading-4,.heading-4-sb,.heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.body-1,.body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.body-2,.body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.body-3,.body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.body-4,.body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.body-5,.body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.interactive-1,.interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.interactive-2,.interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.interactive-3,.interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.helper,.helper-sb{font-size:var(--font-size-1);font-style:italic;font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.section-title-1{font:var(--section-title-1)}.section-title-2{font:var(--section-title-2)}.section-title-3{font:var(--section-title-3)}.section-title-4{font:var(--section-title-4)}.section-title-5{font:var(--section-title-5)}.section-title-6{font:var(--section-title-6)}@media (min-width: 1152px){.heading-1,.heading-1-sb,.heading-1-lt{font-size:var(--font-size-8);font-weight:var(--font-rg);line-height:1.25}.heading-2,.heading-2-sb,.heading-2-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}}@media (max-width: 767px){.mobile-heading-1,.mobile-heading-1-sb,.mobile-heading-1-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.mobile-heading-2,.mobile-heading-2-sb,.mobile-heading-2-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.mobile-heading-3,.mobile-heading-3-sb,.mobile-heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.mobile-heading-4,.mobile-heading-4-sb,.mobile-heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.mobile-body-1,.mobile-body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.mobile-body-2,.mobile-body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.mobile-body-3,.mobile-body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.mobile-body-4,.mobile-body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.mobile-body-5,.mobile-body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.mobile-interactive-1,.mobile-interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.mobile-interactive-2,.mobile-interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.mobile-interactive-3,.mobile-interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.mobile-section-title-1{font:var(--section-title-1)}.mobile-section-title-2{font:var(--section-title-2)}.mobile-section-title-3{font:var(--section-title-3)}.mobile-section-title-4{font:var(--section-title-4)}.mobile-section-title-5{font:var(--section-title-5)}.mobile-section-title-6{font:var(--section-title-6)}.mobile-heading-1-lt,.mobile-heading-2-lt,.mobile-heading-3-lt,.mobile-heading-4-lt{font-weight:var(--font-lt)}.mobile-heading-1-sb,.mobile-heading-2-sb,.mobile-heading-3-sb,.mobile-heading-4-sb,.mobile-body-1-sb,.mobile-body-2-sb,.mobile-body-3-sb,.mobile-body-4-sb,.mobile-body-5-sb,.mobile-interactive-1-sb,.mobile-interactive-2-sb,.mobile-interactive-3-sb{font-weight:var(--font-sb)}}@media (min-width: 768px) and (max-width: 1151px){.tablet-heading-1,.tablet-heading-1-sb,.tablet-heading-1-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.tablet-heading-2,.tablet-heading-2-sb,.tablet-heading-2-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.tablet-heading-3,.tablet-heading-3-sb,.tablet-heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.tablet-heading-4,.tablet-heading-4-sb,.tablet-heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.tablet-body-1,.tablet-body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.tablet-body-2,.tablet-body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.tablet-body-3,.tablet-body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.tablet-body-4,.tablet-body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.tablet-body-5,.tablet-body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.tablet-interactive-1,.tablet-interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.tablet-interactive-2,.tablet-interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.tablet-interactive-3,.tablet-interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.tablet-section-title-1{font:var(--section-title-1)}.tablet-section-title-2{font:var(--section-title-2)}.tablet-section-title-3{font:var(--section-title-3)}.tablet-section-title-4{font:var(--section-title-4)}.tablet-section-title-5{font:var(--section-title-5)}.tablet-section-title-6{font:var(--section-title-6)}.tablet-heading-1-lt,.tablet-heading-2-lt,.tablet-heading-3-lt,.tablet-heading-4-lt{font-weight:var(--font-lt)}.tablet-heading-1-sb,.tablet-heading-2-sb,.tablet-heading-3-sb,.tablet-heading-4-sb,.tablet-body-1-sb,.tablet-body-2-sb,.tablet-body-3-sb,.tablet-body-4-sb,.tablet-body-5-sb,.tablet-interactive-1-sb,.tablet-interactive-2-sb,.tablet-interactive-3-sb{font-weight:var(--font-sb)}}@media (min-width: 1152px) and (max-width: 1365px){.desktop-heading-1,.desktop-heading-1-sb,.desktop-heading-1-lt{font-size:var(--font-size-8);font-weight:var(--font-rg);line-height:1.25}.desktop-heading-2,.desktop-heading-2-sb,.desktop-heading-2-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.desktop-heading-3,.desktop-heading-3-sb,.desktop-heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.desktop-heading-4,.desktop-heading-4-sb,.desktop-heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.desktop-body-1,.desktop-body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.desktop-body-2,.desktop-body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.desktop-body-3,.desktop-body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.desktop-body-4,.desktop-body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.desktop-body-5,.desktop-body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.desktop-interactive-1,.desktop-interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.desktop-interactive-2,.desktop-interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.desktop-interactive-3,.desktop-interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.desktop-section-title-1{font:var(--section-title-1)}.desktop-section-title-2{font:var(--section-title-2)}.desktop-section-title-3{font:var(--section-title-3)}.desktop-section-title-4{font:var(--section-title-4)}.desktop-section-title-5{font:var(--section-title-5)}.desktop-section-title-6{font:var(--section-title-6)}.desktop-heading-1-lt,.desktop-heading-2-lt,.desktop-heading-3-lt,.desktop-heading-4-lt{font-weight:var(--font-lt)}.desktop-heading-1-sb,.desktop-heading-2-sb,.desktop-heading-3-sb,.desktop-heading-4-sb,.desktop-body-1-sb,.desktop-body-2-sb,.desktop-body-3-sb,.desktop-body-4-sb,.desktop-body-5-sb,.desktop-interactive-1-sb,.desktop-interactive-2-sb,.desktop-interactive-3-sb{font-weight:var(--font-sb)}}@media (min-width: 1366px){.wide-heading-1,.wide-heading-1-sb,.wide-heading-1-lt{font-size:var(--font-size-8);font-weight:var(--font-rg);line-height:1.25}.wide-heading-2,.wide-heading-2-sb,.wide-heading-2-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.wide-heading-3,.wide-heading-3-sb,.wide-heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.wide-heading-4,.wide-heading-4-sb,.wide-heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.wide-body-1,.wide-body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.wide-body-2,.wide-body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.wide-body-3,.wide-body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.wide-body-4,.wide-body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.wide-body-5,.wide-body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.wide-interactive-1,.wide-interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.wide-interactive-2,.wide-interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.wide-interactive-3,.wide-interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.wide-section-title-1{font:var(--section-title-1)}.wide-section-title-2{font:var(--section-title-2)}.wide-section-title-3{font:var(--section-title-3)}.wide-section-title-4{font:var(--section-title-4)}.wide-section-title-5{font:var(--section-title-5)}.wide-section-title-6{font:var(--section-title-6)}.wide-heading-1-lt,.wide-heading-2-lt,.wide-heading-3-lt,.wide-heading-4-lt{font-weight:var(--font-lt)}.wide-heading-1-sb,.wide-heading-2-sb,.wide-heading-3-sb,.wide-heading-4-sb,.wide-body-1-sb,.wide-body-2-sb,.wide-body-3-sb,.wide-body-4-sb,.wide-body-5-sb,.wide-interactive-1-sb,.wide-interactive-2-sb,.wide-interactive-3-sb{font-weight:var(--font-sb)}}.heading-1-lt,.heading-2-lt,.heading-3-lt,.heading-4-lt{font-weight:var(--font-lt)}.heading-1-sb,.heading-2-sb,.heading-3-sb,.heading-4-sb,.body-1-sb,.body-2-sb,.body-3-sb,.body-4-sb,.body-5-sb,.interactive-1-sb,.interactive-2-sb,.interactive-3-sb,.helper-sb{font-weight:var(--font-sb)}'}},[1,"z-searchbar",{htmlid:[513],preventSubmit:[4,"prevent-submit"],label:[1],htmlAriaLabel:[1,"html-aria-label"],value:[1],placeholder:[1],autocomplete:[4],autocompleteMinChars:[2,"autocomplete-min-chars"],resultsCount:[2,"results-count"],searchHelperLabel:[1,"search-helper-label"],resultsItems:[1,"results-items"],sortResultsItems:[4,"sort-results-items"],showSearchButton:[4,"show-search-button"],searchButtonIconOnly:[4,"search-button-icon-only"],size:[1],variant:[1],searchString:[32],currResultsCount:[32],showResults:[32],isMobile:[32],selectedItem:[32]},[[4,"click","handleOutsideClick"]],{resultsItems:[{watchItems:0}],resultsCount:[{watchResultsCount:0}],value:[{watchValue:0}],searchString:[{watchSearchString:0}]}]);function y(){"undefined"!=typeof customElements&&["z-searchbar","z-button","z-divider","z-icon","z-input","z-input-message","z-list","z-list-element","z-list-group","z-tag"].forEach((t=>{switch(t){case"z-searchbar":customElements.get(n(t))||customElements.define(n(t),w);break;case"z-button":customElements.get(n(t))||b();break;case"z-divider":customElements.get(n(t))||f();break;case"z-icon":customElements.get(n(t))||c();break;case"z-input":customElements.get(n(t))||g();break;case"z-input-message":customElements.get(n(t))||v();break;case"z-list":customElements.get(n(t))||m();break;case"z-list-element":customElements.get(n(t))||p();break;case"z-list-group":customElements.get(n(t))||z();break;case"z-tag":customElements.get(n(t))||u()}}))}export{w as Z,y as d}
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as e,createEvent as i,h as o,Host as s,transformTag as n}from"@stencil/core/internal/client";import{e as a,B as r,g as l}from"./index2.js";import{r as h,n as d}from"./utils.js";import{d as b}from"./index5.js";import{d as c}from"./index6.js";import{d as f}from"./index3.js";import{d as g}from"./index7.js";import{d as v}from"./index8.js";import{d as m}from"./index9.js";import{d as p}from"./index10.js";import{d as z}from"./index11.js";import{d as u}from"./index14.js";const w=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.searchSubmit=i(this,"searchSubmit",7),this.searchTyping=i(this,"searchTyping",7),this.searchItemClick=i(this,"searchItemClick",7),this.htmlid=`searchbar-${h()}`,this.preventSubmit=!1,this.autocomplete=!1,this.autocompleteMinChars=3,this.searchHelperLabel="Cerca {searchString}",this.sortResultsItems=!1,this.showSearchButton=!1,this.searchButtonIconOnly=!1,this.searchButtonLabel="CERCA",this.size=a.BIG,this.variant=r.PRIMARY,this.searchString=this.value,this.currResultsCount=this.resultsCount,this.showResults=!1,this.isMobile=!1,this.resultsItemsList=null}emitSearchItemClick(t){this.searchItemClick.emit(t),this.selectedItem=t,this.searchString=""}emitSearchSubmit(){this.searchSubmit.emit(this.inputRef.value)}watchItems(){this.resultsItemsList=this.getResultsItemsList()}watchResultsCount(){this.currResultsCount=this.resultsCount}watchValue(){this.searchString=this.value}watchSearchString(){this.searchTyping.emit(this.searchString),this.searchString||(this.currResultsCount=this.resultsCount)}getResultsItemsList(){return"string"==typeof this.resultsItems?JSON.parse(this.resultsItems):this.resultsItems}getGroupedItems(){const t={};return this.resultsItemsList.forEach((e=>{var i;const o=`${null==e?void 0:e.category}${null==e?void 0:e.subcategory}`;t[o]=null!==(i=t[o])&&void 0!==i?i:{category:null==e?void 0:e.category,subcategory:null==e?void 0:e.subcategory,items:[]},t[o].items.push(e)})),this.sortResultsItems?Object.keys(t).sort().reduce(((e,i)=>(e[i]=Object.assign(Object.assign({},t[i]),{items:t[i].items.sort(((t,e)=>{const i=t.label.toUpperCase(),o=e.label.toUpperCase();return i<o?-1:i>o?1:0}))}),e)),{}):t}onListItemKeyDown(t,e){if(t.key===l.ENTER)return t.preventDefault(),void this.emitSearchItemClick(e);this.handleArrowsNavigation(t)}onSearchHelperKeyDown(t){if(t.key===l.ENTER)return t.preventDefault(),void this.emitSearchSubmit();this.handleArrowsNavigation(t)}handleArrowsNavigation(t){var e,i,o,s,n,a;if(![l.ARROW_DOWN,l.ARROW_UP].includes(t.key))return;const r=t.target,h=Array.from(null!==(i=null===(e=this.host.shadowRoot)||void 0===e?void 0:e.querySelectorAll("z-list .list-item"))&&void 0!==i?i:[]),d=h.indexOf(r);if(t.key===l.ARROW_DOWN){t.preventDefault();const e=d+1;e<h.length&&h[e].focus()}if(t.key===l.ARROW_UP){t.preventDefault();const e=d-1;e<0&&(null===(s=null===(o=this.host.shadowRoot)||void 0===o?void 0:o.querySelector("input"))||void 0===s||s.focus(),null===(a=null===(n=this.host.shadowRoot)||void 0===n?void 0:n.querySelector("input"))||void 0===a||a.setSelectionRange(this.inputRef.value.length,this.inputRef.value.length)),e>=0&&h[e].focus()}}handleStopTyping(t){t.stopPropagation(),this.searchString=t.detail.value,this.selectedItem=void 0}handleSubmit(){this.preventSubmit||this.emitSearchSubmit()}handleOutsideClick(t){t.composedPath().includes(this.host)||(this.showResults=!1)}componentWillLoad(){this.resultsItemsList=this.getResultsItemsList(),this.mql=matchMedia("(max-width: 767px)"),this.onMobileViewChange=t=>this.isMobile=t.matches,this.mql.addEventListener("change",this.onMobileViewChange),this.isMobile=this.mql.matches}disconnectedCallback(){var t;null===(t=this.mql)||void 0===t||t.removeEventListener("change",this.onMobileViewChange)}renderItemLabel(t){return this.searchString?t.replace(new RegExp(this.searchString.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gmi"),(t=>`<mark>${t}</mark>`)):t}renderItem(t,e){var i;return o("z-list-element",{id:`list-item-${this.htmlid}-${e}`,role:"presentation",htmlTabindex:-1,onKeyDown:e=>this.onListItemKeyDown(e,t),onClick:()=>this.emitSearchItemClick(t)},o("div",{class:"list-item ellipsis",role:"option",tabindex:0},!!(null==t?void 0:t.icon)&&o("z-icon",{class:"item-icon",name:t.icon}),o("div",{class:"item-label body-3 mobile-body-4",title:t.label,innerHTML:this.renderItemLabel(t.label)}),!!(null==t?void 0:t.tag)&&o("z-tag",{icon:t.tag.icon},this.isMobile?"":t.tag.text)),!!(null===(i=t.children)||void 0===i?void 0:i.length)&&o("z-list",{class:"sub-list",role:"group","aria-label":t.label||void 0},t.children.map(((t,e)=>this.renderItem(t,e)))))}renderItemGroups(){var t;if(!(null===(t=this.resultsItemsList)||void 0===t?void 0:t.length))return;const e=Object.values(this.getGroupedItems()),i=[],s=!!this.currResultsCount;let n=0;for(const t of e){const e=s?this.currResultsCount-n:t.items.length;if(e<=0)break;const a=t.items.slice(0,e).map(((t,e)=>this.renderItem(t,e)));if(n+=a.length,!a.length)continue;const r=[t.category,t.subcategory].filter(Boolean).join(" ");i.push(o("z-list-group",{"aria-label":r||void 0},t.category&&o("z-list-element",{class:"category-heading body-3 mobile-body-4",slot:"header-title",role:"presentation",htmlTabindex:-1},o("div",{class:"category"},t.category),t.subcategory&&o("div",{class:"subcategory"},t.subcategory)),a))}return i}render(){var t,e,i,n,a;return o(s,{key:"cf8441e139a28aa53bd6d61c4b17a12739998d59",onFocus:()=>this.showResults=!0,onClick:t=>this.handleOutsideClick(t),class:{"has-submit":!!this.showSearchButton,"has-results":!!this.autocomplete}},o("div",{key:"b24a5060ef65a27fa1096ca0056f1f2d566c9aca",class:"input-container"},o("z-input",{key:"fa2648f2a11a83dedbd9c1c5d00712675713936d",ref:t=>this.inputRef=t,htmlid:`input-${this.htmlid}`,message:!1,placeholder:this.placeholder,onStopTyping:t=>this.handleStopTyping(t),onKeyUp:t=>{d(t,(()=>this.handleSubmit())),this.handleArrowsNavigation(t)},onFocus:()=>this.showResults=!0,value:this.searchString||(null===(t=this.selectedItem)||void 0===t?void 0:t.label),size:this.size,label:this.label,"aria-label":this.htmlAriaLabel||this.placeholder||void 0}),!!(this.showResults&&this.autocomplete&&this.searchString&&this.searchString.length>=this.autocompleteMinChars&&this.resultsItemsList)&&o("div",{key:"060a4065341f54257d85e8989f55f3b6e8fe1505",class:"results z-scrollbar"},this.preventSubmit&&!(null===(e=this.resultsItemsList)||void 0===e?void 0:e.length)?o("div",{class:"item-no-results body-3 mobile-body-4"},"Non abbiamo trovato risultati per ",o("b",null,this.searchString),o("br",null),o("br",null),"Cosa puoi fare?",o("ul",null,o("li",null,"Verificare di aver scritto bene"),o("li",null,"Provare a cercare un'altra parola"),o("li",null,"Provare a cercare qualcosa di più generico"))):o("z-list",{role:"listbox",id:`list-${this.htmlid}`,"aria-label":this.htmlAriaLabel||this.label||void 0},this.autocomplete&&!this.preventSubmit&&!!this.searchString&&o("z-list-element",{role:"presentation",htmlTabindex:-1,id:`list-item-${this.htmlid}-search`,onKeyDown:t=>this.onSearchHelperKeyDown(t),onClick:()=>this.emitSearchSubmit()},o("div",{class:"list-item item-search",role:"option",tabindex:0},o("z-icon",{class:"search-icon",name:"left-magnifying-glass"}),o("div",{class:"item-label body-3 mobile-body-4",innerHTML:null===(i=this.searchHelperLabel)||void 0===i?void 0:i.replace("{searchString}",`<mark>${this.searchString}</mark>`)}))),this.renderItemGroups(),!!(this.searchString&&(null===(n=this.resultsItemsList)||void 0===n?void 0:n.length)&&this.currResultsCount&&this.currResultsCount<(null===(a=this.resultsItemsList)||void 0===a?void 0:a.length))&&o("z-list-element",{role:"presentation",htmlTabindex:-1,id:`list-item-${this.htmlid}-show-all`},o("div",{role:"option",class:"item-show-all body-3 mobile-body-4",tabindex:0,onClick:()=>this.currResultsCount=void 0},"Vedi tutti i risultati"))))),this.showSearchButton&&o("z-button",{key:"e37aec8f5feb61ab23fe0c497a11290d2b121375",icon:this.searchButtonIconOnly?"search":void 0,"aria-label":this.searchButtonIconOnly?this.searchButtonLabel.trim()||"CERCA":void 0,disabled:!!this.preventSubmit,variant:this.variant,size:this.size,onClick:()=>this.handleSubmit()},this.searchButtonIconOnly?"":this.searchButtonLabel.trim()||"CERCA"))}get host(){return this}static get watchers(){return{resultsItems:[{watchItems:0}],resultsCount:[{watchResultsCount:0}],value:[{watchValue:0}],searchString:[{watchSearchString:0}]}}static get style(){return':host{--z-searchbar-tag-text-color:var(--color-primary03);--z-searchbar-tag-bg:var(--color-hover-primary);--z-searchbar-item-height:2.75rem;z-index:15;display:flex;column-gap:calc(var(--space-unit) * 2);font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host,*,::after,::before{box-sizing:border-box}.input-container{position:relative;display:flex;width:100%;flex-direction:column}.input-container z-input{z-index:1}.results{--item-icon-size:1rem;--z-icon-height:var(--item-icon-size);--z-icon-width:var(--item-icon-size);--item-inline-padding:calc(var(--space-unit) * 1.5);--item-col-gap:var(--space-unit);position:absolute;top:calc(100% - 1px);left:0;overflow:auto;width:100%;max-height:var(--z-searchbar-results-height, 540px);border:var(--border-size-small) solid var(--color-form-surface03);border-top:none;background:var(--color-form-background)}.results z-list-element{--background-color-list-element:var(--color-form-background);position:relative;display:block}.results>z-list>z-list-element::part(list-item-container){padding:0 var(--item-inline-padding)}.results z-list-element>.list-item{position:relative;display:flex;align-items:center;padding:calc(var(--space-unit) * 1.25) calc(var(--space-unit) / 4);background-color:transparent;color:var(--color-form-default-text);fill:var(--color-form-default-icon);gap:var(--item-col-gap)}.results z-list-element>.list-item:hover{background-color:var(--gray100);cursor:pointer}.results z-list-element>.list-item:focus-visible{z-index:1;box-shadow:var(--shadow-focus-primary);outline:none}.results>z-list>z-list-element:not(:last-child)>.list-item,.results z-list-group:not(:last-child)>z-list-element:not(.category-heading){border-bottom:1px solid var(--color-form-surface03)}.results z-list-group{padding:0 var(--item-inline-padding)}.results z-list-group>z-list-element::part(list-item-container){padding:0}.results .sub-list{padding-left:calc(var(--item-icon-size) + var(--item-col-gap))}.results .sub-list z-list-element::part(list-item-container){padding:0}.results .sub-list z-list-element>.list-item{position:relative}.results .sub-list>z-list-element:not(:last-child)::before,.results .sub-list>z-list-element>.list-item::before{position:absolute;top:0;left:calc(0px - var(--item-col-gap) - var(--item-icon-size) / 2 + 1px);border-left:1px solid var(--color-form-surface03);content:""}.results .sub-list>z-list-element:not(:last-child)::before{top:-4px;height:calc(100% + 4px)}.results .sub-list z-list-element>.list-item::before{width:14px;height:calc(var(--z-searchbar-item-height) / 2);border-bottom:1px solid var(--color-form-surface03)}.results .category-heading>.category{font-style:italic}.results .category-heading>.subcategory{text-transform:uppercase}.results z-list-element>.list-item .ellipsis{overflow:hidden}.results .ellipsis>.item-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.results .item-label mark{background:var(--color-primary03);color:var(--color-default-text)}.results .list-item>z-tag{--z-tag-bg:var(--z-searchbar-tag-bg);--z-tag-text-color:var(--z-searchbar-tag-text-color);margin-left:auto;white-space:nowrap}.results .item-show-all{width:100%;color:var(--color-primary01);cursor:pointer;text-align:center}.results .item-no-results{display:block;font-style:italic}.results .item-no-results>ul{padding-left:calc(var(--space-unit) * 2);margin:var(--space-unit)}@media (min-width: 768px){.results{--item-icon-size:1.125rem}}.z-label{display:block;padding-bottom:var(--space-unit);color:var(--color-default-text);font-family:var(--font-family-sans);font-size:var(--font-size-1);font-weight:var(--font-sb);text-align:left;text-transform:uppercase}.z-scrollbar::-webkit-scrollbar{width:6px;background:linear-gradient(to right, transparent 0 1px, var(--gray200) 1px 5px, transparent 5px 6px)}.z-scrollbar::-webkit-scrollbar-thumb{background-color:var(--color-primary01)}.z-scrollbar::-webkit-scrollbar-thumb:hover{background-color:var(--color-hover-primary)}:host([theme="dark"]) .z-scrollbar,.z-scrollbar--dark{--z-scrollbar-track-gradient:linear-gradient( to right, transparent 0 1px, var(--gray600) 1px 5px, transparent 5px 6px );--z-scrollbar-track-color:var(--gray600);--z-scrollbar-thumb-color:var(--color-primary03);--z-scrollbar-thumb-hover-color:var(--color-hover-primary);--z-scrollbar-corner-color:transparent}@supports not selector(.z-scrollbar::-webkit-scrollbar-track){.z-scrollbar{scrollbar-color:var(--color-primary01) transparent}:host([theme="dark"]) .z-scrollbar,.z-scrollbar--dark{scrollbar-color:var(--z-scrollbar-thumb-color, var(--color-primary03)) var(--z-scrollbar-track-color, var(--gray600))}}:root{--font-family-sans:"IBM Plex Sans", sans-serif;--font-family-serif:"IBM Plex Serif", serif;--font-lt:300;--font-rg:400;--font-sb:600;--font-bd:700;--font-size-1:0.75rem;--font-size-2:0.875rem;--font-size-3:1rem;--font-size-4:1.125rem;--font-size-5:1.25rem;--font-size-6:1.5rem;--font-size-7:1.75rem;--font-size-8:2rem;--font-size-9:2.25rem;--font-size-10:2.625rem;--font-size-11:3rem;--font-size-12:3.375rem;--font-size-13:3.75rem;--font-size-14:4.25rem;--font-size-15:4.75rem;--font-size-16:5.25rem;--font-size-17:5.75rem;--section-title-1:var(--font-sb) var(--font-size-11) / 1.083 var(--font-family-serif);--section-title-2:var(--font-sb) var(--font-size-10) / 1.142 var(--font-family-serif);--section-title-3:var(--font-sb) var(--font-size-9) / 1.222 var(--font-family-serif);--section-title-4:var(--font-sb) var(--font-size-8) / 1.25 var(--font-family-serif);--section-title-5:var(--font-sb) var(--font-size-7) / 1.2857 var(--font-family-serif);--section-title-6:var(--font-sb) var(--font-size-6) / 1.333 var(--font-family-serif)}.heading-1,.heading-1-sb,.heading-1-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.heading-2,.heading-2-sb,.heading-2-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.heading-3,.heading-3-sb,.heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.heading-4,.heading-4-sb,.heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.body-1,.body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.body-2,.body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.body-3,.body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.body-4,.body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.body-5,.body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.interactive-1,.interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.interactive-2,.interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.interactive-3,.interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.helper,.helper-sb{font-size:var(--font-size-1);font-style:italic;font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.section-title-1{font:var(--section-title-1)}.section-title-2{font:var(--section-title-2)}.section-title-3{font:var(--section-title-3)}.section-title-4{font:var(--section-title-4)}.section-title-5{font:var(--section-title-5)}.section-title-6{font:var(--section-title-6)}@media (min-width: 1152px){.heading-1,.heading-1-sb,.heading-1-lt{font-size:var(--font-size-8);font-weight:var(--font-rg);line-height:1.25}.heading-2,.heading-2-sb,.heading-2-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}}@media (max-width: 767px){.mobile-heading-1,.mobile-heading-1-sb,.mobile-heading-1-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.mobile-heading-2,.mobile-heading-2-sb,.mobile-heading-2-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.mobile-heading-3,.mobile-heading-3-sb,.mobile-heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.mobile-heading-4,.mobile-heading-4-sb,.mobile-heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.mobile-body-1,.mobile-body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.mobile-body-2,.mobile-body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.mobile-body-3,.mobile-body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.mobile-body-4,.mobile-body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.mobile-body-5,.mobile-body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.mobile-interactive-1,.mobile-interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.mobile-interactive-2,.mobile-interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.mobile-interactive-3,.mobile-interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.mobile-section-title-1{font:var(--section-title-1)}.mobile-section-title-2{font:var(--section-title-2)}.mobile-section-title-3{font:var(--section-title-3)}.mobile-section-title-4{font:var(--section-title-4)}.mobile-section-title-5{font:var(--section-title-5)}.mobile-section-title-6{font:var(--section-title-6)}.mobile-heading-1-lt,.mobile-heading-2-lt,.mobile-heading-3-lt,.mobile-heading-4-lt{font-weight:var(--font-lt)}.mobile-heading-1-sb,.mobile-heading-2-sb,.mobile-heading-3-sb,.mobile-heading-4-sb,.mobile-body-1-sb,.mobile-body-2-sb,.mobile-body-3-sb,.mobile-body-4-sb,.mobile-body-5-sb,.mobile-interactive-1-sb,.mobile-interactive-2-sb,.mobile-interactive-3-sb{font-weight:var(--font-sb)}}@media (min-width: 768px) and (max-width: 1151px){.tablet-heading-1,.tablet-heading-1-sb,.tablet-heading-1-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.tablet-heading-2,.tablet-heading-2-sb,.tablet-heading-2-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.tablet-heading-3,.tablet-heading-3-sb,.tablet-heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.tablet-heading-4,.tablet-heading-4-sb,.tablet-heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.tablet-body-1,.tablet-body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.tablet-body-2,.tablet-body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.tablet-body-3,.tablet-body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.tablet-body-4,.tablet-body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.tablet-body-5,.tablet-body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.tablet-interactive-1,.tablet-interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.tablet-interactive-2,.tablet-interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.tablet-interactive-3,.tablet-interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.tablet-section-title-1{font:var(--section-title-1)}.tablet-section-title-2{font:var(--section-title-2)}.tablet-section-title-3{font:var(--section-title-3)}.tablet-section-title-4{font:var(--section-title-4)}.tablet-section-title-5{font:var(--section-title-5)}.tablet-section-title-6{font:var(--section-title-6)}.tablet-heading-1-lt,.tablet-heading-2-lt,.tablet-heading-3-lt,.tablet-heading-4-lt{font-weight:var(--font-lt)}.tablet-heading-1-sb,.tablet-heading-2-sb,.tablet-heading-3-sb,.tablet-heading-4-sb,.tablet-body-1-sb,.tablet-body-2-sb,.tablet-body-3-sb,.tablet-body-4-sb,.tablet-body-5-sb,.tablet-interactive-1-sb,.tablet-interactive-2-sb,.tablet-interactive-3-sb{font-weight:var(--font-sb)}}@media (min-width: 1152px) and (max-width: 1365px){.desktop-heading-1,.desktop-heading-1-sb,.desktop-heading-1-lt{font-size:var(--font-size-8);font-weight:var(--font-rg);line-height:1.25}.desktop-heading-2,.desktop-heading-2-sb,.desktop-heading-2-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.desktop-heading-3,.desktop-heading-3-sb,.desktop-heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.desktop-heading-4,.desktop-heading-4-sb,.desktop-heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.desktop-body-1,.desktop-body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.desktop-body-2,.desktop-body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.desktop-body-3,.desktop-body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.desktop-body-4,.desktop-body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.desktop-body-5,.desktop-body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.desktop-interactive-1,.desktop-interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.desktop-interactive-2,.desktop-interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.desktop-interactive-3,.desktop-interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.desktop-section-title-1{font:var(--section-title-1)}.desktop-section-title-2{font:var(--section-title-2)}.desktop-section-title-3{font:var(--section-title-3)}.desktop-section-title-4{font:var(--section-title-4)}.desktop-section-title-5{font:var(--section-title-5)}.desktop-section-title-6{font:var(--section-title-6)}.desktop-heading-1-lt,.desktop-heading-2-lt,.desktop-heading-3-lt,.desktop-heading-4-lt{font-weight:var(--font-lt)}.desktop-heading-1-sb,.desktop-heading-2-sb,.desktop-heading-3-sb,.desktop-heading-4-sb,.desktop-body-1-sb,.desktop-body-2-sb,.desktop-body-3-sb,.desktop-body-4-sb,.desktop-body-5-sb,.desktop-interactive-1-sb,.desktop-interactive-2-sb,.desktop-interactive-3-sb{font-weight:var(--font-sb)}}@media (min-width: 1366px){.wide-heading-1,.wide-heading-1-sb,.wide-heading-1-lt{font-size:var(--font-size-8);font-weight:var(--font-rg);line-height:1.25}.wide-heading-2,.wide-heading-2-sb,.wide-heading-2-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.wide-heading-3,.wide-heading-3-sb,.wide-heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.wide-heading-4,.wide-heading-4-sb,.wide-heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.wide-body-1,.wide-body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.wide-body-2,.wide-body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.wide-body-3,.wide-body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.wide-body-4,.wide-body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.wide-body-5,.wide-body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.wide-interactive-1,.wide-interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.wide-interactive-2,.wide-interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.wide-interactive-3,.wide-interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.wide-section-title-1{font:var(--section-title-1)}.wide-section-title-2{font:var(--section-title-2)}.wide-section-title-3{font:var(--section-title-3)}.wide-section-title-4{font:var(--section-title-4)}.wide-section-title-5{font:var(--section-title-5)}.wide-section-title-6{font:var(--section-title-6)}.wide-heading-1-lt,.wide-heading-2-lt,.wide-heading-3-lt,.wide-heading-4-lt{font-weight:var(--font-lt)}.wide-heading-1-sb,.wide-heading-2-sb,.wide-heading-3-sb,.wide-heading-4-sb,.wide-body-1-sb,.wide-body-2-sb,.wide-body-3-sb,.wide-body-4-sb,.wide-body-5-sb,.wide-interactive-1-sb,.wide-interactive-2-sb,.wide-interactive-3-sb{font-weight:var(--font-sb)}}.heading-1-lt,.heading-2-lt,.heading-3-lt,.heading-4-lt{font-weight:var(--font-lt)}.heading-1-sb,.heading-2-sb,.heading-3-sb,.heading-4-sb,.body-1-sb,.body-2-sb,.body-3-sb,.body-4-sb,.body-5-sb,.interactive-1-sb,.interactive-2-sb,.interactive-3-sb,.helper-sb{font-weight:var(--font-sb)}'}},[1,"z-searchbar",{htmlid:[513],preventSubmit:[4,"prevent-submit"],label:[1],htmlAriaLabel:[1,"html-aria-label"],value:[1],placeholder:[1],autocomplete:[4],autocompleteMinChars:[2,"autocomplete-min-chars"],resultsCount:[2,"results-count"],searchHelperLabel:[1,"search-helper-label"],resultsItems:[1,"results-items"],sortResultsItems:[4,"sort-results-items"],showSearchButton:[4,"show-search-button"],searchButtonIconOnly:[4,"search-button-icon-only"],searchButtonLabel:[1,"search-button-label"],size:[1],variant:[1],searchString:[32],currResultsCount:[32],showResults:[32],isMobile:[32],selectedItem:[32]},[[4,"click","handleOutsideClick"]],{resultsItems:[{watchItems:0}],resultsCount:[{watchResultsCount:0}],value:[{watchValue:0}],searchString:[{watchSearchString:0}]}]);function y(){"undefined"!=typeof customElements&&["z-searchbar","z-button","z-divider","z-icon","z-input","z-input-message","z-list","z-list-element","z-list-group","z-tag"].forEach((t=>{switch(t){case"z-searchbar":customElements.get(n(t))||customElements.define(n(t),w);break;case"z-button":customElements.get(n(t))||b();break;case"z-divider":customElements.get(n(t))||c();break;case"z-icon":customElements.get(n(t))||f();break;case"z-input":customElements.get(n(t))||g();break;case"z-input-message":customElements.get(n(t))||v();break;case"z-list":customElements.get(n(t))||m();break;case"z-list-element":customElements.get(n(t))||p();break;case"z-list-group":customElements.get(n(t))||z();break;case"z-tag":customElements.get(n(t))||u()}}))}export{w as Z,y as d}
|