@zanichelli/zanichelli-it-frontend-kit 1.3.1 → 1.4.0-RC2
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/types/components/menubar/menubar.d.ts +5 -0
- package/dist/types/components/menubar/mobile-menubar/mobile-menubar.d.ts +5 -0
- package/dist/types/components/menubar/search-form/search-form.d.ts +28 -5
- package/dist/types/components/menubar/search-form/suggestions.d.ts +11 -0
- package/dist/types/components.d.ts +60 -4
- package/dist/types/utils/subjects.api.d.ts +6 -0
- package/dist/types/utils/types.d.ts +7 -0
- package/dist/types/utils/utils.d.ts +8 -0
- package/dist/zanichelli-it-frontend-kit/index-DPw_TAEB.js +4170 -0
- package/dist/zanichelli-it-frontend-kit/index-DPw_TAEB.js.map +1 -0
- package/dist/zanichelli-it-frontend-kit/index.esm.js +10 -0
- package/dist/zanichelli-it-frontend-kit/index.esm.js.map +1 -1
- package/dist/zanichelli-it-frontend-kit/menu-BsP3cOc_.js +46 -0
- package/dist/zanichelli-it-frontend-kit/menu-BsP3cOc_.js.map +1 -0
- package/dist/zanichelli-it-frontend-kit/subjects.api-BRhngFD0.js +54 -0
- package/dist/zanichelli-it-frontend-kit/subjects.api-BRhngFD0.js.map +1 -0
- package/dist/zanichelli-it-frontend-kit/zanichelli-it-frontend-kit.css +993 -1
- package/dist/zanichelli-it-frontend-kit/zanichelli-it-frontend-kit.esm.js +49 -1
- package/dist/zanichelli-it-frontend-kit/zanichelli-it-frontend-kit.esm.js.map +1 -1
- package/dist/zanichelli-it-frontend-kit/zanit-back-to-top.entry.esm.js.map +1 -0
- package/dist/{components/zanit-back-to-top.js → zanichelli-it-frontend-kit/zanit-back-to-top.entry.js} +10 -34
- package/dist/zanichelli-it-frontend-kit/zanit-back-to-top.entry.js.map +1 -0
- package/dist/zanichelli-it-frontend-kit/zanit-menubar.entry.esm.js.map +1 -0
- package/dist/{components/zanit-menubar.js → zanichelli-it-frontend-kit/zanit-menubar.entry.js} +19 -58
- package/dist/zanichelli-it-frontend-kit/zanit-menubar.entry.js.map +1 -0
- package/dist/zanichelli-it-frontend-kit/zanit-mobile-menubar.entry.esm.js.map +1 -0
- package/dist/{components/p-BJzEFXY7.js → zanichelli-it-frontend-kit/zanit-mobile-menubar.entry.js} +18 -87
- package/dist/zanichelli-it-frontend-kit/zanit-mobile-menubar.entry.js.map +1 -0
- package/dist/zanichelli-it-frontend-kit/zanit-search-form.entry.esm.js.map +1 -0
- package/dist/zanichelli-it-frontend-kit/zanit-search-form.entry.js +307 -0
- package/dist/zanichelli-it-frontend-kit/zanit-search-form.entry.js.map +1 -0
- package/package.json +1 -1
- package/www/build/index-DPw_TAEB.js +4170 -0
- package/www/build/index-DPw_TAEB.js.map +1 -0
- package/www/build/index.esm.js +10 -0
- package/www/build/index.esm.js.map +1 -1
- package/www/build/menu-BsP3cOc_.js +46 -0
- package/www/build/menu-BsP3cOc_.js.map +1 -0
- package/www/build/subjects.api-BRhngFD0.js +54 -0
- package/www/build/subjects.api-BRhngFD0.js.map +1 -0
- package/www/build/zanichelli-it-frontend-kit.css +993 -1
- package/www/build/zanichelli-it-frontend-kit.esm.js +49 -1
- package/www/build/zanichelli-it-frontend-kit.esm.js.map +1 -1
- package/www/build/zanit-back-to-top.entry.esm.js.map +1 -0
- package/www/build/zanit-back-to-top.entry.js +64 -0
- package/www/build/zanit-back-to-top.entry.js.map +1 -0
- package/www/build/zanit-menubar.entry.esm.js.map +1 -0
- package/{dist/collection/components/menubar/menubar.js → www/build/zanit-menubar.entry.js} +31 -159
- package/www/build/zanit-menubar.entry.js.map +1 -0
- package/www/build/zanit-mobile-menubar.entry.esm.js.map +1 -0
- package/www/build/zanit-mobile-menubar.entry.js +171 -0
- package/www/build/zanit-mobile-menubar.entry.js.map +1 -0
- package/www/build/zanit-search-form.entry.esm.js.map +1 -0
- package/www/build/zanit-search-form.entry.js +307 -0
- package/www/build/zanit-search-form.entry.js.map +1 -0
- package/www/index.html +11 -2
- package/dist/cjs/index-BLzQAHAI.js +0 -1578
- package/dist/cjs/index-BLzQAHAI.js.map +0 -1
- package/dist/cjs/index.cjs.js +0 -5
- package/dist/cjs/index.cjs.js.map +0 -1
- package/dist/cjs/loader.cjs.js +0 -15
- package/dist/cjs/loader.cjs.js.map +0 -1
- package/dist/cjs/zanichelli-it-frontend-kit.cjs.js +0 -27
- 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 +0 -771
- package/dist/cjs/zanit-back-to-top_4.cjs.entry.js.map +0 -1
- package/dist/collection/collection-manifest.json +0 -15
- package/dist/collection/components/back-to-top/back-to-top.css +0 -16
- package/dist/collection/components/back-to-top/back-to-top.js +0 -130
- package/dist/collection/components/back-to-top/back-to-top.js.map +0 -1
- package/dist/collection/components/menubar/menu/menu.css +0 -95
- package/dist/collection/components/menubar/menu/menu.js +0 -38
- package/dist/collection/components/menubar/menu/menu.js.map +0 -1
- package/dist/collection/components/menubar/menubar.css +0 -168
- package/dist/collection/components/menubar/menubar.js.map +0 -1
- package/dist/collection/components/menubar/mobile-menubar/mobile-menubar.css +0 -121
- package/dist/collection/components/menubar/mobile-menubar/mobile-menubar.js +0 -291
- package/dist/collection/components/menubar/mobile-menubar/mobile-menubar.js.map +0 -1
- package/dist/collection/components/menubar/search-form/search-form.css +0 -155
- package/dist/collection/components/menubar/search-form/search-form.js +0 -176
- package/dist/collection/components/menubar/search-form/search-form.js.map +0 -1
- package/dist/collection/index.js +0 -11
- package/dist/collection/index.js.map +0 -1
- package/dist/collection/utils/index.js +0 -2
- package/dist/collection/utils/index.js.map +0 -1
- package/dist/collection/utils/utils.js +0 -17
- package/dist/collection/utils/utils.js.map +0 -1
- package/dist/components/index.js +0 -1335
- package/dist/components/index.js.map +0 -1
- package/dist/components/p-BJzEFXY7.js.map +0 -1
- package/dist/components/p-Cfa-BVne.js +0 -133
- package/dist/components/p-Cfa-BVne.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 +0 -9
- package/dist/components/zanit-mobile-menubar.js.map +0 -1
- package/dist/components/zanit-search-form.js +0 -9
- package/dist/components/zanit-search-form.js.map +0 -1
- package/dist/esm/index-DSdvvVFj.js +0 -1549
- package/dist/esm/index-DSdvvVFj.js.map +0 -1
- package/dist/esm/index.js +0 -4
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/loader.js +0 -13
- package/dist/esm/loader.js.map +0 -1
- package/dist/esm/zanichelli-it-frontend-kit.js +0 -23
- 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 +0 -766
- package/dist/esm/zanit-back-to-top_4.entry.js.map +0 -1
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +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/p-fe01ee7e.entry.js +0 -2
- package/dist/zanichelli-it-frontend-kit/p-fe01ee7e.entry.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/p-43c395dc.css +0 -1
- package/www/build/p-DSdvvVFj.js +0 -3
- package/www/build/p-DSdvvVFj.js.map +0 -1
- package/www/build/p-b4df0dec.js +0 -2
- package/www/build/p-fe01ee7e.entry.js +0 -2
- package/www/build/p-fe01ee7e.entry.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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { MenubarItem } from '../../utils';
|
|
2
|
+
import { SearchEnv } from '../../utils/subjects.api';
|
|
2
3
|
/**
|
|
3
4
|
* Main menubar component. Each item can have a menu with subitems
|
|
4
5
|
* When a main menubar item is the current active one, a sub-menubar is shown and each subitem can have a menu with subitems.
|
|
@@ -22,6 +23,10 @@ export declare class ZanitMenubar {
|
|
|
22
23
|
current: string | undefined;
|
|
23
24
|
/** Initial search query. */
|
|
24
25
|
searchQuery: string | undefined;
|
|
26
|
+
/** Environment for search suggestions */
|
|
27
|
+
searchEnv: SearchEnv;
|
|
28
|
+
/** Search area (e.g. "SCUOLA", "UNIVERSITÀ", "DIZIONARI"). */
|
|
29
|
+
searchArea?: string | undefined;
|
|
25
30
|
private timerId;
|
|
26
31
|
/** Setup the list of items. */
|
|
27
32
|
parseData(data: typeof this.data): Promise<void>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { MenubarItem, MenuItem } from '../../../utils';
|
|
2
|
+
import { SearchEnv } from '../../../utils/subjects.api';
|
|
2
3
|
/** Mobile menubar component. */
|
|
3
4
|
export declare class ZanitMobileMenubar {
|
|
4
5
|
host: HTMLZanitMobileMenubarElement;
|
|
@@ -10,6 +11,10 @@ export declare class ZanitMobileMenubar {
|
|
|
10
11
|
searchQuery: string | undefined;
|
|
11
12
|
/** Whether the menubar is loading the data. */
|
|
12
13
|
loading: boolean;
|
|
14
|
+
/** Environment for search suggestions */
|
|
15
|
+
searchEnv: SearchEnv;
|
|
16
|
+
/** Search area (e.g. "SCUOLA", "UNIVERSITÀ", "DIZIONARI"). */
|
|
17
|
+
searchArea?: string | undefined;
|
|
13
18
|
/** Last active item ID. */
|
|
14
19
|
lastCurrent: string | undefined;
|
|
15
20
|
parentItem: MenubarItem | undefined;
|
|
@@ -1,27 +1,50 @@
|
|
|
1
1
|
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
+
import { SearchEvent } from '../../../utils';
|
|
3
|
+
import { SearchEnv } from '../../../utils/subjects.api';
|
|
4
|
+
import { SearchSuggestion } from './suggestions';
|
|
2
5
|
export declare class ZanitSearchForm {
|
|
3
6
|
private formElement;
|
|
7
|
+
private subjectsByArea;
|
|
8
|
+
private timer;
|
|
4
9
|
host: HTMLZanitSearchFormElement;
|
|
5
10
|
/** Indicates whether the searchbar is visible and usable. */
|
|
6
11
|
showSearchbar: boolean;
|
|
7
12
|
/** Search query to apply. */
|
|
8
13
|
_searchQuery: string | undefined;
|
|
14
|
+
/** Search suggestions to show in the autocomplete dropdown. */
|
|
15
|
+
suggestions: SearchSuggestion[];
|
|
16
|
+
/** Active suggestion - used for keyboard navigation */
|
|
17
|
+
activeSuggestion: string;
|
|
18
|
+
/** Show suggestions list */
|
|
19
|
+
showSuggestions: boolean;
|
|
9
20
|
/** Initial search query */
|
|
10
21
|
searchQuery: string | undefined;
|
|
22
|
+
/** Environment for search suggestions */
|
|
23
|
+
searchEnv: SearchEnv;
|
|
24
|
+
/** Search area (e.g. "SCUOLA", "UNIVERSITÀ", "DIZIONARI"). */
|
|
25
|
+
searchArea?: string | undefined;
|
|
11
26
|
onSearchQueryChange(): void;
|
|
27
|
+
onSearchAreaChange(): void;
|
|
28
|
+
onShowSearchbarChange(): void;
|
|
29
|
+
onShowSuggestionsChange(): void;
|
|
12
30
|
/** Emitted on search form submission. */
|
|
13
|
-
search: EventEmitter<
|
|
14
|
-
query: string;
|
|
15
|
-
}>;
|
|
31
|
+
search: EventEmitter<SearchEvent>;
|
|
16
32
|
resetSearch: EventEmitter<void>;
|
|
17
33
|
connectedCallback(): Promise<void>;
|
|
18
34
|
/** Close open searchbar when clicking outside. */
|
|
19
35
|
handleOutsideClick(event: MouseEvent): void;
|
|
20
|
-
/** Close the
|
|
21
|
-
|
|
36
|
+
/** Close the searchbar/suggestions when pressing Escape. */
|
|
37
|
+
handleEsc(event: KeyboardEvent): void;
|
|
38
|
+
/** Close the searchbar/suggestions when pressing Tab. */
|
|
39
|
+
handleTab(event: KeyboardEvent): void;
|
|
22
40
|
private openSearchbar;
|
|
23
41
|
private resetSearchQuery;
|
|
42
|
+
private resetSuggestions;
|
|
24
43
|
private handleInputChange;
|
|
44
|
+
private updateSuggestions;
|
|
25
45
|
private onSearchSubmit;
|
|
46
|
+
private submitSuggestionSearch;
|
|
47
|
+
private handleSuggestionsNav;
|
|
48
|
+
private renderSuggestions;
|
|
26
49
|
render(): any;
|
|
27
50
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type SearchSuggestion = {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
aria_label: string;
|
|
5
|
+
url: string;
|
|
6
|
+
user_query: string;
|
|
7
|
+
query?: string;
|
|
8
|
+
area?: string;
|
|
9
|
+
subject?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function buildSuggestions(query: string, subjectsByArea: Record<string, string[]>, selectedArea?: string): SearchSuggestion[];
|
|
@@ -5,8 +5,10 @@
|
|
|
5
5
|
* It contains typing information for all components that exist in this project.
|
|
6
6
|
*/
|
|
7
7
|
import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
|
8
|
-
import { MenubarItem } from "./utils";
|
|
9
|
-
|
|
8
|
+
import { MenubarItem, SearchEvent } from "./utils";
|
|
9
|
+
import { SearchEnv } from "./utils/subjects.api";
|
|
10
|
+
export { MenubarItem, SearchEvent } from "./utils";
|
|
11
|
+
export { SearchEnv } from "./utils/subjects.api";
|
|
10
12
|
export namespace Components {
|
|
11
13
|
/**
|
|
12
14
|
* Back to top floating action button component.
|
|
@@ -39,6 +41,15 @@ export namespace Components {
|
|
|
39
41
|
* The data to build the menu (as an array of `MenubarItem` or a JSON array) or the url to fetch to retrieve it.
|
|
40
42
|
*/
|
|
41
43
|
"data": Promise<MenubarItem[]> | MenubarItem[] | URL | string;
|
|
44
|
+
/**
|
|
45
|
+
* Search area (e.g. "SCUOLA", "UNIVERSITÀ", "DIZIONARI").
|
|
46
|
+
*/
|
|
47
|
+
"searchArea"?: string | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Environment for search suggestions
|
|
50
|
+
* @default SearchEnv.PROD
|
|
51
|
+
*/
|
|
52
|
+
"searchEnv": SearchEnv;
|
|
42
53
|
/**
|
|
43
54
|
* Initial search query.
|
|
44
55
|
* @default undefined
|
|
@@ -64,6 +75,15 @@ export namespace Components {
|
|
|
64
75
|
* @default false
|
|
65
76
|
*/
|
|
66
77
|
"loading": boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Search area (e.g. "SCUOLA", "UNIVERSITÀ", "DIZIONARI").
|
|
80
|
+
*/
|
|
81
|
+
"searchArea"?: string | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* Environment for search suggestions
|
|
84
|
+
* @default SearchEnv.PROD
|
|
85
|
+
*/
|
|
86
|
+
"searchEnv": SearchEnv;
|
|
67
87
|
/**
|
|
68
88
|
* Initial search query.
|
|
69
89
|
* @default undefined
|
|
@@ -71,6 +91,15 @@ export namespace Components {
|
|
|
71
91
|
"searchQuery": string | undefined;
|
|
72
92
|
}
|
|
73
93
|
interface ZanitSearchForm {
|
|
94
|
+
/**
|
|
95
|
+
* Search area (e.g. "SCUOLA", "UNIVERSITÀ", "DIZIONARI").
|
|
96
|
+
*/
|
|
97
|
+
"searchArea"?: string | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* Environment for search suggestions
|
|
100
|
+
* @default SearchEnv.PROD
|
|
101
|
+
*/
|
|
102
|
+
"searchEnv": SearchEnv;
|
|
74
103
|
/**
|
|
75
104
|
* Initial search query
|
|
76
105
|
* @default undefined
|
|
@@ -114,7 +143,7 @@ declare global {
|
|
|
114
143
|
new (): HTMLZanitMobileMenubarElement;
|
|
115
144
|
};
|
|
116
145
|
interface HTMLZanitSearchFormElementEventMap {
|
|
117
|
-
"search":
|
|
146
|
+
"search": SearchEvent;
|
|
118
147
|
"resetSearch": void;
|
|
119
148
|
}
|
|
120
149
|
interface HTMLZanitSearchFormElement extends Components.ZanitSearchForm, HTMLStencilElement {
|
|
@@ -170,6 +199,15 @@ declare namespace LocalJSX {
|
|
|
170
199
|
* The data to build the menu (as an array of `MenubarItem` or a JSON array) or the url to fetch to retrieve it.
|
|
171
200
|
*/
|
|
172
201
|
"data"?: Promise<MenubarItem[]> | MenubarItem[] | URL | string;
|
|
202
|
+
/**
|
|
203
|
+
* Search area (e.g. "SCUOLA", "UNIVERSITÀ", "DIZIONARI").
|
|
204
|
+
*/
|
|
205
|
+
"searchArea"?: string | undefined;
|
|
206
|
+
/**
|
|
207
|
+
* Environment for search suggestions
|
|
208
|
+
* @default SearchEnv.PROD
|
|
209
|
+
*/
|
|
210
|
+
"searchEnv"?: SearchEnv;
|
|
173
211
|
/**
|
|
174
212
|
* Initial search query.
|
|
175
213
|
* @default undefined
|
|
@@ -195,6 +233,15 @@ declare namespace LocalJSX {
|
|
|
195
233
|
* @default false
|
|
196
234
|
*/
|
|
197
235
|
"loading"?: boolean;
|
|
236
|
+
/**
|
|
237
|
+
* Search area (e.g. "SCUOLA", "UNIVERSITÀ", "DIZIONARI").
|
|
238
|
+
*/
|
|
239
|
+
"searchArea"?: string | undefined;
|
|
240
|
+
/**
|
|
241
|
+
* Environment for search suggestions
|
|
242
|
+
* @default SearchEnv.PROD
|
|
243
|
+
*/
|
|
244
|
+
"searchEnv"?: SearchEnv;
|
|
198
245
|
/**
|
|
199
246
|
* Initial search query.
|
|
200
247
|
* @default undefined
|
|
@@ -206,7 +253,16 @@ declare namespace LocalJSX {
|
|
|
206
253
|
/**
|
|
207
254
|
* Emitted on search form submission.
|
|
208
255
|
*/
|
|
209
|
-
"onSearch"?: (event: ZanitSearchFormCustomEvent<
|
|
256
|
+
"onSearch"?: (event: ZanitSearchFormCustomEvent<SearchEvent>) => void;
|
|
257
|
+
/**
|
|
258
|
+
* Search area (e.g. "SCUOLA", "UNIVERSITÀ", "DIZIONARI").
|
|
259
|
+
*/
|
|
260
|
+
"searchArea"?: string | undefined;
|
|
261
|
+
/**
|
|
262
|
+
* Environment for search suggestions
|
|
263
|
+
* @default SearchEnv.PROD
|
|
264
|
+
*/
|
|
265
|
+
"searchEnv"?: SearchEnv;
|
|
210
266
|
/**
|
|
211
267
|
* Initial search query
|
|
212
268
|
* @default undefined
|
|
@@ -5,3 +5,11 @@
|
|
|
5
5
|
export declare const containsTarget: (ancestor: HTMLElement, event: Event) => boolean;
|
|
6
6
|
/** Move the focus to `next` element, set tabindex to 0 for `next` and -1 to `current`. */
|
|
7
7
|
export declare const moveFocus: (current: HTMLElement, next: HTMLElement) => void;
|
|
8
|
+
/** Check if event key is ArrowUp */
|
|
9
|
+
export declare const isArrowUpKey: (event: KeyboardEvent) => boolean;
|
|
10
|
+
/** Check if event key is ArrowDown */
|
|
11
|
+
export declare const isArrowDownKey: (event: KeyboardEvent) => boolean;
|
|
12
|
+
/** Check if event key is Tab */
|
|
13
|
+
export declare const isTabKey: (event: KeyboardEvent) => boolean;
|
|
14
|
+
/** Check if event key is Escape */
|
|
15
|
+
export declare const isEscKey: (event: KeyboardEvent) => boolean;
|