@materialui-reactjs/admin 1.0.6 → 2.0.1

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.
Files changed (129) hide show
  1. package/CHANGELOG.md +322 -0
  2. package/LICENSE +21 -0
  3. package/README.md +587 -453
  4. package/dist/Common-DFahMuQE.cjs +11 -0
  5. package/dist/Common-_PK8HLKN.js +267 -0
  6. package/dist/Env-DoS-iQjs.cjs +1 -0
  7. package/dist/Env-SHztUA3s.js +16 -0
  8. package/dist/HeaderUpdate-Dirxjmxs.cjs +1 -0
  9. package/dist/{chunks/HeaderUpdate-DuS-gHNR.js → HeaderUpdate-drlnuHI8.js} +28 -25
  10. package/dist/SortableItem-C3KzO8Xh.cjs +1 -0
  11. package/dist/SpinnerLoader-BujLjvC3.cjs +1 -0
  12. package/dist/{chunks/SpinnerLoader-h8RDIarB.js → SpinnerLoader-CyhOQC6d.js} +2 -2
  13. package/dist/UDragFile-D8wOZ1Ut.js +96 -0
  14. package/dist/UDragFile-Db0sK4M7.cjs +1 -0
  15. package/dist/{chunks/Validator-CXYkI7vJ.js → Validator-D2zwZeov.js} +83 -52
  16. package/dist/Validator-DBxl8wtE.cjs +1 -0
  17. package/dist/assets/css/form.css +1 -1
  18. package/dist/assets/css/index.css +1 -1
  19. package/dist/ckeditor/ckeditor.d.ts +3 -0
  20. package/dist/ckeditor/plugins/elfinder.d.ts +11 -0
  21. package/dist/ckeditor/plugins/fullscreen.d.ts +15 -0
  22. package/dist/ckeditor/plugins/pdffinder.d.ts +18 -0
  23. package/dist/ckeditor/types.d.ts +37 -0
  24. package/dist/common-CEZp8xpQ.js +30 -0
  25. package/dist/common-ivDX6gGq.cjs +1 -0
  26. package/dist/components/echarts/index.cjs +1 -0
  27. package/dist/components/echarts/index.js +1 -1
  28. package/dist/components/form/AdvancedMultiSelect.d.ts +6 -3
  29. package/dist/components/form/AsxhUImages.d.ts +2 -1
  30. package/dist/components/form/BoxAddRow.d.ts +13 -2
  31. package/dist/components/form/CheckTreeBox.d.ts +12 -3
  32. package/dist/components/form/CusForm.d.ts +19 -6
  33. package/dist/components/form/DateInput.d.ts +2 -1
  34. package/dist/components/form/Editor.d.ts +2 -1
  35. package/dist/components/form/EfFile.d.ts +2 -1
  36. package/dist/components/form/EfImage.d.ts +2 -1
  37. package/dist/components/form/EfImages.d.ts +2 -1
  38. package/dist/components/form/PImage.d.ts +2 -1
  39. package/dist/components/form/SelectAddRowBox.d.ts +9 -5
  40. package/dist/components/form/SelectAddRowBoxAdvanced.d.ts +13 -4
  41. package/dist/components/form/SelectBox.d.ts +20 -7
  42. package/dist/components/form/UDragFile.d.ts +2 -1
  43. package/dist/components/form/UFile.d.ts +2 -1
  44. package/dist/components/form/UFiles.d.ts +9 -2
  45. package/dist/components/form/UImages.d.ts +2 -1
  46. package/dist/components/form/index.cjs +1 -0
  47. package/dist/components/form/index.js +2 -2
  48. package/dist/components/loader/SpinnerLoader.d.ts +5 -1
  49. package/dist/components/loader/index.cjs +1 -0
  50. package/dist/components/loader/index.js +1 -2
  51. package/dist/components/meta/CardTable.d.ts +11 -5
  52. package/dist/components/meta/CardTable.types.d.ts +57 -0
  53. package/dist/components/meta/CusTooltip.d.ts +8 -2
  54. package/dist/components/meta/Head.d.ts +10 -1
  55. package/dist/components/meta/HeaderDetail.d.ts +2 -1
  56. package/dist/components/meta/HeaderUpdate.d.ts +5 -1
  57. package/dist/components/meta/ModalForm.d.ts +41 -11
  58. package/dist/components/meta/Navtabs.d.ts +1 -1
  59. package/dist/components/meta/ScrollTable.d.ts +7 -3
  60. package/dist/components/meta/SearchBox.d.ts +8 -5
  61. package/dist/components/meta/SortableItem.d.ts +11 -1
  62. package/dist/components/meta/index.cjs +1 -0
  63. package/dist/components/meta/index.d.ts +1 -0
  64. package/dist/components/meta/index.js +3 -3
  65. package/dist/components/sidebar/Sidebar.types.d.ts +9 -7
  66. package/dist/components/sidebar/index.cjs +1 -0
  67. package/dist/components/sidebar/index.js +1 -1
  68. package/dist/components/single/Detail.d.ts +8 -3
  69. package/dist/components/single/Fields.d.ts +10 -4
  70. package/dist/components/single/Import.d.ts +8 -3
  71. package/dist/components/single/List.d.ts +33 -7
  72. package/dist/components/single/Update.d.ts +10 -4
  73. package/dist/components/single/UpdateDetail.d.ts +3 -2
  74. package/dist/components/single/UpdateTableDetail.d.ts +4 -3
  75. package/dist/components/single/index.cjs +1 -0
  76. package/dist/components/single/index.js +1 -1
  77. package/dist/components/top-navbar/index.cjs +1 -0
  78. package/dist/components/top-navbar/index.js +78 -2
  79. package/dist/echarts-Bi3uwLbg.cjs +1 -0
  80. package/dist/{chunks/echarts-CRmndsxC.js → echarts-CTzMqeR5.js} +4 -4
  81. package/dist/form-heyswTRq.js +3897 -0
  82. package/dist/form-sgtop6li.cjs +49 -0
  83. package/dist/hook/common.d.ts +87 -0
  84. package/dist/hook/detail.cjs +1 -0
  85. package/dist/hook/detail.d.ts +9 -15
  86. package/dist/hook/detail.js +1 -11
  87. package/dist/hook/fields.cjs +1 -0
  88. package/dist/hook/fields.d.ts +6 -14
  89. package/dist/hook/fields.js +1 -11
  90. package/dist/hook/import.d.ts +6 -11
  91. package/dist/hook/index.cjs +1 -0
  92. package/dist/hook/index.d.ts +29 -20
  93. package/dist/hook/index.js +14 -11
  94. package/dist/hook/update.cjs +1 -0
  95. package/dist/hook/update.d.ts +11 -19
  96. package/dist/hook/update.js +12 -9
  97. package/dist/index.cjs +1 -0
  98. package/dist/index.d.ts +16 -0
  99. package/dist/index.js +14 -11
  100. package/dist/meta-BANk9kHW.cjs +1 -0
  101. package/dist/meta-CheDAmMh.js +745 -0
  102. package/dist/rolldown-runtime-BocRIvOZ.cjs +1 -0
  103. package/dist/sidebar-CfQAYWi-.cjs +1 -0
  104. package/dist/{chunks/sidebar-Dj4Xr9du.js → sidebar-CzRmfvhi.js} +10 -13
  105. package/dist/{chunks/single-CRF61o_U.js → single-BsJ7TYJi.js} +364 -282
  106. package/dist/single-C2WPEjhk.cjs +1 -0
  107. package/dist/style.cjs +0 -0
  108. package/dist/style.d.ts +0 -0
  109. package/dist/style.js +0 -0
  110. package/dist/types/Menu.d.ts +25 -0
  111. package/dist/utils/Common.d.ts +224 -43
  112. package/dist/utils/CusRoute.d.ts +21 -1
  113. package/dist/utils/Env.d.ts +23 -2
  114. package/dist/utils/Group.d.ts +12 -1
  115. package/dist/utils/Validator.d.ts +34 -12
  116. package/dist/utils/index.cjs +11 -0
  117. package/dist/utils/index.d.ts +2 -1
  118. package/dist/utils/index.js +212 -171
  119. package/package.json +190 -163
  120. package/dist/chunks/Common-BURf0rBN.js +0 -222
  121. package/dist/chunks/Env-DRXhvUcb.js +0 -16
  122. package/dist/chunks/UDragFile-BnUR3riq.js +0 -92
  123. package/dist/chunks/form-CPkpL5eA.js +0 -45889
  124. package/dist/chunks/loader-BUiOnhOH.js +0 -1
  125. package/dist/chunks/meta-4qPWijBT.js +0 -758
  126. package/dist/chunks/top-navbar-Bob0gMUh.js +0 -78
  127. package/scripts/postinstall.cjs +0 -80
  128. /package/dist/{chunks/SortableItem-B4-Zsso3.js → SortableItem-B4-Zsso3.js} +0 -0
  129. /package/dist/{components/meta/Pdfviewer.d.ts → hook/import.cjs} +0 -0
