@argusoft/medplat-core 1.0.22 → 1.0.23
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/{ChangePasswordModalCore-DotONnMz.js → ChangePasswordModalCore-DONyFFlx.js} +5 -5
- package/dist/{ChangePasswordModalCore-DotONnMz.js.map → ChangePasswordModalCore-DONyFFlx.js.map} +1 -1
- package/dist/{EntityManagement-D4nG7wUX.js → EntityManagement-GaYsBTvf.js} +2 -2
- package/dist/{EntityManagement-D4nG7wUX.js.map → EntityManagement-GaYsBTvf.js.map} +1 -1
- package/dist/{ManageUser-Ca1BsI1u.js → ManageUser-Gv38VHMu.js} +136 -136
- package/dist/{ManageUser-Ca1BsI1u.js.map → ManageUser-Gv38VHMu.js.map} +1 -1
- package/dist/{TableList-HGbEN4bv.js → TableList-D6jnIbnz.js} +227 -244
- package/dist/TableList-D6jnIbnz.js.map +1 -0
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/dist/TableList-HGbEN4bv.js.map +0 -1
|
@@ -3,67 +3,67 @@ import { useTranslateProvider as sn } from "@/common/languageTranslator/Translat
|
|
|
3
3
|
import { execute as xe, executeAll as dn } from "@/common/services/QueryBuilder";
|
|
4
4
|
import { showToast as F } from "@/common/toaster/toaster";
|
|
5
5
|
import cn from "@monaco-editor/react";
|
|
6
|
-
import { Dialog as Ae, DialogTitle as Re, Typography as C, Divider as te, DialogContent as Ne, TableContainer as ke, Table as Oe, TableHead as
|
|
6
|
+
import { Dialog as Ae, DialogTitle as Re, Typography as C, Divider as te, DialogContent as Ne, TableContainer as ke, Table as Oe, TableHead as Me, TableRow as K, TableCell as y, TableBody as ze, Chip as A, Box as x, Accordion as pn, AccordionSummary as mn, AccordionDetails as hn, DialogActions as De, Button as z, Alert as Ce, Paper as be, Tooltip as U, TextField as Se, InputAdornment as un, Checkbox as ve, List as fn, ListItem as gn, ListItemButton as yn, ListItemText as xn, IconButton as Te, Autocomplete as Cn } from "@mui/material";
|
|
7
7
|
import b from "prop-types";
|
|
8
|
-
import bn, { useState as
|
|
8
|
+
import bn, { useState as f, useRef as Sn, useEffect as Ie, Suspense as vn, lazy as Tn } from "react";
|
|
9
9
|
import I from "@/common/fontAwesomeIcons/FontAwesomeIcons";
|
|
10
|
-
import
|
|
10
|
+
import Ee from "@mui/material/Grid2";
|
|
11
11
|
import { useForm as In } from "react-hook-form";
|
|
12
|
-
import { useSelector as
|
|
13
|
-
const
|
|
12
|
+
import { useSelector as En } from "react-redux";
|
|
13
|
+
const we = {
|
|
14
14
|
NEW_TABLE: { label: "New Table", color: "success" },
|
|
15
15
|
MODIFIED: { label: "Modified", color: "warning" },
|
|
16
16
|
SYNC_REQUIRED: { label: "Sync Required", color: "info" },
|
|
17
17
|
NO_CHANGES: { label: "No Changes", color: "default" }
|
|
18
18
|
};
|
|
19
|
-
function
|
|
20
|
-
var
|
|
21
|
-
const
|
|
22
|
-
return
|
|
19
|
+
function $e({ changes: s, status: D }) {
|
|
20
|
+
var c, E, v, R, O;
|
|
21
|
+
const u = [];
|
|
22
|
+
return D === "NEW_TABLE" ? u.push(
|
|
23
23
|
/* @__PURE__ */ e(
|
|
24
24
|
A,
|
|
25
25
|
{
|
|
26
26
|
size: "small",
|
|
27
|
-
label: `${((
|
|
27
|
+
label: `${((c = s.addedColumns) == null ? void 0 : c.length) || 0} columns`,
|
|
28
28
|
color: "success",
|
|
29
29
|
variant: "outlined"
|
|
30
30
|
},
|
|
31
31
|
"new"
|
|
32
32
|
)
|
|
33
|
-
) : ((
|
|
33
|
+
) : ((E = s.addedColumns) != null && E.length && u.push(
|
|
34
34
|
/* @__PURE__ */ e(
|
|
35
35
|
A,
|
|
36
36
|
{
|
|
37
37
|
size: "small",
|
|
38
|
-
label: `+${
|
|
38
|
+
label: `+${s.addedColumns.length} cols`,
|
|
39
39
|
color: "success",
|
|
40
40
|
variant: "outlined"
|
|
41
41
|
},
|
|
42
42
|
"add"
|
|
43
43
|
)
|
|
44
|
-
), (v =
|
|
44
|
+
), (v = s.removedColumns) != null && v.length && u.push(
|
|
45
45
|
/* @__PURE__ */ e(
|
|
46
46
|
A,
|
|
47
47
|
{
|
|
48
48
|
size: "small",
|
|
49
|
-
label: `-${
|
|
49
|
+
label: `-${s.removedColumns.length} cols`,
|
|
50
50
|
color: "error",
|
|
51
51
|
variant: "outlined"
|
|
52
52
|
},
|
|
53
53
|
"rem"
|
|
54
54
|
)
|
|
55
|
-
), (R =
|
|
55
|
+
), (R = s.typeChangedColumns) != null && R.length && u.push(
|
|
56
56
|
/* @__PURE__ */ e(
|
|
57
57
|
A,
|
|
58
58
|
{
|
|
59
59
|
size: "small",
|
|
60
|
-
label: `${
|
|
60
|
+
label: `${s.typeChangedColumns.length} types`,
|
|
61
61
|
color: "warning",
|
|
62
62
|
variant: "outlined"
|
|
63
63
|
},
|
|
64
64
|
"type"
|
|
65
65
|
)
|
|
66
|
-
),
|
|
66
|
+
), s.primaryKeyChange && u.push(
|
|
67
67
|
/* @__PURE__ */ e(
|
|
68
68
|
A,
|
|
69
69
|
{
|
|
@@ -74,38 +74,38 @@ function De({ changes: d, status: z }) {
|
|
|
74
74
|
},
|
|
75
75
|
"pk"
|
|
76
76
|
)
|
|
77
|
-
), (O =
|
|
77
|
+
), (O = s.settingsChanges) != null && O.length && u.push(
|
|
78
78
|
/* @__PURE__ */ e(
|
|
79
79
|
A,
|
|
80
80
|
{
|
|
81
81
|
size: "small",
|
|
82
|
-
label: `${
|
|
82
|
+
label: `${s.settingsChanges.length} settings`,
|
|
83
83
|
color: "info",
|
|
84
84
|
variant: "outlined"
|
|
85
85
|
},
|
|
86
86
|
"set"
|
|
87
87
|
)
|
|
88
|
-
),
|
|
88
|
+
), u.length || u.push(
|
|
89
89
|
/* @__PURE__ */ e(C, { variant: "caption", color: "text.secondary", children: "—" }, "none")
|
|
90
|
-
)), /* @__PURE__ */ e(x, { sx: { display: "flex", gap: 0.5, flexWrap: "wrap" }, children:
|
|
90
|
+
)), /* @__PURE__ */ e(x, { sx: { display: "flex", gap: 0.5, flexWrap: "wrap" }, children: u });
|
|
91
91
|
}
|
|
92
|
-
function _e({ item:
|
|
93
|
-
var
|
|
94
|
-
const { tableName:
|
|
92
|
+
function _e({ item: s }) {
|
|
93
|
+
var E, v, R, O, $, _, T;
|
|
94
|
+
const { tableName: D, status: u, changes: c } = s;
|
|
95
95
|
return /* @__PURE__ */ r(x, { sx: { p: 1.5 }, children: [
|
|
96
|
-
|
|
96
|
+
u === "NEW_TABLE" && /* @__PURE__ */ r(Ce, { severity: "success", sx: { mb: 1.5, py: 0.5 }, children: [
|
|
97
97
|
"This table does not exist in the database. A",
|
|
98
98
|
" ",
|
|
99
99
|
/* @__PURE__ */ e("strong", { children: "CREATE TABLE" }),
|
|
100
100
|
" migration script will be generated."
|
|
101
101
|
] }),
|
|
102
|
-
(((
|
|
102
|
+
(((E = c.addedColumns) == null ? void 0 : E.length) > 0 || ((v = c.removedColumns) == null ? void 0 : v.length) > 0 || ((R = c.typeChangedColumns) == null ? void 0 : R.length) > 0 || c.primaryKeyChange) && u !== "NEW_TABLE" && /* @__PURE__ */ r(Ce, { severity: "warning", sx: { mb: 1.5, py: 0.5 }, children: [
|
|
103
103
|
"SQLite does not support all ALTER TABLE operations. A",
|
|
104
104
|
" ",
|
|
105
105
|
/* @__PURE__ */ e("strong", { children: "rebuild migration" }),
|
|
106
106
|
" (dummy table copy) will be generated."
|
|
107
107
|
] }),
|
|
108
|
-
(((O =
|
|
108
|
+
(((O = c.addedColumns) == null ? void 0 : O.length) > 0 || (($ = c.removedColumns) == null ? void 0 : $.length) > 0 || ((_ = c.typeChangedColumns) == null ? void 0 : _.length) > 0) && /* @__PURE__ */ e(
|
|
109
109
|
ke,
|
|
110
110
|
{
|
|
111
111
|
sx: {
|
|
@@ -115,13 +115,13 @@ function _e({ item: d }) {
|
|
|
115
115
|
borderRadius: 1
|
|
116
116
|
},
|
|
117
117
|
children: /* @__PURE__ */ r(Oe, { size: "small", children: [
|
|
118
|
-
/* @__PURE__ */ e(
|
|
118
|
+
/* @__PURE__ */ e(Me, { children: /* @__PURE__ */ r(K, { sx: { backgroundColor: "action.hover" }, children: [
|
|
119
119
|
/* @__PURE__ */ e(y, { sx: { fontWeight: 700, fontSize: "0.75rem" }, children: "Column" }),
|
|
120
120
|
/* @__PURE__ */ e(y, { sx: { fontWeight: 700, fontSize: "0.75rem" }, children: "Type" }),
|
|
121
121
|
/* @__PURE__ */ e(y, { sx: { fontWeight: 700, fontSize: "0.75rem" }, children: "Change" })
|
|
122
122
|
] }) }),
|
|
123
|
-
/* @__PURE__ */ r(
|
|
124
|
-
(
|
|
123
|
+
/* @__PURE__ */ r(ze, { children: [
|
|
124
|
+
(c.addedColumns || []).map((l) => /* @__PURE__ */ r(
|
|
125
125
|
K,
|
|
126
126
|
{
|
|
127
127
|
sx: { backgroundColor: "rgba(76,175,80,0.08)" },
|
|
@@ -139,7 +139,7 @@ function _e({ item: d }) {
|
|
|
139
139
|
},
|
|
140
140
|
`add-${l.name}`
|
|
141
141
|
)),
|
|
142
|
-
(
|
|
142
|
+
(c.removedColumns || []).map((l) => /* @__PURE__ */ r(
|
|
143
143
|
K,
|
|
144
144
|
{
|
|
145
145
|
sx: { backgroundColor: "rgba(244,67,54,0.08)" },
|
|
@@ -172,7 +172,7 @@ function _e({ item: d }) {
|
|
|
172
172
|
},
|
|
173
173
|
`rem-${l.name}`
|
|
174
174
|
)),
|
|
175
|
-
(
|
|
175
|
+
(c.typeChangedColumns || []).map((l) => /* @__PURE__ */ r(
|
|
176
176
|
K,
|
|
177
177
|
{
|
|
178
178
|
sx: { backgroundColor: "rgba(255,152,0,0.08)" },
|
|
@@ -207,7 +207,7 @@ function _e({ item: d }) {
|
|
|
207
207
|
] })
|
|
208
208
|
}
|
|
209
209
|
),
|
|
210
|
-
|
|
210
|
+
c.primaryKeyChange && /* @__PURE__ */ r(
|
|
211
211
|
x,
|
|
212
212
|
{
|
|
213
213
|
sx: {
|
|
@@ -228,14 +228,14 @@ function _e({ item: d }) {
|
|
|
228
228
|
}
|
|
229
229
|
),
|
|
230
230
|
/* @__PURE__ */ r(C, { variant: "caption", sx: { ml: 1 }, children: [
|
|
231
|
-
/* @__PURE__ */ e("code", { children:
|
|
231
|
+
/* @__PURE__ */ e("code", { children: c.primaryKeyChange.from }),
|
|
232
232
|
" → ",
|
|
233
|
-
/* @__PURE__ */ e("code", { children:
|
|
233
|
+
/* @__PURE__ */ e("code", { children: c.primaryKeyChange.to })
|
|
234
234
|
] })
|
|
235
235
|
]
|
|
236
236
|
}
|
|
237
237
|
),
|
|
238
|
-
((T =
|
|
238
|
+
((T = c.settingsChanges) == null ? void 0 : T.length) > 0 && /* @__PURE__ */ r(x, { sx: { mb: 1.5 }, children: [
|
|
239
239
|
/* @__PURE__ */ e(
|
|
240
240
|
C,
|
|
241
241
|
{
|
|
@@ -244,7 +244,7 @@ function _e({ item: d }) {
|
|
|
244
244
|
children: "Settings Changes:"
|
|
245
245
|
}
|
|
246
246
|
),
|
|
247
|
-
|
|
247
|
+
c.settingsChanges.map((l, W) => /* @__PURE__ */ r(
|
|
248
248
|
x,
|
|
249
249
|
{
|
|
250
250
|
sx: { display: "flex", alignItems: "center", gap: 1, mb: 0.25 },
|
|
@@ -273,23 +273,23 @@ function _e({ item: d }) {
|
|
|
273
273
|
] });
|
|
274
274
|
}
|
|
275
275
|
function We({
|
|
276
|
-
open:
|
|
277
|
-
onClose:
|
|
278
|
-
summaryData:
|
|
279
|
-
onApply:
|
|
280
|
-
applying:
|
|
276
|
+
open: s,
|
|
277
|
+
onClose: D,
|
|
278
|
+
summaryData: u,
|
|
279
|
+
onApply: c,
|
|
280
|
+
applying: E,
|
|
281
281
|
migrationVersions: v,
|
|
282
282
|
unifiedMigrationScript: R,
|
|
283
283
|
onUnifiedScriptChange: O
|
|
284
284
|
}) {
|
|
285
|
-
const [
|
|
285
|
+
const [$, _] = f(!0), T = u.filter(
|
|
286
286
|
(l) => l.status !== "NO_CHANGES"
|
|
287
287
|
).length;
|
|
288
288
|
return /* @__PURE__ */ r(
|
|
289
289
|
Ae,
|
|
290
290
|
{
|
|
291
|
-
open:
|
|
292
|
-
onClose:
|
|
291
|
+
open: s,
|
|
292
|
+
onClose: D,
|
|
293
293
|
maxWidth: "md",
|
|
294
294
|
fullWidth: !0,
|
|
295
295
|
PaperProps: { sx: { borderRadius: 1.5 } },
|
|
@@ -299,20 +299,20 @@ function We({
|
|
|
299
299
|
/* @__PURE__ */ r(C, { variant: "body2", color: "text.secondary", children: [
|
|
300
300
|
T,
|
|
301
301
|
" table(s) will be affected · ",
|
|
302
|
-
|
|
302
|
+
u.length,
|
|
303
303
|
" total in file"
|
|
304
304
|
] })
|
|
305
305
|
] }),
|
|
306
306
|
/* @__PURE__ */ e(te, {}),
|
|
307
307
|
/* @__PURE__ */ r(Ne, { sx: { p: 0 }, children: [
|
|
308
308
|
/* @__PURE__ */ e(ke, { children: /* @__PURE__ */ r(Oe, { children: [
|
|
309
|
-
/* @__PURE__ */ e(
|
|
309
|
+
/* @__PURE__ */ e(Me, { children: /* @__PURE__ */ r(K, { sx: { backgroundColor: "action.hover" }, children: [
|
|
310
310
|
/* @__PURE__ */ e(y, { sx: { fontWeight: 700, pl: 3 }, children: "Table Name" }),
|
|
311
311
|
/* @__PURE__ */ e(y, { sx: { fontWeight: 700 }, children: "Status" }),
|
|
312
312
|
/* @__PURE__ */ e(y, { sx: { fontWeight: 700 }, children: "Changes" })
|
|
313
313
|
] }) }),
|
|
314
|
-
/* @__PURE__ */ e(
|
|
315
|
-
const W =
|
|
314
|
+
/* @__PURE__ */ e(ze, { children: u.map((l) => {
|
|
315
|
+
const W = we[l.status] || we.NO_CHANGES;
|
|
316
316
|
return /* @__PURE__ */ r(bn.Fragment, { children: [
|
|
317
317
|
/* @__PURE__ */ r(
|
|
318
318
|
K,
|
|
@@ -344,7 +344,7 @@ function We({
|
|
|
344
344
|
}
|
|
345
345
|
) }),
|
|
346
346
|
/* @__PURE__ */ e(y, { children: /* @__PURE__ */ e(
|
|
347
|
-
|
|
347
|
+
$e,
|
|
348
348
|
{
|
|
349
349
|
changes: l.changes,
|
|
350
350
|
status: l.status
|
|
@@ -377,7 +377,7 @@ function We({
|
|
|
377
377
|
R && /* @__PURE__ */ e(x, { sx: { p: 3, borderTop: "1px solid", borderColor: "divider" }, children: /* @__PURE__ */ r(
|
|
378
378
|
pn,
|
|
379
379
|
{
|
|
380
|
-
expanded:
|
|
380
|
+
expanded: $,
|
|
381
381
|
onChange: () => _((l) => !l),
|
|
382
382
|
sx: {
|
|
383
383
|
boxShadow: "none",
|
|
@@ -470,28 +470,28 @@ function We({
|
|
|
470
470
|
) })
|
|
471
471
|
] }),
|
|
472
472
|
/* @__PURE__ */ e(te, {}),
|
|
473
|
-
/* @__PURE__ */ r(
|
|
473
|
+
/* @__PURE__ */ r(De, { sx: { px: 3, py: 2, gap: 1 }, children: [
|
|
474
474
|
/* @__PURE__ */ e(
|
|
475
|
-
|
|
475
|
+
z,
|
|
476
476
|
{
|
|
477
|
-
onClick:
|
|
477
|
+
onClick: D,
|
|
478
478
|
variant: "outlined",
|
|
479
479
|
size: "small",
|
|
480
480
|
sx: { borderRadius: 2, textTransform: "none" },
|
|
481
|
-
disabled:
|
|
481
|
+
disabled: E,
|
|
482
482
|
children: "Cancel"
|
|
483
483
|
}
|
|
484
484
|
),
|
|
485
485
|
/* @__PURE__ */ e(
|
|
486
|
-
|
|
486
|
+
z,
|
|
487
487
|
{
|
|
488
488
|
variant: "contained",
|
|
489
489
|
size: "small",
|
|
490
|
-
disabled: T === 0 ||
|
|
491
|
-
onClick:
|
|
490
|
+
disabled: T === 0 || E,
|
|
491
|
+
onClick: c,
|
|
492
492
|
sx: { borderRadius: 2, textTransform: "none", boxShadow: "none" },
|
|
493
|
-
startIcon:
|
|
494
|
-
children:
|
|
493
|
+
startIcon: E ? null : /* @__PURE__ */ e(I, { iconName: "faCheck" }),
|
|
494
|
+
children: E ? "Applying…" : `Apply Import (${T})`
|
|
495
495
|
}
|
|
496
496
|
)
|
|
497
497
|
] })
|
|
@@ -512,22 +512,22 @@ We.propTypes = {
|
|
|
512
512
|
_e.propTypes = {
|
|
513
513
|
item: b.object
|
|
514
514
|
};
|
|
515
|
-
|
|
515
|
+
$e.propTypes = {
|
|
516
516
|
changes: b.object,
|
|
517
517
|
status: b.string
|
|
518
518
|
};
|
|
519
|
-
const
|
|
519
|
+
const wn = Tn(() => import("./TableDetails-Cf_YfnY2.js"));
|
|
520
520
|
function An({
|
|
521
|
-
tableList:
|
|
522
|
-
tablesInfo:
|
|
523
|
-
allTableList:
|
|
524
|
-
allTablesInfo:
|
|
525
|
-
formSubmitted:
|
|
521
|
+
tableList: s,
|
|
522
|
+
tablesInfo: D,
|
|
523
|
+
allTableList: u,
|
|
524
|
+
allTablesInfo: c,
|
|
525
|
+
formSubmitted: E,
|
|
526
526
|
reloadComponents: v
|
|
527
527
|
}) {
|
|
528
|
-
const [R, O] =
|
|
528
|
+
const [R, O] = f(""), [$, _] = f(""), [T, l] = f({}), [W, Y] = f({}), [L, Be] = f({}), [Fe, V] = f({}), N = s ? s.filter(
|
|
529
529
|
(n) => n.toLowerCase().includes(R.toLowerCase())
|
|
530
|
-
) : [], [Ke,
|
|
530
|
+
) : [], [Ke, j] = f(!1), [Pe, X] = f(!1), [P, Z] = f(), [ae, Q] = f(!1), [Le, ie] = f(!1), [je, le] = f(!1), { translate: se } = sn(), de = En((n) => n.Authenticate.user.id), [m, ce] = f(!1), [w, G] = f(/* @__PURE__ */ new Set()), pe = Sn(null), [Qe, ee] = f(!1), [me, Ge] = f([]), [Ue, H] = f(!1), [He, he] = f({}), [ne, ue] = f("");
|
|
531
531
|
In({
|
|
532
532
|
defaultValues: {
|
|
533
533
|
field1: "",
|
|
@@ -535,208 +535,191 @@ function An({
|
|
|
535
535
|
field3: ""
|
|
536
536
|
}
|
|
537
537
|
}), Ie(() => {
|
|
538
|
-
let n = {},
|
|
539
|
-
_(
|
|
540
|
-
}, [
|
|
541
|
-
Y(() => T[
|
|
542
|
-
}, [T,
|
|
538
|
+
let n = {}, i = {};
|
|
539
|
+
_(s[0]), n = fe(D), l((t) => ({ ...t, ...n })), i = fe(c), Be((t) => ({ ...t, ...i }));
|
|
540
|
+
}, [D, c]), Ie(() => {
|
|
541
|
+
Y(() => T[s[0]]), V(() => L[s[0]]);
|
|
542
|
+
}, [T, L]);
|
|
543
543
|
const Je = (n) => {
|
|
544
|
-
const
|
|
545
|
-
return
|
|
544
|
+
const i = n.toLowerCase();
|
|
545
|
+
return i.includes("int") || i.includes("timestamp") || i === "boolean" || i.includes("serial") || i.includes("date") ? "INTEGER" : (i.includes("char") || i.includes("text") || i.includes("varchar"), "TEXT");
|
|
546
546
|
}, fe = (n) => {
|
|
547
|
-
const
|
|
548
|
-
return n.forEach((
|
|
549
|
-
const o = JSON.parse(
|
|
550
|
-
name:
|
|
551
|
-
type: Je(o[
|
|
552
|
-
})), a =
|
|
553
|
-
t
|
|
547
|
+
const i = {};
|
|
548
|
+
return n.forEach((t) => {
|
|
549
|
+
const o = JSON.parse(t.columnInfo), p = Object.keys(o).map((d) => ({
|
|
550
|
+
name: d,
|
|
551
|
+
type: Je(o[d])
|
|
552
|
+
})), a = t.mediaConfiguration ? JSON.parse(t.mediaConfiguration) : null;
|
|
553
|
+
i[t.tableName] = {
|
|
554
554
|
columnInfo: p,
|
|
555
|
-
modifiedOnQuery:
|
|
556
|
-
primaryKey:
|
|
557
|
-
selectQuery:
|
|
558
|
-
userData:
|
|
559
|
-
hasMedia:
|
|
555
|
+
modifiedOnQuery: t.modifiedOnQuery ? t.modifiedOnQuery : null,
|
|
556
|
+
primaryKey: t.primaryKey ? t.primaryKey : null,
|
|
557
|
+
selectQuery: t.selectQuery ? t.selectQuery : null,
|
|
558
|
+
userData: t.userData !== void 0 ? t.userData : null,
|
|
559
|
+
hasMedia: t.hasMedia !== void 0 ? t.hasMedia : null,
|
|
560
560
|
mediaConfiguration: a,
|
|
561
|
-
syncByDefault:
|
|
561
|
+
syncByDefault: t.syncByDefault ? t.syncByDefault : !1
|
|
562
562
|
};
|
|
563
|
-
}),
|
|
563
|
+
}), i;
|
|
564
564
|
}, qe = () => {
|
|
565
565
|
Q(!1), X(!0), Z();
|
|
566
566
|
}, Ye = () => {
|
|
567
|
-
|
|
567
|
+
j(!1), Q(!0);
|
|
568
568
|
}, ge = () => {
|
|
569
569
|
X(!1);
|
|
570
570
|
}, Ve = () => {
|
|
571
|
-
if (
|
|
572
|
-
const n = { ...P
|
|
573
|
-
n && (n.columnInfo = []), _(
|
|
571
|
+
if (P) {
|
|
572
|
+
const n = { ...L[P] };
|
|
573
|
+
n && (n.columnInfo = []), _(P), Y(() => n), V(() => L[P]), ie(!0), Q(!1), j(!0);
|
|
574
574
|
}
|
|
575
575
|
X(!1), Z(() => "");
|
|
576
576
|
}, oe = (n) => {
|
|
577
|
-
_(n), Y(() => T[n]), V(() =>
|
|
577
|
+
_(n), Y(() => T[n]), V(() => L[n]), j(!1), Q(!1), ie(!1);
|
|
578
578
|
}, Xe = () => {
|
|
579
|
-
if (
|
|
579
|
+
if (w.size === 0) return;
|
|
580
580
|
const n = {};
|
|
581
|
-
|
|
581
|
+
w.forEach((a) => {
|
|
582
582
|
T[a] && (n[a] = T[a]);
|
|
583
583
|
});
|
|
584
|
-
const
|
|
584
|
+
const i = JSON.stringify(
|
|
585
585
|
{ exportedAt: (/* @__PURE__ */ new Date()).toISOString(), tables: n },
|
|
586
586
|
null,
|
|
587
587
|
2
|
|
588
|
-
),
|
|
588
|
+
), t = new Blob([i], { type: "application/json" }), o = URL.createObjectURL(t), p = document.createElement("a");
|
|
589
589
|
p.href = o, p.download = `db_export_${Date.now()}.json`, p.click(), URL.revokeObjectURL(o), ce(!1), G(/* @__PURE__ */ new Set()), F({
|
|
590
|
-
message: `Exported ${
|
|
590
|
+
message: `Exported ${w.size} table(s) successfully.`,
|
|
591
591
|
type: "success"
|
|
592
592
|
});
|
|
593
|
-
}, Ze = (n,
|
|
594
|
-
const
|
|
593
|
+
}, Ze = (n, i) => {
|
|
594
|
+
const t = i.columnInfo || [];
|
|
595
595
|
let o = `CREATE TABLE ${n} (
|
|
596
596
|
`;
|
|
597
|
-
return o +=
|
|
598
|
-
`),
|
|
599
|
-
CONSTRAINT ${n}_pkey PRIMARY KEY (${
|
|
597
|
+
return o += t.map((p) => ` ${p.name} ${p.type}`).join(`,
|
|
598
|
+
`), i.primaryKey && (o += `,
|
|
599
|
+
CONSTRAINT ${n}_pkey PRIMARY KEY (${i.primaryKey})`), o += `
|
|
600
600
|
);`, o;
|
|
601
|
-
}, ye = (n,
|
|
602
|
-
const o =
|
|
603
|
-
`),
|
|
601
|
+
}, ye = (n, i, t) => {
|
|
602
|
+
const o = t.columnInfo || [], p = i.columnInfo || [], a = new Set(o.map((k) => k.name)), g = p.filter((k) => a.has(k.name)).map((k) => k.name).join(", "), S = t.primaryKey, B = o.map((k) => ` ${k.name} ${k.type}`).join(`,
|
|
603
|
+
`), M = S ? `,
|
|
604
604
|
CONSTRAINT ${n}_dummy_pkey PRIMARY KEY (${S})` : "", re = S ? `,
|
|
605
605
|
CONSTRAINT ${n}_pkey PRIMARY KEY (${S})` : "";
|
|
606
606
|
return [
|
|
607
|
-
"-- Step 1: Create dummy table with new schema",
|
|
608
607
|
`CREATE TABLE ${n}_dummy (
|
|
609
|
-
${B}${
|
|
608
|
+
${B}${M}
|
|
610
609
|
);`,
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
SELECT ${c} FROM ${n};` : "-- (no common columns to copy)",
|
|
614
|
-
"-- Step 3: Drop original table",
|
|
610
|
+
g ? `INSERT INTO ${n}_dummy (${g})
|
|
611
|
+
SELECT ${g} FROM ${n};` : "",
|
|
615
612
|
`DROP TABLE ${n};`,
|
|
616
|
-
"-- Step 4: Recreate original table with new schema",
|
|
617
613
|
`CREATE TABLE ${n} (
|
|
618
614
|
${B}${re}
|
|
619
615
|
);`,
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
|
|
623
|
-
"-- Step 6: Drop dummy table",
|
|
616
|
+
g ? `INSERT INTO ${n} (${g})
|
|
617
|
+
SELECT ${g} FROM ${n}_dummy;` : "",
|
|
624
618
|
`DROP TABLE ${n}_dummy;`
|
|
625
|
-
].join(`
|
|
619
|
+
].filter(Boolean).join(`
|
|
626
620
|
|
|
627
621
|
`);
|
|
628
622
|
}, J = (n) => (n || "").replace(/\s+/g, " ").trim(), en = (n) => {
|
|
629
|
-
const
|
|
630
|
-
return Object.entries(
|
|
631
|
-
const p = T[
|
|
623
|
+
const i = n.tables || {};
|
|
624
|
+
return Object.entries(i).map(([t, o]) => {
|
|
625
|
+
const p = T[t], a = p, d = {
|
|
632
626
|
addedColumns: [],
|
|
633
627
|
removedColumns: [],
|
|
634
628
|
typeChangedColumns: [],
|
|
635
629
|
primaryKeyChange: null,
|
|
636
630
|
settingsChanges: []
|
|
637
631
|
};
|
|
638
|
-
let
|
|
632
|
+
let g = "NO_CHANGES";
|
|
639
633
|
if (!p)
|
|
640
|
-
|
|
634
|
+
g = "NEW_TABLE", d.addedColumns = o.columnInfo || [];
|
|
641
635
|
else {
|
|
642
636
|
const B = new Map(
|
|
643
|
-
(o.columnInfo || []).map((
|
|
644
|
-
),
|
|
645
|
-
(a.columnInfo || []).map((
|
|
637
|
+
(o.columnInfo || []).map((h) => [h.name, h.type])
|
|
638
|
+
), M = new Map(
|
|
639
|
+
(a.columnInfo || []).map((h) => [h.name, h.type])
|
|
646
640
|
);
|
|
647
|
-
if (
|
|
648
|
-
(
|
|
649
|
-
),
|
|
650
|
-
(
|
|
651
|
-
),
|
|
652
|
-
name:
|
|
653
|
-
oldType:
|
|
654
|
-
newType:
|
|
655
|
-
})),
|
|
641
|
+
if (d.addedColumns = (o.columnInfo || []).filter(
|
|
642
|
+
(h) => !M.has(h.name)
|
|
643
|
+
), d.removedColumns = (a.columnInfo || []).filter(
|
|
644
|
+
(h) => !B.has(h.name)
|
|
645
|
+
), d.typeChangedColumns = (o.columnInfo || []).filter((h) => M.has(h.name) && M.get(h.name) !== h.type).map((h) => ({
|
|
646
|
+
name: h.name,
|
|
647
|
+
oldType: M.get(h.name),
|
|
648
|
+
newType: h.type
|
|
649
|
+
})), d.primaryKeyChange = o.primaryKey !== a.primaryKey ? {
|
|
656
650
|
from: a.primaryKey || "(none)",
|
|
657
651
|
to: o.primaryKey || "(none)"
|
|
658
652
|
} : null, p) {
|
|
659
|
-
const
|
|
653
|
+
const h = [];
|
|
660
654
|
[
|
|
661
655
|
["syncByDefault", "Sync by Default"],
|
|
662
656
|
["userData", "User Data"],
|
|
663
657
|
["hasMedia", "Has Media"]
|
|
664
658
|
].forEach(([q, an]) => {
|
|
665
|
-
String(o[q]) !== String(p[q]) &&
|
|
659
|
+
String(o[q]) !== String(p[q]) && h.push({
|
|
666
660
|
field: an,
|
|
667
661
|
from: p[q],
|
|
668
662
|
to: o[q]
|
|
669
663
|
});
|
|
670
|
-
}), J(o.modifiedOnQuery) !== J(p.modifiedOnQuery) &&
|
|
664
|
+
}), J(o.modifiedOnQuery) !== J(p.modifiedOnQuery) && h.push({
|
|
671
665
|
field: "Modified On Query",
|
|
672
666
|
from: "(changed)",
|
|
673
667
|
to: "(changed)"
|
|
674
|
-
}), J(o.selectQuery) !== J(p.selectQuery) &&
|
|
668
|
+
}), J(o.selectQuery) !== J(p.selectQuery) && h.push({
|
|
675
669
|
field: "Data Fetch Query",
|
|
676
670
|
from: "(changed)",
|
|
677
671
|
to: "(changed)"
|
|
678
|
-
}),
|
|
672
|
+
}), d.settingsChanges = h;
|
|
679
673
|
}
|
|
680
|
-
const re =
|
|
681
|
-
|
|
674
|
+
const re = d.addedColumns.length > 0 || d.removedColumns.length > 0 || d.typeChangedColumns.length > 0 || d.primaryKeyChange, k = d.settingsChanges.length > 0;
|
|
675
|
+
g = re || k ? "MODIFIED" : "NO_CHANGES";
|
|
682
676
|
}
|
|
683
677
|
let S = "";
|
|
684
|
-
return
|
|
685
|
-
|
|
678
|
+
return g === "NEW_TABLE" ? S = Ze(t, o) : g !== "NO_CHANGES" && (d.addedColumns.length > 0 || d.removedColumns.length > 0 || d.typeChangedColumns.length > 0 || d.primaryKeyChange) && (S = ye(
|
|
679
|
+
t,
|
|
686
680
|
a,
|
|
687
681
|
o
|
|
688
682
|
)), {
|
|
689
|
-
tableName:
|
|
690
|
-
status:
|
|
691
|
-
changes:
|
|
683
|
+
tableName: t,
|
|
684
|
+
status: g,
|
|
685
|
+
changes: d,
|
|
692
686
|
importedTable: o,
|
|
693
687
|
existingTable: a,
|
|
694
688
|
migrationScript: S
|
|
695
689
|
};
|
|
696
690
|
});
|
|
697
691
|
}, nn = (n) => {
|
|
698
|
-
let
|
|
692
|
+
let i = "";
|
|
699
693
|
return n.filter((o) => o.status !== "NO_CHANGES").forEach((o) => {
|
|
700
|
-
|
|
701
|
-
o.migrationScript && (t += `-- ==================================================
|
|
702
|
-
`, t += `-- Table: ${o.tableName}
|
|
703
|
-
`, o.status === "NEW_TABLE" ? t += `-- Changes: New Table
|
|
704
|
-
` : (t += `-- Changes:
|
|
705
|
-
`, (p = o.changes.addedColumns) != null && p.length && (t += `-- Added: ${o.changes.addedColumns.map((c) => c.name).join(", ")}
|
|
706
|
-
`), (a = o.changes.removedColumns) != null && a.length && (t += `-- Removed: ${o.changes.removedColumns.map((c) => c.name).join(", ")}
|
|
707
|
-
`), (s = o.changes.typeChangedColumns) != null && s.length && (t += `-- Modified types: ${o.changes.typeChangedColumns.map((c) => `${c.name} (${c.oldType} -> ${c.newType})`).join(", ")}
|
|
708
|
-
`), o.changes.primaryKeyChange && (t += `-- Primary Key Changed
|
|
709
|
-
`)), t += `-- ==================================================
|
|
710
|
-
|
|
711
|
-
`, t += o.migrationScript.trim() + `
|
|
694
|
+
o.migrationScript && (i += o.migrationScript.trim() + `
|
|
712
695
|
|
|
713
696
|
`);
|
|
714
|
-
}),
|
|
697
|
+
}), i;
|
|
715
698
|
}, on = (n) => {
|
|
716
699
|
var o;
|
|
717
|
-
const
|
|
718
|
-
if (!
|
|
719
|
-
const
|
|
720
|
-
|
|
700
|
+
const i = (o = n.target.files) == null ? void 0 : o[0];
|
|
701
|
+
if (!i) return;
|
|
702
|
+
const t = new FileReader();
|
|
703
|
+
t.onload = (p) => {
|
|
721
704
|
try {
|
|
722
705
|
const a = JSON.parse(p.target.result);
|
|
723
706
|
if (!a.tables)
|
|
724
707
|
throw new Error("Invalid format: missing 'tables' key.");
|
|
725
|
-
const
|
|
726
|
-
Ge(
|
|
727
|
-
const
|
|
728
|
-
ue(
|
|
729
|
-
var B,
|
|
730
|
-
he(((
|
|
708
|
+
const d = en(a);
|
|
709
|
+
Ge(d);
|
|
710
|
+
const g = nn(d);
|
|
711
|
+
ue(g), xe({ code: "MFA_MIGRATION_MASTER_GET_LATEST_VERSIONS" }).then((S) => {
|
|
712
|
+
var B, M;
|
|
713
|
+
he(((M = (B = S == null ? void 0 : S.data) == null ? void 0 : B.result) == null ? void 0 : M[0]) || {});
|
|
731
714
|
}).catch(() => he({})), ee(!0);
|
|
732
715
|
} catch (a) {
|
|
733
716
|
F({ message: `Import failed: ${a.message}`, type: "error" });
|
|
734
717
|
}
|
|
735
|
-
},
|
|
718
|
+
}, t.readAsText(i), n.target.value = "";
|
|
736
719
|
}, rn = (n) => {
|
|
737
720
|
ue(n);
|
|
738
721
|
}, tn = async () => {
|
|
739
|
-
var
|
|
722
|
+
var t;
|
|
740
723
|
const n = me.filter(
|
|
741
724
|
(o) => o.status !== "NO_CHANGES"
|
|
742
725
|
);
|
|
@@ -745,16 +728,16 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
|
|
|
745
728
|
return;
|
|
746
729
|
}
|
|
747
730
|
H(!0);
|
|
748
|
-
const
|
|
749
|
-
const a = o.importedTable,
|
|
750
|
-
return (a.columnInfo || []).forEach((
|
|
751
|
-
|
|
731
|
+
const i = n.map((o, p) => {
|
|
732
|
+
const a = o.importedTable, d = {};
|
|
733
|
+
return (a.columnInfo || []).forEach((g) => {
|
|
734
|
+
d[g.name] = g.type;
|
|
752
735
|
}), {
|
|
753
736
|
code: "update_mobile_entity",
|
|
754
737
|
parameters: {
|
|
755
738
|
tableName: o.tableName || "",
|
|
756
739
|
syncByDefault: !!a.syncByDefault,
|
|
757
|
-
columnInfo: JSON.stringify(
|
|
740
|
+
columnInfo: JSON.stringify(d) || "",
|
|
758
741
|
primaryKey: a.primaryKey || "",
|
|
759
742
|
modifiedOnQuery: a.modifiedOnQuery || "",
|
|
760
743
|
selectQuery: a.selectQuery || "",
|
|
@@ -768,11 +751,11 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
|
|
|
768
751
|
};
|
|
769
752
|
});
|
|
770
753
|
try {
|
|
771
|
-
const o = (await dn(
|
|
754
|
+
const o = (await dn(i)).data;
|
|
772
755
|
if (o == null ? void 0 : o.some((a) => a.status === 0)) {
|
|
773
|
-
const a = o.findIndex((S) => S.status === 0),
|
|
756
|
+
const a = o.findIndex((S) => S.status === 0), d = n[a], g = ((t = o[a]) == null ? void 0 : t.message) || "Unknown error";
|
|
774
757
|
F({
|
|
775
|
-
message: `Failed to save ${
|
|
758
|
+
message: `Failed to save ${d.tableName}: ${g}`,
|
|
776
759
|
type: "error"
|
|
777
760
|
}), H(!1);
|
|
778
761
|
return;
|
|
@@ -860,42 +843,42 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
|
|
|
860
843
|
/* @__PURE__ */ e(
|
|
861
844
|
U,
|
|
862
845
|
{
|
|
863
|
-
title:
|
|
846
|
+
title: m ? "Cancel export mode" : "Export selected tables as JSON",
|
|
864
847
|
arrow: !0,
|
|
865
848
|
children: /* @__PURE__ */ e(
|
|
866
|
-
|
|
849
|
+
z,
|
|
867
850
|
{
|
|
868
|
-
variant:
|
|
851
|
+
variant: m ? "contained" : "outlined",
|
|
869
852
|
size: "small",
|
|
870
|
-
color:
|
|
853
|
+
color: m ? "warning" : "inherit",
|
|
871
854
|
sx: {
|
|
872
855
|
borderRadius: 2,
|
|
873
856
|
fontWeight: 600,
|
|
874
857
|
px: 2,
|
|
875
858
|
textTransform: "none",
|
|
876
859
|
borderColor: "divider",
|
|
877
|
-
color:
|
|
860
|
+
color: m ? "white" : "text.primary",
|
|
878
861
|
"&:hover": {
|
|
879
|
-
backgroundColor:
|
|
862
|
+
backgroundColor: m ? "warning.dark" : "action.hover",
|
|
880
863
|
borderColor: "text.disabled"
|
|
881
864
|
}
|
|
882
865
|
},
|
|
883
866
|
startIcon: /* @__PURE__ */ e(
|
|
884
867
|
I,
|
|
885
868
|
{
|
|
886
|
-
iconName:
|
|
869
|
+
iconName: m ? "faXmark" : "faFileExport"
|
|
887
870
|
}
|
|
888
871
|
),
|
|
889
872
|
onClick: () => {
|
|
890
873
|
ce((n) => !n), G(/* @__PURE__ */ new Set());
|
|
891
874
|
},
|
|
892
|
-
children:
|
|
875
|
+
children: m ? "Cancel Export" : "Export"
|
|
893
876
|
}
|
|
894
877
|
)
|
|
895
878
|
}
|
|
896
879
|
),
|
|
897
880
|
/* @__PURE__ */ e(U, { title: "Import table configuration from JSON", arrow: !0, children: /* @__PURE__ */ e(
|
|
898
|
-
|
|
881
|
+
z,
|
|
899
882
|
{
|
|
900
883
|
variant: "outlined",
|
|
901
884
|
size: "small",
|
|
@@ -920,7 +903,7 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
|
|
|
920
903
|
}
|
|
921
904
|
) }),
|
|
922
905
|
/* @__PURE__ */ e(
|
|
923
|
-
|
|
906
|
+
z,
|
|
924
907
|
{
|
|
925
908
|
variant: "outlined",
|
|
926
909
|
size: "small",
|
|
@@ -942,7 +925,7 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
|
|
|
942
925
|
}
|
|
943
926
|
),
|
|
944
927
|
/* @__PURE__ */ e(
|
|
945
|
-
|
|
928
|
+
z,
|
|
946
929
|
{
|
|
947
930
|
size: "small",
|
|
948
931
|
variant: "contained",
|
|
@@ -984,7 +967,7 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
|
|
|
984
967
|
/* @__PURE__ */ e(
|
|
985
968
|
A,
|
|
986
969
|
{
|
|
987
|
-
label: `${(
|
|
970
|
+
label: `${(s == null ? void 0 : s.length) || 0} Synced`,
|
|
988
971
|
size: "small",
|
|
989
972
|
color: "primary",
|
|
990
973
|
variant: "filled",
|
|
@@ -994,7 +977,7 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
|
|
|
994
977
|
/* @__PURE__ */ e(
|
|
995
978
|
A,
|
|
996
979
|
{
|
|
997
|
-
label: `${(
|
|
980
|
+
label: `${(u == null ? void 0 : u.length) || 0} Total`,
|
|
998
981
|
size: "small",
|
|
999
982
|
variant: "outlined",
|
|
1000
983
|
sx: {
|
|
@@ -1028,8 +1011,8 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
|
|
|
1028
1011
|
)
|
|
1029
1012
|
] }),
|
|
1030
1013
|
/* @__PURE__ */ e(te, { sx: { my: 3 } }),
|
|
1031
|
-
/* @__PURE__ */ r(
|
|
1032
|
-
/* @__PURE__ */ e(
|
|
1014
|
+
/* @__PURE__ */ r(Ee, { container: !0, spacing: 2.5, children: [
|
|
1015
|
+
/* @__PURE__ */ e(Ee, { size: 3, children: /* @__PURE__ */ r(
|
|
1033
1016
|
be,
|
|
1034
1017
|
{
|
|
1035
1018
|
variant: "outlined",
|
|
@@ -1047,9 +1030,9 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
|
|
|
1047
1030
|
sx: {
|
|
1048
1031
|
px: 2,
|
|
1049
1032
|
py: 1.5,
|
|
1050
|
-
backgroundColor:
|
|
1033
|
+
backgroundColor: m ? "warning.50" : "action.hover",
|
|
1051
1034
|
borderBottom: "1px solid",
|
|
1052
|
-
borderColor:
|
|
1035
|
+
borderColor: m ? "warning.300" : "divider",
|
|
1053
1036
|
transition: "background-color 0.2s"
|
|
1054
1037
|
},
|
|
1055
1038
|
children: [
|
|
@@ -1068,22 +1051,22 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
|
|
|
1068
1051
|
variant: "subtitle2",
|
|
1069
1052
|
sx: {
|
|
1070
1053
|
fontWeight: 700,
|
|
1071
|
-
color:
|
|
1054
|
+
color: m ? "warning.dark" : "text.primary"
|
|
1072
1055
|
},
|
|
1073
|
-
children:
|
|
1056
|
+
children: m ? "Select Tables to Export" : se("Synced Tables")
|
|
1074
1057
|
}
|
|
1075
1058
|
),
|
|
1076
|
-
|
|
1059
|
+
m && /* @__PURE__ */ e(
|
|
1077
1060
|
U,
|
|
1078
1061
|
{
|
|
1079
|
-
title:
|
|
1062
|
+
title: w.size === N.length ? "Deselect all" : "Select all",
|
|
1080
1063
|
arrow: !0,
|
|
1081
1064
|
children: /* @__PURE__ */ e(
|
|
1082
1065
|
ve,
|
|
1083
1066
|
{
|
|
1084
1067
|
size: "small",
|
|
1085
|
-
checked: N.length > 0 &&
|
|
1086
|
-
indeterminate:
|
|
1068
|
+
checked: N.length > 0 && w.size === N.length,
|
|
1069
|
+
indeterminate: w.size > 0 && w.size < N.length,
|
|
1087
1070
|
onChange: (n) => {
|
|
1088
1071
|
n.target.checked ? G(new Set(N)) : G(/* @__PURE__ */ new Set());
|
|
1089
1072
|
},
|
|
@@ -1099,26 +1082,26 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
|
|
|
1099
1082
|
C,
|
|
1100
1083
|
{
|
|
1101
1084
|
variant: "caption",
|
|
1102
|
-
color:
|
|
1103
|
-
children:
|
|
1085
|
+
color: m ? "warning.dark" : "text.secondary",
|
|
1086
|
+
children: m ? `${w.size} of ${N.length} selected` : `${N.length} of ${(s == null ? void 0 : s.length) || 0} tables`
|
|
1104
1087
|
}
|
|
1105
1088
|
)
|
|
1106
1089
|
]
|
|
1107
1090
|
}
|
|
1108
1091
|
),
|
|
1109
|
-
/* @__PURE__ */ e(x, { sx: { overflowY: "auto", flex: 1 }, children: N.length ? /* @__PURE__ */ e(fn, { disablePadding: !0, children: N.map((n,
|
|
1110
|
-
const
|
|
1092
|
+
/* @__PURE__ */ e(x, { sx: { overflowY: "auto", flex: 1 }, children: N.length ? /* @__PURE__ */ e(fn, { disablePadding: !0, children: N.map((n, i) => {
|
|
1093
|
+
const t = $ === n;
|
|
1111
1094
|
return /* @__PURE__ */ e(
|
|
1112
1095
|
gn,
|
|
1113
1096
|
{
|
|
1114
1097
|
disablePadding: !0,
|
|
1115
|
-
secondaryAction: !
|
|
1098
|
+
secondaryAction: !m && /* @__PURE__ */ r(
|
|
1116
1099
|
x,
|
|
1117
1100
|
{
|
|
1118
1101
|
sx: {
|
|
1119
1102
|
display: "flex",
|
|
1120
1103
|
gap: 0.25,
|
|
1121
|
-
opacity:
|
|
1104
|
+
opacity: t ? 1 : 0,
|
|
1122
1105
|
transition: "opacity 0.2s"
|
|
1123
1106
|
},
|
|
1124
1107
|
children: [
|
|
@@ -1133,7 +1116,7 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
|
|
|
1133
1116
|
{
|
|
1134
1117
|
size: "small",
|
|
1135
1118
|
onClick: (o) => {
|
|
1136
|
-
o.stopPropagation(), oe(n),
|
|
1119
|
+
o.stopPropagation(), oe(n), j(!0);
|
|
1137
1120
|
},
|
|
1138
1121
|
sx: {
|
|
1139
1122
|
color: "primary.main",
|
|
@@ -1186,17 +1169,17 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
|
|
|
1186
1169
|
}
|
|
1187
1170
|
),
|
|
1188
1171
|
sx: {
|
|
1189
|
-
borderBottom:
|
|
1172
|
+
borderBottom: i === N.length - 1 ? "none" : "1px solid",
|
|
1190
1173
|
borderColor: "divider",
|
|
1191
1174
|
"&:hover .MuiBox-root": { opacity: "1 !important" }
|
|
1192
1175
|
},
|
|
1193
1176
|
children: /* @__PURE__ */ r(
|
|
1194
1177
|
yn,
|
|
1195
1178
|
{
|
|
1196
|
-
selected:
|
|
1179
|
+
selected: t && !m,
|
|
1197
1180
|
onClick: () => {
|
|
1198
|
-
if (
|
|
1199
|
-
const o = new Set(
|
|
1181
|
+
if (m) {
|
|
1182
|
+
const o = new Set(w);
|
|
1200
1183
|
o.has(n) ? o.delete(n) : o.add(n), G(o);
|
|
1201
1184
|
} else
|
|
1202
1185
|
oe(n);
|
|
@@ -1205,7 +1188,7 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
|
|
|
1205
1188
|
py: 1,
|
|
1206
1189
|
px: 2,
|
|
1207
1190
|
transition: "all 0.15s ease",
|
|
1208
|
-
...
|
|
1191
|
+
...m ? {} : {
|
|
1209
1192
|
"&.Mui-selected": {
|
|
1210
1193
|
backgroundColor: "primary.50",
|
|
1211
1194
|
borderLeft: "3px solid",
|
|
@@ -1220,11 +1203,11 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
|
|
|
1220
1203
|
}
|
|
1221
1204
|
},
|
|
1222
1205
|
children: [
|
|
1223
|
-
|
|
1206
|
+
m && /* @__PURE__ */ e(
|
|
1224
1207
|
ve,
|
|
1225
1208
|
{
|
|
1226
1209
|
size: "small",
|
|
1227
|
-
checked:
|
|
1210
|
+
checked: w.has(n),
|
|
1228
1211
|
disableRipple: !0,
|
|
1229
1212
|
sx: { p: 0, mr: 1.5 }
|
|
1230
1213
|
}
|
|
@@ -1237,8 +1220,8 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
|
|
|
1237
1220
|
{
|
|
1238
1221
|
variant: "body2",
|
|
1239
1222
|
sx: {
|
|
1240
|
-
fontWeight:
|
|
1241
|
-
color:
|
|
1223
|
+
fontWeight: t && !m ? 600 : 400,
|
|
1224
|
+
color: t && !m ? "primary.dark" : "text.primary",
|
|
1242
1225
|
fontSize: "0.82rem",
|
|
1243
1226
|
overflow: "hidden",
|
|
1244
1227
|
textOverflow: "ellipsis",
|
|
@@ -1254,7 +1237,7 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
|
|
|
1254
1237
|
}
|
|
1255
1238
|
)
|
|
1256
1239
|
},
|
|
1257
|
-
|
|
1240
|
+
i + 1
|
|
1258
1241
|
);
|
|
1259
1242
|
}) }) : /* @__PURE__ */ r(x, { sx: { p: 3, textAlign: "center" }, children: [
|
|
1260
1243
|
/* @__PURE__ */ e(
|
|
@@ -1270,11 +1253,11 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
|
|
|
1270
1253
|
variant: "body2",
|
|
1271
1254
|
color: "text.secondary",
|
|
1272
1255
|
sx: { mt: 1 },
|
|
1273
|
-
children:
|
|
1256
|
+
children: s.length < 1 ? "No tables synced" : "No tables match your search."
|
|
1274
1257
|
}
|
|
1275
1258
|
)
|
|
1276
1259
|
] }) }),
|
|
1277
|
-
|
|
1260
|
+
m && /* @__PURE__ */ r(
|
|
1278
1261
|
x,
|
|
1279
1262
|
{
|
|
1280
1263
|
sx: {
|
|
@@ -1288,16 +1271,16 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
|
|
|
1288
1271
|
},
|
|
1289
1272
|
children: [
|
|
1290
1273
|
/* @__PURE__ */ r(C, { variant: "body2", sx: { fontWeight: 600 }, children: [
|
|
1291
|
-
|
|
1274
|
+
w.size,
|
|
1292
1275
|
" selected"
|
|
1293
1276
|
] }),
|
|
1294
1277
|
/* @__PURE__ */ e(
|
|
1295
|
-
|
|
1278
|
+
z,
|
|
1296
1279
|
{
|
|
1297
1280
|
variant: "contained",
|
|
1298
1281
|
size: "small",
|
|
1299
1282
|
color: "primary",
|
|
1300
|
-
disabled:
|
|
1283
|
+
disabled: w.size === 0,
|
|
1301
1284
|
onClick: Xe,
|
|
1302
1285
|
startIcon: /* @__PURE__ */ e(I, { iconName: "faDownload" }),
|
|
1303
1286
|
sx: {
|
|
@@ -1314,20 +1297,20 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
|
|
|
1314
1297
|
]
|
|
1315
1298
|
}
|
|
1316
1299
|
) }),
|
|
1317
|
-
/* @__PURE__ */ e(vn, { children: (
|
|
1318
|
-
|
|
1300
|
+
/* @__PURE__ */ e(vn, { children: (!!$ && !!W || ae) && /* @__PURE__ */ e(
|
|
1301
|
+
wn,
|
|
1319
1302
|
{
|
|
1320
1303
|
tableInfo: W,
|
|
1321
|
-
table:
|
|
1304
|
+
table: $,
|
|
1322
1305
|
isEditMode: Ke,
|
|
1323
|
-
updateEditMode:
|
|
1306
|
+
updateEditMode: j,
|
|
1324
1307
|
tableCompleteInfo: Fe,
|
|
1325
|
-
formSubmitted:
|
|
1308
|
+
formSubmitted: E,
|
|
1326
1309
|
reloadComponents: v,
|
|
1327
1310
|
isCreateTableMode: ae,
|
|
1328
|
-
isSyncTableMode:
|
|
1311
|
+
isSyncTableMode: Le,
|
|
1329
1312
|
updateCreateTableMode: Q,
|
|
1330
|
-
openDeleteModal:
|
|
1313
|
+
openDeleteModal: je,
|
|
1331
1314
|
setOpenDeleteModal: le,
|
|
1332
1315
|
generateRebuildScript: ye
|
|
1333
1316
|
}
|
|
@@ -1339,7 +1322,7 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
|
|
|
1339
1322
|
/* @__PURE__ */ r(
|
|
1340
1323
|
Ae,
|
|
1341
1324
|
{
|
|
1342
|
-
open:
|
|
1325
|
+
open: Pe,
|
|
1343
1326
|
onClose: ge,
|
|
1344
1327
|
maxWidth: "sm",
|
|
1345
1328
|
fullWidth: !0,
|
|
@@ -1354,10 +1337,10 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
|
|
|
1354
1337
|
/* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(
|
|
1355
1338
|
Cn,
|
|
1356
1339
|
{
|
|
1357
|
-
options:
|
|
1340
|
+
options: u.filter((n) => !s.includes(n)),
|
|
1358
1341
|
getOptionLabel: (n) => n,
|
|
1359
|
-
value:
|
|
1360
|
-
onChange: (n,
|
|
1342
|
+
value: P,
|
|
1343
|
+
onChange: (n, i) => Z(i),
|
|
1361
1344
|
renderInput: (n) => /* @__PURE__ */ e(
|
|
1362
1345
|
Se,
|
|
1363
1346
|
{
|
|
@@ -1370,9 +1353,9 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
|
|
|
1370
1353
|
)
|
|
1371
1354
|
}
|
|
1372
1355
|
) }),
|
|
1373
|
-
/* @__PURE__ */ r(
|
|
1356
|
+
/* @__PURE__ */ r(De, { sx: { px: 3, pb: 2 }, children: [
|
|
1374
1357
|
/* @__PURE__ */ e(
|
|
1375
|
-
|
|
1358
|
+
z,
|
|
1376
1359
|
{
|
|
1377
1360
|
onClick: ge,
|
|
1378
1361
|
variant: "outlined",
|
|
@@ -1382,12 +1365,12 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
|
|
|
1382
1365
|
}
|
|
1383
1366
|
),
|
|
1384
1367
|
/* @__PURE__ */ e(
|
|
1385
|
-
|
|
1368
|
+
z,
|
|
1386
1369
|
{
|
|
1387
1370
|
variant: "contained",
|
|
1388
1371
|
size: "small",
|
|
1389
1372
|
onClick: () => Ve(),
|
|
1390
|
-
disabled: !
|
|
1373
|
+
disabled: !P,
|
|
1391
1374
|
sx: { borderRadius: 2, textTransform: "none", boxShadow: "none" },
|
|
1392
1375
|
children: "Sync Table"
|
|
1393
1376
|
}
|
|
@@ -1422,4 +1405,4 @@ An.propTypes = {
|
|
|
1422
1405
|
export {
|
|
1423
1406
|
An as default
|
|
1424
1407
|
};
|
|
1425
|
-
//# sourceMappingURL=TableList-
|
|
1408
|
+
//# sourceMappingURL=TableList-D6jnIbnz.js.map
|