@nice2dev/ui 1.4.13 → 1.4.15
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/CHANGELOG.md +108 -0
- package/dist/{NiceColorPicker-BLwYNSXJ.cjs → NiceColorPicker-79rkvaSk.cjs} +1 -1
- package/dist/NiceDataGrid-B1AOjgjm.cjs +10 -0
- package/dist/NiceForm-fmePSeA9.cjs +1 -0
- package/dist/{NiceHtmlEditor-BzECmDO3.cjs → NiceHtmlEditor-By7R1wRo.cjs} +1 -1
- package/dist/{NiceMention-CYRqPKGU.cjs → NiceMention-i7n2BoMw.cjs} +1 -1
- package/dist/{NiceModuleLifecyclePanel-CiYbPcHV.cjs → NiceModuleLifecyclePanel-DVHQuhc-.cjs} +1 -1
- package/dist/{NicePagination-BAxwqeEd.cjs → NicePagination-D9JguOl0.cjs} +1 -1
- package/dist/NicePivotGrid-B_7iQJys.cjs +2 -0
- package/dist/NiceSavedQueryPanel-ChY4HwpM.cjs +587 -0
- package/dist/{NiceScheduler-BqYiHPvz.cjs → NiceScheduler-B2DamQ_L.cjs} +1 -1
- package/dist/backup/NiceBackupScheduler.mjs +171 -119
- package/dist/charts/NiceOrganizationChart.mjs +159 -59
- package/dist/charts/orgChartExport.mjs +71 -0
- package/dist/charts/tidyTree.mjs +43 -0
- package/dist/charts-C3Q3r8Yz.cjs +918 -0
- package/dist/charts.cjs +1 -1
- package/dist/charts.d.ts +9 -0
- package/dist/{core-lazy-BQexApr7.cjs → core-lazy-ChKRuEPb.cjs} +1 -1
- package/dist/data/NiceDataGrid.mjs +301 -320
- package/dist/data/NiceRowEditDialog.mjs +57 -0
- package/dist/data/NiceTreeGrid.mjs +670 -551
- package/dist/data/NiceTreeView.mjs +222 -180
- package/dist/data/treeRowDrop.mjs +130 -0
- package/dist/data.cjs +1 -1
- package/dist/data.d.ts +68 -5
- package/dist/{devops-cgRBnZVX.cjs → devops-o6Zm0VKB.cjs} +3 -3
- package/dist/devops.cjs +1 -1
- package/dist/editors/forms/NiceForm.mjs +216 -167
- package/dist/editors/inputs/NiceUpload.mjs +238 -238
- package/dist/editors.cjs +1 -1
- package/dist/editors.d.ts +13 -1
- package/dist/feedback.cjs +1 -1
- package/dist/index.cjs +254 -254
- package/dist/index.d.ts +293 -8
- package/dist/index.mjs +980 -966
- package/dist/lazy.cjs +1 -1
- package/dist/lazy.d.ts +11 -1
- package/dist/navigation.cjs +1 -1
- package/dist/no-code/NiceDataMapper.mjs +398 -361
- package/dist/no-code-CN_q6TcB.cjs +331 -0
- package/dist/no-code.cjs +1 -1
- package/dist/no-code.d.ts +11 -1
- package/dist/style.css +1 -1
- package/dist/tools/NicePermissionMatrix.mjs +171 -138
- package/dist/tools/NiceRoleEditor.mjs +334 -297
- package/package.json +4 -4
- package/dist/NiceDataGrid-D3qRQSjy.cjs +0 -10
- package/dist/NiceForm-BWb4LTQJ.cjs +0 -1
- package/dist/NicePivotGrid-Cxu5PECg.cjs +0 -152
- package/dist/NiceSavedQueryPanel-BSZhE-_l.cjs +0 -587
- package/dist/charts-BzlvCCg9.cjs +0 -768
- package/dist/no-code-B1jzfUF5.cjs +0 -331
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useNiceTranslation as
|
|
3
|
-
import { useState as
|
|
4
|
-
const
|
|
1
|
+
import { jsxs as i, jsx as a, Fragment as z } from "react/jsx-runtime";
|
|
2
|
+
import { useNiceTranslation as X, useControllableState as Z, NiceIcon as s } from "@nice2dev/ui-core";
|
|
3
|
+
import { useState as k, useCallback as ee, useMemo as T } from "react";
|
|
4
|
+
const ae = {
|
|
5
5
|
id: "map-1",
|
|
6
6
|
name: "UserToContact",
|
|
7
7
|
description: "Transform User API response to Contact entity",
|
|
@@ -92,7 +92,7 @@ const Q = {
|
|
|
92
92
|
},
|
|
93
93
|
{ id: "v3", field: "contactId", type: "required", message: "Contact ID is required" }
|
|
94
94
|
]
|
|
95
|
-
},
|
|
95
|
+
}, Y = {
|
|
96
96
|
string: "var(--nice-color-success, #22c55e)",
|
|
97
97
|
number: "var(--nice-color-primary, #3b82f6)",
|
|
98
98
|
boolean: "var(--nice-color-warning, #f59e0b)",
|
|
@@ -100,7 +100,7 @@ const Q = {
|
|
|
100
100
|
array: "var(--nice-color-info, #06b6d4)",
|
|
101
101
|
object: "var(--nice-color-accent-pink, #ec4899)",
|
|
102
102
|
any: "var(--nice-text-muted, #6b7280)"
|
|
103
|
-
},
|
|
103
|
+
}, L = {
|
|
104
104
|
string: "edit",
|
|
105
105
|
number: "hash",
|
|
106
106
|
boolean: "check",
|
|
@@ -108,7 +108,7 @@ const Q = {
|
|
|
108
108
|
array: "clipboard",
|
|
109
109
|
object: "box",
|
|
110
110
|
any: "help"
|
|
111
|
-
},
|
|
111
|
+
}, P = {
|
|
112
112
|
direct: "arrow-right",
|
|
113
113
|
format: "edit",
|
|
114
114
|
convert: "refresh",
|
|
@@ -118,33 +118,33 @@ const Q = {
|
|
|
118
118
|
lookup: "search",
|
|
119
119
|
conditional: "help",
|
|
120
120
|
custom: "settings"
|
|
121
|
-
},
|
|
122
|
-
const
|
|
123
|
-
const
|
|
121
|
+
}, te = (c) => {
|
|
122
|
+
const $ = E(c.sourceSchema), f = E(c.targetSchema), v = c.fieldMappings.map((p) => {
|
|
123
|
+
const b = c.transformations.find((u) => u.id === p.transform), h = p.targetField;
|
|
124
124
|
if (!p.sourceField)
|
|
125
|
-
return ` result.${
|
|
125
|
+
return ` result.${h} = ${JSON.stringify(p.defaultValue)};`;
|
|
126
126
|
const x = p.sourceField.split(",").map((u) => u.trim());
|
|
127
|
-
if (
|
|
128
|
-
switch (
|
|
127
|
+
if (b)
|
|
128
|
+
switch (b.type) {
|
|
129
129
|
case "concat":
|
|
130
|
-
return ` result.${
|
|
130
|
+
return ` result.${h} = [${x.map((u) => `source.${u}`).join(", ")}].filter(Boolean).join('${b.config.separator || " "}');`;
|
|
131
131
|
case "format":
|
|
132
132
|
if (x.length === 1) {
|
|
133
|
-
const u =
|
|
134
|
-
return u.includes("{value}") ? ` result.${
|
|
133
|
+
const u = b.config.format || "{value}";
|
|
134
|
+
return u.includes("{value}") ? ` result.${h} = '${u}'.replace('{value}', String(source.${x[0]}));` : ` result.${h} = formatDate(source.${x[0]}, '${u}');`;
|
|
135
135
|
}
|
|
136
136
|
break;
|
|
137
137
|
case "custom":
|
|
138
|
-
return ` result.${
|
|
138
|
+
return ` result.${h} = ${b.config.expression?.replace(/(\w+)\.(\w+)/g, "source.$1.$2")};`;
|
|
139
139
|
case "convert":
|
|
140
|
-
return ` result.${
|
|
140
|
+
return ` result.${h} = ${b.config.convertTo}(source.${x[0]});`;
|
|
141
141
|
}
|
|
142
142
|
if (x.length === 1) {
|
|
143
143
|
const u = p.defaultValue !== void 0 ? ` ?? ${JSON.stringify(p.defaultValue)}` : "";
|
|
144
|
-
return ` result.${
|
|
144
|
+
return ` result.${h} = source.${x[0]}${u};`;
|
|
145
145
|
}
|
|
146
|
-
return ` // TODO: Manual mapping for ${
|
|
147
|
-
}),
|
|
146
|
+
return ` // TODO: Manual mapping for ${h}`;
|
|
147
|
+
}), y = c.validationRules.map((p) => {
|
|
148
148
|
switch (p.type) {
|
|
149
149
|
case "required":
|
|
150
150
|
return ` if (!data.${p.field}) errors.push('${p.message || p.field + " is required"}');`;
|
|
@@ -161,15 +161,15 @@ const Q = {
|
|
|
161
161
|
*/
|
|
162
162
|
|
|
163
163
|
// Source Type
|
|
164
|
-
${
|
|
164
|
+
${$}
|
|
165
165
|
|
|
166
166
|
// Target Type
|
|
167
|
-
${
|
|
167
|
+
${f}
|
|
168
168
|
|
|
169
169
|
// Validation
|
|
170
170
|
export function validate${c.targetSchema.name}(data: ${c.targetSchema.name}): string[] {
|
|
171
171
|
const errors: string[] = [];
|
|
172
|
-
${
|
|
172
|
+
${y.join(`
|
|
173
173
|
`)}
|
|
174
174
|
return errors;
|
|
175
175
|
}
|
|
@@ -178,7 +178,7 @@ ${g.join(`
|
|
|
178
178
|
export function ${c.name.charAt(0).toLowerCase() + c.name.slice(1)}(source: ${c.sourceSchema.name}): ${c.targetSchema.name} {
|
|
179
179
|
const result = {} as ${c.targetSchema.name};
|
|
180
180
|
|
|
181
|
-
${
|
|
181
|
+
${v.join(`
|
|
182
182
|
`)}
|
|
183
183
|
|
|
184
184
|
return result;
|
|
@@ -196,15 +196,15 @@ function formatDate(date: string | Date, format: string): string {
|
|
|
196
196
|
.replace('DD', day);
|
|
197
197
|
}
|
|
198
198
|
`;
|
|
199
|
-
},
|
|
200
|
-
const
|
|
201
|
-
const
|
|
202
|
-
if (
|
|
203
|
-
const u =
|
|
199
|
+
}, E = (c, $) => {
|
|
200
|
+
const f = (y, p) => {
|
|
201
|
+
const b = " ".repeat(p), h = y.nullable ? "?" : "";
|
|
202
|
+
if (y.type === "object" && y.children) {
|
|
203
|
+
const u = y.children.map((F) => f(F, p + 1)).join(`
|
|
204
204
|
`);
|
|
205
|
-
return `${
|
|
205
|
+
return `${b}${y.name}${h}: {
|
|
206
206
|
${u}
|
|
207
|
-
${
|
|
207
|
+
${b}};`;
|
|
208
208
|
}
|
|
209
209
|
const x = {
|
|
210
210
|
string: "string",
|
|
@@ -214,74 +214,81 @@ ${y}};`;
|
|
|
214
214
|
array: "unknown[]",
|
|
215
215
|
object: "Record<string, unknown>",
|
|
216
216
|
any: "unknown"
|
|
217
|
-
}[
|
|
218
|
-
return `${
|
|
219
|
-
},
|
|
217
|
+
}[y.type];
|
|
218
|
+
return `${b}${y.name}${h}: ${x};`;
|
|
219
|
+
}, v = c.fields.map((y) => f(y, 1)).join(`
|
|
220
220
|
`);
|
|
221
221
|
return `interface ${c.name} {
|
|
222
|
-
${
|
|
222
|
+
${v}
|
|
223
223
|
}`;
|
|
224
|
-
},
|
|
225
|
-
const
|
|
226
|
-
return c.forEach((
|
|
227
|
-
|
|
228
|
-
}),
|
|
229
|
-
},
|
|
230
|
-
mapping: c
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
224
|
+
}, I = (c, $ = "") => {
|
|
225
|
+
const f = [];
|
|
226
|
+
return c.forEach((v) => {
|
|
227
|
+
f.push(v), v.children && f.push(...I(v.children, v.path + "."));
|
|
228
|
+
}), f;
|
|
229
|
+
}, le = ({
|
|
230
|
+
mapping: c,
|
|
231
|
+
defaultMapping: $,
|
|
232
|
+
mode: f = "full",
|
|
233
|
+
sourceSchemas: v = [],
|
|
234
|
+
targetSchemas: y = [],
|
|
235
|
+
onMappingChange: p,
|
|
236
|
+
onExport: b,
|
|
237
|
+
onTest: h,
|
|
238
|
+
onSave: x,
|
|
239
|
+
className: u,
|
|
240
|
+
style: F,
|
|
241
|
+
"data-testid": J
|
|
240
242
|
}) => {
|
|
241
|
-
const { t:
|
|
243
|
+
const { t: n } = X(), [l, B] = Z({
|
|
244
|
+
value: c,
|
|
245
|
+
defaultValue: $,
|
|
246
|
+
fallbackValue: ae,
|
|
247
|
+
onChange: p,
|
|
248
|
+
componentName: "NiceDataMapper"
|
|
249
|
+
}), [q, _] = k("mapping"), M = f === "mapping" ? "mapping" : q, [re, ne] = k(null), [N, A] = k(""), [W, j] = k(""), [C, O] = k(null), g = ee(
|
|
242
250
|
(e) => {
|
|
243
|
-
|
|
244
|
-
E(o), b?.(o);
|
|
251
|
+
B({ ...l, ...e });
|
|
245
252
|
},
|
|
246
|
-
[
|
|
247
|
-
),
|
|
248
|
-
() =>
|
|
249
|
-
[
|
|
250
|
-
),
|
|
251
|
-
() =>
|
|
252
|
-
[
|
|
253
|
-
),
|
|
253
|
+
[l, B]
|
|
254
|
+
), U = T(
|
|
255
|
+
() => I(l.sourceSchema.fields),
|
|
256
|
+
[l.sourceSchema.fields]
|
|
257
|
+
), w = T(
|
|
258
|
+
() => I(l.targetSchema.fields),
|
|
259
|
+
[l.targetSchema.fields]
|
|
260
|
+
), V = (e, o) => {
|
|
254
261
|
const d = {
|
|
255
262
|
id: `mapping-${Date.now()}`,
|
|
256
263
|
sourceField: e,
|
|
257
264
|
targetField: o
|
|
258
265
|
};
|
|
259
|
-
|
|
260
|
-
},
|
|
261
|
-
|
|
262
|
-
},
|
|
266
|
+
g({ fieldMappings: [...l.fieldMappings, d] });
|
|
267
|
+
}, G = (e) => {
|
|
268
|
+
g({ fieldMappings: l.fieldMappings.filter((o) => o.id !== e) });
|
|
269
|
+
}, H = () => {
|
|
263
270
|
try {
|
|
264
|
-
const e = JSON.parse(
|
|
265
|
-
|
|
271
|
+
const e = JSON.parse(N), o = {};
|
|
272
|
+
l.fieldMappings.forEach((d) => {
|
|
266
273
|
if (!d.sourceField) {
|
|
267
274
|
o[d.targetField] = d.defaultValue;
|
|
268
275
|
return;
|
|
269
276
|
}
|
|
270
|
-
const
|
|
277
|
+
const r = d.sourceField.split(",").map((S) => S.trim()), m = (S) => S.split(".").reduce((K, Q) => K?.[Q], e), R = l.transformations.find((S) => S.id === d.transform);
|
|
271
278
|
if (R?.type === "concat")
|
|
272
|
-
o[d.targetField] =
|
|
273
|
-
else if (R?.type === "format" &&
|
|
274
|
-
const
|
|
279
|
+
o[d.targetField] = r.map(m).filter(Boolean).join(R.config.separator || " ");
|
|
280
|
+
else if (R?.type === "format" && r.length === 1) {
|
|
281
|
+
const S = m(r[0]);
|
|
275
282
|
o[d.targetField] = (R.config.format || "{value}").replace(
|
|
276
283
|
"{value}",
|
|
277
|
-
String(
|
|
284
|
+
String(S)
|
|
278
285
|
);
|
|
279
|
-
} else
|
|
280
|
-
}),
|
|
286
|
+
} else r.length === 1 && (o[d.targetField] = m(r[0]) ?? d.defaultValue);
|
|
287
|
+
}), j(JSON.stringify(o, null, 2)), h?.(o);
|
|
281
288
|
} catch (e) {
|
|
282
|
-
|
|
289
|
+
j(`Error: ${e.message}`);
|
|
283
290
|
}
|
|
284
|
-
},
|
|
291
|
+
}, D = T(() => te(l), [l]), t = {
|
|
285
292
|
bg: "var(--nice-bg-elevated, #1e1e1e)",
|
|
286
293
|
cardBg: "var(--nice-bg-elevated, #252525)",
|
|
287
294
|
border: "var(--nice-bg-tertiary, #333)",
|
|
@@ -289,64 +296,66 @@ ${b}
|
|
|
289
296
|
textMuted: "var(--nice-text-muted, #888)",
|
|
290
297
|
accent: "var(--nice-color-primary, #3b82f6)"
|
|
291
298
|
};
|
|
292
|
-
return /* @__PURE__ */
|
|
299
|
+
return /* @__PURE__ */ i(
|
|
293
300
|
"div",
|
|
294
301
|
{
|
|
295
|
-
className: `nice-data-mapper ${
|
|
302
|
+
className: `nice-data-mapper ${u || ""}`,
|
|
296
303
|
style: {
|
|
297
304
|
display: "flex",
|
|
298
305
|
flexDirection: "column",
|
|
299
306
|
height: "100%",
|
|
300
|
-
background:
|
|
301
|
-
color:
|
|
307
|
+
background: t.bg,
|
|
308
|
+
color: t.text,
|
|
302
309
|
fontFamily: "system-ui, sans-serif",
|
|
303
|
-
...
|
|
310
|
+
...F
|
|
304
311
|
},
|
|
305
|
-
"data-testid":
|
|
312
|
+
"data-testid": J,
|
|
306
313
|
children: [
|
|
307
|
-
/* @__PURE__ */
|
|
314
|
+
/* @__PURE__ */ i(
|
|
308
315
|
"div",
|
|
309
316
|
{
|
|
310
317
|
style: {
|
|
311
318
|
padding: "16px 20px",
|
|
312
|
-
borderBottom: `1px solid ${
|
|
319
|
+
borderBottom: `1px solid ${t.border}`,
|
|
313
320
|
display: "flex",
|
|
314
321
|
alignItems: "center",
|
|
315
322
|
gap: 16
|
|
316
323
|
},
|
|
317
324
|
children: [
|
|
318
|
-
/* @__PURE__ */
|
|
325
|
+
/* @__PURE__ */ i(
|
|
319
326
|
"h3",
|
|
320
327
|
{
|
|
321
328
|
style: { margin: 0, fontSize: 18, display: "inline-flex", alignItems: "center", gap: 6 },
|
|
322
329
|
children: [
|
|
323
|
-
/* @__PURE__ */
|
|
330
|
+
/* @__PURE__ */ a(s, { name: "refresh", size: 16 }),
|
|
324
331
|
" ",
|
|
325
|
-
|
|
332
|
+
n("dataMapper.dataMapper", "Data Mapper")
|
|
326
333
|
]
|
|
327
334
|
}
|
|
328
335
|
),
|
|
329
|
-
/* @__PURE__ */
|
|
336
|
+
f !== "mapping" && /* @__PURE__ */ a(
|
|
330
337
|
"input",
|
|
331
338
|
{
|
|
332
339
|
type: "text",
|
|
333
|
-
|
|
334
|
-
|
|
340
|
+
"aria-label": n("dataMapper.name", "Mapping name"),
|
|
341
|
+
value: l.name,
|
|
342
|
+
onChange: (e) => g({ name: e.target.value }),
|
|
335
343
|
style: {
|
|
336
344
|
padding: "6px 12px",
|
|
337
345
|
borderRadius: 4,
|
|
338
|
-
border: `1px solid ${
|
|
339
|
-
background:
|
|
340
|
-
color:
|
|
346
|
+
border: `1px solid ${t.border}`,
|
|
347
|
+
background: t.cardBg,
|
|
348
|
+
color: t.text,
|
|
341
349
|
fontSize: 14,
|
|
342
350
|
fontWeight: 600
|
|
343
351
|
}
|
|
344
352
|
}
|
|
345
353
|
),
|
|
346
|
-
/* @__PURE__ */
|
|
354
|
+
f !== "mapping" && /* @__PURE__ */ a("div", { style: { marginLeft: "auto", display: "flex", gap: 8 }, children: /* @__PURE__ */ i(
|
|
347
355
|
"button",
|
|
348
356
|
{
|
|
349
|
-
|
|
357
|
+
type: "button",
|
|
358
|
+
onClick: () => x?.(l),
|
|
350
359
|
style: {
|
|
351
360
|
padding: "8px 16px",
|
|
352
361
|
borderRadius: 6,
|
|
@@ -358,64 +367,64 @@ ${b}
|
|
|
358
367
|
fontWeight: 500
|
|
359
368
|
},
|
|
360
369
|
children: [
|
|
361
|
-
/* @__PURE__ */
|
|
370
|
+
/* @__PURE__ */ a(s, { name: "save", size: 14 }),
|
|
362
371
|
" ",
|
|
363
|
-
|
|
372
|
+
n("dataMapper.save", "Save")
|
|
364
373
|
]
|
|
365
374
|
}
|
|
366
375
|
) })
|
|
367
376
|
]
|
|
368
377
|
}
|
|
369
378
|
),
|
|
370
|
-
/* @__PURE__ */
|
|
379
|
+
f !== "mapping" && /* @__PURE__ */ a(
|
|
371
380
|
"div",
|
|
372
381
|
{
|
|
373
382
|
style: {
|
|
374
383
|
display: "flex",
|
|
375
|
-
borderBottom: `1px solid ${
|
|
384
|
+
borderBottom: `1px solid ${t.border}`,
|
|
376
385
|
padding: "0 20px"
|
|
377
386
|
},
|
|
378
387
|
children: ["mapping", "transforms", "validation", "test", "preview"].map(
|
|
379
|
-
(e) => /* @__PURE__ */
|
|
388
|
+
(e) => /* @__PURE__ */ i(
|
|
380
389
|
"button",
|
|
381
390
|
{
|
|
382
|
-
onClick: () =>
|
|
391
|
+
onClick: () => _(e),
|
|
383
392
|
style: {
|
|
384
393
|
padding: "12px 20px",
|
|
385
394
|
border: "none",
|
|
386
395
|
background: "transparent",
|
|
387
|
-
color:
|
|
396
|
+
color: M === e ? t.text : t.textMuted,
|
|
388
397
|
cursor: "pointer",
|
|
389
398
|
fontSize: 13,
|
|
390
|
-
fontWeight:
|
|
391
|
-
borderBottom:
|
|
399
|
+
fontWeight: M === e ? 600 : 400,
|
|
400
|
+
borderBottom: M === e ? `2px solid ${t.accent}` : "2px solid transparent",
|
|
392
401
|
marginBottom: -1
|
|
393
402
|
},
|
|
394
403
|
children: [
|
|
395
|
-
e === "mapping" && /* @__PURE__ */
|
|
396
|
-
/* @__PURE__ */
|
|
404
|
+
e === "mapping" && /* @__PURE__ */ i(z, { children: [
|
|
405
|
+
/* @__PURE__ */ a(s, { name: "link", size: 14 }),
|
|
397
406
|
" ",
|
|
398
|
-
|
|
407
|
+
n("dataMapper.mapping", "Mapping")
|
|
399
408
|
] }),
|
|
400
|
-
e === "transforms" && /* @__PURE__ */
|
|
401
|
-
/* @__PURE__ */
|
|
409
|
+
e === "transforms" && /* @__PURE__ */ i(z, { children: [
|
|
410
|
+
/* @__PURE__ */ a(s, { name: "zap", size: 14 }),
|
|
402
411
|
" ",
|
|
403
|
-
|
|
412
|
+
n("dataMapper.transforms", "Transforms")
|
|
404
413
|
] }),
|
|
405
|
-
e === "validation" && /* @__PURE__ */
|
|
406
|
-
/* @__PURE__ */
|
|
414
|
+
e === "validation" && /* @__PURE__ */ i(z, { children: [
|
|
415
|
+
/* @__PURE__ */ a(s, { name: "check", size: 14 }),
|
|
407
416
|
" ",
|
|
408
|
-
|
|
417
|
+
n("dataMapper.validation", "Validation")
|
|
409
418
|
] }),
|
|
410
|
-
e === "test" && /* @__PURE__ */
|
|
411
|
-
/* @__PURE__ */
|
|
419
|
+
e === "test" && /* @__PURE__ */ i(z, { children: [
|
|
420
|
+
/* @__PURE__ */ a(s, { name: "flask", size: 14 }),
|
|
412
421
|
" ",
|
|
413
|
-
|
|
422
|
+
n("dataMapper.test", "Test")
|
|
414
423
|
] }),
|
|
415
|
-
e === "preview" && /* @__PURE__ */
|
|
416
|
-
/* @__PURE__ */
|
|
424
|
+
e === "preview" && /* @__PURE__ */ i(z, { children: [
|
|
425
|
+
/* @__PURE__ */ a(s, { name: "eye", size: 14 }),
|
|
417
426
|
" ",
|
|
418
|
-
|
|
427
|
+
n("dataMapper.preview", "Preview")
|
|
419
428
|
] })
|
|
420
429
|
]
|
|
421
430
|
},
|
|
@@ -424,10 +433,10 @@ ${b}
|
|
|
424
433
|
)
|
|
425
434
|
}
|
|
426
435
|
),
|
|
427
|
-
/* @__PURE__ */
|
|
428
|
-
|
|
429
|
-
/* @__PURE__ */
|
|
430
|
-
/* @__PURE__ */
|
|
436
|
+
/* @__PURE__ */ i("div", { style: { flex: 1, overflow: "auto", padding: 20 }, children: [
|
|
437
|
+
M === "mapping" && /* @__PURE__ */ i("div", { style: { display: "flex", gap: 24, height: "100%" }, children: [
|
|
438
|
+
/* @__PURE__ */ i("div", { style: { flex: 1, display: "flex", flexDirection: "column" }, children: [
|
|
439
|
+
/* @__PURE__ */ i(
|
|
431
440
|
"div",
|
|
432
441
|
{
|
|
433
442
|
style: {
|
|
@@ -438,39 +447,39 @@ ${b}
|
|
|
438
447
|
fontWeight: 600
|
|
439
448
|
},
|
|
440
449
|
children: [
|
|
441
|
-
/* @__PURE__ */
|
|
450
|
+
/* @__PURE__ */ a(s, { name: "download", size: 14 }),
|
|
442
451
|
" ",
|
|
443
|
-
|
|
452
|
+
n("dataMapper.source", "Source: {name}").replace(
|
|
444
453
|
"{name}",
|
|
445
|
-
String(
|
|
454
|
+
String(l.sourceSchema.name)
|
|
446
455
|
)
|
|
447
456
|
]
|
|
448
457
|
}
|
|
449
458
|
),
|
|
450
|
-
/* @__PURE__ */
|
|
459
|
+
/* @__PURE__ */ a(
|
|
451
460
|
"div",
|
|
452
461
|
{
|
|
453
462
|
style: {
|
|
454
463
|
flex: 1,
|
|
455
|
-
border: `1px solid ${
|
|
464
|
+
border: `1px solid ${t.border}`,
|
|
456
465
|
borderTop: "none",
|
|
457
466
|
borderRadius: "0 0 8px 8px",
|
|
458
467
|
overflow: "auto"
|
|
459
468
|
},
|
|
460
|
-
children:
|
|
461
|
-
const o = e.path.split(".").length - 1, d =
|
|
462
|
-
(
|
|
469
|
+
children: U.map((e) => {
|
|
470
|
+
const o = e.path.split(".").length - 1, d = l.fieldMappings.some(
|
|
471
|
+
(r) => r.sourceField.split(",").some((m) => m.trim() === e.path)
|
|
463
472
|
);
|
|
464
|
-
return /* @__PURE__ */
|
|
473
|
+
return /* @__PURE__ */ i(
|
|
465
474
|
"div",
|
|
466
475
|
{
|
|
467
476
|
draggable: !0,
|
|
468
|
-
onDragStart: () =>
|
|
469
|
-
onDragEnd: () =>
|
|
477
|
+
onDragStart: () => O(e.path),
|
|
478
|
+
onDragEnd: () => O(null),
|
|
470
479
|
style: {
|
|
471
480
|
padding: "10px 12px",
|
|
472
481
|
paddingLeft: 12 + o * 16,
|
|
473
|
-
borderBottom: `1px solid ${
|
|
482
|
+
borderBottom: `1px solid ${t.border}`,
|
|
474
483
|
display: "flex",
|
|
475
484
|
alignItems: "center",
|
|
476
485
|
gap: 8,
|
|
@@ -479,10 +488,10 @@ ${b}
|
|
|
479
488
|
opacity: e.type === "object" && e.children ? 0.7 : 1
|
|
480
489
|
},
|
|
481
490
|
children: [
|
|
482
|
-
/* @__PURE__ */
|
|
483
|
-
/* @__PURE__ */
|
|
484
|
-
/* @__PURE__ */
|
|
485
|
-
d && /* @__PURE__ */
|
|
491
|
+
/* @__PURE__ */ a("span", { style: { color: Y[e.type], fontSize: 14 }, children: /* @__PURE__ */ a(s, { name: L[e.type], size: 14 }) }),
|
|
492
|
+
/* @__PURE__ */ a("span", { style: { fontFamily: "monospace", fontSize: 12 }, children: e.name }),
|
|
493
|
+
/* @__PURE__ */ a("span", { style: { fontSize: 10, color: t.textMuted }, children: e.type }),
|
|
494
|
+
d && /* @__PURE__ */ a(
|
|
486
495
|
"span",
|
|
487
496
|
{
|
|
488
497
|
style: {
|
|
@@ -490,7 +499,35 @@ ${b}
|
|
|
490
499
|
color: "var(--nice-color-success, #22c55e)",
|
|
491
500
|
fontSize: 10
|
|
492
501
|
},
|
|
493
|
-
children: /* @__PURE__ */
|
|
502
|
+
children: /* @__PURE__ */ a(s, { name: "check", size: 14 })
|
|
503
|
+
}
|
|
504
|
+
),
|
|
505
|
+
!(e.type === "object" && e.children) && /* @__PURE__ */ i(
|
|
506
|
+
"select",
|
|
507
|
+
{
|
|
508
|
+
"aria-label": n("dataMapper.mapTo", "Map {field} to").replace(
|
|
509
|
+
"{field}",
|
|
510
|
+
e.name
|
|
511
|
+
),
|
|
512
|
+
value: "",
|
|
513
|
+
onChange: (r) => {
|
|
514
|
+
r.target.value && V(e.path, r.target.value);
|
|
515
|
+
},
|
|
516
|
+
style: {
|
|
517
|
+
marginLeft: d ? 4 : "auto",
|
|
518
|
+
maxWidth: 130,
|
|
519
|
+
fontSize: 11,
|
|
520
|
+
background: t.cardBg,
|
|
521
|
+
color: t.text,
|
|
522
|
+
border: `1px solid ${t.border}`,
|
|
523
|
+
borderRadius: 4
|
|
524
|
+
},
|
|
525
|
+
children: [
|
|
526
|
+
/* @__PURE__ */ a("option", { value: "", children: n("dataMapper.mapToPlaceholder", "Map to…") }),
|
|
527
|
+
w.filter(
|
|
528
|
+
(r) => !(r.type === "object" && r.children) && !l.fieldMappings.some((m) => m.targetField === r.path)
|
|
529
|
+
).map((r) => /* @__PURE__ */ a("option", { value: r.path, children: r.path }, r.id))
|
|
530
|
+
]
|
|
494
531
|
}
|
|
495
532
|
)
|
|
496
533
|
]
|
|
@@ -501,64 +538,64 @@ ${b}
|
|
|
501
538
|
}
|
|
502
539
|
)
|
|
503
540
|
] }),
|
|
504
|
-
/* @__PURE__ */
|
|
505
|
-
/* @__PURE__ */
|
|
541
|
+
/* @__PURE__ */ i("div", { style: { width: 300, display: "flex", flexDirection: "column" }, children: [
|
|
542
|
+
/* @__PURE__ */ i(
|
|
506
543
|
"div",
|
|
507
544
|
{
|
|
508
545
|
style: {
|
|
509
546
|
padding: "12px 16px",
|
|
510
|
-
background:
|
|
547
|
+
background: t.accent + "20",
|
|
511
548
|
borderRadius: "8px 8px 0 0",
|
|
512
549
|
fontSize: 13,
|
|
513
550
|
fontWeight: 600
|
|
514
551
|
},
|
|
515
552
|
children: [
|
|
516
|
-
/* @__PURE__ */
|
|
553
|
+
/* @__PURE__ */ a(s, { name: "link", size: 16 }),
|
|
517
554
|
" ",
|
|
518
|
-
|
|
555
|
+
n("dataMapper.mappings", "Mappings ({fieldMappings})").replace(
|
|
519
556
|
"{fieldMappings}",
|
|
520
|
-
String(
|
|
557
|
+
String(l.fieldMappings.length)
|
|
521
558
|
)
|
|
522
559
|
]
|
|
523
560
|
}
|
|
524
561
|
),
|
|
525
|
-
/* @__PURE__ */
|
|
562
|
+
/* @__PURE__ */ a(
|
|
526
563
|
"div",
|
|
527
564
|
{
|
|
528
565
|
style: {
|
|
529
566
|
flex: 1,
|
|
530
|
-
border: `1px solid ${
|
|
567
|
+
border: `1px solid ${t.border}`,
|
|
531
568
|
borderTop: "none",
|
|
532
569
|
borderRadius: "0 0 8px 8px",
|
|
533
570
|
overflow: "auto",
|
|
534
571
|
padding: 8
|
|
535
572
|
},
|
|
536
|
-
children:
|
|
537
|
-
const o =
|
|
538
|
-
return /* @__PURE__ */
|
|
573
|
+
children: l.fieldMappings.map((e) => {
|
|
574
|
+
const o = l.transformations.find((d) => d.id === e.transform);
|
|
575
|
+
return /* @__PURE__ */ i(
|
|
539
576
|
"div",
|
|
540
577
|
{
|
|
541
578
|
style: {
|
|
542
579
|
padding: 8,
|
|
543
|
-
background:
|
|
580
|
+
background: t.cardBg,
|
|
544
581
|
borderRadius: 6,
|
|
545
582
|
marginBottom: 8,
|
|
546
583
|
fontSize: 11
|
|
547
584
|
},
|
|
548
585
|
children: [
|
|
549
|
-
/* @__PURE__ */
|
|
586
|
+
/* @__PURE__ */ i(
|
|
550
587
|
"div",
|
|
551
588
|
{
|
|
552
589
|
style: { display: "flex", alignItems: "center", gap: 4, marginBottom: 4 },
|
|
553
590
|
children: [
|
|
554
|
-
/* @__PURE__ */
|
|
555
|
-
/* @__PURE__ */
|
|
556
|
-
/* @__PURE__ */
|
|
557
|
-
/* @__PURE__ */
|
|
591
|
+
/* @__PURE__ */ a("code", { style: { color: "var(--nice-color-success, #22c55e)" }, children: e.sourceField || "(default)" }),
|
|
592
|
+
/* @__PURE__ */ a("span", { style: { color: t.textMuted }, children: /* @__PURE__ */ a(s, { name: "arrow-right", size: 12 }) }),
|
|
593
|
+
/* @__PURE__ */ a("code", { style: { color: "var(--nice-color-primary, #3b82f6)" }, children: e.targetField }),
|
|
594
|
+
/* @__PURE__ */ a(
|
|
558
595
|
"button",
|
|
559
596
|
{
|
|
560
|
-
onClick: () =>
|
|
561
|
-
"aria-label":
|
|
597
|
+
onClick: () => G(e.id),
|
|
598
|
+
"aria-label": n("dataMapper.removeMapping", "Remove mapping"),
|
|
562
599
|
style: {
|
|
563
600
|
marginLeft: "auto",
|
|
564
601
|
padding: 2,
|
|
@@ -568,29 +605,29 @@ ${b}
|
|
|
568
605
|
cursor: "pointer",
|
|
569
606
|
fontSize: 10
|
|
570
607
|
},
|
|
571
|
-
children: /* @__PURE__ */
|
|
608
|
+
children: /* @__PURE__ */ a(s, { name: "close", size: 14 })
|
|
572
609
|
}
|
|
573
610
|
)
|
|
574
611
|
]
|
|
575
612
|
}
|
|
576
613
|
),
|
|
577
|
-
o && /* @__PURE__ */
|
|
614
|
+
o && /* @__PURE__ */ i(
|
|
578
615
|
"div",
|
|
579
616
|
{
|
|
580
617
|
style: {
|
|
581
|
-
color:
|
|
618
|
+
color: t.textMuted,
|
|
582
619
|
display: "flex",
|
|
583
620
|
alignItems: "center",
|
|
584
621
|
gap: 4
|
|
585
622
|
},
|
|
586
623
|
children: [
|
|
587
|
-
/* @__PURE__ */
|
|
624
|
+
/* @__PURE__ */ a(s, { name: P[o.type], size: 14 }),
|
|
588
625
|
" ",
|
|
589
626
|
o.name
|
|
590
627
|
]
|
|
591
628
|
}
|
|
592
629
|
),
|
|
593
|
-
e.defaultValue !== void 0 && /* @__PURE__ */
|
|
630
|
+
e.defaultValue !== void 0 && /* @__PURE__ */ a("div", { style: { color: "var(--nice-color-warning, #f59e0b)" }, children: n("dataMapper.default", "Default: {defaultValue}").replace(
|
|
594
631
|
"{defaultValue}",
|
|
595
632
|
String(JSON.stringify(e.defaultValue))
|
|
596
633
|
) })
|
|
@@ -602,8 +639,8 @@ ${b}
|
|
|
602
639
|
}
|
|
603
640
|
)
|
|
604
641
|
] }),
|
|
605
|
-
/* @__PURE__ */
|
|
606
|
-
/* @__PURE__ */
|
|
642
|
+
/* @__PURE__ */ i("div", { style: { flex: 1, display: "flex", flexDirection: "column" }, children: [
|
|
643
|
+
/* @__PURE__ */ i(
|
|
607
644
|
"div",
|
|
608
645
|
{
|
|
609
646
|
style: {
|
|
@@ -614,50 +651,50 @@ ${b}
|
|
|
614
651
|
fontWeight: 600
|
|
615
652
|
},
|
|
616
653
|
children: [
|
|
617
|
-
/* @__PURE__ */
|
|
654
|
+
/* @__PURE__ */ a(s, { name: "upload", size: 14 }),
|
|
618
655
|
" ",
|
|
619
|
-
|
|
656
|
+
n("dataMapper.target", "Target: {name}").replace(
|
|
620
657
|
"{name}",
|
|
621
|
-
String(
|
|
658
|
+
String(l.targetSchema.name)
|
|
622
659
|
)
|
|
623
660
|
]
|
|
624
661
|
}
|
|
625
662
|
),
|
|
626
|
-
/* @__PURE__ */
|
|
663
|
+
/* @__PURE__ */ a(
|
|
627
664
|
"div",
|
|
628
665
|
{
|
|
629
666
|
style: {
|
|
630
667
|
flex: 1,
|
|
631
|
-
border: `1px solid ${
|
|
668
|
+
border: `1px solid ${t.border}`,
|
|
632
669
|
borderTop: "none",
|
|
633
670
|
borderRadius: "0 0 8px 8px",
|
|
634
671
|
overflow: "auto"
|
|
635
672
|
},
|
|
636
|
-
children:
|
|
637
|
-
const o = e.path.split(".").length - 1, d =
|
|
638
|
-
return /* @__PURE__ */
|
|
673
|
+
children: w.map((e) => {
|
|
674
|
+
const o = e.path.split(".").length - 1, d = l.fieldMappings.some((r) => r.targetField === e.path);
|
|
675
|
+
return /* @__PURE__ */ i(
|
|
639
676
|
"div",
|
|
640
677
|
{
|
|
641
|
-
onDragOver: (
|
|
678
|
+
onDragOver: (r) => r.preventDefault(),
|
|
642
679
|
onDrop: () => {
|
|
643
|
-
|
|
680
|
+
C && !d && V(C, e.path);
|
|
644
681
|
},
|
|
645
682
|
style: {
|
|
646
683
|
padding: "10px 12px",
|
|
647
684
|
paddingLeft: 12 + o * 16,
|
|
648
|
-
borderBottom: `1px solid ${
|
|
685
|
+
borderBottom: `1px solid ${t.border}`,
|
|
649
686
|
display: "flex",
|
|
650
687
|
alignItems: "center",
|
|
651
688
|
gap: 8,
|
|
652
|
-
background:
|
|
689
|
+
background: C && !d ? t.accent + "10" : d ? "color-mix(in srgb, var(--nice-color-primary, #3b82f6) 6%, transparent)" : "transparent",
|
|
653
690
|
transition: "background 0.15s"
|
|
654
691
|
},
|
|
655
692
|
children: [
|
|
656
|
-
/* @__PURE__ */
|
|
657
|
-
/* @__PURE__ */
|
|
658
|
-
/* @__PURE__ */
|
|
659
|
-
e.nullable && /* @__PURE__ */
|
|
660
|
-
d && /* @__PURE__ */
|
|
693
|
+
/* @__PURE__ */ a("span", { style: { color: Y[e.type], fontSize: 14 }, children: /* @__PURE__ */ a(s, { name: L[e.type], size: 14 }) }),
|
|
694
|
+
/* @__PURE__ */ a("span", { style: { fontFamily: "monospace", fontSize: 12 }, children: e.name }),
|
|
695
|
+
/* @__PURE__ */ a("span", { style: { fontSize: 10, color: t.textMuted }, children: e.type }),
|
|
696
|
+
e.nullable && /* @__PURE__ */ a("span", { style: { fontSize: 10, color: t.textMuted }, children: "?" }),
|
|
697
|
+
d && /* @__PURE__ */ a(
|
|
661
698
|
"span",
|
|
662
699
|
{
|
|
663
700
|
style: {
|
|
@@ -665,7 +702,7 @@ ${b}
|
|
|
665
702
|
color: "var(--nice-color-primary, #3b82f6)",
|
|
666
703
|
fontSize: 10
|
|
667
704
|
},
|
|
668
|
-
children: /* @__PURE__ */
|
|
705
|
+
children: /* @__PURE__ */ a(s, { name: "check", size: 14 })
|
|
669
706
|
}
|
|
670
707
|
)
|
|
671
708
|
]
|
|
@@ -677,14 +714,14 @@ ${b}
|
|
|
677
714
|
)
|
|
678
715
|
] })
|
|
679
716
|
] }),
|
|
680
|
-
|
|
681
|
-
/* @__PURE__ */
|
|
682
|
-
/* @__PURE__ */
|
|
683
|
-
/* @__PURE__ */
|
|
717
|
+
M === "transforms" && /* @__PURE__ */ i("div", { children: [
|
|
718
|
+
/* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", gap: 12, marginBottom: 20 }, children: [
|
|
719
|
+
/* @__PURE__ */ i("h4", { style: { margin: 0, display: "inline-flex", alignItems: "center", gap: 6 }, children: [
|
|
720
|
+
/* @__PURE__ */ a(s, { name: "zap", size: 16 }),
|
|
684
721
|
" ",
|
|
685
|
-
|
|
722
|
+
n("dataMapper.transformations", "Transformations")
|
|
686
723
|
] }),
|
|
687
|
-
/* @__PURE__ */
|
|
724
|
+
/* @__PURE__ */ a(
|
|
688
725
|
"button",
|
|
689
726
|
{
|
|
690
727
|
onClick: () => {
|
|
@@ -694,22 +731,22 @@ ${b}
|
|
|
694
731
|
type: "direct",
|
|
695
732
|
config: {}
|
|
696
733
|
};
|
|
697
|
-
|
|
734
|
+
g({ transformations: [...l.transformations, e] });
|
|
698
735
|
},
|
|
699
736
|
style: {
|
|
700
737
|
padding: "6px 12px",
|
|
701
738
|
borderRadius: 4,
|
|
702
739
|
border: "none",
|
|
703
|
-
background:
|
|
740
|
+
background: t.accent,
|
|
704
741
|
color: "var(--nice-color-white, #fff)",
|
|
705
742
|
cursor: "pointer",
|
|
706
743
|
fontSize: 12
|
|
707
744
|
},
|
|
708
|
-
children:
|
|
745
|
+
children: n("dataMapper.addTransform", "+ Add Transform")
|
|
709
746
|
}
|
|
710
747
|
)
|
|
711
748
|
] }),
|
|
712
|
-
/* @__PURE__ */
|
|
749
|
+
/* @__PURE__ */ a(
|
|
713
750
|
"div",
|
|
714
751
|
{
|
|
715
752
|
style: {
|
|
@@ -717,126 +754,126 @@ ${b}
|
|
|
717
754
|
gridTemplateColumns: "repeat(auto-fill, minmax(300px, 1fr))",
|
|
718
755
|
gap: 16
|
|
719
756
|
},
|
|
720
|
-
children:
|
|
757
|
+
children: l.transformations.map((e) => /* @__PURE__ */ i(
|
|
721
758
|
"div",
|
|
722
759
|
{
|
|
723
760
|
style: {
|
|
724
761
|
padding: 16,
|
|
725
|
-
background:
|
|
762
|
+
background: t.cardBg,
|
|
726
763
|
borderRadius: 8,
|
|
727
|
-
border: `1px solid ${
|
|
764
|
+
border: `1px solid ${t.border}`
|
|
728
765
|
},
|
|
729
766
|
children: [
|
|
730
|
-
/* @__PURE__ */
|
|
731
|
-
/* @__PURE__ */
|
|
732
|
-
/* @__PURE__ */
|
|
767
|
+
/* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 12 }, children: [
|
|
768
|
+
/* @__PURE__ */ a("span", { style: { fontSize: 20 }, children: /* @__PURE__ */ a(s, { name: P[e.type], size: 20 }) }),
|
|
769
|
+
/* @__PURE__ */ a(
|
|
733
770
|
"input",
|
|
734
771
|
{
|
|
735
772
|
type: "text",
|
|
736
773
|
value: e.name,
|
|
737
774
|
onChange: (o) => {
|
|
738
|
-
const d =
|
|
739
|
-
(
|
|
775
|
+
const d = l.transformations.map(
|
|
776
|
+
(r) => r.id === e.id ? { ...r, name: o.target.value } : r
|
|
740
777
|
);
|
|
741
|
-
|
|
778
|
+
g({ transformations: d });
|
|
742
779
|
},
|
|
743
780
|
style: {
|
|
744
781
|
flex: 1,
|
|
745
782
|
padding: "6px 8px",
|
|
746
783
|
borderRadius: 4,
|
|
747
|
-
border: `1px solid ${
|
|
748
|
-
background:
|
|
749
|
-
color:
|
|
784
|
+
border: `1px solid ${t.border}`,
|
|
785
|
+
background: t.bg,
|
|
786
|
+
color: t.text,
|
|
750
787
|
fontSize: 13,
|
|
751
788
|
fontWeight: 600
|
|
752
789
|
}
|
|
753
790
|
}
|
|
754
791
|
)
|
|
755
792
|
] }),
|
|
756
|
-
/* @__PURE__ */
|
|
757
|
-
/* @__PURE__ */
|
|
793
|
+
/* @__PURE__ */ i("div", { style: { marginBottom: 12 }, children: [
|
|
794
|
+
/* @__PURE__ */ a(
|
|
758
795
|
"label",
|
|
759
796
|
{
|
|
760
797
|
style: {
|
|
761
798
|
display: "block",
|
|
762
799
|
fontSize: 11,
|
|
763
|
-
color:
|
|
800
|
+
color: t.textMuted,
|
|
764
801
|
marginBottom: 4
|
|
765
802
|
},
|
|
766
|
-
children:
|
|
803
|
+
children: n("dataMapper.type", "Type")
|
|
767
804
|
}
|
|
768
805
|
),
|
|
769
|
-
/* @__PURE__ */
|
|
806
|
+
/* @__PURE__ */ i(
|
|
770
807
|
"select",
|
|
771
808
|
{
|
|
772
809
|
value: e.type,
|
|
773
810
|
onChange: (o) => {
|
|
774
|
-
const d =
|
|
775
|
-
(
|
|
811
|
+
const d = l.transformations.map(
|
|
812
|
+
(r) => r.id === e.id ? { ...r, type: o.target.value } : r
|
|
776
813
|
);
|
|
777
|
-
|
|
814
|
+
g({ transformations: d });
|
|
778
815
|
},
|
|
779
816
|
style: {
|
|
780
817
|
width: "100%",
|
|
781
818
|
padding: "8px 12px",
|
|
782
819
|
borderRadius: 4,
|
|
783
|
-
border: `1px solid ${
|
|
784
|
-
background:
|
|
785
|
-
color:
|
|
820
|
+
border: `1px solid ${t.border}`,
|
|
821
|
+
background: t.bg,
|
|
822
|
+
color: t.text,
|
|
786
823
|
fontSize: 12
|
|
787
824
|
},
|
|
788
825
|
children: [
|
|
789
|
-
/* @__PURE__ */
|
|
790
|
-
/* @__PURE__ */
|
|
791
|
-
/* @__PURE__ */
|
|
792
|
-
/* @__PURE__ */
|
|
793
|
-
/* @__PURE__ */
|
|
794
|
-
/* @__PURE__ */
|
|
795
|
-
/* @__PURE__ */
|
|
796
|
-
/* @__PURE__ */
|
|
797
|
-
/* @__PURE__ */
|
|
826
|
+
/* @__PURE__ */ a("option", { value: "direct", children: n("dataMapper.direct", "Direct") }),
|
|
827
|
+
/* @__PURE__ */ a("option", { value: "format", children: n("dataMapper.format", "Format") }),
|
|
828
|
+
/* @__PURE__ */ a("option", { value: "convert", children: n("dataMapper.convert", "Convert") }),
|
|
829
|
+
/* @__PURE__ */ a("option", { value: "concat", children: n("dataMapper.concatenate", "Concatenate") }),
|
|
830
|
+
/* @__PURE__ */ a("option", { value: "split", children: n("dataMapper.split", "Split") }),
|
|
831
|
+
/* @__PURE__ */ a("option", { value: "calculate", children: n("dataMapper.calculate", "Calculate") }),
|
|
832
|
+
/* @__PURE__ */ a("option", { value: "lookup", children: n("dataMapper.lookup", "Lookup") }),
|
|
833
|
+
/* @__PURE__ */ a("option", { value: "conditional", children: n("dataMapper.conditional", "Conditional") }),
|
|
834
|
+
/* @__PURE__ */ a("option", { value: "custom", children: n("dataMapper.custom", "Custom") })
|
|
798
835
|
]
|
|
799
836
|
}
|
|
800
837
|
)
|
|
801
838
|
] }),
|
|
802
|
-
(e.type === "format" || e.type === "concat") && /* @__PURE__ */
|
|
803
|
-
/* @__PURE__ */
|
|
839
|
+
(e.type === "format" || e.type === "concat") && /* @__PURE__ */ i("div", { children: [
|
|
840
|
+
/* @__PURE__ */ a(
|
|
804
841
|
"label",
|
|
805
842
|
{
|
|
806
843
|
style: {
|
|
807
844
|
display: "block",
|
|
808
845
|
fontSize: 11,
|
|
809
|
-
color:
|
|
846
|
+
color: t.textMuted,
|
|
810
847
|
marginBottom: 4
|
|
811
848
|
},
|
|
812
|
-
children: e.type === "format" ?
|
|
849
|
+
children: e.type === "format" ? n("dataMapper.formatPattern", "Format Pattern") : n("dataMapper.separator", "Separator")
|
|
813
850
|
}
|
|
814
851
|
),
|
|
815
|
-
/* @__PURE__ */
|
|
852
|
+
/* @__PURE__ */ a(
|
|
816
853
|
"input",
|
|
817
854
|
{
|
|
818
855
|
type: "text",
|
|
819
856
|
value: e.type === "format" ? e.config.format || "" : e.config.separator || "",
|
|
820
857
|
onChange: (o) => {
|
|
821
|
-
const d =
|
|
822
|
-
(
|
|
823
|
-
...
|
|
858
|
+
const d = l.transformations.map(
|
|
859
|
+
(r) => r.id === e.id ? {
|
|
860
|
+
...r,
|
|
824
861
|
config: {
|
|
825
|
-
...
|
|
862
|
+
...r.config,
|
|
826
863
|
[e.type === "format" ? "format" : "separator"]: o.target.value
|
|
827
864
|
}
|
|
828
|
-
} :
|
|
865
|
+
} : r
|
|
829
866
|
);
|
|
830
|
-
|
|
867
|
+
g({ transformations: d });
|
|
831
868
|
},
|
|
832
|
-
placeholder: e.type === "format" ?
|
|
869
|
+
placeholder: e.type === "format" ? n("dataMapper.orYyyyMmDd", "{value} or YYYY-MM-DD") : ", ",
|
|
833
870
|
style: {
|
|
834
871
|
width: "100%",
|
|
835
872
|
padding: "8px 12px",
|
|
836
873
|
borderRadius: 4,
|
|
837
|
-
border: `1px solid ${
|
|
838
|
-
background:
|
|
839
|
-
color:
|
|
874
|
+
border: `1px solid ${t.border}`,
|
|
875
|
+
background: t.bg,
|
|
876
|
+
color: t.text,
|
|
840
877
|
fontSize: 12,
|
|
841
878
|
fontFamily: "monospace",
|
|
842
879
|
boxSizing: "border-box"
|
|
@@ -844,37 +881,37 @@ ${b}
|
|
|
844
881
|
}
|
|
845
882
|
)
|
|
846
883
|
] }),
|
|
847
|
-
e.type === "custom" && /* @__PURE__ */
|
|
848
|
-
/* @__PURE__ */
|
|
884
|
+
e.type === "custom" && /* @__PURE__ */ i("div", { children: [
|
|
885
|
+
/* @__PURE__ */ a(
|
|
849
886
|
"label",
|
|
850
887
|
{
|
|
851
888
|
style: {
|
|
852
889
|
display: "block",
|
|
853
890
|
fontSize: 11,
|
|
854
|
-
color:
|
|
891
|
+
color: t.textMuted,
|
|
855
892
|
marginBottom: 4
|
|
856
893
|
},
|
|
857
|
-
children:
|
|
894
|
+
children: n("dataMapper.expression", "Expression")
|
|
858
895
|
}
|
|
859
896
|
),
|
|
860
|
-
/* @__PURE__ */
|
|
897
|
+
/* @__PURE__ */ a(
|
|
861
898
|
"textarea",
|
|
862
899
|
{
|
|
863
900
|
value: e.config.expression || "",
|
|
864
901
|
onChange: (o) => {
|
|
865
|
-
const d =
|
|
866
|
-
(
|
|
902
|
+
const d = l.transformations.map(
|
|
903
|
+
(r) => r.id === e.id ? { ...r, config: { ...r.config, expression: o.target.value } } : r
|
|
867
904
|
);
|
|
868
|
-
|
|
905
|
+
g({ transformations: d });
|
|
869
906
|
},
|
|
870
907
|
rows: 3,
|
|
871
908
|
style: {
|
|
872
909
|
width: "100%",
|
|
873
910
|
padding: "8px 12px",
|
|
874
911
|
borderRadius: 4,
|
|
875
|
-
border: `1px solid ${
|
|
876
|
-
background:
|
|
877
|
-
color:
|
|
912
|
+
border: `1px solid ${t.border}`,
|
|
913
|
+
background: t.bg,
|
|
914
|
+
color: t.text,
|
|
878
915
|
fontSize: 12,
|
|
879
916
|
fontFamily: "monospace",
|
|
880
917
|
resize: "vertical",
|
|
@@ -890,14 +927,14 @@ ${b}
|
|
|
890
927
|
}
|
|
891
928
|
)
|
|
892
929
|
] }),
|
|
893
|
-
|
|
894
|
-
/* @__PURE__ */
|
|
895
|
-
/* @__PURE__ */
|
|
896
|
-
/* @__PURE__ */
|
|
930
|
+
M === "validation" && /* @__PURE__ */ i("div", { children: [
|
|
931
|
+
/* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", gap: 12, marginBottom: 20 }, children: [
|
|
932
|
+
/* @__PURE__ */ i("h4", { style: { margin: 0, display: "inline-flex", alignItems: "center", gap: 6 }, children: [
|
|
933
|
+
/* @__PURE__ */ a(s, { name: "check", size: 16 }),
|
|
897
934
|
" ",
|
|
898
|
-
|
|
935
|
+
n("dataMapper.validationRules", "Validation Rules")
|
|
899
936
|
] }),
|
|
900
|
-
/* @__PURE__ */
|
|
937
|
+
/* @__PURE__ */ a(
|
|
901
938
|
"button",
|
|
902
939
|
{
|
|
903
940
|
onClick: () => {
|
|
@@ -907,141 +944,141 @@ ${b}
|
|
|
907
944
|
type: "required",
|
|
908
945
|
message: ""
|
|
909
946
|
};
|
|
910
|
-
|
|
947
|
+
g({ validationRules: [...l.validationRules, e] });
|
|
911
948
|
},
|
|
912
949
|
style: {
|
|
913
950
|
padding: "6px 12px",
|
|
914
951
|
borderRadius: 4,
|
|
915
952
|
border: "none",
|
|
916
|
-
background:
|
|
953
|
+
background: t.accent,
|
|
917
954
|
color: "var(--nice-color-white, #fff)",
|
|
918
955
|
cursor: "pointer",
|
|
919
956
|
fontSize: 12
|
|
920
957
|
},
|
|
921
|
-
children:
|
|
958
|
+
children: n("dataMapper.addRule", "+ Add Rule")
|
|
922
959
|
}
|
|
923
960
|
)
|
|
924
961
|
] }),
|
|
925
|
-
/* @__PURE__ */
|
|
962
|
+
/* @__PURE__ */ a("div", { style: { display: "flex", flexDirection: "column", gap: 12 }, children: l.validationRules.map((e) => /* @__PURE__ */ i(
|
|
926
963
|
"div",
|
|
927
964
|
{
|
|
928
965
|
style: {
|
|
929
966
|
padding: 16,
|
|
930
|
-
background:
|
|
967
|
+
background: t.cardBg,
|
|
931
968
|
borderRadius: 8,
|
|
932
969
|
display: "flex",
|
|
933
970
|
gap: 12,
|
|
934
971
|
alignItems: "center"
|
|
935
972
|
},
|
|
936
973
|
children: [
|
|
937
|
-
/* @__PURE__ */
|
|
974
|
+
/* @__PURE__ */ i(
|
|
938
975
|
"select",
|
|
939
976
|
{
|
|
940
977
|
value: e.field,
|
|
941
978
|
onChange: (o) => {
|
|
942
|
-
const d =
|
|
943
|
-
(
|
|
979
|
+
const d = l.validationRules.map(
|
|
980
|
+
(r) => r.id === e.id ? { ...r, field: o.target.value } : r
|
|
944
981
|
);
|
|
945
|
-
|
|
982
|
+
g({ validationRules: d });
|
|
946
983
|
},
|
|
947
984
|
style: {
|
|
948
985
|
padding: "8px 12px",
|
|
949
986
|
borderRadius: 4,
|
|
950
|
-
border: `1px solid ${
|
|
951
|
-
background:
|
|
952
|
-
color:
|
|
987
|
+
border: `1px solid ${t.border}`,
|
|
988
|
+
background: t.bg,
|
|
989
|
+
color: t.text,
|
|
953
990
|
fontSize: 12
|
|
954
991
|
},
|
|
955
992
|
children: [
|
|
956
|
-
/* @__PURE__ */
|
|
957
|
-
|
|
993
|
+
/* @__PURE__ */ a("option", { value: "", children: n("dataMapper.selectField", "Select field...") }),
|
|
994
|
+
w.map((o) => /* @__PURE__ */ a("option", { value: o.path, children: o.path }, o.id))
|
|
958
995
|
]
|
|
959
996
|
}
|
|
960
997
|
),
|
|
961
|
-
/* @__PURE__ */
|
|
998
|
+
/* @__PURE__ */ i(
|
|
962
999
|
"select",
|
|
963
1000
|
{
|
|
964
1001
|
value: e.type,
|
|
965
1002
|
onChange: (o) => {
|
|
966
|
-
const d =
|
|
967
|
-
(
|
|
1003
|
+
const d = l.validationRules.map(
|
|
1004
|
+
(r) => r.id === e.id ? { ...r, type: o.target.value } : r
|
|
968
1005
|
);
|
|
969
|
-
|
|
1006
|
+
g({ validationRules: d });
|
|
970
1007
|
},
|
|
971
1008
|
style: {
|
|
972
1009
|
padding: "8px 12px",
|
|
973
1010
|
borderRadius: 4,
|
|
974
|
-
border: `1px solid ${
|
|
975
|
-
background:
|
|
976
|
-
color:
|
|
1011
|
+
border: `1px solid ${t.border}`,
|
|
1012
|
+
background: t.bg,
|
|
1013
|
+
color: t.text,
|
|
977
1014
|
fontSize: 12
|
|
978
1015
|
},
|
|
979
1016
|
children: [
|
|
980
|
-
/* @__PURE__ */
|
|
981
|
-
/* @__PURE__ */
|
|
982
|
-
/* @__PURE__ */
|
|
983
|
-
/* @__PURE__ */
|
|
984
|
-
/* @__PURE__ */
|
|
985
|
-
/* @__PURE__ */
|
|
986
|
-
/* @__PURE__ */
|
|
1017
|
+
/* @__PURE__ */ a("option", { value: "required", children: n("dataMapper.required", "Required") }),
|
|
1018
|
+
/* @__PURE__ */ a("option", { value: "type", children: n("dataMapper.type", "Type") }),
|
|
1019
|
+
/* @__PURE__ */ a("option", { value: "min", children: n("dataMapper.min", "Min") }),
|
|
1020
|
+
/* @__PURE__ */ a("option", { value: "max", children: n("dataMapper.max", "Max") }),
|
|
1021
|
+
/* @__PURE__ */ a("option", { value: "pattern", children: n("dataMapper.pattern", "Pattern") }),
|
|
1022
|
+
/* @__PURE__ */ a("option", { value: "enum", children: n("dataMapper.enum", "Enum") }),
|
|
1023
|
+
/* @__PURE__ */ a("option", { value: "custom", children: n("dataMapper.custom", "Custom") })
|
|
987
1024
|
]
|
|
988
1025
|
}
|
|
989
1026
|
),
|
|
990
|
-
(e.type === "pattern" || e.type === "min" || e.type === "max") && /* @__PURE__ */
|
|
1027
|
+
(e.type === "pattern" || e.type === "min" || e.type === "max") && /* @__PURE__ */ a(
|
|
991
1028
|
"input",
|
|
992
1029
|
{
|
|
993
1030
|
type: "text",
|
|
994
1031
|
value: String(e.value || ""),
|
|
995
1032
|
onChange: (o) => {
|
|
996
|
-
const d =
|
|
997
|
-
(
|
|
1033
|
+
const d = l.validationRules.map(
|
|
1034
|
+
(r) => r.id === e.id ? { ...r, value: o.target.value } : r
|
|
998
1035
|
);
|
|
999
|
-
|
|
1036
|
+
g({ validationRules: d });
|
|
1000
1037
|
},
|
|
1001
|
-
placeholder:
|
|
1038
|
+
placeholder: n("dataMapper.value", "Value"),
|
|
1002
1039
|
style: {
|
|
1003
1040
|
padding: "8px 12px",
|
|
1004
1041
|
borderRadius: 4,
|
|
1005
|
-
border: `1px solid ${
|
|
1006
|
-
background:
|
|
1007
|
-
color:
|
|
1042
|
+
border: `1px solid ${t.border}`,
|
|
1043
|
+
background: t.bg,
|
|
1044
|
+
color: t.text,
|
|
1008
1045
|
fontSize: 12,
|
|
1009
1046
|
width: 150
|
|
1010
1047
|
}
|
|
1011
1048
|
}
|
|
1012
1049
|
),
|
|
1013
|
-
/* @__PURE__ */
|
|
1050
|
+
/* @__PURE__ */ a(
|
|
1014
1051
|
"input",
|
|
1015
1052
|
{
|
|
1016
1053
|
type: "text",
|
|
1017
1054
|
value: e.message || "",
|
|
1018
1055
|
onChange: (o) => {
|
|
1019
|
-
const d =
|
|
1020
|
-
(
|
|
1056
|
+
const d = l.validationRules.map(
|
|
1057
|
+
(r) => r.id === e.id ? { ...r, message: o.target.value } : r
|
|
1021
1058
|
);
|
|
1022
|
-
|
|
1059
|
+
g({ validationRules: d });
|
|
1023
1060
|
},
|
|
1024
|
-
placeholder:
|
|
1061
|
+
placeholder: n("dataMapper.errorMessage", "Error message"),
|
|
1025
1062
|
style: {
|
|
1026
1063
|
flex: 1,
|
|
1027
1064
|
padding: "8px 12px",
|
|
1028
1065
|
borderRadius: 4,
|
|
1029
|
-
border: `1px solid ${
|
|
1030
|
-
background:
|
|
1031
|
-
color:
|
|
1066
|
+
border: `1px solid ${t.border}`,
|
|
1067
|
+
background: t.bg,
|
|
1068
|
+
color: t.text,
|
|
1032
1069
|
fontSize: 12
|
|
1033
1070
|
}
|
|
1034
1071
|
}
|
|
1035
1072
|
),
|
|
1036
|
-
/* @__PURE__ */
|
|
1073
|
+
/* @__PURE__ */ a(
|
|
1037
1074
|
"button",
|
|
1038
1075
|
{
|
|
1039
1076
|
onClick: () => {
|
|
1040
|
-
|
|
1041
|
-
validationRules:
|
|
1077
|
+
g({
|
|
1078
|
+
validationRules: l.validationRules.filter((o) => o.id !== e.id)
|
|
1042
1079
|
});
|
|
1043
1080
|
},
|
|
1044
|
-
"aria-label":
|
|
1081
|
+
"aria-label": n("dataMapper.delete", "Delete"),
|
|
1045
1082
|
style: {
|
|
1046
1083
|
padding: 6,
|
|
1047
1084
|
border: "none",
|
|
@@ -1050,7 +1087,7 @@ ${b}
|
|
|
1050
1087
|
cursor: "pointer",
|
|
1051
1088
|
fontSize: 14
|
|
1052
1089
|
},
|
|
1053
|
-
children: /* @__PURE__ */
|
|
1090
|
+
children: /* @__PURE__ */ a(s, { name: "trash", size: 14 })
|
|
1054
1091
|
}
|
|
1055
1092
|
)
|
|
1056
1093
|
]
|
|
@@ -1058,21 +1095,21 @@ ${b}
|
|
|
1058
1095
|
e.id
|
|
1059
1096
|
)) })
|
|
1060
1097
|
] }),
|
|
1061
|
-
|
|
1062
|
-
/* @__PURE__ */
|
|
1063
|
-
/* @__PURE__ */
|
|
1064
|
-
/* @__PURE__ */
|
|
1065
|
-
/* @__PURE__ */
|
|
1098
|
+
M === "test" && /* @__PURE__ */ i("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 20, height: "100%" }, children: [
|
|
1099
|
+
/* @__PURE__ */ i("div", { style: { display: "flex", flexDirection: "column" }, children: [
|
|
1100
|
+
/* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", gap: 12, marginBottom: 12 }, children: [
|
|
1101
|
+
/* @__PURE__ */ i("h4", { style: { margin: 0, display: "inline-flex", alignItems: "center", gap: 6 }, children: [
|
|
1102
|
+
/* @__PURE__ */ a(s, { name: "download", size: 16 }),
|
|
1066
1103
|
" ",
|
|
1067
|
-
|
|
1104
|
+
n("dataMapper.input", "Input")
|
|
1068
1105
|
] }),
|
|
1069
|
-
/* @__PURE__ */
|
|
1106
|
+
/* @__PURE__ */ a(
|
|
1070
1107
|
"button",
|
|
1071
1108
|
{
|
|
1072
1109
|
onClick: () => {
|
|
1073
|
-
const e = {}, o = (d,
|
|
1074
|
-
d.forEach((
|
|
1075
|
-
|
|
1110
|
+
const e = {}, o = (d, r) => {
|
|
1111
|
+
d.forEach((m) => {
|
|
1112
|
+
m.children && m.type === "object" ? (r[m.name] = {}, o(m.children, r[m.name])) : r[m.name] = {
|
|
1076
1113
|
string: "sample",
|
|
1077
1114
|
number: 42,
|
|
1078
1115
|
boolean: !0,
|
|
@@ -1080,37 +1117,37 @@ ${b}
|
|
|
1080
1117
|
array: [],
|
|
1081
1118
|
object: {},
|
|
1082
1119
|
any: null
|
|
1083
|
-
}[
|
|
1120
|
+
}[m.type];
|
|
1084
1121
|
});
|
|
1085
1122
|
};
|
|
1086
|
-
o(
|
|
1123
|
+
o(l.sourceSchema.fields, e), A(JSON.stringify(e, null, 2));
|
|
1087
1124
|
},
|
|
1088
1125
|
style: {
|
|
1089
1126
|
padding: "4px 8px",
|
|
1090
1127
|
borderRadius: 4,
|
|
1091
|
-
border: `1px solid ${
|
|
1128
|
+
border: `1px solid ${t.border}`,
|
|
1092
1129
|
background: "transparent",
|
|
1093
|
-
color:
|
|
1130
|
+
color: t.text,
|
|
1094
1131
|
cursor: "pointer",
|
|
1095
1132
|
fontSize: 11
|
|
1096
1133
|
},
|
|
1097
|
-
children:
|
|
1134
|
+
children: n("dataMapper.generateSample", "Generate Sample")
|
|
1098
1135
|
}
|
|
1099
1136
|
)
|
|
1100
1137
|
] }),
|
|
1101
|
-
/* @__PURE__ */
|
|
1138
|
+
/* @__PURE__ */ a(
|
|
1102
1139
|
"textarea",
|
|
1103
1140
|
{
|
|
1104
|
-
value:
|
|
1105
|
-
onChange: (e) =>
|
|
1106
|
-
placeholder:
|
|
1141
|
+
value: N,
|
|
1142
|
+
onChange: (e) => A(e.target.value),
|
|
1143
|
+
placeholder: n("dataMapper.pasteJsonInputHere", "Paste JSON input here..."),
|
|
1107
1144
|
style: {
|
|
1108
1145
|
flex: 1,
|
|
1109
1146
|
padding: 12,
|
|
1110
1147
|
borderRadius: 8,
|
|
1111
|
-
border: `1px solid ${
|
|
1112
|
-
background:
|
|
1113
|
-
color:
|
|
1148
|
+
border: `1px solid ${t.border}`,
|
|
1149
|
+
background: t.cardBg,
|
|
1150
|
+
color: t.text,
|
|
1114
1151
|
fontSize: 12,
|
|
1115
1152
|
fontFamily: "JetBrains Mono, Consolas, monospace",
|
|
1116
1153
|
resize: "none"
|
|
@@ -1118,102 +1155,102 @@ ${b}
|
|
|
1118
1155
|
}
|
|
1119
1156
|
)
|
|
1120
1157
|
] }),
|
|
1121
|
-
/* @__PURE__ */
|
|
1122
|
-
/* @__PURE__ */
|
|
1123
|
-
/* @__PURE__ */
|
|
1124
|
-
/* @__PURE__ */
|
|
1158
|
+
/* @__PURE__ */ i("div", { style: { display: "flex", flexDirection: "column" }, children: [
|
|
1159
|
+
/* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", gap: 12, marginBottom: 12 }, children: [
|
|
1160
|
+
/* @__PURE__ */ i("h4", { style: { margin: 0, display: "inline-flex", alignItems: "center", gap: 6 }, children: [
|
|
1161
|
+
/* @__PURE__ */ a(s, { name: "upload", size: 16 }),
|
|
1125
1162
|
" ",
|
|
1126
|
-
|
|
1163
|
+
n("dataMapper.output", "Output")
|
|
1127
1164
|
] }),
|
|
1128
|
-
/* @__PURE__ */
|
|
1165
|
+
/* @__PURE__ */ i(
|
|
1129
1166
|
"button",
|
|
1130
1167
|
{
|
|
1131
|
-
onClick:
|
|
1168
|
+
onClick: H,
|
|
1132
1169
|
style: {
|
|
1133
1170
|
padding: "6px 16px",
|
|
1134
1171
|
borderRadius: 4,
|
|
1135
1172
|
border: "none",
|
|
1136
|
-
background:
|
|
1173
|
+
background: t.accent,
|
|
1137
1174
|
color: "var(--nice-color-white, #fff)",
|
|
1138
1175
|
cursor: "pointer",
|
|
1139
1176
|
fontSize: 12
|
|
1140
1177
|
},
|
|
1141
1178
|
children: [
|
|
1142
|
-
/* @__PURE__ */
|
|
1179
|
+
/* @__PURE__ */ a(s, { name: "refresh", size: 14 }),
|
|
1143
1180
|
" ",
|
|
1144
|
-
|
|
1181
|
+
n("dataMapper.transform", "Transform")
|
|
1145
1182
|
]
|
|
1146
1183
|
}
|
|
1147
1184
|
)
|
|
1148
1185
|
] }),
|
|
1149
|
-
/* @__PURE__ */
|
|
1186
|
+
/* @__PURE__ */ a(
|
|
1150
1187
|
"pre",
|
|
1151
1188
|
{
|
|
1152
1189
|
style: {
|
|
1153
1190
|
flex: 1,
|
|
1154
1191
|
padding: 12,
|
|
1155
1192
|
borderRadius: 8,
|
|
1156
|
-
background:
|
|
1193
|
+
background: t.cardBg,
|
|
1157
1194
|
margin: 0,
|
|
1158
1195
|
overflow: "auto",
|
|
1159
1196
|
fontSize: 12,
|
|
1160
1197
|
fontFamily: "JetBrains Mono, Consolas, monospace"
|
|
1161
1198
|
},
|
|
1162
|
-
children:
|
|
1199
|
+
children: W || "Run transform to see output"
|
|
1163
1200
|
}
|
|
1164
1201
|
)
|
|
1165
1202
|
] })
|
|
1166
1203
|
] }),
|
|
1167
|
-
|
|
1168
|
-
/* @__PURE__ */
|
|
1169
|
-
/* @__PURE__ */
|
|
1204
|
+
M === "preview" && /* @__PURE__ */ i("div", { style: { display: "flex", flexDirection: "column", height: "100%" }, children: [
|
|
1205
|
+
/* @__PURE__ */ i("div", { style: { display: "flex", gap: 12, marginBottom: 16 }, children: [
|
|
1206
|
+
/* @__PURE__ */ i(
|
|
1170
1207
|
"button",
|
|
1171
1208
|
{
|
|
1172
|
-
onClick: () =>
|
|
1209
|
+
onClick: () => b?.(D),
|
|
1173
1210
|
style: {
|
|
1174
1211
|
padding: "8px 16px",
|
|
1175
1212
|
borderRadius: 4,
|
|
1176
1213
|
border: "none",
|
|
1177
|
-
background:
|
|
1214
|
+
background: t.accent,
|
|
1178
1215
|
color: "var(--nice-color-white, #fff)",
|
|
1179
1216
|
cursor: "pointer",
|
|
1180
1217
|
fontSize: 13
|
|
1181
1218
|
},
|
|
1182
1219
|
children: [
|
|
1183
|
-
/* @__PURE__ */
|
|
1220
|
+
/* @__PURE__ */ a(s, { name: "upload", size: 14 }),
|
|
1184
1221
|
" ",
|
|
1185
|
-
|
|
1222
|
+
n("dataMapper.export", "Export")
|
|
1186
1223
|
]
|
|
1187
1224
|
}
|
|
1188
1225
|
),
|
|
1189
|
-
/* @__PURE__ */
|
|
1226
|
+
/* @__PURE__ */ i(
|
|
1190
1227
|
"button",
|
|
1191
1228
|
{
|
|
1192
|
-
onClick: () => navigator.clipboard.writeText(
|
|
1229
|
+
onClick: () => navigator.clipboard.writeText(D),
|
|
1193
1230
|
style: {
|
|
1194
1231
|
padding: "8px 16px",
|
|
1195
1232
|
borderRadius: 4,
|
|
1196
|
-
border: `1px solid ${
|
|
1233
|
+
border: `1px solid ${t.border}`,
|
|
1197
1234
|
background: "transparent",
|
|
1198
|
-
color:
|
|
1235
|
+
color: t.text,
|
|
1199
1236
|
cursor: "pointer",
|
|
1200
1237
|
fontSize: 13
|
|
1201
1238
|
},
|
|
1202
1239
|
children: [
|
|
1203
|
-
/* @__PURE__ */
|
|
1240
|
+
/* @__PURE__ */ a(s, { name: "clipboard", size: 14 }),
|
|
1204
1241
|
" ",
|
|
1205
|
-
|
|
1242
|
+
n("dataMapper.copy", "Copy")
|
|
1206
1243
|
]
|
|
1207
1244
|
}
|
|
1208
1245
|
)
|
|
1209
1246
|
] }),
|
|
1210
|
-
/* @__PURE__ */
|
|
1247
|
+
/* @__PURE__ */ a(
|
|
1211
1248
|
"pre",
|
|
1212
1249
|
{
|
|
1213
1250
|
style: {
|
|
1214
1251
|
flex: 1,
|
|
1215
1252
|
padding: 16,
|
|
1216
|
-
background:
|
|
1253
|
+
background: t.cardBg,
|
|
1217
1254
|
borderRadius: 8,
|
|
1218
1255
|
overflow: "auto",
|
|
1219
1256
|
fontSize: 12,
|
|
@@ -1221,7 +1258,7 @@ ${b}
|
|
|
1221
1258
|
margin: 0,
|
|
1222
1259
|
whiteSpace: "pre-wrap"
|
|
1223
1260
|
},
|
|
1224
|
-
children:
|
|
1261
|
+
children: D
|
|
1225
1262
|
}
|
|
1226
1263
|
)
|
|
1227
1264
|
] })
|
|
@@ -1231,5 +1268,5 @@ ${b}
|
|
|
1231
1268
|
);
|
|
1232
1269
|
};
|
|
1233
1270
|
export {
|
|
1234
|
-
|
|
1271
|
+
le as NiceDataMapper
|
|
1235
1272
|
};
|