@@ -1,60 +1,71 @@
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-BURf0rBN.js";
3
- import { n as l, r as u, t as d } from "./Validator-CXYkI7vJ.js";
4
- import { t as f } from "./UDragFile-BnUR3riq.js";
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-DuS-gHNR.js";
7
- import T, { createRef as E } from "react";
8
- import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
9
- import { Form as A, Link as j } from "react-router-dom";
10
- import { Helmet as M } from "react-helmet-async";
11
- //#region src/hook/detail.ts
12
- var N = (e) => {
13
- e.preventDefault();
14
- let { name: t, type: n, value: r } = e.target;
15
- if (n === "file") {
16
- let n = e.target.files;
17
- return { [t]: n ? n[0] : null };
18
- }
19
- return { [t]: r };
20
- }, P = (e, t, n, r, i, a) => {
1
+ import { t as e } from "./Env-SHztUA3s.js";
2
+ import { C as t, S as n, a as r, b as i, d as a, n as o, s, x as c, y as l } from "./Common-_PK8HLKN.js";
3
+ import { n as u, o as d, r as f, t as p } from "./Validator-D2zwZeov.js";
4
+ import { t as m } from "./UDragFile-D8wOZ1Ut.js";
5
+ import { t as h } from "./SpinnerLoader-CyhOQC6d.js";
6
+ import { a as g, c as _, d as v, i as y, l as b, n as x, o as S, r as C, s as w, t as T, u as E } from "./HeaderUpdate-drlnuHI8.js";
7
+ import { r as D } from "./common-CEZp8xpQ.js";
8
+ import O, { createRef as k } from "react";
9
+ import { Fragment as A, jsx as j, jsxs as M } from "react/jsx-runtime";
10
+ import { Form as N, Link as P } from "react-router-dom";
11
+ import { Helmet as F } from "react-helmet-async";
12
+ //#region src/utils/Group.ts
13
+ var I = (e, t, n, r, i, a) => {
21
14
  if (!a) return !1;
22
- if (a == 1) return !0;
23
- for (let o of e) {
24
- if (o.module == t && o.controller == n && o.action == r && o.code == i && o.status !== 1) return o.isPer;
25
- if (o.subs && o.subs.length > 0 && !P(o.subs, t, n, r, i, a)) return !1;
15
+ if (a === 1) return !0;
16
+ if (!Array.isArray(e)) return !1;
17
+ for (let o of e) if (o) {
18
+ if (o.module === t && o.controller === n && o.action === r && Number(o.code) === Number(i)) return o.status !== 0 && !!o.isPer;
19
+ if (Array.isArray(o.subs) && o.subs.length > 0 && I(o.subs, t, n, r, i, a)) return !0;
26
20
  }
27
- return !0;
28
- }, { API_URL: F, ADMIN_URI: I } = await e(), L = class extends T.Component {
21
+ return !1;
22
+ }, L = class extends O.Component {
29
23
  effectRan = !1;
30
24
  module = "admins";
31
25
  controller = "";
32
26
  state = {
33
27
  data: { filter: {} },
34
- formValue: void 0,
28
+ formValue: {},
35
29
  item: void 0,
36
30
  isDetail: void 0
37
31
  };
38
32
  title = "";
39
33
  cUri = "";
40
- cLink = I + this.cUri;
41
- API_URL = F;
42
- ADMIN_URI = I;
34
+ _envOverride = {};
35
+ _cLinkOverride;
36
+ get API_URL() {
37
+ return this._envOverride.API_URL ?? e().API_URL ?? "";
38
+ }
39
+ set API_URL(e) {
40
+ this._envOverride.API_URL = e;
41
+ }
42
+ get ADMIN_URI() {
43
+ return this._envOverride.ADMIN_URI ?? e().ADMIN_URI ?? "";
44
+ }
45
+ set ADMIN_URI(e) {
46
+ this._envOverride.ADMIN_URI = e;
47
+ }
48
+ get cLink() {
49
+ return this._cLinkOverride ?? this.ADMIN_URI + this.cUri;
50
+ }
51
+ set cLink(e) {
52
+ this._cLinkOverride = e;
53
+ }
43
54
  getDataUrl = "";
44
55
  ctype = "application/json";
45
56
  fluid = !1;
46
57
  isBackUri = !0;
47
58
  debug = !1;
48
- renderForm = () => /* @__PURE__ */ O(D, {});
59
+ renderForm = () => /* @__PURE__ */ j(A, {});
49
60
  syncPermissionsAndState = async () => {
50
- let { menuData: e, user: t } = this.props, n = { isDetail: P(e, this.module, this.controller, "detail", 0, t.groupId) };
61
+ let { menuData: e, user: t } = this.props, n = { isDetail: I(e, this.module, this.controller, "detail", 0, t.groupId) };
51
62
  this.setState(n, async () => {
52
- let e = r();
63
+ let e = a();
53
64
  if (e && n.isDetail) {
54
- let t = (await o(this.getDataUrl + "/" + e, {}, "GET", "application/json", !1))?.data;
65
+ let t = await o(this.getDataUrl + "/" + e, {}, "GET", "application/json", !1), n = t ? t.data : void 0;
55
66
  this.setState({
56
- item: t || !1,
57
- formValue: t ? JSON.parse(JSON.stringify(t)) : {}
67
+ item: n || !1,
68
+ formValue: n ? JSON.parse(JSON.stringify(n)) : {}
58
69
  }, async () => {
59
70
  await this.componentDidMountAfter();
60
71
  });
@@ -66,7 +77,7 @@ var N = (e) => {
66
77
  if (this.effectRan) return;
67
78
  this.effectRan = !0, this.props.user?.groupId && await this.syncPermissionsAndState();
68
79
  } catch (e) {
69
- e.message == "invalid_404" && this.props.navigate(this.cUri), s(e.message);
80
+ s(e) === "invalid_404" && this.props.navigate(this.cUri), c(s(e));
70
81
  }
71
82
  }
72
83
  componentDidMount() {
@@ -74,7 +85,7 @@ var N = (e) => {
74
85
  }
75
86
  componentDidMountAfter = async () => {};
76
87
  renderHeaderDetail() {
77
- return /* @__PURE__ */ O(x, {
88
+ return /* @__PURE__ */ j(C, {
78
89
  adminUri: this.ADMIN_URI,
79
90
  title: this.title,
80
91
  cUri: this.cUri
@@ -82,7 +93,7 @@ var N = (e) => {
82
93
  }
83
94
  handleChange = async (e) => {
84
95
  e.preventDefault();
85
- let t = N(e);
96
+ let t = D(e);
86
97
  this.debug && console.log("handleChange:", e.target.name, e.target.value), this.setState((e) => ({ formValue: {
87
98
  ...e.formValue,
88
99
  ...t
@@ -90,15 +101,15 @@ var N = (e) => {
90
101
  };
91
102
  render() {
92
103
  let { isDetail: e, item: t } = this.state;
93
- return e ? t === !1 ? /* @__PURE__ */ O(_, {
104
+ return e ? t === !1 ? /* @__PURE__ */ j(y, {
94
105
  cUriTitle: this.title,
95
106
  cUri: this.cUri,
96
107
  title: this.title + " | Chi tiết"
97
- }) : /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O(M, { children: /* @__PURE__ */ O("title", { children: this.title }) }), /* @__PURE__ */ k("div", {
108
+ }) : /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j(F, { children: /* @__PURE__ */ j("title", { children: this.title }) }), /* @__PURE__ */ M("div", {
98
109
  className: `mb-3 ${this.fluid ? "container-fluid" : "container"}`,
99
- children: [this.renderHeaderDetail(), /* @__PURE__ */ O("div", {
110
+ children: [this.renderHeaderDetail(), /* @__PURE__ */ j("div", {
100
111
  className: "position-relative",
101
- children: /* @__PURE__ */ O(p, {
112
+ children: /* @__PURE__ */ j(h, {
102
113
  loading: !t,
103
114
  style: {
104
115
  minHeight: 200,
@@ -107,22 +118,14 @@ var N = (e) => {
107
118
  children: this.renderForm()
108
119
  })
109
120
  })]
110
- })] }) : /* @__PURE__ */ O(m, {
121
+ })] }) : /* @__PURE__ */ j(g, {
111
122
  cUriTitle: this.title,
112
123
  cUri: this.cUri,
113
124
  title: this.title + " | Chi tiết",
114
125
  fluid: this.fluid
115
126
  });
116
127
  }
117
- }, R = (e) => {
118
- e.preventDefault();
119
- let { name: t, type: n, value: r } = e.target;
120
- if (n === "file") {
121
- let n = e.target.files;
122
- return { [t]: n ? n[0] : null };
123
- }
124
- return { [t]: r };
125
- }, { API_URL: z, ADMIN_URI: B } = await e(), V = class extends T.Component {
128
+ }, R = class extends O.Component {
126
129
  effectRan = !1;
127
130
  module = "admins";
128
131
  controller = "";
@@ -135,9 +138,26 @@ var N = (e) => {
135
138
  };
136
139
  title = "";
137
140
  cUri = "";
138
- cLink = B + this.cUri;
139
- API_URL = z;
140
- ADMIN_URI = B;
141
+ _envOverride = {};
142
+ _cLinkOverride;
143
+ get API_URL() {
144
+ return this._envOverride.API_URL ?? e().API_URL ?? "";
145
+ }
146
+ set API_URL(e) {
147
+ this._envOverride.API_URL = e;
148
+ }
149
+ get ADMIN_URI() {
150
+ return this._envOverride.ADMIN_URI ?? e().ADMIN_URI ?? "";
151
+ }
152
+ set ADMIN_URI(e) {
153
+ this._envOverride.ADMIN_URI = e;
154
+ }
155
+ get cLink() {
156
+ return this._cLinkOverride ?? this.ADMIN_URI + this.cUri;
157
+ }
158
+ set cLink(e) {
159
+ this._cLinkOverride = e;
160
+ }
141
161
  getDataUrl = "";
142
162
  editUrl = "";
143
163
  createUrl = "";
@@ -145,24 +165,28 @@ var N = (e) => {
145
165
  fluid = !1;
146
166
  isBackUri = !1;
147
167
  debug = !1;
148
- renderForm = () => /* @__PURE__ */ O(D, {});
149
- renderAfterForm = () => /* @__PURE__ */ O(D, {});
168
+ renderForm = () => /* @__PURE__ */ j(A, {});
169
+ renderAfterForm = () => /* @__PURE__ */ j(A, {});
150
170
  handleChange = async (e) => {
151
171
  e.preventDefault();
152
- let t = R(e);
172
+ let t = D(e);
153
173
  this.debug && console.log("handleChange:", e.target.name, e.target.value), this.setState((e) => ({ formValue: {
154
174
  ...e.formValue,
155
175
  ...t
156
176
  } }));
157
177
  };
158
178
  syncPermissionsAndState = async () => {
159
- let { menuData: e, user: t } = this.props, n = { isDetail: P(e, this.module, this.controller, "detail", 0, t.groupId) };
179
+ let { menuData: e, user: t } = this.props, n = { isDetail: I(e, this.module, this.controller, "detail", 0, t.groupId) };
160
180
  this.setState(n, async () => {
161
- let e = (await o(this.getDataUrl, { table: this.table }, "GET", "application/json", !1))?.data;
162
- this.setState({
163
- item: e || !1,
164
- formValue: e ? { ...e } : {}
165
- }), new d("#fieldUpdate").run();
181
+ try {
182
+ let e = await o(this.getDataUrl, { table: this.table }, "GET", "application/json", !1), t = e ? e.data : void 0;
183
+ this.setState({
184
+ item: t || !1,
185
+ formValue: t ? { ...t } : {}
186
+ }), new p("#fieldUpdate").run();
187
+ } catch (e) {
188
+ s(e) === "invalid_404" && this.props.navigate(this.cUri), c(s(e));
189
+ }
166
190
  });
167
191
  };
168
192
  async initDidMount() {
@@ -170,7 +194,7 @@ var N = (e) => {
170
194
  if (this.effectRan) return;
171
195
  this.effectRan = !0, this.props.user?.groupId && (await this.syncPermissionsAndState(), await this.componentDidMountAfter());
172
196
  } catch (e) {
173
- e.message == "invalid_404" && this.props.navigate(this.cUri), s(e.message);
197
+ s(e) === "invalid_404" && this.props.navigate(this.cUri), c(s(e));
174
198
  }
175
199
  }
176
200
  componentDidMount() {
@@ -179,13 +203,13 @@ var N = (e) => {
179
203
  componentDidMountAfter = async () => {};
180
204
  handleSubmit = async (e) => {
181
205
  e.preventDefault();
182
- let { formValue: t } = this.state, r = new d("#fieldUpdate");
183
- if (!r.hasErrors() && !r.isIncomplete()) {
184
- n("#fieldUpdate", !0);
206
+ let { formValue: r } = this.state, i = new p("#fieldUpdate");
207
+ if (!i.hasErrors() && !i.isIncomplete()) {
208
+ t("#fieldUpdate", !0);
185
209
  try {
186
- t.table ||= this.table;
187
- let e = await o(this.editUrl, t, "POST", this.ctype);
188
- if (c("Cập nhật thành công", "top-end", !0), e?.data?.id) {
210
+ r.table ||= this.table;
211
+ let e = await o(this.editUrl, r, "POST", this.ctype);
212
+ if (n("Cập nhật thành công", "top-end", !0), e.data.id) {
189
213
  if (this.isBackUri) return this.props.navigate(this.cUri);
190
214
  this.props.navigate(this.cUri + "/fields"), this.setState({
191
215
  item: { ...e.data },
@@ -195,33 +219,33 @@ var N = (e) => {
195
219
  });
196
220
  }
197
221
  } catch (e) {
198
- s(e.message);
222
+ c(s(e));
199
223
  } finally {
200
- n("#fieldUpdate", !1);
224
+ t("#fieldUpdate", !1);
201
225
  }
202
226
  }
203
227
  };
204
228
  afterSubmit = async (e) => {};
205
229
  renderHeaderUpdate() {
206
- return /* @__PURE__ */ O(C, {
230
+ return /* @__PURE__ */ j(T, {
207
231
  adminUri: this.ADMIN_URI,
208
232
  title: this.title,
209
233
  cUri: this.cUri,
210
- itemId: this.state.item?.id
234
+ itemId: d(this.state.item)
211
235
  });
212
236
  }
213
237
  render() {
214
238
  let { isDetail: e, item: t } = this.state;
215
- return e === !1 ? /* @__PURE__ */ O(m, {
239
+ return e === !1 ? /* @__PURE__ */ j(g, {
216
240
  cUriTitle: this.title,
217
241
  cUri: this.cUri,
218
242
  title: this.title,
219
243
  fluid: this.fluid
220
- }) : /* @__PURE__ */ k(D, { children: [
221
- /* @__PURE__ */ O(M, { children: /* @__PURE__ */ k("title", { children: [this.title, " | Tùy chỉnh dữ liệu"] }) }),
222
- /* @__PURE__ */ O("div", {
244
+ }) : /* @__PURE__ */ M(A, { children: [
245
+ /* @__PURE__ */ j(F, { children: /* @__PURE__ */ M("title", { children: [this.title, " | Tùy chỉnh dữ liệu"] }) }),
246
+ /* @__PURE__ */ j("div", {
223
247
  className: `position-relative mb-3 ${this.fluid ? "container-fluid" : "container"}`,
224
- children: /* @__PURE__ */ O(A, {
248
+ children: /* @__PURE__ */ j(N, {
225
249
  id: "fieldUpdate",
226
250
  className: "position-relative",
227
251
  method: "post",
@@ -229,7 +253,7 @@ var N = (e) => {
229
253
  "data-toggle": "validator",
230
254
  role: "form",
231
255
  onSubmit: this.handleSubmit,
232
- children: /* @__PURE__ */ k(p, {
256
+ children: /* @__PURE__ */ M(h, {
233
257
  loading: !t,
234
258
  style: {
235
259
  minHeight: 200,
@@ -242,7 +266,7 @@ var N = (e) => {
242
266
  this.renderAfterForm()
243
267
  ] });
244
268
  }
245
- }, { API_URL: H, ADMIN_URI: U } = await e(), W = class extends T.Component {
269
+ }, z = class extends O.Component {
246
270
  module = "admins";
247
271
  controller = "";
248
272
  state = {
@@ -253,9 +277,26 @@ var N = (e) => {
253
277
  };
254
278
  title = "";
255
279
  cUri = "";
256
- cLink = U + this.cUri;
257
- API_URL = H;
258
- ADMIN_URI = U;
280
+ _envOverride = {};
281
+ _cLinkOverride;
282
+ get API_URL() {
283
+ return this._envOverride.API_URL ?? e().API_URL ?? "";
284
+ }
285
+ set API_URL(e) {
286
+ this._envOverride.API_URL = e;
287
+ }
288
+ get ADMIN_URI() {
289
+ return this._envOverride.ADMIN_URI ?? e().ADMIN_URI ?? "";
290
+ }
291
+ set ADMIN_URI(e) {
292
+ this._envOverride.ADMIN_URI = e;
293
+ }
294
+ get cLink() {
295
+ return this._cLinkOverride ?? this.ADMIN_URI + this.cUri;
296
+ }
297
+ set cLink(e) {
298
+ this._cLinkOverride = e;
299
+ }
259
300
  importUrl = "";
260
301
  importFile = "assetorigin.xlsx";
261
302
  ctype = "multipart/form-data";
@@ -276,18 +317,18 @@ var N = (e) => {
276
317
  };
277
318
  syncPermissionsAndState = () => {
278
319
  let { menuData: e, user: t } = this.props, n = {
279
- isCre: P(e, this.module, this.controller, "update", 0, t.groupId),
280
- isEdit: P(e, this.module, this.controller, "update", 1, t.groupId)
320
+ isCre: I(e, this.module, this.controller, "update", 0, t.groupId),
321
+ isEdit: I(e, this.module, this.controller, "update", 1, t.groupId)
281
322
  };
282
323
  this.setState(n, async () => {
283
- new d("#itemImport").run();
324
+ new p("#itemImport").run();
284
325
  });
285
326
  };
286
327
  async initDidMount() {
287
328
  try {
288
329
  this.props.user?.groupId && (this.syncPermissionsAndState(), this.componentDidMountAfter());
289
330
  } catch (e) {
290
- e.message == "invalid_404" && this.props.navigate(this.cUri), s(e.message);
331
+ s(e) === "invalid_404" && this.props.navigate(this.cUri), c(s(e));
291
332
  }
292
333
  }
293
334
  componentDidMount() {
@@ -296,20 +337,20 @@ var N = (e) => {
296
337
  componentDidMountAfter = async () => {};
297
338
  handleSubmit = async (e) => {
298
339
  e.preventDefault();
299
- let { formValue: t } = this.state, r = new d("#itemImport");
300
- if (!r.hasErrors() && !r.isIncomplete()) {
301
- n("#itemImport", !0);
340
+ let { formValue: r } = this.state, i = new p("#itemImport");
341
+ if (!i.hasErrors() && !i.isIncomplete()) {
342
+ t("#itemImport", !0);
302
343
  try {
303
- let e = await o(this.importUrl, t, "POST", this.ctype);
304
- e.data?.error?.length ? e?.data?.error && this.setState({ error: Object.fromEntries(e?.data?.error.map((e, t) => [t, e])) }) : (this.props.navigate(this.cUri), c("Import thành công", "top-end", !0));
344
+ let e = await o(this.importUrl, r, "POST", this.ctype);
345
+ e.data?.error?.length ? Array.isArray(e.data?.error) && e.data.error.length && this.setState({ error: Object.fromEntries(e.data.error.map((e, t) => [t, e])) }) : (this.props.navigate(this.cUri), n("Import thành công", "top-end", !0));
305
346
  } catch (e) {
306
- s(e.message);
347
+ c(s(e));
307
348
  } finally {
308
- n("#itemImport", !1);
349
+ t("#itemImport", !1);
309
350
  }
310
351
  }
311
352
  };
312
- renderForm = () => /* @__PURE__ */ O(D, { children: /* @__PURE__ */ O(f, {
353
+ renderForm = () => /* @__PURE__ */ j(A, { children: /* @__PURE__ */ j(m, {
313
354
  onChange: this.handleChange,
314
355
  label: "Import excel",
315
356
  name: "importfile",
@@ -317,18 +358,18 @@ var N = (e) => {
317
358
  }) });
318
359
  render() {
319
360
  let { isCre: e, isEdit: t } = this.state;
320
- return e === !1 && t === !1 ? /* @__PURE__ */ O(m, {
361
+ return e === !1 && t === !1 ? /* @__PURE__ */ j(g, {
321
362
  cUriTitle: this.title,
322
363
  cUri: this.cUri,
323
364
  title: this.title + " | Import",
324
365
  fluid: this.fluid
325
- }) : /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O(M, { children: /* @__PURE__ */ k("title", { children: [
366
+ }) : /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j(F, { children: /* @__PURE__ */ M("title", { children: [
326
367
  this.title,
327
368
  " | ",
328
369
  "Import"
329
- ] }) }), /* @__PURE__ */ O("div", {
370
+ ] }) }), /* @__PURE__ */ j("div", {
330
371
  className: `mb-3 ${this.fluid ? "container-fluid" : "container"}`,
331
- children: /* @__PURE__ */ k(A, {
372
+ children: /* @__PURE__ */ M(N, {
332
373
  id: "itemImport",
333
374
  className: "position-relative",
334
375
  action: this.importUrl,
@@ -337,71 +378,71 @@ var N = (e) => {
337
378
  "data-toggle": "validator",
338
379
  role: "form",
339
380
  onSubmit: this.handleSubmit,
340
- children: [/* @__PURE__ */ k("div", {
381
+ children: [/* @__PURE__ */ M("div", {
341
382
  className: "navbar navbar-main navbar-expand-lg px-0 shadow-none border-radius-xl py-3",
342
- children: [/* @__PURE__ */ O("nav", {
383
+ children: [/* @__PURE__ */ j("nav", {
343
384
  "aria-label": "breadcrumb",
344
- children: /* @__PURE__ */ k("ol", {
385
+ children: /* @__PURE__ */ M("ol", {
345
386
  className: "breadcrumb bg-transparent m-0 p-0",
346
387
  children: [
347
- /* @__PURE__ */ O("li", {
388
+ /* @__PURE__ */ j("li", {
348
389
  className: "breadcrumb-item",
349
- children: /* @__PURE__ */ O(j, {
390
+ children: /* @__PURE__ */ j(P, {
350
391
  className: "text-white",
351
392
  to: this.ADMIN_URI || "/",
352
- children: /* @__PURE__ */ O("i", { className: "fal fa-home" })
393
+ children: /* @__PURE__ */ j("i", { className: "fal fa-home" })
353
394
  })
354
395
  }),
355
- /* @__PURE__ */ O("li", {
396
+ /* @__PURE__ */ j("li", {
356
397
  className: "breadcrumb-item",
357
- children: /* @__PURE__ */ O(j, {
398
+ children: /* @__PURE__ */ j(P, {
358
399
  className: "text-white",
359
400
  to: this.cUri,
360
401
  children: this.title
361
402
  })
362
403
  }),
363
- /* @__PURE__ */ O("li", {
404
+ /* @__PURE__ */ j("li", {
364
405
  className: "breadcrumb-item text-white active",
365
406
  "aria-current": "page",
366
407
  children: "Import"
367
408
  })
368
409
  ]
369
410
  })
370
- }), /* @__PURE__ */ k("div", {
411
+ }), /* @__PURE__ */ M("div", {
371
412
  className: "ms-auto",
372
- children: [/* @__PURE__ */ O(j, {
413
+ children: [/* @__PURE__ */ j(P, {
373
414
  target: "_blank",
374
415
  to: this.API_URL + "/importfile/" + this.importFile,
375
416
  className: "btn btn-sm btn-icon btn-info me-2",
376
417
  title: "Tải xuống biểu mẫu",
377
- children: /* @__PURE__ */ O("i", {
418
+ children: /* @__PURE__ */ j("i", {
378
419
  className: "material-icons text-white position-relative text-lg",
379
420
  children: "file_download"
380
421
  })
381
- }), /* @__PURE__ */ O(j, {
422
+ }), /* @__PURE__ */ j(P, {
382
423
  to: this.cUri,
383
424
  className: "btn btn-sm btn-icon btn-secondary",
384
425
  title: "Trở lại",
385
- children: /* @__PURE__ */ O("i", {
426
+ children: /* @__PURE__ */ j("i", {
386
427
  className: "material-icons text-white position-relative text-lg",
387
428
  children: "reply"
388
429
  })
389
430
  })]
390
431
  })]
391
- }), /* @__PURE__ */ O("div", {
432
+ }), /* @__PURE__ */ j("div", {
392
433
  className: "card",
393
- children: /* @__PURE__ */ O("div", {
434
+ children: /* @__PURE__ */ j("div", {
394
435
  className: "card-body pb-0",
395
- children: /* @__PURE__ */ O("div", {
436
+ children: /* @__PURE__ */ j("div", {
396
437
  className: "row justify-content-center",
397
- children: /* @__PURE__ */ k("div", {
438
+ children: /* @__PURE__ */ M("div", {
398
439
  className: "col-md-8 pt-5 pb-4",
399
440
  children: [
400
- /* @__PURE__ */ O("div", { dangerouslySetInnerHTML: { __html: i(this.state.error) } }),
441
+ /* @__PURE__ */ j("div", { dangerouslySetInnerHTML: { __html: l(this.state.error) } }),
401
442
  this.renderForm(),
402
- /* @__PURE__ */ O("div", {
443
+ /* @__PURE__ */ j("div", {
403
444
  className: "w-100 d-flex",
404
- children: /* @__PURE__ */ O("button", {
445
+ children: /* @__PURE__ */ j("button", {
405
446
  title: "Import",
406
447
  type: "submit",
407
448
  className: "btn btn-success mb-4 mx-auto",
@@ -416,7 +457,7 @@ var N = (e) => {
416
457
  })
417
458
  })] });
418
459
  }
419
- }, { API_URL: G, ADMIN_URI: K } = await e(), q = class extends T.Component {
460
+ }, B = class extends O.Component {
420
461
  effectRan = !1;
421
462
  fluid = !1;
422
463
  module = "admins";
@@ -455,9 +496,26 @@ var N = (e) => {
455
496
  "del"
456
497
  ];
457
498
  cUri = "";
458
- cLink = K + this.cUri;
459
- API_URL = G;
460
- ADMIN_URI = K;
499
+ _envOverride = {};
500
+ _cLinkOverride;
501
+ get API_URL() {
502
+ return this._envOverride.API_URL ?? e().API_URL ?? "";
503
+ }
504
+ set API_URL(e) {
505
+ this._envOverride.API_URL = e;
506
+ }
507
+ get ADMIN_URI() {
508
+ return this._envOverride.ADMIN_URI ?? e().ADMIN_URI ?? "";
509
+ }
510
+ set ADMIN_URI(e) {
511
+ this._envOverride.ADMIN_URI = e;
512
+ }
513
+ get cLink() {
514
+ return this._cLinkOverride ?? this.ADMIN_URI + this.cUri;
515
+ }
516
+ set cLink(e) {
517
+ this._cLinkOverride = e;
518
+ }
461
519
  getDataUrl = "";
462
520
  deleteUrl = "";
463
521
  copyUrl = "";
@@ -466,10 +524,10 @@ var N = (e) => {
466
524
  handleChange = async (e) => {
467
525
  try {
468
526
  e.preventDefault();
469
- let { name: t } = e.target, n = await v(e, this.state.data.filter || {});
527
+ let { name: t } = e.target, n = await b(e, this.state.data.filter || {});
470
528
  if (t === "pageLen") {
471
529
  await this.setFilter(n);
472
- let e = n ? a(n) : "";
530
+ let e = n ? r(n) : "";
473
531
  this.props.navigate(`${this.cUri}?${e}`, { replace: !0 }), await this.fetchData();
474
532
  } else this.setState((e) => ({ data: {
475
533
  ...e.data,
@@ -482,7 +540,7 @@ var N = (e) => {
482
540
  handleSearchForm = async (e) => {
483
541
  try {
484
542
  e.preventDefault();
485
- let t = await h(this.state.data.filter || {}, this.cUri, this.props.navigate);
543
+ let t = await _(this.state.data.filter || {}, this.cUri, this.props.navigate);
486
544
  await this.setFilter(t), await this.fetchData();
487
545
  } catch (e) {
488
546
  console.log(e);
@@ -491,52 +549,52 @@ var N = (e) => {
491
549
  handleClickPage = async (e) => {
492
550
  try {
493
551
  e.preventDefault();
494
- let t = await S(e, this.state.data.filter || {}, this.cUri, this.props.navigate);
552
+ let t = await w(e, this.state.data.filter || {}, this.cUri, this.props.navigate);
495
553
  await this.setFilter(t), await this.fetchData();
496
554
  } catch (e) {
497
- s(e.message);
555
+ c(s(e));
498
556
  }
499
557
  };
500
558
  handleDeleteOne = async (e) => {
501
- t().then(async () => {
559
+ i().then(async () => {
502
560
  try {
503
- await o(`${this.deleteUrl}/${e}`, {}, "GET"), c("Xoá thành công!", "top-end", !0), await this.fetchData();
561
+ await o(`${this.deleteUrl}/${e}`, {}, "DELETE"), n("Xoá thành công!", "top-end", !0), await this.fetchData();
504
562
  } catch (e) {
505
- s(e.message);
563
+ c(s(e));
506
564
  }
507
565
  });
508
566
  };
509
567
  handleDelete = async () => {
510
- this.state.selectedIds.length ? t().then(async () => {
568
+ this.state.selectedIds.length ? i().then(async () => {
511
569
  try {
512
- await o(this.deleteUrl, { selected: this.state.selectedIds }, "POST"), c("Xoá thành công!", "top-end", !0), await this.fetchData();
570
+ await o(this.deleteUrl, { selected: this.state.selectedIds }, "POST"), n("Xoá thành công!", "top-end", !0), await this.fetchData();
513
571
  } catch (e) {
514
- s(e.message);
572
+ c(s(e));
515
573
  }
516
- }) : s("Vui lòng chọn thông tin");
574
+ }) : c("Vui lòng chọn thông tin");
517
575
  };
518
576
  handleCopy = async () => {
519
- this.state.selectedIds.length ? t().then(async () => {
577
+ this.state.selectedIds.length ? i().then(async () => {
520
578
  try {
521
- await o(this.copyUrl, { selected: this.state.selectedIds }, "POST"), c("Sao chép thành công!", "top-end", !0), await this.fetchData();
579
+ await o(this.copyUrl, { selected: this.state.selectedIds }, "POST"), n("Sao chép thành công!", "top-end", !0), await this.fetchData();
522
580
  } catch (e) {
523
- s(e.message);
581
+ c(s(e));
524
582
  }
525
- }) : s("Vui lòng chọn thông tin");
583
+ }) : c("Vui lòng chọn thông tin");
526
584
  };
527
585
  handleExport = async () => {
528
586
  try {
529
- let { data: e } = this.state, t = a(e.filter || {});
587
+ let { data: e } = this.state, t = r(e.filter || {});
530
588
  this.exportUrl && (window.location.href = this.exportUrl + `?${t}`);
531
589
  } catch (e) {
532
- s(e.message);
590
+ c(s(e));
533
591
  }
534
592
  };
535
593
  handleSelectOne = (e, t) => {
536
- this.setState((n) => ({ selectedIds: t ? [.../* @__PURE__ */ new Set([...n.selectedIds, e])] : n.selectedIds.filter((t) => t !== e) }));
594
+ this.setState((n) => ({ selectedIds: t ? [.../* @__PURE__ */ new Set([...Array.isArray(n.selectedIds) ? n.selectedIds : [], e])] : (n.selectedIds ?? []).filter((t) => t !== e) }));
537
595
  };
538
596
  handleSelectAll = (e, t = []) => {
539
- this.setState({ selectedIds: e ? this.state.data.items.map((e) => e.id).filter((e) => e !== void 0 && !t.includes(e)) : [] });
597
+ this.setState({ selectedIds: e ? (this.state.data?.items ?? []).map((e) => e.id).filter((e) => typeof e == "number").filter((e) => !t.includes(e)) : [] });
540
598
  };
541
599
  setFilter(e) {
542
600
  return new Promise((t) => {
@@ -548,7 +606,7 @@ var N = (e) => {
548
606
  }
549
607
  fetchData = async () => {
550
608
  try {
551
- let e = await b(this.state.data.filter || {}, this.getDataUrl);
609
+ let e = await S(this.state.data.filter || {}, this.getDataUrl);
552
610
  if (!e || !("items" in e)) return;
553
611
  this.setState({
554
612
  data: {
@@ -558,7 +616,7 @@ var N = (e) => {
558
616
  selectedIds: []
559
617
  });
560
618
  } catch (e) {
561
- console.error(e.message);
619
+ console.error(s(e));
562
620
  }
563
621
  };
564
622
  syncGetField = async () => ({
@@ -567,12 +625,12 @@ var N = (e) => {
567
625
  });
568
626
  syncPermissionsAndState = async () => {
569
627
  let { menuData: e, user: t } = this.props, n = {
570
- isCre: this.activeMethod.includes("cre") ? P(e, this.module, this.controller, "update", 0, t.groupId) : !1,
571
- isEdit: this.activeMethod.includes("edit") ? P(e, this.module, this.controller, "update", 1, t.groupId) : !1,
572
- isDel: this.activeMethod.includes("del") ? P(e, this.module, this.controller, "delete", 0, t.groupId) : !1,
573
- isDelOne: this.activeMethod.includes("delone") ? P(e, this.module, this.controller, "delete", 1, t.groupId) : !1,
574
- isIndex: this.activeMethod.includes("ind") ? P(e, this.module, this.controller, "index", 0, t.groupId) : !1,
575
- isDetail: this.activeMethod.includes("det") ? P(e, this.module, this.controller, "detail", 0, t.groupId) : !1,
628
+ isCre: this.activeMethod.includes("cre") ? I(e, this.module, this.controller, "update", 0, t.groupId) : !1,
629
+ isEdit: this.activeMethod.includes("edit") ? I(e, this.module, this.controller, "update", 1, t.groupId) : !1,
630
+ isDel: this.activeMethod.includes("del") ? I(e, this.module, this.controller, "delete", 0, t.groupId) : !1,
631
+ isDelOne: this.activeMethod.includes("delone") ? I(e, this.module, this.controller, "delete", 1, t.groupId) : !1,
632
+ isIndex: this.activeMethod.includes("ind") ? I(e, this.module, this.controller, "index", 0, t.groupId) : !1,
633
+ isDetail: this.activeMethod.includes("det") ? I(e, this.module, this.controller, "detail", 0, t.groupId) : !1,
576
634
  isImport: !!this.activeMethod.includes("imp"),
577
635
  isExport: !!this.activeMethod.includes("exp"),
578
636
  isCopy: !!this.activeMethod.includes("cpy")
@@ -602,7 +660,7 @@ var N = (e) => {
602
660
  };
603
661
  await this.setFilter(n), this.props.user?.groupId && await this.syncPermissionsAndState();
604
662
  } catch (e) {
605
- s(e.message);
663
+ c(s(e));
606
664
  }
607
665
  }
608
666
  componentDidMount() {
@@ -610,7 +668,7 @@ var N = (e) => {
610
668
  }
611
669
  componentDidMountAfter = async () => {};
612
670
  renderHeaderIndex() {
613
- return /* @__PURE__ */ O(y, {
671
+ return /* @__PURE__ */ j(x, {
614
672
  adminUri: this.ADMIN_URI,
615
673
  title: this.title,
616
674
  cUri: this.cUri,
@@ -625,41 +683,41 @@ var N = (e) => {
625
683
  onDelete: this.handleDelete
626
684
  });
627
685
  }
628
- renderTable = () => /* @__PURE__ */ O(D, {});
629
- renderSearch = () => /* @__PURE__ */ O(D, {});
686
+ renderTable = () => /* @__PURE__ */ j(A, {});
687
+ renderSearch = () => /* @__PURE__ */ j(A, {});
630
688
  render() {
631
689
  let { isIndex: e, data: t, loading: n } = this.state;
632
- return e === !1 ? /* @__PURE__ */ O(m, {
690
+ return e === !1 ? /* @__PURE__ */ j(g, {
633
691
  cUriTitle: this.title,
634
692
  cUri: this.cUri,
635
693
  title: this.title,
636
694
  fluid: this.fluid
637
- }) : /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O(M, { children: /* @__PURE__ */ O("title", { children: this.title }) }), /* @__PURE__ */ O(p, {
695
+ }) : /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j(F, { children: /* @__PURE__ */ j("title", { children: this.title }) }), /* @__PURE__ */ j(h, {
638
696
  loading: n,
639
- children: e && /* @__PURE__ */ k("div", {
697
+ children: e && /* @__PURE__ */ M("div", {
640
698
  className: `mb-3 ${this.fluid ? "container-fluid" : "container"}`,
641
- children: [this.renderHeaderIndex(), /* @__PURE__ */ O("div", {
699
+ children: [this.renderHeaderIndex(), /* @__PURE__ */ j("div", {
642
700
  className: "card position-relative",
643
- children: /* @__PURE__ */ O("div", {
701
+ children: /* @__PURE__ */ j("div", {
644
702
  className: "card-body",
645
703
  style: { minHeight: "200px" },
646
- children: /* @__PURE__ */ k("div", {
704
+ children: /* @__PURE__ */ M("div", {
647
705
  className: "searchForm",
648
706
  children: [
649
- /* @__PURE__ */ O("form", {
707
+ /* @__PURE__ */ j("form", {
650
708
  onSubmit: this.handleSearchForm,
651
709
  children: this.renderSearch()
652
710
  }),
653
- t.items.length ? /* @__PURE__ */ O(w, {
711
+ t?.items?.length ? /* @__PURE__ */ j(E, {
654
712
  data: t,
655
713
  onChange: this.handleChange,
656
714
  onClickPage: this.handleClickPage
657
715
  }) : "",
658
- /* @__PURE__ */ O("div", {
716
+ /* @__PURE__ */ j("div", {
659
717
  className: "table-responsive mt-2",
660
718
  children: this.renderTable()
661
719
  }),
662
- t.items.length ? /* @__PURE__ */ O(w, {
720
+ t?.items?.length ? /* @__PURE__ */ j(E, {
663
721
  data: t,
664
722
  onChange: this.handleChange,
665
723
  onClickPage: this.handleClickPage
@@ -671,78 +729,78 @@ var N = (e) => {
671
729
  })
672
730
  })] });
673
731
  }
674
- }, J = ({ adminUri: e, cUri: t, title: n, itemId: r, isSave: i = !0, titleAction: a }) => /* @__PURE__ */ k("div", {
732
+ }, V = ({ adminUri: e, cUri: t, title: n, itemId: r, isSave: i = !0, titleAction: a }) => /* @__PURE__ */ M("div", {
675
733
  className: "navbar navbar-main navbar-expand-lg px-0 shadow-none border-radius-xl py-3",
676
- children: [/* @__PURE__ */ O("nav", {
734
+ children: [/* @__PURE__ */ j("nav", {
677
735
  "aria-label": "breadcrumb",
678
- children: /* @__PURE__ */ k("ol", {
736
+ children: /* @__PURE__ */ M("ol", {
679
737
  className: "breadcrumb bg-transparent m-0 p-0",
680
738
  children: [
681
- /* @__PURE__ */ O("li", {
739
+ /* @__PURE__ */ j("li", {
682
740
  className: "breadcrumb-item",
683
- children: /* @__PURE__ */ O(j, {
741
+ children: /* @__PURE__ */ j(P, {
684
742
  className: "text-white",
685
743
  to: e || "/",
686
- children: /* @__PURE__ */ O("i", { className: "fal fa-home" })
744
+ children: /* @__PURE__ */ j("i", { className: "fal fa-home" })
687
745
  })
688
746
  }),
689
- /* @__PURE__ */ O("li", {
747
+ /* @__PURE__ */ j("li", {
690
748
  className: "breadcrumb-item",
691
- children: /* @__PURE__ */ O(j, {
749
+ children: /* @__PURE__ */ j(P, {
692
750
  className: "text-white",
693
751
  to: t,
694
752
  children: n
695
753
  })
696
754
  }),
697
- /* @__PURE__ */ O("li", {
755
+ /* @__PURE__ */ j("li", {
698
756
  className: "breadcrumb-item text-white active",
699
757
  "aria-current": "page",
700
758
  children: a ?? (r ? "Chỉnh sửa" : "Thêm mới")
701
759
  })
702
760
  ]
703
761
  })
704
- }), /* @__PURE__ */ k("div", {
762
+ }), /* @__PURE__ */ M("div", {
705
763
  className: "ms-auto",
706
- children: [i && /* @__PURE__ */ O(g, {
764
+ children: [i && /* @__PURE__ */ j(v, {
707
765
  title: "Lưu lại",
708
- children: /* @__PURE__ */ O("button", {
766
+ children: /* @__PURE__ */ j("button", {
709
767
  type: "submit",
710
768
  className: "btn btn-sm btn-icon btn-success me-1",
711
- children: /* @__PURE__ */ O("i", {
769
+ children: /* @__PURE__ */ j("i", {
712
770
  className: "material-icons text-white position-relative text-lg",
713
771
  children: "save"
714
772
  })
715
773
  })
716
- }), /* @__PURE__ */ O(g, {
774
+ }), /* @__PURE__ */ j(v, {
717
775
  title: "Trở lại",
718
- children: /* @__PURE__ */ O(j, {
776
+ children: /* @__PURE__ */ j(P, {
719
777
  to: t,
720
778
  className: "btn btn-sm btn-icon btn-secondary",
721
- children: /* @__PURE__ */ O("i", {
779
+ children: /* @__PURE__ */ j("i", {
722
780
  className: "material-icons text-white position-relative text-lg",
723
781
  children: "reply"
724
782
  })
725
783
  })
726
784
  })]
727
785
  })]
728
- }), Y = ({ title: e = "", cUri: t = "", fluid: n = !1, cUriTitle: r = "" }) => /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O(M, { children: /* @__PURE__ */ O("title", { children: e || "Truy cập không được phép" }) }), /* @__PURE__ */ k("div", {
786
+ }), H = ({ title: e = "", cUri: t = "", fluid: n = !1, cUriTitle: r = "" }) => /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j(F, { children: /* @__PURE__ */ j("title", { children: e || "Truy cập không được phép" }) }), /* @__PURE__ */ M("div", {
729
787
  className: `${n ? "container-fluid" : "container"}`,
730
- children: [/* @__PURE__ */ O("div", {
788
+ children: [/* @__PURE__ */ j("div", {
731
789
  className: "navbar navbar-main navbar-expand-lg px-0 shadow-none border-radius-xl py-3",
732
- children: /* @__PURE__ */ O("nav", {
790
+ children: /* @__PURE__ */ j("nav", {
733
791
  "aria-label": "breadcrumb",
734
- children: /* @__PURE__ */ k("ol", {
792
+ children: /* @__PURE__ */ M("ol", {
735
793
  className: "breadcrumb bg-transparent m-0 p-0",
736
- children: [/* @__PURE__ */ O("li", {
794
+ children: [/* @__PURE__ */ j("li", {
737
795
  className: "breadcrumb-item",
738
- children: /* @__PURE__ */ O(j, {
796
+ children: /* @__PURE__ */ j(P, {
739
797
  className: "text-white",
740
798
  to: "/",
741
- children: /* @__PURE__ */ O("i", { className: "fal fa-home" })
799
+ children: /* @__PURE__ */ j("i", { className: "fal fa-home" })
742
800
  })
743
- }), /* @__PURE__ */ O("li", {
801
+ }), /* @__PURE__ */ j("li", {
744
802
  className: "breadcrumb-item",
745
- children: /* @__PURE__ */ O(j, {
803
+ children: /* @__PURE__ */ j(P, {
746
804
  className: "text-white",
747
805
  to: t,
748
806
  children: r
@@ -750,25 +808,25 @@ var N = (e) => {
750
808
  })]
751
809
  })
752
810
  })
753
- }), /* @__PURE__ */ O("div", {
811
+ }), /* @__PURE__ */ j("div", {
754
812
  style: { minHeight: "50vh" },
755
813
  className: "d-flex align-items-center",
756
- children: /* @__PURE__ */ k("div", {
814
+ children: /* @__PURE__ */ M("div", {
757
815
  className: "m-auto text-center",
758
816
  children: [
759
- /* @__PURE__ */ O("h1", {
817
+ /* @__PURE__ */ j("h1", {
760
818
  className: "display-1 text-bolder text-white",
761
819
  children: "403"
762
820
  }),
763
- /* @__PURE__ */ O("h2", {
821
+ /* @__PURE__ */ j("h2", {
764
822
  className: "text-white",
765
823
  children: "Truy cập không được phép"
766
824
  }),
767
- /* @__PURE__ */ O("p", {
825
+ /* @__PURE__ */ j("p", {
768
826
  className: "lead text-white",
769
827
  children: "Xin lỗi, bạn không có quyền truy cập vào trang này."
770
828
  }),
771
- /* @__PURE__ */ O(j, {
829
+ /* @__PURE__ */ j(P, {
772
830
  to: "/",
773
831
  className: "btn btn-outline-white mt-4",
774
832
  children: "trang chủ"
@@ -776,24 +834,24 @@ var N = (e) => {
776
834
  ]
777
835
  })
778
836
  })]
779
- })] }), X = ({ title: e = "", cUri: t = "", fluid: n = !1, cUriTitle: r = "" }) => /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O(M, { children: /* @__PURE__ */ O("title", { children: e || "Không tìm thấy dữ liệu" }) }), /* @__PURE__ */ k("div", {
837
+ })] }), U = ({ title: e = "", cUri: t = "", fluid: n = !1, cUriTitle: r = "" }) => /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j(F, { children: /* @__PURE__ */ j("title", { children: e || "Không tìm thấy dữ liệu" }) }), /* @__PURE__ */ M("div", {
780
838
  className: `${n ? "container-fluid" : "container"}`,
781
- children: [/* @__PURE__ */ O("div", {
839
+ children: [/* @__PURE__ */ j("div", {
782
840
  className: "navbar navbar-main navbar-expand-lg px-0 shadow-none border-radius-xl py-3",
783
- children: /* @__PURE__ */ O("nav", {
841
+ children: /* @__PURE__ */ j("nav", {
784
842
  "aria-label": "breadcrumb",
785
- children: /* @__PURE__ */ k("ol", {
843
+ children: /* @__PURE__ */ M("ol", {
786
844
  className: "breadcrumb bg-transparent m-0 p-0",
787
- children: [/* @__PURE__ */ O("li", {
845
+ children: [/* @__PURE__ */ j("li", {
788
846
  className: "breadcrumb-item",
789
- children: /* @__PURE__ */ O(j, {
847
+ children: /* @__PURE__ */ j(P, {
790
848
  className: "text-white",
791
849
  to: "/",
792
- children: /* @__PURE__ */ O("i", { className: "fal fa-home" })
850
+ children: /* @__PURE__ */ j("i", { className: "fal fa-home" })
793
851
  })
794
- }), /* @__PURE__ */ O("li", {
852
+ }), /* @__PURE__ */ j("li", {
795
853
  className: "breadcrumb-item",
796
- children: /* @__PURE__ */ O(j, {
854
+ children: /* @__PURE__ */ j(P, {
797
855
  className: "text-white",
798
856
  to: t,
799
857
  children: r
@@ -801,25 +859,25 @@ var N = (e) => {
801
859
  })]
802
860
  })
803
861
  })
804
- }), /* @__PURE__ */ O("div", {
862
+ }), /* @__PURE__ */ j("div", {
805
863
  style: { minHeight: "50vh" },
806
864
  className: "d-flex align-items-center",
807
- children: /* @__PURE__ */ k("div", {
865
+ children: /* @__PURE__ */ M("div", {
808
866
  className: "m-auto text-center",
809
867
  children: [
810
- /* @__PURE__ */ O("h1", {
868
+ /* @__PURE__ */ j("h1", {
811
869
  className: "display-1 text-bolder text-white",
812
870
  children: "404"
813
871
  }),
814
- /* @__PURE__ */ O("h2", {
872
+ /* @__PURE__ */ j("h2", {
815
873
  className: "text-white",
816
874
  children: "Không tìm thấy dữ liệu"
817
875
  }),
818
- /* @__PURE__ */ O("p", {
876
+ /* @__PURE__ */ j("p", {
819
877
  className: "lead text-white",
820
878
  children: "Xin lỗi, dữ liệu của bạn không được tìm thấy"
821
879
  }),
822
- /* @__PURE__ */ O(j, {
880
+ /* @__PURE__ */ j(P, {
823
881
  to: "/",
824
882
  className: "btn btn-outline-white mt-4",
825
883
  children: "trang chủ"
@@ -827,7 +885,7 @@ var N = (e) => {
827
885
  ]
828
886
  })
829
887
  })]
830
- })] }), { API_URL: Z, ADMIN_URI: Q } = await e(), $ = class extends T.Component {
888
+ })] }), W = class extends O.Component {
831
889
  effectRan = !1;
832
890
  module = "admins";
833
891
  controller = "";
@@ -842,9 +900,26 @@ var N = (e) => {
842
900
  };
843
901
  title = "";
844
902
  cUri = "";
845
- cLink = Q + this.cUri;
846
- API_URL = Z;
847
- ADMIN_URI = Q;
903
+ _envOverride = {};
904
+ _cLinkOverride;
905
+ get API_URL() {
906
+ return this._envOverride.API_URL ?? e().API_URL ?? "";
907
+ }
908
+ set API_URL(e) {
909
+ this._envOverride.API_URL = e;
910
+ }
911
+ get ADMIN_URI() {
912
+ return this._envOverride.ADMIN_URI ?? e().ADMIN_URI ?? "";
913
+ }
914
+ set ADMIN_URI(e) {
915
+ this._envOverride.ADMIN_URI = e;
916
+ }
917
+ get cLink() {
918
+ return this._cLinkOverride ?? this.ADMIN_URI + this.cUri;
919
+ }
920
+ set cLink(e) {
921
+ this._cLinkOverride = e;
922
+ }
848
923
  getDataUrl = "";
849
924
  editUrl = "";
850
925
  createUrl = "";
@@ -854,34 +929,34 @@ var N = (e) => {
854
929
  isBackUri = !0;
855
930
  debug = !1;
856
931
  constructor(e) {
857
- super(e), this.formRef = T.createRef();
932
+ super(e), this.formRef = O.createRef();
858
933
  }
859
- renderForm = () => /* @__PURE__ */ O(D, {});
860
- renderAfterForm = () => /* @__PURE__ */ O(D, {});
934
+ renderForm = () => /* @__PURE__ */ j(A, {});
935
+ renderAfterForm = () => /* @__PURE__ */ j(A, {});
861
936
  handleChange = (e) => {
862
937
  e.preventDefault();
863
- let t = u(e);
864
- this.setState((e) => ({ formValue: l(e.formValue, t) }));
938
+ let t = f(e);
939
+ this.setState((e) => ({ formValue: u(e.formValue, t) }));
865
940
  };
866
941
  syncPermissionsAndState = async () => {
867
942
  let { menuData: e, user: t } = this.props, n = {
868
- isCre: P(e, this.module, this.controller, "update", 0, t.groupId),
869
- isEdit: P(e, this.module, this.controller, "update", 1, t.groupId),
870
- isDetail: P(e, this.module, this.controller, "detail", 0, t.groupId)
943
+ isCre: I(e, this.module, this.controller, "update", 0, t.groupId),
944
+ isEdit: I(e, this.module, this.controller, "update", 1, t.groupId),
945
+ isDetail: I(e, this.module, this.controller, "detail", 0, t.groupId)
871
946
  };
872
947
  this.setState(n, async () => {
873
- let e = r();
948
+ let e = a();
874
949
  if (e && n.isEdit) {
875
- let t = (await o(this.getDataUrl + "/" + e, {}, "GET", "application/json", !1))?.data;
950
+ let t = await o(this.getDataUrl + "/" + e, {}, "GET", "application/json", !1), n = t ? t.data : void 0;
876
951
  this.setState({
877
- item: t || !1,
878
- formValue: t ? JSON.parse(JSON.stringify(t)) : {}
952
+ item: n || !1,
953
+ formValue: n ? JSON.parse(JSON.stringify(n)) : {}
879
954
  }, async () => {
880
- this.setState({ loading: !1 }), await this.componentDidMountAfter(), this.formRef.current && new d(this.formRef.current).run();
955
+ this.setState({ loading: !1 }), await this.componentDidMountAfter(), this.formRef.current && new p(this.formRef.current).run();
881
956
  });
882
957
  } else {
883
958
  if (this.setState({ loading: !1 }), await this.componentDidMountAfter(), !this.formRef.current) return;
884
- new d(this.formRef.current).run();
959
+ new p(this.formRef.current).run();
885
960
  }
886
961
  });
887
962
  };
@@ -890,7 +965,7 @@ var N = (e) => {
890
965
  if (this.effectRan) return;
891
966
  this.effectRan = !0, this.props.user?.groupId && await this.syncPermissionsAndState();
892
967
  } catch (e) {
893
- e.message == "invalid_404" && this.props.navigate(this.cUri), s(e.message);
968
+ s(e) === "invalid_404" && this.props.navigate(this.cUri), c(s(e));
894
969
  }
895
970
  }
896
971
  componentDidMount = () => {
@@ -902,12 +977,12 @@ var N = (e) => {
902
977
  });
903
978
  handleSubmit = async (e) => {
904
979
  e.preventDefault();
905
- let { item: t, formValue: n } = this.state, r = Number(t?.id), i = new d(this.formRef.current);
906
- !i.hasErrors() && !i.isIncomplete() && this.formRef.current && this.beforeSubmit().then(async () => {
980
+ let { item: t, formValue: r } = this.state, i = d(t), a = new p(this.formRef.current);
981
+ !a.hasErrors() && !a.isIncomplete() && this.formRef.current && this.beforeSubmit().then(async () => {
907
982
  this.setState({ loading: !0 });
908
983
  try {
909
- let e = r ? this.editUrl + "/" + r : this.createUrl, t = await o(e, n, "POST", this.ctype);
910
- if (c(r ? "Cập nhật thành công" : "Thêm mới thành công", "top-end", !0), t?.data?.id) {
984
+ let e = i ? this.editUrl + "/" + i : this.createUrl, t = await o(e, r, "POST", this.ctype);
985
+ if (n(i ? "Cập nhật thành công" : "Thêm mới thành công", "top-end", !0), t?.data?.id) {
911
986
  if (this.isBackUri) return this.props.navigate(this.cUri);
912
987
  this.props.navigate(this.cUri + "/edit/" + Number(t.data.id)), this.setState({
913
988
  item: { ...t.data },
@@ -917,7 +992,7 @@ var N = (e) => {
917
992
  });
918
993
  }
919
994
  } catch (e) {
920
- s(e.message);
995
+ c(s(e));
921
996
  } finally {
922
997
  this.setState({ loading: !1 });
923
998
  }
@@ -925,33 +1000,33 @@ var N = (e) => {
925
1000
  };
926
1001
  afterSubmit = async (e) => {};
927
1002
  renderHeaderUpdate() {
928
- return /* @__PURE__ */ O(J, {
1003
+ return /* @__PURE__ */ j(V, {
929
1004
  adminUri: this.ADMIN_URI,
930
1005
  title: this.title,
931
1006
  cUri: this.cUri,
932
- itemId: this.state.item?.id
1007
+ itemId: d(this.state.item)
933
1008
  });
934
1009
  }
935
1010
  render() {
936
- let e = r(), { isCre: t, isEdit: n, isDetail: a, item: o } = this.state;
937
- return t === !1 && n === !1 && a === !1 || t === !1 && e === 0 || (n === !1 || a === !1) && e ? /* @__PURE__ */ O(Y, {
1011
+ let e = a(), { isCre: t, isEdit: n, isDetail: r, item: i } = this.state;
1012
+ return t === !1 && n === !1 && r === !1 || t === !1 && e == null || (n === !1 || r === !1) && e ? /* @__PURE__ */ j(H, {
938
1013
  cUriTitle: this.title,
939
1014
  cUri: this.cUri,
940
1015
  title: this.title + " | " + (e ? "Chỉnh sửa" : "Thêm mới"),
941
1016
  fluid: this.fluid
942
- }) : e && o === !1 ? /* @__PURE__ */ O(X, {
1017
+ }) : e && i === !1 ? /* @__PURE__ */ j(U, {
943
1018
  cUriTitle: this.title,
944
1019
  cUri: this.cUri,
945
1020
  title: this.title + " | " + (e ? "Chỉnh sửa" : "Thêm mới")
946
- }) : /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O(M, { children: /* @__PURE__ */ k("title", { children: [
1021
+ }) : /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j(F, { children: /* @__PURE__ */ M("title", { children: [
947
1022
  this.title,
948
1023
  " | ",
949
- o?.id ? "Chỉnh sửa" : "Thêm mới"
950
- ] }) }), /* @__PURE__ */ k("div", {
1024
+ d(i) ? "Chỉnh sửa" : "Thêm mới"
1025
+ ] }) }), /* @__PURE__ */ M("div", {
951
1026
  className: `mb-3 ${this.fluid ? "container-fluid" : "container"}`,
952
1027
  children: [
953
- /* @__PURE__ */ O("div", { dangerouslySetInnerHTML: { __html: i(this.state.error) } }),
954
- /* @__PURE__ */ O(A, {
1028
+ /* @__PURE__ */ j("div", { dangerouslySetInnerHTML: { __html: l(this.state.error) } }),
1029
+ /* @__PURE__ */ j(N, {
955
1030
  ref: this.formRef,
956
1031
  className: "position-relative",
957
1032
  method: "post",
@@ -959,7 +1034,7 @@ var N = (e) => {
959
1034
  "data-toggle": "validator",
960
1035
  role: "form",
961
1036
  onSubmit: this.handleSubmit,
962
- children: /* @__PURE__ */ k(p, {
1037
+ children: /* @__PURE__ */ M(h, {
963
1038
  loading: !!this.state.loading,
964
1039
  style: {
965
1040
  minHeight: 200,
@@ -972,37 +1047,40 @@ var N = (e) => {
972
1047
  ]
973
1048
  })] });
974
1049
  }
975
- }, ee = class extends $ {
1050
+ }, G = class extends W {
976
1051
  urlUpdateDetail = "";
977
1052
  render() {
978
- let e = r(), { isCre: t, isEdit: n, isDetail: a, item: o } = this.state;
979
- return t === !1 && n === !1 && a === !1 || t === !1 && e === 0 || (n === !1 || a === !1) && e ? /* @__PURE__ */ O(Y, {
1053
+ let e = a(), { isCre: t, isEdit: n, isDetail: r, item: i } = this.state;
1054
+ if (t === !1 && n === !1 && r === !1 || t === !1 && e == null || (n === !1 || r === !1) && e) return /* @__PURE__ */ j(H, {
980
1055
  cUriTitle: this.title,
981
1056
  cUri: this.cUri,
982
1057
  title: this.title + " | " + (e ? "Chỉnh sửa" : "Thêm mới"),
983
1058
  fluid: this.fluid
984
- }) : e && o === !1 ? /* @__PURE__ */ O(X, {
1059
+ });
1060
+ if (e && i === !1) return /* @__PURE__ */ j(U, {
985
1061
  cUriTitle: this.title,
986
1062
  cUri: this.cUri,
987
1063
  title: this.title + " | " + (e ? "Chỉnh sửa" : "Thêm mới")
988
- }) : (e && o || !e) && /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O(M, { children: /* @__PURE__ */ k("title", { children: [
1064
+ });
1065
+ let o = d(i);
1066
+ return /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j(F, { children: /* @__PURE__ */ M("title", { children: [
989
1067
  this.title,
990
1068
  " | ",
991
- o?.id ? "Chỉnh sửa" : "Thêm mới"
992
- ] }) }), /* @__PURE__ */ k("div", {
1069
+ o ? "Chỉnh sửa" : "Thêm mới"
1070
+ ] }) }), /* @__PURE__ */ M("div", {
993
1071
  className: `mb-3 ${this.fluid ? "container-fluid" : "container"}`,
994
1072
  children: [
995
- /* @__PURE__ */ O(J, {
1073
+ /* @__PURE__ */ j(V, {
996
1074
  adminUri: this.ADMIN_URI,
997
1075
  title: this.title,
998
1076
  cUri: this.cUri,
999
1077
  isSave: !1,
1000
- itemId: o?.id
1078
+ itemId: o
1001
1079
  }),
1002
- /* @__PURE__ */ O("div", { dangerouslySetInnerHTML: { __html: i(this.state.error) } }),
1003
- /* @__PURE__ */ O("div", {
1080
+ /* @__PURE__ */ j("div", { dangerouslySetInnerHTML: { __html: l(this.state.error) } }),
1081
+ /* @__PURE__ */ j("div", {
1004
1082
  className: "position-relative",
1005
- children: /* @__PURE__ */ O(p, {
1083
+ children: /* @__PURE__ */ j(h, {
1006
1084
  loading: !!this.state.loading,
1007
1085
  style: {
1008
1086
  minHeight: 200,
@@ -1014,18 +1092,19 @@ var N = (e) => {
1014
1092
  ]
1015
1093
  })] });
1016
1094
  }
1017
- handleDetailSubmit = async (e, t) => {
1095
+ handleDetailSubmit = async (e, r) => {
1018
1096
  try {
1019
- if (this.state.item?.id && e?.length) {
1020
- let r = {};
1021
- r.itemid = this.state.item?.id, r.details = e, n(t, !0), await o(this.urlUpdateDetail, r), n(t, !1), c("Thêm tài sản thành công", "top-end", !0), await this.editDetailAfter(this.state.item?.id), this.props.navigate(this.cUri + "/edit/" + this.state.item?.id);
1022
- }
1097
+ let i = d(this.state.item);
1098
+ i && e?.length && (t(r, !0), await o(this.urlUpdateDetail, {
1099
+ itemid: i,
1100
+ details: e
1101
+ }), t(r, !1), n("Thêm tài sản thành công", "top-end", !0), await this.editDetailAfter(i), this.props.navigate(this.cUri + "/edit/" + i));
1023
1102
  } catch (e) {
1024
- s(e.message), n(t, !1);
1103
+ c(s(e)), t(r, !1);
1025
1104
  }
1026
1105
  };
1027
1106
  editDetailAfter = async (e) => {};
1028
- }, te = class extends $ {
1107
+ }, K = class extends W {
1029
1108
  urlGetDeTableList = "";
1030
1109
  urlGetDeTable = "";
1031
1110
  urlCreDeTable = "";
@@ -1034,49 +1113,52 @@ var N = (e) => {
1034
1113
  modalRef;
1035
1114
  isBackUri = !1;
1036
1115
  constructor(e) {
1037
- super(e), this.modalRef = E();
1116
+ super(e), this.modalRef = k();
1038
1117
  }
1039
1118
  async fetchDataDetails() {
1040
1119
  return {};
1041
1120
  }
1042
1121
  render() {
1043
- let e = r(), { isCre: t, isEdit: n, isDetail: i, item: a } = this.state;
1044
- return t === !1 && n === !1 && i === !1 || t === !1 && e === 0 || (n === !1 || i === !1) && e ? /* @__PURE__ */ O(Y, {
1122
+ let e = a(), { isCre: t, isEdit: n, isDetail: r, item: i } = this.state;
1123
+ if (t === !1 && n === !1 && r === !1 || t === !1 && e == null || (n === !1 || r === !1) && e) return /* @__PURE__ */ j(H, {
1045
1124
  cUriTitle: this.title,
1046
1125
  cUri: this.cUri,
1047
1126
  title: this.title + " | " + (e ? "Chỉnh sửa" : "Thêm mới"),
1048
1127
  fluid: this.fluid
1049
- }) : e && a === !1 ? /* @__PURE__ */ O(X, {
1128
+ });
1129
+ if (e && i === !1) return /* @__PURE__ */ j(U, {
1050
1130
  cUriTitle: this.title,
1051
1131
  cUri: this.cUri,
1052
1132
  title: this.title + " | " + (e ? "Chỉnh sửa" : "Thêm mới")
1053
- }) : (e && a || !e) && /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O(M, { children: /* @__PURE__ */ k("title", { children: [
1133
+ });
1134
+ let o = d(i);
1135
+ return /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j(F, { children: /* @__PURE__ */ M("title", { children: [
1054
1136
  this.title,
1055
1137
  " | ",
1056
- a?.id ? "Chỉnh sửa" : "Thêm mới"
1057
- ] }) }), /* @__PURE__ */ k("div", {
1138
+ o ? "Chỉnh sửa" : "Thêm mới"
1139
+ ] }) }), /* @__PURE__ */ M("div", {
1058
1140
  className: `mb-3 ${this.fluid ? "container-fluid" : "container"}`,
1059
1141
  children: [
1060
- /* @__PURE__ */ O(J, {
1142
+ /* @__PURE__ */ j(V, {
1061
1143
  adminUri: this.ADMIN_URI,
1062
1144
  title: this.title,
1063
1145
  cUri: this.cUri,
1064
1146
  isSave: !1,
1065
- itemId: this.state?.item?.id
1147
+ itemId: o
1066
1148
  }),
1067
- a && this.renderDeTable(),
1149
+ i ? this.renderDeTable() : null,
1068
1150
  this.renderForm()
1069
1151
  ]
1070
1152
  })] });
1071
1153
  }
1072
1154
  renderDeTable() {
1073
- return /* @__PURE__ */ O(D, {});
1155
+ return /* @__PURE__ */ j(A, {});
1074
1156
  }
1075
- renderModalDeBody = (e, t) => /* @__PURE__ */ O(D, {});
1157
+ renderModalDeBody = (e, t) => /* @__PURE__ */ j(A, {});
1076
1158
  handleDetailSubmit = async (e) => {
1077
1159
  e.preventDefault();
1078
1160
  };
1079
1161
  editDetailAfter = async (e) => {};
1080
1162
  };
1081
1163
  //#endregion
1082
- export { W as a, q as i, ee as n, V as o, $ as r, L as s, te as t };
1164
+ export { z as a, B as i, G as n, R as o, W as r, L as s, K as t };