@firecms/data_import_export 3.0.0-canary.52 → 3.0.0-canary.54
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/export_import/export.d.ts +12 -1
- package/dist/index.es.js +438 -393
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +16 -16
- package/src/export_import/BasicExportAction.tsx +12 -2
- package/src/export_import/ExportCollectionAction.tsx +32 -3
- package/src/export_import/export.ts +24 -10
package/dist/index.es.js
CHANGED
@@ -1,17 +1,17 @@
|
|
1
|
-
import
|
1
|
+
import b, { useState as N, useRef as He, useEffect as Ne, useCallback as C, useMemo as Ue } from "react";
|
2
2
|
import { jsxs as p, Fragment as M, jsx as i } from "react/jsx-runtime";
|
3
|
-
import { getPropertyInPath as J, mergeDeep as
|
4
|
-
import { Table as
|
5
|
-
import { inferTypeFromValue as
|
6
|
-
import * as
|
7
|
-
import { getIn as
|
8
|
-
const
|
9
|
-
const [e,
|
3
|
+
import { getPropertyInPath as J, mergeDeep as ze, resolveProperty as We, isPropertyBuilder as me, EntityReference as Xe, useSnackbarController as Se, useCustomizationController as q, getFieldConfig as Oe, ErrorBoundary as Ge, PropertyConfigBadge as ke, useDataSource as Ie, resolveCollection as _e, getPropertiesWithPropertiesOrder as Ye, useSelectionController as qe, EntityCollectionTable as Qe, slugify as Ze, getArrayValuesCount as Ke, getValueInPath as et, useFireCMSContext as tt, useNavigationController as rt, getDefaultValuesFor as at } from "@firecms/core";
|
4
|
+
import { Table as fe, TableHeader as he, TableCell as w, TableBody as ge, TableRow as xe, Typography as f, ChevronRightIcon as ye, ExpandablePanel as nt, Select as Ae, SelectItem as H, TextField as re, BooleanSwitchWithLabel as Y, DateTimeField as st, FileUpload as it, UploadIcon as lt, IconButton as Q, EditIcon as ot, CenteredView as be, Button as S, CircularProgress as Ee, Tooltip as Z, FileUploadIcon as ct, Dialog as se, DialogContent as ie, DialogActions as le, cn as _, defaultBorderMixin as dt, GetAppIcon as Te, Alert as pt, focusedMixin as T } from "@firecms/ui";
|
5
|
+
import { inferTypeFromValue as ut, buildEntityPropertiesFromData as mt } from "@firecms/schema_inference";
|
6
|
+
import * as U from "xlsx";
|
7
|
+
import { getIn as Fe, setIn as ft } from "@firecms/formex";
|
8
|
+
const ht = () => {
|
9
|
+
const [e, a] = N(!1), [s, t] = N({}), [r, n] = N(), [l, o] = N([]), [c, d] = N([]), [u, m] = N({}), [h, g] = N([]), [y, A] = N({});
|
10
10
|
return {
|
11
11
|
inUse: e,
|
12
|
-
setInUse:
|
12
|
+
setInUse: a,
|
13
13
|
idColumn: r,
|
14
|
-
setIdColumn:
|
14
|
+
setIdColumn: n,
|
15
15
|
entities: c,
|
16
16
|
setEntities: d,
|
17
17
|
importData: l,
|
@@ -20,34 +20,34 @@ const ut = () => {
|
|
20
20
|
setHeadingsOrder: g,
|
21
21
|
headersMapping: u,
|
22
22
|
setHeadersMapping: m,
|
23
|
-
originProperties:
|
24
|
-
setOriginProperties:
|
23
|
+
originProperties: y,
|
24
|
+
setOriginProperties: A,
|
25
25
|
defaultValues: s,
|
26
26
|
setDefaultValues: t
|
27
27
|
};
|
28
28
|
};
|
29
|
-
function
|
30
|
-
let
|
29
|
+
function gt(e) {
|
30
|
+
let a = 0;
|
31
31
|
const s = [], t = {};
|
32
32
|
if (e == null || e["!ref"] == null)
|
33
33
|
return [];
|
34
34
|
const r = t.range !== void 0 ? t.range : e["!ref"];
|
35
|
-
let
|
36
|
-
switch (t.header === 1 ?
|
35
|
+
let n;
|
36
|
+
switch (t.header === 1 ? a = 1 : t.header === "A" ? a = 2 : Array.isArray(t.header) && (a = 3), typeof r) {
|
37
37
|
case "string":
|
38
|
-
|
38
|
+
n = ve(r);
|
39
39
|
break;
|
40
40
|
case "number":
|
41
|
-
|
41
|
+
n = ve(e["!ref"]), n.s.r = r;
|
42
42
|
break;
|
43
43
|
default:
|
44
|
-
|
44
|
+
n = r;
|
45
45
|
}
|
46
|
-
const l =
|
47
|
-
for (let c =
|
48
|
-
o[c] =
|
46
|
+
const l = U.utils.encode_row(n.s.r), o = new Array(n.e.c - n.s.c + 1);
|
47
|
+
for (let c = n.s.c; c <= n.e.c; ++c) {
|
48
|
+
o[c] = U.utils.encode_col(c);
|
49
49
|
const d = e[o[c] + l];
|
50
|
-
switch (
|
50
|
+
switch (a) {
|
51
51
|
case 1:
|
52
52
|
s.push(c);
|
53
53
|
break;
|
@@ -55,18 +55,18 @@ function mt(e) {
|
|
55
55
|
s.push(o[c]);
|
56
56
|
break;
|
57
57
|
case 3:
|
58
|
-
s.push(t.header[c -
|
58
|
+
s.push(t.header[c - n.s.c]);
|
59
59
|
break;
|
60
60
|
default:
|
61
61
|
if (d === void 0)
|
62
62
|
continue;
|
63
|
-
s.push(
|
63
|
+
s.push(U.utils.format_cell(d));
|
64
64
|
}
|
65
65
|
}
|
66
66
|
return s;
|
67
67
|
}
|
68
|
-
function
|
69
|
-
const
|
68
|
+
function ve(e) {
|
69
|
+
const a = {
|
70
70
|
s: {
|
71
71
|
c: 0,
|
72
72
|
r: 0
|
@@ -77,50 +77,50 @@ function be(e) {
|
|
77
77
|
}
|
78
78
|
};
|
79
79
|
let s = 0, t = 0, r = 0;
|
80
|
-
const
|
81
|
-
for (s = 0; t <
|
80
|
+
const n = e.length;
|
81
|
+
for (s = 0; t < n && !((r = e.charCodeAt(t) - 64) < 1 || r > 26); ++t)
|
82
82
|
s = 26 * s + r;
|
83
|
-
for (
|
83
|
+
for (a.s.c = --s, s = 0; t < n && !((r = e.charCodeAt(t) - 48) < 0 || r > 9); ++t)
|
84
84
|
s = 10 * s + r;
|
85
|
-
if (
|
86
|
-
return
|
87
|
-
for (s = 0; t !==
|
85
|
+
if (a.s.r = --s, t === n || e.charCodeAt(++t) === 58)
|
86
|
+
return a.e.c = a.s.c, a.e.r = a.s.r, a;
|
87
|
+
for (s = 0; t !== n && !((r = e.charCodeAt(t) - 64) < 1 || r > 26); ++t)
|
88
88
|
s = 26 * s + r;
|
89
|
-
for (
|
89
|
+
for (a.e.c = --s, s = 0; t !== n && !((r = e.charCodeAt(t) - 48) < 0 || r > 9); ++t)
|
90
90
|
s = 10 * s + r;
|
91
|
-
return
|
91
|
+
return a.e.r = --s, a;
|
92
92
|
}
|
93
|
-
function
|
94
|
-
return new Promise((
|
93
|
+
function xt(e) {
|
94
|
+
return new Promise((a, s) => {
|
95
95
|
if (e.type === "application/json") {
|
96
96
|
console.debug("Converting JSON file to JSON", e.name);
|
97
97
|
const t = new FileReader();
|
98
98
|
t.onload = function(r) {
|
99
99
|
try {
|
100
|
-
const
|
100
|
+
const n = r.target?.result, l = JSON.parse(n);
|
101
101
|
if (!Array.isArray(l))
|
102
102
|
s(new Error("JSON file should contain an array of objects"));
|
103
103
|
else {
|
104
104
|
const o = l.length > 0 ? Object.keys(l[0]) : [];
|
105
|
-
|
105
|
+
a({
|
106
106
|
data: l,
|
107
107
|
propertiesOrder: o
|
108
108
|
});
|
109
109
|
}
|
110
|
-
} catch (
|
111
|
-
console.error("Error parsing JSON file",
|
110
|
+
} catch (n) {
|
111
|
+
console.error("Error parsing JSON file", n), s(n);
|
112
112
|
}
|
113
113
|
}, t.readAsText(e);
|
114
114
|
} else {
|
115
115
|
console.debug("Converting Excel file to JSON", e.name);
|
116
116
|
const t = new FileReader();
|
117
117
|
t.onload = function(r) {
|
118
|
-
const
|
118
|
+
const n = new Uint8Array(r.target?.result), l = U.read(n, {
|
119
119
|
type: "array",
|
120
120
|
codepage: 65001,
|
121
121
|
cellDates: !0
|
122
|
-
}), o = l.SheetNames[0], c = l.Sheets[o], d =
|
123
|
-
|
122
|
+
}), o = l.SheetNames[0], c = l.Sheets[o], d = U.utils.sheet_to_json(c), u = gt(c), h = d.map(yt).map(je);
|
123
|
+
a({
|
124
124
|
data: h,
|
125
125
|
propertiesOrder: u
|
126
126
|
});
|
@@ -128,71 +128,71 @@ function ft(e) {
|
|
128
128
|
}
|
129
129
|
});
|
130
130
|
}
|
131
|
-
function
|
132
|
-
return Object.keys(e).reduce((
|
131
|
+
function yt(e) {
|
132
|
+
return Object.keys(e).reduce((a, s) => {
|
133
133
|
try {
|
134
|
-
|
134
|
+
a[s] = JSON.parse(e[s]);
|
135
135
|
} catch {
|
136
|
-
|
136
|
+
a[s] = e[s];
|
137
137
|
}
|
138
|
-
return
|
138
|
+
return a;
|
139
139
|
}, {});
|
140
140
|
}
|
141
141
|
function je(e) {
|
142
|
-
return Object.keys(e).reduce((
|
143
|
-
let t =
|
142
|
+
return Object.keys(e).reduce((a, s) => {
|
143
|
+
let t = a;
|
144
144
|
const r = s.split(".");
|
145
|
-
return r.forEach((
|
146
|
-
if (/^[\w]+\[\d+\]$/.test(
|
147
|
-
const o =
|
145
|
+
return r.forEach((n, l) => {
|
146
|
+
if (/^[\w]+\[\d+\]$/.test(n)) {
|
147
|
+
const o = n.slice(0, n.indexOf("[")), c = parseInt(n.slice(n.indexOf("[") + 1, n.indexOf("]")));
|
148
148
|
t[o] || (t[o] = []), l !== r.length - 1 ? (t[o][c] = t[o][c] || {}, t = t[o][c]) : t[o][c] = e[s];
|
149
149
|
} else
|
150
|
-
l !== r.length - 1 ? (t[
|
151
|
-
}),
|
150
|
+
l !== r.length - 1 ? (t[n] = t[n] || {}, t = t[n]) : t[n] = e[s];
|
151
|
+
}), a;
|
152
152
|
}, {});
|
153
153
|
}
|
154
|
-
function
|
155
|
-
const l =
|
156
|
-
|
154
|
+
function bt(e, a, s, t, r, n) {
|
155
|
+
const l = Pe(e);
|
156
|
+
a && delete l[a];
|
157
157
|
const o = Object.entries(l).map(([u, m]) => {
|
158
|
-
const h =
|
158
|
+
const h = Fe(s, u) ?? u, g = J(t, h);
|
159
159
|
if (!g)
|
160
160
|
return {};
|
161
|
-
const
|
161
|
+
const y = ae(m, g);
|
162
162
|
return {
|
163
|
-
[h]:
|
163
|
+
[h]: y
|
164
164
|
};
|
165
|
-
}).reduce((u, m) => ({ ...u, ...m }), {}), c =
|
166
|
-
let d =
|
165
|
+
}).reduce((u, m) => ({ ...u, ...m }), {}), c = ze(n ?? {}, je(o));
|
166
|
+
let d = a ? e[a] : void 0;
|
167
167
|
return typeof d == "string" ? d = d.trim() : typeof d == "number" || typeof d == "boolean" ? d = d.toString() : d instanceof Date ? d = d.toISOString() : d && "toString" in d && (d = d.toString()), {
|
168
168
|
id: d,
|
169
169
|
values: c,
|
170
170
|
path: r
|
171
171
|
};
|
172
172
|
}
|
173
|
-
function
|
173
|
+
function Pe(e, a = "") {
|
174
174
|
return Object.keys(e).reduce((s, t) => {
|
175
|
-
const r =
|
176
|
-
return typeof e[t] == "object" && !(e[t] instanceof Date) && e[t] !== null && !Array.isArray(e[t]) ? Object.assign(s,
|
175
|
+
const r = a ? `${a}.${t}` : t;
|
176
|
+
return typeof e[t] == "object" && !(e[t] instanceof Date) && e[t] !== null && !Array.isArray(e[t]) ? Object.assign(s, Pe(e[t], r)) : s[r] = e[t], s;
|
177
177
|
}, {});
|
178
178
|
}
|
179
|
-
function
|
179
|
+
function ae(e, a) {
|
180
180
|
if (e === null)
|
181
181
|
return null;
|
182
|
-
if (
|
182
|
+
if (a === void 0)
|
183
183
|
return e;
|
184
|
-
const s =
|
185
|
-
propertyOrBuilder:
|
184
|
+
const s = We({
|
185
|
+
propertyOrBuilder: a
|
186
186
|
});
|
187
187
|
if (s === null)
|
188
188
|
return e;
|
189
|
-
const t =
|
190
|
-
if (t === "array" && r === "array" && Array.isArray(e) && s.of && !
|
191
|
-
return e.map((
|
189
|
+
const t = ut(e), r = s.dataType;
|
190
|
+
if (t === "array" && r === "array" && Array.isArray(e) && s.of && !me(s.of))
|
191
|
+
return e.map((n) => ae(n, s.of));
|
192
192
|
if (t === "string" && r === "number" && typeof e == "string")
|
193
193
|
return Number(e);
|
194
|
-
if (t === "string" && r === "array" && typeof e == "string" && s.of && !
|
195
|
-
return e.split(",").map((
|
194
|
+
if (t === "string" && r === "array" && typeof e == "string" && s.of && !me(s.of))
|
195
|
+
return e.split(",").map((n) => ae(n, s.of));
|
196
196
|
if (t === "string" && r === "boolean")
|
197
197
|
return e === "true";
|
198
198
|
if (t === "number" && r === "boolean")
|
@@ -204,7 +204,7 @@ function ne(e, n) {
|
|
204
204
|
if (t === "number" && r === "string" && typeof e == "number")
|
205
205
|
return e.toString();
|
206
206
|
if (t === "string" && r === "array" && typeof e == "string")
|
207
|
-
return e.split(",").map((
|
207
|
+
return e.split(",").map((n) => n.trim());
|
208
208
|
if (t === "string" && r === "date" && typeof e == "string")
|
209
209
|
try {
|
210
210
|
return new Date(e);
|
@@ -221,8 +221,8 @@ function ne(e, n) {
|
|
221
221
|
return e;
|
222
222
|
}
|
223
223
|
else if (t === "string" && r === "reference" && typeof e == "string") {
|
224
|
-
const
|
225
|
-
return new
|
224
|
+
const n = e.split("/").slice(0, -1).join("/"), l = e.split("/").slice(-1)[0];
|
225
|
+
return new Xe(l, n);
|
226
226
|
} else {
|
227
227
|
if (t === r)
|
228
228
|
return e;
|
@@ -232,37 +232,37 @@ function ne(e, n) {
|
|
232
232
|
}
|
233
233
|
return e;
|
234
234
|
}
|
235
|
-
function
|
235
|
+
function vt(e) {
|
236
236
|
return typeof e == "number" ? "number" : typeof e == "string" ? "string" : typeof e == "boolean" ? "boolean" : e instanceof Date ? "date" : Array.isArray(e) ? "array" : "map";
|
237
237
|
}
|
238
|
-
function
|
238
|
+
function Ct({
|
239
239
|
importConfig: e,
|
240
|
-
destinationProperties:
|
240
|
+
destinationProperties: a,
|
241
241
|
buildPropertyView: s
|
242
242
|
}) {
|
243
|
-
const t = e.headersMapping, r = e.headingsOrder,
|
243
|
+
const t = e.headersMapping, r = e.headingsOrder, n = e.idColumn, l = e.originProperties;
|
244
244
|
return /* @__PURE__ */ p(M, { children: [
|
245
245
|
/* @__PURE__ */ i(
|
246
|
-
|
246
|
+
wt,
|
247
247
|
{
|
248
|
-
idColumn:
|
248
|
+
idColumn: n,
|
249
249
|
headersMapping: t,
|
250
250
|
onChange: (o) => e.setIdColumn(o ?? void 0)
|
251
251
|
}
|
252
252
|
),
|
253
253
|
/* @__PURE__ */ i("div", { className: "h-4" }),
|
254
|
-
/* @__PURE__ */ p(
|
254
|
+
/* @__PURE__ */ p(fe, { style: {
|
255
255
|
tableLayout: "fixed"
|
256
256
|
}, children: [
|
257
|
-
/* @__PURE__ */ p(
|
257
|
+
/* @__PURE__ */ p(he, { children: [
|
258
258
|
/* @__PURE__ */ i(w, { header: !0, style: { width: "20%" }, children: "Column in file" }),
|
259
259
|
/* @__PURE__ */ i(w, { header: !0 }),
|
260
260
|
/* @__PURE__ */ i(w, { header: !0, style: { width: "75%" }, children: "Map to Property" })
|
261
261
|
] }),
|
262
|
-
/* @__PURE__ */ i(
|
262
|
+
/* @__PURE__ */ i(ge, { children: a && r.map(
|
263
263
|
(o) => {
|
264
|
-
const c = t[o], d = t[o], u = c ? J(
|
265
|
-
return /* @__PURE__ */ p(
|
264
|
+
const c = t[o], d = t[o], u = c ? J(a, c) : null, m = J(l, o), h = m ? m.dataType === "array" && typeof m.of == "object" ? `${m.dataType} - ${m.of.dataType}` : m.dataType : void 0;
|
265
|
+
return /* @__PURE__ */ p(xe, { style: { height: "90px" }, children: [
|
266
266
|
/* @__PURE__ */ p(w, { style: { width: "20%" }, children: [
|
267
267
|
/* @__PURE__ */ i(f, { variant: "body2", children: o }),
|
268
268
|
m && /* @__PURE__ */ i(
|
@@ -274,14 +274,14 @@ function yt({
|
|
274
274
|
}
|
275
275
|
)
|
276
276
|
] }),
|
277
|
-
/* @__PURE__ */ i(w, { children: /* @__PURE__ */ i(
|
277
|
+
/* @__PURE__ */ i(w, { children: /* @__PURE__ */ i(ye, {}) }),
|
278
278
|
/* @__PURE__ */ i(
|
279
279
|
w,
|
280
280
|
{
|
281
|
-
className: o ===
|
281
|
+
className: o === n ? "text-center" : void 0,
|
282
282
|
style: { width: "75%" },
|
283
283
|
children: s?.({
|
284
|
-
isIdColumn: o ===
|
284
|
+
isIdColumn: o === n,
|
285
285
|
property: u,
|
286
286
|
propertyKey: d,
|
287
287
|
importKey: o
|
@@ -292,34 +292,34 @@ function yt({
|
|
292
292
|
}
|
293
293
|
) })
|
294
294
|
] }),
|
295
|
-
/* @__PURE__ */ p(
|
295
|
+
/* @__PURE__ */ p(nt, { title: "Default values", initiallyExpanded: !1, className: "p-4 mt-4", children: [
|
296
296
|
/* @__PURE__ */ i("div", { className: "text-sm text-slate-500 dark:text-slate-300 font-medium ml-3.5 mb-1", children: "You can select a default value for unmapped columns and empty values:" }),
|
297
|
-
/* @__PURE__ */ p(
|
297
|
+
/* @__PURE__ */ p(fe, { style: {
|
298
298
|
tableLayout: "fixed"
|
299
299
|
}, children: [
|
300
|
-
/* @__PURE__ */ p(
|
300
|
+
/* @__PURE__ */ p(he, { children: [
|
301
301
|
/* @__PURE__ */ i(w, { header: !0, style: { width: "30%" }, children: "Property" }),
|
302
302
|
/* @__PURE__ */ i(w, { header: !0 }),
|
303
303
|
/* @__PURE__ */ i(w, { header: !0, style: { width: "65%" }, children: "Default value" })
|
304
304
|
] }),
|
305
|
-
/* @__PURE__ */ i(
|
305
|
+
/* @__PURE__ */ i(ge, { children: a && Me(a).map(
|
306
306
|
(o) => {
|
307
|
-
const c = J(
|
308
|
-
return typeof c != "object" || c === null || !["number", "string", "boolean", "map"].includes(c.dataType) ? null : /* @__PURE__ */ p(
|
307
|
+
const c = J(a, o);
|
308
|
+
return typeof c != "object" || c === null || !["number", "string", "boolean", "map"].includes(c.dataType) ? null : /* @__PURE__ */ p(xe, { style: { height: "70px" }, children: [
|
309
309
|
/* @__PURE__ */ i(w, { style: { width: "20%" }, children: /* @__PURE__ */ i(f, { variant: "body2", children: o }) }),
|
310
|
-
/* @__PURE__ */ i(w, { children: /* @__PURE__ */ i(
|
310
|
+
/* @__PURE__ */ i(w, { children: /* @__PURE__ */ i(ye, {}) }),
|
311
311
|
/* @__PURE__ */ i(
|
312
312
|
w,
|
313
313
|
{
|
314
|
-
className: o ===
|
314
|
+
className: o === n ? "text-center" : void 0,
|
315
315
|
style: { width: "75%" },
|
316
316
|
children: /* @__PURE__ */ i(
|
317
|
-
|
317
|
+
Dt,
|
318
318
|
{
|
319
319
|
property: c,
|
320
|
-
defaultValue:
|
320
|
+
defaultValue: Fe(e.defaultValues, o),
|
321
321
|
onValueChange: (d) => {
|
322
|
-
const u =
|
322
|
+
const u = ft(e.defaultValues, o, d);
|
323
323
|
e.setDefaultValues(u);
|
324
324
|
}
|
325
325
|
}
|
@@ -333,23 +333,23 @@ function yt({
|
|
333
333
|
] })
|
334
334
|
] });
|
335
335
|
}
|
336
|
-
function
|
336
|
+
function Me(e, a) {
|
337
337
|
return Object.entries(e).reduce((s, [t, r]) => {
|
338
|
-
const
|
338
|
+
const n = a ? `${a}.${t}` : t;
|
339
339
|
if (typeof r != "function" && r.dataType === "map" && r.properties) {
|
340
|
-
const l =
|
340
|
+
const l = Me(r.properties, n);
|
341
341
|
return [...s, ...l];
|
342
342
|
}
|
343
|
-
return [...s,
|
343
|
+
return [...s, n];
|
344
344
|
}, []);
|
345
345
|
}
|
346
|
-
function
|
346
|
+
function wt({
|
347
347
|
idColumn: e,
|
348
|
-
headersMapping:
|
348
|
+
headersMapping: a,
|
349
349
|
onChange: s
|
350
350
|
}) {
|
351
351
|
return /* @__PURE__ */ i("div", { children: /* @__PURE__ */ p(
|
352
|
-
|
352
|
+
Ae,
|
353
353
|
{
|
354
354
|
size: "small",
|
355
355
|
value: e ?? "",
|
@@ -362,14 +362,14 @@ function bt({
|
|
362
362
|
label: "Column that will be used as ID for each document",
|
363
363
|
children: [
|
364
364
|
/* @__PURE__ */ i(H, { value: "__none__", children: "Autogenerate ID" }),
|
365
|
-
Object.entries(
|
365
|
+
Object.entries(a).map(([t, r]) => /* @__PURE__ */ i(H, { value: t, children: t }, t))
|
366
366
|
]
|
367
367
|
}
|
368
368
|
) });
|
369
369
|
}
|
370
|
-
function
|
370
|
+
function Dt({
|
371
371
|
property: e,
|
372
|
-
onValueChange:
|
372
|
+
onValueChange: a,
|
373
373
|
defaultValue: s
|
374
374
|
}) {
|
375
375
|
return e.dataType === "string" ? /* @__PURE__ */ i(
|
@@ -378,7 +378,7 @@ function vt({
|
|
378
378
|
size: "small",
|
379
379
|
placeholder: "Default value",
|
380
380
|
value: s ?? "",
|
381
|
-
onChange: (t) =>
|
381
|
+
onChange: (t) => a(t.target.value)
|
382
382
|
}
|
383
383
|
) : e.dataType === "number" ? /* @__PURE__ */ i(
|
384
384
|
re,
|
@@ -387,34 +387,34 @@ function vt({
|
|
387
387
|
type: "number",
|
388
388
|
value: s ?? "",
|
389
389
|
placeholder: "Default value",
|
390
|
-
onChange: (t) =>
|
390
|
+
onChange: (t) => a(t.target.value)
|
391
391
|
}
|
392
392
|
) : e.dataType === "boolean" ? /* @__PURE__ */ i(
|
393
|
-
|
393
|
+
Y,
|
394
394
|
{
|
395
395
|
value: s ?? null,
|
396
396
|
allowIndeterminate: !0,
|
397
397
|
size: "small",
|
398
|
-
onValueChange: (t) =>
|
398
|
+
onValueChange: (t) => a(t === null ? void 0 : t),
|
399
399
|
label: s === void 0 ? "Do not set value" : s === !0 ? "Set value to true" : "Set value to false"
|
400
400
|
}
|
401
401
|
) : e.dataType === "date" ? /* @__PURE__ */ i(
|
402
|
-
|
402
|
+
st,
|
403
403
|
{
|
404
404
|
mode: e.mode ?? "date",
|
405
405
|
size: "small",
|
406
406
|
value: s ?? void 0,
|
407
407
|
onChange: (t) => {
|
408
|
-
|
408
|
+
a(t);
|
409
409
|
},
|
410
410
|
clearable: !0
|
411
411
|
}
|
412
412
|
) : null;
|
413
413
|
}
|
414
|
-
function
|
415
|
-
const
|
414
|
+
function Nt({ onDataAdded: e }) {
|
415
|
+
const a = Se();
|
416
416
|
return /* @__PURE__ */ i(
|
417
|
-
|
417
|
+
it,
|
418
418
|
{
|
419
419
|
accept: {
|
420
420
|
"text/*": [".csv", ".xls", ".xlsx"],
|
@@ -430,17 +430,17 @@ function Ct({ onDataAdded: e }) {
|
|
430
430
|
size: "small",
|
431
431
|
maxFiles: 1,
|
432
432
|
uploadDescription: /* @__PURE__ */ p(M, { children: [
|
433
|
-
/* @__PURE__ */ i(
|
433
|
+
/* @__PURE__ */ i(lt, {}),
|
434
434
|
"Drag and drop a file here or click to upload"
|
435
435
|
] }),
|
436
436
|
onFilesAdded: (s) => {
|
437
|
-
s.length > 0 &&
|
437
|
+
s.length > 0 && xt(s[0]).then(({
|
438
438
|
data: t,
|
439
439
|
propertiesOrder: r
|
440
440
|
}) => {
|
441
441
|
e(t, r);
|
442
442
|
}).catch((t) => {
|
443
|
-
console.error("Error parsing file", t),
|
443
|
+
console.error("Error parsing file", t), a.open({
|
444
444
|
type: "error",
|
445
445
|
message: t.message
|
446
446
|
});
|
@@ -449,170 +449,170 @@ function Ct({ onDataAdded: e }) {
|
|
449
449
|
}
|
450
450
|
);
|
451
451
|
}
|
452
|
-
function
|
452
|
+
function Bt({
|
453
453
|
propertyKey: e,
|
454
|
-
property:
|
454
|
+
property: a,
|
455
455
|
onEditClick: s,
|
456
456
|
includeName: t = !0,
|
457
457
|
onPropertyNameChanged: r,
|
458
|
-
propertyTypeView:
|
458
|
+
propertyTypeView: n
|
459
459
|
}) {
|
460
|
-
const { propertyConfigs: l } =
|
461
|
-
return /* @__PURE__ */ i(
|
460
|
+
const { propertyConfigs: l } = q(), o = a ? Oe(a, l) : null;
|
461
|
+
return /* @__PURE__ */ i(Ge, { children: /* @__PURE__ */ p(
|
462
462
|
"div",
|
463
463
|
{
|
464
464
|
className: "flex flex-row w-full items-center",
|
465
465
|
children: [
|
466
|
-
/* @__PURE__ */ i("div", { className: "mx-4", children:
|
466
|
+
/* @__PURE__ */ i("div", { className: "mx-4", children: n ?? /* @__PURE__ */ i(ke, { propertyConfig: o ?? void 0 }) }),
|
467
467
|
/* @__PURE__ */ i("div", { className: "w-full flex flex-col grow", children: /* @__PURE__ */ p("div", { className: "flex flex-row items-center gap-2", children: [
|
468
468
|
t && /* @__PURE__ */ i(
|
469
469
|
re,
|
470
470
|
{
|
471
471
|
size: "small",
|
472
472
|
className: "text-base grow",
|
473
|
-
value:
|
473
|
+
value: a?.name ?? "",
|
474
474
|
onChange: (c) => {
|
475
475
|
r && e && r(e, c.target.value);
|
476
476
|
}
|
477
477
|
}
|
478
478
|
),
|
479
|
-
/* @__PURE__ */ i(
|
479
|
+
/* @__PURE__ */ i(Q, { onClick: s, size: "small", children: /* @__PURE__ */ i(ot, { size: "small" }) })
|
480
480
|
] }) })
|
481
481
|
]
|
482
482
|
}
|
483
483
|
) });
|
484
484
|
}
|
485
|
-
function
|
485
|
+
function St({
|
486
486
|
path: e,
|
487
|
-
importConfig:
|
487
|
+
importConfig: a,
|
488
488
|
collection: s,
|
489
489
|
onImportSuccess: t
|
490
490
|
}) {
|
491
|
-
const [r,
|
491
|
+
const [r, n] = N(void 0), l = Ie(), o = He(!1), [c, d] = N(0);
|
492
492
|
function u() {
|
493
|
-
o.current || (o.current = !0,
|
493
|
+
o.current || (o.current = !0, Re(
|
494
494
|
l,
|
495
495
|
s,
|
496
496
|
e,
|
497
|
-
|
497
|
+
a.entities,
|
498
498
|
0,
|
499
499
|
25,
|
500
500
|
d
|
501
501
|
).then(() => {
|
502
502
|
t(s), o.current = !1;
|
503
503
|
}).catch((m) => {
|
504
|
-
|
504
|
+
n(m), o.current = !1;
|
505
505
|
}));
|
506
506
|
}
|
507
|
-
return
|
507
|
+
return Ne(() => {
|
508
508
|
u();
|
509
|
-
}, []), r ? /* @__PURE__ */ p(
|
509
|
+
}, []), r ? /* @__PURE__ */ p(be, { className: "flex flex-col gap-4 items-center", children: [
|
510
510
|
/* @__PURE__ */ i(f, { variant: "h6", children: "Error saving data" }),
|
511
511
|
/* @__PURE__ */ i(f, { variant: "body2", color: "error", children: r.message }),
|
512
512
|
/* @__PURE__ */ i(
|
513
|
-
|
513
|
+
S,
|
514
514
|
{
|
515
515
|
onClick: u,
|
516
516
|
variant: "outlined",
|
517
517
|
children: "Retry"
|
518
518
|
}
|
519
519
|
)
|
520
|
-
] }) : /* @__PURE__ */ p(
|
521
|
-
/* @__PURE__ */ i(
|
520
|
+
] }) : /* @__PURE__ */ p(be, { className: "flex flex-col gap-4 items-center", children: [
|
521
|
+
/* @__PURE__ */ i(Ee, {}),
|
522
522
|
/* @__PURE__ */ i(f, { variant: "h6", children: "Saving data" }),
|
523
523
|
/* @__PURE__ */ p(f, { variant: "body2", children: [
|
524
524
|
c,
|
525
525
|
"/",
|
526
|
-
|
526
|
+
a.entities.length,
|
527
527
|
" entities saved"
|
528
528
|
] }),
|
529
529
|
/* @__PURE__ */ i(f, { variant: "caption", children: "Do not close this tab or the import will be interrupted." })
|
530
530
|
] });
|
531
531
|
}
|
532
|
-
function
|
533
|
-
console.debug("Saving imported data", r,
|
534
|
-
const o = t.slice(r, r +
|
532
|
+
function Re(e, a, s, t, r = 0, n = 25, l) {
|
533
|
+
console.debug("Saving imported data", r, n);
|
534
|
+
const o = t.slice(r, r + n);
|
535
535
|
return Promise.all(o.map((c) => e.saveEntity({
|
536
536
|
path: s,
|
537
537
|
values: c.values,
|
538
538
|
entityId: c.id,
|
539
|
-
collection:
|
539
|
+
collection: a,
|
540
540
|
status: "new"
|
541
|
-
}))).then(() => r +
|
541
|
+
}))).then(() => r + n < t.length ? (l(r + n), Re(e, a, s, t, r + n, n, l)) : (l(t.length), Promise.resolve()));
|
542
542
|
}
|
543
|
-
function
|
543
|
+
function Ot({
|
544
544
|
collection: e,
|
545
|
-
path:
|
545
|
+
path: a,
|
546
546
|
collectionEntitiesCount: s,
|
547
547
|
onAnalyticsEvent: t
|
548
548
|
}) {
|
549
|
-
const r =
|
549
|
+
const r = q(), n = Se(), [l, o] = b.useState(!1), [c, d] = b.useState("initial"), u = ht(), m = C(() => {
|
550
550
|
o(!0), t?.("import_open"), d("initial");
|
551
|
-
}, [t]), h =
|
551
|
+
}, [t]), h = C(() => {
|
552
552
|
o(!1);
|
553
|
-
}, [o]), g =
|
553
|
+
}, [o]), g = C(() => {
|
554
554
|
t?.("import_mapping_complete"), d("preview");
|
555
|
-
}, [t]),
|
555
|
+
}, [t]), y = C(() => {
|
556
556
|
t?.("import_data_save"), d("import_data_saving");
|
557
|
-
}, [t]),
|
558
|
-
if (u.setImportData(
|
559
|
-
const
|
560
|
-
u.setOriginProperties(
|
561
|
-
const
|
562
|
-
u.setHeadersMapping(
|
563
|
-
const
|
564
|
-
(
|
557
|
+
}, [t]), A = async (v) => {
|
558
|
+
if (u.setImportData(v), v.length > 0) {
|
559
|
+
const P = await mt(v, vt);
|
560
|
+
u.setOriginProperties(P);
|
561
|
+
const E = $e(v, e?.properties);
|
562
|
+
u.setHeadersMapping(E);
|
563
|
+
const O = Object.keys(E)?.[0];
|
564
|
+
(O?.includes("id") || O?.includes("key")) && u.setIdColumn(O);
|
565
565
|
}
|
566
566
|
setTimeout(() => {
|
567
567
|
t?.("import_data_added"), d("mapping");
|
568
568
|
}, 100);
|
569
|
-
},
|
569
|
+
}, F = _e({
|
570
570
|
collection: e,
|
571
|
-
path:
|
571
|
+
path: a,
|
572
572
|
fields: r.propertyConfigs
|
573
|
-
}),
|
573
|
+
}), j = Ye(F.properties, F.propertiesOrder), z = Object.entries(j).flatMap(([v, P]) => Ve(v, P, 0)), ce = F.propertiesOrder ?? Object.keys(F.properties);
|
574
574
|
return e.collectionGroup ? null : /* @__PURE__ */ p(M, { children: [
|
575
|
-
/* @__PURE__ */ i(
|
575
|
+
/* @__PURE__ */ i(Z, { title: "Import", children: /* @__PURE__ */ i(Q, { color: "primary", onClick: m, children: /* @__PURE__ */ i(ct, {}) }) }),
|
576
576
|
/* @__PURE__ */ p(
|
577
|
-
|
577
|
+
se,
|
578
578
|
{
|
579
579
|
open: l,
|
580
580
|
fullWidth: c === "preview",
|
581
581
|
fullHeight: c === "preview",
|
582
582
|
maxWidth: c === "initial" ? "lg" : "7xl",
|
583
583
|
children: [
|
584
|
-
/* @__PURE__ */ p(
|
584
|
+
/* @__PURE__ */ p(ie, { className: "flex flex-col gap-4 my-4", fullHeight: c === "preview", children: [
|
585
585
|
c === "initial" && /* @__PURE__ */ p(M, { children: [
|
586
586
|
/* @__PURE__ */ i(f, { variant: "h6", children: "Import data" }),
|
587
587
|
/* @__PURE__ */ i(f, { variant: "body2", children: "Upload a CSV, Excel or JSON file and map it to your existing schema" }),
|
588
|
-
/* @__PURE__ */ i(
|
588
|
+
/* @__PURE__ */ i(Nt, { onDataAdded: A })
|
589
589
|
] }),
|
590
590
|
c === "mapping" && /* @__PURE__ */ p(M, { children: [
|
591
591
|
/* @__PURE__ */ i(f, { variant: "h6", className: "ml-3.5", children: "Map fields" }),
|
592
592
|
/* @__PURE__ */ i(
|
593
|
-
|
593
|
+
Ct,
|
594
594
|
{
|
595
595
|
importConfig: u,
|
596
|
-
destinationProperties:
|
596
|
+
destinationProperties: j,
|
597
597
|
buildPropertyView: ({
|
598
|
-
isIdColumn:
|
599
|
-
property:
|
600
|
-
propertyKey:
|
601
|
-
importKey:
|
598
|
+
isIdColumn: v,
|
599
|
+
property: P,
|
600
|
+
propertyKey: E,
|
601
|
+
importKey: O
|
602
602
|
}) => /* @__PURE__ */ i(
|
603
|
-
|
603
|
+
kt,
|
604
604
|
{
|
605
|
-
selectedPropertyKey:
|
606
|
-
properties:
|
607
|
-
propertiesAndLevel:
|
608
|
-
isIdColumn:
|
605
|
+
selectedPropertyKey: E ?? "",
|
606
|
+
properties: j,
|
607
|
+
propertiesAndLevel: z,
|
608
|
+
isIdColumn: v,
|
609
609
|
onIdSelected: () => {
|
610
|
-
u.setIdColumn(
|
610
|
+
u.setIdColumn(O);
|
611
611
|
},
|
612
|
-
onPropertySelected: (
|
612
|
+
onPropertySelected: (R) => {
|
613
613
|
t?.("import_mapping_field_updated");
|
614
|
-
const
|
615
|
-
u.setHeadersMapping(
|
614
|
+
const de = Object.entries(u.headersMapping).map(([k, V]) => V === R ? { [k]: null } : k === O ? { [k]: R } : { [k]: V }).reduce((k, V) => ({ ...k, ...V }), {});
|
615
|
+
u.setHeadersMapping(de), R === u.idColumn && u.setIdColumn(void 0);
|
616
616
|
}
|
617
617
|
}
|
618
618
|
)
|
@@ -620,21 +620,21 @@ function Dt({
|
|
620
620
|
)
|
621
621
|
] }),
|
622
622
|
c === "preview" && /* @__PURE__ */ i(
|
623
|
-
|
623
|
+
It,
|
624
624
|
{
|
625
625
|
importConfig: u,
|
626
|
-
properties:
|
627
|
-
propertiesOrder:
|
626
|
+
properties: j,
|
627
|
+
propertiesOrder: ce
|
628
628
|
}
|
629
629
|
),
|
630
630
|
c === "import_data_saving" && u && /* @__PURE__ */ i(
|
631
|
-
|
631
|
+
St,
|
632
632
|
{
|
633
633
|
importConfig: u,
|
634
634
|
collection: e,
|
635
|
-
path:
|
636
|
-
onImportSuccess: (
|
637
|
-
h(),
|
635
|
+
path: a,
|
636
|
+
onImportSuccess: (v) => {
|
637
|
+
h(), n.open({
|
638
638
|
type: "info",
|
639
639
|
message: "Data imported successfully"
|
640
640
|
});
|
@@ -642,9 +642,9 @@ function Dt({
|
|
642
642
|
}
|
643
643
|
)
|
644
644
|
] }),
|
645
|
-
/* @__PURE__ */ p(
|
645
|
+
/* @__PURE__ */ p(le, { children: [
|
646
646
|
c === "mapping" && /* @__PURE__ */ i(
|
647
|
-
|
647
|
+
S,
|
648
648
|
{
|
649
649
|
onClick: () => d("initial"),
|
650
650
|
variant: "text",
|
@@ -652,7 +652,7 @@ function Dt({
|
|
652
652
|
}
|
653
653
|
),
|
654
654
|
c === "preview" && /* @__PURE__ */ i(
|
655
|
-
|
655
|
+
S,
|
656
656
|
{
|
657
657
|
onClick: () => d("mapping"),
|
658
658
|
variant: "text",
|
@@ -660,7 +660,7 @@ function Dt({
|
|
660
660
|
}
|
661
661
|
),
|
662
662
|
/* @__PURE__ */ i(
|
663
|
-
|
663
|
+
S,
|
664
664
|
{
|
665
665
|
onClick: h,
|
666
666
|
variant: "text",
|
@@ -668,7 +668,7 @@ function Dt({
|
|
668
668
|
}
|
669
669
|
),
|
670
670
|
c === "mapping" && /* @__PURE__ */ i(
|
671
|
-
|
671
|
+
S,
|
672
672
|
{
|
673
673
|
variant: "filled",
|
674
674
|
onClick: g,
|
@@ -676,10 +676,10 @@ function Dt({
|
|
676
676
|
}
|
677
677
|
),
|
678
678
|
c === "preview" && /* @__PURE__ */ i(
|
679
|
-
|
679
|
+
S,
|
680
680
|
{
|
681
681
|
variant: "filled",
|
682
|
-
onClick:
|
682
|
+
onClick: y,
|
683
683
|
children: "Save data"
|
684
684
|
}
|
685
685
|
)
|
@@ -689,33 +689,33 @@ function Dt({
|
|
689
689
|
)
|
690
690
|
] });
|
691
691
|
}
|
692
|
-
const
|
693
|
-
function
|
692
|
+
const X = "__internal_id__";
|
693
|
+
function kt({
|
694
694
|
selectedPropertyKey: e,
|
695
|
-
properties:
|
695
|
+
properties: a,
|
696
696
|
onPropertySelected: s,
|
697
697
|
onIdSelected: t,
|
698
698
|
propertiesAndLevel: r,
|
699
|
-
isIdColumn:
|
699
|
+
isIdColumn: n
|
700
700
|
}) {
|
701
|
-
const l = e ? J(
|
702
|
-
|
701
|
+
const l = e ? J(a, e) : null, o = C((d) => d === X ? /* @__PURE__ */ i(f, { variant: "body2", className: "p-4", children: "Use this column as ID" }) : !d || !l ? /* @__PURE__ */ i(f, { variant: "body2", color: "disabled", className: "p-4", children: "Do not import this property" }) : /* @__PURE__ */ i(
|
702
|
+
Ce,
|
703
703
|
{
|
704
704
|
propertyKey: d,
|
705
705
|
property: l
|
706
706
|
}
|
707
707
|
), [l]);
|
708
708
|
return /* @__PURE__ */ p(
|
709
|
-
|
709
|
+
Ae,
|
710
710
|
{
|
711
|
-
value:
|
711
|
+
value: n ? X : e ?? void 0,
|
712
712
|
onValueChange: (d) => {
|
713
|
-
d ===
|
713
|
+
d === X ? (t(), s(null)) : s(d === "__do_not_import" ? null : d);
|
714
714
|
},
|
715
715
|
renderValue: o,
|
716
716
|
children: [
|
717
717
|
/* @__PURE__ */ i(H, { value: "__do_not_import", children: /* @__PURE__ */ i(f, { variant: "body2", color: "disabled", className: "p-4", children: "Do not import this property" }) }),
|
718
|
-
/* @__PURE__ */ i(H, { value:
|
718
|
+
/* @__PURE__ */ i(H, { value: X, children: /* @__PURE__ */ i(f, { variant: "body2", className: "p-4", children: "Use this column as ID" }) }),
|
719
719
|
r.map(({
|
720
720
|
property: d,
|
721
721
|
level: u,
|
@@ -726,7 +726,7 @@ function Nt({
|
|
726
726
|
value: m,
|
727
727
|
disabled: d.dataType === "map",
|
728
728
|
children: /* @__PURE__ */ i(
|
729
|
-
|
729
|
+
Ce,
|
730
730
|
{
|
731
731
|
propertyKey: m,
|
732
732
|
property: d,
|
@@ -740,29 +740,29 @@ function Nt({
|
|
740
740
|
}
|
741
741
|
);
|
742
742
|
}
|
743
|
-
function
|
743
|
+
function Ve(e, a, s) {
|
744
744
|
const t = [];
|
745
745
|
return t.push({
|
746
|
-
property:
|
746
|
+
property: a,
|
747
747
|
level: s,
|
748
748
|
propertyKey: e
|
749
|
-
}),
|
750
|
-
t.push(...
|
749
|
+
}), a.dataType === "map" && a.properties && Object.entries(a.properties).forEach(([r, n]) => {
|
750
|
+
t.push(...Ve(`${e}.${r}`, n, s + 1));
|
751
751
|
}), t;
|
752
752
|
}
|
753
|
-
function
|
753
|
+
function Ce({
|
754
754
|
propertyKey: e,
|
755
|
-
property:
|
755
|
+
property: a,
|
756
756
|
level: s = 0
|
757
757
|
}) {
|
758
|
-
const { propertyConfigs: t } =
|
758
|
+
const { propertyConfigs: t } = q(), r = Oe(a, t);
|
759
759
|
return /* @__PURE__ */ p(
|
760
760
|
"div",
|
761
761
|
{
|
762
762
|
className: "flex flex-row w-full text-start items-center h-full",
|
763
763
|
children: [
|
764
|
-
new Array(s).fill(0).map((
|
765
|
-
/* @__PURE__ */ i("div", { className: "m-4", children: /* @__PURE__ */ i(
|
764
|
+
new Array(s).fill(0).map((n, l) => /* @__PURE__ */ i("div", { className: _(dt, "ml-8 border-l h-12") }, l)),
|
765
|
+
/* @__PURE__ */ i("div", { className: "m-4", children: /* @__PURE__ */ i(Z, { title: r?.name, children: /* @__PURE__ */ i(ke, { propertyConfig: r }) }) }),
|
766
766
|
/* @__PURE__ */ p("div", { className: "flex flex-col flex-grow p-2 pl-2", children: [
|
767
767
|
/* @__PURE__ */ i(
|
768
768
|
f,
|
@@ -770,7 +770,7 @@ function ve({
|
|
770
770
|
variant: "body1",
|
771
771
|
component: "span",
|
772
772
|
className: "flex-grow pr-2",
|
773
|
-
children:
|
773
|
+
children: a.name ? a.name : " "
|
774
774
|
}
|
775
775
|
),
|
776
776
|
/* @__PURE__ */ i(
|
@@ -788,18 +788,18 @@ function ve({
|
|
788
788
|
}
|
789
789
|
);
|
790
790
|
}
|
791
|
-
function
|
791
|
+
function It({
|
792
792
|
importConfig: e,
|
793
|
-
properties:
|
793
|
+
properties: a,
|
794
794
|
propertiesOrder: s
|
795
795
|
}) {
|
796
|
-
|
797
|
-
const r = e.importData.map((
|
796
|
+
Ne(() => {
|
797
|
+
const r = e.importData.map((n) => bt(n, e.idColumn, e.headersMapping, a, "TEMP_PATH", e.defaultValues));
|
798
798
|
e.setEntities(r);
|
799
799
|
}, []);
|
800
|
-
const t =
|
800
|
+
const t = qe();
|
801
801
|
return /* @__PURE__ */ i(
|
802
|
-
|
802
|
+
Qe,
|
803
803
|
{
|
804
804
|
title: /* @__PURE__ */ p("div", { children: [
|
805
805
|
/* @__PURE__ */ i(f, { variant: "subtitle2", children: "Imported data preview" }),
|
@@ -815,186 +815,212 @@ function St({
|
|
815
815
|
filterable: !1,
|
816
816
|
sortable: !1,
|
817
817
|
selectionController: t,
|
818
|
-
properties:
|
818
|
+
properties: a
|
819
819
|
}
|
820
820
|
);
|
821
821
|
}
|
822
|
-
function $e(e,
|
822
|
+
function $e(e, a) {
|
823
823
|
const s = {};
|
824
824
|
return e.filter(Boolean).forEach((t) => {
|
825
825
|
Object.keys(t).forEach((r) => {
|
826
|
-
const
|
827
|
-
if (typeof
|
828
|
-
const l =
|
826
|
+
const n = t[r];
|
827
|
+
if (typeof n == "object" && !Array.isArray(n)) {
|
828
|
+
const l = a?.[r], o = l && "properties" in l ? l.properties : void 0, c = $e([n], o);
|
829
829
|
Object.entries(c).forEach(([d, u]) => {
|
830
830
|
s[`${r}.${d}`] = `${r}.${u}`;
|
831
831
|
});
|
832
832
|
}
|
833
|
-
if (!
|
833
|
+
if (!a)
|
834
834
|
s[r] = r;
|
835
|
-
else if (r in
|
835
|
+
else if (r in a)
|
836
836
|
s[r] = r;
|
837
837
|
else {
|
838
|
-
const l =
|
839
|
-
l in
|
838
|
+
const l = Ze(r);
|
839
|
+
l in a ? s[r] = l : s[r] = r;
|
840
840
|
}
|
841
841
|
});
|
842
842
|
}), s;
|
843
843
|
}
|
844
|
-
function Be(
|
844
|
+
function Be({
|
845
|
+
data: e,
|
846
|
+
additionalData: a,
|
847
|
+
properties: s,
|
848
|
+
propertiesOrder: t,
|
849
|
+
name: r,
|
850
|
+
flattenArrays: n,
|
851
|
+
additionalHeaders: l,
|
852
|
+
exportType: o,
|
853
|
+
dateExportType: c
|
854
|
+
}) {
|
845
855
|
if (console.debug("Downloading export", {
|
846
856
|
dataLength: e.length,
|
847
857
|
properties: s,
|
848
858
|
exportType: o,
|
849
859
|
dateExportType: c
|
850
860
|
}), o === "csv") {
|
851
|
-
const d =
|
852
|
-
|
861
|
+
const d = n ? Ke(e.map((y) => y.values)) : {}, u = Et(s, t, l, d), m = _t(e, a, s, u, c), h = we(u.map((y) => y.label)), g = m.map((y) => we(y));
|
862
|
+
De([h, ...g], `${r}.csv`, "text/csv");
|
853
863
|
} else {
|
854
|
-
const d =
|
855
|
-
|
864
|
+
const d = At(e, a, s, c), u = JSON.stringify(d, null, 2);
|
865
|
+
De([u], `${r}.json`, "application/json");
|
856
866
|
}
|
857
867
|
}
|
858
|
-
function
|
859
|
-
const
|
868
|
+
function _t(e, a, s, t, r) {
|
869
|
+
const n = e.map((l) => ({
|
860
870
|
id: l.id,
|
861
|
-
...
|
871
|
+
...oe(l.values, s, "csv", r)
|
862
872
|
}));
|
863
|
-
return
|
864
|
-
|
865
|
-
}),
|
873
|
+
return a && a.forEach((l, o) => {
|
874
|
+
n[o] = { ...n[o], ...l };
|
875
|
+
}), n && n.map((l) => t.map((o) => et(l, o.key)));
|
866
876
|
}
|
867
|
-
function
|
868
|
-
const r = e.map((
|
869
|
-
id:
|
870
|
-
...
|
877
|
+
function At(e, a, s, t) {
|
878
|
+
const r = e.map((n) => ({
|
879
|
+
id: n.id,
|
880
|
+
...oe(n.values, s, "json", t)
|
871
881
|
}));
|
872
|
-
return
|
873
|
-
r[l] = { ...r[l], ...
|
882
|
+
return a && a.forEach((n, l) => {
|
883
|
+
r[l] = { ...r[l], ...n };
|
874
884
|
}), r;
|
875
885
|
}
|
876
|
-
function
|
886
|
+
function Et(e, a, s, t) {
|
877
887
|
const r = [
|
878
888
|
{
|
879
889
|
label: "id",
|
880
890
|
key: "id"
|
881
891
|
},
|
882
|
-
...(
|
883
|
-
const l = e[
|
884
|
-
return l ? t && t[
|
885
|
-
{ length: t[
|
886
|
-
(o, c) =>
|
887
|
-
).flat() :
|
892
|
+
...(a ?? Object.keys(e)).flatMap((n) => {
|
893
|
+
const l = e[n];
|
894
|
+
return l ? t && t[n] > 1 ? Array.from(
|
895
|
+
{ length: t[n] },
|
896
|
+
(o, c) => ne(l, `${n}[${c}]`, "")
|
897
|
+
).flat() : ne(l, n, "") : (console.warn("Property not found", n, e), []);
|
888
898
|
})
|
889
899
|
];
|
890
|
-
return s && r.push(...s.map((
|
891
|
-
label:
|
892
|
-
key:
|
900
|
+
return s && r.push(...s.map((n) => ({
|
901
|
+
label: n,
|
902
|
+
key: n
|
893
903
|
}))), r;
|
894
904
|
}
|
895
|
-
function
|
896
|
-
const t = s ? `${s}.${
|
897
|
-
return e.dataType === "map" && e.properties ? Object.entries(e.properties).map(([r,
|
905
|
+
function ne(e, a, s = "") {
|
906
|
+
const t = s ? `${s}.${a}` : a;
|
907
|
+
return e.dataType === "map" && e.properties ? Object.entries(e.properties).map(([r, n]) => ne(n, r, t)).flat() : [{
|
898
908
|
label: t,
|
899
909
|
key: t
|
900
910
|
}];
|
901
911
|
}
|
902
|
-
function
|
912
|
+
function G(e, a, s, t) {
|
903
913
|
let r;
|
904
|
-
if (
|
905
|
-
r =
|
906
|
-
else if (
|
907
|
-
|
908
|
-
else if (
|
909
|
-
const
|
910
|
-
r =
|
914
|
+
if (a.dataType === "map" && a.properties)
|
915
|
+
r = oe(e, a.properties, s, t);
|
916
|
+
else if (a.dataType === "array")
|
917
|
+
a.of && Array.isArray(e) ? Array.isArray(a.of) ? r = a.of.map((n, l) => G(e[l], n, s, t)) : a.of.dataType === "map" ? r = s === "csv" ? e.map((n) => JSON.stringify(n)) : e.map((n) => G(n, a.of, s, t)) : r = e.map((n) => G(n, a.of, s, t)) : r = e;
|
918
|
+
else if (a.dataType === "reference" && e && e.isEntityReference && e.isEntityReference()) {
|
919
|
+
const n = e || void 0;
|
920
|
+
r = n ? n.pathWithId : null;
|
911
921
|
} else
|
912
|
-
|
922
|
+
a.dataType === "date" && e instanceof Date ? r = e ? t === "timestamp" ? e.getTime() : e.toISOString() : null : r = e;
|
913
923
|
return r;
|
914
924
|
}
|
915
|
-
function
|
916
|
-
const r = Object.entries(
|
917
|
-
const o = e && e[
|
918
|
-
return c === void 0 ? {} : { [
|
919
|
-
}).reduce((
|
925
|
+
function oe(e, a, s, t) {
|
926
|
+
const r = Object.entries(a).map(([n, l]) => {
|
927
|
+
const o = e && e[n], c = G(o, l, s, t);
|
928
|
+
return c === void 0 ? {} : { [n]: c };
|
929
|
+
}).reduce((n, l) => ({ ...n, ...l }), {});
|
920
930
|
return { ...e, ...r };
|
921
931
|
}
|
922
|
-
function
|
923
|
-
return e.map((
|
932
|
+
function we(e) {
|
933
|
+
return e.map((a) => a == null ? "" : Array.isArray(a) ? '"' + JSON.stringify(a).replaceAll('"', '\\"') + '"' : '"' + String(a).replaceAll('"', '""') + '"').join(",") + `\r
|
924
934
|
`;
|
925
935
|
}
|
926
|
-
function
|
927
|
-
const t = new Blob(e, { type: s }), r = URL.createObjectURL(t),
|
928
|
-
|
936
|
+
function De(e, a, s) {
|
937
|
+
const t = new Blob(e, { type: s }), r = URL.createObjectURL(t), n = document.createElement("a");
|
938
|
+
n.href = r, n.setAttribute("download", a), n.click();
|
929
939
|
}
|
930
|
-
const
|
931
|
-
function
|
940
|
+
const Tt = 500;
|
941
|
+
function Ft({
|
932
942
|
collection: e,
|
933
|
-
path:
|
943
|
+
path: a,
|
934
944
|
collectionEntitiesCount: s,
|
935
945
|
onAnalyticsEvent: t,
|
936
946
|
exportAllowed: r,
|
937
|
-
notAllowedView:
|
947
|
+
notAllowedView: n
|
938
948
|
}) {
|
939
|
-
const l =
|
949
|
+
const l = q(), o = typeof e.exportable == "object" ? e.exportable : void 0, c = b.useRef(/* @__PURE__ */ new Date()), [d, u] = b.useState(!1), [m, h] = b.useState(!0), [g, y] = b.useState("csv"), [A, F] = b.useState("string"), j = tt(), z = Ie(), v = rt().resolveAliasesFrom(a), P = !r || r({
|
940
950
|
collectionEntitiesCount: s,
|
941
|
-
path:
|
951
|
+
path: v,
|
942
952
|
collection: e
|
943
|
-
}),
|
953
|
+
}), E = b.useMemo(() => _e({
|
944
954
|
collection: e,
|
945
|
-
path:
|
955
|
+
path: v,
|
946
956
|
fields: l.propertyConfigs
|
947
|
-
}), [e,
|
948
|
-
|
949
|
-
}, [
|
950
|
-
|
951
|
-
}, [
|
952
|
-
const
|
953
|
-
[
|
954
|
-
entity:
|
955
|
-
context:
|
957
|
+
}), [e, v]), [O, R] = b.useState(!1), [de, k] = b.useState(), [V, $] = b.useState(!1), Le = C(() => {
|
958
|
+
$(!0);
|
959
|
+
}, [$]), K = C(() => {
|
960
|
+
$(!1);
|
961
|
+
}, [$]), pe = C(async (D) => {
|
962
|
+
const W = o?.additionalFields, I = E.additionalFields, ee = W ? await Promise.all(D.map(async (B) => (await Promise.all(W.map(async (x) => ({
|
963
|
+
[x.key]: await x.builder({
|
964
|
+
entity: B,
|
965
|
+
context: j
|
956
966
|
})
|
957
|
-
})))).reduce((
|
958
|
-
[
|
959
|
-
entity:
|
960
|
-
context:
|
967
|
+
})))).reduce((x, L) => ({ ...x, ...L }), {}))) : [], te = I ? await Promise.all(D.map(async (B) => (await Promise.all(I.map(async (x) => x.value ? {
|
968
|
+
[x.key]: await x.value({
|
969
|
+
entity: B,
|
970
|
+
context: j
|
961
971
|
})
|
962
|
-
} : {}))).reduce((
|
963
|
-
return [...
|
964
|
-
}, [o?.additionalFields]),
|
972
|
+
} : {}))).reduce((x, L) => ({ ...x, ...L }), {}))) : [];
|
973
|
+
return [...ee, ...te];
|
974
|
+
}, [o?.additionalFields]), ue = C(async (D, W) => {
|
965
975
|
t?.("export_collection", {
|
966
976
|
collection: D.path
|
967
|
-
}),
|
968
|
-
path:
|
977
|
+
}), R(!0), z.fetchCollection({
|
978
|
+
path: v,
|
969
979
|
collection: D
|
970
980
|
}).then(async (I) => {
|
971
|
-
|
972
|
-
const
|
973
|
-
...
|
974
|
-
...D.additionalFields?.map((
|
975
|
-
]
|
976
|
-
|
981
|
+
k(void 0);
|
982
|
+
const ee = await pe(I), te = [
|
983
|
+
...W?.additionalFields?.map((x) => x.key) ?? [],
|
984
|
+
...D.additionalFields?.map((x) => x.key) ?? []
|
985
|
+
], B = d ? I.map((x) => {
|
986
|
+
const L = at(D.properties);
|
987
|
+
return {
|
988
|
+
...x,
|
989
|
+
values: { ...L, ...x.values }
|
990
|
+
};
|
991
|
+
}) : I;
|
992
|
+
Be({
|
993
|
+
data: B,
|
994
|
+
additionalData: ee,
|
995
|
+
properties: D.properties,
|
996
|
+
propertiesOrder: D.propertiesOrder,
|
997
|
+
name: D.name,
|
998
|
+
flattenArrays: m,
|
999
|
+
additionalHeaders: te,
|
1000
|
+
exportType: g,
|
1001
|
+
dateExportType: A
|
1002
|
+
}), t?.("export_collection_success", {
|
977
1003
|
collection: D.path
|
978
1004
|
});
|
979
1005
|
}).catch((I) => {
|
980
|
-
console.error("Error loading export data", I),
|
981
|
-
}).finally(() =>
|
982
|
-
}, [t,
|
983
|
-
|
984
|
-
}, [
|
1006
|
+
console.error("Error loading export data", I), k(I);
|
1007
|
+
}).finally(() => R(!1));
|
1008
|
+
}, [t, z, v, pe, d, m, g, A]), Je = C(() => {
|
1009
|
+
ue(E, o), K();
|
1010
|
+
}, [ue, E, o, K]);
|
985
1011
|
return /* @__PURE__ */ p(M, { children: [
|
986
|
-
/* @__PURE__ */ i(
|
1012
|
+
/* @__PURE__ */ i(Z, { title: "Export", children: /* @__PURE__ */ i(Q, { color: "primary", onClick: Le, children: /* @__PURE__ */ i(Te, {}) }) }),
|
987
1013
|
/* @__PURE__ */ p(
|
988
|
-
|
1014
|
+
se,
|
989
1015
|
{
|
990
|
-
open:
|
991
|
-
onOpenChange:
|
1016
|
+
open: V,
|
1017
|
+
onOpenChange: $,
|
992
1018
|
maxWidth: "xl",
|
993
1019
|
children: [
|
994
|
-
/* @__PURE__ */ p(
|
1020
|
+
/* @__PURE__ */ p(ie, { className: "flex flex-col gap-4 my-4", children: [
|
995
1021
|
/* @__PURE__ */ i(f, { variant: "h6", children: "Export data" }),
|
996
1022
|
/* @__PURE__ */ i("div", { children: "Download the the content of this table as a CSV" }),
|
997
|
-
s >
|
1023
|
+
s > Tt && /* @__PURE__ */ i(pt, { color: "warning", children: /* @__PURE__ */ p("div", { children: [
|
998
1024
|
"This collections has a large number of documents (",
|
999
1025
|
s,
|
1000
1026
|
")."
|
@@ -1009,9 +1035,9 @@ function At({
|
|
1009
1035
|
type: "radio",
|
1010
1036
|
value: "csv",
|
1011
1037
|
name: "exportType",
|
1012
|
-
checked:
|
1013
|
-
onChange: () =>
|
1014
|
-
className:
|
1038
|
+
checked: g === "csv",
|
1039
|
+
onChange: () => y("csv"),
|
1040
|
+
className: _(T, "w-4 text-primary-dark bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600")
|
1015
1041
|
}
|
1016
1042
|
),
|
1017
1043
|
/* @__PURE__ */ i(
|
@@ -1031,9 +1057,9 @@ function At({
|
|
1031
1057
|
type: "radio",
|
1032
1058
|
value: "json",
|
1033
1059
|
name: "exportType",
|
1034
|
-
checked:
|
1035
|
-
onChange: () =>
|
1036
|
-
className:
|
1060
|
+
checked: g === "json",
|
1061
|
+
onChange: () => y("json"),
|
1062
|
+
className: _(T, "w-4 text-primary-dark bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600")
|
1037
1063
|
}
|
1038
1064
|
),
|
1039
1065
|
/* @__PURE__ */ i(
|
@@ -1055,9 +1081,9 @@ function At({
|
|
1055
1081
|
type: "radio",
|
1056
1082
|
value: "timestamp",
|
1057
1083
|
name: "dateExportType",
|
1058
|
-
checked:
|
1059
|
-
onChange: () =>
|
1060
|
-
className:
|
1084
|
+
checked: A === "timestamp",
|
1085
|
+
onChange: () => F("timestamp"),
|
1086
|
+
className: _(T, "w-4 text-primary-dark bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600")
|
1061
1087
|
}
|
1062
1088
|
),
|
1063
1089
|
/* @__PURE__ */ p(
|
@@ -1081,9 +1107,9 @@ function At({
|
|
1081
1107
|
type: "radio",
|
1082
1108
|
value: "string",
|
1083
1109
|
name: "dateExportType",
|
1084
|
-
checked:
|
1085
|
-
onChange: () =>
|
1086
|
-
className:
|
1110
|
+
checked: A === "string",
|
1111
|
+
onChange: () => F("string"),
|
1112
|
+
className: _(T, "w-4 text-primary-dark bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600")
|
1087
1113
|
}
|
1088
1114
|
),
|
1089
1115
|
/* @__PURE__ */ p(
|
@@ -1102,33 +1128,42 @@ function At({
|
|
1102
1128
|
] })
|
1103
1129
|
] }),
|
1104
1130
|
/* @__PURE__ */ i(
|
1105
|
-
|
1131
|
+
Y,
|
1132
|
+
{
|
1133
|
+
size: "small",
|
1134
|
+
disabled: g !== "csv",
|
1135
|
+
value: m,
|
1136
|
+
onValueChange: h,
|
1137
|
+
label: "Flatten arrays"
|
1138
|
+
}
|
1139
|
+
),
|
1140
|
+
/* @__PURE__ */ i(
|
1141
|
+
Y,
|
1106
1142
|
{
|
1107
1143
|
size: "small",
|
1108
|
-
disabled: m !== "csv",
|
1109
1144
|
value: d,
|
1110
1145
|
onValueChange: u,
|
1111
|
-
label: "
|
1146
|
+
label: "Include undefined values"
|
1112
1147
|
}
|
1113
1148
|
),
|
1114
|
-
!
|
1149
|
+
!P && n
|
1115
1150
|
] }),
|
1116
|
-
/* @__PURE__ */ p(
|
1117
|
-
|
1151
|
+
/* @__PURE__ */ p(le, { children: [
|
1152
|
+
O && /* @__PURE__ */ i(Ee, { size: "small" }),
|
1118
1153
|
/* @__PURE__ */ i(
|
1119
|
-
|
1154
|
+
S,
|
1120
1155
|
{
|
1121
|
-
onClick:
|
1156
|
+
onClick: K,
|
1122
1157
|
variant: "text",
|
1123
1158
|
children: "Cancel"
|
1124
1159
|
}
|
1125
1160
|
),
|
1126
1161
|
/* @__PURE__ */ i(
|
1127
|
-
|
1162
|
+
S,
|
1128
1163
|
{
|
1129
1164
|
variant: "filled",
|
1130
|
-
onClick:
|
1131
|
-
disabled:
|
1165
|
+
onClick: Je,
|
1166
|
+
disabled: O || !P,
|
1132
1167
|
children: "Download"
|
1133
1168
|
}
|
1134
1169
|
)
|
@@ -1138,37 +1173,47 @@ function At({
|
|
1138
1173
|
)
|
1139
1174
|
] });
|
1140
1175
|
}
|
1141
|
-
function
|
1142
|
-
return
|
1176
|
+
function Lt(e) {
|
1177
|
+
return Ue(() => ({
|
1143
1178
|
key: "import_export",
|
1144
1179
|
collectionView: {
|
1145
|
-
CollectionActions: [
|
1180
|
+
CollectionActions: [Ot, Ft],
|
1146
1181
|
collectionActionsProps: e
|
1147
1182
|
}
|
1148
1183
|
}), [e]);
|
1149
1184
|
}
|
1150
|
-
function
|
1185
|
+
function Jt({
|
1151
1186
|
data: e,
|
1152
|
-
properties:
|
1187
|
+
properties: a,
|
1153
1188
|
propertiesOrder: s
|
1154
1189
|
}) {
|
1155
|
-
const t =
|
1190
|
+
const t = b.useRef(/* @__PURE__ */ new Date()), [r, n] = b.useState(!0), [l, o] = b.useState("csv"), [c, d] = b.useState("string"), [u, m] = b.useState(!1), h = C(() => {
|
1156
1191
|
m(!0);
|
1157
|
-
}, [m]), g =
|
1192
|
+
}, [m]), g = C(() => {
|
1158
1193
|
m(!1);
|
1159
|
-
}, [m]),
|
1160
|
-
Be(
|
1194
|
+
}, [m]), y = C(() => {
|
1195
|
+
Be({
|
1196
|
+
data: e,
|
1197
|
+
additionalData: [],
|
1198
|
+
properties: a,
|
1199
|
+
propertiesOrder: s,
|
1200
|
+
name: "export.csv",
|
1201
|
+
flattenArrays: r,
|
1202
|
+
additionalHeaders: [],
|
1203
|
+
exportType: l,
|
1204
|
+
dateExportType: c
|
1205
|
+
}), g();
|
1161
1206
|
}, []);
|
1162
1207
|
return /* @__PURE__ */ p(M, { children: [
|
1163
|
-
/* @__PURE__ */ i(
|
1208
|
+
/* @__PURE__ */ i(Z, { title: "Export", children: /* @__PURE__ */ i(Q, { color: "primary", onClick: h, children: /* @__PURE__ */ i(Te, {}) }) }),
|
1164
1209
|
/* @__PURE__ */ p(
|
1165
|
-
|
1210
|
+
se,
|
1166
1211
|
{
|
1167
1212
|
open: u,
|
1168
1213
|
onOpenChange: m,
|
1169
1214
|
maxWidth: "xl",
|
1170
1215
|
children: [
|
1171
|
-
/* @__PURE__ */ p(
|
1216
|
+
/* @__PURE__ */ p(ie, { className: "flex flex-col gap-4 my-4", children: [
|
1172
1217
|
/* @__PURE__ */ i(f, { variant: "h6", children: "Export data" }),
|
1173
1218
|
/* @__PURE__ */ i("div", { children: "Download the the content of this table as a CSV" }),
|
1174
1219
|
/* @__PURE__ */ p("div", { className: "flex flex-row gap-4", children: [
|
@@ -1183,7 +1228,7 @@ function Bt({
|
|
1183
1228
|
name: "exportType",
|
1184
1229
|
checked: l === "csv",
|
1185
1230
|
onChange: () => o("csv"),
|
1186
|
-
className:
|
1231
|
+
className: _(T, "w-4 text-primary-dark bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600")
|
1187
1232
|
}
|
1188
1233
|
),
|
1189
1234
|
/* @__PURE__ */ i(
|
@@ -1205,7 +1250,7 @@ function Bt({
|
|
1205
1250
|
name: "exportType",
|
1206
1251
|
checked: l === "json",
|
1207
1252
|
onChange: () => o("json"),
|
1208
|
-
className:
|
1253
|
+
className: _(T, "w-4 text-primary-dark bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600")
|
1209
1254
|
}
|
1210
1255
|
),
|
1211
1256
|
/* @__PURE__ */ i(
|
@@ -1229,7 +1274,7 @@ function Bt({
|
|
1229
1274
|
name: "dateExportType",
|
1230
1275
|
checked: c === "timestamp",
|
1231
1276
|
onChange: () => d("timestamp"),
|
1232
|
-
className:
|
1277
|
+
className: _(T, "w-4 text-primary-dark bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600")
|
1233
1278
|
}
|
1234
1279
|
),
|
1235
1280
|
/* @__PURE__ */ p(
|
@@ -1255,7 +1300,7 @@ function Bt({
|
|
1255
1300
|
name: "dateExportType",
|
1256
1301
|
checked: c === "string",
|
1257
1302
|
onChange: () => d("string"),
|
1258
|
-
className:
|
1303
|
+
className: _(T, "w-4 text-primary-dark bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600")
|
1259
1304
|
}
|
1260
1305
|
),
|
1261
1306
|
/* @__PURE__ */ p(
|
@@ -1274,19 +1319,19 @@ function Bt({
|
|
1274
1319
|
] })
|
1275
1320
|
] }),
|
1276
1321
|
/* @__PURE__ */ i(
|
1277
|
-
|
1322
|
+
Y,
|
1278
1323
|
{
|
1279
1324
|
size: "small",
|
1280
1325
|
disabled: l !== "csv",
|
1281
1326
|
value: r,
|
1282
|
-
onValueChange:
|
1327
|
+
onValueChange: n,
|
1283
1328
|
label: "Flatten arrays"
|
1284
1329
|
}
|
1285
1330
|
)
|
1286
1331
|
] }),
|
1287
|
-
/* @__PURE__ */ p(
|
1332
|
+
/* @__PURE__ */ p(le, { children: [
|
1288
1333
|
/* @__PURE__ */ i(
|
1289
|
-
|
1334
|
+
S,
|
1290
1335
|
{
|
1291
1336
|
onClick: g,
|
1292
1337
|
variant: "text",
|
@@ -1294,10 +1339,10 @@ function Bt({
|
|
1294
1339
|
}
|
1295
1340
|
),
|
1296
1341
|
/* @__PURE__ */ i(
|
1297
|
-
|
1342
|
+
S,
|
1298
1343
|
{
|
1299
1344
|
variant: "filled",
|
1300
|
-
onClick:
|
1345
|
+
onClick: y,
|
1301
1346
|
children: "Download"
|
1302
1347
|
}
|
1303
1348
|
)
|
@@ -1308,26 +1353,26 @@ function Bt({
|
|
1308
1353
|
] });
|
1309
1354
|
}
|
1310
1355
|
export {
|
1311
|
-
|
1312
|
-
|
1313
|
-
|
1314
|
-
|
1315
|
-
|
1316
|
-
|
1317
|
-
|
1318
|
-
|
1319
|
-
|
1320
|
-
|
1321
|
-
|
1322
|
-
|
1356
|
+
Jt as BasicExportAction,
|
1357
|
+
Ct as DataNewPropertiesMapping,
|
1358
|
+
Ft as ExportCollectionAction,
|
1359
|
+
Ot as ImportCollectionAction,
|
1360
|
+
It as ImportDataPreview,
|
1361
|
+
Nt as ImportFileUpload,
|
1362
|
+
Bt as ImportNewPropertyFieldPreview,
|
1363
|
+
St as ImportSaveInProgress,
|
1364
|
+
Ce as PropertySelectEntry,
|
1365
|
+
bt as convertDataToEntity,
|
1366
|
+
xt as convertFileToJson,
|
1367
|
+
De as downloadBlob,
|
1323
1368
|
Be as downloadEntitiesExport,
|
1324
|
-
|
1325
|
-
|
1326
|
-
|
1327
|
-
|
1328
|
-
|
1369
|
+
Pe as flattenEntry,
|
1370
|
+
_t as getEntityCSVExportableData,
|
1371
|
+
At as getEntityJsonExportableData,
|
1372
|
+
vt as getInferenceType,
|
1373
|
+
ae as processValueMapping,
|
1329
1374
|
je as unflattenObject,
|
1330
|
-
|
1331
|
-
|
1375
|
+
ht as useImportConfig,
|
1376
|
+
Lt as useImportExportPlugin
|
1332
1377
|
};
|
1333
1378
|
//# sourceMappingURL=index.es.js.map
|