@zanichelli/albe-web-components 7.3.2 → 7.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index-e3299e0a.js +6 -30
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/web-components-library.cjs.js +1 -1
- package/dist/cjs/z-app-header_11.cjs.entry.js +1052 -0
- package/dist/cjs/z-dragdrop-area_2.cjs.entry.js +865 -2
- package/dist/cjs/z-menu-section.cjs.entry.js +1 -1
- package/dist/cjs/z-menu.cjs.entry.js +1 -1
- package/dist/collection/components/inputs/z-searchbar/index.js +6 -17
- package/dist/collection/components/inputs/z-searchbar/styles.css +46 -95
- package/dist/collection/components/modal/z-modal/index.js +8 -1
- package/dist/collection/components/modal/z-modal/styles.css +13 -0
- package/dist/collection/components/navigation/z-app-header/index.js +171 -47
- package/dist/collection/components/navigation/z-app-header/index.stories.js +393 -0
- package/dist/collection/components/navigation/z-app-header/styles.css +167 -166
- package/dist/collection/components/navigation/z-menu/index.js +1 -0
- package/dist/collection/components/navigation/z-menu/styles.css +7 -7
- package/dist/collection/components/navigation/z-menu-section/styles.css +8 -9
- package/dist/collection/components/z-offcanvas/index.js +34 -50
- package/dist/esm/index-a2ca4b97.js +6 -30
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{utils-970ac457.js → utils-a52a81ba.js} +1 -1
- package/dist/esm/web-components-library.js +1 -1
- package/dist/esm/z-app-header_11.entry.js +1038 -0
- package/dist/esm/z-chip.entry.js +1 -1
- package/dist/esm/z-combobox.entry.js +1 -1
- package/dist/esm/z-dragdrop-area_2.entry.js +865 -2
- package/dist/esm/z-file-upload.entry.js +1 -1
- package/dist/esm/z-menu-section.entry.js +1 -1
- package/dist/esm/z-menu.entry.js +1 -1
- package/dist/esm/z-myz-card-info.entry.js +1 -1
- package/dist/esm/z-myz-list-item.entry.js +1 -1
- package/dist/esm/z-pocket_3.entry.js +1 -1
- package/dist/esm/z-select.entry.js +1 -1
- package/dist/esm/z-skip-to-content.entry.js +1 -1
- package/dist/esm/z-slideshow.entry.js +1 -1
- package/dist/esm/z-table-header.entry.js +1 -1
- package/dist/esm/z-toggle-switch.entry.js +1 -1
- package/dist/types/components/inputs/z-searchbar/index.d.ts +0 -2
- package/dist/types/components/navigation/z-app-header/index.d.ts +49 -17
- package/dist/types/components/navigation/z-menu/index.d.ts +1 -0
- package/dist/types/components/z-offcanvas/index.d.ts +10 -12
- package/dist/types/components.d.ts +41 -13
- package/dist/web-components-library/index.esm.js +1 -1
- package/dist/web-components-library/{p-1f259ec0.entry.js → p-0bf3a704.entry.js} +1 -1
- package/{www/build/p-d982fc4c.entry.js → dist/web-components-library/p-10e036e4.entry.js} +1 -1
- package/dist/web-components-library/p-161a4e84.entry.js +1 -0
- package/dist/web-components-library/{p-dfc69cc3.js → p-1c6b0e09.js} +1 -1
- package/dist/web-components-library/{p-10625725.entry.js → p-1e71778f.entry.js} +1 -1
- package/dist/web-components-library/{p-068951a7.entry.js → p-1eaef57d.entry.js} +1 -1
- package/dist/web-components-library/p-27441384.entry.js +1 -0
- package/dist/web-components-library/{p-779c8d20.entry.js → p-378e3fd3.entry.js} +1 -1
- package/dist/web-components-library/{p-e2758870.entry.js → p-5c5a2680.entry.js} +1 -1
- package/dist/web-components-library/p-6d377fcb.entry.js +1 -0
- package/{www/build/p-191c9901.entry.js → dist/web-components-library/p-84b23d4b.entry.js} +1 -1
- package/dist/web-components-library/p-8ff45f5f.entry.js +1 -0
- package/dist/web-components-library/p-b36fc3db.entry.js +1 -0
- package/dist/web-components-library/{p-bca446ef.entry.js → p-c9bb584c.entry.js} +1 -1
- package/dist/web-components-library/{p-59b1f1e9.entry.js → p-d986024a.entry.js} +1 -1
- package/dist/web-components-library/p-eefde77a.entry.js +1 -0
- package/dist/web-components-library/web-components-library.esm.js +1 -1
- package/package.json +3 -2
- package/www/build/index.esm.js +1 -1
- package/www/build/{p-1f259ec0.entry.js → p-0bf3a704.entry.js} +1 -1
- package/{dist/web-components-library/p-d982fc4c.entry.js → www/build/p-10e036e4.entry.js} +1 -1
- package/www/build/p-161a4e84.entry.js +1 -0
- package/www/build/{p-dfc69cc3.js → p-1c6b0e09.js} +1 -1
- package/www/build/{p-10625725.entry.js → p-1e71778f.entry.js} +1 -1
- package/www/build/{p-068951a7.entry.js → p-1eaef57d.entry.js} +1 -1
- package/www/build/p-27441384.entry.js +1 -0
- package/www/build/{p-779c8d20.entry.js → p-378e3fd3.entry.js} +1 -1
- package/www/build/{p-e2758870.entry.js → p-5c5a2680.entry.js} +1 -1
- package/www/build/p-6d377fcb.entry.js +1 -0
- package/www/build/p-70021fac.js +1 -0
- package/{dist/web-components-library/p-191c9901.entry.js → www/build/p-84b23d4b.entry.js} +1 -1
- package/www/build/p-8ff45f5f.entry.js +1 -0
- package/www/build/p-b36fc3db.entry.js +1 -0
- package/www/build/{p-bca446ef.entry.js → p-c9bb584c.entry.js} +1 -1
- package/www/build/{p-59b1f1e9.entry.js → p-d986024a.entry.js} +1 -1
- package/www/build/p-eefde77a.entry.js +1 -0
- package/www/build/web-components-library.esm.js +1 -1
- package/www/index.html +1 -1
- package/dist/cjs/z-app-header_2.cjs.entry.js +0 -152
- package/dist/cjs/z-button.cjs.entry.js +0 -43
- package/dist/cjs/z-divider.cjs.entry.js +0 -26
- package/dist/cjs/z-input_2.cjs.entry.js +0 -273
- package/dist/cjs/z-list_3.cjs.entry.js +0 -261
- package/dist/cjs/z-offcanvas.cjs.entry.js +0 -57
- package/dist/cjs/z-searchbar.cjs.entry.js +0 -248
- package/dist/esm/z-app-header_2.entry.js +0 -147
- package/dist/esm/z-button.entry.js +0 -39
- package/dist/esm/z-divider.entry.js +0 -22
- package/dist/esm/z-input_2.entry.js +0 -268
- package/dist/esm/z-list_3.entry.js +0 -255
- package/dist/esm/z-offcanvas.entry.js +0 -53
- package/dist/esm/z-searchbar.entry.js +0 -244
- package/dist/web-components-library/p-1570917d.entry.js +0 -1
- package/dist/web-components-library/p-157aea3b.entry.js +0 -1
- package/dist/web-components-library/p-1c8e7c24.entry.js +0 -1
- package/dist/web-components-library/p-20682781.entry.js +0 -1
- package/dist/web-components-library/p-3d0f5e36.entry.js +0 -1
- package/dist/web-components-library/p-4f266607.entry.js +0 -1
- package/dist/web-components-library/p-51c946a5.entry.js +0 -1
- package/dist/web-components-library/p-af283478.entry.js +0 -1
- package/dist/web-components-library/p-bae1911e.entry.js +0 -1
- package/dist/web-components-library/p-d0760bb1.entry.js +0 -1
- package/dist/web-components-library/p-deda8776.entry.js +0 -1
- package/dist/web-components-library/p-f3a8cc14.entry.js +0 -1
- package/www/build/p-1570917d.entry.js +0 -1
- package/www/build/p-157aea3b.entry.js +0 -1
- package/www/build/p-1c8e7c24.entry.js +0 -1
- package/www/build/p-20682781.entry.js +0 -1
- package/www/build/p-3d0f5e36.entry.js +0 -1
- package/www/build/p-4b0934c2.js +0 -1
- package/www/build/p-4f266607.entry.js +0 -1
- package/www/build/p-51c946a5.entry.js +0 -1
- package/www/build/p-af283478.entry.js +0 -1
- package/www/build/p-bae1911e.entry.js +0 -1
- package/www/build/p-d0760bb1.entry.js +0 -1
- package/www/build/p-deda8776.entry.js +0 -1
- package/www/build/p-f3a8cc14.entry.js +0 -1
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
|
+
import { ButtonVariant, ControlSize, OffCanvasVariant, TransitionDirection } from "../../../beans";
|
|
2
3
|
const SUPPORT_INTERSECTION_OBSERVER = typeof IntersectionObserver !== "undefined";
|
|
3
4
|
/**
|
|
4
5
|
* @slot title - Slot for the main title
|
|
5
6
|
* @slot subtitle - Slot for the subtitle. It will not appear in stuck header.
|
|
6
7
|
* @slot stucked-title - Title for the stuck header. By default it uses the text from the `title` slot.
|
|
7
|
-
* @cssprop --app-header-content-max-width - Use it to set header's content max width. Useful when the project use a fixed width layout. Defaults to `100%`.
|
|
8
|
-
* @cssprop --app-header-height - Defaults to `auto`.
|
|
9
8
|
* @cssprop --app-header-typography-1-size - Part of the heading typography's scale. Use it if you have to override the default value. Value: `24px`.
|
|
10
9
|
* @cssprop --app-header-typography-2-size - Part of the heading typography's scale. Use it if you have to override the default value. Value: `28px`.
|
|
11
10
|
* @cssprop --app-header-typography-3-size - Part of the heading typography's scale. Use it if you have to override the default value. Value: `32px`.
|
|
@@ -42,25 +41,34 @@ const SUPPORT_INTERSECTION_OBSERVER = typeof IntersectionObserver !== "undefined
|
|
|
42
41
|
* @cssprop --app-header-typography-10-tracking - Part of the heading typography's scale. Use it if you have to override the default value. Value: `calc(-2 / 1em)`.
|
|
43
42
|
* @cssprop --app-header-typography-11-tracking - Part of the heading typography's scale. Use it if you have to override the default value. Value: `calc(-2.2 / 1em)`.
|
|
44
43
|
* @cssprop --app-header-typography-12-tracking - Part of the heading typography's scale. Use it if you have to override the default value. Value: `calc(-2.4 / 1em)`.
|
|
44
|
+
* @cssprop --app-header-content-max-width - Use it to set header's content max width. Useful when the project use a fixed width layout. Defaults to `100%`.
|
|
45
|
+
* @cssprop --app-header-height - Defaults to `auto`.
|
|
45
46
|
* @cssprop --app-header-top-offset - Top offset for the stuck header. Useful when there are other fixed elements above the header. Defaults to `48px` (the height of the main topbar).
|
|
46
47
|
* @cssprop --app-header-drawer-trigger-size - The size of the drawer icon. Defaults to `--space-unit * 4`.
|
|
47
|
-
* @cssprop --app-header-bg - Header background color. Defaults to `--color-
|
|
48
|
-
* @cssprop --app-header-stucked-bg - Stuck header background color. Defaults to `--color-
|
|
49
|
-
* @cssprop --app-header-text-color - Text color. Defaults to `--
|
|
50
|
-
* @cssprop --app-header-
|
|
48
|
+
* @cssprop --app-header-bg - Header background color. Defaults to `--color-surface01`.
|
|
49
|
+
* @cssprop --app-header-stucked-bg - Stuck header background color. Defaults to `--color-surface01`.
|
|
50
|
+
* @cssprop --app-header-text-color - Text color. Useful on `hero` variant to set text color based on the colors of the background image. Defaults to `--color-text01`.
|
|
51
|
+
* @cssprop --app-header-title-font-size - Variable to customize the title's font size.
|
|
52
|
+
* NOTE: Only use one of the exported `--app-header-typography-*-size` as a value.
|
|
53
|
+
* Defaults to `--app-header-typography-3-size`.
|
|
54
|
+
* @cssprop --app-header-title-lineheight - Variable to customize the title's line-height.
|
|
55
|
+
* NOTE: Only use one of the exported `--app-header-typography-*-lineheight` as a value and use the same level as the one of the font size.
|
|
56
|
+
* Defaults to `--app-header-typography-3-lineheight`.
|
|
57
|
+
* @cssprop --app-header-title-letter-spacing - Variable to customize the title's letter-spacing.
|
|
58
|
+
* NOTE: Only use one of the exported `--app-header-typography-*-tracking` as a value and use the same level as the one of the font size.
|
|
59
|
+
* Defaults to `--app-header-typography-3-tracking`.
|
|
60
|
+
* @cssprop --app-header-stucked-text-color - Stuck header text color. Defaults to `--color-text01`.
|
|
51
61
|
*/
|
|
52
62
|
export class ZAppHeader {
|
|
53
63
|
constructor() {
|
|
54
64
|
/**
|
|
55
65
|
* Stuck mode for the header.
|
|
56
66
|
* You can programmatically set it using an IntersectionObserver.
|
|
57
|
-
* **Optional**
|
|
58
67
|
*/
|
|
59
68
|
this.stuck = false;
|
|
60
69
|
/**
|
|
61
70
|
* Should place an overlay over the hero image.
|
|
62
71
|
* Useful for legibility purpose.
|
|
63
|
-
* **Optional**
|
|
64
72
|
*/
|
|
65
73
|
this.overlay = false;
|
|
66
74
|
/**
|
|
@@ -74,10 +82,23 @@ export class ZAppHeader {
|
|
|
74
82
|
* The opening state of the drawer.
|
|
75
83
|
*/
|
|
76
84
|
this.drawerOpen = false;
|
|
85
|
+
/**
|
|
86
|
+
* Enable the search bar.
|
|
87
|
+
*/
|
|
88
|
+
this.enableSearch = false;
|
|
89
|
+
/**
|
|
90
|
+
* Placeholder text for the search bar.
|
|
91
|
+
*/
|
|
92
|
+
this.searchPlaceholder = "Cerca";
|
|
77
93
|
/**
|
|
78
94
|
* The stuck state of the bar.
|
|
79
95
|
*/
|
|
80
96
|
this._stuck = false;
|
|
97
|
+
/**
|
|
98
|
+
* Current viewport.
|
|
99
|
+
* Used to change the aspect of the search button (icon only) on mobile and tablet.
|
|
100
|
+
*/
|
|
101
|
+
this.currentViewport = "mobile";
|
|
81
102
|
this.observer = SUPPORT_INTERSECTION_OBSERVER &&
|
|
82
103
|
new IntersectionObserver(([entry]) => {
|
|
83
104
|
this._stuck = !entry.isIntersecting;
|
|
@@ -88,18 +109,34 @@ export class ZAppHeader {
|
|
|
88
109
|
this.closeDrawer = this.closeDrawer.bind(this);
|
|
89
110
|
this.collectMenuElements = this.collectMenuElements.bind(this);
|
|
90
111
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
112
|
+
evaluateViewport() {
|
|
113
|
+
if (window.innerWidth < 768) {
|
|
114
|
+
this.currentViewport = "mobile";
|
|
115
|
+
}
|
|
116
|
+
else if (window.innerWidth >= 768 && window.innerWidth < 1152) {
|
|
117
|
+
this.currentViewport = "tablet";
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
this.currentViewport = "desktop";
|
|
121
|
+
}
|
|
96
122
|
}
|
|
97
|
-
|
|
98
|
-
|
|
123
|
+
onStuck() {
|
|
124
|
+
const scrollParent = this.scrollParent;
|
|
125
|
+
if (!scrollParent) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
this.sticking.emit(this._stuck);
|
|
99
129
|
}
|
|
100
|
-
|
|
101
|
-
this.
|
|
102
|
-
|
|
130
|
+
setMenuFloatingMode() {
|
|
131
|
+
if (this.menuElements.length === 0) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
const elements = this.menuElements;
|
|
135
|
+
elements.forEach((element) => {
|
|
136
|
+
element.open = false;
|
|
137
|
+
element.floating = !this.drawerOpen;
|
|
138
|
+
element.verticalContext = this.drawerOpen;
|
|
139
|
+
});
|
|
103
140
|
}
|
|
104
141
|
get title() {
|
|
105
142
|
const titleElement = this.hostElement.querySelector('[slot="title"]');
|
|
@@ -115,19 +152,36 @@ export class ZAppHeader {
|
|
|
115
152
|
}
|
|
116
153
|
return parent;
|
|
117
154
|
}
|
|
155
|
+
get canShowMenu() {
|
|
156
|
+
return this.menuLength > 0 && this.flow !== "offcanvas" && this.currentViewport !== "mobile" && !this.drawerOpen;
|
|
157
|
+
}
|
|
158
|
+
get canShowSearchbar() {
|
|
159
|
+
if (!this.enableSearch) {
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
// Always show the searchbar on desktop, even if a searchPageUrl is set
|
|
163
|
+
if (this.searchPageUrl) {
|
|
164
|
+
return this.currentViewport === "desktop";
|
|
165
|
+
}
|
|
166
|
+
return true;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Whether the header has a hero image, either as a prop or as a slot.
|
|
170
|
+
*/
|
|
171
|
+
get hasHero() {
|
|
172
|
+
return this.hero !== undefined || this.hostElement.querySelector("[slot=hero]") !== null;
|
|
173
|
+
}
|
|
174
|
+
openDrawer() {
|
|
175
|
+
this.drawerOpen = true;
|
|
176
|
+
}
|
|
177
|
+
closeDrawer() {
|
|
178
|
+
this.drawerOpen = false;
|
|
179
|
+
}
|
|
118
180
|
collectMenuElements() {
|
|
119
181
|
const menuElements = (this.menuElements = this.hostElement.querySelectorAll('[slot="menu"]'));
|
|
120
182
|
this.menuLength = menuElements.length;
|
|
121
183
|
this.setMenuFloatingMode();
|
|
122
184
|
}
|
|
123
|
-
onStuckMode() {
|
|
124
|
-
if (this.stuck) {
|
|
125
|
-
this.enableStuckObserver();
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
this.disableStuckMode();
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
185
|
enableStuckObserver() {
|
|
132
186
|
if (this.observer) {
|
|
133
187
|
this.observer.observe(this.container);
|
|
@@ -139,26 +193,33 @@ export class ZAppHeader {
|
|
|
139
193
|
this.observer.unobserve(this.container);
|
|
140
194
|
}
|
|
141
195
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
196
|
+
onStuckMode() {
|
|
197
|
+
if (this.stuck) {
|
|
198
|
+
this.enableStuckObserver();
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
this.disableStuckMode();
|
|
146
202
|
}
|
|
147
|
-
this.emitStickingEvent();
|
|
148
203
|
}
|
|
149
|
-
|
|
150
|
-
if (this.
|
|
151
|
-
return;
|
|
204
|
+
renderSearchLinkButton() {
|
|
205
|
+
if (!this.enableSearch || !this.searchPageUrl || this.currentViewport === "desktop") {
|
|
206
|
+
return null;
|
|
152
207
|
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
208
|
+
return (h("z-button", { class: "search-page-button", variant: ButtonVariant.SECONDARY, href: this.searchPageUrl, icon: "search", size: ControlSize.X_SMALL }));
|
|
209
|
+
}
|
|
210
|
+
componentDidLoad() {
|
|
211
|
+
this.collectMenuElements();
|
|
212
|
+
this.onStuckMode();
|
|
213
|
+
this.evaluateViewport();
|
|
159
214
|
}
|
|
160
215
|
render() {
|
|
161
|
-
return (h(Host, { "menu-length": this.menuLength },
|
|
216
|
+
return (h(Host, { "menu-length": this.menuLength }, this.hasHero && (h("div", { class: "hero-container" }, h("slot", { name: "hero" }, this.hero && (h("img", { alt: "", src: this.hero }))))), h("div", { class: "heading-panel", ref: (el) => (this.container = el) }, h("div", { class: "heading-container" }, h("div", { class: "heading-title" }, this.menuLength > 0 && (h("button", { class: "drawer-trigger", "aria-label": "Apri menu", onClick: this.openDrawer }, h("z-icon", { name: "burger-menu" }))), h("slot", { name: "title" }), this.renderSearchLinkButton()), h("div", { class: "heading-subtitle" }, h("slot", { name: "subtitle" }))), (this.canShowMenu || this.canShowSearchbar) && (h("div", { class: "menu-container" }, this.canShowMenu && (h("slot", { name: "menu", onSlotchange: this.collectMenuElements })), this.canShowSearchbar && (h("z-searchbar", { placeholder: this.searchPlaceholder, showSearchButton: true, searchButtonIconOnly: this.currentViewport !== "desktop", size: ControlSize.X_SMALL, variant: ButtonVariant.SECONDARY, preventSubmit: true, onSearchTyping: (e) => {
|
|
217
|
+
var _a;
|
|
218
|
+
e.target.preventSubmit = ((_a = e.detail) === null || _a === void 0 ? void 0 : _a.length) < 3;
|
|
219
|
+
} }))))), h("z-offcanvas", { variant: OffCanvasVariant.OVERLAY, transitiondirection: TransitionDirection.RIGHT, open: this.drawerOpen, onCanvasOpenStatusChanged: (ev) => (this.drawerOpen = ev.detail) }, h("button", { class: "drawer-close", "aria-label": "Chiudi menu", onClick: this.closeDrawer, slot: "canvasContent" }, h("z-icon", { name: "close" })), this.drawerOpen && (h("div", { class: "drawer-content", slot: "canvasContent" }, h("slot", { name: "menu", onSlotchange: this.collectMenuElements })))), this._stuck && (h("div", { class: "heading-stuck" }, h("div", { class: "heading-stuck-content" }, this.menuLength > 0 && (h("button", { class: "drawer-trigger", "aria-label": "Apri menu", onClick: this.openDrawer }, h("z-icon", { name: "burger-menu" }))), h("div", { class: "heading-title" }, h("slot", { name: "stucked-title" }, this.title)), this.renderSearchLinkButton(), this.canShowSearchbar && this.currentViewport === "desktop" && (h("z-searchbar", { placeholder: this.searchPlaceholder, showSearchButton: true, searchButtonIconOnly: false, size: ControlSize.X_SMALL, variant: ButtonVariant.SECONDARY, preventSubmit: true, onSearchTyping: (e) => {
|
|
220
|
+
var _a;
|
|
221
|
+
e.target.preventSubmit = ((_a = e.detail) === null || _a === void 0 ? void 0 : _a.length) < 3;
|
|
222
|
+
} })))))));
|
|
162
223
|
}
|
|
163
224
|
static get is() { return "z-app-header"; }
|
|
164
225
|
static get encapsulation() { return "shadow"; }
|
|
@@ -186,7 +247,7 @@ export class ZAppHeader {
|
|
|
186
247
|
"optional": false,
|
|
187
248
|
"docs": {
|
|
188
249
|
"tags": [],
|
|
189
|
-
"text": "Stuck mode for the header.\nYou can programmatically set it using an IntersectionObserver
|
|
250
|
+
"text": "Stuck mode for the header.\nYou can programmatically set it using an IntersectionObserver."
|
|
190
251
|
},
|
|
191
252
|
"attribute": "stuck",
|
|
192
253
|
"reflect": true,
|
|
@@ -204,7 +265,7 @@ export class ZAppHeader {
|
|
|
204
265
|
"optional": false,
|
|
205
266
|
"docs": {
|
|
206
267
|
"tags": [],
|
|
207
|
-
"text": "Set the hero image source for the header.\nYou can also use a slot=\"hero\" node for advanced
|
|
268
|
+
"text": "Set the hero image source for the header.\nYou can also use a [slot=\"hero\"] node for advanced customization."
|
|
208
269
|
},
|
|
209
270
|
"attribute": "hero",
|
|
210
271
|
"reflect": false
|
|
@@ -221,7 +282,7 @@ export class ZAppHeader {
|
|
|
221
282
|
"optional": false,
|
|
222
283
|
"docs": {
|
|
223
284
|
"tags": [],
|
|
224
|
-
"text": "Should place an overlay over the hero image.\nUseful for legibility purpose
|
|
285
|
+
"text": "Should place an overlay over the hero image.\nUseful for legibility purpose."
|
|
225
286
|
},
|
|
226
287
|
"attribute": "overlay",
|
|
227
288
|
"reflect": true,
|
|
@@ -262,12 +323,66 @@ export class ZAppHeader {
|
|
|
262
323
|
"attribute": "drawer-open",
|
|
263
324
|
"reflect": true,
|
|
264
325
|
"defaultValue": "false"
|
|
326
|
+
},
|
|
327
|
+
"enableSearch": {
|
|
328
|
+
"type": "boolean",
|
|
329
|
+
"mutable": false,
|
|
330
|
+
"complexType": {
|
|
331
|
+
"original": "boolean",
|
|
332
|
+
"resolved": "boolean",
|
|
333
|
+
"references": {}
|
|
334
|
+
},
|
|
335
|
+
"required": false,
|
|
336
|
+
"optional": false,
|
|
337
|
+
"docs": {
|
|
338
|
+
"tags": [],
|
|
339
|
+
"text": "Enable the search bar."
|
|
340
|
+
},
|
|
341
|
+
"attribute": "enable-search",
|
|
342
|
+
"reflect": true,
|
|
343
|
+
"defaultValue": "false"
|
|
344
|
+
},
|
|
345
|
+
"searchPlaceholder": {
|
|
346
|
+
"type": "string",
|
|
347
|
+
"mutable": false,
|
|
348
|
+
"complexType": {
|
|
349
|
+
"original": "string",
|
|
350
|
+
"resolved": "string",
|
|
351
|
+
"references": {}
|
|
352
|
+
},
|
|
353
|
+
"required": false,
|
|
354
|
+
"optional": false,
|
|
355
|
+
"docs": {
|
|
356
|
+
"tags": [],
|
|
357
|
+
"text": "Placeholder text for the search bar."
|
|
358
|
+
},
|
|
359
|
+
"attribute": "search-placeholder",
|
|
360
|
+
"reflect": false,
|
|
361
|
+
"defaultValue": "\"Cerca\""
|
|
362
|
+
},
|
|
363
|
+
"searchPageUrl": {
|
|
364
|
+
"type": "string",
|
|
365
|
+
"mutable": false,
|
|
366
|
+
"complexType": {
|
|
367
|
+
"original": "string",
|
|
368
|
+
"resolved": "string",
|
|
369
|
+
"references": {}
|
|
370
|
+
},
|
|
371
|
+
"required": false,
|
|
372
|
+
"optional": false,
|
|
373
|
+
"docs": {
|
|
374
|
+
"tags": [],
|
|
375
|
+
"text": "Url to the search page.\nSet this prop and `enableSearch` to show a link-button on mobile and tablet viewports, instead of the normal searchbar.\nThe link will also appear on the sticky header."
|
|
376
|
+
},
|
|
377
|
+
"attribute": "search-page-url",
|
|
378
|
+
"reflect": false
|
|
265
379
|
}
|
|
266
380
|
};
|
|
267
381
|
}
|
|
268
382
|
static get states() {
|
|
269
383
|
return {
|
|
270
384
|
"_stuck": {},
|
|
385
|
+
"currentViewport": {},
|
|
271
386
|
"menuLength": {}
|
|
272
387
|
};
|
|
273
388
|
}
|
|
@@ -292,14 +407,23 @@ export class ZAppHeader {
|
|
|
292
407
|
static get elementRef() { return "hostElement"; }
|
|
293
408
|
static get watchers() {
|
|
294
409
|
return [{
|
|
295
|
-
"propName": "stuck",
|
|
296
|
-
"methodName": "onStuckMode"
|
|
297
|
-
}, {
|
|
298
410
|
"propName": "_stuck",
|
|
299
411
|
"methodName": "onStuck"
|
|
300
412
|
}, {
|
|
301
413
|
"propName": "drawerOpen",
|
|
302
414
|
"methodName": "setMenuFloatingMode"
|
|
415
|
+
}, {
|
|
416
|
+
"propName": "stuck",
|
|
417
|
+
"methodName": "onStuckMode"
|
|
418
|
+
}];
|
|
419
|
+
}
|
|
420
|
+
static get listeners() {
|
|
421
|
+
return [{
|
|
422
|
+
"name": "resize",
|
|
423
|
+
"method": "evaluateViewport",
|
|
424
|
+
"target": "window",
|
|
425
|
+
"capture": false,
|
|
426
|
+
"passive": true
|
|
303
427
|
}];
|
|
304
428
|
}
|
|
305
429
|
}
|