@swisspost/internet-header 1.16.0 → 1.16.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/focus-trap.cjs.entry.js +32 -50
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/{post-internet-header-72edf928.js → post-internet-header-a55dfcff.js} +2 -3
- package/dist/cjs/swisspost-internet-header.cjs.entry.js +1 -1
- package/dist/collection/components/post-internet-breadcrumbs/post-internet-breadcrumbs.js +2 -8
- package/dist/collection/components/post-internet-header/post-internet-header.js +22 -62
- package/dist/components/focus-trap2.js +32 -50
- package/dist/components/swisspost-internet-header.js +2 -3
- package/dist/docs.json +31 -120
- package/dist/esm/focus-trap.entry.js +32 -50
- package/dist/esm/index.js +1 -1
- package/dist/esm/{post-internet-header-25cbaecc.js → post-internet-header-af82bc5f.js} +2 -3
- package/dist/esm/swisspost-internet-header.entry.js +1 -1
- package/dist/esm-es5/focus-trap.entry.js +3 -3
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{post-internet-header-25cbaecc.js → post-internet-header-af82bc5f.js} +1 -1
- package/dist/esm-es5/swisspost-internet-header.entry.js +1 -1
- package/dist/swisspost-internet-header/index.esm.js +1 -1
- package/dist/swisspost-internet-header/{p-2ca95ddf.system.js → p-20543d6d.system.js} +1 -1
- package/dist/swisspost-internet-header/{p-c45a080c.system.entry.js → p-4d5bddc5.system.entry.js} +3 -3
- package/dist/swisspost-internet-header/{p-572ff7a8.js → p-5c93e1e9.js} +1 -1
- package/dist/swisspost-internet-header/p-695fe962.system.js +1 -1
- package/dist/swisspost-internet-header/{p-5a806d1a.system.js → p-7936d692.system.js} +1 -1
- package/dist/swisspost-internet-header/{p-935c52e3.entry.js → p-8de89a63.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-944e8412.entry.js +11 -0
- package/dist/swisspost-internet-header/{p-df70d07e.system.entry.js → p-b8d92cc7.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/swisspost-internet-header.esm.js +1 -1
- package/dist/types/components/post-internet-breadcrumbs/post-internet-breadcrumbs.d.ts +0 -2
- package/dist/types/components/post-internet-header/post-internet-header.d.ts +1 -16
- package/dist/types/components.d.ts +4 -37
- package/package.json +2 -2
- package/dist/swisspost-internet-header/p-085d38af.entry.js +0 -11
|
@@ -10,7 +10,6 @@ export declare class PostInternetHeader {
|
|
|
10
10
|
project: string;
|
|
11
11
|
/**
|
|
12
12
|
* Sticky behaviour of the header.
|
|
13
|
-
* @deprecated this option will no longer be configurable with the new header in the next major release.
|
|
14
13
|
*/
|
|
15
14
|
stickyness: StickynessOptions;
|
|
16
15
|
/**
|
|
@@ -19,27 +18,22 @@ export declare class PostInternetHeader {
|
|
|
19
18
|
language?: 'de' | 'fr' | 'it' | 'en';
|
|
20
19
|
/**
|
|
21
20
|
* Toggle the meta navigation.
|
|
22
|
-
* @deprecated use the new configuration API to show or hide the meta navigation links. This option will be removed in the next major release.
|
|
23
21
|
*/
|
|
24
22
|
meta: boolean;
|
|
25
23
|
/**
|
|
26
24
|
* Toggle the login link (when logged out) or the user widget (when logged in).
|
|
27
|
-
* @deprecated use the new configuration API to show or hide the login. This option will be removed in the next major release.
|
|
28
25
|
*/
|
|
29
26
|
login: boolean;
|
|
30
27
|
/**
|
|
31
28
|
* Toggle the search button.
|
|
32
|
-
* @deprecated use the new configuration API to show or hide the search. This option will be removed in the next major release.
|
|
33
29
|
*/
|
|
34
30
|
search: boolean;
|
|
35
31
|
/**
|
|
36
32
|
* Toggle skiplinks. They help keyboard users to quickly jump to important sections of the page.
|
|
37
|
-
* @deprecated please implement the skiplinks component. This option will be removed in the next major release.
|
|
38
33
|
*/
|
|
39
34
|
skiplinks: boolean;
|
|
40
35
|
/**
|
|
41
36
|
* Define a proxy URL for the config fetch request.
|
|
42
|
-
* @deprecated this functionality will no longer be provided in the next major release and was deprecated previously.
|
|
43
37
|
*/
|
|
44
38
|
configProxy?: string;
|
|
45
39
|
/**
|
|
@@ -49,44 +43,36 @@ export declare class PostInternetHeader {
|
|
|
49
43
|
/**
|
|
50
44
|
* Override the language switch links with custom URLs. Helpful when your application contains sub-pages, and you
|
|
51
45
|
* would like to stay on subpages when the user changes language.
|
|
52
|
-
* @deprecated use the language menu slot to override the language switch and specify custom URLs. This option will be removed in the next major release.
|
|
53
46
|
*/
|
|
54
47
|
languageSwitchOverrides?: string | IAvailableLanguage[];
|
|
55
48
|
/**
|
|
56
49
|
* Customize the header config loaded from the post portal.
|
|
57
|
-
* @deprecated use the main navigation slot to add custom menu entries. This option will be removed in the next major release.
|
|
58
50
|
*/
|
|
59
51
|
customConfig?: string | ICustomConfig;
|
|
60
52
|
/**
|
|
61
53
|
* The header uses this cookie to set the language. Disables automatic language detection.
|
|
62
|
-
* @deprecated this will no longer be supported in the next major release due to low usage, in favor of a project-specific solution.
|
|
63
54
|
*/
|
|
64
55
|
languageCookieKey?: string;
|
|
65
56
|
/**
|
|
66
57
|
* The header uses this local storage key to set the language. Disables automatic language selection.
|
|
67
|
-
* @deprecated this will no longer be supported in the next major release due to low usage, in favor of a project-specific solution.
|
|
68
58
|
*/
|
|
69
59
|
languageLocalStorageKey?: string;
|
|
70
60
|
/**
|
|
71
61
|
* Overrides the logout-url provided by the portal config.
|
|
72
|
-
* @deprecated use the new configuration API to specify the logout URL. This option will be removed in the next major release.
|
|
73
62
|
*/
|
|
74
63
|
logoutUrl?: string;
|
|
75
64
|
/**
|
|
76
65
|
* Overrides the selfadmin url in case it needs to differ from the logoutUrl, which is the url that is used by default.
|
|
77
66
|
* The selfadmin url is used in the KLP login widget to set the user menu links.
|
|
78
|
-
* @deprecated use the new configuration API to specify these URLs. This option will be removed in the next major release.
|
|
79
67
|
*/
|
|
80
68
|
selfAdminOrigin?: string;
|
|
81
69
|
/**
|
|
82
70
|
* Set the currently activated route. If there is a link matching this URL in the header, it will be highlighted.
|
|
83
71
|
* Will also highlight partly matching URLs. When set to auto, will use current location.href for comparison.
|
|
84
|
-
* @deprecated boolean values will no longer be accepted in the next major release. Use "none" for false and "auto" for true. All other values remain unchanged.
|
|
85
72
|
*/
|
|
86
|
-
activeRoute?:
|
|
73
|
+
activeRoute?: ActiveRouteProp;
|
|
87
74
|
/**
|
|
88
75
|
* Online Services only: Add custom links to the special online service navigation entry
|
|
89
|
-
* @deprecatedthe new header will no longer include this flyout in the next major release. Use the main navigation slot to add application-specific menu items.
|
|
90
76
|
*/
|
|
91
77
|
osFlyoutOverrides?: string | NavMainEntity;
|
|
92
78
|
/**
|
|
@@ -104,7 +90,6 @@ export declare class PostInternetHeader {
|
|
|
104
90
|
/**
|
|
105
91
|
* Get the currently set language as a two letter string ("de", "fr" "it" or "en")
|
|
106
92
|
* @returns string
|
|
107
|
-
* @deprecated use `document.documentElement.lang` instead
|
|
108
93
|
*/
|
|
109
94
|
getCurrentLanguage(): Promise<'de' | 'fr' | 'it' | 'en' | string>;
|
|
110
95
|
private mainNav?;
|
|
@@ -9,13 +9,13 @@ import { DropdownEvent, NavMainEntity } from "./models/header.model";
|
|
|
9
9
|
import { Event } from "./stencil-public-runtime";
|
|
10
10
|
import { IBreadcrumbItem, IBreadcrumbOverlay } from "./models/breadcrumbs.model";
|
|
11
11
|
import { StickynessOptions } from "./models/implementor.model";
|
|
12
|
-
import { Environment, ICustomConfig } from "./models/general.model";
|
|
12
|
+
import { ActiveRouteProp, Environment, ICustomConfig } from "./models/general.model";
|
|
13
13
|
import { IAvailableLanguage } from "./models/language.model";
|
|
14
14
|
export { DropdownEvent, NavMainEntity } from "./models/header.model";
|
|
15
15
|
export { Event } from "./stencil-public-runtime";
|
|
16
16
|
export { IBreadcrumbItem, IBreadcrumbOverlay } from "./models/breadcrumbs.model";
|
|
17
17
|
export { StickynessOptions } from "./models/implementor.model";
|
|
18
|
-
export { Environment, ICustomConfig } from "./models/general.model";
|
|
18
|
+
export { ActiveRouteProp, Environment, ICustomConfig } from "./models/general.model";
|
|
19
19
|
export { IAvailableLanguage } from "./models/language.model";
|
|
20
20
|
export namespace Components {
|
|
21
21
|
/**
|
|
@@ -97,12 +97,10 @@ export namespace Components {
|
|
|
97
97
|
interface SwisspostInternetBreadcrumbs {
|
|
98
98
|
/**
|
|
99
99
|
* Add custom breadcrumb items to the end of the pre-configured list. Handy if your online service has its own navigation structure.
|
|
100
|
-
* @deprecated overlays will no longer be provided in the next major release, therefore this method will no longer be needed.
|
|
101
100
|
*/
|
|
102
101
|
"customItems"?: string | IBreadcrumbItem[];
|
|
103
102
|
/**
|
|
104
103
|
* Hide all buttons.
|
|
105
|
-
* @deprecated Help and Contact buttons will no longer be provided in the next major release, therefore this prop will no longer be needed.
|
|
106
104
|
*/
|
|
107
105
|
"hideButtons": boolean;
|
|
108
106
|
/**
|
|
@@ -116,17 +114,14 @@ export namespace Components {
|
|
|
116
114
|
interface SwisspostInternetHeader {
|
|
117
115
|
/**
|
|
118
116
|
* Set the currently activated route. If there is a link matching this URL in the header, it will be highlighted. Will also highlight partly matching URLs. When set to auto, will use current location.href for comparison.
|
|
119
|
-
* @deprecated boolean values will no longer be accepted in the next major release. Use "none" for false and "auto" for true. All other values remain unchanged.
|
|
120
117
|
*/
|
|
121
|
-
"activeRoute"?:
|
|
118
|
+
"activeRoute"?: ActiveRouteProp;
|
|
122
119
|
/**
|
|
123
120
|
* Define a proxy URL for the config fetch request.
|
|
124
|
-
* @deprecated this functionality will no longer be provided in the next major release and was deprecated previously.
|
|
125
121
|
*/
|
|
126
122
|
"configProxy"?: string;
|
|
127
123
|
/**
|
|
128
124
|
* Customize the header config loaded from the post portal.
|
|
129
|
-
* @deprecated use the main navigation slot to add custom menu entries. This option will be removed in the next major release.
|
|
130
125
|
*/
|
|
131
126
|
"customConfig"?: string | ICustomConfig;
|
|
132
127
|
/**
|
|
@@ -140,7 +135,6 @@ export namespace Components {
|
|
|
140
135
|
/**
|
|
141
136
|
* Get the currently set language as a two letter string ("de", "fr" "it" or "en")
|
|
142
137
|
* @returns string
|
|
143
|
-
* @deprecated use `document.documentElement.lang` instead
|
|
144
138
|
*/
|
|
145
139
|
"getCurrentLanguage": () => Promise<'de' | 'fr' | 'it' | 'en' | string>;
|
|
146
140
|
/**
|
|
@@ -149,37 +143,30 @@ export namespace Components {
|
|
|
149
143
|
"language"?: 'de' | 'fr' | 'it' | 'en';
|
|
150
144
|
/**
|
|
151
145
|
* The header uses this cookie to set the language. Disables automatic language detection.
|
|
152
|
-
* @deprecated this will no longer be supported in the next major release due to low usage, in favor of a project-specific solution.
|
|
153
146
|
*/
|
|
154
147
|
"languageCookieKey"?: string;
|
|
155
148
|
/**
|
|
156
149
|
* The header uses this local storage key to set the language. Disables automatic language selection.
|
|
157
|
-
* @deprecated this will no longer be supported in the next major release due to low usage, in favor of a project-specific solution.
|
|
158
150
|
*/
|
|
159
151
|
"languageLocalStorageKey"?: string;
|
|
160
152
|
/**
|
|
161
153
|
* Override the language switch links with custom URLs. Helpful when your application contains sub-pages, and you would like to stay on subpages when the user changes language.
|
|
162
|
-
* @deprecated use the language menu slot to override the language switch and specify custom URLs. This option will be removed in the next major release.
|
|
163
154
|
*/
|
|
164
155
|
"languageSwitchOverrides"?: string | IAvailableLanguage[];
|
|
165
156
|
/**
|
|
166
157
|
* Toggle the login link (when logged out) or the user widget (when logged in).
|
|
167
|
-
* @deprecated use the new configuration API to show or hide the login. This option will be removed in the next major release.
|
|
168
158
|
*/
|
|
169
159
|
"login": boolean;
|
|
170
160
|
/**
|
|
171
161
|
* Overrides the logout-url provided by the portal config.
|
|
172
|
-
* @deprecated use the new configuration API to specify the logout URL. This option will be removed in the next major release.
|
|
173
162
|
*/
|
|
174
163
|
"logoutUrl"?: string;
|
|
175
164
|
/**
|
|
176
165
|
* Toggle the meta navigation.
|
|
177
|
-
* @deprecated use the new configuration API to show or hide the meta navigation links. This option will be removed in the next major release.
|
|
178
166
|
*/
|
|
179
167
|
"meta": boolean;
|
|
180
168
|
/**
|
|
181
169
|
* Online Services only: Add custom links to the special online service navigation entry
|
|
182
|
-
* @deprecatedthe new header will no longer include this flyout in the next major release. Use the main navigation slot to add application-specific menu items.
|
|
183
170
|
*/
|
|
184
171
|
"osFlyoutOverrides"?: string | NavMainEntity;
|
|
185
172
|
/**
|
|
@@ -188,22 +175,18 @@ export namespace Components {
|
|
|
188
175
|
"project": string;
|
|
189
176
|
/**
|
|
190
177
|
* Toggle the search button.
|
|
191
|
-
* @deprecated use the new configuration API to show or hide the search. This option will be removed in the next major release.
|
|
192
178
|
*/
|
|
193
179
|
"search": boolean;
|
|
194
180
|
/**
|
|
195
181
|
* Overrides the selfadmin url in case it needs to differ from the logoutUrl, which is the url that is used by default. The selfadmin url is used in the KLP login widget to set the user menu links.
|
|
196
|
-
* @deprecated use the new configuration API to specify these URLs. This option will be removed in the next major release.
|
|
197
182
|
*/
|
|
198
183
|
"selfAdminOrigin"?: string;
|
|
199
184
|
/**
|
|
200
185
|
* Toggle skiplinks. They help keyboard users to quickly jump to important sections of the page.
|
|
201
|
-
* @deprecated please implement the skiplinks component. This option will be removed in the next major release.
|
|
202
186
|
*/
|
|
203
187
|
"skiplinks": boolean;
|
|
204
188
|
/**
|
|
205
189
|
* Sticky behaviour of the header.
|
|
206
|
-
* @deprecated this option will no longer be configurable with the new header in the next major release.
|
|
207
190
|
*/
|
|
208
191
|
"stickyness": StickynessOptions;
|
|
209
192
|
}
|
|
@@ -420,12 +403,10 @@ declare namespace LocalJSX {
|
|
|
420
403
|
interface SwisspostInternetBreadcrumbs {
|
|
421
404
|
/**
|
|
422
405
|
* Add custom breadcrumb items to the end of the pre-configured list. Handy if your online service has its own navigation structure.
|
|
423
|
-
* @deprecated overlays will no longer be provided in the next major release, therefore this method will no longer be needed.
|
|
424
406
|
*/
|
|
425
407
|
"customItems"?: string | IBreadcrumbItem[];
|
|
426
408
|
/**
|
|
427
409
|
* Hide all buttons.
|
|
428
|
-
* @deprecated Help and Contact buttons will no longer be provided in the next major release, therefore this prop will no longer be needed.
|
|
429
410
|
*/
|
|
430
411
|
"hideButtons"?: boolean;
|
|
431
412
|
}
|
|
@@ -434,17 +415,14 @@ declare namespace LocalJSX {
|
|
|
434
415
|
interface SwisspostInternetHeader {
|
|
435
416
|
/**
|
|
436
417
|
* Set the currently activated route. If there is a link matching this URL in the header, it will be highlighted. Will also highlight partly matching URLs. When set to auto, will use current location.href for comparison.
|
|
437
|
-
* @deprecated boolean values will no longer be accepted in the next major release. Use "none" for false and "auto" for true. All other values remain unchanged.
|
|
438
418
|
*/
|
|
439
|
-
"activeRoute"?:
|
|
419
|
+
"activeRoute"?: ActiveRouteProp;
|
|
440
420
|
/**
|
|
441
421
|
* Define a proxy URL for the config fetch request.
|
|
442
|
-
* @deprecated this functionality will no longer be provided in the next major release and was deprecated previously.
|
|
443
422
|
*/
|
|
444
423
|
"configProxy"?: string;
|
|
445
424
|
/**
|
|
446
425
|
* Customize the header config loaded from the post portal.
|
|
447
|
-
* @deprecated use the main navigation slot to add custom menu entries. This option will be removed in the next major release.
|
|
448
426
|
*/
|
|
449
427
|
"customConfig"?: string | ICustomConfig;
|
|
450
428
|
/**
|
|
@@ -461,32 +439,26 @@ declare namespace LocalJSX {
|
|
|
461
439
|
"language"?: 'de' | 'fr' | 'it' | 'en';
|
|
462
440
|
/**
|
|
463
441
|
* The header uses this cookie to set the language. Disables automatic language detection.
|
|
464
|
-
* @deprecated this will no longer be supported in the next major release due to low usage, in favor of a project-specific solution.
|
|
465
442
|
*/
|
|
466
443
|
"languageCookieKey"?: string;
|
|
467
444
|
/**
|
|
468
445
|
* The header uses this local storage key to set the language. Disables automatic language selection.
|
|
469
|
-
* @deprecated this will no longer be supported in the next major release due to low usage, in favor of a project-specific solution.
|
|
470
446
|
*/
|
|
471
447
|
"languageLocalStorageKey"?: string;
|
|
472
448
|
/**
|
|
473
449
|
* Override the language switch links with custom URLs. Helpful when your application contains sub-pages, and you would like to stay on subpages when the user changes language.
|
|
474
|
-
* @deprecated use the language menu slot to override the language switch and specify custom URLs. This option will be removed in the next major release.
|
|
475
450
|
*/
|
|
476
451
|
"languageSwitchOverrides"?: string | IAvailableLanguage[];
|
|
477
452
|
/**
|
|
478
453
|
* Toggle the login link (when logged out) or the user widget (when logged in).
|
|
479
|
-
* @deprecated use the new configuration API to show or hide the login. This option will be removed in the next major release.
|
|
480
454
|
*/
|
|
481
455
|
"login"?: boolean;
|
|
482
456
|
/**
|
|
483
457
|
* Overrides the logout-url provided by the portal config.
|
|
484
|
-
* @deprecated use the new configuration API to specify the logout URL. This option will be removed in the next major release.
|
|
485
458
|
*/
|
|
486
459
|
"logoutUrl"?: string;
|
|
487
460
|
/**
|
|
488
461
|
* Toggle the meta navigation.
|
|
489
|
-
* @deprecated use the new configuration API to show or hide the meta navigation links. This option will be removed in the next major release.
|
|
490
462
|
*/
|
|
491
463
|
"meta"?: boolean;
|
|
492
464
|
/**
|
|
@@ -495,7 +467,6 @@ declare namespace LocalJSX {
|
|
|
495
467
|
"onHeaderLoaded"?: (event: SwisspostInternetHeaderCustomEvent<void>) => void;
|
|
496
468
|
/**
|
|
497
469
|
* Online Services only: Add custom links to the special online service navigation entry
|
|
498
|
-
* @deprecatedthe new header will no longer include this flyout in the next major release. Use the main navigation slot to add application-specific menu items.
|
|
499
470
|
*/
|
|
500
471
|
"osFlyoutOverrides"?: string | NavMainEntity;
|
|
501
472
|
/**
|
|
@@ -504,22 +475,18 @@ declare namespace LocalJSX {
|
|
|
504
475
|
"project"?: string;
|
|
505
476
|
/**
|
|
506
477
|
* Toggle the search button.
|
|
507
|
-
* @deprecated use the new configuration API to show or hide the search. This option will be removed in the next major release.
|
|
508
478
|
*/
|
|
509
479
|
"search"?: boolean;
|
|
510
480
|
/**
|
|
511
481
|
* Overrides the selfadmin url in case it needs to differ from the logoutUrl, which is the url that is used by default. The selfadmin url is used in the KLP login widget to set the user menu links.
|
|
512
|
-
* @deprecated use the new configuration API to specify these URLs. This option will be removed in the next major release.
|
|
513
482
|
*/
|
|
514
483
|
"selfAdminOrigin"?: string;
|
|
515
484
|
/**
|
|
516
485
|
* Toggle skiplinks. They help keyboard users to quickly jump to important sections of the page.
|
|
517
|
-
* @deprecated please implement the skiplinks component. This option will be removed in the next major release.
|
|
518
486
|
*/
|
|
519
487
|
"skiplinks"?: boolean;
|
|
520
488
|
/**
|
|
521
489
|
* Sticky behaviour of the header.
|
|
522
|
-
* @deprecated this option will no longer be configurable with the new header in the next major release.
|
|
523
490
|
*/
|
|
524
491
|
"stickyness"?: StickynessOptions;
|
|
525
492
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swisspost/internet-header",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.2",
|
|
4
4
|
"description": "The header for client facing applications.",
|
|
5
5
|
"author": "Swiss Post <design-system@post.ch>",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"loader/"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@swisspost/design-system-styles": "9.
|
|
30
|
+
"@swisspost/design-system-styles": "9.9.0",
|
|
31
31
|
"body-scroll-lock": "4.0.0-beta.0",
|
|
32
32
|
"iframe-resizer": "4.4.5",
|
|
33
33
|
"jquery": "3.7.1",
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{r as n,h as t,H as e,g as r}from"./p-67f6b5a8.js";
|
|
2
|
-
/*!
|
|
3
|
-
* tabbable 6.4.0
|
|
4
|
-
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
5
|
-
*/
|
|
6
|
-
var i=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],o=i.join(","),u="undefined"==typeof Element,a=u?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,c=!u&&Element.prototype.getRootNode?function(n){var t;return null==n||null===(t=n.getRootNode)||void 0===t?void 0:t.call(n)}:function(n){return null==n?void 0:n.ownerDocument},f=function(n,t){var e;void 0===t&&(t=!0);var r=null==n||null===(e=n.getAttribute)||void 0===e?void 0:e.call(n,"inert");return""===r||"true"===r||t&&n&&("function"==typeof n.closest?n.closest("[inert]"):f(n.parentNode))},l=function(n,t,e){if(f(n))return[];var r=Array.prototype.slice.apply(n.querySelectorAll(o));return t&&a.call(n,o)&&r.unshift(n),r.filter(e)},s=function(n,t,e){for(var r=[],i=Array.from(n);i.length;){var u=i.shift();if(!f(u,!1))if("SLOT"===u.tagName){var c=u.assignedElements(),l=s(c.length?c:u.children,!0,e);e.flatten?r.push.apply(r,l):r.push({scopeParent:u,candidates:l})}else{a.call(u,o)&&e.filter(u)&&(t||!n.includes(u))&&r.push(u);var v=u.shadowRoot||"function"==typeof e.getShadowRoot&&e.getShadowRoot(u),d=!f(v,!1)&&(!e.shadowRootFilter||e.shadowRootFilter(u));if(v&&d){var p=s(!0===v?u.children:v.children,!0,e);e.flatten?r.push.apply(r,p):r.push({scopeParent:u,candidates:p})}else i.unshift.apply(i,u.children)}}return r},v=function(n){return!isNaN(parseInt(n.getAttribute("tabindex"),10))},d=function(n){if(!n)throw new Error("No node provided");return n.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(n.tagName)||function(n){var t,e=null==n||null===(t=n.getAttribute)||void 0===t?void 0:t.call(n,"contenteditable");return""===e||"true"===e}(n))&&!v(n)?0:n.tabIndex},p=function(n,t){return n.tabIndex===t.tabIndex?n.documentOrder-t.documentOrder:n.tabIndex-t.tabIndex},b=function(n){return"INPUT"===n.tagName},h=function(n){var t=n.getBoundingClientRect();return 0===t.width&&0===t.height},y=function(n,t){return!(t.disabled||function(n){return b(n)&&"hidden"===n.type}(t)||function(n,t){var e=t.displayCheck,r=t.getShadowRoot;if("full-native"===e&&"checkVisibility"in n)return!n.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if("hidden"===getComputedStyle(n).visibility)return!0;var i=a.call(n,"details>summary:first-of-type");if(a.call(i?n.parentElement:n,"details:not([open]) *"))return!0;if(e&&"full"!==e&&"full-native"!==e&&"legacy-full"!==e){if("non-zero-area"===e)return h(n)}else{if("function"==typeof r){for(var o=n;n;){var u=n.parentElement,f=c(n);if(u&&!u.shadowRoot&&!0===r(u))return h(n);n=n.assignedSlot?n.assignedSlot:u||f===n.ownerDocument?u:f.host}n=o}if(function(n){var t,e,r,i,o=n&&c(n),u=null===(t=o)||void 0===t?void 0:t.host,a=!1;if(o&&o!==n)for(a=!!(null!==(e=u)&&void 0!==e&&null!==(r=e.ownerDocument)&&void 0!==r&&r.contains(u)||null!=n&&null!==(i=n.ownerDocument)&&void 0!==i&&i.contains(n));!a&&u;){var f,l,s;a=!(null===(l=u=null===(f=o=c(u))||void 0===f?void 0:f.host)||void 0===l||null===(s=l.ownerDocument)||void 0===s||!s.contains(u))}return a}(n))return!n.getClientRects().length;if("legacy-full"!==e)return!0}return!1}(t,n)||function(n){return"DETAILS"===n.tagName&&Array.prototype.slice.apply(n.children).some((function(n){return"SUMMARY"===n.tagName}))}(t)||function(n){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(n.tagName))for(var t=n.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var e=0;e<t.children.length;e++){var r=t.children.item(e);if("LEGEND"===r.tagName)return!!a.call(t,"fieldset[disabled] *")||!r.contains(n)}return!0}t=t.parentElement}return!1}(t))},w=function(n,t){return!(function(n){return function(n){return b(n)&&"radio"===n.type}(n)&&!function(n){if(!n.name)return!0;var t,e=n.form||c(n),r=function(n){return e.querySelectorAll('input[type="radio"][name="'+n+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(n.name));else try{t=r(n.name)}catch(n){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",n.message),!1}var i=function(n,t){for(var e=0;e<n.length;e++)if(n[e].checked&&n[e].form===t)return n[e]}(t,n.form);return!i||i===n}(n)}(t)||d(t)<0||!y(n,t))},m=function(n){var t=parseInt(n.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},E=function(n){var t=[],e=[];return n.forEach((function(n,r){var i=!!n.scopeParent,o=i?n.scopeParent:n,u=function(n,t){var e=d(n);return e<0&&t&&!v(n)?0:e}(o,i),a=i?E(n.candidates):o;0===u?i?t.push.apply(t,a):t.push(o):e.push({documentOrder:r,tabIndex:u,item:n,isScope:i,content:a})})),e.sort(p).reduce((function(n,t){return t.isScope?n.push.apply(n,t.content):n.push(t.content),n}),[]).concat(t)},k=function(n,t){if(t=t||{},!n)throw new Error("No node provided");return!1!==a.call(n,o)&&w(t,n)},T=i.concat("iframe:not([inert]):not([inert] *)").join(","),g=function(n,t){if(t=t||{},!n)throw new Error("No node provided");return!1!==a.call(n,T)&&y(t,n)};
|
|
7
|
-
/*!
|
|
8
|
-
* focus-trap 7.5.4
|
|
9
|
-
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
|
|
10
|
-
*/
|
|
11
|
-
function O(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),e.push.apply(e,r)}return e}function F(n){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?O(Object(e),!0).forEach((function(t){var r,i,o;r=n,o=e[t],(i=function(n){var t=function(n){if("object"!=typeof n||null===n)return n;var t=n[Symbol.toPrimitive];if(void 0!==t){var e=t.call(n,"string");if("object"!=typeof e)return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}(n);return"symbol"==typeof t?t:String(t)}(i=t))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):O(Object(e)).forEach((function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(e,t))}))}return n}var N=function(n){return"Tab"===(null==n?void 0:n.key)||9===(null==n?void 0:n.keyCode)},S=function(n){return N(n)&&!n.shiftKey},A=function(n){return N(n)&&n.shiftKey},D=function(n){return setTimeout(n,0)},j=function(n,t){var e=-1;return n.every((function(n,r){return!t(n)||(e=r,!1)})),e},P=function(n){for(var t=arguments.length,e=new Array(t>1?t-1:0),r=1;r<t;r++)e[r-1]=arguments[r];return"function"==typeof n?n.apply(void 0,e):n},C=function(n){return n.target.shadowRoot&&"function"==typeof n.composedPath?n.composedPath()[0]:n.target},I=[];const x=class{constructor(t){n(this,t),this.active=!1,this.trap=void 0}handleActiveChange(n){this.toggleTrap(n)}connectedCallback(){var n,t,e,r,i,o,u,a,c,f,v,p,b,h,T,O,x,L,R,U,B,M,V,G,Y;this.trap||(this.trap=(t=null===(n=this.host)||void 0===n?void 0:n.firstElementChild,i=(null==(e={allowOutsideClick:!0})?void 0:e.document)||document,o=(null==e?void 0:e.trapStack)||I,u=F({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:S,isKeyBackward:A},e),a={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},c=function(n,t,e){return n&&void 0!==n[t]?n[t]:u[e||t]},f=function(n,t){var e="function"==typeof(null==t?void 0:t.composedPath)?t.composedPath():void 0;return a.containerGroups.findIndex((function(t){var r=t.container,i=t.tabbableNodes;return r.contains(n)||(null==e?void 0:e.includes(r))||i.find((function(t){return t===n}))}))},v=function(n){var t=u[n];if("function"==typeof t){for(var e=arguments.length,r=new Array(e>1?e-1:0),o=1;o<e;o++)r[o-1]=arguments[o];t=t.apply(void 0,r)}if(!0===t&&(t=void 0),!t){if(void 0===t||!1===t)return t;throw new Error("`".concat(n,"` was specified but was not a node, or did not return a node"))}var a=t;if("string"==typeof t&&!(a=i.querySelector(t)))throw new Error("`".concat(n,"` as selector refers to no known node"));return a},p=function(){var n=v("initialFocus");if(!1===n)return!1;if(void 0===n||!g(n,u.tabbableOptions))if(f(i.activeElement)>=0)n=i.activeElement;else{var t=a.tabbableGroups[0];n=t&&t.firstTabbableNode||v("fallbackFocus")}if(!n)throw new Error("Your focus-trap needs to have at least one focusable element");return n},b=function(){if(a.containerGroups=a.containers.map((function(n){var t=function(n,t){var e;return e=(t=t||{}).getShadowRoot?s([n],t.includeContainer,{filter:w.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:m}):l(n,t.includeContainer,w.bind(null,t)),E(e)}(n,u.tabbableOptions),e=function(n,t){return(t=t||{}).getShadowRoot?s([n],t.includeContainer,{filter:y.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):l(n,t.includeContainer,y.bind(null,t))}(n,u.tabbableOptions),r=t.length>0?t[0]:void 0,i=t.length>0?t[t.length-1]:void 0,o=e.find((function(n){return k(n)})),a=e.slice().reverse().find((function(n){return k(n)})),c=!!t.find((function(n){return d(n)>0}));return{container:n,tabbableNodes:t,focusableNodes:e,posTabIndexesFound:c,firstTabbableNode:r,lastTabbableNode:i,firstDomTabbableNode:o,lastDomTabbableNode:a,nextTabbableNode:function(n){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=t.indexOf(n);return i<0?r?e.slice(e.indexOf(n)+1).find((function(n){return k(n)})):e.slice(0,e.indexOf(n)).reverse().find((function(n){return k(n)})):t[i+(r?1:-1)]}}})),a.tabbableGroups=a.containerGroups.filter((function(n){return n.tabbableNodes.length>0})),a.tabbableGroups.length<=0&&!v("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(a.containerGroups.find((function(n){return n.posTabIndexesFound}))&&a.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},h=function n(t){var e=t.activeElement;if(e)return e.shadowRoot&&null!==e.shadowRoot.activeElement?n(e.shadowRoot):e},T=function n(t){!1!==t&&t!==h(document)&&(t&&t.focus?(t.focus({preventScroll:!!u.preventScroll}),a.mostRecentlyFocusedNode=t,function(n){return n.tagName&&"input"===n.tagName.toLowerCase()&&"function"==typeof n.select}(t)&&t.select()):n(p()))},O=function(n){var t=v("setReturnFocus",n);return t||!1!==t&&n},x=function(n){var t=n.target,e=n.event,r=n.isBackward,i=void 0!==r&&r;t=t||C(e),b();var o=null;if(a.tabbableGroups.length>0){var c=f(t,e),l=c>=0?a.containerGroups[c]:void 0;if(c<0)o=i?a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode:a.tabbableGroups[0].firstTabbableNode;else if(i){var s=j(a.tabbableGroups,(function(n){return t===n.firstTabbableNode}));if(s<0&&(l.container===t||g(t,u.tabbableOptions)&&!k(t,u.tabbableOptions)&&!l.nextTabbableNode(t,!1))&&(s=c),s>=0){var p=a.tabbableGroups[0===s?a.tabbableGroups.length-1:s-1];o=d(t)>=0?p.lastTabbableNode:p.lastDomTabbableNode}else N(e)||(o=l.nextTabbableNode(t,!1))}else{var h=j(a.tabbableGroups,(function(n){return t===n.lastTabbableNode}));if(h<0&&(l.container===t||g(t,u.tabbableOptions)&&!k(t,u.tabbableOptions)&&!l.nextTabbableNode(t))&&(h=c),h>=0){var y=a.tabbableGroups[h===a.tabbableGroups.length-1?0:h+1];o=d(t)>=0?y.firstTabbableNode:y.firstDomTabbableNode}else N(e)||(o=l.nextTabbableNode(t))}}else o=v("fallbackFocus");return o},L=function(n){var t=C(n);f(t,n)>=0||(P(u.clickOutsideDeactivates,n)?r.deactivate({returnFocus:u.returnFocusOnDeactivate}):P(u.allowOutsideClick,n)||n.preventDefault())},R=function(n){var t=C(n),e=f(t,n)>=0;if(e||t instanceof Document)e&&(a.mostRecentlyFocusedNode=t);else{var r;n.stopImmediatePropagation();var i=!0;if(a.mostRecentlyFocusedNode)if(d(a.mostRecentlyFocusedNode)>0){var o=f(a.mostRecentlyFocusedNode),c=a.containerGroups[o].tabbableNodes;if(c.length>0){var l=c.findIndex((function(n){return n===a.mostRecentlyFocusedNode}));l>=0&&(u.isKeyForward(a.recentNavEvent)?l+1<c.length&&(r=c[l+1],i=!1):l-1>=0&&(r=c[l-1],i=!1))}}else a.containerGroups.some((function(n){return n.tabbableNodes.some((function(n){return d(n)>0}))}))||(i=!1);else i=!1;i&&(r=x({target:a.mostRecentlyFocusedNode,isBackward:u.isKeyBackward(a.recentNavEvent)})),T(r||a.mostRecentlyFocusedNode||p())}a.recentNavEvent=void 0},U=function(n){if(("Escape"===(null==(t=n)?void 0:t.key)||"Esc"===(null==t?void 0:t.key)||27===(null==t?void 0:t.keyCode))&&!1!==P(u.escapeDeactivates,n))return n.preventDefault(),void r.deactivate();var t;(u.isKeyForward(n)||u.isKeyBackward(n))&&function(n){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];a.recentNavEvent=n;var e=x({event:n,isBackward:t});e&&(N(n)&&n.preventDefault(),T(e))}(n,u.isKeyBackward(n))},B=function(n){var t=C(n);f(t,n)>=0||P(u.clickOutsideDeactivates,n)||P(u.allowOutsideClick,n)||(n.preventDefault(),n.stopImmediatePropagation())},M=function(){if(a.active)return function(n,t){if(n.length>0){var e=n[n.length-1];e!==t&&e.pause()}var r=n.indexOf(t);-1===r||n.splice(r,1),n.push(t)}(o,r),a.delayInitialFocusTimer=u.delayInitialFocus?D((function(){T(p())})):T(p()),i.addEventListener("focusin",R,!0),i.addEventListener("mousedown",L,{capture:!0,passive:!1}),i.addEventListener("touchstart",L,{capture:!0,passive:!1}),i.addEventListener("click",B,{capture:!0,passive:!1}),i.addEventListener("keydown",U,{capture:!0,passive:!1}),r},V=function(){if(a.active)return i.removeEventListener("focusin",R,!0),i.removeEventListener("mousedown",L,!0),i.removeEventListener("touchstart",L,!0),i.removeEventListener("click",B,!0),i.removeEventListener("keydown",U,!0),r},G="undefined"!=typeof window&&"MutationObserver"in window?new MutationObserver((function(n){n.some((function(n){return Array.from(n.removedNodes).some((function(n){return n===a.mostRecentlyFocusedNode}))}))&&T(p())})):void 0,Y=function(){G&&(G.disconnect(),a.active&&!a.paused&&a.containers.map((function(n){G.observe(n,{subtree:!0,childList:!0})})))},(r={get active(){return a.active},get paused(){return a.paused},activate:function(n){if(a.active)return this;var t=c(n,"onActivate"),e=c(n,"onPostActivate"),r=c(n,"checkCanFocusTrap");r||b(),a.active=!0,a.paused=!1,a.nodeFocusedBeforeActivation=i.activeElement,null==t||t();var o=function(){r&&b(),M(),Y(),null==e||e()};return r?(r(a.containers.concat()).then(o,o),this):(o(),this)},deactivate:function(n){if(!a.active)return this;var t=F({onDeactivate:u.onDeactivate,onPostDeactivate:u.onPostDeactivate,checkCanReturnFocus:u.checkCanReturnFocus},n);clearTimeout(a.delayInitialFocusTimer),a.delayInitialFocusTimer=void 0,V(),a.active=!1,a.paused=!1,Y(),function(n,t){var e=n.indexOf(t);-1!==e&&n.splice(e,1),n.length>0&&n[n.length-1].unpause()}(o,r);var e=c(t,"onDeactivate"),i=c(t,"onPostDeactivate"),f=c(t,"checkCanReturnFocus"),l=c(t,"returnFocus","returnFocusOnDeactivate");null==e||e();var s=function(){D((function(){l&&T(O(a.nodeFocusedBeforeActivation)),null==i||i()}))};return l&&f?(f(O(a.nodeFocusedBeforeActivation)).then(s,s),this):(s(),this)},pause:function(n){if(a.paused||!a.active)return this;var t=c(n,"onPause"),e=c(n,"onPostPause");return a.paused=!0,null==t||t(),V(),Y(),null==e||e(),this},unpause:function(n){if(!a.paused||!a.active)return this;var t=c(n,"onUnpause"),e=c(n,"onPostUnpause");return a.paused=!1,null==t||t(),b(),M(),Y(),null==e||e(),this},updateContainerElements:function(n){var t=[].concat(n).filter(Boolean);return a.containers=t.map((function(n){return"string"==typeof n?i.querySelector(n):n})),a.active&&b(),Y(),this}}).updateContainerElements(t),r))}componentDidLoad(){this.toggleTrap(this.active)}disconnectedCallback(){var n;null===(n=this.trap)||void 0===n||n.deactivate()}toggleTrap(n){var t,e;n?null===(t=this.trap)||void 0===t||t.activate():null===(e=this.trap)||void 0===e||e.deactivate()}render(){return t(e,{key:"40e6912cae0ae3e92b46cf4d251e1b1a47320d0f"},t("slot",{key:"39fe2c6ad0e0b419090ac8270840a83e49c286cf"}))}get host(){return r(this)}static get watchers(){return{active:["handleActiveChange"]}}};export{x as focus_trap}
|