@visma-swno/vsn-navigation 1.2.0-beta.3 → 1.2.0-beta.4
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.
|
@@ -305,10 +305,10 @@ var A = 0, Ae = (e) => (ge(((e, t) => Ee(ke, e, t))), T = Oe = e.sourceLocale, D
|
|
|
305
305
|
if (typeof navigator > "u") return !1;
|
|
306
306
|
let e = navigator.userAgentData?.platform ?? navigator.platform ?? "";
|
|
307
307
|
return /mac/i.test(e);
|
|
308
|
-
}, Pe = (e) => Ne() ? e.metaKey : e.ctrlKey, Fe = () => x("Choose a service"), Ie = () => x("Search"), Le = () => Ne() ? "Cmd+K" : "CTRL+K", Re = (e) => x(b`Type at least ${e} characters to search`), ze = () => x("Menu items"), Be = (e) => x(b`Load ${e} more`), Ve = () => x("VSN"), He = "survicate-sdk", Ue = "ui-components-feedback", We = (e) => `https://survey.survicate.com/workspaces/${e}/web_surveys.js`;
|
|
308
|
+
}, Pe = (e) => !e.shiftKey && !e.altKey && (Ne() ? e.metaKey && !e.ctrlKey : e.ctrlKey && !e.metaKey), j = (e) => e.shiftKey || e.altKey || e.ctrlKey || e.metaKey, M = (e) => !j(e), Fe = () => x("Choose a service"), Ie = () => x("Search"), Le = () => Ne() ? "Cmd+K" : "CTRL+K", Re = (e) => x(b`Type at least ${e} characters to search`), ze = () => x("Menu items"), Be = (e) => x(b`Load ${e} more`), Ve = () => x("VSN"), He = "survicate-sdk", Ue = "ui-components-feedback", We = (e) => `https://survey.survicate.com/workspaces/${e}/web_surveys.js`;
|
|
309
309
|
//#endregion
|
|
310
310
|
//#region src/shared/icons.ts
|
|
311
|
-
function
|
|
311
|
+
function N(e, t = 24, r) {
|
|
312
312
|
return n`<svg
|
|
313
313
|
xmlns="http://www.w3.org/2000/svg"
|
|
314
314
|
width="${t}"
|
|
@@ -386,7 +386,7 @@ var tt = i`
|
|
|
386
386
|
<path d="m7 9 5-5 5 5"/>
|
|
387
387
|
`, nt = i`
|
|
388
388
|
<path d="m18 15-6-6-6 6"/>
|
|
389
|
-
`,
|
|
389
|
+
`, P = i`
|
|
390
390
|
<path d="m6 9 6 6 6-6"/>
|
|
391
391
|
`, rt = i`
|
|
392
392
|
<circle cx="11" cy="11" r="8"/>
|
|
@@ -417,7 +417,7 @@ var ot = i`
|
|
|
417
417
|
`;
|
|
418
418
|
//#endregion
|
|
419
419
|
//#region \0@oxc-project+runtime@0.127.0/helpers/decorate.js
|
|
420
|
-
function
|
|
420
|
+
function F(e, t, n, r) {
|
|
421
421
|
var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
|
|
422
422
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
|
|
423
423
|
else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
|
|
@@ -425,9 +425,9 @@ function N(e, t, n, r) {
|
|
|
425
425
|
}
|
|
426
426
|
//#endregion
|
|
427
427
|
//#region src/components/vsn-side-bar/vsn-menu/vsn-menu-item.ts
|
|
428
|
-
var
|
|
428
|
+
var I, L = class extends e {
|
|
429
429
|
static {
|
|
430
|
-
|
|
430
|
+
I = this;
|
|
431
431
|
}
|
|
432
432
|
static {
|
|
433
433
|
this.styles = [h];
|
|
@@ -452,7 +452,7 @@ var P, F = class extends e {
|
|
|
452
452
|
}
|
|
453
453
|
}, this._onItemMouseLeave = () => {
|
|
454
454
|
this._showTooltip = !1;
|
|
455
|
-
}, this._tooltipId = `vsn-side-menu-item-tooltip-${
|
|
455
|
+
}, this._tooltipId = `vsn-side-menu-item-tooltip-${I._idCounter++}`;
|
|
456
456
|
}
|
|
457
457
|
willUpdate(e) {
|
|
458
458
|
let t = this.tree;
|
|
@@ -477,7 +477,7 @@ var P, F = class extends e {
|
|
|
477
477
|
<div class="ga-tooltip ga-tooltip--right-center w-34 max-w-135">${this.tree?.label}</div>
|
|
478
478
|
</div>
|
|
479
479
|
<span class="ga-side-navigation__item-icon">
|
|
480
|
-
${e ? this._isExpanded ?
|
|
480
|
+
${e ? this._isExpanded ? N(P, 16) : N(ot, 16) : ""}
|
|
481
481
|
</span>
|
|
482
482
|
<div class="ga-side-navigation__item-content">
|
|
483
483
|
<div class="ga-side-navigation__item-label">${this.tree?.label}</div>
|
|
@@ -511,7 +511,7 @@ var P, F = class extends e {
|
|
|
511
511
|
this._isExpanded = !this._isExpanded, e.preventDefault(), e.stopPropagation();
|
|
512
512
|
return;
|
|
513
513
|
}
|
|
514
|
-
if (e.button !== 0 || e
|
|
514
|
+
if (e.button !== 0 || j(e)) return;
|
|
515
515
|
e.preventDefault(), e.stopPropagation();
|
|
516
516
|
let n = new CustomEvent("vsn-menu-item-changed", {
|
|
517
517
|
bubbles: !0,
|
|
@@ -521,13 +521,13 @@ var P, F = class extends e {
|
|
|
521
521
|
this.dispatchEvent(n);
|
|
522
522
|
}
|
|
523
523
|
};
|
|
524
|
-
|
|
524
|
+
F([s({ attribute: !1 })], L.prototype, "tree", void 0), F([s({ type: Number })], L.prototype, "level", void 0), F([ue({
|
|
525
525
|
context: de,
|
|
526
526
|
subscribe: !0
|
|
527
|
-
}), l()],
|
|
527
|
+
}), l()], L.prototype, "_currentActiveId", void 0), F([l()], L.prototype, "_isActive", void 0), F([l()], L.prototype, "_isExpanded", void 0), F([l()], L.prototype, "_showTooltip", void 0), F([l()], L.prototype, "_tooltipPos", void 0), F([c(".ga-side-navigation__item-label")], L.prototype, "_labelEl", void 0), L = I = F([o("vsn-menu-item")], L);
|
|
528
528
|
//#endregion
|
|
529
529
|
//#region src/components/vsn-side-bar/vsn-menu/vsn-menu.ts
|
|
530
|
-
var
|
|
530
|
+
var R = class extends e {
|
|
531
531
|
constructor(...e) {
|
|
532
532
|
super(...e), this.items = [], this._currentActiveId = "", this.currentItem = "";
|
|
533
533
|
}
|
|
@@ -556,110 +556,118 @@ var I = class extends e {
|
|
|
556
556
|
return n`<vsn-menu-item .tree=${e}></vsn-menu-item>`;
|
|
557
557
|
}
|
|
558
558
|
};
|
|
559
|
-
|
|
559
|
+
F([s({ attribute: !1 })], R.prototype, "items", void 0), F([le({ context: de }), l()], R.prototype, "_currentActiveId", void 0), F([s()], R.prototype, "currentItem", void 0), R = F([o("vsn-menu")], R);
|
|
560
560
|
//#endregion
|
|
561
561
|
//#region src/components/vsn-side-bar/vsn-menu/vsn-menu-button.ts
|
|
562
|
-
var
|
|
562
|
+
var z = class extends e {
|
|
563
563
|
constructor(...e) {
|
|
564
|
-
super(...e), this.label = "", this._onKeydown = (e) => {
|
|
565
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.click());
|
|
564
|
+
super(...e), this.label = "", this.closeOnClick = !1, this._onKeydown = (e) => {
|
|
565
|
+
e.defaultPrevented || M(e) && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), e.stopImmediatePropagation(), this.click());
|
|
566
|
+
}, this._onClick = (e) => {
|
|
567
|
+
e.defaultPrevented || e.button !== 0 || j(e) || this.closeOnClick && this.dispatchEvent(new CustomEvent("vsn-side-bar-close", {
|
|
568
|
+
bubbles: !0,
|
|
569
|
+
composed: !0
|
|
570
|
+
}));
|
|
566
571
|
};
|
|
567
572
|
}
|
|
568
573
|
static {
|
|
569
574
|
this.styles = [t`
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
575
|
+
/* Every dimension multiplies by --ga-base-scaling-factor (default 1) so the
|
|
576
|
+
whole component scales uniformly with the host's density setting.
|
|
577
|
+
Layout spacing lives on the inner .row, NOT on :host — a consuming app's
|
|
578
|
+
reset (* { margin: 0; padding: 0 }) overrides :host but can't reach the shadow. */
|
|
574
579
|
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
+
:host {
|
|
581
|
+
display: block;
|
|
582
|
+
border-radius: calc(var(--ga-radius) * var(--ga-base-scaling-factor, 1));
|
|
583
|
+
cursor: pointer;
|
|
584
|
+
}
|
|
580
585
|
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
586
|
+
:host(:hover) {
|
|
587
|
+
background-color: var(--ga-color-surface-action-hover-2);
|
|
588
|
+
}
|
|
584
589
|
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
590
|
+
:host(:focus-visible) {
|
|
591
|
+
outline: calc(2px * var(--ga-base-scaling-factor, 1)) solid var(--ga-color-border-focus);
|
|
592
|
+
outline-offset: calc(4px * var(--ga-base-scaling-factor, 1));
|
|
593
|
+
}
|
|
589
594
|
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
595
|
+
.row {
|
|
596
|
+
display: flex;
|
|
597
|
+
align-items: center;
|
|
598
|
+
/* spacing-04 padding-block + 20px label line-height = 44px row,
|
|
599
|
+
matching Gaia's .ga-side-navigation__item (py-3 / px-4 / gap-3). */
|
|
600
|
+
gap: calc(var(--ga-size-spacing-04) * var(--ga-base-scaling-factor, 1));
|
|
601
|
+
padding-block: calc(var(--ga-size-spacing-04) * var(--ga-base-scaling-factor, 1));
|
|
602
|
+
padding-inline: calc(var(--ga-size-spacing-05) * var(--ga-base-scaling-factor, 1));
|
|
603
|
+
}
|
|
599
604
|
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
605
|
+
.icon {
|
|
606
|
+
width: calc(1rem * var(--ga-base-scaling-factor, 1));
|
|
607
|
+
flex-shrink: 0;
|
|
608
|
+
color: var(--ga-color-icon-primary);
|
|
609
|
+
display: inline-flex;
|
|
610
|
+
align-items: center;
|
|
611
|
+
}
|
|
607
612
|
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
613
|
+
.label {
|
|
614
|
+
flex: 1;
|
|
615
|
+
display: inline-flex;
|
|
616
|
+
overflow: hidden;
|
|
617
|
+
white-space: nowrap;
|
|
618
|
+
text-overflow: ellipsis;
|
|
619
|
+
font-family: Inter, ui-sans-serif, system-ui, sans-serif;
|
|
620
|
+
font-feature-settings: 'liga' 1, 'calt' 1;
|
|
621
|
+
font-size: calc(var(--ga-text-md-font-size) * var(--ga-base-scaling-factor, 1));
|
|
622
|
+
line-height: calc(var(--ga-text-md-line-height) * var(--ga-base-scaling-factor, 1));
|
|
623
|
+
letter-spacing: calc(var(--ga-text-md-letter-spacing) * var(--ga-base-scaling-factor, 1));
|
|
624
|
+
color: var(--ga-color-text-action);
|
|
625
|
+
}
|
|
621
626
|
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
627
|
+
slot[name="kbd"]::slotted(kbd) {
|
|
628
|
+
display: inline-flex;
|
|
629
|
+
align-items: center;
|
|
630
|
+
justify-content: center;
|
|
631
|
+
gap: calc(0.125rem * var(--ga-base-scaling-factor, 1));
|
|
632
|
+
flex-shrink: 0;
|
|
633
|
+
cursor: default;
|
|
634
|
+
border: calc(1px * var(--ga-base-scaling-factor, 1)) solid var(--ga-color-border-disabled);
|
|
635
|
+
border-radius: calc(var(--ga-radius) * var(--ga-base-scaling-factor, 1));
|
|
636
|
+
background-color: var(--ga-color-white);
|
|
637
|
+
/* !important: the <kbd> is host-provided slotted content, so a
|
|
638
|
+
consuming app's * { padding: 0 } reset overrides ::slotted normal
|
|
639
|
+
rules. We can't move it to an inner shadow element (it's the
|
|
640
|
+
host's element), so important is the accepted defense here. */
|
|
641
|
+
padding-inline: calc(var(--ga-size-spacing-02) * var(--ga-base-scaling-factor, 1)) !important;
|
|
642
|
+
padding-block: calc(1px * var(--ga-base-scaling-factor, 1)) !important;
|
|
643
|
+
font-family: Inter, ui-sans-serif, system-ui, sans-serif;
|
|
644
|
+
font-size: calc(var(--ga-text-xs-font-size) * var(--ga-base-scaling-factor, 1));
|
|
645
|
+
line-height: calc(var(--ga-text-xs-line-height) * var(--ga-base-scaling-factor, 1));
|
|
646
|
+
letter-spacing: calc(var(--ga-text-xs-letter-spacing) * var(--ga-base-scaling-factor, 1));
|
|
647
|
+
color: var(--ga-color-text-body);
|
|
648
|
+
}
|
|
649
|
+
`];
|
|
645
650
|
}
|
|
646
651
|
connectedCallback() {
|
|
647
|
-
super.connectedCallback(), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this.addEventListener("keydown", this._onKeydown);
|
|
652
|
+
super.connectedCallback(), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this.addEventListener("keydown", this._onKeydown), this.addEventListener("click", this._onClick);
|
|
648
653
|
}
|
|
649
654
|
disconnectedCallback() {
|
|
650
|
-
this.removeEventListener("keydown", this._onKeydown), super.disconnectedCallback();
|
|
655
|
+
this.removeEventListener("keydown", this._onKeydown), this.removeEventListener("click", this._onClick), super.disconnectedCallback();
|
|
651
656
|
}
|
|
652
657
|
render() {
|
|
653
658
|
return n`
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
659
|
+
<div class="row">
|
|
660
|
+
<span class="icon"><slot name="icon"></slot></span>
|
|
661
|
+
<span class="label">${this.label}</span>
|
|
662
|
+
<slot name="kbd"></slot>
|
|
663
|
+
</div>
|
|
664
|
+
`;
|
|
660
665
|
}
|
|
661
666
|
};
|
|
662
|
-
|
|
667
|
+
F([s()], z.prototype, "label", void 0), F([s({
|
|
668
|
+
type: Boolean,
|
|
669
|
+
attribute: "close-on-click"
|
|
670
|
+
})], z.prototype, "closeOnClick", void 0), z = F([o("vsn-menu-button")], z);
|
|
663
671
|
//#endregion
|
|
664
672
|
//#region src/components/vsn-side-bar/vsn-menu/vsn-menu-separator.ts
|
|
665
673
|
var st = class extends e {
|
|
@@ -685,29 +693,30 @@ var st = class extends e {
|
|
|
685
693
|
return n`<div class="line"></div>`;
|
|
686
694
|
}
|
|
687
695
|
};
|
|
688
|
-
st =
|
|
696
|
+
st = F([o("vsn-menu-separator")], st);
|
|
689
697
|
//#endregion
|
|
690
698
|
//#region src/components/vsn-side-bar/vsn-footer/vsn-footer.keyboard.ts
|
|
691
699
|
var ct = class {
|
|
692
700
|
constructor(e) {
|
|
693
701
|
this._prevExpanded = !1, this.onUserKeydown = (e) => {
|
|
694
|
-
e.key === "Enter" || e.key === " " ? (e.preventDefault(), this.host.expanded = !this.host.expanded) : e.key === "Escape" && this.host.expanded && (e.preventDefault(), this.host.expanded = !1);
|
|
702
|
+
e.defaultPrevented || (M(e) && (e.key === "Enter" || e.key === " ") ? (e.preventDefault(), this.host.expanded = !this.host.expanded) : M(e) && e.key === "Escape" && this.host.expanded && (e.preventDefault(), this.host.expanded = !1));
|
|
695
703
|
}, this.onDropdownKeydown = (e) => {
|
|
696
|
-
if (e.
|
|
704
|
+
if (e.defaultPrevented) return;
|
|
705
|
+
if (M(e) && e.key === "Escape") {
|
|
697
706
|
e.preventDefault(), this._closeAndRefocus();
|
|
698
707
|
return;
|
|
699
708
|
}
|
|
700
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
709
|
+
if (M(e) && (e.key === "Enter" || e.key === " ")) {
|
|
701
710
|
let t = e.target;
|
|
702
711
|
t instanceof HTMLElement && t.classList.contains("ga-side-navigation__footer-dropdown-item") && (e.preventDefault(), t.click());
|
|
703
712
|
return;
|
|
704
713
|
}
|
|
705
|
-
if (e.key === "Tab"
|
|
714
|
+
if (M(e) && e.key === "Tab") {
|
|
706
715
|
let t = Array.from(this.host.querySelectorAll(".ga-side-navigation__footer-dropdown-item")), n = t[t.length - 1];
|
|
707
716
|
n && e.target === n && (this.host.expanded = !1);
|
|
708
717
|
return;
|
|
709
718
|
}
|
|
710
|
-
if (e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
|
|
719
|
+
if (j(e) || e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
|
|
711
720
|
e.preventDefault();
|
|
712
721
|
let t = this.host.querySelector(".ga-side-navigation__footer-dropdown");
|
|
713
722
|
if (!t) return;
|
|
@@ -797,7 +806,7 @@ var pt = {
|
|
|
797
806
|
}, mt = () => ({
|
|
798
807
|
profile: x("My profile"),
|
|
799
808
|
logout: x("Log out")
|
|
800
|
-
}),
|
|
809
|
+
}), B = class extends e {
|
|
801
810
|
static {
|
|
802
811
|
this.styles = [h, ut];
|
|
803
812
|
}
|
|
@@ -853,7 +862,7 @@ var pt = {
|
|
|
853
862
|
</div>
|
|
854
863
|
|
|
855
864
|
<span class="ga-side-navigation__user-action">
|
|
856
|
-
${this.expanded ?
|
|
865
|
+
${this.expanded ? N(nt, 16) : N(tt, 16)}
|
|
857
866
|
</span>
|
|
858
867
|
|
|
859
868
|
</div>
|
|
@@ -867,14 +876,14 @@ var pt = {
|
|
|
867
876
|
${this._items.map((e) => {
|
|
868
877
|
let t = n`
|
|
869
878
|
<span class="ga-side-navigation__footer-dropdown-icon">
|
|
870
|
-
${
|
|
879
|
+
${N(pt[e.id], 16)}
|
|
871
880
|
</span>
|
|
872
881
|
<span class="ga-side-navigation__footer-dropdown-title">
|
|
873
882
|
${e.label}
|
|
874
883
|
</span>
|
|
875
884
|
${e.external ? n`
|
|
876
885
|
<span class="ga-side-navigation__footer-dropdown-trail">
|
|
877
|
-
${
|
|
886
|
+
${N(et, 16)}
|
|
878
887
|
</span>
|
|
879
888
|
` : r}
|
|
880
889
|
`;
|
|
@@ -922,52 +931,55 @@ var pt = {
|
|
|
922
931
|
@error=${() => {
|
|
923
932
|
this._avatarFailed = !0;
|
|
924
933
|
}} />` : n`<span class="ga-side-navigation__user-avatar vsn-side-navigation__user-avatar--icon">
|
|
925
|
-
${
|
|
934
|
+
${N(Qe, 24)}
|
|
926
935
|
</span>`;
|
|
927
936
|
}
|
|
928
937
|
};
|
|
929
|
-
|
|
938
|
+
F([s({ attribute: !1 })], B.prototype, "user", void 0), F([s()], B.prototype, "profilePictureBaseUrl", void 0), F([s()], B.prototype, "myProfileUrl", void 0), F([s({
|
|
930
939
|
type: Boolean,
|
|
931
940
|
reflect: !0
|
|
932
|
-
})],
|
|
941
|
+
})], B.prototype, "expanded", void 0), F([l()], B.prototype, "_avatarFailed", void 0), B = F([S(), o("vsn-footer")], B);
|
|
933
942
|
//#endregion
|
|
934
943
|
//#region src/components/vsn-side-bar/vsn-header/vsn-header.keyboard.ts
|
|
935
944
|
var ht = class {
|
|
936
945
|
constructor(e) {
|
|
937
946
|
this.onSwitcherKeydown = (e) => {
|
|
938
|
-
if (e.
|
|
939
|
-
if (e
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
if (!this.host.
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
if (
|
|
950
|
-
|
|
947
|
+
if (!e.defaultPrevented) {
|
|
948
|
+
if (M(e) && (e.key === "Enter" || e.key === " ")) {
|
|
949
|
+
if (e.preventDefault(), this.host.expanded && !this.host.canClose) return;
|
|
950
|
+
(this.host.expanded || this.host.hasAvailableItems || this.host.modulesLoading) && (this.host.expanded = !this.host.expanded);
|
|
951
|
+
return;
|
|
952
|
+
}
|
|
953
|
+
if (M(e) && e.key === "ArrowDown" && !this.host.expanded) {
|
|
954
|
+
if (!this.host.hasAvailableItems) return;
|
|
955
|
+
e.preventDefault(), this.host.expanded = !0;
|
|
956
|
+
return;
|
|
957
|
+
}
|
|
958
|
+
if (M(e) && e.key === "Escape" && this.host.expanded) {
|
|
959
|
+
if (!this.host.canClose) return;
|
|
960
|
+
e.preventDefault(), this.host.expanded = !1;
|
|
961
|
+
}
|
|
951
962
|
}
|
|
952
963
|
}, this.host = e, e.addController(this);
|
|
953
964
|
}
|
|
954
965
|
hostConnected() {}
|
|
955
|
-
}, gt = ".ga-side-navigation__switcher:focus{outline-offset:2px;outline:2px solid #3b82f6}",
|
|
966
|
+
}, gt = ".ga-side-navigation__switcher:focus{outline-offset:2px;outline:2px solid #3b82f6}", V = class extends e {
|
|
956
967
|
constructor(...e) {
|
|
957
968
|
super(...e), this.items = [], this.loading = !1, this._handleKeydown = (e) => {
|
|
958
|
-
if (e.
|
|
969
|
+
if (e.defaultPrevented) return;
|
|
970
|
+
if (M(e) && e.key === "Escape") {
|
|
959
971
|
e.preventDefault(), this.dispatchEvent(new CustomEvent("close-request", {
|
|
960
972
|
bubbles: !0,
|
|
961
973
|
composed: !0
|
|
962
974
|
}));
|
|
963
975
|
return;
|
|
964
976
|
}
|
|
965
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
977
|
+
if (M(e) && (e.key === "Enter" || e.key === " ")) {
|
|
966
978
|
let t = e.target;
|
|
967
979
|
t instanceof HTMLElement && t.classList.contains("ga-side-navigation__switcher-dropdown-item") && (e.preventDefault(), t.click());
|
|
968
980
|
return;
|
|
969
981
|
}
|
|
970
|
-
if (e.key === "Tab"
|
|
982
|
+
if (M(e) && e.key === "Tab") {
|
|
971
983
|
let t = Array.from(this.querySelectorAll(".ga-side-navigation__switcher-dropdown-item")), n = t[t.length - 1];
|
|
972
984
|
n && e.target === n && this.dispatchEvent(new CustomEvent("tab-exit", {
|
|
973
985
|
bubbles: !0,
|
|
@@ -975,7 +987,7 @@ var ht = class {
|
|
|
975
987
|
}));
|
|
976
988
|
return;
|
|
977
989
|
}
|
|
978
|
-
if (e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
|
|
990
|
+
if (j(e) || e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
|
|
979
991
|
e.preventDefault();
|
|
980
992
|
let t = Array.from(this.querySelectorAll(".ga-side-navigation__switcher-dropdown-item"));
|
|
981
993
|
if (t.length === 0) return;
|
|
@@ -1033,7 +1045,7 @@ var ht = class {
|
|
|
1033
1045
|
`;
|
|
1034
1046
|
}
|
|
1035
1047
|
};
|
|
1036
|
-
|
|
1048
|
+
F([s({ attribute: !1 })], V.prototype, "items", void 0), F([s({ type: Boolean })], V.prototype, "loading", void 0), V = F([S(), o("vsn-switcher-menu")], V);
|
|
1037
1049
|
//#endregion
|
|
1038
1050
|
//#region src/components/vsn-side-bar/vsn-search/vsn-search.css.ts
|
|
1039
1051
|
var _t = t`
|
|
@@ -1085,7 +1097,7 @@ var _t = t`
|
|
|
1085
1097
|
.ga-side-navigation__search input::placeholder {
|
|
1086
1098
|
color: var(--ga-color-text-disable-selected);
|
|
1087
1099
|
}
|
|
1088
|
-
`,
|
|
1100
|
+
`, H = class extends e {
|
|
1089
1101
|
constructor(...e) {
|
|
1090
1102
|
super(...e), this.shortcut = "", this.value = "", this.loading = !1, this._emitSearch = () => {
|
|
1091
1103
|
this._canSearch && this.dispatchEvent(new CustomEvent("vsn-search-submit", {
|
|
@@ -1093,14 +1105,13 @@ var _t = t`
|
|
|
1093
1105
|
bubbles: !0,
|
|
1094
1106
|
composed: !0
|
|
1095
1107
|
}));
|
|
1096
|
-
}, this.
|
|
1097
|
-
this.dispatchEvent(new CustomEvent("vsn-search-
|
|
1098
|
-
detail: { value: this.value },
|
|
1108
|
+
}, this._emitSearchCleared = () => {
|
|
1109
|
+
this.dispatchEvent(new CustomEvent("vsn-search-cleared", {
|
|
1099
1110
|
bubbles: !0,
|
|
1100
1111
|
composed: !0
|
|
1101
1112
|
}));
|
|
1102
1113
|
}, this._handleEscape = (e) => {
|
|
1103
|
-
e.key === "Escape" && this.
|
|
1114
|
+
e.defaultPrevented || M(e) && e.key === "Escape" && this.value.length > 0 && (e.preventDefault(), this._emitSearchCleared());
|
|
1104
1115
|
};
|
|
1105
1116
|
}
|
|
1106
1117
|
createRenderRoot() {
|
|
@@ -1125,7 +1136,7 @@ var _t = t`
|
|
|
1125
1136
|
}));
|
|
1126
1137
|
}
|
|
1127
1138
|
_handleEnter(e) {
|
|
1128
|
-
e.key === "Enter" && this._emitSearch();
|
|
1139
|
+
e.defaultPrevented || M(e) && e.key === "Enter" && this._emitSearch();
|
|
1129
1140
|
}
|
|
1130
1141
|
render() {
|
|
1131
1142
|
let e = this.value.length > 0 && this.value.length < 3;
|
|
@@ -1137,16 +1148,17 @@ var _t = t`
|
|
|
1137
1148
|
aria-label=${x("Search")}
|
|
1138
1149
|
?disabled=${!this._canSearch}
|
|
1139
1150
|
@click=${this._emitSearch}>
|
|
1140
|
-
${
|
|
1151
|
+
${N(rt, 24)}
|
|
1141
1152
|
</button>
|
|
1142
1153
|
<input type="search"
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1154
|
+
.placeholder=${Ie()}
|
|
1155
|
+
.value=${this.value}
|
|
1156
|
+
@input=${this._handleInput}
|
|
1157
|
+
@keydown=${this._handleEnter}/>
|
|
1147
1158
|
${this._trailingSlot()}
|
|
1148
1159
|
</div>
|
|
1149
|
-
${u(e, () => n
|
|
1160
|
+
${u(e, () => n`
|
|
1161
|
+
<div class="vsn-search__helper">${Re(3)}</div>`)}
|
|
1150
1162
|
`;
|
|
1151
1163
|
}
|
|
1152
1164
|
_trailingSlot() {
|
|
@@ -1163,8 +1175,8 @@ var _t = t`
|
|
|
1163
1175
|
_clearButton() {
|
|
1164
1176
|
return n`
|
|
1165
1177
|
<button class="vsn-search__clear" aria-label=${x("Clear search")}
|
|
1166
|
-
|
|
1167
|
-
${
|
|
1178
|
+
@click=${this._emitSearchCleared}>
|
|
1179
|
+
${N(it, 16)}
|
|
1168
1180
|
</button>
|
|
1169
1181
|
`;
|
|
1170
1182
|
}
|
|
@@ -1172,10 +1184,10 @@ var _t = t`
|
|
|
1172
1184
|
return n`<kbd class="ga-side-navigation__search-shortcut">${this.shortcut}</kbd>`;
|
|
1173
1185
|
}
|
|
1174
1186
|
};
|
|
1175
|
-
|
|
1187
|
+
F([s()], H.prototype, "shortcut", void 0), F([s()], H.prototype, "value", void 0), F([s({ type: Boolean })], H.prototype, "loading", void 0), H = F([S(), o("vsn-search")], H);
|
|
1176
1188
|
//#endregion
|
|
1177
1189
|
//#region src/components/vsn-side-bar/vsn-header/vsn-header.ts
|
|
1178
|
-
var
|
|
1190
|
+
var U = class extends e {
|
|
1179
1191
|
createRenderRoot() {
|
|
1180
1192
|
return this;
|
|
1181
1193
|
}
|
|
@@ -1203,7 +1215,7 @@ var V = class extends e {
|
|
|
1203
1215
|
<span class="ga-side-navigation__switcher-title">${e.title}</span>
|
|
1204
1216
|
${u(this.canClose, () => n`
|
|
1205
1217
|
<span class="ga-side-navigation__switcher-action">
|
|
1206
|
-
${this.expanded ?
|
|
1218
|
+
${this.expanded ? N(P, 16) : N(tt, 16)}
|
|
1207
1219
|
</span>
|
|
1208
1220
|
`)}
|
|
1209
1221
|
</div>
|
|
@@ -1221,7 +1233,7 @@ var V = class extends e {
|
|
|
1221
1233
|
|
|
1222
1234
|
${u(this.search?.enabled, () => n`
|
|
1223
1235
|
<vsn-search
|
|
1224
|
-
.shortcut=${
|
|
1236
|
+
.shortcut=${Le()}
|
|
1225
1237
|
.value=${this.searchValue}
|
|
1226
1238
|
.loading=${this.searchLoading}>
|
|
1227
1239
|
</vsn-search>`)}
|
|
@@ -1284,10 +1296,10 @@ var V = class extends e {
|
|
|
1284
1296
|
this.canClose && (this.expanded = !1);
|
|
1285
1297
|
}
|
|
1286
1298
|
};
|
|
1287
|
-
|
|
1299
|
+
F([s({ attribute: !1 })], U.prototype, "modules", void 0), F([s()], U.prototype, "activeModuleId", void 0), F([s()], U.prototype, "activeModuleLabel", void 0), F([s({ type: Boolean })], U.prototype, "modulesLoading", void 0), F([s({ type: Boolean })], U.prototype, "hasMenu", void 0), F([s({ attribute: !1 })], U.prototype, "search", void 0), F([s()], U.prototype, "searchValue", void 0), F([s({ type: Boolean })], U.prototype, "searchLoading", void 0), F([s({
|
|
1288
1300
|
type: Boolean,
|
|
1289
1301
|
reflect: !0
|
|
1290
|
-
})],
|
|
1302
|
+
})], U.prototype, "expanded", void 0), U = F([S(), o("vsn-header")], U);
|
|
1291
1303
|
//#endregion
|
|
1292
1304
|
//#region src/components/vsn-side-bar/vsn-search-results/vsn-search-results.css.ts
|
|
1293
1305
|
var vt = t`
|
|
@@ -1362,7 +1374,7 @@ var vt = t`
|
|
|
1362
1374
|
`, yt = class {
|
|
1363
1375
|
constructor(e) {
|
|
1364
1376
|
this.onResultsKeydown = (e) => {
|
|
1365
|
-
if (e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
|
|
1377
|
+
if (e.defaultPrevented || j(e) || e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
|
|
1366
1378
|
e.preventDefault();
|
|
1367
1379
|
let t = Array.from(this.host.querySelectorAll(".ga-side-navigation__search-results-item"));
|
|
1368
1380
|
if (t.length === 0) return;
|
|
@@ -1373,7 +1385,7 @@ var vt = t`
|
|
|
1373
1385
|
}, this.host = e, e.addController(this);
|
|
1374
1386
|
}
|
|
1375
1387
|
hostConnected() {}
|
|
1376
|
-
},
|
|
1388
|
+
}, W = class extends e {
|
|
1377
1389
|
constructor(...e) {
|
|
1378
1390
|
super(...e), this.loadingMore = !1, this._keyboard = new yt(this);
|
|
1379
1391
|
}
|
|
@@ -1452,7 +1464,7 @@ var vt = t`
|
|
|
1452
1464
|
}));
|
|
1453
1465
|
}
|
|
1454
1466
|
};
|
|
1455
|
-
|
|
1467
|
+
F([s({ attribute: !1 })], W.prototype, "results", void 0), F([s()], W.prototype, "errorMessage", void 0), F([s()], W.prototype, "nextCursor", void 0), F([s({ type: Boolean })], W.prototype, "loadingMore", void 0), W = F([S(), o("vsn-search-results")], W);
|
|
1456
1468
|
//#endregion
|
|
1457
1469
|
//#region src/components/vsn-side-bar/vsn-template/vsn-template.css.ts
|
|
1458
1470
|
var bt = t`
|
|
@@ -1498,7 +1510,7 @@ var bt = t`
|
|
|
1498
1510
|
`;
|
|
1499
1511
|
}
|
|
1500
1512
|
};
|
|
1501
|
-
St =
|
|
1513
|
+
St = F([S(), o("vsn-template")], St);
|
|
1502
1514
|
//#endregion
|
|
1503
1515
|
//#region src/components/vsn-side-bar/vsn-error-state/vsn-error-state.css.ts
|
|
1504
1516
|
var Ct = t`
|
|
@@ -1550,7 +1562,7 @@ var Ct = t`
|
|
|
1550
1562
|
render() {
|
|
1551
1563
|
return n`
|
|
1552
1564
|
<div class="vsn-error-state" role="alert" aria-live="assertive">
|
|
1553
|
-
<div class="vsn-error-state__icon">${
|
|
1565
|
+
<div class="vsn-error-state__icon">${N(at, 24)}</div>
|
|
1554
1566
|
<div class="vsn-error-state__title">${x("Loading error")}</div>
|
|
1555
1567
|
<div class="vsn-error-state__message">${x("We're unable to load the menu.")}</div>
|
|
1556
1568
|
<div class="vsn-error-state__hint">${x("Please check your internet connection and try again.")}</div>
|
|
@@ -1559,7 +1571,7 @@ var Ct = t`
|
|
|
1559
1571
|
`;
|
|
1560
1572
|
}
|
|
1561
1573
|
};
|
|
1562
|
-
wt =
|
|
1574
|
+
wt = F([S(), o("vsn-error-state")], wt);
|
|
1563
1575
|
//#endregion
|
|
1564
1576
|
//#region src/components/vsn-side-bar/vsn-search-scopes/vsn-search-scopes.css.ts
|
|
1565
1577
|
var Tt = t`
|
|
@@ -1583,12 +1595,12 @@ var Tt = t`
|
|
|
1583
1595
|
text-overflow: ellipsis;
|
|
1584
1596
|
}
|
|
1585
1597
|
}
|
|
1586
|
-
`,
|
|
1598
|
+
`, Et, G = class extends e {
|
|
1587
1599
|
static {
|
|
1588
|
-
|
|
1600
|
+
Et = this;
|
|
1589
1601
|
}
|
|
1590
1602
|
constructor(...e) {
|
|
1591
|
-
super(...e), this.scopes = [], this.selectedScopeId = "", this._name = `vsn-search-scope-${++
|
|
1603
|
+
super(...e), this.scopes = [], this.selectedScopeId = "", this._name = `vsn-search-scope-${++Et._counter}`;
|
|
1592
1604
|
}
|
|
1593
1605
|
createRenderRoot() {
|
|
1594
1606
|
return this;
|
|
@@ -1630,16 +1642,16 @@ var Tt = t`
|
|
|
1630
1642
|
}));
|
|
1631
1643
|
}
|
|
1632
1644
|
};
|
|
1633
|
-
|
|
1645
|
+
F([s({ attribute: !1 })], G.prototype, "scopes", void 0), F([s()], G.prototype, "selectedScopeId", void 0), G = Et = F([S(), o("vsn-search-scopes")], G);
|
|
1634
1646
|
//#endregion
|
|
1635
1647
|
//#region src/shared/lang/locale-codes.ts
|
|
1636
|
-
var
|
|
1648
|
+
var Dt = "en", Ot = [
|
|
1637
1649
|
"da",
|
|
1638
1650
|
"fi",
|
|
1639
1651
|
"nl",
|
|
1640
1652
|
"no",
|
|
1641
1653
|
"sv"
|
|
1642
|
-
],
|
|
1654
|
+
], kt = /* @__PURE__ */ p({ templates: () => At }), At = {
|
|
1643
1655
|
s09a45db408570a7a: "Min profil",
|
|
1644
1656
|
s119f9875b7d4cdfc: "Har du brug for hjælp? Kontakt support.",
|
|
1645
1657
|
s1228605ee65ddefa: b`${0} resultat`,
|
|
@@ -1669,7 +1681,7 @@ var Et = "en", Dt = [
|
|
|
1669
1681
|
sfbf31f663cef6cc2: "Prøv andre søgeord eller tjek stavningen.",
|
|
1670
1682
|
s7c510419ea376840: "VSN",
|
|
1671
1683
|
s38385cd359b17f7a: "Loading modules"
|
|
1672
|
-
},
|
|
1684
|
+
}, jt = /* @__PURE__ */ p({ templates: () => Mt }), Mt = {
|
|
1673
1685
|
s09a45db408570a7a: "Oma profiili",
|
|
1674
1686
|
s119f9875b7d4cdfc: "Tarvitsetko apua? Ota yhteyttä tukeen.",
|
|
1675
1687
|
s1228605ee65ddefa: b`${0} tulos`,
|
|
@@ -1699,7 +1711,7 @@ var Et = "en", Dt = [
|
|
|
1699
1711
|
sfbf31f663cef6cc2: "Kokeile eri hakusanoja tai tarkista kirjoitusasu.",
|
|
1700
1712
|
s7c510419ea376840: "VSN",
|
|
1701
1713
|
s38385cd359b17f7a: "Loading modules"
|
|
1702
|
-
},
|
|
1714
|
+
}, Nt = /* @__PURE__ */ p({ templates: () => Pt }), Pt = {
|
|
1703
1715
|
s09a45db408570a7a: "Mijn profiel",
|
|
1704
1716
|
s119f9875b7d4cdfc: "Hulp nodig? Neem contact op met ondersteuning.",
|
|
1705
1717
|
s1228605ee65ddefa: b`${0} resultaat`,
|
|
@@ -1729,7 +1741,7 @@ var Et = "en", Dt = [
|
|
|
1729
1741
|
sfbf31f663cef6cc2: "Probeer andere zoekwoorden of controleer de spelling.",
|
|
1730
1742
|
s7c510419ea376840: "VSN",
|
|
1731
1743
|
s38385cd359b17f7a: "Loading modules"
|
|
1732
|
-
},
|
|
1744
|
+
}, Ft = /* @__PURE__ */ p({ templates: () => It }), It = {
|
|
1733
1745
|
s09a45db408570a7a: "Min profil",
|
|
1734
1746
|
s119f9875b7d4cdfc: "Trenger du hjelp? Kontakt støtte.",
|
|
1735
1747
|
s1228605ee65ddefa: b`${0} resultat`,
|
|
@@ -1759,7 +1771,7 @@ var Et = "en", Dt = [
|
|
|
1759
1771
|
sfbf31f663cef6cc2: "Prøv andre søkeord eller sjekk stavemåten.",
|
|
1760
1772
|
s7c510419ea376840: "VSN",
|
|
1761
1773
|
s38385cd359b17f7a: "Loading modules"
|
|
1762
|
-
},
|
|
1774
|
+
}, Lt = /* @__PURE__ */ p({ templates: () => Rt }), Rt = {
|
|
1763
1775
|
s09a45db408570a7a: "Min profil",
|
|
1764
1776
|
s119f9875b7d4cdfc: "Behöver du hjälp? Kontakta support.",
|
|
1765
1777
|
s1228605ee65ddefa: b`${0} resultat`,
|
|
@@ -1789,17 +1801,17 @@ var Et = "en", Dt = [
|
|
|
1789
1801
|
sfbf31f663cef6cc2: "Prova andra sökord eller kontrollera stavningen.",
|
|
1790
1802
|
s7c510419ea376840: "VSN",
|
|
1791
1803
|
s38385cd359b17f7a: "Loading modules"
|
|
1792
|
-
},
|
|
1793
|
-
da:
|
|
1794
|
-
fi:
|
|
1795
|
-
nl:
|
|
1796
|
-
no:
|
|
1797
|
-
sv:
|
|
1798
|
-
}, { getLocale:
|
|
1799
|
-
sourceLocale:
|
|
1800
|
-
targetLocales:
|
|
1801
|
-
loadLocale: (e) =>
|
|
1802
|
-
}),
|
|
1804
|
+
}, zt = {
|
|
1805
|
+
da: kt,
|
|
1806
|
+
fi: jt,
|
|
1807
|
+
nl: Nt,
|
|
1808
|
+
no: Ft,
|
|
1809
|
+
sv: Lt
|
|
1810
|
+
}, { getLocale: Bt, setLocale: Vt } = Ae({
|
|
1811
|
+
sourceLocale: Dt,
|
|
1812
|
+
targetLocales: Ot,
|
|
1813
|
+
loadLocale: (e) => zt[e] ? Promise.resolve(zt[e]) : Promise.reject(/* @__PURE__ */ Error(`Unknown locale: ${e}`))
|
|
1814
|
+
}), Ht = t`
|
|
1803
1815
|
@layer components {
|
|
1804
1816
|
.vsn-switcher-anchor {
|
|
1805
1817
|
position: relative;
|
|
@@ -1813,7 +1825,7 @@ var Et = "en", Dt = [
|
|
|
1813
1825
|
z-index: 10;
|
|
1814
1826
|
}
|
|
1815
1827
|
}
|
|
1816
|
-
`,
|
|
1828
|
+
`, Ut = t`
|
|
1817
1829
|
.vsn-spinner {
|
|
1818
1830
|
display: inline-block;
|
|
1819
1831
|
flex-shrink: 0;
|
|
@@ -1833,7 +1845,7 @@ var Et = "en", Dt = [
|
|
|
1833
1845
|
@keyframes vsn-spin {
|
|
1834
1846
|
to { transform: rotate(360deg); }
|
|
1835
1847
|
}
|
|
1836
|
-
`,
|
|
1848
|
+
`, Wt = class {
|
|
1837
1849
|
constructor(e, t, n) {
|
|
1838
1850
|
this._onHostClick = (e) => {
|
|
1839
1851
|
let t = this._host.renderRoot.querySelector(this._clickedSelector);
|
|
@@ -1846,14 +1858,14 @@ var Et = "en", Dt = [
|
|
|
1846
1858
|
hostDisconnected() {
|
|
1847
1859
|
this._host.removeEventListener("click", this._onHostClick);
|
|
1848
1860
|
}
|
|
1849
|
-
},
|
|
1861
|
+
}, Gt = "button:not([disabled]), a[href], [tabindex]:not([tabindex=\"-1\"])", Kt = class {
|
|
1850
1862
|
constructor(e) {
|
|
1851
1863
|
this.onKeydown = (e) => {
|
|
1852
|
-
if (e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
|
|
1864
|
+
if (e.defaultPrevented || j(e) || e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
|
|
1853
1865
|
let t = this.host.renderRoot.querySelector("slot[name=\"nav-footer\"]");
|
|
1854
1866
|
if (!t) return;
|
|
1855
1867
|
let n = [];
|
|
1856
|
-
for (let e of t.assignedElements({ flatten: !0 })) e.matches(
|
|
1868
|
+
for (let e of t.assignedElements({ flatten: !0 })) e.matches(Gt) && n.push(e), n.push(...Array.from(e.querySelectorAll(Gt)));
|
|
1857
1869
|
if (n.length === 0) return;
|
|
1858
1870
|
let r = e.composedPath()[0];
|
|
1859
1871
|
if (!(r instanceof HTMLElement)) return;
|
|
@@ -1865,18 +1877,18 @@ var Et = "en", Dt = [
|
|
|
1865
1877
|
}, this.host = e, e.addController(this);
|
|
1866
1878
|
}
|
|
1867
1879
|
hostConnected() {}
|
|
1868
|
-
},
|
|
1880
|
+
}, K = class extends e {
|
|
1869
1881
|
static {
|
|
1870
1882
|
this.styles = [
|
|
1871
1883
|
h,
|
|
1872
|
-
|
|
1884
|
+
Ht,
|
|
1873
1885
|
ut,
|
|
1874
1886
|
_t,
|
|
1875
1887
|
vt,
|
|
1876
1888
|
Tt,
|
|
1877
1889
|
bt,
|
|
1878
1890
|
Ct,
|
|
1879
|
-
|
|
1891
|
+
Ut,
|
|
1880
1892
|
t`
|
|
1881
1893
|
:host {
|
|
1882
1894
|
position: absolute;
|
|
@@ -1891,7 +1903,7 @@ var Et = "en", Dt = [
|
|
|
1891
1903
|
];
|
|
1892
1904
|
}
|
|
1893
1905
|
constructor() {
|
|
1894
|
-
super(), this.modules = [], this.modulesLoading = !1, this.lang = "en", this.error = !1, this.open = !1, this._searchQuery = "", this._searchLoading = !1, this._activeScopeId = "menu", this._searchLoadingMore = !1, this._navFooterKeyboard = new
|
|
1906
|
+
super(), this.modules = [], this.modulesLoading = !1, this.lang = "en", this.error = !1, this.open = !1, this._searchQuery = "", this._searchLoading = !1, this._activeScopeId = "menu", this._searchLoadingMore = !1, this._navFooterKeyboard = new Kt(this), this._onNavigate = (e) => {
|
|
1895
1907
|
this._searchQuery = "", this._searchResults = void 0, this.dispatchEvent(new CustomEvent("vsn-side-bar-close", {
|
|
1896
1908
|
bubbles: !0,
|
|
1897
1909
|
composed: !0
|
|
@@ -1908,13 +1920,13 @@ var Et = "en", Dt = [
|
|
|
1908
1920
|
}));
|
|
1909
1921
|
}, this._onScopeChanged = (e) => {
|
|
1910
1922
|
this._activeScopeId = e.detail.scopeId, this._runSearch(this._searchQuery, this._activeScopeId);
|
|
1911
|
-
}, new
|
|
1923
|
+
}, new Wt(this, ".ga-side-navigation", () => this.dispatchEvent(new CustomEvent("vsn-side-bar-close", {
|
|
1912
1924
|
bubbles: !0,
|
|
1913
1925
|
composed: !0
|
|
1914
1926
|
})));
|
|
1915
1927
|
}
|
|
1916
1928
|
willUpdate(e) {
|
|
1917
|
-
e.has("lang") &&
|
|
1929
|
+
e.has("lang") && Vt(this.lang).catch(console.error), e.has("open") && e.get("open") && !this.open && (this._searchQuery = "", this._activeScopeId = "menu", this._clearSearchState(), this.renderRoot.querySelector("vsn-header")?.reset(), this.renderRoot.querySelector("vsn-footer")?.reset());
|
|
1918
1930
|
}
|
|
1919
1931
|
async focusSearch() {
|
|
1920
1932
|
await this.updateComplete, this.menu?.search?.enabled && this.renderRoot.querySelector("vsn-search")?.focus();
|
|
@@ -1925,11 +1937,8 @@ var Et = "en", Dt = [
|
|
|
1925
1937
|
_onSearchSubmit(e) {
|
|
1926
1938
|
this._runSearch(e.detail.query, this._activeScopeId);
|
|
1927
1939
|
}
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
bubbles: !0,
|
|
1931
|
-
composed: !0
|
|
1932
|
-
}));
|
|
1940
|
+
_onSearchCleared() {
|
|
1941
|
+
this._searchQuery = "", this._clearSearchState(), this.focusSearch();
|
|
1933
1942
|
}
|
|
1934
1943
|
_clearSearchState() {
|
|
1935
1944
|
this._searchAbort?.abort(), this._searchAbort = void 0, this._searchResults = void 0, this._searchLoading = !1, this._searchLoadingMore = !1, this._searchError = void 0, this._searchNextCursor = void 0;
|
|
@@ -2015,43 +2024,47 @@ var Et = "en", Dt = [
|
|
|
2015
2024
|
${this.header()}
|
|
2016
2025
|
${this.scopesGroup()}
|
|
2017
2026
|
${e === "error" ? this.errorState() : e === "loading" ? this.loadingState() : e === "results" ? this.searchResults() : this.renderMenu(this.menu)}
|
|
2018
|
-
${e === "menu" ? n
|
|
2027
|
+
${e === "menu" ? n`
|
|
2028
|
+
<slot name="nav-footer"></slot>` : n``}
|
|
2019
2029
|
${this.auth ? this.footer(this.auth) : ""}
|
|
2020
2030
|
</div>
|
|
2021
2031
|
`;
|
|
2022
2032
|
}
|
|
2023
2033
|
searchResults() {
|
|
2024
|
-
return n
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2034
|
+
return n`
|
|
2035
|
+
<vsn-search-results
|
|
2036
|
+
class="flex-1 min-h-0"
|
|
2037
|
+
.results=${this._searchResults}
|
|
2038
|
+
.errorMessage=${this._searchError}
|
|
2039
|
+
.nextCursor=${this._searchNextCursor}
|
|
2040
|
+
.loadingMore=${this._searchLoadingMore}>
|
|
2041
|
+
</vsn-search-results>`;
|
|
2031
2042
|
}
|
|
2032
2043
|
loadingState() {
|
|
2033
|
-
return n
|
|
2044
|
+
return n`
|
|
2045
|
+
<vsn-template class="flex-1 min-h-0"></vsn-template>`;
|
|
2034
2046
|
}
|
|
2035
2047
|
errorState() {
|
|
2036
|
-
return n
|
|
2048
|
+
return n`
|
|
2049
|
+
<vsn-error-state class="flex-1 min-h-0"></vsn-error-state>`;
|
|
2037
2050
|
}
|
|
2038
2051
|
header() {
|
|
2039
2052
|
let e = this.menu?.items.length ? this.menu.search : void 0;
|
|
2040
2053
|
return n`
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2054
|
+
<vsn-header
|
|
2055
|
+
.modules=${this.modules}
|
|
2056
|
+
.activeModuleId=${this.activeModuleId}
|
|
2057
|
+
.activeModuleLabel=${this.activeModuleLabel}
|
|
2058
|
+
.modulesLoading=${this.modulesLoading}
|
|
2059
|
+
.hasMenu=${(this.menu?.items.length ?? 0) > 0}
|
|
2060
|
+
.search=${e}
|
|
2061
|
+
.searchValue=${this._searchQuery}
|
|
2062
|
+
.searchLoading=${this._searchLoading}
|
|
2063
|
+
@vsn-search-input=${this._onSearchInput}
|
|
2064
|
+
@vsn-search-submit=${this._onSearchSubmit}
|
|
2065
|
+
@vsn-search-cleared=${this._onSearchCleared}
|
|
2066
|
+
>
|
|
2067
|
+
</vsn-header>`;
|
|
2055
2068
|
}
|
|
2056
2069
|
scopesGroup() {
|
|
2057
2070
|
if (!this.menu?.search?.enabled) return n``;
|
|
@@ -2071,27 +2084,28 @@ var Et = "en", Dt = [
|
|
|
2071
2084
|
`;
|
|
2072
2085
|
}
|
|
2073
2086
|
renderMenu(e) {
|
|
2074
|
-
return n
|
|
2087
|
+
return n`
|
|
2088
|
+
<vsn-menu class="flex-1 min-h-0" .items=${e?.items ?? []} .currentItem=${e?.currentItem ?? ""}></vsn-menu>`;
|
|
2075
2089
|
}
|
|
2076
2090
|
footer(e) {
|
|
2077
2091
|
return n`
|
|
2078
2092
|
<vsn-footer
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2093
|
+
.user=${e.user}
|
|
2094
|
+
.profilePictureBaseUrl=${e.profilePictureBaseUrl}
|
|
2095
|
+
.myProfileUrl=${e.myProfileUrl}>
|
|
2082
2096
|
</vsn-footer>
|
|
2083
2097
|
`;
|
|
2084
2098
|
}
|
|
2085
2099
|
};
|
|
2086
|
-
|
|
2100
|
+
F([s({ attribute: !1 })], K.prototype, "modules", void 0), F([s()], K.prototype, "activeModuleId", void 0), F([s()], K.prototype, "activeModuleLabel", void 0), F([s({ type: Boolean })], K.prototype, "modulesLoading", void 0), F([s()], K.prototype, "lang", void 0), F([s({ attribute: !1 })], K.prototype, "auth", void 0), F([s({ type: Boolean })], K.prototype, "error", void 0), F([s({
|
|
2087
2101
|
type: Boolean,
|
|
2088
2102
|
reflect: !0
|
|
2089
|
-
})],
|
|
2103
|
+
})], K.prototype, "open", void 0), F([s({ attribute: !1 })], K.prototype, "menu", void 0), F([l()], K.prototype, "_searchQuery", void 0), F([l()], K.prototype, "_searchResults", void 0), F([l()], K.prototype, "_searchLoading", void 0), F([l()], K.prototype, "_activeScopeId", void 0), F([l()], K.prototype, "_searchError", void 0), F([l()], K.prototype, "_searchNextCursor", void 0), F([l()], K.prototype, "_searchLoadingMore", void 0), K = F([o("vsn-side-bar")], K);
|
|
2090
2104
|
//#endregion
|
|
2091
2105
|
//#region src/components/vsn-top-bar/vsn-breadcrumb-menu-item.ts
|
|
2092
|
-
var
|
|
2106
|
+
var q, J = class extends e {
|
|
2093
2107
|
static {
|
|
2094
|
-
|
|
2108
|
+
q = this;
|
|
2095
2109
|
}
|
|
2096
2110
|
static {
|
|
2097
2111
|
this.styles = h;
|
|
@@ -2118,7 +2132,7 @@ var K, q = class extends e {
|
|
|
2118
2132
|
e.preventDefault(), e.stopPropagation(), this._isExpanded = !this._isExpanded;
|
|
2119
2133
|
return;
|
|
2120
2134
|
}
|
|
2121
|
-
if (!this.tree || e.button !== 0 || e
|
|
2135
|
+
if (!this.tree || e.button !== 0 || j(e)) return;
|
|
2122
2136
|
e.preventDefault(), e.stopPropagation();
|
|
2123
2137
|
let t = [...this.ancestorPath, this.tree];
|
|
2124
2138
|
this.dispatchEvent(new CustomEvent("vsn-breadcrumb-menu-leaf-select", {
|
|
@@ -2126,7 +2140,7 @@ var K, q = class extends e {
|
|
|
2126
2140
|
bubbles: !0,
|
|
2127
2141
|
composed: !0
|
|
2128
2142
|
}));
|
|
2129
|
-
}, this._tooltipId = `vsn-menu-item-tooltip-${
|
|
2143
|
+
}, this._tooltipId = `vsn-menu-item-tooltip-${q._idCounter++}`;
|
|
2130
2144
|
}
|
|
2131
2145
|
createRenderRoot() {
|
|
2132
2146
|
return this;
|
|
@@ -2152,7 +2166,7 @@ var K, q = class extends e {
|
|
|
2152
2166
|
<div class="ga-tooltip ga-tooltip--right-start" style="white-space: nowrap">${e}</div>
|
|
2153
2167
|
</div>
|
|
2154
2168
|
<span class="ga-side-navigation__item-icon">
|
|
2155
|
-
${this._isParent() ? this._isExpanded ?
|
|
2169
|
+
${this._isParent() ? this._isExpanded ? N(P, 16) : N(ot, 16) : ""}
|
|
2156
2170
|
</span>
|
|
2157
2171
|
<div class="ga-side-navigation__item-content">
|
|
2158
2172
|
<div class="ga-side-navigation__item-label">${e}</div>
|
|
@@ -2176,10 +2190,10 @@ var K, q = class extends e {
|
|
|
2176
2190
|
if (this.tree && _(this.tree)) return this.tree.items.length > 0;
|
|
2177
2191
|
}
|
|
2178
2192
|
};
|
|
2179
|
-
|
|
2193
|
+
F([s({ attribute: !1 })], J.prototype, "tree", void 0), F([s({ type: Number })], J.prototype, "level", void 0), F([s({ type: Array })], J.prototype, "ancestorPath", void 0), F([l()], J.prototype, "_isExpanded", void 0), F([l()], J.prototype, "_showTooltip", void 0), F([l()], J.prototype, "_tooltipPos", void 0), F([c(".ga-side-navigation__item-label")], J.prototype, "_labelEl", void 0), J = q = F([o("vsn-breadcrumb-menu-item")], J);
|
|
2180
2194
|
//#endregion
|
|
2181
2195
|
//#region src/components/vsn-top-bar/vsn-breadcrumb-menu.ts
|
|
2182
|
-
var
|
|
2196
|
+
var qt = class extends e {
|
|
2183
2197
|
static {
|
|
2184
2198
|
this.styles = h;
|
|
2185
2199
|
}
|
|
@@ -2199,7 +2213,7 @@ var J = class extends e {
|
|
|
2199
2213
|
`;
|
|
2200
2214
|
}
|
|
2201
2215
|
};
|
|
2202
|
-
|
|
2216
|
+
F([s({ attribute: !1 })], qt.prototype, "treeList", void 0), qt = F([o("vsn-breadcrumb-menu")], qt);
|
|
2203
2217
|
//#endregion
|
|
2204
2218
|
//#region src/components/vsn-top-bar/vsn-breadcrumbs.ts
|
|
2205
2219
|
var Y = class extends e {
|
|
@@ -2522,10 +2536,10 @@ var Y = class extends e {
|
|
|
2522
2536
|
`;
|
|
2523
2537
|
}
|
|
2524
2538
|
};
|
|
2525
|
-
|
|
2539
|
+
F([s({ attribute: !1 })], Y.prototype, "tree", void 0), F([s({ type: Array })], Y.prototype, "modules", void 0), F([s()], Y.prototype, "activeModuleId", void 0), F([l()], Y.prototype, "_openPopoverId", void 0), F([l()], Y.prototype, "_displayMode", void 0), F([l()], Y.prototype, "_overflowCount", void 0), F([l()], Y.prototype, "_tooltip", void 0), Y = F([S(), o("vsn-breadcrumbs")], Y);
|
|
2526
2540
|
//#endregion
|
|
2527
2541
|
//#region src/components/vsn-top-bar/vsn-ai-assistant.ts
|
|
2528
|
-
var
|
|
2542
|
+
var Jt = class extends e {
|
|
2529
2543
|
static {
|
|
2530
2544
|
this.styles = h;
|
|
2531
2545
|
}
|
|
@@ -2542,12 +2556,12 @@ var Kt = class extends e {
|
|
|
2542
2556
|
render() {
|
|
2543
2557
|
return n`
|
|
2544
2558
|
<button type="button" class="ga-button ga-button--secondary ga-button--icon-only" aria-label=${x("Open AI assistant")} @click=${this._handleClick}>
|
|
2545
|
-
<span class="ga-icon">${
|
|
2559
|
+
<span class="ga-icon">${N(Ke)}</span>
|
|
2546
2560
|
</button>
|
|
2547
2561
|
`;
|
|
2548
2562
|
}
|
|
2549
2563
|
};
|
|
2550
|
-
|
|
2564
|
+
Jt = F([S(), o("vsn-ai-assistant")], Jt);
|
|
2551
2565
|
//#endregion
|
|
2552
2566
|
//#region src/components/vsn-top-bar/vsn-feedback.ts
|
|
2553
2567
|
var X = class extends e {
|
|
@@ -2593,7 +2607,7 @@ var X = class extends e {
|
|
|
2593
2607
|
render() {
|
|
2594
2608
|
return this._compact ? n`
|
|
2595
2609
|
<button type="button" class="ga-button ga-button--secondary ga-button--icon-only" aria-label=${x("Send feedback")} @click=${this._handleClick}>
|
|
2596
|
-
<span class="ga-icon">${
|
|
2610
|
+
<span class="ga-icon">${N(Ye)}</span>
|
|
2597
2611
|
</button>
|
|
2598
2612
|
` : n`
|
|
2599
2613
|
<button type="button" class="ga-button ga-button--secondary" aria-label=${x("Send feedback")} @click=${this._handleClick}>
|
|
@@ -2602,10 +2616,10 @@ var X = class extends e {
|
|
|
2602
2616
|
`;
|
|
2603
2617
|
}
|
|
2604
2618
|
};
|
|
2605
|
-
|
|
2619
|
+
F([l()], X.prototype, "_compact", void 0), F([s({ attribute: !1 })], X.prototype, "feedback", void 0), F([s({ attribute: !1 })], X.prototype, "auth", void 0), X = F([S(), o("vsn-feedback")], X);
|
|
2606
2620
|
//#endregion
|
|
2607
2621
|
//#region src/components/vsn-top-bar/vsn-home.ts
|
|
2608
|
-
var
|
|
2622
|
+
var Yt = class extends e {
|
|
2609
2623
|
static {
|
|
2610
2624
|
this.styles = h;
|
|
2611
2625
|
}
|
|
@@ -2626,15 +2640,15 @@ var Z = class extends e {
|
|
|
2626
2640
|
render() {
|
|
2627
2641
|
return this.landingPageUrl ? n`
|
|
2628
2642
|
<a href=${this.landingPageUrl} class="ga-button ga-button--ghost ga-button--icon-only" aria-label=${x("Home")} @click=${this._handleClick}>
|
|
2629
|
-
<span class="ga-icon">${
|
|
2643
|
+
<span class="ga-icon">${N(Xe)}</span>
|
|
2630
2644
|
</a>
|
|
2631
2645
|
` : r;
|
|
2632
2646
|
}
|
|
2633
2647
|
};
|
|
2634
|
-
|
|
2648
|
+
F([s({ attribute: "landing-page-url" })], Yt.prototype, "landingPageUrl", void 0), Yt = F([S(), o("vsn-home")], Yt);
|
|
2635
2649
|
//#endregion
|
|
2636
2650
|
//#region src/components/vsn-top-bar/vsn-menu-toggle.ts
|
|
2637
|
-
var
|
|
2651
|
+
var Xt = class extends e {
|
|
2638
2652
|
constructor(...e) {
|
|
2639
2653
|
super(...e), this._tooltip = null, this._onMouseEnter = (e) => {
|
|
2640
2654
|
let t = e.currentTarget.getBoundingClientRect();
|
|
@@ -2664,7 +2678,7 @@ var qt = class extends e {
|
|
|
2664
2678
|
render() {
|
|
2665
2679
|
return n`
|
|
2666
2680
|
<button type="button" class="ga-button ga-button--secondary ga-button--icon-only" aria-label=${x("Open menu")} aria-describedby=${this._tooltip ? "vsn-menu-toggle-tooltip" : r} @click=${this._handleClick} @mouseenter=${this._onMouseEnter} @mouseleave=${this._onMouseLeave}>
|
|
2667
|
-
<span class="ga-icon">${
|
|
2681
|
+
<span class="ga-icon">${N(Ge)}</span>
|
|
2668
2682
|
</button>
|
|
2669
2683
|
${this._tooltip ? n`
|
|
2670
2684
|
<div id="vsn-menu-toggle-tooltip" role="tooltip" style="position: fixed; left: ${this._tooltip.x}px; top: ${this._tooltip.y}px; pointer-events: none; z-index: 9999;">
|
|
@@ -2674,10 +2688,10 @@ var qt = class extends e {
|
|
|
2674
2688
|
`;
|
|
2675
2689
|
}
|
|
2676
2690
|
};
|
|
2677
|
-
|
|
2691
|
+
F([l()], Xt.prototype, "_tooltip", void 0), Xt = F([S(), o("vsn-menu-toggle")], Xt);
|
|
2678
2692
|
//#endregion
|
|
2679
2693
|
//#region src/components/vsn-top-bar/vsn-notifications.ts
|
|
2680
|
-
var
|
|
2694
|
+
var Z = class extends e {
|
|
2681
2695
|
constructor(...e) {
|
|
2682
2696
|
super(...e), this.notificationActive = !1;
|
|
2683
2697
|
}
|
|
@@ -2698,19 +2712,19 @@ var Jt = class extends e {
|
|
|
2698
2712
|
let e = this.notificationActive ? Je : qe;
|
|
2699
2713
|
return n`
|
|
2700
2714
|
<button type="button" class="ga-button ga-button--secondary ga-button--icon-only" aria-label=${x("Notifications")} @click=${this._handleClick}>
|
|
2701
|
-
<span class="ga-icon">${
|
|
2715
|
+
<span class="ga-icon">${N(e)}</span>
|
|
2702
2716
|
</button>
|
|
2703
2717
|
`;
|
|
2704
2718
|
}
|
|
2705
2719
|
};
|
|
2706
|
-
|
|
2720
|
+
F([s({
|
|
2707
2721
|
type: Boolean,
|
|
2708
2722
|
attribute: "notification-active",
|
|
2709
2723
|
reflect: !0
|
|
2710
|
-
})],
|
|
2724
|
+
})], Z.prototype, "notificationActive", void 0), Z = F([S(), o("vsn-notifications")], Z);
|
|
2711
2725
|
//#endregion
|
|
2712
2726
|
//#region src/components/vsn-top-bar/vsn-help.ts
|
|
2713
|
-
function
|
|
2727
|
+
function Zt(e) {
|
|
2714
2728
|
try {
|
|
2715
2729
|
let t = new URL(e);
|
|
2716
2730
|
return t.protocol === "https:" || t.protocol === "http:";
|
|
@@ -2718,7 +2732,7 @@ function Yt(e) {
|
|
|
2718
2732
|
return !1;
|
|
2719
2733
|
}
|
|
2720
2734
|
}
|
|
2721
|
-
var
|
|
2735
|
+
var Qt = class extends e {
|
|
2722
2736
|
static {
|
|
2723
2737
|
this.styles = h;
|
|
2724
2738
|
}
|
|
@@ -2733,18 +2747,18 @@ var Xt = class extends e {
|
|
|
2733
2747
|
}));
|
|
2734
2748
|
}
|
|
2735
2749
|
render() {
|
|
2736
|
-
return this.helpUrl &&
|
|
2750
|
+
return this.helpUrl && Zt(this.helpUrl) ? n`
|
|
2737
2751
|
<a href=${this.helpUrl} rel="noopener noreferrer" class="ga-button ga-button--secondary ga-button--icon-only" aria-label=${x("Help")}>
|
|
2738
|
-
<span class="ga-icon">${
|
|
2752
|
+
<span class="ga-icon">${N(Ze)}</span>
|
|
2739
2753
|
</a>
|
|
2740
2754
|
` : n`
|
|
2741
2755
|
<button type="button" class="ga-button ga-button--secondary ga-button--icon-only" aria-label=${x("Help")} @click=${this._handleClick}>
|
|
2742
|
-
<span class="ga-icon">${
|
|
2756
|
+
<span class="ga-icon">${N(Ze)}</span>
|
|
2743
2757
|
</button>
|
|
2744
2758
|
`;
|
|
2745
2759
|
}
|
|
2746
2760
|
};
|
|
2747
|
-
|
|
2761
|
+
F([s({ attribute: "help-url" })], Qt.prototype, "helpUrl", void 0), Qt = F([S(), o("vsn-help")], Qt);
|
|
2748
2762
|
//#endregion
|
|
2749
2763
|
//#region src/components/vsn-top-bar/vsn-top-bar.ts
|
|
2750
2764
|
var Q = class extends e {
|
|
@@ -2752,7 +2766,7 @@ var Q = class extends e {
|
|
|
2752
2766
|
super(...e), this.modules = [], this.feedback = null, this.showHelp = !1, this.showNotification = !1, this.notificationActive = !1, this.lang = "en";
|
|
2753
2767
|
}
|
|
2754
2768
|
willUpdate(e) {
|
|
2755
|
-
e.has("lang") &&
|
|
2769
|
+
e.has("lang") && Vt(this.lang).catch(console.error);
|
|
2756
2770
|
}
|
|
2757
2771
|
focusMenuToggle() {
|
|
2758
2772
|
this.renderRoot.querySelector("vsn-menu-toggle")?.focus();
|
|
@@ -2854,26 +2868,28 @@ var Q = class extends e {
|
|
|
2854
2868
|
`;
|
|
2855
2869
|
}
|
|
2856
2870
|
};
|
|
2857
|
-
|
|
2871
|
+
F([s({ attribute: !1 })], Q.prototype, "tree", void 0), F([s({ type: Array })], Q.prototype, "modules", void 0), F([s()], Q.prototype, "activeModuleId", void 0), F([s({ attribute: "landing-page-url" })], Q.prototype, "landingPageUrl", void 0), F([s({ attribute: !1 })], Q.prototype, "feedback", void 0), F([s({ attribute: !1 })], Q.prototype, "auth", void 0), F([s({
|
|
2858
2872
|
type: Boolean,
|
|
2859
2873
|
attribute: "show-help"
|
|
2860
|
-
})], Q.prototype, "showHelp", void 0),
|
|
2874
|
+
})], Q.prototype, "showHelp", void 0), F([s({ attribute: "help-url" })], Q.prototype, "helpUrl", void 0), F([s({
|
|
2861
2875
|
type: Boolean,
|
|
2862
2876
|
attribute: "show-notification"
|
|
2863
|
-
})], Q.prototype, "showNotification", void 0),
|
|
2877
|
+
})], Q.prototype, "showNotification", void 0), F([s({
|
|
2864
2878
|
type: Boolean,
|
|
2865
2879
|
attribute: "notification-active"
|
|
2866
|
-
})], Q.prototype, "notificationActive", void 0),
|
|
2880
|
+
})], Q.prototype, "notificationActive", void 0), F([s()], Q.prototype, "lang", void 0), Q = F([o("vsn-top-bar")], Q);
|
|
2867
2881
|
//#endregion
|
|
2868
2882
|
//#region src/components/vsn-navigation.ts
|
|
2869
2883
|
var $ = class extends e {
|
|
2870
2884
|
constructor(...e) {
|
|
2871
|
-
super(...e), this.lang = "en", this.showHelp = !1, this.feedback = null, this.showNotification = !1, this.notificationActive = !1, this.
|
|
2872
|
-
!Pe(e) || e.key.toLowerCase() !== "k" || (e.preventDefault(), this.
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2885
|
+
super(...e), this.lang = "en", this.showHelp = !1, this.feedback = null, this.showNotification = !1, this.notificationActive = !1, this.open = !1, this._currentItem = "", this._resolvedModules = [], this._modulesLoading = !1, this._modulesLoadToken = 0, this._restoreFocusToToggle = !1, this._onShortcut = (e) => {
|
|
2886
|
+
e.defaultPrevented || !Pe(e) || e.key.toLowerCase() !== "k" || (e.preventDefault(), this.dispatchEvent(new CustomEvent("vsn-open", {
|
|
2887
|
+
cancelable: !0,
|
|
2888
|
+
bubbles: !0,
|
|
2889
|
+
composed: !0
|
|
2890
|
+
})) && this._openAndFocusSearch());
|
|
2891
|
+
}, this._onEscape = (e) => {
|
|
2892
|
+
e.defaultPrevented || this.open && M(e) && e.key === "Escape" && (e.preventDefault(), this.open = !1);
|
|
2877
2893
|
};
|
|
2878
2894
|
}
|
|
2879
2895
|
_resolveModules() {
|
|
@@ -2940,29 +2956,32 @@ var $ = class extends e {
|
|
|
2940
2956
|
};
|
|
2941
2957
|
}
|
|
2942
2958
|
_onToggleSideBar() {
|
|
2943
|
-
this.
|
|
2959
|
+
this.open ? this._closeSideBar() : this._openAndFocusSearch();
|
|
2944
2960
|
}
|
|
2945
2961
|
_openAndFocusSearch() {
|
|
2946
|
-
this.
|
|
2947
|
-
}
|
|
2948
|
-
_onSideBarClose() {
|
|
2949
|
-
this._closeSideBar();
|
|
2962
|
+
this.open = !0, this.updateComplete.then(() => this.renderRoot.querySelector("vsn-side-bar")?.focusSearch());
|
|
2950
2963
|
}
|
|
2951
2964
|
_closeSideBar() {
|
|
2952
|
-
|
|
2953
|
-
|
|
2965
|
+
this.open = !1;
|
|
2966
|
+
}
|
|
2967
|
+
update(e) {
|
|
2968
|
+
if (e.has("open") && e.get("open") && !this.open) {
|
|
2969
|
+
let e = this.renderRoot.querySelector("vsn-side-bar");
|
|
2970
|
+
this._restoreFocusToToggle = e?.matches(":focus-within") ?? !1;
|
|
2971
|
+
}
|
|
2972
|
+
super.update(e);
|
|
2954
2973
|
}
|
|
2955
2974
|
updated(e) {
|
|
2956
|
-
e.has("
|
|
2975
|
+
e.has("open") && e.get("open") && !this.open && this._restoreFocusToToggle && this.renderRoot.querySelector("vsn-top-bar")?.focusMenuToggle();
|
|
2957
2976
|
}
|
|
2958
2977
|
connectedCallback() {
|
|
2959
|
-
super.connectedCallback(), document.addEventListener("keydown", this._onShortcut), document.addEventListener("keydown", this.
|
|
2978
|
+
super.connectedCallback(), document.addEventListener("keydown", this._onShortcut), document.addEventListener("keydown", this._onEscape);
|
|
2960
2979
|
}
|
|
2961
2980
|
disconnectedCallback() {
|
|
2962
|
-
document.removeEventListener("keydown", this._onShortcut), document.removeEventListener("keydown", this.
|
|
2981
|
+
document.removeEventListener("keydown", this._onShortcut), document.removeEventListener("keydown", this._onEscape), super.disconnectedCallback();
|
|
2963
2982
|
}
|
|
2964
2983
|
_onTopBarClick(e) {
|
|
2965
|
-
this.
|
|
2984
|
+
this.open && (e.composedPath().some((e) => e.tagName?.toUpperCase() === "VSN-MENU-TOGGLE") || (this.open = !1));
|
|
2966
2985
|
}
|
|
2967
2986
|
render() {
|
|
2968
2987
|
return n`
|
|
@@ -2980,7 +2999,7 @@ var $ = class extends e {
|
|
|
2980
2999
|
?notification-active=${this.notificationActive}
|
|
2981
3000
|
@toggle-side-bar=${this._onToggleSideBar}
|
|
2982
3001
|
@click=${this._onTopBarClick}
|
|
2983
|
-
@vsn-breadcrumb-dropdown-open=${this.
|
|
3002
|
+
@vsn-breadcrumb-dropdown-open=${this._closeSideBar}
|
|
2984
3003
|
>
|
|
2985
3004
|
<slot name="context-selector" slot="context-selector"></slot>
|
|
2986
3005
|
</vsn-top-bar>
|
|
@@ -2993,8 +3012,8 @@ var $ = class extends e {
|
|
|
2993
3012
|
.activeModuleLabel=${this.modules?.activeModuleLabel}
|
|
2994
3013
|
.modulesLoading=${this._modulesLoading}
|
|
2995
3014
|
.auth=${this.auth}
|
|
2996
|
-
?open=${this.
|
|
2997
|
-
@vsn-side-bar-close=${this.
|
|
3015
|
+
?open=${this.open}
|
|
3016
|
+
@vsn-side-bar-close=${this._closeSideBar}
|
|
2998
3017
|
>
|
|
2999
3018
|
<slot name="nav-footer" slot="nav-footer"></slot>
|
|
3000
3019
|
</vsn-side-bar>
|
|
@@ -3005,15 +3024,19 @@ var $ = class extends e {
|
|
|
3005
3024
|
`;
|
|
3006
3025
|
}
|
|
3007
3026
|
};
|
|
3008
|
-
|
|
3027
|
+
F([s()], $.prototype, "lang", void 0), F([s({ attribute: !1 })], $.prototype, "tree", void 0), F([s({ attribute: !1 })], $.prototype, "modules", void 0), F([s({ attribute: !1 })], $.prototype, "auth", void 0), F([s({ attribute: "landing-page-url" })], $.prototype, "landingPageUrl", void 0), F([s({
|
|
3009
3028
|
type: Boolean,
|
|
3010
3029
|
attribute: "show-help"
|
|
3011
|
-
})], $.prototype, "showHelp", void 0),
|
|
3030
|
+
})], $.prototype, "showHelp", void 0), F([s({ attribute: "help-url" })], $.prototype, "helpUrl", void 0), F([s({ attribute: !1 })], $.prototype, "feedback", void 0), F([s({
|
|
3012
3031
|
type: Boolean,
|
|
3013
3032
|
attribute: "show-notification"
|
|
3014
|
-
})], $.prototype, "showNotification", void 0),
|
|
3033
|
+
})], $.prototype, "showNotification", void 0), F([s({
|
|
3015
3034
|
type: Boolean,
|
|
3016
3035
|
attribute: "notification-active"
|
|
3017
|
-
})], $.prototype, "notificationActive", void 0),
|
|
3036
|
+
})], $.prototype, "notificationActive", void 0), F([s({
|
|
3037
|
+
type: Boolean,
|
|
3038
|
+
attribute: "open",
|
|
3039
|
+
reflect: !0
|
|
3040
|
+
})], $.prototype, "open", void 0), F([l()], $.prototype, "_currentItem", void 0), F([l()], $.prototype, "_resolvedModules", void 0), F([l()], $.prototype, "_modulesLoading", void 0), $ = F([o("vsn-navigation")], $);
|
|
3018
3041
|
//#endregion
|
|
3019
3042
|
export { v as SearchError, $ as VSNNavigation, g as isTreeLeaf, _ as isTreeParent };
|