@mintplayer/web-components 2.0.2 → 2.1.1
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/carousel/src/styles/carousel.styles.d.ts +2 -0
- package/dropdown/src/styles/dropdown.styles.d.ts +2 -0
- package/dropdown-menu/index.d.ts +1 -0
- package/dropdown-menu/index.mjs +562 -0
- package/dropdown-menu/src/components/index.d.ts +1 -0
- package/dropdown-menu/src/components/mp-dropdown-element.d.ts +19 -0
- package/dropdown-menu/src/components/mp-dropdown-menu.d.ts +46 -0
- package/dropdown-menu/src/index.d.ts +3 -0
- package/dropdown-menu/src/styles/index.d.ts +1 -0
- package/dropdown-menu/src/types/dropdown.d.ts +9 -0
- package/dropdown-menu/src/types/index.d.ts +1 -0
- package/navbar/index.d.ts +1 -0
- package/navbar/index.mjs +1361 -0
- package/navbar/src/components/index.d.ts +4 -0
- package/navbar/src/components/mp-navbar-brand.d.ts +13 -0
- package/navbar/src/components/mp-navbar-dropdown.d.ts +35 -0
- package/navbar/src/components/mp-navbar-element.d.ts +9 -0
- package/navbar/src/components/mp-navbar-item.d.ts +16 -0
- package/navbar/src/components/mp-navbar.d.ts +52 -0
- package/navbar/src/index.d.ts +3 -0
- package/navbar/src/styles/index.d.ts +4 -0
- package/navbar/src/types/index.d.ts +1 -0
- package/navbar/src/types/navbar.d.ts +7 -0
- package/package.json +9 -1
- package/dropdown-menu/src/styles/dropdown-divider.styles.d.ts +0 -2
- package/dropdown-menu/src/styles/dropdown-header.styles.d.ts +0 -2
- package/dropdown-menu/src/styles/dropdown-item.styles.d.ts +0 -2
package/navbar/index.mjs
ADDED
|
@@ -0,0 +1,1361 @@
|
|
|
1
|
+
import { unsafeCSS as e, LitElement as d, html as o } from "lit";
|
|
2
|
+
import { OverlayController as v } from "../overlay/index.mjs";
|
|
3
|
+
const p = e(`.navbar {
|
|
4
|
+
--bs-navbar-padding-x: 0;
|
|
5
|
+
--bs-navbar-padding-y: 0.5rem;
|
|
6
|
+
--bs-navbar-color: rgba(var(--bs-emphasis-color-rgb), 0.65);
|
|
7
|
+
--bs-navbar-hover-color: rgba(var(--bs-emphasis-color-rgb), 0.8);
|
|
8
|
+
--bs-navbar-disabled-color: rgba(var(--bs-emphasis-color-rgb), 0.3);
|
|
9
|
+
--bs-navbar-active-color: rgba(var(--bs-emphasis-color-rgb), 1);
|
|
10
|
+
--bs-navbar-brand-padding-y: 0.3125rem;
|
|
11
|
+
--bs-navbar-brand-margin-end: 1rem;
|
|
12
|
+
--bs-navbar-brand-font-size: 1.25rem;
|
|
13
|
+
--bs-navbar-brand-color: rgba(var(--bs-emphasis-color-rgb), 1);
|
|
14
|
+
--bs-navbar-brand-hover-color: rgba(var(--bs-emphasis-color-rgb), 1);
|
|
15
|
+
--bs-navbar-nav-link-padding-x: 0.5rem;
|
|
16
|
+
--bs-navbar-toggler-padding-y: 0.25rem;
|
|
17
|
+
--bs-navbar-toggler-padding-x: 0.75rem;
|
|
18
|
+
--bs-navbar-toggler-font-size: 1.25rem;
|
|
19
|
+
--bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2833, 37, 41, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
|
|
20
|
+
--bs-navbar-toggler-border-color: rgba(var(--bs-emphasis-color-rgb), 0.15);
|
|
21
|
+
--bs-navbar-toggler-border-radius: var(--bs-border-radius);
|
|
22
|
+
--bs-navbar-toggler-focus-width: 0.25rem;
|
|
23
|
+
--bs-navbar-toggler-transition: box-shadow 0.15s ease-in-out;
|
|
24
|
+
position: relative;
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-wrap: wrap;
|
|
27
|
+
align-items: center;
|
|
28
|
+
justify-content: space-between;
|
|
29
|
+
padding: var(--bs-navbar-padding-y) var(--bs-navbar-padding-x);
|
|
30
|
+
}
|
|
31
|
+
.navbar > .container-xxl, .navbar > .container-xl, .navbar > .container-lg, .navbar > .container-md, .navbar > .container-sm, .navbar > .container,
|
|
32
|
+
.navbar > .container-fluid {
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-wrap: inherit;
|
|
35
|
+
align-items: center;
|
|
36
|
+
justify-content: space-between;
|
|
37
|
+
}
|
|
38
|
+
.navbar-brand {
|
|
39
|
+
padding-top: var(--bs-navbar-brand-padding-y);
|
|
40
|
+
padding-bottom: var(--bs-navbar-brand-padding-y);
|
|
41
|
+
margin-right: var(--bs-navbar-brand-margin-end);
|
|
42
|
+
font-size: var(--bs-navbar-brand-font-size);
|
|
43
|
+
color: var(--bs-navbar-brand-color);
|
|
44
|
+
text-decoration: none;
|
|
45
|
+
white-space: nowrap;
|
|
46
|
+
}
|
|
47
|
+
.navbar-brand:hover, .navbar-brand:focus {
|
|
48
|
+
color: var(--bs-navbar-brand-hover-color);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.navbar-nav {
|
|
52
|
+
--bs-nav-link-padding-x: 0;
|
|
53
|
+
--bs-nav-link-padding-y: 0.5rem;
|
|
54
|
+
--bs-nav-link-font-weight: ;
|
|
55
|
+
--bs-nav-link-color: var(--bs-navbar-color);
|
|
56
|
+
--bs-nav-link-hover-color: var(--bs-navbar-hover-color);
|
|
57
|
+
--bs-nav-link-disabled-color: var(--bs-navbar-disabled-color);
|
|
58
|
+
display: flex;
|
|
59
|
+
flex-direction: column;
|
|
60
|
+
padding-left: 0;
|
|
61
|
+
margin-bottom: 0;
|
|
62
|
+
list-style: none;
|
|
63
|
+
}
|
|
64
|
+
.navbar-nav .nav-link.active, .navbar-nav .nav-link.show {
|
|
65
|
+
color: var(--bs-navbar-active-color);
|
|
66
|
+
}
|
|
67
|
+
.navbar-nav .dropdown-menu {
|
|
68
|
+
position: static;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.navbar-text {
|
|
72
|
+
padding-top: 0.5rem;
|
|
73
|
+
padding-bottom: 0.5rem;
|
|
74
|
+
color: var(--bs-navbar-color);
|
|
75
|
+
}
|
|
76
|
+
.navbar-text a,
|
|
77
|
+
.navbar-text a:hover,
|
|
78
|
+
.navbar-text a:focus {
|
|
79
|
+
color: var(--bs-navbar-active-color);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.navbar-collapse {
|
|
83
|
+
flex-grow: 1;
|
|
84
|
+
flex-basis: 100%;
|
|
85
|
+
align-items: center;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.navbar-toggler {
|
|
89
|
+
padding: var(--bs-navbar-toggler-padding-y) var(--bs-navbar-toggler-padding-x);
|
|
90
|
+
font-size: var(--bs-navbar-toggler-font-size);
|
|
91
|
+
line-height: 1;
|
|
92
|
+
color: var(--bs-navbar-color);
|
|
93
|
+
background-color: transparent;
|
|
94
|
+
border: var(--bs-border-width) solid var(--bs-navbar-toggler-border-color);
|
|
95
|
+
border-radius: var(--bs-navbar-toggler-border-radius);
|
|
96
|
+
transition: var(--bs-navbar-toggler-transition);
|
|
97
|
+
}
|
|
98
|
+
@media (prefers-reduced-motion: reduce) {
|
|
99
|
+
.navbar-toggler {
|
|
100
|
+
transition: none;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
.navbar-toggler:hover {
|
|
104
|
+
text-decoration: none;
|
|
105
|
+
}
|
|
106
|
+
.navbar-toggler:focus {
|
|
107
|
+
text-decoration: none;
|
|
108
|
+
outline: 0;
|
|
109
|
+
box-shadow: 0 0 0 var(--bs-navbar-toggler-focus-width);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.navbar-toggler-icon {
|
|
113
|
+
display: inline-block;
|
|
114
|
+
width: 1.5em;
|
|
115
|
+
height: 1.5em;
|
|
116
|
+
vertical-align: middle;
|
|
117
|
+
background-image: var(--bs-navbar-toggler-icon-bg);
|
|
118
|
+
background-repeat: no-repeat;
|
|
119
|
+
background-position: center;
|
|
120
|
+
background-size: 100%;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.navbar-nav-scroll {
|
|
124
|
+
max-height: var(--bs-scroll-height, 75vh);
|
|
125
|
+
overflow-y: auto;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
@media (min-width: 576px) {
|
|
129
|
+
.navbar-expand-sm {
|
|
130
|
+
flex-wrap: nowrap;
|
|
131
|
+
justify-content: flex-start;
|
|
132
|
+
}
|
|
133
|
+
.navbar-expand-sm .navbar-nav {
|
|
134
|
+
flex-direction: row;
|
|
135
|
+
}
|
|
136
|
+
.navbar-expand-sm .navbar-nav .dropdown-menu {
|
|
137
|
+
position: absolute;
|
|
138
|
+
}
|
|
139
|
+
.navbar-expand-sm .navbar-nav .nav-link {
|
|
140
|
+
padding-right: var(--bs-navbar-nav-link-padding-x);
|
|
141
|
+
padding-left: var(--bs-navbar-nav-link-padding-x);
|
|
142
|
+
}
|
|
143
|
+
.navbar-expand-sm .navbar-nav-scroll {
|
|
144
|
+
overflow: visible;
|
|
145
|
+
}
|
|
146
|
+
.navbar-expand-sm .navbar-collapse {
|
|
147
|
+
display: flex !important;
|
|
148
|
+
flex-basis: auto;
|
|
149
|
+
}
|
|
150
|
+
.navbar-expand-sm .navbar-toggler {
|
|
151
|
+
display: none;
|
|
152
|
+
}
|
|
153
|
+
.navbar-expand-sm .offcanvas {
|
|
154
|
+
position: static;
|
|
155
|
+
z-index: auto;
|
|
156
|
+
flex-grow: 1;
|
|
157
|
+
width: auto !important;
|
|
158
|
+
height: auto !important;
|
|
159
|
+
visibility: visible !important;
|
|
160
|
+
background-color: transparent !important;
|
|
161
|
+
border: 0 !important;
|
|
162
|
+
transform: none !important;
|
|
163
|
+
transition: none;
|
|
164
|
+
}
|
|
165
|
+
.navbar-expand-sm .offcanvas .offcanvas-header {
|
|
166
|
+
display: none;
|
|
167
|
+
}
|
|
168
|
+
.navbar-expand-sm .offcanvas .offcanvas-body {
|
|
169
|
+
display: flex;
|
|
170
|
+
flex-grow: 0;
|
|
171
|
+
padding: 0;
|
|
172
|
+
overflow-y: visible;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
@media (min-width: 768px) {
|
|
176
|
+
.navbar-expand-md {
|
|
177
|
+
flex-wrap: nowrap;
|
|
178
|
+
justify-content: flex-start;
|
|
179
|
+
}
|
|
180
|
+
.navbar-expand-md .navbar-nav {
|
|
181
|
+
flex-direction: row;
|
|
182
|
+
}
|
|
183
|
+
.navbar-expand-md .navbar-nav .dropdown-menu {
|
|
184
|
+
position: absolute;
|
|
185
|
+
}
|
|
186
|
+
.navbar-expand-md .navbar-nav .nav-link {
|
|
187
|
+
padding-right: var(--bs-navbar-nav-link-padding-x);
|
|
188
|
+
padding-left: var(--bs-navbar-nav-link-padding-x);
|
|
189
|
+
}
|
|
190
|
+
.navbar-expand-md .navbar-nav-scroll {
|
|
191
|
+
overflow: visible;
|
|
192
|
+
}
|
|
193
|
+
.navbar-expand-md .navbar-collapse {
|
|
194
|
+
display: flex !important;
|
|
195
|
+
flex-basis: auto;
|
|
196
|
+
}
|
|
197
|
+
.navbar-expand-md .navbar-toggler {
|
|
198
|
+
display: none;
|
|
199
|
+
}
|
|
200
|
+
.navbar-expand-md .offcanvas {
|
|
201
|
+
position: static;
|
|
202
|
+
z-index: auto;
|
|
203
|
+
flex-grow: 1;
|
|
204
|
+
width: auto !important;
|
|
205
|
+
height: auto !important;
|
|
206
|
+
visibility: visible !important;
|
|
207
|
+
background-color: transparent !important;
|
|
208
|
+
border: 0 !important;
|
|
209
|
+
transform: none !important;
|
|
210
|
+
transition: none;
|
|
211
|
+
}
|
|
212
|
+
.navbar-expand-md .offcanvas .offcanvas-header {
|
|
213
|
+
display: none;
|
|
214
|
+
}
|
|
215
|
+
.navbar-expand-md .offcanvas .offcanvas-body {
|
|
216
|
+
display: flex;
|
|
217
|
+
flex-grow: 0;
|
|
218
|
+
padding: 0;
|
|
219
|
+
overflow-y: visible;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
@media (min-width: 992px) {
|
|
223
|
+
.navbar-expand-lg {
|
|
224
|
+
flex-wrap: nowrap;
|
|
225
|
+
justify-content: flex-start;
|
|
226
|
+
}
|
|
227
|
+
.navbar-expand-lg .navbar-nav {
|
|
228
|
+
flex-direction: row;
|
|
229
|
+
}
|
|
230
|
+
.navbar-expand-lg .navbar-nav .dropdown-menu {
|
|
231
|
+
position: absolute;
|
|
232
|
+
}
|
|
233
|
+
.navbar-expand-lg .navbar-nav .nav-link {
|
|
234
|
+
padding-right: var(--bs-navbar-nav-link-padding-x);
|
|
235
|
+
padding-left: var(--bs-navbar-nav-link-padding-x);
|
|
236
|
+
}
|
|
237
|
+
.navbar-expand-lg .navbar-nav-scroll {
|
|
238
|
+
overflow: visible;
|
|
239
|
+
}
|
|
240
|
+
.navbar-expand-lg .navbar-collapse {
|
|
241
|
+
display: flex !important;
|
|
242
|
+
flex-basis: auto;
|
|
243
|
+
}
|
|
244
|
+
.navbar-expand-lg .navbar-toggler {
|
|
245
|
+
display: none;
|
|
246
|
+
}
|
|
247
|
+
.navbar-expand-lg .offcanvas {
|
|
248
|
+
position: static;
|
|
249
|
+
z-index: auto;
|
|
250
|
+
flex-grow: 1;
|
|
251
|
+
width: auto !important;
|
|
252
|
+
height: auto !important;
|
|
253
|
+
visibility: visible !important;
|
|
254
|
+
background-color: transparent !important;
|
|
255
|
+
border: 0 !important;
|
|
256
|
+
transform: none !important;
|
|
257
|
+
transition: none;
|
|
258
|
+
}
|
|
259
|
+
.navbar-expand-lg .offcanvas .offcanvas-header {
|
|
260
|
+
display: none;
|
|
261
|
+
}
|
|
262
|
+
.navbar-expand-lg .offcanvas .offcanvas-body {
|
|
263
|
+
display: flex;
|
|
264
|
+
flex-grow: 0;
|
|
265
|
+
padding: 0;
|
|
266
|
+
overflow-y: visible;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
@media (min-width: 1200px) {
|
|
270
|
+
.navbar-expand-xl {
|
|
271
|
+
flex-wrap: nowrap;
|
|
272
|
+
justify-content: flex-start;
|
|
273
|
+
}
|
|
274
|
+
.navbar-expand-xl .navbar-nav {
|
|
275
|
+
flex-direction: row;
|
|
276
|
+
}
|
|
277
|
+
.navbar-expand-xl .navbar-nav .dropdown-menu {
|
|
278
|
+
position: absolute;
|
|
279
|
+
}
|
|
280
|
+
.navbar-expand-xl .navbar-nav .nav-link {
|
|
281
|
+
padding-right: var(--bs-navbar-nav-link-padding-x);
|
|
282
|
+
padding-left: var(--bs-navbar-nav-link-padding-x);
|
|
283
|
+
}
|
|
284
|
+
.navbar-expand-xl .navbar-nav-scroll {
|
|
285
|
+
overflow: visible;
|
|
286
|
+
}
|
|
287
|
+
.navbar-expand-xl .navbar-collapse {
|
|
288
|
+
display: flex !important;
|
|
289
|
+
flex-basis: auto;
|
|
290
|
+
}
|
|
291
|
+
.navbar-expand-xl .navbar-toggler {
|
|
292
|
+
display: none;
|
|
293
|
+
}
|
|
294
|
+
.navbar-expand-xl .offcanvas {
|
|
295
|
+
position: static;
|
|
296
|
+
z-index: auto;
|
|
297
|
+
flex-grow: 1;
|
|
298
|
+
width: auto !important;
|
|
299
|
+
height: auto !important;
|
|
300
|
+
visibility: visible !important;
|
|
301
|
+
background-color: transparent !important;
|
|
302
|
+
border: 0 !important;
|
|
303
|
+
transform: none !important;
|
|
304
|
+
transition: none;
|
|
305
|
+
}
|
|
306
|
+
.navbar-expand-xl .offcanvas .offcanvas-header {
|
|
307
|
+
display: none;
|
|
308
|
+
}
|
|
309
|
+
.navbar-expand-xl .offcanvas .offcanvas-body {
|
|
310
|
+
display: flex;
|
|
311
|
+
flex-grow: 0;
|
|
312
|
+
padding: 0;
|
|
313
|
+
overflow-y: visible;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
@media (min-width: 1400px) {
|
|
317
|
+
.navbar-expand-xxl {
|
|
318
|
+
flex-wrap: nowrap;
|
|
319
|
+
justify-content: flex-start;
|
|
320
|
+
}
|
|
321
|
+
.navbar-expand-xxl .navbar-nav {
|
|
322
|
+
flex-direction: row;
|
|
323
|
+
}
|
|
324
|
+
.navbar-expand-xxl .navbar-nav .dropdown-menu {
|
|
325
|
+
position: absolute;
|
|
326
|
+
}
|
|
327
|
+
.navbar-expand-xxl .navbar-nav .nav-link {
|
|
328
|
+
padding-right: var(--bs-navbar-nav-link-padding-x);
|
|
329
|
+
padding-left: var(--bs-navbar-nav-link-padding-x);
|
|
330
|
+
}
|
|
331
|
+
.navbar-expand-xxl .navbar-nav-scroll {
|
|
332
|
+
overflow: visible;
|
|
333
|
+
}
|
|
334
|
+
.navbar-expand-xxl .navbar-collapse {
|
|
335
|
+
display: flex !important;
|
|
336
|
+
flex-basis: auto;
|
|
337
|
+
}
|
|
338
|
+
.navbar-expand-xxl .navbar-toggler {
|
|
339
|
+
display: none;
|
|
340
|
+
}
|
|
341
|
+
.navbar-expand-xxl .offcanvas {
|
|
342
|
+
position: static;
|
|
343
|
+
z-index: auto;
|
|
344
|
+
flex-grow: 1;
|
|
345
|
+
width: auto !important;
|
|
346
|
+
height: auto !important;
|
|
347
|
+
visibility: visible !important;
|
|
348
|
+
background-color: transparent !important;
|
|
349
|
+
border: 0 !important;
|
|
350
|
+
transform: none !important;
|
|
351
|
+
transition: none;
|
|
352
|
+
}
|
|
353
|
+
.navbar-expand-xxl .offcanvas .offcanvas-header {
|
|
354
|
+
display: none;
|
|
355
|
+
}
|
|
356
|
+
.navbar-expand-xxl .offcanvas .offcanvas-body {
|
|
357
|
+
display: flex;
|
|
358
|
+
flex-grow: 0;
|
|
359
|
+
padding: 0;
|
|
360
|
+
overflow-y: visible;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
.navbar-expand {
|
|
364
|
+
flex-wrap: nowrap;
|
|
365
|
+
justify-content: flex-start;
|
|
366
|
+
}
|
|
367
|
+
.navbar-expand .navbar-nav {
|
|
368
|
+
flex-direction: row;
|
|
369
|
+
}
|
|
370
|
+
.navbar-expand .navbar-nav .dropdown-menu {
|
|
371
|
+
position: absolute;
|
|
372
|
+
}
|
|
373
|
+
.navbar-expand .navbar-nav .nav-link {
|
|
374
|
+
padding-right: var(--bs-navbar-nav-link-padding-x);
|
|
375
|
+
padding-left: var(--bs-navbar-nav-link-padding-x);
|
|
376
|
+
}
|
|
377
|
+
.navbar-expand .navbar-nav-scroll {
|
|
378
|
+
overflow: visible;
|
|
379
|
+
}
|
|
380
|
+
.navbar-expand .navbar-collapse {
|
|
381
|
+
display: flex !important;
|
|
382
|
+
flex-basis: auto;
|
|
383
|
+
}
|
|
384
|
+
.navbar-expand .navbar-toggler {
|
|
385
|
+
display: none;
|
|
386
|
+
}
|
|
387
|
+
.navbar-expand .offcanvas {
|
|
388
|
+
position: static;
|
|
389
|
+
z-index: auto;
|
|
390
|
+
flex-grow: 1;
|
|
391
|
+
width: auto !important;
|
|
392
|
+
height: auto !important;
|
|
393
|
+
visibility: visible !important;
|
|
394
|
+
background-color: transparent !important;
|
|
395
|
+
border: 0 !important;
|
|
396
|
+
transform: none !important;
|
|
397
|
+
transition: none;
|
|
398
|
+
}
|
|
399
|
+
.navbar-expand .offcanvas .offcanvas-header {
|
|
400
|
+
display: none;
|
|
401
|
+
}
|
|
402
|
+
.navbar-expand .offcanvas .offcanvas-body {
|
|
403
|
+
display: flex;
|
|
404
|
+
flex-grow: 0;
|
|
405
|
+
padding: 0;
|
|
406
|
+
overflow-y: visible;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
.navbar-dark,
|
|
410
|
+
.navbar[data-bs-theme=dark] {
|
|
411
|
+
--bs-navbar-color: rgba(255, 255, 255, 0.55);
|
|
412
|
+
--bs-navbar-hover-color: rgba(255, 255, 255, 0.75);
|
|
413
|
+
--bs-navbar-disabled-color: rgba(255, 255, 255, 0.25);
|
|
414
|
+
--bs-navbar-active-color: #fff;
|
|
415
|
+
--bs-navbar-brand-color: #fff;
|
|
416
|
+
--bs-navbar-brand-hover-color: #fff;
|
|
417
|
+
--bs-navbar-toggler-border-color: rgba(255, 255, 255, 0.1);
|
|
418
|
+
--bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
[data-bs-theme=dark] .navbar-toggler-icon {
|
|
422
|
+
--bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
:host, *, *::before, *::after {
|
|
426
|
+
box-sizing: border-box;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
:host {
|
|
430
|
+
display: block;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
:host([positioning=fixed]) {
|
|
434
|
+
position: fixed;
|
|
435
|
+
inset: 0 0 auto;
|
|
436
|
+
width: 100%;
|
|
437
|
+
z-index: 1030;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
.navbar {
|
|
441
|
+
position: relative;
|
|
442
|
+
z-index: 20;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
:host([color=primary]) .navbar {
|
|
446
|
+
background-color: var(--bs-primary);
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
:host([color=secondary]) .navbar {
|
|
450
|
+
background-color: var(--bs-secondary);
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
:host([color=success]) .navbar {
|
|
454
|
+
background-color: var(--bs-success);
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
:host([color=info]) .navbar {
|
|
458
|
+
background-color: var(--bs-info);
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
:host([color=warning]) .navbar {
|
|
462
|
+
background-color: var(--bs-warning);
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
:host([color=danger]) .navbar {
|
|
466
|
+
background-color: var(--bs-danger);
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
:host([color=light]) .navbar {
|
|
470
|
+
background-color: var(--bs-light);
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
:host([color=dark]) .navbar {
|
|
474
|
+
background-color: var(--bs-dark);
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
:host([color=body]) .navbar {
|
|
478
|
+
background-color: var(--bs-body-bg);
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
:host([color=body-secondary]) .navbar {
|
|
482
|
+
background-color: var(--bs-secondary-bg);
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
:host([color=body-tertiary]) .navbar {
|
|
486
|
+
background-color: var(--bs-tertiary-bg);
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
.navbar-toggler {
|
|
490
|
+
padding: 0.75rem 1rem;
|
|
491
|
+
border: none;
|
|
492
|
+
background: transparent;
|
|
493
|
+
cursor: pointer;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
.navbar-toggler-bar {
|
|
497
|
+
display: block;
|
|
498
|
+
width: 25px;
|
|
499
|
+
height: 2px;
|
|
500
|
+
margin: 6px 0;
|
|
501
|
+
background-color: var(--bs-navbar-color, currentColor);
|
|
502
|
+
transition: 0.4s;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
.navbar-toggle:checked ~ .navbar-toggler .navbar-toggler-bar:nth-child(1) {
|
|
506
|
+
transform: rotate(-45deg) translate(-7px, 5px);
|
|
507
|
+
}
|
|
508
|
+
.navbar-toggle:checked ~ .navbar-toggler .navbar-toggler-bar:nth-child(2) {
|
|
509
|
+
opacity: 0;
|
|
510
|
+
}
|
|
511
|
+
.navbar-toggle:checked ~ .navbar-toggler .navbar-toggler-bar:nth-child(3) {
|
|
512
|
+
transform: rotate(45deg) translate(-6px, -4px);
|
|
513
|
+
}
|
|
514
|
+
.navbar-toggle:checked ~ .navbar-toggler ::slotted([slot=toggler]) {
|
|
515
|
+
--mp-navbar-expanded: 1;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
.navbar-toggle:focus-visible ~ .navbar-toggler {
|
|
519
|
+
border-radius: var(--bs-navbar-toggler-border-radius, 0.375rem);
|
|
520
|
+
box-shadow: 0 0 0 var(--bs-navbar-toggler-focus-width, 0.25rem);
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
.navbar-toggle {
|
|
524
|
+
position: absolute;
|
|
525
|
+
width: 1px;
|
|
526
|
+
height: 1px;
|
|
527
|
+
margin: -1px;
|
|
528
|
+
padding: 0;
|
|
529
|
+
overflow: hidden;
|
|
530
|
+
clip: rect(0 0 0 0);
|
|
531
|
+
white-space: nowrap;
|
|
532
|
+
border: 0;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
.navbar-collapse {
|
|
536
|
+
flex-basis: 100%;
|
|
537
|
+
display: grid;
|
|
538
|
+
grid-template-rows: 1fr;
|
|
539
|
+
transition: grid-template-rows 0.35s ease, visibility 0s var(--mp-collapse-hide-delay, 0s);
|
|
540
|
+
overflow: hidden;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
.navbar-collapse-inner {
|
|
544
|
+
min-height: 0;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
@media (prefers-reduced-motion: reduce) {
|
|
548
|
+
.navbar-collapse {
|
|
549
|
+
transition: none;
|
|
550
|
+
}
|
|
551
|
+
.navbar-toggler-bar {
|
|
552
|
+
transition: none;
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
.navbar-nav {
|
|
556
|
+
display: flex;
|
|
557
|
+
flex-direction: column;
|
|
558
|
+
list-style: none;
|
|
559
|
+
margin: 0;
|
|
560
|
+
padding: 0;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
.navbar-toggle:checked ~ .navbar-collapse,
|
|
564
|
+
:host(:not([data-js])) .navbar-collapse:focus-within {
|
|
565
|
+
grid-template-rows: 1fr !important;
|
|
566
|
+
visibility: visible;
|
|
567
|
+
--mp-collapse-hide-delay: 0s;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
@media (min-width: 576px) {
|
|
571
|
+
:host([breakpoint=sm]) .navbar-toggle, :host([breakpoint=sm]) .navbar-toggler {
|
|
572
|
+
display: none;
|
|
573
|
+
}
|
|
574
|
+
:host([breakpoint=sm]) .navbar-collapse {
|
|
575
|
+
flex-basis: auto;
|
|
576
|
+
display: flex;
|
|
577
|
+
align-items: center;
|
|
578
|
+
grid-template-rows: none;
|
|
579
|
+
overflow: visible;
|
|
580
|
+
}
|
|
581
|
+
:host([breakpoint=sm]) .navbar-collapse-inner {
|
|
582
|
+
display: contents;
|
|
583
|
+
}
|
|
584
|
+
:host([breakpoint=sm]) .navbar-nav {
|
|
585
|
+
flex-direction: row;
|
|
586
|
+
align-items: center;
|
|
587
|
+
}
|
|
588
|
+
:host([breakpoint=sm]) .nav-end {
|
|
589
|
+
margin-inline-start: auto;
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
@media (max-width: 575.98px) {
|
|
593
|
+
:host([breakpoint=sm]) .navbar-collapse {
|
|
594
|
+
grid-template-rows: 0fr;
|
|
595
|
+
}
|
|
596
|
+
:host([breakpoint=sm]) ::slotted([slot=brand]) {
|
|
597
|
+
margin-inline: auto;
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
@media (min-width: 768px) {
|
|
602
|
+
:host([breakpoint=md]) .navbar-toggle, :host([breakpoint=md]) .navbar-toggler {
|
|
603
|
+
display: none;
|
|
604
|
+
}
|
|
605
|
+
:host([breakpoint=md]) .navbar-collapse {
|
|
606
|
+
flex-basis: auto;
|
|
607
|
+
display: flex;
|
|
608
|
+
align-items: center;
|
|
609
|
+
grid-template-rows: none;
|
|
610
|
+
overflow: visible;
|
|
611
|
+
}
|
|
612
|
+
:host([breakpoint=md]) .navbar-collapse-inner {
|
|
613
|
+
display: contents;
|
|
614
|
+
}
|
|
615
|
+
:host([breakpoint=md]) .navbar-nav {
|
|
616
|
+
flex-direction: row;
|
|
617
|
+
align-items: center;
|
|
618
|
+
}
|
|
619
|
+
:host([breakpoint=md]) .nav-end {
|
|
620
|
+
margin-inline-start: auto;
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
@media (max-width: 767.98px) {
|
|
624
|
+
:host([breakpoint=md]) .navbar-collapse {
|
|
625
|
+
grid-template-rows: 0fr;
|
|
626
|
+
}
|
|
627
|
+
:host([breakpoint=md]) ::slotted([slot=brand]) {
|
|
628
|
+
margin-inline: auto;
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
@media (min-width: 992px) {
|
|
633
|
+
:host([breakpoint=lg]) .navbar-toggle, :host([breakpoint=lg]) .navbar-toggler {
|
|
634
|
+
display: none;
|
|
635
|
+
}
|
|
636
|
+
:host([breakpoint=lg]) .navbar-collapse {
|
|
637
|
+
flex-basis: auto;
|
|
638
|
+
display: flex;
|
|
639
|
+
align-items: center;
|
|
640
|
+
grid-template-rows: none;
|
|
641
|
+
overflow: visible;
|
|
642
|
+
}
|
|
643
|
+
:host([breakpoint=lg]) .navbar-collapse-inner {
|
|
644
|
+
display: contents;
|
|
645
|
+
}
|
|
646
|
+
:host([breakpoint=lg]) .navbar-nav {
|
|
647
|
+
flex-direction: row;
|
|
648
|
+
align-items: center;
|
|
649
|
+
}
|
|
650
|
+
:host([breakpoint=lg]) .nav-end {
|
|
651
|
+
margin-inline-start: auto;
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
@media (max-width: 991.98px) {
|
|
655
|
+
:host([breakpoint=lg]) .navbar-collapse {
|
|
656
|
+
grid-template-rows: 0fr;
|
|
657
|
+
}
|
|
658
|
+
:host([breakpoint=lg]) ::slotted([slot=brand]) {
|
|
659
|
+
margin-inline: auto;
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
@media (min-width: 1200px) {
|
|
664
|
+
:host([breakpoint=xl]) .navbar-toggle, :host([breakpoint=xl]) .navbar-toggler {
|
|
665
|
+
display: none;
|
|
666
|
+
}
|
|
667
|
+
:host([breakpoint=xl]) .navbar-collapse {
|
|
668
|
+
flex-basis: auto;
|
|
669
|
+
display: flex;
|
|
670
|
+
align-items: center;
|
|
671
|
+
grid-template-rows: none;
|
|
672
|
+
overflow: visible;
|
|
673
|
+
}
|
|
674
|
+
:host([breakpoint=xl]) .navbar-collapse-inner {
|
|
675
|
+
display: contents;
|
|
676
|
+
}
|
|
677
|
+
:host([breakpoint=xl]) .navbar-nav {
|
|
678
|
+
flex-direction: row;
|
|
679
|
+
align-items: center;
|
|
680
|
+
}
|
|
681
|
+
:host([breakpoint=xl]) .nav-end {
|
|
682
|
+
margin-inline-start: auto;
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
@media (max-width: 1199.98px) {
|
|
686
|
+
:host([breakpoint=xl]) .navbar-collapse {
|
|
687
|
+
grid-template-rows: 0fr;
|
|
688
|
+
}
|
|
689
|
+
:host([breakpoint=xl]) ::slotted([slot=brand]) {
|
|
690
|
+
margin-inline: auto;
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
@media (min-width: 1400px) {
|
|
695
|
+
:host([breakpoint=xxl]) .navbar-toggle, :host([breakpoint=xxl]) .navbar-toggler {
|
|
696
|
+
display: none;
|
|
697
|
+
}
|
|
698
|
+
:host([breakpoint=xxl]) .navbar-collapse {
|
|
699
|
+
flex-basis: auto;
|
|
700
|
+
display: flex;
|
|
701
|
+
align-items: center;
|
|
702
|
+
grid-template-rows: none;
|
|
703
|
+
overflow: visible;
|
|
704
|
+
}
|
|
705
|
+
:host([breakpoint=xxl]) .navbar-collapse-inner {
|
|
706
|
+
display: contents;
|
|
707
|
+
}
|
|
708
|
+
:host([breakpoint=xxl]) .navbar-nav {
|
|
709
|
+
flex-direction: row;
|
|
710
|
+
align-items: center;
|
|
711
|
+
}
|
|
712
|
+
:host([breakpoint=xxl]) .nav-end {
|
|
713
|
+
margin-inline-start: auto;
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
@media (max-width: 1399.98px) {
|
|
717
|
+
:host([breakpoint=xxl]) .navbar-collapse {
|
|
718
|
+
grid-template-rows: 0fr;
|
|
719
|
+
}
|
|
720
|
+
:host([breakpoint=xxl]) ::slotted([slot=brand]) {
|
|
721
|
+
margin-inline: auto;
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
@media (max-width: 575.98px) {
|
|
726
|
+
:host(:where([breakpoint=sm][data-js])) .navbar-collapse {
|
|
727
|
+
visibility: hidden;
|
|
728
|
+
--mp-collapse-hide-delay: 0.35s;
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
@media (max-width: 767.98px) {
|
|
732
|
+
:host(:where([breakpoint=md][data-js])) .navbar-collapse {
|
|
733
|
+
visibility: hidden;
|
|
734
|
+
--mp-collapse-hide-delay: 0.35s;
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
@media (max-width: 991.98px) {
|
|
738
|
+
:host(:where([breakpoint=lg][data-js])) .navbar-collapse {
|
|
739
|
+
visibility: hidden;
|
|
740
|
+
--mp-collapse-hide-delay: 0.35s;
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
@media (max-width: 1199.98px) {
|
|
744
|
+
:host(:where([breakpoint=xl][data-js])) .navbar-collapse {
|
|
745
|
+
visibility: hidden;
|
|
746
|
+
--mp-collapse-hide-delay: 0.35s;
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
@media (max-width: 1399.98px) {
|
|
750
|
+
:host(:where([breakpoint=xxl][data-js])) .navbar-collapse {
|
|
751
|
+
visibility: hidden;
|
|
752
|
+
--mp-collapse-hide-delay: 0.35s;
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
@media (max-width: 575.98px) {
|
|
756
|
+
:host([breakpoint=sm][positioning=fixed]) {
|
|
757
|
+
max-height: 100dvh;
|
|
758
|
+
overflow: hidden auto;
|
|
759
|
+
scrollbar-width: none;
|
|
760
|
+
}
|
|
761
|
+
:host([breakpoint=sm][positioning=fixed])::-webkit-scrollbar {
|
|
762
|
+
width: 0;
|
|
763
|
+
height: 0;
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
@media (max-width: 767.98px) {
|
|
767
|
+
:host([breakpoint=md][positioning=fixed]) {
|
|
768
|
+
max-height: 100dvh;
|
|
769
|
+
overflow: hidden auto;
|
|
770
|
+
scrollbar-width: none;
|
|
771
|
+
}
|
|
772
|
+
:host([breakpoint=md][positioning=fixed])::-webkit-scrollbar {
|
|
773
|
+
width: 0;
|
|
774
|
+
height: 0;
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
@media (max-width: 991.98px) {
|
|
778
|
+
:host([breakpoint=lg][positioning=fixed]) {
|
|
779
|
+
max-height: 100dvh;
|
|
780
|
+
overflow: hidden auto;
|
|
781
|
+
scrollbar-width: none;
|
|
782
|
+
}
|
|
783
|
+
:host([breakpoint=lg][positioning=fixed])::-webkit-scrollbar {
|
|
784
|
+
width: 0;
|
|
785
|
+
height: 0;
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
@media (max-width: 1199.98px) {
|
|
789
|
+
:host([breakpoint=xl][positioning=fixed]) {
|
|
790
|
+
max-height: 100dvh;
|
|
791
|
+
overflow: hidden auto;
|
|
792
|
+
scrollbar-width: none;
|
|
793
|
+
}
|
|
794
|
+
:host([breakpoint=xl][positioning=fixed])::-webkit-scrollbar {
|
|
795
|
+
width: 0;
|
|
796
|
+
height: 0;
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
@media (max-width: 1399.98px) {
|
|
800
|
+
:host([breakpoint=xxl][positioning=fixed]) {
|
|
801
|
+
max-height: 100dvh;
|
|
802
|
+
overflow: hidden auto;
|
|
803
|
+
scrollbar-width: none;
|
|
804
|
+
}
|
|
805
|
+
:host([breakpoint=xxl][positioning=fixed])::-webkit-scrollbar {
|
|
806
|
+
width: 0;
|
|
807
|
+
height: 0;
|
|
808
|
+
}
|
|
809
|
+
}`), c = e(`:host, *, *::before, *::after {
|
|
810
|
+
box-sizing: border-box;
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
:host {
|
|
814
|
+
display: block;
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
::slotted(a),
|
|
818
|
+
::slotted(button) {
|
|
819
|
+
display: block;
|
|
820
|
+
padding: var(--bs-nav-link-padding-y, 0.5rem) 0.5rem;
|
|
821
|
+
font-size: var(--bs-nav-link-font-size);
|
|
822
|
+
font-weight: var(--bs-nav-link-font-weight);
|
|
823
|
+
color: var(--bs-nav-link-color, var(--bs-navbar-color, inherit)) !important;
|
|
824
|
+
text-decoration: none !important;
|
|
825
|
+
background: transparent;
|
|
826
|
+
border: 0;
|
|
827
|
+
cursor: pointer;
|
|
828
|
+
white-space: nowrap;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
::slotted(a:hover),
|
|
832
|
+
::slotted(a:focus),
|
|
833
|
+
::slotted(button:hover),
|
|
834
|
+
::slotted(button:focus) {
|
|
835
|
+
color: var(--bs-nav-link-hover-color, var(--bs-navbar-hover-color, inherit)) !important;
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
:host([active]) ::slotted(a),
|
|
839
|
+
:host([active]) ::slotted(button),
|
|
840
|
+
::slotted(a.active),
|
|
841
|
+
::slotted(button.active) {
|
|
842
|
+
color: var(--bs-nav-link-active-color, var(--bs-navbar-active-color, inherit)) !important;
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
:host([disabled]) ::slotted(a),
|
|
846
|
+
:host([disabled]) ::slotted(button) {
|
|
847
|
+
color: var(--bs-nav-link-disabled-color, var(--bs-navbar-disabled-color, inherit)) !important;
|
|
848
|
+
pointer-events: none;
|
|
849
|
+
}`), g = e(`:host, *, *::before, *::after {
|
|
850
|
+
box-sizing: border-box;
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
:host {
|
|
854
|
+
display: inline-flex;
|
|
855
|
+
align-items: center;
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
::slotted(a),
|
|
859
|
+
::slotted(span),
|
|
860
|
+
::slotted(strong) {
|
|
861
|
+
padding-top: var(--bs-navbar-brand-padding-y, 0.3125rem);
|
|
862
|
+
padding-bottom: var(--bs-navbar-brand-padding-y, 0.3125rem);
|
|
863
|
+
margin-right: var(--bs-navbar-brand-margin-end, 1rem);
|
|
864
|
+
font-size: var(--bs-navbar-brand-font-size, 1.25rem);
|
|
865
|
+
color: var(--bs-navbar-brand-color, inherit) !important;
|
|
866
|
+
text-decoration: none !important;
|
|
867
|
+
white-space: nowrap;
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
::slotted(a:hover),
|
|
871
|
+
::slotted(a:focus) {
|
|
872
|
+
color: var(--bs-navbar-brand-hover-color, inherit) !important;
|
|
873
|
+
}`), h = e(`:host, *, *::before, *::after {
|
|
874
|
+
box-sizing: border-box;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
:host {
|
|
878
|
+
position: relative;
|
|
879
|
+
display: block;
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
.nav-link.dropdown-toggle {
|
|
883
|
+
display: flex;
|
|
884
|
+
align-items: center;
|
|
885
|
+
padding: var(--bs-nav-link-padding-y, 0.5rem) 0.5rem;
|
|
886
|
+
color: var(--bs-nav-link-color, var(--bs-navbar-color, inherit));
|
|
887
|
+
text-decoration: none;
|
|
888
|
+
white-space: nowrap;
|
|
889
|
+
cursor: pointer;
|
|
890
|
+
background: transparent;
|
|
891
|
+
border: 0;
|
|
892
|
+
user-select: none;
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
.nav-link.dropdown-toggle:hover,
|
|
896
|
+
:host(:not([data-js]):focus-within) .nav-link.dropdown-toggle {
|
|
897
|
+
color: var(--bs-nav-link-hover-color, var(--bs-navbar-hover-color, inherit));
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
.nav-link.dropdown-toggle::after {
|
|
901
|
+
display: inline-block;
|
|
902
|
+
margin-left: 0.255em;
|
|
903
|
+
vertical-align: 0.255em;
|
|
904
|
+
content: "";
|
|
905
|
+
border-top: 0.3em solid;
|
|
906
|
+
border-right: 0.3em solid transparent;
|
|
907
|
+
border-bottom: 0;
|
|
908
|
+
border-left: 0.3em solid transparent;
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
:host([active]) .nav-link.dropdown-toggle {
|
|
912
|
+
color: var(--bs-nav-link-active-color, var(--bs-navbar-active-color, inherit));
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
:host([data-submenu]) .nav-link.dropdown-toggle {
|
|
916
|
+
justify-content: space-between;
|
|
917
|
+
width: 100%;
|
|
918
|
+
padding: var(--bs-dropdown-item-padding-y, 0.25rem) var(--bs-dropdown-item-padding-x, 1rem);
|
|
919
|
+
color: var(--bs-dropdown-link-color, inherit);
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
:host([data-submenu]) .nav-link.dropdown-toggle:hover {
|
|
923
|
+
color: var(--bs-dropdown-link-hover-color, inherit);
|
|
924
|
+
background-color: var(--bs-dropdown-link-hover-bg, transparent);
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
:host([data-submenu][active]) .nav-link.dropdown-toggle {
|
|
928
|
+
color: var(--bs-dropdown-link-active-color, #fff);
|
|
929
|
+
background-color: var(--bs-dropdown-link-active-bg, var(--bs-primary));
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
:host([data-submenu]) .nav-link.dropdown-toggle::after {
|
|
933
|
+
margin-left: 0.5rem;
|
|
934
|
+
border-top: 0.3em solid transparent;
|
|
935
|
+
border-bottom: 0.3em solid transparent;
|
|
936
|
+
border-left: 0.3em solid;
|
|
937
|
+
border-right: 0;
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
::slotted(:not([slot=label])) {
|
|
941
|
+
display: none;
|
|
942
|
+
position: static;
|
|
943
|
+
max-height: none;
|
|
944
|
+
overflow: visible;
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
:host(:not([data-submenu])) ::slotted(:not([slot=label])) {
|
|
948
|
+
margin: 0 1rem;
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
:host([data-submenu]) ::slotted(:not([slot=label])) {
|
|
952
|
+
margin: 0 0.5rem;
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
:host(:not([data-js]):focus-within) ::slotted(:not([slot=label])),
|
|
956
|
+
:host([data-open]) ::slotted(:not([slot=label])),
|
|
957
|
+
:host([data-menu-open]) ::slotted(:not([slot=label])) {
|
|
958
|
+
display: block;
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
@media (min-width: 576px) {
|
|
962
|
+
:host([data-expand=sm]:not([data-submenu])) ::slotted(:not([slot=label])) {
|
|
963
|
+
position: absolute;
|
|
964
|
+
top: 100%;
|
|
965
|
+
inset-inline-start: 0;
|
|
966
|
+
z-index: 1000;
|
|
967
|
+
margin: 0;
|
|
968
|
+
max-height: calc(100vh - 100% - 1rem);
|
|
969
|
+
overflow-y: auto;
|
|
970
|
+
}
|
|
971
|
+
:host([data-expand=sm][data-submenu]) ::slotted(:not([slot=label])) {
|
|
972
|
+
position: fixed;
|
|
973
|
+
inset-inline-start: auto;
|
|
974
|
+
top: auto;
|
|
975
|
+
z-index: 1050;
|
|
976
|
+
margin: 0;
|
|
977
|
+
max-height: calc(100vh - 1rem);
|
|
978
|
+
overflow-y: auto;
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
@media (min-width: 768px) {
|
|
982
|
+
:host([data-expand=md]:not([data-submenu])) ::slotted(:not([slot=label])) {
|
|
983
|
+
position: absolute;
|
|
984
|
+
top: 100%;
|
|
985
|
+
inset-inline-start: 0;
|
|
986
|
+
z-index: 1000;
|
|
987
|
+
margin: 0;
|
|
988
|
+
max-height: calc(100vh - 100% - 1rem);
|
|
989
|
+
overflow-y: auto;
|
|
990
|
+
}
|
|
991
|
+
:host([data-expand=md][data-submenu]) ::slotted(:not([slot=label])) {
|
|
992
|
+
position: fixed;
|
|
993
|
+
inset-inline-start: auto;
|
|
994
|
+
top: auto;
|
|
995
|
+
z-index: 1050;
|
|
996
|
+
margin: 0;
|
|
997
|
+
max-height: calc(100vh - 1rem);
|
|
998
|
+
overflow-y: auto;
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
@media (min-width: 992px) {
|
|
1002
|
+
:host([data-expand=lg]:not([data-submenu])) ::slotted(:not([slot=label])) {
|
|
1003
|
+
position: absolute;
|
|
1004
|
+
top: 100%;
|
|
1005
|
+
inset-inline-start: 0;
|
|
1006
|
+
z-index: 1000;
|
|
1007
|
+
margin: 0;
|
|
1008
|
+
max-height: calc(100vh - 100% - 1rem);
|
|
1009
|
+
overflow-y: auto;
|
|
1010
|
+
}
|
|
1011
|
+
:host([data-expand=lg][data-submenu]) ::slotted(:not([slot=label])) {
|
|
1012
|
+
position: fixed;
|
|
1013
|
+
inset-inline-start: auto;
|
|
1014
|
+
top: auto;
|
|
1015
|
+
z-index: 1050;
|
|
1016
|
+
margin: 0;
|
|
1017
|
+
max-height: calc(100vh - 1rem);
|
|
1018
|
+
overflow-y: auto;
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
@media (min-width: 1200px) {
|
|
1022
|
+
:host([data-expand=xl]:not([data-submenu])) ::slotted(:not([slot=label])) {
|
|
1023
|
+
position: absolute;
|
|
1024
|
+
top: 100%;
|
|
1025
|
+
inset-inline-start: 0;
|
|
1026
|
+
z-index: 1000;
|
|
1027
|
+
margin: 0;
|
|
1028
|
+
max-height: calc(100vh - 100% - 1rem);
|
|
1029
|
+
overflow-y: auto;
|
|
1030
|
+
}
|
|
1031
|
+
:host([data-expand=xl][data-submenu]) ::slotted(:not([slot=label])) {
|
|
1032
|
+
position: fixed;
|
|
1033
|
+
inset-inline-start: auto;
|
|
1034
|
+
top: auto;
|
|
1035
|
+
z-index: 1050;
|
|
1036
|
+
margin: 0;
|
|
1037
|
+
max-height: calc(100vh - 1rem);
|
|
1038
|
+
overflow-y: auto;
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
@media (min-width: 1400px) {
|
|
1042
|
+
:host([data-expand=xxl]:not([data-submenu])) ::slotted(:not([slot=label])) {
|
|
1043
|
+
position: absolute;
|
|
1044
|
+
top: 100%;
|
|
1045
|
+
inset-inline-start: 0;
|
|
1046
|
+
z-index: 1000;
|
|
1047
|
+
margin: 0;
|
|
1048
|
+
max-height: calc(100vh - 100% - 1rem);
|
|
1049
|
+
overflow-y: auto;
|
|
1050
|
+
}
|
|
1051
|
+
:host([data-expand=xxl][data-submenu]) ::slotted(:not([slot=label])) {
|
|
1052
|
+
position: fixed;
|
|
1053
|
+
inset-inline-start: auto;
|
|
1054
|
+
top: auto;
|
|
1055
|
+
z-index: 1050;
|
|
1056
|
+
margin: 0;
|
|
1057
|
+
max-height: calc(100vh - 1rem);
|
|
1058
|
+
overflow-y: auto;
|
|
1059
|
+
}
|
|
1060
|
+
}`);
|
|
1061
|
+
class r extends d {
|
|
1062
|
+
static {
|
|
1063
|
+
this.styles = [p];
|
|
1064
|
+
}
|
|
1065
|
+
static get observedAttributes() {
|
|
1066
|
+
return [
|
|
1067
|
+
...super.observedAttributes ?? [],
|
|
1068
|
+
"breakpoint",
|
|
1069
|
+
"color",
|
|
1070
|
+
"expanded",
|
|
1071
|
+
"aria-label",
|
|
1072
|
+
"positioning"
|
|
1073
|
+
];
|
|
1074
|
+
}
|
|
1075
|
+
createRenderRoot() {
|
|
1076
|
+
return this.constructor.observedAttributes.includes("defer-hydration") || this.shadowRoot?.replaceChildren(), super.createRenderRoot();
|
|
1077
|
+
}
|
|
1078
|
+
connectedCallback() {
|
|
1079
|
+
super.connectedCallback(), this.setAttribute("data-js", ""), this.style.getPropertyValue("--mp-navbar-breakpoint") || this.#l(this.getAttribute("breakpoint")), this.addEventListener("click", this.#t);
|
|
1080
|
+
}
|
|
1081
|
+
disconnectedCallback() {
|
|
1082
|
+
super.disconnectedCallback(), this.removeEventListener("click", this.#t);
|
|
1083
|
+
}
|
|
1084
|
+
/**
|
|
1085
|
+
* Clicking a navigation link (an `<a href>` — a routerLink renders one) should
|
|
1086
|
+
* dismiss the menu: close every open dropdown and, in small mode, slide the
|
|
1087
|
+
* collapse shut. Dropdown *triggers* are `<a role="button">` with no `href`
|
|
1088
|
+
* (excluded), so opening a dropdown doesn't collapse the bar. Collapsing in
|
|
1089
|
+
* wide mode is a no-op (the collapse is always shown there).
|
|
1090
|
+
*/
|
|
1091
|
+
#t = (a) => {
|
|
1092
|
+
a.composedPath().find(
|
|
1093
|
+
(t) => t instanceof HTMLAnchorElement && t.hasAttribute("href") && !t.classList.contains("dropdown-toggle")
|
|
1094
|
+
) && (this.querySelectorAll("mp-navbar-dropdown").forEach(
|
|
1095
|
+
(t) => t.close?.()
|
|
1096
|
+
), this.toggle(!1));
|
|
1097
|
+
};
|
|
1098
|
+
attributeChangedCallback(a, n, t) {
|
|
1099
|
+
super.attributeChangedCallback(a, n, t), a === "color" ? this.#a(t) : a === "breakpoint" ? this.#l(t) : a === "expanded" ? this.#o(t !== null, !1) : a === "aria-label" && this.requestUpdate();
|
|
1100
|
+
}
|
|
1101
|
+
/** Solid colors need `data-bs-theme` for text/link contrast; adaptive names inherit the page theme. */
|
|
1102
|
+
#a(a) {
|
|
1103
|
+
const n = this.#n(a);
|
|
1104
|
+
n ? this.setAttribute("data-bs-theme", n) : this.getAttribute("data-bs-theme") && this.removeAttribute("data-bs-theme");
|
|
1105
|
+
}
|
|
1106
|
+
#n(a) {
|
|
1107
|
+
return a ? a === "light" || a === "white" ? "light" : a === "body" || a === "transparent" || a.startsWith("body-") ? null : "dark" : null;
|
|
1108
|
+
}
|
|
1109
|
+
/** min-width px for each Bootstrap breakpoint (xs = always collapsed → 0). */
|
|
1110
|
+
static #i = {
|
|
1111
|
+
xs: 0,
|
|
1112
|
+
sm: 576,
|
|
1113
|
+
md: 768,
|
|
1114
|
+
lg: 992,
|
|
1115
|
+
xl: 1200,
|
|
1116
|
+
xxl: 1400
|
|
1117
|
+
};
|
|
1118
|
+
/**
|
|
1119
|
+
* Publish the resolved breakpoint so DESCENDANT dropdowns (a different shadow
|
|
1120
|
+
* tree) can switch inline↔overlay. `data-breakpoint` is a convenience for JS;
|
|
1121
|
+
* `--mp-navbar-breakpoint` is the load-bearing channel — CSS custom properties
|
|
1122
|
+
* inherit THROUGH shadow boundaries, so `mp-navbar-dropdown` reads the px in JS
|
|
1123
|
+
* (matchMedia gate) without any DI/context.
|
|
1124
|
+
*/
|
|
1125
|
+
#l(a) {
|
|
1126
|
+
const n = a ?? "md", t = r.#i[n] ?? 768;
|
|
1127
|
+
this.setAttribute("data-breakpoint", n), this.style.setProperty("--mp-navbar-breakpoint", `${t}px`);
|
|
1128
|
+
}
|
|
1129
|
+
get #e() {
|
|
1130
|
+
return this.renderRoot?.querySelector(".navbar-toggle") ?? null;
|
|
1131
|
+
}
|
|
1132
|
+
/** Whether the collapse is (visually) expanded — the toggle's checked state. */
|
|
1133
|
+
get expanded() {
|
|
1134
|
+
return this.#e?.checked ?? this.hasAttribute("expanded");
|
|
1135
|
+
}
|
|
1136
|
+
set expanded(a) {
|
|
1137
|
+
this.toggle(a);
|
|
1138
|
+
}
|
|
1139
|
+
/**
|
|
1140
|
+
* The single write path for the collapse state: checkbox + `aria-expanded`
|
|
1141
|
+
* (+ event). Programmatic writes (`toggle()`, the `expanded` attribute,
|
|
1142
|
+
* dismiss-on-navigate) don't fire the checkbox's `change` event, so syncing
|
|
1143
|
+
* aria only there left `aria-expanded` stale after every programmatic close.
|
|
1144
|
+
*/
|
|
1145
|
+
#o(a, n = !0) {
|
|
1146
|
+
const t = this.#e;
|
|
1147
|
+
t && (t.checked = a, t.setAttribute("aria-expanded", String(a)), n && this.#s(a));
|
|
1148
|
+
}
|
|
1149
|
+
/** Programmatically open/close the collapse. */
|
|
1150
|
+
toggle(a) {
|
|
1151
|
+
this.#o(a ?? !(this.#e?.checked ?? !1));
|
|
1152
|
+
}
|
|
1153
|
+
#d = () => {
|
|
1154
|
+
this.#o(this.#e?.checked ?? !1);
|
|
1155
|
+
};
|
|
1156
|
+
#r = (a) => {
|
|
1157
|
+
a.key === "Enter" && (a.preventDefault(), this.toggle());
|
|
1158
|
+
};
|
|
1159
|
+
#s(a) {
|
|
1160
|
+
this.dispatchEvent(
|
|
1161
|
+
new CustomEvent("expandedchange", {
|
|
1162
|
+
detail: { expanded: a },
|
|
1163
|
+
bubbles: !0,
|
|
1164
|
+
composed: !0
|
|
1165
|
+
})
|
|
1166
|
+
);
|
|
1167
|
+
}
|
|
1168
|
+
render() {
|
|
1169
|
+
const a = this.getAttribute("aria-label") ?? "Main navigation";
|
|
1170
|
+
return o`
|
|
1171
|
+
<nav class="navbar" part="nav" aria-label=${a}>
|
|
1172
|
+
<slot name="brand"></slot>
|
|
1173
|
+
<input
|
|
1174
|
+
type="checkbox"
|
|
1175
|
+
id="mp-navbar-toggle"
|
|
1176
|
+
class="navbar-toggle"
|
|
1177
|
+
role="button"
|
|
1178
|
+
aria-label="Toggle navigation"
|
|
1179
|
+
aria-expanded="false"
|
|
1180
|
+
aria-controls="navbar-collapse"
|
|
1181
|
+
@change=${this.#d}
|
|
1182
|
+
@keydown=${this.#r}
|
|
1183
|
+
/>
|
|
1184
|
+
<label for="mp-navbar-toggle" class="navbar-toggler" part="toggler" aria-hidden="true">
|
|
1185
|
+
<slot name="toggler">
|
|
1186
|
+
<span class="navbar-toggler-bar"></span>
|
|
1187
|
+
<span class="navbar-toggler-bar"></span>
|
|
1188
|
+
<span class="navbar-toggler-bar"></span>
|
|
1189
|
+
</slot>
|
|
1190
|
+
</label>
|
|
1191
|
+
<div class="navbar-collapse" id="navbar-collapse" part="collapse">
|
|
1192
|
+
<div class="navbar-collapse-inner">
|
|
1193
|
+
<ul class="navbar-nav nav-start" part="nav-start"><slot></slot></ul>
|
|
1194
|
+
<ul class="navbar-nav nav-end" part="nav-end"><slot name="end"></slot></ul>
|
|
1195
|
+
</div>
|
|
1196
|
+
</div>
|
|
1197
|
+
</nav>
|
|
1198
|
+
`;
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
customElements.get("mp-navbar") || customElements.define("mp-navbar", r);
|
|
1202
|
+
class i extends d {
|
|
1203
|
+
createRenderRoot() {
|
|
1204
|
+
return this.constructor.observedAttributes.includes("defer-hydration") || this.shadowRoot?.replaceChildren(), super.createRenderRoot();
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1207
|
+
class m extends i {
|
|
1208
|
+
static {
|
|
1209
|
+
this.styles = [c];
|
|
1210
|
+
}
|
|
1211
|
+
render() {
|
|
1212
|
+
return o`<slot></slot>`;
|
|
1213
|
+
}
|
|
1214
|
+
}
|
|
1215
|
+
customElements.get("mp-navbar-item") || customElements.define("mp-navbar-item", m);
|
|
1216
|
+
class x extends i {
|
|
1217
|
+
static {
|
|
1218
|
+
this.styles = [g];
|
|
1219
|
+
}
|
|
1220
|
+
render() {
|
|
1221
|
+
return o`<slot></slot>`;
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1224
|
+
customElements.get("mp-navbar-brand") || customElements.define("mp-navbar-brand", x);
|
|
1225
|
+
class s extends i {
|
|
1226
|
+
static {
|
|
1227
|
+
this.styles = [h];
|
|
1228
|
+
}
|
|
1229
|
+
static get observedAttributes() {
|
|
1230
|
+
return [...super.observedAttributes ?? [], "data-open", "data-menu-open"];
|
|
1231
|
+
}
|
|
1232
|
+
#t = !1;
|
|
1233
|
+
#a = null;
|
|
1234
|
+
#n = null;
|
|
1235
|
+
/** Open via either path — inline (`data-open`) or overlay (`data-menu-open`). */
|
|
1236
|
+
get #i() {
|
|
1237
|
+
return this.hasAttribute("data-open") || this.hasAttribute("data-menu-open");
|
|
1238
|
+
}
|
|
1239
|
+
attributeChangedCallback(a, n, t) {
|
|
1240
|
+
super.attributeChangedCallback(a, n, t), (a === "data-open" || a === "data-menu-open") && this.renderRoot?.querySelector(".dropdown-toggle")?.setAttribute("aria-expanded", String(this.#i));
|
|
1241
|
+
}
|
|
1242
|
+
/** min-width px per Bootstrap breakpoint — mirrors mp-navbar's map. */
|
|
1243
|
+
static #l = {
|
|
1244
|
+
xs: 0,
|
|
1245
|
+
sm: 576,
|
|
1246
|
+
md: 768,
|
|
1247
|
+
lg: 992,
|
|
1248
|
+
xl: 1200,
|
|
1249
|
+
xxl: 1400
|
|
1250
|
+
};
|
|
1251
|
+
/** Wide mode = at/above the navbar breakpoint (matchMedia). Small/no-JS = false. */
|
|
1252
|
+
get #e() {
|
|
1253
|
+
return this.#n?.matches ?? !1;
|
|
1254
|
+
}
|
|
1255
|
+
connectedCallback() {
|
|
1256
|
+
super.connectedCallback(), this.setAttribute("data-js", ""), this.#t = !!this.closest("mp-dropdown-menu");
|
|
1257
|
+
const a = this.closest("mp-navbar")?.getAttribute("breakpoint") ?? "md";
|
|
1258
|
+
if (this.setAttribute("data-expand", a), typeof window < "u" && window.matchMedia) {
|
|
1259
|
+
const n = s.#l[a] ?? 768;
|
|
1260
|
+
this.#n = window.matchMedia(`(min-width: ${n}px)`), this.#n.addEventListener("change", this.#o);
|
|
1261
|
+
}
|
|
1262
|
+
this.addEventListener("keydown", this.#v), this.#t && (this.setAttribute("data-submenu", ""), this.#a = new v(this, {
|
|
1263
|
+
anchor: () => this.renderRoot?.querySelector(".dropdown-toggle") ?? null,
|
|
1264
|
+
trigger: () => this.renderRoot?.querySelector(".dropdown-toggle") ?? null,
|
|
1265
|
+
// The default-slotted panel: `<mp-dropdown-menu>` directly (React/Vue), or a
|
|
1266
|
+
// framework wrapper host that contains it (Angular's `<bs-dropdown-menu>`).
|
|
1267
|
+
// Match the direct child that isn't the trigger label so the element the
|
|
1268
|
+
// CSS positions (`::slotted(:not([slot="label"]))`) is the same one the
|
|
1269
|
+
// controller moves.
|
|
1270
|
+
panel: () => this.querySelector(':scope > :not([slot="label"])'),
|
|
1271
|
+
// Open to the right of the trigger; flip to the left if it won't fit.
|
|
1272
|
+
positions: [
|
|
1273
|
+
{ originX: "end", originY: "top", overlayX: "start", overlayY: "top" },
|
|
1274
|
+
{ originX: "start", originY: "top", overlayX: "end", overlayY: "top" }
|
|
1275
|
+
]
|
|
1276
|
+
}));
|
|
1277
|
+
}
|
|
1278
|
+
disconnectedCallback() {
|
|
1279
|
+
super.disconnectedCallback(), this.removeEventListener("keydown", this.#v), document.removeEventListener("mousedown", this.#s, !0), this.#n?.removeEventListener("change", this.#o);
|
|
1280
|
+
}
|
|
1281
|
+
// Resize crossed the breakpoint: close any open panel so state doesn't leak
|
|
1282
|
+
// across the inline↔overlay switch (the CSS + #toggle re-resolve on next open).
|
|
1283
|
+
#o = () => {
|
|
1284
|
+
this.#a?.close(), this.#r(!1);
|
|
1285
|
+
};
|
|
1286
|
+
get #d() {
|
|
1287
|
+
return this.hasAttribute("data-open");
|
|
1288
|
+
}
|
|
1289
|
+
#r(a) {
|
|
1290
|
+
a !== this.#d && (this.toggleAttribute("data-open", a), a ? document.addEventListener("mousedown", this.#s, !0) : document.removeEventListener("mousedown", this.#s, !0));
|
|
1291
|
+
}
|
|
1292
|
+
#s = (a) => {
|
|
1293
|
+
a.composedPath().includes(this) || this.#r(!1);
|
|
1294
|
+
};
|
|
1295
|
+
#b() {
|
|
1296
|
+
this.#t && this.#e && this.#a ? this.#a.toggle() : this.#r(!this.#d);
|
|
1297
|
+
}
|
|
1298
|
+
/** Close the dropdown (both the overlay and the inline paths). Public so the
|
|
1299
|
+
* parent `mp-navbar` can dismiss every dropdown when a nav link is clicked. */
|
|
1300
|
+
close() {
|
|
1301
|
+
this.#a?.close(), this.#r(!1);
|
|
1302
|
+
}
|
|
1303
|
+
/**
|
|
1304
|
+
* Toggle on MOUSEDOWN, not click — the whole gesture must resolve at press
|
|
1305
|
+
* time. Dismissal of a sibling's open dropdown also happens on mousedown
|
|
1306
|
+
* (its document capture listener, which runs before this target handler), so
|
|
1307
|
+
* open+close ride the SAME event, in a guaranteed order. With a click-based
|
|
1308
|
+
* open, a real pointer that drifts a few px between press and release makes
|
|
1309
|
+
* the browser retarget `click` to the common ancestor (mousedown/mouseup
|
|
1310
|
+
* targets differ once the sibling's panel — which bleeds under this trigger —
|
|
1311
|
+
* is yanked out mid-gesture), and the dropdown silently fails to open.
|
|
1312
|
+
* No preventDefault: it would suppress focus moving to the trigger.
|
|
1313
|
+
*/
|
|
1314
|
+
#p = () => {
|
|
1315
|
+
this.#b();
|
|
1316
|
+
};
|
|
1317
|
+
#c = (a) => {
|
|
1318
|
+
a.key === "Enter" || a.key === " " || a.key === "Spacebar" ? (a.preventDefault(), this.#b()) : a.key === "ArrowDown" && (a.preventDefault(), this.#i || this.#b(), this.#g());
|
|
1319
|
+
};
|
|
1320
|
+
/** Escape closes the INNERMOST open dropdown and returns focus to its
|
|
1321
|
+
* trigger — fires for the shadow trigger and slotted menu content alike
|
|
1322
|
+
* (keydown is composed). Closed hosts let the event bubble to an open
|
|
1323
|
+
* ancestor, so nested submenus unwind one level per press. */
|
|
1324
|
+
#v = (a) => {
|
|
1325
|
+
a.key !== "Escape" || !this.#i || (a.stopPropagation(), this.close(), this.renderRoot?.querySelector(".dropdown-toggle")?.focus());
|
|
1326
|
+
};
|
|
1327
|
+
/** Move focus to the first item control of the slotted menu (this menu's own
|
|
1328
|
+
* items only — nested submenus keep theirs). */
|
|
1329
|
+
#g() {
|
|
1330
|
+
const a = this.querySelector(':scope > :not([slot="label"])'), n = a?.matches("mp-dropdown-menu") ? a : a?.querySelector("mp-dropdown-menu");
|
|
1331
|
+
if (!n) return;
|
|
1332
|
+
const t = [...n.querySelectorAll(".dropdown-item")].find((b) => b.closest("mp-dropdown-menu") === n);
|
|
1333
|
+
(t?.querySelector("a, button") ?? t)?.focus();
|
|
1334
|
+
}
|
|
1335
|
+
render() {
|
|
1336
|
+
return o`
|
|
1337
|
+
<a
|
|
1338
|
+
class="nav-link dropdown-toggle"
|
|
1339
|
+
part="toggle"
|
|
1340
|
+
role="button"
|
|
1341
|
+
tabindex="0"
|
|
1342
|
+
aria-haspopup="menu"
|
|
1343
|
+
aria-expanded="false"
|
|
1344
|
+
@mousedown=${this.#p}
|
|
1345
|
+
@keydown=${this.#c}
|
|
1346
|
+
><slot name="label"></slot></a>
|
|
1347
|
+
<slot></slot>
|
|
1348
|
+
`;
|
|
1349
|
+
}
|
|
1350
|
+
}
|
|
1351
|
+
customElements.get("mp-navbar-dropdown") || customElements.define("mp-navbar-dropdown", s);
|
|
1352
|
+
export {
|
|
1353
|
+
r as MpNavbar,
|
|
1354
|
+
x as MpNavbarBrand,
|
|
1355
|
+
s as MpNavbarDropdown,
|
|
1356
|
+
m as MpNavbarItem,
|
|
1357
|
+
g as navbarBrandStyles,
|
|
1358
|
+
h as navbarDropdownStyles,
|
|
1359
|
+
c as navbarItemStyles,
|
|
1360
|
+
p as navbarStyles
|
|
1361
|
+
};
|