@oneclick.dev/cms-core-modules 0.0.123 → 0.0.125
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/AppointmentListTable-CWzbwqR-.js +1 -0
- package/dist/AppointmentListTable-DoZuBstk.mjs +270 -0
- package/dist/ContentEditor-BlNbqkAz.js +324 -0
- package/dist/{ContentEditor-MDGolnIP.mjs → ContentEditor-D754iLJS.mjs} +7985 -26820
- package/dist/{Detail-Dk8E6_uF.mjs → Detail-BOxWQ1QQ.mjs} +15 -14
- package/dist/{Detail-Cn9Bk0u0.mjs → Detail-BfKW0uZE.mjs} +26 -25
- package/dist/Detail-DFVu2F38.mjs +11 -0
- package/dist/Detail-DJea_fCd.js +1 -0
- package/dist/Detail-DPJacXfm.js +1 -0
- package/dist/Detail-DSLZ7_bM.js +1 -0
- package/dist/Detail-DUGThL9Y.js +1 -0
- package/dist/{Detail-B_scnidb.mjs → Detail-D_LlEeHu.mjs} +35 -34
- package/dist/Editor-D4evcdhv.mjs +768 -0
- package/dist/Editor-gLLtuJbY.js +1 -0
- package/dist/FormStatusBadge.vue_vue_type_script_setup_true_lang-BjKpsqT9.js +1 -0
- package/dist/FormStatusBadge.vue_vue_type_script_setup_true_lang-D5v5AhLe.mjs +76 -0
- package/dist/Knowledge-B66vxz--.js +1 -0
- package/dist/Knowledge-BnMTTuJ7.mjs +742 -0
- package/dist/Overview-0hFXiuYo.js +1 -0
- package/dist/Overview-BE4uYPx0.mjs +745 -0
- package/dist/Overview-BTx5LF4J.js +1 -0
- package/dist/Overview-CCu2PHai.mjs +289 -0
- package/dist/Overview-CQRpFhbJ.mjs +286 -0
- package/dist/Overview-CTs7sX4d.js +1 -0
- package/dist/Overview-Cj89XXKN.js +1 -0
- package/dist/Overview-D2u-leeO.js +1 -0
- package/dist/Overview-D_2wozCG.mjs +1733 -0
- package/dist/Overview-D_c18mbR.mjs +248 -0
- package/dist/Overview-Dffo-zH4.mjs +11 -0
- package/dist/Overview-g4Rcj245.js +1 -0
- package/dist/{TableCalculationWidget-CrqcLGfU.mjs → TableCalculationWidget-B_LFoOYm.mjs} +3 -3
- package/dist/{TableCalculationWidget-CkQPrVUd.js → TableCalculationWidget-CahOIcbk.js} +1 -1
- package/dist/TableDataWidget-BwqWFH4A.js +1 -0
- package/dist/TableDataWidget-RsVxcDsL.mjs +112 -0
- package/dist/TableOverviewCard-BPWCqo56.js +1 -0
- package/dist/{TableOverviewCard-Ci0d4o4w.mjs → TableOverviewCard-D667DDag.mjs} +113 -127
- package/dist/TableResultView.vue_vue_type_script_setup_true_lang-C3XiOXgb.js +1 -0
- package/dist/TableResultView.vue_vue_type_script_setup_true_lang-sp0TLio0.mjs +547 -0
- package/dist/{TableRowActionCard-BhdnnPaq.mjs → TableRowActionCard-BPYJ-Kjy.mjs} +95 -101
- package/dist/TableRowActionCard-Bnqj1YIe.js +1 -0
- package/dist/TableView-CwhZ9YN2.js +4 -0
- package/dist/TableView-DX9PKS8N.mjs +9673 -0
- package/dist/TemplateBuilder.vue_vue_type_script_setup_true_lang-BgDdzbLe.js +1 -0
- package/dist/TemplateBuilder.vue_vue_type_script_setup_true_lang-D85V4nrQ.mjs +2886 -0
- package/dist/Test-CzmOmi53.mjs +447 -0
- package/dist/Test-USDtNFY1.js +1 -0
- package/dist/UserDetail-DpUL3mhk.mjs +1483 -0
- package/dist/UserDetail-KRIfxaYd.js +1 -0
- package/dist/cms-core-modules.css +1 -1
- package/dist/dateRangePresets-CaPVagHY.mjs +453 -0
- package/dist/dateRangePresets-gxQCiZ6c.js +1 -0
- package/dist/index-6hZ6MYY6.js +1 -0
- package/dist/index-BVmmicu3.mjs +14 -0
- package/dist/index-CQuN5rKx.js +1 -0
- package/dist/index-ChHD_1Cf.js +144 -0
- package/dist/index-CnDGeInm.js +1 -0
- package/dist/index-CqDTc5Ig.mjs +20 -0
- package/dist/index-CvV4nVWI.js +1 -0
- package/dist/index-CyvvAdt4.js +1 -0
- package/dist/index-DH2z0W_w.mjs +19012 -0
- package/dist/index-DIRD7t5_.mjs +20 -0
- package/dist/index-DZKzj48V.mjs +17 -0
- package/dist/index-OJuBYR60.mjs +57 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.mjs +480 -103
- package/dist/orders-C_sz8J9b.js +1 -0
- package/dist/{orders-BfTLIm7U.mjs → orders-Cgdggzvx.mjs} +84 -84
- package/dist/server-handlers.cjs.js +1 -1
- package/dist/server-handlers.mjs +2696 -605
- package/dist/src/appointments/chat-components/AppointmentListTable.vue.d.ts +3 -0
- package/dist/src/appointments/index.d.ts +93 -3
- package/dist/src/appointments/reservation-summary.d.ts +48 -0
- package/dist/src/appointments/server.d.ts +1 -0
- package/dist/src/appointments/tools.d.ts +93 -3
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/Container.d.ts +1 -1
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/Row.d.ts +7 -0
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/Stack.d.ts +7 -0
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/helpers/resizeHistory.d.ts +9 -0
- package/dist/src/contentManager/components/content-editor/tiptap-menus/ElementEditorMenu.vue.d.ts +3 -1
- package/dist/src/filezone/config.d.ts +31 -0
- package/dist/src/filezone/index.d.ts +43 -0
- package/dist/src/filezone/index.vue.d.ts +2 -0
- package/dist/src/filezone/metadata.d.ts +2 -0
- package/dist/src/filezone/pages/Overview.vue.d.ts +4 -0
- package/dist/src/filezone/permissions.d.ts +5 -0
- package/dist/src/filezone/routes.d.ts +5 -0
- package/dist/src/filezone/server.d.ts +36 -0
- package/dist/src/firebaseAuthManager/components/DeleteUserDialog.vue.d.ts +25 -0
- package/dist/src/firebaseAuthManager/components/ReasonActionDialog.vue.d.ts +23 -0
- package/dist/src/firebaseAuthManager/components/UserStatusBadge.vue.d.ts +5 -0
- package/dist/src/firebaseAuthManager/config.d.ts +151 -0
- package/dist/src/firebaseAuthManager/index.d.ts +163 -0
- package/dist/src/firebaseAuthManager/index.vue.d.ts +14 -0
- package/dist/src/firebaseAuthManager/metadata.d.ts +2 -0
- package/dist/src/firebaseAuthManager/pages/Overview.vue.d.ts +2 -0
- package/dist/src/firebaseAuthManager/pages/UserDetail.vue.d.ts +2 -0
- package/dist/src/firebaseAuthManager/permissions.d.ts +5 -0
- package/dist/src/firebaseAuthManager/routes.d.ts +5 -0
- package/dist/src/firebaseAuthManager/server.d.ts +162 -0
- package/dist/src/firebaseAuthManager/types.d.ts +84 -0
- package/dist/src/formBuilder/components/FormPreviewDialog.vue.d.ts +12 -0
- package/dist/src/formBuilder/components/FormStatusBadge.vue.d.ts +9 -0
- package/dist/src/formBuilder/config.d.ts +31 -0
- package/dist/src/formBuilder/index.d.ts +44 -0
- package/dist/src/formBuilder/index.vue.d.ts +14 -0
- package/dist/src/formBuilder/lib/forms.d.ts +11 -0
- package/dist/src/formBuilder/metadata.d.ts +2 -0
- package/dist/src/formBuilder/pages/Editor.vue.d.ts +2 -0
- package/dist/src/formBuilder/pages/Overview.vue.d.ts +2 -0
- package/dist/src/formBuilder/permissions.d.ts +5 -0
- package/dist/src/formBuilder/routes.d.ts +5 -0
- package/dist/src/formBuilder/server.d.ts +87 -0
- package/dist/src/formBuilder/tools.d.ts +1 -0
- package/dist/src/formBuilder/types.d.ts +46 -0
- package/dist/src/helpbot/composables/useHelpbotApi.d.ts +18 -0
- package/dist/src/helpbot/config.d.ts +17 -0
- package/dist/src/helpbot/index.d.ts +29 -0
- package/dist/src/helpbot/index.vue.d.ts +2 -0
- package/dist/src/helpbot/metadata.d.ts +2 -0
- package/dist/src/helpbot/pages/Knowledge.vue.d.ts +4 -0
- package/dist/src/helpbot/pages/Overview.vue.d.ts +2 -0
- package/dist/src/helpbot/pages/Test.vue.d.ts +4 -0
- package/dist/src/helpbot/permissions.d.ts +5 -0
- package/dist/src/helpbot/routes.d.ts +5 -0
- package/dist/src/helpbot/types.d.ts +42 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/src/mailTemplates/builder-types.d.ts +40 -0
- package/dist/src/mailTemplates/components/BlockRenderer.vue.d.ts +24 -0
- package/dist/src/mailTemplates/components/DesignPanel.vue.d.ts +13 -0
- package/dist/src/mailTemplates/components/EmailCanvas.vue.d.ts +44 -0
- package/dist/src/mailTemplates/components/RichTextEditor.vue.d.ts +10 -0
- package/dist/src/mailTemplates/components/RightSidebar.vue.d.ts +18 -0
- package/dist/src/mailTemplates/components/SettingsPanel.vue.d.ts +15 -0
- package/dist/src/mailTemplates/components/TemplateBuilder.vue.d.ts +2 -0
- package/dist/src/mailTemplates/components/TemplateList.vue.d.ts +19 -1
- package/dist/src/mailTemplates/components/rich-text.d.ts +6 -0
- package/dist/src/mailTemplates/config.d.ts +10 -4
- package/dist/src/mailTemplates/defaults.d.ts +10 -0
- package/dist/src/mailTemplates/editor-state.d.ts +21 -0
- package/dist/src/mailTemplates/index.d.ts +11 -5
- package/dist/src/mailTemplates/index.vue.d.ts +2 -4
- package/dist/src/mailTemplates/metadata.d.ts +1 -1
- package/dist/src/mailTemplates/pages/Detail.vue.d.ts +1 -13
- package/dist/src/mailTemplates/pages/Overview.vue.d.ts +1 -13
- package/dist/src/mailTemplates/server.d.ts +23 -0
- package/dist/src/server-handlers.d.ts +6 -0
- package/dist/src/table/badge-filter-utils.d.ts +8 -0
- package/dist/src/table/chat-components/TableOverviewCard.vue.d.ts +2 -7
- package/dist/src/table/chat-components/TableResultView.vue.d.ts +3 -7
- package/dist/src/table/components/TableDisplayCell.vue.d.ts +8 -0
- package/dist/src/table/components/columns/BadgeColumnSettings.vue.d.ts +9 -0
- package/dist/src/table/components/columns/ColumnColorSelect.vue.d.ts +11 -0
- package/dist/src/table/components/columns/ColumnDisplaySettings.vue.d.ts +9 -0
- package/dist/src/table/components/columns/ColumnTypeSelect.vue.d.ts +11 -0
- package/dist/src/table/components/columns/ColumnValueSourceInput.vue.d.ts +15 -0
- package/dist/src/table/components/columns/DialogTableColumnItem.vue.d.ts +8 -11
- package/dist/src/table/components/columns/ProgressColumnSettings.vue.d.ts +8 -0
- package/dist/src/table/components/stats/StatDialog.vue.d.ts +6 -10
- package/dist/src/table/components/stats/Stats.vue.d.ts +9 -15
- package/dist/src/table/composables/useTableClock.d.ts +4 -0
- package/dist/src/table/display-utils.d.ts +35 -0
- package/dist/src/table/row-value.d.ts +1 -0
- package/dist/src/table/stat-utils.d.ts +9 -0
- package/dist/src/table/tool-utils.d.ts +1 -1
- package/dist/src/table/types.d.ts +54 -1
- package/dist/src/whatsappBusiness/analytics.d.ts +4 -0
- package/dist/src/whatsappBusiness/components/AccountPanel.vue.d.ts +2 -0
- package/dist/src/whatsappBusiness/components/InsightsPanel.vue.d.ts +5 -0
- package/dist/src/whatsappBusiness/components/TemplateDialog.vue.d.ts +14 -0
- package/dist/src/whatsappBusiness/components/TemplatesPanel.vue.d.ts +5 -0
- package/dist/src/whatsappBusiness/components/presentation.d.ts +4 -0
- package/dist/src/whatsappBusiness/config.d.ts +51 -0
- package/dist/src/whatsappBusiness/connection.d.ts +77 -0
- package/dist/src/whatsappBusiness/index.d.ts +63 -0
- package/dist/src/whatsappBusiness/index.vue.d.ts +5 -0
- package/dist/src/whatsappBusiness/metadata.d.ts +2 -0
- package/dist/src/whatsappBusiness/pages/Overview.vue.d.ts +2 -0
- package/dist/src/whatsappBusiness/permissions.d.ts +5 -0
- package/dist/src/whatsappBusiness/provider.d.ts +21 -0
- package/dist/src/whatsappBusiness/routes.d.ts +5 -0
- package/dist/src/whatsappBusiness/server.d.ts +14 -0
- package/dist/src/whatsappBusiness/templates.d.ts +94 -0
- package/dist/src/whatsappBusiness/types.d.ts +162 -0
- package/dist/{tool-sandbox-DoF1PsyS.js → tool-sandbox-BSkKdH7V.js} +1 -1
- package/dist/{tool-sandbox-DdkMLkDK.mjs → tool-sandbox-DU9b1B7v.mjs} +1 -1
- package/dist/types-9N-DKxNj.mjs +250 -0
- package/dist/types-B5MifmeF.mjs +2696 -0
- package/dist/types-Cem0vPo_.js +1 -0
- package/dist/types-D5dgTskW.js +1 -0
- package/dist/useHelpbotApi-BIIungOh.js +1 -0
- package/dist/useHelpbotApi-HC9JSiSn.mjs +229 -0
- package/dist/{useTableAgentTools-D5mzGf3A.js → useTableAgentTools-BrUot49I.js} +1 -1
- package/dist/{useTableAgentTools-DcN3kYRL.mjs → useTableAgentTools-r5InEI4p.mjs} +8 -8
- package/dist/vee-validate-zod-CWZwNTWE.js +1 -0
- package/dist/vee-validate-zod-D0WaDgDZ.mjs +1780 -0
- package/package.json +2 -2
- package/src/appointments/tools.ts +52 -2
- package/src/formBuilder/tools.ts +1 -0
- package/dist/AppointmentListTable-DZJNmTMb.mjs +0 -177
- package/dist/AppointmentListTable-Dieu9US_.js +0 -1
- package/dist/ContentEditor-C-Wm48ai.js +0 -467
- package/dist/Detail-BCUUNWvp.js +0 -1
- package/dist/Detail-Byk781b4.mjs +0 -26
- package/dist/Detail-DGg_xXZc.js +0 -1
- package/dist/Detail-Sc2qZdxj.js +0 -1
- package/dist/Detail-mvSGbnFU.js +0 -1
- package/dist/Overview-BDlBCUI_.js +0 -1
- package/dist/Overview-Su8ZUbMs.mjs +0 -26
- package/dist/TableDataWidget-7qvC3Egd.js +0 -1
- package/dist/TableDataWidget-DMTSoGRO.mjs +0 -121
- package/dist/TableOverviewCard-AFq-puJs.js +0 -1
- package/dist/TableResultView.vue_vue_type_script_setup_true_lang-CBn-Oxl9.mjs +0 -534
- package/dist/TableResultView.vue_vue_type_script_setup_true_lang-C_Lv-SmJ.js +0 -1
- package/dist/TableRowActionCard-IzB6tNN-.js +0 -1
- package/dist/TableView-BkwoKREo.js +0 -4
- package/dist/TableView-C4Zyp8d7.mjs +0 -8228
- package/dist/TemplateList.vue_vue_type_script_setup_true_lang-B_AtWnHa.js +0 -1
- package/dist/TemplateList.vue_vue_type_script_setup_true_lang-Cmovy7kk.mjs +0 -40
- package/dist/dateRangePresets-B-l5b_wR.mjs +0 -48
- package/dist/dateRangePresets-CPWqst_x.js +0 -1
- package/dist/orders-DUa2PVoa.js +0 -1
- package/dist/vee-validate-zod-SjDT8X35.mjs +0 -4404
- package/dist/vee-validate-zod-VCmLnrtQ.js +0 -1
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useNuxtApp as
|
|
3
|
-
import { Loader2 as
|
|
4
|
-
import { g as je } from "./dateRangePresets-
|
|
5
|
-
import { _ as
|
|
6
|
-
const
|
|
1
|
+
import { defineComponent as ge, ref as x, computed as z, onMounted as be, resolveComponent as ye, openBlock as i, createElementBlock as u, createVNode as m, unref as f, createElementVNode as l, toDisplayString as c, Fragment as D, renderList as F, createTextVNode as h, createCommentVNode as _, withCtx as xe, normalizeClass as Y } from "vue";
|
|
2
|
+
import { useNuxtApp as he } from "nuxt/app";
|
|
3
|
+
import { Loader2 as _e, Table2 as we, Check as ve, ExternalLink as Ae, CalendarRange as ke, MousePointerClick as Ce, Columns3 as Ne } from "lucide-vue-next";
|
|
4
|
+
import { g as $e, p as Se, s as je, a as Re } from "./dateRangePresets-CaPVagHY.mjs";
|
|
5
|
+
import { _ as ze, s as q, n as De } from "./TableResultView.vue_vue_type_script_setup_true_lang-sp0TLio0.mjs";
|
|
6
|
+
const Fe = { class: "w-full min-w-0" }, Le = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "flex items-center gap-2 py-3"
|
|
9
|
-
},
|
|
9
|
+
}, Te = { class: "text-xs text-muted-foreground" }, Ee = {
|
|
10
10
|
key: 1,
|
|
11
11
|
class: "rounded-xl border border-destructive/30 bg-destructive/5 p-3 text-xs text-destructive"
|
|
12
|
-
},
|
|
12
|
+
}, Ie = {
|
|
13
13
|
key: 2,
|
|
14
14
|
class: "overflow-hidden rounded-xl border bg-background"
|
|
15
|
-
},
|
|
15
|
+
}, Oe = { class: "flex items-start gap-3 border-b bg-muted/30 p-3" }, Me = { class: "flex size-9 shrink-0 items-center justify-center rounded-lg bg-primary/10" }, Be = { class: "min-w-0 flex-1" }, Pe = { class: "truncate text-sm font-semibold" }, Ve = { class: "mt-0.5 text-[11px] text-muted-foreground" }, Ue = {
|
|
16
16
|
key: 0,
|
|
17
17
|
class: "mt-2 flex flex-wrap gap-1"
|
|
18
|
-
},
|
|
18
|
+
}, Ye = { class: "grid gap-3 border-b p-3 sm:grid-cols-2" }, qe = { class: "rounded-lg border bg-muted/15 p-2.5" }, He = { class: "flex items-center gap-1.5 text-[11px] font-medium" }, Qe = { class: "rounded-lg border bg-muted/15 p-2.5" }, We = { class: "flex items-center gap-1.5 text-[11px] font-medium" }, Ze = {
|
|
19
19
|
key: 0,
|
|
20
20
|
class: "mt-1.5 flex flex-wrap gap-1"
|
|
21
|
-
},
|
|
21
|
+
}, Ge = {
|
|
22
22
|
key: 1,
|
|
23
23
|
class: "mt-1 text-xs text-muted-foreground"
|
|
24
|
-
},
|
|
24
|
+
}, Je = { class: "border-b p-3" }, Ke = { class: "mb-2 flex items-center justify-between gap-2" }, Xe = { class: "flex items-center gap-1.5 text-[11px] font-medium" }, et = { class: "text-[10px] text-muted-foreground" }, tt = {
|
|
25
25
|
key: 0,
|
|
26
26
|
class: "flex flex-wrap gap-1.5"
|
|
27
|
-
},
|
|
27
|
+
}, rt = { class: "font-medium" }, st = { class: "text-muted-foreground" }, ot = {
|
|
28
28
|
key: 0,
|
|
29
29
|
class: "text-muted-foreground/70"
|
|
30
|
-
},
|
|
30
|
+
}, nt = {
|
|
31
31
|
key: 1,
|
|
32
32
|
class: "text-xs text-muted-foreground"
|
|
33
|
-
},
|
|
33
|
+
}, at = { class: "p-3" }, lt = {
|
|
34
34
|
key: 0,
|
|
35
35
|
class: "mt-2 text-[11px] text-amber-600 dark:text-amber-400"
|
|
36
|
-
},
|
|
36
|
+
}, it = {
|
|
37
37
|
key: 0,
|
|
38
38
|
class: "border-t bg-muted/20 px-3 py-2 text-[10px] text-muted-foreground"
|
|
39
|
-
},
|
|
39
|
+
}, pt = /* @__PURE__ */ ge({
|
|
40
40
|
__name: "TableOverviewCard",
|
|
41
41
|
props: {
|
|
42
42
|
projectSlug: {},
|
|
@@ -48,8 +48,8 @@ const ze = { class: "w-full min-w-0" }, De = {
|
|
|
48
48
|
status: {}
|
|
49
49
|
},
|
|
50
50
|
emits: ["submit"],
|
|
51
|
-
setup(
|
|
52
|
-
const d =
|
|
51
|
+
setup(w, { emit: H }) {
|
|
52
|
+
const d = w, Q = H, { $useProjectService: W, $useModuleStorage: Z, $useFlowBuilder: G, $useRoute: L } = he(), y = x(!0), g = x(null), n = x(null), v = x(null), T = x(!1), E = z(() => {
|
|
53
53
|
const e = Number(d.resolvedArgs?.sampleLimit);
|
|
54
54
|
return Number.isFinite(e) ? Math.min(Math.max(Math.floor(e), 1), 10) : 3;
|
|
55
55
|
}), J = z(() => n.value?.columns.filter((e) => e.visible !== !1) || []), I = z(() => {
|
|
@@ -69,10 +69,10 @@ const ze = { class: "w-full min-w-0" }, De = {
|
|
|
69
69
|
function K() {
|
|
70
70
|
if (d.status !== "completed") return !1;
|
|
71
71
|
const e = d.resolvedArgs?._cachedData;
|
|
72
|
-
return !e || typeof e != "object" || Array.isArray(e) ? !1 : typeof e.error == "string" ? (g.value = e.error,
|
|
72
|
+
return !e || typeof e != "object" || Array.isArray(e) ? !1 : typeof e.error == "string" ? (g.value = e.error, y.value = !1, !0) : !e.module || !Array.isArray(e.columns) || !Array.isArray(e.sampleRows) ? !1 : (n.value = e, v.value = d.resolvedArgs?._fetchedAt || null, y.value = !1, !0);
|
|
73
73
|
}
|
|
74
74
|
async function X() {
|
|
75
|
-
|
|
75
|
+
y.value = !0, g.value = null;
|
|
76
76
|
try {
|
|
77
77
|
const e = W(), t = Z({
|
|
78
78
|
projectId: d.projectSlug,
|
|
@@ -80,19 +80,19 @@ const ze = { class: "w-full min-w-0" }, De = {
|
|
|
80
80
|
}), [r, s] = await Promise.all([
|
|
81
81
|
e.getModule(d.projectSlug, d.instanceId),
|
|
82
82
|
t.getAllModuleData()
|
|
83
|
-
]), o = ee(s), a = te(o.columns),
|
|
84
|
-
let
|
|
83
|
+
]), o = ee(s), a = te(o.columns), A = re(o.itemActions), N = se(o.filters), $ = oe(o.stats), S = ne(o.dateRangeFilter);
|
|
84
|
+
let b = [], j;
|
|
85
85
|
if (r?.config?.getItems)
|
|
86
86
|
try {
|
|
87
|
-
const { runFlow: p } = G(),
|
|
87
|
+
const { runFlow: p } = G(), fe = typeof L == "function" ? L() : null, pe = await p(
|
|
88
88
|
r.config.getItems,
|
|
89
|
-
ae(S.defaultPreset,
|
|
89
|
+
ae(S.defaultPreset, fe?.query || {})
|
|
90
90
|
);
|
|
91
|
-
|
|
91
|
+
b = le(pe);
|
|
92
92
|
} catch (p) {
|
|
93
93
|
j = B(p, "The table data sample could not be loaded.");
|
|
94
94
|
}
|
|
95
|
-
const R = a.length > 0 ? a :
|
|
95
|
+
const R = a.length > 0 ? a : ie(b), P = R.filter((p) => p.visible !== !1).slice(0, 40), V = P.length > 0 ? b.slice(0, E.value).map((p) => Se(p, P)).map(ce) : [], U = q({
|
|
96
96
|
module: {
|
|
97
97
|
id: d.instanceId,
|
|
98
98
|
name: r?.name || d.instanceName,
|
|
@@ -109,26 +109,26 @@ const ze = { class: "w-full min-w-0" }, De = {
|
|
|
109
109
|
allowBulkActions: r?.config?.allowBulkActions === !0
|
|
110
110
|
},
|
|
111
111
|
columnCount: R.length,
|
|
112
|
-
columns: R.slice(0, 40),
|
|
112
|
+
columns: R.slice(0, 40).map(je),
|
|
113
113
|
dateRangeFilter: S,
|
|
114
|
-
actionCount:
|
|
115
|
-
actions:
|
|
116
|
-
filters:
|
|
117
|
-
stats:
|
|
118
|
-
totalRows:
|
|
114
|
+
actionCount: A.length,
|
|
115
|
+
actions: A.slice(0, 20),
|
|
116
|
+
filters: N.slice(0, 20),
|
|
117
|
+
stats: $.slice(0, 20),
|
|
118
|
+
totalRows: b.length,
|
|
119
119
|
sampleCount: V.length,
|
|
120
120
|
sampleRows: V,
|
|
121
121
|
...j ? { sampleError: j } : {}
|
|
122
122
|
}, 512 * 1024);
|
|
123
|
-
n.value = U,
|
|
123
|
+
n.value = U, v.value = (/* @__PURE__ */ new Date()).toISOString(), O(U);
|
|
124
124
|
} catch (e) {
|
|
125
|
-
g.value = B(e, "Failed to inspect this table."),
|
|
125
|
+
g.value = B(e, "Failed to inspect this table."), O({ error: g.value });
|
|
126
126
|
} finally {
|
|
127
|
-
|
|
127
|
+
y.value = !1;
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
function
|
|
131
|
-
d.status === "completed" ||
|
|
130
|
+
function O(e) {
|
|
131
|
+
d.status === "completed" || T.value || (T.value = !0, Q("submit", e));
|
|
132
132
|
}
|
|
133
133
|
function ee(e) {
|
|
134
134
|
return Array.isArray(e) ? Object.fromEntries(
|
|
@@ -136,13 +136,7 @@ const ze = { class: "w-full min-w-0" }, De = {
|
|
|
136
136
|
) : e && typeof e == "object" ? e : {};
|
|
137
137
|
}
|
|
138
138
|
function te(e) {
|
|
139
|
-
return
|
|
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
|
-
})) : [];
|
|
139
|
+
return De(e).filter((t) => !t._remove);
|
|
146
140
|
}
|
|
147
141
|
function re(e) {
|
|
148
142
|
return Array.isArray(e) ? e.filter((t) => t && t.flow && (typeof t.id == "string" || typeof t.label == "string")).map((t, r) => ({
|
|
@@ -153,7 +147,7 @@ const ze = { class: "w-full min-w-0" }, De = {
|
|
|
153
147
|
function se(e) {
|
|
154
148
|
return Array.isArray(e) ? e.filter((t) => t && typeof t.property == "string").map((t, r) => ({
|
|
155
149
|
id: typeof t.id == "string" ? t.id : `filter-${r}`,
|
|
156
|
-
label: typeof t.label == "string" && t.label.trim() ? t.label :
|
|
150
|
+
label: typeof t.label == "string" && t.label.trim() ? t.label : C(t.property),
|
|
157
151
|
property: t.property
|
|
158
152
|
})) : [];
|
|
159
153
|
}
|
|
@@ -170,44 +164,33 @@ const ze = { class: "w-full min-w-0" }, De = {
|
|
|
170
164
|
return {
|
|
171
165
|
enabled: !!t,
|
|
172
166
|
defaultPreset: t,
|
|
173
|
-
label: t ?
|
|
167
|
+
label: t ? de(t) : "Not configured"
|
|
174
168
|
};
|
|
175
169
|
}
|
|
176
170
|
function ae(e, t) {
|
|
177
|
-
const r = Object.entries(t).map(([
|
|
178
|
-
name:
|
|
171
|
+
const r = Object.entries(t).map(([N, $]) => ({
|
|
172
|
+
name: N.replace(/-([a-z])/g, (S, b) => b.toUpperCase()),
|
|
179
173
|
type: "routeQueryParam",
|
|
180
|
-
value:
|
|
174
|
+
value: $ ?? null
|
|
181
175
|
}));
|
|
182
176
|
if (!e) return r;
|
|
183
|
-
const o =
|
|
177
|
+
const o = Re()[e];
|
|
184
178
|
if (!Array.isArray(o) || !o[0]) return r;
|
|
185
|
-
const a =
|
|
179
|
+
const a = M(o[0], !1), A = M(o[1] || o[0], !0);
|
|
186
180
|
return [...r, {
|
|
187
181
|
name: "dateRangeFilter",
|
|
188
182
|
type: "dateRangeFilter",
|
|
189
|
-
value: { from: a, to:
|
|
183
|
+
value: { from: a, to: A }
|
|
190
184
|
}];
|
|
191
185
|
}
|
|
192
|
-
function
|
|
186
|
+
function M(e, t) {
|
|
193
187
|
const [r, s, o] = e.split("-").map(Number), a = new Date(r, s - 1, o);
|
|
194
188
|
return t && a.setHours(23, 59, 59, 999), a;
|
|
195
189
|
}
|
|
196
|
-
function
|
|
190
|
+
function le(e) {
|
|
197
191
|
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
192
|
}
|
|
199
|
-
function
|
|
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) {
|
|
193
|
+
function ie(e) {
|
|
211
194
|
const t = [], r = /* @__PURE__ */ new Set();
|
|
212
195
|
for (const s of e.slice(0, 10))
|
|
213
196
|
for (const o of Object.keys(s))
|
|
@@ -215,12 +198,12 @@ const ze = { class: "w-full min-w-0" }, De = {
|
|
|
215
198
|
return t.slice(0, 40).map((s, o) => ({
|
|
216
199
|
id: `inferred-${o}`,
|
|
217
200
|
property: s,
|
|
218
|
-
label:
|
|
219
|
-
type:
|
|
201
|
+
label: C(s),
|
|
202
|
+
type: ue(s, e.map((a) => a[s])),
|
|
220
203
|
visible: !0
|
|
221
204
|
}));
|
|
222
205
|
}
|
|
223
|
-
function
|
|
206
|
+
function ue(e, t) {
|
|
224
207
|
const s = e.toLowerCase().replace(/[_.-]/g, "");
|
|
225
208
|
if (/email$/.test(s)) return "email";
|
|
226
209
|
if (/(phone|mobile|telephone|tel)$/.test(s)) return "phone";
|
|
@@ -231,15 +214,18 @@ const ze = { class: "w-full min-w-0" }, De = {
|
|
|
231
214
|
const o = t.filter((a) => a != null && a !== "");
|
|
232
215
|
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
216
|
}
|
|
234
|
-
function
|
|
235
|
-
const t =
|
|
217
|
+
function ce(e) {
|
|
218
|
+
const t = /* @__PURE__ */ new WeakSet(), r = Object.fromEntries(Object.entries(e).map(([s, o]) => [
|
|
219
|
+
s,
|
|
220
|
+
k(o, 1, t)
|
|
221
|
+
]));
|
|
236
222
|
try {
|
|
237
|
-
return q(
|
|
223
|
+
return q(r, 32 * 1024);
|
|
238
224
|
} catch {
|
|
239
225
|
return { _sampleOmitted: "This sample row was too large to include in chat." };
|
|
240
226
|
}
|
|
241
227
|
}
|
|
242
|
-
function
|
|
228
|
+
function k(e, t, r) {
|
|
243
229
|
if (e == null || typeof e == "number" || typeof e == "boolean") return e;
|
|
244
230
|
if (typeof e == "string") return e.length > 500 ? `${e.slice(0, 499)}…` : e;
|
|
245
231
|
if (typeof e == "bigint") return String(e);
|
|
@@ -248,18 +234,18 @@ const ze = { class: "w-full min-w-0" }, De = {
|
|
|
248
234
|
if (t >= 3) return Array.isArray(e) ? `[Array(${e.length})]` : "[Object]";
|
|
249
235
|
if (r.has(e)) return "[Circular]";
|
|
250
236
|
if (r.add(e), Array.isArray(e)) {
|
|
251
|
-
const o = e.slice(0, 10).map((a) =>
|
|
237
|
+
const o = e.slice(0, 10).map((a) => k(a, t + 1, r));
|
|
252
238
|
return e.length > 10 && o.push(`[${e.length - 10} more items]`), o;
|
|
253
239
|
}
|
|
254
240
|
const s = {};
|
|
255
241
|
for (const [o, a] of Object.entries(e).slice(0, 20))
|
|
256
|
-
o === "__proto__" || o === "constructor" || o === "prototype" || (s[o] =
|
|
242
|
+
o === "__proto__" || o === "constructor" || o === "prototype" || (s[o] = k(a, t + 1, r));
|
|
257
243
|
return s;
|
|
258
244
|
}
|
|
259
|
-
function
|
|
245
|
+
function C(e) {
|
|
260
246
|
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
247
|
}
|
|
262
|
-
function
|
|
248
|
+
function de(e) {
|
|
263
249
|
return {
|
|
264
250
|
today: "Today",
|
|
265
251
|
yesterday: "Yesterday",
|
|
@@ -272,13 +258,13 @@ const ze = { class: "w-full min-w-0" }, De = {
|
|
|
272
258
|
nextMonth: "Next 30 days",
|
|
273
259
|
next6months: "Next 6 months",
|
|
274
260
|
nextYear: "Next 12 months"
|
|
275
|
-
}[e] ||
|
|
261
|
+
}[e] || C(e);
|
|
276
262
|
}
|
|
277
263
|
function B(e, t) {
|
|
278
264
|
const r = e?.data?.statusMessage || e?.statusMessage || e?.message;
|
|
279
265
|
return typeof r == "string" && r.trim() ? r.slice(0, 500) : t;
|
|
280
266
|
}
|
|
281
|
-
function
|
|
267
|
+
function me(e) {
|
|
282
268
|
if (!e) return "";
|
|
283
269
|
const t = new Date(e);
|
|
284
270
|
return Number.isNaN(t.getTime()) ? "" : t.toLocaleString(void 0, {
|
|
@@ -288,87 +274,87 @@ const ze = { class: "w-full min-w-0" }, De = {
|
|
|
288
274
|
minute: "2-digit"
|
|
289
275
|
});
|
|
290
276
|
}
|
|
291
|
-
return
|
|
277
|
+
return be(() => {
|
|
292
278
|
d.status === "completed" && K() || X();
|
|
293
279
|
}), (e, t) => {
|
|
294
|
-
const r =
|
|
295
|
-
return
|
|
296
|
-
|
|
297
|
-
m(f(
|
|
298
|
-
|
|
299
|
-
])) : g.value ? (
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
m(f(
|
|
280
|
+
const r = ye("NuxtLink");
|
|
281
|
+
return i(), u("div", Fe, [
|
|
282
|
+
y.value ? (i(), u("div", Le, [
|
|
283
|
+
m(f(_e), { class: "size-4 animate-spin text-muted-foreground" }),
|
|
284
|
+
l("span", Te, "Inspecting " + c(w.instanceName) + "…", 1)
|
|
285
|
+
])) : g.value ? (i(), u("div", Ee, c(g.value), 1)) : n.value ? (i(), u("div", Ie, [
|
|
286
|
+
l("div", Oe, [
|
|
287
|
+
l("div", Me, [
|
|
288
|
+
m(f(we), { class: "size-4 text-primary" })
|
|
303
289
|
]),
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
I.value.length ? (
|
|
308
|
-
(
|
|
290
|
+
l("div", Be, [
|
|
291
|
+
l("p", Pe, c(n.value.module.name), 1),
|
|
292
|
+
l("p", Ve, c(n.value.totalRows) + " " + c(n.value.totalRows === 1 ? "row" : "rows") + " · " + c(n.value.columnCount) + " " + c(n.value.columnCount === 1 ? "column" : "columns"), 1),
|
|
293
|
+
I.value.length ? (i(), u("div", Ue, [
|
|
294
|
+
(i(!0), u(D, null, F(I.value, (s) => (i(), u("span", {
|
|
309
295
|
key: s,
|
|
310
296
|
class: "inline-flex items-center gap-1 rounded-full border bg-background px-1.5 py-0.5 text-[10px] text-muted-foreground"
|
|
311
297
|
}, [
|
|
312
|
-
m(f(
|
|
298
|
+
m(f(ve), { class: "size-2.5 text-emerald-500" }),
|
|
313
299
|
h(" " + c(s), 1)
|
|
314
300
|
]))), 128))
|
|
315
301
|
])) : _("", !0)
|
|
316
302
|
]),
|
|
317
303
|
m(r, {
|
|
318
|
-
to: `/projects/${
|
|
304
|
+
to: `/projects/${w.projectSlug}/modules/${w.instanceId}`,
|
|
319
305
|
class: "inline-flex shrink-0 items-center gap-1 text-[11px] text-primary hover:underline"
|
|
320
306
|
}, {
|
|
321
|
-
default:
|
|
307
|
+
default: xe(() => [
|
|
322
308
|
t[0] || (t[0] = h(" Open ", -1)),
|
|
323
|
-
m(f(
|
|
309
|
+
m(f(Ae), { class: "size-3" })
|
|
324
310
|
]),
|
|
325
311
|
_: 1
|
|
326
312
|
}, 8, ["to"])
|
|
327
313
|
]),
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
m(f(
|
|
314
|
+
l("div", Ye, [
|
|
315
|
+
l("div", qe, [
|
|
316
|
+
l("div", He, [
|
|
317
|
+
m(f(ke), { class: "size-3.5 text-primary" }),
|
|
332
318
|
t[1] || (t[1] = h(" Date range filter ", -1))
|
|
333
319
|
]),
|
|
334
|
-
|
|
320
|
+
l("p", {
|
|
335
321
|
class: Y(["mt-1 text-xs", n.value.dateRangeFilter.enabled ? "text-foreground" : "text-muted-foreground"])
|
|
336
322
|
}, c(n.value.dateRangeFilter.label), 3)
|
|
337
323
|
]),
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
m(f(
|
|
324
|
+
l("div", Qe, [
|
|
325
|
+
l("div", We, [
|
|
326
|
+
m(f(Ce), { class: "size-3.5 text-primary" }),
|
|
341
327
|
t[2] || (t[2] = h(" Row actions ", -1))
|
|
342
328
|
]),
|
|
343
|
-
n.value.actions.length ? (
|
|
344
|
-
(
|
|
329
|
+
n.value.actions.length ? (i(), u("div", Ze, [
|
|
330
|
+
(i(!0), u(D, null, F(n.value.actions, (s) => (i(), u("span", {
|
|
345
331
|
key: s.id,
|
|
346
332
|
class: "rounded-full bg-primary/10 px-1.5 py-0.5 text-[10px] font-medium text-primary"
|
|
347
333
|
}, c(s.label), 1))), 128))
|
|
348
|
-
])) : (
|
|
334
|
+
])) : (i(), u("p", Ge, "No row actions configured"))
|
|
349
335
|
])
|
|
350
336
|
]),
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
m(f(
|
|
337
|
+
l("div", Je, [
|
|
338
|
+
l("div", Ke, [
|
|
339
|
+
l("div", Xe, [
|
|
340
|
+
m(f(Ne), { class: "size-3.5 text-primary" }),
|
|
355
341
|
t[3] || (t[3] = h(" Columns ", -1))
|
|
356
342
|
]),
|
|
357
|
-
|
|
343
|
+
l("span", et, c(J.value.length) + " visible ", 1)
|
|
358
344
|
]),
|
|
359
|
-
n.value.columns.length ? (
|
|
360
|
-
(
|
|
361
|
-
key: s
|
|
345
|
+
n.value.columns.length ? (i(), u("div", tt, [
|
|
346
|
+
(i(!0), u(D, null, F(n.value.columns, (s) => (i(), u("span", {
|
|
347
|
+
key: f($e)(s),
|
|
362
348
|
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
349
|
}, [
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
s.visible ? _("", !0) : (
|
|
350
|
+
l("span", rt, c(s.label), 1),
|
|
351
|
+
l("span", st, c(s.type), 1),
|
|
352
|
+
s.visible ? _("", !0) : (i(), u("span", ot, "hidden"))
|
|
367
353
|
], 2))), 128))
|
|
368
|
-
])) : (
|
|
354
|
+
])) : (i(), u("p", nt, "No columns could be inferred."))
|
|
369
355
|
]),
|
|
370
|
-
|
|
371
|
-
m(
|
|
356
|
+
l("div", at, [
|
|
357
|
+
m(ze, {
|
|
372
358
|
rows: n.value.sampleRows,
|
|
373
359
|
columns: n.value.columns,
|
|
374
360
|
title: "Sample data",
|
|
@@ -378,14 +364,14 @@ const ze = { class: "w-full min-w-0" }, De = {
|
|
|
378
364
|
"max-columns": 6,
|
|
379
365
|
"empty-text": "No sample rows were returned."
|
|
380
366
|
}, null, 8, ["rows", "columns", "description", "total-count", "max-rows"]),
|
|
381
|
-
n.value.sampleError ? (
|
|
367
|
+
n.value.sampleError ? (i(), u("p", lt, c(n.value.sampleError), 1)) : _("", !0)
|
|
382
368
|
]),
|
|
383
|
-
|
|
369
|
+
v.value ? (i(), u("div", it, " Snapshot from " + c(me(v.value)), 1)) : _("", !0)
|
|
384
370
|
])) : _("", !0)
|
|
385
371
|
]);
|
|
386
372
|
};
|
|
387
373
|
}
|
|
388
374
|
});
|
|
389
375
|
export {
|
|
390
|
-
|
|
376
|
+
pt as default
|
|
391
377
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const i=require("./dateRangePresets-gxQCiZ6c.js"),e=require("vue"),h=require("lucide-vue-next"),P=new Set(["__proto__","constructor","prototype"]);function j(r){return r.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_.-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase())}function M(r,t){const s=r.toLowerCase().replace(/[_.-]/g,"");if(/email$/.test(s))return"email";if(/(phone|mobile|telephone|tel)$/.test(s))return"phone";if(/(image|photo|avatar|thumbnail|logo|picture)$/.test(s))return"image";if(/(url|link|website|href)$/.test(s))return"URL";if(/(price|amount|cost|total|revenue|salary|fee)$/.test(s))return"currency";if(/(createdat|updatedat|timestamp)$/.test(s))return"datetime";if(/date$/.test(s))return"date";const p=t.filter(l=>l!=null&&l!=="");return p.length?p.every(l=>typeof l=="boolean")?"boolean":p.every(l=>typeof l=="number")?"number":p.every(l=>Array.isArray(l))?"array":p.every(l=>typeof l=="string"&&/^\d{4}-\d{2}-\d{2}(?:T|$)/.test(l))?p.some(l=>String(l).includes("T"))?"datetime":"date":"text":"text"}function q(r){if(r==null)return[];const t=Array.isArray(r)?r:Array.isArray(r?.data)?r.data:Array.isArray(r?.items)?r.items:Array.isArray(r?.rows)?r.rows:null;if(!t)throw new Error("The Fetch items flow must return an array of rows.");return t.map(s=>s&&typeof s=="object"&&!Array.isArray(s)?s:{value:s})}function W(r){return Array.isArray(r)?r.filter(t=>t&&typeof t.property=="string"&&t.property.trim()).map((t,s)=>({...t,id:typeof t.id=="string"?t.id:`column-${s}`,property:t.property.trim(),label:typeof t.label=="string"&&t.label.trim()?t.label.trim():j(t.property),type:typeof t.type=="string"&&t.type?t.type:"text",visible:t.visible!==!1})):[]}function F(r,t,s,p){if(!(!r||typeof r!="object"||Array.isArray(r)||p>=2))for(const[l,c]of Object.entries(r)){if(P.has(l))continue;const d=t?`${t}.${l}`:l;c&&typeof c=="object"&&!Array.isArray(c)&&!(c instanceof Date)?F(c,d,s,p+1):s.add(d)}}function U(r){const t=new Set;for(const s of r.slice(0,10))F(s,"",t,0);return Array.from(t).slice(0,40).map((s,p)=>({id:`inferred-${p}`,property:s,label:j(s),type:M(s,r.map(l=>i.resolveProperty(l,s))),visible:!0}))}function D(r,t){const s=String(r||"").trim().toLocaleLowerCase();return s&&(t.find(p=>i.getTableColumnId(p).toLocaleLowerCase()===s)||t.find(p=>p.property.toLocaleLowerCase()===s)||t.find(p=>String(p.label||"").trim().toLocaleLowerCase()===s)||t.find(p=>String(p.id||"").trim().toLocaleLowerCase()===s))||null}function w(r){return r==null||r===""||Array.isArray(r)&&r.length===0}function J(r){return typeof r=="boolean"?r:typeof r!="string"?null:r.toLowerCase()==="true"?!0:r.toLowerCase()==="false"?!1:null}function H(r,t){if(typeof t=="number"){const s=Number(r);return Number.isFinite(s)?s:r}return typeof t=="boolean"?J(r)??r:r}function _(r,t){const s=H(t,r);if(typeof r=="string"&&typeof s=="string")return r.toLocaleLowerCase()===s.toLocaleLowerCase();if(r instanceof Date){const p=new Date(s);return!Number.isNaN(p.getTime())&&r.getTime()===p.getTime()}return Object.is(r,s)}function v(r){if(r instanceof Date)return r.getTime();if(typeof r=="number")return r;if(typeof r=="boolean")return r?1:0;if(typeof r=="string"){const t=r.trim(),s=Number(t);if(t&&Number.isFinite(s))return s;if(/^\d{4}-\d{2}-\d{2}(?:T|$)/.test(t)){const p=new Date(t).getTime();if(!Number.isNaN(p))return p}return t.toLocaleLowerCase()}return String(r??"").toLocaleLowerCase()}function K(r,t,s,p){const l=D(t.property,s),c=l?.type==="progress"?i.getColumnCellValue(r,l,p):i.resolveProperty(r,l?.property||t.property),d=t.operator||"==",u=Array.isArray(t.values)?t.values:(d==="in"||d==="notIn")&&typeof t.value=="string"?t.value.split(",").map(f=>f.trim()):[];if([">",">=","<","<="].includes(d)&&(w(c)||w(t.value)))return!1;switch(d){case"==":case"equals":return _(c,t.value);case"!=":case"not_equals":return!_(c,t.value);case">":return v(c)>v(t.value);case">=":return v(c)>=v(t.value);case"<":return v(c)<v(t.value);case"<=":return v(c)<=v(t.value);case"contains":return Array.isArray(c)?c.some(f=>_(f,t.value)):String(c??"").toLocaleLowerCase().includes(String(t.value??"").toLocaleLowerCase());case"startsWith":return String(c??"").toLocaleLowerCase().startsWith(String(t.value??"").toLocaleLowerCase());case"endsWith":return String(c??"").toLocaleLowerCase().endsWith(String(t.value??"").toLocaleLowerCase());case"in":return u.some(f=>_(c,f));case"notIn":return!u.some(f=>_(c,f));case"isEmpty":return w(c);case"isNotEmpty":return!w(c);default:throw new Error(`Unsupported table filter operator "${d}".`)}}function X(r,t,s=[]){if(!Array.isArray(t)||!t.length)return[...r];for(const l of t){if(!l||typeof l.property!="string"||!l.property.trim())throw new Error("Every table filter needs a property.");if(s.length&&!D(l.property,s))throw new Error(`Unknown table filter property "${l.property}". Use a property or label reported by inspectTable.`)}const p=Date.now();return r.filter(l=>t.every(c=>K(l,c,s,p)))}function Y(r,t,s="asc",p=[]){if(!t)return[...r];const l=D(t,p);if(p.length&&!l)throw new Error(`Unknown table sort property "${t}". Use a property or label reported by inspectTable.`);const c=s==="desc"?-1:1,d=Date.now(),u=f=>l?.type==="progress"?i.getColumnCellValue(f,l,d):i.resolveProperty(f,l?.property||t);return r.map((f,g)=>({row:f,index:g})).sort((f,g)=>{const k=u(f.row),B=u(g.row);if(w(k)&&w(B))return f.index-g.index;if(w(k))return 1;if(w(B))return-1;const S=v(k),L=v(B);return S<L?-1*c:S>L?1*c:f.index-g.index}).map(f=>f.row)}function Z(r,t,s,p){return r.filter(l=>{const c=i.resolveProperty(l,t);if(c==null||c==="")return!1;const u=(c instanceof Date?c:typeof c=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(c)?new Date(`${c}T00:00:00.000`):new Date(c)).getTime();return!Number.isNaN(u)&&u>=s.getTime()&&u<=p.getTime()})}function G(r){return r===null||["string","number","boolean"].includes(typeof r)}function Q(r,t,s=[]){const p=["id","_id","uuid","key","email","slug"],l=s.length?s:U(t),c=Array.from(new Set([...p,...l.map(f=>f.property),...Object.keys(r||{})])).filter(f=>!P.has(f)),d=[];let u=[...t];for(const f of c){const g=i.resolveProperty(r,f);if(!G(g)||g==="")continue;const k=u.filter(B=>_(i.resolveProperty(B,f),g));if(k.length){if(u.length===1)return[{property:f,value:g}];if(k.length!==u.length){if(d.push({property:f,value:g}),u=k,u.length===1)return d;if(d.length>=3)break}}}return u.length===1&&d.length?d:null}function ee(r,t=512*1024){const s=new WeakSet,p=JSON.stringify(r,(c,d)=>{if(!P.has(c)){if(typeof d=="bigint")return String(d);if(d instanceof Date)return d.toISOString();if(d&&typeof d=="object"){if(s.has(d))return"[Circular]";s.add(d)}return d}});if(p===void 0)throw new Error("The table result is not JSON serializable.");const l=new TextEncoder().encode(p).byteLength;if(l>t)throw new Error(`The table result is too large to store (${Math.ceil(l/1024)} KB). Narrow the query or lower the row limit.`);return JSON.parse(p)}const te={class:"w-full min-w-0 overflow-hidden rounded-xl border bg-background"},re={key:0,class:"flex items-start gap-2.5 border-b bg-muted/30 px-3 py-2.5"},oe={class:"mt-0.5 flex size-7 shrink-0 items-center justify-center rounded-lg bg-primary/10"},ne={class:"min-w-0 flex-1"},ae={key:0,class:"truncate text-xs font-semibold"},se={key:1,class:"mt-0.5 text-[11px] leading-relaxed text-muted-foreground"},ie={key:0,class:"shrink-0 rounded-full bg-muted px-2 py-0.5 text-[10px] tabular-nums text-muted-foreground"},le={key:1,class:"flex flex-col items-center px-4 py-8 text-center"},ce={class:"text-xs text-muted-foreground"},pe={key:2,class:"flex flex-col items-center px-4 py-8 text-center"},ue={key:3,class:"grid gap-x-5 gap-y-3 p-3 sm:grid-cols-2"},de={class:"mb-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground"},fe=["src","alt"],ye={key:2,class:"flex size-16 items-center justify-center rounded-lg border bg-muted/30"},me=["href"],ge=["href"],be=["href"],he=["title"],ke={key:4,class:"overflow-x-auto"},xe={class:"w-full min-w-max text-left text-xs"},ve={class:"border-b bg-muted/30"},we=["src","alt"],Be={key:2,class:"flex size-8 items-center justify-center rounded-md border bg-muted/30"},Ce=["href"],_e={class:"truncate"},Se=["href"],Ee=["href"],Ne=["title"],Le={key:5,class:"flex flex-wrap items-center gap-x-3 gap-y-1 border-t bg-muted/20 px-3 py-2 text-[10px] text-muted-foreground"},Te={key:0},De={key:1},Ae=e.defineComponent({__name:"TableResultView",props:{rows:{default:()=>[]},columns:{default:()=>[]},title:{default:""},description:{default:""},totalCount:{default:void 0},emptyText:{default:"No matching rows found."},maxRows:{default:20},maxColumns:{default:12},currency:{default:"EUR"},view:{default:"auto"}},setup(r){const t=r;i.provideTableClock();const s=e.computed(()=>S(t.maxRows,1,100,20)),p=e.computed(()=>S(t.maxColumns,1,20,12)),l=e.computed(()=>(Array.isArray(t.rows)?t.rows:[]).filter(o=>o!=null).map(o=>typeof o=="object"&&!Array.isArray(o)?o:{value:o})),c=e.computed(()=>{const o=Array.isArray(t.columns)?t.columns:[],y=o.filter(a=>a&&a.visible!==!1&&!a._remove&&(a.property||a.key)).map((a,m)=>{const N=String(a.property||a.key);return{id:String(a.id||N||m),property:N,label:a.label||$(N),type:a.type||z(N,l.value.map(O=>i.resolveProperty(O,N))),visible:!0,numberDisplay:a.numberDisplay,textDisplay:a.textDisplay,dateDisplay:a.dateDisplay,progress:a.progress,badge:a.badge}});if(o.length>0)return L(y);const n=[],b=new Set;for(const a of l.value.slice(0,10))for(const m of Object.keys(a))b.has(m)||(b.add(m),n.push(m));return n.map(a=>({id:a,property:a,label:$(a),type:z(a,l.value.map(m=>i.resolveProperty(m,a))),visible:!0}))}),d=e.computed(()=>c.value.slice(0,p.value)),u=e.computed(()=>l.value.slice(0,s.value)),f=e.computed(()=>Math.max(c.value.length-d.value.length,0)),g=e.computed(()=>{const o=Number(t.totalCount);return Number.isFinite(o)&&o>=l.value.length?o:l.value.length}),k=e.computed(()=>Math.max(g.value-u.value.length,0)),B=e.computed(()=>u.value.length===1&&(t.view==="card"||t.view==="metric"||t.view==="auto"&&g.value===1));function S(o,y,n,b){const a=Number(o);return Number.isFinite(a)?Math.min(Math.max(Math.floor(a),y),n):b}function L(o){const y=new Set;return o.filter(n=>{const b=i.getTableColumnId(n);return y.has(b)?!1:(y.add(b),!0)})}function V(o){return["date","datetime","progress","badge"].includes(o.type)}function $(o){return o.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_.-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,y=>y.toUpperCase())}function z(o,y){const b=o.toLowerCase().replace(/[_.-]/g,"");if(/(image|photo|avatar|thumbnail|logo|picture)$/.test(b))return"image";if(/(email)$/.test(b))return"email";if(/(phone|mobile|telephone|tel)$/.test(b))return"phone";if(/(url|link|website|href)$/.test(b))return"URL";if(/(price|amount|cost|total|revenue|salary|fee)$/.test(b))return"currency";if(/(date|createdat|updatedat|timestamp)$/.test(b))return"datetime";const a=y.filter(m=>m!=null&&m!=="");return a.length===0?"text":a.every(m=>typeof m=="boolean")?"boolean":a.every(m=>Array.isArray(m))?"array":a.every(m=>typeof m=="number")?"number":a.every(m=>typeof m=="string"&&/^https?:\/\//i.test(m))?"URL":a.every(m=>typeof m=="string"&&/^\d{4}-\d{2}-\d{2}(?:T|$)/.test(m))?a.some(m=>String(m).includes("T"))?"datetime":"date":"text"}function C(o){return o==null||o===""}function A(o){if(typeof o!="string")return!1;try{const y=new URL(o,typeof window>"u"?"https://localhost":window.location.origin);return y.protocol==="http:"||y.protocol==="https:"}catch{return!1}}function R(o){return A(o)||typeof o=="string"&&/^data:image\/(?:png|jpe?g|gif|webp|avif);base64,/i.test(o)}function x(o,y){if(C(o))return"—";switch(y.type){case"text":return T(i.formatTableText(o,y,E),180);case"boolean":return o?"Yes":"No";case"number":return i.formatTableNumber(o,y,n=>n.toLocaleString(void 0,{maximumFractionDigits:2}));case"currency":{const n=typeof o=="number"?o:Number(String(o).replace(",","."));if(!Number.isFinite(n))return String(o);try{return new Intl.NumberFormat(void 0,{style:"currency",currency:t.currency}).format(n)}catch{return`${n.toLocaleString(void 0,{maximumFractionDigits:2})} ${t.currency}`}}case"date":case"datetime":{const n=new Date(o);return Number.isNaN(n.getTime())?String(o):y.type==="date"?n.toLocaleDateString():n.toLocaleString()}case"array-counter":return Array.isArray(o)?String(o.length):"0";case"array":return Array.isArray(o)?T(o.map(E).join(", "),160):String(o);case"html":return T(I(String(o)),160);default:return T(E(o),180)}}function E(o){if(C(o))return"—";if(o instanceof Date)return o.toLocaleString();if(typeof o=="string")return o;if(typeof o=="number"||typeof o=="boolean"||typeof o=="bigint")return String(o);try{return JSON.stringify(o)}catch{return String(o)}}function I(o){if(typeof document>"u")return o.replace(/<[^>]*>/g," ");const y=document.createElement("div");return y.innerHTML=o,y.textContent||""}function T(o,y){return o.length>y?`${o.slice(0,y-1)}…`:o}return(o,y)=>(e.openBlock(),e.createElementBlock("div",te,[r.title||r.description?(e.openBlock(),e.createElementBlock("div",re,[e.createElementVNode("div",oe,[e.createVNode(e.unref(h.Table2),{class:"size-3.5 text-primary"})]),e.createElementVNode("div",ne,[r.title?(e.openBlock(),e.createElementBlock("p",ae,e.toDisplayString(r.title),1)):e.createCommentVNode("",!0),r.description?(e.openBlock(),e.createElementBlock("p",se,e.toDisplayString(r.description),1)):e.createCommentVNode("",!0)]),g.value>0?(e.openBlock(),e.createElementBlock("span",ie,e.toDisplayString(g.value)+" "+e.toDisplayString(g.value===1?"row":"rows"),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),u.value.length===0?(e.openBlock(),e.createElementBlock("div",le,[e.createVNode(e.unref(h.Table2),{class:"mb-2 size-7 text-muted-foreground/50"}),e.createElementVNode("p",ce,e.toDisplayString(r.emptyText),1)])):d.value.length===0?(e.openBlock(),e.createElementBlock("div",pe,[e.createVNode(e.unref(h.Columns3),{class:"mb-2 size-7 text-muted-foreground/50"}),y[0]||(y[0]=e.createElementVNode("p",{class:"text-xs text-muted-foreground"},"No visible columns are configured.",-1))])):B.value?(e.openBlock(),e.createElementBlock("div",ue,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,n=>(e.openBlock(),e.createElementBlock("div",{key:e.unref(i.getTableColumnId)(n),class:"min-w-0"},[e.createElementVNode("p",de,e.toDisplayString(n.label),1),V(n)?(e.openBlock(),e.createBlock(i._sfc_main,{key:0,row:u.value[0],column:n},null,8,["row","column"])):n.type==="image"&&R(e.unref(i.resolveProperty)(u.value[0],n.property))?(e.openBlock(),e.createElementBlock("img",{key:1,src:e.unref(i.resolveProperty)(u.value[0],n.property),alt:n.label,class:"size-16 rounded-lg border object-cover"},null,8,fe)):n.type==="image"?(e.openBlock(),e.createElementBlock("div",ye,[e.createVNode(e.unref(h.Image),{class:"size-5 text-muted-foreground/50"})])):n.type==="URL"&&A(e.unref(i.resolveProperty)(u.value[0],n.property))?(e.openBlock(),e.createElementBlock("a",{key:3,href:e.unref(i.resolveProperty)(u.value[0],n.property),target:"_blank",rel:"noopener noreferrer",class:"inline-flex max-w-full items-center gap-1 break-all text-xs text-primary hover:underline"},[e.createTextVNode(e.toDisplayString(x(e.unref(i.resolveProperty)(u.value[0],n.property),n))+" ",1),e.createVNode(e.unref(h.ExternalLink),{class:"size-3 shrink-0"})],8,me)):n.type==="email"&&!C(e.unref(i.resolveProperty)(u.value[0],n.property))?(e.openBlock(),e.createElementBlock("a",{key:4,href:`mailto:${e.unref(i.resolveProperty)(u.value[0],n.property)}`,class:"break-all text-xs text-primary hover:underline"},e.toDisplayString(x(e.unref(i.resolveProperty)(u.value[0],n.property),n)),9,ge)):n.type==="phone"&&!C(e.unref(i.resolveProperty)(u.value[0],n.property))?(e.openBlock(),e.createElementBlock("a",{key:5,href:`tel:${e.unref(i.resolveProperty)(u.value[0],n.property)}`,class:"text-xs text-primary hover:underline"},e.toDisplayString(x(e.unref(i.resolveProperty)(u.value[0],n.property),n)),9,be)):n.type==="boolean"?(e.openBlock(),e.createElementBlock("span",{key:6,class:e.normalizeClass(["inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-medium",e.unref(i.resolveProperty)(u.value[0],n.property)?"bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":"bg-muted text-muted-foreground"])},[e.unref(i.resolveProperty)(u.value[0],n.property)?(e.openBlock(),e.createBlock(e.unref(h.Check),{key:0,class:"size-3"})):(e.openBlock(),e.createBlock(e.unref(h.X),{key:1,class:"size-3"})),e.createTextVNode(" "+e.toDisplayString(x(e.unref(i.resolveProperty)(u.value[0],n.property),n)),1)],2)):(e.openBlock(),e.createElementBlock("p",{key:7,class:"break-words text-xs font-medium",title:E(e.unref(i.resolveProperty)(u.value[0],n.property))},e.toDisplayString(x(e.unref(i.resolveProperty)(u.value[0],n.property),n)),9,he))]))),128))])):(e.openBlock(),e.createElementBlock("div",ke,[e.createElementVNode("table",xe,[e.createElementVNode("thead",null,[e.createElementVNode("tr",ve,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,n=>(e.openBlock(),e.createElementBlock("th",{key:e.unref(i.getTableColumnId)(n),class:"whitespace-nowrap px-3 py-2 text-[10px] font-medium uppercase tracking-wide text-muted-foreground"},e.toDisplayString(n.label),1))),128))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(n,b)=>(e.openBlock(),e.createElementBlock("tr",{key:b,class:"border-b last:border-b-0 hover:bg-muted/20"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,a=>(e.openBlock(),e.createElementBlock("td",{key:e.unref(i.getTableColumnId)(a),class:"max-w-56 px-3 py-2 align-middle"},[V(a)?(e.openBlock(),e.createBlock(i._sfc_main,{key:0,row:n,column:a},null,8,["row","column"])):a.type==="image"&&R(e.unref(i.resolveProperty)(n,a.property))?(e.openBlock(),e.createElementBlock("img",{key:1,src:e.unref(i.resolveProperty)(n,a.property),alt:a.label,class:"size-8 rounded-md border object-cover"},null,8,we)):a.type==="image"?(e.openBlock(),e.createElementBlock("div",Be,[e.createVNode(e.unref(h.Image),{class:"size-3.5 text-muted-foreground/50"})])):a.type==="URL"&&A(e.unref(i.resolveProperty)(n,a.property))?(e.openBlock(),e.createElementBlock("a",{key:3,href:e.unref(i.resolveProperty)(n,a.property),target:"_blank",rel:"noopener noreferrer",class:"inline-flex max-w-48 items-center gap-1 truncate text-primary hover:underline"},[e.createElementVNode("span",_e,e.toDisplayString(x(e.unref(i.resolveProperty)(n,a.property),a)),1),e.createVNode(e.unref(h.ExternalLink),{class:"size-3 shrink-0"})],8,Ce)):a.type==="email"&&!C(e.unref(i.resolveProperty)(n,a.property))?(e.openBlock(),e.createElementBlock("a",{key:4,href:`mailto:${e.unref(i.resolveProperty)(n,a.property)}`,class:"block max-w-48 truncate text-primary hover:underline"},e.toDisplayString(x(e.unref(i.resolveProperty)(n,a.property),a)),9,Se)):a.type==="phone"&&!C(e.unref(i.resolveProperty)(n,a.property))?(e.openBlock(),e.createElementBlock("a",{key:5,href:`tel:${e.unref(i.resolveProperty)(n,a.property)}`,class:"whitespace-nowrap text-primary hover:underline"},e.toDisplayString(x(e.unref(i.resolveProperty)(n,a.property),a)),9,Ee)):a.type==="boolean"?(e.openBlock(),e.createElementBlock("span",{key:6,class:e.normalizeClass(["inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-[10px] font-medium",e.unref(i.resolveProperty)(n,a.property)?"bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":"bg-muted text-muted-foreground"])},[e.unref(i.resolveProperty)(n,a.property)?(e.openBlock(),e.createBlock(e.unref(h.Check),{key:0,class:"size-2.5"})):(e.openBlock(),e.createBlock(e.unref(h.X),{key:1,class:"size-2.5"})),e.createTextVNode(" "+e.toDisplayString(x(e.unref(i.resolveProperty)(n,a.property),a)),1)],2)):(e.openBlock(),e.createElementBlock("span",{key:7,class:"block max-w-56 truncate",title:E(e.unref(i.resolveProperty)(n,a.property))},e.toDisplayString(x(e.unref(i.resolveProperty)(n,a.property),a)),9,Ne))]))),128))]))),128))])])])),u.value.length>0&&(o.$slots.footer||k.value>0||f.value>0)?(e.openBlock(),e.createElementBlock("div",Le,[e.renderSlot(o.$slots,"footer"),!o.$slots.footer&&k.value>0?(e.openBlock(),e.createElementBlock("span",Te,"Showing "+e.toDisplayString(u.value.length)+" of "+e.toDisplayString(g.value)+" rows",1)):e.createCommentVNode("",!0),f.value>0?(e.openBlock(),e.createElementBlock("span",De,e.toDisplayString(f.value)+" more "+e.toDisplayString(f.value===1?"column":"columns")+" hidden",1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]))}});exports._sfc_main=Ae;exports.applyLocalDateRange=Z;exports.applyTableFilters=X;exports.applyTableSort=Y;exports.buildRowReference=Q;exports.inferTableColumns=U;exports.normalizeTableColumns=W;exports.normalizeTableRows=q;exports.resolveColumn=D;exports.serializeBounded=ee;
|