@oneclick.dev/cms-core-modules 0.0.122 → 0.0.123
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/{ContentEditor-CoJjsV-m.js → ContentEditor-C-Wm48ai.js} +63 -59
- package/dist/{ContentEditor-DIwqplfB.mjs → ContentEditor-MDGolnIP.mjs} +27596 -26138
- package/dist/{NewReservationDialog.vue_vue_type_script_setup_true_lang-bZidw6RT.mjs → NewReservationDialog.vue_vue_type_script_setup_true_lang-8I_Z9cD_.mjs} +530 -530
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-BVE_uURZ.js +1 -0
- package/dist/OrderDetailDialog.vue_vue_type_script_setup_true_lang-BdFa-xNf.mjs +3566 -0
- package/dist/OrderDetailDialog.vue_vue_type_script_setup_true_lang-DzPOadcU.js +925 -0
- package/dist/TableCalculationWidget-CkQPrVUd.js +59 -0
- package/dist/TableCalculationWidget-CrqcLGfU.mjs +254 -0
- package/dist/TableDataWidget-7qvC3Egd.js +1 -0
- package/dist/TableDataWidget-DMTSoGRO.mjs +121 -0
- package/dist/TableOverviewCard-AFq-puJs.js +1 -0
- package/dist/TableOverviewCard-Ci0d4o4w.mjs +391 -0
- package/dist/TableResultView.vue_vue_type_script_setup_true_lang-CBn-Oxl9.mjs +534 -0
- package/dist/TableResultView.vue_vue_type_script_setup_true_lang-C_Lv-SmJ.js +1 -0
- package/dist/TableRowActionCard-BhdnnPaq.mjs +266 -0
- package/dist/TableRowActionCard-IzB6tNN-.js +1 -0
- package/dist/TableView-BkwoKREo.js +4 -0
- package/dist/TableView-C4Zyp8d7.mjs +8228 -0
- package/dist/{agenda-BCKDYOeF.mjs → agenda-DWdbWUbb.mjs} +10 -9
- package/dist/agenda-r9Gl85GL.js +1 -0
- package/dist/dateRangePresets-B-l5b_wR.mjs +48 -0
- package/dist/dateRangePresets-CPWqst_x.js +1 -0
- package/dist/fuse-Deb-Iq39.mjs +1473 -0
- package/dist/fuse-_CGUd5Zq.js +1 -0
- package/dist/{index-DU3Ib10Z.mjs → index-B_qaX29C.mjs} +7 -6
- package/dist/{index-Bk3yLv_G.js → index-yHLT6gaZ.js} +3 -3
- package/dist/index.cjs.js +1 -1
- package/dist/index.mjs +419 -109
- package/dist/{orders-CElKNc1v.mjs → orders-BfTLIm7U.mjs} +10 -9
- package/dist/orders-DUa2PVoa.js +1 -0
- package/dist/reports-ChCsd1Gk.mjs +1107 -0
- package/dist/reports-DmJPm8uP.js +158 -0
- package/dist/row-item-C1dUyimV.mjs +204 -0
- package/dist/row-item-Cyo3m3MZ.js +1 -0
- package/dist/src/appointments/components/edit/EventDialog/BookingsList.vue.d.ts +9 -3
- package/dist/src/appointments/components/edit/EventDialog/OrderDetailDialog.vue.d.ts +2 -0
- package/dist/src/appointments/components/edit/EventDialog/ReservationDetailDialog.vue.d.ts +4 -2
- package/dist/src/appointments/components/edit/dashboard/BookingsList.vue.d.ts +9 -3
- package/dist/src/appointments/pages/edit/orders.vue.d.ts +9 -3
- package/dist/src/appointments/pages/edit/reports.vue.d.ts +229 -1
- package/dist/src/table/chat-components/TableCalculationWidget.vue.d.ts +15 -0
- package/dist/src/table/chat-components/TableDataWidget.vue.d.ts +15 -0
- package/dist/src/table/chat-components/TableOverviewCard.vue.d.ts +61 -0
- package/dist/src/table/chat-components/TableResultView.vue.d.ts +48 -0
- package/dist/src/table/chat-components/TableRowActionCard.vue.d.ts +15 -0
- package/dist/src/table/components/filters/DialogTableFilterOptionItem.vue.d.ts +16 -0
- package/dist/src/table/components/filters/NumberComparisonFilter.vue.d.ts +12 -0
- package/dist/src/table/components/filters/NumberComparisonFilterSettings.vue.d.ts +12 -0
- package/dist/src/table/components/filters/NumberRangeFilter.vue.d.ts +12 -0
- package/dist/src/table/components/filters/NumberRangeFilterSettings.vue.d.ts +12 -0
- package/dist/src/table/components/filters/filter-utils.d.ts +14 -0
- package/dist/src/table/composables/useTableAgentTools.d.ts +33 -0
- package/dist/src/table/index.d.ts +339 -0
- package/dist/src/table/tool-sandbox.d.ts +13 -0
- package/dist/src/table/tool-utils.d.ts +11 -0
- package/dist/src/table/tools.d.ts +333 -1
- package/dist/src/table/types.d.ts +79 -0
- package/dist/tool-sandbox-DdkMLkDK.mjs +182 -0
- package/dist/tool-sandbox-DoF1PsyS.js +115 -0
- package/dist/useTableAgentTools-D5mzGf3A.js +1 -0
- package/dist/useTableAgentTools-DcN3kYRL.mjs +131 -0
- package/package.json +17 -17
- package/src/table/tools.ts +304 -1
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-BdZbcubW.js +0 -1
- package/dist/OrderDetailDialog.vue_vue_type_script_setup_true_lang-BYSeUW_V.js +0 -925
- package/dist/OrderDetailDialog.vue_vue_type_script_setup_true_lang-DwAUYR8p.mjs +0 -5021
- package/dist/TableView-Ctnep-Qu.mjs +0 -6247
- package/dist/TableView-DJqyJL9L.js +0 -4
- package/dist/agenda-B54F8cEr.js +0 -1
- package/dist/orders-BMosTk6r.js +0 -1
- package/dist/reports-BQT_GZzU.js +0 -158
- package/dist/reports-DksZCTOw.mjs +0 -837
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
import { defineComponent as be, ref as x, computed as z, onMounted as xe, resolveComponent as he, openBlock as l, createElementBlock as u, createVNode as m, unref as f, createElementVNode as i, toDisplayString as c, Fragment as D, renderList as F, createTextVNode as h, createCommentVNode as _, withCtx as _e, normalizeClass as Y } from "vue";
|
|
2
|
+
import { useNuxtApp as ve } from "nuxt/app";
|
|
3
|
+
import { Loader2 as we, Table2 as Ae, Check as ke, ExternalLink as Ce, CalendarRange as $e, MousePointerClick as Ne, Columns3 as Se } from "lucide-vue-next";
|
|
4
|
+
import { g as je } from "./dateRangePresets-B-l5b_wR.mjs";
|
|
5
|
+
import { _ as Re, s as q } from "./TableResultView.vue_vue_type_script_setup_true_lang-CBn-Oxl9.mjs";
|
|
6
|
+
const ze = { class: "w-full min-w-0" }, De = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "flex items-center gap-2 py-3"
|
|
9
|
+
}, Fe = { class: "text-xs text-muted-foreground" }, Le = {
|
|
10
|
+
key: 1,
|
|
11
|
+
class: "rounded-xl border border-destructive/30 bg-destructive/5 p-3 text-xs text-destructive"
|
|
12
|
+
}, Oe = {
|
|
13
|
+
key: 2,
|
|
14
|
+
class: "overflow-hidden rounded-xl border bg-background"
|
|
15
|
+
}, Ee = { class: "flex items-start gap-3 border-b bg-muted/30 p-3" }, Ie = { class: "flex size-9 shrink-0 items-center justify-center rounded-lg bg-primary/10" }, Me = { class: "min-w-0 flex-1" }, Te = { class: "truncate text-sm font-semibold" }, Be = { class: "mt-0.5 text-[11px] text-muted-foreground" }, Pe = {
|
|
16
|
+
key: 0,
|
|
17
|
+
class: "mt-2 flex flex-wrap gap-1"
|
|
18
|
+
}, Ve = { class: "grid gap-3 border-b p-3 sm:grid-cols-2" }, Ue = { class: "rounded-lg border bg-muted/15 p-2.5" }, Ye = { class: "flex items-center gap-1.5 text-[11px] font-medium" }, qe = { class: "rounded-lg border bg-muted/15 p-2.5" }, He = { class: "flex items-center gap-1.5 text-[11px] font-medium" }, Qe = {
|
|
19
|
+
key: 0,
|
|
20
|
+
class: "mt-1.5 flex flex-wrap gap-1"
|
|
21
|
+
}, We = {
|
|
22
|
+
key: 1,
|
|
23
|
+
class: "mt-1 text-xs text-muted-foreground"
|
|
24
|
+
}, Ze = { class: "border-b p-3" }, Ge = { class: "mb-2 flex items-center justify-between gap-2" }, Je = { class: "flex items-center gap-1.5 text-[11px] font-medium" }, Ke = { class: "text-[10px] text-muted-foreground" }, Xe = {
|
|
25
|
+
key: 0,
|
|
26
|
+
class: "flex flex-wrap gap-1.5"
|
|
27
|
+
}, et = { class: "font-medium" }, tt = { class: "text-muted-foreground" }, rt = {
|
|
28
|
+
key: 0,
|
|
29
|
+
class: "text-muted-foreground/70"
|
|
30
|
+
}, st = {
|
|
31
|
+
key: 1,
|
|
32
|
+
class: "text-xs text-muted-foreground"
|
|
33
|
+
}, ot = { class: "p-3" }, nt = {
|
|
34
|
+
key: 0,
|
|
35
|
+
class: "mt-2 text-[11px] text-amber-600 dark:text-amber-400"
|
|
36
|
+
}, at = {
|
|
37
|
+
key: 0,
|
|
38
|
+
class: "border-t bg-muted/20 px-3 py-2 text-[10px] text-muted-foreground"
|
|
39
|
+
}, mt = /* @__PURE__ */ be({
|
|
40
|
+
__name: "TableOverviewCard",
|
|
41
|
+
props: {
|
|
42
|
+
projectSlug: {},
|
|
43
|
+
toolName: {},
|
|
44
|
+
instanceId: {},
|
|
45
|
+
instanceName: {},
|
|
46
|
+
moduleType: {},
|
|
47
|
+
resolvedArgs: {},
|
|
48
|
+
status: {}
|
|
49
|
+
},
|
|
50
|
+
emits: ["submit"],
|
|
51
|
+
setup(v, { emit: H }) {
|
|
52
|
+
const d = v, Q = H, { $useProjectService: W, $useModuleStorage: Z, $useFlowBuilder: G, $useRoute: L } = ve(), b = x(!0), g = x(null), n = x(null), w = x(null), O = x(!1), E = z(() => {
|
|
53
|
+
const e = Number(d.resolvedArgs?.sampleLimit);
|
|
54
|
+
return Number.isFinite(e) ? Math.min(Math.max(Math.floor(e), 1), 10) : 3;
|
|
55
|
+
}), J = z(() => n.value?.columns.filter((e) => e.visible !== !1) || []), I = z(() => {
|
|
56
|
+
if (!n.value) return [];
|
|
57
|
+
const e = {
|
|
58
|
+
fetchConfigured: "Data source connected",
|
|
59
|
+
viewable: "Row details",
|
|
60
|
+
editable: "Editable",
|
|
61
|
+
deletable: "Deletable",
|
|
62
|
+
addable: "Addable",
|
|
63
|
+
searchable: "Searchable",
|
|
64
|
+
downloadable: "Downloadable",
|
|
65
|
+
allowBulkActions: "Bulk actions"
|
|
66
|
+
};
|
|
67
|
+
return Object.entries(n.value.capabilities).filter(([, t]) => t).map(([t]) => e[t] || t);
|
|
68
|
+
});
|
|
69
|
+
function K() {
|
|
70
|
+
if (d.status !== "completed") return !1;
|
|
71
|
+
const e = d.resolvedArgs?._cachedData;
|
|
72
|
+
return !e || typeof e != "object" || Array.isArray(e) ? !1 : typeof e.error == "string" ? (g.value = e.error, b.value = !1, !0) : !e.module || !Array.isArray(e.columns) || !Array.isArray(e.sampleRows) ? !1 : (n.value = e, w.value = d.resolvedArgs?._fetchedAt || null, b.value = !1, !0);
|
|
73
|
+
}
|
|
74
|
+
async function X() {
|
|
75
|
+
b.value = !0, g.value = null;
|
|
76
|
+
try {
|
|
77
|
+
const e = W(), t = Z({
|
|
78
|
+
projectId: d.projectSlug,
|
|
79
|
+
moduleId: d.instanceId
|
|
80
|
+
}), [r, s] = await Promise.all([
|
|
81
|
+
e.getModule(d.projectSlug, d.instanceId),
|
|
82
|
+
t.getAllModuleData()
|
|
83
|
+
]), o = ee(s), a = te(o.columns), k = re(o.itemActions), $ = se(o.filters), N = oe(o.stats), S = ne(o.dateRangeFilter);
|
|
84
|
+
let y = [], j;
|
|
85
|
+
if (r?.config?.getItems)
|
|
86
|
+
try {
|
|
87
|
+
const { runFlow: p } = G(), ge = typeof L == "function" ? L() : null, ye = await p(
|
|
88
|
+
r.config.getItems,
|
|
89
|
+
ae(S.defaultPreset, ge?.query || {})
|
|
90
|
+
);
|
|
91
|
+
y = ie(ye);
|
|
92
|
+
} catch (p) {
|
|
93
|
+
j = B(p, "The table data sample could not be loaded.");
|
|
94
|
+
}
|
|
95
|
+
const R = a.length > 0 ? a : ce(y), P = R.filter((p) => p.visible !== !1).slice(0, 40), V = P.length > 0 ? y.slice(0, E.value).map((p) => le(p, P)).map(me) : [], U = q({
|
|
96
|
+
module: {
|
|
97
|
+
id: d.instanceId,
|
|
98
|
+
name: r?.name || d.instanceName,
|
|
99
|
+
type: r?.type || d.moduleType
|
|
100
|
+
},
|
|
101
|
+
capabilities: {
|
|
102
|
+
fetchConfigured: !!r?.config?.getItems,
|
|
103
|
+
viewable: r?.config?.viewable === !0,
|
|
104
|
+
editable: r?.config?.editable === !0,
|
|
105
|
+
deletable: r?.config?.deletable === !0,
|
|
106
|
+
addable: r?.config?.addable === !0,
|
|
107
|
+
searchable: r?.config?.searchable === !0,
|
|
108
|
+
downloadable: r?.config?.downloadable === !0,
|
|
109
|
+
allowBulkActions: r?.config?.allowBulkActions === !0
|
|
110
|
+
},
|
|
111
|
+
columnCount: R.length,
|
|
112
|
+
columns: R.slice(0, 40),
|
|
113
|
+
dateRangeFilter: S,
|
|
114
|
+
actionCount: k.length,
|
|
115
|
+
actions: k.slice(0, 20),
|
|
116
|
+
filters: $.slice(0, 20),
|
|
117
|
+
stats: N.slice(0, 20),
|
|
118
|
+
totalRows: y.length,
|
|
119
|
+
sampleCount: V.length,
|
|
120
|
+
sampleRows: V,
|
|
121
|
+
...j ? { sampleError: j } : {}
|
|
122
|
+
}, 512 * 1024);
|
|
123
|
+
n.value = U, w.value = (/* @__PURE__ */ new Date()).toISOString(), M(U);
|
|
124
|
+
} catch (e) {
|
|
125
|
+
g.value = B(e, "Failed to inspect this table."), M({ error: g.value });
|
|
126
|
+
} finally {
|
|
127
|
+
b.value = !1;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
function M(e) {
|
|
131
|
+
d.status === "completed" || O.value || (O.value = !0, Q("submit", e));
|
|
132
|
+
}
|
|
133
|
+
function ee(e) {
|
|
134
|
+
return Array.isArray(e) ? Object.fromEntries(
|
|
135
|
+
e.filter((t) => t && typeof t.key == "string").map((t) => [t.key, t.value])
|
|
136
|
+
) : e && typeof e == "object" ? e : {};
|
|
137
|
+
}
|
|
138
|
+
function te(e) {
|
|
139
|
+
return Array.isArray(e) ? e.filter((t) => t && typeof t.property == "string" && t.property.trim()).map((t, r) => ({
|
|
140
|
+
id: typeof t.id == "string" ? t.id : `column-${r}`,
|
|
141
|
+
property: t.property,
|
|
142
|
+
label: typeof t.label == "string" && t.label.trim() ? t.label : A(t.property),
|
|
143
|
+
type: typeof t.type == "string" && t.type ? t.type : "text",
|
|
144
|
+
visible: t.visible !== !1
|
|
145
|
+
})) : [];
|
|
146
|
+
}
|
|
147
|
+
function re(e) {
|
|
148
|
+
return Array.isArray(e) ? e.filter((t) => t && t.flow && (typeof t.id == "string" || typeof t.label == "string")).map((t, r) => ({
|
|
149
|
+
id: typeof t.id == "string" ? t.id : `action-${r}`,
|
|
150
|
+
label: typeof t.label == "string" && t.label.trim() ? t.label : `Action ${r + 1}`
|
|
151
|
+
})) : [];
|
|
152
|
+
}
|
|
153
|
+
function se(e) {
|
|
154
|
+
return Array.isArray(e) ? e.filter((t) => t && typeof t.property == "string").map((t, r) => ({
|
|
155
|
+
id: typeof t.id == "string" ? t.id : `filter-${r}`,
|
|
156
|
+
label: typeof t.label == "string" && t.label.trim() ? t.label : A(t.property),
|
|
157
|
+
property: t.property
|
|
158
|
+
})) : [];
|
|
159
|
+
}
|
|
160
|
+
function oe(e) {
|
|
161
|
+
return Array.isArray(e) ? e.filter((t) => t && typeof t.method == "string").map((t, r) => ({
|
|
162
|
+
id: typeof t.id == "string" ? t.id : `stat-${r}`,
|
|
163
|
+
label: typeof t.label == "string" && t.label.trim() ? t.label : `Statistic ${r + 1}`,
|
|
164
|
+
method: t.method,
|
|
165
|
+
...typeof t.field == "string" && t.field ? { field: t.field } : {}
|
|
166
|
+
})) : [];
|
|
167
|
+
}
|
|
168
|
+
function ne(e) {
|
|
169
|
+
const t = e && typeof e.defaultDate == "string" && e.defaultDate ? e.defaultDate : null;
|
|
170
|
+
return {
|
|
171
|
+
enabled: !!t,
|
|
172
|
+
defaultPreset: t,
|
|
173
|
+
label: t ? pe(t) : "Not configured"
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
function ae(e, t) {
|
|
177
|
+
const r = Object.entries(t).map(([$, N]) => ({
|
|
178
|
+
name: $.replace(/-([a-z])/g, (S, y) => y.toUpperCase()),
|
|
179
|
+
type: "routeQueryParam",
|
|
180
|
+
value: N ?? null
|
|
181
|
+
}));
|
|
182
|
+
if (!e) return r;
|
|
183
|
+
const o = je()[e];
|
|
184
|
+
if (!Array.isArray(o) || !o[0]) return r;
|
|
185
|
+
const a = T(o[0], !1), k = T(o[1] || o[0], !0);
|
|
186
|
+
return [...r, {
|
|
187
|
+
name: "dateRangeFilter",
|
|
188
|
+
type: "dateRangeFilter",
|
|
189
|
+
value: { from: a, to: k }
|
|
190
|
+
}];
|
|
191
|
+
}
|
|
192
|
+
function T(e, t) {
|
|
193
|
+
const [r, s, o] = e.split("-").map(Number), a = new Date(r, s - 1, o);
|
|
194
|
+
return t && a.setHours(23, 59, 59, 999), a;
|
|
195
|
+
}
|
|
196
|
+
function ie(e) {
|
|
197
|
+
return (Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : Array.isArray(e?.items) ? e.items : Array.isArray(e?.rows) ? e.rows : []).map((r) => r && typeof r == "object" && !Array.isArray(r) ? r : { value: r });
|
|
198
|
+
}
|
|
199
|
+
function le(e, t) {
|
|
200
|
+
return Object.fromEntries(t.map((r) => [
|
|
201
|
+
r.property,
|
|
202
|
+
ue(e, r.property)
|
|
203
|
+
]));
|
|
204
|
+
}
|
|
205
|
+
function ue(e, t) {
|
|
206
|
+
const r = t.split(".");
|
|
207
|
+
if (!r.some((s) => ["__proto__", "constructor", "prototype"].includes(s)))
|
|
208
|
+
return Object.prototype.hasOwnProperty.call(e, t) ? e[t] : r.reduce((s, o) => s?.[o], e);
|
|
209
|
+
}
|
|
210
|
+
function ce(e) {
|
|
211
|
+
const t = [], r = /* @__PURE__ */ new Set();
|
|
212
|
+
for (const s of e.slice(0, 10))
|
|
213
|
+
for (const o of Object.keys(s))
|
|
214
|
+
r.has(o) || (r.add(o), t.push(o));
|
|
215
|
+
return t.slice(0, 40).map((s, o) => ({
|
|
216
|
+
id: `inferred-${o}`,
|
|
217
|
+
property: s,
|
|
218
|
+
label: A(s),
|
|
219
|
+
type: de(s, e.map((a) => a[s])),
|
|
220
|
+
visible: !0
|
|
221
|
+
}));
|
|
222
|
+
}
|
|
223
|
+
function de(e, t) {
|
|
224
|
+
const s = e.toLowerCase().replace(/[_.-]/g, "");
|
|
225
|
+
if (/email$/.test(s)) return "email";
|
|
226
|
+
if (/(phone|mobile|telephone|tel)$/.test(s)) return "phone";
|
|
227
|
+
if (/(image|photo|avatar|thumbnail|logo|picture)$/.test(s)) return "image";
|
|
228
|
+
if (/(url|link|website|href)$/.test(s)) return "URL";
|
|
229
|
+
if (/(price|amount|cost|total|revenue|salary|fee)$/.test(s)) return "currency";
|
|
230
|
+
if (/(date|createdat|updatedat|timestamp)$/.test(s)) return "datetime";
|
|
231
|
+
const o = t.filter((a) => a != null && a !== "");
|
|
232
|
+
return o.length === 0 ? "text" : o.every((a) => typeof a == "boolean") ? "boolean" : o.every((a) => Array.isArray(a)) ? "array" : o.every((a) => typeof a == "number") ? "number" : "text";
|
|
233
|
+
}
|
|
234
|
+
function me(e) {
|
|
235
|
+
const t = C(e, 0, /* @__PURE__ */ new WeakSet());
|
|
236
|
+
try {
|
|
237
|
+
return q(t, 32 * 1024);
|
|
238
|
+
} catch {
|
|
239
|
+
return { _sampleOmitted: "This sample row was too large to include in chat." };
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
function C(e, t, r) {
|
|
243
|
+
if (e == null || typeof e == "number" || typeof e == "boolean") return e;
|
|
244
|
+
if (typeof e == "string") return e.length > 500 ? `${e.slice(0, 499)}…` : e;
|
|
245
|
+
if (typeof e == "bigint") return String(e);
|
|
246
|
+
if (e instanceof Date) return e.toISOString();
|
|
247
|
+
if (typeof e != "object") return String(e);
|
|
248
|
+
if (t >= 3) return Array.isArray(e) ? `[Array(${e.length})]` : "[Object]";
|
|
249
|
+
if (r.has(e)) return "[Circular]";
|
|
250
|
+
if (r.add(e), Array.isArray(e)) {
|
|
251
|
+
const o = e.slice(0, 10).map((a) => C(a, t + 1, r));
|
|
252
|
+
return e.length > 10 && o.push(`[${e.length - 10} more items]`), o;
|
|
253
|
+
}
|
|
254
|
+
const s = {};
|
|
255
|
+
for (const [o, a] of Object.entries(e).slice(0, 20))
|
|
256
|
+
o === "__proto__" || o === "constructor" || o === "prototype" || (s[o] = C(a, t + 1, r));
|
|
257
|
+
return s;
|
|
258
|
+
}
|
|
259
|
+
function A(e) {
|
|
260
|
+
return e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_.-]+/g, " ").replace(/\s+/g, " ").trim().replace(/\b\w/g, (t) => t.toUpperCase());
|
|
261
|
+
}
|
|
262
|
+
function pe(e) {
|
|
263
|
+
return {
|
|
264
|
+
today: "Today",
|
|
265
|
+
yesterday: "Yesterday",
|
|
266
|
+
last7days: "Last 7 days",
|
|
267
|
+
lastMonth: "Last 30 days",
|
|
268
|
+
last6months: "Last 6 months",
|
|
269
|
+
lastYear: "Last 12 months",
|
|
270
|
+
tomorrow: "Tomorrow",
|
|
271
|
+
next7days: "Next 7 days",
|
|
272
|
+
nextMonth: "Next 30 days",
|
|
273
|
+
next6months: "Next 6 months",
|
|
274
|
+
nextYear: "Next 12 months"
|
|
275
|
+
}[e] || A(e);
|
|
276
|
+
}
|
|
277
|
+
function B(e, t) {
|
|
278
|
+
const r = e?.data?.statusMessage || e?.statusMessage || e?.message;
|
|
279
|
+
return typeof r == "string" && r.trim() ? r.slice(0, 500) : t;
|
|
280
|
+
}
|
|
281
|
+
function fe(e) {
|
|
282
|
+
if (!e) return "";
|
|
283
|
+
const t = new Date(e);
|
|
284
|
+
return Number.isNaN(t.getTime()) ? "" : t.toLocaleString(void 0, {
|
|
285
|
+
month: "short",
|
|
286
|
+
day: "numeric",
|
|
287
|
+
hour: "2-digit",
|
|
288
|
+
minute: "2-digit"
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
return xe(() => {
|
|
292
|
+
d.status === "completed" && K() || X();
|
|
293
|
+
}), (e, t) => {
|
|
294
|
+
const r = he("NuxtLink");
|
|
295
|
+
return l(), u("div", ze, [
|
|
296
|
+
b.value ? (l(), u("div", De, [
|
|
297
|
+
m(f(we), { class: "size-4 animate-spin text-muted-foreground" }),
|
|
298
|
+
i("span", Fe, "Inspecting " + c(v.instanceName) + "…", 1)
|
|
299
|
+
])) : g.value ? (l(), u("div", Le, c(g.value), 1)) : n.value ? (l(), u("div", Oe, [
|
|
300
|
+
i("div", Ee, [
|
|
301
|
+
i("div", Ie, [
|
|
302
|
+
m(f(Ae), { class: "size-4 text-primary" })
|
|
303
|
+
]),
|
|
304
|
+
i("div", Me, [
|
|
305
|
+
i("p", Te, c(n.value.module.name), 1),
|
|
306
|
+
i("p", Be, c(n.value.totalRows) + " " + c(n.value.totalRows === 1 ? "row" : "rows") + " · " + c(n.value.columnCount) + " " + c(n.value.columnCount === 1 ? "column" : "columns"), 1),
|
|
307
|
+
I.value.length ? (l(), u("div", Pe, [
|
|
308
|
+
(l(!0), u(D, null, F(I.value, (s) => (l(), u("span", {
|
|
309
|
+
key: s,
|
|
310
|
+
class: "inline-flex items-center gap-1 rounded-full border bg-background px-1.5 py-0.5 text-[10px] text-muted-foreground"
|
|
311
|
+
}, [
|
|
312
|
+
m(f(ke), { class: "size-2.5 text-emerald-500" }),
|
|
313
|
+
h(" " + c(s), 1)
|
|
314
|
+
]))), 128))
|
|
315
|
+
])) : _("", !0)
|
|
316
|
+
]),
|
|
317
|
+
m(r, {
|
|
318
|
+
to: `/projects/${v.projectSlug}/modules/${v.instanceId}`,
|
|
319
|
+
class: "inline-flex shrink-0 items-center gap-1 text-[11px] text-primary hover:underline"
|
|
320
|
+
}, {
|
|
321
|
+
default: _e(() => [
|
|
322
|
+
t[0] || (t[0] = h(" Open ", -1)),
|
|
323
|
+
m(f(Ce), { class: "size-3" })
|
|
324
|
+
]),
|
|
325
|
+
_: 1
|
|
326
|
+
}, 8, ["to"])
|
|
327
|
+
]),
|
|
328
|
+
i("div", Ve, [
|
|
329
|
+
i("div", Ue, [
|
|
330
|
+
i("div", Ye, [
|
|
331
|
+
m(f($e), { class: "size-3.5 text-primary" }),
|
|
332
|
+
t[1] || (t[1] = h(" Date range filter ", -1))
|
|
333
|
+
]),
|
|
334
|
+
i("p", {
|
|
335
|
+
class: Y(["mt-1 text-xs", n.value.dateRangeFilter.enabled ? "text-foreground" : "text-muted-foreground"])
|
|
336
|
+
}, c(n.value.dateRangeFilter.label), 3)
|
|
337
|
+
]),
|
|
338
|
+
i("div", qe, [
|
|
339
|
+
i("div", He, [
|
|
340
|
+
m(f(Ne), { class: "size-3.5 text-primary" }),
|
|
341
|
+
t[2] || (t[2] = h(" Row actions ", -1))
|
|
342
|
+
]),
|
|
343
|
+
n.value.actions.length ? (l(), u("div", Qe, [
|
|
344
|
+
(l(!0), u(D, null, F(n.value.actions, (s) => (l(), u("span", {
|
|
345
|
+
key: s.id,
|
|
346
|
+
class: "rounded-full bg-primary/10 px-1.5 py-0.5 text-[10px] font-medium text-primary"
|
|
347
|
+
}, c(s.label), 1))), 128))
|
|
348
|
+
])) : (l(), u("p", We, "No row actions configured"))
|
|
349
|
+
])
|
|
350
|
+
]),
|
|
351
|
+
i("div", Ze, [
|
|
352
|
+
i("div", Ge, [
|
|
353
|
+
i("div", Je, [
|
|
354
|
+
m(f(Se), { class: "size-3.5 text-primary" }),
|
|
355
|
+
t[3] || (t[3] = h(" Columns ", -1))
|
|
356
|
+
]),
|
|
357
|
+
i("span", Ke, c(J.value.length) + " visible ", 1)
|
|
358
|
+
]),
|
|
359
|
+
n.value.columns.length ? (l(), u("div", Xe, [
|
|
360
|
+
(l(!0), u(D, null, F(n.value.columns, (s) => (l(), u("span", {
|
|
361
|
+
key: s.id || s.property,
|
|
362
|
+
class: Y(["inline-flex items-center gap-1 rounded-md border px-2 py-1 text-[10px]", s.visible ? "bg-background" : "bg-muted/40 text-muted-foreground"])
|
|
363
|
+
}, [
|
|
364
|
+
i("span", et, c(s.label), 1),
|
|
365
|
+
i("span", tt, c(s.type), 1),
|
|
366
|
+
s.visible ? _("", !0) : (l(), u("span", rt, "hidden"))
|
|
367
|
+
], 2))), 128))
|
|
368
|
+
])) : (l(), u("p", st, "No columns could be inferred."))
|
|
369
|
+
]),
|
|
370
|
+
i("div", ot, [
|
|
371
|
+
m(Re, {
|
|
372
|
+
rows: n.value.sampleRows,
|
|
373
|
+
columns: n.value.columns,
|
|
374
|
+
title: "Sample data",
|
|
375
|
+
description: n.value.sampleCount ? `First ${n.value.sampleCount} ${n.value.sampleCount === 1 ? "row" : "rows"} from the current data set` : "",
|
|
376
|
+
"total-count": n.value.sampleCount,
|
|
377
|
+
"max-rows": E.value,
|
|
378
|
+
"max-columns": 6,
|
|
379
|
+
"empty-text": "No sample rows were returned."
|
|
380
|
+
}, null, 8, ["rows", "columns", "description", "total-count", "max-rows"]),
|
|
381
|
+
n.value.sampleError ? (l(), u("p", nt, c(n.value.sampleError), 1)) : _("", !0)
|
|
382
|
+
]),
|
|
383
|
+
w.value ? (l(), u("div", at, " Snapshot from " + c(fe(w.value)), 1)) : _("", !0)
|
|
384
|
+
])) : _("", !0)
|
|
385
|
+
]);
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
});
|
|
389
|
+
export {
|
|
390
|
+
mt as default
|
|
391
|
+
};
|