master-data-management-react 0.1.3 → 0.1.4
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/README.md +14 -0
- package/dist/hooks/useApiService.d.ts +2 -0
- package/dist/hooks/useApiService.d.ts.map +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.js +323 -317
- package/dist/pages/MasterView/MasterView.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,81 +1,87 @@
|
|
|
1
|
-
import Rt, { useRef as We, useMemo as Re, useState as
|
|
1
|
+
import Rt, { useRef as We, useMemo as Re, useState as j, useEffect as Ce, useCallback as Ie } from "react";
|
|
2
2
|
import { styled as ce, Box as N, Select as Ht, FormControl as Xt, CircularProgress as Le, Divider as zt, Button as ne, Typography as _e, Paper as _t, Autocomplete as Be, TextField as ee, Menu as qt, MenuItem as ke, Alert as Kt } from "@mui/material";
|
|
3
3
|
import { AgGridReact as Jt } from "ag-grid-react";
|
|
4
4
|
import { ModuleRegistry as Qt, ClientSideRowModelModule as gt, AllCommunityModule as Zt } from "ag-grid-community";
|
|
5
|
-
const vt = (a,
|
|
5
|
+
const vt = (a, u) => ({
|
|
6
6
|
getEntities: async () => {
|
|
7
|
-
const d = await a.get(
|
|
7
|
+
const d = await a.get(u.entities);
|
|
8
8
|
return {
|
|
9
9
|
data: d.data.data ?? d.data
|
|
10
10
|
};
|
|
11
11
|
},
|
|
12
12
|
getMetadata: async (d) => {
|
|
13
|
-
const
|
|
13
|
+
const f = await a.get(u.metadata(d));
|
|
14
14
|
return {
|
|
15
|
-
data:
|
|
15
|
+
data: f.data.data ?? f.data
|
|
16
16
|
};
|
|
17
17
|
},
|
|
18
|
-
getRecords: async (d,
|
|
19
|
-
const s = await a.get(
|
|
18
|
+
getRecords: async (d, f) => {
|
|
19
|
+
const s = await a.get(u.records(d), { params: f });
|
|
20
20
|
return {
|
|
21
21
|
data: s.data.data ?? s.data,
|
|
22
22
|
total: s.data.total ?? s.data.count ?? 0
|
|
23
23
|
};
|
|
24
24
|
},
|
|
25
|
-
getRecord: async (d,
|
|
26
|
-
const s = await a.get(
|
|
25
|
+
getRecord: async (d, f) => {
|
|
26
|
+
const s = await a.get(u.recordById(d, f));
|
|
27
27
|
return {
|
|
28
28
|
data: s.data.data ?? s.data
|
|
29
29
|
};
|
|
30
30
|
},
|
|
31
|
-
createRecord: async (d,
|
|
32
|
-
const s = await a.post(
|
|
31
|
+
createRecord: async (d, f) => {
|
|
32
|
+
const s = await a.post(u.records(d), f);
|
|
33
33
|
return {
|
|
34
34
|
data: s.data.data ?? s.data
|
|
35
35
|
};
|
|
36
36
|
},
|
|
37
|
-
updateRecord: async (d,
|
|
38
|
-
const k = await a.put(
|
|
37
|
+
updateRecord: async (d, f, s) => {
|
|
38
|
+
const k = await a.put(u.recordById(d, f), s);
|
|
39
39
|
return {
|
|
40
40
|
data: k.data.data ?? k.data
|
|
41
41
|
};
|
|
42
42
|
},
|
|
43
|
-
deleteRecord: async (d,
|
|
44
|
-
const s = await a.delete(
|
|
43
|
+
deleteRecord: async (d, f) => {
|
|
44
|
+
const s = await a.delete(u.recordById(d, f));
|
|
45
45
|
return {
|
|
46
46
|
data: s.data.data ?? s.data
|
|
47
47
|
};
|
|
48
48
|
},
|
|
49
|
-
exportCSV: async (d,
|
|
50
|
-
params:
|
|
49
|
+
exportCSV: async (d, f) => await a.get(u.exportCSV(d), {
|
|
50
|
+
params: f,
|
|
51
51
|
responseType: "blob"
|
|
52
52
|
}),
|
|
53
|
-
exportExcel: async (d,
|
|
54
|
-
params:
|
|
53
|
+
exportExcel: async (d, f) => await a.get(u.exportExcel(d), {
|
|
54
|
+
params: f,
|
|
55
55
|
responseType: "blob"
|
|
56
|
-
})
|
|
56
|
+
}),
|
|
57
|
+
getDropdownOptions: async (d) => {
|
|
58
|
+
const f = u.dropdownOptions ? u.dropdownOptions(d) : d, s = await a.get(f);
|
|
59
|
+
return {
|
|
60
|
+
data: s.data.data ?? s.data
|
|
61
|
+
};
|
|
62
|
+
}
|
|
57
63
|
});
|
|
58
64
|
var be = { exports: {} }, Ae = {};
|
|
59
65
|
var st;
|
|
60
66
|
function er() {
|
|
61
67
|
if (st) return Ae;
|
|
62
68
|
st = 1;
|
|
63
|
-
var a = Rt,
|
|
64
|
-
function
|
|
65
|
-
var S,
|
|
69
|
+
var a = Rt, u = /* @__PURE__ */ Symbol.for("react.element"), d = /* @__PURE__ */ Symbol.for("react.fragment"), f = Object.prototype.hasOwnProperty, s = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, k = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
70
|
+
function X(p, g, Y) {
|
|
71
|
+
var S, I = {}, C = null, W = null;
|
|
66
72
|
Y !== void 0 && (C = "" + Y), g.key !== void 0 && (C = "" + g.key), g.ref !== void 0 && (W = g.ref);
|
|
67
|
-
for (S in g)
|
|
68
|
-
if (p && p.defaultProps) for (S in g = p.defaultProps, g)
|
|
69
|
-
return { $$typeof:
|
|
73
|
+
for (S in g) f.call(g, S) && !k.hasOwnProperty(S) && (I[S] = g[S]);
|
|
74
|
+
if (p && p.defaultProps) for (S in g = p.defaultProps, g) I[S] === void 0 && (I[S] = g[S]);
|
|
75
|
+
return { $$typeof: u, type: p, key: C, ref: W, props: I, _owner: s.current };
|
|
70
76
|
}
|
|
71
|
-
return Ae.Fragment = d, Ae.jsx =
|
|
77
|
+
return Ae.Fragment = d, Ae.jsx = X, Ae.jsxs = X, Ae;
|
|
72
78
|
}
|
|
73
|
-
var
|
|
79
|
+
var Oe = {};
|
|
74
80
|
var it;
|
|
75
81
|
function tr() {
|
|
76
82
|
return it || (it = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
77
|
-
var a = Rt,
|
|
78
|
-
function
|
|
83
|
+
var a = Rt, u = /* @__PURE__ */ Symbol.for("react.element"), d = /* @__PURE__ */ Symbol.for("react.portal"), f = /* @__PURE__ */ Symbol.for("react.fragment"), s = /* @__PURE__ */ Symbol.for("react.strict_mode"), k = /* @__PURE__ */ Symbol.for("react.profiler"), X = /* @__PURE__ */ Symbol.for("react.provider"), p = /* @__PURE__ */ Symbol.for("react.context"), g = /* @__PURE__ */ Symbol.for("react.forward_ref"), Y = /* @__PURE__ */ Symbol.for("react.suspense"), S = /* @__PURE__ */ Symbol.for("react.suspense_list"), I = /* @__PURE__ */ Symbol.for("react.memo"), C = /* @__PURE__ */ Symbol.for("react.lazy"), W = /* @__PURE__ */ Symbol.for("react.offscreen"), te = Symbol.iterator, de = "@@iterator";
|
|
84
|
+
function q(e) {
|
|
79
85
|
if (e === null || typeof e != "object")
|
|
80
86
|
return null;
|
|
81
87
|
var t = te && e[te] || e[de];
|
|
@@ -84,14 +90,14 @@ function tr() {
|
|
|
84
90
|
var V = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
85
91
|
function D(e) {
|
|
86
92
|
{
|
|
87
|
-
for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0),
|
|
88
|
-
n[
|
|
93
|
+
for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), c = 1; c < t; c++)
|
|
94
|
+
n[c - 1] = arguments[c];
|
|
89
95
|
P("error", e, n);
|
|
90
96
|
}
|
|
91
97
|
}
|
|
92
98
|
function P(e, t, n) {
|
|
93
99
|
{
|
|
94
|
-
var
|
|
100
|
+
var c = V.ReactDebugCurrentFrame, A = c.getStackAddendum();
|
|
95
101
|
A !== "" && (t += "%s", n = n.concat([A]));
|
|
96
102
|
var y = n.map(function(_) {
|
|
97
103
|
return String(_);
|
|
@@ -99,19 +105,19 @@ function tr() {
|
|
|
99
105
|
y.unshift("Warning: " + t), Function.prototype.apply.call(console[e], console, y);
|
|
100
106
|
}
|
|
101
107
|
}
|
|
102
|
-
var re = !1,
|
|
108
|
+
var re = !1, F = !1, G = !1, ue = !1, K = !1, oe;
|
|
103
109
|
oe = /* @__PURE__ */ Symbol.for("react.module.reference");
|
|
104
110
|
function R(e) {
|
|
105
|
-
return !!(typeof e == "string" || typeof e == "function" || e ===
|
|
111
|
+
return !!(typeof e == "string" || typeof e == "function" || e === f || e === k || K || e === s || e === Y || e === S || ue || e === W || re || F || G || typeof e == "object" && e !== null && (e.$$typeof === C || e.$$typeof === I || e.$$typeof === X || e.$$typeof === p || e.$$typeof === g || // This needs to include all possible module reference object
|
|
106
112
|
// types supported by any Flight configuration anywhere since
|
|
107
113
|
// we don't know which Flight build this will end up being used
|
|
108
114
|
// with.
|
|
109
115
|
e.$$typeof === oe || e.getModuleId !== void 0));
|
|
110
116
|
}
|
|
111
|
-
function
|
|
112
|
-
var
|
|
113
|
-
if (
|
|
114
|
-
return
|
|
117
|
+
function E(e, t, n) {
|
|
118
|
+
var c = e.displayName;
|
|
119
|
+
if (c)
|
|
120
|
+
return c;
|
|
115
121
|
var A = t.displayName || t.name || "";
|
|
116
122
|
return A !== "" ? n + "(" + A + ")" : n;
|
|
117
123
|
}
|
|
@@ -126,7 +132,7 @@ function tr() {
|
|
|
126
132
|
if (typeof e == "string")
|
|
127
133
|
return e;
|
|
128
134
|
switch (e) {
|
|
129
|
-
case
|
|
135
|
+
case f:
|
|
130
136
|
return "Fragment";
|
|
131
137
|
case d:
|
|
132
138
|
return "Portal";
|
|
@@ -144,14 +150,14 @@ function tr() {
|
|
|
144
150
|
case p:
|
|
145
151
|
var t = e;
|
|
146
152
|
return i(t) + ".Consumer";
|
|
147
|
-
case
|
|
153
|
+
case X:
|
|
148
154
|
var n = e;
|
|
149
155
|
return i(n._context) + ".Provider";
|
|
150
156
|
case g:
|
|
151
|
-
return
|
|
152
|
-
case
|
|
153
|
-
var
|
|
154
|
-
return
|
|
157
|
+
return E(e, e.render, "ForwardRef");
|
|
158
|
+
case I:
|
|
159
|
+
var c = e.displayName || null;
|
|
160
|
+
return c !== null ? c : T(e.type) || "Memo";
|
|
155
161
|
case C: {
|
|
156
162
|
var A = e, y = A._payload, _ = A._init;
|
|
157
163
|
try {
|
|
@@ -163,14 +169,14 @@ function tr() {
|
|
|
163
169
|
}
|
|
164
170
|
return null;
|
|
165
171
|
}
|
|
166
|
-
var
|
|
172
|
+
var w = Object.assign, h = 0, J, U, Q, fe, Te, ae, ge;
|
|
167
173
|
function ve() {
|
|
168
174
|
}
|
|
169
175
|
ve.__reactDisabledLog = !0;
|
|
170
|
-
function
|
|
176
|
+
function we() {
|
|
171
177
|
{
|
|
172
178
|
if (h === 0) {
|
|
173
|
-
|
|
179
|
+
J = console.log, U = console.info, Q = console.warn, fe = console.error, Te = console.group, ae = console.groupCollapsed, ge = console.groupEnd;
|
|
174
180
|
var e = {
|
|
175
181
|
configurable: !0,
|
|
176
182
|
enumerable: !0,
|
|
@@ -199,25 +205,25 @@ function tr() {
|
|
|
199
205
|
writable: !0
|
|
200
206
|
};
|
|
201
207
|
Object.defineProperties(console, {
|
|
202
|
-
log:
|
|
203
|
-
value:
|
|
208
|
+
log: w({}, e, {
|
|
209
|
+
value: J
|
|
204
210
|
}),
|
|
205
|
-
info:
|
|
211
|
+
info: w({}, e, {
|
|
206
212
|
value: U
|
|
207
213
|
}),
|
|
208
|
-
warn:
|
|
209
|
-
value:
|
|
214
|
+
warn: w({}, e, {
|
|
215
|
+
value: Q
|
|
210
216
|
}),
|
|
211
|
-
error:
|
|
217
|
+
error: w({}, e, {
|
|
212
218
|
value: fe
|
|
213
219
|
}),
|
|
214
|
-
group:
|
|
220
|
+
group: w({}, e, {
|
|
215
221
|
value: Te
|
|
216
222
|
}),
|
|
217
|
-
groupCollapsed:
|
|
223
|
+
groupCollapsed: w({}, e, {
|
|
218
224
|
value: ae
|
|
219
225
|
}),
|
|
220
|
-
groupEnd:
|
|
226
|
+
groupEnd: w({}, e, {
|
|
221
227
|
value: ge
|
|
222
228
|
})
|
|
223
229
|
});
|
|
@@ -225,39 +231,39 @@ function tr() {
|
|
|
225
231
|
h < 0 && D("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
226
232
|
}
|
|
227
233
|
}
|
|
228
|
-
var
|
|
234
|
+
var l = V.ReactCurrentDispatcher, v;
|
|
229
235
|
function x(e, t, n) {
|
|
230
236
|
{
|
|
231
237
|
if (v === void 0)
|
|
232
238
|
try {
|
|
233
239
|
throw Error();
|
|
234
240
|
} catch (A) {
|
|
235
|
-
var
|
|
236
|
-
v =
|
|
241
|
+
var c = A.stack.trim().match(/\n( *(at )?)/);
|
|
242
|
+
v = c && c[1] || "";
|
|
237
243
|
}
|
|
238
244
|
return `
|
|
239
245
|
` + v + e;
|
|
240
246
|
}
|
|
241
247
|
}
|
|
242
|
-
var
|
|
248
|
+
var O = !1, b;
|
|
243
249
|
{
|
|
244
250
|
var Z = typeof WeakMap == "function" ? WeakMap : Map;
|
|
245
251
|
b = new Z();
|
|
246
252
|
}
|
|
247
253
|
function Se(e, t) {
|
|
248
|
-
if (!e ||
|
|
254
|
+
if (!e || O)
|
|
249
255
|
return "";
|
|
250
256
|
{
|
|
251
257
|
var n = b.get(e);
|
|
252
258
|
if (n !== void 0)
|
|
253
259
|
return n;
|
|
254
260
|
}
|
|
255
|
-
var
|
|
256
|
-
|
|
261
|
+
var c;
|
|
262
|
+
O = !0;
|
|
257
263
|
var A = Error.prepareStackTrace;
|
|
258
264
|
Error.prepareStackTrace = void 0;
|
|
259
265
|
var y;
|
|
260
|
-
y =
|
|
266
|
+
y = l.current, l.current = null, we();
|
|
261
267
|
try {
|
|
262
268
|
if (t) {
|
|
263
269
|
var _ = function() {
|
|
@@ -271,14 +277,14 @@ function tr() {
|
|
|
271
277
|
try {
|
|
272
278
|
Reflect.construct(_, []);
|
|
273
279
|
} catch (B) {
|
|
274
|
-
|
|
280
|
+
c = B;
|
|
275
281
|
}
|
|
276
282
|
Reflect.construct(e, [], _);
|
|
277
283
|
} else {
|
|
278
284
|
try {
|
|
279
285
|
_.call();
|
|
280
286
|
} catch (B) {
|
|
281
|
-
|
|
287
|
+
c = B;
|
|
282
288
|
}
|
|
283
289
|
e.call(_.prototype);
|
|
284
290
|
}
|
|
@@ -286,31 +292,31 @@ function tr() {
|
|
|
286
292
|
try {
|
|
287
293
|
throw Error();
|
|
288
294
|
} catch (B) {
|
|
289
|
-
|
|
295
|
+
c = B;
|
|
290
296
|
}
|
|
291
297
|
e();
|
|
292
298
|
}
|
|
293
299
|
} catch (B) {
|
|
294
|
-
if (B &&
|
|
300
|
+
if (B && c && typeof B.stack == "string") {
|
|
295
301
|
for (var m = B.stack.split(`
|
|
296
|
-
`), $ =
|
|
297
|
-
`), L = m.length - 1,
|
|
298
|
-
|
|
299
|
-
for (; L >= 1 &&
|
|
300
|
-
if (m[L] !== $[
|
|
301
|
-
if (L !== 1 ||
|
|
302
|
+
`), $ = c.stack.split(`
|
|
303
|
+
`), L = m.length - 1, M = $.length - 1; L >= 1 && M >= 0 && m[L] !== $[M]; )
|
|
304
|
+
M--;
|
|
305
|
+
for (; L >= 1 && M >= 0; L--, M--)
|
|
306
|
+
if (m[L] !== $[M]) {
|
|
307
|
+
if (L !== 1 || M !== 1)
|
|
302
308
|
do
|
|
303
|
-
if (L--,
|
|
304
|
-
var
|
|
309
|
+
if (L--, M--, M < 0 || m[L] !== $[M]) {
|
|
310
|
+
var z = `
|
|
305
311
|
` + m[L].replace(" at new ", " at ");
|
|
306
|
-
return e.displayName &&
|
|
312
|
+
return e.displayName && z.includes("<anonymous>") && (z = z.replace("<anonymous>", e.displayName)), typeof e == "function" && b.set(e, z), z;
|
|
307
313
|
}
|
|
308
|
-
while (L >= 1 &&
|
|
314
|
+
while (L >= 1 && M >= 0);
|
|
309
315
|
break;
|
|
310
316
|
}
|
|
311
317
|
}
|
|
312
318
|
} finally {
|
|
313
|
-
|
|
319
|
+
O = !1, l.current = y, o(), Error.prepareStackTrace = A;
|
|
314
320
|
}
|
|
315
321
|
var me = e ? e.displayName || e.name : "", Ee = me ? x(me) : "";
|
|
316
322
|
return typeof e == "function" && b.set(e, Ee), Ee;
|
|
@@ -339,10 +345,10 @@ function tr() {
|
|
|
339
345
|
switch (e.$$typeof) {
|
|
340
346
|
case g:
|
|
341
347
|
return ht(e.render);
|
|
342
|
-
case
|
|
348
|
+
case I:
|
|
343
349
|
return De(e.type, t, n);
|
|
344
350
|
case C: {
|
|
345
|
-
var
|
|
351
|
+
var c = e, A = c._payload, y = c._init;
|
|
346
352
|
try {
|
|
347
353
|
return De(y(A), t, n);
|
|
348
354
|
} catch {
|
|
@@ -359,7 +365,7 @@ function tr() {
|
|
|
359
365
|
} else
|
|
360
366
|
Xe.setExtraStackFrame(null);
|
|
361
367
|
}
|
|
362
|
-
function
|
|
368
|
+
function Ot(e, t, n, c, A) {
|
|
363
369
|
{
|
|
364
370
|
var y = Function.call.bind(he);
|
|
365
371
|
for (var _ in e)
|
|
@@ -367,20 +373,20 @@ function tr() {
|
|
|
367
373
|
var m = void 0;
|
|
368
374
|
try {
|
|
369
375
|
if (typeof e[_] != "function") {
|
|
370
|
-
var $ = Error((
|
|
376
|
+
var $ = Error((c || "React class") + ": " + n + " type `" + _ + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[_] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
371
377
|
throw $.name = "Invariant Violation", $;
|
|
372
378
|
}
|
|
373
|
-
m = e[_](t, _,
|
|
379
|
+
m = e[_](t, _, c, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
374
380
|
} catch (L) {
|
|
375
381
|
m = L;
|
|
376
382
|
}
|
|
377
|
-
m && !(m instanceof Error) && (xe(A), D("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",
|
|
383
|
+
m && !(m instanceof Error) && (xe(A), D("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", c || "React class", n, _, typeof m), xe(null)), m instanceof Error && !(m.message in He) && (He[m.message] = !0, xe(A), D("Failed %s type: %s", n, m.message), xe(null));
|
|
378
384
|
}
|
|
379
385
|
}
|
|
380
386
|
}
|
|
381
|
-
var
|
|
382
|
-
function
|
|
383
|
-
return
|
|
387
|
+
var It = Array.isArray;
|
|
388
|
+
function Me(e) {
|
|
389
|
+
return It(e);
|
|
384
390
|
}
|
|
385
391
|
function yt(e) {
|
|
386
392
|
{
|
|
@@ -449,10 +455,10 @@ function tr() {
|
|
|
449
455
|
});
|
|
450
456
|
}
|
|
451
457
|
}
|
|
452
|
-
var
|
|
458
|
+
var wt = function(e, t, n, c, A, y, _) {
|
|
453
459
|
var m = {
|
|
454
460
|
// This tag allows us to uniquely identify this as a React Element
|
|
455
|
-
$$typeof:
|
|
461
|
+
$$typeof: u,
|
|
456
462
|
// Built-in properties that belong on the element
|
|
457
463
|
type: e,
|
|
458
464
|
key: t,
|
|
@@ -470,7 +476,7 @@ function tr() {
|
|
|
470
476
|
configurable: !1,
|
|
471
477
|
enumerable: !1,
|
|
472
478
|
writable: !1,
|
|
473
|
-
value:
|
|
479
|
+
value: c
|
|
474
480
|
}), Object.defineProperty(m, "_source", {
|
|
475
481
|
configurable: !1,
|
|
476
482
|
enumerable: !1,
|
|
@@ -478,7 +484,7 @@ function tr() {
|
|
|
478
484
|
value: A
|
|
479
485
|
}), Object.freeze && (Object.freeze(m.props), Object.freeze(m)), m;
|
|
480
486
|
};
|
|
481
|
-
function
|
|
487
|
+
function Mt(e, t, n, c, A) {
|
|
482
488
|
{
|
|
483
489
|
var y, _ = {}, m = null, $ = null;
|
|
484
490
|
n !== void 0 && (qe(n), m = "" + n), bt(t) && (qe(t.key), m = "" + t.key), xt(t) && ($ = t.ref, Nt(t, A));
|
|
@@ -490,13 +496,13 @@ function tr() {
|
|
|
490
496
|
_[y] === void 0 && (_[y] = L[y]);
|
|
491
497
|
}
|
|
492
498
|
if (m || $) {
|
|
493
|
-
var
|
|
494
|
-
m && Lt(_,
|
|
499
|
+
var M = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
500
|
+
m && Lt(_, M), $ && Pt(_, M);
|
|
495
501
|
}
|
|
496
|
-
return
|
|
502
|
+
return wt(e, m, $, A, c, Ke.current, _);
|
|
497
503
|
}
|
|
498
504
|
}
|
|
499
|
-
var
|
|
505
|
+
var je = V.ReactCurrentOwner, Ze = V.ReactDebugCurrentFrame;
|
|
500
506
|
function pe(e) {
|
|
501
507
|
if (e) {
|
|
502
508
|
var t = e._owner, n = De(e.type, e._source, t ? t.type : null);
|
|
@@ -504,15 +510,15 @@ function tr() {
|
|
|
504
510
|
} else
|
|
505
511
|
Ze.setExtraStackFrame(null);
|
|
506
512
|
}
|
|
507
|
-
var
|
|
508
|
-
|
|
513
|
+
var Fe;
|
|
514
|
+
Fe = !1;
|
|
509
515
|
function Ue(e) {
|
|
510
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
516
|
+
return typeof e == "object" && e !== null && e.$$typeof === u;
|
|
511
517
|
}
|
|
512
518
|
function et() {
|
|
513
519
|
{
|
|
514
|
-
if (
|
|
515
|
-
var e = T(
|
|
520
|
+
if (je.current) {
|
|
521
|
+
var e = T(je.current.type);
|
|
516
522
|
if (e)
|
|
517
523
|
return `
|
|
518
524
|
|
|
@@ -521,11 +527,11 @@ Check the render method of \`` + e + "`.";
|
|
|
521
527
|
return "";
|
|
522
528
|
}
|
|
523
529
|
}
|
|
524
|
-
function
|
|
530
|
+
function jt(e) {
|
|
525
531
|
return "";
|
|
526
532
|
}
|
|
527
533
|
var tt = {};
|
|
528
|
-
function
|
|
534
|
+
function Ft(e) {
|
|
529
535
|
{
|
|
530
536
|
var t = et();
|
|
531
537
|
if (!t) {
|
|
@@ -542,27 +548,27 @@ Check the top-level render call using <` + n + ">.");
|
|
|
542
548
|
if (!e._store || e._store.validated || e.key != null)
|
|
543
549
|
return;
|
|
544
550
|
e._store.validated = !0;
|
|
545
|
-
var n =
|
|
551
|
+
var n = Ft(t);
|
|
546
552
|
if (tt[n])
|
|
547
553
|
return;
|
|
548
554
|
tt[n] = !0;
|
|
549
|
-
var
|
|
550
|
-
e && e._owner && e._owner !==
|
|
555
|
+
var c = "";
|
|
556
|
+
e && e._owner && e._owner !== je.current && (c = " It was passed a child from " + T(e._owner.type) + "."), pe(e), D('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', n, c), pe(null);
|
|
551
557
|
}
|
|
552
558
|
}
|
|
553
559
|
function at(e, t) {
|
|
554
560
|
{
|
|
555
561
|
if (typeof e != "object")
|
|
556
562
|
return;
|
|
557
|
-
if (
|
|
563
|
+
if (Me(e))
|
|
558
564
|
for (var n = 0; n < e.length; n++) {
|
|
559
|
-
var
|
|
560
|
-
Ue(
|
|
565
|
+
var c = e[n];
|
|
566
|
+
Ue(c) && rt(c, t);
|
|
561
567
|
}
|
|
562
568
|
else if (Ue(e))
|
|
563
569
|
e._store && (e._store.validated = !0);
|
|
564
570
|
else if (e) {
|
|
565
|
-
var A =
|
|
571
|
+
var A = q(e);
|
|
566
572
|
if (typeof A == "function" && A !== e.entries)
|
|
567
573
|
for (var y = A.call(e), _; !(_ = y.next()).done; )
|
|
568
574
|
Ue(_.value) && rt(_.value, t);
|
|
@@ -579,15 +585,15 @@ Check the top-level render call using <` + n + ">.");
|
|
|
579
585
|
n = t.propTypes;
|
|
580
586
|
else if (typeof t == "object" && (t.$$typeof === g || // Note: Memo only checks outer props here.
|
|
581
587
|
// Inner props are checked in the reconciler.
|
|
582
|
-
t.$$typeof ===
|
|
588
|
+
t.$$typeof === I))
|
|
583
589
|
n = t.propTypes;
|
|
584
590
|
else
|
|
585
591
|
return;
|
|
586
592
|
if (n) {
|
|
587
|
-
var
|
|
588
|
-
|
|
589
|
-
} else if (t.PropTypes !== void 0 && !
|
|
590
|
-
|
|
593
|
+
var c = T(t);
|
|
594
|
+
Ot(n, e.props, "prop", c, e);
|
|
595
|
+
} else if (t.PropTypes !== void 0 && !Fe) {
|
|
596
|
+
Fe = !0;
|
|
591
597
|
var A = T(t);
|
|
592
598
|
D("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", A || "Unknown");
|
|
593
599
|
}
|
|
@@ -597,9 +603,9 @@ Check the top-level render call using <` + n + ">.");
|
|
|
597
603
|
function Gt(e) {
|
|
598
604
|
{
|
|
599
605
|
for (var t = Object.keys(e.props), n = 0; n < t.length; n++) {
|
|
600
|
-
var
|
|
601
|
-
if (
|
|
602
|
-
pe(e), D("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",
|
|
606
|
+
var c = t[n];
|
|
607
|
+
if (c !== "children" && c !== "key") {
|
|
608
|
+
pe(e), D("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", c), pe(null);
|
|
603
609
|
break;
|
|
604
610
|
}
|
|
605
611
|
}
|
|
@@ -607,32 +613,32 @@ Check the top-level render call using <` + n + ">.");
|
|
|
607
613
|
}
|
|
608
614
|
}
|
|
609
615
|
var nt = {};
|
|
610
|
-
function ot(e, t, n,
|
|
616
|
+
function ot(e, t, n, c, A, y) {
|
|
611
617
|
{
|
|
612
618
|
var _ = R(e);
|
|
613
619
|
if (!_) {
|
|
614
620
|
var m = "";
|
|
615
621
|
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (m += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
616
|
-
var $ =
|
|
622
|
+
var $ = jt();
|
|
617
623
|
$ ? m += $ : m += et();
|
|
618
624
|
var L;
|
|
619
|
-
e === null ? L = "null" :
|
|
625
|
+
e === null ? L = "null" : Me(e) ? L = "array" : e !== void 0 && e.$$typeof === u ? (L = "<" + (T(e.type) || "Unknown") + " />", m = " Did you accidentally export a JSX literal instead of a component?") : L = typeof e, D("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", L, m);
|
|
620
626
|
}
|
|
621
|
-
var
|
|
622
|
-
if (
|
|
623
|
-
return
|
|
627
|
+
var M = Mt(e, t, n, A, y);
|
|
628
|
+
if (M == null)
|
|
629
|
+
return M;
|
|
624
630
|
if (_) {
|
|
625
|
-
var
|
|
626
|
-
if (
|
|
627
|
-
if (
|
|
628
|
-
if (
|
|
629
|
-
for (var me = 0; me <
|
|
630
|
-
at(
|
|
631
|
-
Object.freeze && Object.freeze(
|
|
631
|
+
var z = t.children;
|
|
632
|
+
if (z !== void 0)
|
|
633
|
+
if (c)
|
|
634
|
+
if (Me(z)) {
|
|
635
|
+
for (var me = 0; me < z.length; me++)
|
|
636
|
+
at(z[me], e);
|
|
637
|
+
Object.freeze && Object.freeze(z);
|
|
632
638
|
} else
|
|
633
639
|
D("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
634
640
|
else
|
|
635
|
-
at(
|
|
641
|
+
at(z, e);
|
|
636
642
|
}
|
|
637
643
|
if (he.call(t, "key")) {
|
|
638
644
|
var Ee = T(e), B = Object.keys(t).filter(function(Bt) {
|
|
@@ -648,7 +654,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
648
654
|
<%s key={someKey} {...props} />`, Ge, Ee, Wt, Ee), nt[Ee + Ge] = !0;
|
|
649
655
|
}
|
|
650
656
|
}
|
|
651
|
-
return e ===
|
|
657
|
+
return e === f ? Gt(M) : Ut(M), M;
|
|
652
658
|
}
|
|
653
659
|
}
|
|
654
660
|
function kt(e, t, n) {
|
|
@@ -658,8 +664,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
658
664
|
return ot(e, t, n, !1);
|
|
659
665
|
}
|
|
660
666
|
var Vt = Yt, $t = kt;
|
|
661
|
-
|
|
662
|
-
})()),
|
|
667
|
+
Oe.Fragment = f, Oe.jsx = Vt, Oe.jsxs = $t;
|
|
668
|
+
})()), Oe;
|
|
663
669
|
}
|
|
664
670
|
var lt;
|
|
665
671
|
function rr() {
|
|
@@ -827,7 +833,7 @@ const nr = ce(N)(({ theme: a }) => ({
|
|
|
827
833
|
SERVER_SIDE: "serverSide",
|
|
828
834
|
INFINITE: "infinite",
|
|
829
835
|
VIEWPORT: "viewport"
|
|
830
|
-
},
|
|
836
|
+
}, Or = {
|
|
831
837
|
DEFAULT_FLEX: 1,
|
|
832
838
|
ACTION_COLUMN_WIDTH: 150,
|
|
833
839
|
SORTABLE: !0,
|
|
@@ -847,40 +853,40 @@ const nr = ce(N)(({ theme: a }) => ({
|
|
|
847
853
|
Qt.registerModules([gt, Zt]);
|
|
848
854
|
const Er = ({
|
|
849
855
|
rows: a,
|
|
850
|
-
totalRecords:
|
|
856
|
+
totalRecords: u,
|
|
851
857
|
currentPage: d,
|
|
852
|
-
loading:
|
|
858
|
+
loading: f,
|
|
853
859
|
onPageChange: s,
|
|
854
860
|
columns: k,
|
|
855
|
-
pageSize:
|
|
861
|
+
pageSize: X,
|
|
856
862
|
pageSizeOptions: p,
|
|
857
863
|
onPageSizeChange: g,
|
|
858
864
|
setSort: Y,
|
|
859
865
|
sortModel: S,
|
|
860
|
-
height:
|
|
866
|
+
height: I = lr.DEFAULT_HEIGHT,
|
|
861
867
|
domLayout: C = ut.NORMAL,
|
|
862
868
|
getRowHeight: W,
|
|
863
869
|
pinnedBottomRowData: te,
|
|
864
870
|
showLoader: de = !0,
|
|
865
|
-
emptyDataMessage:
|
|
871
|
+
emptyDataMessage: q,
|
|
866
872
|
...V
|
|
867
873
|
}) => {
|
|
868
|
-
const D = We(null), P = We([]), re = (
|
|
869
|
-
if (
|
|
870
|
-
const G =
|
|
871
|
-
colId:
|
|
872
|
-
sort:
|
|
874
|
+
const D = We(null), P = We([]), re = (F) => {
|
|
875
|
+
if (F.source !== cr.UI_COLUMN_SORTED || (console.log("Sort Changed Event (User Initiated):", F), !Y)) return;
|
|
876
|
+
const G = F.api.getColumnState().filter((K) => K.sort).map((K) => ({
|
|
877
|
+
colId: K.colId,
|
|
878
|
+
sort: K.sort
|
|
873
879
|
}));
|
|
874
880
|
console.log("New Sort Model:", G), JSON.stringify(G) !== JSON.stringify(P.current) && (P.current = G, Y(G));
|
|
875
881
|
};
|
|
876
|
-
return de &&
|
|
882
|
+
return de && f ? /* @__PURE__ */ r.jsx(
|
|
877
883
|
ct,
|
|
878
884
|
{
|
|
879
885
|
style: {
|
|
880
886
|
display: "flex",
|
|
881
887
|
alignItems: "center",
|
|
882
888
|
justifyContent: "center",
|
|
883
|
-
height:
|
|
889
|
+
height: I,
|
|
884
890
|
minHeight: 120
|
|
885
891
|
},
|
|
886
892
|
children: /* @__PURE__ */ r.jsx(Le, {})
|
|
@@ -889,7 +895,7 @@ const Er = ({
|
|
|
889
895
|
/* @__PURE__ */ r.jsx(
|
|
890
896
|
sr,
|
|
891
897
|
{
|
|
892
|
-
height: C === ut.AUTO_HEIGHT ? void 0 :
|
|
898
|
+
height: C === ut.AUTO_HEIGHT ? void 0 : I,
|
|
893
899
|
children: /* @__PURE__ */ r.jsx(
|
|
894
900
|
Jt,
|
|
895
901
|
{
|
|
@@ -902,7 +908,7 @@ const Er = ({
|
|
|
902
908
|
rowModelType: St.CLIENT_SIDE,
|
|
903
909
|
modules: [gt],
|
|
904
910
|
localeText: {
|
|
905
|
-
noRowsToShow:
|
|
911
|
+
noRowsToShow: q || "No data to show"
|
|
906
912
|
},
|
|
907
913
|
...V,
|
|
908
914
|
enableBrowserTooltips: !0,
|
|
@@ -915,16 +921,16 @@ const Er = ({
|
|
|
915
921
|
width: 170,
|
|
916
922
|
sortable: !0,
|
|
917
923
|
unSortIcon: !0,
|
|
918
|
-
tooltipValueGetter: (
|
|
924
|
+
tooltipValueGetter: (F) => F.value ?? dr.NO_DATA
|
|
919
925
|
},
|
|
920
926
|
suppressRowTransform: !0,
|
|
921
927
|
getRowHeight: W ?? (() => 54),
|
|
922
928
|
maintainColumnOrder: !0,
|
|
923
929
|
initialState: S && S.length > 0 ? {
|
|
924
930
|
sort: {
|
|
925
|
-
sortModel: S.map((
|
|
926
|
-
colId:
|
|
927
|
-
sort:
|
|
931
|
+
sortModel: S.map((F) => ({
|
|
932
|
+
colId: F.colId,
|
|
933
|
+
sort: F.sort
|
|
928
934
|
}))
|
|
929
935
|
}
|
|
930
936
|
} : void 0
|
|
@@ -932,13 +938,13 @@ const Er = ({
|
|
|
932
938
|
)
|
|
933
939
|
}
|
|
934
940
|
),
|
|
935
|
-
|
|
941
|
+
u === 0 && /* @__PURE__ */ r.jsx(zt, {})
|
|
936
942
|
] }) });
|
|
937
943
|
}, Tr = ({
|
|
938
944
|
totalRecords: a,
|
|
939
|
-
currentPage:
|
|
945
|
+
currentPage: u,
|
|
940
946
|
pageSize: d,
|
|
941
|
-
onPageChange:
|
|
947
|
+
onPageChange: f
|
|
942
948
|
}) => {
|
|
943
949
|
const s = Math.ceil(a / d);
|
|
944
950
|
return /* @__PURE__ */ r.jsxs(N, { sx: { display: "flex", gap: 2, alignItems: "center" }, children: [
|
|
@@ -946,14 +952,14 @@ const Er = ({
|
|
|
946
952
|
ne,
|
|
947
953
|
{
|
|
948
954
|
size: "small",
|
|
949
|
-
disabled:
|
|
950
|
-
onClick: () =>
|
|
955
|
+
disabled: u === 1,
|
|
956
|
+
onClick: () => f(u - 1),
|
|
951
957
|
children: "Previous"
|
|
952
958
|
}
|
|
953
959
|
),
|
|
954
960
|
/* @__PURE__ */ r.jsxs(_e, { variant: "body2", children: [
|
|
955
961
|
"Page ",
|
|
956
|
-
|
|
962
|
+
u,
|
|
957
963
|
" of ",
|
|
958
964
|
s || 1
|
|
959
965
|
] }),
|
|
@@ -961,8 +967,8 @@ const Er = ({
|
|
|
961
967
|
ne,
|
|
962
968
|
{
|
|
963
969
|
size: "small",
|
|
964
|
-
disabled:
|
|
965
|
-
onClick: () =>
|
|
970
|
+
disabled: u >= s,
|
|
971
|
+
onClick: () => f(u + 1),
|
|
966
972
|
children: "Next"
|
|
967
973
|
}
|
|
968
974
|
)
|
|
@@ -1007,9 +1013,9 @@ const Er = ({
|
|
|
1007
1013
|
FAILED_LOAD_OPTIONS: (a) => `Failed to load options for ${a}`,
|
|
1008
1014
|
FAILED_LOAD_FORM_CONFIG: "Failed to load form configuration",
|
|
1009
1015
|
FIELD_REQUIRED: (a) => `${a} is required`,
|
|
1010
|
-
FIELD_MIN_VALUE: (a,
|
|
1011
|
-
FIELD_MAX_VALUE: (a,
|
|
1012
|
-
},
|
|
1016
|
+
FIELD_MIN_VALUE: (a, u) => `${a} must be at least ${u}`,
|
|
1017
|
+
FIELD_MAX_VALUE: (a, u) => `${a} must be at most ${u}`
|
|
1018
|
+
}, Ir = {
|
|
1013
1019
|
RECORD_CREATED: "Record created successfully",
|
|
1014
1020
|
RECORD_UPDATED: "Record updated successfully",
|
|
1015
1021
|
RECORD_DELETED: "Record deleted successfully"
|
|
@@ -1059,25 +1065,25 @@ const Er = ({
|
|
|
1059
1065
|
HEADERS: {
|
|
1060
1066
|
CONTENT_TYPE: "application/json"
|
|
1061
1067
|
}
|
|
1062
|
-
},
|
|
1068
|
+
}, wr = {
|
|
1063
1069
|
MASTER: "/master"
|
|
1064
|
-
},
|
|
1070
|
+
}, Mr = {
|
|
1065
1071
|
// Entity endpoints
|
|
1066
1072
|
ENTITIES: "/master/entities",
|
|
1067
1073
|
ENTITY_METADATA: (a) => `/master/${a}/metadata`,
|
|
1068
1074
|
ENTITY_RECORDS: (a) => `/master/${a}/records`,
|
|
1069
|
-
ENTITY_RECORD_BY_ID: (a,
|
|
1075
|
+
ENTITY_RECORD_BY_ID: (a, u) => `/master/${a}/records/${u}`,
|
|
1070
1076
|
ENTITY_OPTIONS: (a) => `/master/${a}/options`,
|
|
1071
1077
|
// Export endpoints
|
|
1072
1078
|
EXPORT_CSV: (a) => `/master/${a}/export/csv`,
|
|
1073
1079
|
EXPORT_EXCEL: (a) => `/master/${a}/export/excel`
|
|
1074
|
-
},
|
|
1080
|
+
}, jr = {
|
|
1075
1081
|
GET: "GET",
|
|
1076
1082
|
POST: "POST",
|
|
1077
1083
|
PUT: "PUT",
|
|
1078
1084
|
DELETE: "DELETE",
|
|
1079
1085
|
PATCH: "PATCH"
|
|
1080
|
-
},
|
|
1086
|
+
}, Fr = {
|
|
1081
1087
|
PAGE: "page",
|
|
1082
1088
|
LIMIT: "limit",
|
|
1083
1089
|
SEARCH: "search",
|
|
@@ -1100,7 +1106,7 @@ const Er = ({
|
|
|
1100
1106
|
COUNT: "count",
|
|
1101
1107
|
MESSAGE: "message",
|
|
1102
1108
|
ERROR: "error"
|
|
1103
|
-
},
|
|
1109
|
+
}, H = {
|
|
1104
1110
|
CREATE: "create",
|
|
1105
1111
|
EDIT: "edit",
|
|
1106
1112
|
VIEW: "view"
|
|
@@ -1159,21 +1165,21 @@ const Er = ({
|
|
|
1159
1165
|
ENTITY_MATCH: /\/master\/([^\/]+)\/options/
|
|
1160
1166
|
}, Hr = ({
|
|
1161
1167
|
apiClient: a,
|
|
1162
|
-
apiEndpoints:
|
|
1168
|
+
apiEndpoints: u,
|
|
1163
1169
|
onNavigateToNew: d,
|
|
1164
|
-
onNavigateToEdit:
|
|
1170
|
+
onNavigateToEdit: f
|
|
1165
1171
|
}) => {
|
|
1166
|
-
const s = Re(() => vt(a,
|
|
1172
|
+
const s = Re(() => vt(a, u), [a, u]), [k, X] = j([]), [p, g] = j(null), [Y, S] = j([]), [I, C] = j({}), [W, te] = j([]), [de, q] = j([]), [V, D] = j(0), [P, re] = j(10), [F, G] = j(1), [ue, K] = j(!1), [oe, R] = j(!1), [E, i] = j({}), [T, w] = j([]), [h, J] = j(null), U = We(!0);
|
|
1167
1173
|
Ce(() => {
|
|
1168
1174
|
(async () => {
|
|
1169
1175
|
try {
|
|
1170
|
-
const x = ((await s.getEntities()).data || []).map((
|
|
1171
|
-
name:
|
|
1172
|
-
label:
|
|
1176
|
+
const x = ((await s.getEntities()).data || []).map((O) => ({
|
|
1177
|
+
name: O.tableName || O.name,
|
|
1178
|
+
label: O.displayName || O.label
|
|
1173
1179
|
}));
|
|
1174
|
-
|
|
1175
|
-
} catch (
|
|
1176
|
-
console.error(ie.FAILED_LOAD_ENTITIES,
|
|
1180
|
+
X(x), x.length > 0 && g(x[0]);
|
|
1181
|
+
} catch (l) {
|
|
1182
|
+
console.error(ie.FAILED_LOAD_ENTITIES, l);
|
|
1177
1183
|
}
|
|
1178
1184
|
})();
|
|
1179
1185
|
}, []), Ce(() => {
|
|
@@ -1186,72 +1192,72 @@ const Er = ({
|
|
|
1186
1192
|
(v.parameterList || []).forEach((b) => {
|
|
1187
1193
|
x[b.name] = null;
|
|
1188
1194
|
}), C(x);
|
|
1189
|
-
const
|
|
1195
|
+
const O = {};
|
|
1190
1196
|
for (const b of v.parameterList || [])
|
|
1191
|
-
b.options && Array.isArray(b.options) && (
|
|
1192
|
-
i(
|
|
1193
|
-
} catch (
|
|
1194
|
-
console.error(ie.FAILED_LOAD_METADATA,
|
|
1197
|
+
b.options && Array.isArray(b.options) && (O[b.name] = b.options);
|
|
1198
|
+
i(O), q([]), R(!1);
|
|
1199
|
+
} catch (l) {
|
|
1200
|
+
console.error(ie.FAILED_LOAD_METADATA, l);
|
|
1195
1201
|
}
|
|
1196
1202
|
})();
|
|
1197
1203
|
}, [p]);
|
|
1198
|
-
const
|
|
1199
|
-
const o = {},
|
|
1200
|
-
Y.forEach((
|
|
1201
|
-
if (
|
|
1202
|
-
const Z =
|
|
1203
|
-
Z && (o[`${
|
|
1204
|
+
const Q = Re(() => {
|
|
1205
|
+
const o = {}, l = [], v = [];
|
|
1206
|
+
Y.forEach((O) => {
|
|
1207
|
+
if (O.dataType === Ne.DATERANGE) {
|
|
1208
|
+
const Z = I[`${O.name}${se.FROM}`], Se = I[`${O.name}${se.TO}`];
|
|
1209
|
+
Z && (o[`${O.name}${se.FROM}`] = Z), Se && (o[`${O.name}${se.TO}`] = Se);
|
|
1204
1210
|
return;
|
|
1205
1211
|
}
|
|
1206
|
-
const b = O
|
|
1207
|
-
b == null || b === "" || (
|
|
1212
|
+
const b = I[O.name];
|
|
1213
|
+
b == null || b === "" || (O.options ? o[O.name] = b : (l.push(O.name), v.push(String(b).trim())));
|
|
1208
1214
|
});
|
|
1209
1215
|
const x = {
|
|
1210
|
-
page:
|
|
1216
|
+
page: F,
|
|
1211
1217
|
limit: P
|
|
1212
1218
|
};
|
|
1213
|
-
return Object.keys(o).length > 0 && Object.entries(o).forEach(([
|
|
1214
|
-
x[`filters[${
|
|
1215
|
-
}),
|
|
1216
|
-
}, [Y,
|
|
1219
|
+
return Object.keys(o).length > 0 && Object.entries(o).forEach(([O, b]) => {
|
|
1220
|
+
x[`filters[${O}]`] = b;
|
|
1221
|
+
}), l.length > 0 && (x.search = v.join(","), x.searchBy = l.join(",")), T.length > 0 && (x.sortBy = T.map((O) => O.colId).join(","), x.sortOrder = T.map((O) => O.sort === "desc" ? pt.DESC : pt.ASC).join(",")), console.log("Query params:", x), x;
|
|
1222
|
+
}, [Y, I, F, P, T]), fe = Ie(async () => {
|
|
1217
1223
|
if (!(!p || !U.current)) {
|
|
1218
|
-
U.current = !1,
|
|
1224
|
+
U.current = !1, K(!0);
|
|
1219
1225
|
try {
|
|
1220
|
-
console.log("Fetching with params:",
|
|
1221
|
-
const o = await s.getRecords(p.name,
|
|
1222
|
-
|
|
1226
|
+
console.log("Fetching with params:", Q);
|
|
1227
|
+
const o = await s.getRecords(p.name, Q), l = o.data || [], v = o.total || 0;
|
|
1228
|
+
q(l), D(v);
|
|
1223
1229
|
} catch (o) {
|
|
1224
|
-
console.error(ie.FAILED_FETCH_LIST, o), console.error("Full error:", o),
|
|
1230
|
+
console.error(ie.FAILED_FETCH_LIST, o), console.error("Full error:", o), q([]), D(0);
|
|
1225
1231
|
} finally {
|
|
1226
|
-
|
|
1232
|
+
K(!1), U.current = !0;
|
|
1227
1233
|
}
|
|
1228
1234
|
}
|
|
1229
|
-
}, [p,
|
|
1235
|
+
}, [p, Q]);
|
|
1230
1236
|
Ce(() => {
|
|
1231
|
-
oe && (
|
|
1232
|
-
}, [
|
|
1237
|
+
oe && (F > 1 || T.length > 0) && fe();
|
|
1238
|
+
}, [F, P, T, oe, fe]);
|
|
1233
1239
|
const Te = () => {
|
|
1234
1240
|
G(1), R(!0), setTimeout(() => {
|
|
1235
1241
|
U.current = !0, fe();
|
|
1236
1242
|
}, 0);
|
|
1237
1243
|
}, ae = (o) => {
|
|
1238
|
-
|
|
1244
|
+
J(o.currentTarget);
|
|
1239
1245
|
}, ge = () => {
|
|
1240
|
-
|
|
1246
|
+
J(null);
|
|
1241
1247
|
}, ve = async (o) => {
|
|
1242
1248
|
if (p)
|
|
1243
1249
|
try {
|
|
1244
|
-
const
|
|
1250
|
+
const l = o === "csv" ? await s.exportCSV(p.name, Q) : await s.exportExcel(p.name, Q), v = o === "csv" ? mt.CSV : mt.EXCEL, x = o === "csv" ? Et.CSV : Et.EXCEL, O = l.data instanceof Blob ? l.data : new Blob([l.data], { type: v }), b = URL.createObjectURL(O), Z = document.createElement("a");
|
|
1245
1251
|
Z.href = b, Z.download = `${p.name}_${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}.${x}`, Z.style.visibility = "hidden", document.body.appendChild(Z), Z.click(), document.body.removeChild(Z), setTimeout(() => URL.revokeObjectURL(b), fr.URL_REVOKE);
|
|
1246
|
-
} catch (
|
|
1247
|
-
console.error(`Failed to export ${o.toUpperCase()}:`,
|
|
1252
|
+
} catch (l) {
|
|
1253
|
+
console.error(`Failed to export ${o.toUpperCase()}:`, l);
|
|
1248
1254
|
} finally {
|
|
1249
1255
|
ge();
|
|
1250
1256
|
}
|
|
1251
|
-
},
|
|
1252
|
-
const o = W.map((
|
|
1253
|
-
field:
|
|
1254
|
-
headerName:
|
|
1257
|
+
}, we = Re(() => {
|
|
1258
|
+
const o = W.map((l) => ({
|
|
1259
|
+
field: l.name,
|
|
1260
|
+
headerName: l.label,
|
|
1255
1261
|
sortable: !0,
|
|
1256
1262
|
filter: !1,
|
|
1257
1263
|
flex: 1
|
|
@@ -1262,20 +1268,20 @@ const Er = ({
|
|
|
1262
1268
|
sortable: !1,
|
|
1263
1269
|
filter: !1,
|
|
1264
1270
|
width: 150,
|
|
1265
|
-
cellRenderer: (
|
|
1266
|
-
const v =
|
|
1271
|
+
cellRenderer: (l) => {
|
|
1272
|
+
const v = l.data;
|
|
1267
1273
|
return !v || !p ? null : /* @__PURE__ */ r.jsx(N, { sx: { display: "flex", gap: 1, py: 1 }, children: /* @__PURE__ */ r.jsx(
|
|
1268
1274
|
ne,
|
|
1269
1275
|
{
|
|
1270
1276
|
size: "small",
|
|
1271
1277
|
variant: "outlined",
|
|
1272
|
-
onClick: () =>
|
|
1278
|
+
onClick: () => f?.(p.name, v.id),
|
|
1273
1279
|
children: le.EDIT
|
|
1274
1280
|
}
|
|
1275
1281
|
) });
|
|
1276
1282
|
}
|
|
1277
1283
|
}), o;
|
|
1278
|
-
}, [W, p,
|
|
1284
|
+
}, [W, p, f]);
|
|
1279
1285
|
return /* @__PURE__ */ r.jsxs(N, { className: "master-view", children: [
|
|
1280
1286
|
/* @__PURE__ */ r.jsxs(_t, { className: "filter-section", children: [
|
|
1281
1287
|
/* @__PURE__ */ r.jsx(_e, { variant: "h5", gutterBottom: !0, children: Pe.MASTER_DATA_MANAGEMENT }),
|
|
@@ -1288,7 +1294,7 @@ const Er = ({
|
|
|
1288
1294
|
options: k,
|
|
1289
1295
|
getOptionLabel: (o) => o.label,
|
|
1290
1296
|
value: p,
|
|
1291
|
-
onChange: (o,
|
|
1297
|
+
onChange: (o, l) => g(l),
|
|
1292
1298
|
renderInput: (o) => /* @__PURE__ */ r.jsx(ee, { ...o, size: "small", placeholder: ye.SELECT_ENTITY }),
|
|
1293
1299
|
className: "field-input"
|
|
1294
1300
|
}
|
|
@@ -1302,8 +1308,8 @@ const Er = ({
|
|
|
1302
1308
|
{
|
|
1303
1309
|
type: "date",
|
|
1304
1310
|
size: "small",
|
|
1305
|
-
value:
|
|
1306
|
-
onChange: (
|
|
1311
|
+
value: I[`${o.name}${se.FROM}`] || "",
|
|
1312
|
+
onChange: (l) => C((v) => ({ ...v, [`${o.name}${se.FROM}`]: l.target.value })),
|
|
1307
1313
|
sx: { flex: 1 }
|
|
1308
1314
|
}
|
|
1309
1315
|
),
|
|
@@ -1313,8 +1319,8 @@ const Er = ({
|
|
|
1313
1319
|
type: "date",
|
|
1314
1320
|
size: "small",
|
|
1315
1321
|
label: Ye.TO,
|
|
1316
|
-
value:
|
|
1317
|
-
onChange: (
|
|
1322
|
+
value: I[`${o.name}${se.TO}`] || "",
|
|
1323
|
+
onChange: (l) => C((v) => ({ ...v, [`${o.name}${se.TO}`]: l.target.value })),
|
|
1318
1324
|
sx: { flex: 1 }
|
|
1319
1325
|
}
|
|
1320
1326
|
)
|
|
@@ -1323,18 +1329,18 @@ const Er = ({
|
|
|
1323
1329
|
{
|
|
1324
1330
|
type: "date",
|
|
1325
1331
|
size: "small",
|
|
1326
|
-
value:
|
|
1327
|
-
onChange: (
|
|
1332
|
+
value: I[o.name] || "",
|
|
1333
|
+
onChange: (l) => C((v) => ({ ...v, [o.name]: l.target.value })),
|
|
1328
1334
|
className: "field-input"
|
|
1329
1335
|
}
|
|
1330
1336
|
) : o.options ? /* @__PURE__ */ r.jsx(
|
|
1331
1337
|
Be,
|
|
1332
1338
|
{
|
|
1333
|
-
options:
|
|
1334
|
-
getOptionLabel: (
|
|
1335
|
-
value:
|
|
1336
|
-
onChange: (
|
|
1337
|
-
renderInput: (
|
|
1339
|
+
options: E[o.name] || o.options,
|
|
1340
|
+
getOptionLabel: (l) => l.label || String(l.value),
|
|
1341
|
+
value: E[o.name]?.find((l) => l.value === I[o.name]) || null,
|
|
1342
|
+
onChange: (l, v) => C((x) => ({ ...x, [o.name]: v?.value || null })),
|
|
1343
|
+
renderInput: (l) => /* @__PURE__ */ r.jsx(ee, { ...l, size: "small", placeholder: ye.SELECT(o.label) }),
|
|
1338
1344
|
className: "field-input"
|
|
1339
1345
|
}
|
|
1340
1346
|
) : o.dataType === Ne.NUMBER ? /* @__PURE__ */ r.jsx(
|
|
@@ -1342,8 +1348,8 @@ const Er = ({
|
|
|
1342
1348
|
{
|
|
1343
1349
|
type: "number",
|
|
1344
1350
|
size: "small",
|
|
1345
|
-
value:
|
|
1346
|
-
onChange: (
|
|
1351
|
+
value: I[o.name] || "",
|
|
1352
|
+
onChange: (l) => C((v) => ({ ...v, [o.name]: l.target.value })),
|
|
1347
1353
|
placeholder: ye.FILTER_BY(o.label),
|
|
1348
1354
|
className: "field-input"
|
|
1349
1355
|
}
|
|
@@ -1351,8 +1357,8 @@ const Er = ({
|
|
|
1351
1357
|
ee,
|
|
1352
1358
|
{
|
|
1353
1359
|
size: "small",
|
|
1354
|
-
value:
|
|
1355
|
-
onChange: (
|
|
1360
|
+
value: I[o.name] || "",
|
|
1361
|
+
onChange: (l) => C((v) => ({ ...v, [o.name]: l.target.value })),
|
|
1356
1362
|
placeholder: ye.FILTER_BY(o.label),
|
|
1357
1363
|
className: "field-input"
|
|
1358
1364
|
}
|
|
@@ -1400,9 +1406,9 @@ const Er = ({
|
|
|
1400
1406
|
Er,
|
|
1401
1407
|
{
|
|
1402
1408
|
rows: de,
|
|
1403
|
-
columns:
|
|
1409
|
+
columns: we,
|
|
1404
1410
|
totalRecords: V,
|
|
1405
|
-
currentPage:
|
|
1411
|
+
currentPage: F,
|
|
1406
1412
|
loading: ue,
|
|
1407
1413
|
rowModelType: St.CLIENT_SIDE,
|
|
1408
1414
|
onPageChange: G,
|
|
@@ -1411,7 +1417,7 @@ const Er = ({
|
|
|
1411
1417
|
onPageSizeChange: (o) => {
|
|
1412
1418
|
re(o), G(1);
|
|
1413
1419
|
},
|
|
1414
|
-
setSort:
|
|
1420
|
+
setSort: w,
|
|
1415
1421
|
sortModel: T,
|
|
1416
1422
|
height: 500
|
|
1417
1423
|
},
|
|
@@ -1446,7 +1452,7 @@ const Er = ({
|
|
|
1446
1452
|
Tr,
|
|
1447
1453
|
{
|
|
1448
1454
|
totalRecords: V,
|
|
1449
|
-
currentPage:
|
|
1455
|
+
currentPage: F,
|
|
1450
1456
|
onPageChange: G,
|
|
1451
1457
|
pageSize: P
|
|
1452
1458
|
}
|
|
@@ -1456,16 +1462,16 @@ const Er = ({
|
|
|
1456
1462
|
] });
|
|
1457
1463
|
}, Xr = ({
|
|
1458
1464
|
apiClient: a,
|
|
1459
|
-
apiEndpoints:
|
|
1465
|
+
apiEndpoints: u,
|
|
1460
1466
|
entity: d,
|
|
1461
|
-
id:
|
|
1467
|
+
id: f,
|
|
1462
1468
|
mode: s,
|
|
1463
1469
|
onBack: k,
|
|
1464
|
-
onSuccess:
|
|
1470
|
+
onSuccess: X
|
|
1465
1471
|
}) => {
|
|
1466
|
-
const p = Re(() => vt(a,
|
|
1467
|
-
const i = g[R], T = g[
|
|
1468
|
-
return i?.validation?.required && !T?.validation?.required ? -1 : !i?.validation?.required && T?.validation?.required ? 1 : R.localeCompare(
|
|
1472
|
+
const p = Re(() => vt(a, u), [a, u]), [g, Y] = j({}), [S, I] = j({}), [C, W] = j(!1), [te, de] = j({}), [q, V] = j(!0), [D, P] = j(null), re = Re(() => Object.keys(g), [g]), F = Re(() => re.sort((R, E) => {
|
|
1473
|
+
const i = g[R], T = g[E];
|
|
1474
|
+
return i?.validation?.required && !T?.validation?.required ? -1 : !i?.validation?.required && T?.validation?.required ? 1 : R.localeCompare(E);
|
|
1469
1475
|
}), [re, g]);
|
|
1470
1476
|
Ce(() => {
|
|
1471
1477
|
if (!d) return;
|
|
@@ -1475,20 +1481,20 @@ const Er = ({
|
|
|
1475
1481
|
try {
|
|
1476
1482
|
const i = await p.getMetadata(d);
|
|
1477
1483
|
if (!R) return;
|
|
1478
|
-
const
|
|
1479
|
-
Y(
|
|
1484
|
+
const w = (i.data?.data || i.data || {}).formConfig || {};
|
|
1485
|
+
Y(w);
|
|
1480
1486
|
const h = {};
|
|
1481
|
-
for (const [
|
|
1487
|
+
for (const [J, U] of Object.entries(w))
|
|
1482
1488
|
if (U.fieldType === $e.DROPDOWN)
|
|
1483
1489
|
if (U.optionType === "API" && U.option && typeof U.option == "string")
|
|
1484
1490
|
try {
|
|
1485
|
-
const
|
|
1491
|
+
const Te = ((await p.getDropdownOptions(U.option)).data || []).map((ae) => ({
|
|
1486
1492
|
value: ae.id,
|
|
1487
1493
|
label: ae.name || ae.displayName || String(ae.id)
|
|
1488
1494
|
}));
|
|
1489
1495
|
h[U.fieldName] = Te;
|
|
1490
|
-
} catch (
|
|
1491
|
-
console.error(`Failed to load options for ${
|
|
1496
|
+
} catch (Q) {
|
|
1497
|
+
console.error(`Failed to load options for ${J}:`, Q), h[U.fieldName] = [];
|
|
1492
1498
|
}
|
|
1493
1499
|
else U.optionType === "Raw" && Array.isArray(U.option) && (h[U.fieldName] = U.option);
|
|
1494
1500
|
R && de(h);
|
|
@@ -1501,20 +1507,20 @@ const Er = ({
|
|
|
1501
1507
|
R = !1;
|
|
1502
1508
|
};
|
|
1503
1509
|
}, [d, p, a]), Ce(() => {
|
|
1504
|
-
if (!d || !
|
|
1505
|
-
|
|
1510
|
+
if (!d || !f || s === H.CREATE) {
|
|
1511
|
+
I({});
|
|
1506
1512
|
return;
|
|
1507
1513
|
}
|
|
1508
1514
|
let R = !0;
|
|
1509
1515
|
return (async () => {
|
|
1510
1516
|
W(!0), P(null);
|
|
1511
1517
|
try {
|
|
1512
|
-
const i = await p.getRecord(d,
|
|
1518
|
+
const i = await p.getRecord(d, f);
|
|
1513
1519
|
if (!R) return;
|
|
1514
|
-
const T = i.data?.data || i.data || {},
|
|
1515
|
-
for (const [h,
|
|
1516
|
-
h.endsWith(Rr) || (
|
|
1517
|
-
|
|
1520
|
+
const T = i.data?.data || i.data || {}, w = {};
|
|
1521
|
+
for (const [h, J] of Object.entries(T))
|
|
1522
|
+
h.endsWith(Rr) || (w[h] = J);
|
|
1523
|
+
I(w);
|
|
1518
1524
|
} catch (i) {
|
|
1519
1525
|
console.error(ie.FAILED_LOAD_RECORD, i), R && P(ie.FAILED_LOAD_RECORD);
|
|
1520
1526
|
} finally {
|
|
@@ -1523,15 +1529,15 @@ const Er = ({
|
|
|
1523
1529
|
})(), () => {
|
|
1524
1530
|
R = !1;
|
|
1525
1531
|
};
|
|
1526
|
-
}, [d,
|
|
1527
|
-
const G =
|
|
1528
|
-
|
|
1529
|
-
}, []), ue =
|
|
1532
|
+
}, [d, f, s, p]);
|
|
1533
|
+
const G = Ie((R, E) => {
|
|
1534
|
+
I((i) => ({ ...i, [R]: E }));
|
|
1535
|
+
}, []), ue = Ie(() => {
|
|
1530
1536
|
const R = [];
|
|
1531
|
-
for (const [
|
|
1532
|
-
i.validation?.required && !S[i.fieldName] && R.push(ie.FIELD_REQUIRED(
|
|
1537
|
+
for (const [E, i] of Object.entries(g))
|
|
1538
|
+
i.validation?.required && !S[i.fieldName] && R.push(ie.FIELD_REQUIRED(E)), i.validation?.min !== void 0 && S[i.fieldName] < i.validation.min && R.push(`${E} must be at least ${i.validation.min}`), i.validation?.max !== void 0 && S[i.fieldName] > i.validation.max && R.push(`${E} must be at most ${i.validation.max}`);
|
|
1533
1539
|
return R;
|
|
1534
|
-
}, [g, S]),
|
|
1540
|
+
}, [g, S]), K = Ie(async () => {
|
|
1535
1541
|
if (!d) return;
|
|
1536
1542
|
const R = ue();
|
|
1537
1543
|
if (R.length > 0) {
|
|
@@ -1540,81 +1546,81 @@ const Er = ({
|
|
|
1540
1546
|
}
|
|
1541
1547
|
W(!0), P(null);
|
|
1542
1548
|
try {
|
|
1543
|
-
const
|
|
1549
|
+
const E = {};
|
|
1544
1550
|
for (const i of Object.values(g)) {
|
|
1545
1551
|
const T = i.fieldName;
|
|
1546
|
-
T && S[T] !== void 0 && S[T] !== "" && (
|
|
1552
|
+
T && S[T] !== void 0 && S[T] !== "" && (E[T] = S[T]);
|
|
1547
1553
|
}
|
|
1548
|
-
if (s ===
|
|
1549
|
-
const i = await p.createRecord(d, { data:
|
|
1550
|
-
|
|
1551
|
-
} else if (
|
|
1552
|
-
const i = await p.updateRecord(d,
|
|
1553
|
-
|
|
1554
|
+
if (s === H.CREATE) {
|
|
1555
|
+
const i = await p.createRecord(d, { data: E });
|
|
1556
|
+
X?.(i);
|
|
1557
|
+
} else if (f) {
|
|
1558
|
+
const i = await p.updateRecord(d, f, { data: E });
|
|
1559
|
+
X?.(i);
|
|
1554
1560
|
}
|
|
1555
1561
|
k?.();
|
|
1556
|
-
} catch (
|
|
1557
|
-
console.error("Failed to save record:",
|
|
1558
|
-
const i =
|
|
1562
|
+
} catch (E) {
|
|
1563
|
+
console.error("Failed to save record:", E);
|
|
1564
|
+
const i = E?.response?.data?.message || (Array.isArray(E?.response?.data?.message) ? E.response.data.message.join(", ") : "Failed to save record. Please try again.");
|
|
1559
1565
|
P(i);
|
|
1560
1566
|
} finally {
|
|
1561
1567
|
W(!1);
|
|
1562
1568
|
}
|
|
1563
|
-
}, [d, g, S, ue, s,
|
|
1564
|
-
const
|
|
1565
|
-
if (!
|
|
1566
|
-
const T = S[i] ?? "",
|
|
1569
|
+
}, [d, g, S, ue, s, f, p, k, X]), oe = Ie((R) => {
|
|
1570
|
+
const E = g[R], i = E?.fieldName;
|
|
1571
|
+
if (!E || i === "id") return null;
|
|
1572
|
+
const T = S[i] ?? "", w = s === H.VIEW || C;
|
|
1567
1573
|
return /* @__PURE__ */ r.jsxs(N, { className: "form-field", children: [
|
|
1568
1574
|
/* @__PURE__ */ r.jsxs(_e, { variant: "body2", className: "field-label", children: [
|
|
1569
1575
|
R,
|
|
1570
|
-
|
|
1576
|
+
E.validation?.required && s !== H.VIEW && /* @__PURE__ */ r.jsx("span", { style: { color: mr }, children: pr })
|
|
1571
1577
|
] }),
|
|
1572
|
-
|
|
1578
|
+
E.fieldType === $e.DROPDOWN ? /* @__PURE__ */ r.jsx(
|
|
1573
1579
|
Be,
|
|
1574
1580
|
{
|
|
1575
1581
|
options: te[i] || [],
|
|
1576
1582
|
getOptionLabel: (h) => h.label || String(h.value),
|
|
1577
1583
|
value: te[i]?.find((h) => h.value === T) || null,
|
|
1578
|
-
onChange: (h,
|
|
1579
|
-
disabled:
|
|
1580
|
-
loading:
|
|
1584
|
+
onChange: (h, J) => G(i, J?.value ?? null),
|
|
1585
|
+
disabled: w,
|
|
1586
|
+
loading: q,
|
|
1581
1587
|
renderInput: (h) => /* @__PURE__ */ r.jsx(
|
|
1582
1588
|
ee,
|
|
1583
1589
|
{
|
|
1584
1590
|
...h,
|
|
1585
1591
|
size: "small",
|
|
1586
1592
|
placeholder: ye.SELECT(R),
|
|
1587
|
-
error:
|
|
1593
|
+
error: E.validation?.required && !T && s !== H.VIEW
|
|
1588
1594
|
}
|
|
1589
1595
|
),
|
|
1590
1596
|
className: "field-input"
|
|
1591
1597
|
}
|
|
1592
|
-
) :
|
|
1598
|
+
) : E.fieldType === $e.DATEPICKER ? /* @__PURE__ */ r.jsx(
|
|
1593
1599
|
ee,
|
|
1594
1600
|
{
|
|
1595
1601
|
type: "date",
|
|
1596
1602
|
size: "small",
|
|
1597
1603
|
value: T ? String(T).slice(0, 10) : "",
|
|
1598
1604
|
onChange: (h) => G(i, h.target.value),
|
|
1599
|
-
disabled:
|
|
1600
|
-
error:
|
|
1605
|
+
disabled: w,
|
|
1606
|
+
error: E.validation?.required && !T && s !== H.VIEW,
|
|
1601
1607
|
className: "field-input",
|
|
1602
1608
|
InputLabelProps: { shrink: !0 }
|
|
1603
1609
|
}
|
|
1604
|
-
) :
|
|
1610
|
+
) : E.dataType === "number" || E.dataType === "float" ? /* @__PURE__ */ r.jsx(
|
|
1605
1611
|
ee,
|
|
1606
1612
|
{
|
|
1607
1613
|
type: "number",
|
|
1608
1614
|
size: "small",
|
|
1609
1615
|
value: T,
|
|
1610
1616
|
onChange: (h) => G(i, h.target.value),
|
|
1611
|
-
disabled:
|
|
1617
|
+
disabled: w,
|
|
1612
1618
|
placeholder: R,
|
|
1613
|
-
error:
|
|
1619
|
+
error: E.validation?.required && !T && s !== H.VIEW,
|
|
1614
1620
|
inputProps: {
|
|
1615
|
-
max:
|
|
1616
|
-
min:
|
|
1617
|
-
step:
|
|
1621
|
+
max: E.validation?.max,
|
|
1622
|
+
min: E.validation?.min,
|
|
1623
|
+
step: E.dataType === "float" ? 0.01 : 1
|
|
1618
1624
|
},
|
|
1619
1625
|
className: "field-input"
|
|
1620
1626
|
}
|
|
@@ -1624,33 +1630,33 @@ const Er = ({
|
|
|
1624
1630
|
size: "small",
|
|
1625
1631
|
value: T,
|
|
1626
1632
|
onChange: (h) => G(i, h.target.value),
|
|
1627
|
-
disabled:
|
|
1633
|
+
disabled: w,
|
|
1628
1634
|
placeholder: R,
|
|
1629
|
-
error:
|
|
1635
|
+
error: E.validation?.required && !T && s !== H.VIEW,
|
|
1630
1636
|
inputProps: {
|
|
1631
|
-
maxLength:
|
|
1637
|
+
maxLength: E.validation?.max
|
|
1632
1638
|
},
|
|
1633
1639
|
className: "field-input"
|
|
1634
1640
|
}
|
|
1635
1641
|
)
|
|
1636
1642
|
] }, R);
|
|
1637
|
-
}, [g, S, te, G, s, C,
|
|
1638
|
-
return
|
|
1643
|
+
}, [g, S, te, G, s, C, q]);
|
|
1644
|
+
return q ? /* @__PURE__ */ r.jsx(N, { className: "loading-container", display: "flex", justifyContent: "center", alignItems: "center", minHeight: "400px", children: /* @__PURE__ */ r.jsx(Le, {}) }) : /* @__PURE__ */ r.jsx(N, { className: "master-form", children: /* @__PURE__ */ r.jsxs(_t, { className: "form-section", children: [
|
|
1639
1645
|
/* @__PURE__ */ r.jsxs(_e, { variant: "h5", gutterBottom: !0, children: [
|
|
1640
|
-
s ===
|
|
1646
|
+
s === H.CREATE ? Pe.ADD_NEW_RECORD : s === H.EDIT ? Pe.EDIT_RECORD : Pe.VIEW_RECORD,
|
|
1641
1647
|
d && ` - ${d.charAt(0).toUpperCase() + d.slice(1)}`
|
|
1642
1648
|
] }),
|
|
1643
1649
|
D && /* @__PURE__ */ r.jsx(Kt, { severity: "error", onClose: () => P(null), sx: { mb: 2 }, children: D }),
|
|
1644
|
-
C && s !==
|
|
1645
|
-
/* @__PURE__ */ r.jsx(N, { className: "form-fields", children:
|
|
1646
|
-
/* @__PURE__ */ r.jsx(N, { className: "action-buttons", mt: 3, children: s !==
|
|
1650
|
+
C && s !== H.VIEW && /* @__PURE__ */ r.jsx(N, { display: "flex", justifyContent: "center", my: 2, children: /* @__PURE__ */ r.jsx(Le, { size: 24 }) }),
|
|
1651
|
+
/* @__PURE__ */ r.jsx(N, { className: "form-fields", children: F.map(oe) }),
|
|
1652
|
+
/* @__PURE__ */ r.jsx(N, { className: "action-buttons", mt: 3, children: s !== H.VIEW ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
1647
1653
|
/* @__PURE__ */ r.jsx(
|
|
1648
1654
|
ne,
|
|
1649
1655
|
{
|
|
1650
1656
|
variant: "contained",
|
|
1651
|
-
onClick:
|
|
1657
|
+
onClick: K,
|
|
1652
1658
|
disabled: C,
|
|
1653
|
-
children: C ? /* @__PURE__ */ r.jsx(Le, { size: 24 }) : s ===
|
|
1659
|
+
children: C ? /* @__PURE__ */ r.jsx(Le, { size: 24 }) : s === H.CREATE ? le.CREATE : le.UPDATE
|
|
1654
1660
|
}
|
|
1655
1661
|
),
|
|
1656
1662
|
/* @__PURE__ */ r.jsx(
|
|
@@ -1668,8 +1674,8 @@ const Er = ({
|
|
|
1668
1674
|
ROOT: "/",
|
|
1669
1675
|
MASTER: "/master",
|
|
1670
1676
|
MASTER_ENTITY_NEW: (a) => `/master/${a}/new`,
|
|
1671
|
-
MASTER_ENTITY_VIEW: (a,
|
|
1672
|
-
MASTER_ENTITY_EDIT: (a,
|
|
1677
|
+
MASTER_ENTITY_VIEW: (a, u) => `/master/${a}/${u}`,
|
|
1678
|
+
MASTER_ENTITY_EDIT: (a, u) => `/master/${a}/${u}/edit`
|
|
1673
1679
|
}, qr = {
|
|
1674
1680
|
ROOT: "/",
|
|
1675
1681
|
MASTER: "/master",
|
|
@@ -1688,12 +1694,12 @@ const Er = ({
|
|
|
1688
1694
|
EDIT: "/edit"
|
|
1689
1695
|
};
|
|
1690
1696
|
export {
|
|
1691
|
-
|
|
1697
|
+
wr as API_BASE_PATHS,
|
|
1692
1698
|
Pr as API_CONFIG,
|
|
1693
|
-
|
|
1699
|
+
Mr as API_ENDPOINTS,
|
|
1694
1700
|
Lr as ARIA_LABELS,
|
|
1695
1701
|
le as BUTTON_LABELS,
|
|
1696
|
-
|
|
1702
|
+
Or as COLUMN_PROPERTIES,
|
|
1697
1703
|
xr as CSS_CLASSES,
|
|
1698
1704
|
Ne as DATA_TYPES,
|
|
1699
1705
|
Nr as DATE_FORMATS,
|
|
@@ -1706,7 +1712,7 @@ export {
|
|
|
1706
1712
|
Yr as FIELD_NAMES,
|
|
1707
1713
|
$e as FIELD_TYPES,
|
|
1708
1714
|
Et as FILE_EXTENSIONS,
|
|
1709
|
-
|
|
1715
|
+
H as FORM_MODES,
|
|
1710
1716
|
ur as GRID_CSS_CLASSES,
|
|
1711
1717
|
cr as GRID_EVENT_SOURCES,
|
|
1712
1718
|
ut as GRID_LAYOUT,
|
|
@@ -1714,7 +1720,7 @@ export {
|
|
|
1714
1720
|
lr as GRID_SETTINGS,
|
|
1715
1721
|
Ve as GRID_TEXT,
|
|
1716
1722
|
fr as GRID_TIMEOUTS,
|
|
1717
|
-
|
|
1723
|
+
jr as HTTP_METHODS,
|
|
1718
1724
|
$r as INPUT_TYPES,
|
|
1719
1725
|
Dr as LOADING_MESSAGES,
|
|
1720
1726
|
mt as MIME_TYPES,
|
|
@@ -1727,7 +1733,7 @@ export {
|
|
|
1727
1733
|
hr as PAGINATION_SETTINGS,
|
|
1728
1734
|
ye as PLACEHOLDERS,
|
|
1729
1735
|
Tr as Pagination,
|
|
1730
|
-
|
|
1736
|
+
Fr as QUERY_PARAMS,
|
|
1731
1737
|
Br as REGEX_PATTERNS,
|
|
1732
1738
|
pr as REQUIRED_INDICATOR,
|
|
1733
1739
|
mr as REQUIRED_INDICATOR_COLOR,
|
|
@@ -1741,7 +1747,7 @@ export {
|
|
|
1741
1747
|
pt as SORT_ORDER,
|
|
1742
1748
|
Ar as SORT_SETTINGS,
|
|
1743
1749
|
br as STYLE_CONSTANTS,
|
|
1744
|
-
|
|
1750
|
+
Ir as SUCCESS_MESSAGES,
|
|
1745
1751
|
Er as ServerSideGrid,
|
|
1746
1752
|
Jr as URL_PARAMS,
|
|
1747
1753
|
yr as VALIDATION_MESSAGES,
|