@webquark/core 1.1.0-dev.5 → 1.1.0-dev.6
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/README.md +20 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/q-navbar.cjs.entry.js +222 -4
- package/dist/cjs/webquark.cjs.js +1 -1
- package/dist/collection/components/layout/navbar/navbar.css +119 -0
- package/dist/collection/components/layout/navbar/navbar.js +280 -4
- package/dist/collection/components/layout/navbar/test/navbar.cmp.test.js +317 -1
- package/dist/components/q-navbar.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/q-navbar.entry.js +222 -4
- package/dist/esm/webquark.js +1 -1
- package/dist/playground/build/p-0aecd9b1.entry.js +1 -0
- package/dist/playground/build/webquark.esm.js +1 -1
- package/dist/playground/playground/specs/q-navbar.sandbox.json +8 -0
- package/dist/types/components/layout/navbar/navbar.d.ts +27 -1
- package/dist/types/components/layout/navbar/navbar.types.d.ts +2 -0
- package/dist/types/components.d.ts +24 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/webquark/p-0aecd9b1.entry.js +1 -0
- package/dist/webquark/webquark.esm.js +1 -1
- package/package.json +1 -1
- package/scripts/wq-switch/README.md +39 -11
- package/scripts/wq-switch/dist/index.js +31 -18
- package/scripts/wq-switch/dist/setup.js +31 -15
- package/dist/playground/build/p-fdd85ce4.entry.js +0 -1
- package/dist/webquark/p-fdd85ce4.entry.js +0 -1
|
@@ -463,3 +463,122 @@
|
|
|
463
463
|
display: none;
|
|
464
464
|
}
|
|
465
465
|
}
|
|
466
|
+
|
|
467
|
+
/* Alignment is deliberately isolated from the legacy viewport and vertical layouts. */
|
|
468
|
+
@media (min-width: 720.01px) {
|
|
469
|
+
:host(:is([edge='top'], [edge='bottom'])[nav-align='end']) .desktop-nav {
|
|
470
|
+
justify-content: flex-end;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
:host(:is([edge='top'], [edge='bottom'])[nav-align='center']) .navbar:not(.is-collapsed) .desktop-nav {
|
|
474
|
+
justify-content: center;
|
|
475
|
+
position: relative;
|
|
476
|
+
inset-inline-start: var(--q-navbar-nav-offset-inline, 0px);
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
:host(:is([edge='top'], [edge='bottom'])[nav-align='center'][nav-center-within='container']) .navbar:not(.is-collapsed) .navbar-row {
|
|
480
|
+
display: grid;
|
|
481
|
+
grid-template-columns: minmax(0, 1fr) max-content minmax(0, 1fr);
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
:host(:is([edge='top'], [edge='bottom'])[nav-align='center']) .navbar:not(.is-collapsed) .brand-link {
|
|
485
|
+
justify-self: start;
|
|
486
|
+
flex-shrink: 0;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
.is-collapsed .navbar-row {
|
|
490
|
+
display: flex;
|
|
491
|
+
flex-wrap: wrap;
|
|
492
|
+
justify-content: space-between;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
.is-collapsed .desktop-nav {
|
|
496
|
+
order: 3;
|
|
497
|
+
flex: 1 0 100%;
|
|
498
|
+
flex-wrap: wrap;
|
|
499
|
+
justify-content: center;
|
|
500
|
+
inset-inline-start: auto;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
:host([mobile-mode='menu']) .is-collapsed .desktop-nav,
|
|
504
|
+
:host([mobile-mode='menu']) .is-collapsed .desktop-actions {
|
|
505
|
+
display: none;
|
|
506
|
+
order: 3;
|
|
507
|
+
flex: 1 0 100%;
|
|
508
|
+
flex-direction: column;
|
|
509
|
+
align-items: stretch;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
:host([mobile-mode='menu']) .is-collapsed.is-open .desktop-nav,
|
|
513
|
+
:host([mobile-mode='menu']) .is-collapsed.is-open:not(.has-mobile-actions) .desktop-actions {
|
|
514
|
+
display: flex;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
:host([mobile-mode='menu']) .is-collapsed.has-mobile-nav slot[name='nav'] {
|
|
518
|
+
display: none;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
:host([mobile-mode='menu']) .is-collapsed .nav-item-shell,
|
|
522
|
+
:host([mobile-mode='menu']) .is-collapsed .nav-item {
|
|
523
|
+
width: 100%;
|
|
524
|
+
justify-content: flex-start;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
:host([mobile-mode='menu']) .is-collapsed .menu-button {
|
|
528
|
+
display: inline-flex;
|
|
529
|
+
flex-shrink: 0;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
:host([mobile-mode='menu']) .is-collapsed.is-open .mobile-panel.has-content {
|
|
533
|
+
display: block;
|
|
534
|
+
padding: var(--q-navbar-mobile-panel-padding, 8px 16px 16px);
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
.is-collapsed .mobile-nav,
|
|
538
|
+
.is-collapsed .mobile-actions {
|
|
539
|
+
display: flex;
|
|
540
|
+
flex-direction: column;
|
|
541
|
+
gap: 6px;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
:host([edge='bottom'][mobile-mode='menu']) .is-collapsed {
|
|
545
|
+
display: flex;
|
|
546
|
+
flex-direction: column-reverse;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
:host([edge='bottom'][mobile-mode='menu']) .is-collapsed .desktop-nav,
|
|
550
|
+
:host([edge='bottom'][mobile-mode='menu']) .is-collapsed .desktop-actions {
|
|
551
|
+
order: -1;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
/* Read intrinsic desktop dimensions on the original nodes, then restore before paint. */
|
|
555
|
+
:host .navbar.is-measuring .navbar-row {
|
|
556
|
+
display: flex;
|
|
557
|
+
flex-wrap: nowrap;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
:host .navbar.is-measuring :is(.brand-link, .desktop-nav, .desktop-actions) {
|
|
561
|
+
display: flex;
|
|
562
|
+
flex: 0 0 auto;
|
|
563
|
+
width: max-content;
|
|
564
|
+
max-width: none;
|
|
565
|
+
flex-direction: row;
|
|
566
|
+
flex-wrap: nowrap;
|
|
567
|
+
order: 0;
|
|
568
|
+
align-items: center;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
:host .navbar.is-measuring .desktop-nav {
|
|
572
|
+
position: relative;
|
|
573
|
+
inset-inline-start: var(--q-navbar-nav-offset-inline, 0px);
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
:host .navbar.is-measuring .desktop-nav slot[name='nav'] {
|
|
577
|
+
display: contents;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
:host .navbar.is-measuring :is(.nav-item-shell, .nav-item) {
|
|
581
|
+
width: var(--q-navbar-item-width, max-content);
|
|
582
|
+
flex-shrink: 0;
|
|
583
|
+
}
|
|
584
|
+
}
|
|
@@ -37,6 +37,10 @@ export class QNavbar {
|
|
|
37
37
|
compact = false;
|
|
38
38
|
transparent = false;
|
|
39
39
|
bordered = true;
|
|
40
|
+
/** Horizontal desktop navigation alignment. */
|
|
41
|
+
navAlign = 'start';
|
|
42
|
+
/** Reference box for centred horizontal desktop navigation. */
|
|
43
|
+
navCenterWithin = 'available';
|
|
40
44
|
/** Controls whether mobile widths collapse items into a menu or keep them inline. */
|
|
41
45
|
mobileMode = 'menu';
|
|
42
46
|
/** Accessible label for the mobile menu toggle button. */
|
|
@@ -48,13 +52,215 @@ export class QNavbar {
|
|
|
48
52
|
// ========================= [2] INTERNAL STATE & REFS =========================
|
|
49
53
|
menuOpen = false;
|
|
50
54
|
hasMobileContent = false;
|
|
55
|
+
collision = false;
|
|
56
|
+
hasMobileNav = false;
|
|
57
|
+
hasMobileActions = false;
|
|
51
58
|
instanceId = ++navbarIds;
|
|
52
59
|
primaryNavId = `q-navbar-primary-nav-${this.instanceId}`;
|
|
53
60
|
mobilePanelId = `q-navbar-mobile-panel-${this.instanceId}`;
|
|
54
61
|
dismissListenersActive = false;
|
|
62
|
+
resizeObserver;
|
|
63
|
+
mutationObserver;
|
|
64
|
+
frame = 0;
|
|
65
|
+
focusAfterRender;
|
|
66
|
+
desktopFocus;
|
|
55
67
|
// ========================= [3] LIFECYCLE & WATCHERS ==========================
|
|
68
|
+
connectedCallback() {
|
|
69
|
+
if (typeof window === 'undefined')
|
|
70
|
+
return;
|
|
71
|
+
this.resizeObserver = new ResizeObserver(this.scheduleMeasure);
|
|
72
|
+
this.resizeObserver.observe(this.el);
|
|
73
|
+
this.mutationObserver = new MutationObserver(this.refreshObservedContent);
|
|
74
|
+
this.mutationObserver.observe(this.el, { subtree: true, childList: true, characterData: true, attributes: true });
|
|
75
|
+
this.el.addEventListener('load', this.scheduleMeasure, true);
|
|
76
|
+
window.addEventListener('resize', this.scheduleMeasure);
|
|
77
|
+
document.fonts?.addEventListener('loadingdone', this.scheduleMeasure);
|
|
78
|
+
void document.fonts?.ready.then(() => this.scheduleMeasure());
|
|
79
|
+
this.el.shadowRoot?.addEventListener('slotchange', this.refreshObservedContent);
|
|
80
|
+
this.el.shadowRoot?.addEventListener('load', this.scheduleMeasure, true);
|
|
81
|
+
if (this.el.shadowRoot)
|
|
82
|
+
this.refreshObservedContent();
|
|
83
|
+
this.scheduleMeasure();
|
|
84
|
+
}
|
|
85
|
+
componentDidLoad() {
|
|
86
|
+
this.el.shadowRoot?.addEventListener('slotchange', this.refreshObservedContent);
|
|
87
|
+
this.el.shadowRoot?.addEventListener('load', this.scheduleMeasure, true);
|
|
88
|
+
this.refreshObservedContent();
|
|
89
|
+
}
|
|
90
|
+
componentDidRender() {
|
|
91
|
+
if (this.focusAfterRender) {
|
|
92
|
+
const target = this.focusAfterRender;
|
|
93
|
+
(target !== 'navigation' && this.canReceiveFocus(target) ? target : this.firstNavigationControl()).focus();
|
|
94
|
+
this.focusAfterRender = undefined;
|
|
95
|
+
}
|
|
96
|
+
this.scheduleMeasure();
|
|
97
|
+
}
|
|
98
|
+
mobileModeChanged() {
|
|
99
|
+
if (!this.collision)
|
|
100
|
+
return;
|
|
101
|
+
const root = this.el.shadowRoot;
|
|
102
|
+
const { focused, owned, inBrand, inMobileSlot } = this.focusContext();
|
|
103
|
+
this.setMenuOpen(false);
|
|
104
|
+
if (this.mobileMode === 'inline' && owned && (focused === root.querySelector('.menu-button') || inMobileSlot)) {
|
|
105
|
+
this.focusAfterRender = this.desktopFocus || 'navigation';
|
|
106
|
+
}
|
|
107
|
+
else if (this.mobileMode === 'menu' && focused && owned && !inBrand) {
|
|
108
|
+
this.desktopFocus = focused;
|
|
109
|
+
this.focusAfterRender = root.querySelector('.menu-button');
|
|
110
|
+
}
|
|
111
|
+
}
|
|
56
112
|
disconnectedCallback() {
|
|
57
113
|
this.removeMenuDismissListeners();
|
|
114
|
+
this.resizeObserver?.disconnect();
|
|
115
|
+
this.mutationObserver?.disconnect();
|
|
116
|
+
cancelAnimationFrame(this.frame);
|
|
117
|
+
this.frame = 0;
|
|
118
|
+
this.el.removeEventListener('load', this.scheduleMeasure, true);
|
|
119
|
+
this.el.shadowRoot?.removeEventListener('slotchange', this.refreshObservedContent);
|
|
120
|
+
this.el.shadowRoot?.removeEventListener('load', this.scheduleMeasure, true);
|
|
121
|
+
window.removeEventListener('resize', this.scheduleMeasure);
|
|
122
|
+
document.fonts?.removeEventListener('loadingdone', this.scheduleMeasure);
|
|
123
|
+
}
|
|
124
|
+
refreshObservedContent = () => {
|
|
125
|
+
this.handleMobileSlotChange();
|
|
126
|
+
this.resizeObserver?.disconnect();
|
|
127
|
+
this.resizeObserver?.observe(this.el);
|
|
128
|
+
for (const node of [...Array.from(this.el.querySelectorAll('*')), ...Array.from(this.el.shadowRoot?.querySelectorAll('img, .brand-link, .desktop-actions, .nav-item-shell') || [])]) {
|
|
129
|
+
this.resizeObserver?.observe(node);
|
|
130
|
+
}
|
|
131
|
+
this.scheduleMeasure();
|
|
132
|
+
};
|
|
133
|
+
scheduleMeasure = () => {
|
|
134
|
+
if (!this.el.isConnected || this.frame)
|
|
135
|
+
return;
|
|
136
|
+
this.frame = requestAnimationFrame(() => {
|
|
137
|
+
this.frame = 0;
|
|
138
|
+
this.measureLayout();
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
/** Measure the original nodes synchronously; no cloned controls or hidden-width guesses. */
|
|
142
|
+
measureLayout() {
|
|
143
|
+
const root = this.el.shadowRoot;
|
|
144
|
+
const bar = root?.querySelector('.navbar');
|
|
145
|
+
if (!bar)
|
|
146
|
+
return;
|
|
147
|
+
const enabled = window.innerWidth > 720 && this.navAlign === 'center' && (this.edge === 'top' || this.edge === 'bottom');
|
|
148
|
+
let next = false;
|
|
149
|
+
if (enabled) {
|
|
150
|
+
const row = root.querySelector('.navbar-row');
|
|
151
|
+
const nav = root.querySelector('.desktop-nav');
|
|
152
|
+
bar.classList.add('is-measuring');
|
|
153
|
+
try {
|
|
154
|
+
const style = getComputedStyle(row);
|
|
155
|
+
const available = row.clientWidth - parseFloat(style.paddingLeft) - parseFloat(style.paddingRight);
|
|
156
|
+
const gap = parseFloat(style.columnGap) || 0;
|
|
157
|
+
const brand = this.visualWidth(root.querySelector('.brand-link'));
|
|
158
|
+
const actions = this.visualWidth(root.querySelector('.desktop-actions'));
|
|
159
|
+
const navRect = nav.getBoundingClientRect();
|
|
160
|
+
const bounds = this.visualBounds(nav);
|
|
161
|
+
// Symmetric overflow allowance keeps the actual navigation group centred.
|
|
162
|
+
const navigation = navRect.width + 2 * Math.max(0, navRect.left - bounds.left, bounds.right - navRect.right);
|
|
163
|
+
const offset = Math.abs(parseFloat(getComputedStyle(nav).insetInlineStart) || 0);
|
|
164
|
+
const sides = this.navCenterWithin === 'container' ? 2 * Math.max(brand, actions) : brand + actions;
|
|
165
|
+
const spare = available - (sides + 2 * gap + navigation + 2 * offset);
|
|
166
|
+
next = spare < (this.collision ? 8 : 0);
|
|
167
|
+
}
|
|
168
|
+
finally {
|
|
169
|
+
bar.classList.remove('is-measuring');
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
if (next === this.collision)
|
|
173
|
+
return;
|
|
174
|
+
const { focused, owned, inBrand, inMobileSlot } = this.focusContext();
|
|
175
|
+
const toggle = root.querySelector('.menu-button');
|
|
176
|
+
if (next && this.mobileMode === 'menu' && owned && !inBrand) {
|
|
177
|
+
this.desktopFocus = focused;
|
|
178
|
+
// Expose the toggle before the render hides the focused desktop control.
|
|
179
|
+
bar.classList.add('is-collapsed');
|
|
180
|
+
toggle.focus();
|
|
181
|
+
this.focusAfterRender = toggle;
|
|
182
|
+
}
|
|
183
|
+
else if (!next && this.collision) {
|
|
184
|
+
this.setMenuOpen(false);
|
|
185
|
+
if (owned) {
|
|
186
|
+
const desktopControl = focused !== toggle && !inMobileSlot ? focused : this.desktopFocus;
|
|
187
|
+
this.focusAfterRender = window.innerWidth <= 720 && this.mobileMode === 'menu' ? toggle :
|
|
188
|
+
desktopControl?.isConnected ? desktopControl : 'navigation';
|
|
189
|
+
}
|
|
190
|
+
this.desktopFocus = undefined;
|
|
191
|
+
}
|
|
192
|
+
this.collision = next;
|
|
193
|
+
}
|
|
194
|
+
visualBounds(element) {
|
|
195
|
+
const rect = element.getBoundingClientRect();
|
|
196
|
+
let left = rect.left;
|
|
197
|
+
let right = rect.right;
|
|
198
|
+
const visit = (node) => {
|
|
199
|
+
if (getComputedStyle(node).display === 'none')
|
|
200
|
+
return;
|
|
201
|
+
const box = node.getBoundingClientRect();
|
|
202
|
+
if (box.width && getComputedStyle(node).visibility !== 'hidden') {
|
|
203
|
+
left = Math.min(left, box.left);
|
|
204
|
+
right = Math.max(right, box.right);
|
|
205
|
+
}
|
|
206
|
+
const children = node instanceof HTMLSlotElement ? node.assignedElements({ flatten: true }) : Array.from(node.shadowRoot?.children || node.children);
|
|
207
|
+
for (const child of children)
|
|
208
|
+
visit(child);
|
|
209
|
+
};
|
|
210
|
+
visit(element);
|
|
211
|
+
return { left, right };
|
|
212
|
+
}
|
|
213
|
+
visualWidth(element) {
|
|
214
|
+
const bounds = this.visualBounds(element);
|
|
215
|
+
return bounds.right - bounds.left;
|
|
216
|
+
}
|
|
217
|
+
firstNavigationControl() {
|
|
218
|
+
// Search the rendered tree, including assigned slots and custom controls' open shadows.
|
|
219
|
+
// Resolve this after rendering so the restored desktop controls are visible.
|
|
220
|
+
const find = (node) => {
|
|
221
|
+
if (node instanceof HTMLElement && node.tabIndex >= 0 && this.canReceiveFocus(node))
|
|
222
|
+
return node;
|
|
223
|
+
const assigned = node instanceof HTMLSlotElement ? node.assignedElements({ flatten: true }) : [];
|
|
224
|
+
const children = node instanceof HTMLSlotElement && assigned.length ? assigned : Array.from(node.shadowRoot?.children || node.children);
|
|
225
|
+
for (const child of children) {
|
|
226
|
+
const control = find(child);
|
|
227
|
+
if (control)
|
|
228
|
+
return control;
|
|
229
|
+
}
|
|
230
|
+
return undefined;
|
|
231
|
+
};
|
|
232
|
+
return find(this.el.shadowRoot.querySelector('.desktop-nav')) || this.el.shadowRoot.querySelector('.brand-link');
|
|
233
|
+
}
|
|
234
|
+
canReceiveFocus(element) {
|
|
235
|
+
if (!element.isConnected || !element.checkVisibility() || getComputedStyle(element).visibility !== 'visible')
|
|
236
|
+
return false;
|
|
237
|
+
let node = element;
|
|
238
|
+
while (node && node !== this.el) {
|
|
239
|
+
if (node instanceof HTMLElement && node.matches(':disabled, [disabled], [aria-disabled="true"], [inert], [aria-hidden="true"]'))
|
|
240
|
+
return false;
|
|
241
|
+
node = this.composedParent(node);
|
|
242
|
+
}
|
|
243
|
+
return true;
|
|
244
|
+
}
|
|
245
|
+
composedParent(node) {
|
|
246
|
+
return node instanceof HTMLElement && node.assignedSlot ? node.assignedSlot :
|
|
247
|
+
node.parentNode || (node instanceof ShadowRoot ? node.host : null);
|
|
248
|
+
}
|
|
249
|
+
focusContext() {
|
|
250
|
+
let focused = (this.el.shadowRoot?.activeElement || document.activeElement);
|
|
251
|
+
while (focused?.shadowRoot?.activeElement)
|
|
252
|
+
focused = focused.shadowRoot.activeElement;
|
|
253
|
+
let owner = focused;
|
|
254
|
+
let inBrand = false;
|
|
255
|
+
let inMobileSlot = false;
|
|
256
|
+
while (owner && owner !== this.el) {
|
|
257
|
+
if (owner instanceof HTMLElement) {
|
|
258
|
+
inBrand ||= owner.matches('.brand-link, [slot="brand"]');
|
|
259
|
+
inMobileSlot ||= owner.matches('[slot="mobile-nav"], [slot="mobile-actions"]');
|
|
260
|
+
}
|
|
261
|
+
owner = this.composedParent(owner);
|
|
262
|
+
}
|
|
263
|
+
return { focused, owned: owner === this.el, inBrand, inMobileSlot };
|
|
58
264
|
}
|
|
59
265
|
// =================== [5] EVENT HANDLERS & INTERNAL METHODS ===================
|
|
60
266
|
get parsedItems() {
|
|
@@ -95,6 +301,8 @@ export class QNavbar {
|
|
|
95
301
|
handleDocumentKeyDown = (ev) => {
|
|
96
302
|
if (ev.key === 'Escape') {
|
|
97
303
|
this.handleMenuClose();
|
|
304
|
+
if (this.collision)
|
|
305
|
+
this.el.shadowRoot?.querySelector('.menu-button')?.focus();
|
|
98
306
|
}
|
|
99
307
|
};
|
|
100
308
|
handleWindowClick = (ev) => {
|
|
@@ -121,7 +329,9 @@ export class QNavbar {
|
|
|
121
329
|
this.handleMenuClose();
|
|
122
330
|
};
|
|
123
331
|
handleMobileSlotChange = () => {
|
|
124
|
-
this.
|
|
332
|
+
this.hasMobileNav = !!this.el.querySelector(':scope > [slot="mobile-nav"]');
|
|
333
|
+
this.hasMobileActions = !!this.el.querySelector(':scope > [slot="mobile-actions"]');
|
|
334
|
+
this.hasMobileContent = this.hasMobileNav || this.hasMobileActions;
|
|
125
335
|
};
|
|
126
336
|
setIconAttribute(el, name, value) {
|
|
127
337
|
if (value === undefined || value === null || value === '') {
|
|
@@ -176,14 +386,17 @@ export class QNavbar {
|
|
|
176
386
|
const items = identifyItems(this.parsedItems, item => item.value, { warningContext: 'q-navbar.items' });
|
|
177
387
|
const hasItems = items.length > 0;
|
|
178
388
|
const ariaLabel = this.ariaLabel?.trim() || undefined;
|
|
179
|
-
return (h("div", { key: '
|
|
389
|
+
return (h("div", { key: '00f888b080a074ec3685ceada5d496326514e2fb', class: {
|
|
180
390
|
'navbar': true,
|
|
181
391
|
'is-open': this.menuOpen,
|
|
182
392
|
'is-sticky': this.sticky,
|
|
183
393
|
'is-compact': this.compact,
|
|
184
394
|
'is-transparent': this.transparent,
|
|
185
395
|
'is-bordered': this.bordered,
|
|
186
|
-
|
|
396
|
+
'is-collapsed': this.collision,
|
|
397
|
+
'has-mobile-nav': this.hasMobileNav,
|
|
398
|
+
'has-mobile-actions': this.hasMobileActions,
|
|
399
|
+
}, part: "navbar" }, h("div", { key: 'f24c91309c2c5987ef1b84f79acdcb31ae521b86', class: "navbar-row" }, this.renderBrand(), h("nav", { key: '3e26ddc18f190a92bbd9056dabe1329f15caa4f2', id: this.primaryNavId, class: "desktop-nav", "aria-label": ariaLabel || 'Primary navigation', part: "nav" }, hasItems && this.renderNavItems(items), h("slot", { key: '1a45ae975cff2d34f8c689901ba0f7bec4fdd3f2', name: "nav" })), h("div", { key: 'da8baabd5a3cc1ea8d8b15cfc18928c140d9d3be', class: "desktop-actions", part: "actions" }, h("slot", { key: 'd07790314852c69fd8244a6efbbb5e107beafb8f', name: "actions" })), h("button", { key: '68109104c149b3c7a8f63b15e5114ec9051b1c0a', class: "menu-button", type: "button", "aria-label": this.mobileLabel, "aria-expanded": this.menuOpen ? 'true' : 'false', "aria-controls": `${this.primaryNavId} ${this.mobilePanelId}`, "aria-haspopup": "true", onClick: this.handleMenuToggle, part: "menu-button" }, h("span", { key: 'bb6052833d3e863fb74e54d2c2c243dabe708767' }), h("span", { key: '6b2238110e06b3fa5510d4838732bcc3f5200951' }), h("span", { key: '5d5d00183cf6692d56a26f87282e9893a0a8ff97' }))), h("div", { key: 'a5b00cc3d4329ff1f8fe494e5ae018eec30eb078', id: this.mobilePanelId, class: { 'mobile-panel': true, 'has-content': this.hasMobileContent }, part: "mobile-panel" }, h("nav", { key: 'cfddcab8350f89a39eb32a9dbd0708cd58b9ee2c', class: "mobile-nav", "aria-label": ariaLabel || 'Mobile navigation' }, h("slot", { key: '11206e1984ec839c509055e2e67c16055617e2af', name: "mobile-nav", onSlotchange: this.handleMobileSlotChange })), h("div", { key: 'aa0744fdee9e3657b594aa660223199a2a89a9ac', class: "mobile-actions" }, h("slot", { key: '3c673b53b9becd58603a1b1719c78fb06cefb92a', name: "mobile-actions", onSlotchange: this.handleMobileSlotChange })))));
|
|
187
400
|
}
|
|
188
401
|
static get is() { return "q-navbar"; }
|
|
189
402
|
static get encapsulation() { return "shadow"; }
|
|
@@ -453,6 +666,60 @@ export class QNavbar {
|
|
|
453
666
|
"attribute": "bordered",
|
|
454
667
|
"defaultValue": "true"
|
|
455
668
|
},
|
|
669
|
+
"navAlign": {
|
|
670
|
+
"type": "string",
|
|
671
|
+
"mutable": false,
|
|
672
|
+
"complexType": {
|
|
673
|
+
"original": "QNavbarNavAlign",
|
|
674
|
+
"resolved": "\"center\" | \"end\" | \"start\"",
|
|
675
|
+
"references": {
|
|
676
|
+
"QNavbarNavAlign": {
|
|
677
|
+
"location": "import",
|
|
678
|
+
"path": "./navbar.types",
|
|
679
|
+
"id": "src/components/layout/navbar/navbar.types.ts::QNavbarNavAlign",
|
|
680
|
+
"referenceLocation": "QNavbarNavAlign"
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
},
|
|
684
|
+
"required": false,
|
|
685
|
+
"optional": false,
|
|
686
|
+
"docs": {
|
|
687
|
+
"tags": [],
|
|
688
|
+
"text": "Horizontal desktop navigation alignment."
|
|
689
|
+
},
|
|
690
|
+
"getter": false,
|
|
691
|
+
"setter": false,
|
|
692
|
+
"reflect": true,
|
|
693
|
+
"attribute": "nav-align",
|
|
694
|
+
"defaultValue": "'start'"
|
|
695
|
+
},
|
|
696
|
+
"navCenterWithin": {
|
|
697
|
+
"type": "string",
|
|
698
|
+
"mutable": false,
|
|
699
|
+
"complexType": {
|
|
700
|
+
"original": "QNavbarNavCenterWithin",
|
|
701
|
+
"resolved": "\"available\" | \"container\"",
|
|
702
|
+
"references": {
|
|
703
|
+
"QNavbarNavCenterWithin": {
|
|
704
|
+
"location": "import",
|
|
705
|
+
"path": "./navbar.types",
|
|
706
|
+
"id": "src/components/layout/navbar/navbar.types.ts::QNavbarNavCenterWithin",
|
|
707
|
+
"referenceLocation": "QNavbarNavCenterWithin"
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
},
|
|
711
|
+
"required": false,
|
|
712
|
+
"optional": false,
|
|
713
|
+
"docs": {
|
|
714
|
+
"tags": [],
|
|
715
|
+
"text": "Reference box for centred horizontal desktop navigation."
|
|
716
|
+
},
|
|
717
|
+
"getter": false,
|
|
718
|
+
"setter": false,
|
|
719
|
+
"reflect": true,
|
|
720
|
+
"attribute": "nav-center-within",
|
|
721
|
+
"defaultValue": "'available'"
|
|
722
|
+
},
|
|
456
723
|
"mobileMode": {
|
|
457
724
|
"type": "string",
|
|
458
725
|
"mutable": false,
|
|
@@ -525,7 +792,10 @@ export class QNavbar {
|
|
|
525
792
|
static get states() {
|
|
526
793
|
return {
|
|
527
794
|
"menuOpen": {},
|
|
528
|
-
"hasMobileContent": {}
|
|
795
|
+
"hasMobileContent": {},
|
|
796
|
+
"collision": {},
|
|
797
|
+
"hasMobileNav": {},
|
|
798
|
+
"hasMobileActions": {}
|
|
529
799
|
};
|
|
530
800
|
}
|
|
531
801
|
static get events() {
|
|
@@ -569,4 +839,10 @@ export class QNavbar {
|
|
|
569
839
|
}];
|
|
570
840
|
}
|
|
571
841
|
static get elementRef() { return "el"; }
|
|
842
|
+
static get watchers() {
|
|
843
|
+
return [{
|
|
844
|
+
"propName": "mobileMode",
|
|
845
|
+
"methodName": "mobileModeChanged"
|
|
846
|
+
}];
|
|
847
|
+
}
|
|
572
848
|
}
|