master-data-management-react 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +8 -8
- package/dist/index.js +696 -673
- package/dist/pages/MasterView/MasterView.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,146 +1,146 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { styled as
|
|
1
|
+
import ht, { useRef as Ke, useMemo as Oe, useState as w, useEffect as Pe, useCallback as Ne } from "react";
|
|
2
|
+
import { styled as ue, Box as L, Select as Ht, FormControl as Xt, CircularProgress as Ue, Divider as zt, Button as ie, Typography as Ie, Paper as vt, Autocomplete as Je, TextField as te, Menu as qt, MenuItem as He, Alert as Kt } from "@mui/material";
|
|
3
3
|
import { AgGridReact as Jt } from "ag-grid-react";
|
|
4
|
-
import { ModuleRegistry as Qt, ClientSideRowModelModule as
|
|
5
|
-
const
|
|
4
|
+
import { ModuleRegistry as Qt, ClientSideRowModelModule as St, AllCommunityModule as Zt } from "ag-grid-community";
|
|
5
|
+
const At = (a, u) => ({
|
|
6
6
|
getEntities: async () => {
|
|
7
|
-
const
|
|
7
|
+
const d = await a.get(u.entities);
|
|
8
8
|
return {
|
|
9
|
-
data:
|
|
9
|
+
data: d.data.data ?? d.data
|
|
10
10
|
};
|
|
11
11
|
},
|
|
12
|
-
getMetadata: async (
|
|
13
|
-
const
|
|
12
|
+
getMetadata: async (d) => {
|
|
13
|
+
const E = await a.get(u.metadata(d));
|
|
14
14
|
return {
|
|
15
|
-
data:
|
|
15
|
+
data: E.data.data ?? E.data
|
|
16
16
|
};
|
|
17
17
|
},
|
|
18
|
-
getRecords: async (
|
|
19
|
-
const s = await a.get(u.records(
|
|
18
|
+
getRecords: async (d, E) => {
|
|
19
|
+
const s = await a.get(u.records(d), { params: E });
|
|
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 (
|
|
26
|
-
const s = await a.get(u.recordById(
|
|
25
|
+
getRecord: async (d, E) => {
|
|
26
|
+
const s = await a.get(u.recordById(d, E));
|
|
27
27
|
return {
|
|
28
28
|
data: s.data.data ?? s.data
|
|
29
29
|
};
|
|
30
30
|
},
|
|
31
|
-
createRecord: async (
|
|
32
|
-
const s = await a.post(u.records(
|
|
31
|
+
createRecord: async (d, E) => {
|
|
32
|
+
const s = await a.post(u.records(d), E);
|
|
33
33
|
return {
|
|
34
34
|
data: s.data.data ?? s.data
|
|
35
35
|
};
|
|
36
36
|
},
|
|
37
|
-
updateRecord: async (
|
|
38
|
-
const k = await a.put(u.recordById(
|
|
37
|
+
updateRecord: async (d, E, s) => {
|
|
38
|
+
const k = await a.put(u.recordById(d, E), s);
|
|
39
39
|
return {
|
|
40
40
|
data: k.data.data ?? k.data
|
|
41
41
|
};
|
|
42
42
|
},
|
|
43
|
-
deleteRecord: async (
|
|
44
|
-
const s = await a.delete(u.recordById(
|
|
43
|
+
deleteRecord: async (d, E) => {
|
|
44
|
+
const s = await a.delete(u.recordById(d, E));
|
|
45
45
|
return {
|
|
46
46
|
data: s.data.data ?? s.data
|
|
47
47
|
};
|
|
48
48
|
},
|
|
49
|
-
exportCSV: async (
|
|
50
|
-
params:
|
|
49
|
+
exportCSV: async (d, E) => await a.get(u.exportCSV(d), {
|
|
50
|
+
params: E,
|
|
51
51
|
responseType: "blob"
|
|
52
52
|
}),
|
|
53
|
-
exportExcel: async (
|
|
54
|
-
params:
|
|
53
|
+
exportExcel: async (d, E) => await a.get(u.exportExcel(d), {
|
|
54
|
+
params: E,
|
|
55
55
|
responseType: "blob"
|
|
56
56
|
}),
|
|
57
|
-
getDropdownOptions: async (
|
|
58
|
-
const
|
|
57
|
+
getDropdownOptions: async (d) => {
|
|
58
|
+
const E = u.dropdownOptions ? u.dropdownOptions(d) : d, s = await a.get(E);
|
|
59
59
|
return {
|
|
60
60
|
data: s.data.data ?? s.data
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
});
|
|
64
|
-
var
|
|
65
|
-
var
|
|
64
|
+
var Me = { exports: {} }, De = {};
|
|
65
|
+
var dt;
|
|
66
66
|
function er() {
|
|
67
|
-
if (
|
|
68
|
-
|
|
69
|
-
var a =
|
|
70
|
-
function
|
|
71
|
-
var S,
|
|
72
|
-
|
|
73
|
-
for (S in
|
|
74
|
-
if (p && p.defaultProps) for (S in
|
|
75
|
-
return { $$typeof: u, type: p, key: C, ref:
|
|
67
|
+
if (dt) return De;
|
|
68
|
+
dt = 1;
|
|
69
|
+
var a = ht, u = /* @__PURE__ */ Symbol.for("react.element"), d = /* @__PURE__ */ Symbol.for("react.fragment"), E = 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 z(p, v, V) {
|
|
71
|
+
var S, A = {}, C = null, B = null;
|
|
72
|
+
V !== void 0 && (C = "" + V), v.key !== void 0 && (C = "" + v.key), v.ref !== void 0 && (B = v.ref);
|
|
73
|
+
for (S in v) E.call(v, S) && !k.hasOwnProperty(S) && (A[S] = v[S]);
|
|
74
|
+
if (p && p.defaultProps) for (S in v = p.defaultProps, v) A[S] === void 0 && (A[S] = v[S]);
|
|
75
|
+
return { $$typeof: u, type: p, key: C, ref: B, props: A, _owner: s.current };
|
|
76
76
|
}
|
|
77
|
-
return
|
|
77
|
+
return De.Fragment = d, De.jsx = z, De.jsxs = z, De;
|
|
78
78
|
}
|
|
79
|
-
var
|
|
80
|
-
var
|
|
79
|
+
var xe = {};
|
|
80
|
+
var ut;
|
|
81
81
|
function tr() {
|
|
82
|
-
return
|
|
83
|
-
var a =
|
|
84
|
-
function
|
|
82
|
+
return ut || (ut = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
83
|
+
var a = ht, u = /* @__PURE__ */ Symbol.for("react.element"), d = /* @__PURE__ */ Symbol.for("react.portal"), E = /* @__PURE__ */ Symbol.for("react.fragment"), s = /* @__PURE__ */ Symbol.for("react.strict_mode"), k = /* @__PURE__ */ Symbol.for("react.profiler"), z = /* @__PURE__ */ Symbol.for("react.provider"), p = /* @__PURE__ */ Symbol.for("react.context"), v = /* @__PURE__ */ Symbol.for("react.forward_ref"), V = /* @__PURE__ */ Symbol.for("react.suspense"), S = /* @__PURE__ */ Symbol.for("react.suspense_list"), A = /* @__PURE__ */ Symbol.for("react.memo"), C = /* @__PURE__ */ Symbol.for("react.lazy"), B = /* @__PURE__ */ Symbol.for("react.offscreen"), re = Symbol.iterator, fe = "@@iterator";
|
|
84
|
+
function Q(e) {
|
|
85
85
|
if (e === null || typeof e != "object")
|
|
86
86
|
return null;
|
|
87
|
-
var t =
|
|
87
|
+
var t = re && e[re] || e[fe];
|
|
88
88
|
return typeof t == "function" ? t : null;
|
|
89
89
|
}
|
|
90
|
-
var
|
|
91
|
-
function
|
|
90
|
+
var Y = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
91
|
+
function b(e) {
|
|
92
92
|
{
|
|
93
|
-
for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0),
|
|
94
|
-
n[
|
|
95
|
-
|
|
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];
|
|
95
|
+
j("error", e, n);
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
-
function
|
|
98
|
+
function j(e, t, n) {
|
|
99
99
|
{
|
|
100
|
-
var
|
|
101
|
-
|
|
102
|
-
var y = n.map(function(
|
|
103
|
-
return String(
|
|
100
|
+
var c = Y.ReactDebugCurrentFrame, I = c.getStackAddendum();
|
|
101
|
+
I !== "" && (t += "%s", n = n.concat([I]));
|
|
102
|
+
var y = n.map(function(g) {
|
|
103
|
+
return String(g);
|
|
104
104
|
});
|
|
105
105
|
y.unshift("Warning: " + t), Function.prototype.apply.call(console[e], console, y);
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
var
|
|
109
|
-
|
|
110
|
-
function
|
|
111
|
-
return !!(typeof e == "string" || typeof e == "function" || e ===
|
|
108
|
+
var ne = !1, U = !1, G = !1, Ee = !1, Z = !1, le;
|
|
109
|
+
le = /* @__PURE__ */ Symbol.for("react.module.reference");
|
|
110
|
+
function _(e) {
|
|
111
|
+
return !!(typeof e == "string" || typeof e == "function" || e === E || e === k || Z || e === s || e === V || e === S || Ee || e === B || ne || U || G || typeof e == "object" && e !== null && (e.$$typeof === C || e.$$typeof === A || e.$$typeof === z || e.$$typeof === p || e.$$typeof === v || // This needs to include all possible module reference object
|
|
112
112
|
// types supported by any Flight configuration anywhere since
|
|
113
113
|
// we don't know which Flight build this will end up being used
|
|
114
114
|
// with.
|
|
115
|
-
e.$$typeof ===
|
|
115
|
+
e.$$typeof === le || e.getModuleId !== void 0));
|
|
116
116
|
}
|
|
117
|
-
function
|
|
118
|
-
var
|
|
119
|
-
if (
|
|
120
|
-
return
|
|
121
|
-
var
|
|
122
|
-
return
|
|
117
|
+
function T(e, t, n) {
|
|
118
|
+
var c = e.displayName;
|
|
119
|
+
if (c)
|
|
120
|
+
return c;
|
|
121
|
+
var I = t.displayName || t.name || "";
|
|
122
|
+
return I !== "" ? n + "(" + I + ")" : n;
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function l(e) {
|
|
125
125
|
return e.displayName || "Context";
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function f(e) {
|
|
128
128
|
if (e == null)
|
|
129
129
|
return null;
|
|
130
|
-
if (typeof e.tag == "number" &&
|
|
130
|
+
if (typeof e.tag == "number" && b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
131
131
|
return e.displayName || e.name || null;
|
|
132
132
|
if (typeof e == "string")
|
|
133
133
|
return e;
|
|
134
134
|
switch (e) {
|
|
135
|
-
case
|
|
135
|
+
case E:
|
|
136
136
|
return "Fragment";
|
|
137
|
-
case
|
|
137
|
+
case d:
|
|
138
138
|
return "Portal";
|
|
139
139
|
case k:
|
|
140
140
|
return "Profiler";
|
|
141
141
|
case s:
|
|
142
142
|
return "StrictMode";
|
|
143
|
-
case
|
|
143
|
+
case V:
|
|
144
144
|
return "Suspense";
|
|
145
145
|
case S:
|
|
146
146
|
return "SuspenseList";
|
|
@@ -149,19 +149,19 @@ function tr() {
|
|
|
149
149
|
switch (e.$$typeof) {
|
|
150
150
|
case p:
|
|
151
151
|
var t = e;
|
|
152
|
-
return
|
|
153
|
-
case
|
|
152
|
+
return l(t) + ".Consumer";
|
|
153
|
+
case z:
|
|
154
154
|
var n = e;
|
|
155
|
-
return
|
|
156
|
-
case
|
|
157
|
-
return
|
|
158
|
-
case
|
|
159
|
-
var
|
|
160
|
-
return
|
|
155
|
+
return l(n._context) + ".Provider";
|
|
156
|
+
case v:
|
|
157
|
+
return T(e, e.render, "ForwardRef");
|
|
158
|
+
case A:
|
|
159
|
+
var c = e.displayName || null;
|
|
160
|
+
return c !== null ? c : f(e.type) || "Memo";
|
|
161
161
|
case C: {
|
|
162
|
-
var
|
|
162
|
+
var I = e, y = I._payload, g = I._init;
|
|
163
163
|
try {
|
|
164
|
-
return
|
|
164
|
+
return f(g(y));
|
|
165
165
|
} catch {
|
|
166
166
|
return null;
|
|
167
167
|
}
|
|
@@ -169,18 +169,18 @@ function tr() {
|
|
|
169
169
|
}
|
|
170
170
|
return null;
|
|
171
171
|
}
|
|
172
|
-
var
|
|
173
|
-
function
|
|
172
|
+
var F = Object.assign, O = 0, ee, $, oe, Te, he, se, ye;
|
|
173
|
+
function Ce() {
|
|
174
174
|
}
|
|
175
|
-
|
|
176
|
-
function
|
|
175
|
+
Ce.__reactDisabledLog = !0;
|
|
176
|
+
function Ge() {
|
|
177
177
|
{
|
|
178
|
-
if (
|
|
179
|
-
|
|
178
|
+
if (O === 0) {
|
|
179
|
+
ee = console.log, $ = console.info, oe = console.warn, Te = console.error, he = console.group, se = console.groupCollapsed, ye = console.groupEnd;
|
|
180
180
|
var e = {
|
|
181
181
|
configurable: !0,
|
|
182
182
|
enumerable: !0,
|
|
183
|
-
value:
|
|
183
|
+
value: Ce,
|
|
184
184
|
writable: !0
|
|
185
185
|
};
|
|
186
186
|
Object.defineProperties(console, {
|
|
@@ -193,199 +193,199 @@ function tr() {
|
|
|
193
193
|
groupEnd: e
|
|
194
194
|
});
|
|
195
195
|
}
|
|
196
|
-
|
|
196
|
+
O++;
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
function o() {
|
|
200
200
|
{
|
|
201
|
-
if (
|
|
201
|
+
if (O--, O === 0) {
|
|
202
202
|
var e = {
|
|
203
203
|
configurable: !0,
|
|
204
204
|
enumerable: !0,
|
|
205
205
|
writable: !0
|
|
206
206
|
};
|
|
207
207
|
Object.defineProperties(console, {
|
|
208
|
-
log:
|
|
209
|
-
value:
|
|
208
|
+
log: F({}, e, {
|
|
209
|
+
value: ee
|
|
210
210
|
}),
|
|
211
|
-
info:
|
|
212
|
-
value:
|
|
211
|
+
info: F({}, e, {
|
|
212
|
+
value: $
|
|
213
213
|
}),
|
|
214
|
-
warn:
|
|
215
|
-
value:
|
|
214
|
+
warn: F({}, e, {
|
|
215
|
+
value: oe
|
|
216
216
|
}),
|
|
217
|
-
error:
|
|
218
|
-
value: fe
|
|
219
|
-
}),
|
|
220
|
-
group: j({}, e, {
|
|
217
|
+
error: F({}, e, {
|
|
221
218
|
value: Te
|
|
222
219
|
}),
|
|
223
|
-
|
|
224
|
-
value:
|
|
220
|
+
group: F({}, e, {
|
|
221
|
+
value: he
|
|
222
|
+
}),
|
|
223
|
+
groupCollapsed: F({}, e, {
|
|
224
|
+
value: se
|
|
225
225
|
}),
|
|
226
|
-
groupEnd:
|
|
227
|
-
value:
|
|
226
|
+
groupEnd: F({}, e, {
|
|
227
|
+
value: ye
|
|
228
228
|
})
|
|
229
229
|
});
|
|
230
230
|
}
|
|
231
|
-
|
|
231
|
+
O < 0 && b("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
232
232
|
}
|
|
233
233
|
}
|
|
234
|
-
var
|
|
234
|
+
var i = Y.ReactCurrentDispatcher, h;
|
|
235
235
|
function x(e, t, n) {
|
|
236
236
|
{
|
|
237
|
-
if (
|
|
237
|
+
if (h === void 0)
|
|
238
238
|
try {
|
|
239
239
|
throw Error();
|
|
240
|
-
} catch (
|
|
241
|
-
var
|
|
242
|
-
|
|
240
|
+
} catch (I) {
|
|
241
|
+
var c = I.stack.trim().match(/\n( *(at )?)/);
|
|
242
|
+
h = c && c[1] || "";
|
|
243
243
|
}
|
|
244
244
|
return `
|
|
245
|
-
` +
|
|
245
|
+
` + h + e;
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
|
-
var
|
|
248
|
+
var m = !1, N;
|
|
249
249
|
{
|
|
250
|
-
var
|
|
251
|
-
|
|
250
|
+
var ve = typeof WeakMap == "function" ? WeakMap : Map;
|
|
251
|
+
N = new ve();
|
|
252
252
|
}
|
|
253
|
-
function
|
|
254
|
-
if (!e ||
|
|
253
|
+
function pe(e, t) {
|
|
254
|
+
if (!e || m)
|
|
255
255
|
return "";
|
|
256
256
|
{
|
|
257
|
-
var n =
|
|
257
|
+
var n = N.get(e);
|
|
258
258
|
if (n !== void 0)
|
|
259
259
|
return n;
|
|
260
260
|
}
|
|
261
|
-
var
|
|
262
|
-
|
|
263
|
-
var
|
|
261
|
+
var c;
|
|
262
|
+
m = !0;
|
|
263
|
+
var I = Error.prepareStackTrace;
|
|
264
264
|
Error.prepareStackTrace = void 0;
|
|
265
265
|
var y;
|
|
266
|
-
y =
|
|
266
|
+
y = i.current, i.current = null, Ge();
|
|
267
267
|
try {
|
|
268
268
|
if (t) {
|
|
269
|
-
var
|
|
269
|
+
var g = function() {
|
|
270
270
|
throw Error();
|
|
271
271
|
};
|
|
272
|
-
if (Object.defineProperty(
|
|
272
|
+
if (Object.defineProperty(g.prototype, "props", {
|
|
273
273
|
set: function() {
|
|
274
274
|
throw Error();
|
|
275
275
|
}
|
|
276
276
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
277
277
|
try {
|
|
278
|
-
Reflect.construct(
|
|
279
|
-
} catch (
|
|
280
|
-
|
|
278
|
+
Reflect.construct(g, []);
|
|
279
|
+
} catch (H) {
|
|
280
|
+
c = H;
|
|
281
281
|
}
|
|
282
|
-
Reflect.construct(e, [],
|
|
282
|
+
Reflect.construct(e, [], g);
|
|
283
283
|
} else {
|
|
284
284
|
try {
|
|
285
|
-
|
|
286
|
-
} catch (
|
|
287
|
-
|
|
285
|
+
g.call();
|
|
286
|
+
} catch (H) {
|
|
287
|
+
c = H;
|
|
288
288
|
}
|
|
289
|
-
e.call(
|
|
289
|
+
e.call(g.prototype);
|
|
290
290
|
}
|
|
291
291
|
} else {
|
|
292
292
|
try {
|
|
293
293
|
throw Error();
|
|
294
|
-
} catch (
|
|
295
|
-
|
|
294
|
+
} catch (H) {
|
|
295
|
+
c = H;
|
|
296
296
|
}
|
|
297
297
|
e();
|
|
298
298
|
}
|
|
299
|
-
} catch (
|
|
300
|
-
if (
|
|
301
|
-
for (var R =
|
|
302
|
-
`),
|
|
303
|
-
`),
|
|
304
|
-
|
|
305
|
-
for (;
|
|
306
|
-
if (R[
|
|
307
|
-
if (
|
|
299
|
+
} catch (H) {
|
|
300
|
+
if (H && c && typeof H.stack == "string") {
|
|
301
|
+
for (var R = H.stack.split(`
|
|
302
|
+
`), W = c.stack.split(`
|
|
303
|
+
`), P = R.length - 1, M = W.length - 1; P >= 1 && M >= 0 && R[P] !== W[M]; )
|
|
304
|
+
M--;
|
|
305
|
+
for (; P >= 1 && M >= 0; P--, M--)
|
|
306
|
+
if (R[P] !== W[M]) {
|
|
307
|
+
if (P !== 1 || M !== 1)
|
|
308
308
|
do
|
|
309
|
-
if (
|
|
310
|
-
var
|
|
311
|
-
` + R[
|
|
312
|
-
return e.displayName &&
|
|
309
|
+
if (P--, M--, M < 0 || R[P] !== W[M]) {
|
|
310
|
+
var K = `
|
|
311
|
+
` + R[P].replace(" at new ", " at ");
|
|
312
|
+
return e.displayName && K.includes("<anonymous>") && (K = K.replace("<anonymous>", e.displayName)), typeof e == "function" && N.set(e, K), K;
|
|
313
313
|
}
|
|
314
|
-
while (
|
|
314
|
+
while (P >= 1 && M >= 0);
|
|
315
315
|
break;
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
318
|
} finally {
|
|
319
|
-
|
|
319
|
+
m = !1, i.current = y, o(), Error.prepareStackTrace = I;
|
|
320
320
|
}
|
|
321
|
-
var
|
|
322
|
-
return typeof e == "function" &&
|
|
321
|
+
var Ae = e ? e.displayName || e.name : "", ge = Ae ? x(Ae) : "";
|
|
322
|
+
return typeof e == "function" && N.set(e, ge), ge;
|
|
323
323
|
}
|
|
324
|
-
function
|
|
325
|
-
return
|
|
324
|
+
function je(e, t, n) {
|
|
325
|
+
return pe(e, !1);
|
|
326
326
|
}
|
|
327
|
-
function
|
|
327
|
+
function me(e) {
|
|
328
328
|
var t = e.prototype;
|
|
329
329
|
return !!(t && t.isReactComponent);
|
|
330
330
|
}
|
|
331
|
-
function
|
|
331
|
+
function Re(e, t, n) {
|
|
332
332
|
if (e == null)
|
|
333
333
|
return "";
|
|
334
334
|
if (typeof e == "function")
|
|
335
|
-
return
|
|
335
|
+
return pe(e, me(e));
|
|
336
336
|
if (typeof e == "string")
|
|
337
337
|
return x(e);
|
|
338
338
|
switch (e) {
|
|
339
|
-
case
|
|
339
|
+
case V:
|
|
340
340
|
return x("Suspense");
|
|
341
341
|
case S:
|
|
342
342
|
return x("SuspenseList");
|
|
343
343
|
}
|
|
344
344
|
if (typeof e == "object")
|
|
345
345
|
switch (e.$$typeof) {
|
|
346
|
-
case
|
|
347
|
-
return
|
|
348
|
-
case
|
|
349
|
-
return
|
|
346
|
+
case v:
|
|
347
|
+
return je(e.render);
|
|
348
|
+
case A:
|
|
349
|
+
return Re(e.type, t, n);
|
|
350
350
|
case C: {
|
|
351
|
-
var
|
|
351
|
+
var c = e, I = c._payload, y = c._init;
|
|
352
352
|
try {
|
|
353
|
-
return
|
|
353
|
+
return Re(y(I), t, n);
|
|
354
354
|
} catch {
|
|
355
355
|
}
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
358
|
return "";
|
|
359
359
|
}
|
|
360
|
-
var
|
|
361
|
-
function
|
|
360
|
+
var q = Object.prototype.hasOwnProperty, D = {}, ae = Y.ReactDebugCurrentFrame;
|
|
361
|
+
function _e(e) {
|
|
362
362
|
if (e) {
|
|
363
|
-
var t = e._owner, n =
|
|
364
|
-
|
|
363
|
+
var t = e._owner, n = Re(e.type, e._source, t ? t.type : null);
|
|
364
|
+
ae.setExtraStackFrame(n);
|
|
365
365
|
} else
|
|
366
|
-
|
|
366
|
+
ae.setExtraStackFrame(null);
|
|
367
367
|
}
|
|
368
|
-
function
|
|
368
|
+
function Fe(e, t, n, c, I) {
|
|
369
369
|
{
|
|
370
|
-
var y = Function.call.bind(
|
|
371
|
-
for (var
|
|
372
|
-
if (y(e,
|
|
370
|
+
var y = Function.call.bind(q);
|
|
371
|
+
for (var g in e)
|
|
372
|
+
if (y(e, g)) {
|
|
373
373
|
var R = void 0;
|
|
374
374
|
try {
|
|
375
|
-
if (typeof e[
|
|
376
|
-
var
|
|
377
|
-
throw
|
|
375
|
+
if (typeof e[g] != "function") {
|
|
376
|
+
var W = Error((c || "React class") + ": " + n + " type `" + g + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[g] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
377
|
+
throw W.name = "Invariant Violation", W;
|
|
378
378
|
}
|
|
379
|
-
R = e[
|
|
380
|
-
} catch (
|
|
381
|
-
R =
|
|
379
|
+
R = e[g](t, g, c, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
380
|
+
} catch (P) {
|
|
381
|
+
R = P;
|
|
382
382
|
}
|
|
383
|
-
R && !(R instanceof Error) && (
|
|
383
|
+
R && !(R instanceof Error) && (_e(I), b("%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, g, typeof R), _e(null)), R instanceof Error && !(R.message in D) && (D[R.message] = !0, _e(I), b("Failed %s type: %s", n, R.message), _e(null));
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
386
|
}
|
|
387
387
|
var It = Array.isArray;
|
|
388
|
-
function
|
|
388
|
+
function ke(e) {
|
|
389
389
|
return It(e);
|
|
390
390
|
}
|
|
391
391
|
function yt(e) {
|
|
@@ -396,26 +396,26 @@ function tr() {
|
|
|
396
396
|
}
|
|
397
397
|
function Ct(e) {
|
|
398
398
|
try {
|
|
399
|
-
return
|
|
399
|
+
return Qe(e), !1;
|
|
400
400
|
} catch {
|
|
401
401
|
return !0;
|
|
402
402
|
}
|
|
403
403
|
}
|
|
404
|
-
function
|
|
404
|
+
function Qe(e) {
|
|
405
405
|
return "" + e;
|
|
406
406
|
}
|
|
407
|
-
function
|
|
407
|
+
function Ze(e) {
|
|
408
408
|
if (Ct(e))
|
|
409
|
-
return
|
|
409
|
+
return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", yt(e)), Qe(e);
|
|
410
410
|
}
|
|
411
|
-
var
|
|
411
|
+
var et = Y.ReactCurrentOwner, Dt = {
|
|
412
412
|
key: !0,
|
|
413
413
|
ref: !0,
|
|
414
414
|
__self: !0,
|
|
415
415
|
__source: !0
|
|
416
|
-
},
|
|
416
|
+
}, tt, rt;
|
|
417
417
|
function xt(e) {
|
|
418
|
-
if (
|
|
418
|
+
if (q.call(e, "ref")) {
|
|
419
419
|
var t = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
420
420
|
if (t && t.isReactWarning)
|
|
421
421
|
return !1;
|
|
@@ -423,7 +423,7 @@ function tr() {
|
|
|
423
423
|
return e.ref !== void 0;
|
|
424
424
|
}
|
|
425
425
|
function bt(e) {
|
|
426
|
-
if (
|
|
426
|
+
if (q.call(e, "key")) {
|
|
427
427
|
var t = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
428
428
|
if (t && t.isReactWarning)
|
|
429
429
|
return !1;
|
|
@@ -431,12 +431,12 @@ function tr() {
|
|
|
431
431
|
return e.key !== void 0;
|
|
432
432
|
}
|
|
433
433
|
function Nt(e, t) {
|
|
434
|
-
typeof e.ref == "string" &&
|
|
434
|
+
typeof e.ref == "string" && et.current;
|
|
435
435
|
}
|
|
436
436
|
function Lt(e, t) {
|
|
437
437
|
{
|
|
438
438
|
var n = function() {
|
|
439
|
-
|
|
439
|
+
tt || (tt = !0, b("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
|
|
440
440
|
};
|
|
441
441
|
n.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
442
442
|
get: n,
|
|
@@ -447,7 +447,7 @@ function tr() {
|
|
|
447
447
|
function Pt(e, t) {
|
|
448
448
|
{
|
|
449
449
|
var n = function() {
|
|
450
|
-
|
|
450
|
+
rt || (rt = !0, b("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
|
|
451
451
|
};
|
|
452
452
|
n.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
453
453
|
get: n,
|
|
@@ -455,7 +455,7 @@ function tr() {
|
|
|
455
455
|
});
|
|
456
456
|
}
|
|
457
457
|
}
|
|
458
|
-
var jt = function(e, t, n,
|
|
458
|
+
var jt = function(e, t, n, c, I, y, g) {
|
|
459
459
|
var R = {
|
|
460
460
|
// This tag allows us to uniquely identify this as a React Element
|
|
461
461
|
$$typeof: u,
|
|
@@ -463,7 +463,7 @@ function tr() {
|
|
|
463
463
|
type: e,
|
|
464
464
|
key: t,
|
|
465
465
|
ref: n,
|
|
466
|
-
props:
|
|
466
|
+
props: g,
|
|
467
467
|
// Record the component responsible for creating this element.
|
|
468
468
|
_owner: y
|
|
469
469
|
};
|
|
@@ -476,49 +476,49 @@ function tr() {
|
|
|
476
476
|
configurable: !1,
|
|
477
477
|
enumerable: !1,
|
|
478
478
|
writable: !1,
|
|
479
|
-
value:
|
|
479
|
+
value: c
|
|
480
480
|
}), Object.defineProperty(R, "_source", {
|
|
481
481
|
configurable: !1,
|
|
482
482
|
enumerable: !1,
|
|
483
483
|
writable: !1,
|
|
484
|
-
value:
|
|
484
|
+
value: I
|
|
485
485
|
}), Object.freeze && (Object.freeze(R.props), Object.freeze(R)), R;
|
|
486
486
|
};
|
|
487
|
-
function
|
|
487
|
+
function Ft(e, t, n, c, I) {
|
|
488
488
|
{
|
|
489
|
-
var y,
|
|
490
|
-
n !== void 0 && (
|
|
489
|
+
var y, g = {}, R = null, W = null;
|
|
490
|
+
n !== void 0 && (Ze(n), R = "" + n), bt(t) && (Ze(t.key), R = "" + t.key), xt(t) && (W = t.ref, Nt(t, I));
|
|
491
491
|
for (y in t)
|
|
492
|
-
|
|
492
|
+
q.call(t, y) && !Dt.hasOwnProperty(y) && (g[y] = t[y]);
|
|
493
493
|
if (e && e.defaultProps) {
|
|
494
|
-
var
|
|
495
|
-
for (y in
|
|
496
|
-
|
|
494
|
+
var P = e.defaultProps;
|
|
495
|
+
for (y in P)
|
|
496
|
+
g[y] === void 0 && (g[y] = P[y]);
|
|
497
497
|
}
|
|
498
|
-
if (R ||
|
|
499
|
-
var
|
|
500
|
-
R && Lt(
|
|
498
|
+
if (R || W) {
|
|
499
|
+
var M = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
500
|
+
R && Lt(g, M), W && Pt(g, M);
|
|
501
501
|
}
|
|
502
|
-
return jt(e, R,
|
|
502
|
+
return jt(e, R, W, I, c, et.current, g);
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
|
-
var
|
|
506
|
-
function
|
|
505
|
+
var Ve = Y.ReactCurrentOwner, at = Y.ReactDebugCurrentFrame;
|
|
506
|
+
function Se(e) {
|
|
507
507
|
if (e) {
|
|
508
|
-
var t = e._owner, n =
|
|
509
|
-
|
|
508
|
+
var t = e._owner, n = Re(e.type, e._source, t ? t.type : null);
|
|
509
|
+
at.setExtraStackFrame(n);
|
|
510
510
|
} else
|
|
511
|
-
|
|
511
|
+
at.setExtraStackFrame(null);
|
|
512
512
|
}
|
|
513
|
-
var
|
|
514
|
-
|
|
515
|
-
function
|
|
513
|
+
var Ye;
|
|
514
|
+
Ye = !1;
|
|
515
|
+
function We(e) {
|
|
516
516
|
return typeof e == "object" && e !== null && e.$$typeof === u;
|
|
517
517
|
}
|
|
518
|
-
function
|
|
518
|
+
function nt() {
|
|
519
519
|
{
|
|
520
|
-
if (
|
|
521
|
-
var e =
|
|
520
|
+
if (Ve.current) {
|
|
521
|
+
var e = f(Ve.current.type);
|
|
522
522
|
if (e)
|
|
523
523
|
return `
|
|
524
524
|
|
|
@@ -530,10 +530,10 @@ Check the render method of \`` + e + "`.";
|
|
|
530
530
|
function Mt(e) {
|
|
531
531
|
return "";
|
|
532
532
|
}
|
|
533
|
-
var
|
|
534
|
-
function
|
|
533
|
+
var ot = {};
|
|
534
|
+
function wt(e) {
|
|
535
535
|
{
|
|
536
|
-
var t =
|
|
536
|
+
var t = nt();
|
|
537
537
|
if (!t) {
|
|
538
538
|
var n = typeof e == "string" ? e : e.displayName || e.name;
|
|
539
539
|
n && (t = `
|
|
@@ -543,35 +543,35 @@ Check the top-level render call using <` + n + ">.");
|
|
|
543
543
|
return t;
|
|
544
544
|
}
|
|
545
545
|
}
|
|
546
|
-
function
|
|
546
|
+
function st(e, t) {
|
|
547
547
|
{
|
|
548
548
|
if (!e._store || e._store.validated || e.key != null)
|
|
549
549
|
return;
|
|
550
550
|
e._store.validated = !0;
|
|
551
|
-
var n =
|
|
552
|
-
if (
|
|
551
|
+
var n = wt(t);
|
|
552
|
+
if (ot[n])
|
|
553
553
|
return;
|
|
554
|
-
|
|
555
|
-
var
|
|
556
|
-
e && e._owner && e._owner !==
|
|
554
|
+
ot[n] = !0;
|
|
555
|
+
var c = "";
|
|
556
|
+
e && e._owner && e._owner !== Ve.current && (c = " It was passed a child from " + f(e._owner.type) + "."), Se(e), b('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), Se(null);
|
|
557
557
|
}
|
|
558
558
|
}
|
|
559
|
-
function
|
|
559
|
+
function it(e, t) {
|
|
560
560
|
{
|
|
561
561
|
if (typeof e != "object")
|
|
562
562
|
return;
|
|
563
|
-
if (
|
|
563
|
+
if (ke(e))
|
|
564
564
|
for (var n = 0; n < e.length; n++) {
|
|
565
|
-
var
|
|
566
|
-
|
|
565
|
+
var c = e[n];
|
|
566
|
+
We(c) && st(c, t);
|
|
567
567
|
}
|
|
568
|
-
else if (
|
|
568
|
+
else if (We(e))
|
|
569
569
|
e._store && (e._store.validated = !0);
|
|
570
570
|
else if (e) {
|
|
571
|
-
var
|
|
572
|
-
if (typeof
|
|
573
|
-
for (var y =
|
|
574
|
-
|
|
571
|
+
var I = Q(e);
|
|
572
|
+
if (typeof I == "function" && I !== e.entries)
|
|
573
|
+
for (var y = I.call(e), g; !(g = y.next()).done; )
|
|
574
|
+
We(g.value) && st(g.value, t);
|
|
575
575
|
}
|
|
576
576
|
}
|
|
577
577
|
}
|
|
@@ -583,99 +583,99 @@ Check the top-level render call using <` + n + ">.");
|
|
|
583
583
|
var n;
|
|
584
584
|
if (typeof t == "function")
|
|
585
585
|
n = t.propTypes;
|
|
586
|
-
else if (typeof t == "object" && (t.$$typeof ===
|
|
586
|
+
else if (typeof t == "object" && (t.$$typeof === v || // Note: Memo only checks outer props here.
|
|
587
587
|
// Inner props are checked in the reconciler.
|
|
588
|
-
t.$$typeof ===
|
|
588
|
+
t.$$typeof === A))
|
|
589
589
|
n = t.propTypes;
|
|
590
590
|
else
|
|
591
591
|
return;
|
|
592
592
|
if (n) {
|
|
593
|
-
var
|
|
594
|
-
|
|
595
|
-
} else if (t.PropTypes !== void 0 && !
|
|
596
|
-
|
|
597
|
-
var
|
|
598
|
-
|
|
593
|
+
var c = f(t);
|
|
594
|
+
Fe(n, e.props, "prop", c, e);
|
|
595
|
+
} else if (t.PropTypes !== void 0 && !Ye) {
|
|
596
|
+
Ye = !0;
|
|
597
|
+
var I = f(t);
|
|
598
|
+
b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", I || "Unknown");
|
|
599
599
|
}
|
|
600
|
-
typeof t.getDefaultProps == "function" && !t.getDefaultProps.isReactClassApproved &&
|
|
600
|
+
typeof t.getDefaultProps == "function" && !t.getDefaultProps.isReactClassApproved && b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
601
601
|
}
|
|
602
602
|
}
|
|
603
|
-
function
|
|
603
|
+
function $t(e) {
|
|
604
604
|
{
|
|
605
605
|
for (var t = Object.keys(e.props), n = 0; n < t.length; n++) {
|
|
606
|
-
var
|
|
607
|
-
if (
|
|
608
|
-
|
|
606
|
+
var c = t[n];
|
|
607
|
+
if (c !== "children" && c !== "key") {
|
|
608
|
+
Se(e), b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", c), Se(null);
|
|
609
609
|
break;
|
|
610
610
|
}
|
|
611
611
|
}
|
|
612
|
-
e.ref !== null && (
|
|
612
|
+
e.ref !== null && (Se(e), b("Invalid attribute `ref` supplied to `React.Fragment`."), Se(null));
|
|
613
613
|
}
|
|
614
614
|
}
|
|
615
|
-
var
|
|
616
|
-
function
|
|
615
|
+
var lt = {};
|
|
616
|
+
function ct(e, t, n, c, I, y) {
|
|
617
617
|
{
|
|
618
|
-
var
|
|
619
|
-
if (!
|
|
618
|
+
var g = _(e);
|
|
619
|
+
if (!g) {
|
|
620
620
|
var R = "";
|
|
621
621
|
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (R += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
622
|
-
var
|
|
623
|
-
|
|
624
|
-
var
|
|
625
|
-
e === null ?
|
|
622
|
+
var W = Mt();
|
|
623
|
+
W ? R += W : R += nt();
|
|
624
|
+
var P;
|
|
625
|
+
e === null ? P = "null" : ke(e) ? P = "array" : e !== void 0 && e.$$typeof === u ? (P = "<" + (f(e.type) || "Unknown") + " />", R = " Did you accidentally export a JSX literal instead of a component?") : P = typeof e, b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", P, R);
|
|
626
626
|
}
|
|
627
|
-
var
|
|
628
|
-
if (
|
|
629
|
-
return
|
|
630
|
-
if (
|
|
631
|
-
var
|
|
632
|
-
if (
|
|
633
|
-
if (
|
|
634
|
-
if (
|
|
635
|
-
for (var
|
|
636
|
-
|
|
637
|
-
Object.freeze && Object.freeze(
|
|
627
|
+
var M = Ft(e, t, n, I, y);
|
|
628
|
+
if (M == null)
|
|
629
|
+
return M;
|
|
630
|
+
if (g) {
|
|
631
|
+
var K = t.children;
|
|
632
|
+
if (K !== void 0)
|
|
633
|
+
if (c)
|
|
634
|
+
if (ke(K)) {
|
|
635
|
+
for (var Ae = 0; Ae < K.length; Ae++)
|
|
636
|
+
it(K[Ae], e);
|
|
637
|
+
Object.freeze && Object.freeze(K);
|
|
638
638
|
} else
|
|
639
|
-
|
|
639
|
+
b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
640
640
|
else
|
|
641
|
-
|
|
641
|
+
it(K, e);
|
|
642
642
|
}
|
|
643
|
-
if (
|
|
644
|
-
var
|
|
643
|
+
if (q.call(t, "key")) {
|
|
644
|
+
var ge = f(e), H = Object.keys(t).filter(function(Bt) {
|
|
645
645
|
return Bt !== "key";
|
|
646
|
-
}),
|
|
647
|
-
if (!
|
|
648
|
-
var Wt =
|
|
649
|
-
|
|
646
|
+
}), Be = H.length > 0 ? "{key: someKey, " + H.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
647
|
+
if (!lt[ge + Be]) {
|
|
648
|
+
var Wt = H.length > 0 ? "{" + H.join(": ..., ") + ": ...}" : "{}";
|
|
649
|
+
b(`A props object containing a "key" prop is being spread into JSX:
|
|
650
650
|
let props = %s;
|
|
651
651
|
<%s {...props} />
|
|
652
652
|
React keys must be passed directly to JSX without using spread:
|
|
653
653
|
let props = %s;
|
|
654
|
-
<%s key={someKey} {...props} />`,
|
|
654
|
+
<%s key={someKey} {...props} />`, Be, ge, Wt, ge), lt[ge + Be] = !0;
|
|
655
655
|
}
|
|
656
656
|
}
|
|
657
|
-
return e ===
|
|
657
|
+
return e === E ? $t(M) : Ut(M), M;
|
|
658
658
|
}
|
|
659
659
|
}
|
|
660
|
-
function
|
|
661
|
-
return
|
|
660
|
+
function Gt(e, t, n) {
|
|
661
|
+
return ct(e, t, n, !0);
|
|
662
662
|
}
|
|
663
|
-
function
|
|
664
|
-
return
|
|
663
|
+
function kt(e, t, n) {
|
|
664
|
+
return ct(e, t, n, !1);
|
|
665
665
|
}
|
|
666
|
-
var Vt =
|
|
667
|
-
|
|
668
|
-
})()),
|
|
666
|
+
var Vt = kt, Yt = Gt;
|
|
667
|
+
xe.Fragment = E, xe.jsx = Vt, xe.jsxs = Yt;
|
|
668
|
+
})()), xe;
|
|
669
669
|
}
|
|
670
|
-
var
|
|
670
|
+
var ft;
|
|
671
671
|
function rr() {
|
|
672
|
-
return
|
|
672
|
+
return ft || (ft = 1, process.env.NODE_ENV === "production" ? Me.exports = er() : Me.exports = tr()), Me.exports;
|
|
673
673
|
}
|
|
674
674
|
var r = rr();
|
|
675
|
-
const ar =
|
|
675
|
+
const ar = ue(L)(({ theme: a }) => ({
|
|
676
676
|
width: "100%",
|
|
677
677
|
fontFamily: a.typography.fontFamily
|
|
678
|
-
})),
|
|
678
|
+
})), Et = ue("div")(({ theme: a }) => ({
|
|
679
679
|
width: "100%",
|
|
680
680
|
"& .ag-header": {
|
|
681
681
|
borderRadius: "8px 8px 0 0"
|
|
@@ -715,7 +715,7 @@ const ar = ce(N)(({ theme: a }) => ({
|
|
|
715
715
|
border: "1px solid transparent !important"
|
|
716
716
|
}
|
|
717
717
|
}));
|
|
718
|
-
|
|
718
|
+
ue(L)(() => ({
|
|
719
719
|
position: "fixed",
|
|
720
720
|
inset: 0,
|
|
721
721
|
display: "flex",
|
|
@@ -724,7 +724,7 @@ ce(N)(() => ({
|
|
|
724
724
|
zIndex: 1301,
|
|
725
725
|
background: "rgba(255, 255, 255, 0.5)"
|
|
726
726
|
}));
|
|
727
|
-
const nr =
|
|
727
|
+
const nr = ue(L)(({ theme: a }) => ({
|
|
728
728
|
display: "flex",
|
|
729
729
|
justifyContent: "flex-end",
|
|
730
730
|
marginTop: "16px",
|
|
@@ -739,7 +739,7 @@ const nr = ce(N)(({ theme: a }) => ({
|
|
|
739
739
|
alignItems: "center",
|
|
740
740
|
gap: "16px"
|
|
741
741
|
}
|
|
742
|
-
})), or =
|
|
742
|
+
})), or = ue(Ht)(() => ({
|
|
743
743
|
fontSize: "14px",
|
|
744
744
|
border: "none",
|
|
745
745
|
boxShadow: "none",
|
|
@@ -755,7 +755,7 @@ const nr = ce(N)(({ theme: a }) => ({
|
|
|
755
755
|
paddingLeft: "8px",
|
|
756
756
|
paddingRight: "32px !important"
|
|
757
757
|
}
|
|
758
|
-
})), sr =
|
|
758
|
+
})), sr = ue(L)(
|
|
759
759
|
({ height: a }) => ({
|
|
760
760
|
...a !== void 0 && {
|
|
761
761
|
height: `${a}px`
|
|
@@ -791,7 +791,7 @@ const nr = ce(N)(({ theme: a }) => ({
|
|
|
791
791
|
justifyContent: "space-between"
|
|
792
792
|
}
|
|
793
793
|
})
|
|
794
|
-
), ir =
|
|
794
|
+
), ir = ue(Xt)(
|
|
795
795
|
({ theme: a }) => ({
|
|
796
796
|
display: "flex",
|
|
797
797
|
flexDirection: "row",
|
|
@@ -802,7 +802,7 @@ const nr = ce(N)(({ theme: a }) => ({
|
|
|
802
802
|
gap: "8px"
|
|
803
803
|
}
|
|
804
804
|
})
|
|
805
|
-
),
|
|
805
|
+
), Tt = ue(L)(({ theme: a }) => ({
|
|
806
806
|
fontWeight: 300,
|
|
807
807
|
fontSize: "14px",
|
|
808
808
|
[a.breakpoints.down("sm")]: {
|
|
@@ -813,7 +813,7 @@ const nr = ce(N)(({ theme: a }) => ({
|
|
|
813
813
|
MIN_HEIGHT: 300,
|
|
814
814
|
MAX_HEIGHT: 800,
|
|
815
815
|
DEFAULT_ROW_HEIGHT: 50
|
|
816
|
-
},
|
|
816
|
+
}, Sr = {
|
|
817
817
|
DEFAULT_PAGE: 1,
|
|
818
818
|
DEFAULT_PAGE_SIZE: 10,
|
|
819
819
|
PAGE_SIZE_OPTIONS: [10, 20, 50, 100],
|
|
@@ -825,10 +825,10 @@ const nr = ce(N)(({ theme: a }) => ({
|
|
|
825
825
|
UI_COLUMN_SORTED: "uiColumnSorted",
|
|
826
826
|
API: "api",
|
|
827
827
|
COLUMN_MOVED: "columnMoved"
|
|
828
|
-
},
|
|
828
|
+
}, pt = {
|
|
829
829
|
NORMAL: "normal",
|
|
830
830
|
AUTO_HEIGHT: "autoHeight"
|
|
831
|
-
},
|
|
831
|
+
}, Ot = {
|
|
832
832
|
CLIENT_SIDE: "clientSide",
|
|
833
833
|
SERVER_SIDE: "serverSide",
|
|
834
834
|
INFINITE: "infinite",
|
|
@@ -850,85 +850,85 @@ const nr = ce(N)(({ theme: a }) => ({
|
|
|
850
850
|
URL_REVOKE: 100
|
|
851
851
|
// milliseconds to wait before revoking blob URL
|
|
852
852
|
};
|
|
853
|
-
Qt.registerModules([
|
|
853
|
+
Qt.registerModules([St, Zt]);
|
|
854
854
|
const Er = ({
|
|
855
855
|
rows: a,
|
|
856
856
|
totalRecords: u,
|
|
857
|
-
currentPage:
|
|
858
|
-
loading:
|
|
857
|
+
currentPage: d,
|
|
858
|
+
loading: E,
|
|
859
859
|
onPageChange: s,
|
|
860
860
|
columns: k,
|
|
861
|
-
pageSize:
|
|
861
|
+
pageSize: z,
|
|
862
862
|
pageSizeOptions: p,
|
|
863
|
-
onPageSizeChange:
|
|
864
|
-
setSort:
|
|
863
|
+
onPageSizeChange: v,
|
|
864
|
+
setSort: V,
|
|
865
865
|
sortModel: S,
|
|
866
|
-
height:
|
|
867
|
-
domLayout: C =
|
|
868
|
-
getRowHeight:
|
|
869
|
-
pinnedBottomRowData:
|
|
870
|
-
showLoader:
|
|
871
|
-
emptyDataMessage:
|
|
872
|
-
...
|
|
866
|
+
height: A = lr.DEFAULT_HEIGHT,
|
|
867
|
+
domLayout: C = pt.NORMAL,
|
|
868
|
+
getRowHeight: B,
|
|
869
|
+
pinnedBottomRowData: re,
|
|
870
|
+
showLoader: fe = !0,
|
|
871
|
+
emptyDataMessage: Q,
|
|
872
|
+
...Y
|
|
873
873
|
}) => {
|
|
874
|
-
const
|
|
875
|
-
if (
|
|
876
|
-
const G =
|
|
877
|
-
colId:
|
|
878
|
-
sort:
|
|
874
|
+
const b = Ke(null), j = Ke([]), ne = (U) => {
|
|
875
|
+
if (U.source !== cr.UI_COLUMN_SORTED || (console.log("Sort Changed Event (User Initiated):", U), !V)) return;
|
|
876
|
+
const G = U.api.getColumnState().filter((Z) => Z.sort).map((Z) => ({
|
|
877
|
+
colId: Z.colId,
|
|
878
|
+
sort: Z.sort
|
|
879
879
|
}));
|
|
880
|
-
console.log("New Sort Model:", G), JSON.stringify(G) !== JSON.stringify(
|
|
880
|
+
console.log("New Sort Model:", G), JSON.stringify(G) !== JSON.stringify(j.current) && (j.current = G, V(G));
|
|
881
881
|
};
|
|
882
|
-
return
|
|
883
|
-
|
|
882
|
+
return fe && E ? /* @__PURE__ */ r.jsx(
|
|
883
|
+
Et,
|
|
884
884
|
{
|
|
885
885
|
style: {
|
|
886
886
|
display: "flex",
|
|
887
887
|
alignItems: "center",
|
|
888
888
|
justifyContent: "center",
|
|
889
|
-
height:
|
|
889
|
+
height: A,
|
|
890
890
|
minHeight: 120
|
|
891
891
|
},
|
|
892
|
-
children: /* @__PURE__ */ r.jsx(
|
|
892
|
+
children: /* @__PURE__ */ r.jsx(Ue, {})
|
|
893
893
|
}
|
|
894
|
-
) : /* @__PURE__ */ r.jsx(
|
|
894
|
+
) : /* @__PURE__ */ r.jsx(Et, { "data-testid": "ServerSideGrid", className: ur.AG_THEME_ALPINE, children: /* @__PURE__ */ r.jsxs(ar, { children: [
|
|
895
895
|
/* @__PURE__ */ r.jsx(
|
|
896
896
|
sr,
|
|
897
897
|
{
|
|
898
|
-
height: C ===
|
|
898
|
+
height: C === pt.AUTO_HEIGHT ? void 0 : A,
|
|
899
899
|
children: /* @__PURE__ */ r.jsx(
|
|
900
900
|
Jt,
|
|
901
901
|
{
|
|
902
|
-
ref:
|
|
902
|
+
ref: b,
|
|
903
903
|
theme: "legacy",
|
|
904
904
|
columnDefs: k,
|
|
905
905
|
rowData: a,
|
|
906
|
-
pinnedBottomRowData:
|
|
906
|
+
pinnedBottomRowData: re,
|
|
907
907
|
domLayout: C,
|
|
908
|
-
rowModelType:
|
|
909
|
-
modules: [
|
|
908
|
+
rowModelType: Ot.CLIENT_SIDE,
|
|
909
|
+
modules: [St],
|
|
910
910
|
localeText: {
|
|
911
|
-
noRowsToShow:
|
|
911
|
+
noRowsToShow: Q || "No data to show"
|
|
912
912
|
},
|
|
913
|
-
...
|
|
913
|
+
...Y,
|
|
914
914
|
enableBrowserTooltips: !0,
|
|
915
915
|
suppressMovableColumns: !0,
|
|
916
916
|
suppressMenuHide: !0,
|
|
917
|
-
onSortChanged:
|
|
917
|
+
onSortChanged: ne,
|
|
918
918
|
defaultColDef: {
|
|
919
919
|
width: 170,
|
|
920
920
|
sortable: !0,
|
|
921
921
|
unSortIcon: !0,
|
|
922
|
-
tooltipValueGetter: (
|
|
922
|
+
tooltipValueGetter: (U) => U.value ?? dr.NO_DATA
|
|
923
923
|
},
|
|
924
924
|
suppressRowTransform: !0,
|
|
925
|
-
getRowHeight:
|
|
925
|
+
getRowHeight: B ?? (() => 54),
|
|
926
926
|
maintainColumnOrder: !0,
|
|
927
927
|
initialState: S && S.length > 0 ? {
|
|
928
928
|
sort: {
|
|
929
|
-
sortModel: S.map((
|
|
930
|
-
colId:
|
|
931
|
-
sort:
|
|
929
|
+
sortModel: S.map((U) => ({
|
|
930
|
+
colId: U.colId,
|
|
931
|
+
sort: U.sort
|
|
932
932
|
}))
|
|
933
933
|
}
|
|
934
934
|
} : void 0
|
|
@@ -941,42 +941,42 @@ const Er = ({
|
|
|
941
941
|
}, Tr = ({
|
|
942
942
|
totalRecords: a,
|
|
943
943
|
currentPage: u,
|
|
944
|
-
pageSize:
|
|
945
|
-
onPageChange:
|
|
944
|
+
pageSize: d,
|
|
945
|
+
onPageChange: E
|
|
946
946
|
}) => {
|
|
947
|
-
const s = Math.ceil(a /
|
|
948
|
-
return /* @__PURE__ */ r.jsxs(
|
|
947
|
+
const s = Math.ceil(a / d);
|
|
948
|
+
return /* @__PURE__ */ r.jsxs(L, { sx: { display: "flex", gap: 2, alignItems: "center" }, children: [
|
|
949
949
|
/* @__PURE__ */ r.jsx(
|
|
950
|
-
|
|
950
|
+
ie,
|
|
951
951
|
{
|
|
952
952
|
size: "small",
|
|
953
953
|
disabled: u === 1,
|
|
954
|
-
onClick: () =>
|
|
954
|
+
onClick: () => E(u - 1),
|
|
955
955
|
children: "Previous"
|
|
956
956
|
}
|
|
957
957
|
),
|
|
958
|
-
/* @__PURE__ */ r.jsxs(
|
|
958
|
+
/* @__PURE__ */ r.jsxs(Ie, { variant: "body2", children: [
|
|
959
959
|
"Page ",
|
|
960
960
|
u,
|
|
961
961
|
" of ",
|
|
962
962
|
s || 1
|
|
963
963
|
] }),
|
|
964
964
|
/* @__PURE__ */ r.jsx(
|
|
965
|
-
|
|
965
|
+
ie,
|
|
966
966
|
{
|
|
967
967
|
size: "small",
|
|
968
968
|
disabled: u >= s,
|
|
969
|
-
onClick: () =>
|
|
969
|
+
onClick: () => E(u + 1),
|
|
970
970
|
children: "Next"
|
|
971
971
|
}
|
|
972
972
|
)
|
|
973
973
|
] });
|
|
974
|
-
},
|
|
974
|
+
}, $e = {
|
|
975
975
|
MASTER_DATA_MANAGEMENT: "Master Data Management",
|
|
976
976
|
ADD_NEW_RECORD: "Add New Record",
|
|
977
977
|
EDIT_RECORD: "Edit Record",
|
|
978
978
|
VIEW_RECORD: "View Record"
|
|
979
|
-
},
|
|
979
|
+
}, de = {
|
|
980
980
|
VIEW: "View",
|
|
981
981
|
ADD_NEW_RECORD: "Add New Record",
|
|
982
982
|
EDIT: "Edit",
|
|
@@ -985,22 +985,22 @@ const Er = ({
|
|
|
985
985
|
CANCEL: "Cancel",
|
|
986
986
|
BACK: "Back",
|
|
987
987
|
EXPORT: "Export"
|
|
988
|
-
},
|
|
988
|
+
}, Xe = {
|
|
989
989
|
SELECT_ENTITY: "Select Entity",
|
|
990
990
|
ACTIONS: "Actions",
|
|
991
991
|
FROM: "From",
|
|
992
992
|
TO: "To"
|
|
993
|
-
},
|
|
993
|
+
}, Le = {
|
|
994
994
|
SELECT_ENTITY: "Select Entity",
|
|
995
995
|
SELECT: (a) => `Select ${a}`,
|
|
996
996
|
FILTER_BY: (a) => `Filter by ${a}`
|
|
997
|
-
},
|
|
997
|
+
}, mt = {
|
|
998
998
|
CSV: "CSV Format",
|
|
999
999
|
EXCEL: "Excel Format"
|
|
1000
|
-
},
|
|
1000
|
+
}, Rt = {
|
|
1001
1001
|
CSV: "csv",
|
|
1002
1002
|
EXCEL: "xlsx"
|
|
1003
|
-
},
|
|
1003
|
+
}, ce = {
|
|
1004
1004
|
FAILED_LOAD_ENTITIES: "Failed to load entities",
|
|
1005
1005
|
FAILED_LOAD_METADATA: "Failed to load metadata",
|
|
1006
1006
|
FAILED_LOAD_RECORD: "Failed to load record",
|
|
@@ -1026,7 +1026,7 @@ const Er = ({
|
|
|
1026
1026
|
}, Dr = {
|
|
1027
1027
|
LOADING: "Loading...",
|
|
1028
1028
|
PLEASE_WAIT: "Please wait..."
|
|
1029
|
-
},
|
|
1029
|
+
}, ze = {
|
|
1030
1030
|
SHOWING: "Showing",
|
|
1031
1031
|
OF: "of",
|
|
1032
1032
|
ENTRIES: "entries"
|
|
@@ -1051,7 +1051,7 @@ const Er = ({
|
|
|
1051
1051
|
ACTION_BUTTON_GAP: 1,
|
|
1052
1052
|
FORM_MARGIN_TOP: 3,
|
|
1053
1053
|
FORM_MARGIN_BOTTOM: 2
|
|
1054
|
-
},
|
|
1054
|
+
}, _t = [10, 20, 50, 100], pr = " *", mr = "red", Rr = "_display", Nr = {
|
|
1055
1055
|
ISO_DATE: "YYYY-MM-DD",
|
|
1056
1056
|
DISPLAY_DATE: "DD/MM/YYYY",
|
|
1057
1057
|
FILE_DATE: "YYYY-MM-DD"
|
|
@@ -1065,7 +1065,7 @@ const Er = ({
|
|
|
1065
1065
|
}
|
|
1066
1066
|
}, jr = {
|
|
1067
1067
|
MASTER: "/master"
|
|
1068
|
-
},
|
|
1068
|
+
}, Fr = {
|
|
1069
1069
|
// Entity endpoints
|
|
1070
1070
|
ENTITIES: "/master/entities",
|
|
1071
1071
|
ENTITY_METADATA: (a) => `/master/${a}/metadata`,
|
|
@@ -1081,34 +1081,34 @@ const Er = ({
|
|
|
1081
1081
|
PUT: "PUT",
|
|
1082
1082
|
DELETE: "DELETE",
|
|
1083
1083
|
PATCH: "PATCH"
|
|
1084
|
-
},
|
|
1084
|
+
}, wr = {
|
|
1085
1085
|
PAGE: "page",
|
|
1086
1086
|
LIMIT: "limit",
|
|
1087
1087
|
SEARCH: "search",
|
|
1088
1088
|
SEARCH_BY: "searchBy",
|
|
1089
1089
|
SORT_BY: "sortBy",
|
|
1090
1090
|
SORT_ORDER: "sortOrder"
|
|
1091
|
-
},
|
|
1091
|
+
}, we = {
|
|
1092
1092
|
ASC: "ASC",
|
|
1093
1093
|
DESC: "DESC"
|
|
1094
1094
|
}, Ur = {
|
|
1095
1095
|
JSON: "json",
|
|
1096
1096
|
BLOB: "blob",
|
|
1097
1097
|
TEXT: "text"
|
|
1098
|
-
},
|
|
1098
|
+
}, gt = {
|
|
1099
1099
|
CSV: "text/csv;charset=utf-8;",
|
|
1100
1100
|
EXCEL: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
1101
1101
|
JSON: "application/json"
|
|
1102
|
-
},
|
|
1102
|
+
}, $r = {
|
|
1103
1103
|
DATA: "data",
|
|
1104
1104
|
COUNT: "count",
|
|
1105
1105
|
MESSAGE: "message",
|
|
1106
1106
|
ERROR: "error"
|
|
1107
|
-
},
|
|
1107
|
+
}, X = {
|
|
1108
1108
|
CREATE: "create",
|
|
1109
1109
|
EDIT: "edit",
|
|
1110
1110
|
VIEW: "view"
|
|
1111
|
-
},
|
|
1111
|
+
}, qe = {
|
|
1112
1112
|
TEXT: "text",
|
|
1113
1113
|
DROPDOWN: "dropdown",
|
|
1114
1114
|
DATEPICKER: "datepicker",
|
|
@@ -1116,7 +1116,7 @@ const Er = ({
|
|
|
1116
1116
|
TEXTAREA: "textarea",
|
|
1117
1117
|
CHECKBOX: "checkbox",
|
|
1118
1118
|
RADIO: "radio"
|
|
1119
|
-
},
|
|
1119
|
+
}, be = {
|
|
1120
1120
|
STRING: "string",
|
|
1121
1121
|
NUMBER: "number",
|
|
1122
1122
|
FLOAT: "float",
|
|
@@ -1125,11 +1125,11 @@ const Er = ({
|
|
|
1125
1125
|
BOOLEAN: "boolean",
|
|
1126
1126
|
ARRAY: "array",
|
|
1127
1127
|
OBJECT: "object"
|
|
1128
|
-
},
|
|
1128
|
+
}, Gr = {
|
|
1129
1129
|
API: "API",
|
|
1130
1130
|
RAW: "Raw",
|
|
1131
1131
|
STATIC: "Static"
|
|
1132
|
-
},
|
|
1132
|
+
}, kr = {
|
|
1133
1133
|
ID: "id",
|
|
1134
1134
|
NAME: "name",
|
|
1135
1135
|
LABEL: "label",
|
|
@@ -1145,10 +1145,10 @@ const Er = ({
|
|
|
1145
1145
|
PATTERN: "pattern",
|
|
1146
1146
|
EMAIL: "email",
|
|
1147
1147
|
URL: "url"
|
|
1148
|
-
},
|
|
1148
|
+
}, J = {
|
|
1149
1149
|
FROM: "From",
|
|
1150
1150
|
TO: "To"
|
|
1151
|
-
},
|
|
1151
|
+
}, Yr = {
|
|
1152
1152
|
TEXT: "text",
|
|
1153
1153
|
NUMBER: "number",
|
|
1154
1154
|
DATE: "date",
|
|
@@ -1164,238 +1164,261 @@ const Er = ({
|
|
|
1164
1164
|
}, Hr = ({
|
|
1165
1165
|
apiClient: a,
|
|
1166
1166
|
apiEndpoints: u,
|
|
1167
|
-
onNavigateToNew:
|
|
1168
|
-
onNavigateToEdit:
|
|
1167
|
+
onNavigateToNew: d,
|
|
1168
|
+
onNavigateToEdit: E
|
|
1169
1169
|
}) => {
|
|
1170
|
-
const s =
|
|
1171
|
-
|
|
1170
|
+
const s = Oe(() => At(a, u), [a, u]), [k, z] = w([]), [p, v] = w(null), [V, S] = w([]), [A, C] = w({}), [B, re] = w([]), [fe, Q] = w([]), [Y, b] = w(0), [j, ne] = w(10), [U, G] = w(1), [Ee, Z] = w(!1), [le, _] = w(!1), [T, l] = w({}), [f, F] = w([]), [O, ee] = w(null), $ = Ke(!0);
|
|
1171
|
+
Pe(() => {
|
|
1172
1172
|
(async () => {
|
|
1173
1173
|
try {
|
|
1174
|
-
const x = ((await s.getEntities()).data || []).map((
|
|
1175
|
-
name:
|
|
1176
|
-
label:
|
|
1174
|
+
const x = ((await s.getEntities()).data || []).map((m) => ({
|
|
1175
|
+
name: m.tableName || m.name,
|
|
1176
|
+
label: m.displayName || m.label
|
|
1177
1177
|
}));
|
|
1178
|
-
|
|
1179
|
-
} catch (
|
|
1180
|
-
console.error(
|
|
1178
|
+
z(x), x.length > 0 && v(x[0]);
|
|
1179
|
+
} catch (i) {
|
|
1180
|
+
console.error(ce.FAILED_LOAD_ENTITIES, i);
|
|
1181
1181
|
}
|
|
1182
1182
|
})();
|
|
1183
|
-
}, []),
|
|
1183
|
+
}, []), Pe(() => {
|
|
1184
1184
|
if (!p) return;
|
|
1185
1185
|
(async () => {
|
|
1186
1186
|
try {
|
|
1187
|
-
const
|
|
1188
|
-
S(
|
|
1187
|
+
const h = (await s.getMetadata(p.name)).data || {};
|
|
1188
|
+
S(h.parameterList || []), re(h.resultsList || []);
|
|
1189
1189
|
const x = {};
|
|
1190
|
-
(
|
|
1191
|
-
x[
|
|
1190
|
+
(h.parameterList || []).forEach((N) => {
|
|
1191
|
+
x[N.name] = null;
|
|
1192
1192
|
}), C(x);
|
|
1193
|
-
const
|
|
1194
|
-
for (const
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
} catch (
|
|
1198
|
-
console.error(
|
|
1193
|
+
const m = {};
|
|
1194
|
+
for (const N of h.parameterList || [])
|
|
1195
|
+
N.options && Array.isArray(N.options) && (m[N.name] = N.options);
|
|
1196
|
+
l(m), Q([]), _(!1);
|
|
1197
|
+
} catch (i) {
|
|
1198
|
+
console.error(ce.FAILED_LOAD_METADATA, i);
|
|
1199
1199
|
}
|
|
1200
1200
|
})();
|
|
1201
1201
|
}, [p]);
|
|
1202
|
-
const
|
|
1203
|
-
const o = {},
|
|
1204
|
-
|
|
1205
|
-
if (
|
|
1206
|
-
const
|
|
1207
|
-
|
|
1202
|
+
const oe = Oe(() => {
|
|
1203
|
+
const o = {}, i = [], h = [];
|
|
1204
|
+
V.forEach((m) => {
|
|
1205
|
+
if (m.dataType === be.DATERANGE) {
|
|
1206
|
+
const ve = A[`${m.name}${J.FROM}`], pe = A[`${m.name}${J.TO}`];
|
|
1207
|
+
ve && (o[`${m.name}${J.FROM}`] = ve), pe && (o[`${m.name}${J.TO}`] = pe);
|
|
1208
1208
|
return;
|
|
1209
1209
|
}
|
|
1210
|
-
const
|
|
1211
|
-
|
|
1210
|
+
const N = A[m.name];
|
|
1211
|
+
N == null || N === "" || (m.options ? o[m.name] = N : (i.push(m.name), h.push(String(N).trim())));
|
|
1212
1212
|
});
|
|
1213
1213
|
const x = {
|
|
1214
|
-
page:
|
|
1215
|
-
limit:
|
|
1214
|
+
page: U,
|
|
1215
|
+
limit: j
|
|
1216
1216
|
};
|
|
1217
|
-
return Object.keys(o).length > 0 && Object.entries(o).forEach(([
|
|
1218
|
-
x[`filters[${
|
|
1219
|
-
}),
|
|
1220
|
-
}, [
|
|
1221
|
-
if (!(!p ||
|
|
1222
|
-
|
|
1217
|
+
return Object.keys(o).length > 0 && Object.entries(o).forEach(([m, N]) => {
|
|
1218
|
+
x[`filters[${m}]`] = N;
|
|
1219
|
+
}), i.length > 0 && (x.search = h.join(","), x.searchBy = i.join(",")), f.length > 0 && (x.sortBy = f.map((m) => m.colId).join(","), x.sortOrder = f.map((m) => m.sort === "desc" ? we.DESC : we.ASC).join(",")), console.log("Query params:", x), x;
|
|
1220
|
+
}, [V, A, U, j, f]), Te = Ne(async () => {
|
|
1221
|
+
if (!(!p || !$.current)) {
|
|
1222
|
+
$.current = !1, Z(!0);
|
|
1223
1223
|
try {
|
|
1224
|
-
console.log("Fetching with params:",
|
|
1225
|
-
const o = await s.getRecords(p.name,
|
|
1226
|
-
|
|
1224
|
+
console.log("Fetching with params:", oe);
|
|
1225
|
+
const o = await s.getRecords(p.name, oe), i = o.data || [], h = o.total || 0;
|
|
1226
|
+
Q(i), b(h);
|
|
1227
1227
|
} catch (o) {
|
|
1228
|
-
console.error(
|
|
1228
|
+
console.error(ce.FAILED_FETCH_LIST, o), console.error("Full error:", o), Q([]), b(0);
|
|
1229
1229
|
} finally {
|
|
1230
|
-
|
|
1230
|
+
Z(!1), $.current = !0;
|
|
1231
1231
|
}
|
|
1232
1232
|
}
|
|
1233
|
-
}, [p,
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
}, [
|
|
1237
|
-
const
|
|
1238
|
-
G(1),
|
|
1239
|
-
|
|
1233
|
+
}, [p, oe]);
|
|
1234
|
+
Pe(() => {
|
|
1235
|
+
le && (U > 1 || f.length > 0) && Te();
|
|
1236
|
+
}, [U, j, f, le, Te]);
|
|
1237
|
+
const he = () => {
|
|
1238
|
+
G(1), _(!0), setTimeout(() => {
|
|
1239
|
+
$.current = !0, Te();
|
|
1240
1240
|
}, 0);
|
|
1241
|
-
},
|
|
1242
|
-
|
|
1243
|
-
},
|
|
1244
|
-
|
|
1245
|
-
},
|
|
1241
|
+
}, se = (o) => {
|
|
1242
|
+
ee(o.currentTarget);
|
|
1243
|
+
}, ye = () => {
|
|
1244
|
+
ee(null);
|
|
1245
|
+
}, Ce = async (o) => {
|
|
1246
1246
|
if (p)
|
|
1247
1247
|
try {
|
|
1248
|
-
const
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1248
|
+
const i = {}, h = [], x = [];
|
|
1249
|
+
V.forEach((D) => {
|
|
1250
|
+
if (D.dataType === be.DATERANGE) {
|
|
1251
|
+
const _e = A[`${D.name}${J.FROM}`], Fe = A[`${D.name}${J.TO}`];
|
|
1252
|
+
_e && (i[`${D.name}${J.FROM}`] = _e), Fe && (i[`${D.name}${J.TO}`] = Fe);
|
|
1253
|
+
return;
|
|
1254
|
+
}
|
|
1255
|
+
const ae = A[D.name];
|
|
1256
|
+
ae == null || ae === "" || (D.options ? i[D.name] = ae : (h.push(D.name), x.push(String(ae).trim())));
|
|
1257
|
+
});
|
|
1258
|
+
const m = {};
|
|
1259
|
+
Object.keys(i).length > 0 && Object.entries(i).forEach(([D, ae]) => {
|
|
1260
|
+
m[`filters[${D}]`] = ae;
|
|
1261
|
+
}), h.length > 0 && (m.search = x.join(","), m.searchBy = h.join(",")), f.length > 0 && (m.sortBy = f.map((D) => D.colId).join(","), m.sortOrder = f.map((D) => D.sort === "desc" ? we.DESC : we.ASC).join(",")), console.log("Export params:", m);
|
|
1262
|
+
const N = o === "csv" ? await s.exportCSV(p.name, m) : await s.exportExcel(p.name, m), ve = N.headers["content-type"] || (o === "csv" ? gt.CSV : gt.EXCEL), pe = new Blob([N.data], { type: ve }), je = N.headers["content-disposition"];
|
|
1263
|
+
let me = `${p.name}_${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}`;
|
|
1264
|
+
if (je) {
|
|
1265
|
+
const D = je.match(/filename="?(.+)"?/i);
|
|
1266
|
+
D && D[1] && (me = D[1].replace(/["]/g, ""));
|
|
1267
|
+
} else {
|
|
1268
|
+
const D = o === "csv" ? Rt.CSV : Rt.EXCEL;
|
|
1269
|
+
me.endsWith(`.${D}`) || (me += `.${D}`);
|
|
1270
|
+
}
|
|
1271
|
+
const Re = URL.createObjectURL(pe), q = document.createElement("a");
|
|
1272
|
+
q.href = Re, q.download = me, q.style.display = "none", document.body.appendChild(q), q.click(), document.body.removeChild(q), setTimeout(() => URL.revokeObjectURL(Re), fr.URL_REVOKE), console.log(`${o.toUpperCase()} export successful:`, me);
|
|
1273
|
+
} catch (i) {
|
|
1274
|
+
console.error(`Failed to export ${o.toUpperCase()}:`, i), alert(`Failed to export ${o.toUpperCase()}. Please try again.`);
|
|
1252
1275
|
} finally {
|
|
1253
|
-
|
|
1276
|
+
ye();
|
|
1254
1277
|
}
|
|
1255
|
-
},
|
|
1256
|
-
const o =
|
|
1257
|
-
field:
|
|
1258
|
-
headerName:
|
|
1278
|
+
}, Ge = Oe(() => {
|
|
1279
|
+
const o = B.map((i) => ({
|
|
1280
|
+
field: i.name,
|
|
1281
|
+
headerName: i.label,
|
|
1259
1282
|
sortable: !0,
|
|
1260
1283
|
filter: !1,
|
|
1261
1284
|
flex: 1
|
|
1262
1285
|
}));
|
|
1263
1286
|
return o.push({
|
|
1264
1287
|
field: "actions",
|
|
1265
|
-
headerName:
|
|
1288
|
+
headerName: Xe.ACTIONS,
|
|
1266
1289
|
sortable: !1,
|
|
1267
1290
|
filter: !1,
|
|
1268
1291
|
width: 150,
|
|
1269
|
-
cellRenderer: (
|
|
1270
|
-
const
|
|
1271
|
-
return !
|
|
1272
|
-
|
|
1292
|
+
cellRenderer: (i) => {
|
|
1293
|
+
const h = i.data;
|
|
1294
|
+
return !h || !p ? null : /* @__PURE__ */ r.jsx(L, { sx: { display: "flex", gap: 1, py: 1 }, children: /* @__PURE__ */ r.jsx(
|
|
1295
|
+
ie,
|
|
1273
1296
|
{
|
|
1274
1297
|
size: "small",
|
|
1275
1298
|
variant: "outlined",
|
|
1276
|
-
onClick: () =>
|
|
1277
|
-
children:
|
|
1299
|
+
onClick: () => E?.(p.name, h.id),
|
|
1300
|
+
children: de.EDIT
|
|
1278
1301
|
}
|
|
1279
1302
|
) });
|
|
1280
1303
|
}
|
|
1281
1304
|
}), o;
|
|
1282
|
-
}, [
|
|
1283
|
-
return /* @__PURE__ */ r.jsxs(
|
|
1284
|
-
/* @__PURE__ */ r.jsxs(
|
|
1285
|
-
/* @__PURE__ */ r.jsx(
|
|
1286
|
-
/* @__PURE__ */ r.jsxs(
|
|
1287
|
-
/* @__PURE__ */ r.jsxs(
|
|
1288
|
-
/* @__PURE__ */ r.jsx(
|
|
1305
|
+
}, [B, p, E]);
|
|
1306
|
+
return /* @__PURE__ */ r.jsxs(L, { className: "master-view", children: [
|
|
1307
|
+
/* @__PURE__ */ r.jsxs(vt, { className: "filter-section", children: [
|
|
1308
|
+
/* @__PURE__ */ r.jsx(Ie, { variant: "h5", gutterBottom: !0, children: $e.MASTER_DATA_MANAGEMENT }),
|
|
1309
|
+
/* @__PURE__ */ r.jsxs(L, { className: "filters", children: [
|
|
1310
|
+
/* @__PURE__ */ r.jsxs(L, { className: "filter-field", children: [
|
|
1311
|
+
/* @__PURE__ */ r.jsx(Ie, { variant: "body2", className: "field-label", children: Xe.SELECT_ENTITY }),
|
|
1289
1312
|
/* @__PURE__ */ r.jsx(
|
|
1290
|
-
|
|
1313
|
+
Je,
|
|
1291
1314
|
{
|
|
1292
1315
|
options: k,
|
|
1293
1316
|
getOptionLabel: (o) => o.label,
|
|
1294
1317
|
value: p,
|
|
1295
|
-
onChange: (o,
|
|
1296
|
-
renderInput: (o) => /* @__PURE__ */ r.jsx(
|
|
1318
|
+
onChange: (o, i) => v(i),
|
|
1319
|
+
renderInput: (o) => /* @__PURE__ */ r.jsx(te, { ...o, size: "small", placeholder: Le.SELECT_ENTITY }),
|
|
1297
1320
|
className: "field-input"
|
|
1298
1321
|
}
|
|
1299
1322
|
)
|
|
1300
1323
|
] }),
|
|
1301
|
-
|
|
1302
|
-
/* @__PURE__ */ r.jsx(
|
|
1303
|
-
o.dataType ===
|
|
1324
|
+
V.filter((o) => o.name.toLowerCase() !== "id").map((o) => /* @__PURE__ */ r.jsxs(L, { className: "filter-field", children: [
|
|
1325
|
+
/* @__PURE__ */ r.jsx(Ie, { variant: "body2", className: "field-label", children: o.label }),
|
|
1326
|
+
o.dataType === be.DATERANGE ? /* @__PURE__ */ r.jsxs(L, { sx: { display: "flex", gap: 1, width: "100%" }, children: [
|
|
1304
1327
|
/* @__PURE__ */ r.jsx(
|
|
1305
|
-
|
|
1328
|
+
te,
|
|
1306
1329
|
{
|
|
1307
1330
|
type: "date",
|
|
1308
1331
|
size: "small",
|
|
1309
|
-
value:
|
|
1310
|
-
onChange: (
|
|
1332
|
+
value: A[`${o.name}${J.FROM}`] || "",
|
|
1333
|
+
onChange: (i) => C((h) => ({ ...h, [`${o.name}${J.FROM}`]: i.target.value })),
|
|
1311
1334
|
sx: { flex: 1 }
|
|
1312
1335
|
}
|
|
1313
1336
|
),
|
|
1314
1337
|
/* @__PURE__ */ r.jsx(
|
|
1315
|
-
|
|
1338
|
+
te,
|
|
1316
1339
|
{
|
|
1317
1340
|
type: "date",
|
|
1318
1341
|
size: "small",
|
|
1319
|
-
label:
|
|
1320
|
-
value:
|
|
1321
|
-
onChange: (
|
|
1342
|
+
label: Xe.TO,
|
|
1343
|
+
value: A[`${o.name}${J.TO}`] || "",
|
|
1344
|
+
onChange: (i) => C((h) => ({ ...h, [`${o.name}${J.TO}`]: i.target.value })),
|
|
1322
1345
|
sx: { flex: 1 }
|
|
1323
1346
|
}
|
|
1324
1347
|
)
|
|
1325
|
-
] }) : o.dataType ===
|
|
1326
|
-
|
|
1348
|
+
] }) : o.dataType === be.DATE ? /* @__PURE__ */ r.jsx(
|
|
1349
|
+
te,
|
|
1327
1350
|
{
|
|
1328
1351
|
type: "date",
|
|
1329
1352
|
size: "small",
|
|
1330
|
-
value:
|
|
1331
|
-
onChange: (
|
|
1353
|
+
value: A[o.name] || "",
|
|
1354
|
+
onChange: (i) => C((h) => ({ ...h, [o.name]: i.target.value })),
|
|
1332
1355
|
className: "field-input"
|
|
1333
1356
|
}
|
|
1334
1357
|
) : o.options ? /* @__PURE__ */ r.jsx(
|
|
1335
|
-
|
|
1358
|
+
Je,
|
|
1336
1359
|
{
|
|
1337
|
-
options:
|
|
1338
|
-
getOptionLabel: (
|
|
1339
|
-
value:
|
|
1340
|
-
onChange: (
|
|
1341
|
-
renderInput: (
|
|
1360
|
+
options: T[o.name] || o.options,
|
|
1361
|
+
getOptionLabel: (i) => i.label || String(i.value),
|
|
1362
|
+
value: T[o.name]?.find((i) => i.value === A[o.name]) || null,
|
|
1363
|
+
onChange: (i, h) => C((x) => ({ ...x, [o.name]: h?.value || null })),
|
|
1364
|
+
renderInput: (i) => /* @__PURE__ */ r.jsx(te, { ...i, size: "small", placeholder: Le.SELECT(o.label) }),
|
|
1342
1365
|
className: "field-input"
|
|
1343
1366
|
}
|
|
1344
|
-
) : o.dataType ===
|
|
1345
|
-
|
|
1367
|
+
) : o.dataType === be.NUMBER ? /* @__PURE__ */ r.jsx(
|
|
1368
|
+
te,
|
|
1346
1369
|
{
|
|
1347
1370
|
type: "number",
|
|
1348
1371
|
size: "small",
|
|
1349
|
-
value:
|
|
1350
|
-
onChange: (
|
|
1351
|
-
placeholder:
|
|
1372
|
+
value: A[o.name] || "",
|
|
1373
|
+
onChange: (i) => C((h) => ({ ...h, [o.name]: i.target.value })),
|
|
1374
|
+
placeholder: Le.FILTER_BY(o.label),
|
|
1352
1375
|
className: "field-input"
|
|
1353
1376
|
}
|
|
1354
1377
|
) : /* @__PURE__ */ r.jsx(
|
|
1355
|
-
|
|
1378
|
+
te,
|
|
1356
1379
|
{
|
|
1357
1380
|
size: "small",
|
|
1358
|
-
value:
|
|
1359
|
-
onChange: (
|
|
1360
|
-
placeholder:
|
|
1381
|
+
value: A[o.name] || "",
|
|
1382
|
+
onChange: (i) => C((h) => ({ ...h, [o.name]: i.target.value })),
|
|
1383
|
+
placeholder: Le.FILTER_BY(o.label),
|
|
1361
1384
|
className: "field-input"
|
|
1362
1385
|
}
|
|
1363
1386
|
)
|
|
1364
1387
|
] }, o.name))
|
|
1365
1388
|
] }),
|
|
1366
|
-
/* @__PURE__ */ r.jsxs(
|
|
1367
|
-
/* @__PURE__ */ r.jsx(
|
|
1389
|
+
/* @__PURE__ */ r.jsxs(L, { className: "action-buttons", children: [
|
|
1390
|
+
/* @__PURE__ */ r.jsx(ie, { variant: "contained", onClick: he, children: de.VIEW }),
|
|
1368
1391
|
/* @__PURE__ */ r.jsx(
|
|
1369
|
-
|
|
1392
|
+
ie,
|
|
1370
1393
|
{
|
|
1371
1394
|
variant: "contained",
|
|
1372
1395
|
disabled: !p,
|
|
1373
|
-
onClick: () => p &&
|
|
1374
|
-
children:
|
|
1396
|
+
onClick: () => p && d?.(p.name),
|
|
1397
|
+
children: de.ADD_NEW_RECORD
|
|
1375
1398
|
}
|
|
1376
1399
|
)
|
|
1377
1400
|
] })
|
|
1378
1401
|
] }),
|
|
1379
|
-
|
|
1380
|
-
/* @__PURE__ */ r.jsxs(
|
|
1402
|
+
le && /* @__PURE__ */ r.jsxs(L, { mt: 4, width: "100%", children: [
|
|
1403
|
+
/* @__PURE__ */ r.jsxs(L, { display: "flex", justifyContent: "flex-end", mb: 2, children: [
|
|
1381
1404
|
/* @__PURE__ */ r.jsx(
|
|
1382
|
-
|
|
1405
|
+
ie,
|
|
1383
1406
|
{
|
|
1384
1407
|
variant: "outlined",
|
|
1385
|
-
onClick:
|
|
1408
|
+
onClick: se,
|
|
1386
1409
|
disabled: !p,
|
|
1387
|
-
children:
|
|
1410
|
+
children: de.EXPORT
|
|
1388
1411
|
}
|
|
1389
1412
|
),
|
|
1390
1413
|
/* @__PURE__ */ r.jsxs(
|
|
1391
1414
|
qt,
|
|
1392
1415
|
{
|
|
1393
|
-
anchorEl:
|
|
1394
|
-
open: !!
|
|
1395
|
-
onClose:
|
|
1416
|
+
anchorEl: O,
|
|
1417
|
+
open: !!O,
|
|
1418
|
+
onClose: ye,
|
|
1396
1419
|
children: [
|
|
1397
|
-
/* @__PURE__ */ r.jsx(
|
|
1398
|
-
/* @__PURE__ */ r.jsx(
|
|
1420
|
+
/* @__PURE__ */ r.jsx(He, { onClick: () => Ce("csv"), children: mt.CSV }),
|
|
1421
|
+
/* @__PURE__ */ r.jsx(He, { onClick: () => Ce("excel"), children: mt.EXCEL })
|
|
1399
1422
|
]
|
|
1400
1423
|
}
|
|
1401
1424
|
)
|
|
@@ -1403,56 +1426,56 @@ const Er = ({
|
|
|
1403
1426
|
/* @__PURE__ */ r.jsx(
|
|
1404
1427
|
Er,
|
|
1405
1428
|
{
|
|
1406
|
-
rows:
|
|
1407
|
-
columns:
|
|
1408
|
-
totalRecords:
|
|
1409
|
-
currentPage:
|
|
1410
|
-
loading:
|
|
1411
|
-
rowModelType:
|
|
1429
|
+
rows: fe,
|
|
1430
|
+
columns: Ge,
|
|
1431
|
+
totalRecords: Y,
|
|
1432
|
+
currentPage: U,
|
|
1433
|
+
loading: Ee,
|
|
1434
|
+
rowModelType: Ot.CLIENT_SIDE,
|
|
1412
1435
|
onPageChange: G,
|
|
1413
|
-
pageSize:
|
|
1414
|
-
pageSizeOptions: [...
|
|
1436
|
+
pageSize: j,
|
|
1437
|
+
pageSizeOptions: [..._t],
|
|
1415
1438
|
onPageSizeChange: (o) => {
|
|
1416
|
-
|
|
1439
|
+
ne(o), G(1);
|
|
1417
1440
|
},
|
|
1418
|
-
setSort:
|
|
1419
|
-
sortModel:
|
|
1441
|
+
setSort: F,
|
|
1442
|
+
sortModel: f,
|
|
1420
1443
|
height: 500
|
|
1421
1444
|
},
|
|
1422
1445
|
p?.name
|
|
1423
1446
|
),
|
|
1424
1447
|
/* @__PURE__ */ r.jsxs(nr, { children: [
|
|
1425
|
-
/* @__PURE__ */ r.jsx(
|
|
1426
|
-
/* @__PURE__ */ r.jsxs(
|
|
1427
|
-
|
|
1448
|
+
/* @__PURE__ */ r.jsx(L, { display: "flex", alignItems: "center", gap: 1, children: /* @__PURE__ */ r.jsxs(ir, { variant: "outlined", size: "small", children: [
|
|
1449
|
+
/* @__PURE__ */ r.jsxs(Tt, { children: [
|
|
1450
|
+
ze.SHOWING,
|
|
1428
1451
|
" "
|
|
1429
1452
|
] }),
|
|
1430
1453
|
/* @__PURE__ */ r.jsx(
|
|
1431
1454
|
or,
|
|
1432
1455
|
{
|
|
1433
|
-
value:
|
|
1456
|
+
value: j,
|
|
1434
1457
|
inputProps: { "aria-label": "Page size" },
|
|
1435
1458
|
onChange: (o) => {
|
|
1436
|
-
|
|
1459
|
+
ne(Number(o.target.value)), G(1);
|
|
1437
1460
|
},
|
|
1438
|
-
children:
|
|
1461
|
+
children: _t.map((o) => /* @__PURE__ */ r.jsx(He, { value: o, children: o }, o))
|
|
1439
1462
|
}
|
|
1440
1463
|
),
|
|
1441
|
-
/* @__PURE__ */ r.jsxs(
|
|
1442
|
-
|
|
1464
|
+
/* @__PURE__ */ r.jsxs(Tt, { children: [
|
|
1465
|
+
ze.OF,
|
|
1443
1466
|
" ",
|
|
1444
|
-
|
|
1467
|
+
Y,
|
|
1445
1468
|
" ",
|
|
1446
|
-
|
|
1469
|
+
ze.ENTRIES
|
|
1447
1470
|
] })
|
|
1448
1471
|
] }) }),
|
|
1449
1472
|
/* @__PURE__ */ r.jsx(
|
|
1450
1473
|
Tr,
|
|
1451
1474
|
{
|
|
1452
|
-
totalRecords:
|
|
1453
|
-
currentPage:
|
|
1475
|
+
totalRecords: Y,
|
|
1476
|
+
currentPage: U,
|
|
1454
1477
|
onPageChange: G,
|
|
1455
|
-
pageSize:
|
|
1478
|
+
pageSize: j
|
|
1456
1479
|
}
|
|
1457
1480
|
)
|
|
1458
1481
|
] })
|
|
@@ -1461,212 +1484,212 @@ const Er = ({
|
|
|
1461
1484
|
}, Xr = ({
|
|
1462
1485
|
apiClient: a,
|
|
1463
1486
|
apiEndpoints: u,
|
|
1464
|
-
entity:
|
|
1465
|
-
id:
|
|
1487
|
+
entity: d,
|
|
1488
|
+
id: E,
|
|
1466
1489
|
mode: s,
|
|
1467
1490
|
onBack: k,
|
|
1468
|
-
onSuccess:
|
|
1491
|
+
onSuccess: z
|
|
1469
1492
|
}) => {
|
|
1470
|
-
const p =
|
|
1471
|
-
const
|
|
1472
|
-
return
|
|
1473
|
-
}), [
|
|
1474
|
-
|
|
1475
|
-
if (!
|
|
1476
|
-
let
|
|
1493
|
+
const p = Oe(() => At(a, u), [a, u]), [v, V] = w({}), [S, A] = w({}), [C, B] = w(!1), [re, fe] = w({}), [Q, Y] = w(!0), [b, j] = w(null), ne = Oe(() => Object.keys(v), [v]), U = Oe(() => ne.sort((_, T) => {
|
|
1494
|
+
const l = v[_], f = v[T];
|
|
1495
|
+
return l?.validation?.required && !f?.validation?.required ? -1 : !l?.validation?.required && f?.validation?.required ? 1 : _.localeCompare(T);
|
|
1496
|
+
}), [ne, v]);
|
|
1497
|
+
Pe(() => {
|
|
1498
|
+
if (!d) return;
|
|
1499
|
+
let _ = !0;
|
|
1477
1500
|
return (async () => {
|
|
1478
|
-
|
|
1501
|
+
Y(!0), j(null);
|
|
1479
1502
|
try {
|
|
1480
|
-
const
|
|
1481
|
-
if (!
|
|
1482
|
-
const
|
|
1483
|
-
|
|
1484
|
-
const
|
|
1485
|
-
for (const [
|
|
1486
|
-
if (
|
|
1487
|
-
if (
|
|
1503
|
+
const l = await p.getMetadata(d);
|
|
1504
|
+
if (!_) return;
|
|
1505
|
+
const F = (l.data?.data || l.data || {}).formConfig || {};
|
|
1506
|
+
V(F);
|
|
1507
|
+
const O = {};
|
|
1508
|
+
for (const [ee, $] of Object.entries(F))
|
|
1509
|
+
if ($.fieldType === qe.DROPDOWN)
|
|
1510
|
+
if ($.optionType === "API" && $.option && typeof $.option == "string")
|
|
1488
1511
|
try {
|
|
1489
|
-
const
|
|
1490
|
-
value:
|
|
1491
|
-
label:
|
|
1512
|
+
const he = ((await p.getDropdownOptions($.option)).data || []).map((se) => ({
|
|
1513
|
+
value: se.id,
|
|
1514
|
+
label: se.name || se.displayName || String(se.id)
|
|
1492
1515
|
}));
|
|
1493
|
-
|
|
1494
|
-
} catch (
|
|
1495
|
-
console.error(`Failed to load options for ${
|
|
1516
|
+
O[$.fieldName] = he;
|
|
1517
|
+
} catch (oe) {
|
|
1518
|
+
console.error(`Failed to load options for ${ee}:`, oe), O[$.fieldName] = [];
|
|
1496
1519
|
}
|
|
1497
|
-
else
|
|
1498
|
-
|
|
1499
|
-
} catch (
|
|
1500
|
-
console.error(
|
|
1520
|
+
else $.optionType === "Raw" && Array.isArray($.option) && (O[$.fieldName] = $.option);
|
|
1521
|
+
_ && fe(O);
|
|
1522
|
+
} catch (l) {
|
|
1523
|
+
console.error(ce.FAILED_LOAD_METADATA, l), _ && j(ce.FAILED_LOAD_FORM_CONFIG);
|
|
1501
1524
|
} finally {
|
|
1502
|
-
|
|
1525
|
+
_ && Y(!1);
|
|
1503
1526
|
}
|
|
1504
1527
|
})(), () => {
|
|
1505
|
-
|
|
1528
|
+
_ = !1;
|
|
1506
1529
|
};
|
|
1507
|
-
}, [
|
|
1508
|
-
if (!
|
|
1509
|
-
|
|
1530
|
+
}, [d, p, a]), Pe(() => {
|
|
1531
|
+
if (!d || !E || s === X.CREATE) {
|
|
1532
|
+
A({});
|
|
1510
1533
|
return;
|
|
1511
1534
|
}
|
|
1512
|
-
let
|
|
1535
|
+
let _ = !0;
|
|
1513
1536
|
return (async () => {
|
|
1514
|
-
|
|
1537
|
+
B(!0), j(null);
|
|
1515
1538
|
try {
|
|
1516
|
-
const
|
|
1517
|
-
if (!
|
|
1518
|
-
const
|
|
1519
|
-
for (const [
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
} catch (
|
|
1523
|
-
console.error(
|
|
1539
|
+
const l = await p.getRecord(d, E);
|
|
1540
|
+
if (!_) return;
|
|
1541
|
+
const f = l.data?.data || l.data || {}, F = {};
|
|
1542
|
+
for (const [O, ee] of Object.entries(f))
|
|
1543
|
+
O.endsWith(Rr) || (F[O] = ee);
|
|
1544
|
+
A(F);
|
|
1545
|
+
} catch (l) {
|
|
1546
|
+
console.error(ce.FAILED_LOAD_RECORD, l), _ && j(ce.FAILED_LOAD_RECORD);
|
|
1524
1547
|
} finally {
|
|
1525
|
-
|
|
1548
|
+
_ && B(!1);
|
|
1526
1549
|
}
|
|
1527
1550
|
})(), () => {
|
|
1528
|
-
|
|
1551
|
+
_ = !1;
|
|
1529
1552
|
};
|
|
1530
|
-
}, [
|
|
1531
|
-
const G =
|
|
1532
|
-
|
|
1533
|
-
}, []),
|
|
1534
|
-
const
|
|
1535
|
-
for (const [
|
|
1536
|
-
|
|
1537
|
-
return
|
|
1538
|
-
}, [
|
|
1539
|
-
if (!
|
|
1540
|
-
const
|
|
1541
|
-
if (
|
|
1542
|
-
|
|
1553
|
+
}, [d, E, s, p]);
|
|
1554
|
+
const G = Ne((_, T) => {
|
|
1555
|
+
A((l) => ({ ...l, [_]: T }));
|
|
1556
|
+
}, []), Ee = Ne(() => {
|
|
1557
|
+
const _ = [];
|
|
1558
|
+
for (const [T, l] of Object.entries(v))
|
|
1559
|
+
l.validation?.required && !S[l.fieldName] && _.push(ce.FIELD_REQUIRED(T)), l.validation?.min !== void 0 && S[l.fieldName] < l.validation.min && _.push(`${T} must be at least ${l.validation.min}`), l.validation?.max !== void 0 && S[l.fieldName] > l.validation.max && _.push(`${T} must be at most ${l.validation.max}`);
|
|
1560
|
+
return _;
|
|
1561
|
+
}, [v, S]), Z = Ne(async () => {
|
|
1562
|
+
if (!d) return;
|
|
1563
|
+
const _ = Ee();
|
|
1564
|
+
if (_.length > 0) {
|
|
1565
|
+
j(_.join(", "));
|
|
1543
1566
|
return;
|
|
1544
1567
|
}
|
|
1545
|
-
|
|
1568
|
+
B(!0), j(null);
|
|
1546
1569
|
try {
|
|
1547
|
-
const
|
|
1548
|
-
for (const
|
|
1549
|
-
const
|
|
1550
|
-
|
|
1570
|
+
const T = {};
|
|
1571
|
+
for (const l of Object.values(v)) {
|
|
1572
|
+
const f = l.fieldName;
|
|
1573
|
+
f && S[f] !== void 0 && S[f] !== "" && (T[f] = S[f]);
|
|
1551
1574
|
}
|
|
1552
|
-
if (s ===
|
|
1553
|
-
const
|
|
1554
|
-
|
|
1555
|
-
} else if (
|
|
1556
|
-
const
|
|
1557
|
-
|
|
1575
|
+
if (s === X.CREATE) {
|
|
1576
|
+
const l = await p.createRecord(d, { data: T });
|
|
1577
|
+
z?.(l);
|
|
1578
|
+
} else if (E) {
|
|
1579
|
+
const l = await p.updateRecord(d, E, { data: T });
|
|
1580
|
+
z?.(l);
|
|
1558
1581
|
}
|
|
1559
1582
|
k?.();
|
|
1560
|
-
} catch (
|
|
1561
|
-
console.error("Failed to save record:",
|
|
1562
|
-
const
|
|
1563
|
-
|
|
1583
|
+
} catch (T) {
|
|
1584
|
+
console.error("Failed to save record:", T);
|
|
1585
|
+
const l = T?.response?.data?.message || (Array.isArray(T?.response?.data?.message) ? T.response.data.message.join(", ") : "Failed to save record. Please try again.");
|
|
1586
|
+
j(l);
|
|
1564
1587
|
} finally {
|
|
1565
|
-
|
|
1588
|
+
B(!1);
|
|
1566
1589
|
}
|
|
1567
|
-
}, [
|
|
1568
|
-
const
|
|
1569
|
-
if (!
|
|
1570
|
-
const
|
|
1571
|
-
return /* @__PURE__ */ r.jsxs(
|
|
1572
|
-
/* @__PURE__ */ r.jsxs(
|
|
1573
|
-
|
|
1574
|
-
|
|
1590
|
+
}, [d, v, S, Ee, s, E, p, k, z]), le = Ne((_) => {
|
|
1591
|
+
const T = v[_], l = T?.fieldName;
|
|
1592
|
+
if (!T || l === "id") return null;
|
|
1593
|
+
const f = S[l] ?? "", F = s === X.VIEW || C;
|
|
1594
|
+
return /* @__PURE__ */ r.jsxs(L, { className: "form-field", children: [
|
|
1595
|
+
/* @__PURE__ */ r.jsxs(Ie, { variant: "body2", className: "field-label", children: [
|
|
1596
|
+
_,
|
|
1597
|
+
T.validation?.required && s !== X.VIEW && /* @__PURE__ */ r.jsx("span", { style: { color: mr }, children: pr })
|
|
1575
1598
|
] }),
|
|
1576
|
-
|
|
1577
|
-
|
|
1599
|
+
T.fieldType === qe.DROPDOWN ? /* @__PURE__ */ r.jsx(
|
|
1600
|
+
Je,
|
|
1578
1601
|
{
|
|
1579
|
-
options:
|
|
1580
|
-
getOptionLabel: (
|
|
1581
|
-
value:
|
|
1582
|
-
onChange: (
|
|
1583
|
-
disabled:
|
|
1584
|
-
loading:
|
|
1585
|
-
renderInput: (
|
|
1586
|
-
|
|
1602
|
+
options: re[l] || [],
|
|
1603
|
+
getOptionLabel: (O) => O.label || String(O.value),
|
|
1604
|
+
value: re[l]?.find((O) => O.value === f) || null,
|
|
1605
|
+
onChange: (O, ee) => G(l, ee?.value ?? null),
|
|
1606
|
+
disabled: F,
|
|
1607
|
+
loading: Q,
|
|
1608
|
+
renderInput: (O) => /* @__PURE__ */ r.jsx(
|
|
1609
|
+
te,
|
|
1587
1610
|
{
|
|
1588
|
-
...
|
|
1611
|
+
...O,
|
|
1589
1612
|
size: "small",
|
|
1590
|
-
placeholder:
|
|
1591
|
-
error:
|
|
1613
|
+
placeholder: Le.SELECT(_),
|
|
1614
|
+
error: T.validation?.required && !f && s !== X.VIEW
|
|
1592
1615
|
}
|
|
1593
1616
|
),
|
|
1594
1617
|
className: "field-input"
|
|
1595
1618
|
}
|
|
1596
|
-
) :
|
|
1597
|
-
|
|
1619
|
+
) : T.fieldType === qe.DATEPICKER ? /* @__PURE__ */ r.jsx(
|
|
1620
|
+
te,
|
|
1598
1621
|
{
|
|
1599
1622
|
type: "date",
|
|
1600
1623
|
size: "small",
|
|
1601
|
-
value:
|
|
1602
|
-
onChange: (
|
|
1603
|
-
disabled:
|
|
1604
|
-
error:
|
|
1624
|
+
value: f ? String(f).slice(0, 10) : "",
|
|
1625
|
+
onChange: (O) => G(l, O.target.value),
|
|
1626
|
+
disabled: F,
|
|
1627
|
+
error: T.validation?.required && !f && s !== X.VIEW,
|
|
1605
1628
|
className: "field-input",
|
|
1606
1629
|
InputLabelProps: { shrink: !0 }
|
|
1607
1630
|
}
|
|
1608
|
-
) :
|
|
1609
|
-
|
|
1631
|
+
) : T.dataType === "number" || T.dataType === "float" ? /* @__PURE__ */ r.jsx(
|
|
1632
|
+
te,
|
|
1610
1633
|
{
|
|
1611
1634
|
type: "number",
|
|
1612
1635
|
size: "small",
|
|
1613
|
-
value:
|
|
1614
|
-
onChange: (
|
|
1615
|
-
disabled:
|
|
1616
|
-
placeholder:
|
|
1617
|
-
error:
|
|
1636
|
+
value: f,
|
|
1637
|
+
onChange: (O) => G(l, O.target.value),
|
|
1638
|
+
disabled: F,
|
|
1639
|
+
placeholder: _,
|
|
1640
|
+
error: T.validation?.required && !f && s !== X.VIEW,
|
|
1618
1641
|
inputProps: {
|
|
1619
|
-
max:
|
|
1620
|
-
min:
|
|
1621
|
-
step:
|
|
1642
|
+
max: T.validation?.max,
|
|
1643
|
+
min: T.validation?.min,
|
|
1644
|
+
step: T.dataType === "float" ? 0.01 : 1
|
|
1622
1645
|
},
|
|
1623
1646
|
className: "field-input"
|
|
1624
1647
|
}
|
|
1625
1648
|
) : /* @__PURE__ */ r.jsx(
|
|
1626
|
-
|
|
1649
|
+
te,
|
|
1627
1650
|
{
|
|
1628
1651
|
size: "small",
|
|
1629
|
-
value:
|
|
1630
|
-
onChange: (
|
|
1631
|
-
disabled:
|
|
1632
|
-
placeholder:
|
|
1633
|
-
error:
|
|
1652
|
+
value: f,
|
|
1653
|
+
onChange: (O) => G(l, O.target.value),
|
|
1654
|
+
disabled: F,
|
|
1655
|
+
placeholder: _,
|
|
1656
|
+
error: T.validation?.required && !f && s !== X.VIEW,
|
|
1634
1657
|
inputProps: {
|
|
1635
|
-
maxLength:
|
|
1658
|
+
maxLength: T.validation?.max
|
|
1636
1659
|
},
|
|
1637
1660
|
className: "field-input"
|
|
1638
1661
|
}
|
|
1639
1662
|
)
|
|
1640
|
-
] },
|
|
1641
|
-
}, [
|
|
1642
|
-
return
|
|
1643
|
-
/* @__PURE__ */ r.jsxs(
|
|
1644
|
-
s ===
|
|
1645
|
-
|
|
1663
|
+
] }, _);
|
|
1664
|
+
}, [v, S, re, G, s, C, Q]);
|
|
1665
|
+
return Q ? /* @__PURE__ */ r.jsx(L, { className: "loading-container", display: "flex", justifyContent: "center", alignItems: "center", minHeight: "400px", children: /* @__PURE__ */ r.jsx(Ue, {}) }) : /* @__PURE__ */ r.jsx(L, { className: "master-form", children: /* @__PURE__ */ r.jsxs(vt, { className: "form-section", children: [
|
|
1666
|
+
/* @__PURE__ */ r.jsxs(Ie, { variant: "h5", gutterBottom: !0, children: [
|
|
1667
|
+
s === X.CREATE ? $e.ADD_NEW_RECORD : s === X.EDIT ? $e.EDIT_RECORD : $e.VIEW_RECORD,
|
|
1668
|
+
d && ` - ${d.charAt(0).toUpperCase() + d.slice(1)}`
|
|
1646
1669
|
] }),
|
|
1647
|
-
|
|
1648
|
-
C && s !==
|
|
1649
|
-
/* @__PURE__ */ r.jsx(
|
|
1650
|
-
/* @__PURE__ */ r.jsx(
|
|
1670
|
+
b && /* @__PURE__ */ r.jsx(Kt, { severity: "error", onClose: () => j(null), sx: { mb: 2 }, children: b }),
|
|
1671
|
+
C && s !== X.VIEW && /* @__PURE__ */ r.jsx(L, { display: "flex", justifyContent: "center", my: 2, children: /* @__PURE__ */ r.jsx(Ue, { size: 24 }) }),
|
|
1672
|
+
/* @__PURE__ */ r.jsx(L, { className: "form-fields", children: U.map(le) }),
|
|
1673
|
+
/* @__PURE__ */ r.jsx(L, { className: "action-buttons", mt: 3, children: s !== X.VIEW ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
1651
1674
|
/* @__PURE__ */ r.jsx(
|
|
1652
|
-
|
|
1675
|
+
ie,
|
|
1653
1676
|
{
|
|
1654
1677
|
variant: "contained",
|
|
1655
|
-
onClick:
|
|
1678
|
+
onClick: Z,
|
|
1656
1679
|
disabled: C,
|
|
1657
|
-
children: C ? /* @__PURE__ */ r.jsx(
|
|
1680
|
+
children: C ? /* @__PURE__ */ r.jsx(Ue, { size: 24 }) : s === X.CREATE ? de.CREATE : de.UPDATE
|
|
1658
1681
|
}
|
|
1659
1682
|
),
|
|
1660
1683
|
/* @__PURE__ */ r.jsx(
|
|
1661
|
-
|
|
1684
|
+
ie,
|
|
1662
1685
|
{
|
|
1663
1686
|
variant: "outlined",
|
|
1664
1687
|
onClick: () => k?.(),
|
|
1665
1688
|
disabled: C,
|
|
1666
|
-
children:
|
|
1689
|
+
children: de.CANCEL
|
|
1667
1690
|
}
|
|
1668
1691
|
)
|
|
1669
|
-
] }) : /* @__PURE__ */ r.jsx(
|
|
1692
|
+
] }) : /* @__PURE__ */ r.jsx(ie, { variant: "outlined", onClick: () => k?.(), children: de.BACK }) })
|
|
1670
1693
|
] }) });
|
|
1671
1694
|
}, zr = {
|
|
1672
1695
|
ROOT: "/",
|
|
@@ -1694,55 +1717,55 @@ const Er = ({
|
|
|
1694
1717
|
export {
|
|
1695
1718
|
jr as API_BASE_PATHS,
|
|
1696
1719
|
Pr as API_CONFIG,
|
|
1697
|
-
|
|
1720
|
+
Fr as API_ENDPOINTS,
|
|
1698
1721
|
Lr as ARIA_LABELS,
|
|
1699
|
-
|
|
1722
|
+
de as BUTTON_LABELS,
|
|
1700
1723
|
Or as COLUMN_PROPERTIES,
|
|
1701
1724
|
xr as CSS_CLASSES,
|
|
1702
|
-
|
|
1725
|
+
be as DATA_TYPES,
|
|
1703
1726
|
Nr as DATE_FORMATS,
|
|
1704
|
-
|
|
1705
|
-
|
|
1727
|
+
J as DATE_RANGE_SUFFIXES,
|
|
1728
|
+
Rr as DISPLAY_FIELD_SUFFIX,
|
|
1706
1729
|
Cr as EMPTY_STATE_MESSAGES,
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1730
|
+
ce as ERROR_MESSAGES,
|
|
1731
|
+
mt as EXPORT_OPTIONS,
|
|
1732
|
+
Xe as FIELD_LABELS,
|
|
1733
|
+
kr as FIELD_NAMES,
|
|
1734
|
+
qe as FIELD_TYPES,
|
|
1735
|
+
Rt as FILE_EXTENSIONS,
|
|
1736
|
+
X as FORM_MODES,
|
|
1714
1737
|
ur as GRID_CSS_CLASSES,
|
|
1715
1738
|
cr as GRID_EVENT_SOURCES,
|
|
1716
|
-
|
|
1739
|
+
pt as GRID_LAYOUT,
|
|
1717
1740
|
dr as GRID_MESSAGES,
|
|
1718
1741
|
lr as GRID_SETTINGS,
|
|
1719
|
-
|
|
1742
|
+
ze as GRID_TEXT,
|
|
1720
1743
|
fr as GRID_TIMEOUTS,
|
|
1721
1744
|
Mr as HTTP_METHODS,
|
|
1722
|
-
|
|
1745
|
+
Yr as INPUT_TYPES,
|
|
1723
1746
|
Dr as LOADING_MESSAGES,
|
|
1724
|
-
|
|
1747
|
+
gt as MIME_TYPES,
|
|
1725
1748
|
Xr as MasterForm,
|
|
1726
1749
|
Hr as MasterView,
|
|
1727
1750
|
Wr as NUMBER_INPUT,
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1751
|
+
Gr as OPTION_TYPES,
|
|
1752
|
+
_t as PAGE_SIZE_OPTIONS,
|
|
1753
|
+
$e as PAGE_TITLES,
|
|
1754
|
+
Sr as PAGINATION_SETTINGS,
|
|
1755
|
+
Le as PLACEHOLDERS,
|
|
1733
1756
|
Tr as Pagination,
|
|
1734
|
-
|
|
1757
|
+
wr as QUERY_PARAMS,
|
|
1735
1758
|
Br as REGEX_PATTERNS,
|
|
1736
1759
|
pr as REQUIRED_INDICATOR,
|
|
1737
|
-
|
|
1738
|
-
|
|
1760
|
+
mr as REQUIRED_INDICATOR_COLOR,
|
|
1761
|
+
$r as RESPONSE_KEYS,
|
|
1739
1762
|
Ur as RESPONSE_TYPES,
|
|
1740
1763
|
zr as ROUTES,
|
|
1741
1764
|
Kr as ROUTE_KEYS,
|
|
1742
1765
|
qr as ROUTE_PATTERNS,
|
|
1743
1766
|
Qr as ROUTE_SUFFIXES,
|
|
1744
|
-
|
|
1745
|
-
|
|
1767
|
+
Ot as ROW_MODEL_TYPES,
|
|
1768
|
+
we as SORT_ORDER,
|
|
1746
1769
|
Ar as SORT_SETTINGS,
|
|
1747
1770
|
br as STYLE_CONSTANTS,
|
|
1748
1771
|
Ir as SUCCESS_MESSAGES,
|
|
@@ -1750,5 +1773,5 @@ export {
|
|
|
1750
1773
|
Jr as URL_PARAMS,
|
|
1751
1774
|
yr as VALIDATION_MESSAGES,
|
|
1752
1775
|
Vr as VALIDATION_RULES,
|
|
1753
|
-
|
|
1776
|
+
At as createApiService
|
|
1754
1777
|
};
|