@realtek/core-theme 0.0.90 → 0.0.91

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.js CHANGED
@@ -2097,38 +2097,38 @@ async function yi(e, t, n = "", r = 50, i = 0, a = {}) {
2097
2097
  return a.dataSource && s.set("dataSource", a.dataSource), a.masterName && s.set("masterName", a.masterName), a.groupName && s.set("groupName", a.groupName), g(o, `/filter-dropdown-values?${s}`);
2098
2098
  }
2099
2099
  async function bi(e, t = {}, n = {}, r = {}) {
2100
- let { limit: i = 10, offset: a = 0 } = n, { sort: s = "", sortDir: l = "", scope: u = "" } = r, d = hi(u || t.selectedSource), f = new URLSearchParams();
2101
- f.append("module", e), f.append("limit", String(i)), f.append("offset", String(a)), d && (f.set("scope", d), console.log("[searchModuleData] Adding scope to query:", d)), s && f.set("sort", s), l && f.set("sortDir", l), console.log("[searchModuleData] Final query string:", f.toString()), Object.entries(t).forEach(([e, t]) => {
2100
+ let { limit: i = 10, offset: a = 0 } = n, { sort: o = "", sortDir: s = "", scope: l = "" } = r, u = hi(l || t.selectedSource), d = new URLSearchParams();
2101
+ d.append("module", e), d.append("limit", String(i)), d.append("offset", String(a)), u && (d.set("scope", u), console.log("[searchModuleData] Adding scope to query:", u)), o && d.set("sort", o), s && d.set("sortDir", s), console.log("[searchModuleData] Final query string:", d.toString()), Object.entries(t).forEach(([e, t]) => {
2102
2102
  if (t == null || t === "") return;
2103
2103
  let n = t;
2104
- n = typeof t == "object" ? t.value ?? t.label ?? t.name ?? String(t) : String(t), f.append(e, n);
2104
+ n = typeof t == "object" ? t.value ?? t.label ?? t.name ?? String(t) : String(t), d.append(e, n);
2105
2105
  });
2106
- let p = await c(o, `/module-data-list?${f.toString()}`), m = p?.data ?? p, h = Array.isArray(m) ? m : m?.rows ?? m?.records ?? m?.items ?? m?.list ?? m?.data ?? [], g = _i(p, m, h, d), _ = vi(p, m);
2107
- d && _[d] === void 0 && Number.isFinite(g) && (_[d] = g);
2108
- let v = h.some((e) => [
2106
+ let f = await c("http://localhost:9009/v1", `/module-data-list?${d.toString()}`), p = f?.data ?? f, m = Array.isArray(p) ? p : p?.rows ?? p?.records ?? p?.items ?? p?.list ?? p?.data ?? [], h = _i(f, p, m, u), g = vi(f, p);
2107
+ u && g[u] === void 0 && Number.isFinite(h) && (g[u] = h);
2108
+ let _ = m.some((e) => [
2109
2109
  e?.sourceType,
2110
2110
  e?.profileSource,
2111
2111
  e?.selectedSource,
2112
2112
  e?.customFields?.sourceType,
2113
2113
  e?.customFields?.profileSource
2114
- ].flat().some((e) => String(e ?? "").trim().toLowerCase() === "dice") || !!e?.customFields?.diceProfileData), y = h;
2115
- if (v) try {
2114
+ ].flat().some((e) => String(e ?? "").trim().toLowerCase() === "dice") || !!e?.customFields?.diceProfileData), v = m;
2115
+ if (_) try {
2116
2116
  let { transformDiceResponseToInternalFormat: e } = await Promise.resolve().then(() => $r);
2117
- y = e(p, p)?.data?.data ?? h;
2117
+ v = e(f, f)?.data?.data ?? m;
2118
2118
  } catch (e) {
2119
- console.error("[searchModuleData] Dice transformation failed:", e), y = h.map(Ci);
2119
+ console.error("[searchModuleData] Dice transformation failed:", e), v = m.map(Ci);
2120
2120
  }
2121
- else y = Array.isArray(h) ? h.map(Ci) : [];
2121
+ else v = Array.isArray(m) ? m.map(Ci) : [];
2122
2122
  return {
2123
- rows: y,
2124
- total: Number(g) || 0,
2125
- counts: _,
2126
- tabs: p?.tabs ?? p?.tabList ?? m?.tabs ?? m?.tabList ?? [],
2127
- fields: p?.fields ?? p?.fieldConfig ?? m?.fields ?? m?.fieldConfig ?? [],
2128
- tabField: p?.tabField ?? m?.tabField ?? "",
2129
- actionRules: m?.actionRules ?? [],
2130
- actions: m?.actions ?? [],
2131
- columnActions: m?.columnActions ?? []
2123
+ rows: v,
2124
+ total: Number(h) || 0,
2125
+ counts: g,
2126
+ tabs: f?.tabs ?? f?.tabList ?? p?.tabs ?? p?.tabList ?? [],
2127
+ fields: f?.fields ?? f?.fieldConfig ?? p?.fields ?? p?.fieldConfig ?? [],
2128
+ tabField: f?.tabField ?? p?.tabField ?? "",
2129
+ actionRules: p?.actionRules ?? [],
2130
+ actions: p?.actions ?? [],
2131
+ columnActions: p?.columnActions ?? []
2132
2132
  };
2133
2133
  }
2134
2134
  function xi(e, t) {
@@ -4649,29 +4649,29 @@ async function Bc(e, t = 10, n = 0, r = {}) {
4649
4649
  module: e,
4650
4650
  limit: String(t),
4651
4651
  offset: String(n)
4652
- });
4653
- l.set("scope", i || "internal"), a && l.set("sort", a), s && l.set("sortDir", s);
4654
- let u = Kc(c.filter((e) => e?.field));
4655
- u.length && l.set("filters", JSON.stringify(u));
4656
- let d = await Mc(o, `/module-data-list?${l.toString()}`), f = Vc(d), p = f.some((e) => Wc(e)), m = f.some((e) => Gc(e));
4657
- if (p || m) try {
4658
- let { transformDiceResponseToInternalFormat: e } = await Promise.resolve().then(() => $r), r = e(d, d), a = r?.data?.data ?? [];
4652
+ }), u = String(i ?? "").trim();
4653
+ a && l.set("sort", a), s && l.set("sortDir", s);
4654
+ let d = Kc(c.filter((e) => e?.field));
4655
+ d.length && l.set("filters", JSON.stringify(d));
4656
+ let f = await Mc(o, `/module-data-list?${l.toString()}`), p = Vc(f), m = p.some((e) => Wc(e)), h = p.some((e) => Gc(e));
4657
+ if (m || h) try {
4658
+ let { transformDiceResponseToInternalFormat: e } = await Promise.resolve().then(() => $r), r = e(f, f), i = r?.data?.data ?? [];
4659
4659
  return {
4660
- items: a,
4661
- total: Uc(d, i || "internal") || Uc(r, i || "internal") || a.length,
4660
+ items: i,
4661
+ total: Uc(f, u) || Uc(r, u) || i.length,
4662
4662
  limit: t,
4663
4663
  offset: n,
4664
- tabs: r?.data?.tabs ?? d?.tabs ?? d?.data?.tabs ?? [],
4665
- fields: r?.data?.fields ?? d?.fields ?? d?.data?.fields ?? [],
4666
- tabField: r?.data?.tabField ?? d?.tabField ?? d?.data?.tabField ?? "",
4667
- actionRules: r?.data?.actionRules ?? d?.data?.actionRules ?? [],
4668
- actions: r?.data?.actions ?? d?.data?.actions ?? [],
4669
- columnActions: r?.data?.columnActions ?? d?.data?.columnActions ?? []
4664
+ tabs: r?.data?.tabs ?? f?.tabs ?? f?.data?.tabs ?? [],
4665
+ fields: r?.data?.fields ?? f?.fields ?? f?.data?.fields ?? [],
4666
+ tabField: r?.data?.tabField ?? f?.tabField ?? f?.data?.tabField ?? "",
4667
+ actionRules: r?.data?.actionRules ?? f?.data?.actionRules ?? [],
4668
+ actions: r?.data?.actions ?? f?.data?.actions ?? [],
4669
+ columnActions: r?.data?.columnActions ?? f?.data?.columnActions ?? []
4670
4670
  };
4671
4671
  } catch (e) {
4672
4672
  console.error("[getModuleDataList] Dice transformation failed:", e);
4673
4673
  }
4674
- return d;
4674
+ return f;
4675
4675
  }
4676
4676
  function Vc(e) {
4677
4677
  let t = e?.data ?? e, n = Array.isArray(t) ? t : t?.rows ?? t?.records ?? t?.items ?? t?.list ?? t?.data ?? e?.items ?? e?.records ?? [];