@zanichelli/zanichelli-it-frontend-kit 1.4.1-RC1 → 1.4.2
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-BLzQAHAI.js → index-BKkNg6ed.js} +498 -358
- package/dist/cjs/index.cjs.js +0 -3
- package/dist/cjs/loader.cjs.js +2 -5
- package/dist/cjs/zanichelli-it-frontend-kit.cjs.js +3 -6
- package/dist/cjs/zanit-back-to-top_4.cjs.entry.js +76 -64
- package/dist/collection/collection-manifest.json +3 -2
- package/dist/collection/components/back-to-top/back-to-top.js +3 -4
- package/dist/collection/components/menubar/menu/menu.js +0 -1
- package/dist/collection/components/menubar/menubar.js +12 -11
- package/dist/collection/components/menubar/mobile-menubar/mobile-menubar.js +12 -13
- package/dist/collection/components/menubar/search-form/search-form.js +14 -13
- package/dist/collection/components/menubar/search-form/suggestions.js +1 -2
- package/dist/collection/index.js +0 -1
- package/dist/collection/utils/index.js +0 -1
- package/dist/collection/utils/subjects.api.js +0 -1
- package/dist/collection/utils/utils.js +0 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +1 -1335
- package/dist/components/p-BMtMaJq9.js +1 -0
- package/dist/components/p-BXeRLfHX.js +1 -0
- package/dist/components/zanit-back-to-top.js +1 -88
- package/dist/components/zanit-menubar.js +1 -455
- package/dist/components/zanit-mobile-menubar.js +1 -9
- package/dist/components/zanit-search-form.js +1 -9
- package/dist/esm/{index-DSdvvVFj.js → index-CFgcJxsy.js} +498 -358
- package/dist/esm/index.js +0 -3
- package/dist/esm/loader.js +3 -6
- package/dist/esm/zanichelli-it-frontend-kit.js +4 -7
- package/dist/esm/zanit-back-to-top_4.entry.js +76 -64
- package/dist/types/components/back-to-top/back-to-top.d.ts +2 -1
- package/dist/types/components/menubar/menubar.d.ts +2 -1
- package/dist/types/components/menubar/mobile-menubar/mobile-menubar.d.ts +2 -1
- package/dist/types/components/menubar/search-form/search-form.d.ts +3 -2
- package/dist/types/components.d.ts +35 -8
- package/dist/types/stencil-public-runtime.d.ts +169 -11
- package/dist/zanichelli-it-frontend-kit/index.esm.js +0 -2
- package/dist/zanichelli-it-frontend-kit/p-93d8b277.entry.js +1 -0
- package/dist/zanichelli-it-frontend-kit/p-CFgcJxsy.js +2 -0
- package/dist/zanichelli-it-frontend-kit/zanichelli-it-frontend-kit.esm.js +1 -2
- package/package.json +17 -15
- package/www/build/index.esm.js +0 -2
- package/www/build/p-93d8b277.entry.js +1 -0
- package/www/build/p-CFgcJxsy.js +2 -0
- package/www/build/p-ec9829f4.js +1 -0
- package/www/build/zanichelli-it-frontend-kit.esm.js +1 -2
- package/www/index.html +3 -2
- package/dist/cjs/index-BLzQAHAI.js.map +0 -1
- package/dist/cjs/index.cjs.js.map +0 -1
- package/dist/cjs/loader.cjs.js.map +0 -1
- package/dist/cjs/zanichelli-it-frontend-kit.cjs.js.map +0 -1
- package/dist/cjs/zanit-back-to-top.zanit-menubar.zanit-mobile-menubar.zanit-search-form.entry.cjs.js.map +0 -1
- package/dist/cjs/zanit-back-to-top_4.cjs.entry.js.map +0 -1
- package/dist/collection/components/back-to-top/back-to-top.js.map +0 -1
- package/dist/collection/components/menubar/menu/menu.js.map +0 -1
- package/dist/collection/components/menubar/menubar.js.map +0 -1
- package/dist/collection/components/menubar/mobile-menubar/mobile-menubar.js.map +0 -1
- package/dist/collection/components/menubar/search-form/search-form.js.map +0 -1
- package/dist/collection/components/menubar/search-form/suggestions.js.map +0 -1
- package/dist/collection/index.js.map +0 -1
- package/dist/collection/utils/index.js.map +0 -1
- package/dist/collection/utils/subjects.api.js.map +0 -1
- package/dist/collection/utils/utils.js.map +0 -1
- package/dist/components/index.js.map +0 -1
- package/dist/components/p-CPhDV9oz.js +0 -246
- package/dist/components/p-CPhDV9oz.js.map +0 -1
- package/dist/components/p-DR2f_bjz.js +0 -387
- package/dist/components/p-DR2f_bjz.js.map +0 -1
- package/dist/components/zanit-back-to-top.js.map +0 -1
- package/dist/components/zanit-menubar.js.map +0 -1
- package/dist/components/zanit-mobile-menubar.js.map +0 -1
- package/dist/components/zanit-search-form.js.map +0 -1
- package/dist/esm/index-DSdvvVFj.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/loader.js.map +0 -1
- package/dist/esm/zanichelli-it-frontend-kit.js.map +0 -1
- package/dist/esm/zanit-back-to-top.zanit-menubar.zanit-mobile-menubar.zanit-search-form.entry.js.map +0 -1
- package/dist/esm/zanit-back-to-top_4.entry.js.map +0 -1
- package/dist/zanichelli-it-frontend-kit/index.esm.js.map +0 -1
- package/dist/zanichelli-it-frontend-kit/loader.esm.js.map +0 -1
- package/dist/zanichelli-it-frontend-kit/p-12c6519e.entry.js +0 -2
- package/dist/zanichelli-it-frontend-kit/p-12c6519e.entry.js.map +0 -1
- package/dist/zanichelli-it-frontend-kit/p-DSdvvVFj.js +0 -3
- package/dist/zanichelli-it-frontend-kit/p-DSdvvVFj.js.map +0 -1
- package/dist/zanichelli-it-frontend-kit/zanichelli-it-frontend-kit.esm.js.map +0 -1
- package/dist/zanichelli-it-frontend-kit/zanit-back-to-top.zanit-menubar.zanit-mobile-menubar.zanit-search-form.entry.esm.js.map +0 -1
- package/www/build/index.esm.js.map +0 -1
- package/www/build/loader.esm.js.map +0 -1
- package/www/build/p-12c6519e.entry.js +0 -2
- package/www/build/p-12c6519e.entry.js.map +0 -1
- package/www/build/p-17633e25.js +0 -2
- package/www/build/p-DSdvvVFj.js +0 -3
- package/www/build/p-DSdvvVFj.js.map +0 -1
- package/www/build/zanichelli-it-frontend-kit.esm.js.map +0 -1
- package/www/build/zanit-back-to-top.zanit-menubar.zanit-mobile-menubar.zanit-search-form.entry.esm.js.map +0 -1
package/dist/esm/index.js
CHANGED
package/dist/esm/loader.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { g as globalScripts, b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { g as globalScripts, b as bootstrapLazy } from './index-CFgcJxsy.js';
|
|
2
|
+
export { s as setNonce } from './index-CFgcJxsy.js';
|
|
3
3
|
|
|
4
4
|
const defineCustomElements = async (win, options) => {
|
|
5
5
|
if (typeof window === 'undefined') return undefined;
|
|
6
6
|
await globalScripts();
|
|
7
|
-
return bootstrapLazy([["zanit-back-to-top_4",[[
|
|
7
|
+
return bootstrapLazy([["zanit-back-to-top_4",[[529,"zanit-menubar",{"data":[1],"current":[1],"searchQuery":[1025,"search-query"],"searchEnv":[1,"search-env"],"searchArea":[1,"search-area"],"items":[32],"openMenu":[32],"openNavbar":[32],"currentPath":[32],"isMobile":[32],"loading":[32]},[[5,"click","handleOutsideClick"],[5,"keydown","handleKeydown"],[1,"mouseover","handleMouseover"],[1,"mouseout","handleMouseout"],[1,"focusout","handleFocusout"]],{"data":[{"parseData":0}],"items":[{"onItemsChange":0}],"current":[{"onCurrentChange":0}]}],[514,"zanit-back-to-top",{"pageMinHeight":[2,"page-min-height"],"scrollMinHeight":[2,"scroll-min-height"],"showFab":[32],"currentPageHeight":[32],"isMobile":[32]},[[9,"scroll","handleScroll"]]],[529,"zanit-mobile-menubar",{"currentPath":[16],"items":[16],"searchQuery":[1025,"search-query"],"loading":[4],"searchEnv":[1,"search-env"],"searchArea":[1,"search-area"],"lastCurrent":[32],"parentItem":[32],"menuItems":[32],"menuType":[32],"open":[32]},[[5,"click","handleOutsideClick"],[1,"keydown","handleKeydown"],[5,"focusin","handleFocusout"]],{"items":[{"onItemsChange":0}],"currentPath":[{"onItemsChange":0}]}],[513,"zanit-search-form",{"searchQuery":[1025,"search-query"],"searchEnv":[1,"search-env"],"searchArea":[1,"search-area"],"showSearchbar":[32],"_searchQuery":[32],"suggestions":[32],"activeSuggestion":[32],"showSuggestions":[32]},[[5,"mousedown","handleOutsideClick"],[1,"keydown","handleEsc"],[5,"keyup","handleTab"]],{"searchQuery":[{"onSearchQueryChange":0}],"searchArea":[{"onSearchAreaChange":0}],"showSearchbar":[{"onShowSearchbarChange":0}],"showSuggestions":[{"onShowSuggestionsChange":0}]}]]]], options);
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export { defineCustomElements };
|
|
11
|
-
//# sourceMappingURL=loader.js.map
|
|
12
|
-
|
|
13
|
-
//# sourceMappingURL=loader.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { p as promiseResolve, g as globalScripts, b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { p as promiseResolve, g as globalScripts, b as bootstrapLazy } from './index-CFgcJxsy.js';
|
|
2
|
+
export { s as setNonce } from './index-CFgcJxsy.js';
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
|
-
Stencil Client Patch Browser v4.
|
|
5
|
+
Stencil Client Patch Browser v4.43.4 | MIT Licensed | https://stenciljs.com
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
var patchBrowser = () => {
|
|
@@ -16,8 +16,5 @@ var patchBrowser = () => {
|
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(async (options) => {
|
|
18
18
|
await globalScripts();
|
|
19
|
-
return bootstrapLazy([["zanit-back-to-top_4",[[
|
|
19
|
+
return bootstrapLazy([["zanit-back-to-top_4",[[529,"zanit-menubar",{"data":[1],"current":[1],"searchQuery":[1025,"search-query"],"searchEnv":[1,"search-env"],"searchArea":[1,"search-area"],"items":[32],"openMenu":[32],"openNavbar":[32],"currentPath":[32],"isMobile":[32],"loading":[32]},[[5,"click","handleOutsideClick"],[5,"keydown","handleKeydown"],[1,"mouseover","handleMouseover"],[1,"mouseout","handleMouseout"],[1,"focusout","handleFocusout"]],{"data":[{"parseData":0}],"items":[{"onItemsChange":0}],"current":[{"onCurrentChange":0}]}],[514,"zanit-back-to-top",{"pageMinHeight":[2,"page-min-height"],"scrollMinHeight":[2,"scroll-min-height"],"showFab":[32],"currentPageHeight":[32],"isMobile":[32]},[[9,"scroll","handleScroll"]]],[529,"zanit-mobile-menubar",{"currentPath":[16],"items":[16],"searchQuery":[1025,"search-query"],"loading":[4],"searchEnv":[1,"search-env"],"searchArea":[1,"search-area"],"lastCurrent":[32],"parentItem":[32],"menuItems":[32],"menuType":[32],"open":[32]},[[5,"click","handleOutsideClick"],[1,"keydown","handleKeydown"],[5,"focusin","handleFocusout"]],{"items":[{"onItemsChange":0}],"currentPath":[{"onItemsChange":0}]}],[513,"zanit-search-form",{"searchQuery":[1025,"search-query"],"searchEnv":[1,"search-env"],"searchArea":[1,"search-area"],"showSearchbar":[32],"_searchQuery":[32],"suggestions":[32],"activeSuggestion":[32],"showSuggestions":[32]},[[5,"mousedown","handleOutsideClick"],[1,"keydown","handleEsc"],[5,"keyup","handleTab"]],{"searchQuery":[{"onSearchQueryChange":0}],"searchArea":[{"onSearchAreaChange":0}],"showSearchbar":[{"onShowSearchbarChange":0}],"showSuggestions":[{"onShowSuggestionsChange":0}]}]]]], options);
|
|
20
20
|
});
|
|
21
|
-
//# sourceMappingURL=zanichelli-it-frontend-kit.js.map
|
|
22
|
-
|
|
23
|
-
//# sourceMappingURL=zanichelli-it-frontend-kit.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as registerInstance, a as getElement, h, H as Host, F as Fragment, c as createEvent } from './index-
|
|
1
|
+
import { r as registerInstance, a as getElement, h, H as Host, F as Fragment, c as createEvent } from './index-CFgcJxsy.js';
|
|
2
2
|
|
|
3
|
-
const backToTopCss =
|
|
3
|
+
const backToTopCss = () => `.sc-zanit-back-to-top-h{opacity:1;transition:all 0.2s linear;visibility:visible}.hidden.sc-zanit-back-to-top-h{opacity:0;visibility:hidden}.sc-zanit-back-to-top-h .z-fab.sc-zanit-back-to-top{--color-primary01:var(--gray950);outline:1px solid var(--color-white)}`;
|
|
4
4
|
|
|
5
5
|
const ZanitBackTop = class {
|
|
6
6
|
constructor(hostRef) {
|
|
@@ -53,10 +53,10 @@ const ZanitBackTop = class {
|
|
|
53
53
|
window.scrollTo({ top: 0, behavior: 'smooth' });
|
|
54
54
|
}
|
|
55
55
|
render() {
|
|
56
|
-
return (h(Host, { key: '
|
|
56
|
+
return (h(Host, { key: '8db557141277e71d6d2fdaad2e525df03fb78461', class: { hidden: !this.showFab }, "aria-hidden": this.showFab ? 'false' : 'true' }, h("button", { key: 'e9a1cfcc75c39e6a5d657712306e331bbfabbcf9', class: { 'z-fab': true, 'z-fab-extended': !this.isMobile }, onClick: () => this.scroll() }, h("z-icon", { key: 'c83accba15ee2efbbef5f17cdbb92c57f7aee0a0', name: "back-top" }), h("span", { key: '59167788a06ac2b45b4e91c944c0fefd1dc79780' }, "Torna su"))));
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
|
-
ZanitBackTop.style = backToTopCss;
|
|
59
|
+
ZanitBackTop.style = backToTopCss();
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
62
|
* Check if an element contains an event target by checking its composedPath.
|
|
@@ -83,6 +83,31 @@ const isTabKey = (event) => event.key === 'Tab';
|
|
|
83
83
|
/** Check if event key is Escape */
|
|
84
84
|
const isEscKey = (event) => event.key === 'Escape';
|
|
85
85
|
|
|
86
|
+
var SearchEnv;
|
|
87
|
+
(function (SearchEnv) {
|
|
88
|
+
SearchEnv["DEV"] = "dev";
|
|
89
|
+
SearchEnv["TEST"] = "test";
|
|
90
|
+
SearchEnv["PROD"] = "prod";
|
|
91
|
+
})(SearchEnv || (SearchEnv = {}));
|
|
92
|
+
const S3_SHOP_URL = {
|
|
93
|
+
dev: 'https://zanichelli-shop-dev.s3.eu-west-1.amazonaws.com',
|
|
94
|
+
test: 'https://zanichelli-shop-test.s3.eu-west-1.amazonaws.com',
|
|
95
|
+
prod: 'https://zanichelli-shop.s3.eu-west-1.amazonaws.com',
|
|
96
|
+
};
|
|
97
|
+
async function getSubjectsByArea(searchEnv) {
|
|
98
|
+
try {
|
|
99
|
+
const response = await fetch(`${S3_SHOP_URL[searchEnv]}/categories.json`);
|
|
100
|
+
if (!response.ok) {
|
|
101
|
+
throw new Error(`HTTP ${response.status}`);
|
|
102
|
+
}
|
|
103
|
+
return await response.json();
|
|
104
|
+
}
|
|
105
|
+
catch (err) {
|
|
106
|
+
console.error('Error fetching subjects:', err);
|
|
107
|
+
return {};
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
86
111
|
const DEFAULT_GROUP_KEY = 'default';
|
|
87
112
|
const DEFAULT_GROUP = {
|
|
88
113
|
id: DEFAULT_GROUP_KEY,
|
|
@@ -112,45 +137,17 @@ const Menu = ({ controlledBy, items, currentPath = [], onItemKeyDown }) => {
|
|
|
112
137
|
}
|
|
113
138
|
const groups = getGroupedItems(items);
|
|
114
139
|
const isActive = (item) => currentPath.includes(controlledBy) && currentPath.includes(item.id);
|
|
115
|
-
return (h("div", { class: "menu-wrapper", role: "none" },
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
'menu-item': true,
|
|
122
|
-
'active': isActive(item),
|
|
123
|
-
}, href: item.href, role: "menuitem", tabIndex: -1, "aria-current": isActive(item) ? 'page' : 'false', onKeyDown: (event) => onItemKeyDown(event), target: item.target }, item.label))))))))))));
|
|
140
|
+
return (h("div", { class: "menu-wrapper", role: "none" }, h("div", { class: "menu", "aria-labelledby": controlledBy ?? undefined, role: "menu" }, groups.map(({ group, items }) => (h("div", { class: { group: true, highlight: items.some((item) => item.highlight) } }, group.id !== DEFAULT_GROUP_KEY ? (h("div", { class: "group-name", id: group.id }, group.label)) : groups.length > 1 ? (
|
|
141
|
+
// empty div to keep the same height as the other groups
|
|
142
|
+
h("div", { class: "group-name" })) : null, h("ul", { class: "menu-list", role: "group", "aria-labelledby": group.id !== DEFAULT_GROUP_KEY ? group.id : undefined }, items.map((item) => (h("li", { role: "none" }, item.href && (h("a", { class: {
|
|
143
|
+
'menu-item': true,
|
|
144
|
+
'active': isActive(item),
|
|
145
|
+
}, href: item.href, role: "menuitem", tabIndex: -1, "aria-current": isActive(item) ? 'page' : 'false', onKeyDown: (event) => onItemKeyDown(event), target: item.target }, item.label))))))))))));
|
|
124
146
|
};
|
|
125
147
|
|
|
126
|
-
var
|
|
127
|
-
(function (SearchEnv) {
|
|
128
|
-
SearchEnv["DEV"] = "dev";
|
|
129
|
-
SearchEnv["TEST"] = "test";
|
|
130
|
-
SearchEnv["PROD"] = "prod";
|
|
131
|
-
})(SearchEnv || (SearchEnv = {}));
|
|
132
|
-
const S3_SHOP_URL = {
|
|
133
|
-
dev: 'https://zanichelli-shop-dev.s3.eu-west-1.amazonaws.com',
|
|
134
|
-
test: 'https://zanichelli-shop-test.s3.eu-west-1.amazonaws.com',
|
|
135
|
-
prod: 'https://zanichelli-shop.s3.eu-west-1.amazonaws.com',
|
|
136
|
-
};
|
|
137
|
-
async function getSubjectsByArea(searchEnv) {
|
|
138
|
-
try {
|
|
139
|
-
const response = await fetch(`${S3_SHOP_URL[searchEnv]}/categories.json`);
|
|
140
|
-
if (!response.ok) {
|
|
141
|
-
throw new Error(`HTTP ${response.status}`);
|
|
142
|
-
}
|
|
143
|
-
return await response.json();
|
|
144
|
-
}
|
|
145
|
-
catch (err) {
|
|
146
|
-
console.error('Error fetching subjects:', err);
|
|
147
|
-
return {};
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
const menubarCss = ":host{position:relative;z-index:2;display:flex;width:100%;background-color:#fff;color:var(--gray900);font-family:var(--font-family-sans)}:host,*,::before,::after{box-sizing:border-box}*:focus:focus-visible{box-shadow:var(--shadow-focus-primary);outline:none}ul{padding:0;margin:0;list-style:none}a{color:var(--gray900);cursor:pointer;text-decoration:none}button{all:unset;cursor:pointer}:host nav{width:100%}.shadow-wrapper{position:relative;z-index:1;display:flex;width:100%}.shadow-wrapper::after{position:absolute;top:0;right:0;width:100%;height:100%;background:transparent;box-shadow:var(--shadow-1);content:'';pointer-events:none}.width-limiter{position:relative;display:flex;width:100%;max-width:var(--zanit-menubar-max-width, 1366px);margin:0 auto}.shadow-wrapper+.shadow-wrapper{z-index:0}.sub-menubar>ul{gap:28px}.width-limiter>ul,.sub-menubar>ul{position:relative;z-index:3;display:flex;width:100%;align-items:center;padding:0 var(--grid-margin);margin-right:auto;margin-left:auto;gap:20px}.shadow-wrapper>.width-limiter,.shadow-wrapper>ul{width:100%;max-width:var(--zanit-menubar-max-width, 1366px)}ul.menubar{height:3rem;padding-right:0}.menubar z-ghost-loading{display:block;width:120px;height:1.25rem}.menubar>li[role='separator']{width:1px;height:1.25rem;background-color:#000}.menubar-item{position:relative;display:flex;align-items:center;padding:14px 0;font-size:1rem;gap:8px;line-height:1.25rem}.menubar .menubar-item{text-transform:uppercase}.menubar-item [data-text]{display:flex;flex-direction:column}.menubar-item.active>[data-text],.menubar-item:hover>[data-text],.menubar-item:focus:focus-visible>[data-text]{font-weight:var(--font-bd)}.menubar-item>[data-text]::after{height:0;content:attr(data-text) / '';font-weight:var(--font-bd);letter-spacing:normal;pointer-events:none;user-select:none;visibility:hidden}.sub-menubar .menubar-item.active::after{position:absolute;z-index:-1;bottom:0;left:-4px;width:calc(100% + 8px);height:4px;background-color:var(--red500);content:''}zanit-search-form{margin-left:auto}";
|
|
148
|
+
const menubarCss = () => `:host{position:relative;z-index:2;display:flex;width:100%;background-color:#fff;color:var(--gray900);font-family:var(--font-family-sans)}:host,*,::before,::after{box-sizing:border-box}*:focus:focus-visible{box-shadow:var(--shadow-focus-primary);outline:none}ul{padding:0;margin:0;list-style:none}a{color:var(--gray900);cursor:pointer;text-decoration:none}button{all:unset;cursor:pointer}:host nav{width:100%}.shadow-wrapper{position:relative;z-index:1;display:flex;width:100%}.shadow-wrapper::after{position:absolute;top:0;right:0;width:100%;height:100%;background:transparent;box-shadow:var(--shadow-1);content:'';pointer-events:none}.width-limiter{position:relative;display:flex;width:100%;max-width:var(--zanit-menubar-max-width, 1366px);margin:0 auto}.shadow-wrapper+.shadow-wrapper{z-index:0}.sub-menubar>ul{gap:28px}.width-limiter>ul,.sub-menubar>ul{position:relative;z-index:3;display:flex;width:100%;align-items:center;padding:0 var(--grid-margin);margin-right:auto;margin-left:auto;gap:20px}.shadow-wrapper>.width-limiter,.shadow-wrapper>ul{width:100%;max-width:var(--zanit-menubar-max-width, 1366px)}ul.menubar{height:3rem;padding-right:0}.menubar z-ghost-loading{display:block;width:120px;height:1.25rem}.menubar>li[role='separator']{width:1px;height:1.25rem;background-color:#000}.menubar-item{position:relative;display:flex;align-items:center;padding:14px 0;font-size:1rem;gap:8px;line-height:1.25rem}.menubar .menubar-item{text-transform:uppercase}.menubar-item [data-text]{display:flex;flex-direction:column}.menubar-item.active>[data-text],.menubar-item:hover>[data-text],.menubar-item:focus:focus-visible>[data-text]{font-weight:var(--font-bd)}.menubar-item>[data-text]::after{height:0;content:attr(data-text) / '';font-weight:var(--font-bd);letter-spacing:normal;pointer-events:none;user-select:none;visibility:hidden}.sub-menubar .menubar-item.active::after{position:absolute;z-index:-1;bottom:0;left:-4px;width:calc(100% + 8px);height:4px;background-color:var(--red500);content:''}zanit-search-form{margin-left:auto}`;
|
|
152
149
|
|
|
153
|
-
const menuCss$1 =
|
|
150
|
+
const menuCss$1 = () => `.menu-wrapper{width:100%;background-color:#fff}.menu{position:relative;display:flex;width:100%;flex-direction:column;gap:32px 0}.menu .group{display:flex;flex-direction:column}.menu .group .group-name{border-bottom:1px solid currentcolor;margin-bottom:4px;color:var(--red500);font-size:0.875rem;font-weight:var(--font-md)}.menu .group .menu-list{display:flex;flex-direction:column;gap:8px}.menu .group .menu-list .menu-item{display:block;border-bottom:2px solid transparent;font-size:0.875rem;font-weight:var(--font-md)}.menu .menu-list .menu-item.active,.menu .menu-list .menu-item:hover{border-bottom-color:var(--red500)}.menu .group.highlight .menu-list .menu-item{font-size:1rem}@media (width >= 768px){.menu-wrapper{position:absolute;top:100%;left:0;display:flex;justify-content:center;box-shadow:var(--shadow-1)}.menu{display:grid;width:100%;max-width:var(--zanit-menubar-max-width, 1366px);padding:16px var(--grid-margin);gap:0 24px;grid-auto-columns:minmax(0, max-content);grid-auto-flow:column;grid-template-rows:minmax(0, max-content) max-content}.menu .group{display:grid;grid-row:1 / -1;grid-template-columns:1fr;grid-template-rows:subgrid}@supports not (grid-template-rows: subgrid){.menu .group{grid-template-rows:repeat(auto-fit, minmax(0, max-content))}}.menu .group .group-name{border:none;margin-bottom:16px}.menu .group .menu-list .menu-item{font-size:1rem}.menu .group.highlight .menu-list .menu-item{font-size:1.5rem}}`;
|
|
154
151
|
|
|
155
152
|
const ZanitMenubar = class {
|
|
156
153
|
constructor(hostRef) {
|
|
@@ -543,16 +540,22 @@ const ZanitMenubar = class {
|
|
|
543
540
|
}
|
|
544
541
|
static get delegatesFocus() { return true; }
|
|
545
542
|
static get watchers() { return {
|
|
546
|
-
"data": [
|
|
547
|
-
|
|
548
|
-
|
|
543
|
+
"data": [{
|
|
544
|
+
"parseData": 0
|
|
545
|
+
}],
|
|
546
|
+
"items": [{
|
|
547
|
+
"onItemsChange": 0
|
|
548
|
+
}],
|
|
549
|
+
"current": [{
|
|
550
|
+
"onCurrentChange": 0
|
|
551
|
+
}]
|
|
549
552
|
}; }
|
|
550
553
|
};
|
|
551
|
-
ZanitMenubar.style = menubarCss + menuCss$1;
|
|
554
|
+
ZanitMenubar.style = menubarCss() + menuCss$1();
|
|
552
555
|
|
|
553
|
-
const mobileMenubarCss =
|
|
556
|
+
const mobileMenubarCss = () => `:host{position:relative;z-index:2;display:block;width:100%;max-width:100%;height:3rem;background-color:#fff;color:var(--gray900);fill:var(--gray900);font-family:var(--font-family-sans)}:host,*,::before,::after{box-sizing:border-box}*:focus:focus-visible{box-shadow:var(--shadow-focus-primary);outline:none}ul{padding:0;margin:0;list-style:none}a{color:var(--gray900);cursor:pointer;text-decoration:none}button{all:unset;cursor:pointer}nav{display:flex;width:100%;align-items:center;padding-left:var(--grid-margin);gap:8px}nav::after{position:absolute;top:0;right:0;width:100%;height:100%;background:transparent;box-shadow:var(--shadow-1);content:'';pointer-events:none}z-logo{margin:8px 0}.mobile-menu{position:absolute;top:100%;left:0;display:flex;overflow:auto;width:100%;max-height:calc(100vh - 48px - var(--zanit-menubar-top-offset, 0px));flex-direction:column;padding:16px var(--grid-margin) 32px;background-color:#fff;box-shadow:var(--shadow-2);gap:8px}.mobile-menu li{width:100%}.mobile-menu .items-container{display:flex;min-height:256px;flex-direction:column;gap:8px}.mobile-menu .items-container z-ghost-loading{width:40%;height:1.2rem}.mobile-menu .items-container .menubar-item{display:block;width:100%;padding:8px 0;font-size:1rem;text-align:left}.mobile-menu .items-container li:not(:last-child) .menubar-item{border-bottom:1px solid #000}[role='menuitem'].parent{display:flex;width:fit-content;align-items:center;padding:0;border:none;font-size:0.875rem;gap:8px}zanit-search-form{margin-left:auto}`;
|
|
554
557
|
|
|
555
|
-
const menuCss =
|
|
558
|
+
const menuCss = () => `.menu-wrapper{width:100%;background-color:#fff}.menu{position:relative;display:flex;width:100%;flex-direction:column;gap:32px 0}.menu .group{display:flex;flex-direction:column}.menu .group .group-name{border-bottom:1px solid currentcolor;margin-bottom:4px;color:var(--red500);font-size:0.875rem;font-weight:var(--font-md)}.menu .group .menu-list{display:flex;flex-direction:column;gap:8px}.menu .group .menu-list .menu-item{display:block;border-bottom:2px solid transparent;font-size:0.875rem;font-weight:var(--font-md)}.menu .menu-list .menu-item.active,.menu .menu-list .menu-item:hover{border-bottom-color:var(--red500)}.menu .group.highlight .menu-list .menu-item{font-size:1rem}@media (width >= 768px){.menu-wrapper{position:absolute;top:100%;left:0;display:flex;justify-content:center;box-shadow:var(--shadow-1)}.menu{display:grid;width:100%;max-width:var(--zanit-menubar-max-width, 1366px);padding:16px var(--grid-margin);gap:0 24px;grid-auto-columns:minmax(0, max-content);grid-auto-flow:column;grid-template-rows:minmax(0, max-content) max-content}.menu .group{display:grid;grid-row:1 / -1;grid-template-columns:1fr;grid-template-rows:subgrid}@supports not (grid-template-rows: subgrid){.menu .group{grid-template-rows:repeat(auto-fit, minmax(0, max-content))}}.menu .group .group-name{border:none;margin-bottom:16px}.menu .group .menu-list .menu-item{font-size:1rem}.menu .group.highlight .menu-list .menu-item{font-size:1.5rem}}`;
|
|
556
559
|
|
|
557
560
|
const ZanitMobileMenubar = class {
|
|
558
561
|
constructor(hostRef) {
|
|
@@ -577,7 +580,7 @@ const ZanitMobileMenubar = class {
|
|
|
577
580
|
menuItems = undefined;
|
|
578
581
|
/** Whether the items to render come from a menubar or a menu. */
|
|
579
582
|
menuType = undefined;
|
|
580
|
-
open;
|
|
583
|
+
open = false;
|
|
581
584
|
onItemsChange() {
|
|
582
585
|
this.lastCurrent = this.currentPath?.length ? this.currentPath[this.currentPath.length - 1] : undefined;
|
|
583
586
|
this.setupData(this.items);
|
|
@@ -700,18 +703,22 @@ const ZanitMobileMenubar = class {
|
|
|
700
703
|
this.open = false;
|
|
701
704
|
}
|
|
702
705
|
render() {
|
|
703
|
-
return (h("nav", { key: '
|
|
706
|
+
return (h("nav", { key: 'e3c4f8212d54b84206c2d40c9670263dd0f2460a', "aria-label": "Zanichelli.it" }, h("button", { key: '8f4600dbb2c530e5901127d556eee94dcd60947a', class: "burger-button", type: "button", "aria-expanded": this.open ? 'true' : 'false', "aria-controls": "mobile-menu", "aria-label": this.open ? 'Chiudi menù' : 'Apri menù', onClick: () => this.toggleMenu() }, h("z-icon", { key: 'aa3d06cca2f2c7e92cb4afb37a5085ea37ec8283', name: this.open ? 'multiply' : 'burger-menu', width: "1.5rem", height: "1.5rem" })), h("z-logo", { key: 'af3724fc7f330c7b2f7d826bd0dd2edc2dbb5742', imageAlt: "Logo Zanichelli", link: "/", height: 32, width: 126 }), h("zanit-search-form", { key: 'cc3c8e2ece6ac0428864d8affcd567c9a1272824', searchQuery: this.searchQuery, onResetSearch: () => (this.searchQuery = undefined), searchArea: this.searchArea, searchEnv: this.searchEnv }), this.open && (h("ul", { key: '0c35b0f4869ae076a1c02f07f1b19e787f4c3780', class: "mobile-menu", role: "menubar" }, !this.loading && this.currentPath && this.currentPath.length > 0 && (h("li", { key: 'ff8e9d8871ebea21ba178d1ba9d295d26b018be2', role: "none" }, h("a", { key: '4afb5ccda0e206f640f429ecfe7ac1e3491a475d', class: "parent", href: this.parentItem?.href ?? '/', id: this.parentItem?.id ?? undefined, role: "menuitem", tabIndex: -1, onKeyDown: (event) => this.handleItemKeydown(event), target: this.parentItem?.target }, h("z-icon", { key: '2db8da21ad88b937d591eac551a3599704e13147', name: "arrow-left", width: "0.5rem", height: "0.5rem" }), h("span", { key: 'd285244285ccee5e76db049cb4fba1dd591d7ce1' }, this.parentItem?.label || 'Home')))), this.loading ? (h("div", { class: "items-container", role: "none" }, [...new Array(4)].map(() => (h("li", { role: "none" }, h("div", { class: "menubar-item", role: "none" }, h("z-ghost-loading", null))))))) : this.menuType === 'menu' ? (h(Menu, { items: this.menuItems, controlledBy: this.parentItem?.id, currentPath: this.currentPath, onItemKeyDown: (event) => this.handleItemKeydown(event) })) : (this.menuItems?.length > 0 && (h("div", { class: "items-container", role: "none" }, this.menuItems.map((item) => (h("li", { role: "none" }, h("a", { class: {
|
|
704
707
|
'menu-item': this.menuType === 'menu',
|
|
705
708
|
'menubar-item': this.menuType === 'menubar',
|
|
706
709
|
}, href: item.href, id: item.id, role: "menuitem", "aria-current": this.lastCurrent === item.id ? 'page' : 'false', tabIndex: -1, onKeyDown: (event) => this.handleItemKeydown(event), target: item.target }, h("span", { "data-text": item.label }, item.label))))))))))));
|
|
707
710
|
}
|
|
708
711
|
static get delegatesFocus() { return true; }
|
|
709
712
|
static get watchers() { return {
|
|
710
|
-
"items": [
|
|
711
|
-
|
|
713
|
+
"items": [{
|
|
714
|
+
"onItemsChange": 0
|
|
715
|
+
}],
|
|
716
|
+
"currentPath": [{
|
|
717
|
+
"onItemsChange": 0
|
|
718
|
+
}]
|
|
712
719
|
}; }
|
|
713
720
|
};
|
|
714
|
-
ZanitMobileMenubar.style = mobileMenubarCss + menuCss;
|
|
721
|
+
ZanitMobileMenubar.style = mobileMenubarCss() + menuCss();
|
|
715
722
|
|
|
716
723
|
var AREA_LABELS;
|
|
717
724
|
(function (AREA_LABELS) {
|
|
@@ -771,7 +778,7 @@ const buildId = (string) => string
|
|
|
771
778
|
.map((c) => c.charCodeAt(0).toString(16))
|
|
772
779
|
.join('');
|
|
773
780
|
const buildUrl = (params) => {
|
|
774
|
-
return
|
|
781
|
+
return `/ricerca?${new URLSearchParams(params).toString()}`;
|
|
775
782
|
};
|
|
776
783
|
const buildDetail = (user_query, query, area, subject) => ({
|
|
777
784
|
user_query,
|
|
@@ -798,7 +805,7 @@ const getAreaOrder = (area) => {
|
|
|
798
805
|
return index >= 0 ? index : 100;
|
|
799
806
|
};
|
|
800
807
|
|
|
801
|
-
const searchFormCss =
|
|
808
|
+
const searchFormCss = () => `:host,*,::before,::after{box-sizing:border-box}*:focus:focus-visible{box-shadow:var(--shadow-focus-primary);outline:none}button{all:unset;cursor:pointer}.searchbar{--searchbar-button-x-padding:14px;--searchbar-button-icon-width:1.75rem;--closed-searchbar-width:calc((var(--searchbar-button-x-padding) * 2) + var(--searchbar-button-icon-width) + 1px);position:absolute;z-index:5;top:0;right:0;display:flex;width:var(--closed-searchbar-width);height:3rem;justify-content:flex-end;transition:width 0.4s ease-in-out}.searchbar.searchbar-open{width:100%}.searchbar .input-wrapper{display:flex;overflow:hidden;width:100%;align-items:center;padding:8px;padding-left:var(--grid-margin);background-color:#fff;gap:8px;transition-duration:0.4s;transition-property:padding-right, padding-left, width;transition-timing-function:ease-in-out}.searchbar:not(.searchbar-open) .input-wrapper{overflow:hidden;width:0;padding:0}.searchbar button[type='reset']{--z-icon-width:1rem;--z-icon-height:1rem;display:flex;align-items:center;cursor:pointer}.searchbar input{z-index:1;width:100%;height:100%;padding:0;border:none;background-color:#fff;font-family:var(--font-family-sans);font-size:1rem}.searchbar.searchbar-open input:first-child{padding-left:4px;margin-left:-4px;}.searchbar input[type='search']::-webkit-search-cancel-button,.searchbar input[type='search']::-webkit-search-decoration{appearance:none}.searchbar input::placeholder{color:var(--gray500)}.searchbar .searchbar-button{display:flex;align-items:center;justify-content:center;padding:10px var(--searchbar-button-x-padding);border-left:1px solid #000;background:var(--zanit-accent-color);font-family:inherit;font-size:inherit;gap:64px;line-height:1}.searchbar .searchbar-button:focus-visible{z-index:1}.searchbar-button z-icon{--z-icon-width:var(--searchbar-button-icon-width);--z-icon-height:var(--searchbar-button-icon-width)}.suggestions-wrapper{position:absolute;z-index:4;top:3rem;left:50%;width:100vw;border-top:1px solid var(--gray200);margin-left:-50vw;background:#fff;box-shadow:var(--shadow-1)}.suggestions-wrapper.hidden{display:none}.suggestions{display:flex;width:100%;flex-direction:column;align-items:stretch;padding:var(--space-unit);margin:0 auto}.suggestion-head{padding:calc(var(--space-unit) * 0.75) var(--space-unit);color:var(--gray700);font-size:0.875rem;font-weight:var(--font-md);line-height:1.125rem}.suggestion{display:flex;padding:calc(var(--space-unit) * 0.75) var(--space-unit);color:var(--gray900);cursor:pointer;font-size:1rem;gap:var(--space-unit);line-height:1.5rem}.suggestion:hover,.suggestion[aria-selected='true']{background:var(--gray100)}.suggestion strong{font-weight:var(--font-bd)}.suggestion mark{background-color:var(--red50)}.suggestion z-icon{--z-icon-height:1.125rem;margin-top:0.125rem}.suggestions z-divider{margin:var(--space-unit) 0}@media (width < 1152px){.searchbar .searchbar-button>.searchbar-button-label{display:none}}@media (width >= 768px){.searchbar{--searchbar-button-x-padding:16px;--searchbar-button-icon-width:2rem}.searchbar .input-wrapper{gap:14px}.searchbar button[type='reset']{--z-icon-width:1.5rem;--z-icon-height:1.5rem}.searchbar input,.searchbar .searchbar-button{font-size:1.5rem}.searchbar .searchbar-button{padding:8px var(--searchbar-button-x-padding)}.suggestions{padding:var(--space-unit) calc(var(--space-unit) * 2)}}@media (width >= 1152px){.searchbar{--closed-searchbar-width:190px}}@media (width >= 1366px){.searchbar .searchbar-button{border-right:1px solid #000}.suggestions{max-width:1366px;padding:var(--space-unit) calc(var(--space-unit) * 3)}}`;
|
|
802
809
|
|
|
803
810
|
const ZanitSearchForm = class {
|
|
804
811
|
constructor(hostRef) {
|
|
@@ -843,10 +850,10 @@ const ZanitSearchForm = class {
|
|
|
843
850
|
}
|
|
844
851
|
onShowSuggestionsChange() {
|
|
845
852
|
this.activeSuggestion = '';
|
|
846
|
-
document.body.style.overflowX = this.showSuggestions ? 'hidden' : 'initial';
|
|
847
853
|
}
|
|
848
854
|
/** Emitted on search form submission. */
|
|
849
855
|
search;
|
|
856
|
+
/** Emitted when the search query is reset by the user (e.g. by clicking the reset button). */
|
|
850
857
|
resetSearch;
|
|
851
858
|
async connectedCallback() {
|
|
852
859
|
this.subjectsByArea = await getSubjectsByArea(this.searchEnv);
|
|
@@ -997,24 +1004,29 @@ const ZanitSearchForm = class {
|
|
|
997
1004
|
}))));
|
|
998
1005
|
}
|
|
999
1006
|
render() {
|
|
1000
|
-
return (h(Host, { key: '
|
|
1007
|
+
return (h(Host, { key: 'c87ecbcbff0205ddb35fb96bbfbcca6bb7ac8802' }, h("form", { key: '77f2951f88ae0361897161688f3a9875d555b20c', class: { 'searchbar': true, 'searchbar-open': this.showSearchbar }, ref: (el) => (this.formElement = el), role: "search", "aria-label": "Cerca nel sito", method: "get", action: "/ricerca", onSubmit: (event) => this.onSearchSubmit(event), onReset: () => this.resetSearchQuery() }, !!this.searchArea && (h("input", { key: '3cf0dceef1acc58c3c0e637f974db6c7587be081', type: "hidden", name: "area", value: this.searchArea })), h("div", { key: 'd797f9832f29b723010ca486298f0c4a4aabe3ee', class: "input-wrapper", role: "none" }, this.searchQuery && (h("button", { key: '2d5971957d84e83120fc96f49e359635e3792104', type: "reset", "aria-label": "Svuota campo di ricerca", disabled: !this.showSearchbar, "aria-hidden": !this.showSearchbar ? 'true' : undefined, tabIndex: !this.showSearchbar ? -1 : 0 }, h("z-icon", { key: '7027abe8c6a2211433048041a4ef2a5e273ca226', name: "multiply-circled" }))), h("input", { key: '2184d3fa615d94bf3615606a4624abdbb81cb2ae', id: "searchbar-input", name: "q", type: "search", disabled: !this.showSearchbar, placeholder: "Cerca per parola chiave o ISBN", value: this.searchQuery, required: true, autocomplete: "off", role: "combobox", "aria-autocomplete": "list", "aria-expanded": this.showSuggestions ? 'true' : 'false', "aria-controls": "search-suggestions", "aria-activedescendant": this.activeSuggestion, "aria-label": "Cerca per parola chiave o ISBN", "aria-hidden": !this.showSearchbar ? 'true' : undefined, tabIndex: !this.showSearchbar ? -1 : 0, onInput: (event) => this.handleInputChange(event), onKeyDown: (e) => {
|
|
1001
1008
|
// INFO: prevent ESC from clearing input
|
|
1002
1009
|
if (isEscKey(e)) {
|
|
1003
1010
|
e.preventDefault();
|
|
1004
1011
|
}
|
|
1005
1012
|
this.handleSuggestionsNav(e);
|
|
1006
|
-
} })), h("button", { key: '
|
|
1013
|
+
} })), h("button", { key: '06a7ad6e3e4c74f2dd3bd56fb6f2da006c8d59c0', class: "searchbar-button", "aria-label": this.showSearchbar ? 'Esegui ricerca' : 'Apri il campo di ricerca', "aria-controls": "searchbar-input", type: this.showSearchbar ? 'submit' : 'button', onClick: () => this.openSearchbar() }, this.showSearchbar ? null : h("span", { class: "searchbar-button-label" }, "Cerca"), h("z-icon", { key: '72e66f0280f0b835e760c1631076b71fa5dc03fa', name: "search" }))), this.renderSuggestions()));
|
|
1007
1014
|
}
|
|
1008
1015
|
static get watchers() { return {
|
|
1009
|
-
"searchQuery": [
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
"
|
|
1016
|
+
"searchQuery": [{
|
|
1017
|
+
"onSearchQueryChange": 0
|
|
1018
|
+
}],
|
|
1019
|
+
"searchArea": [{
|
|
1020
|
+
"onSearchAreaChange": 0
|
|
1021
|
+
}],
|
|
1022
|
+
"showSearchbar": [{
|
|
1023
|
+
"onShowSearchbarChange": 0
|
|
1024
|
+
}],
|
|
1025
|
+
"showSuggestions": [{
|
|
1026
|
+
"onShowSuggestionsChange": 0
|
|
1027
|
+
}]
|
|
1013
1028
|
}; }
|
|
1014
1029
|
};
|
|
1015
|
-
ZanitSearchForm.style = searchFormCss;
|
|
1030
|
+
ZanitSearchForm.style = searchFormCss();
|
|
1016
1031
|
|
|
1017
1032
|
export { ZanitBackTop as zanit_back_to_top, ZanitMenubar as zanit_menubar, ZanitMobileMenubar as zanit_mobile_menubar, ZanitSearchForm as zanit_search_form };
|
|
1018
|
-
//# sourceMappingURL=zanit-back-to-top.zanit-menubar.zanit-mobile-menubar.zanit-search-form.entry.js.map
|
|
1019
|
-
|
|
1020
|
-
//# sourceMappingURL=zanit-back-to-top_4.entry.js.map
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { ComponentInterface } from '../../stencil-public-runtime';
|
|
1
2
|
/**
|
|
2
3
|
* Back to top floating action button component.
|
|
3
4
|
* Appears on scroll, given a min height for both scroll height and page height.
|
|
4
5
|
*/
|
|
5
|
-
export declare class ZanitBackTop {
|
|
6
|
+
export declare class ZanitBackTop implements ComponentInterface {
|
|
6
7
|
private resizeObserver;
|
|
7
8
|
private mutationObserver;
|
|
8
9
|
host: HTMLZanitBackToTopElement;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ComponentInterface } from '../../stencil-public-runtime';
|
|
1
2
|
import { MenubarItem } from '../../utils';
|
|
2
3
|
import { SearchEnv } from '../../utils/subjects.api';
|
|
3
4
|
/**
|
|
@@ -5,7 +6,7 @@ import { SearchEnv } from '../../utils/subjects.api';
|
|
|
5
6
|
* When a main menubar item is the current active one, a sub-menubar is shown and each subitem can have a menu with subitems.
|
|
6
7
|
* @cssprop {--zanit-menubar-max-width} Maximum width of the menubar.
|
|
7
8
|
*/
|
|
8
|
-
export declare class ZanitMenubar {
|
|
9
|
+
export declare class ZanitMenubar implements ComponentInterface {
|
|
9
10
|
host: HTMLZanitMenubarElement;
|
|
10
11
|
/** Menubar items extracted from `data`. */
|
|
11
12
|
items: MenubarItem[];
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { ComponentInterface } from '../../../stencil-public-runtime';
|
|
1
2
|
import { MenubarItem, MenuItem } from '../../../utils';
|
|
2
3
|
import { SearchEnv } from '../../../utils/subjects.api';
|
|
3
4
|
/** Mobile menubar component. */
|
|
4
|
-
export declare class ZanitMobileMenubar {
|
|
5
|
+
export declare class ZanitMobileMenubar implements ComponentInterface {
|
|
5
6
|
host: HTMLZanitMobileMenubarElement;
|
|
6
7
|
/** IDs path of the current item. */
|
|
7
8
|
currentPath: string[];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
1
|
+
import { ComponentInterface, EventEmitter } from '../../../stencil-public-runtime';
|
|
2
2
|
import { SearchEvent } from '../../../utils';
|
|
3
3
|
import { SearchEnv } from '../../../utils/subjects.api';
|
|
4
4
|
import { SearchSuggestion } from './suggestions';
|
|
5
|
-
export declare class ZanitSearchForm {
|
|
5
|
+
export declare class ZanitSearchForm implements ComponentInterface {
|
|
6
6
|
private formElement;
|
|
7
7
|
private subjectsByArea;
|
|
8
8
|
private timer;
|
|
@@ -29,6 +29,7 @@ export declare class ZanitSearchForm {
|
|
|
29
29
|
onShowSuggestionsChange(): void;
|
|
30
30
|
/** Emitted on search form submission. */
|
|
31
31
|
search: EventEmitter<SearchEvent>;
|
|
32
|
+
/** Emitted when the search query is reset by the user (e.g. by clicking the reset button). */
|
|
32
33
|
resetSearch: EventEmitter<void>;
|
|
33
34
|
connectedCallback(): Promise<void>;
|
|
34
35
|
/** Close open searchbar when clicking outside. */
|
|
@@ -249,6 +249,9 @@ declare namespace LocalJSX {
|
|
|
249
249
|
"searchQuery"?: string | undefined;
|
|
250
250
|
}
|
|
251
251
|
interface ZanitSearchForm {
|
|
252
|
+
/**
|
|
253
|
+
* Emitted when the search query is reset by the user (e.g. by clicking the reset button).
|
|
254
|
+
*/
|
|
252
255
|
"onResetSearch"?: (event: ZanitSearchFormCustomEvent<void>) => void;
|
|
253
256
|
/**
|
|
254
257
|
* Emitted on search form submission.
|
|
@@ -269,11 +272,35 @@ declare namespace LocalJSX {
|
|
|
269
272
|
*/
|
|
270
273
|
"searchQuery"?: string | undefined;
|
|
271
274
|
}
|
|
275
|
+
|
|
276
|
+
interface ZanitBackToTopAttributes {
|
|
277
|
+
"pageMinHeight": number;
|
|
278
|
+
"scrollMinHeight": number;
|
|
279
|
+
}
|
|
280
|
+
interface ZanitMenubarAttributes {
|
|
281
|
+
"data": Promise<MenubarItem[]> | MenubarItem[] | URL | string;
|
|
282
|
+
"current": string | undefined;
|
|
283
|
+
"searchQuery": string | undefined;
|
|
284
|
+
"searchEnv": SearchEnv;
|
|
285
|
+
"searchArea": string | undefined;
|
|
286
|
+
}
|
|
287
|
+
interface ZanitMobileMenubarAttributes {
|
|
288
|
+
"searchQuery": string | undefined;
|
|
289
|
+
"loading": boolean;
|
|
290
|
+
"searchEnv": SearchEnv;
|
|
291
|
+
"searchArea": string | undefined;
|
|
292
|
+
}
|
|
293
|
+
interface ZanitSearchFormAttributes {
|
|
294
|
+
"searchQuery": string | undefined;
|
|
295
|
+
"searchEnv": SearchEnv;
|
|
296
|
+
"searchArea": string | undefined;
|
|
297
|
+
}
|
|
298
|
+
|
|
272
299
|
interface IntrinsicElements {
|
|
273
|
-
"zanit-back-to-top": ZanitBackToTop;
|
|
274
|
-
"zanit-menubar": ZanitMenubar;
|
|
275
|
-
"zanit-mobile-menubar": ZanitMobileMenubar;
|
|
276
|
-
"zanit-search-form": ZanitSearchForm;
|
|
300
|
+
"zanit-back-to-top": Omit<ZanitBackToTop, keyof ZanitBackToTopAttributes> & { [K in keyof ZanitBackToTop & keyof ZanitBackToTopAttributes]?: ZanitBackToTop[K] } & { [K in keyof ZanitBackToTop & keyof ZanitBackToTopAttributes as `attr:${K}`]?: ZanitBackToTopAttributes[K] } & { [K in keyof ZanitBackToTop & keyof ZanitBackToTopAttributes as `prop:${K}`]?: ZanitBackToTop[K] };
|
|
301
|
+
"zanit-menubar": Omit<ZanitMenubar, keyof ZanitMenubarAttributes> & { [K in keyof ZanitMenubar & keyof ZanitMenubarAttributes]?: ZanitMenubar[K] } & { [K in keyof ZanitMenubar & keyof ZanitMenubarAttributes as `attr:${K}`]?: ZanitMenubarAttributes[K] } & { [K in keyof ZanitMenubar & keyof ZanitMenubarAttributes as `prop:${K}`]?: ZanitMenubar[K] };
|
|
302
|
+
"zanit-mobile-menubar": Omit<ZanitMobileMenubar, keyof ZanitMobileMenubarAttributes> & { [K in keyof ZanitMobileMenubar & keyof ZanitMobileMenubarAttributes]?: ZanitMobileMenubar[K] } & { [K in keyof ZanitMobileMenubar & keyof ZanitMobileMenubarAttributes as `attr:${K}`]?: ZanitMobileMenubarAttributes[K] } & { [K in keyof ZanitMobileMenubar & keyof ZanitMobileMenubarAttributes as `prop:${K}`]?: ZanitMobileMenubar[K] };
|
|
303
|
+
"zanit-search-form": Omit<ZanitSearchForm, keyof ZanitSearchFormAttributes> & { [K in keyof ZanitSearchForm & keyof ZanitSearchFormAttributes]?: ZanitSearchForm[K] } & { [K in keyof ZanitSearchForm & keyof ZanitSearchFormAttributes as `attr:${K}`]?: ZanitSearchFormAttributes[K] } & { [K in keyof ZanitSearchForm & keyof ZanitSearchFormAttributes as `prop:${K}`]?: ZanitSearchForm[K] };
|
|
277
304
|
}
|
|
278
305
|
}
|
|
279
306
|
export { LocalJSX as JSX };
|
|
@@ -284,18 +311,18 @@ declare module "@stencil/core" {
|
|
|
284
311
|
* Back to top floating action button component.
|
|
285
312
|
* Appears on scroll, given a min height for both scroll height and page height.
|
|
286
313
|
*/
|
|
287
|
-
"zanit-back-to-top": LocalJSX.
|
|
314
|
+
"zanit-back-to-top": LocalJSX.IntrinsicElements["zanit-back-to-top"] & JSXBase.HTMLAttributes<HTMLZanitBackToTopElement>;
|
|
288
315
|
/**
|
|
289
316
|
* Main menubar component. Each item can have a menu with subitems
|
|
290
317
|
* When a main menubar item is the current active one, a sub-menubar is shown and each subitem can have a menu with subitems.
|
|
291
318
|
* @cssprop {--zanit-menubar-max-width} Maximum width of the menubar.
|
|
292
319
|
*/
|
|
293
|
-
"zanit-menubar": LocalJSX.
|
|
320
|
+
"zanit-menubar": LocalJSX.IntrinsicElements["zanit-menubar"] & JSXBase.HTMLAttributes<HTMLZanitMenubarElement>;
|
|
294
321
|
/**
|
|
295
322
|
* Mobile menubar component.
|
|
296
323
|
*/
|
|
297
|
-
"zanit-mobile-menubar": LocalJSX.
|
|
298
|
-
"zanit-search-form": LocalJSX.
|
|
324
|
+
"zanit-mobile-menubar": LocalJSX.IntrinsicElements["zanit-mobile-menubar"] & JSXBase.HTMLAttributes<HTMLZanitMobileMenubarElement>;
|
|
325
|
+
"zanit-search-form": LocalJSX.IntrinsicElements["zanit-search-form"] & JSXBase.HTMLAttributes<HTMLZanitSearchFormElement>;
|
|
299
326
|
}
|
|
300
327
|
}
|
|
301
328
|
}
|