@oneclick.dev/cms-core-modules 0.0.124 → 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-DX1bTQKs.mjs → ContentEditor-D754iLJS.mjs} +8074 -27026
- package/dist/{Detail-B7pe808q.mjs → Detail-BOxWQ1QQ.mjs} +2 -2
- package/dist/{Detail-B_Q7Qkuz.mjs → Detail-BfKW0uZE.mjs} +2 -2
- package/dist/Detail-DFVu2F38.mjs +11 -0
- package/dist/{Detail-t3tOcy3X.js → Detail-DJea_fCd.js} +1 -1
- package/dist/{Detail-CNiLIEh9.js → Detail-DPJacXfm.js} +1 -1
- package/dist/Detail-DSLZ7_bM.js +1 -0
- package/dist/{Detail-BESGmY7z.js → Detail-DUGThL9Y.js} +1 -1
- package/dist/{Detail-DNxAzeCs.mjs → Detail-D_LlEeHu.mjs} +2 -2
- package/dist/Overview-0hFXiuYo.js +1 -0
- package/dist/Overview-BTx5LF4J.js +1 -0
- package/dist/Overview-CCu2PHai.mjs +289 -0
- package/dist/Overview-D2u-leeO.js +1 -0
- package/dist/Overview-D_2wozCG.mjs +1733 -0
- package/dist/Overview-Dffo-zH4.mjs +11 -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/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-ChHD_1Cf.js +144 -0
- package/dist/index-CvV4nVWI.js +1 -0
- package/dist/index-DH2z0W_w.mjs +19012 -0
- package/dist/index-DZKzj48V.mjs +17 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.mjs +237 -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 +2055 -1123
- 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/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/index.d.ts +2 -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 +4 -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-ibC3-e1N.mjs → types-B5MifmeF.mjs} +339 -273
- package/dist/types-D5dgTskW.js +1 -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-BQElPD0m.js → vee-validate-zod-CWZwNTWE.js} +1 -1
- package/dist/{vee-validate-zod-CN16K2x9.mjs → vee-validate-zod-D0WaDgDZ.mjs} +1 -1
- package/package.json +2 -2
- package/src/appointments/tools.ts +52 -2
- package/dist/AppointmentListTable-DZJNmTMb.mjs +0 -177
- package/dist/AppointmentListTable-Dieu9US_.js +0 -1
- package/dist/ContentEditor-BcIUumah.js +0 -467
- package/dist/Detail-Byk781b4.mjs +0 -26
- 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-6mdrL3zx.js +0 -4
- package/dist/TableView-Du5nOE6R.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/types-BMraG1kN.js +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { defineComponent as e, openBlock as o, createBlock as r } from "vue";
|
|
2
|
+
import { _ as t } from "./TemplateBuilder.vue_vue_type_script_setup_true_lang-D85V4nrQ.mjs";
|
|
3
|
+
const p = /* @__PURE__ */ e({
|
|
4
|
+
__name: "Overview",
|
|
5
|
+
setup(_) {
|
|
6
|
+
return (n, c) => (o(), r(t));
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
export {
|
|
10
|
+
p as default
|
|
11
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as q, ref as b, computed as z, onMounted as F, openBlock as i, createElementBlock as d, createVNode as x, unref as C, createElementVNode as f, toDisplayString as c, createCommentVNode as $, createBlock as P, withCtx as G } from "vue";
|
|
2
2
|
import { Loader2 as L, AlertCircle as V, Calculator as J } from "lucide-vue-next";
|
|
3
|
-
import { u as W } from "./useTableAgentTools-
|
|
4
|
-
import { _ as H, i as w, r as B, s as K } from "./TableResultView.vue_vue_type_script_setup_true_lang-
|
|
5
|
-
import { r as Q } from "./tool-sandbox-
|
|
3
|
+
import { u as W } from "./useTableAgentTools-r5InEI4p.mjs";
|
|
4
|
+
import { _ as H, i as w, r as B, s as K } from "./TableResultView.vue_vue_type_script_setup_true_lang-sp0TLio0.mjs";
|
|
5
|
+
import { r as Q } from "./tool-sandbox-DU9b1B7v.mjs";
|
|
6
6
|
const X = { class: "w-full" }, Y = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "flex items-center gap-2 py-3 text-xs text-muted-foreground"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),f=require("lucide-vue-next"),D=require("./useTableAgentTools-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),f=require("lucide-vue-next"),D=require("./useTableAgentTools-BrUot49I.js"),c=require("./TableResultView.vue_vue_type_script_setup_true_lang-C3XiOXgb.js"),O=require("./tool-sandbox-BSkKdH7V.js"),V={class:"w-full"},q={key:0,class:"flex items-center gap-2 py-3 text-xs text-muted-foreground"},$={key:1,class:"flex items-start gap-2 rounded-xl border border-destructive/30 bg-destructive/5 p-3 text-xs text-destructive"},M={key:2,class:"rounded-xl border bg-background p-4"},R={class:"flex items-center gap-2 text-xs font-medium text-muted-foreground"},I={class:"mt-3 break-words text-3xl font-semibold tracking-tight"},U={key:0,class:"mt-1 text-xs text-muted-foreground"},P={key:0},z={key:1},F=`
|
|
2
2
|
const get = (object, path) => {
|
|
3
3
|
if (!path) return object;
|
|
4
4
|
if (Object.prototype.hasOwnProperty.call(object, path)) return object[path];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),h=require("lucide-vue-next"),S=require("./useTableAgentTools-BrUot49I.js"),g=require("./dateRangePresets-gxQCiZ6c.js"),i=require("./TableResultView.vue_vue_type_script_setup_true_lang-C3XiOXgb.js"),T={class:"w-full"},B={key:0,class:"flex items-center gap-2 py-3 text-xs text-muted-foreground"},D={key:1,class:"flex items-start gap-2 rounded-xl border border-destructive/30 bg-destructive/5 p-3 text-xs text-destructive"},R={key:0},q={key:1},M=t.defineComponent({__name:"TableDataWidget",props:{projectSlug:{},toolName:{},instanceId:{},instanceName:{},moduleType:{},resolvedArgs:{},status:{}},emits:["submit"],setup(w,{emit:y}){const r=w,f=y,d=t.ref(!0),n=t.ref(null),o=t.ref(null),{loadRows:b}=S.useTableAgentTools(r);function _(e){const l=Number(e);return Number.isFinite(l)?Math.min(Math.max(Math.trunc(l),1),100):20}function A(e,l){const u=l.length?l:i.inferTableColumns(e),m=Array.isArray(r.resolvedArgs?.columns)?r.resolvedArgs.columns:[];if(m.length){const a=m.map(s=>({requested:String(s),column:i.resolveColumn(String(s),u)})),p=a.filter(s=>!s.column).map(s=>s.requested);if(p.length)throw new Error(`Unknown table ${p.length===1?"column":"columns"}: ${p.join(", ")}. Use properties or labels reported by inspectTable.`);const v=a.map(s=>s.column);return Array.from(new Map(v.map(s=>[g.getTableColumnId(s),s])).values()).slice(0,12)}const c=u.filter(a=>a.visible!==!1&&!a._remove);return(c.length?c:u).slice(0,12)}function k(){if(r.status!=="completed")return!1;const e=r.resolvedArgs?._cachedData;return!e||typeof e!="object"||Array.isArray(e)?!1:typeof e.error=="string"?(n.value=e.error,d.value=!1,!0):!Array.isArray(e.rows)||!Array.isArray(e.columns)?!1:(o.value=e,d.value=!1,!0)}async function x(){if(!k()){d.value=!0,n.value=null;try{const e=await b(r.resolvedArgs||{}),l=_(r.resolvedArgs?.limit),u=A(e.rows,e.columns),m=e.rows.slice(0,l),c=m.map(s=>g.projectTableRow(s,u)),a=e.columns.length?e.columns:i.inferTableColumns(e.rows),p=m.map((s,C)=>({row:C,match:i.buildRowReference(s,e.rows,a)})),v=i.serializeBounded({title:r.resolvedArgs?.title||r.instanceName,view:r.resolvedArgs?.view||"auto",columns:u.map(s=>({...g.snapshotTableColumn(s),visible:!0})),rows:c,rowReferences:p,totalFetched:e.sourceRows.length,totalMatched:e.rows.length,displayedCount:c.length,truncated:e.rows.length>c.length,dateRange:e.requestedRange?{startDate:e.requestedRange.startDate,endDate:e.requestedRange.endDate,localProperty:e.localDateProperty}:null,availableActions:e.actions.map(s=>({id:s.id,label:s.label}))});o.value=v,r.status!=="completed"&&f("submit",v)}catch(e){n.value=e?.message||"Failed to load table data.",r.status!=="completed"&&f("submit",{error:n.value,rows:[],totalMatched:0})}finally{d.value=!1}}}return t.onMounted(x),(e,l)=>(t.openBlock(),t.createElementBlock("div",T,[d.value?(t.openBlock(),t.createElementBlock("div",B,[t.createVNode(t.unref(h.Loader2),{class:"size-4 animate-spin"}),l[0]||(l[0]=t.createElementVNode("span",null,"Loading table data…",-1))])):n.value?(t.openBlock(),t.createElementBlock("div",D,[t.createVNode(t.unref(h.AlertCircle),{class:"mt-0.5 size-4 shrink-0"}),t.createElementVNode("span",null,t.toDisplayString(n.value),1)])):o.value?(t.openBlock(),t.createBlock(i._sfc_main,{key:2,title:o.value.title,rows:o.value.rows||[],columns:o.value.columns||[],view:o.value.view||"auto","total-count":o.value.totalMatched,"max-rows":o.value.displayedCount,"empty-text":"No rows match this request."},{footer:t.withCtx(()=>[o.value.truncated?(t.openBlock(),t.createElementBlock("span",R," Showing "+t.toDisplayString(o.value.displayedCount)+" of "+t.toDisplayString(o.value.totalMatched)+" matching rows ",1)):(t.openBlock(),t.createElementBlock("span",q,t.toDisplayString(o.value.totalMatched)+" "+t.toDisplayString(o.value.totalMatched===1?"row":"rows"),1))]),_:1},8,["title","rows","columns","view","total-count","max-rows"])):t.createCommentVNode("",!0)]))}});exports.default=M;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { defineComponent as T, ref as h, onMounted as S, openBlock as i, createElementBlock as p, createVNode as w, unref as b, createElementVNode as y, toDisplayString as v, createBlock as q, withCtx as j, createCommentVNode as B } from "vue";
|
|
2
|
+
import { Loader2 as z, AlertCircle as E } from "lucide-vue-next";
|
|
3
|
+
import { u as F } from "./useTableAgentTools-r5InEI4p.mjs";
|
|
4
|
+
import { p as L, s as V, g as $ } from "./dateRangePresets-CaPVagHY.mjs";
|
|
5
|
+
import { _ as I, i as A, b as P, s as U, r as W } from "./TableResultView.vue_vue_type_script_setup_true_lang-sp0TLio0.mjs";
|
|
6
|
+
const G = { class: "w-full" }, H = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "flex items-center gap-2 py-3 text-xs text-muted-foreground"
|
|
9
|
+
}, J = {
|
|
10
|
+
key: 1,
|
|
11
|
+
class: "flex items-start gap-2 rounded-xl border border-destructive/30 bg-destructive/5 p-3 text-xs text-destructive"
|
|
12
|
+
}, K = { key: 0 }, O = { key: 1 }, te = /* @__PURE__ */ T({
|
|
13
|
+
__name: "TableDataWidget",
|
|
14
|
+
props: {
|
|
15
|
+
projectSlug: {},
|
|
16
|
+
toolName: {},
|
|
17
|
+
instanceId: {},
|
|
18
|
+
instanceName: {},
|
|
19
|
+
moduleType: {},
|
|
20
|
+
resolvedArgs: {},
|
|
21
|
+
status: {}
|
|
22
|
+
},
|
|
23
|
+
emits: ["submit"],
|
|
24
|
+
setup(_, { emit: x }) {
|
|
25
|
+
const a = _, g = x, c = h(!0), l = h(null), s = h(null), { loadRows: C } = F(a);
|
|
26
|
+
function k(e) {
|
|
27
|
+
const o = Number(e);
|
|
28
|
+
return Number.isFinite(o) ? Math.min(Math.max(Math.trunc(o), 1), 100) : 20;
|
|
29
|
+
}
|
|
30
|
+
function M(e, o) {
|
|
31
|
+
const n = o.length ? o : A(e), d = Array.isArray(a.resolvedArgs?.columns) ? a.resolvedArgs.columns : [];
|
|
32
|
+
if (d.length) {
|
|
33
|
+
const r = d.map((t) => ({
|
|
34
|
+
requested: String(t),
|
|
35
|
+
column: W(String(t), n)
|
|
36
|
+
})), m = r.filter((t) => !t.column).map((t) => t.requested);
|
|
37
|
+
if (m.length)
|
|
38
|
+
throw new Error(`Unknown table ${m.length === 1 ? "column" : "columns"}: ${m.join(", ")}. Use properties or labels reported by inspectTable.`);
|
|
39
|
+
const f = r.map((t) => t.column);
|
|
40
|
+
return Array.from(new Map(f.map((t) => [$(t), t])).values()).slice(0, 12);
|
|
41
|
+
}
|
|
42
|
+
const u = n.filter((r) => r.visible !== !1 && !r._remove);
|
|
43
|
+
return (u.length ? u : n).slice(0, 12);
|
|
44
|
+
}
|
|
45
|
+
function R() {
|
|
46
|
+
if (a.status !== "completed") return !1;
|
|
47
|
+
const e = a.resolvedArgs?._cachedData;
|
|
48
|
+
return !e || typeof e != "object" || Array.isArray(e) ? !1 : typeof e.error == "string" ? (l.value = e.error, c.value = !1, !0) : !Array.isArray(e.rows) || !Array.isArray(e.columns) ? !1 : (s.value = e, c.value = !1, !0);
|
|
49
|
+
}
|
|
50
|
+
async function D() {
|
|
51
|
+
if (!R()) {
|
|
52
|
+
c.value = !0, l.value = null;
|
|
53
|
+
try {
|
|
54
|
+
const e = await C(a.resolvedArgs || {}), o = k(a.resolvedArgs?.limit), n = M(e.rows, e.columns), d = e.rows.slice(0, o), u = d.map((t) => L(t, n)), r = e.columns.length ? e.columns : A(e.rows), m = d.map((t, N) => ({
|
|
55
|
+
row: N,
|
|
56
|
+
match: P(t, e.rows, r)
|
|
57
|
+
})), f = U({
|
|
58
|
+
title: a.resolvedArgs?.title || a.instanceName,
|
|
59
|
+
view: a.resolvedArgs?.view || "auto",
|
|
60
|
+
columns: n.map((t) => ({ ...V(t), visible: !0 })),
|
|
61
|
+
rows: u,
|
|
62
|
+
rowReferences: m,
|
|
63
|
+
totalFetched: e.sourceRows.length,
|
|
64
|
+
totalMatched: e.rows.length,
|
|
65
|
+
displayedCount: u.length,
|
|
66
|
+
truncated: e.rows.length > u.length,
|
|
67
|
+
dateRange: e.requestedRange ? {
|
|
68
|
+
startDate: e.requestedRange.startDate,
|
|
69
|
+
endDate: e.requestedRange.endDate,
|
|
70
|
+
localProperty: e.localDateProperty
|
|
71
|
+
} : null,
|
|
72
|
+
availableActions: e.actions.map((t) => ({
|
|
73
|
+
id: t.id,
|
|
74
|
+
label: t.label
|
|
75
|
+
}))
|
|
76
|
+
});
|
|
77
|
+
s.value = f, a.status !== "completed" && g("submit", f);
|
|
78
|
+
} catch (e) {
|
|
79
|
+
l.value = e?.message || "Failed to load table data.", a.status !== "completed" && g("submit", { error: l.value, rows: [], totalMatched: 0 });
|
|
80
|
+
} finally {
|
|
81
|
+
c.value = !1;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return S(D), (e, o) => (i(), p("div", G, [
|
|
86
|
+
c.value ? (i(), p("div", H, [
|
|
87
|
+
w(b(z), { class: "size-4 animate-spin" }),
|
|
88
|
+
o[0] || (o[0] = y("span", null, "Loading table data…", -1))
|
|
89
|
+
])) : l.value ? (i(), p("div", J, [
|
|
90
|
+
w(b(E), { class: "mt-0.5 size-4 shrink-0" }),
|
|
91
|
+
y("span", null, v(l.value), 1)
|
|
92
|
+
])) : s.value ? (i(), q(I, {
|
|
93
|
+
key: 2,
|
|
94
|
+
title: s.value.title,
|
|
95
|
+
rows: s.value.rows || [],
|
|
96
|
+
columns: s.value.columns || [],
|
|
97
|
+
view: s.value.view || "auto",
|
|
98
|
+
"total-count": s.value.totalMatched,
|
|
99
|
+
"max-rows": s.value.displayedCount,
|
|
100
|
+
"empty-text": "No rows match this request."
|
|
101
|
+
}, {
|
|
102
|
+
footer: j(() => [
|
|
103
|
+
s.value.truncated ? (i(), p("span", K, " Showing " + v(s.value.displayedCount) + " of " + v(s.value.totalMatched) + " matching rows ", 1)) : (i(), p("span", O, v(s.value.totalMatched) + " " + v(s.value.totalMatched === 1 ? "row" : "rows"), 1))
|
|
104
|
+
]),
|
|
105
|
+
_: 1
|
|
106
|
+
}, 8, ["title", "rows", "columns", "view", "total-count", "max-rows"])) : B("", !0)
|
|
107
|
+
]));
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
export {
|
|
111
|
+
te as default
|
|
112
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),se=require("nuxt/app"),u=require("lucide-vue-next"),b=require("./dateRangePresets-gxQCiZ6c.js"),x=require("./TableResultView.vue_vue_type_script_setup_true_lang-C3XiOXgb.js"),ae={class:"w-full min-w-0"},le={key:0,class:"flex items-center gap-2 py-3"},ie={class:"text-xs text-muted-foreground"},ce={key:1,class:"rounded-xl border border-destructive/30 bg-destructive/5 p-3 text-xs text-destructive"},ue={key:2,class:"overflow-hidden rounded-xl border bg-background"},de={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"},pe={class:"min-w-0 flex-1"},fe={class:"truncate text-sm font-semibold"},ge={class:"mt-0.5 text-[11px] text-muted-foreground"},ye={key:0,class:"mt-2 flex flex-wrap gap-1"},be={class:"grid gap-3 border-b p-3 sm:grid-cols-2"},xe={class:"rounded-lg border bg-muted/15 p-2.5"},he={class:"flex items-center gap-1.5 text-[11px] font-medium"},_e={class:"rounded-lg border bg-muted/15 p-2.5"},ke={class:"flex items-center gap-1.5 text-[11px] font-medium"},ve={key:0,class:"mt-1.5 flex flex-wrap gap-1"},we={key:1,class:"mt-1 text-xs text-muted-foreground"},Ne={class:"border-b p-3"},Ae={class:"mb-2 flex items-center justify-between gap-2"},Ee={class:"flex items-center gap-1.5 text-[11px] font-medium"},Be={class:"text-[10px] text-muted-foreground"},Ce={key:0,class:"flex flex-wrap gap-1.5"},Se={class:"font-medium"},Ve={class:"text-muted-foreground"},De={key:0,class:"text-muted-foreground/70"},Re={key:1,class:"text-xs text-muted-foreground"},$e={class:"p-3"},je={key:0,class:"mt-2 text-[11px] text-amber-600 dark:text-amber-400"},ze={key:0,class:"border-t bg-muted/20 px-3 py-2 text-[10px] text-muted-foreground"},Te=e.defineComponent({__name:"TableOverviewCard",props:{projectSlug:{},toolName:{},instanceId:{},instanceName:{},moduleType:{},resolvedArgs:{},status:{}},emits:["submit"],setup(f,{emit:T}){const i=f,F=T,{$useProjectService:L,$useModuleStorage:O,$useFlowBuilder:I,$useRoute:E}=se.useNuxtApp(),p=e.ref(!0),d=e.ref(null),a=e.ref(null),g=e.ref(null),B=e.ref(!1),C=e.computed(()=>{const t=Number(i.resolvedArgs?.sampleLimit);return Number.isFinite(t)?Math.min(Math.max(Math.floor(t),1),10):3}),M=e.computed(()=>a.value?.columns.filter(t=>t.visible!==!1)||[]),S=e.computed(()=>{if(!a.value)return[];const t={fetchConfigured:"Data source connected",viewable:"Row details",editable:"Editable",deletable:"Deletable",addable:"Addable",searchable:"Searchable",downloadable:"Downloadable",allowBulkActions:"Bulk actions"};return Object.entries(a.value.capabilities).filter(([,r])=>r).map(([r])=>t[r]||r)});function P(){if(i.status!=="completed")return!1;const t=i.resolvedArgs?._cachedData;return!t||typeof t!="object"||Array.isArray(t)?!1:typeof t.error=="string"?(d.value=t.error,p.value=!1,!0):!t.module||!Array.isArray(t.columns)||!Array.isArray(t.sampleRows)?!1:(a.value=t,g.value=i.resolvedArgs?._fetchedAt||null,p.value=!1,!0)}async function q(){p.value=!0,d.value=null;try{const t=L(),r=O({projectId:i.projectSlug,moduleId:i.instanceId}),[o,n]=await Promise.all([t.getModule(i.projectSlug,i.instanceId),r.getAllModuleData()]),s=U(n),l=Y(s.columns),y=H(s.itemActions),k=Q(s.filters),v=W(s.stats),w=Z(s.dateRangeFilter);let m=[],N;if(o?.config?.getItems)try{const{runFlow:c}=I(),oe=typeof E=="function"?E():null,ne=await c(o.config.getItems,G(w.defaultPreset,oe?.query||{}));m=J(ne)}catch(c){N=R(c,"The table data sample could not be loaded.")}const A=l.length>0?l:K(m),$=A.filter(c=>c.visible!==!1).slice(0,40),j=$.length>0?m.slice(0,C.value).map(c=>b.projectTableRow(c,$)).map(ee):[],z=x.serializeBounded({module:{id:i.instanceId,name:o?.name||i.instanceName,type:o?.type||i.moduleType},capabilities:{fetchConfigured:!!o?.config?.getItems,viewable:o?.config?.viewable===!0,editable:o?.config?.editable===!0,deletable:o?.config?.deletable===!0,addable:o?.config?.addable===!0,searchable:o?.config?.searchable===!0,downloadable:o?.config?.downloadable===!0,allowBulkActions:o?.config?.allowBulkActions===!0},columnCount:A.length,columns:A.slice(0,40).map(b.snapshotTableColumn),dateRangeFilter:w,actionCount:y.length,actions:y.slice(0,20),filters:k.slice(0,20),stats:v.slice(0,20),totalRows:m.length,sampleCount:j.length,sampleRows:j,...N?{sampleError:N}:{}},512*1024);a.value=z,g.value=new Date().toISOString(),V(z)}catch(t){d.value=R(t,"Failed to inspect this table."),V({error:d.value})}finally{p.value=!1}}function V(t){i.status==="completed"||B.value||(B.value=!0,F("submit",t))}function U(t){return Array.isArray(t)?Object.fromEntries(t.filter(r=>r&&typeof r.key=="string").map(r=>[r.key,r.value])):t&&typeof t=="object"?t:{}}function Y(t){return x.normalizeTableColumns(t).filter(r=>!r._remove)}function H(t){return Array.isArray(t)?t.filter(r=>r&&r.flow&&(typeof r.id=="string"||typeof r.label=="string")).map((r,o)=>({id:typeof r.id=="string"?r.id:`action-${o}`,label:typeof r.label=="string"&&r.label.trim()?r.label:`Action ${o+1}`})):[]}function Q(t){return Array.isArray(t)?t.filter(r=>r&&typeof r.property=="string").map((r,o)=>({id:typeof r.id=="string"?r.id:`filter-${o}`,label:typeof r.label=="string"&&r.label.trim()?r.label:_(r.property),property:r.property})):[]}function W(t){return Array.isArray(t)?t.filter(r=>r&&typeof r.method=="string").map((r,o)=>({id:typeof r.id=="string"?r.id:`stat-${o}`,label:typeof r.label=="string"&&r.label.trim()?r.label:`Statistic ${o+1}`,method:r.method,...typeof r.field=="string"&&r.field?{field:r.field}:{}})):[]}function Z(t){const r=t&&typeof t.defaultDate=="string"&&t.defaultDate?t.defaultDate:null;return{enabled:!!r,defaultPreset:r,label:r?te(r):"Not configured"}}function G(t,r){const o=Object.entries(r).map(([k,v])=>({name:k.replace(/-([a-z])/g,(w,m)=>m.toUpperCase()),type:"routeQueryParam",value:v??null}));if(!t)return o;const s=b.getDateRangePresets()[t];if(!Array.isArray(s)||!s[0])return o;const l=D(s[0],!1),y=D(s[1]||s[0],!0);return[...o,{name:"dateRangeFilter",type:"dateRangeFilter",value:{from:l,to:y}}]}function D(t,r){const[o,n,s]=t.split("-").map(Number),l=new Date(o,n-1,s);return r&&l.setHours(23,59,59,999),l}function J(t){return(Array.isArray(t)?t:Array.isArray(t?.data)?t.data:Array.isArray(t?.items)?t.items:Array.isArray(t?.rows)?t.rows:[]).map(o=>o&&typeof o=="object"&&!Array.isArray(o)?o:{value:o})}function K(t){const r=[],o=new Set;for(const n of t.slice(0,10))for(const s of Object.keys(n))o.has(s)||(o.add(s),r.push(s));return r.slice(0,40).map((n,s)=>({id:`inferred-${s}`,property:n,label:_(n),type:X(n,t.map(l=>l[n])),visible:!0}))}function X(t,r){const n=t.toLowerCase().replace(/[_.-]/g,"");if(/email$/.test(n))return"email";if(/(phone|mobile|telephone|tel)$/.test(n))return"phone";if(/(image|photo|avatar|thumbnail|logo|picture)$/.test(n))return"image";if(/(url|link|website|href)$/.test(n))return"URL";if(/(price|amount|cost|total|revenue|salary|fee)$/.test(n))return"currency";if(/(date|createdat|updatedat|timestamp)$/.test(n))return"datetime";const s=r.filter(l=>l!=null&&l!=="");return s.length===0?"text":s.every(l=>typeof l=="boolean")?"boolean":s.every(l=>Array.isArray(l))?"array":s.every(l=>typeof l=="number")?"number":"text"}function ee(t){const r=new WeakSet,o=Object.fromEntries(Object.entries(t).map(([n,s])=>[n,h(s,1,r)]));try{return x.serializeBounded(o,32*1024)}catch{return{_sampleOmitted:"This sample row was too large to include in chat."}}}function h(t,r,o){if(t==null||typeof t=="number"||typeof t=="boolean")return t;if(typeof t=="string")return t.length>500?`${t.slice(0,499)}…`:t;if(typeof t=="bigint")return String(t);if(t instanceof Date)return t.toISOString();if(typeof t!="object")return String(t);if(r>=3)return Array.isArray(t)?`[Array(${t.length})]`:"[Object]";if(o.has(t))return"[Circular]";if(o.add(t),Array.isArray(t)){const s=t.slice(0,10).map(l=>h(l,r+1,o));return t.length>10&&s.push(`[${t.length-10} more items]`),s}const n={};for(const[s,l]of Object.entries(t).slice(0,20))s==="__proto__"||s==="constructor"||s==="prototype"||(n[s]=h(l,r+1,o));return n}function _(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_.-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,r=>r.toUpperCase())}function te(t){return{today:"Today",yesterday:"Yesterday",last7days:"Last 7 days",lastMonth:"Last 30 days",last6months:"Last 6 months",lastYear:"Last 12 months",tomorrow:"Tomorrow",next7days:"Next 7 days",nextMonth:"Next 30 days",next6months:"Next 6 months",nextYear:"Next 12 months"}[t]||_(t)}function R(t,r){const o=t?.data?.statusMessage||t?.statusMessage||t?.message;return typeof o=="string"&&o.trim()?o.slice(0,500):r}function re(t){if(!t)return"";const r=new Date(t);return Number.isNaN(r.getTime())?"":r.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}return e.onMounted(()=>{i.status==="completed"&&P()||q()}),(t,r)=>{const o=e.resolveComponent("NuxtLink");return e.openBlock(),e.createElementBlock("div",ae,[p.value?(e.openBlock(),e.createElementBlock("div",le,[e.createVNode(e.unref(u.Loader2),{class:"size-4 animate-spin text-muted-foreground"}),e.createElementVNode("span",ie,"Inspecting "+e.toDisplayString(f.instanceName)+"…",1)])):d.value?(e.openBlock(),e.createElementBlock("div",ce,e.toDisplayString(d.value),1)):a.value?(e.openBlock(),e.createElementBlock("div",ue,[e.createElementVNode("div",de,[e.createElementVNode("div",me,[e.createVNode(e.unref(u.Table2),{class:"size-4 text-primary"})]),e.createElementVNode("div",pe,[e.createElementVNode("p",fe,e.toDisplayString(a.value.module.name),1),e.createElementVNode("p",ge,e.toDisplayString(a.value.totalRows)+" "+e.toDisplayString(a.value.totalRows===1?"row":"rows")+" · "+e.toDisplayString(a.value.columnCount)+" "+e.toDisplayString(a.value.columnCount===1?"column":"columns"),1),S.value.length?(e.openBlock(),e.createElementBlock("div",ye,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.value,n=>(e.openBlock(),e.createElementBlock("span",{key:n,class:"inline-flex items-center gap-1 rounded-full border bg-background px-1.5 py-0.5 text-[10px] text-muted-foreground"},[e.createVNode(e.unref(u.Check),{class:"size-2.5 text-emerald-500"}),e.createTextVNode(" "+e.toDisplayString(n),1)]))),128))])):e.createCommentVNode("",!0)]),e.createVNode(o,{to:`/projects/${f.projectSlug}/modules/${f.instanceId}`,class:"inline-flex shrink-0 items-center gap-1 text-[11px] text-primary hover:underline"},{default:e.withCtx(()=>[r[0]||(r[0]=e.createTextVNode(" Open ",-1)),e.createVNode(e.unref(u.ExternalLink),{class:"size-3"})]),_:1},8,["to"])]),e.createElementVNode("div",be,[e.createElementVNode("div",xe,[e.createElementVNode("div",he,[e.createVNode(e.unref(u.CalendarRange),{class:"size-3.5 text-primary"}),r[1]||(r[1]=e.createTextVNode(" Date range filter ",-1))]),e.createElementVNode("p",{class:e.normalizeClass(["mt-1 text-xs",a.value.dateRangeFilter.enabled?"text-foreground":"text-muted-foreground"])},e.toDisplayString(a.value.dateRangeFilter.label),3)]),e.createElementVNode("div",_e,[e.createElementVNode("div",ke,[e.createVNode(e.unref(u.MousePointerClick),{class:"size-3.5 text-primary"}),r[2]||(r[2]=e.createTextVNode(" Row actions ",-1))]),a.value.actions.length?(e.openBlock(),e.createElementBlock("div",ve,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value.actions,n=>(e.openBlock(),e.createElementBlock("span",{key:n.id,class:"rounded-full bg-primary/10 px-1.5 py-0.5 text-[10px] font-medium text-primary"},e.toDisplayString(n.label),1))),128))])):(e.openBlock(),e.createElementBlock("p",we,"No row actions configured"))])]),e.createElementVNode("div",Ne,[e.createElementVNode("div",Ae,[e.createElementVNode("div",Ee,[e.createVNode(e.unref(u.Columns3),{class:"size-3.5 text-primary"}),r[3]||(r[3]=e.createTextVNode(" Columns ",-1))]),e.createElementVNode("span",Be,e.toDisplayString(M.value.length)+" visible ",1)]),a.value.columns.length?(e.openBlock(),e.createElementBlock("div",Ce,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value.columns,n=>(e.openBlock(),e.createElementBlock("span",{key:e.unref(b.getTableColumnId)(n),class:e.normalizeClass(["inline-flex items-center gap-1 rounded-md border px-2 py-1 text-[10px]",n.visible?"bg-background":"bg-muted/40 text-muted-foreground"])},[e.createElementVNode("span",Se,e.toDisplayString(n.label),1),e.createElementVNode("span",Ve,e.toDisplayString(n.type),1),n.visible?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",De,"hidden"))],2))),128))])):(e.openBlock(),e.createElementBlock("p",Re,"No columns could be inferred."))]),e.createElementVNode("div",$e,[e.createVNode(x._sfc_main,{rows:a.value.sampleRows,columns:a.value.columns,title:"Sample data",description:a.value.sampleCount?`First ${a.value.sampleCount} ${a.value.sampleCount===1?"row":"rows"} from the current data set`:"","total-count":a.value.sampleCount,"max-rows":C.value,"max-columns":6,"empty-text":"No sample rows were returned."},null,8,["rows","columns","description","total-count","max-rows"]),a.value.sampleError?(e.openBlock(),e.createElementBlock("p",je,e.toDisplayString(a.value.sampleError),1)):e.createCommentVNode("",!0)]),g.value?(e.openBlock(),e.createElementBlock("div",ze," Snapshot from "+e.toDisplayString(re(g.value)),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])}}});exports.default=Te;
|