@realtek/core-theme 0.0.324 → 0.0.325
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/dist-lib/index.cjs +1 -1
- package/dist-lib/index.cjs.map +1 -1
- package/dist-lib/index.js +19 -16
- package/dist-lib/index.js.map +1 -1
- package/package.json +1 -1
package/dist-lib/index.js
CHANGED
|
@@ -13140,10 +13140,13 @@ function Pb({ moduleName: e, id: t, customConfigName: n, auxRecords: r, authToke
|
|
|
13140
13140
|
let [P, we] = L({
|
|
13141
13141
|
sourceDefaultTab: l,
|
|
13142
13142
|
selectedTab: l
|
|
13143
|
-
}), Te = P.sourceDefaultTab === l ? P.selectedTab : l, Ee = ge.some((e) => e.key === Te) ? Te : ge[0]?.key, De = (
|
|
13143
|
+
}), Te = P.sourceDefaultTab === l ? P.selectedTab : l, Ee = ge.some((e) => e.key === Te) ? Te : ge[0]?.key, De = new Set(ge.map((e) => kb(e.key))), Oe = (e) => {
|
|
13144
|
+
let t = e.allowedTabs ?? [];
|
|
13145
|
+
return !t.length || t.some((e) => kb(e) === kb(Ee)) || ye && t.some((e) => kb(e) === kb(ye)) ? !0 : !t.some((e) => De.has(kb(e))) && !ye;
|
|
13146
|
+
}, ke = Se.filter((e) => e.detailPlacement === "primary" && Ce(e) && Oe(e)), Ae = Se.filter((e) => e.detailPlacement !== "primary" && Ce(e) && Oe(e));
|
|
13144
13147
|
if (!ne) return null;
|
|
13145
|
-
let
|
|
13146
|
-
let r = [...
|
|
13148
|
+
let je = (n) => {
|
|
13149
|
+
let r = [...ke, ...Ae].find((e) => e.key === n);
|
|
13147
13150
|
if (r?.actionType === "document" && r.documentField) {
|
|
13148
13151
|
let n = Nb(m, r.documentField);
|
|
13149
13152
|
if (n.length) {
|
|
@@ -13211,7 +13214,7 @@ function Pb({ moduleName: e, id: t, customConfigName: n, auxRecords: r, authToke
|
|
|
13211
13214
|
id: t,
|
|
13212
13215
|
action: r
|
|
13213
13216
|
});
|
|
13214
|
-
},
|
|
13217
|
+
}, Me = (n) => {
|
|
13215
13218
|
we({
|
|
13216
13219
|
sourceDefaultTab: l,
|
|
13217
13220
|
selectedTab: n
|
|
@@ -13219,7 +13222,7 @@ function Pb({ moduleName: e, id: t, customConfigName: n, auxRecords: r, authToke
|
|
|
13219
13222
|
moduleName: e,
|
|
13220
13223
|
id: t
|
|
13221
13224
|
});
|
|
13222
|
-
},
|
|
13225
|
+
}, Ne = Ae.map((e) => {
|
|
13223
13226
|
let t = hd(e, he, ye ?? void 0), n = !t && jb(e, he, y, ye ?? void 0);
|
|
13224
13227
|
return {
|
|
13225
13228
|
key: e.key,
|
|
@@ -13227,20 +13230,20 @@ function Pb({ moduleName: e, id: t, customConfigName: n, auxRecords: r, authToke
|
|
|
13227
13230
|
danger: e.danger,
|
|
13228
13231
|
disabled: !!t || !!n,
|
|
13229
13232
|
title: n || void 0,
|
|
13230
|
-
onClick: t || n ? void 0 : () =>
|
|
13233
|
+
onClick: t || n ? void 0 : () => je(e.key)
|
|
13231
13234
|
};
|
|
13232
|
-
}),
|
|
13233
|
-
if (
|
|
13235
|
+
}), Pe = ly(k)?.header;
|
|
13236
|
+
if (Pe?.variant === "finance") {
|
|
13234
13237
|
let t = (e) => e == null ? "" : Array.isArray(e) ? e.map(t).filter(Boolean).join(", ") : String(typeof e == "object" ? e.value ?? e.label ?? e.name ?? e.id ?? "" : e), n = {};
|
|
13235
13238
|
for (let e of m ?? []) for (let t of e.fields ?? []) t?.field != null && (n[t.field] = t.value);
|
|
13236
|
-
let r = (e) => t(n[e]), i = r(
|
|
13239
|
+
let r = (e) => t(n[e]), i = r(Pe.statusField), a = (Pe.chips ?? []).map((e) => ({
|
|
13237
13240
|
key: e.field,
|
|
13238
13241
|
icon: e.icon ? Sb[e.icon] : void 0,
|
|
13239
13242
|
label: e.label,
|
|
13240
13243
|
value: r(e.field) || "—",
|
|
13241
13244
|
badge: e.badgeField && r(e.badgeField) || void 0,
|
|
13242
13245
|
tooltip: e.tooltip
|
|
13243
|
-
})), o = c ? [] :
|
|
13246
|
+
})), o = c ? [] : ke.map((e) => {
|
|
13244
13247
|
let t = hd(e, he, ye ?? void 0), n = !t && jb(e, he, y, ye ?? void 0);
|
|
13245
13248
|
return {
|
|
13246
13249
|
key: e.key,
|
|
@@ -13249,7 +13252,7 @@ function Pb({ moduleName: e, id: t, customConfigName: n, auxRecords: r, authToke
|
|
|
13249
13252
|
enabled: !t && !n,
|
|
13250
13253
|
variant: e.tone,
|
|
13251
13254
|
disabledReason: n || void 0,
|
|
13252
|
-
onClick: t || n ? void 0 : () =>
|
|
13255
|
+
onClick: t || n ? void 0 : () => je(e.key)
|
|
13253
13256
|
};
|
|
13254
13257
|
}), s = i ? Iy(e, i) : [];
|
|
13255
13258
|
return /* @__PURE__ */ X("div", {
|
|
@@ -13385,23 +13388,23 @@ function Pb({ moduleName: e, id: t, customConfigName: n, auxRecords: r, authToke
|
|
|
13385
13388
|
children: [
|
|
13386
13389
|
/* @__PURE__ */ X("div", {
|
|
13387
13390
|
className: "znx-dh-actions",
|
|
13388
|
-
children: [
|
|
13391
|
+
children: [ke.map((e) => {
|
|
13389
13392
|
let t = hd(e, he, ye ?? void 0), n = !t && jb(e, he, y, ye ?? void 0), r = /* @__PURE__ */ Y(R, {
|
|
13390
13393
|
type: "text",
|
|
13391
13394
|
disabled: !!t || !!n,
|
|
13392
13395
|
className: `znx-dh-btn znx-dh-btn--${t ? t.tone : e.tone ?? "primary"}${t ? " znx-dh-btn--done" : ""}`,
|
|
13393
13396
|
icon: t ? /* @__PURE__ */ Y(Sa, {}) : e.icon ? Sb[e.icon] : void 0,
|
|
13394
|
-
onClick: t || n ? void 0 : () =>
|
|
13397
|
+
onClick: t || n ? void 0 : () => je(e.key),
|
|
13395
13398
|
children: t ? t.label : e.label
|
|
13396
13399
|
}, e.key);
|
|
13397
13400
|
return n ? /* @__PURE__ */ Y(K, {
|
|
13398
13401
|
title: n,
|
|
13399
13402
|
children: /* @__PURE__ */ Y("span", { children: r })
|
|
13400
13403
|
}, e.key) : r;
|
|
13401
|
-
}),
|
|
13404
|
+
}), Ae.length > 0 && /* @__PURE__ */ Y(Pi, {
|
|
13402
13405
|
trigger: ["click"],
|
|
13403
13406
|
placement: "bottomRight",
|
|
13404
|
-
menu: { items:
|
|
13407
|
+
menu: { items: Ne },
|
|
13405
13408
|
children: /* @__PURE__ */ Y(R, {
|
|
13406
13409
|
type: "text",
|
|
13407
13410
|
className: "znx-dh-more",
|
|
@@ -13433,7 +13436,7 @@ function Pb({ moduleName: e, id: t, customConfigName: n, auxRecords: r, authToke
|
|
|
13433
13436
|
children: ge.map((e) => /* @__PURE__ */ Y("button", {
|
|
13434
13437
|
type: "button",
|
|
13435
13438
|
className: `znx-dh-tab${Ee === e.key ? " is-active" : ""}`,
|
|
13436
|
-
onClick: () =>
|
|
13439
|
+
onClick: () => Me(e.key),
|
|
13437
13440
|
children: e.label
|
|
13438
13441
|
}, e.key))
|
|
13439
13442
|
})]
|