@visma-swno/vsn-navigation 1.2.0-beta.3 → 1.2.0-beta.5
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,125 @@ 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
|
+
cursor: pointer;
|
|
583
|
+
outline-style: none;
|
|
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) > .row::after {
|
|
591
|
+
position: absolute;
|
|
592
|
+
inset: 3px;
|
|
593
|
+
border-radius: calc(var(--ga-radius) * var(--ga-base-scaling-factor, 1));
|
|
594
|
+
border-style: var(--tw-border-style);
|
|
595
|
+
border-width: 2px;
|
|
596
|
+
border-color: var(--ga-color-border-focus);
|
|
597
|
+
--tw-content: '';
|
|
598
|
+
content: var(--tw-content);
|
|
599
|
+
}
|
|
589
600
|
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
601
|
+
.row {
|
|
602
|
+
position: relative;
|
|
603
|
+
display: flex;
|
|
604
|
+
align-items: center;
|
|
605
|
+
/* spacing-04 padding-block + 20px label line-height = 44px row,
|
|
606
|
+
matching Gaia's .ga-side-navigation__item (py-3 / px-4 / gap-3). */
|
|
607
|
+
gap: calc(var(--ga-size-spacing-04) * var(--ga-base-scaling-factor, 1));
|
|
608
|
+
padding-block: calc(var(--ga-size-spacing-04) * var(--ga-base-scaling-factor, 1));
|
|
609
|
+
padding-inline: calc(var(--ga-size-spacing-05) * var(--ga-base-scaling-factor, 1));
|
|
610
|
+
}
|
|
599
611
|
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
612
|
+
.icon {
|
|
613
|
+
width: calc(1rem * var(--ga-base-scaling-factor, 1));
|
|
614
|
+
flex-shrink: 0;
|
|
615
|
+
color: var(--ga-color-icon-primary);
|
|
616
|
+
display: inline-flex;
|
|
617
|
+
align-items: center;
|
|
618
|
+
}
|
|
607
619
|
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
620
|
+
.label {
|
|
621
|
+
flex: 1;
|
|
622
|
+
display: inline-flex;
|
|
623
|
+
overflow: hidden;
|
|
624
|
+
white-space: nowrap;
|
|
625
|
+
text-overflow: ellipsis;
|
|
626
|
+
font-family: Inter, ui-sans-serif, system-ui, sans-serif;
|
|
627
|
+
font-feature-settings: 'liga' 1, 'calt' 1;
|
|
628
|
+
font-size: calc(var(--ga-text-md-font-size) * var(--ga-base-scaling-factor, 1));
|
|
629
|
+
line-height: calc(var(--ga-text-md-line-height) * var(--ga-base-scaling-factor, 1));
|
|
630
|
+
letter-spacing: calc(var(--ga-text-md-letter-spacing) * var(--ga-base-scaling-factor, 1));
|
|
631
|
+
color: var(--ga-color-text-action);
|
|
632
|
+
}
|
|
621
633
|
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
634
|
+
slot[name="kbd"]::slotted(kbd) {
|
|
635
|
+
display: inline-flex;
|
|
636
|
+
align-items: center;
|
|
637
|
+
justify-content: center;
|
|
638
|
+
gap: calc(0.125rem * var(--ga-base-scaling-factor, 1));
|
|
639
|
+
flex-shrink: 0;
|
|
640
|
+
cursor: default;
|
|
641
|
+
border: calc(1px * var(--ga-base-scaling-factor, 1)) solid var(--ga-color-border-disabled);
|
|
642
|
+
border-radius: calc(var(--ga-radius) * var(--ga-base-scaling-factor, 1));
|
|
643
|
+
background-color: var(--ga-color-white);
|
|
644
|
+
/* !important: the <kbd> is host-provided slotted content, so a
|
|
645
|
+
consuming app's * { padding: 0 } reset overrides ::slotted normal
|
|
646
|
+
rules. We can't move it to an inner shadow element (it's the
|
|
647
|
+
host's element), so important is the accepted defense here. */
|
|
648
|
+
padding-inline: calc(var(--ga-size-spacing-02) * var(--ga-base-scaling-factor, 1)) !important;
|
|
649
|
+
padding-block: calc(1px * var(--ga-base-scaling-factor, 1)) !important;
|
|
650
|
+
font-family: Inter, ui-sans-serif, system-ui, sans-serif;
|
|
651
|
+
font-size: calc(var(--ga-text-xs-font-size) * var(--ga-base-scaling-factor, 1));
|
|
652
|
+
line-height: calc(var(--ga-text-xs-line-height) * var(--ga-base-scaling-factor, 1));
|
|
653
|
+
letter-spacing: calc(var(--ga-text-xs-letter-spacing) * var(--ga-base-scaling-factor, 1));
|
|
654
|
+
color: var(--ga-color-text-body);
|
|
655
|
+
}
|
|
656
|
+
`];
|
|
645
657
|
}
|
|
646
658
|
connectedCallback() {
|
|
647
|
-
super.connectedCallback(), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this.addEventListener("keydown", this._onKeydown);
|
|
659
|
+
super.connectedCallback(), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this.addEventListener("keydown", this._onKeydown), this.addEventListener("click", this._onClick);
|
|
648
660
|
}
|
|
649
661
|
disconnectedCallback() {
|
|
650
|
-
this.removeEventListener("keydown", this._onKeydown), super.disconnectedCallback();
|
|
662
|
+
this.removeEventListener("keydown", this._onKeydown), this.removeEventListener("click", this._onClick), super.disconnectedCallback();
|
|
651
663
|
}
|
|
652
664
|
render() {
|
|
653
665
|
return n`
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
666
|
+
<div class="row">
|
|
667
|
+
<span class="icon"><slot name="icon"></slot></span>
|
|
668
|
+
<span class="label">${this.label}</span>
|
|
669
|
+
<slot name="kbd"></slot>
|
|
670
|
+
</div>
|
|
671
|
+
`;
|
|
660
672
|
}
|
|
661
673
|
};
|
|
662
|
-
|
|
674
|
+
F([s()], z.prototype, "label", void 0), F([s({
|
|
675
|
+
type: Boolean,
|
|
676
|
+
attribute: "close-on-click"
|
|
677
|
+
})], z.prototype, "closeOnClick", void 0), z = F([o("vsn-menu-button")], z);
|
|
663
678
|
//#endregion
|
|
664
679
|
//#region src/components/vsn-side-bar/vsn-menu/vsn-menu-separator.ts
|
|
665
680
|
var st = class extends e {
|
|
@@ -685,29 +700,30 @@ var st = class extends e {
|
|
|
685
700
|
return n`<div class="line"></div>`;
|
|
686
701
|
}
|
|
687
702
|
};
|
|
688
|
-
st =
|
|
703
|
+
st = F([o("vsn-menu-separator")], st);
|
|
689
704
|
//#endregion
|
|
690
705
|
//#region src/components/vsn-side-bar/vsn-footer/vsn-footer.keyboard.ts
|
|
691
706
|
var ct = class {
|
|
692
707
|
constructor(e) {
|
|
693
708
|
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);
|
|
709
|
+
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
710
|
}, this.onDropdownKeydown = (e) => {
|
|
696
|
-
if (e.
|
|
711
|
+
if (e.defaultPrevented) return;
|
|
712
|
+
if (M(e) && e.key === "Escape") {
|
|
697
713
|
e.preventDefault(), this._closeAndRefocus();
|
|
698
714
|
return;
|
|
699
715
|
}
|
|
700
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
716
|
+
if (M(e) && (e.key === "Enter" || e.key === " ")) {
|
|
701
717
|
let t = e.target;
|
|
702
718
|
t instanceof HTMLElement && t.classList.contains("ga-side-navigation__footer-dropdown-item") && (e.preventDefault(), t.click());
|
|
703
719
|
return;
|
|
704
720
|
}
|
|
705
|
-
if (e.key === "Tab"
|
|
721
|
+
if (M(e) && e.key === "Tab") {
|
|
706
722
|
let t = Array.from(this.host.querySelectorAll(".ga-side-navigation__footer-dropdown-item")), n = t[t.length - 1];
|
|
707
723
|
n && e.target === n && (this.host.expanded = !1);
|
|
708
724
|
return;
|
|
709
725
|
}
|
|
710
|
-
if (e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
|
|
726
|
+
if (j(e) || e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
|
|
711
727
|
e.preventDefault();
|
|
712
728
|
let t = this.host.querySelector(".ga-side-navigation__footer-dropdown");
|
|
713
729
|
if (!t) return;
|
|
@@ -797,7 +813,7 @@ var pt = {
|
|
|
797
813
|
}, mt = () => ({
|
|
798
814
|
profile: x("My profile"),
|
|
799
815
|
logout: x("Log out")
|
|
800
|
-
}),
|
|
816
|
+
}), B = class extends e {
|
|
801
817
|
static {
|
|
802
818
|
this.styles = [h, ut];
|
|
803
819
|
}
|
|
@@ -853,7 +869,7 @@ var pt = {
|
|
|
853
869
|
</div>
|
|
854
870
|
|
|
855
871
|
<span class="ga-side-navigation__user-action">
|
|
856
|
-
${this.expanded ?
|
|
872
|
+
${this.expanded ? N(nt, 16) : N(tt, 16)}
|
|
857
873
|
</span>
|
|
858
874
|
|
|
859
875
|
</div>
|
|
@@ -867,14 +883,14 @@ var pt = {
|
|
|
867
883
|
${this._items.map((e) => {
|
|
868
884
|
let t = n`
|
|
869
885
|
<span class="ga-side-navigation__footer-dropdown-icon">
|
|
870
|
-
${
|
|
886
|
+
${N(pt[e.id], 16)}
|
|
871
887
|
</span>
|
|
872
888
|
<span class="ga-side-navigation__footer-dropdown-title">
|
|
873
889
|
${e.label}
|
|
874
890
|
</span>
|
|
875
891
|
${e.external ? n`
|
|
876
892
|
<span class="ga-side-navigation__footer-dropdown-trail">
|
|
877
|
-
${
|
|
893
|
+
${N(et, 16)}
|
|
878
894
|
</span>
|
|
879
895
|
` : r}
|
|
880
896
|
`;
|
|
@@ -922,52 +938,55 @@ var pt = {
|
|
|
922
938
|
@error=${() => {
|
|
923
939
|
this._avatarFailed = !0;
|
|
924
940
|
}} />` : n`<span class="ga-side-navigation__user-avatar vsn-side-navigation__user-avatar--icon">
|
|
925
|
-
${
|
|
941
|
+
${N(Qe, 24)}
|
|
926
942
|
</span>`;
|
|
927
943
|
}
|
|
928
944
|
};
|
|
929
|
-
|
|
945
|
+
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
946
|
type: Boolean,
|
|
931
947
|
reflect: !0
|
|
932
|
-
})],
|
|
948
|
+
})], B.prototype, "expanded", void 0), F([l()], B.prototype, "_avatarFailed", void 0), B = F([S(), o("vsn-footer")], B);
|
|
933
949
|
//#endregion
|
|
934
950
|
//#region src/components/vsn-side-bar/vsn-header/vsn-header.keyboard.ts
|
|
935
951
|
var ht = class {
|
|
936
952
|
constructor(e) {
|
|
937
953
|
this.onSwitcherKeydown = (e) => {
|
|
938
|
-
if (e.
|
|
939
|
-
if (e
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
if (!this.host.
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
if (
|
|
950
|
-
|
|
954
|
+
if (!e.defaultPrevented) {
|
|
955
|
+
if (M(e) && (e.key === "Enter" || e.key === " ")) {
|
|
956
|
+
if (e.preventDefault(), this.host.expanded && !this.host.canClose) return;
|
|
957
|
+
(this.host.expanded || this.host.hasAvailableItems || this.host.modulesLoading) && (this.host.expanded = !this.host.expanded);
|
|
958
|
+
return;
|
|
959
|
+
}
|
|
960
|
+
if (M(e) && e.key === "ArrowDown" && !this.host.expanded) {
|
|
961
|
+
if (!this.host.hasAvailableItems) return;
|
|
962
|
+
e.preventDefault(), this.host.expanded = !0;
|
|
963
|
+
return;
|
|
964
|
+
}
|
|
965
|
+
if (M(e) && e.key === "Escape" && this.host.expanded) {
|
|
966
|
+
if (!this.host.canClose) return;
|
|
967
|
+
e.preventDefault(), this.host.expanded = !1;
|
|
968
|
+
}
|
|
951
969
|
}
|
|
952
970
|
}, this.host = e, e.addController(this);
|
|
953
971
|
}
|
|
954
972
|
hostConnected() {}
|
|
955
|
-
}, gt = ".ga-side-navigation__switcher:focus{outline-offset:2px;outline:2px solid #3b82f6}",
|
|
973
|
+
}, gt = ".ga-side-navigation__switcher:focus{outline-offset:2px;outline:2px solid #3b82f6}", V = class extends e {
|
|
956
974
|
constructor(...e) {
|
|
957
975
|
super(...e), this.items = [], this.loading = !1, this._handleKeydown = (e) => {
|
|
958
|
-
if (e.
|
|
976
|
+
if (e.defaultPrevented) return;
|
|
977
|
+
if (M(e) && e.key === "Escape") {
|
|
959
978
|
e.preventDefault(), this.dispatchEvent(new CustomEvent("close-request", {
|
|
960
979
|
bubbles: !0,
|
|
961
980
|
composed: !0
|
|
962
981
|
}));
|
|
963
982
|
return;
|
|
964
983
|
}
|
|
965
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
984
|
+
if (M(e) && (e.key === "Enter" || e.key === " ")) {
|
|
966
985
|
let t = e.target;
|
|
967
986
|
t instanceof HTMLElement && t.classList.contains("ga-side-navigation__switcher-dropdown-item") && (e.preventDefault(), t.click());
|
|
968
987
|
return;
|
|
969
988
|
}
|
|
970
|
-
if (e.key === "Tab"
|
|
989
|
+
if (M(e) && e.key === "Tab") {
|
|
971
990
|
let t = Array.from(this.querySelectorAll(".ga-side-navigation__switcher-dropdown-item")), n = t[t.length - 1];
|
|
972
991
|
n && e.target === n && this.dispatchEvent(new CustomEvent("tab-exit", {
|
|
973
992
|
bubbles: !0,
|
|
@@ -975,7 +994,7 @@ var ht = class {
|
|
|
975
994
|
}));
|
|
976
995
|
return;
|
|
977
996
|
}
|
|
978
|
-
if (e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
|
|
997
|
+
if (j(e) || e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
|
|
979
998
|
e.preventDefault();
|
|
980
999
|
let t = Array.from(this.querySelectorAll(".ga-side-navigation__switcher-dropdown-item"));
|
|
981
1000
|
if (t.length === 0) return;
|
|
@@ -1033,7 +1052,7 @@ var ht = class {
|
|
|
1033
1052
|
`;
|
|
1034
1053
|
}
|
|
1035
1054
|
};
|
|
1036
|
-
|
|
1055
|
+
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
1056
|
//#endregion
|
|
1038
1057
|
//#region src/components/vsn-side-bar/vsn-search/vsn-search.css.ts
|
|
1039
1058
|
var _t = t`
|
|
@@ -1085,7 +1104,7 @@ var _t = t`
|
|
|
1085
1104
|
.ga-side-navigation__search input::placeholder {
|
|
1086
1105
|
color: var(--ga-color-text-disable-selected);
|
|
1087
1106
|
}
|
|
1088
|
-
`,
|
|
1107
|
+
`, H = class extends e {
|
|
1089
1108
|
constructor(...e) {
|
|
1090
1109
|
super(...e), this.shortcut = "", this.value = "", this.loading = !1, this._emitSearch = () => {
|
|
1091
1110
|
this._canSearch && this.dispatchEvent(new CustomEvent("vsn-search-submit", {
|
|
@@ -1093,14 +1112,13 @@ var _t = t`
|
|
|
1093
1112
|
bubbles: !0,
|
|
1094
1113
|
composed: !0
|
|
1095
1114
|
}));
|
|
1096
|
-
}, this.
|
|
1097
|
-
this.dispatchEvent(new CustomEvent("vsn-search-
|
|
1098
|
-
detail: { value: this.value },
|
|
1115
|
+
}, this._emitSearchCleared = () => {
|
|
1116
|
+
this.dispatchEvent(new CustomEvent("vsn-search-cleared", {
|
|
1099
1117
|
bubbles: !0,
|
|
1100
1118
|
composed: !0
|
|
1101
1119
|
}));
|
|
1102
1120
|
}, this._handleEscape = (e) => {
|
|
1103
|
-
e.key === "Escape" && this.
|
|
1121
|
+
e.defaultPrevented || M(e) && e.key === "Escape" && this.value.length > 0 && (e.preventDefault(), this._emitSearchCleared());
|
|
1104
1122
|
};
|
|
1105
1123
|
}
|
|
1106
1124
|
createRenderRoot() {
|
|
@@ -1125,7 +1143,7 @@ var _t = t`
|
|
|
1125
1143
|
}));
|
|
1126
1144
|
}
|
|
1127
1145
|
_handleEnter(e) {
|
|
1128
|
-
e.key === "Enter" && this._emitSearch();
|
|
1146
|
+
e.defaultPrevented || M(e) && e.key === "Enter" && this._emitSearch();
|
|
1129
1147
|
}
|
|
1130
1148
|
render() {
|
|
1131
1149
|
let e = this.value.length > 0 && this.value.length < 3;
|
|
@@ -1137,16 +1155,17 @@ var _t = t`
|
|
|
1137
1155
|
aria-label=${x("Search")}
|
|
1138
1156
|
?disabled=${!this._canSearch}
|
|
1139
1157
|
@click=${this._emitSearch}>
|
|
1140
|
-
${
|
|
1158
|
+
${N(rt, 24)}
|
|
1141
1159
|
</button>
|
|
1142
1160
|
<input type="search"
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1161
|
+
.placeholder=${Ie()}
|
|
1162
|
+
.value=${this.value}
|
|
1163
|
+
@input=${this._handleInput}
|
|
1164
|
+
@keydown=${this._handleEnter}/>
|
|
1147
1165
|
${this._trailingSlot()}
|
|
1148
1166
|
</div>
|
|
1149
|
-
${u(e, () => n
|
|
1167
|
+
${u(e, () => n`
|
|
1168
|
+
<div class="vsn-search__helper">${Re(3)}</div>`)}
|
|
1150
1169
|
`;
|
|
1151
1170
|
}
|
|
1152
1171
|
_trailingSlot() {
|
|
@@ -1163,8 +1182,8 @@ var _t = t`
|
|
|
1163
1182
|
_clearButton() {
|
|
1164
1183
|
return n`
|
|
1165
1184
|
<button class="vsn-search__clear" aria-label=${x("Clear search")}
|
|
1166
|
-
|
|
1167
|
-
${
|
|
1185
|
+
@click=${this._emitSearchCleared}>
|
|
1186
|
+
${N(it, 16)}
|
|
1168
1187
|
</button>
|
|
1169
1188
|
`;
|
|
1170
1189
|
}
|
|
@@ -1172,10 +1191,10 @@ var _t = t`
|
|
|
1172
1191
|
return n`<kbd class="ga-side-navigation__search-shortcut">${this.shortcut}</kbd>`;
|
|
1173
1192
|
}
|
|
1174
1193
|
};
|
|
1175
|
-
|
|
1194
|
+
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
1195
|
//#endregion
|
|
1177
1196
|
//#region src/components/vsn-side-bar/vsn-header/vsn-header.ts
|
|
1178
|
-
var
|
|
1197
|
+
var U = class extends e {
|
|
1179
1198
|
createRenderRoot() {
|
|
1180
1199
|
return this;
|
|
1181
1200
|
}
|
|
@@ -1203,7 +1222,7 @@ var V = class extends e {
|
|
|
1203
1222
|
<span class="ga-side-navigation__switcher-title">${e.title}</span>
|
|
1204
1223
|
${u(this.canClose, () => n`
|
|
1205
1224
|
<span class="ga-side-navigation__switcher-action">
|
|
1206
|
-
${this.expanded ?
|
|
1225
|
+
${this.expanded ? N(P, 16) : N(tt, 16)}
|
|
1207
1226
|
</span>
|
|
1208
1227
|
`)}
|
|
1209
1228
|
</div>
|
|
@@ -1221,7 +1240,7 @@ var V = class extends e {
|
|
|
1221
1240
|
|
|
1222
1241
|
${u(this.search?.enabled, () => n`
|
|
1223
1242
|
<vsn-search
|
|
1224
|
-
.shortcut=${
|
|
1243
|
+
.shortcut=${Le()}
|
|
1225
1244
|
.value=${this.searchValue}
|
|
1226
1245
|
.loading=${this.searchLoading}>
|
|
1227
1246
|
</vsn-search>`)}
|
|
@@ -1284,10 +1303,10 @@ var V = class extends e {
|
|
|
1284
1303
|
this.canClose && (this.expanded = !1);
|
|
1285
1304
|
}
|
|
1286
1305
|
};
|
|
1287
|
-
|
|
1306
|
+
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
1307
|
type: Boolean,
|
|
1289
1308
|
reflect: !0
|
|
1290
|
-
})],
|
|
1309
|
+
})], U.prototype, "expanded", void 0), U = F([S(), o("vsn-header")], U);
|
|
1291
1310
|
//#endregion
|
|
1292
1311
|
//#region src/components/vsn-side-bar/vsn-search-results/vsn-search-results.css.ts
|
|
1293
1312
|
var vt = t`
|
|
@@ -1362,7 +1381,7 @@ var vt = t`
|
|
|
1362
1381
|
`, yt = class {
|
|
1363
1382
|
constructor(e) {
|
|
1364
1383
|
this.onResultsKeydown = (e) => {
|
|
1365
|
-
if (e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
|
|
1384
|
+
if (e.defaultPrevented || j(e) || e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
|
|
1366
1385
|
e.preventDefault();
|
|
1367
1386
|
let t = Array.from(this.host.querySelectorAll(".ga-side-navigation__search-results-item"));
|
|
1368
1387
|
if (t.length === 0) return;
|
|
@@ -1373,7 +1392,7 @@ var vt = t`
|
|
|
1373
1392
|
}, this.host = e, e.addController(this);
|
|
1374
1393
|
}
|
|
1375
1394
|
hostConnected() {}
|
|
1376
|
-
},
|
|
1395
|
+
}, W = class extends e {
|
|
1377
1396
|
constructor(...e) {
|
|
1378
1397
|
super(...e), this.loadingMore = !1, this._keyboard = new yt(this);
|
|
1379
1398
|
}
|
|
@@ -1452,7 +1471,7 @@ var vt = t`
|
|
|
1452
1471
|
}));
|
|
1453
1472
|
}
|
|
1454
1473
|
};
|
|
1455
|
-
|
|
1474
|
+
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
1475
|
//#endregion
|
|
1457
1476
|
//#region src/components/vsn-side-bar/vsn-template/vsn-template.css.ts
|
|
1458
1477
|
var bt = t`
|
|
@@ -1498,7 +1517,7 @@ var bt = t`
|
|
|
1498
1517
|
`;
|
|
1499
1518
|
}
|
|
1500
1519
|
};
|
|
1501
|
-
St =
|
|
1520
|
+
St = F([S(), o("vsn-template")], St);
|
|
1502
1521
|
//#endregion
|
|
1503
1522
|
//#region src/components/vsn-side-bar/vsn-error-state/vsn-error-state.css.ts
|
|
1504
1523
|
var Ct = t`
|
|
@@ -1550,7 +1569,7 @@ var Ct = t`
|
|
|
1550
1569
|
render() {
|
|
1551
1570
|
return n`
|
|
1552
1571
|
<div class="vsn-error-state" role="alert" aria-live="assertive">
|
|
1553
|
-
<div class="vsn-error-state__icon">${
|
|
1572
|
+
<div class="vsn-error-state__icon">${N(at, 24)}</div>
|
|
1554
1573
|
<div class="vsn-error-state__title">${x("Loading error")}</div>
|
|
1555
1574
|
<div class="vsn-error-state__message">${x("We're unable to load the menu.")}</div>
|
|
1556
1575
|
<div class="vsn-error-state__hint">${x("Please check your internet connection and try again.")}</div>
|
|
@@ -1559,7 +1578,7 @@ var Ct = t`
|
|
|
1559
1578
|
`;
|
|
1560
1579
|
}
|
|
1561
1580
|
};
|
|
1562
|
-
wt =
|
|
1581
|
+
wt = F([S(), o("vsn-error-state")], wt);
|
|
1563
1582
|
//#endregion
|
|
1564
1583
|
//#region src/components/vsn-side-bar/vsn-search-scopes/vsn-search-scopes.css.ts
|
|
1565
1584
|
var Tt = t`
|
|
@@ -1583,12 +1602,12 @@ var Tt = t`
|
|
|
1583
1602
|
text-overflow: ellipsis;
|
|
1584
1603
|
}
|
|
1585
1604
|
}
|
|
1586
|
-
`,
|
|
1605
|
+
`, Et, G = class extends e {
|
|
1587
1606
|
static {
|
|
1588
|
-
|
|
1607
|
+
Et = this;
|
|
1589
1608
|
}
|
|
1590
1609
|
constructor(...e) {
|
|
1591
|
-
super(...e), this.scopes = [], this.selectedScopeId = "", this._name = `vsn-search-scope-${++
|
|
1610
|
+
super(...e), this.scopes = [], this.selectedScopeId = "", this._name = `vsn-search-scope-${++Et._counter}`;
|
|
1592
1611
|
}
|
|
1593
1612
|
createRenderRoot() {
|
|
1594
1613
|
return this;
|
|
@@ -1630,16 +1649,16 @@ var Tt = t`
|
|
|
1630
1649
|
}));
|
|
1631
1650
|
}
|
|
1632
1651
|
};
|
|
1633
|
-
|
|
1652
|
+
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
1653
|
//#endregion
|
|
1635
1654
|
//#region src/shared/lang/locale-codes.ts
|
|
1636
|
-
var
|
|
1655
|
+
var Dt = "en", Ot = [
|
|
1637
1656
|
"da",
|
|
1638
1657
|
"fi",
|
|
1639
1658
|
"nl",
|
|
1640
1659
|
"no",
|
|
1641
1660
|
"sv"
|
|
1642
|
-
],
|
|
1661
|
+
], kt = /* @__PURE__ */ p({ templates: () => At }), At = {
|
|
1643
1662
|
s09a45db408570a7a: "Min profil",
|
|
1644
1663
|
s119f9875b7d4cdfc: "Har du brug for hjælp? Kontakt support.",
|
|
1645
1664
|
s1228605ee65ddefa: b`${0} resultat`,
|
|
@@ -1669,7 +1688,7 @@ var Et = "en", Dt = [
|
|
|
1669
1688
|
sfbf31f663cef6cc2: "Prøv andre søgeord eller tjek stavningen.",
|
|
1670
1689
|
s7c510419ea376840: "VSN",
|
|
1671
1690
|
s38385cd359b17f7a: "Loading modules"
|
|
1672
|
-
},
|
|
1691
|
+
}, jt = /* @__PURE__ */ p({ templates: () => Mt }), Mt = {
|
|
1673
1692
|
s09a45db408570a7a: "Oma profiili",
|
|
1674
1693
|
s119f9875b7d4cdfc: "Tarvitsetko apua? Ota yhteyttä tukeen.",
|
|
1675
1694
|
s1228605ee65ddefa: b`${0} tulos`,
|
|
@@ -1699,7 +1718,7 @@ var Et = "en", Dt = [
|
|
|
1699
1718
|
sfbf31f663cef6cc2: "Kokeile eri hakusanoja tai tarkista kirjoitusasu.",
|
|
1700
1719
|
s7c510419ea376840: "VSN",
|
|
1701
1720
|
s38385cd359b17f7a: "Loading modules"
|
|
1702
|
-
},
|
|
1721
|
+
}, Nt = /* @__PURE__ */ p({ templates: () => Pt }), Pt = {
|
|
1703
1722
|
s09a45db408570a7a: "Mijn profiel",
|
|
1704
1723
|
s119f9875b7d4cdfc: "Hulp nodig? Neem contact op met ondersteuning.",
|
|
1705
1724
|
s1228605ee65ddefa: b`${0} resultaat`,
|
|
@@ -1729,7 +1748,7 @@ var Et = "en", Dt = [
|
|
|
1729
1748
|
sfbf31f663cef6cc2: "Probeer andere zoekwoorden of controleer de spelling.",
|
|
1730
1749
|
s7c510419ea376840: "VSN",
|
|
1731
1750
|
s38385cd359b17f7a: "Loading modules"
|
|
1732
|
-
},
|
|
1751
|
+
}, Ft = /* @__PURE__ */ p({ templates: () => It }), It = {
|
|
1733
1752
|
s09a45db408570a7a: "Min profil",
|
|
1734
1753
|
s119f9875b7d4cdfc: "Trenger du hjelp? Kontakt støtte.",
|
|
1735
1754
|
s1228605ee65ddefa: b`${0} resultat`,
|
|
@@ -1759,7 +1778,7 @@ var Et = "en", Dt = [
|
|
|
1759
1778
|
sfbf31f663cef6cc2: "Prøv andre søkeord eller sjekk stavemåten.",
|
|
1760
1779
|
s7c510419ea376840: "VSN",
|
|
1761
1780
|
s38385cd359b17f7a: "Loading modules"
|
|
1762
|
-
},
|
|
1781
|
+
}, Lt = /* @__PURE__ */ p({ templates: () => Rt }), Rt = {
|
|
1763
1782
|
s09a45db408570a7a: "Min profil",
|
|
1764
1783
|
s119f9875b7d4cdfc: "Behöver du hjälp? Kontakta support.",
|
|
1765
1784
|
s1228605ee65ddefa: b`${0} resultat`,
|
|
@@ -1789,17 +1808,17 @@ var Et = "en", Dt = [
|
|
|
1789
1808
|
sfbf31f663cef6cc2: "Prova andra sökord eller kontrollera stavningen.",
|
|
1790
1809
|
s7c510419ea376840: "VSN",
|
|
1791
1810
|
s38385cd359b17f7a: "Loading modules"
|
|
1792
|
-
},
|
|
1793
|
-
da:
|
|
1794
|
-
fi:
|
|
1795
|
-
nl:
|
|
1796
|
-
no:
|
|
1797
|
-
sv:
|
|
1798
|
-
}, { getLocale:
|
|
1799
|
-
sourceLocale:
|
|
1800
|
-
targetLocales:
|
|
1801
|
-
loadLocale: (e) =>
|
|
1802
|
-
}),
|
|
1811
|
+
}, zt = {
|
|
1812
|
+
da: kt,
|
|
1813
|
+
fi: jt,
|
|
1814
|
+
nl: Nt,
|
|
1815
|
+
no: Ft,
|
|
1816
|
+
sv: Lt
|
|
1817
|
+
}, { getLocale: Bt, setLocale: Vt } = Ae({
|
|
1818
|
+
sourceLocale: Dt,
|
|
1819
|
+
targetLocales: Ot,
|
|
1820
|
+
loadLocale: (e) => zt[e] ? Promise.resolve(zt[e]) : Promise.reject(/* @__PURE__ */ Error(`Unknown locale: ${e}`))
|
|
1821
|
+
}), Ht = t`
|
|
1803
1822
|
@layer components {
|
|
1804
1823
|
.vsn-switcher-anchor {
|
|
1805
1824
|
position: relative;
|
|
@@ -1813,7 +1832,7 @@ var Et = "en", Dt = [
|
|
|
1813
1832
|
z-index: 10;
|
|
1814
1833
|
}
|
|
1815
1834
|
}
|
|
1816
|
-
`,
|
|
1835
|
+
`, Ut = t`
|
|
1817
1836
|
.vsn-spinner {
|
|
1818
1837
|
display: inline-block;
|
|
1819
1838
|
flex-shrink: 0;
|
|
@@ -1833,7 +1852,7 @@ var Et = "en", Dt = [
|
|
|
1833
1852
|
@keyframes vsn-spin {
|
|
1834
1853
|
to { transform: rotate(360deg); }
|
|
1835
1854
|
}
|
|
1836
|
-
`,
|
|
1855
|
+
`, Wt = class {
|
|
1837
1856
|
constructor(e, t, n) {
|
|
1838
1857
|
this._onHostClick = (e) => {
|
|
1839
1858
|
let t = this._host.renderRoot.querySelector(this._clickedSelector);
|
|
@@ -1846,14 +1865,14 @@ var Et = "en", Dt = [
|
|
|
1846
1865
|
hostDisconnected() {
|
|
1847
1866
|
this._host.removeEventListener("click", this._onHostClick);
|
|
1848
1867
|
}
|
|
1849
|
-
},
|
|
1868
|
+
}, Gt = "button:not([disabled]), a[href], [tabindex]:not([tabindex=\"-1\"])", Kt = class {
|
|
1850
1869
|
constructor(e) {
|
|
1851
1870
|
this.onKeydown = (e) => {
|
|
1852
|
-
if (e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
|
|
1871
|
+
if (e.defaultPrevented || j(e) || e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
|
|
1853
1872
|
let t = this.host.renderRoot.querySelector("slot[name=\"nav-footer\"]");
|
|
1854
1873
|
if (!t) return;
|
|
1855
1874
|
let n = [];
|
|
1856
|
-
for (let e of t.assignedElements({ flatten: !0 })) e.matches(
|
|
1875
|
+
for (let e of t.assignedElements({ flatten: !0 })) e.matches(Gt) && n.push(e), n.push(...Array.from(e.querySelectorAll(Gt)));
|
|
1857
1876
|
if (n.length === 0) return;
|
|
1858
1877
|
let r = e.composedPath()[0];
|
|
1859
1878
|
if (!(r instanceof HTMLElement)) return;
|
|
@@ -1865,18 +1884,18 @@ var Et = "en", Dt = [
|
|
|
1865
1884
|
}, this.host = e, e.addController(this);
|
|
1866
1885
|
}
|
|
1867
1886
|
hostConnected() {}
|
|
1868
|
-
},
|
|
1887
|
+
}, K = class extends e {
|
|
1869
1888
|
static {
|
|
1870
1889
|
this.styles = [
|
|
1871
1890
|
h,
|
|
1872
|
-
|
|
1891
|
+
Ht,
|
|
1873
1892
|
ut,
|
|
1874
1893
|
_t,
|
|
1875
1894
|
vt,
|
|
1876
1895
|
Tt,
|
|
1877
1896
|
bt,
|
|
1878
1897
|
Ct,
|
|
1879
|
-
|
|
1898
|
+
Ut,
|
|
1880
1899
|
t`
|
|
1881
1900
|
:host {
|
|
1882
1901
|
position: absolute;
|
|
@@ -1891,7 +1910,7 @@ var Et = "en", Dt = [
|
|
|
1891
1910
|
];
|
|
1892
1911
|
}
|
|
1893
1912
|
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
|
|
1913
|
+
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
1914
|
this._searchQuery = "", this._searchResults = void 0, this.dispatchEvent(new CustomEvent("vsn-side-bar-close", {
|
|
1896
1915
|
bubbles: !0,
|
|
1897
1916
|
composed: !0
|
|
@@ -1908,13 +1927,13 @@ var Et = "en", Dt = [
|
|
|
1908
1927
|
}));
|
|
1909
1928
|
}, this._onScopeChanged = (e) => {
|
|
1910
1929
|
this._activeScopeId = e.detail.scopeId, this._runSearch(this._searchQuery, this._activeScopeId);
|
|
1911
|
-
}, new
|
|
1930
|
+
}, new Wt(this, ".ga-side-navigation", () => this.dispatchEvent(new CustomEvent("vsn-side-bar-close", {
|
|
1912
1931
|
bubbles: !0,
|
|
1913
1932
|
composed: !0
|
|
1914
1933
|
})));
|
|
1915
1934
|
}
|
|
1916
1935
|
willUpdate(e) {
|
|
1917
|
-
e.has("lang") &&
|
|
1936
|
+
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
1937
|
}
|
|
1919
1938
|
async focusSearch() {
|
|
1920
1939
|
await this.updateComplete, this.menu?.search?.enabled && this.renderRoot.querySelector("vsn-search")?.focus();
|
|
@@ -1925,11 +1944,8 @@ var Et = "en", Dt = [
|
|
|
1925
1944
|
_onSearchSubmit(e) {
|
|
1926
1945
|
this._runSearch(e.detail.query, this._activeScopeId);
|
|
1927
1946
|
}
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
bubbles: !0,
|
|
1931
|
-
composed: !0
|
|
1932
|
-
}));
|
|
1947
|
+
_onSearchCleared() {
|
|
1948
|
+
this._searchQuery = "", this._clearSearchState(), this.focusSearch();
|
|
1933
1949
|
}
|
|
1934
1950
|
_clearSearchState() {
|
|
1935
1951
|
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 +2031,47 @@ var Et = "en", Dt = [
|
|
|
2015
2031
|
${this.header()}
|
|
2016
2032
|
${this.scopesGroup()}
|
|
2017
2033
|
${e === "error" ? this.errorState() : e === "loading" ? this.loadingState() : e === "results" ? this.searchResults() : this.renderMenu(this.menu)}
|
|
2018
|
-
${e === "menu" ? n
|
|
2034
|
+
${e === "menu" ? n`
|
|
2035
|
+
<slot name="nav-footer"></slot>` : n``}
|
|
2019
2036
|
${this.auth ? this.footer(this.auth) : ""}
|
|
2020
2037
|
</div>
|
|
2021
2038
|
`;
|
|
2022
2039
|
}
|
|
2023
2040
|
searchResults() {
|
|
2024
|
-
return n
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2041
|
+
return n`
|
|
2042
|
+
<vsn-search-results
|
|
2043
|
+
class="flex-1 min-h-0"
|
|
2044
|
+
.results=${this._searchResults}
|
|
2045
|
+
.errorMessage=${this._searchError}
|
|
2046
|
+
.nextCursor=${this._searchNextCursor}
|
|
2047
|
+
.loadingMore=${this._searchLoadingMore}>
|
|
2048
|
+
</vsn-search-results>`;
|
|
2031
2049
|
}
|
|
2032
2050
|
loadingState() {
|
|
2033
|
-
return n
|
|
2051
|
+
return n`
|
|
2052
|
+
<vsn-template class="flex-1 min-h-0"></vsn-template>`;
|
|
2034
2053
|
}
|
|
2035
2054
|
errorState() {
|
|
2036
|
-
return n
|
|
2055
|
+
return n`
|
|
2056
|
+
<vsn-error-state class="flex-1 min-h-0"></vsn-error-state>`;
|
|
2037
2057
|
}
|
|
2038
2058
|
header() {
|
|
2039
2059
|
let e = this.menu?.items.length ? this.menu.search : void 0;
|
|
2040
2060
|
return n`
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2061
|
+
<vsn-header
|
|
2062
|
+
.modules=${this.modules}
|
|
2063
|
+
.activeModuleId=${this.activeModuleId}
|
|
2064
|
+
.activeModuleLabel=${this.activeModuleLabel}
|
|
2065
|
+
.modulesLoading=${this.modulesLoading}
|
|
2066
|
+
.hasMenu=${(this.menu?.items.length ?? 0) > 0}
|
|
2067
|
+
.search=${e}
|
|
2068
|
+
.searchValue=${this._searchQuery}
|
|
2069
|
+
.searchLoading=${this._searchLoading}
|
|
2070
|
+
@vsn-search-input=${this._onSearchInput}
|
|
2071
|
+
@vsn-search-submit=${this._onSearchSubmit}
|
|
2072
|
+
@vsn-search-cleared=${this._onSearchCleared}
|
|
2073
|
+
>
|
|
2074
|
+
</vsn-header>`;
|
|
2055
2075
|
}
|
|
2056
2076
|
scopesGroup() {
|
|
2057
2077
|
if (!this.menu?.search?.enabled) return n``;
|
|
@@ -2071,27 +2091,28 @@ var Et = "en", Dt = [
|
|
|
2071
2091
|
`;
|
|
2072
2092
|
}
|
|
2073
2093
|
renderMenu(e) {
|
|
2074
|
-
return n
|
|
2094
|
+
return n`
|
|
2095
|
+
<vsn-menu class="flex-1 min-h-0" .items=${e?.items ?? []} .currentItem=${e?.currentItem ?? ""}></vsn-menu>`;
|
|
2075
2096
|
}
|
|
2076
2097
|
footer(e) {
|
|
2077
2098
|
return n`
|
|
2078
2099
|
<vsn-footer
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2100
|
+
.user=${e.user}
|
|
2101
|
+
.profilePictureBaseUrl=${e.profilePictureBaseUrl}
|
|
2102
|
+
.myProfileUrl=${e.myProfileUrl}>
|
|
2082
2103
|
</vsn-footer>
|
|
2083
2104
|
`;
|
|
2084
2105
|
}
|
|
2085
2106
|
};
|
|
2086
|
-
|
|
2107
|
+
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
2108
|
type: Boolean,
|
|
2088
2109
|
reflect: !0
|
|
2089
|
-
})],
|
|
2110
|
+
})], 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
2111
|
//#endregion
|
|
2091
2112
|
//#region src/components/vsn-top-bar/vsn-breadcrumb-menu-item.ts
|
|
2092
|
-
var
|
|
2113
|
+
var q, J = class extends e {
|
|
2093
2114
|
static {
|
|
2094
|
-
|
|
2115
|
+
q = this;
|
|
2095
2116
|
}
|
|
2096
2117
|
static {
|
|
2097
2118
|
this.styles = h;
|
|
@@ -2118,7 +2139,7 @@ var K, q = class extends e {
|
|
|
2118
2139
|
e.preventDefault(), e.stopPropagation(), this._isExpanded = !this._isExpanded;
|
|
2119
2140
|
return;
|
|
2120
2141
|
}
|
|
2121
|
-
if (!this.tree || e.button !== 0 || e
|
|
2142
|
+
if (!this.tree || e.button !== 0 || j(e)) return;
|
|
2122
2143
|
e.preventDefault(), e.stopPropagation();
|
|
2123
2144
|
let t = [...this.ancestorPath, this.tree];
|
|
2124
2145
|
this.dispatchEvent(new CustomEvent("vsn-breadcrumb-menu-leaf-select", {
|
|
@@ -2126,7 +2147,7 @@ var K, q = class extends e {
|
|
|
2126
2147
|
bubbles: !0,
|
|
2127
2148
|
composed: !0
|
|
2128
2149
|
}));
|
|
2129
|
-
}, this._tooltipId = `vsn-menu-item-tooltip-${
|
|
2150
|
+
}, this._tooltipId = `vsn-menu-item-tooltip-${q._idCounter++}`;
|
|
2130
2151
|
}
|
|
2131
2152
|
createRenderRoot() {
|
|
2132
2153
|
return this;
|
|
@@ -2152,7 +2173,7 @@ var K, q = class extends e {
|
|
|
2152
2173
|
<div class="ga-tooltip ga-tooltip--right-start" style="white-space: nowrap">${e}</div>
|
|
2153
2174
|
</div>
|
|
2154
2175
|
<span class="ga-side-navigation__item-icon">
|
|
2155
|
-
${this._isParent() ? this._isExpanded ?
|
|
2176
|
+
${this._isParent() ? this._isExpanded ? N(P, 16) : N(ot, 16) : ""}
|
|
2156
2177
|
</span>
|
|
2157
2178
|
<div class="ga-side-navigation__item-content">
|
|
2158
2179
|
<div class="ga-side-navigation__item-label">${e}</div>
|
|
@@ -2176,10 +2197,10 @@ var K, q = class extends e {
|
|
|
2176
2197
|
if (this.tree && _(this.tree)) return this.tree.items.length > 0;
|
|
2177
2198
|
}
|
|
2178
2199
|
};
|
|
2179
|
-
|
|
2200
|
+
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
2201
|
//#endregion
|
|
2181
2202
|
//#region src/components/vsn-top-bar/vsn-breadcrumb-menu.ts
|
|
2182
|
-
var
|
|
2203
|
+
var qt = class extends e {
|
|
2183
2204
|
static {
|
|
2184
2205
|
this.styles = h;
|
|
2185
2206
|
}
|
|
@@ -2199,7 +2220,7 @@ var J = class extends e {
|
|
|
2199
2220
|
`;
|
|
2200
2221
|
}
|
|
2201
2222
|
};
|
|
2202
|
-
|
|
2223
|
+
F([s({ attribute: !1 })], qt.prototype, "treeList", void 0), qt = F([o("vsn-breadcrumb-menu")], qt);
|
|
2203
2224
|
//#endregion
|
|
2204
2225
|
//#region src/components/vsn-top-bar/vsn-breadcrumbs.ts
|
|
2205
2226
|
var Y = class extends e {
|
|
@@ -2522,10 +2543,10 @@ var Y = class extends e {
|
|
|
2522
2543
|
`;
|
|
2523
2544
|
}
|
|
2524
2545
|
};
|
|
2525
|
-
|
|
2546
|
+
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
2547
|
//#endregion
|
|
2527
2548
|
//#region src/components/vsn-top-bar/vsn-ai-assistant.ts
|
|
2528
|
-
var
|
|
2549
|
+
var Jt = class extends e {
|
|
2529
2550
|
static {
|
|
2530
2551
|
this.styles = h;
|
|
2531
2552
|
}
|
|
@@ -2542,12 +2563,12 @@ var Kt = class extends e {
|
|
|
2542
2563
|
render() {
|
|
2543
2564
|
return n`
|
|
2544
2565
|
<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">${
|
|
2566
|
+
<span class="ga-icon">${N(Ke)}</span>
|
|
2546
2567
|
</button>
|
|
2547
2568
|
`;
|
|
2548
2569
|
}
|
|
2549
2570
|
};
|
|
2550
|
-
|
|
2571
|
+
Jt = F([S(), o("vsn-ai-assistant")], Jt);
|
|
2551
2572
|
//#endregion
|
|
2552
2573
|
//#region src/components/vsn-top-bar/vsn-feedback.ts
|
|
2553
2574
|
var X = class extends e {
|
|
@@ -2593,7 +2614,7 @@ var X = class extends e {
|
|
|
2593
2614
|
render() {
|
|
2594
2615
|
return this._compact ? n`
|
|
2595
2616
|
<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">${
|
|
2617
|
+
<span class="ga-icon">${N(Ye)}</span>
|
|
2597
2618
|
</button>
|
|
2598
2619
|
` : n`
|
|
2599
2620
|
<button type="button" class="ga-button ga-button--secondary" aria-label=${x("Send feedback")} @click=${this._handleClick}>
|
|
@@ -2602,10 +2623,10 @@ var X = class extends e {
|
|
|
2602
2623
|
`;
|
|
2603
2624
|
}
|
|
2604
2625
|
};
|
|
2605
|
-
|
|
2626
|
+
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
2627
|
//#endregion
|
|
2607
2628
|
//#region src/components/vsn-top-bar/vsn-home.ts
|
|
2608
|
-
var
|
|
2629
|
+
var Yt = class extends e {
|
|
2609
2630
|
static {
|
|
2610
2631
|
this.styles = h;
|
|
2611
2632
|
}
|
|
@@ -2626,15 +2647,15 @@ var Z = class extends e {
|
|
|
2626
2647
|
render() {
|
|
2627
2648
|
return this.landingPageUrl ? n`
|
|
2628
2649
|
<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">${
|
|
2650
|
+
<span class="ga-icon">${N(Xe)}</span>
|
|
2630
2651
|
</a>
|
|
2631
2652
|
` : r;
|
|
2632
2653
|
}
|
|
2633
2654
|
};
|
|
2634
|
-
|
|
2655
|
+
F([s({ attribute: "landing-page-url" })], Yt.prototype, "landingPageUrl", void 0), Yt = F([S(), o("vsn-home")], Yt);
|
|
2635
2656
|
//#endregion
|
|
2636
2657
|
//#region src/components/vsn-top-bar/vsn-menu-toggle.ts
|
|
2637
|
-
var
|
|
2658
|
+
var Xt = class extends e {
|
|
2638
2659
|
constructor(...e) {
|
|
2639
2660
|
super(...e), this._tooltip = null, this._onMouseEnter = (e) => {
|
|
2640
2661
|
let t = e.currentTarget.getBoundingClientRect();
|
|
@@ -2664,7 +2685,7 @@ var qt = class extends e {
|
|
|
2664
2685
|
render() {
|
|
2665
2686
|
return n`
|
|
2666
2687
|
<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">${
|
|
2688
|
+
<span class="ga-icon">${N(Ge)}</span>
|
|
2668
2689
|
</button>
|
|
2669
2690
|
${this._tooltip ? n`
|
|
2670
2691
|
<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 +2695,10 @@ var qt = class extends e {
|
|
|
2674
2695
|
`;
|
|
2675
2696
|
}
|
|
2676
2697
|
};
|
|
2677
|
-
|
|
2698
|
+
F([l()], Xt.prototype, "_tooltip", void 0), Xt = F([S(), o("vsn-menu-toggle")], Xt);
|
|
2678
2699
|
//#endregion
|
|
2679
2700
|
//#region src/components/vsn-top-bar/vsn-notifications.ts
|
|
2680
|
-
var
|
|
2701
|
+
var Z = class extends e {
|
|
2681
2702
|
constructor(...e) {
|
|
2682
2703
|
super(...e), this.notificationActive = !1;
|
|
2683
2704
|
}
|
|
@@ -2698,19 +2719,19 @@ var Jt = class extends e {
|
|
|
2698
2719
|
let e = this.notificationActive ? Je : qe;
|
|
2699
2720
|
return n`
|
|
2700
2721
|
<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">${
|
|
2722
|
+
<span class="ga-icon">${N(e)}</span>
|
|
2702
2723
|
</button>
|
|
2703
2724
|
`;
|
|
2704
2725
|
}
|
|
2705
2726
|
};
|
|
2706
|
-
|
|
2727
|
+
F([s({
|
|
2707
2728
|
type: Boolean,
|
|
2708
2729
|
attribute: "notification-active",
|
|
2709
2730
|
reflect: !0
|
|
2710
|
-
})],
|
|
2731
|
+
})], Z.prototype, "notificationActive", void 0), Z = F([S(), o("vsn-notifications")], Z);
|
|
2711
2732
|
//#endregion
|
|
2712
2733
|
//#region src/components/vsn-top-bar/vsn-help.ts
|
|
2713
|
-
function
|
|
2734
|
+
function Zt(e) {
|
|
2714
2735
|
try {
|
|
2715
2736
|
let t = new URL(e);
|
|
2716
2737
|
return t.protocol === "https:" || t.protocol === "http:";
|
|
@@ -2718,7 +2739,7 @@ function Yt(e) {
|
|
|
2718
2739
|
return !1;
|
|
2719
2740
|
}
|
|
2720
2741
|
}
|
|
2721
|
-
var
|
|
2742
|
+
var Qt = class extends e {
|
|
2722
2743
|
static {
|
|
2723
2744
|
this.styles = h;
|
|
2724
2745
|
}
|
|
@@ -2733,18 +2754,18 @@ var Xt = class extends e {
|
|
|
2733
2754
|
}));
|
|
2734
2755
|
}
|
|
2735
2756
|
render() {
|
|
2736
|
-
return this.helpUrl &&
|
|
2757
|
+
return this.helpUrl && Zt(this.helpUrl) ? n`
|
|
2737
2758
|
<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">${
|
|
2759
|
+
<span class="ga-icon">${N(Ze)}</span>
|
|
2739
2760
|
</a>
|
|
2740
2761
|
` : n`
|
|
2741
2762
|
<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">${
|
|
2763
|
+
<span class="ga-icon">${N(Ze)}</span>
|
|
2743
2764
|
</button>
|
|
2744
2765
|
`;
|
|
2745
2766
|
}
|
|
2746
2767
|
};
|
|
2747
|
-
|
|
2768
|
+
F([s({ attribute: "help-url" })], Qt.prototype, "helpUrl", void 0), Qt = F([S(), o("vsn-help")], Qt);
|
|
2748
2769
|
//#endregion
|
|
2749
2770
|
//#region src/components/vsn-top-bar/vsn-top-bar.ts
|
|
2750
2771
|
var Q = class extends e {
|
|
@@ -2752,7 +2773,7 @@ var Q = class extends e {
|
|
|
2752
2773
|
super(...e), this.modules = [], this.feedback = null, this.showHelp = !1, this.showNotification = !1, this.notificationActive = !1, this.lang = "en";
|
|
2753
2774
|
}
|
|
2754
2775
|
willUpdate(e) {
|
|
2755
|
-
e.has("lang") &&
|
|
2776
|
+
e.has("lang") && Vt(this.lang).catch(console.error);
|
|
2756
2777
|
}
|
|
2757
2778
|
focusMenuToggle() {
|
|
2758
2779
|
this.renderRoot.querySelector("vsn-menu-toggle")?.focus();
|
|
@@ -2854,26 +2875,28 @@ var Q = class extends e {
|
|
|
2854
2875
|
`;
|
|
2855
2876
|
}
|
|
2856
2877
|
};
|
|
2857
|
-
|
|
2878
|
+
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
2879
|
type: Boolean,
|
|
2859
2880
|
attribute: "show-help"
|
|
2860
|
-
})], Q.prototype, "showHelp", void 0),
|
|
2881
|
+
})], Q.prototype, "showHelp", void 0), F([s({ attribute: "help-url" })], Q.prototype, "helpUrl", void 0), F([s({
|
|
2861
2882
|
type: Boolean,
|
|
2862
2883
|
attribute: "show-notification"
|
|
2863
|
-
})], Q.prototype, "showNotification", void 0),
|
|
2884
|
+
})], Q.prototype, "showNotification", void 0), F([s({
|
|
2864
2885
|
type: Boolean,
|
|
2865
2886
|
attribute: "notification-active"
|
|
2866
|
-
})], Q.prototype, "notificationActive", void 0),
|
|
2887
|
+
})], Q.prototype, "notificationActive", void 0), F([s()], Q.prototype, "lang", void 0), Q = F([o("vsn-top-bar")], Q);
|
|
2867
2888
|
//#endregion
|
|
2868
2889
|
//#region src/components/vsn-navigation.ts
|
|
2869
2890
|
var $ = class extends e {
|
|
2870
2891
|
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
|
-
|
|
2892
|
+
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) => {
|
|
2893
|
+
e.defaultPrevented || !Pe(e) || e.key.toLowerCase() !== "k" || (e.preventDefault(), this.dispatchEvent(new CustomEvent("vsn-open", {
|
|
2894
|
+
cancelable: !0,
|
|
2895
|
+
bubbles: !0,
|
|
2896
|
+
composed: !0
|
|
2897
|
+
})) && this._openAndFocusSearch());
|
|
2898
|
+
}, this._onEscape = (e) => {
|
|
2899
|
+
e.defaultPrevented || this.open && M(e) && e.key === "Escape" && (e.preventDefault(), this.open = !1);
|
|
2877
2900
|
};
|
|
2878
2901
|
}
|
|
2879
2902
|
_resolveModules() {
|
|
@@ -2940,29 +2963,32 @@ var $ = class extends e {
|
|
|
2940
2963
|
};
|
|
2941
2964
|
}
|
|
2942
2965
|
_onToggleSideBar() {
|
|
2943
|
-
this.
|
|
2966
|
+
this.open ? this._closeSideBar() : this._openAndFocusSearch();
|
|
2944
2967
|
}
|
|
2945
2968
|
_openAndFocusSearch() {
|
|
2946
|
-
this.
|
|
2947
|
-
}
|
|
2948
|
-
_onSideBarClose() {
|
|
2949
|
-
this._closeSideBar();
|
|
2969
|
+
this.open = !0, this.updateComplete.then(() => this.renderRoot.querySelector("vsn-side-bar")?.focusSearch());
|
|
2950
2970
|
}
|
|
2951
2971
|
_closeSideBar() {
|
|
2952
|
-
|
|
2953
|
-
|
|
2972
|
+
this.open = !1;
|
|
2973
|
+
}
|
|
2974
|
+
update(e) {
|
|
2975
|
+
if (e.has("open") && e.get("open") && !this.open) {
|
|
2976
|
+
let e = this.renderRoot.querySelector("vsn-side-bar");
|
|
2977
|
+
this._restoreFocusToToggle = e?.matches(":focus-within") ?? !1;
|
|
2978
|
+
}
|
|
2979
|
+
super.update(e);
|
|
2954
2980
|
}
|
|
2955
2981
|
updated(e) {
|
|
2956
|
-
e.has("
|
|
2982
|
+
e.has("open") && e.get("open") && !this.open && this._restoreFocusToToggle && this.renderRoot.querySelector("vsn-top-bar")?.focusMenuToggle();
|
|
2957
2983
|
}
|
|
2958
2984
|
connectedCallback() {
|
|
2959
|
-
super.connectedCallback(), document.addEventListener("keydown", this._onShortcut), document.addEventListener("keydown", this.
|
|
2985
|
+
super.connectedCallback(), document.addEventListener("keydown", this._onShortcut), document.addEventListener("keydown", this._onEscape);
|
|
2960
2986
|
}
|
|
2961
2987
|
disconnectedCallback() {
|
|
2962
|
-
document.removeEventListener("keydown", this._onShortcut), document.removeEventListener("keydown", this.
|
|
2988
|
+
document.removeEventListener("keydown", this._onShortcut), document.removeEventListener("keydown", this._onEscape), super.disconnectedCallback();
|
|
2963
2989
|
}
|
|
2964
2990
|
_onTopBarClick(e) {
|
|
2965
|
-
this.
|
|
2991
|
+
this.open && (e.composedPath().some((e) => e.tagName?.toUpperCase() === "VSN-MENU-TOGGLE") || (this.open = !1));
|
|
2966
2992
|
}
|
|
2967
2993
|
render() {
|
|
2968
2994
|
return n`
|
|
@@ -2980,7 +3006,7 @@ var $ = class extends e {
|
|
|
2980
3006
|
?notification-active=${this.notificationActive}
|
|
2981
3007
|
@toggle-side-bar=${this._onToggleSideBar}
|
|
2982
3008
|
@click=${this._onTopBarClick}
|
|
2983
|
-
@vsn-breadcrumb-dropdown-open=${this.
|
|
3009
|
+
@vsn-breadcrumb-dropdown-open=${this._closeSideBar}
|
|
2984
3010
|
>
|
|
2985
3011
|
<slot name="context-selector" slot="context-selector"></slot>
|
|
2986
3012
|
</vsn-top-bar>
|
|
@@ -2993,8 +3019,8 @@ var $ = class extends e {
|
|
|
2993
3019
|
.activeModuleLabel=${this.modules?.activeModuleLabel}
|
|
2994
3020
|
.modulesLoading=${this._modulesLoading}
|
|
2995
3021
|
.auth=${this.auth}
|
|
2996
|
-
?open=${this.
|
|
2997
|
-
@vsn-side-bar-close=${this.
|
|
3022
|
+
?open=${this.open}
|
|
3023
|
+
@vsn-side-bar-close=${this._closeSideBar}
|
|
2998
3024
|
>
|
|
2999
3025
|
<slot name="nav-footer" slot="nav-footer"></slot>
|
|
3000
3026
|
</vsn-side-bar>
|
|
@@ -3005,15 +3031,19 @@ var $ = class extends e {
|
|
|
3005
3031
|
`;
|
|
3006
3032
|
}
|
|
3007
3033
|
};
|
|
3008
|
-
|
|
3034
|
+
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
3035
|
type: Boolean,
|
|
3010
3036
|
attribute: "show-help"
|
|
3011
|
-
})], $.prototype, "showHelp", void 0),
|
|
3037
|
+
})], $.prototype, "showHelp", void 0), F([s({ attribute: "help-url" })], $.prototype, "helpUrl", void 0), F([s({ attribute: !1 })], $.prototype, "feedback", void 0), F([s({
|
|
3012
3038
|
type: Boolean,
|
|
3013
3039
|
attribute: "show-notification"
|
|
3014
|
-
})], $.prototype, "showNotification", void 0),
|
|
3040
|
+
})], $.prototype, "showNotification", void 0), F([s({
|
|
3015
3041
|
type: Boolean,
|
|
3016
3042
|
attribute: "notification-active"
|
|
3017
|
-
})], $.prototype, "notificationActive", void 0),
|
|
3043
|
+
})], $.prototype, "notificationActive", void 0), F([s({
|
|
3044
|
+
type: Boolean,
|
|
3045
|
+
attribute: "open",
|
|
3046
|
+
reflect: !0
|
|
3047
|
+
})], $.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
3048
|
//#endregion
|
|
3019
3049
|
export { v as SearchError, $ as VSNNavigation, g as isTreeLeaf, _ as isTreeParent };
|