@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.
Files changed (223) hide show
  1. package/dist/AppointmentListTable-CWzbwqR-.js +1 -0
  2. package/dist/AppointmentListTable-DoZuBstk.mjs +270 -0
  3. package/dist/ContentEditor-BlNbqkAz.js +324 -0
  4. package/dist/{ContentEditor-MDGolnIP.mjs → ContentEditor-D754iLJS.mjs} +7985 -26820
  5. package/dist/{Detail-Dk8E6_uF.mjs → Detail-BOxWQ1QQ.mjs} +15 -14
  6. package/dist/{Detail-Cn9Bk0u0.mjs → Detail-BfKW0uZE.mjs} +26 -25
  7. package/dist/Detail-DFVu2F38.mjs +11 -0
  8. package/dist/Detail-DJea_fCd.js +1 -0
  9. package/dist/Detail-DPJacXfm.js +1 -0
  10. package/dist/Detail-DSLZ7_bM.js +1 -0
  11. package/dist/Detail-DUGThL9Y.js +1 -0
  12. package/dist/{Detail-B_scnidb.mjs → Detail-D_LlEeHu.mjs} +35 -34
  13. package/dist/Editor-D4evcdhv.mjs +768 -0
  14. package/dist/Editor-gLLtuJbY.js +1 -0
  15. package/dist/FormStatusBadge.vue_vue_type_script_setup_true_lang-BjKpsqT9.js +1 -0
  16. package/dist/FormStatusBadge.vue_vue_type_script_setup_true_lang-D5v5AhLe.mjs +76 -0
  17. package/dist/Knowledge-B66vxz--.js +1 -0
  18. package/dist/Knowledge-BnMTTuJ7.mjs +742 -0
  19. package/dist/Overview-0hFXiuYo.js +1 -0
  20. package/dist/Overview-BE4uYPx0.mjs +745 -0
  21. package/dist/Overview-BTx5LF4J.js +1 -0
  22. package/dist/Overview-CCu2PHai.mjs +289 -0
  23. package/dist/Overview-CQRpFhbJ.mjs +286 -0
  24. package/dist/Overview-CTs7sX4d.js +1 -0
  25. package/dist/Overview-Cj89XXKN.js +1 -0
  26. package/dist/Overview-D2u-leeO.js +1 -0
  27. package/dist/Overview-D_2wozCG.mjs +1733 -0
  28. package/dist/Overview-D_c18mbR.mjs +248 -0
  29. package/dist/Overview-Dffo-zH4.mjs +11 -0
  30. package/dist/Overview-g4Rcj245.js +1 -0
  31. package/dist/{TableCalculationWidget-CrqcLGfU.mjs → TableCalculationWidget-B_LFoOYm.mjs} +3 -3
  32. package/dist/{TableCalculationWidget-CkQPrVUd.js → TableCalculationWidget-CahOIcbk.js} +1 -1
  33. package/dist/TableDataWidget-BwqWFH4A.js +1 -0
  34. package/dist/TableDataWidget-RsVxcDsL.mjs +112 -0
  35. package/dist/TableOverviewCard-BPWCqo56.js +1 -0
  36. package/dist/{TableOverviewCard-Ci0d4o4w.mjs → TableOverviewCard-D667DDag.mjs} +113 -127
  37. package/dist/TableResultView.vue_vue_type_script_setup_true_lang-C3XiOXgb.js +1 -0
  38. package/dist/TableResultView.vue_vue_type_script_setup_true_lang-sp0TLio0.mjs +547 -0
  39. package/dist/{TableRowActionCard-BhdnnPaq.mjs → TableRowActionCard-BPYJ-Kjy.mjs} +95 -101
  40. package/dist/TableRowActionCard-Bnqj1YIe.js +1 -0
  41. package/dist/TableView-CwhZ9YN2.js +4 -0
  42. package/dist/TableView-DX9PKS8N.mjs +9673 -0
  43. package/dist/TemplateBuilder.vue_vue_type_script_setup_true_lang-BgDdzbLe.js +1 -0
  44. package/dist/TemplateBuilder.vue_vue_type_script_setup_true_lang-D85V4nrQ.mjs +2886 -0
  45. package/dist/Test-CzmOmi53.mjs +447 -0
  46. package/dist/Test-USDtNFY1.js +1 -0
  47. package/dist/UserDetail-DpUL3mhk.mjs +1483 -0
  48. package/dist/UserDetail-KRIfxaYd.js +1 -0
  49. package/dist/cms-core-modules.css +1 -1
  50. package/dist/dateRangePresets-CaPVagHY.mjs +453 -0
  51. package/dist/dateRangePresets-gxQCiZ6c.js +1 -0
  52. package/dist/index-6hZ6MYY6.js +1 -0
  53. package/dist/index-BVmmicu3.mjs +14 -0
  54. package/dist/index-CQuN5rKx.js +1 -0
  55. package/dist/index-ChHD_1Cf.js +144 -0
  56. package/dist/index-CnDGeInm.js +1 -0
  57. package/dist/index-CqDTc5Ig.mjs +20 -0
  58. package/dist/index-CvV4nVWI.js +1 -0
  59. package/dist/index-CyvvAdt4.js +1 -0
  60. package/dist/index-DH2z0W_w.mjs +19012 -0
  61. package/dist/index-DIRD7t5_.mjs +20 -0
  62. package/dist/index-DZKzj48V.mjs +17 -0
  63. package/dist/index-OJuBYR60.mjs +57 -0
  64. package/dist/index.cjs.js +1 -1
  65. package/dist/index.mjs +480 -103
  66. package/dist/orders-C_sz8J9b.js +1 -0
  67. package/dist/{orders-BfTLIm7U.mjs → orders-Cgdggzvx.mjs} +84 -84
  68. package/dist/server-handlers.cjs.js +1 -1
  69. package/dist/server-handlers.mjs +2696 -605
  70. package/dist/src/appointments/chat-components/AppointmentListTable.vue.d.ts +3 -0
  71. package/dist/src/appointments/index.d.ts +93 -3
  72. package/dist/src/appointments/reservation-summary.d.ts +48 -0
  73. package/dist/src/appointments/server.d.ts +1 -0
  74. package/dist/src/appointments/tools.d.ts +93 -3
  75. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Container.d.ts +1 -1
  76. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Row.d.ts +7 -0
  77. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Stack.d.ts +7 -0
  78. package/dist/src/contentManager/components/content-editor/tiptap-extensions/helpers/resizeHistory.d.ts +9 -0
  79. package/dist/src/contentManager/components/content-editor/tiptap-menus/ElementEditorMenu.vue.d.ts +3 -1
  80. package/dist/src/filezone/config.d.ts +31 -0
  81. package/dist/src/filezone/index.d.ts +43 -0
  82. package/dist/src/filezone/index.vue.d.ts +2 -0
  83. package/dist/src/filezone/metadata.d.ts +2 -0
  84. package/dist/src/filezone/pages/Overview.vue.d.ts +4 -0
  85. package/dist/src/filezone/permissions.d.ts +5 -0
  86. package/dist/src/filezone/routes.d.ts +5 -0
  87. package/dist/src/filezone/server.d.ts +36 -0
  88. package/dist/src/firebaseAuthManager/components/DeleteUserDialog.vue.d.ts +25 -0
  89. package/dist/src/firebaseAuthManager/components/ReasonActionDialog.vue.d.ts +23 -0
  90. package/dist/src/firebaseAuthManager/components/UserStatusBadge.vue.d.ts +5 -0
  91. package/dist/src/firebaseAuthManager/config.d.ts +151 -0
  92. package/dist/src/firebaseAuthManager/index.d.ts +163 -0
  93. package/dist/src/firebaseAuthManager/index.vue.d.ts +14 -0
  94. package/dist/src/firebaseAuthManager/metadata.d.ts +2 -0
  95. package/dist/src/firebaseAuthManager/pages/Overview.vue.d.ts +2 -0
  96. package/dist/src/firebaseAuthManager/pages/UserDetail.vue.d.ts +2 -0
  97. package/dist/src/firebaseAuthManager/permissions.d.ts +5 -0
  98. package/dist/src/firebaseAuthManager/routes.d.ts +5 -0
  99. package/dist/src/firebaseAuthManager/server.d.ts +162 -0
  100. package/dist/src/firebaseAuthManager/types.d.ts +84 -0
  101. package/dist/src/formBuilder/components/FormPreviewDialog.vue.d.ts +12 -0
  102. package/dist/src/formBuilder/components/FormStatusBadge.vue.d.ts +9 -0
  103. package/dist/src/formBuilder/config.d.ts +31 -0
  104. package/dist/src/formBuilder/index.d.ts +44 -0
  105. package/dist/src/formBuilder/index.vue.d.ts +14 -0
  106. package/dist/src/formBuilder/lib/forms.d.ts +11 -0
  107. package/dist/src/formBuilder/metadata.d.ts +2 -0
  108. package/dist/src/formBuilder/pages/Editor.vue.d.ts +2 -0
  109. package/dist/src/formBuilder/pages/Overview.vue.d.ts +2 -0
  110. package/dist/src/formBuilder/permissions.d.ts +5 -0
  111. package/dist/src/formBuilder/routes.d.ts +5 -0
  112. package/dist/src/formBuilder/server.d.ts +87 -0
  113. package/dist/src/formBuilder/tools.d.ts +1 -0
  114. package/dist/src/formBuilder/types.d.ts +46 -0
  115. package/dist/src/helpbot/composables/useHelpbotApi.d.ts +18 -0
  116. package/dist/src/helpbot/config.d.ts +17 -0
  117. package/dist/src/helpbot/index.d.ts +29 -0
  118. package/dist/src/helpbot/index.vue.d.ts +2 -0
  119. package/dist/src/helpbot/metadata.d.ts +2 -0
  120. package/dist/src/helpbot/pages/Knowledge.vue.d.ts +4 -0
  121. package/dist/src/helpbot/pages/Overview.vue.d.ts +2 -0
  122. package/dist/src/helpbot/pages/Test.vue.d.ts +4 -0
  123. package/dist/src/helpbot/permissions.d.ts +5 -0
  124. package/dist/src/helpbot/routes.d.ts +5 -0
  125. package/dist/src/helpbot/types.d.ts +42 -0
  126. package/dist/src/index.d.ts +5 -0
  127. package/dist/src/mailTemplates/builder-types.d.ts +40 -0
  128. package/dist/src/mailTemplates/components/BlockRenderer.vue.d.ts +24 -0
  129. package/dist/src/mailTemplates/components/DesignPanel.vue.d.ts +13 -0
  130. package/dist/src/mailTemplates/components/EmailCanvas.vue.d.ts +44 -0
  131. package/dist/src/mailTemplates/components/RichTextEditor.vue.d.ts +10 -0
  132. package/dist/src/mailTemplates/components/RightSidebar.vue.d.ts +18 -0
  133. package/dist/src/mailTemplates/components/SettingsPanel.vue.d.ts +15 -0
  134. package/dist/src/mailTemplates/components/TemplateBuilder.vue.d.ts +2 -0
  135. package/dist/src/mailTemplates/components/TemplateList.vue.d.ts +19 -1
  136. package/dist/src/mailTemplates/components/rich-text.d.ts +6 -0
  137. package/dist/src/mailTemplates/config.d.ts +10 -4
  138. package/dist/src/mailTemplates/defaults.d.ts +10 -0
  139. package/dist/src/mailTemplates/editor-state.d.ts +21 -0
  140. package/dist/src/mailTemplates/index.d.ts +11 -5
  141. package/dist/src/mailTemplates/index.vue.d.ts +2 -4
  142. package/dist/src/mailTemplates/metadata.d.ts +1 -1
  143. package/dist/src/mailTemplates/pages/Detail.vue.d.ts +1 -13
  144. package/dist/src/mailTemplates/pages/Overview.vue.d.ts +1 -13
  145. package/dist/src/mailTemplates/server.d.ts +23 -0
  146. package/dist/src/server-handlers.d.ts +6 -0
  147. package/dist/src/table/badge-filter-utils.d.ts +8 -0
  148. package/dist/src/table/chat-components/TableOverviewCard.vue.d.ts +2 -7
  149. package/dist/src/table/chat-components/TableResultView.vue.d.ts +3 -7
  150. package/dist/src/table/components/TableDisplayCell.vue.d.ts +8 -0
  151. package/dist/src/table/components/columns/BadgeColumnSettings.vue.d.ts +9 -0
  152. package/dist/src/table/components/columns/ColumnColorSelect.vue.d.ts +11 -0
  153. package/dist/src/table/components/columns/ColumnDisplaySettings.vue.d.ts +9 -0
  154. package/dist/src/table/components/columns/ColumnTypeSelect.vue.d.ts +11 -0
  155. package/dist/src/table/components/columns/ColumnValueSourceInput.vue.d.ts +15 -0
  156. package/dist/src/table/components/columns/DialogTableColumnItem.vue.d.ts +8 -11
  157. package/dist/src/table/components/columns/ProgressColumnSettings.vue.d.ts +8 -0
  158. package/dist/src/table/components/stats/StatDialog.vue.d.ts +6 -10
  159. package/dist/src/table/components/stats/Stats.vue.d.ts +9 -15
  160. package/dist/src/table/composables/useTableClock.d.ts +4 -0
  161. package/dist/src/table/display-utils.d.ts +35 -0
  162. package/dist/src/table/row-value.d.ts +1 -0
  163. package/dist/src/table/stat-utils.d.ts +9 -0
  164. package/dist/src/table/tool-utils.d.ts +1 -1
  165. package/dist/src/table/types.d.ts +54 -1
  166. package/dist/src/whatsappBusiness/analytics.d.ts +4 -0
  167. package/dist/src/whatsappBusiness/components/AccountPanel.vue.d.ts +2 -0
  168. package/dist/src/whatsappBusiness/components/InsightsPanel.vue.d.ts +5 -0
  169. package/dist/src/whatsappBusiness/components/TemplateDialog.vue.d.ts +14 -0
  170. package/dist/src/whatsappBusiness/components/TemplatesPanel.vue.d.ts +5 -0
  171. package/dist/src/whatsappBusiness/components/presentation.d.ts +4 -0
  172. package/dist/src/whatsappBusiness/config.d.ts +51 -0
  173. package/dist/src/whatsappBusiness/connection.d.ts +77 -0
  174. package/dist/src/whatsappBusiness/index.d.ts +63 -0
  175. package/dist/src/whatsappBusiness/index.vue.d.ts +5 -0
  176. package/dist/src/whatsappBusiness/metadata.d.ts +2 -0
  177. package/dist/src/whatsappBusiness/pages/Overview.vue.d.ts +2 -0
  178. package/dist/src/whatsappBusiness/permissions.d.ts +5 -0
  179. package/dist/src/whatsappBusiness/provider.d.ts +21 -0
  180. package/dist/src/whatsappBusiness/routes.d.ts +5 -0
  181. package/dist/src/whatsappBusiness/server.d.ts +14 -0
  182. package/dist/src/whatsappBusiness/templates.d.ts +94 -0
  183. package/dist/src/whatsappBusiness/types.d.ts +162 -0
  184. package/dist/{tool-sandbox-DoF1PsyS.js → tool-sandbox-BSkKdH7V.js} +1 -1
  185. package/dist/{tool-sandbox-DdkMLkDK.mjs → tool-sandbox-DU9b1B7v.mjs} +1 -1
  186. package/dist/types-9N-DKxNj.mjs +250 -0
  187. package/dist/types-B5MifmeF.mjs +2696 -0
  188. package/dist/types-Cem0vPo_.js +1 -0
  189. package/dist/types-D5dgTskW.js +1 -0
  190. package/dist/useHelpbotApi-BIIungOh.js +1 -0
  191. package/dist/useHelpbotApi-HC9JSiSn.mjs +229 -0
  192. package/dist/{useTableAgentTools-D5mzGf3A.js → useTableAgentTools-BrUot49I.js} +1 -1
  193. package/dist/{useTableAgentTools-DcN3kYRL.mjs → useTableAgentTools-r5InEI4p.mjs} +8 -8
  194. package/dist/vee-validate-zod-CWZwNTWE.js +1 -0
  195. package/dist/vee-validate-zod-D0WaDgDZ.mjs +1780 -0
  196. package/package.json +2 -2
  197. package/src/appointments/tools.ts +52 -2
  198. package/src/formBuilder/tools.ts +1 -0
  199. package/dist/AppointmentListTable-DZJNmTMb.mjs +0 -177
  200. package/dist/AppointmentListTable-Dieu9US_.js +0 -1
  201. package/dist/ContentEditor-C-Wm48ai.js +0 -467
  202. package/dist/Detail-BCUUNWvp.js +0 -1
  203. package/dist/Detail-Byk781b4.mjs +0 -26
  204. package/dist/Detail-DGg_xXZc.js +0 -1
  205. package/dist/Detail-Sc2qZdxj.js +0 -1
  206. package/dist/Detail-mvSGbnFU.js +0 -1
  207. package/dist/Overview-BDlBCUI_.js +0 -1
  208. package/dist/Overview-Su8ZUbMs.mjs +0 -26
  209. package/dist/TableDataWidget-7qvC3Egd.js +0 -1
  210. package/dist/TableDataWidget-DMTSoGRO.mjs +0 -121
  211. package/dist/TableOverviewCard-AFq-puJs.js +0 -1
  212. package/dist/TableResultView.vue_vue_type_script_setup_true_lang-CBn-Oxl9.mjs +0 -534
  213. package/dist/TableResultView.vue_vue_type_script_setup_true_lang-C_Lv-SmJ.js +0 -1
  214. package/dist/TableRowActionCard-IzB6tNN-.js +0 -1
  215. package/dist/TableView-BkwoKREo.js +0 -4
  216. package/dist/TableView-C4Zyp8d7.mjs +0 -8228
  217. package/dist/TemplateList.vue_vue_type_script_setup_true_lang-B_AtWnHa.js +0 -1
  218. package/dist/TemplateList.vue_vue_type_script_setup_true_lang-Cmovy7kk.mjs +0 -40
  219. package/dist/dateRangePresets-B-l5b_wR.mjs +0 -48
  220. package/dist/dateRangePresets-CPWqst_x.js +0 -1
  221. package/dist/orders-DUa2PVoa.js +0 -1
  222. package/dist/vee-validate-zod-SjDT8X35.mjs +0 -4404
  223. package/dist/vee-validate-zod-VCmLnrtQ.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneclick.dev/cms-core-modules",
