yaml-admin-front 0.0.100 → 0.0.102
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/index.cjs.js +147 -147
- package/dist/index.es.js +34 -27
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -86770,33 +86770,39 @@ const XC = /* @__PURE__ */ yn(FMe), $Me = typeof XC == "object" ? XC.default : X
|
|
|
86770
86770
|
}
|
|
86771
86771
|
) });
|
|
86772
86772
|
}, VMe = ({ component: t, custom: e, ...r }) => {
|
|
86773
|
-
const { yml: n } = Vn(), [a, i] = Xe({})
|
|
86773
|
+
const { yml: n } = Vn(), [a, i] = Xe({}), o = $e(() => {
|
|
86774
|
+
const g = Array.isArray(t.sort) ? t.sort[0] : null;
|
|
86775
|
+
return g?.name ? {
|
|
86776
|
+
field: g.name,
|
|
86777
|
+
order: g.desc ? "DESC" : "ASC"
|
|
86778
|
+
} : { field: "id", order: "DESC" };
|
|
86779
|
+
}, [t.sort]);
|
|
86774
86780
|
Te(() => {
|
|
86775
|
-
const
|
|
86776
|
-
t.filter && t.filter.forEach((
|
|
86777
|
-
let
|
|
86778
|
-
if (
|
|
86779
|
-
if (typeof
|
|
86780
|
-
const [
|
|
86781
|
-
|
|
86782
|
-
} else typeof
|
|
86783
|
-
}), i(
|
|
86781
|
+
const g = {};
|
|
86782
|
+
t.filter && t.filter.forEach((v) => {
|
|
86783
|
+
let m = v.value;
|
|
86784
|
+
if (m != null)
|
|
86785
|
+
if (typeof v.value == "string" && (v.value.includes("$lte ") || v.value.includes("$gte ") || v.value.includes("$lt ") || v.value.includes("$gt "))) {
|
|
86786
|
+
const [y, b] = v.value.split(" ");
|
|
86787
|
+
g[v.name] = y + " " + b;
|
|
86788
|
+
} else typeof v.value == "string" && m.startsWith("$") && (m = localStorage.getItem(m.substring(1))), g[v.name] = m;
|
|
86789
|
+
}), i(g);
|
|
86784
86790
|
}, [t.filter]);
|
|
86785
|
-
const { data:
|
|
86791
|
+
const { data: l, total: u, isLoading: c, error: d } = rT(
|
|
86786
86792
|
t.entity,
|
|
86787
86793
|
{
|
|
86788
86794
|
pagination: { page: 1, perPage: t.limit || 10 },
|
|
86789
|
-
sort:
|
|
86795
|
+
sort: o,
|
|
86790
86796
|
filter: a
|
|
86791
86797
|
},
|
|
86792
86798
|
{ enabled: Object.keys(a).length > 0 || !t.filter }
|
|
86793
|
-
),
|
|
86794
|
-
data:
|
|
86795
|
-
isLoading:
|
|
86796
|
-
total:
|
|
86799
|
+
), f = $e(() => ({
|
|
86800
|
+
data: l,
|
|
86801
|
+
isLoading: c,
|
|
86802
|
+
total: u,
|
|
86797
86803
|
page: 1,
|
|
86798
86804
|
perPage: t.limit || 10,
|
|
86799
|
-
sort:
|
|
86805
|
+
sort: o,
|
|
86800
86806
|
filterValues: a,
|
|
86801
86807
|
setSort: () => {
|
|
86802
86808
|
},
|
|
@@ -86814,8 +86820,8 @@ const XC = /* @__PURE__ */ yn(FMe), $Me = typeof XC == "object" ? XC.default : X
|
|
|
86814
86820
|
},
|
|
86815
86821
|
onUnselectItems: () => {
|
|
86816
86822
|
}
|
|
86817
|
-
}), [
|
|
86818
|
-
if (
|
|
86823
|
+
}), [l, c, u, o, a, t.entity, t.limit]);
|
|
86824
|
+
if (c)
|
|
86819
86825
|
return /* @__PURE__ */ L.jsx(nn, { sx: { width: "100%", height: t.height || 300 }, children: /* @__PURE__ */ L.jsx(
|
|
86820
86826
|
vA,
|
|
86821
86827
|
{
|
|
@@ -86825,17 +86831,17 @@ const XC = /* @__PURE__ */ yn(FMe), $Me = typeof XC == "object" ? XC.default : X
|
|
|
86825
86831
|
sx: { borderRadius: 2, bgcolor: "rgba(0,0,0,0.04)" }
|
|
86826
86832
|
}
|
|
86827
86833
|
) });
|
|
86828
|
-
if (
|
|
86834
|
+
if (d)
|
|
86829
86835
|
return /* @__PURE__ */ L.jsx(Ot, { color: "error", children: "Error loading data" });
|
|
86830
|
-
if (!
|
|
86836
|
+
if (!l || !n?.entity?.[t.entity])
|
|
86831
86837
|
return null;
|
|
86832
|
-
const
|
|
86833
|
-
return /* @__PURE__ */ L.jsx(Es, { value: t.entity, children: /* @__PURE__ */ L.jsx(pT, { value:
|
|
86834
|
-
const
|
|
86835
|
-
return
|
|
86836
|
-
field:
|
|
86838
|
+
const h = n.entity[t.entity];
|
|
86839
|
+
return /* @__PURE__ */ L.jsx(Es, { value: t.entity, children: /* @__PURE__ */ L.jsx(pT, { value: f, children: /* @__PURE__ */ L.jsx(nn, { sx: { width: "100%", overflow: "auto" }, children: /* @__PURE__ */ L.jsx(jb, { bulkActionButtons: !1, rowClick: !1, empty: /* @__PURE__ */ L.jsx(nn, { sx: { p: 2 }, children: "No data" }), children: t.fields.map((g, v) => {
|
|
86840
|
+
const m = typeof g == "string" ? g : g.name, y = h.fields.find((b) => b.name === m);
|
|
86841
|
+
return y ? Xu({
|
|
86842
|
+
field: y,
|
|
86837
86843
|
isList: !0,
|
|
86838
|
-
crud_field: typeof
|
|
86844
|
+
crud_field: typeof g == "object" ? g : { name: m }
|
|
86839
86845
|
}) : null;
|
|
86840
86846
|
}) }) }) }) });
|
|
86841
86847
|
}, GC = [
|
|
@@ -87027,6 +87033,7 @@ const XC = /* @__PURE__ */ yn(FMe), $Me = typeof XC == "object" ? XC.default : X
|
|
|
87027
87033
|
) }) });
|
|
87028
87034
|
};
|
|
87029
87035
|
export {
|
|
87036
|
+
wke as ActionPopup,
|
|
87030
87037
|
KY as AdminContext,
|
|
87031
87038
|
jOe as AdminProvider,
|
|
87032
87039
|
Q5 as AppBar,
|