@materialui-reactjs/admin 1.0.4 → 1.0.6
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/chunks/{Common-C_ZhT4L6.js → Common-BURf0rBN.js} +34 -29
- package/dist/chunks/{HeaderUpdate-lrSYWsKp.js → HeaderUpdate-DuS-gHNR.js} +2 -2
- package/dist/chunks/{UDragFile-CAiSfTsp.js → UDragFile-BnUR3riq.js} +1 -1
- package/dist/chunks/{Validator-DjZz2bJs.js → Validator-CXYkI7vJ.js} +62 -59
- package/dist/chunks/{form-C8gzkYMW.js → form-CPkpL5eA.js} +177 -131
- package/dist/chunks/{meta-k8MmuQjS.js → meta-4qPWijBT.js} +13 -13
- package/dist/chunks/{single-DyPwG6ZR.js → single-CRF61o_U.js} +210 -210
- package/dist/chunks/{top-navbar-FBw88y_o.js → top-navbar-Bob0gMUh.js} +1 -1
- package/dist/components/form/DateTimeInput.d.ts +2 -1
- package/dist/components/form/UFile.d.ts +1 -1
- package/dist/components/form/UFiles.d.ts +1 -0
- package/dist/components/form/index.js +3 -3
- package/dist/components/meta/index.js +2 -2
- package/dist/components/single/Detail.d.ts +1 -0
- package/dist/components/single/Fields.d.ts +1 -0
- package/dist/components/single/Update.d.ts +2 -1
- package/dist/components/single/index.js +1 -1
- package/dist/components/top-navbar/index.js +1 -1
- package/dist/hook/detail.d.ts +5 -1
- package/dist/hook/detail.js +7 -7
- package/dist/hook/fields.d.ts +5 -1
- package/dist/hook/fields.js +7 -7
- package/dist/hook/index.d.ts +1 -1
- package/dist/hook/index.js +2 -2
- package/dist/hook/update.d.ts +12 -3
- package/dist/hook/update.js +25 -22
- package/dist/index.js +11 -11
- package/dist/utils/Common.d.ts +4 -0
- package/dist/utils/index.js +28 -23
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as e } from "./Env-DRXhvUcb.js";
|
|
2
|
-
import { _ as t, a as n, d as r, f as i, h as a, l as o, m as s, n as c, p as l, r as u, s as d, u as f } from "./Common-
|
|
2
|
+
import { _ as t, a as n, d as r, f as i, h as a, l as o, m as s, n as c, p as l, r as u, s as d, u as f } from "./Common-BURf0rBN.js";
|
|
3
3
|
import { t as p } from "./SortableItem-B4-Zsso3.js";
|
|
4
|
-
import {
|
|
4
|
+
import { i as m, t as h } from "./Validator-CXYkI7vJ.js";
|
|
5
5
|
import g, { createContext as _, memo as v, useCallback as y, useContext as b, useEffect as x, useMemo as ee, useReducer as te, useRef as S, useState as C } from "react";
|
|
6
6
|
import w, { components as T } from "react-select";
|
|
7
7
|
import { DragDropContext as ne, Draggable as E, Droppable as re } from "@hello-pangea/dnd";
|
|
@@ -44674,9 +44674,9 @@ var { API_URL: GN } = await e(), KN = ({ label: e, name: t, cpnClass: r = "", re
|
|
|
44674
44674
|
return r?.(o), o;
|
|
44675
44675
|
});
|
|
44676
44676
|
}, d = (e, t) => {
|
|
44677
|
-
let n = m(e
|
|
44677
|
+
let n = m(e), i = a.map((e, r) => r === t ? {
|
|
44678
44678
|
...e,
|
|
44679
|
-
[n
|
|
44679
|
+
[n.name]: n.value
|
|
44680
44680
|
} : e);
|
|
44681
44681
|
o(i), r?.(i);
|
|
44682
44682
|
}, h = (t, n, r) => {
|
|
@@ -44970,31 +44970,41 @@ var { API_URL: GN } = await e(), KN = ({ label: e, name: t, cpnClass: r = "", re
|
|
|
44970
44970
|
})
|
|
44971
44971
|
})
|
|
44972
44972
|
})
|
|
44973
|
-
}), ZN = { textField: { className: "datepicker-custom" } }, QN = ({ label: e, name: t, value: n = "",
|
|
44974
|
-
let
|
|
44973
|
+
}), ZN = { textField: { className: "datepicker-custom" } }, QN = ({ label: e, name: t, value: n = "", debug: r = !1, defaultValue: i = "", cpnClass: a = "", required: o, onChange: s, ...c }) => {
|
|
44974
|
+
let l = S(!1);
|
|
44975
44975
|
x(() => {
|
|
44976
|
-
if (
|
|
44977
|
-
|
|
44978
|
-
|
|
44979
|
-
|
|
44976
|
+
if (r && console.log("DateTimeInput mounted", {
|
|
44977
|
+
value: n,
|
|
44978
|
+
defaultValue: i,
|
|
44979
|
+
onChange: !!s
|
|
44980
|
+
}), !l.current && !n && i && s) {
|
|
44981
|
+
let e = u(i);
|
|
44982
|
+
e && (l.current = !0, d(e));
|
|
44980
44983
|
}
|
|
44981
|
-
}, [
|
|
44982
|
-
|
|
44984
|
+
}, [
|
|
44985
|
+
n,
|
|
44986
|
+
i,
|
|
44987
|
+
s
|
|
44988
|
+
]);
|
|
44989
|
+
let u = (e) => {
|
|
44983
44990
|
if (!e) return null;
|
|
44984
44991
|
if (e instanceof Date) return isNaN(e.getTime()) ? null : e;
|
|
44985
44992
|
let t = new Date(e);
|
|
44986
44993
|
return isNaN(t.getTime()) ? null : t;
|
|
44987
|
-
},
|
|
44988
|
-
|
|
44994
|
+
}, d = (e) => {
|
|
44995
|
+
r && console.log("handleChange", {
|
|
44996
|
+
name: t,
|
|
44997
|
+
date: e
|
|
44998
|
+
}), !(!s || !e || isNaN(e.getTime())) && s({
|
|
44989
44999
|
target: {
|
|
44990
45000
|
name: t,
|
|
44991
45001
|
value: ie(e, "yyyy-MM-dd HH:mm:ss")
|
|
44992
45002
|
},
|
|
44993
45003
|
preventDefault: () => {}
|
|
44994
45004
|
});
|
|
44995
|
-
};
|
|
45005
|
+
}, f = u(n) ?? u(i);
|
|
44996
45006
|
return /* @__PURE__ */ O("div", {
|
|
44997
|
-
className: "form-group " + (
|
|
45007
|
+
className: "form-group " + (a ?? ""),
|
|
44998
45008
|
children: /* @__PURE__ */ O("div", {
|
|
44999
45009
|
className: "input-group input-group-outline",
|
|
45000
45010
|
children: /* @__PURE__ */ O(Me, {
|
|
@@ -45002,11 +45012,11 @@ var { API_URL: GN } = await e(), KN = ({ label: e, name: t, cpnClass: r = "", re
|
|
|
45002
45012
|
adapterLocale: Pe,
|
|
45003
45013
|
children: /* @__PURE__ */ O(Fe, {
|
|
45004
45014
|
slotProps: ZN,
|
|
45005
|
-
label: e + (
|
|
45015
|
+
label: e + (o ? " *" : ""),
|
|
45006
45016
|
name: t,
|
|
45007
|
-
value:
|
|
45008
|
-
onChange:
|
|
45009
|
-
...
|
|
45017
|
+
value: f,
|
|
45018
|
+
onChange: d,
|
|
45019
|
+
...c
|
|
45010
45020
|
})
|
|
45011
45021
|
})
|
|
45012
45022
|
})
|
|
@@ -45540,13 +45550,39 @@ var { API_URL: GN } = await e(), KN = ({ label: e, name: t, cpnClass: r = "", re
|
|
|
45540
45550
|
]
|
|
45541
45551
|
})
|
|
45542
45552
|
}) });
|
|
45543
|
-
}, sP = ({ label: e, name: t, cpnClass: n = "", required: r = !1,
|
|
45544
|
-
let
|
|
45545
|
-
|
|
45546
|
-
|
|
45547
|
-
}, [
|
|
45548
|
-
|
|
45549
|
-
|
|
45553
|
+
}, sP = ({ label: e, name: t, cpnClass: n = "", required: r = !1, disabled: a, readonly: o, value: s = "", onChange: l, isEdit: u = !1, ext: d = ".xlsx, .xls, .docx, .doc, .pdf", df: f = "" }) => {
|
|
45554
|
+
let p = S(null), m = S(null), [h, g] = C(""), [_, v] = C("");
|
|
45555
|
+
x(() => {
|
|
45556
|
+
v((s ?? "").split("/").pop() ?? ""), g(i(s, f));
|
|
45557
|
+
}, [s, f]), x(() => () => {
|
|
45558
|
+
m.current &&= (URL.revokeObjectURL(m.current), null);
|
|
45559
|
+
}, []);
|
|
45560
|
+
let y = (e) => {
|
|
45561
|
+
e.preventDefault();
|
|
45562
|
+
let t = /\.(pdf|docx|doc|xlsx|xls)$/i, n = e.target.files;
|
|
45563
|
+
if (!n || n.length === 0) return;
|
|
45564
|
+
let r = e.target.getAttribute("accept"), i = r ? RegExp(".(" + r.replace(/[., ]/g, (e) => e === "," ? "|" : "") + ")$", "i") : t;
|
|
45565
|
+
c(n, 10, i).then(() => {
|
|
45566
|
+
let t = n[0];
|
|
45567
|
+
if (!t) return;
|
|
45568
|
+
m.current && URL.revokeObjectURL(m.current);
|
|
45569
|
+
let r = URL.createObjectURL(t);
|
|
45570
|
+
m.current = r, g(r), v(t.name), l?.(e);
|
|
45571
|
+
}).catch((t) => {
|
|
45572
|
+
console.error("Upload file validation failed:", t), e.target.value = "";
|
|
45573
|
+
});
|
|
45574
|
+
}, b = (e) => {
|
|
45575
|
+
e.preventDefault(), m.current &&= (URL.revokeObjectURL(m.current), null), g(""), v(""), p.current && (p.current.value = ""), l && l({
|
|
45576
|
+
target: {
|
|
45577
|
+
name: t,
|
|
45578
|
+
type: "input",
|
|
45579
|
+
value: ""
|
|
45580
|
+
},
|
|
45581
|
+
preventDefault: () => {}
|
|
45582
|
+
});
|
|
45583
|
+
}, ee = u && !a && !o;
|
|
45584
|
+
return /* @__PURE__ */ k("div", {
|
|
45585
|
+
className: `card ${n}`,
|
|
45550
45586
|
children: [
|
|
45551
45587
|
/* @__PURE__ */ O("div", {
|
|
45552
45588
|
className: "card-header",
|
|
@@ -45557,28 +45593,17 @@ var { API_URL: GN } = await e(), KN = ({ label: e, name: t, cpnClass: r = "", re
|
|
|
45557
45593
|
children: [/* @__PURE__ */ O("h3", {
|
|
45558
45594
|
className: "card-title",
|
|
45559
45595
|
children: e
|
|
45560
|
-
}),
|
|
45596
|
+
}), ee && /* @__PURE__ */ k("label", {
|
|
45561
45597
|
className: "text-info cursor-pointer m-0 ms-auto",
|
|
45562
45598
|
children: ["Tải lên", /* @__PURE__ */ O("input", {
|
|
45599
|
+
ref: p,
|
|
45563
45600
|
required: r,
|
|
45601
|
+
disabled: a,
|
|
45564
45602
|
name: t,
|
|
45565
45603
|
type: "file",
|
|
45566
|
-
onChange:
|
|
45567
|
-
e.preventDefault();
|
|
45568
|
-
let t = /\.(pdf|docx|doc|xlsx|xls)$/i, n = d.current?.querySelector(".default-file-input"), r = d.current?.querySelector(".showFile");
|
|
45569
|
-
if (!n || !r) return;
|
|
45570
|
-
let i = n.files;
|
|
45571
|
-
if (!i) return;
|
|
45572
|
-
let a = d.current?.querySelector(".rmFile"), s = n.getAttribute("accept"), l = s ? RegExp(".(" + s.replace(/[., ]/g, (e) => e === "," ? "|" : "") + ")$", "i") : t;
|
|
45573
|
-
c(i, 10, l).then(() => {
|
|
45574
|
-
Array.from(i).forEach((t) => {
|
|
45575
|
-
let n = URL.createObjectURL(t);
|
|
45576
|
-
p(n), h(t.name), o && o(e), a?.classList.remove("d-none");
|
|
45577
|
-
});
|
|
45578
|
-
});
|
|
45579
|
-
},
|
|
45604
|
+
onChange: y,
|
|
45580
45605
|
className: "d-none default-file-input",
|
|
45581
|
-
accept:
|
|
45606
|
+
accept: d
|
|
45582
45607
|
})]
|
|
45583
45608
|
})]
|
|
45584
45609
|
})
|
|
@@ -45588,73 +45613,83 @@ var { API_URL: GN } = await e(), KN = ({ label: e, name: t, cpnClass: r = "", re
|
|
|
45588
45613
|
/* @__PURE__ */ k("div", {
|
|
45589
45614
|
className: "card-body d-flex justify-content-between align-items-center px-3 py-0 showFile",
|
|
45590
45615
|
style: { minHeight: "50px" },
|
|
45591
|
-
children: [/* @__PURE__ */ k("div", {
|
|
45592
|
-
className:
|
|
45616
|
+
children: [h && /* @__PURE__ */ k("div", {
|
|
45617
|
+
className: "d-flex align-items-center justify-content-center",
|
|
45593
45618
|
children: [/* @__PURE__ */ O("i", { className: "fal fa-file me-1" }), /* @__PURE__ */ O("a", {
|
|
45594
45619
|
className: "text-info",
|
|
45595
|
-
href:
|
|
45620
|
+
href: h,
|
|
45596
45621
|
target: "_blank",
|
|
45597
|
-
|
|
45622
|
+
rel: "noopener noreferrer",
|
|
45623
|
+
children: _
|
|
45598
45624
|
})]
|
|
45599
|
-
}),
|
|
45600
|
-
onClick:
|
|
45601
|
-
e.preventDefault();
|
|
45602
|
-
let n = d.current?.querySelector(".default-file-input"), r = d.current?.querySelector(".showFile");
|
|
45603
|
-
if (!n || !r) return;
|
|
45604
|
-
let a = d.current?.querySelector(".rmFile");
|
|
45605
|
-
a && (a.classList.add("d-none"), p(i("", u)), n.value = "", o && o({
|
|
45606
|
-
target: {
|
|
45607
|
-
name: t,
|
|
45608
|
-
type: "input",
|
|
45609
|
-
value: ""
|
|
45610
|
-
},
|
|
45611
|
-
preventDefault: () => {}
|
|
45612
|
-
}));
|
|
45613
|
-
},
|
|
45625
|
+
}), ee && h && /* @__PURE__ */ O("a", {
|
|
45626
|
+
onClick: b,
|
|
45614
45627
|
href: "#",
|
|
45615
|
-
className:
|
|
45628
|
+
className: "ml-auto link text-danger",
|
|
45616
45629
|
children: "Xóa"
|
|
45617
45630
|
})]
|
|
45618
45631
|
})
|
|
45619
45632
|
]
|
|
45620
45633
|
});
|
|
45621
|
-
}, cP = ({ label: e, name: t, cpnClass: n = "", required: r = !1,
|
|
45622
|
-
let
|
|
45634
|
+
}, cP = ({ label: e, name: t, cpnClass: n = "", required: r = !1, disabled: a, readonly: o, value: s = [], onChange: l, isEdit: u = !1, ext: d = ".xlsx, .xls, .docx, .doc, .pdf", df: f = "" }) => {
|
|
45635
|
+
let [p, m] = C([]), [h, g] = C(Array.isArray(s) ? s : []), [_, v] = C(""), y = S(/* @__PURE__ */ new Map()), b = (e) => {
|
|
45636
|
+
let t = y.current.get(e);
|
|
45637
|
+
return t || (t = URL.createObjectURL(e), y.current.set(e, t)), t;
|
|
45638
|
+
}, ee = (t, n) => {
|
|
45639
|
+
r && t.length === 0 && n.length === 0 ? v(e + " không được để trống") : v("");
|
|
45640
|
+
};
|
|
45641
|
+
x(() => () => {
|
|
45642
|
+
y.current.forEach((e) => {
|
|
45643
|
+
URL.revokeObjectURL(e);
|
|
45644
|
+
}), y.current.clear();
|
|
45645
|
+
}, []), x(() => {
|
|
45646
|
+
g(Array.isArray(s) ? s : []);
|
|
45647
|
+
}, [s]);
|
|
45648
|
+
let te = (e) => {
|
|
45623
45649
|
e.preventDefault();
|
|
45624
|
-
let
|
|
45625
|
-
if (!
|
|
45626
|
-
let r = n
|
|
45627
|
-
|
|
45628
|
-
|
|
45629
|
-
|
|
45630
|
-
|
|
45631
|
-
|
|
45650
|
+
let n = /\.(pdf|docx|doc|xlsx|xls)$/i, r = e.currentTarget, i = r.files;
|
|
45651
|
+
if (!i || i.length === 0) return;
|
|
45652
|
+
let a = r.getAttribute("accept"), o = a ? RegExp(".(" + a.replace(/[., ]/g, (e) => e === "," ? "|" : "") + ")$", "i") : n;
|
|
45653
|
+
c(i, 10, o).then(() => {
|
|
45654
|
+
let e = Array.from(i), n = [...p, ...e];
|
|
45655
|
+
m(n), v(""), l?.({
|
|
45656
|
+
target: {
|
|
45657
|
+
name: `${t}_upload`,
|
|
45658
|
+
type: "files",
|
|
45659
|
+
value: n
|
|
45660
|
+
},
|
|
45661
|
+
preventDefault: () => {}
|
|
45662
|
+
}), r.value = "";
|
|
45632
45663
|
});
|
|
45633
|
-
},
|
|
45634
|
-
e.preventDefault()
|
|
45635
|
-
|
|
45636
|
-
|
|
45637
|
-
};
|
|
45638
|
-
return x(() => {
|
|
45639
|
-
o && o({
|
|
45664
|
+
}, w = (e, n) => {
|
|
45665
|
+
e.preventDefault();
|
|
45666
|
+
let r = h.filter((e, t) => t !== n);
|
|
45667
|
+
g(r), ee(r, p), l?.({
|
|
45640
45668
|
target: {
|
|
45641
|
-
name:
|
|
45642
|
-
|
|
45643
|
-
value: f
|
|
45669
|
+
name: t,
|
|
45670
|
+
value: r
|
|
45644
45671
|
},
|
|
45645
45672
|
preventDefault: () => {}
|
|
45646
45673
|
});
|
|
45647
|
-
},
|
|
45648
|
-
|
|
45674
|
+
}, T = (e, n) => {
|
|
45675
|
+
e.preventDefault();
|
|
45676
|
+
let r = p[n];
|
|
45677
|
+
if (r) {
|
|
45678
|
+
let e = y.current.get(r);
|
|
45679
|
+
e && (URL.revokeObjectURL(e), y.current.delete(r));
|
|
45680
|
+
}
|
|
45681
|
+
let i = p.filter((e, t) => t !== n);
|
|
45682
|
+
m(i), ee(h, i), l?.({
|
|
45649
45683
|
target: {
|
|
45650
|
-
name: t
|
|
45651
|
-
|
|
45684
|
+
name: `${t}_upload`,
|
|
45685
|
+
type: "files",
|
|
45686
|
+
value: i
|
|
45652
45687
|
},
|
|
45653
45688
|
preventDefault: () => {}
|
|
45654
45689
|
});
|
|
45655
|
-
},
|
|
45656
|
-
|
|
45657
|
-
className: `card
|
|
45690
|
+
}, ne = u && !a && !o;
|
|
45691
|
+
return /* @__PURE__ */ k("div", {
|
|
45692
|
+
className: `card ${n}`,
|
|
45658
45693
|
children: [
|
|
45659
45694
|
/* @__PURE__ */ O("div", {
|
|
45660
45695
|
className: "card-header position-relative",
|
|
@@ -45665,20 +45700,19 @@ var { API_URL: GN } = await e(), KN = ({ label: e, name: t, cpnClass: r = "", re
|
|
|
45665
45700
|
children: [/* @__PURE__ */ O("h3", {
|
|
45666
45701
|
className: "card-title",
|
|
45667
45702
|
children: e
|
|
45668
|
-
}),
|
|
45703
|
+
}), ne && /* @__PURE__ */ k("label", {
|
|
45669
45704
|
className: "text-info cursor-pointer m-0 ms-auto",
|
|
45670
45705
|
children: ["Tải lên", /* @__PURE__ */ O("input", {
|
|
45671
|
-
|
|
45706
|
+
disabled: a,
|
|
45672
45707
|
name: t,
|
|
45673
45708
|
multiple: !0,
|
|
45674
45709
|
type: "file",
|
|
45675
|
-
onChange:
|
|
45710
|
+
onChange: te,
|
|
45676
45711
|
style: {
|
|
45677
45712
|
position: "absolute",
|
|
45678
45713
|
left: -9999
|
|
45679
45714
|
},
|
|
45680
|
-
|
|
45681
|
-
accept: l
|
|
45715
|
+
accept: d
|
|
45682
45716
|
})]
|
|
45683
45717
|
})]
|
|
45684
45718
|
})
|
|
@@ -45688,49 +45722,61 @@ var { API_URL: GN } = await e(), KN = ({ label: e, name: t, cpnClass: r = "", re
|
|
|
45688
45722
|
/* @__PURE__ */ k("div", {
|
|
45689
45723
|
className: "card-body py-2 px-3",
|
|
45690
45724
|
style: { minHeight: "50px" },
|
|
45691
|
-
children: [
|
|
45692
|
-
|
|
45693
|
-
|
|
45725
|
+
children: [
|
|
45726
|
+
h?.map((e, t) => {
|
|
45727
|
+
let n = (e ? e.split("/").pop() : "")?.split("___");
|
|
45728
|
+
return /* @__PURE__ */ k("div", {
|
|
45729
|
+
className: "d-flex w-100 justify-content-between",
|
|
45730
|
+
children: [/* @__PURE__ */ k("div", {
|
|
45731
|
+
className: "d-flex justify-content-center flex-column",
|
|
45732
|
+
children: [/* @__PURE__ */ k("div", {
|
|
45733
|
+
className: "w-100",
|
|
45734
|
+
children: [/* @__PURE__ */ O("i", { className: "fal fa-file me-1" }), /* @__PURE__ */ O("a", {
|
|
45735
|
+
className: "text-info",
|
|
45736
|
+
href: i(e, f),
|
|
45737
|
+
target: "_blank",
|
|
45738
|
+
children: n?.[1]
|
|
45739
|
+
})]
|
|
45740
|
+
}), /* @__PURE__ */ O("span", { children: n?.[0] ? new Date(Number(n[0])).toLocaleString("vi-VN") : "" })]
|
|
45741
|
+
}), ne && /* @__PURE__ */ O("a", {
|
|
45742
|
+
onClick: (e) => w(e, t),
|
|
45743
|
+
href: "#",
|
|
45744
|
+
className: "ml-auto link text-danger",
|
|
45745
|
+
children: "Xóa"
|
|
45746
|
+
})]
|
|
45747
|
+
}, t);
|
|
45748
|
+
}),
|
|
45749
|
+
p?.map((e, t) => /* @__PURE__ */ k("div", {
|
|
45694
45750
|
className: "d-flex w-100 justify-content-between",
|
|
45695
45751
|
children: [/* @__PURE__ */ k("div", {
|
|
45696
|
-
className:
|
|
45697
|
-
children: [/* @__PURE__ */
|
|
45698
|
-
className: "
|
|
45699
|
-
|
|
45700
|
-
|
|
45701
|
-
|
|
45702
|
-
|
|
45703
|
-
|
|
45704
|
-
|
|
45705
|
-
|
|
45706
|
-
}), s && /* @__PURE__ */ O("a", {
|
|
45707
|
-
onClick: (e) => _(e, t),
|
|
45752
|
+
className: "d-flex align-items-center justify-content-center",
|
|
45753
|
+
children: [/* @__PURE__ */ O("i", { className: "fal fa-file me-1" }), /* @__PURE__ */ O("a", {
|
|
45754
|
+
className: "text-info text-1-line",
|
|
45755
|
+
href: b(e),
|
|
45756
|
+
target: "_blank",
|
|
45757
|
+
rel: "noopener noreferrer",
|
|
45758
|
+
children: e?.name
|
|
45759
|
+
})]
|
|
45760
|
+
}), ne && /* @__PURE__ */ O("a", {
|
|
45761
|
+
onClick: (e) => T(e, t),
|
|
45708
45762
|
href: "#",
|
|
45709
|
-
className:
|
|
45763
|
+
className: "ml-auto link text-danger",
|
|
45710
45764
|
children: "Xóa"
|
|
45711
45765
|
})]
|
|
45712
|
-
}, t)
|
|
45713
|
-
|
|
45714
|
-
|
|
45715
|
-
|
|
45716
|
-
|
|
45717
|
-
|
|
45718
|
-
className: "text-info text-1-line",
|
|
45719
|
-
href: URL.createObjectURL(e),
|
|
45720
|
-
target: "_blank",
|
|
45721
|
-
children: e?.name
|
|
45722
|
-
})]
|
|
45723
|
-
}), s && /* @__PURE__ */ O("a", {
|
|
45724
|
-
onClick: (e) => v(e, t),
|
|
45725
|
-
href: "#",
|
|
45726
|
-
className: `ml-auto link text-danger ${e ? "" : "d-none"}`,
|
|
45727
|
-
children: "Xóa"
|
|
45728
|
-
})]
|
|
45729
|
-
}, t))]
|
|
45766
|
+
}, t)),
|
|
45767
|
+
_ && /* @__PURE__ */ O("div", {
|
|
45768
|
+
className: "text-danger mt-1",
|
|
45769
|
+
children: _
|
|
45770
|
+
})
|
|
45771
|
+
]
|
|
45730
45772
|
})
|
|
45731
45773
|
]
|
|
45732
45774
|
});
|
|
45733
|
-
}, lP = (
|
|
45775
|
+
}, lP = (e, t, n) => {
|
|
45776
|
+
let r = e?.[t] ?? [], i = e?.[`${t}_upload`] ?? [];
|
|
45777
|
+
if (r.length === 0 && i.length === 0) throw Error(`${n} không được để trống`);
|
|
45778
|
+
return !0;
|
|
45779
|
+
}, uP = ({ label: e, name: t, cpnClass: n = "", required: r = !1, value: a = [], onChange: o, isEdit: s = !1, ext: l = ".png, .jpg, .jpeg, .ico", df: u = "" }) => {
|
|
45734
45780
|
let d = S(null), [f, p] = C([]), [m, h] = C(Array.isArray(a) ? a : []), g = (e) => {
|
|
45735
45781
|
e.preventDefault();
|
|
45736
45782
|
let t = /\.(png|jpg|jpeg|ico)$/i, n = d.current?.querySelector(".default-file-input");
|
|
@@ -45840,4 +45886,4 @@ var { API_URL: GN } = await e(), KN = ({ label: e, name: t, cpnClass: r = "", re
|
|
|
45840
45886
|
});
|
|
45841
45887
|
};
|
|
45842
45888
|
//#endregion
|
|
45843
|
-
export {
|
|
45889
|
+
export { Ze as C, ze as D, Ve as E, Xe as S, qe as T, rt as _, oP as a, Je as b, eP as c, XN as d, JN as f, nt as g, it as h, sP as i, $N as l, KN as m, cP as n, nP as o, qN as p, lP as r, tP as s, uP as t, QN as u, Qe as v, Ge as w, Ye as x, Ke as y };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { _ as e, b as t, d as n, o as r, t as i, v as a, y as o } from "./Common-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { _ as e, b as t, d as n, o as r, t as i, v as a, y as o } from "./Common-BURf0rBN.js";
|
|
2
|
+
import { i as s, t as c } from "./Validator-CXYkI7vJ.js";
|
|
3
|
+
import { d as l, l as u, s as d, u as f } from "./HeaderUpdate-DuS-gHNR.js";
|
|
4
4
|
import { useEffect as p, useLayoutEffect as m, useRef as h, useState as g } from "react";
|
|
5
5
|
import _ from "react-select";
|
|
6
6
|
import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
@@ -10,7 +10,7 @@ import { Helmet as T } from "react-helmet-async";
|
|
|
10
10
|
//#region src/components/meta/BtnGroup.tsx
|
|
11
11
|
var E = ({ cUri: e, itemId: t, isEdit: n = !1, isDel: r = !1, onDelete: i }) => /* @__PURE__ */ b("div", {
|
|
12
12
|
className: "btn-group",
|
|
13
|
-
children: [n && /* @__PURE__ */ y(
|
|
13
|
+
children: [n && /* @__PURE__ */ y(l, {
|
|
14
14
|
title: "Chỉnh sửa",
|
|
15
15
|
children: /* @__PURE__ */ y(C, {
|
|
16
16
|
to: e + "/edit/" + t,
|
|
@@ -20,7 +20,7 @@ var E = ({ cUri: e, itemId: t, isEdit: n = !1, isDel: r = !1, onDelete: i }) =>
|
|
|
20
20
|
children: "drive_file_rename_outline"
|
|
21
21
|
})
|
|
22
22
|
})
|
|
23
|
-
}), r && /* @__PURE__ */ y(
|
|
23
|
+
}), r && /* @__PURE__ */ y(l, {
|
|
24
24
|
title: "Xóa",
|
|
25
25
|
children: /* @__PURE__ */ y("button", {
|
|
26
26
|
type: "button",
|
|
@@ -111,11 +111,11 @@ var E = ({ cUri: e, itemId: t, isEdit: n = !1, isDel: r = !1, onDelete: i }) =>
|
|
|
111
111
|
className: `modal-body rounded-bottom pb-0 ${C}`,
|
|
112
112
|
style: { overflowY: "auto" },
|
|
113
113
|
children: a(D, async (e) => {
|
|
114
|
-
let { name: t, value: n } = s(e
|
|
115
|
-
O({
|
|
116
|
-
...
|
|
114
|
+
let { name: t, value: n } = s(e);
|
|
115
|
+
O((e) => ({
|
|
116
|
+
...e,
|
|
117
117
|
[t]: n
|
|
118
|
-
});
|
|
118
|
+
}));
|
|
119
119
|
})
|
|
120
120
|
}),
|
|
121
121
|
/* @__PURE__ */ b("div", {
|
|
@@ -404,7 +404,7 @@ var E = ({ cUri: e, itemId: t, isEdit: n = !1, isDel: r = !1, onDelete: i }) =>
|
|
|
404
404
|
})
|
|
405
405
|
]
|
|
406
406
|
});
|
|
407
|
-
}, L = ({ frmBody: n, service: s, apiOption: c, options:
|
|
407
|
+
}, L = ({ frmBody: n, service: s, apiOption: c, options: l, tbOption: m, roleOption: _, clsWidth: S = "xl", btnTxt: C = "Lưu lại" }) => {
|
|
408
408
|
let T = h(null), E = w(), [k, A] = g(0), [j, M] = g({
|
|
409
409
|
items: [],
|
|
410
410
|
page: 1,
|
|
@@ -439,7 +439,7 @@ var E = ({ cUri: e, itemId: t, isEdit: n = !1, isDel: r = !1, onDelete: i }) =>
|
|
|
439
439
|
}, L = async (e) => {
|
|
440
440
|
try {
|
|
441
441
|
e.preventDefault();
|
|
442
|
-
let t = await
|
|
442
|
+
let t = await d(e, j?.filter || {}, c?.cUri, E);
|
|
443
443
|
M({
|
|
444
444
|
...j,
|
|
445
445
|
filter: t
|
|
@@ -449,7 +449,7 @@ var E = ({ cUri: e, itemId: t, isEdit: n = !1, isDel: r = !1, onDelete: i }) =>
|
|
|
449
449
|
}
|
|
450
450
|
}, R = async (e) => {
|
|
451
451
|
e.preventDefault();
|
|
452
|
-
let t =
|
|
452
|
+
let t = u(e, j?.filter || {});
|
|
453
453
|
M({
|
|
454
454
|
...j,
|
|
455
455
|
filter: t
|
|
@@ -571,7 +571,7 @@ var E = ({ cUri: e, itemId: t, isEdit: n = !1, isDel: r = !1, onDelete: i }) =>
|
|
|
571
571
|
/* @__PURE__ */ y(I, {
|
|
572
572
|
ftfield: m.ftfield,
|
|
573
573
|
service: s,
|
|
574
|
-
options:
|
|
574
|
+
options: l,
|
|
575
575
|
filter: j?.filter || {},
|
|
576
576
|
handleChange: R,
|
|
577
577
|
handleSearchForm: z
|