@burdenoff/microfe-export 2026.1023.2 → 2026.1107.1
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/hooks/useExportQueries.d.ts +4 -2
- package/dist/export/hooks/useExportQueries.d.ts.map +1 -1
- package/dist/export/hooks/useExportQueries.js +176 -164
- package/dist/export/hooks/useExportQueries.js.map +1 -1
- package/dist/export/pages/CreateExportPage.d.ts.map +1 -1
- package/dist/export/pages/CreateExportPage.js +190 -190
- package/dist/export/pages/CreateExportPage.js.map +1 -1
- package/dist/export/pages/ExportDetailPage.d.ts.map +1 -1
- package/dist/export/pages/ExportDetailPage.js +174 -173
- package/dist/export/pages/ExportDetailPage.js.map +1 -1
- package/dist/export/providers/ExportProvider.d.ts.map +1 -1
- package/dist/export/providers/ExportProvider.js +68 -63
- package/dist/export/providers/ExportProvider.js.map +1 -1
- package/dist/export/types/index.d.ts +3 -0
- package/dist/export/types/index.d.ts.map +1 -1
- package/dist/export/utils/exportAuthority.d.ts +18 -0
- package/dist/export/utils/exportAuthority.d.ts.map +1 -0
- package/dist/export/utils/exportAuthority.js +52 -0
- package/dist/export/utils/exportAuthority.js.map +1 -0
- package/dist/generated/wspace-operations.d.ts +70 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -1
- package/dist/generated/wspace-operations.js +41 -6
- package/dist/generated/wspace-operations.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,78 +1,78 @@
|
|
|
1
1
|
import { useExport as e } from "../providers/ExportProvider.js";
|
|
2
2
|
import { useTr as t } from "../hooks/useTr.js";
|
|
3
|
-
import { useAvailableEntities as n, useCreateExportJob as r, useExportTemplates as ee } from "../hooks/useExportQueries.js";
|
|
4
|
-
import { cn as
|
|
5
|
-
import { getFormatDisplayName as
|
|
3
|
+
import { useAvailableEntities as n, useCreateExportJob as r, useExportTemplates as i, useOrganizationExportPermission as ee } from "../hooks/useExportQueries.js";
|
|
4
|
+
import { cn as a } from "../utils/cn.js";
|
|
5
|
+
import { getFormatDisplayName as o } from "../constants/enums.js";
|
|
6
6
|
import { PageLayout as te } from "../components/PageLayout.js";
|
|
7
|
-
import { isExportEntityDisabled as
|
|
8
|
-
import { useCallback as ne, useEffect as re, useRef as ie, useState as
|
|
9
|
-
import { ArrowLeft as ae, ArrowRight as
|
|
10
|
-
import { useAppShell as
|
|
11
|
-
import { useSearchParams as
|
|
12
|
-
import { isQuotaExhaustedError as
|
|
13
|
-
import { jsx as
|
|
14
|
-
import { AlertDialog as
|
|
7
|
+
import { isExportEntityDisabled as s, isForeignProductEntity as c } from "../utils/disabledModules.js";
|
|
8
|
+
import { useCallback as ne, useEffect as re, useRef as ie, useState as l } from "react";
|
|
9
|
+
import { ArrowLeft as ae, ArrowRight as u, Building2 as d, CalendarRange as oe, CheckCircle2 as f, Download as p, FileJson as m, FileSpreadsheet as h, Loader2 as se, Lock as ce, Package as le, User as g, Users as _ } from "lucide-react";
|
|
10
|
+
import { useAppShell as ue, usePermission as de } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
11
|
+
import { useSearchParams as fe } from "react-router";
|
|
12
|
+
import { isQuotaExhaustedError as pe } from "@burdenoff/fe-libs/shared/utils";
|
|
13
|
+
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
14
|
+
import { AlertDialog as me, AlertDialogAction as b, AlertDialogCancel as x, AlertDialogContent as he, AlertDialogDescription as ge, AlertDialogFooter as _e, AlertDialogHeader as ve, AlertDialogTitle as ye, EmphasisPanel as be, IllustratedEmptyState as xe, PagePurpose as Se, ShowMore as Ce } from "@burdenoff/fe-libs/ui";
|
|
15
15
|
//#region src/export/pages/CreateExportPage.tsx
|
|
16
|
-
var
|
|
16
|
+
var S = ["CSV", "JSON"], we = {
|
|
17
17
|
CSV: h,
|
|
18
18
|
JSON: m
|
|
19
|
-
},
|
|
19
|
+
}, Te = {
|
|
20
20
|
INDIVIDUAL: g,
|
|
21
21
|
WORKSPACE_ADMIN: _,
|
|
22
|
-
ORG_ADMIN:
|
|
22
|
+
ORG_ADMIN: d
|
|
23
23
|
};
|
|
24
|
-
function
|
|
25
|
-
let { basePath:
|
|
24
|
+
function C() {
|
|
25
|
+
let { basePath: d = "/", navigate: m, organizationId: h } = e(), g = t(), [_, C] = l("INDIVIDUAL"), { createJob: w, isPending: T } = r(_), { data: E } = n(), { data: D } = i(), [O] = fe(), { productSlug: k } = ue(), A = ne((e) => !s(e) && !c(e, k), [k]), Ee = de("export:workspace_admin"), j = ee(h), [M, N] = l("entities"), [P, F] = l([]), [I, L] = l(""), [R, z] = l("CSV"), [B, V] = l(O.get("templateId") ?? void 0), [H, De] = l(""), [U, Oe] = l(""), [W, G] = l(null), [ke, K] = l(!1), q = ie(null);
|
|
26
26
|
re(() => {
|
|
27
|
-
let e =
|
|
28
|
-
if (!e || !
|
|
29
|
-
let t =
|
|
27
|
+
let e = O.get("templateId");
|
|
28
|
+
if (!e || !D?.length || q.current === e) return;
|
|
29
|
+
let t = D.find((t) => t.id === e);
|
|
30
30
|
if (!t) return;
|
|
31
|
-
|
|
31
|
+
q.current = e, V(t.id), F((t.entityTypes ?? []).filter(A));
|
|
32
32
|
let n = t.format?.toUpperCase();
|
|
33
|
-
n &&
|
|
33
|
+
n && S.includes(n) && z(n), t.name && L(t.name);
|
|
34
34
|
}, [
|
|
35
|
+
A,
|
|
35
36
|
O,
|
|
36
|
-
|
|
37
|
-
T
|
|
37
|
+
D
|
|
38
38
|
]);
|
|
39
39
|
let Ae = () => {
|
|
40
|
-
|
|
40
|
+
M === "options" ? N("entities") : M === "review" ? N("options") : m?.(d);
|
|
41
41
|
}, je = () => {
|
|
42
|
-
if (
|
|
43
|
-
if (
|
|
44
|
-
|
|
42
|
+
if (M === "entities") {
|
|
43
|
+
if (P.length === 0) {
|
|
44
|
+
G(g("export.create.errors.selectEntity", "Please select at least one entity type to export"));
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
|
-
|
|
48
|
-
} else if (
|
|
49
|
-
if (!
|
|
50
|
-
|
|
47
|
+
G(null), N("options");
|
|
48
|
+
} else if (M === "options") {
|
|
49
|
+
if (!I.trim()) {
|
|
50
|
+
G(g("export.create.errors.exportNameRequired", "Please provide a name for this export"));
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
|
-
|
|
53
|
+
G(null), N("review");
|
|
54
54
|
}
|
|
55
|
-
},
|
|
55
|
+
}, Me = async () => {
|
|
56
56
|
try {
|
|
57
|
-
|
|
58
|
-
name:
|
|
59
|
-
entityTypes:
|
|
60
|
-
format:
|
|
61
|
-
exportScope:
|
|
62
|
-
organizationId:
|
|
63
|
-
templateId:
|
|
64
|
-
dateRangeStart:
|
|
65
|
-
dateRangeEnd:
|
|
66
|
-
}), m?.(
|
|
57
|
+
G(null), await w({
|
|
58
|
+
name: I,
|
|
59
|
+
entityTypes: P,
|
|
60
|
+
format: R,
|
|
61
|
+
exportScope: _,
|
|
62
|
+
organizationId: _ === "ORG_ADMIN" ? h : void 0,
|
|
63
|
+
templateId: B,
|
|
64
|
+
dateRangeStart: H ? new Date(H).toISOString() : null,
|
|
65
|
+
dateRangeEnd: U ? new Date(U).toISOString() : null
|
|
66
|
+
}), m?.(d);
|
|
67
67
|
} catch (e) {
|
|
68
|
-
if (
|
|
69
|
-
|
|
68
|
+
if (pe(e)) {
|
|
69
|
+
K(!0), G(g("export.create.errors.quotaReached", "You have reached your export limit for this month."));
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
|
-
|
|
72
|
+
G(e instanceof Error ? e.message : g("export.create.errors.createFailed", "Failed to create export"));
|
|
73
73
|
}
|
|
74
|
-
},
|
|
75
|
-
|
|
74
|
+
}, Ne = (e) => {
|
|
75
|
+
A(e) && F((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
|
|
76
76
|
}, J = (e) => {
|
|
77
77
|
switch (e) {
|
|
78
78
|
case "INDIVIDUAL": return g("export.create.scope.individual.label", "My Data Only");
|
|
@@ -80,7 +80,7 @@ function w() {
|
|
|
80
80
|
case "ORG_ADMIN": return g("export.create.scope.orgAdmin.label", "All Organization Data");
|
|
81
81
|
default: return e;
|
|
82
82
|
}
|
|
83
|
-
},
|
|
83
|
+
}, Pe = (e) => {
|
|
84
84
|
switch (e) {
|
|
85
85
|
case "INDIVIDUAL": return g("export.create.scope.individual.description", "Export data you personally created across selected modules.");
|
|
86
86
|
case "WORKSPACE_ADMIN": return g("export.create.scope.workspaceAdmin.description", "Export all data in this workspace regardless of who created it. Requires workspace admin access.");
|
|
@@ -120,132 +120,132 @@ function w() {
|
|
|
120
120
|
label: g("export.create.entities.calendar.label", "Calendar Events"),
|
|
121
121
|
description: g("export.create.entities.calendar.description", "Events and bookings")
|
|
122
122
|
}
|
|
123
|
-
}, X =
|
|
124
|
-
let n = !t &&
|
|
125
|
-
return /* @__PURE__ */
|
|
123
|
+
}, X = E.filter((e) => e.enabled !== !1 && !c(e.entityType, k)), Z = X.filter((e) => !s(e.entityType)), Q = X.filter((e) => s(e.entityType)), $ = (e, t) => {
|
|
124
|
+
let n = !t && P.includes(e.entityType);
|
|
125
|
+
return /* @__PURE__ */ y("button", {
|
|
126
126
|
type: "button",
|
|
127
|
-
onClick: () =>
|
|
127
|
+
onClick: () => Ne(e.entityType),
|
|
128
128
|
disabled: t,
|
|
129
129
|
"aria-disabled": t,
|
|
130
130
|
title: t ? g("export.create.select.unavailableHint", "Export for this product isn't available yet") : void 0,
|
|
131
|
-
className:
|
|
131
|
+
className: a("text-left border-2 rounded-xl p-4 transition-all duration-200", t ? "border-border-subtle/30 opacity-50 cursor-not-allowed" : n ? "border-primary bg-action-primary-bg/5 shadow-md" : "border-border-subtle/50 hover:border-primary/30 hover:shadow-sm"),
|
|
132
132
|
children: [
|
|
133
|
-
/* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ y("div", {
|
|
134
134
|
className: "flex items-center justify-between mb-2 gap-2",
|
|
135
|
-
children: [/* @__PURE__ */
|
|
135
|
+
children: [/* @__PURE__ */ v("h3", {
|
|
136
136
|
className: "font-semibold",
|
|
137
137
|
children: Y[e.entityType]?.label ?? e.displayName
|
|
138
|
-
}), t ? /* @__PURE__ */
|
|
138
|
+
}), t ? /* @__PURE__ */ v("span", {
|
|
139
139
|
className: "shrink-0 text-xs font-medium px-2 py-0.5 rounded-full bg-bg-sunken text-text-secondary",
|
|
140
140
|
children: g("export.create.select.unavailable", "Unavailable")
|
|
141
|
-
}) : n && /* @__PURE__ */
|
|
141
|
+
}) : n && /* @__PURE__ */ v(f, {
|
|
142
142
|
size: 18,
|
|
143
143
|
className: "text-primary"
|
|
144
144
|
})]
|
|
145
145
|
}),
|
|
146
|
-
/* @__PURE__ */
|
|
146
|
+
/* @__PURE__ */ v("p", {
|
|
147
147
|
className: "text-sm text-text-secondary",
|
|
148
148
|
children: Y[e.entityType]?.description ?? e.description
|
|
149
149
|
}),
|
|
150
|
-
e.estimatedSize && /* @__PURE__ */
|
|
150
|
+
e.estimatedSize && /* @__PURE__ */ y("p", {
|
|
151
151
|
className: "text-xs text-text-secondary mt-2",
|
|
152
152
|
children: ["~", e.estimatedSize]
|
|
153
153
|
})
|
|
154
154
|
]
|
|
155
155
|
}, e.entityType);
|
|
156
156
|
};
|
|
157
|
-
return /* @__PURE__ */
|
|
157
|
+
return /* @__PURE__ */ y(te, {
|
|
158
158
|
showHeader: !1,
|
|
159
159
|
children: [
|
|
160
|
-
/* @__PURE__ */
|
|
160
|
+
/* @__PURE__ */ v("div", {
|
|
161
161
|
className: "relative overflow-hidden rounded-xl bg-accent-wash border border-border-seam p-6 shadow-[var(--shadow-pop)]",
|
|
162
|
-
children: /* @__PURE__ */
|
|
162
|
+
children: /* @__PURE__ */ y("div", {
|
|
163
163
|
className: "relative z-10 flex items-center gap-4",
|
|
164
|
-
children: [/* @__PURE__ */
|
|
164
|
+
children: [/* @__PURE__ */ v("button", {
|
|
165
165
|
type: "button",
|
|
166
|
-
onClick: () => m?.(
|
|
166
|
+
onClick: () => m?.(d),
|
|
167
167
|
className: "p-2.5 hover:bg-accent rounded-lg transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",
|
|
168
168
|
"aria-label": g("export.create.actions.backToDashboard", "Back to export dashboard"),
|
|
169
|
-
children: /* @__PURE__ */
|
|
170
|
-
}), /* @__PURE__ */
|
|
169
|
+
children: /* @__PURE__ */ v(ae, { size: 20 })
|
|
170
|
+
}), /* @__PURE__ */ y("div", {
|
|
171
171
|
className: "flex items-center gap-3",
|
|
172
|
-
children: [/* @__PURE__ */
|
|
172
|
+
children: [/* @__PURE__ */ v("div", {
|
|
173
173
|
className: "p-2.5 rounded-lg bg-action-primary-bg/10 backdrop-blur-sm",
|
|
174
|
-
children: /* @__PURE__ */
|
|
174
|
+
children: /* @__PURE__ */ v(p, {
|
|
175
175
|
size: 24,
|
|
176
176
|
className: "text-primary"
|
|
177
177
|
})
|
|
178
|
-
}), /* @__PURE__ */
|
|
178
|
+
}), /* @__PURE__ */ v("h1", {
|
|
179
179
|
className: "text-2xl sm:text-3xl font-bold",
|
|
180
180
|
children: g("export.create.title", "New Export")
|
|
181
181
|
})]
|
|
182
182
|
})]
|
|
183
183
|
})
|
|
184
184
|
}),
|
|
185
|
-
/* @__PURE__ */
|
|
186
|
-
icon: /* @__PURE__ */
|
|
185
|
+
/* @__PURE__ */ v(Se, {
|
|
186
|
+
icon: /* @__PURE__ */ v(p, { size: 16 }),
|
|
187
187
|
children: g("export.create.purpose", "Build a one-off export in three steps: pick which data to include, choose a format and scope, then review and start it. The export runs in the background and produces a downloadable ZIP you can grab from History when it finishes.")
|
|
188
188
|
}),
|
|
189
|
-
/* @__PURE__ */
|
|
189
|
+
/* @__PURE__ */ v("div", {
|
|
190
190
|
className: "flex items-center gap-2 justify-center flex-wrap",
|
|
191
191
|
children: [
|
|
192
192
|
"entities",
|
|
193
193
|
"options",
|
|
194
194
|
"review"
|
|
195
|
-
].map((e, t) => /* @__PURE__ */
|
|
195
|
+
].map((e, t) => /* @__PURE__ */ y("div", {
|
|
196
196
|
className: "flex items-center gap-2",
|
|
197
|
-
children: [t > 0 && /* @__PURE__ */
|
|
197
|
+
children: [t > 0 && /* @__PURE__ */ v(u, {
|
|
198
198
|
size: 18,
|
|
199
199
|
className: "text-text-secondary"
|
|
200
|
-
}), /* @__PURE__ */
|
|
201
|
-
className:
|
|
202
|
-
children: [/* @__PURE__ */
|
|
200
|
+
}), /* @__PURE__ */ y("div", {
|
|
201
|
+
className: a("flex items-center gap-2 px-4 py-2.5 rounded-lg text-sm font-medium border-2 transition-all duration-200", M === e ? "bg-action-primary-bg text-action-primary-text border-primary shadow-[var(--shadow-pop)]" : "bg-bg-sunken/50 text-text-secondary border-border-seam"),
|
|
202
|
+
children: [/* @__PURE__ */ v("div", {
|
|
203
203
|
className: "flex items-center justify-center size-6 rounded-full bg-bg-surface/20 font-bold",
|
|
204
204
|
children: t + 1
|
|
205
|
-
}), /* @__PURE__ */
|
|
205
|
+
}), /* @__PURE__ */ v("span", {
|
|
206
206
|
className: "hidden sm:inline capitalize",
|
|
207
207
|
children: e === "entities" ? g("export.create.steps.entities", "Select Data") : e === "options" ? g("export.create.steps.options", "Options") : g("export.create.steps.review", "Review")
|
|
208
208
|
})]
|
|
209
209
|
})]
|
|
210
210
|
}, e))
|
|
211
211
|
}),
|
|
212
|
-
|
|
212
|
+
W && /* @__PURE__ */ v("div", {
|
|
213
213
|
className: "border-2 border-border-default rounded-xl bg-status-error-bg-subtle p-4 text-status-error-text text-sm",
|
|
214
|
-
children:
|
|
214
|
+
children: W
|
|
215
215
|
}),
|
|
216
|
-
|
|
216
|
+
M === "entities" && /* @__PURE__ */ y("div", {
|
|
217
217
|
className: "space-y-4",
|
|
218
218
|
children: [
|
|
219
|
-
/* @__PURE__ */
|
|
219
|
+
/* @__PURE__ */ v("h2", {
|
|
220
220
|
className: "text-lg font-bold",
|
|
221
221
|
children: g("export.create.select.title", "Select data to export")
|
|
222
222
|
}),
|
|
223
|
-
/* @__PURE__ */
|
|
223
|
+
/* @__PURE__ */ v("p", {
|
|
224
224
|
className: "text-sm text-text-secondary",
|
|
225
225
|
children: g("export.create.select.description", "Choose which entity types to include in your export.")
|
|
226
226
|
}),
|
|
227
|
-
X.length === 0 ? /* @__PURE__ */
|
|
227
|
+
X.length === 0 ? /* @__PURE__ */ v(xe, {
|
|
228
228
|
illustration: "empty-data",
|
|
229
229
|
title: g("export.create.select.emptyTitle", "Nothing to export yet"),
|
|
230
230
|
description: g("export.create.select.empty", "No exportable entity types are configured for this workspace yet. Once your workspace has data in supported modules, they'll show up here to select.")
|
|
231
|
-
}) : /* @__PURE__ */
|
|
231
|
+
}) : /* @__PURE__ */ y("div", {
|
|
232
232
|
className: "space-y-6",
|
|
233
|
-
children: [Z.length > 0 && /* @__PURE__ */
|
|
233
|
+
children: [Z.length > 0 && /* @__PURE__ */ v("div", {
|
|
234
234
|
className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",
|
|
235
235
|
children: Z.map((e) => $(e, !1))
|
|
236
|
-
}), Q.length > 0 && /* @__PURE__ */
|
|
236
|
+
}), Q.length > 0 && /* @__PURE__ */ y("div", {
|
|
237
237
|
className: "space-y-3",
|
|
238
|
-
children: [/* @__PURE__ */
|
|
238
|
+
children: [/* @__PURE__ */ y("div", {
|
|
239
239
|
className: "flex items-center gap-3",
|
|
240
240
|
children: [
|
|
241
|
-
/* @__PURE__ */
|
|
242
|
-
/* @__PURE__ */
|
|
241
|
+
/* @__PURE__ */ v("div", { className: "h-px flex-1 bg-border/60" }),
|
|
242
|
+
/* @__PURE__ */ v("span", {
|
|
243
243
|
className: "text-xs font-medium uppercase tracking-wide text-text-secondary",
|
|
244
244
|
children: g("export.create.select.unavailableSection", "Not available yet")
|
|
245
245
|
}),
|
|
246
|
-
/* @__PURE__ */
|
|
246
|
+
/* @__PURE__ */ v("div", { className: "h-px flex-1 bg-border/60" })
|
|
247
247
|
]
|
|
248
|
-
}), /* @__PURE__ */
|
|
248
|
+
}), /* @__PURE__ */ v("div", {
|
|
249
249
|
className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",
|
|
250
250
|
children: Q.map((e) => $(e, !0))
|
|
251
251
|
})]
|
|
@@ -253,207 +253,207 @@ function w() {
|
|
|
253
253
|
})
|
|
254
254
|
]
|
|
255
255
|
}),
|
|
256
|
-
|
|
256
|
+
M === "options" && /* @__PURE__ */ v("div", {
|
|
257
257
|
className: "space-y-6",
|
|
258
|
-
children: /* @__PURE__ */
|
|
258
|
+
children: /* @__PURE__ */ y("div", {
|
|
259
259
|
className: "border border-border-seam rounded-xl p-6 space-y-5 bg-bg-surface",
|
|
260
260
|
children: [
|
|
261
|
-
/* @__PURE__ */
|
|
261
|
+
/* @__PURE__ */ v("h2", {
|
|
262
262
|
className: "text-lg font-bold",
|
|
263
263
|
children: g("export.create.options.title", "Export Options")
|
|
264
264
|
}),
|
|
265
|
-
/* @__PURE__ */
|
|
265
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
266
266
|
className: "block text-sm font-semibold mb-2",
|
|
267
267
|
children: g("export.create.options.scope", "Export Scope")
|
|
268
|
-
}), /* @__PURE__ */
|
|
268
|
+
}), /* @__PURE__ */ v("div", {
|
|
269
269
|
className: "grid grid-cols-1 sm:grid-cols-3 gap-3",
|
|
270
270
|
children: [
|
|
271
271
|
"INDIVIDUAL",
|
|
272
272
|
"WORKSPACE_ADMIN",
|
|
273
273
|
"ORG_ADMIN"
|
|
274
274
|
].map((e) => {
|
|
275
|
-
let t = e === "WORKSPACE_ADMIN" && !
|
|
276
|
-
return /* @__PURE__ */
|
|
275
|
+
let t = e === "WORKSPACE_ADMIN" && !Ee || e === "ORG_ADMIN" && !j, n = Te[e], r = e === "WORKSPACE_ADMIN" ? g("export.create.scope.workspaceAdmin.required", "Workspace admin access required") : g("export.create.scope.orgAdmin.required", "Organization admin access required");
|
|
276
|
+
return /* @__PURE__ */ y("button", {
|
|
277
277
|
type: "button",
|
|
278
|
-
onClick: () => !t &&
|
|
278
|
+
onClick: () => !t && C(e),
|
|
279
279
|
disabled: t,
|
|
280
|
-
className:
|
|
280
|
+
className: a("text-left border-2 rounded-xl p-4 transition-all duration-200", _ === e ? "border-primary bg-action-primary-bg/5 shadow-md" : t ? "border-border-subtle/30 opacity-50 cursor-not-allowed" : "border-border-subtle/50 hover:border-primary/30 hover:shadow-sm"),
|
|
281
281
|
title: t ? r : void 0,
|
|
282
282
|
children: [
|
|
283
|
-
/* @__PURE__ */
|
|
283
|
+
/* @__PURE__ */ y("div", {
|
|
284
284
|
className: "flex items-center justify-between mb-2",
|
|
285
285
|
children: [
|
|
286
|
-
/* @__PURE__ */
|
|
286
|
+
/* @__PURE__ */ v(n, {
|
|
287
287
|
size: 18,
|
|
288
|
-
className:
|
|
288
|
+
className: _ === e ? "text-primary" : t ? "text-text-secondary/50" : "text-text-secondary"
|
|
289
289
|
}),
|
|
290
|
-
|
|
290
|
+
_ === e && /* @__PURE__ */ v(f, {
|
|
291
291
|
size: 16,
|
|
292
292
|
className: "text-primary"
|
|
293
293
|
}),
|
|
294
|
-
t && /* @__PURE__ */
|
|
294
|
+
t && /* @__PURE__ */ v(ce, {
|
|
295
295
|
size: 14,
|
|
296
296
|
className: "text-text-secondary/50"
|
|
297
297
|
})
|
|
298
298
|
]
|
|
299
299
|
}),
|
|
300
|
-
/* @__PURE__ */
|
|
300
|
+
/* @__PURE__ */ v("p", {
|
|
301
301
|
className: "font-semibold text-sm",
|
|
302
302
|
children: J(e)
|
|
303
303
|
}),
|
|
304
|
-
/* @__PURE__ */
|
|
304
|
+
/* @__PURE__ */ v("p", {
|
|
305
305
|
className: "text-xs text-text-secondary mt-1",
|
|
306
|
-
children:
|
|
306
|
+
children: Pe(e)
|
|
307
307
|
})
|
|
308
308
|
]
|
|
309
309
|
}, e);
|
|
310
310
|
})
|
|
311
311
|
})] }),
|
|
312
|
-
/* @__PURE__ */
|
|
312
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("label", {
|
|
313
313
|
htmlFor: "exportName",
|
|
314
314
|
className: "block text-sm font-semibold mb-2",
|
|
315
315
|
children: [
|
|
316
316
|
g("export.create.options.name", "Export Name"),
|
|
317
317
|
" ",
|
|
318
|
-
/* @__PURE__ */
|
|
318
|
+
/* @__PURE__ */ v("span", {
|
|
319
319
|
className: "text-status-error-text",
|
|
320
320
|
children: "*"
|
|
321
321
|
})
|
|
322
322
|
]
|
|
323
|
-
}), /* @__PURE__ */
|
|
323
|
+
}), /* @__PURE__ */ v("input", {
|
|
324
324
|
type: "text",
|
|
325
325
|
id: "exportName",
|
|
326
326
|
"aria-label": g("export.create.options.name", "Export Name"),
|
|
327
|
-
value:
|
|
328
|
-
onChange: (e) =>
|
|
327
|
+
value: I,
|
|
328
|
+
onChange: (e) => L(e.target.value),
|
|
329
329
|
className: "w-full px-4 py-2.5 border-2 border-border-subtle rounded-lg bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all duration-200",
|
|
330
330
|
placeholder: g("export.create.options.namePlaceholder", "e.g., Monthly User Export")
|
|
331
331
|
})] }),
|
|
332
|
-
/* @__PURE__ */
|
|
332
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
333
333
|
className: "block text-sm font-semibold mb-2",
|
|
334
334
|
children: g("export.create.options.outputFormat", "Output Format")
|
|
335
|
-
}), /* @__PURE__ */
|
|
335
|
+
}), /* @__PURE__ */ v("div", {
|
|
336
336
|
className: "grid grid-cols-2 gap-3",
|
|
337
|
-
children:
|
|
338
|
-
let t =
|
|
339
|
-
return /* @__PURE__ */
|
|
337
|
+
children: S.map((e) => {
|
|
338
|
+
let t = we[e];
|
|
339
|
+
return /* @__PURE__ */ y("button", {
|
|
340
340
|
type: "button",
|
|
341
|
-
onClick: () =>
|
|
342
|
-
className:
|
|
343
|
-
children: [/* @__PURE__ */
|
|
341
|
+
onClick: () => z(e),
|
|
342
|
+
className: a("flex items-center gap-3 border-2 rounded-lg p-3 transition-all duration-200", R === e ? "border-primary bg-action-primary-bg/5" : "border-border-subtle/50 hover:border-primary/30"),
|
|
343
|
+
children: [/* @__PURE__ */ v(t, {
|
|
344
344
|
size: 18,
|
|
345
|
-
className:
|
|
346
|
-
}), /* @__PURE__ */
|
|
345
|
+
className: R === e ? "text-primary" : "text-text-secondary"
|
|
346
|
+
}), /* @__PURE__ */ v("span", {
|
|
347
347
|
className: "font-medium text-sm",
|
|
348
|
-
children:
|
|
348
|
+
children: o(e)
|
|
349
349
|
})]
|
|
350
350
|
}, e);
|
|
351
351
|
})
|
|
352
352
|
})] }),
|
|
353
|
-
/* @__PURE__ */
|
|
354
|
-
/* @__PURE__ */
|
|
353
|
+
/* @__PURE__ */ y("div", { children: [
|
|
354
|
+
/* @__PURE__ */ v("label", {
|
|
355
355
|
className: "block text-sm font-semibold mb-2",
|
|
356
356
|
children: g("export.create.options.archiveFormat", "Archive Format")
|
|
357
357
|
}),
|
|
358
|
-
/* @__PURE__ */
|
|
358
|
+
/* @__PURE__ */ v("div", {
|
|
359
359
|
className: "flex gap-3",
|
|
360
|
-
children: /* @__PURE__ */
|
|
361
|
-
className:
|
|
362
|
-
children: [/* @__PURE__ */
|
|
360
|
+
children: /* @__PURE__ */ y("div", {
|
|
361
|
+
className: a("flex items-center gap-2 border-2 rounded-lg px-4 py-2 border-primary bg-action-primary-bg/5"),
|
|
362
|
+
children: [/* @__PURE__ */ v(le, {
|
|
363
363
|
size: 16,
|
|
364
364
|
className: "text-primary"
|
|
365
|
-
}), /* @__PURE__ */
|
|
365
|
+
}), /* @__PURE__ */ v("span", {
|
|
366
366
|
className: "font-medium text-sm",
|
|
367
367
|
children: g("export.archive.zip", "ZIP")
|
|
368
368
|
})]
|
|
369
369
|
})
|
|
370
370
|
}),
|
|
371
|
-
/* @__PURE__ */
|
|
371
|
+
/* @__PURE__ */ v("p", {
|
|
372
372
|
className: "text-xs text-text-secondary mt-1.5",
|
|
373
373
|
children: g("export.create.options.archiveDescription", "Exports are packaged as ZIP archives.")
|
|
374
374
|
})
|
|
375
375
|
] }),
|
|
376
|
-
/* @__PURE__ */
|
|
376
|
+
/* @__PURE__ */ v(Ce, {
|
|
377
377
|
collapsedHeight: 0,
|
|
378
378
|
label: g("export.create.options.advancedToggle", "Date range & template"),
|
|
379
|
-
children: /* @__PURE__ */
|
|
379
|
+
children: /* @__PURE__ */ y("div", {
|
|
380
380
|
className: "space-y-5 pt-1",
|
|
381
|
-
children: [/* @__PURE__ */
|
|
382
|
-
/* @__PURE__ */
|
|
381
|
+
children: [/* @__PURE__ */ y("div", { children: [
|
|
382
|
+
/* @__PURE__ */ v("label", {
|
|
383
383
|
className: "block text-sm font-semibold mb-2",
|
|
384
|
-
children: /* @__PURE__ */
|
|
384
|
+
children: /* @__PURE__ */ y("span", {
|
|
385
385
|
className: "inline-flex items-center gap-1.5",
|
|
386
386
|
children: [
|
|
387
|
-
/* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ v(oe, { size: 15 }),
|
|
388
388
|
g("export.create.options.dateRange", "Date Range"),
|
|
389
389
|
" ",
|
|
390
|
-
/* @__PURE__ */
|
|
390
|
+
/* @__PURE__ */ v("span", {
|
|
391
391
|
className: "font-normal text-text-secondary",
|
|
392
392
|
children: g("export.create.shared.optional", "(optional)")
|
|
393
393
|
})
|
|
394
394
|
]
|
|
395
395
|
})
|
|
396
396
|
}),
|
|
397
|
-
/* @__PURE__ */
|
|
397
|
+
/* @__PURE__ */ y("div", {
|
|
398
398
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-3",
|
|
399
|
-
children: [/* @__PURE__ */
|
|
399
|
+
children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
400
400
|
htmlFor: "dateFrom",
|
|
401
401
|
className: "block text-xs text-text-secondary mb-1",
|
|
402
402
|
children: g("export.create.options.dateFrom", "From")
|
|
403
|
-
}), /* @__PURE__ */
|
|
403
|
+
}), /* @__PURE__ */ v("input", {
|
|
404
404
|
type: "date",
|
|
405
405
|
id: "dateFrom",
|
|
406
406
|
"aria-label": g("export.create.options.dateFrom", "From"),
|
|
407
|
-
value:
|
|
407
|
+
value: H,
|
|
408
408
|
onChange: (e) => De(e.target.value),
|
|
409
409
|
className: "w-full px-3 py-2 border-2 border-border-subtle rounded-lg bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary text-sm"
|
|
410
|
-
})] }), /* @__PURE__ */
|
|
410
|
+
})] }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
411
411
|
htmlFor: "dateTo",
|
|
412
412
|
className: "block text-xs text-text-secondary mb-1",
|
|
413
413
|
children: g("export.create.options.dateTo", "To")
|
|
414
|
-
}), /* @__PURE__ */
|
|
414
|
+
}), /* @__PURE__ */ v("input", {
|
|
415
415
|
type: "date",
|
|
416
416
|
id: "dateTo",
|
|
417
417
|
"aria-label": g("export.create.options.dateTo", "To"),
|
|
418
|
-
value:
|
|
419
|
-
min:
|
|
418
|
+
value: U,
|
|
419
|
+
min: H,
|
|
420
420
|
onChange: (e) => Oe(e.target.value),
|
|
421
421
|
className: "w-full px-3 py-2 border-2 border-border-subtle rounded-lg bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary text-sm"
|
|
422
422
|
})] })]
|
|
423
423
|
}),
|
|
424
|
-
/* @__PURE__ */
|
|
424
|
+
/* @__PURE__ */ v("p", {
|
|
425
425
|
className: "text-xs text-text-secondary mt-1.5",
|
|
426
426
|
children: g("export.create.options.dateRangeDescription", "Leave blank to export all data regardless of date.")
|
|
427
427
|
})
|
|
428
|
-
] }), /* @__PURE__ */
|
|
428
|
+
] }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("label", {
|
|
429
429
|
className: "block text-sm font-semibold mb-2",
|
|
430
430
|
children: [
|
|
431
431
|
g("export.create.options.basedOnTemplate", "Based on Template"),
|
|
432
432
|
" ",
|
|
433
|
-
/* @__PURE__ */
|
|
433
|
+
/* @__PURE__ */ v("span", {
|
|
434
434
|
className: "font-normal text-text-secondary",
|
|
435
435
|
children: g("export.create.shared.optional", "(optional)")
|
|
436
436
|
})
|
|
437
437
|
]
|
|
438
|
-
}),
|
|
439
|
-
value:
|
|
440
|
-
onChange: (e) =>
|
|
438
|
+
}), D.length > 0 ? /* @__PURE__ */ y("select", {
|
|
439
|
+
value: B ?? "",
|
|
440
|
+
onChange: (e) => V(e.target.value || void 0),
|
|
441
441
|
className: "w-full px-3 py-2 border-2 border-border-subtle rounded-lg bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
442
|
-
children: [/* @__PURE__ */
|
|
442
|
+
children: [/* @__PURE__ */ v("option", {
|
|
443
443
|
value: "",
|
|
444
444
|
children: g("export.create.options.noTemplate", "No template")
|
|
445
|
-
}),
|
|
445
|
+
}), D.map((e) => /* @__PURE__ */ v("option", {
|
|
446
446
|
value: e.id,
|
|
447
447
|
children: e.name
|
|
448
448
|
}, e.id))]
|
|
449
|
-
}) : /* @__PURE__ */
|
|
449
|
+
}) : /* @__PURE__ */ y("p", {
|
|
450
450
|
className: "text-sm text-text-secondary",
|
|
451
451
|
children: [
|
|
452
452
|
g("export.create.options.noTemplates", "No templates yet."),
|
|
453
453
|
" ",
|
|
454
|
-
/* @__PURE__ */
|
|
454
|
+
/* @__PURE__ */ v("button", {
|
|
455
455
|
type: "button",
|
|
456
|
-
onClick: () => m?.(
|
|
456
|
+
onClick: () => m?.(d + "/templates"),
|
|
457
457
|
className: "text-primary underline-offset-2 hover:underline",
|
|
458
458
|
children: g("export.create.options.createTemplateLink", "Create one")
|
|
459
459
|
}),
|
|
@@ -466,53 +466,53 @@ function w() {
|
|
|
466
466
|
]
|
|
467
467
|
})
|
|
468
468
|
}),
|
|
469
|
-
|
|
469
|
+
M === "review" && /* @__PURE__ */ v("div", {
|
|
470
470
|
className: "space-y-6",
|
|
471
|
-
children: /* @__PURE__ */
|
|
471
|
+
children: /* @__PURE__ */ y(be, {
|
|
472
472
|
className: "p-6 space-y-4",
|
|
473
|
-
children: [/* @__PURE__ */
|
|
473
|
+
children: [/* @__PURE__ */ y("h2", {
|
|
474
474
|
className: "text-lg font-bold flex items-center gap-2",
|
|
475
|
-
children: [/* @__PURE__ */
|
|
475
|
+
children: [/* @__PURE__ */ v(f, {
|
|
476
476
|
size: 20,
|
|
477
477
|
className: "text-primary"
|
|
478
478
|
}), g("export.create.review.title", "Review Export")]
|
|
479
|
-
}), /* @__PURE__ */
|
|
479
|
+
}), /* @__PURE__ */ v("dl", {
|
|
480
480
|
className: "space-y-3 text-sm",
|
|
481
481
|
children: [
|
|
482
482
|
{
|
|
483
483
|
label: g("export.create.review.fields.name", "Name"),
|
|
484
|
-
value:
|
|
484
|
+
value: I
|
|
485
485
|
},
|
|
486
486
|
{
|
|
487
487
|
label: g("export.create.review.fields.scope", "Scope"),
|
|
488
|
-
value: J(
|
|
488
|
+
value: J(_)
|
|
489
489
|
},
|
|
490
490
|
{
|
|
491
491
|
label: g("export.create.review.fields.entityTypes", "Entity Types"),
|
|
492
|
-
value:
|
|
492
|
+
value: P.join(", ")
|
|
493
493
|
},
|
|
494
494
|
{
|
|
495
495
|
label: g("export.create.review.fields.format", "Format"),
|
|
496
|
-
value:
|
|
496
|
+
value: o(R)
|
|
497
497
|
},
|
|
498
498
|
{
|
|
499
499
|
label: g("export.create.review.fields.archive", "Archive"),
|
|
500
500
|
value: g("export.archive.zip", "ZIP")
|
|
501
501
|
},
|
|
502
|
-
...
|
|
502
|
+
...H || U ? [{
|
|
503
503
|
label: g("export.create.review.fields.dateRange", "Date Range"),
|
|
504
|
-
value: [
|
|
504
|
+
value: [H || "—", U || "—"].join(" → ")
|
|
505
505
|
}] : [],
|
|
506
|
-
...
|
|
506
|
+
...B ? [{
|
|
507
507
|
label: g("export.create.review.fields.template", "Template"),
|
|
508
|
-
value:
|
|
508
|
+
value: D.find((e) => e.id === B)?.name ?? B
|
|
509
509
|
}] : []
|
|
510
|
-
].map(({ label: e, value: t }) => /* @__PURE__ */
|
|
510
|
+
].map(({ label: e, value: t }) => /* @__PURE__ */ y("div", {
|
|
511
511
|
className: "flex flex-col sm:flex-row sm:justify-between gap-1",
|
|
512
|
-
children: [/* @__PURE__ */
|
|
512
|
+
children: [/* @__PURE__ */ v("dt", {
|
|
513
513
|
className: "text-text-secondary",
|
|
514
514
|
children: e
|
|
515
|
-
}), /* @__PURE__ */
|
|
515
|
+
}), /* @__PURE__ */ v("dd", {
|
|
516
516
|
className: "font-semibold sm:text-right break-words",
|
|
517
517
|
children: t
|
|
518
518
|
})]
|
|
@@ -520,33 +520,33 @@ function w() {
|
|
|
520
520
|
})]
|
|
521
521
|
})
|
|
522
522
|
}),
|
|
523
|
-
/* @__PURE__ */
|
|
523
|
+
/* @__PURE__ */ y("div", {
|
|
524
524
|
className: "flex flex-col sm:flex-row gap-3 pt-2",
|
|
525
|
-
children: [/* @__PURE__ */
|
|
525
|
+
children: [/* @__PURE__ */ v("button", {
|
|
526
526
|
type: "button",
|
|
527
527
|
onClick: Ae,
|
|
528
528
|
className: "px-6 py-3 border-2 border-border-subtle/50 rounded-lg hover:bg-accent hover:border-primary/30 transition-all duration-200 font-medium",
|
|
529
|
-
children:
|
|
530
|
-
}),
|
|
529
|
+
children: M === "entities" ? g("export.create.actions.cancel", "Cancel") : g("export.create.actions.back", "Back")
|
|
530
|
+
}), M === "review" ? /* @__PURE__ */ y("button", {
|
|
531
531
|
type: "button",
|
|
532
|
-
onClick:
|
|
533
|
-
disabled:
|
|
532
|
+
onClick: Me,
|
|
533
|
+
disabled: T,
|
|
534
534
|
className: "flex-1 inline-flex items-center justify-center gap-2 px-6 py-3 bg-action-primary-bg text-action-primary-text rounded-lg hover:bg-action-primary-bg/90 transition-all duration-200 font-bold shadow-lg disabled:opacity-50 disabled:cursor-not-allowed",
|
|
535
|
-
children: [
|
|
535
|
+
children: [T ? /* @__PURE__ */ v(se, {
|
|
536
536
|
size: 18,
|
|
537
537
|
className: "animate-spin"
|
|
538
|
-
}) : /* @__PURE__ */
|
|
539
|
-
}) : /* @__PURE__ */
|
|
538
|
+
}) : /* @__PURE__ */ v(p, { size: 18 }), g("export.create.actions.startExport", "Start Export")]
|
|
539
|
+
}) : /* @__PURE__ */ y("button", {
|
|
540
540
|
type: "button",
|
|
541
541
|
onClick: je,
|
|
542
542
|
className: "flex-1 inline-flex items-center justify-center gap-2 px-6 py-3 bg-action-primary-bg text-action-primary-text rounded-lg hover:bg-action-primary-bg/90 transition-all duration-200 font-bold shadow-lg",
|
|
543
|
-
children: [g("export.create.actions.next", "Next"), /* @__PURE__ */
|
|
543
|
+
children: [g("export.create.actions.next", "Next"), /* @__PURE__ */ v(u, { size: 18 })]
|
|
544
544
|
})]
|
|
545
545
|
}),
|
|
546
|
-
/* @__PURE__ */
|
|
546
|
+
/* @__PURE__ */ v(me, {
|
|
547
547
|
open: ke,
|
|
548
|
-
onOpenChange:
|
|
549
|
-
children: /* @__PURE__ */
|
|
548
|
+
onOpenChange: K,
|
|
549
|
+
children: /* @__PURE__ */ y(he, { children: [/* @__PURE__ */ y(ve, { children: [/* @__PURE__ */ v(ye, { children: g("export.create.quotaDialog.title", "Export Limit Reached") }), /* @__PURE__ */ v(ge, { children: g("export.create.quotaDialog.description", "You have reached your export limit for this month.") })] }), /* @__PURE__ */ y(_e, { children: [/* @__PURE__ */ v(x, { children: g("export.create.quotaDialog.dismiss", "Dismiss") }), /* @__PURE__ */ v(b, {
|
|
550
550
|
onClick: () => window.location.assign("/billing"),
|
|
551
551
|
children: g("export.create.quotaDialog.viewBilling", "View Billing")
|
|
552
552
|
})] })] })
|
|
@@ -555,6 +555,6 @@ function w() {
|
|
|
555
555
|
});
|
|
556
556
|
}
|
|
557
557
|
//#endregion
|
|
558
|
-
export {
|
|
558
|
+
export { C as CreateExportPage };
|
|
559
559
|
|
|
560
560
|
//# sourceMappingURL=CreateExportPage.js.map
|