master-data-management-react 0.1.4 → 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/App.d.ts +5 -0
- package/dist/App.d.ts.map +1 -0
- package/dist/components/ServerSideGrid/ServerSideGrid.d.ts.map +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.js +676 -655
- package/dist/main.d.ts +2 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/pages/MasterView/MasterView.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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
7
|
const d = await a.get(u.entities);
|
|
8
8
|
return {
|
|
@@ -10,129 +10,129 @@ const vt = (a, u) => ({
|
|
|
10
10
|
};
|
|
11
11
|
},
|
|
12
12
|
getMetadata: async (d) => {
|
|
13
|
-
const
|
|
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 (d,
|
|
19
|
-
const s = await a.get(u.records(d), { params:
|
|
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 (d,
|
|
26
|
-
const s = await a.get(u.recordById(d,
|
|
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 (d,
|
|
32
|
-
const s = await a.post(u.records(d),
|
|
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 (d,
|
|
38
|
-
const k = await a.put(u.recordById(d,
|
|
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 (d,
|
|
44
|
-
const s = await a.delete(u.recordById(d,
|
|
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 (d,
|
|
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 (d,
|
|
54
|
-
params:
|
|
53
|
+
exportExcel: async (d, E) => await a.get(u.exportExcel(d), {
|
|
54
|
+
params: E,
|
|
55
55
|
responseType: "blob"
|
|
56
56
|
}),
|
|
57
57
|
getDropdownOptions: async (d) => {
|
|
58
|
-
const
|
|
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
93
|
for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), c = 1; c < t; c++)
|
|
94
94
|
n[c - 1] = arguments[c];
|
|
95
|
-
|
|
95
|
+
j("error", e, n);
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
-
function
|
|
98
|
+
function j(e, t, n) {
|
|
99
99
|
{
|
|
100
|
-
var c =
|
|
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
|
|
117
|
+
function T(e, t, n) {
|
|
118
118
|
var c = e.displayName;
|
|
119
119
|
if (c)
|
|
120
120
|
return c;
|
|
121
|
-
var
|
|
122
|
-
return
|
|
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
137
|
case d:
|
|
138
138
|
return "Portal";
|
|
@@ -140,7 +140,7 @@ function tr() {
|
|
|
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
|
|
155
|
+
return l(n._context) + ".Provider";
|
|
156
|
+
case v:
|
|
157
|
+
return T(e, e.render, "ForwardRef");
|
|
158
|
+
case A:
|
|
159
159
|
var c = e.displayName || null;
|
|
160
|
-
return c !== null ? c :
|
|
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: w({}, 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 c =
|
|
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
261
|
var c;
|
|
262
|
-
|
|
263
|
-
var
|
|
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
|
-
c =
|
|
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
|
-
c =
|
|
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
|
-
c =
|
|
294
|
+
} catch (H) {
|
|
295
|
+
c = H;
|
|
296
296
|
}
|
|
297
297
|
e();
|
|
298
298
|
}
|
|
299
|
-
} catch (
|
|
300
|
-
if (
|
|
301
|
-
for (var
|
|
302
|
-
`),
|
|
303
|
-
`),
|
|
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
304
|
M--;
|
|
305
|
-
for (;
|
|
306
|
-
if (
|
|
307
|
-
if (
|
|
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
|
-
` +
|
|
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 c = e,
|
|
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,
|
|
373
|
-
var
|
|
370
|
+
var y = Function.call.bind(q);
|
|
371
|
+
for (var g in e)
|
|
372
|
+
if (y(e, g)) {
|
|
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
|
-
|
|
380
|
-
} catch (
|
|
381
|
-
|
|
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
|
-
|
|
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,70 +455,70 @@ function tr() {
|
|
|
455
455
|
});
|
|
456
456
|
}
|
|
457
457
|
}
|
|
458
|
-
var
|
|
459
|
-
var
|
|
458
|
+
var jt = function(e, t, n, c, I, y, g) {
|
|
459
|
+
var R = {
|
|
460
460
|
// This tag allows us to uniquely identify this as a React Element
|
|
461
461
|
$$typeof: u,
|
|
462
462
|
// Built-in properties that belong on the element
|
|
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
|
};
|
|
470
|
-
return
|
|
470
|
+
return R._store = {}, Object.defineProperty(R._store, "validated", {
|
|
471
471
|
configurable: !1,
|
|
472
472
|
enumerable: !1,
|
|
473
473
|
writable: !0,
|
|
474
474
|
value: !1
|
|
475
|
-
}), Object.defineProperty(
|
|
475
|
+
}), Object.defineProperty(R, "_self", {
|
|
476
476
|
configurable: !1,
|
|
477
477
|
enumerable: !1,
|
|
478
478
|
writable: !1,
|
|
479
479
|
value: c
|
|
480
|
-
}), Object.defineProperty(
|
|
480
|
+
}), Object.defineProperty(R, "_source", {
|
|
481
481
|
configurable: !1,
|
|
482
482
|
enumerable: !1,
|
|
483
483
|
writable: !1,
|
|
484
|
-
value:
|
|
485
|
-
}), Object.freeze && (Object.freeze(
|
|
484
|
+
value: I
|
|
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 (
|
|
498
|
+
if (R || W) {
|
|
499
499
|
var M = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
500
|
-
|
|
500
|
+
R && Lt(g, M), W && Pt(g, M);
|
|
501
501
|
}
|
|
502
|
-
return
|
|
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
|
|
|
@@ -527,13 +527,13 @@ Check the render method of \`` + e + "`.";
|
|
|
527
527
|
return "";
|
|
528
528
|
}
|
|
529
529
|
}
|
|
530
|
-
function
|
|
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
|
-
|
|
554
|
+
ot[n] = !0;
|
|
555
555
|
var c = "";
|
|
556
|
-
e && e._owner && e._owner !==
|
|
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
565
|
var c = e[n];
|
|
566
|
-
|
|
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 c =
|
|
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
606
|
var c = t[n];
|
|
607
607
|
if (c !== "children" && c !== "key") {
|
|
608
|
-
|
|
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 (!
|
|
620
|
-
var
|
|
621
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (
|
|
622
|
-
var
|
|
623
|
-
|
|
624
|
-
var
|
|
625
|
-
e === null ?
|
|
618
|
+
var g = _(e);
|
|
619
|
+
if (!g) {
|
|
620
|
+
var R = "";
|
|
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 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 M =
|
|
627
|
+
var M = Ft(e, t, n, I, y);
|
|
628
628
|
if (M == null)
|
|
629
629
|
return M;
|
|
630
|
-
if (
|
|
631
|
-
var
|
|
632
|
-
if (
|
|
630
|
+
if (g) {
|
|
631
|
+
var K = t.children;
|
|
632
|
+
if (K !== void 0)
|
|
633
633
|
if (c)
|
|
634
|
-
if (
|
|
635
|
-
for (var
|
|
636
|
-
|
|
637
|
-
Object.freeze && Object.freeze(
|
|
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,87 +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
857
|
currentPage: d,
|
|
858
|
-
loading:
|
|
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:
|
|
918
|
-
multiSortKey: "ctrl",
|
|
919
|
-
alwaysMultiSort: !0,
|
|
917
|
+
onSortChanged: ne,
|
|
920
918
|
defaultColDef: {
|
|
921
919
|
width: 170,
|
|
922
920
|
sortable: !0,
|
|
923
921
|
unSortIcon: !0,
|
|
924
|
-
tooltipValueGetter: (
|
|
922
|
+
tooltipValueGetter: (U) => U.value ?? dr.NO_DATA
|
|
925
923
|
},
|
|
926
924
|
suppressRowTransform: !0,
|
|
927
|
-
getRowHeight:
|
|
925
|
+
getRowHeight: B ?? (() => 54),
|
|
928
926
|
maintainColumnOrder: !0,
|
|
929
927
|
initialState: S && S.length > 0 ? {
|
|
930
928
|
sort: {
|
|
931
|
-
sortModel: S.map((
|
|
932
|
-
colId:
|
|
933
|
-
sort:
|
|
929
|
+
sortModel: S.map((U) => ({
|
|
930
|
+
colId: U.colId,
|
|
931
|
+
sort: U.sort
|
|
934
932
|
}))
|
|
935
933
|
}
|
|
936
934
|
} : void 0
|
|
@@ -944,41 +942,41 @@ const Er = ({
|
|
|
944
942
|
totalRecords: a,
|
|
945
943
|
currentPage: u,
|
|
946
944
|
pageSize: d,
|
|
947
|
-
onPageChange:
|
|
945
|
+
onPageChange: E
|
|
948
946
|
}) => {
|
|
949
947
|
const s = Math.ceil(a / d);
|
|
950
|
-
return /* @__PURE__ */ r.jsxs(
|
|
948
|
+
return /* @__PURE__ */ r.jsxs(L, { sx: { display: "flex", gap: 2, alignItems: "center" }, children: [
|
|
951
949
|
/* @__PURE__ */ r.jsx(
|
|
952
|
-
|
|
950
|
+
ie,
|
|
953
951
|
{
|
|
954
952
|
size: "small",
|
|
955
953
|
disabled: u === 1,
|
|
956
|
-
onClick: () =>
|
|
954
|
+
onClick: () => E(u - 1),
|
|
957
955
|
children: "Previous"
|
|
958
956
|
}
|
|
959
957
|
),
|
|
960
|
-
/* @__PURE__ */ r.jsxs(
|
|
958
|
+
/* @__PURE__ */ r.jsxs(Ie, { variant: "body2", children: [
|
|
961
959
|
"Page ",
|
|
962
960
|
u,
|
|
963
961
|
" of ",
|
|
964
962
|
s || 1
|
|
965
963
|
] }),
|
|
966
964
|
/* @__PURE__ */ r.jsx(
|
|
967
|
-
|
|
965
|
+
ie,
|
|
968
966
|
{
|
|
969
967
|
size: "small",
|
|
970
968
|
disabled: u >= s,
|
|
971
|
-
onClick: () =>
|
|
969
|
+
onClick: () => E(u + 1),
|
|
972
970
|
children: "Next"
|
|
973
971
|
}
|
|
974
972
|
)
|
|
975
973
|
] });
|
|
976
|
-
},
|
|
974
|
+
}, $e = {
|
|
977
975
|
MASTER_DATA_MANAGEMENT: "Master Data Management",
|
|
978
976
|
ADD_NEW_RECORD: "Add New Record",
|
|
979
977
|
EDIT_RECORD: "Edit Record",
|
|
980
978
|
VIEW_RECORD: "View Record"
|
|
981
|
-
},
|
|
979
|
+
}, de = {
|
|
982
980
|
VIEW: "View",
|
|
983
981
|
ADD_NEW_RECORD: "Add New Record",
|
|
984
982
|
EDIT: "Edit",
|
|
@@ -987,22 +985,22 @@ const Er = ({
|
|
|
987
985
|
CANCEL: "Cancel",
|
|
988
986
|
BACK: "Back",
|
|
989
987
|
EXPORT: "Export"
|
|
990
|
-
},
|
|
988
|
+
}, Xe = {
|
|
991
989
|
SELECT_ENTITY: "Select Entity",
|
|
992
990
|
ACTIONS: "Actions",
|
|
993
991
|
FROM: "From",
|
|
994
992
|
TO: "To"
|
|
995
|
-
},
|
|
993
|
+
}, Le = {
|
|
996
994
|
SELECT_ENTITY: "Select Entity",
|
|
997
995
|
SELECT: (a) => `Select ${a}`,
|
|
998
996
|
FILTER_BY: (a) => `Filter by ${a}`
|
|
999
|
-
},
|
|
997
|
+
}, mt = {
|
|
1000
998
|
CSV: "CSV Format",
|
|
1001
999
|
EXCEL: "Excel Format"
|
|
1002
|
-
},
|
|
1000
|
+
}, Rt = {
|
|
1003
1001
|
CSV: "csv",
|
|
1004
1002
|
EXCEL: "xlsx"
|
|
1005
|
-
},
|
|
1003
|
+
}, ce = {
|
|
1006
1004
|
FAILED_LOAD_ENTITIES: "Failed to load entities",
|
|
1007
1005
|
FAILED_LOAD_METADATA: "Failed to load metadata",
|
|
1008
1006
|
FAILED_LOAD_RECORD: "Failed to load record",
|
|
@@ -1028,7 +1026,7 @@ const Er = ({
|
|
|
1028
1026
|
}, Dr = {
|
|
1029
1027
|
LOADING: "Loading...",
|
|
1030
1028
|
PLEASE_WAIT: "Please wait..."
|
|
1031
|
-
},
|
|
1029
|
+
}, ze = {
|
|
1032
1030
|
SHOWING: "Showing",
|
|
1033
1031
|
OF: "of",
|
|
1034
1032
|
ENTRIES: "entries"
|
|
@@ -1053,7 +1051,7 @@ const Er = ({
|
|
|
1053
1051
|
ACTION_BUTTON_GAP: 1,
|
|
1054
1052
|
FORM_MARGIN_TOP: 3,
|
|
1055
1053
|
FORM_MARGIN_BOTTOM: 2
|
|
1056
|
-
},
|
|
1054
|
+
}, _t = [10, 20, 50, 100], pr = " *", mr = "red", Rr = "_display", Nr = {
|
|
1057
1055
|
ISO_DATE: "YYYY-MM-DD",
|
|
1058
1056
|
DISPLAY_DATE: "DD/MM/YYYY",
|
|
1059
1057
|
FILE_DATE: "YYYY-MM-DD"
|
|
@@ -1065,9 +1063,9 @@ const Er = ({
|
|
|
1065
1063
|
HEADERS: {
|
|
1066
1064
|
CONTENT_TYPE: "application/json"
|
|
1067
1065
|
}
|
|
1068
|
-
},
|
|
1066
|
+
}, jr = {
|
|
1069
1067
|
MASTER: "/master"
|
|
1070
|
-
},
|
|
1068
|
+
}, Fr = {
|
|
1071
1069
|
// Entity endpoints
|
|
1072
1070
|
ENTITIES: "/master/entities",
|
|
1073
1071
|
ENTITY_METADATA: (a) => `/master/${a}/metadata`,
|
|
@@ -1077,40 +1075,40 @@ const Er = ({
|
|
|
1077
1075
|
// Export endpoints
|
|
1078
1076
|
EXPORT_CSV: (a) => `/master/${a}/export/csv`,
|
|
1079
1077
|
EXPORT_EXCEL: (a) => `/master/${a}/export/excel`
|
|
1080
|
-
},
|
|
1078
|
+
}, Mr = {
|
|
1081
1079
|
GET: "GET",
|
|
1082
1080
|
POST: "POST",
|
|
1083
1081
|
PUT: "PUT",
|
|
1084
1082
|
DELETE: "DELETE",
|
|
1085
1083
|
PATCH: "PATCH"
|
|
1086
|
-
},
|
|
1084
|
+
}, wr = {
|
|
1087
1085
|
PAGE: "page",
|
|
1088
1086
|
LIMIT: "limit",
|
|
1089
1087
|
SEARCH: "search",
|
|
1090
1088
|
SEARCH_BY: "searchBy",
|
|
1091
1089
|
SORT_BY: "sortBy",
|
|
1092
1090
|
SORT_ORDER: "sortOrder"
|
|
1093
|
-
},
|
|
1091
|
+
}, we = {
|
|
1094
1092
|
ASC: "ASC",
|
|
1095
1093
|
DESC: "DESC"
|
|
1096
1094
|
}, Ur = {
|
|
1097
1095
|
JSON: "json",
|
|
1098
1096
|
BLOB: "blob",
|
|
1099
1097
|
TEXT: "text"
|
|
1100
|
-
},
|
|
1098
|
+
}, gt = {
|
|
1101
1099
|
CSV: "text/csv;charset=utf-8;",
|
|
1102
1100
|
EXCEL: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
1103
1101
|
JSON: "application/json"
|
|
1104
|
-
},
|
|
1102
|
+
}, $r = {
|
|
1105
1103
|
DATA: "data",
|
|
1106
1104
|
COUNT: "count",
|
|
1107
1105
|
MESSAGE: "message",
|
|
1108
1106
|
ERROR: "error"
|
|
1109
|
-
},
|
|
1107
|
+
}, X = {
|
|
1110
1108
|
CREATE: "create",
|
|
1111
1109
|
EDIT: "edit",
|
|
1112
1110
|
VIEW: "view"
|
|
1113
|
-
},
|
|
1111
|
+
}, qe = {
|
|
1114
1112
|
TEXT: "text",
|
|
1115
1113
|
DROPDOWN: "dropdown",
|
|
1116
1114
|
DATEPICKER: "datepicker",
|
|
@@ -1118,7 +1116,7 @@ const Er = ({
|
|
|
1118
1116
|
TEXTAREA: "textarea",
|
|
1119
1117
|
CHECKBOX: "checkbox",
|
|
1120
1118
|
RADIO: "radio"
|
|
1121
|
-
},
|
|
1119
|
+
}, be = {
|
|
1122
1120
|
STRING: "string",
|
|
1123
1121
|
NUMBER: "number",
|
|
1124
1122
|
FLOAT: "float",
|
|
@@ -1127,11 +1125,11 @@ const Er = ({
|
|
|
1127
1125
|
BOOLEAN: "boolean",
|
|
1128
1126
|
ARRAY: "array",
|
|
1129
1127
|
OBJECT: "object"
|
|
1130
|
-
},
|
|
1128
|
+
}, Gr = {
|
|
1131
1129
|
API: "API",
|
|
1132
1130
|
RAW: "Raw",
|
|
1133
1131
|
STATIC: "Static"
|
|
1134
|
-
},
|
|
1132
|
+
}, kr = {
|
|
1135
1133
|
ID: "id",
|
|
1136
1134
|
NAME: "name",
|
|
1137
1135
|
LABEL: "label",
|
|
@@ -1147,10 +1145,10 @@ const Er = ({
|
|
|
1147
1145
|
PATTERN: "pattern",
|
|
1148
1146
|
EMAIL: "email",
|
|
1149
1147
|
URL: "url"
|
|
1150
|
-
},
|
|
1148
|
+
}, J = {
|
|
1151
1149
|
FROM: "From",
|
|
1152
1150
|
TO: "To"
|
|
1153
|
-
},
|
|
1151
|
+
}, Yr = {
|
|
1154
1152
|
TEXT: "text",
|
|
1155
1153
|
NUMBER: "number",
|
|
1156
1154
|
DATE: "date",
|
|
@@ -1167,237 +1165,260 @@ const Er = ({
|
|
|
1167
1165
|
apiClient: a,
|
|
1168
1166
|
apiEndpoints: u,
|
|
1169
1167
|
onNavigateToNew: d,
|
|
1170
|
-
onNavigateToEdit:
|
|
1168
|
+
onNavigateToEdit: E
|
|
1171
1169
|
}) => {
|
|
1172
|
-
const s =
|
|
1173
|
-
|
|
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(() => {
|
|
1174
1172
|
(async () => {
|
|
1175
1173
|
try {
|
|
1176
|
-
const x = ((await s.getEntities()).data || []).map((
|
|
1177
|
-
name:
|
|
1178
|
-
label:
|
|
1174
|
+
const x = ((await s.getEntities()).data || []).map((m) => ({
|
|
1175
|
+
name: m.tableName || m.name,
|
|
1176
|
+
label: m.displayName || m.label
|
|
1179
1177
|
}));
|
|
1180
|
-
|
|
1181
|
-
} catch (
|
|
1182
|
-
console.error(
|
|
1178
|
+
z(x), x.length > 0 && v(x[0]);
|
|
1179
|
+
} catch (i) {
|
|
1180
|
+
console.error(ce.FAILED_LOAD_ENTITIES, i);
|
|
1183
1181
|
}
|
|
1184
1182
|
})();
|
|
1185
|
-
}, []),
|
|
1183
|
+
}, []), Pe(() => {
|
|
1186
1184
|
if (!p) return;
|
|
1187
1185
|
(async () => {
|
|
1188
1186
|
try {
|
|
1189
|
-
const
|
|
1190
|
-
S(
|
|
1187
|
+
const h = (await s.getMetadata(p.name)).data || {};
|
|
1188
|
+
S(h.parameterList || []), re(h.resultsList || []);
|
|
1191
1189
|
const x = {};
|
|
1192
|
-
(
|
|
1193
|
-
x[
|
|
1190
|
+
(h.parameterList || []).forEach((N) => {
|
|
1191
|
+
x[N.name] = null;
|
|
1194
1192
|
}), C(x);
|
|
1195
|
-
const
|
|
1196
|
-
for (const
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
} catch (
|
|
1200
|
-
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);
|
|
1201
1199
|
}
|
|
1202
1200
|
})();
|
|
1203
1201
|
}, [p]);
|
|
1204
|
-
const
|
|
1205
|
-
const o = {},
|
|
1206
|
-
|
|
1207
|
-
if (
|
|
1208
|
-
const
|
|
1209
|
-
|
|
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);
|
|
1210
1208
|
return;
|
|
1211
1209
|
}
|
|
1212
|
-
const
|
|
1213
|
-
|
|
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())));
|
|
1214
1212
|
});
|
|
1215
1213
|
const x = {
|
|
1216
|
-
page:
|
|
1217
|
-
limit:
|
|
1214
|
+
page: U,
|
|
1215
|
+
limit: j
|
|
1218
1216
|
};
|
|
1219
|
-
return Object.keys(o).length > 0 && Object.entries(o).forEach(([
|
|
1220
|
-
x[`filters[${
|
|
1221
|
-
}),
|
|
1222
|
-
}, [
|
|
1223
|
-
if (!(!p ||
|
|
1224
|
-
|
|
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);
|
|
1225
1223
|
try {
|
|
1226
|
-
console.log("Fetching with params:",
|
|
1227
|
-
const o = await s.getRecords(p.name,
|
|
1228
|
-
|
|
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);
|
|
1229
1227
|
} catch (o) {
|
|
1230
|
-
console.error(
|
|
1228
|
+
console.error(ce.FAILED_FETCH_LIST, o), console.error("Full error:", o), Q([]), b(0);
|
|
1231
1229
|
} finally {
|
|
1232
|
-
|
|
1230
|
+
Z(!1), $.current = !0;
|
|
1233
1231
|
}
|
|
1234
1232
|
}
|
|
1235
|
-
}, [p,
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
}, [
|
|
1239
|
-
const
|
|
1240
|
-
G(1),
|
|
1241
|
-
|
|
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();
|
|
1242
1240
|
}, 0);
|
|
1243
|
-
},
|
|
1244
|
-
|
|
1245
|
-
},
|
|
1246
|
-
|
|
1247
|
-
},
|
|
1241
|
+
}, se = (o) => {
|
|
1242
|
+
ee(o.currentTarget);
|
|
1243
|
+
}, ye = () => {
|
|
1244
|
+
ee(null);
|
|
1245
|
+
}, Ce = async (o) => {
|
|
1248
1246
|
if (p)
|
|
1249
1247
|
try {
|
|
1250
|
-
const
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
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.`);
|
|
1254
1275
|
} finally {
|
|
1255
|
-
|
|
1276
|
+
ye();
|
|
1256
1277
|
}
|
|
1257
|
-
},
|
|
1258
|
-
const o =
|
|
1259
|
-
field:
|
|
1260
|
-
headerName:
|
|
1278
|
+
}, Ge = Oe(() => {
|
|
1279
|
+
const o = B.map((i) => ({
|
|
1280
|
+
field: i.name,
|
|
1281
|
+
headerName: i.label,
|
|
1261
1282
|
sortable: !0,
|
|
1262
1283
|
filter: !1,
|
|
1263
1284
|
flex: 1
|
|
1264
1285
|
}));
|
|
1265
1286
|
return o.push({
|
|
1266
1287
|
field: "actions",
|
|
1267
|
-
headerName:
|
|
1288
|
+
headerName: Xe.ACTIONS,
|
|
1268
1289
|
sortable: !1,
|
|
1269
1290
|
filter: !1,
|
|
1270
1291
|
width: 150,
|
|
1271
|
-
cellRenderer: (
|
|
1272
|
-
const
|
|
1273
|
-
return !
|
|
1274
|
-
|
|
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,
|
|
1275
1296
|
{
|
|
1276
1297
|
size: "small",
|
|
1277
1298
|
variant: "outlined",
|
|
1278
|
-
onClick: () =>
|
|
1279
|
-
children:
|
|
1299
|
+
onClick: () => E?.(p.name, h.id),
|
|
1300
|
+
children: de.EDIT
|
|
1280
1301
|
}
|
|
1281
1302
|
) });
|
|
1282
1303
|
}
|
|
1283
1304
|
}), o;
|
|
1284
|
-
}, [
|
|
1285
|
-
return /* @__PURE__ */ r.jsxs(
|
|
1286
|
-
/* @__PURE__ */ r.jsxs(
|
|
1287
|
-
/* @__PURE__ */ r.jsx(
|
|
1288
|
-
/* @__PURE__ */ r.jsxs(
|
|
1289
|
-
/* @__PURE__ */ r.jsxs(
|
|
1290
|
-
/* @__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 }),
|
|
1291
1312
|
/* @__PURE__ */ r.jsx(
|
|
1292
|
-
|
|
1313
|
+
Je,
|
|
1293
1314
|
{
|
|
1294
1315
|
options: k,
|
|
1295
1316
|
getOptionLabel: (o) => o.label,
|
|
1296
1317
|
value: p,
|
|
1297
|
-
onChange: (o,
|
|
1298
|
-
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 }),
|
|
1299
1320
|
className: "field-input"
|
|
1300
1321
|
}
|
|
1301
1322
|
)
|
|
1302
1323
|
] }),
|
|
1303
|
-
|
|
1304
|
-
/* @__PURE__ */ r.jsx(
|
|
1305
|
-
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: [
|
|
1306
1327
|
/* @__PURE__ */ r.jsx(
|
|
1307
|
-
|
|
1328
|
+
te,
|
|
1308
1329
|
{
|
|
1309
1330
|
type: "date",
|
|
1310
1331
|
size: "small",
|
|
1311
|
-
value:
|
|
1312
|
-
onChange: (
|
|
1332
|
+
value: A[`${o.name}${J.FROM}`] || "",
|
|
1333
|
+
onChange: (i) => C((h) => ({ ...h, [`${o.name}${J.FROM}`]: i.target.value })),
|
|
1313
1334
|
sx: { flex: 1 }
|
|
1314
1335
|
}
|
|
1315
1336
|
),
|
|
1316
1337
|
/* @__PURE__ */ r.jsx(
|
|
1317
|
-
|
|
1338
|
+
te,
|
|
1318
1339
|
{
|
|
1319
1340
|
type: "date",
|
|
1320
1341
|
size: "small",
|
|
1321
|
-
label:
|
|
1322
|
-
value:
|
|
1323
|
-
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 })),
|
|
1324
1345
|
sx: { flex: 1 }
|
|
1325
1346
|
}
|
|
1326
1347
|
)
|
|
1327
|
-
] }) : o.dataType ===
|
|
1328
|
-
|
|
1348
|
+
] }) : o.dataType === be.DATE ? /* @__PURE__ */ r.jsx(
|
|
1349
|
+
te,
|
|
1329
1350
|
{
|
|
1330
1351
|
type: "date",
|
|
1331
1352
|
size: "small",
|
|
1332
|
-
value:
|
|
1333
|
-
onChange: (
|
|
1353
|
+
value: A[o.name] || "",
|
|
1354
|
+
onChange: (i) => C((h) => ({ ...h, [o.name]: i.target.value })),
|
|
1334
1355
|
className: "field-input"
|
|
1335
1356
|
}
|
|
1336
1357
|
) : o.options ? /* @__PURE__ */ r.jsx(
|
|
1337
|
-
|
|
1358
|
+
Je,
|
|
1338
1359
|
{
|
|
1339
|
-
options:
|
|
1340
|
-
getOptionLabel: (
|
|
1341
|
-
value:
|
|
1342
|
-
onChange: (
|
|
1343
|
-
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) }),
|
|
1344
1365
|
className: "field-input"
|
|
1345
1366
|
}
|
|
1346
|
-
) : o.dataType ===
|
|
1347
|
-
|
|
1367
|
+
) : o.dataType === be.NUMBER ? /* @__PURE__ */ r.jsx(
|
|
1368
|
+
te,
|
|
1348
1369
|
{
|
|
1349
1370
|
type: "number",
|
|
1350
1371
|
size: "small",
|
|
1351
|
-
value:
|
|
1352
|
-
onChange: (
|
|
1353
|
-
placeholder:
|
|
1372
|
+
value: A[o.name] || "",
|
|
1373
|
+
onChange: (i) => C((h) => ({ ...h, [o.name]: i.target.value })),
|
|
1374
|
+
placeholder: Le.FILTER_BY(o.label),
|
|
1354
1375
|
className: "field-input"
|
|
1355
1376
|
}
|
|
1356
1377
|
) : /* @__PURE__ */ r.jsx(
|
|
1357
|
-
|
|
1378
|
+
te,
|
|
1358
1379
|
{
|
|
1359
1380
|
size: "small",
|
|
1360
|
-
value:
|
|
1361
|
-
onChange: (
|
|
1362
|
-
placeholder:
|
|
1381
|
+
value: A[o.name] || "",
|
|
1382
|
+
onChange: (i) => C((h) => ({ ...h, [o.name]: i.target.value })),
|
|
1383
|
+
placeholder: Le.FILTER_BY(o.label),
|
|
1363
1384
|
className: "field-input"
|
|
1364
1385
|
}
|
|
1365
1386
|
)
|
|
1366
1387
|
] }, o.name))
|
|
1367
1388
|
] }),
|
|
1368
|
-
/* @__PURE__ */ r.jsxs(
|
|
1369
|
-
/* @__PURE__ */ r.jsx(
|
|
1389
|
+
/* @__PURE__ */ r.jsxs(L, { className: "action-buttons", children: [
|
|
1390
|
+
/* @__PURE__ */ r.jsx(ie, { variant: "contained", onClick: he, children: de.VIEW }),
|
|
1370
1391
|
/* @__PURE__ */ r.jsx(
|
|
1371
|
-
|
|
1392
|
+
ie,
|
|
1372
1393
|
{
|
|
1373
1394
|
variant: "contained",
|
|
1374
1395
|
disabled: !p,
|
|
1375
1396
|
onClick: () => p && d?.(p.name),
|
|
1376
|
-
children:
|
|
1397
|
+
children: de.ADD_NEW_RECORD
|
|
1377
1398
|
}
|
|
1378
1399
|
)
|
|
1379
1400
|
] })
|
|
1380
1401
|
] }),
|
|
1381
|
-
|
|
1382
|
-
/* @__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: [
|
|
1383
1404
|
/* @__PURE__ */ r.jsx(
|
|
1384
|
-
|
|
1405
|
+
ie,
|
|
1385
1406
|
{
|
|
1386
1407
|
variant: "outlined",
|
|
1387
|
-
onClick:
|
|
1408
|
+
onClick: se,
|
|
1388
1409
|
disabled: !p,
|
|
1389
|
-
children:
|
|
1410
|
+
children: de.EXPORT
|
|
1390
1411
|
}
|
|
1391
1412
|
),
|
|
1392
1413
|
/* @__PURE__ */ r.jsxs(
|
|
1393
1414
|
qt,
|
|
1394
1415
|
{
|
|
1395
|
-
anchorEl:
|
|
1396
|
-
open: !!
|
|
1397
|
-
onClose:
|
|
1416
|
+
anchorEl: O,
|
|
1417
|
+
open: !!O,
|
|
1418
|
+
onClose: ye,
|
|
1398
1419
|
children: [
|
|
1399
|
-
/* @__PURE__ */ r.jsx(
|
|
1400
|
-
/* @__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 })
|
|
1401
1422
|
]
|
|
1402
1423
|
}
|
|
1403
1424
|
)
|
|
@@ -1405,56 +1426,56 @@ const Er = ({
|
|
|
1405
1426
|
/* @__PURE__ */ r.jsx(
|
|
1406
1427
|
Er,
|
|
1407
1428
|
{
|
|
1408
|
-
rows:
|
|
1409
|
-
columns:
|
|
1410
|
-
totalRecords:
|
|
1411
|
-
currentPage:
|
|
1412
|
-
loading:
|
|
1413
|
-
rowModelType:
|
|
1429
|
+
rows: fe,
|
|
1430
|
+
columns: Ge,
|
|
1431
|
+
totalRecords: Y,
|
|
1432
|
+
currentPage: U,
|
|
1433
|
+
loading: Ee,
|
|
1434
|
+
rowModelType: Ot.CLIENT_SIDE,
|
|
1414
1435
|
onPageChange: G,
|
|
1415
|
-
pageSize:
|
|
1416
|
-
pageSizeOptions: [...
|
|
1436
|
+
pageSize: j,
|
|
1437
|
+
pageSizeOptions: [..._t],
|
|
1417
1438
|
onPageSizeChange: (o) => {
|
|
1418
|
-
|
|
1439
|
+
ne(o), G(1);
|
|
1419
1440
|
},
|
|
1420
|
-
setSort:
|
|
1421
|
-
sortModel:
|
|
1441
|
+
setSort: F,
|
|
1442
|
+
sortModel: f,
|
|
1422
1443
|
height: 500
|
|
1423
1444
|
},
|
|
1424
1445
|
p?.name
|
|
1425
1446
|
),
|
|
1426
1447
|
/* @__PURE__ */ r.jsxs(nr, { children: [
|
|
1427
|
-
/* @__PURE__ */ r.jsx(
|
|
1428
|
-
/* @__PURE__ */ r.jsxs(
|
|
1429
|
-
|
|
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,
|
|
1430
1451
|
" "
|
|
1431
1452
|
] }),
|
|
1432
1453
|
/* @__PURE__ */ r.jsx(
|
|
1433
1454
|
or,
|
|
1434
1455
|
{
|
|
1435
|
-
value:
|
|
1456
|
+
value: j,
|
|
1436
1457
|
inputProps: { "aria-label": "Page size" },
|
|
1437
1458
|
onChange: (o) => {
|
|
1438
|
-
|
|
1459
|
+
ne(Number(o.target.value)), G(1);
|
|
1439
1460
|
},
|
|
1440
|
-
children:
|
|
1461
|
+
children: _t.map((o) => /* @__PURE__ */ r.jsx(He, { value: o, children: o }, o))
|
|
1441
1462
|
}
|
|
1442
1463
|
),
|
|
1443
|
-
/* @__PURE__ */ r.jsxs(
|
|
1444
|
-
|
|
1464
|
+
/* @__PURE__ */ r.jsxs(Tt, { children: [
|
|
1465
|
+
ze.OF,
|
|
1445
1466
|
" ",
|
|
1446
|
-
|
|
1467
|
+
Y,
|
|
1447
1468
|
" ",
|
|
1448
|
-
|
|
1469
|
+
ze.ENTRIES
|
|
1449
1470
|
] })
|
|
1450
1471
|
] }) }),
|
|
1451
1472
|
/* @__PURE__ */ r.jsx(
|
|
1452
1473
|
Tr,
|
|
1453
1474
|
{
|
|
1454
|
-
totalRecords:
|
|
1455
|
-
currentPage:
|
|
1475
|
+
totalRecords: Y,
|
|
1476
|
+
currentPage: U,
|
|
1456
1477
|
onPageChange: G,
|
|
1457
|
-
pageSize:
|
|
1478
|
+
pageSize: j
|
|
1458
1479
|
}
|
|
1459
1480
|
)
|
|
1460
1481
|
] })
|
|
@@ -1464,211 +1485,211 @@ const Er = ({
|
|
|
1464
1485
|
apiClient: a,
|
|
1465
1486
|
apiEndpoints: u,
|
|
1466
1487
|
entity: d,
|
|
1467
|
-
id:
|
|
1488
|
+
id: E,
|
|
1468
1489
|
mode: s,
|
|
1469
1490
|
onBack: k,
|
|
1470
|
-
onSuccess:
|
|
1491
|
+
onSuccess: z
|
|
1471
1492
|
}) => {
|
|
1472
|
-
const p =
|
|
1473
|
-
const
|
|
1474
|
-
return
|
|
1475
|
-
}), [
|
|
1476
|
-
|
|
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(() => {
|
|
1477
1498
|
if (!d) return;
|
|
1478
|
-
let
|
|
1499
|
+
let _ = !0;
|
|
1479
1500
|
return (async () => {
|
|
1480
|
-
|
|
1501
|
+
Y(!0), j(null);
|
|
1481
1502
|
try {
|
|
1482
|
-
const
|
|
1483
|
-
if (!
|
|
1484
|
-
const
|
|
1485
|
-
|
|
1486
|
-
const
|
|
1487
|
-
for (const [
|
|
1488
|
-
if (
|
|
1489
|
-
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")
|
|
1490
1511
|
try {
|
|
1491
|
-
const
|
|
1492
|
-
value:
|
|
1493
|
-
label:
|
|
1512
|
+
const he = ((await p.getDropdownOptions($.option)).data || []).map((se) => ({
|
|
1513
|
+
value: se.id,
|
|
1514
|
+
label: se.name || se.displayName || String(se.id)
|
|
1494
1515
|
}));
|
|
1495
|
-
|
|
1496
|
-
} catch (
|
|
1497
|
-
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] = [];
|
|
1498
1519
|
}
|
|
1499
|
-
else
|
|
1500
|
-
|
|
1501
|
-
} catch (
|
|
1502
|
-
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);
|
|
1503
1524
|
} finally {
|
|
1504
|
-
|
|
1525
|
+
_ && Y(!1);
|
|
1505
1526
|
}
|
|
1506
1527
|
})(), () => {
|
|
1507
|
-
|
|
1528
|
+
_ = !1;
|
|
1508
1529
|
};
|
|
1509
|
-
}, [d, p, a]),
|
|
1510
|
-
if (!d || !
|
|
1511
|
-
|
|
1530
|
+
}, [d, p, a]), Pe(() => {
|
|
1531
|
+
if (!d || !E || s === X.CREATE) {
|
|
1532
|
+
A({});
|
|
1512
1533
|
return;
|
|
1513
1534
|
}
|
|
1514
|
-
let
|
|
1535
|
+
let _ = !0;
|
|
1515
1536
|
return (async () => {
|
|
1516
|
-
|
|
1537
|
+
B(!0), j(null);
|
|
1517
1538
|
try {
|
|
1518
|
-
const
|
|
1519
|
-
if (!
|
|
1520
|
-
const
|
|
1521
|
-
for (const [
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
} catch (
|
|
1525
|
-
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);
|
|
1526
1547
|
} finally {
|
|
1527
|
-
|
|
1548
|
+
_ && B(!1);
|
|
1528
1549
|
}
|
|
1529
1550
|
})(), () => {
|
|
1530
|
-
|
|
1551
|
+
_ = !1;
|
|
1531
1552
|
};
|
|
1532
|
-
}, [d,
|
|
1533
|
-
const G =
|
|
1534
|
-
|
|
1535
|
-
}, []),
|
|
1536
|
-
const
|
|
1537
|
-
for (const [
|
|
1538
|
-
|
|
1539
|
-
return
|
|
1540
|
-
}, [
|
|
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 () => {
|
|
1541
1562
|
if (!d) return;
|
|
1542
|
-
const
|
|
1543
|
-
if (
|
|
1544
|
-
|
|
1563
|
+
const _ = Ee();
|
|
1564
|
+
if (_.length > 0) {
|
|
1565
|
+
j(_.join(", "));
|
|
1545
1566
|
return;
|
|
1546
1567
|
}
|
|
1547
|
-
|
|
1568
|
+
B(!0), j(null);
|
|
1548
1569
|
try {
|
|
1549
|
-
const
|
|
1550
|
-
for (const
|
|
1551
|
-
const
|
|
1552
|
-
|
|
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]);
|
|
1553
1574
|
}
|
|
1554
|
-
if (s ===
|
|
1555
|
-
const
|
|
1556
|
-
|
|
1557
|
-
} else if (
|
|
1558
|
-
const
|
|
1559
|
-
|
|
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);
|
|
1560
1581
|
}
|
|
1561
1582
|
k?.();
|
|
1562
|
-
} catch (
|
|
1563
|
-
console.error("Failed to save record:",
|
|
1564
|
-
const
|
|
1565
|
-
|
|
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);
|
|
1566
1587
|
} finally {
|
|
1567
|
-
|
|
1588
|
+
B(!1);
|
|
1568
1589
|
}
|
|
1569
|
-
}, [d,
|
|
1570
|
-
const
|
|
1571
|
-
if (!
|
|
1572
|
-
const
|
|
1573
|
-
return /* @__PURE__ */ r.jsxs(
|
|
1574
|
-
/* @__PURE__ */ r.jsxs(
|
|
1575
|
-
|
|
1576
|
-
|
|
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 })
|
|
1577
1598
|
] }),
|
|
1578
|
-
|
|
1579
|
-
|
|
1599
|
+
T.fieldType === qe.DROPDOWN ? /* @__PURE__ */ r.jsx(
|
|
1600
|
+
Je,
|
|
1580
1601
|
{
|
|
1581
|
-
options:
|
|
1582
|
-
getOptionLabel: (
|
|
1583
|
-
value:
|
|
1584
|
-
onChange: (
|
|
1585
|
-
disabled:
|
|
1586
|
-
loading:
|
|
1587
|
-
renderInput: (
|
|
1588
|
-
|
|
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,
|
|
1589
1610
|
{
|
|
1590
|
-
...
|
|
1611
|
+
...O,
|
|
1591
1612
|
size: "small",
|
|
1592
|
-
placeholder:
|
|
1593
|
-
error:
|
|
1613
|
+
placeholder: Le.SELECT(_),
|
|
1614
|
+
error: T.validation?.required && !f && s !== X.VIEW
|
|
1594
1615
|
}
|
|
1595
1616
|
),
|
|
1596
1617
|
className: "field-input"
|
|
1597
1618
|
}
|
|
1598
|
-
) :
|
|
1599
|
-
|
|
1619
|
+
) : T.fieldType === qe.DATEPICKER ? /* @__PURE__ */ r.jsx(
|
|
1620
|
+
te,
|
|
1600
1621
|
{
|
|
1601
1622
|
type: "date",
|
|
1602
1623
|
size: "small",
|
|
1603
|
-
value:
|
|
1604
|
-
onChange: (
|
|
1605
|
-
disabled:
|
|
1606
|
-
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,
|
|
1607
1628
|
className: "field-input",
|
|
1608
1629
|
InputLabelProps: { shrink: !0 }
|
|
1609
1630
|
}
|
|
1610
|
-
) :
|
|
1611
|
-
|
|
1631
|
+
) : T.dataType === "number" || T.dataType === "float" ? /* @__PURE__ */ r.jsx(
|
|
1632
|
+
te,
|
|
1612
1633
|
{
|
|
1613
1634
|
type: "number",
|
|
1614
1635
|
size: "small",
|
|
1615
|
-
value:
|
|
1616
|
-
onChange: (
|
|
1617
|
-
disabled:
|
|
1618
|
-
placeholder:
|
|
1619
|
-
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,
|
|
1620
1641
|
inputProps: {
|
|
1621
|
-
max:
|
|
1622
|
-
min:
|
|
1623
|
-
step:
|
|
1642
|
+
max: T.validation?.max,
|
|
1643
|
+
min: T.validation?.min,
|
|
1644
|
+
step: T.dataType === "float" ? 0.01 : 1
|
|
1624
1645
|
},
|
|
1625
1646
|
className: "field-input"
|
|
1626
1647
|
}
|
|
1627
1648
|
) : /* @__PURE__ */ r.jsx(
|
|
1628
|
-
|
|
1649
|
+
te,
|
|
1629
1650
|
{
|
|
1630
1651
|
size: "small",
|
|
1631
|
-
value:
|
|
1632
|
-
onChange: (
|
|
1633
|
-
disabled:
|
|
1634
|
-
placeholder:
|
|
1635
|
-
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,
|
|
1636
1657
|
inputProps: {
|
|
1637
|
-
maxLength:
|
|
1658
|
+
maxLength: T.validation?.max
|
|
1638
1659
|
},
|
|
1639
1660
|
className: "field-input"
|
|
1640
1661
|
}
|
|
1641
1662
|
)
|
|
1642
|
-
] },
|
|
1643
|
-
}, [
|
|
1644
|
-
return
|
|
1645
|
-
/* @__PURE__ */ r.jsxs(
|
|
1646
|
-
s ===
|
|
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,
|
|
1647
1668
|
d && ` - ${d.charAt(0).toUpperCase() + d.slice(1)}`
|
|
1648
1669
|
] }),
|
|
1649
|
-
|
|
1650
|
-
C && s !==
|
|
1651
|
-
/* @__PURE__ */ r.jsx(
|
|
1652
|
-
/* @__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: [
|
|
1653
1674
|
/* @__PURE__ */ r.jsx(
|
|
1654
|
-
|
|
1675
|
+
ie,
|
|
1655
1676
|
{
|
|
1656
1677
|
variant: "contained",
|
|
1657
|
-
onClick:
|
|
1678
|
+
onClick: Z,
|
|
1658
1679
|
disabled: C,
|
|
1659
|
-
children: C ? /* @__PURE__ */ r.jsx(
|
|
1680
|
+
children: C ? /* @__PURE__ */ r.jsx(Ue, { size: 24 }) : s === X.CREATE ? de.CREATE : de.UPDATE
|
|
1660
1681
|
}
|
|
1661
1682
|
),
|
|
1662
1683
|
/* @__PURE__ */ r.jsx(
|
|
1663
|
-
|
|
1684
|
+
ie,
|
|
1664
1685
|
{
|
|
1665
1686
|
variant: "outlined",
|
|
1666
1687
|
onClick: () => k?.(),
|
|
1667
1688
|
disabled: C,
|
|
1668
|
-
children:
|
|
1689
|
+
children: de.CANCEL
|
|
1669
1690
|
}
|
|
1670
1691
|
)
|
|
1671
|
-
] }) : /* @__PURE__ */ r.jsx(
|
|
1692
|
+
] }) : /* @__PURE__ */ r.jsx(ie, { variant: "outlined", onClick: () => k?.(), children: de.BACK }) })
|
|
1672
1693
|
] }) });
|
|
1673
1694
|
}, zr = {
|
|
1674
1695
|
ROOT: "/",
|
|
@@ -1694,57 +1715,57 @@ const Er = ({
|
|
|
1694
1715
|
EDIT: "/edit"
|
|
1695
1716
|
};
|
|
1696
1717
|
export {
|
|
1697
|
-
|
|
1718
|
+
jr as API_BASE_PATHS,
|
|
1698
1719
|
Pr as API_CONFIG,
|
|
1699
|
-
|
|
1720
|
+
Fr as API_ENDPOINTS,
|
|
1700
1721
|
Lr as ARIA_LABELS,
|
|
1701
|
-
|
|
1722
|
+
de as BUTTON_LABELS,
|
|
1702
1723
|
Or as COLUMN_PROPERTIES,
|
|
1703
1724
|
xr as CSS_CLASSES,
|
|
1704
|
-
|
|
1725
|
+
be as DATA_TYPES,
|
|
1705
1726
|
Nr as DATE_FORMATS,
|
|
1706
|
-
|
|
1727
|
+
J as DATE_RANGE_SUFFIXES,
|
|
1707
1728
|
Rr as DISPLAY_FIELD_SUFFIX,
|
|
1708
1729
|
Cr as EMPTY_STATE_MESSAGES,
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
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,
|
|
1716
1737
|
ur as GRID_CSS_CLASSES,
|
|
1717
1738
|
cr as GRID_EVENT_SOURCES,
|
|
1718
|
-
|
|
1739
|
+
pt as GRID_LAYOUT,
|
|
1719
1740
|
dr as GRID_MESSAGES,
|
|
1720
1741
|
lr as GRID_SETTINGS,
|
|
1721
|
-
|
|
1742
|
+
ze as GRID_TEXT,
|
|
1722
1743
|
fr as GRID_TIMEOUTS,
|
|
1723
|
-
|
|
1724
|
-
|
|
1744
|
+
Mr as HTTP_METHODS,
|
|
1745
|
+
Yr as INPUT_TYPES,
|
|
1725
1746
|
Dr as LOADING_MESSAGES,
|
|
1726
|
-
|
|
1747
|
+
gt as MIME_TYPES,
|
|
1727
1748
|
Xr as MasterForm,
|
|
1728
1749
|
Hr as MasterView,
|
|
1729
1750
|
Wr as NUMBER_INPUT,
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
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,
|
|
1735
1756
|
Tr as Pagination,
|
|
1736
|
-
|
|
1757
|
+
wr as QUERY_PARAMS,
|
|
1737
1758
|
Br as REGEX_PATTERNS,
|
|
1738
1759
|
pr as REQUIRED_INDICATOR,
|
|
1739
1760
|
mr as REQUIRED_INDICATOR_COLOR,
|
|
1740
|
-
|
|
1761
|
+
$r as RESPONSE_KEYS,
|
|
1741
1762
|
Ur as RESPONSE_TYPES,
|
|
1742
1763
|
zr as ROUTES,
|
|
1743
1764
|
Kr as ROUTE_KEYS,
|
|
1744
1765
|
qr as ROUTE_PATTERNS,
|
|
1745
1766
|
Qr as ROUTE_SUFFIXES,
|
|
1746
|
-
|
|
1747
|
-
|
|
1767
|
+
Ot as ROW_MODEL_TYPES,
|
|
1768
|
+
we as SORT_ORDER,
|
|
1748
1769
|
Ar as SORT_SETTINGS,
|
|
1749
1770
|
br as STYLE_CONSTANTS,
|
|
1750
1771
|
Ir as SUCCESS_MESSAGES,
|
|
@@ -1752,5 +1773,5 @@ export {
|
|
|
1752
1773
|
Jr as URL_PARAMS,
|
|
1753
1774
|
yr as VALIDATION_MESSAGES,
|
|
1754
1775
|
Vr as VALIDATION_RULES,
|
|
1755
|
-
|
|
1776
|
+
At as createApiService
|
|
1756
1777
|
};
|