3
- "version": "0.0.123",
3
+ "version": "0.0.125",
4
4
  "main": "dist/index.cjs.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",
@@ -28,7 +28,7 @@
28
28
  "peerDependencies": {
29
29
  "@formkit/drag-and-drop": "^0.5.3",
30
30
  "@internationalized/date": "^3.8.0",
31
- "@oneclick.dev/cms-kit": "0.0.144",
31
+ "@oneclick.dev/cms-kit": "0.0.151",
32
32
  "@tanstack/vue-table": "^8.21.3",
33
33
  "@vee-validate/zod": "^4.15.0",
34
34
  "@vue-flow/core": "^1.48.1",
@@ -27,7 +27,7 @@ export const tools = [
27
27
  },
28
28
  {
29
29
  name: "getRecentAppointments",
30
- description: 'Show a table in chat with recent appointments, default loading the latest 20 appointments.',
30
+ description: 'Show a table of recent appointments only when the user explicitly asks for recent or latest bookings. Defaults to the latest 20 orders. For reservation counts, totals, or questions about a specific day or period, use getReservationSummary instead.',
31
31
  executionMode: 'component',
32
32
  chatComponent: 'AppointmentListTable',
33
33
  parameters: {
@@ -49,6 +49,56 @@ export const tools = [
49
49
  ]
50
50
  }
51
51
  },
52
+ {
53
+ name: 'getReservationSummary',
54
+ description: 'Show matching reservations in a chat table and answer how many reservations, bookings, orders, or spots there are on a date or during a period. Counts by reservation date, including reservations booked long ago. Returns full totals, a daily breakdown, and a page of matching appointments with customer details, orderId and reservationId for follow-up questions. The table is already displayed; give the requested conclusion without repeating every row. Totals cover all matches, not just the displayed page. If pagination.hasMore is true, use pagination.nextOffset and the returned absolute startDate/endDate to retrieve more rows with the same filters. Pass today, tomorrow, or yesterday literally on the initial request so the server resolves the project timezone. Default: confirmed orders, excluding cancelled/rejected reservations. Distinguish reservationCount, orderCount, and spotCount in your answer. For cancelled/rejected reservations across all orders, set orderStatus to all and reservationStatus to the requested status.',
55
+ executionMode: 'api',
56
+ chatComponent: 'AppointmentListTable',
57
+ parameters: {
58
+ type: 'object',
59
+ additionalProperties: false,
60
+ properties: {
61
+ startDate: {
62
+ type: 'string',
63
+ description: 'Inclusive reservation date: YYYY-MM-DD, today, tomorrow, or yesterday. For one day, provide only startDate.',
64
+ },
65
+ endDate: {
66
+ type: 'string',
67
+ description: 'Inclusive last reservation date: YYYY-MM-DD, today, tomorrow, or yesterday. Defaults to startDate.',
68
+ },
69
+ agendaId: {
70
+ type: 'string',
71
+ description: 'Optional agenda ID to restrict the count. Use listAgendas to find IDs. Omit to include all agendas in this module.',
72
+ },
73
+ orderStatus: {
74
+ type: 'string',
75
+ enum: ['confirmed', 'pending', 'cancelled', 'all'],
76
+ default: 'confirmed',
77
+ description: 'Order status to include. Defaults to confirmed. Use all when the question explicitly includes all order statuses.',
78
+ },
79
+ reservationStatus: {
80
+ type: 'string',
81
+ enum: ['active', 'approved', 'needs_approval', 'cancelled', 'rejected', 'all'],
82
+ default: 'active',
83
+ description: 'Reservation status to include. Active excludes cancelled and rejected reservations. All includes every reservation status within the selected order status.',
84
+ },
85
+ limit: {
86
+ type: 'integer',
87
+ minimum: 1,
88
+ maximum: 200,
89
+ default: 100,
90
+ description: 'Maximum reservation rows to show in this table, from 1 to 200. Totals always include every matching reservation.',
91
+ },
92
+ offset: {
93
+ type: 'integer',
94
+ minimum: 0,
95
+ default: 0,
96
+ description: 'Number of matching rows to skip. For the next page use pagination.nextOffset from the preceding result, keeping its absolute dates and filters.',
97
+ },
98
+ },
99
+ required: ['startDate'],
100
+ },
101
+ },
52
102
  {
53
103
  name: "changeAppointmentDetails",
54
104
  description: 'Show a card in chat where user can edit name, email and date of an existing appointment.',
@@ -100,4 +150,4 @@ export const tools = [
100
150
  ]
101
151
  }
102
152
  }
