@materialui-reactjs/admin 1.0.5 → 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-CYN7fndV.js → HeaderUpdate-DuS-gHNR.js} +1 -1
- package/dist/chunks/{UDragFile-CAiSfTsp.js → UDragFile-BnUR3riq.js} +1 -1
- package/dist/chunks/{form-DirVyglJ.js → form-CPkpL5eA.js} +1 -1
- package/dist/chunks/{meta-BkJxF49g.js → meta-4qPWijBT.js} +2 -2
- package/dist/chunks/{single-DfnwtW2f.js → single-CRF61o_U.js} +3 -3
- package/dist/chunks/{top-navbar-FBw88y_o.js → top-navbar-Bob0gMUh.js} +1 -1
- package/dist/components/form/index.js +2 -2
- package/dist/components/meta/index.js +2 -2
- package/dist/components/single/index.js +1 -1
- package/dist/components/top-navbar/index.js +1 -1
- package/dist/hook/index.js +1 -1
- package/dist/index.js +6 -6
- package/dist/utils/Common.d.ts +4 -0
- package/dist/utils/index.js +26 -21
- package/package.json +1 -1
|
@@ -45,7 +45,12 @@ var { SECRET_KEY: i, STATIC_URL: a, API_URL: o, UPLOADS_URL: s } = await e(), c
|
|
|
45
45
|
t.append(e, n);
|
|
46
46
|
}
|
|
47
47
|
}), t;
|
|
48
|
-
}, u =
|
|
48
|
+
}, u = class extends Error {
|
|
49
|
+
errorCode;
|
|
50
|
+
constructor(e, t) {
|
|
51
|
+
super(e), this.name = "ApiError", this.errorCode = t;
|
|
52
|
+
}
|
|
53
|
+
}, d = async (e, t = {}, n = "POST", r = "application/json", a = !0) => {
|
|
49
54
|
let o = { "Secret-Key": i };
|
|
50
55
|
r !== "multipart/form-data" && (o["Content-Type"] = r);
|
|
51
56
|
let s = {
|
|
@@ -61,17 +66,17 @@ var { SECRET_KEY: i, STATIC_URL: a, API_URL: o, UPLOADS_URL: s } = await e(), c
|
|
|
61
66
|
let r = n.toString();
|
|
62
67
|
e += (e.includes("?") ? "&" : "?") + r;
|
|
63
68
|
}
|
|
64
|
-
let c = await (await fetch(e, s)).text(),
|
|
69
|
+
let c = await (await fetch(e, s)).text(), d = null;
|
|
65
70
|
if (c) try {
|
|
66
|
-
|
|
71
|
+
d = JSON.parse(c);
|
|
67
72
|
} catch {
|
|
68
|
-
|
|
73
|
+
d = c;
|
|
69
74
|
}
|
|
70
|
-
if (
|
|
71
|
-
if (
|
|
75
|
+
if (d?.status == 200) return d;
|
|
76
|
+
if (d?.msg && a) throw new u(d.msg, d.errorCode);
|
|
72
77
|
if (a) throw Error("invalid_response");
|
|
73
78
|
return !1;
|
|
74
|
-
},
|
|
79
|
+
}, f = (e = "Bạn có chắc muốn thực hiện thao tác này ?", r = "Đồng ý") => n(t).fire({
|
|
75
80
|
title: "Xác nhận",
|
|
76
81
|
text: e,
|
|
77
82
|
icon: "warning",
|
|
@@ -81,7 +86,7 @@ var { SECRET_KEY: i, STATIC_URL: a, API_URL: o, UPLOADS_URL: s } = await e(), c
|
|
|
81
86
|
confirmButtonText: r,
|
|
82
87
|
cancelButtonText: "Hủy",
|
|
83
88
|
position: "top"
|
|
84
|
-
}),
|
|
89
|
+
}), p = (e, r = "top", i = !1) => {
|
|
85
90
|
n(t).fire({
|
|
86
91
|
toast: i,
|
|
87
92
|
icon: "success",
|
|
@@ -90,29 +95,29 @@ var { SECRET_KEY: i, STATIC_URL: a, API_URL: o, UPLOADS_URL: s } = await e(), c
|
|
|
90
95
|
showConfirmButton: !1,
|
|
91
96
|
timer: 1500
|
|
92
97
|
});
|
|
93
|
-
},
|
|
98
|
+
}, m = (e) => {
|
|
94
99
|
n(t).fire({
|
|
95
100
|
icon: "error",
|
|
96
101
|
position: "top",
|
|
97
102
|
title: e,
|
|
98
103
|
showConfirmButton: !1
|
|
99
104
|
});
|
|
100
|
-
},
|
|
105
|
+
}, h = (e) => {
|
|
101
106
|
if (!e) return "";
|
|
102
107
|
let t = new Date(e);
|
|
103
108
|
return isNaN(t.getTime()) ? "Invalid Date" : `${String(t.getDate()).padStart(2, "0")}/${String(t.getMonth() + 1).padStart(2, "0")}/${t.getFullYear()}`;
|
|
104
|
-
},
|
|
109
|
+
}, g = (e) => {
|
|
105
110
|
let t = new URLSearchParams();
|
|
106
111
|
return Object.entries(e).forEach(([e, n]) => {
|
|
107
112
|
Array.isArray(n) ? n.forEach((n) => {
|
|
108
113
|
n != null && t.append(e, String(n));
|
|
109
114
|
}) : n != null && t.set(e, String(n));
|
|
110
115
|
}), t.toString();
|
|
111
|
-
},
|
|
116
|
+
}, _ = () => {
|
|
112
117
|
let e = window.location.pathname.match(/\/(\d+)(\/)?$/);
|
|
113
118
|
return e ? Number(e[1]) : null;
|
|
114
|
-
},
|
|
115
|
-
function
|
|
119
|
+
}, v = (e, t = "/styles/default.jpg") => e ? a + ("/" + e).replaceAll("//", "/") : t, y = (e) => e ? a + ("/" + e).replaceAll("//", "/") : "", b = (e, t = "/styles/default.jpg") => e ? o + ("/" + e).replaceAll("//", "/") : t, x = (e, t = "/styles/default.jpg") => e ? s + "/" + e : t;
|
|
120
|
+
function S(e) {
|
|
116
121
|
let t = "";
|
|
117
122
|
for (let n = 0; n < e; n++) {
|
|
118
123
|
let e = Math.floor(Math.random() * 62);
|
|
@@ -120,19 +125,19 @@ function x(e) {
|
|
|
120
125
|
}
|
|
121
126
|
return t;
|
|
122
127
|
}
|
|
123
|
-
var
|
|
128
|
+
var C = (e, t = 20, n = !1) => new Promise((r) => {
|
|
124
129
|
for (let r = 0; r < e.length; r++) if (e[r] !== void 0) {
|
|
125
130
|
if (n.test(e[r].name)) {
|
|
126
|
-
if (e[r].size >= t * 1024 * 1024) return
|
|
127
|
-
} else return
|
|
128
|
-
} else return
|
|
131
|
+
if (e[r].size >= t * 1024 * 1024) return m(`Tập tin tải lên không quá ${t}M`), !1;
|
|
132
|
+
} else return m("Tập tin không hợp lệ"), !1;
|
|
133
|
+
} else return m("Tập tin không tồn tại"), !1;
|
|
129
134
|
r(void 0);
|
|
130
|
-
}),
|
|
135
|
+
}), w = (e = "", t = "danger") => {
|
|
131
136
|
let n = "";
|
|
132
137
|
if (typeof e == "string") return e.trim() === "" ? "" : `<div class="alert alert-${t}">${e}</div>`;
|
|
133
138
|
for (let r in e) n += `<div class="alert alert-${t}">${e[r]}</div>`;
|
|
134
139
|
return n;
|
|
135
|
-
},
|
|
140
|
+
}, T = (e, t = {}) => new Promise((n, r) => {
|
|
136
141
|
try {
|
|
137
142
|
let r = window.jQuery, i = r(e);
|
|
138
143
|
if (!i.length) throw Error("invalid_elfinder");
|
|
@@ -154,7 +159,7 @@ var S = (e, t = 20, n = !1) => new Promise((r) => {
|
|
|
154
159
|
} catch (e) {
|
|
155
160
|
r(e);
|
|
156
161
|
}
|
|
157
|
-
}),
|
|
162
|
+
}), E = (e) => new Promise((t, n) => {
|
|
158
163
|
try {
|
|
159
164
|
let n = typeof e == "string" ? document.querySelector(e) : e;
|
|
160
165
|
if (!n) throw Error("invalid_modalEl_btnEl");
|
|
@@ -174,12 +179,12 @@ var S = (e, t = 20, n = !1) => new Promise((r) => {
|
|
|
174
179
|
} catch (e) {
|
|
175
180
|
console.log(e), n(e);
|
|
176
181
|
}
|
|
177
|
-
}),
|
|
182
|
+
}), D = (e, t, n = !1, r = !1) => {
|
|
178
183
|
if (!e) throw Error("invalid_btnEl");
|
|
179
184
|
e.addEventListener("click", (i) => {
|
|
180
|
-
i.preventDefault(),
|
|
185
|
+
i.preventDefault(), E(t).then((t) => {
|
|
181
186
|
let { modalEl: i, md: a } = t;
|
|
182
|
-
|
|
187
|
+
T("#elfinderStatic").then((t) => {
|
|
183
188
|
n && n({
|
|
184
189
|
data: t,
|
|
185
190
|
btnEl: e,
|
|
@@ -190,12 +195,12 @@ var S = (e, t = 20, n = !1) => new Promise((r) => {
|
|
|
190
195
|
}), a.show();
|
|
191
196
|
});
|
|
192
197
|
});
|
|
193
|
-
},
|
|
198
|
+
}, O = (e, t, n = !1, r = !1) => {
|
|
194
199
|
if (!e) throw Error("invalid_btnEl");
|
|
195
200
|
e.addEventListener("click", (i) => {
|
|
196
|
-
i.preventDefault(),
|
|
201
|
+
i.preventDefault(), E(t).then((t) => {
|
|
197
202
|
let { modalEl: i, md: a } = t;
|
|
198
|
-
|
|
203
|
+
T("#elfinderStatic", { url: o + "/elfinder/connectorFiles" }).then((t) => {
|
|
199
204
|
n && n({
|
|
200
205
|
data: t,
|
|
201
206
|
btnEl: e,
|
|
@@ -206,7 +211,7 @@ var S = (e, t = 20, n = !1) => new Promise((r) => {
|
|
|
206
211
|
}), a.show();
|
|
207
212
|
});
|
|
208
213
|
});
|
|
209
|
-
},
|
|
214
|
+
}, k = (e = !1) => {
|
|
210
215
|
let t = [{
|
|
211
216
|
id: 1,
|
|
212
217
|
name: "Tiếng Việt"
|
|
@@ -214,4 +219,4 @@ var S = (e, t = 20, n = !1) => new Promise((r) => {
|
|
|
214
219
|
return e === !1 ? t : t.find((t) => t.id === e)?.name || "";
|
|
215
220
|
};
|
|
216
221
|
//#endregion
|
|
217
|
-
export {
|
|
222
|
+
export { f as _, T as a, c as b, _ as c, b as d, x as f, w as g, D as h, g as i, v as l, O as m, C as n, h as o, S as p, E as r, y as s, d as t, k as u, m as v, p as y };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as e, t } from "./Common-
|
|
1
|
+
import { i as e, t } from "./Common-BURf0rBN.js";
|
|
2
2
|
import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
3
3
|
import { Link as a, NavLink as o } from "react-router-dom";
|
|
4
4
|
import { Tooltip as s } from "@mui/material";
|
|
@@ -1,5 +1,5 @@
|
|
|
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
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";
|
|
@@ -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-
|
|
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
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-
|
|
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";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { n as e } from "./Env-DRXhvUcb.js";
|
|
2
|
-
import { _ as t, b as n, c as r, g as i, i as a, t as o, v as s, y as c } from "./Common-
|
|
2
|
+
import { _ as t, b as n, c as r, g as i, i as a, t as o, v as s, y as c } from "./Common-BURf0rBN.js";
|
|
3
3
|
import { n as l, r as u, t as d } from "./Validator-CXYkI7vJ.js";
|
|
4
|
-
import { t as f } from "./UDragFile-
|
|
4
|
+
import { t as f } from "./UDragFile-BnUR3riq.js";
|
|
5
5
|
import { t as p } from "./SpinnerLoader-h8RDIarB.js";
|
|
6
|
-
import { a as m, c as h, d as g, i as _, l as v, n as y, o as b, r as x, s as S, t as C, u as w } from "./HeaderUpdate-
|
|
6
|
+
import { a as m, c as h, d as g, i as _, l as v, n as y, o as b, r as x, s as S, t as C, u as w } from "./HeaderUpdate-DuS-gHNR.js";
|
|
7
7
|
import T, { createRef as E } from "react";
|
|
8
8
|
import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
|
|
9
9
|
import { Form as A, Link as j } from "react-router-dom";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { C as e, D as t, E as n, S as r, T as i, _ as a, a as o, b as s, c, d as l, f as u, g as d, h as f, i as p, l as m, m as h, n as g, o as _, p as v, r as y, s as b, t as x, u as S, v as C, w, x as T, y as E } from "../../chunks/form-
|
|
2
|
-
import { t as D } from "../../chunks/UDragFile-
|
|
1
|
+
import { C as e, D as t, E as n, S as r, T as i, _ as a, a as o, b as s, c, d as l, f as u, g as d, h as f, i as p, l as m, m as h, n as g, o as _, p as v, r as y, s as b, t as x, u as S, v as C, w, x as T, y as E } from "../../chunks/form-CPkpL5eA.js";
|
|
2
|
+
import { t as D } from "../../chunks/UDragFile-BnUR3riq.js";
|
|
3
3
|
export { t as AdvancedMultiSelect, n as AsxhUImages, v as BoxAddRow, C as CheckBox, u as CheckTreeBox, l as DateInput, S as DateTimeInput, h as Editor, m as EfFile, f as EfImage, c as EfImages, E as Email, s as NumberText, b as PImage, T as Password, r as PhoneVn, e as RatioKeyVal, _ as SelectAddRowBox, o as SelectAddRowBoxAdvanced, d as SelectBox, a as SelectMBox, w as Text, i as Textarea, D as UDragFile, p as UFile, g as UFiles, x as UImages, y as validateRequiredFiles };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { t as e } from "../../chunks/SortableItem-B4-Zsso3.js";
|
|
2
|
-
import { a as t, c as n, i as r, l as i, n as a, o, r as s, s as c, t as l } from "../../chunks/meta-
|
|
3
|
-
import { a as u, d, i as f, n as p, r as m, t as h, u as g } from "../../chunks/HeaderUpdate-
|
|
2
|
+
import { a as t, c as n, i as r, l as i, n as a, o, r as s, s as c, t as l } from "../../chunks/meta-4qPWijBT.js";
|
|
3
|
+
import { a as u, d, i as f, n as p, r as m, t as h, u as g } from "../../chunks/HeaderUpdate-DuS-gHNR.js";
|
|
4
4
|
export { i as BtnGroup, t as CardTable, d as CusTooltip, r as ElfinderModal, u as Error403, f as Error404, s as Head, m as HeaderDetail, p as HeaderIndex, h as HeaderUpdate, n as ModalForm, a as NavTabs, l as PDFEmbed, g as Pagination, c as ScrollTable, o as SearchBox, e as SortableItem };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "../../chunks/single-
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "../../chunks/single-CRF61o_U.js";
|
|
2
2
|
export { a as SingleDetail, r as SingleFields, e as SingleImport, t as SingleIndex, i as SingleUpdate, n as SingleUpdateDetail, o as SingleUpdateTableDetail };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../chunks/top-navbar-
|
|
1
|
+
import { t as e } from "../../chunks/top-navbar-Bob0gMUh.js";
|
|
2
2
|
export { e as TopNavbar };
|
package/dist/hook/index.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { C as e, D as t, E as n, S as r, T as i, _ as a, a as o, b as s, c, d as l, f as u, g as d, h as f, i as p, l as m, m as h, n as g, o as _, p as v, r as y, s as b, t as x, u as S, v as C, w, x as T, y as E } from "./chunks/form-
|
|
1
|
+
import { C as e, D as t, E as n, S as r, T as i, _ as a, a as o, b as s, c, d as l, f as u, g as d, h as f, i as p, l as m, m as h, n as g, o as _, p as v, r as y, s as b, t as x, u as S, v as C, w, x as T, y as E } from "./chunks/form-CPkpL5eA.js";
|
|
2
2
|
import { t as D } from "./chunks/SortableItem-B4-Zsso3.js";
|
|
3
|
-
import { t as O } from "./chunks/UDragFile-
|
|
3
|
+
import { t as O } from "./chunks/UDragFile-BnUR3riq.js";
|
|
4
4
|
import { a as k, i as A, n as j, r as M, t as N } from "./chunks/echarts-CRmndsxC.js";
|
|
5
5
|
import { t as P } from "./chunks/SpinnerLoader-h8RDIarB.js";
|
|
6
|
-
import { a as F, c as I, i as L, l as R, n as z, o as B, r as V, s as H, t as U } from "./chunks/meta-
|
|
7
|
-
import { a as W, d as G, i as K, n as q, r as J, t as Y, u as X } from "./chunks/HeaderUpdate-
|
|
6
|
+
import { a as F, c as I, i as L, l as R, n as z, o as B, r as V, s as H, t as U } from "./chunks/meta-4qPWijBT.js";
|
|
7
|
+
import { a as W, d as G, i as K, n as q, r as J, t as Y, u as X } from "./chunks/HeaderUpdate-DuS-gHNR.js";
|
|
8
8
|
import { t as Z } from "./chunks/sidebar-Dj4Xr9du.js";
|
|
9
|
-
import { a as Q, i as $, n as ee, o as te, r as ne, s as re, t as ie } from "./chunks/single-
|
|
10
|
-
import { t as ae } from "./chunks/top-navbar-
|
|
9
|
+
import { a as Q, i as $, n as ee, o as te, r as ne, s as re, t as ie } from "./chunks/single-CRF61o_U.js";
|
|
10
|
+
import { t as ae } from "./chunks/top-navbar-Bob0gMUh.js";
|
|
11
11
|
export { t as AdvancedMultiSelect, n as AsxhUImages, k as BarChart, v as BoxAddRow, R as BtnGroup, F as CardTable, C as CheckBox, u as CheckTreeBox, G as CusTooltip, l as DateInput, S as DateTimeInput, h as Editor, m as EfFile, f as EfImage, c as EfImages, L as ElfinderModal, E as Email, W as Error403, K as Error404, V as Head, J as HeaderDetail, q as HeaderIndex, Y as HeaderUpdate, A as LineChart, I as ModalForm, M as MultiBarChart, j as MultiLineChart, z as NavTabs, s as NumberText, U as PDFEmbed, b as PImage, X as Pagination, T as Password, r as PhoneVn, N as PieChart, e as RatioKeyVal, H as ScrollTable, B as SearchBox, _ as SelectAddRowBox, o as SelectAddRowBoxAdvanced, d as SelectBox, a as SelectMBox, Z as Sidebar, re as SingleDetail, te as SingleFields, Q as SingleImport, $ as SingleIndex, ne as SingleUpdate, ee as SingleUpdateDetail, ie as SingleUpdateTableDetail, D as SortableItem, P as SpinnerLoader, w as Text, i as Textarea, ae as TopNavbar, O as UDragFile, p as UFile, g as UFiles, x as UImages, y as validateRequiredFiles };
|
package/dist/utils/Common.d.ts
CHANGED
|
@@ -3,6 +3,10 @@ export declare const loadScript: (src: string) => Promise<void>;
|
|
|
3
3
|
export declare const loadScripts: (scripts: string[]) => Promise<void>;
|
|
4
4
|
export declare const spinnerLoader: (box: string | Element, action?: boolean) => void;
|
|
5
5
|
export declare const buildFormData: (data: Record<string, any>) => FormData;
|
|
6
|
+
export declare class ApiError extends Error {
|
|
7
|
+
errorCode: string;
|
|
8
|
+
constructor(message: string, errorCode: string);
|
|
9
|
+
}
|
|
6
10
|
export declare const callFetchApi: (url: string, data?: any, type?: string, ctype?: string) => Promise<any>;
|
|
7
11
|
export declare const callFetchApiToken: (url: string, data?: any, type?: string, ctype?: string, isTry?: boolean) => Promise<any>;
|
|
8
12
|
export declare const showSweetAlert: (text?: string, confirmText?: string) => Promise<import('sweetalert2').SweetAlertResult<any>>;
|
package/dist/utils/index.js
CHANGED
|
@@ -12,9 +12,9 @@ var { SECRET_KEY: l, STATIC_URL: u, API_URL: d, UPLOADS_URL: f } = await e(), p
|
|
|
12
12
|
}
|
|
13
13
|
let r = document.createElement("script");
|
|
14
14
|
r.src = e, r.onload = () => t(), r.onerror = () => n(/* @__PURE__ */ Error(`Failed to load script ${e}`)), document.body.appendChild(r);
|
|
15
|
-
}),
|
|
15
|
+
}), ee = async (e) => {
|
|
16
16
|
for (let t of e) await p(t);
|
|
17
|
-
},
|
|
17
|
+
}, m = (e, t = !0) => {
|
|
18
18
|
let n = typeof e == "string" ? document.querySelector(e) : e;
|
|
19
19
|
if (n) {
|
|
20
20
|
if (t) n.querySelector(".boxSpinner") || n.insertAdjacentHTML("afterbegin", "<div class=\"boxSpinner rounded\">\n <div class=\"spinner\">\n <div class=\"rect1\"></div>\n <div class=\"rect2\"></div>\n <div class=\"rect3\"></div>\n <div class=\"rect4\"></div>\n <div class=\"rect5\"></div>\n <div class=\"rect6\"></div>\n <div class=\"rect7\"></div>\n </div>\n </div>");
|
|
@@ -54,7 +54,12 @@ var { SECRET_KEY: l, STATIC_URL: u, API_URL: d, UPLOADS_URL: f } = await e(), p
|
|
|
54
54
|
t.append(e, n);
|
|
55
55
|
}
|
|
56
56
|
}), t;
|
|
57
|
-
}, g =
|
|
57
|
+
}, g = class extends Error {
|
|
58
|
+
errorCode;
|
|
59
|
+
constructor(e, t) {
|
|
60
|
+
super(e), this.name = "ApiError", this.errorCode = t;
|
|
61
|
+
}
|
|
62
|
+
}, _ = async (e, t = {}, n = "POST", r = "application/json") => {
|
|
58
63
|
let i = {
|
|
59
64
|
method: n,
|
|
60
65
|
headers: {
|
|
@@ -66,8 +71,8 @@ var { SECRET_KEY: l, STATIC_URL: u, API_URL: d, UPLOADS_URL: f } = await e(), p
|
|
|
66
71
|
n == "POST" && (i.body = JSON.stringify(t));
|
|
67
72
|
let a = await (await fetch(e, i)).json();
|
|
68
73
|
if (a.status == 200) return a;
|
|
69
|
-
throw a.msg ?
|
|
70
|
-
},
|
|
74
|
+
throw a.msg ? new g(a.msg, a.errorCode) : Error("invalid_response");
|
|
75
|
+
}, v = async (e, t = {}, n = "POST", r = "application/json", i = !0) => {
|
|
71
76
|
let a = { "Secret-Key": l };
|
|
72
77
|
r !== "multipart/form-data" && (a["Content-Type"] = r);
|
|
73
78
|
let o = {
|
|
@@ -90,10 +95,10 @@ var { SECRET_KEY: l, STATIC_URL: u, API_URL: d, UPLOADS_URL: f } = await e(), p
|
|
|
90
95
|
c = s;
|
|
91
96
|
}
|
|
92
97
|
if (c?.status == 200) return c;
|
|
93
|
-
if (c?.msg && i) throw
|
|
98
|
+
if (c?.msg && i) throw new g(c.msg, c.errorCode);
|
|
94
99
|
if (i) throw Error("invalid_response");
|
|
95
100
|
return !1;
|
|
96
|
-
},
|
|
101
|
+
}, te = (e = "Bạn có chắc muốn thực hiện thao tác này ?", t = "Đồng ý") => r(n).fire({
|
|
97
102
|
title: "Xác nhận",
|
|
98
103
|
text: e,
|
|
99
104
|
icon: "warning",
|
|
@@ -103,7 +108,7 @@ var { SECRET_KEY: l, STATIC_URL: u, API_URL: d, UPLOADS_URL: f } = await e(), p
|
|
|
103
108
|
confirmButtonText: t,
|
|
104
109
|
cancelButtonText: "Hủy",
|
|
105
110
|
position: "top"
|
|
106
|
-
}),
|
|
111
|
+
}), ne = (e, t = "top", i = !1) => {
|
|
107
112
|
r(n).fire({
|
|
108
113
|
toast: i,
|
|
109
114
|
icon: "success",
|
|
@@ -112,7 +117,7 @@ var { SECRET_KEY: l, STATIC_URL: u, API_URL: d, UPLOADS_URL: f } = await e(), p
|
|
|
112
117
|
showConfirmButton: !1,
|
|
113
118
|
timer: 1500
|
|
114
119
|
});
|
|
115
|
-
},
|
|
120
|
+
}, re = (e) => {
|
|
116
121
|
r(n).fire({
|
|
117
122
|
icon: "warning",
|
|
118
123
|
title: e,
|
|
@@ -126,7 +131,7 @@ var { SECRET_KEY: l, STATIC_URL: u, API_URL: d, UPLOADS_URL: f } = await e(), p
|
|
|
126
131
|
title: e,
|
|
127
132
|
showConfirmButton: !1
|
|
128
133
|
});
|
|
129
|
-
},
|
|
134
|
+
}, ie = (e, t, n = "name") => {
|
|
130
135
|
let r = t?.find((t) => t.id === e);
|
|
131
136
|
return r ? r[n] : null;
|
|
132
137
|
}, b = (e, t, n = "name") => e.map((e) => {
|
|
@@ -260,7 +265,7 @@ var D = (e) => {
|
|
|
260
265
|
let e = window.location.pathname.match(/\/(\d+)(\/)?$/);
|
|
261
266
|
return e ? Number(e[1]) : null;
|
|
262
267
|
}, F = (e, t = "/styles/default.jpg") => e ? u + ("/" + e).replaceAll("//", "/") : t, I = (e) => e ? u + ("/" + e).replaceAll("//", "/") : "", L = (e, t = "/styles/default.jpg") => e ? d + ("/" + e).replaceAll("//", "/") : t, R = (e, t = "/styles/default.jpg") => e ? f + "/" + e : t, z = (e, t = "/styles/default.jpg") => e ? f + "/" + e : t;
|
|
263
|
-
function
|
|
268
|
+
function ae(e) {
|
|
264
269
|
let t = "";
|
|
265
270
|
for (let n = 0; n < e; n++) {
|
|
266
271
|
let e = Math.floor(Math.random() * 62);
|
|
@@ -406,11 +411,11 @@ function X(e, t = {}, n = "ids") {
|
|
|
406
411
|
}
|
|
407
412
|
return n === "ids" && (r = Y(r)), r;
|
|
408
413
|
}
|
|
409
|
-
var
|
|
414
|
+
var oe = (e, t = {}, n = "vi-VN") => e ? e?.toLocaleString(n, t) : 0, se = (e) => {
|
|
410
415
|
if (!e) return new c(0);
|
|
411
416
|
let t = String(e).replace(/[^\d.]/g, "");
|
|
412
417
|
return t ? new c(t) : new c(0);
|
|
413
|
-
},
|
|
418
|
+
}, ce = (e, t) => [...new Set(e.map((e) => e[t]))], le = (e, t, n, r, i) => {
|
|
414
419
|
let a = e.length, o = [];
|
|
415
420
|
for (let s = 0; s < a; s++) {
|
|
416
421
|
let a = t.find((t) => t[r] === e[s]);
|
|
@@ -420,34 +425,34 @@ var ae = (e, t = {}, n = "vi-VN") => e ? e?.toLocaleString(n, t) : 0, oe = (e) =
|
|
|
420
425
|
});
|
|
421
426
|
}
|
|
422
427
|
return o;
|
|
423
|
-
},
|
|
428
|
+
}, ue = (e, t) => e.map((e) => {
|
|
424
429
|
let n = {};
|
|
425
430
|
for (let r in t) {
|
|
426
431
|
let i = t[r];
|
|
427
432
|
typeof i == "string" ? n[r] = e[i] : typeof i == "function" && (n[r] = i(e));
|
|
428
433
|
}
|
|
429
434
|
return n;
|
|
430
|
-
}),
|
|
435
|
+
}), de = (e, t, n = !1) => {
|
|
431
436
|
if (t.split("-").map(Number).includes(e)) return !0;
|
|
432
437
|
if (n) throw Error("invalid_status");
|
|
433
438
|
return !1;
|
|
434
439
|
};
|
|
435
|
-
function
|
|
440
|
+
function Z(e, t) {
|
|
436
441
|
return e?.reduce((e, n) => e + (n[t] ?? 0), 0) || 0;
|
|
437
442
|
}
|
|
438
|
-
var
|
|
443
|
+
var fe = (e) => {
|
|
439
444
|
switch (e) {
|
|
440
445
|
case 3: return "tháng " + ((/* @__PURE__ */ new Date()).getMonth() + 1);
|
|
441
446
|
case 4: return "năm " + (/* @__PURE__ */ new Date()).getFullYear();
|
|
442
447
|
}
|
|
443
448
|
return "";
|
|
444
|
-
},
|
|
449
|
+
}, pe = (e = !1) => {
|
|
445
450
|
let t = [{
|
|
446
451
|
id: 1,
|
|
447
452
|
name: "Tiếng Việt"
|
|
448
453
|
}];
|
|
449
454
|
return e === !1 ? t : t.find((t) => t.id === e)?.name || "";
|
|
450
|
-
},
|
|
455
|
+
}, me = class {
|
|
451
456
|
routes = [];
|
|
452
457
|
async addGS(e, t, n, r = !1, i = !1, a = !1, o = !1) {
|
|
453
458
|
let s = {
|
|
@@ -492,7 +497,7 @@ var de = (e) => {
|
|
|
492
497
|
if (o.subs && o.subs.length > 0 && !Q(o.subs, t, n, r, i, a)) return !1;
|
|
493
498
|
}
|
|
494
499
|
return !0;
|
|
495
|
-
}, $ = window.jQuery,
|
|
500
|
+
}, $ = window.jQuery, he = class e {
|
|
496
501
|
options;
|
|
497
502
|
validators;
|
|
498
503
|
$element;
|
|
@@ -668,4 +673,4 @@ var de = (e) => {
|
|
|
668
673
|
};
|
|
669
674
|
};
|
|
670
675
|
//#endregion
|
|
671
|
-
export {
|
|
676
|
+
export { g as ApiError, me as CusRoute, he as Validator, h as buildFormData, _ as callFetchApi, v as callFetchApiToken, Q as checkPermission, V as checkUploadFile, K as createModal, N as createQueryString, se as decimalNumber, G as elFinderPopup, Y as filterIds, O as formatDate, A as formatDateSql, D as formatDateTime, oe as formatNumber, k as formatYear, S as getActiveStatus, t as getEnv, I as getFile, fe as getFilterType, P as getIdParams, F as getImage, pe as getLangs, x as getLinkFiles, ie as getName, b as getNames, j as getParams, L as getPubImage, C as getPublishStatus, w as getTrueFlaseStatus, z as getUploadFile, R as getUploadImage, B as htmlToText, de as isStsNum, e as loadEnv, p as loadScript, ee as loadScripts, ue as mapArrData, ce as mapArrFields, W as mapDataForm, le as mergeArrObject, T as parseDate, ae as randomString, U as resetForm, M as setParams, J as showFinderFileModal, q as showFinderModal, H as showMessage, te as showSweetAlert, y as showSweetAlertError, ne as showSweetAlertOk, re as showSweetAlertWarning, m as spinnerLoader, E as strToDate, X as stringToJson, Z as sumArrCol };
|