@visma-swno/vsn-navigation 1.4.0-beta.1 → 1.4.0-beta.3
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.
|
@@ -129,10 +129,10 @@ var w = 0, we = (e) => (se(((e, t) => _e(Ce, e, t))), x = xe = e.sourceLocale, S
|
|
|
129
129
|
if (typeof navigator > "u") return !1;
|
|
130
130
|
let e = navigator.userAgentData?.platform ?? navigator.platform ?? "";
|
|
131
131
|
return /mac/i.test(e);
|
|
132
|
-
}, Oe = (e) => !e.shiftKey && !e.altKey && (De() ? e.metaKey && !e.ctrlKey : e.ctrlKey && !e.metaKey), T = (e) => e.shiftKey || e.altKey || e.ctrlKey || e.metaKey, E = (e) => !T(e), ke = () => v("Choose a service"), Ae = () => v("Search"), je = () => De() ? "Cmd+O" : "CTRL+O", Me = (e) => v(_`Type at least ${e} characters to search`), Ne = () => v("Menu items"), Pe = () => v("Load more"), Fe = () => v("VSN"), Ie = "survicate-sdk", Le = "ui-components-feedback", Re = (e) => `https://survey.survicate.com/workspaces/${e}/web_surveys.js`;
|
|
132
|
+
}, Oe = (e) => !e.shiftKey && !e.altKey && (De() ? e.metaKey && !e.ctrlKey : e.ctrlKey && !e.metaKey), T = (e) => e.shiftKey || e.altKey || e.ctrlKey || e.metaKey, E = (e) => !T(e), ke = () => v("Choose a service"), Ae = () => v("Search"), je = () => De() ? "Cmd+O" : "CTRL+O", Me = (e) => v(_`Type at least ${e} characters to search`), Ne = () => v("Menu items"), Pe = () => v("Load more"), Fe = () => v("VSN"), D = "menu", Ie = "survicate-sdk", Le = "ui-components-feedback", Re = (e) => `https://survey.survicate.com/workspaces/${e}/web_surveys.js`;
|
|
133
133
|
//#endregion
|
|
134
134
|
//#region src/shared/icons.ts
|
|
135
|
-
function
|
|
135
|
+
function O(e, t = 24, r) {
|
|
136
136
|
return n`<svg
|
|
137
137
|
xmlns="http://www.w3.org/2000/svg"
|
|
138
138
|
width="${t}"
|
|
@@ -210,7 +210,7 @@ var Xe = i`
|
|
|
210
210
|
<path d="m7 9 5-5 5 5"/>
|
|
211
211
|
`, Ze = i`
|
|
212
212
|
<path d="m18 15-6-6-6 6"/>
|
|
213
|
-
`,
|
|
213
|
+
`, k = i`
|
|
214
214
|
<path d="m6 9 6 6 6-6"/>
|
|
215
215
|
`, Qe = i`
|
|
216
216
|
<circle cx="11" cy="11" r="8"/>
|
|
@@ -404,17 +404,17 @@ function lt({ context: e, subscribe: t }) {
|
|
|
404
404
|
}
|
|
405
405
|
//#endregion
|
|
406
406
|
//#region src/shared/types/index.ts
|
|
407
|
-
function
|
|
407
|
+
function A(e) {
|
|
408
408
|
return "url" in e;
|
|
409
409
|
}
|
|
410
|
-
function
|
|
410
|
+
function j(e) {
|
|
411
411
|
return "items" in e;
|
|
412
412
|
}
|
|
413
|
-
var
|
|
413
|
+
var ut = class e extends Error {
|
|
414
414
|
constructor(t) {
|
|
415
415
|
super(t), this.name = "SearchError", Object.setPrototypeOf(this, e.prototype);
|
|
416
416
|
}
|
|
417
|
-
},
|
|
417
|
+
}, dt = rt("activeId"), ft = rt(Symbol("focus-manager"));
|
|
418
418
|
//#endregion
|
|
419
419
|
//#region \0@oxc-project+runtime@0.127.0/helpers/decorate.js
|
|
420
420
|
function M(e, t, n, r) {
|
|
@@ -470,7 +470,7 @@ var N, P = class extends e {
|
|
|
470
470
|
this._focusManager?.focusNext(this);
|
|
471
471
|
return;
|
|
472
472
|
}
|
|
473
|
-
|
|
473
|
+
j(t) ? this.handleKeyForParent(e.key) : this.handleKeyForLeaf(e.key);
|
|
474
474
|
}
|
|
475
475
|
};
|
|
476
476
|
let e = N._idCounter++;
|
|
@@ -481,10 +481,10 @@ var N, P = class extends e {
|
|
|
481
481
|
}
|
|
482
482
|
willUpdate(e) {
|
|
483
483
|
let t = this.tree;
|
|
484
|
-
t !== void 0 && e.has("_currentActiveId") && (this._isActive = this._currentActiveId === t.id,
|
|
484
|
+
t !== void 0 && e.has("_currentActiveId") && (this._isActive = this._currentActiveId === t.id, j(t) && (this._isExpanded = this.isActiveNode(t) !== null));
|
|
485
485
|
}
|
|
486
486
|
render() {
|
|
487
|
-
let e = this.tree !== void 0 &&
|
|
487
|
+
let e = this.tree !== void 0 && j(this.tree), t = this.tree && j(this.tree) ? this.tree.items : [];
|
|
488
488
|
return n`
|
|
489
489
|
${this.menuItemMarkup()}
|
|
490
490
|
${e ? n`
|
|
@@ -494,7 +494,7 @@ var N, P = class extends e {
|
|
|
494
494
|
`;
|
|
495
495
|
}
|
|
496
496
|
menuItemMarkup() {
|
|
497
|
-
let e = this.tree !== void 0 &&
|
|
497
|
+
let e = this.tree !== void 0 && j(this.tree), t = this.tree?.["data-qa-id"], r = {
|
|
498
498
|
"ga-side-navigation__item": !0,
|
|
499
499
|
[`ga-side-navigation__item--level-${this.level}`]: this.level > 1,
|
|
500
500
|
"ga-side-navigation__item--expanded": this._isExpanded,
|
|
@@ -505,7 +505,7 @@ var N, P = class extends e {
|
|
|
505
505
|
<div class="ga-tooltip ga-tooltip--right-center w-34 max-w-135">${this.tree?.label}</div>
|
|
506
506
|
</div>
|
|
507
507
|
<span class="ga-side-navigation__item-icon">
|
|
508
|
-
${e ? this._isExpanded ?
|
|
508
|
+
${e ? this._isExpanded ? O(k, 16) : O(tt, 16) : ""}
|
|
509
509
|
</span>
|
|
510
510
|
<div class="ga-side-navigation__item-content">
|
|
511
511
|
<div class="ga-side-navigation__item-label">${this.tree?.label}</div>
|
|
@@ -517,7 +517,7 @@ var N, P = class extends e {
|
|
|
517
517
|
@mouseleave=${this._onItemMouseLeave} @keydown=${this._onKeyDown}>${i}
|
|
518
518
|
</button>` : n`<a class="${d(r)}" aria-describedby="${this._tooltipId}"
|
|
519
519
|
aria-current=${f(this._isActive ? "page" : void 0)}
|
|
520
|
-
href="${this.tree &&
|
|
520
|
+
href="${this.tree && A(this.tree) ? this.tree.url : ""}" data-qa-id="${f(t)}"
|
|
521
521
|
@click=${this._handleItemClick} @mouseenter=${this._onItemMouseEnter}
|
|
522
522
|
@mouseleave=${this._onItemMouseLeave} @keydown=${this._onKeyDown}>${i}</a>`;
|
|
523
523
|
}
|
|
@@ -553,7 +553,7 @@ var N, P = class extends e {
|
|
|
553
553
|
}
|
|
554
554
|
isActiveNode(e) {
|
|
555
555
|
if (e.id === this._currentActiveId) return e;
|
|
556
|
-
if (
|
|
556
|
+
if (j(e)) for (let t of e.items) {
|
|
557
557
|
let e = this.isActiveNode(t);
|
|
558
558
|
if (e) return e;
|
|
559
559
|
}
|
|
@@ -562,7 +562,7 @@ var N, P = class extends e {
|
|
|
562
562
|
_handleItemClick(e) {
|
|
563
563
|
let t = this.tree;
|
|
564
564
|
if (t !== void 0) {
|
|
565
|
-
if (
|
|
565
|
+
if (j(t)) {
|
|
566
566
|
this._isExpanded = !this._isExpanded, e.preventDefault(), e.stopPropagation();
|
|
567
567
|
return;
|
|
568
568
|
}
|
|
@@ -575,9 +575,9 @@ var N, P = class extends e {
|
|
|
575
575
|
}
|
|
576
576
|
};
|
|
577
577
|
M([s({ attribute: !1 })], P.prototype, "tree", void 0), M([s({ type: Number })], P.prototype, "level", void 0), M([lt({
|
|
578
|
-
context:
|
|
578
|
+
context: dt,
|
|
579
579
|
subscribe: !0
|
|
580
|
-
}), l()], P.prototype, "_currentActiveId", void 0), M([l()], P.prototype, "_isActive", void 0), M([l()], P.prototype, "_isExpanded", void 0), M([l()], P.prototype, "_showTooltip", void 0), M([l()], P.prototype, "_tooltipPos", void 0), M([c(".ga-side-navigation__item-label")], P.prototype, "_labelEl", void 0), M([lt({ context:
|
|
580
|
+
}), l()], P.prototype, "_currentActiveId", void 0), M([l()], P.prototype, "_isActive", void 0), M([l()], P.prototype, "_isExpanded", void 0), M([l()], P.prototype, "_showTooltip", void 0), M([l()], P.prototype, "_tooltipPos", void 0), M([c(".ga-side-navigation__item-label")], P.prototype, "_labelEl", void 0), M([lt({ context: ft })], P.prototype, "_focusManager", void 0), M([s({ type: Boolean })], P.prototype, "hasPageTitle", void 0), P = N = M([o("vsn-menu-item")], P);
|
|
581
581
|
//#endregion
|
|
582
582
|
//#region src/components/vsn-side-bar/vsn-menu/vsn-menu.ts
|
|
583
583
|
var F = class extends e {
|
|
@@ -618,7 +618,7 @@ var F = class extends e {
|
|
|
618
618
|
<vsn-menu-item .tree=${e} .hasPageTitle=${this.hasPageTitle}></vsn-menu-item>`;
|
|
619
619
|
}
|
|
620
620
|
};
|
|
621
|
-
M([s({ attribute: !1 })], F.prototype, "items", void 0), M([ct({ context:
|
|
621
|
+
M([s({ attribute: !1 })], F.prototype, "items", void 0), M([ct({ context: dt }), l()], F.prototype, "_currentActiveId", void 0), M([s()], F.prototype, "currentItem", void 0), M([s({ type: Boolean })], F.prototype, "hasPageTitle", void 0), M([ct({ context: ft })], F.prototype, "_focusManager", void 0), F = M([y(), o("vsn-menu")], F);
|
|
622
622
|
//#endregion
|
|
623
623
|
//#region src/components/vsn-side-bar/vsn-menu/vsn-menu-button.ts
|
|
624
624
|
var I = class extends e {
|
|
@@ -741,7 +741,7 @@ M([s()], I.prototype, "label", void 0), M([s({
|
|
|
741
741
|
})], I.prototype, "closeOnClick", void 0), I = M([o("vsn-menu-button")], I);
|
|
742
742
|
//#endregion
|
|
743
743
|
//#region src/components/vsn-side-bar/vsn-menu/vsn-menu-separator.ts
|
|
744
|
-
var
|
|
744
|
+
var pt = class extends e {
|
|
745
745
|
static {
|
|
746
746
|
this.styles = [t`
|
|
747
747
|
/* flow-root establishes a BFC so the .line's margins stay contained.
|
|
@@ -765,10 +765,10 @@ var ft = class extends e {
|
|
|
765
765
|
return n`<div class="line"></div>`;
|
|
766
766
|
}
|
|
767
767
|
};
|
|
768
|
-
|
|
768
|
+
pt = M([o("vsn-menu-separator")], pt);
|
|
769
769
|
//#endregion
|
|
770
770
|
//#region src/components/vsn-side-bar/vsn-footer/vsn-footer.keyboard.ts
|
|
771
|
-
var
|
|
771
|
+
var mt = class {
|
|
772
772
|
constructor(e) {
|
|
773
773
|
this._prevExpanded = !1, this.onUserKeydown = (e) => {
|
|
774
774
|
e.defaultPrevented || T(e) || e.key === "Escape" && this.host.expanded && (e.preventDefault(), this.host.expanded = !1);
|
|
@@ -792,7 +792,7 @@ var pt = class {
|
|
|
792
792
|
} else !this.host.expanded && this._prevExpanded && this.host.querySelector(".ga-side-navigation__user")?.focus();
|
|
793
793
|
this._prevExpanded = this.host.expanded;
|
|
794
794
|
}
|
|
795
|
-
},
|
|
795
|
+
}, ht = class {
|
|
796
796
|
constructor(e, t, n) {
|
|
797
797
|
this._onPointerDown = (e) => {
|
|
798
798
|
let t = e.composedPath();
|
|
@@ -809,11 +809,11 @@ var pt = class {
|
|
|
809
809
|
hostDisconnected() {
|
|
810
810
|
document.removeEventListener("pointerdown", this._onPointerDown, !0);
|
|
811
811
|
}
|
|
812
|
-
},
|
|
813
|
-
function
|
|
812
|
+
}, gt = "initials";
|
|
813
|
+
function _t(e, t, n, r) {
|
|
814
814
|
if (!t) return;
|
|
815
815
|
let i = new URLSearchParams({
|
|
816
|
-
type:
|
|
816
|
+
type: gt,
|
|
817
817
|
size: r
|
|
818
818
|
});
|
|
819
819
|
return n && i.set("client_id", n), `${e}${t}?${i}`;
|
|
@@ -839,10 +839,10 @@ var L = class {
|
|
|
839
839
|
hostUpdated() {
|
|
840
840
|
this._rootElement == null && this._rootSelector && (this._rootElement = this._host.renderRoot.querySelector(this._rootSelector), this._rootElement != null && this._rootElement.addEventListener("keydown", this._onKeyDown));
|
|
841
841
|
}
|
|
842
|
-
},
|
|
842
|
+
}, vt = {
|
|
843
843
|
profile: qe,
|
|
844
844
|
logout: Je
|
|
845
|
-
},
|
|
845
|
+
}, yt = () => ({
|
|
846
846
|
profile: v("My profile"),
|
|
847
847
|
logout: v("Log out")
|
|
848
848
|
}), R = class extends e {
|
|
@@ -852,16 +852,16 @@ var L = class {
|
|
|
852
852
|
get _items() {
|
|
853
853
|
return [{
|
|
854
854
|
id: "profile",
|
|
855
|
-
label:
|
|
855
|
+
label: yt().profile,
|
|
856
856
|
url: this.myProfileUrl
|
|
857
857
|
}, {
|
|
858
858
|
id: "logout",
|
|
859
|
-
label:
|
|
859
|
+
label: yt().logout,
|
|
860
860
|
url: "/logout"
|
|
861
861
|
}];
|
|
862
862
|
}
|
|
863
863
|
constructor() {
|
|
864
|
-
super(), this.expanded = !1, this._avatarFailed = !1, this._keyboard = new
|
|
864
|
+
super(), this.expanded = !1, this._avatarFailed = !1, this._keyboard = new mt(this), new ht(this, [".ga-side-navigation__footer-dropdown", ".ga-side-navigation__user"], () => {
|
|
865
865
|
this.expanded = !1;
|
|
866
866
|
}), new L(this, () => this.expanded);
|
|
867
867
|
}
|
|
@@ -897,7 +897,7 @@ var L = class {
|
|
|
897
897
|
</div>
|
|
898
898
|
|
|
899
899
|
<span class="ga-side-navigation__user-action">
|
|
900
|
-
${this.expanded ?
|
|
900
|
+
${this.expanded ? O(Ze, 16) : O(Xe, 16)}
|
|
901
901
|
</span>
|
|
902
902
|
|
|
903
903
|
</button>
|
|
@@ -911,14 +911,14 @@ var L = class {
|
|
|
911
911
|
${this._items.map((e) => {
|
|
912
912
|
let t = n`
|
|
913
913
|
<span class="ga-side-navigation__footer-dropdown-icon">
|
|
914
|
-
${
|
|
914
|
+
${O(vt[e.id], 16)}
|
|
915
915
|
</span>
|
|
916
916
|
<span class="ga-side-navigation__footer-dropdown-title">
|
|
917
917
|
${e.label}
|
|
918
918
|
</span>
|
|
919
919
|
${e.external ? n`
|
|
920
920
|
<span class="ga-side-navigation__footer-dropdown-trail">
|
|
921
|
-
${
|
|
921
|
+
${O(Ye, 16)}
|
|
922
922
|
</span>
|
|
923
923
|
` : r}
|
|
924
924
|
`;
|
|
@@ -958,7 +958,7 @@ var L = class {
|
|
|
958
958
|
}));
|
|
959
959
|
}
|
|
960
960
|
renderAvatar() {
|
|
961
|
-
let e =
|
|
961
|
+
let e = _t(this.profilePictureBaseUrl, this.user.userId, this.user.clientId, "small");
|
|
962
962
|
return e && !this._avatarFailed ? n`<img
|
|
963
963
|
class="ga-side-navigation__user-avatar"
|
|
964
964
|
src=${e}
|
|
@@ -966,7 +966,7 @@ var L = class {
|
|
|
966
966
|
@error=${() => {
|
|
967
967
|
this._avatarFailed = !0;
|
|
968
968
|
}}/>` : n`<span class="ga-side-navigation__user-avatar vsn-side-navigation__user-avatar--icon">
|
|
969
|
-
${
|
|
969
|
+
${O(qe, 24)}
|
|
970
970
|
</span>`;
|
|
971
971
|
}
|
|
972
972
|
};
|
|
@@ -976,7 +976,7 @@ M([s({ attribute: !1 })], R.prototype, "user", void 0), M([s()], R.prototype, "p
|
|
|
976
976
|
})], R.prototype, "expanded", void 0), M([l()], R.prototype, "_avatarFailed", void 0), R = M([y(), o("vsn-footer")], R);
|
|
977
977
|
//#endregion
|
|
978
978
|
//#region src/components/vsn-side-bar/vsn-header/vsn-header.keyboard.ts
|
|
979
|
-
var
|
|
979
|
+
var bt = class {
|
|
980
980
|
constructor(e) {
|
|
981
981
|
this.onSwitcherKeydown = (e) => {
|
|
982
982
|
e.defaultPrevented || T(e) || this.host.expanded && e.key === "Escape" && this.host.requestClose() && e.preventDefault();
|
|
@@ -1067,27 +1067,6 @@ var B = class extends e {
|
|
|
1067
1067
|
createRenderRoot() {
|
|
1068
1068
|
return this;
|
|
1069
1069
|
}
|
|
1070
|
-
focus() {
|
|
1071
|
-
let e = this.querySelector("input");
|
|
1072
|
-
e?.focus(), e?.select();
|
|
1073
|
-
}
|
|
1074
|
-
get _canSearch() {
|
|
1075
|
-
return this.value.length >= 3;
|
|
1076
|
-
}
|
|
1077
|
-
_handleInput(e) {
|
|
1078
|
-
let t = e.target.value;
|
|
1079
|
-
this.dispatchEvent(new CustomEvent("vsn-search-input", {
|
|
1080
|
-
detail: { value: t },
|
|
1081
|
-
bubbles: !0,
|
|
1082
|
-
composed: !0
|
|
1083
|
-
})), this._scheduleAutoSearch();
|
|
1084
|
-
}
|
|
1085
|
-
disconnectedCallback() {
|
|
1086
|
-
this._cancelDebounce(), super.disconnectedCallback();
|
|
1087
|
-
}
|
|
1088
|
-
_handleEnter(e) {
|
|
1089
|
-
e.defaultPrevented || E(e) && e.key === "Enter" && this._emitSearch();
|
|
1090
|
-
}
|
|
1091
1070
|
render() {
|
|
1092
1071
|
let e = this.value.length > 0 && this.value.length < 3;
|
|
1093
1072
|
return n`
|
|
@@ -1098,7 +1077,7 @@ var B = class extends e {
|
|
|
1098
1077
|
aria-label=${v("Search")}
|
|
1099
1078
|
?disabled=${!this._canSearch}
|
|
1100
1079
|
@click=${this._emitSearch}>
|
|
1101
|
-
${
|
|
1080
|
+
${O(Qe, 24)}
|
|
1102
1081
|
</button>
|
|
1103
1082
|
<input type="search"
|
|
1104
1083
|
.placeholder=${Ae()}
|
|
@@ -1111,6 +1090,27 @@ var B = class extends e {
|
|
|
1111
1090
|
<div class="vsn-search__helper">${Me(3)}</div>`)}
|
|
1112
1091
|
`;
|
|
1113
1092
|
}
|
|
1093
|
+
focus() {
|
|
1094
|
+
let e = this.querySelector("input");
|
|
1095
|
+
e?.focus(), e?.select();
|
|
1096
|
+
}
|
|
1097
|
+
get _canSearch() {
|
|
1098
|
+
return this.value.length >= 3;
|
|
1099
|
+
}
|
|
1100
|
+
_handleInput(e) {
|
|
1101
|
+
let t = e.target.value;
|
|
1102
|
+
this.dispatchEvent(new CustomEvent("vsn-search-input", {
|
|
1103
|
+
detail: { value: t },
|
|
1104
|
+
bubbles: !0,
|
|
1105
|
+
composed: !0
|
|
1106
|
+
})), this._scheduleAutoSearch();
|
|
1107
|
+
}
|
|
1108
|
+
disconnectedCallback() {
|
|
1109
|
+
this._cancelDebounce(), super.disconnectedCallback();
|
|
1110
|
+
}
|
|
1111
|
+
_handleEnter(e) {
|
|
1112
|
+
e.defaultPrevented || E(e) && e.key === "Enter" && this._emitSearch();
|
|
1113
|
+
}
|
|
1114
1114
|
_trailingSlot() {
|
|
1115
1115
|
let e = this.loading, t = this.value.length > 0, i = !this.loading && this.value.length === 0 && this.shortcut.length > 0;
|
|
1116
1116
|
return n`
|
|
@@ -1126,7 +1126,7 @@ var B = class extends e {
|
|
|
1126
1126
|
return n`
|
|
1127
1127
|
<button class="vsn-search__clear" aria-label=${v("Clear search")}
|
|
1128
1128
|
@click=${this._emitSearchCleared}>
|
|
1129
|
-
${
|
|
1129
|
+
${O($e, 16)}
|
|
1130
1130
|
</button>
|
|
1131
1131
|
`;
|
|
1132
1132
|
}
|
|
@@ -1142,7 +1142,7 @@ var V = class extends e {
|
|
|
1142
1142
|
return this;
|
|
1143
1143
|
}
|
|
1144
1144
|
constructor() {
|
|
1145
|
-
super(), this.modules = [], this.modulesLoading = !1, this.hasMenu = !1, this.moduleSwitcherMaxHeight = 0, this.searchValue = "", this.searchLoading = !1, this.expanded = !1, this._keyboard = new
|
|
1145
|
+
super(), this.modules = [], this.modulesLoading = !1, this.hasMenu = !1, this.moduleSwitcherMaxHeight = 0, this.searchValue = "", this.searchLoading = !1, this.expanded = !1, this._keyboard = new bt(this), new ht(this, [".ga-side-navigation__switcher-dropdown", ".ga-side-navigation__switcher"], () => {
|
|
1146
1146
|
this.canClose && (this.expanded = !1);
|
|
1147
1147
|
}), new L(this, () => this.expanded, ".vsn-switcher-anchor");
|
|
1148
1148
|
}
|
|
@@ -1167,7 +1167,7 @@ var V = class extends e {
|
|
|
1167
1167
|
title="">
|
|
1168
1168
|
<span class="ga-side-navigation__switcher-title">${e.title}</span>
|
|
1169
1169
|
<span class="ga-side-navigation__switcher-action">
|
|
1170
|
-
${this.canClose ? this.expanded ?
|
|
1170
|
+
${this.canClose ? this.expanded ? O(k, 16) : O(Xe, 16) : O(ze, 16)}
|
|
1171
1171
|
</span>
|
|
1172
1172
|
</button>
|
|
1173
1173
|
|
|
@@ -1245,7 +1245,7 @@ M([s({ attribute: !1 })], V.prototype, "modules", void 0), M([s()], V.prototype,
|
|
|
1245
1245
|
})], V.prototype, "expanded", void 0), V = M([y(), o("vsn-header")], V);
|
|
1246
1246
|
//#endregion
|
|
1247
1247
|
//#region src/components/vsn-side-bar/vsn-search-results/vsn-search-results.keyboard.ts
|
|
1248
|
-
var
|
|
1248
|
+
var xt = class {
|
|
1249
1249
|
constructor(e) {
|
|
1250
1250
|
this.onResultsKeydown = (e) => {
|
|
1251
1251
|
if (e.defaultPrevented || T(e) || e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
|
|
@@ -1259,9 +1259,9 @@ var bt = class {
|
|
|
1259
1259
|
}, this.host = e, e.addController(this);
|
|
1260
1260
|
}
|
|
1261
1261
|
hostConnected() {}
|
|
1262
|
-
},
|
|
1262
|
+
}, St, H = class extends e {
|
|
1263
1263
|
static {
|
|
1264
|
-
|
|
1264
|
+
St = this;
|
|
1265
1265
|
}
|
|
1266
1266
|
createRenderRoot() {
|
|
1267
1267
|
return this;
|
|
@@ -1283,7 +1283,7 @@ var bt = class {
|
|
|
1283
1283
|
}
|
|
1284
1284
|
}, this._onItemMouseLeave = () => {
|
|
1285
1285
|
this._showTooltip = !1;
|
|
1286
|
-
}, this._tooltipId = `vsn-search-result-item-tooltip-${
|
|
1286
|
+
}, this._tooltipId = `vsn-search-result-item-tooltip-${St._idCounter++}`;
|
|
1287
1287
|
}
|
|
1288
1288
|
render() {
|
|
1289
1289
|
let e = this.item;
|
|
@@ -1317,12 +1317,12 @@ var bt = class {
|
|
|
1317
1317
|
}));
|
|
1318
1318
|
}
|
|
1319
1319
|
};
|
|
1320
|
-
M([s({ attribute: !1 })], H.prototype, "item", void 0), M([l()], H.prototype, "_showTooltip", void 0), M([l()], H.prototype, "_tooltipPos", void 0), M([c(".ga-side-navigation__search-results-item-label")], H.prototype, "_labelEl", void 0), H =
|
|
1320
|
+
M([s({ attribute: !1 })], H.prototype, "item", void 0), M([l()], H.prototype, "_showTooltip", void 0), M([l()], H.prototype, "_tooltipPos", void 0), M([c(".ga-side-navigation__search-results-item-label")], H.prototype, "_labelEl", void 0), H = St = M([o("vsn-search-result-item")], H);
|
|
1321
1321
|
//#endregion
|
|
1322
1322
|
//#region src/components/vsn-side-bar/vsn-search-results/vsn-search-results.ts
|
|
1323
1323
|
var U = class extends e {
|
|
1324
1324
|
constructor(...e) {
|
|
1325
|
-
super(...e), this.loadingMore = !1, this._keyboard = new
|
|
1325
|
+
super(...e), this.loadingMore = !1, this._keyboard = new xt(this);
|
|
1326
1326
|
}
|
|
1327
1327
|
createRenderRoot() {
|
|
1328
1328
|
return this;
|
|
@@ -1380,13 +1380,13 @@ var U = class extends e {
|
|
|
1380
1380
|
M([s({ attribute: !1 })], U.prototype, "results", void 0), M([s()], U.prototype, "errorMessage", void 0), M([s()], U.prototype, "nextCursor", void 0), M([s({ type: Boolean })], U.prototype, "loadingMore", void 0), U = M([y(), o("vsn-search-results")], U);
|
|
1381
1381
|
//#endregion
|
|
1382
1382
|
//#region src/components/vsn-side-bar/vsn-template/vsn-template.ts
|
|
1383
|
-
var
|
|
1383
|
+
var Ct = [
|
|
1384
1384
|
160,
|
|
1385
1385
|
96,
|
|
1386
1386
|
144,
|
|
1387
1387
|
192,
|
|
1388
1388
|
160
|
|
1389
|
-
],
|
|
1389
|
+
], wt = class extends e {
|
|
1390
1390
|
createRenderRoot() {
|
|
1391
1391
|
return this;
|
|
1392
1392
|
}
|
|
@@ -1396,7 +1396,7 @@ var St = [
|
|
|
1396
1396
|
role="status"
|
|
1397
1397
|
aria-busy="true"
|
|
1398
1398
|
aria-label=${v("Loading results")}>
|
|
1399
|
-
${
|
|
1399
|
+
${Ct.map((e) => n`
|
|
1400
1400
|
<div class="vsn-template__row">
|
|
1401
1401
|
<div class="vsn-template__bar" style="width: ${e}px"></div>
|
|
1402
1402
|
</div>
|
|
@@ -1405,17 +1405,17 @@ var St = [
|
|
|
1405
1405
|
`;
|
|
1406
1406
|
}
|
|
1407
1407
|
};
|
|
1408
|
-
|
|
1408
|
+
wt = M([y(), o("vsn-template")], wt);
|
|
1409
1409
|
//#endregion
|
|
1410
1410
|
//#region src/components/vsn-side-bar/vsn-error-state/vsn-error-state.ts
|
|
1411
|
-
var
|
|
1411
|
+
var Tt = class extends e {
|
|
1412
1412
|
createRenderRoot() {
|
|
1413
1413
|
return this;
|
|
1414
1414
|
}
|
|
1415
1415
|
render() {
|
|
1416
1416
|
return n`
|
|
1417
1417
|
<div class="vsn-error-state" role="alert" aria-live="assertive">
|
|
1418
|
-
<div class="vsn-error-state__icon">${
|
|
1418
|
+
<div class="vsn-error-state__icon">${O(et, 24)}</div>
|
|
1419
1419
|
<div class="vsn-error-state__title">${v("Loading error")}</div>
|
|
1420
1420
|
<div class="vsn-error-state__message">${v("We're unable to load the menu.")}</div>
|
|
1421
1421
|
<div class="vsn-error-state__hint">${v("Please check your internet connection and try again.")}</div>
|
|
@@ -1424,15 +1424,15 @@ var wt = class extends e {
|
|
|
1424
1424
|
`;
|
|
1425
1425
|
}
|
|
1426
1426
|
};
|
|
1427
|
-
|
|
1427
|
+
Tt = M([y(), o("vsn-error-state")], Tt);
|
|
1428
1428
|
//#endregion
|
|
1429
1429
|
//#region src/components/vsn-side-bar/vsn-search-scopes/vsn-search-scopes.ts
|
|
1430
|
-
var
|
|
1430
|
+
var Et, W = class extends e {
|
|
1431
1431
|
static {
|
|
1432
|
-
|
|
1432
|
+
Et = this;
|
|
1433
1433
|
}
|
|
1434
1434
|
constructor(...e) {
|
|
1435
|
-
super(...e), this.scopes = [], this.selectedScopeId = "", this._name = `vsn-search-scope-${++
|
|
1435
|
+
super(...e), this.scopes = [], this.selectedScopeId = "", this._name = `vsn-search-scope-${++Et._counter}`;
|
|
1436
1436
|
}
|
|
1437
1437
|
createRenderRoot() {
|
|
1438
1438
|
return this;
|
|
@@ -1470,16 +1470,16 @@ var Tt, W = class extends e {
|
|
|
1470
1470
|
}));
|
|
1471
1471
|
}
|
|
1472
1472
|
};
|
|
1473
|
-
M([s({ attribute: !1 })], W.prototype, "scopes", void 0), M([s()], W.prototype, "selectedScopeId", void 0), W =
|
|
1473
|
+
M([s({ attribute: !1 })], W.prototype, "scopes", void 0), M([s()], W.prototype, "selectedScopeId", void 0), W = Et = M([y(), o("vsn-search-scopes")], W);
|
|
1474
1474
|
//#endregion
|
|
1475
1475
|
//#region src/shared/lang/locale-codes.ts
|
|
1476
|
-
var
|
|
1476
|
+
var Dt = "en", Ot = [
|
|
1477
1477
|
"da",
|
|
1478
1478
|
"fi",
|
|
1479
1479
|
"nl",
|
|
1480
1480
|
"no",
|
|
1481
1481
|
"sv"
|
|
1482
|
-
],
|
|
1482
|
+
], kt = /* @__PURE__ */ m({ templates: () => At }), At = {
|
|
1483
1483
|
s09a45db408570a7a: "Min profil",
|
|
1484
1484
|
s119f9875b7d4cdfc: "Har du brug for hjælp? Kontakt support.",
|
|
1485
1485
|
s1228605ee65ddefa: _`${0} resultat`,
|
|
@@ -1513,7 +1513,7 @@ var Et = "en", Dt = [
|
|
|
1513
1513
|
sfbf31f663cef6cc2: "Prøv andre søgeord eller tjek stavningen.",
|
|
1514
1514
|
s7c510419ea376840: "VSN",
|
|
1515
1515
|
s38385cd359b17f7a: "Loading modules"
|
|
1516
|
-
},
|
|
1516
|
+
}, jt = /* @__PURE__ */ m({ templates: () => Mt }), Mt = {
|
|
1517
1517
|
s09a45db408570a7a: "Oma profiili",
|
|
1518
1518
|
s119f9875b7d4cdfc: "Tarvitsetko apua? Ota yhteyttä tukeen.",
|
|
1519
1519
|
s1228605ee65ddefa: _`${0} tulos`,
|
|
@@ -1547,7 +1547,7 @@ var Et = "en", Dt = [
|
|
|
1547
1547
|
sfbf31f663cef6cc2: "Kokeile eri hakusanoja tai tarkista kirjoitusasu.",
|
|
1548
1548
|
s7c510419ea376840: "VSN",
|
|
1549
1549
|
s38385cd359b17f7a: "Loading modules"
|
|
1550
|
-
},
|
|
1550
|
+
}, Nt = /* @__PURE__ */ m({ templates: () => Pt }), Pt = {
|
|
1551
1551
|
s09a45db408570a7a: "Mijn profiel",
|
|
1552
1552
|
s119f9875b7d4cdfc: "Hulp nodig? Neem contact op met ondersteuning.",
|
|
1553
1553
|
s1228605ee65ddefa: _`${0} resultaat`,
|
|
@@ -1581,7 +1581,7 @@ var Et = "en", Dt = [
|
|
|
1581
1581
|
sfbf31f663cef6cc2: "Probeer andere zoekwoorden of controleer de spelling.",
|
|
1582
1582
|
s7c510419ea376840: "VSN",
|
|
1583
1583
|
s38385cd359b17f7a: "Loading modules"
|
|
1584
|
-
},
|
|
1584
|
+
}, Ft = /* @__PURE__ */ m({ templates: () => It }), It = {
|
|
1585
1585
|
s09a45db408570a7a: "Min profil",
|
|
1586
1586
|
s119f9875b7d4cdfc: "Trenger du hjelp? Kontakt støtte.",
|
|
1587
1587
|
s1228605ee65ddefa: _`${0} resultat`,
|
|
@@ -1615,7 +1615,7 @@ var Et = "en", Dt = [
|
|
|
1615
1615
|
sfbf31f663cef6cc2: "Prøv andre søkeord eller sjekk stavemåten.",
|
|
1616
1616
|
s7c510419ea376840: "VSN",
|
|
1617
1617
|
s38385cd359b17f7a: "Loading modules"
|
|
1618
|
-
},
|
|
1618
|
+
}, Lt = /* @__PURE__ */ m({ templates: () => Rt }), Rt = {
|
|
1619
1619
|
s09a45db408570a7a: "Min profil",
|
|
1620
1620
|
s119f9875b7d4cdfc: "Behöver du hjälp? Kontakta support.",
|
|
1621
1621
|
s1228605ee65ddefa: _`${0} resultat`,
|
|
@@ -1649,17 +1649,17 @@ var Et = "en", Dt = [
|
|
|
1649
1649
|
sfbf31f663cef6cc2: "Prova andra sökord eller kontrollera stavningen.",
|
|
1650
1650
|
s7c510419ea376840: "VSN",
|
|
1651
1651
|
s38385cd359b17f7a: "Loading modules"
|
|
1652
|
-
},
|
|
1653
|
-
da:
|
|
1654
|
-
fi:
|
|
1655
|
-
nl:
|
|
1656
|
-
no:
|
|
1657
|
-
sv:
|
|
1658
|
-
}, { getLocale:
|
|
1659
|
-
sourceLocale:
|
|
1660
|
-
targetLocales:
|
|
1661
|
-
loadLocale: (e) =>
|
|
1662
|
-
}),
|
|
1652
|
+
}, zt = {
|
|
1653
|
+
da: kt,
|
|
1654
|
+
fi: jt,
|
|
1655
|
+
nl: Nt,
|
|
1656
|
+
no: Ft,
|
|
1657
|
+
sv: Lt
|
|
1658
|
+
}, { getLocale: Bt, setLocale: Vt } = we({
|
|
1659
|
+
sourceLocale: Dt,
|
|
1660
|
+
targetLocales: Ot,
|
|
1661
|
+
loadLocale: (e) => zt[e] ? Promise.resolve(zt[e]) : Promise.reject(/* @__PURE__ */ Error(`Unknown locale: ${e}`))
|
|
1662
|
+
}), Ht = t`
|
|
1663
1663
|
@layer components {
|
|
1664
1664
|
vsn-footer {
|
|
1665
1665
|
display: block;
|
|
@@ -1700,7 +1700,7 @@ var Et = "en", Dt = [
|
|
|
1700
1700
|
justify-content: center;
|
|
1701
1701
|
}
|
|
1702
1702
|
}
|
|
1703
|
-
`,
|
|
1703
|
+
`, Ut = t`
|
|
1704
1704
|
@layer components {
|
|
1705
1705
|
.vsn-switcher-anchor {
|
|
1706
1706
|
position: relative;
|
|
@@ -1714,7 +1714,7 @@ var Et = "en", Dt = [
|
|
|
1714
1714
|
z-index: 10;
|
|
1715
1715
|
}
|
|
1716
1716
|
}
|
|
1717
|
-
`,
|
|
1717
|
+
`, Wt = t`
|
|
1718
1718
|
.vsn-search__trigger,
|
|
1719
1719
|
.vsn-search__clear {
|
|
1720
1720
|
display: inline-flex;
|
|
@@ -1763,7 +1763,7 @@ var Et = "en", Dt = [
|
|
|
1763
1763
|
.ga-side-navigation__search input::placeholder {
|
|
1764
1764
|
color: var(--ga-color-text-disable-selected);
|
|
1765
1765
|
}
|
|
1766
|
-
`,
|
|
1766
|
+
`, Gt = t`
|
|
1767
1767
|
.vsn-search-results__empty {
|
|
1768
1768
|
display: flex;
|
|
1769
1769
|
flex-direction: column;
|
|
@@ -1832,7 +1832,7 @@ var Et = "en", Dt = [
|
|
|
1832
1832
|
cursor: not-allowed;
|
|
1833
1833
|
opacity: 0.5;
|
|
1834
1834
|
}
|
|
1835
|
-
`,
|
|
1835
|
+
`, Kt = t`
|
|
1836
1836
|
@layer components {
|
|
1837
1837
|
vsn-search-scopes {
|
|
1838
1838
|
display: block;
|
|
@@ -1853,7 +1853,7 @@ var Et = "en", Dt = [
|
|
|
1853
1853
|
text-overflow: ellipsis;
|
|
1854
1854
|
}
|
|
1855
1855
|
}
|
|
1856
|
-
`,
|
|
1856
|
+
`, qt = t`
|
|
1857
1857
|
.vsn-template__row {
|
|
1858
1858
|
display: flex;
|
|
1859
1859
|
flex-direction: column;
|
|
@@ -1868,7 +1868,7 @@ var Et = "en", Dt = [
|
|
|
1868
1868
|
background: var(--ga-color-miscellaneous-skeleton-element, #F2F3F5);
|
|
1869
1869
|
flex-shrink: 0;
|
|
1870
1870
|
}
|
|
1871
|
-
`,
|
|
1871
|
+
`, Jt = t`
|
|
1872
1872
|
.vsn-error-state {
|
|
1873
1873
|
display: flex;
|
|
1874
1874
|
flex-direction: column;
|
|
@@ -1907,7 +1907,7 @@ var Et = "en", Dt = [
|
|
|
1907
1907
|
font-weight: 400;
|
|
1908
1908
|
color: var(--ga-color-text-on-disabled);
|
|
1909
1909
|
}
|
|
1910
|
-
`,
|
|
1910
|
+
`, Yt = t`
|
|
1911
1911
|
.vsn-spinner {
|
|
1912
1912
|
display: inline-block;
|
|
1913
1913
|
flex-shrink: 0;
|
|
@@ -1927,20 +1927,7 @@ var Et = "en", Dt = [
|
|
|
1927
1927
|
@keyframes vsn-spin {
|
|
1928
1928
|
to { transform: rotate(360deg); }
|
|
1929
1929
|
}
|
|
1930
|
-
`,
|
|
1931
|
-
constructor(e, t, n) {
|
|
1932
|
-
this._onHostClick = (e) => {
|
|
1933
|
-
let t = this._host.renderRoot.querySelector(this._clickedSelector);
|
|
1934
|
-
t && !e.composedPath().includes(t) && this._callback();
|
|
1935
|
-
}, this._host = e, this._clickedSelector = t, this._callback = n, e.addController(this);
|
|
1936
|
-
}
|
|
1937
|
-
hostConnected() {
|
|
1938
|
-
this._host.addEventListener("click", this._onHostClick);
|
|
1939
|
-
}
|
|
1940
|
-
hostDisconnected() {
|
|
1941
|
-
this._host.removeEventListener("click", this._onHostClick);
|
|
1942
|
-
}
|
|
1943
|
-
}, Xt = "button:not([disabled]), a[href], [tabindex]:not([tabindex=\"-1\"])", Zt = class {
|
|
1930
|
+
`, Xt = "button:not([disabled]), a[href], [tabindex]:not([tabindex=\"-1\"])", Zt = class {
|
|
1944
1931
|
constructor(e) {
|
|
1945
1932
|
this.onKeydown = (e) => {
|
|
1946
1933
|
if (e.defaultPrevented || T(e) || e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
|
|
@@ -2010,20 +1997,22 @@ var Et = "en", Dt = [
|
|
|
2010
1997
|
this.styles = [
|
|
2011
1998
|
g,
|
|
2012
1999
|
Qt,
|
|
2013
|
-
|
|
2000
|
+
Ut,
|
|
2014
2001
|
$t,
|
|
2015
|
-
|
|
2002
|
+
Ht,
|
|
2016
2003
|
en,
|
|
2017
|
-
Ut,
|
|
2018
2004
|
Wt,
|
|
2019
2005
|
Gt,
|
|
2020
2006
|
Kt,
|
|
2021
2007
|
qt,
|
|
2022
2008
|
Jt,
|
|
2009
|
+
Yt,
|
|
2023
2010
|
t`
|
|
2024
2011
|
:host {
|
|
2025
2012
|
position: absolute;
|
|
2026
|
-
|
|
2013
|
+
top: 0;
|
|
2014
|
+
bottom: calc(calc(.25rem * var(--ga-base-scaling-factor, 1)) * 4);
|
|
2015
|
+
left: calc(calc(.25rem * var(--ga-base-scaling-factor, 1)) * 4);
|
|
2027
2016
|
z-index: 100;
|
|
2028
2017
|
}
|
|
2029
2018
|
|
|
@@ -2033,11 +2022,6 @@ var Et = "en", Dt = [
|
|
|
2033
2022
|
`
|
|
2034
2023
|
];
|
|
2035
2024
|
}
|
|
2036
|
-
downLevelTree(e) {
|
|
2037
|
-
if (!e) return;
|
|
2038
|
-
let t = e[0];
|
|
2039
|
-
if (!(!t || !A(t))) return t;
|
|
2040
|
-
}
|
|
2041
2025
|
get _menu() {
|
|
2042
2026
|
let e = this.downLevelTree(this.menu?.items);
|
|
2043
2027
|
if (e !== void 0) return {
|
|
@@ -2047,7 +2031,7 @@ var Et = "en", Dt = [
|
|
|
2047
2031
|
};
|
|
2048
2032
|
}
|
|
2049
2033
|
constructor() {
|
|
2050
|
-
super(), this.modules = [], this.modulesLoading = !1, this.lang = "en", this.error = !1, this.open = !1, this._searchQuery = "", this._searchLoading = !1, this._activeScopeId =
|
|
2034
|
+
super(), this.modules = [], this.modulesLoading = !1, this.lang = "en", this.error = !1, this.open = !1, this._searchQuery = "", this._searchLoading = !1, this._activeScopeId = D, this._searchLoadingMore = !1, this._moduleSwitcherMaxHeight = 0, this._hasPageTitle = !1, this._navFooterKeyboard = new Zt(this), this._customWidthPerLanguage = { fi: "30em" }, this._onNavigate = (e) => {
|
|
2051
2035
|
this._searchQuery = "", this._searchResults = void 0, this.dispatchEvent(new CustomEvent("vsn-side-bar-close", {
|
|
2052
2036
|
bubbles: !0,
|
|
2053
2037
|
composed: !0
|
|
@@ -2064,24 +2048,26 @@ var Et = "en", Dt = [
|
|
|
2064
2048
|
}));
|
|
2065
2049
|
}, this._onScopeChanged = (e) => {
|
|
2066
2050
|
this._activeScopeId = e.detail.scopeId, this._runSearch(this._searchQuery, this._activeScopeId);
|
|
2067
|
-
},
|
|
2068
|
-
bubbles: !0,
|
|
2069
|
-
composed: !0
|
|
2070
|
-
}))), this._resizeObserver = new ResizeObserver((e) => {
|
|
2051
|
+
}, this._resizeObserver = new ResizeObserver((e) => {
|
|
2071
2052
|
this._observeMenuSize(e);
|
|
2072
2053
|
}), this._resizeObserver.observe(this), new L(this, () => this.open);
|
|
2073
2054
|
}
|
|
2055
|
+
downLevelTree(e) {
|
|
2056
|
+
if (!e) return;
|
|
2057
|
+
let t = e[0];
|
|
2058
|
+
if (!(!t || !j(t))) return t;
|
|
2059
|
+
}
|
|
2074
2060
|
_observeMenuSize(e) {
|
|
2075
2061
|
this._moduleSwitcherMaxHeight = Math.max(0, e[0].contentRect.height - 134);
|
|
2076
2062
|
}
|
|
2077
2063
|
willUpdate(e) {
|
|
2078
|
-
e.has("lang") &&
|
|
2064
|
+
e.has("lang") && Vt(this.lang).catch(console.error), e.has("open") && e.get("open") && !this.open && this.resetSidebarToInitialState(), e.has("menu") && (this._hasPageTitle = this.menu?.pageTitle !== void 0, e.get("menu")?.items !== this.menu?.items && this._runSearch(this._searchQuery, this._activeScopeId));
|
|
2079
2065
|
}
|
|
2080
2066
|
updated(e) {
|
|
2081
2067
|
e.has("open") && this.open && this._scrollActiveItemIntoView(), e.has("menu") && this.open && this.menu?.currentItem && (e.get("menu")?.currentItem || this._scrollActiveItemIntoView());
|
|
2082
2068
|
}
|
|
2083
2069
|
resetSidebarToInitialState() {
|
|
2084
|
-
this._searchQuery = "", this._activeScopeId =
|
|
2070
|
+
this._searchQuery = "", this._activeScopeId = D, this._clearSearchState(), this.renderRoot.querySelector("vsn-header")?.reset(), this.renderRoot.querySelector("vsn-footer")?.reset();
|
|
2085
2071
|
}
|
|
2086
2072
|
render() {
|
|
2087
2073
|
let e = this._viewMode();
|
|
@@ -2129,7 +2115,7 @@ var Et = "en", Dt = [
|
|
|
2129
2115
|
this._runSearch(e.detail.query, this._activeScopeId);
|
|
2130
2116
|
}
|
|
2131
2117
|
_onSearchCleared() {
|
|
2132
|
-
this._searchQuery = "", this._clearSearchState(), this.focusSearch();
|
|
2118
|
+
this._searchQuery = "", this._activeScopeId = D, this._clearSearchState(), this.focusSearch();
|
|
2133
2119
|
}
|
|
2134
2120
|
_clearSearchState() {
|
|
2135
2121
|
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;
|
|
@@ -2159,7 +2145,7 @@ var Et = "en", Dt = [
|
|
|
2159
2145
|
this._searchResults = t.results, this._searchNextCursor = t.nextCursor, this._searchLoading = !1, this._searchAbort = void 0;
|
|
2160
2146
|
} catch (e) {
|
|
2161
2147
|
if (this._searchAbort !== r) return;
|
|
2162
|
-
e instanceof
|
|
2148
|
+
e instanceof ut ? (this._searchError = e.message, this._searchResults = void 0) : console.error("Search function rejected with non-SearchError:", e), this._searchLoading = !1, this._searchAbort = void 0;
|
|
2163
2149
|
}
|
|
2164
2150
|
}
|
|
2165
2151
|
async _loadMore() {
|
|
@@ -2179,14 +2165,14 @@ var Et = "en", Dt = [
|
|
|
2179
2165
|
this._searchResults = [...this._searchResults ?? [], ...n.results], this._searchNextCursor = n.nextCursor, this._searchLoadingMore = !1, this._searchAbort = void 0;
|
|
2180
2166
|
} catch (e) {
|
|
2181
2167
|
if (this._searchAbort !== t) return;
|
|
2182
|
-
e instanceof
|
|
2168
|
+
e instanceof ut ? (this._searchError = e.message, this._searchResults = void 0, this._searchNextCursor = void 0) : console.error("Load-more function rejected with non-SearchError:", e), this._searchLoadingMore = !1, this._searchAbort = void 0;
|
|
2183
2169
|
}
|
|
2184
2170
|
}
|
|
2185
2171
|
_filterTree(e) {
|
|
2186
2172
|
let t = this._menu?.items;
|
|
2187
2173
|
if (!t?.length || !e) return [];
|
|
2188
2174
|
let n = e.toLowerCase(), r = [], i = (e, t) => {
|
|
2189
|
-
for (let a of e) if (
|
|
2175
|
+
for (let a of e) if (j(a)) i(a.items, [...t, a]);
|
|
2190
2176
|
else if (a.label.toLowerCase().includes(n) || this.matchInKeywords(a.keywords, n)) {
|
|
2191
2177
|
let e = t.length > 0 ? [t.map((e) => e.label).join(" › ")] : void 0;
|
|
2192
2178
|
r.push({
|
|
@@ -2243,12 +2229,12 @@ var Et = "en", Dt = [
|
|
|
2243
2229
|
</vsn-header>`;
|
|
2244
2230
|
}
|
|
2245
2231
|
scopesGroup() {
|
|
2246
|
-
if (!this.menu?.search?.enabled) return n``;
|
|
2232
|
+
if (!this.menu?.search?.enabled || this._searchQuery.length === 0) return n``;
|
|
2247
2233
|
let e = this.menu.search.extraDataSets ?? [];
|
|
2248
2234
|
return e.length === 0 ? n`` : n`
|
|
2249
2235
|
<vsn-search-scopes
|
|
2250
2236
|
.scopes=${[{
|
|
2251
|
-
id:
|
|
2237
|
+
id: D,
|
|
2252
2238
|
label: Ne()
|
|
2253
2239
|
}, ...e.map((e) => ({
|
|
2254
2240
|
id: e.id,
|
|
@@ -2343,7 +2329,7 @@ var K, q = class extends e {
|
|
|
2343
2329
|
<div class="ga-tooltip ga-tooltip--right-start" style="white-space: nowrap">${e}</div>
|
|
2344
2330
|
</div>
|
|
2345
2331
|
<span class="ga-side-navigation__item-icon">
|
|
2346
|
-
${this._isParent() ? this._isExpanded ?
|
|
2332
|
+
${this._isParent() ? this._isExpanded ? O(k, 16) : O(tt, 16) : ""}
|
|
2347
2333
|
</span>
|
|
2348
2334
|
<div class="ga-side-navigation__item-content">
|
|
2349
2335
|
<div class="ga-side-navigation__item-label">${e}</div>
|
|
@@ -2353,7 +2339,7 @@ var K, q = class extends e {
|
|
|
2353
2339
|
<div class="${d(t)}" role="button" tabindex="0" aria-expanded=${this._isExpanded} aria-describedby="${this._tooltipId}" @click=${this._onClick} @keydown=${this._onKeyDown}
|
|
2354
2340
|
@mouseenter=${this._onItemMouseEnter} @mouseleave=${this._onItemMouseLeave}>${r}
|
|
2355
2341
|
</div>` : n`<a class="${d(t)}" aria-describedby="${this._tooltipId}"
|
|
2356
|
-
href="${this.tree &&
|
|
2342
|
+
href="${this.tree && A(this.tree) ? this.tree.url : ""}" @click=${this._onClick}
|
|
2357
2343
|
@mouseenter=${this._onItemMouseEnter} @mouseleave=${this._onItemMouseLeave}>${r}</a>`;
|
|
2358
2344
|
}
|
|
2359
2345
|
_menuItem(e, t) {
|
|
@@ -2361,10 +2347,10 @@ var K, q = class extends e {
|
|
|
2361
2347
|
<vsn-breadcrumb-menu-item .tree=${e} .level=${t} .ancestorPath=${this.tree ? [...this.ancestorPath, this.tree] : this.ancestorPath}></vsn-breadcrumb-menu-item>`;
|
|
2362
2348
|
}
|
|
2363
2349
|
_getTreeItems(e) {
|
|
2364
|
-
if (e !== void 0 &&
|
|
2350
|
+
if (e !== void 0 && j(e)) return e.items;
|
|
2365
2351
|
}
|
|
2366
2352
|
_isParent() {
|
|
2367
|
-
if (this.tree &&
|
|
2353
|
+
if (this.tree && j(this.tree)) return this.tree.items.length > 0;
|
|
2368
2354
|
}
|
|
2369
2355
|
};
|
|
2370
2356
|
M([s({ attribute: !1 })], q.prototype, "tree", void 0), M([s({ type: Number })], q.prototype, "level", void 0), M([s({ type: Array })], q.prototype, "ancestorPath", void 0), M([l()], q.prototype, "_isExpanded", void 0), M([l()], q.prototype, "_showTooltip", void 0), M([l()], q.prototype, "_tooltipPos", void 0), M([c(".ga-side-navigation__item-label")], q.prototype, "_labelEl", void 0), q = K = M([o("vsn-breadcrumb-menu-item")], q);
|
|
@@ -2442,7 +2428,7 @@ var J = class extends e {
|
|
|
2442
2428
|
this.styles = [
|
|
2443
2429
|
g,
|
|
2444
2430
|
Qt,
|
|
2445
|
-
|
|
2431
|
+
Yt,
|
|
2446
2432
|
t`
|
|
2447
2433
|
.vsn-bc-modules-loading {
|
|
2448
2434
|
display: flex;
|
|
@@ -2493,6 +2479,12 @@ var J = class extends e {
|
|
|
2493
2479
|
.ga-breadcrumb-item--overflow .ga-breadcrumb-item__trigger:hover .ga-breadcrumb-item__label {
|
|
2494
2480
|
text-decoration: none;
|
|
2495
2481
|
}
|
|
2482
|
+
|
|
2483
|
+
/* Override global padding-right-only to apply equal padding on both sides */
|
|
2484
|
+
.ga-breadcrumb-item--link .ga-breadcrumb-item__trigger,
|
|
2485
|
+
.ga-breadcrumb-item--current-page .ga-breadcrumb-item__trigger {
|
|
2486
|
+
padding-inline: calc(0.25rem * var(--ga-base-scaling-factor, 1));
|
|
2487
|
+
}
|
|
2496
2488
|
|
|
2497
2489
|
/* Focus indicator for keyboard navigation inside breadcrumb dropdowns */
|
|
2498
2490
|
.ga-breadcrumb-item__menu .ga-side-navigation__item:focus-visible {
|
|
@@ -2554,7 +2546,7 @@ var J = class extends e {
|
|
|
2554
2546
|
_findPath(e, t, n = []) {
|
|
2555
2547
|
let r = [...n, e];
|
|
2556
2548
|
if (e.id === t) return r;
|
|
2557
|
-
for (let n of
|
|
2549
|
+
for (let n of j(e) ? e.items : []) {
|
|
2558
2550
|
let e = this._findPath(n, t, r);
|
|
2559
2551
|
if (e) return e;
|
|
2560
2552
|
}
|
|
@@ -2673,7 +2665,7 @@ var J = class extends e {
|
|
|
2673
2665
|
_handleLeafSelect(e, t) {
|
|
2674
2666
|
(this.shadowRoot?.getElementById(t))?.hidePopover?.();
|
|
2675
2667
|
let n = e.detail.path, r = n[n.length - 1];
|
|
2676
|
-
r &&
|
|
2668
|
+
r && A(r) && this.dispatchEvent(new CustomEvent("vsn-menu-item-changed", {
|
|
2677
2669
|
detail: r,
|
|
2678
2670
|
bubbles: !0,
|
|
2679
2671
|
composed: !0
|
|
@@ -2692,7 +2684,7 @@ var J = class extends e {
|
|
|
2692
2684
|
</div>`;
|
|
2693
2685
|
}
|
|
2694
2686
|
_renderLastItem(e, t, r) {
|
|
2695
|
-
return r ? n`${
|
|
2687
|
+
return r ? n`${j(e) && e.items.length > 0 ? this._renderBreadcrumbItem(e, t) : this._renderLeafAsAncestor(e)}${this._renderPageTitle(r)}` : this._renderCurrentItem(e);
|
|
2696
2688
|
}
|
|
2697
2689
|
_renderPageTitle(e) {
|
|
2698
2690
|
return n`
|
|
@@ -2714,7 +2706,7 @@ var J = class extends e {
|
|
|
2714
2706
|
</div>`;
|
|
2715
2707
|
}
|
|
2716
2708
|
_renderBreadcrumbItem(e, t) {
|
|
2717
|
-
if (!
|
|
2709
|
+
if (!j(e) || e.items.length === 0) return n``;
|
|
2718
2710
|
let i = this._popoverItemId(t), a = this._popoverItemTriggerId(t);
|
|
2719
2711
|
return n`
|
|
2720
2712
|
<div class="ga-breadcrumb-item ga-breadcrumb-item--link"
|
|
@@ -2832,7 +2824,7 @@ var nn = class extends e {
|
|
|
2832
2824
|
return n`
|
|
2833
2825
|
<button type="button" class="ga-button ga-button--secondary ga-button--icon-only"
|
|
2834
2826
|
aria-label=${v("Open AI assistant")} @click=${this._handleClick}>
|
|
2835
|
-
<span class="ga-icon">${
|
|
2827
|
+
<span class="ga-icon">${O(Ve)}</span>
|
|
2836
2828
|
</button>
|
|
2837
2829
|
`;
|
|
2838
2830
|
}
|
|
@@ -2885,7 +2877,7 @@ var Y = class extends e {
|
|
|
2885
2877
|
return this._compact ? n`
|
|
2886
2878
|
<button type="button" class="ga-button ga-button--secondary ga-button--icon-only"
|
|
2887
2879
|
aria-label=${v("Send feedback")} @click=${this._handleClick}>
|
|
2888
|
-
<span class="ga-icon">${
|
|
2880
|
+
<span class="ga-icon">${O(We)}</span>
|
|
2889
2881
|
</button>
|
|
2890
2882
|
` : n`
|
|
2891
2883
|
<button type="button" class="ga-button ga-button--secondary" aria-label=${v("Send feedback")}
|
|
@@ -2917,7 +2909,7 @@ var rn = class extends e {
|
|
|
2917
2909
|
return this.landingPageUrl ? n`
|
|
2918
2910
|
<a href=${this.landingPageUrl} class="ga-button ga-button--ghost ga-button--icon-only" aria-label=${v("Home")}
|
|
2919
2911
|
@click=${this._handleClick}>
|
|
2920
|
-
<span class="ga-icon">${
|
|
2912
|
+
<span class="ga-icon">${O(Ge)}</span>
|
|
2921
2913
|
</a>
|
|
2922
2914
|
` : r;
|
|
2923
2915
|
}
|
|
@@ -2952,7 +2944,7 @@ var an = class extends e {
|
|
|
2952
2944
|
@click=${this._handleClick}
|
|
2953
2945
|
@mouseenter=${this._onActivate}
|
|
2954
2946
|
@mouseleave=${this._onDeactivate}>
|
|
2955
|
-
<span class="ga-icon">${
|
|
2947
|
+
<span class="ga-icon">${O(Be)}</span>
|
|
2956
2948
|
</button>
|
|
2957
2949
|
<div id="vsn-menu-toggle-tooltip" role="tooltip"
|
|
2958
2950
|
style="position: fixed; inset: unset; margin: 0; padding: 0; border: none; background: transparent; overflow: visible; pointer-events: none; z-index: 9999;"
|
|
@@ -2984,7 +2976,7 @@ var on = class extends e {
|
|
|
2984
2976
|
return n`
|
|
2985
2977
|
<button type="button" class="ga-button ga-button--secondary ga-button--icon-only"
|
|
2986
2978
|
aria-label=${v("Notifications")} @click=${this._handleClick}>
|
|
2987
|
-
<span class="ga-icon">${
|
|
2979
|
+
<span class="ga-icon">${O(e)}</span>
|
|
2988
2980
|
</button>
|
|
2989
2981
|
`;
|
|
2990
2982
|
}
|
|
@@ -3019,12 +3011,12 @@ var X = class extends e {
|
|
|
3019
3011
|
return this.helpUrl && sn(this.helpUrl) ? n`
|
|
3020
3012
|
<a href=${this.helpUrl} target="_blank" rel="noopener noreferrer" class="ga-button ga-button--secondary ga-button--icon-only"
|
|
3021
3013
|
aria-label=${v("Help")}>
|
|
3022
|
-
<span class="ga-icon">${
|
|
3014
|
+
<span class="ga-icon">${O(Ke)}</span>
|
|
3023
3015
|
</a>
|
|
3024
3016
|
` : n`
|
|
3025
3017
|
<button type="button" class="ga-button ga-button--secondary ga-button--icon-only" aria-label=${v("Help")}
|
|
3026
3018
|
@click=${this._handleClick}>
|
|
3027
|
-
<span class="ga-icon">${
|
|
3019
|
+
<span class="ga-icon">${O(Ke)}</span>
|
|
3028
3020
|
</button>
|
|
3029
3021
|
`;
|
|
3030
3022
|
}
|
|
@@ -3037,7 +3029,7 @@ var Z = class extends e {
|
|
|
3037
3029
|
super(), this.modules = [], this.feedback = null, this.showHelp = !1, this.showNotification = !1, this.notificationActive = !1, this.modulesLoading = !1, this.lang = "en", new L(this, () => !0);
|
|
3038
3030
|
}
|
|
3039
3031
|
willUpdate(e) {
|
|
3040
|
-
e.has("lang") &&
|
|
3032
|
+
e.has("lang") && Vt(this.lang).catch(console.error);
|
|
3041
3033
|
}
|
|
3042
3034
|
focusMenuToggle() {
|
|
3043
3035
|
this.renderRoot.querySelector("vsn-menu-toggle")?.focus();
|
|
@@ -3362,6 +3354,9 @@ var $ = class extends e {
|
|
|
3362
3354
|
_onTopBarClick(e) {
|
|
3363
3355
|
this.open && (e.composedPath().some((e) => e.tagName?.toUpperCase() === "VSN-MENU-TOGGLE") || (this.open = !1));
|
|
3364
3356
|
}
|
|
3357
|
+
_onSlotContentClick() {
|
|
3358
|
+
this.open &&= !1;
|
|
3359
|
+
}
|
|
3365
3360
|
render() {
|
|
3366
3361
|
return n`
|
|
3367
3362
|
<vsn-top-bar
|
|
@@ -3398,7 +3393,7 @@ var $ = class extends e {
|
|
|
3398
3393
|
<slot name="side-context-selector" slot="side-context-selector"></slot>
|
|
3399
3394
|
<slot name="nav-footer" slot="nav-footer"></slot>
|
|
3400
3395
|
</vsn-side-bar>
|
|
3401
|
-
<div class="h-full">
|
|
3396
|
+
<div class="h-full" @click=${this._onSlotContentClick}>
|
|
3402
3397
|
<slot></slot>
|
|
3403
3398
|
</div>
|
|
3404
3399
|
</div>
|
|
@@ -3420,4 +3415,4 @@ M([s()], $.prototype, "lang", void 0), M([s({ attribute: !1 })], $.prototype, "t
|
|
|
3420
3415
|
reflect: !0
|
|
3421
3416
|
})], $.prototype, "open", void 0), M([l()], $.prototype, "_resolvedModules", void 0), M([l()], $.prototype, "_modulesLoading", void 0), $ = M([o("vsn-navigation")], $);
|
|
3422
3417
|
//#endregion
|
|
3423
|
-
export {
|
|
3418
|
+
export { ut as SearchError, $ as VSNNavigation, Q as VSNSkipToMain, A as isTreeLeaf, j as isTreeParent };
|