@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
package/dist/Detail-Byk781b4.mjs
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { defineComponent as r, onMounted as n, openBlock as c, createElementBlock as s, createVNode as a } from "vue";
|
|
2
|
-
import { useModuleBreadcrumbs as i, useFirebaseIntegration as p } from "@oneclick.dev/cms-kit";
|
|
3
|
-
import { _ as m } from "./TemplateList.vue_vue_type_script_setup_true_lang-Cmovy7kk.mjs";
|
|
4
|
-
const u = { class: "relative" }, b = /* @__PURE__ */ r({
|
|
5
|
-
__name: "Detail",
|
|
6
|
-
props: {
|
|
7
|
-
config: {
|
|
8
|
-
type: Object,
|
|
9
|
-
required: !0
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
setup(e) {
|
|
13
|
-
const t = e;
|
|
14
|
-
i(() => []), p(t.config.project);
|
|
15
|
-
const o = async () => {
|
|
16
|
-
};
|
|
17
|
-
return n(() => {
|
|
18
|
-
o();
|
|
19
|
-
}), (_, l) => (c(), s("div", u, [
|
|
20
|
-
a(m)
|
|
21
|
-
]));
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
export {
|
|
25
|
-
b as default
|
|
26
|
-
};
|
package/dist/Detail-mvSGbnFU.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("@oneclick.dev/cms-kit"),o=require("./TemplateList.vue_vue_type_script_setup_true_lang-B_AtWnHa.js"),s={class:"relative"},i=e.defineComponent({__name:"Detail",props:{config:{type:Object,required:!0}},setup(r){const c=r;t.useModuleBreadcrumbs(()=>[]),t.useFirebaseIntegration(c.config.project);const n=async()=>{};return e.onMounted(()=>{n()}),(u,a)=>(e.openBlock(),e.createElementBlock("div",s,[e.createVNode(o._sfc_main)]))}});exports.default=i;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("@oneclick.dev/cms-kit"),o=require("./TemplateList.vue_vue_type_script_setup_true_lang-B_AtWnHa.js"),s={class:"relative"},i=e.defineComponent({__name:"Overview",props:{config:{type:Object,required:!0}},setup(r){const c=r;t.useModuleBreadcrumbs(()=>[]),t.useFirebaseIntegration(c.config.project);const n=async()=>{};return e.onMounted(()=>{n()}),(u,a)=>(e.openBlock(),e.createElementBlock("div",s,[e.createVNode(o._sfc_main)]))}});exports.default=i;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { defineComponent as r, onMounted as n, openBlock as c, createElementBlock as s, createVNode as a } from "vue";
|
|
2
|
-
import { useModuleBreadcrumbs as i, useFirebaseIntegration as p } from "@oneclick.dev/cms-kit";
|
|
3
|
-
import { _ as m } from "./TemplateList.vue_vue_type_script_setup_true_lang-Cmovy7kk.mjs";
|
|
4
|
-
const u = { class: "relative" }, v = /* @__PURE__ */ r({
|
|
5
|
-
__name: "Overview",
|
|
6
|
-
props: {
|
|
7
|
-
config: {
|
|
8
|
-
type: Object,
|
|
9
|
-
required: !0
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
setup(e) {
|
|
13
|
-
const t = e;
|
|
14
|
-
i(() => []), p(t.config.project);
|
|
15
|
-
const o = async () => {
|
|
16
|
-
};
|
|
17
|
-
return n(() => {
|
|
18
|
-
o();
|
|
19
|
-
}), (_, d) => (c(), s("div", u, [
|
|
20
|
-
a(m)
|
|
21
|
-
]));
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
export {
|
|
25
|
-
v as default
|
|
26
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),g=require("lucide-vue-next"),B=require("./useTableAgentTools-D5mzGf3A.js"),c=require("./TableResultView.vue_vue_type_script_setup_true_lang-C_Lv-SmJ.js"),D={class:"w-full"},C={key:0,class:"flex items-center gap-2 py-3 text-xs text-muted-foreground"},M={key:1,class:"flex items-start gap-2 rounded-xl border border-destructive/30 bg-destructive/5 p-3 text-xs text-destructive"},N={key:0},R={key:1},q=t.defineComponent({__name:"TableDataWidget",props:{projectSlug:{},toolName:{},instanceId:{},instanceName:{},moduleType:{},resolvedArgs:{},status:{}},emits:["submit"],setup(y,{emit:h}){const s=y,f=h,d=t.ref(!0),u=t.ref(null),o=t.ref(null),{loadRows:w}=B.useTableAgentTools(s);function b(e){const l=Number(e);return Number.isFinite(l)?Math.min(Math.max(Math.trunc(l),1),100):20}function _(e,l){const a=l.length?l:c.inferTableColumns(e),p=Array.isArray(s.resolvedArgs?.columns)?s.resolvedArgs.columns:[];if(p.length){const n=p.map(r=>({requested:String(r),column:c.resolveColumn(String(r),a)})),m=n.filter(r=>!r.column).map(r=>r.requested);if(m.length)throw new Error(`Unknown table ${m.length===1?"column":"columns"}: ${m.join(", ")}. Use properties or labels reported by inspectTable.`);const v=n.map(r=>r.column);return Array.from(new Map(v.map(r=>[r.property,r])).values()).slice(0,12)}const i=a.filter(n=>n.visible!==!1&&!n._remove);return(i.length?i:a).slice(0,12)}function A(e,l){return Object.fromEntries(l.map(a=>[a.property,c.resolveProperty(e,a.property)]))}function k(){if(s.status!=="completed")return!1;const e=s.resolvedArgs?._cachedData;return!e||typeof e!="object"||Array.isArray(e)?!1:typeof e.error=="string"?(u.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,u.value=null;try{const e=await w(s.resolvedArgs||{}),l=b(s.resolvedArgs?.limit),a=_(e.rows,e.columns),p=e.rows.slice(0,l),i=p.map(r=>A(r,a)),n=e.columns.length?e.columns:c.inferTableColumns(e.rows),m=p.map((r,S)=>({row:S,match:c.buildRowReference(r,e.rows,n)})),v=c.serializeBounded({title:s.resolvedArgs?.title||s.instanceName,view:s.resolvedArgs?.view||"auto",columns:a.map(r=>({property:r.property,label:r.label||r.property,type:r.type||"text"})),rows:i,rowReferences:m,totalFetched:e.sourceRows.length,totalMatched:e.rows.length,displayedCount:i.length,truncated:e.rows.length>i.length,dateRange:e.requestedRange?{startDate:e.requestedRange.startDate,endDate:e.requestedRange.endDate,localProperty:e.localDateProperty}:null,availableActions:e.actions.map(r=>({id:r.id,label:r.label}))});o.value=v,s.status!=="completed"&&f("submit",v)}catch(e){u.value=e?.message||"Failed to load table data.",s.status!=="completed"&&f("submit",{error:u.value,rows:[],totalMatched:0})}finally{d.value=!1}}}return t.onMounted(x),(e,l)=>(t.openBlock(),t.createElementBlock("div",D,[d.value?(t.openBlock(),t.createElementBlock("div",C,[t.createVNode(t.unref(g.Loader2),{class:"size-4 animate-spin"}),l[0]||(l[0]=t.createElementVNode("span",null,"Loading table data…",-1))])):u.value?(t.openBlock(),t.createElementBlock("div",M,[t.createVNode(t.unref(g.AlertCircle),{class:"mt-0.5 size-4 shrink-0"}),t.createElementVNode("span",null,t.toDisplayString(u.value),1)])):o.value?(t.openBlock(),t.createBlock(c._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",N," Showing "+t.toDisplayString(o.value.displayedCount)+" of "+t.toDisplayString(o.value.totalMatched)+" matching rows ",1)):(t.openBlock(),t.createElementBlock("span",R,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=q;
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { defineComponent as q, ref as h, onMounted as T, openBlock as u, createElementBlock as p, createVNode as w, unref as y, createElementVNode as b, toDisplayString as v, createBlock as j, withCtx as B, createCommentVNode as E } from "vue";
|
|
2
|
-
import { Loader2 as z, AlertCircle as F } from "lucide-vue-next";
|
|
3
|
-
import { u as L } from "./useTableAgentTools-DcN3kYRL.mjs";
|
|
4
|
-
import { _ as P, i as A, b as V, s as $, r as U, a as I } from "./TableResultView.vue_vue_type_script_setup_true_lang-CBn-Oxl9.mjs";
|
|
5
|
-
const O = { class: "w-full" }, W = {
|
|
6
|
-
key: 0,
|
|
7
|
-
class: "flex items-center gap-2 py-3 text-xs text-muted-foreground"
|
|
8
|
-
}, G = {
|
|
9
|
-
key: 1,
|
|
10
|
-
class: "flex items-start gap-2 rounded-xl border border-destructive/30 bg-destructive/5 p-3 text-xs text-destructive"
|
|
11
|
-
}, H = { key: 0 }, J = { key: 1 }, Z = /* @__PURE__ */ q({
|
|
12
|
-
__name: "TableDataWidget",
|
|
13
|
-
props: {
|
|
14
|
-
projectSlug: {},
|
|
15
|
-
toolName: {},
|
|
16
|
-
instanceId: {},
|
|
17
|
-
instanceName: {},
|
|
18
|
-
moduleType: {},
|
|
19
|
-
resolvedArgs: {},
|
|
20
|
-
status: {}
|
|
21
|
-
},
|
|
22
|
-
emits: ["submit"],
|
|
23
|
-
setup(_, { emit: x }) {
|
|
24
|
-
const s = _, g = x, c = h(!0), n = h(null), r = h(null), { loadRows: k } = L(s);
|
|
25
|
-
function C(e) {
|
|
26
|
-
const a = Number(e);
|
|
27
|
-
return Number.isFinite(a) ? Math.min(Math.max(Math.trunc(a), 1), 100) : 20;
|
|
28
|
-
}
|
|
29
|
-
function M(e, a) {
|
|
30
|
-
const o = a.length ? a : A(e), d = Array.isArray(s.resolvedArgs?.columns) ? s.resolvedArgs.columns : [];
|
|
31
|
-
if (d.length) {
|
|
32
|
-
const l = d.map((t) => ({
|
|
33
|
-
requested: String(t),
|
|
34
|
-
column: U(String(t), o)
|
|
35
|
-
})), m = l.filter((t) => !t.column).map((t) => t.requested);
|
|
36
|
-
if (m.length)
|
|
37
|
-
throw new Error(`Unknown table ${m.length === 1 ? "column" : "columns"}: ${m.join(", ")}. Use properties or labels reported by inspectTable.`);
|
|
38
|
-
const f = l.map((t) => t.column);
|
|
39
|
-
return Array.from(new Map(f.map((t) => [t.property, t])).values()).slice(0, 12);
|
|
40
|
-
}
|
|
41
|
-
const i = o.filter((l) => l.visible !== !1 && !l._remove);
|
|
42
|
-
return (i.length ? i : o).slice(0, 12);
|
|
43
|
-
}
|
|
44
|
-
function R(e, a) {
|
|
45
|
-
return Object.fromEntries(a.map((o) => [
|
|
46
|
-
o.property,
|
|
47
|
-
I(e, o.property)
|
|
48
|
-
]));
|
|
49
|
-
}
|
|
50
|
-
function D() {
|
|
51
|
-
if (s.status !== "completed") return !1;
|
|
52
|
-
const e = s.resolvedArgs?._cachedData;
|
|
53
|
-
return !e || typeof e != "object" || Array.isArray(e) ? !1 : typeof e.error == "string" ? (n.value = e.error, c.value = !1, !0) : !Array.isArray(e.rows) || !Array.isArray(e.columns) ? !1 : (r.value = e, c.value = !1, !0);
|
|
54
|
-
}
|
|
55
|
-
async function N() {
|
|
56
|
-
if (!D()) {
|
|
57
|
-
c.value = !0, n.value = null;
|
|
58
|
-
try {
|
|
59
|
-
const e = await k(s.resolvedArgs || {}), a = C(s.resolvedArgs?.limit), o = M(e.rows, e.columns), d = e.rows.slice(0, a), i = d.map((t) => R(t, o)), l = e.columns.length ? e.columns : A(e.rows), m = d.map((t, S) => ({
|
|
60
|
-
row: S,
|
|
61
|
-
match: V(t, e.rows, l)
|
|
62
|
-
})), f = $({
|
|
63
|
-
title: s.resolvedArgs?.title || s.instanceName,
|
|
64
|
-
view: s.resolvedArgs?.view || "auto",
|
|
65
|
-
columns: o.map((t) => ({
|
|
66
|
-
property: t.property,
|
|
67
|
-
label: t.label || t.property,
|
|
68
|
-
type: t.type || "text"
|
|
69
|
-
})),
|
|
70
|
-
rows: i,
|
|
71
|
-
rowReferences: m,
|
|
72
|
-
totalFetched: e.sourceRows.length,
|
|
73
|
-
totalMatched: e.rows.length,
|
|
74
|
-
displayedCount: i.length,
|
|
75
|
-
truncated: e.rows.length > i.length,
|
|
76
|
-
dateRange: e.requestedRange ? {
|
|
77
|
-
startDate: e.requestedRange.startDate,
|
|
78
|
-
endDate: e.requestedRange.endDate,
|
|
79
|
-
localProperty: e.localDateProperty
|
|
80
|
-
} : null,
|
|
81
|
-
availableActions: e.actions.map((t) => ({
|
|
82
|
-
id: t.id,
|
|
83
|
-
label: t.label
|
|
84
|
-
}))
|
|
85
|
-
});
|
|
86
|
-
r.value = f, s.status !== "completed" && g("submit", f);
|
|
87
|
-
} catch (e) {
|
|
88
|
-
n.value = e?.message || "Failed to load table data.", s.status !== "completed" && g("submit", { error: n.value, rows: [], totalMatched: 0 });
|
|
89
|
-
} finally {
|
|
90
|
-
c.value = !1;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
return T(N), (e, a) => (u(), p("div", O, [
|
|
95
|
-
c.value ? (u(), p("div", W, [
|
|
96
|
-
w(y(z), { class: "size-4 animate-spin" }),
|
|
97
|
-
a[0] || (a[0] = b("span", null, "Loading table data…", -1))
|
|
98
|
-
])) : n.value ? (u(), p("div", G, [
|
|
99
|
-
w(y(F), { class: "mt-0.5 size-4 shrink-0" }),
|
|
100
|
-
b("span", null, v(n.value), 1)
|
|
101
|
-
])) : r.value ? (u(), j(P, {
|
|
102
|
-
key: 2,
|
|
103
|
-
title: r.value.title,
|
|
104
|
-
rows: r.value.rows || [],
|
|
105
|
-
columns: r.value.columns || [],
|
|
106
|
-
view: r.value.view || "auto",
|
|
107
|
-
"total-count": r.value.totalMatched,
|
|
108
|
-
"max-rows": r.value.displayedCount,
|
|
109
|
-
"empty-text": "No rows match this request."
|
|
110
|
-
}, {
|
|
111
|
-
footer: B(() => [
|
|
112
|
-
r.value.truncated ? (u(), p("span", H, " Showing " + v(r.value.displayedCount) + " of " + v(r.value.totalMatched) + " matching rows ", 1)) : (u(), p("span", J, v(r.value.totalMatched) + " " + v(r.value.totalMatched === 1 ? "row" : "rows"), 1))
|
|
113
|
-
]),
|
|
114
|
-
_: 1
|
|
115
|
-
}, 8, ["title", "rows", "columns", "view", "total-count", "max-rows"])) : E("", !0)
|
|
116
|
-
]));
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
export {
|
|
120
|
-
Z as default
|
|
121
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),ae=require("nuxt/app"),d=require("lucide-vue-next"),le=require("./dateRangePresets-CPWqst_x.js"),N=require("./TableResultView.vue_vue_type_script_setup_true_lang-C_Lv-SmJ.js"),ie={class:"w-full min-w-0"},ce={key:0,class:"flex items-center gap-2 py-3"},de={class:"text-xs text-muted-foreground"},ue={key:1,class:"rounded-xl border border-destructive/30 bg-destructive/5 p-3 text-xs text-destructive"},me={key:2,class:"overflow-hidden rounded-xl border bg-background"},pe={class:"flex items-start gap-3 border-b bg-muted/30 p-3"},fe={class:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-primary/10"},ge={class:"min-w-0 flex-1"},ye={class:"truncate text-sm font-semibold"},be={class:"mt-0.5 text-[11px] text-muted-foreground"},xe={key:0,class:"mt-2 flex flex-wrap gap-1"},he={class:"grid gap-3 border-b p-3 sm:grid-cols-2"},_e={class:"rounded-lg border bg-muted/15 p-2.5"},ke={class:"flex items-center gap-1.5 text-[11px] font-medium"},ve={class:"rounded-lg border bg-muted/15 p-2.5"},we={class:"flex items-center gap-1.5 text-[11px] font-medium"},Ne={key:0,class:"mt-1.5 flex flex-wrap gap-1"},Ae={key:1,class:"mt-1 text-xs text-muted-foreground"},Ee={class:"border-b p-3"},Be={class:"mb-2 flex items-center justify-between gap-2"},Se={class:"flex items-center gap-1.5 text-[11px] font-medium"},Ve={class:"text-[10px] text-muted-foreground"},Ce={key:0,class:"flex flex-wrap gap-1.5"},De={class:"font-medium"},$e={class:"text-muted-foreground"},Re={key:0,class:"text-muted-foreground/70"},je={key:1,class:"text-xs text-muted-foreground"},ze={class:"p-3"},Fe={key:0,class:"mt-2 text-[11px] text-amber-600 dark:text-amber-400"},Le={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:z}){const i=f,F=z,{$useProjectService:L,$useModuleStorage:T,$useFlowBuilder:O,$useRoute:A}=ae.useNuxtApp(),p=e.ref(!0),u=e.ref(null),a=e.ref(null),g=e.ref(null),E=e.ref(!1),B=e.computed(()=>{const t=Number(i.resolvedArgs?.sampleLimit);return Number.isFinite(t)?Math.min(Math.max(Math.floor(t),1),10):3}),I=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 M(){if(i.status!=="completed")return!1;const t=i.resolvedArgs?._cachedData;return!t||typeof t!="object"||Array.isArray(t)?!1:typeof t.error=="string"?(u.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 P(){p.value=!0,u.value=null;try{const t=L(),r=T({projectId:i.projectSlug,moduleId:i.instanceId}),[o,n]=await Promise.all([t.getModule(i.projectSlug,i.instanceId),r.getAllModuleData()]),s=q(n),l=U(s.columns),b=Y(s.itemActions),h=H(s.filters),_=Q(s.stats),k=W(s.dateRangeFilter);let m=[],v;if(o?.config?.getItems)try{const{runFlow:c}=O(),ne=typeof A=="function"?A():null,se=await c(o.config.getItems,Z(k.defaultPreset,ne?.query||{}));m=G(se)}catch(c){v=D(c,"The table data sample could not be loaded.")}const w=l.length>0?l:X(m),$=w.filter(c=>c.visible!==!1).slice(0,40),R=$.length>0?m.slice(0,B.value).map(c=>J(c,$)).map(te):[],j=N.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:w.length,columns:w.slice(0,40),dateRangeFilter:k,actionCount:b.length,actions:b.slice(0,20),filters:h.slice(0,20),stats:_.slice(0,20),totalRows:m.length,sampleCount:R.length,sampleRows:R,...v?{sampleError:v}:{}},512*1024);a.value=j,g.value=new Date().toISOString(),V(j)}catch(t){u.value=D(t,"Failed to inspect this table."),V({error:u.value})}finally{p.value=!1}}function V(t){i.status==="completed"||E.value||(E.value=!0,F("submit",t))}function q(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 U(t){return Array.isArray(t)?t.filter(r=>r&&typeof r.property=="string"&&r.property.trim()).map((r,o)=>({id:typeof r.id=="string"?r.id:`column-${o}`,property:r.property,label:typeof r.label=="string"&&r.label.trim()?r.label:y(r.property),type:typeof r.type=="string"&&r.type?r.type:"text",visible:r.visible!==!1})):[]}function Y(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 H(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:y(r.property),property:r.property})):[]}function Q(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 W(t){const r=t&&typeof t.defaultDate=="string"&&t.defaultDate?t.defaultDate:null;return{enabled:!!r,defaultPreset:r,label:r?re(r):"Not configured"}}function Z(t,r){const o=Object.entries(r).map(([h,_])=>({name:h.replace(/-([a-z])/g,(k,m)=>m.toUpperCase()),type:"routeQueryParam",value:_??null}));if(!t)return o;const s=le.getDateRangePresets()[t];if(!Array.isArray(s)||!s[0])return o;const l=C(s[0],!1),b=C(s[1]||s[0],!0);return[...o,{name:"dateRangeFilter",type:"dateRangeFilter",value:{from:l,to:b}}]}function C(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 G(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 J(t,r){return Object.fromEntries(r.map(o=>[o.property,K(t,o.property)]))}function K(t,r){const o=r.split(".");if(!o.some(n=>["__proto__","constructor","prototype"].includes(n)))return Object.prototype.hasOwnProperty.call(t,r)?t[r]:o.reduce((n,s)=>n?.[s],t)}function X(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:y(n),type:ee(n,t.map(l=>l[n])),visible:!0}))}function ee(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 te(t){const r=x(t,0,new WeakSet);try{return N.serializeBounded(r,32*1024)}catch{return{_sampleOmitted:"This sample row was too large to include in chat."}}}function x(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=>x(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]=x(l,r+1,o));return n}function y(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 re(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]||y(t)}function D(t,r){const o=t?.data?.statusMessage||t?.statusMessage||t?.message;return typeof o=="string"&&o.trim()?o.slice(0,500):r}function oe(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"&&M()||P()}),(t,r)=>{const o=e.resolveComponent("NuxtLink");return e.openBlock(),e.createElementBlock("div",ie,[p.value?(e.openBlock(),e.createElementBlock("div",ce,[e.createVNode(e.unref(d.Loader2),{class:"size-4 animate-spin text-muted-foreground"}),e.createElementVNode("span",de,"Inspecting "+e.toDisplayString(f.instanceName)+"…",1)])):u.value?(e.openBlock(),e.createElementBlock("div",ue,e.toDisplayString(u.value),1)):a.value?(e.openBlock(),e.createElementBlock("div",me,[e.createElementVNode("div",pe,[e.createElementVNode("div",fe,[e.createVNode(e.unref(d.Table2),{class:"size-4 text-primary"})]),e.createElementVNode("div",ge,[e.createElementVNode("p",ye,e.toDisplayString(a.value.module.name),1),e.createElementVNode("p",be,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",xe,[(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(d.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(d.ExternalLink),{class:"size-3"})]),_:1},8,["to"])]),e.createElementVNode("div",he,[e.createElementVNode("div",_e,[e.createElementVNode("div",ke,[e.createVNode(e.unref(d.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",ve,[e.createElementVNode("div",we,[e.createVNode(e.unref(d.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",Ne,[(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",Ae,"No row actions configured"))])]),e.createElementVNode("div",Ee,[e.createElementVNode("div",Be,[e.createElementVNode("div",Se,[e.createVNode(e.unref(d.Columns3),{class:"size-3.5 text-primary"}),r[3]||(r[3]=e.createTextVNode(" Columns ",-1))]),e.createElementVNode("span",Ve,e.toDisplayString(I.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:n.id||n.property,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",De,e.toDisplayString(n.label),1),e.createElementVNode("span",$e,e.toDisplayString(n.type),1),n.visible?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Re,"hidden"))],2))),128))])):(e.openBlock(),e.createElementBlock("p",je,"No columns could be inferred."))]),e.createElementVNode("div",ze,[e.createVNode(N._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":B.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",Fe,e.toDisplayString(a.value.sampleError),1)):e.createCommentVNode("",!0)]),g.value?(e.openBlock(),e.createElementBlock("div",Le," Snapshot from "+e.toDisplayString(oe(g.value)),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])}}});exports.default=Te;
|