@luigi-project/core-modular 0.0.18-dev.202610130059 → 0.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/luigi.js +54 -79
- package/luigi.js.map +1 -1
- package/package.json +1 -1
- package/services/navigation.service.d.ts +1 -2
- package/types/connector.d.ts +8 -0
- package/types/navigation.d.ts +0 -3
package/luigi.js
CHANGED
|
@@ -7953,23 +7953,23 @@ var fi = {
|
|
|
7953
7953
|
}), n;
|
|
7954
7954
|
}
|
|
7955
7955
|
async buildNavItems(e, t, n) {
|
|
7956
|
-
let r = {}, i = [], a = []
|
|
7957
|
-
for (let
|
|
7958
|
-
if (!H.isNodeAccessPermitted(
|
|
7959
|
-
let e =
|
|
7960
|
-
if (
|
|
7961
|
-
let
|
|
7962
|
-
t?.context && (
|
|
7963
|
-
...
|
|
7956
|
+
let r = {}, i = [], a = [];
|
|
7957
|
+
for (let o of e) {
|
|
7958
|
+
if (!H.isNodeAccessPermitted(o, this.getParentNode(n.selectedNode, n), n?.selectedNode?.context || {}, this.luigi)) continue;
|
|
7959
|
+
let e = o.externalLink ? { ...o.externalLink } : void 0, s = U.getNodeHref(o, n?.pathParams, this.luigi);
|
|
7960
|
+
if (e?.url) {
|
|
7961
|
+
let r = { ...o };
|
|
7962
|
+
t?.context && (r.context = {
|
|
7963
|
+
...r.context,
|
|
7964
7964
|
...t.context
|
|
7965
7965
|
});
|
|
7966
|
-
let
|
|
7967
|
-
...
|
|
7968
|
-
viewUrl:
|
|
7969
|
-
},
|
|
7970
|
-
|
|
7966
|
+
let i = {
|
|
7967
|
+
...r,
|
|
7968
|
+
viewUrl: e.url
|
|
7969
|
+
}, a = n?.pathParams ? n.pathParams : {};
|
|
7970
|
+
e.url = U.substituteViewUrl(i, a, void 0, this.luigi), s = e.url;
|
|
7971
7971
|
}
|
|
7972
|
-
if (
|
|
7972
|
+
if (o.statusBadge) {
|
|
7973
7973
|
let e = {
|
|
7974
7974
|
critical: "Critical",
|
|
7975
7975
|
informative: "Information",
|
|
@@ -7977,71 +7977,49 @@ var fi = {
|
|
|
7977
7977
|
neutral: "Neutral",
|
|
7978
7978
|
positive: "Positive"
|
|
7979
7979
|
};
|
|
7980
|
-
|
|
7981
|
-
}
|
|
7982
|
-
let
|
|
7983
|
-
if (
|
|
7984
|
-
let n =
|
|
7985
|
-
|
|
7986
|
-
|
|
7987
|
-
|
|
7988
|
-
|
|
7989
|
-
|
|
7990
|
-
|
|
7991
|
-
|
|
7992
|
-
|
|
7993
|
-
|
|
7994
|
-
|
|
7995
|
-
|
|
7996
|
-
|
|
7997
|
-
|
|
7998
|
-
|
|
7999
|
-
|
|
8000
|
-
|
|
8001
|
-
|
|
8002
|
-
o.badgeCounter.count = () => Number(e + u);
|
|
8003
|
-
} else o.badgeCounter = {
|
|
8004
|
-
count: () => Number(u),
|
|
8005
|
-
label: ""
|
|
8006
|
-
};
|
|
8007
|
-
o.category?.nodes?.push({
|
|
8008
|
-
altText: s.altText,
|
|
8009
|
-
externalLink: c,
|
|
8010
|
-
href: l,
|
|
8011
|
-
icon: s.icon,
|
|
8012
|
-
label: s.label ? U.resolveNodeLabel(s, this.luigi) : void 0,
|
|
8013
|
-
node: s,
|
|
8014
|
-
selected: s === t,
|
|
8015
|
-
tooltip: s.label ? this.resolveTooltipText(s, s.label) : void 0
|
|
7980
|
+
o.statusBadge.type = e[o.statusBadge.type] || "Neutral";
|
|
7981
|
+
}
|
|
7982
|
+
let c = o.category && (typeof o.category == "string" || o.category.id || o.category.label);
|
|
7983
|
+
if (c) {
|
|
7984
|
+
let n = o.category.id || o.category.label || o.category, a = this.luigi.i18n().getTranslation(o.category.label || o.category.id || o.category), c = r[n];
|
|
7985
|
+
c || (c = { category: {
|
|
7986
|
+
altText: o.category.altText || "",
|
|
7987
|
+
icon: o.category.icon,
|
|
7988
|
+
id: n,
|
|
7989
|
+
label: a,
|
|
7990
|
+
nodes: [],
|
|
7991
|
+
tooltip: this.resolveTooltipText(o.category, a),
|
|
7992
|
+
navigateOnClick: o.category.navigateOnClick ?? !1
|
|
7993
|
+
} }, r[n] = c, i.push(c)), c.category?.nodes?.push({
|
|
7994
|
+
altText: o.altText,
|
|
7995
|
+
externalLink: e,
|
|
7996
|
+
href: s,
|
|
7997
|
+
icon: o.icon,
|
|
7998
|
+
label: o.label ? U.resolveNodeLabel(o, this.luigi) : void 0,
|
|
7999
|
+
node: o,
|
|
8000
|
+
selected: o === t,
|
|
8001
|
+
tooltip: o.label ? this.resolveTooltipText(o, o.label) : void 0
|
|
8016
8002
|
});
|
|
8017
8003
|
} else {
|
|
8018
|
-
let
|
|
8019
|
-
altText:
|
|
8020
|
-
badgeCounter:
|
|
8021
|
-
externalLink:
|
|
8022
|
-
href:
|
|
8023
|
-
icon:
|
|
8024
|
-
label:
|
|
8025
|
-
node:
|
|
8026
|
-
selected:
|
|
8027
|
-
tooltip:
|
|
8004
|
+
let n = {
|
|
8005
|
+
altText: o.altText,
|
|
8006
|
+
badgeCounter: o.badgeCounter,
|
|
8007
|
+
externalLink: e,
|
|
8008
|
+
href: s,
|
|
8009
|
+
icon: o.icon,
|
|
8010
|
+
label: o.label ? U.resolveNodeLabel(o, this.luigi) : void 0,
|
|
8011
|
+
node: o,
|
|
8012
|
+
selected: o === t,
|
|
8013
|
+
tooltip: o.label ? this.resolveTooltipText(o, o.label) : void 0
|
|
8028
8014
|
};
|
|
8029
|
-
|
|
8015
|
+
o.category && !c ? a.push(n) : i.push(n);
|
|
8030
8016
|
}
|
|
8031
|
-
u && o.push(u);
|
|
8032
8017
|
}
|
|
8033
|
-
let s = o?.length ? o.reduce((e, t) => e + t) : 0, c = {
|
|
8034
|
-
count: () => s,
|
|
8035
|
-
label: ""
|
|
8036
|
-
};
|
|
8037
8018
|
return i.unshift(...a), i.forEach((e) => {
|
|
8038
8019
|
if (!e.category?.navigateOnClick || !e.category.nodes?.length) return;
|
|
8039
8020
|
let t = e.category.navigateOnClick, n = t === !0 ? e.category.nodes.find((e) => e.node?.category?.navigateOnClick) : e.category.nodes.find((e) => e.node?.pathSegment === t);
|
|
8040
8021
|
n && (n.navigateOnClick = !0);
|
|
8041
|
-
}), {
|
|
8042
|
-
items: i,
|
|
8043
|
-
totalBadgeNode: c
|
|
8044
|
-
};
|
|
8022
|
+
}), { items: i };
|
|
8045
8023
|
}
|
|
8046
8024
|
async getCurrentNode(e) {
|
|
8047
8025
|
let t = await this.getPathData(e), n = t.selectedNode;
|
|
@@ -8094,13 +8072,12 @@ var fi = {
|
|
|
8094
8072
|
(s?.keepSelectedForChildren || s?.tabNav) && (c = s, o.pop(), s = [...o].pop());
|
|
8095
8073
|
let l, u = c;
|
|
8096
8074
|
c ? n.rootNodes.includes(c) ? (l = c, u = void 0) : l = c.tabNav || c.keepSelectedForChildren ? s : [...i].pop() : (l = [...i].pop(), u = void 0);
|
|
8097
|
-
let d = await this.getChildren(l, l?.context || {}) || []
|
|
8098
|
-
return r =
|
|
8075
|
+
let d = await this.getChildren(l, l?.context || {}) || [];
|
|
8076
|
+
return r = (await this.buildNavItems(d, u, n)).items, r = this.applyNavGroups(r), {
|
|
8099
8077
|
selectedNode: c || {},
|
|
8100
8078
|
items: r,
|
|
8101
8079
|
basePath: a.replace(/\/\/+/g, "/"),
|
|
8102
8080
|
sideNavFooterText: this.luigi.getConfig().settings?.sideNavFooterText,
|
|
8103
|
-
totalBadgeNode: f.totalBadgeNode,
|
|
8104
8081
|
navClick: (e) => e.node ? this.navItemClick(e.node, n) : Promise.resolve()
|
|
8105
8082
|
};
|
|
8106
8083
|
}
|
|
@@ -8202,7 +8179,6 @@ var fi = {
|
|
|
8202
8179
|
logo: n.settings?.header?.logo,
|
|
8203
8180
|
logoAltText: b,
|
|
8204
8181
|
topNodes: v.items,
|
|
8205
|
-
totalBadgeNode: v.totalBadgeNode,
|
|
8206
8182
|
contextSwitcher: g,
|
|
8207
8183
|
productSwitcher: _,
|
|
8208
8184
|
profile: this.luigi.auth().isAuthorizationEnabled() || n.navigation?.profile ? f : void 0,
|
|
@@ -8242,19 +8218,18 @@ var fi = {
|
|
|
8242
8218
|
});
|
|
8243
8219
|
let c = i ? this.getTruncatedChildren(i.children ?? []) : this.getTruncatedChildren(r.children ?? []);
|
|
8244
8220
|
if (o?.hideTabNavAutomatically && c.length <= 1) return {};
|
|
8245
|
-
let l =
|
|
8221
|
+
let l = {
|
|
8246
8222
|
selectedNode: r,
|
|
8247
|
-
items:
|
|
8248
|
-
totalBadgeNode: l.totalBadgeNode,
|
|
8223
|
+
items: (await this.buildNavItems(c, r, n)).items,
|
|
8249
8224
|
basePath: s.replace(/\/\/+/g, "/"),
|
|
8250
8225
|
overflowLabel: this.luigi.i18n().getTranslation("luigi.navigation.tabNav.more"),
|
|
8251
8226
|
navClick: (e) => e.node ? this.navItemClick(e.node, n) : Promise.resolve()
|
|
8252
8227
|
};
|
|
8253
|
-
return o?.showAsTabHeader && a.webcomponent && a.viewUrl && (
|
|
8228
|
+
return o?.showAsTabHeader && a.webcomponent && a.viewUrl && (l.headerNode = {
|
|
8254
8229
|
viewUrl: a.viewUrl,
|
|
8255
8230
|
context: n.context || a.context,
|
|
8256
8231
|
webcomponent: a.webcomponent
|
|
8257
|
-
}),
|
|
8232
|
+
}), l;
|
|
8258
8233
|
}
|
|
8259
8234
|
getTabNavConfig(e) {
|
|
8260
8235
|
if (e.tabNav && typeof e.tabNav == "object") return e.tabNav;
|