103
- ]
153
+ ]
@@ -0,0 +1 @@
1
+ export const tools: any[] = []
@@ -1,177 +0,0 @@
1
- import { defineComponent as A, computed as L, ref as x, onMounted as j, resolveComponent as D, openBlock as d, createElementBlock as i, unref as o, createVNode as m, createElementVNode as t, toDisplayString as n, Fragment as P, renderList as z, normalizeClass as E, withCtx as F, createTextVNode as V } from "vue";
2
- import { Loader2 as q, CalendarDays as M, ExternalLink as B } from "lucide-vue-next";
3
- const R = { class: "w-full" }, U = {
4
- key: 0,
5
- class: "flex items-center gap-2 py-3"
6
- }, S = {
7
- key: 1,
8
- class: "text-xs text-destructive py-2"
9
- }, G = {
10
- key: 2,
11
- class: "rounded-xl border bg-background p-4 text-center"
12
- }, H = {
13
- key: 3,
14
- class: "rounded-xl border bg-background overflow-hidden"
15
- }, J = { class: "overflow-x-auto" }, K = { class: "w-full text-xs" }, O = { class: "px-3 py-2" }, Q = { class: "font-medium truncate max-w-[160px]" }, W = { class: "text-muted-foreground truncate max-w-[160px]" }, X = { class: "px-3 py-2 whitespace-nowrap" }, Y = { class: "px-3 py-2 whitespace-nowrap" }, Z = { class: "px-3 py-2 text-center" }, ee = { class: "px-3 py-2" }, te = { class: "px-3 py-2 text-right font-medium whitespace-nowrap" }, se = { class: "px-3 py-2 border-t bg-muted/20 flex items-center justify-between" }, re = { class: "text-xs text-muted-foreground" }, ae = /* @__PURE__ */ A({
16
- __name: "AppointmentListTable",
17
- props: {
18
- toolName: {},
19
- instanceId: {},
20
- instanceName: {},
21
- moduleType: {},
22
- resolvedArgs: {},
23
- status: {}
24
- },
25
- emits: ["submit"],
26
- setup(f, { emit: b }) {
27
- const { $useRoute: h, $useModuleApi: v } = useNuxtApp(), u = f, y = b, _ = h(), k = L(() => _.params.slug), w = v(u.instanceId), p = x(!0), l = x(null), a = x([]);
28
- async function I() {
29
- const r = u.resolvedArgs?.quantity || 20, s = u.resolvedArgs?.status || "confirmed";
30
- p.value = !0, l.value = null;
31
- try {
32
- const c = await w.get(`/appointments?quantity=${r}&status=${s}`);
33
- a.value = c.appointments || [], g({
34
- count: a.value.length,
35
- appointments: a.value.map((e) => ({
36
- orderId: e.orderId,
37
- reservationId: e.reservationId,
38
- customerName: `${e.customerInfo?.firstName || ""} ${e.customerInfo?.lastName || ""}`.trim(),
39
- email: e.customerInfo?.email,
40
- date: e.date,
41
- startTime: e.startTime,
42
- endTime: e.endTime,
43
- spots: e.spots,
44
- status: e.reservationStatus || e.status,
45
- price: e.reservationPrice
46
- }))
47
- });
48
- } catch (c) {
49
- l.value = c?.data?.statusMessage || c?.message || "Failed to load appointments", g(`Error loading appointments: ${l.value}`);
50
- } finally {
51
- p.value = !1;
52
- }
53
- }
54
- j(() => {
55
- I();
56
- });
57
- function g(r) {
58
- u.status !== "completed" && y("submit", r);
59
- }
60
- const N = (r, s) => {
61
- if (s !== "confirmed")
62
- switch (s) {
63
- case "pending":
64
- return "text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-900/20";
65
- case "cancelled":
66
- return "text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20";
67
- default:
68
- return "text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20";
69
- }
70
- switch (r || s) {
71
- case "approved":
72
- return "text-emerald-600 dark:text-emerald-400 bg-emerald-50 dark:bg-emerald-900/20";
73
- case "needs_approval":
74
- return "text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20";
75
- case "rejected":
76
- case "cancelled":
77
- return "text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20";
78
- default:
79
- return "text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-900/20";
80
- }
81
- }, C = (r, s) => {
82
- if (s !== "confirmed")
83
- switch (s) {
84
- case "pending":
85
- return "Pending";
86
- case "cancelled":
87
- return "Cancelled";
88
- default:
89
- return s || "Unknown";
90
- }
91
- switch (r || s) {
92
- case "approved":
93
- return "Approved";
94
- case "needs_approval":
95
- return "Needs Approval";
96
- case "rejected":
97
- return "Rejected";
98
- case "cancelled":
99
- return "Cancelled";
100
- case "confirmed":
101
- return "Confirmed";
102
- default:
103
- return r || s || "Pending";
104
- }
105
- }, T = (r) => r == null ? "—" : `€${r.toFixed(2)}`, $ = (r) => {
106
- if (!r) return "—";
107
- try {
108
- return new Date(r).toLocaleDateString("en-US", { weekday: "short", month: "short", day: "numeric" });
109
- } catch {
110
- return r;
111
- }
112
- };
113
- return (r, s) => {
114
- const c = D("NuxtLink");
115
- return d(), i("div", R, [
116
- o(p) ? (d(), i("div", U, [
117
- m(o(q), { class: "size-4 animate-spin text-muted-foreground" }),
118
- s[0] || (s[0] = t("span", { class: "text-xs text-muted-foreground" }, "Loading appointments…", -1))
119
- ])) : o(l) ? (d(), i("div", S, n(o(l)), 1)) : o(a).length === 0 ? (d(), i("div", G, [
120
- m(o(M), { class: "size-8 text-muted-foreground mx-auto mb-2" }),
121
- s[1] || (s[1] = t("p", { class: "text-sm text-muted-foreground" }, "No recent appointments found.", -1))
122
- ])) : (d(), i("div", H, [
123
- t("div", J, [
124
- t("table", K, [
125
- s[2] || (s[2] = t("thead", null, [
126
- t("tr", { class: "border-b bg-muted/40" }, [
127
- t("th", { class: "text-left px-3 py-2 font-medium text-muted-foreground" }, "Customer"),
128
- t("th", { class: "text-left px-3 py-2 font-medium text-muted-foreground" }, "Date"),
129
- t("th", { class: "text-left px-3 py-2 font-medium text-muted-foreground" }, "Time"),
130
- t("th", { class: "text-center px-3 py-2 font-medium text-muted-foreground" }, "Spots"),
131
- t("th", { class: "text-left px-3 py-2 font-medium text-muted-foreground" }, "Status"),
132
- t("th", { class: "text-right px-3 py-2 font-medium text-muted-foreground" }, "Price")
133
- ])
134
- ], -1)),
135
- t("tbody", null, [
136
- (d(!0), i(P, null, z(o(a), (e) => (d(), i("tr", {
137
- key: e.reservationId || e.orderId,
138
- class: "border-b last:border-b-0 hover:bg-muted/30 transition-colors"
139
- }, [
140
- t("td", O, [
141
- t("div", Q, n(e.customerInfo?.firstName) + " " + n(e.customerInfo?.lastName), 1),
142
- t("div", W, n(e.customerInfo?.email), 1)
143
- ]),
144
- t("td", X, n($(e.date)), 1),
145
- t("td", Y, n(e.startTime) + " – " + n(e.endTime), 1),
146
- t("td", Z, n(e.spots || 1), 1),
147
- t("td", ee, [
148
- t("span", {
149
- class: E(["inline-block text-[10px] font-medium px-1.5 py-0.5 rounded-full uppercase whitespace-nowrap", N(e.reservationStatus, e.status)])
150
- }, n(C(e.reservationStatus, e.status)), 3)
151
- ]),
152
- t("td", te, n(T(e.reservationPrice)), 1)
153
- ]))), 128))
154
- ])
155
- ])
156
- ]),
157
- t("div", se, [
158
- t("span", re, n(o(a).length) + " appointment" + n(o(a).length === 1 ? "" : "s"), 1),
159
- m(c, {
160
- to: `/projects/${o(k)}/modules/${f.instanceId}`,
161
- class: "inline-flex items-center gap-1.5 text-xs text-primary hover:underline"
162
- }, {
163
- default: F(() => [
164
- m(o(B), { class: "size-3" }),
165
- s[3] || (s[3] = V(" View all ", -1))
166
- ]),
167
- _: 1
168
- }, 8, ["to"])
169
- ])
170
- ]))
171
- ]);
172
- };
173
- }
174
- });
175
- export {
176
- ae as default
177
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("lucide-vue-next"),E={class:"w-full"},V={key:0,class:"flex items-center gap-2 py-3"},w={key:1,class:"text-xs text-destructive py-2"},D={key:2,class:"rounded-xl border bg-background p-4 text-center"},I={key:3,class:"rounded-xl border bg-background overflow-hidden"},B={class:"overflow-x-auto"},S={class:"w-full text-xs"},T={class:"px-3 py-2"},C={class:"font-medium truncate max-w-[160px]"},$={class:"text-muted-foreground truncate max-w-[160px]"},A={class:"px-3 py-2 whitespace-nowrap"},L={class:"px-3 py-2 whitespace-nowrap"},j={class:"px-3 py-2 text-center"},P={class:"px-3 py-2"},q={class:"px-3 py-2 text-right font-medium whitespace-nowrap"},z={class:"px-3 py-2 border-t bg-muted/20 flex items-center justify-between"},F={class:"text-xs text-muted-foreground"},M=e.defineComponent({__name:"AppointmentListTable",props:{toolName:{},instanceId:{},instanceName:{},moduleType:{},resolvedArgs:{},status:{}},emits:["submit"],setup(i,{emit:m}){const{$useRoute:p,$useModuleApi:x}=useNuxtApp(),d=i,f=m,g=p(),b=e.computed(()=>g.params.slug),y=x(d.instanceId),l=e.ref(!0),a=e.ref(null),o=e.ref([]);async function N(){const n=d.resolvedArgs?.quantity||20,r=d.resolvedArgs?.status||"confirmed";l.value=!0,a.value=null;try{const s=await y.get(`/appointments?quantity=${n}&status=${r}`);o.value=s.appointments||[],u({count:o.value.length,appointments:o.value.map(t=>({orderId:t.orderId,reservationId:t.reservationId,customerName:`${t.customerInfo?.firstName||""} ${t.customerInfo?.lastName||""}`.trim(),email:t.customerInfo?.email,date:t.date,startTime:t.startTime,endTime:t.endTime,spots:t.spots,status:t.reservationStatus||t.status,price:t.reservationPrice}))})}catch(s){a.value=s?.data?.statusMessage||s?.message||"Failed to load appointments",u(`Error loading appointments: ${a.value}`)}finally{l.value=!1}}e.onMounted(()=>{N()});function u(n){d.status!=="completed"&&f("submit",n)}const h=(n,r)=>{if(r!=="confirmed")switch(r){case"pending":return"text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-900/20";case"cancelled":return"text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20";default:return"text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20"}switch(n||r){case"approved":return"text-emerald-600 dark:text-emerald-400 bg-emerald-50 dark:bg-emerald-900/20";case"needs_approval":return"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20";case"rejected":case"cancelled":return"text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20";default:return"text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-900/20"}},k=(n,r)=>{if(r!=="confirmed")switch(r){case"pending":return"Pending";case"cancelled":return"Cancelled";default:return r||"Unknown"}switch(n||r){case"approved":return"Approved";case"needs_approval":return"Needs Approval";case"rejected":return"Rejected";case"cancelled":return"Cancelled";case"confirmed":return"Confirmed";default:return n||r||"Pending"}},v=n=>n==null?"—":`€${n.toFixed(2)}`,_=n=>{if(!n)return"—";try{return new Date(n).toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"})}catch{return n}};return(n,r)=>{const s=e.resolveComponent("NuxtLink");return e.openBlock(),e.createElementBlock("div",E,[e.unref(l)?(e.openBlock(),e.createElementBlock("div",V,[e.createVNode(e.unref(c.Loader2),{class:"size-4 animate-spin text-muted-foreground"}),r[0]||(r[0]=e.createElementVNode("span",{class:"text-xs text-muted-foreground"},"Loading appointments…",-1))])):e.unref(a)?(e.openBlock(),e.createElementBlock("div",w,e.toDisplayString(e.unref(a)),1)):e.unref(o).length===0?(e.openBlock(),e.createElementBlock("div",D,[e.createVNode(e.unref(c.CalendarDays),{class:"size-8 text-muted-foreground mx-auto mb-2"}),r[1]||(r[1]=e.createElementVNode("p",{class:"text-sm text-muted-foreground"},"No recent appointments found.",-1))])):(e.openBlock(),e.createElementBlock("div",I,[e.createElementVNode("div",B,[e.createElementVNode("table",S,[r[2]||(r[2]=e.createElementVNode("thead",null,[e.createElementVNode("tr",{class:"border-b bg-muted/40"},[e.createElementVNode("th",{class:"text-left px-3 py-2 font-medium text-muted-foreground"},"Customer"),e.createElementVNode("th",{class:"text-left px-3 py-2 font-medium text-muted-foreground"},"Date"),e.createElementVNode("th",{class:"text-left px-3 py-2 font-medium text-muted-foreground"},"Time"),e.createElementVNode("th",{class:"text-center px-3 py-2 font-medium text-muted-foreground"},"Spots"),e.createElementVNode("th",{class:"text-left px-3 py-2 font-medium text-muted-foreground"},"Status"),e.createElementVNode("th",{class:"text-right px-3 py-2 font-medium text-muted-foreground"},"Price")])],-1)),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o),t=>(e.openBlock(),e.createElementBlock("tr",{key:t.reservationId||t.orderId,class:"border-b last:border-b-0 hover:bg-muted/30 transition-colors"},[e.createElementVNode("td",T,[e.createElementVNode("div",C,e.toDisplayString(t.customerInfo?.firstName)+" "+e.toDisplayString(t.customerInfo?.lastName),1),e.createElementVNode("div",$,e.toDisplayString(t.customerInfo?.email),1)]),e.createElementVNode("td",A,e.toDisplayString(_(t.date)),1),e.createElementVNode("td",L,e.toDisplayString(t.startTime)+" – "+e.toDisplayString(t.endTime),1),e.createElementVNode("td",j,e.toDisplayString(t.spots||1),1),e.createElementVNode("td",P,[e.createElementVNode("span",{class:e.normalizeClass(["inline-block text-[10px] font-medium px-1.5 py-0.5 rounded-full uppercase whitespace-nowrap",h(t.reservationStatus,t.status)])},e.toDisplayString(k(t.reservationStatus,t.status)),3)]),e.createElementVNode("td",q,e.toDisplayString(v(t.reservationPrice)),1)]))),128))])])]),e.createElementVNode("div",z,[e.createElementVNode("span",F,e.toDisplayString(e.unref(o).length)+" appointment"+e.toDisplayString(e.unref(o).length===1?"":"s"),1),e.createVNode(s,{to:`/projects/${e.unref(b)}/modules/${i.instanceId}`,class:"inline-flex items-center gap-1.5 text-xs text-primary hover:underline"},{default:e.withCtx(()=>[e.createVNode(e.unref(c.ExternalLink),{class:"size-3"}),r[3]||(r[3]=e.createTextVNode(" View all ",-1))]),_:1},8,["to"])])]))])}}});exports.default=M;