n8n-editor-ui 1.110.1 → 1.112.0

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 (137) hide show
  1. package/dist/assets/{AddDataStoreModal-D3j8deoq.css → AddDataStoreModal-B7jBhCjt.css} +5 -3
  2. package/dist/assets/{AddDataStoreModal-BXMe2_Yo.js → AddDataStoreModal-CLYFuWF4.js} +19 -9
  3. package/dist/assets/{AnimatedSpinner-CxbOZIWM.js → AnimatedSpinner-D7Nt5ZAz.js} +2 -1
  4. package/dist/assets/{AnnotationTagsDropdown.ee.vue_vue_type_script_setup_true_lang-D-tU5Nsg.js → AnnotationTagsDropdown.ee.vue_vue_type_script_setup_true_lang-BzK1dfc7.js} +2 -1
  5. package/dist/assets/{AuthView-ty01eojq.js → AuthView-Db8T18BU.js} +3 -2
  6. package/dist/assets/{ChangePasswordView-nmwMP1GF.js → ChangePasswordView-Clb7ta4t.js} +4 -3
  7. package/dist/assets/CollectionParameter-BGBoLgV2.js +5 -0
  8. package/dist/assets/{ConsumedTokensDetails.vue_vue_type_script_setup_true_lang-CSmXlf80.js → ConsumedTokensDetails.vue_vue_type_script_setup_true_lang-BG5somV-.js} +2 -1
  9. package/dist/assets/{CredentialsView-IHneFweR.js → CredentialsView-CydHAPfb.js} +11 -9
  10. package/dist/assets/{DataStoreActions.vue_vue_type_script_setup_true_lang-Dug6Q9SH.js → DataStoreActions.vue_vue_type_script_setup_true_lang-qftEof1u.js} +7 -2
  11. package/dist/assets/{DataStoreDetailsView-DSpK3R_L.css → DataStoreDetailsView-C8fMxukz.css} +103 -82
  12. package/dist/assets/{DataStoreDetailsView-BZ7cLl6L.js → DataStoreDetailsView-DZK3pYSP.js} +1271 -696
  13. package/dist/assets/{DataStoreView-CzuM5UmJ.js → DataStoreView-CT0OnFLR.js} +14 -29
  14. package/dist/assets/{DemoFooter-CTFaju55.js → DemoFooter-DHwNRr6t.js} +7 -6
  15. package/dist/assets/{EmptySharedSectionActionBox.vue_vue_type_script_setup_true_lang-DirQeoxa.js → EmptySharedSectionActionBox.vue_vue_type_script_setup_true_lang-Y97PdUKW.js} +2 -1
  16. package/dist/assets/{EntityNotFound-SgHEB5Zx.js → EntityNotFound-BDjIF_1D.js} +2 -1
  17. package/dist/assets/{EntityUnAuthorised-Ba1UjrRW.js → EntityUnAuthorised-Dz3DXm1-.js} +2 -1
  18. package/dist/assets/{ErrorView-DR_boVdR.js → ErrorView-BH0St5KC.js} +2 -1
  19. package/dist/assets/{EvaluationsRootView-DutxuCnH.js → EvaluationsRootView-CnJlr4OF.js} +2 -1
  20. package/dist/assets/{EvaluationsView-ClUUTcAC.js → EvaluationsView-DABp8z-m.js} +4 -3
  21. package/dist/assets/{ExecutionsTime.vue_vue_type_script_setup_true_lang-_0D6TWFX.js → ExecutionsTime.vue_vue_type_script_setup_true_lang-gCj_FZH6.js} +3 -2
  22. package/dist/assets/{ExecutionsView-gF8JMKIq.js → ExecutionsView-CivgrlFE.js} +14 -12
  23. package/dist/assets/{ExecutionsView-DpVZbkhT.css → ExecutionsView-GKNLT5Ec.css} +1 -1
  24. package/dist/assets/{FixedCollectionParameter-DTkvAml6.css → FixedCollectionParameter-Dg7ZadcB.css} +18 -18
  25. package/dist/assets/{FixedCollectionParameter-D9zye2vX.js → FixedCollectionParameter-l8xC6wRw.js} +7 -3
  26. package/dist/assets/{ForgotMyPasswordView-EkWEVktJ.js → ForgotMyPasswordView-WF87QWAH.js} +4 -3
  27. package/dist/assets/{InfoAccordion-u7XlbH6a.js → InfoAccordion-8iWJ2sSU.js} +2 -1
  28. package/dist/assets/{InsightsChartAverageRuntime-CoBgniUR.js → InsightsChartAverageRuntime-BEd6XJn6.js} +5 -4
  29. package/dist/assets/{InsightsChartFailed-Dn6SuM16.js → InsightsChartFailed-CVwzK3ch.js} +5 -4
  30. package/dist/assets/{InsightsChartFailureRate-CJl1j0ob.js → InsightsChartFailureRate-BeA77_lp.js} +5 -4
  31. package/dist/assets/{InsightsChartTimeSaved-B5DjojXI.js → InsightsChartTimeSaved-DkgR7j7U.js} +5 -4
  32. package/dist/assets/{InsightsChartTotal-T1SFp7S-.js → InsightsChartTotal--1QxzvAZ.js} +5 -4
  33. package/dist/assets/{InsightsDashboard-CCDahAm5.js → InsightsDashboard-cHCzH4ZY.js} +13 -11
  34. package/dist/assets/{InsightsPaywall-Cp82bMTp.js → InsightsPaywall-neQ9PmYP.js} +2 -1
  35. package/dist/assets/{InsightsSummary-I5vKNG0I.js → InsightsSummary-BekdjOxv.js} +4 -2
  36. package/dist/assets/{InsightsTableWorkflows-D1U89HJ4.js → InsightsTableWorkflows-LMO-UU8h.js} +5 -4
  37. package/dist/assets/{Logo-DHG_oEvt.js → Logo-DXNRuN8z.js} +2 -1
  38. package/dist/assets/{LogsPanel-CvmnM4bL.js → LogsPanel-2GQHQFmh.js} +38 -23
  39. package/dist/assets/{LogsPanel-BinqqXXh.css → LogsPanel-CUsQIBpC.css} +17 -17
  40. package/dist/assets/{MainHeader-pDg5KXTB.css → MainHeader-6lIHYgJG.css} +16 -16
  41. package/dist/assets/{MainHeader-CTxGLJsC.js → MainHeader-BlBek00C.js} +14 -13
  42. package/dist/assets/{MainSidebar-D_xwIVsL.js → MainSidebar-qdHg8D5V.js} +3 -2
  43. package/dist/assets/{NodeCreation-iNUuiza-.js → NodeCreation-DO5k3aK3.js} +4 -3
  44. package/dist/assets/{NodeCreator-DMpMHPcz.js → NodeCreator-C3Pmrqkh.js} +4 -6
  45. package/dist/assets/{NodeDetailsView-BKEGFeZ7.js → NodeDetailsView-BACft9ex.js} +18 -17
  46. package/dist/assets/{NodeDetailsView-CjdovDgq.css → NodeDetailsView-CBYV4Rrz.css} +11 -11
  47. package/dist/assets/{NodeDetailsViewV2-XPdbzrLu.js → NodeDetailsViewV2--1S2eK5u.js} +14 -13
  48. package/dist/assets/{NodeView-Bj14aKtm.js → NodeView-BRwQ5Cqs.js} +185 -113
  49. package/dist/assets/{NodeView-BRa11kAq.css → NodeView-Chs2u0U9.css} +70 -31
  50. package/dist/assets/{PageViewLayout--7SkYsc9.js → PageViewLayout-DldtilHz.js} +2 -1
  51. package/dist/assets/{PrebuiltAgentTemplatesView-B7fK6krA.js → PrebuiltAgentTemplatesView-ChyN8J2x.js} +3 -2
  52. package/dist/assets/{ProjectBreadcrumb-BxMwihEP.js → ProjectBreadcrumb-9uWmVmc7.js} +2 -1
  53. package/dist/assets/{ProjectHeader-CVfPUZNI.js → ProjectHeader-CWapIKXf.js} +93 -23
  54. package/dist/assets/{ProjectSettings-t9C-Ly49.js → ProjectSettings-BlYXGYRx.js} +5 -3
  55. package/dist/assets/{PushConnectionTracker.vue_vue_type_script_setup_true_lang-zVio8c2n.js → PushConnectionTracker.vue_vue_type_script_setup_true_lang-DjpouOrH.js} +2 -1
  56. package/dist/assets/{ResourcesListLayout-O-Z59wTE.js → ResourcesListLayout-CfDIFGjS.js} +7 -6
  57. package/dist/assets/{ResourcesListLayout-B5eMf4SI.css → ResourcesListLayout-vTwRIDRz.css} +8 -8
  58. package/dist/assets/{RunDataJson-0J6_FxmM.js → RunDataJson-CTm3-xdY.js} +4 -3
  59. package/dist/assets/{RunDataJsonActions-ZbUSwg32.js → RunDataJsonActions-B_yBOGYB.js} +2 -1
  60. package/dist/assets/{RunDataParsedAiContent-Byf4f3hM.js → RunDataParsedAiContent-Cg9vUI0v.js} +3 -2
  61. package/dist/assets/{RunDataSearch-CyCbN9Nc.js → RunDataSearch-DPt2MvbI.js} +2 -1
  62. package/dist/assets/{RunDataTable-Rj0zhULj.js → RunDataTable-DHVRSqQT.js} +2 -1
  63. package/dist/assets/{SamlOnboarding-UDfF4zGH.js → SamlOnboarding-CN_xGqen.js} +4 -3
  64. package/dist/assets/{SelectedItemsInfo-CfUb0ZrI.css → SelectedItemsInfo-Dl4uynXs.css} +5 -3
  65. package/dist/assets/{SelectedItemsInfo-64VntNmH.js → SelectedItemsInfo-DzoCyQOW.js} +12 -7
  66. package/dist/assets/{SettingsApiView-BMYiuOCY.js → SettingsApiView-BIKCRKGM.js} +2 -1
  67. package/dist/assets/{SettingsCommunityNodesView-BULfnkhp.js → SettingsCommunityNodesView-ClWYmDB8.js} +7 -4
  68. package/dist/assets/{SettingsExternalSecrets-DgYPNKtM.js → SettingsExternalSecrets-D58JxT3V.js} +2 -1
  69. package/dist/assets/{SettingsLdapView-B64PusRO.js → SettingsLdapView-uImCjvMm.js} +2 -1
  70. package/dist/assets/{SettingsLogStreamingView-DiDxOEmg.js → SettingsLogStreamingView-DUn62Yq4.js} +2 -1
  71. package/dist/assets/{SettingsPersonalView-TP__Drcl.js → SettingsPersonalView-DGiCMsXu.js} +2 -1
  72. package/dist/assets/{SettingsSourceControl-FiqxT6qx.js → SettingsSourceControl-CVik5czR.js} +2 -1
  73. package/dist/assets/{SettingsSso-e5ntwax1.js → SettingsSso-BQkWpsdO.js} +2 -1
  74. package/dist/assets/{SettingsUsageAndPlan-BiNhzaI3.js → SettingsUsageAndPlan-BuwgmEka.js} +2 -1
  75. package/dist/assets/{SettingsUsersView-g3odVDFj.js → SettingsUsersView-DCmtHeMa.js} +2 -1
  76. package/dist/assets/{SettingsView-5M3uETdg.js → SettingsView-CrBThv_a.js} +2 -1
  77. package/dist/assets/{SetupView-DOX9lfRU.js → SetupView-CES8Gnnv.js} +4 -3
  78. package/dist/assets/{SetupWorkflowCredentialsButton-DMIEMB5C.js → SetupWorkflowCredentialsButton-Bjhx_rck.js} +2 -1
  79. package/dist/assets/{SetupWorkflowFromTemplateView-DEJsN9PM.js → SetupWorkflowFromTemplateView-C8kmCc7J.js} +4 -3
  80. package/dist/assets/{SigninView-FKXG_00n.js → SigninView-24xKsh_S.js} +4 -3
  81. package/dist/assets/{SignoutView-ppJ6lbCU.js → SignoutView-DgFIUUyh.js} +2 -1
  82. package/dist/assets/{SignupView-CmcH1BYL.js → SignupView-BckB-uUh.js} +4 -3
  83. package/dist/assets/{TableBase-DBeBHkOY.js → TableBase-CQEzJfeN.js} +2 -1
  84. package/dist/assets/{Tags-CdXa3Xx9.js → Tags-DbX-5_Fk.js} +2 -2
  85. package/dist/assets/{TemplateDetails-BxvljQA3.js → TemplateDetails-BGraOFbY.js} +3 -2
  86. package/dist/assets/{TemplateList-CV9csLUI.js → TemplateList-5P1N08U1.js} +2 -1
  87. package/dist/assets/{TemplatesCollectionView-4dKgKAQR.js → TemplatesCollectionView-D2-SU0eR.js} +7 -7
  88. package/dist/assets/{TemplatesSearchView-taSkU7cY.js → TemplatesSearchView-ncBXTfOM.js} +4 -3
  89. package/dist/assets/{TemplatesView-CXSlz1M1.js → TemplatesView-DO7HuUts.js} +2 -1
  90. package/dist/assets/{TemplatesWorkflowView-C-x3Aov1.js → TemplatesWorkflowView-BvrjU4RD.js} +7 -7
  91. package/dist/assets/{TriggerPanel-C-c5cPsc.js → TriggerPanel-BFQ6veDz.js} +10 -8
  92. package/dist/assets/{VariablesView-Bh0OeH4s.css → VariablesView-BHcrNXsw.css} +6 -6
  93. package/dist/assets/{VariablesView-C3mX49G9.js → VariablesView-BVzruwEA.js} +17 -14
  94. package/dist/assets/{WorkerView-DYK4TcTw.js → WorkerView-DRM6mgWJ.js} +9 -6
  95. package/dist/assets/{WorkflowActivator-DZIgVvgL.js → WorkflowActivator-BOt1oNlm.js} +4 -3
  96. package/dist/assets/{WorkflowExecutionsInfoAccordion-CivRIQhL.js → WorkflowExecutionsInfoAccordion-BjZUTKcs.js} +3 -2
  97. package/dist/assets/{WorkflowExecutionsLandingPage-kBAMGqy2.js → WorkflowExecutionsLandingPage-ENKxL7Yh.js} +4 -3
  98. package/dist/assets/{WorkflowExecutionsPreview-Bnd5-B-d.js → WorkflowExecutionsPreview-Cdgg29u5.js} +5 -4
  99. package/dist/assets/{WorkflowExecutionsView-CIfisPDk.js → WorkflowExecutionsView-t3W7WuAy.js} +9 -9
  100. package/dist/assets/{WorkflowHistory-JXOUdJnK.js → WorkflowHistory--OLvuBs1.js} +3 -2
  101. package/dist/assets/{WorkflowOnboardingView-Dc1KYhGC.js → WorkflowOnboardingView-C8y96ur1.js} +2 -1
  102. package/dist/assets/{WorkflowPreview-BF9SI0vn.js → WorkflowPreview-C1XHoZmU.js} +2 -1
  103. package/dist/assets/{WorkflowsView-CTnvp65F.js → WorkflowsView-B9rxI0No.js} +272 -62
  104. package/dist/assets/{WorkflowsView-BuvoAeDm.css → WorkflowsView-MF9XcT0u.css} +186 -0
  105. package/dist/assets/{canvas-DbK7UyVG.js → canvas-D2PwiGnN.js} +1 -1
  106. package/dist/assets/{chartjs.utils-DIRvJRrn.js → chartjs.utils-B6sz8yOh.js} +2 -2
  107. package/dist/assets/{core-Br-UFy15.js → core-Be7WBA6o.js} +2 -1
  108. package/dist/assets/{en-DdNgUrpa.js → en-CJyn5rnO.js} +32 -25
  109. package/dist/assets/{global-link-actions--TiC75iP.js → global-link-actions-B9WsUojd.js} +1 -1
  110. package/dist/assets/index-4g2Akj0I.js +13861 -0
  111. package/dist/assets/{index-DXNU_2Fk.css → index-B7wrqKiF.css} +8207 -8184
  112. package/dist/assets/{index--OJ5nhDf.js → index-BJG79OsS.js} +326678 -342011
  113. package/dist/assets/{index-D2apwRup.js → index-LOlKxvn4.js} +2 -1
  114. package/dist/assets/loadDefaultEn-DNiURDi9.js +8 -0
  115. package/dist/assets/{pickBy-BljOBsPy.js → pickBy-BMn768eW.js} +1 -1
  116. package/dist/assets/{readyToRunWorkflows.store-Dhb8bhvk.js → readyToRunWorkflows.store-HSpbq3Bf.js} +2 -1
  117. package/dist/assets/readyToRunWorkflowsV2.store-DcRVIsRt.js +138 -0
  118. package/dist/assets/sqlite3-DBpDb1lf.wasm +0 -0
  119. package/dist/assets/sqlite3-opfs-async-proxy-CYRFPDln.js +579 -0
  120. package/dist/assets/sqlite3-worker1-bundler-friendly-DF3WqBKq.js +11289 -0
  121. package/dist/assets/{templateActions-B4GEcBXU.js → templateActions-DR_XHPc4.js} +1 -1
  122. package/dist/assets/{useBeforeUnload-ZtUpNFCu.js → useBeforeUnload-DmAaB1v5.js} +2 -1
  123. package/dist/assets/{useExecutionDebugging-Bve-aaKO.js → useExecutionDebugging-B8xDxcb6.js} +2 -1
  124. package/dist/assets/{useImportCurlCommand-CAuor9Pu.js → useImportCurlCommand-BaN8fxqM.js} +2 -1
  125. package/dist/assets/{useProjectPages-CH519D2j.js → useProjectPages-B-oTYbCo.js} +2 -1
  126. package/dist/assets/{usePushConnection-Db77V5LR.js → usePushConnection-Bcd2_XWM.js} +36 -22
  127. package/dist/assets/{useWorkflowActivate-7Rw9KyzM.js → useWorkflowActivate-BDE2t3MM.js} +2 -1
  128. package/dist/assets/worker-DZxlyUFA.js +11826 -0
  129. package/dist/index.html +4 -3
  130. package/index.html +1 -1
  131. package/package.json +1 -1
  132. package/vite/i18n-locales-hmr-helpers.ts +19 -0
  133. package/vite.config.mts +33 -6
  134. package/dist/assets/CollectionParameter-CQji5w8u.js +0 -4
  135. package/dist/assets/Tag-BQAJRKFE.js +0 -32
  136. package/dist/assets/Tag-Cg-Hqs2H.css +0 -153
  137. package/dist/assets/dataStore.store-HuymAG46.js +0 -288
@@ -1,8 +1,8 @@
1
- import { d as defineComponent, aG as useTemplateRef, b as useRouter, a as useToast, r as ref, x as computed, c as useI18n, a7 as watch, h as createElementBlock, g as openBlock, n as normalizeClass, i as createVNode, j as createBaseVNode, w as withCtx, t as toDisplayString, aH as InlineRename, l as unref, e as createBlock, f as createCommentVNode, gk as PROJECT_DATA_STORES, Y as nextTick, _ as _export_sfc, ef as mergeModels, c1 as toRefs, eg as useModel, o as onMounted, ez as getCurrentInstance, gI as markRaw, c7 as onUnmounted, gJ as mergeDefaults, eW as toRaw, gK as render, c0 as isRef, gL as isReactive, fW as isProxy, b2 as withDirectives, N as N8nIcon, b3 as vShow, aM as N8nActionDropdown, P as useDebounce, y as N8nPopoverReka, e5 as N8nInputLabel, cZ as N8nInput, b8 as withKeys, gM as MAX_COLUMN_NAME_LENGTH, p as N8nText, k as createTextVNode, a9 as Tooltip, e8 as N8nSelect, F as Fragment, A as renderList, e9 as _sfc_main$9, q as N8nButton, aa as _sfc_main$a, gN as COLUMN_NAME_REGEX, bd as DateTime, a8 as resolveComponent, ap as normalizeStyle, ca as useClipboard, bq as onClickOutside, gO as DATA_STORE_HEADER_HEIGHT, gP as DATA_STORE_ROW_HEIGHT, gQ as ADD_ROW_ROW_ID, gR as DEFAULT_ID_COLUMN_NAME, am as useMessage, an as MODAL_CONFIRM, gS as NULL_VALUE, gT as EMPTY_VALUE, eS as orderBy, gU as DATA_STORE_ID_COLUMN_WIDTH, ax as useDocumentTitle, gV as MIN_LOADING_TIME, dK as N8nLoading, dJ as _sfc_main$b, gW as DATA_STORE_VIEW } from "./index--OJ5nhDf.js";
2
- import { u as useDataStoreStore, r as reorderItem } from "./dataStore.store-HuymAG46.js";
3
- import { B as Breadcrumbs, _ as __unplugin_components_0 } from "./ProjectBreadcrumb-BxMwihEP.js";
4
- import { _ as _sfc_main$8 } from "./DataStoreActions.vue_vue_type_script_setup_true_lang-Dug6Q9SH.js";
5
- import { S as SelectedItemsInfo } from "./SelectedItemsInfo-64VntNmH.js";
1
+ import { fK as useDataStoreStore, b as useRouter, a as useToast, ah as InlineRename, fq as PROJECT_DATA_STORES, eb as telemetry, _ as _export_sfc, fO as render, fP as ResponseError, N as N8nIcon, az as vShow, am as N8nActionDropdown, fQ as LOOSE_DATE_REGEX, r as useDebounce, h as N8nPopoverReka, di as N8nInputLabel, cj as N8nInput, aE as withKeys, fR as MAX_COLUMN_NAME_LENGTH, d as N8nText, H as Tooltip, dl as N8nSelect, dm as _sfc_main$9, e as N8nButton, I as _sfc_main$a, fS as COLUMN_NAME_REGEX, fT as ADD_ROW_ROW_ID, fU as NULL_VALUE, fV as EMPTY_VALUE, aJ as DateTime, fW as NUMBER_WITH_SPACES_REGEX, fX as NUMBER_THOUSAND_SEPARATOR, fY as NUMBER_DECIMAL_SEPARATOR, bv as useClipboard, aW as onClickOutside, fZ as DEFAULT_ID_COLUMN_NAME, f_ as reorderItem, f$ as DEFAULT_COLUMN_WIDTH, e1 as orderBy, g0 as DATA_STORE_ID_COLUMN_WIDTH, Z as useMessage, $ as MODAL_CONFIRM, Y as useTelemetry, g1 as DATA_STORE_HEADER_HEIGHT, g2 as DATA_STORE_ROW_HEIGHT, a8 as useDocumentTitle, g3 as MIN_LOADING_TIME, cZ as N8nLoading, cY as _sfc_main$b, g4 as DATA_STORE_VIEW } from "./index-BJG79OsS.js";
2
+ import { o as defineComponent, bB as useTemplateRef, b8 as ref, a9 as computed, bT as useI18n, w as watch, ac as createElementBlock, b1 as openBlock, aQ as normalizeClass, k as createVNode, ad as createBaseVNode, bI as withCtx, bo as toDisplayString, u as unref, aa as createBlock, ab as createCommentVNode, n as nextTick, aO as mergeModels, bs as toRefs, by as useModel, r as onMounted, g as getCurrentInstance, aM as markRaw, s as onUnmounted, aN as mergeDefaults, Q as toRaw, aI as isRef, aG as isReactive, aF as isProxy, bK as withDirectives, bc as resolveComponent, aS as normalizeStyle, ah as createTextVNode, F as Fragment, ba as renderList } from "./index-4g2Akj0I.js";
3
+ import { B as Breadcrumbs, _ as __unplugin_components_0 } from "./ProjectBreadcrumb-9uWmVmc7.js";
4
+ import { _ as _sfc_main$8 } from "./DataStoreActions.vue_vue_type_script_setup_true_lang-qftEof1u.js";
5
+ import { S as SelectedItemsInfo } from "./SelectedItemsInfo-DzoCyQOW.js";
6
6
  const BREADCRUMBS_SEPARATOR = "/";
7
7
  const _sfc_main$7 = /* @__PURE__ */ defineComponent({
8
8
  __name: "DataStoreBreadcrumbs",
@@ -60,6 +60,10 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
60
60
  throw new Error(i18n.baseText("generic.unknownError"));
61
61
  }
62
62
  editableName.value = name;
63
+ telemetry.track("User renamed data table", {
64
+ data_table_id: props.dataStore.id,
65
+ data_table_project_id: props.dataStore.projectId
66
+ });
63
67
  } catch (error) {
64
68
  editableName.value = props.dataStore.name;
65
69
  toast.showError(error, i18n.baseText("dataStore.rename.error"));
@@ -126,12 +130,12 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
126
130
  };
127
131
  }
128
132
  });
129
- const separator = "_separator_12h50_132";
133
+ const separator = "_separator_1n6ua_133";
130
134
  const style0$2 = {
131
- "data-store-breadcrumbs": "_data-store-breadcrumbs_12h50_123",
132
- "data-store-actions": "_data-store-actions_12h50_128",
135
+ "data-store-breadcrumbs": "_data-store-breadcrumbs_1n6ua_123",
136
+ "data-store-actions": "_data-store-actions_1n6ua_128",
133
137
  separator,
134
- "breadcrumb-current": "_breadcrumb-current_12h50_138"
138
+ "breadcrumb-current": "_breadcrumb-current_1n6ua_139"
135
139
  };
136
140
  const cssModules$2 = {
137
141
  "$style": style0$2
@@ -3322,6 +3326,38 @@ function _applyColumnState(beans, params, source) {
3322
3326
  colAnimation?.finish();
3323
3327
  return unmatchedCount === 0;
3324
3328
  }
3329
+ function _resetColumnState(beans, source) {
3330
+ const { colModel, autoColSvc, selectionColSvc, eventSvc, gos } = beans;
3331
+ const primaryCols = colModel.getColDefCols();
3332
+ if (!primaryCols?.length) {
3333
+ return;
3334
+ }
3335
+ const primaryColumnTree = colModel.getColDefColTree();
3336
+ const primaryColumns = _getColumnsFromTree(primaryColumnTree);
3337
+ const columnStates = [];
3338
+ let letRowGroupIndex = 1e3;
3339
+ let letPivotIndex = 1e3;
3340
+ const addColState = (col) => {
3341
+ const stateItem = getColumnStateFromColDef(col);
3342
+ if (_missing(stateItem.rowGroupIndex) && stateItem.rowGroup) {
3343
+ stateItem.rowGroupIndex = letRowGroupIndex++;
3344
+ }
3345
+ if (_missing(stateItem.pivotIndex) && stateItem.pivot) {
3346
+ stateItem.pivotIndex = letPivotIndex++;
3347
+ }
3348
+ columnStates.push(stateItem);
3349
+ };
3350
+ autoColSvc?.getColumns()?.forEach(addColState);
3351
+ selectionColSvc?.getColumns()?.forEach(addColState);
3352
+ primaryColumns?.forEach(addColState);
3353
+ _applyColumnState(beans, { state: columnStates }, source);
3354
+ const autoCols = autoColSvc?.getColumns() ?? [];
3355
+ const selectionCols = selectionColSvc?.getColumns() ?? [];
3356
+ const orderedCols = [...selectionCols, ...autoCols, ...primaryCols];
3357
+ const orderedColState = orderedCols.map((col) => ({ colId: col.colId }));
3358
+ _applyColumnState(beans, { state: orderedColState, applyOrder: true }, source);
3359
+ eventSvc.dispatchEvent(_addGridCommonParams(gos, { type: "columnsReset", source }));
3360
+ }
3325
3361
  function _compareColumnStatesAndDispatchEvents(beans, source) {
3326
3362
  const { rowGroupColsSvc, pivotColsSvc, valueColsSvc, colModel, sortSvc, eventSvc } = beans;
3327
3363
  const startState = {
@@ -22054,6 +22090,176 @@ var SkeletonCellRendererModule = {
22054
22090
  agSkeletonCellRenderer: SkeletonCellRenderer
22055
22091
  }
22056
22092
  };
22093
+ function getColumnDef(beans, key) {
22094
+ const column = beans.colModel.getColDefCol(key);
22095
+ if (column) {
22096
+ return column.getColDef();
22097
+ }
22098
+ return null;
22099
+ }
22100
+ function getColumnDefs(beans) {
22101
+ return beans.colModel.getColumnDefs();
22102
+ }
22103
+ function getDisplayNameForColumn(beans, column, location) {
22104
+ return beans.colNames.getDisplayNameForColumn(column, location) || "";
22105
+ }
22106
+ function getColumn(beans, key) {
22107
+ return beans.colModel.getColDefCol(key);
22108
+ }
22109
+ function getColumns(beans) {
22110
+ return beans.colModel.getColDefCols();
22111
+ }
22112
+ function applyColumnState(beans, params) {
22113
+ return _applyColumnState(beans, params, "api");
22114
+ }
22115
+ function getColumnState(beans) {
22116
+ return _getColumnState(beans);
22117
+ }
22118
+ function resetColumnState(beans) {
22119
+ _resetColumnState(beans, "api");
22120
+ }
22121
+ function isPinning(beans) {
22122
+ return beans.visibleCols.isPinningLeft() || beans.visibleCols.isPinningRight();
22123
+ }
22124
+ function isPinningLeft(beans) {
22125
+ return beans.visibleCols.isPinningLeft();
22126
+ }
22127
+ function isPinningRight(beans) {
22128
+ return beans.visibleCols.isPinningRight();
22129
+ }
22130
+ function getDisplayedColAfter(beans, col) {
22131
+ return beans.visibleCols.getColAfter(col);
22132
+ }
22133
+ function getDisplayedColBefore(beans, col) {
22134
+ return beans.visibleCols.getColBefore(col);
22135
+ }
22136
+ function setColumnsVisible(beans, keys, visible) {
22137
+ beans.colModel.setColsVisible(keys, visible, "api");
22138
+ }
22139
+ function setColumnsPinned(beans, keys, pinned) {
22140
+ beans.pinnedCols?.setColsPinned(keys, pinned, "api");
22141
+ }
22142
+ function getAllGridColumns(beans) {
22143
+ return beans.colModel.getCols();
22144
+ }
22145
+ function getDisplayedLeftColumns(beans) {
22146
+ return beans.visibleCols.leftCols;
22147
+ }
22148
+ function getDisplayedCenterColumns(beans) {
22149
+ return beans.visibleCols.centerCols;
22150
+ }
22151
+ function getDisplayedRightColumns(beans) {
22152
+ return beans.visibleCols.rightCols;
22153
+ }
22154
+ function getAllDisplayedColumns(beans) {
22155
+ return beans.visibleCols.allCols;
22156
+ }
22157
+ function getAllDisplayedVirtualColumns(beans) {
22158
+ return beans.colViewport.getViewportColumns();
22159
+ }
22160
+ function _deepCloneDefinition(object, keysToSkip) {
22161
+ if (!object) {
22162
+ return;
22163
+ }
22164
+ const obj = object;
22165
+ const res = {};
22166
+ Object.keys(obj).forEach((key) => {
22167
+ if (keysToSkip && keysToSkip.indexOf(key) >= 0 || SKIP_JS_BUILTINS.has(key)) {
22168
+ return;
22169
+ }
22170
+ const value = obj[key];
22171
+ const sourceIsSimpleObject = typeof value === "object" && value !== null && value.constructor === Object;
22172
+ if (sourceIsSimpleObject) {
22173
+ res[key] = _deepCloneDefinition(value);
22174
+ } else {
22175
+ res[key] = value;
22176
+ }
22177
+ });
22178
+ return res;
22179
+ }
22180
+ var ColumnDefFactory = class extends BeanStub {
22181
+ constructor() {
22182
+ super(...arguments);
22183
+ this.beanName = "colDefFactory";
22184
+ }
22185
+ wireBeans(beans) {
22186
+ this.rowGroupColsSvc = beans.rowGroupColsSvc;
22187
+ this.pivotColsSvc = beans.pivotColsSvc;
22188
+ }
22189
+ getColumnDefs(colDefColsList, showingPivotResult, lastOrder, colsList) {
22190
+ const cols = colDefColsList.slice();
22191
+ if (showingPivotResult) {
22192
+ cols.sort((a, b) => lastOrder.indexOf(a) - lastOrder.indexOf(b));
22193
+ } else if (lastOrder) {
22194
+ cols.sort((a, b) => colsList.indexOf(a) - colsList.indexOf(b));
22195
+ }
22196
+ const rowGroupColumns = this.rowGroupColsSvc?.columns;
22197
+ const pivotColumns = this.pivotColsSvc?.columns;
22198
+ return this.buildColumnDefs(cols, rowGroupColumns, pivotColumns);
22199
+ }
22200
+ buildColumnDefs(cols, rowGroupColumns = [], pivotColumns = []) {
22201
+ const res = [];
22202
+ const colGroupDefs = {};
22203
+ cols.forEach((col) => {
22204
+ const colDef = this.createDefFromColumn(col, rowGroupColumns, pivotColumns);
22205
+ let addToResult = true;
22206
+ let childDef = colDef;
22207
+ let pointer = col.getOriginalParent();
22208
+ let lastPointer = null;
22209
+ while (pointer) {
22210
+ let parentDef = null;
22211
+ if (pointer.isPadding()) {
22212
+ pointer = pointer.getOriginalParent();
22213
+ continue;
22214
+ }
22215
+ const existingParentDef = colGroupDefs[pointer.getGroupId()];
22216
+ if (existingParentDef) {
22217
+ existingParentDef.children.push(childDef);
22218
+ addToResult = false;
22219
+ break;
22220
+ }
22221
+ parentDef = this.createDefFromGroup(pointer);
22222
+ if (parentDef) {
22223
+ parentDef.children = [childDef];
22224
+ colGroupDefs[parentDef.groupId] = parentDef;
22225
+ childDef = parentDef;
22226
+ pointer = pointer.getOriginalParent();
22227
+ }
22228
+ if (pointer != null && lastPointer === pointer) {
22229
+ addToResult = false;
22230
+ break;
22231
+ }
22232
+ lastPointer = pointer;
22233
+ }
22234
+ if (addToResult) {
22235
+ res.push(childDef);
22236
+ }
22237
+ });
22238
+ return res;
22239
+ }
22240
+ createDefFromGroup(group) {
22241
+ const defCloned = _deepCloneDefinition(group.getColGroupDef(), ["children"]);
22242
+ if (defCloned) {
22243
+ defCloned.groupId = group.getGroupId();
22244
+ }
22245
+ return defCloned;
22246
+ }
22247
+ createDefFromColumn(col, rowGroupColumns, pivotColumns) {
22248
+ const colDefCloned = _deepCloneDefinition(col.getColDef());
22249
+ colDefCloned.colId = col.getColId();
22250
+ colDefCloned.width = col.getActualWidth();
22251
+ colDefCloned.rowGroup = col.isRowGroupActive();
22252
+ colDefCloned.rowGroupIndex = col.isRowGroupActive() ? rowGroupColumns.indexOf(col) : null;
22253
+ colDefCloned.pivot = col.isPivotActive();
22254
+ colDefCloned.pivotIndex = col.isPivotActive() ? pivotColumns.indexOf(col) : null;
22255
+ colDefCloned.aggFunc = col.isValueActive() ? col.getAggFunc() : null;
22256
+ colDefCloned.hide = col.isVisible() ? void 0 : true;
22257
+ colDefCloned.pinned = col.isPinned() ? col.getPinned() : null;
22258
+ colDefCloned.sort = col.getSort() ? col.getSort() : null;
22259
+ colDefCloned.sortIndex = col.getSortIndex() != null ? col.getSortIndex() : null;
22260
+ return colDefCloned;
22261
+ }
22262
+ };
22057
22263
  var ColumnFlexService = class extends BeanStub {
22058
22264
  constructor() {
22059
22265
  super(...arguments);
@@ -22828,6 +23034,34 @@ var ColumnFlexModule = {
22828
23034
  version: VERSION,
22829
23035
  beans: [ColumnFlexService]
22830
23036
  };
23037
+ var ColumnApiModule = {
23038
+ moduleName: "ColumnApi",
23039
+ version: VERSION,
23040
+ beans: [ColumnDefFactory],
23041
+ apiFunctions: {
23042
+ getColumnDef,
23043
+ getDisplayNameForColumn,
23044
+ getColumn,
23045
+ getColumns,
23046
+ applyColumnState,
23047
+ getColumnState,
23048
+ resetColumnState,
23049
+ isPinning,
23050
+ isPinningLeft,
23051
+ isPinningRight,
23052
+ getDisplayedColAfter,
23053
+ getDisplayedColBefore,
23054
+ setColumnsVisible,
23055
+ setColumnsPinned,
23056
+ getAllGridColumns,
23057
+ getDisplayedLeftColumns,
23058
+ getDisplayedCenterColumns,
23059
+ getDisplayedRightColumns,
23060
+ getAllDisplayedColumns,
23061
+ getAllDisplayedVirtualColumns,
23062
+ getColumnDefs
23063
+ }
23064
+ };
22831
23065
  function _camelCaseToHumanText(camelCase) {
22832
23066
  if (!camelCase || camelCase == null) {
22833
23067
  return null;
@@ -41189,11 +41423,55 @@ const n8nTheme = themeQuartz.withPart(iconSetAlpine).withParams({
41189
41423
  checkboxUncheckedBackgroundColor: "var(--color-background-light-base)",
41190
41424
  checkboxCheckedBackgroundColor: "var(--color-primary)"
41191
41425
  });
41426
+ const useDataStorePagination = (options = {}) => {
41427
+ const currentPage = ref(options.initialPage ?? 1);
41428
+ const pageSize = ref(options.initialPageSize ?? 20);
41429
+ const totalItems = ref(0);
41430
+ const pageSizeOptions = options.pageSizeOptions ?? [10, 20, 50];
41431
+ const setTotalItems = (count) => {
41432
+ totalItems.value = count;
41433
+ };
41434
+ const setCurrentPage = async (page) => {
41435
+ currentPage.value = page;
41436
+ if (options.onChange) await options.onChange(currentPage.value, pageSize.value);
41437
+ };
41438
+ const setPageSize = async (size) => {
41439
+ pageSize.value = size;
41440
+ currentPage.value = 1;
41441
+ if (options.onChange) await options.onChange(currentPage.value, pageSize.value);
41442
+ };
41443
+ const ensureItemOnPage = async (itemIndex) => {
41444
+ const itemPage = Math.max(1, Math.ceil(itemIndex / pageSize.value));
41445
+ if (currentPage.value !== itemPage) {
41446
+ currentPage.value = itemPage;
41447
+ if (options.onChange) await options.onChange(currentPage.value, pageSize.value);
41448
+ }
41449
+ };
41450
+ return {
41451
+ currentPage,
41452
+ pageSize,
41453
+ pageSizeOptions,
41454
+ totalItems,
41455
+ setTotalItems,
41456
+ setCurrentPage,
41457
+ setPageSize,
41458
+ ensureItemOnPage
41459
+ };
41460
+ };
41461
+ const DATA_STORE_COLUMN_TYPES = ["string", "number", "boolean", "date"];
41462
+ const AG_GRID_CELL_TYPES = [
41463
+ "text",
41464
+ "number",
41465
+ "boolean",
41466
+ "date",
41467
+ "dateString",
41468
+ "object"
41469
+ ];
41192
41470
  const isDataStoreValue = (value) => {
41193
41471
  return value === null || typeof value === "string" || typeof value === "number" || typeof value === "boolean" || value instanceof Date;
41194
41472
  };
41195
41473
  const isAGGridCellType = (value) => {
41196
- return typeof value === "string" && ["text", "number", "boolean", "date", "dateString", "object"].includes(value);
41474
+ return typeof value === "string" && AG_GRID_CELL_TYPES.includes(value);
41197
41475
  };
41198
41476
  const COLUMN_TYPE_ICONS = {
41199
41477
  string: "type",
@@ -41203,6 +41481,7 @@ const COLUMN_TYPE_ICONS = {
41203
41481
  };
41204
41482
  const useDataStoreTypes = () => {
41205
41483
  const getIconForType = (type) => COLUMN_TYPE_ICONS[type];
41484
+ const i18n = useI18n();
41206
41485
  const mapToAGCellType = (colType) => {
41207
41486
  if (colType === "string") {
41208
41487
  return "text";
@@ -41232,14 +41511,35 @@ const useDataStoreTypes = () => {
41232
41511
  return null;
41233
41512
  }
41234
41513
  };
41514
+ const getAddColumnError = (error) => {
41515
+ const DEFAULT_HTTP_STATUS = 500;
41516
+ const DEFAULT_MESSAGE = i18n.baseText("generic.unknownError");
41517
+ if (error instanceof ResponseError) {
41518
+ return {
41519
+ httpStatus: error.httpStatusCode ?? 500,
41520
+ message: error.message
41521
+ };
41522
+ }
41523
+ if (error instanceof Error) {
41524
+ return {
41525
+ httpStatus: DEFAULT_HTTP_STATUS,
41526
+ message: error.message
41527
+ };
41528
+ }
41529
+ return {
41530
+ httpStatus: DEFAULT_HTTP_STATUS,
41531
+ message: DEFAULT_MESSAGE
41532
+ };
41533
+ };
41235
41534
  return {
41236
41535
  getIconForType,
41237
41536
  mapToAGCellType,
41238
41537
  mapToDataStoreColumnType,
41239
- getDefaultValueForType
41538
+ getDefaultValueForType,
41539
+ getAddColumnError
41240
41540
  };
41241
41541
  };
41242
- const _hoisted_1$4 = { class: "data-store-column-header-icon-wrapper" };
41542
+ const _hoisted_1$3 = { class: "data-store-column-header-icon-wrapper" };
41243
41543
  const _hoisted_2$2 = {
41244
41544
  class: "ag-header-cell-text",
41245
41545
  "data-test-id": "data-store-column-header-text"
@@ -41326,7 +41626,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
41326
41626
  onMouseleave: onMouseLeave,
41327
41627
  onClick: onHeaderClick
41328
41628
  }, [
41329
- createBaseVNode("div", _hoisted_1$4, [
41629
+ createBaseVNode("div", _hoisted_1$3, [
41330
41630
  typeIcon.value ? (openBlock(), createBlock(_component_N8nIcon, {
41331
41631
  key: 0,
41332
41632
  icon: typeIcon.value
@@ -41360,15 +41660,143 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
41360
41660
  };
41361
41661
  }
41362
41662
  });
41363
- const _hoisted_1$3 = { class: "add-column-header-component-wrapper" };
41364
- const _hoisted_2$1 = { class: "add-ds-column-header-popover-content" };
41663
+ const parseLooseDateInput = (text) => {
41664
+ const trimmed = text.trim();
41665
+ const m = LOOSE_DATE_REGEX.exec(trimmed);
41666
+ if (!m) return null;
41667
+ const y = Number(m[1]);
41668
+ const mo = Number(m[2]);
41669
+ const d = Number(m[3]);
41670
+ const hh = m[4] !== void 0 ? Number(m[4]) : 0;
41671
+ const mm = m[5] !== void 0 ? Number(m[5]) : 0;
41672
+ const ss = m[6] !== void 0 ? Number(m[6]) : 0;
41673
+ const dt = new Date(y, mo - 1, d, hh, mm, ss, 0);
41674
+ if (dt.getFullYear() !== y || dt.getMonth() !== mo - 1 || dt.getDate() !== d || dt.getHours() !== hh || dt.getMinutes() !== mm || dt.getSeconds() !== ss) {
41675
+ return null;
41676
+ }
41677
+ return dt;
41678
+ };
41679
+ const areValuesEqual = (oldValue, newValue, type) => {
41680
+ if (type && type === "date") {
41681
+ if (oldValue instanceof Date && newValue instanceof Date) {
41682
+ return oldValue.getTime() === newValue.getTime();
41683
+ }
41684
+ }
41685
+ return oldValue === newValue;
41686
+ };
41687
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
41688
+ __name: "ElDatePickerCellEditor",
41689
+ props: {
41690
+ params: {}
41691
+ },
41692
+ setup(__props, { expose: __expose }) {
41693
+ const props = __props;
41694
+ const pickerRef = useTemplateRef("pickerRef");
41695
+ const wrapperRef = useTemplateRef("wrapperRef");
41696
+ const dateValue = ref(null);
41697
+ const initialValue = ref(null);
41698
+ const inputWidth = ref(props.params.column.getActualWidth() - 4);
41699
+ function commitIfParsedFromInput(target) {
41700
+ const input = target instanceof HTMLInputElement ? target : null;
41701
+ const value = input?.value ?? "";
41702
+ const parsed = parseLooseDateInput(value);
41703
+ if (parsed) {
41704
+ dateValue.value = parsed;
41705
+ props.params.stopEditing();
41706
+ return true;
41707
+ }
41708
+ return false;
41709
+ }
41710
+ function onKeydown(e) {
41711
+ if (e.key === "Escape") {
41712
+ e.stopPropagation();
41713
+ dateValue.value = initialValue.value;
41714
+ props.params.stopEditing();
41715
+ return;
41716
+ }
41717
+ if (e.key === "Enter") {
41718
+ const committed = commitIfParsedFromInput(e.target);
41719
+ if (committed) {
41720
+ e.preventDefault();
41721
+ e.stopPropagation();
41722
+ }
41723
+ }
41724
+ }
41725
+ function getInnerInput() {
41726
+ return wrapperRef.value?.querySelector("input") ?? null;
41727
+ }
41728
+ function onChange() {
41729
+ props.params.stopEditing();
41730
+ }
41731
+ function onClear() {
41732
+ dateValue.value = null;
41733
+ props.params.stopEditing();
41734
+ }
41735
+ onMounted(async () => {
41736
+ const initial = props.params.value;
41737
+ if (initial === null || initial === void 0) {
41738
+ dateValue.value = null;
41739
+ } else if (initial instanceof Date) {
41740
+ dateValue.value = initial;
41741
+ }
41742
+ initialValue.value = dateValue.value;
41743
+ await nextTick();
41744
+ try {
41745
+ pickerRef.value?.focus?.();
41746
+ } catch {
41747
+ }
41748
+ });
41749
+ __expose({
41750
+ getValue: () => {
41751
+ const input = getInnerInput();
41752
+ const typed = input?.value ?? "";
41753
+ const parsed = parseLooseDateInput(typed);
41754
+ if (parsed) return parsed;
41755
+ return dateValue.value;
41756
+ },
41757
+ isPopup: () => true
41758
+ });
41759
+ return (_ctx, _cache) => {
41760
+ const _component_el_date_picker = resolveComponent("el-date-picker");
41761
+ return openBlock(), createElementBlock("div", {
41762
+ ref_key: "wrapperRef",
41763
+ ref: wrapperRef,
41764
+ class: "datastore-datepicker-wrapper"
41765
+ }, [
41766
+ createVNode(_component_el_date_picker, {
41767
+ id: "datastore-datepicker",
41768
+ ref_key: "pickerRef",
41769
+ ref: pickerRef,
41770
+ modelValue: dateValue.value,
41771
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => dateValue.value = $event),
41772
+ type: "datetime",
41773
+ style: normalizeStyle({ width: `${inputWidth.value}px` }),
41774
+ clearable: true,
41775
+ editable: true,
41776
+ teleported: false,
41777
+ "popper-class": "ag-custom-component-popup datastore-datepicker-popper",
41778
+ placeholder: "YYYY-MM-DD (HH:mm:ss)",
41779
+ size: "small",
41780
+ onChange,
41781
+ onClear,
41782
+ onKeydown
41783
+ }, null, 8, ["modelValue", "style"])
41784
+ ], 512);
41785
+ };
41786
+ }
41787
+ });
41788
+ const _hoisted_1$2 = { class: "add-column-header-component-wrapper" };
41789
+ const _hoisted_2$1 = {
41790
+ class: "add-ds-column-header-popover-content",
41791
+ "data-test-id": "add-column-popover-content"
41792
+ };
41365
41793
  const _hoisted_3 = { class: "popover-body" };
41366
41794
  const _hoisted_4 = {
41367
41795
  key: 0,
41368
41796
  class: "error-message"
41369
41797
  };
41370
41798
  const _hoisted_5 = { class: "add-column-option-content" };
41371
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
41799
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
41372
41800
  __name: "AddColumnButton",
41373
41801
  props: {
41374
41802
  params: {},
@@ -41383,21 +41811,39 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
41383
41811
  const nameInputRef = ref(null);
41384
41812
  const columnName = ref("");
41385
41813
  const columnType = ref("string");
41386
- const columnTypes = ["string", "number", "boolean", "date"];
41814
+ const columnTypes = [...DATA_STORE_COLUMN_TYPES];
41387
41815
  const error = ref(null);
41388
41816
  const popoverOpen = ref(false);
41389
41817
  const isSelectOpen = ref(false);
41390
41818
  const popoverId = computed(() => props.popoverId ?? "add-column-popover");
41819
+ const columnTypeOptions = computed(() => {
41820
+ return columnTypes.map((type) => ({
41821
+ label: type === "date" ? "datetime" : type,
41822
+ value: type
41823
+ }));
41824
+ });
41391
41825
  const onAddButtonClicked = async () => {
41392
41826
  validateName();
41393
41827
  if (!columnName.value || !columnType.value || error.value) {
41394
41828
  return;
41395
41829
  }
41396
- const success = await props.params.onAddColumn({
41830
+ const response = await props.params.onAddColumn({
41397
41831
  name: columnName.value,
41398
41832
  type: columnType.value
41399
41833
  });
41400
- if (!success) {
41834
+ if (!response.success) {
41835
+ let errorMessage = i18n.baseText("dataStore.addColumn.error");
41836
+ let errorDescription = response.errorMessage;
41837
+ if (response.httpStatus === 409) {
41838
+ errorMessage = i18n.baseText("dataStore.addColumn.alreadyExistsError", {
41839
+ interpolate: { name: columnName.value }
41840
+ });
41841
+ errorDescription = i18n.baseText("dataStore.addColumn.alreadyExistsDescription");
41842
+ }
41843
+ error.value = {
41844
+ message: errorMessage,
41845
+ description: errorDescription
41846
+ };
41401
41847
  return;
41402
41848
  }
41403
41849
  columnName.value = "";
@@ -41420,7 +41866,10 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
41420
41866
  error.value = null;
41421
41867
  }
41422
41868
  if (columnName.value && !COLUMN_NAME_REGEX.test(columnName.value)) {
41423
- error.value = i18n.baseText("dataStore.addColumn.invalidName.error");
41869
+ error.value = {
41870
+ message: i18n.baseText("dataStore.addColumn.invalidName.error"),
41871
+ description: i18n.baseText("dataStore.addColumn.invalidName.description")
41872
+ };
41424
41873
  }
41425
41874
  };
41426
41875
  const onInput = debounce(validateName, { debounceTime: 100 });
@@ -41441,7 +41890,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
41441
41890
  content: unref(i18n).baseText("dataStore.addColumn.label")
41442
41891
  }, {
41443
41892
  default: withCtx(() => [
41444
- createBaseVNode("div", _hoisted_1$3, [
41893
+ createBaseVNode("div", _hoisted_1$2, [
41445
41894
  createVNode(_component_N8nPopoverReka, {
41446
41895
  id: popoverId.value,
41447
41896
  open: popoverOpen.value,
@@ -41487,18 +41936,21 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
41487
41936
  onInput: unref(onInput)
41488
41937
  }, null, 8, ["modelValue", "placeholder", "maxlength", "onInput"]),
41489
41938
  error.value ? (openBlock(), createElementBlock("div", _hoisted_4, [
41490
- createVNode(_component_n8n_text, {
41939
+ error.value.message ? (openBlock(), createBlock(_component_n8n_text, {
41940
+ key: 0,
41491
41941
  size: "small",
41492
41942
  color: "danger",
41493
41943
  tag: "span"
41494
41944
  }, {
41495
41945
  default: withCtx(() => [
41496
- createTextVNode(toDisplayString(error.value), 1)
41946
+ createTextVNode(toDisplayString(error.value.message), 1)
41497
41947
  ]),
41498
41948
  _: 1
41499
- }),
41949
+ })) : createCommentVNode("", true),
41500
41950
  createVNode(Tooltip, {
41501
- content: unref(i18n).baseText("dataStore.addColumn.invalidName.description")
41951
+ content: error.value.description,
41952
+ placement: "top",
41953
+ disabled: !error.value.description
41502
41954
  }, {
41503
41955
  default: withCtx(() => [
41504
41956
  createVNode(_component_N8nIcon, {
@@ -41510,7 +41962,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
41510
41962
  })
41511
41963
  ]),
41512
41964
  _: 1
41513
- }, 8, ["content"])
41965
+ }, 8, ["content", "disabled"])
41514
41966
  ])) : createCommentVNode("", true)
41515
41967
  ]),
41516
41968
  _: 1
@@ -41528,27 +41980,28 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
41528
41980
  onVisibleChange: _cache[2] || (_cache[2] = ($event) => isSelectOpen.value = $event)
41529
41981
  }, {
41530
41982
  default: withCtx(() => [
41531
- (openBlock(), createElementBlock(Fragment, null, renderList(columnTypes, (type) => {
41532
- return createVNode(_component_N8nOption, {
41533
- key: type,
41534
- value: type
41983
+ (openBlock(true), createElementBlock(Fragment, null, renderList(columnTypeOptions.value, (option) => {
41984
+ return openBlock(), createBlock(_component_N8nOption, {
41985
+ key: option.value,
41986
+ label: option.label,
41987
+ value: option.value
41535
41988
  }, {
41536
41989
  default: withCtx(() => [
41537
41990
  createBaseVNode("div", _hoisted_5, [
41538
41991
  createVNode(_component_N8nIcon, {
41539
- icon: unref(getIconForType)(type)
41992
+ icon: unref(getIconForType)(option.value)
41540
41993
  }, null, 8, ["icon"]),
41541
41994
  createVNode(_component_N8nText, null, {
41542
41995
  default: withCtx(() => [
41543
- createTextVNode(toDisplayString(type), 1)
41996
+ createTextVNode(toDisplayString(option.label), 1)
41544
41997
  ]),
41545
41998
  _: 2
41546
41999
  }, 1024)
41547
42000
  ])
41548
42001
  ]),
41549
42002
  _: 2
41550
- }, 1032, ["value"]);
41551
- }), 64))
42003
+ }, 1032, ["label", "value"]);
42004
+ }), 128))
41552
42005
  ]),
41553
42006
  _: 1
41554
42007
  }, 8, ["modelValue", "append-to"])
@@ -41580,7 +42033,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
41580
42033
  };
41581
42034
  }
41582
42035
  });
41583
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
42036
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
41584
42037
  __name: "AddRowButton",
41585
42038
  props: {
41586
42039
  params: {}
@@ -41605,8 +42058,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
41605
42058
  };
41606
42059
  }
41607
42060
  });
41608
- const _hoisted_1$2 = { class: "n8n-empty-value" };
41609
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
42061
+ const _hoisted_1$1 = { class: "n8n-empty-value" };
42062
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
41610
42063
  __name: "NullEmptyCellRenderer",
41611
42064
  props: {
41612
42065
  params: {}
@@ -41614,84 +42067,690 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
41614
42067
  setup(__props) {
41615
42068
  const props = __props;
41616
42069
  return (_ctx, _cache) => {
41617
- return openBlock(), createElementBlock("span", _hoisted_1$2, toDisplayString(props.params.value), 1);
42070
+ return openBlock(), createElementBlock("span", _hoisted_1$1, toDisplayString(props.params.value), 1);
41618
42071
  };
41619
42072
  }
41620
42073
  });
41621
- const _hoisted_1$1 = { class: "datastore-datepicker-wrapper" };
41622
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
41623
- __name: "ElDatePickerCellEditor",
41624
- props: {
41625
- params: {}
41626
- },
41627
- setup(__props, { expose: __expose }) {
41628
- const props = __props;
41629
- const pickerRef = ref(null);
41630
- const dateValue = ref(null);
41631
- const initialValue = ref(null);
41632
- const inputWidth = ref(props.params.column.getActualWidth() - 4);
41633
- onMounted(async () => {
41634
- const initial = props.params.value;
41635
- if (initial === null || initial === void 0) {
41636
- dateValue.value = null;
41637
- } else if (initial instanceof Date) {
41638
- const dt = DateTime.fromJSDate(initial);
41639
- dateValue.value = dt.minus({ minutes: dt.offset }).toJSDate();
41640
- }
41641
- initialValue.value = dateValue.value;
41642
- await nextTick();
41643
- try {
41644
- pickerRef.value?.focus?.();
41645
- } catch {
41646
- }
42074
+ const getCellClass = (params) => {
42075
+ if (params.data?.id === ADD_ROW_ROW_ID) {
42076
+ return "add-row-cell";
42077
+ }
42078
+ if (params.column.getUserProvidedColDef()?.cellDataType === "boolean") {
42079
+ return "boolean-cell";
42080
+ }
42081
+ return "";
42082
+ };
42083
+ const createValueGetter = (col) => (params) => {
42084
+ if (params.data?.[col.name] === null || params.data?.[col.name] === void 0) {
42085
+ return null;
42086
+ }
42087
+ if (col.type === "date") {
42088
+ const value = params.data?.[col.name];
42089
+ if (typeof value === "string") {
42090
+ return new Date(value);
42091
+ }
42092
+ }
42093
+ return params.data?.[col.name];
42094
+ };
42095
+ const createCellRendererSelector = (col) => (params) => {
42096
+ if (params.data?.id === ADD_ROW_ROW_ID || col.id === "add-column") {
42097
+ return {};
42098
+ }
42099
+ let rowValue = params.data?.[col.name];
42100
+ if (rowValue === void 0) {
42101
+ rowValue = null;
42102
+ }
42103
+ if (rowValue === null) {
42104
+ return { component: _sfc_main$2, params: { value: NULL_VALUE } };
42105
+ }
42106
+ if (rowValue === "") {
42107
+ return { component: _sfc_main$2, params: { value: EMPTY_VALUE } };
42108
+ }
42109
+ return void 0;
42110
+ };
42111
+ const createStringValueSetter = (col, isTextEditorOpen) => (params) => {
42112
+ let originalValue = params.data[col.name];
42113
+ if (originalValue === void 0) {
42114
+ originalValue = null;
42115
+ }
42116
+ let newValue = params.newValue;
42117
+ if (!isDataStoreValue(newValue)) {
42118
+ return false;
42119
+ }
42120
+ if (originalValue === null && newValue === "") {
42121
+ return false;
42122
+ }
42123
+ if (isTextEditorOpen.value && newValue === null) {
42124
+ newValue = "";
42125
+ }
42126
+ params.data[col.name] = newValue;
42127
+ return true;
42128
+ };
42129
+ const stringCellEditorParams = (params) => ({
42130
+ value: params.value ?? "",
42131
+ maxLength: 999999999
42132
+ });
42133
+ const dateValueFormatter = (params) => {
42134
+ const value = params.value;
42135
+ if (value === null || value === void 0) return "";
42136
+ return DateTime.fromJSDate(value).toISO() ?? "";
42137
+ };
42138
+ const numberWithSpaces = (num) => {
42139
+ const parts = num.toString().split(".");
42140
+ parts[0] = parts[0].replace(NUMBER_WITH_SPACES_REGEX, NUMBER_THOUSAND_SEPARATOR);
42141
+ return parts.join(NUMBER_DECIMAL_SEPARATOR);
42142
+ };
42143
+ const numberValueFormatter = (params) => {
42144
+ const value = params.value;
42145
+ if (value === null || value === void 0) return "";
42146
+ return numberWithSpaces(value);
42147
+ };
42148
+ const useDataStoreGridBase = ({
42149
+ gridContainerRef,
42150
+ onDeleteColumn,
42151
+ onAddRowClick,
42152
+ onAddColumn
42153
+ }) => {
42154
+ const gridApi = ref(null);
42155
+ const colDefs = ref([]);
42156
+ const isTextEditorOpen = ref(false);
42157
+ const { mapToAGCellType } = useDataStoreTypes();
42158
+ const { copy: copyToClipboard } = useClipboard({ onPaste: onClipboardPaste });
42159
+ const currentSortBy = ref(DEFAULT_ID_COLUMN_NAME);
42160
+ const currentSortOrder = ref("asc");
42161
+ const lastFocusedCell = ref(null);
42162
+ const initializedGridApi = computed(() => {
42163
+ if (!gridApi.value) {
42164
+ throw new Error("Grid API is not initialized");
42165
+ }
42166
+ return gridApi.value;
42167
+ });
42168
+ const onGridReady = (params) => {
42169
+ gridApi.value = params.api;
42170
+ if (gridContainerRef.value) {
42171
+ params.api.setGridOption("popupParent", gridContainerRef.value);
42172
+ }
42173
+ };
42174
+ const setGridData = ({
42175
+ colDefs: colDefs2,
42176
+ rowData
42177
+ }) => {
42178
+ if (colDefs2) {
42179
+ initializedGridApi.value.setGridOption("columnDefs", colDefs2);
42180
+ }
42181
+ if (rowData) {
42182
+ initializedGridApi.value.setGridOption("rowData", rowData);
42183
+ }
42184
+ initializedGridApi.value.setGridOption("pinnedBottomRowData", [{ id: ADD_ROW_ROW_ID }]);
42185
+ };
42186
+ const focusFirstEditableCell = (rowId) => {
42187
+ const rowNode = initializedGridApi.value.getRowNode(String(rowId));
42188
+ if (rowNode?.rowIndex === null) return;
42189
+ const rowIndex = rowNode.rowIndex;
42190
+ const displayed = initializedGridApi.value.getAllDisplayedColumns();
42191
+ const firstEditable = displayed.find((col) => {
42192
+ const def = col.getColDef();
42193
+ if (!def) return false;
42194
+ if (def.colId === DEFAULT_ID_COLUMN_NAME) return false;
42195
+ return !!def.editable;
42196
+ });
42197
+ if (!firstEditable) return;
42198
+ const columnId = firstEditable.getColId();
42199
+ requestAnimationFrame(() => {
42200
+ initializedGridApi.value.ensureIndexVisible(rowIndex);
42201
+ requestAnimationFrame(() => {
42202
+ initializedGridApi.value.setFocusedCell(rowIndex, columnId);
42203
+ initializedGridApi.value.startEditingCell({
42204
+ rowIndex,
42205
+ colKey: columnId
42206
+ });
42207
+ });
41647
42208
  });
41648
- function onChange() {
41649
- props.params.stopEditing();
42209
+ };
42210
+ const createColumnDef = (col, extraProps = {}) => {
42211
+ const columnDef = {
42212
+ colId: col.id,
42213
+ field: col.name,
42214
+ headerName: col.name,
42215
+ sortable: true,
42216
+ editable: (params) => params.data?.id !== ADD_ROW_ROW_ID,
42217
+ resizable: true,
42218
+ lockPinned: true,
42219
+ headerComponent: _sfc_main$6,
42220
+ headerComponentParams: { onDelete: onDeleteColumn, allowMenuActions: true },
42221
+ cellEditorPopup: false,
42222
+ cellDataType: mapToAGCellType(col.type),
42223
+ cellClass: getCellClass,
42224
+ valueGetter: createValueGetter(col),
42225
+ cellRendererSelector: createCellRendererSelector(col),
42226
+ width: DEFAULT_COLUMN_WIDTH
42227
+ };
42228
+ if (col.type === "string") {
42229
+ columnDef.cellEditor = "agLargeTextCellEditor";
42230
+ columnDef.cellEditorPopup = true;
42231
+ columnDef.cellEditorPopupPosition = "over";
42232
+ columnDef.cellEditorParams = stringCellEditorParams;
42233
+ columnDef.valueSetter = createStringValueSetter(col, isTextEditorOpen);
42234
+ } else if (col.type === "date") {
42235
+ columnDef.cellEditorSelector = () => ({
42236
+ component: _sfc_main$5
42237
+ });
42238
+ columnDef.valueFormatter = dateValueFormatter;
42239
+ columnDef.cellEditorPopup = true;
42240
+ } else if (col.type === "number") {
42241
+ columnDef.valueFormatter = numberValueFormatter;
41650
42242
  }
41651
- function onClear() {
41652
- dateValue.value = null;
41653
- props.params.stopEditing();
42243
+ return {
42244
+ ...columnDef,
42245
+ ...extraProps
42246
+ };
42247
+ };
42248
+ const onCellEditingStarted = (params) => {
42249
+ if (params.column.getColDef().cellDataType === "text") {
42250
+ isTextEditorOpen.value = true;
42251
+ } else {
42252
+ isTextEditorOpen.value = false;
41654
42253
  }
41655
- function onKeydown(e) {
41656
- if (e.key === "Escape") {
41657
- e.stopPropagation();
41658
- dateValue.value = initialValue.value;
41659
- props.params.stopEditing();
41660
- } else if (e.key === "Enter") {
41661
- e.stopPropagation();
41662
- props.params.stopEditing();
41663
- }
42254
+ };
42255
+ const onCellEditingStopped = (params) => {
42256
+ if (params.column.getColDef().cellDataType === "text") {
42257
+ isTextEditorOpen.value = false;
41664
42258
  }
41665
- __expose({
41666
- getValue: () => {
41667
- if (dateValue.value === null) return null;
41668
- const dt = DateTime.fromJSDate(dateValue.value);
41669
- return dt.plus({ minutes: dt.offset }).toJSDate();
42259
+ };
42260
+ const getColumnDefinitions = (dataStoreColumns) => {
42261
+ const systemDateColumnOptions = {
42262
+ editable: false,
42263
+ suppressMovable: true,
42264
+ lockPinned: true,
42265
+ lockPosition: "right",
42266
+ headerComponentParams: {
42267
+ allowMenuActions: false
41670
42268
  },
41671
- isPopup: () => true
41672
- });
41673
- return (_ctx, _cache) => {
41674
- const _component_el_date_picker = resolveComponent("el-date-picker");
41675
- return openBlock(), createElementBlock("div", _hoisted_1$1, [
41676
- createVNode(_component_el_date_picker, {
41677
- ref_key: "pickerRef",
41678
- ref: pickerRef,
41679
- modelValue: dateValue.value,
41680
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => dateValue.value = $event),
41681
- type: "datetime",
41682
- style: normalizeStyle({ width: `${inputWidth.value}px` }),
41683
- clearable: true,
42269
+ cellClass: (params) => params.data?.id === ADD_ROW_ROW_ID ? "add-row-cell" : "system-cell",
42270
+ headerClass: "system-column",
42271
+ width: DEFAULT_COLUMN_WIDTH
42272
+ };
42273
+ return [
42274
+ // Always add the ID column, it's not returned by the back-end but all data stores have it
42275
+ // We use it as a placeholder for new datastores
42276
+ createColumnDef(
42277
+ {
42278
+ id: DEFAULT_ID_COLUMN_NAME,
42279
+ name: DEFAULT_ID_COLUMN_NAME,
42280
+ type: "string"
42281
+ },
42282
+ {
41684
42283
  editable: false,
41685
- teleported: false,
41686
- placeholder: "",
41687
- onChange,
41688
- onClear,
41689
- onKeydown
41690
- }, null, 8, ["modelValue", "style"])
41691
- ]);
42284
+ sortable: true,
42285
+ suppressMovable: true,
42286
+ headerComponent: null,
42287
+ lockPosition: true,
42288
+ minWidth: DATA_STORE_ID_COLUMN_WIDTH,
42289
+ maxWidth: DATA_STORE_ID_COLUMN_WIDTH,
42290
+ resizable: false,
42291
+ headerClass: "system-column",
42292
+ cellClass: (params) => params.data?.id === ADD_ROW_ROW_ID ? "add-row-cell" : "id-column",
42293
+ cellRendererSelector: (params) => {
42294
+ if (params.value === ADD_ROW_ROW_ID) {
42295
+ return {
42296
+ component: _sfc_main$3,
42297
+ params: { onClick: onAddRowClick }
42298
+ };
42299
+ }
42300
+ return void 0;
42301
+ }
42302
+ }
42303
+ ),
42304
+ // Append other columns
42305
+ ...orderBy(dataStoreColumns, "index").map((col) => createColumnDef(col)),
42306
+ createColumnDef(
42307
+ {
42308
+ index: dataStoreColumns.length + 1,
42309
+ id: "createdAt",
42310
+ name: "createdAt",
42311
+ type: "date"
42312
+ },
42313
+ systemDateColumnOptions
42314
+ ),
42315
+ createColumnDef(
42316
+ {
42317
+ index: dataStoreColumns.length + 2,
42318
+ id: "updatedAt",
42319
+ name: "updatedAt",
42320
+ type: "date"
42321
+ },
42322
+ systemDateColumnOptions
42323
+ ),
42324
+ createColumnDef(
42325
+ {
42326
+ index: dataStoreColumns.length + 3,
42327
+ id: "add-column",
42328
+ name: "Add Column",
42329
+ type: "string"
42330
+ },
42331
+ {
42332
+ editable: false,
42333
+ suppressMovable: true,
42334
+ lockPinned: true,
42335
+ lockPosition: "right",
42336
+ resizable: false,
42337
+ flex: 1,
42338
+ headerComponent: _sfc_main$4,
42339
+ headerComponentParams: { onAddColumn }
42340
+ }
42341
+ )
42342
+ ];
42343
+ };
42344
+ const loadColumns = (dataStoreColumns) => {
42345
+ colDefs.value = getColumnDefinitions(dataStoreColumns);
42346
+ setGridData({ colDefs: colDefs.value });
42347
+ };
42348
+ const deleteColumn = (columnId) => {
42349
+ colDefs.value = colDefs.value.filter((col) => col.colId !== columnId);
42350
+ setGridData({ colDefs: colDefs.value });
42351
+ };
42352
+ const insertColumnAtIndex = (column, index) => {
42353
+ colDefs.value.splice(index, 0, column);
42354
+ setGridData({ colDefs: colDefs.value });
42355
+ };
42356
+ const addColumn = (column) => {
42357
+ colDefs.value = [
42358
+ ...colDefs.value.slice(0, -1),
42359
+ createColumnDef(column),
42360
+ ...colDefs.value.slice(-1)
42361
+ ];
42362
+ setGridData({ colDefs: colDefs.value });
42363
+ };
42364
+ const moveColumn = (oldIndex, newIndex) => {
42365
+ const fromIndex = oldIndex - 1;
42366
+ const columnToBeMoved = colDefs.value[fromIndex];
42367
+ if (!columnToBeMoved) {
42368
+ return;
42369
+ }
42370
+ const middleWithIndex = colDefs.value.slice(1, -1).map((col, index) => ({ ...col, index }));
42371
+ const reorderedMiddle = reorderItem(middleWithIndex, fromIndex, newIndex).sort((a, b) => a.index - b.index).map(({ index, ...col }) => col);
42372
+ colDefs.value = [colDefs.value[0], ...reorderedMiddle, colDefs.value[colDefs.value.length - 1]];
42373
+ };
42374
+ const handleCopyFocusedCell = async (params) => {
42375
+ const focused = params.api.getFocusedCell();
42376
+ if (!focused) {
42377
+ return;
42378
+ }
42379
+ const row = params.api.getDisplayedRowAtIndex(focused.rowIndex);
42380
+ const colDef = focused.column.getColDef();
42381
+ if (row?.data && colDef.field) {
42382
+ const rawValue = row.data[colDef.field];
42383
+ const text = rawValue === null || rawValue === void 0 ? "" : String(rawValue);
42384
+ await copyToClipboard(text);
42385
+ }
42386
+ };
42387
+ function onClipboardPaste(data) {
42388
+ const focusedCell = initializedGridApi.value.getFocusedCell();
42389
+ const isEditing2 = initializedGridApi.value.getEditingCells().length > 0;
42390
+ if (!focusedCell || isEditing2) return;
42391
+ const row = initializedGridApi.value.getDisplayedRowAtIndex(focusedCell.rowIndex);
42392
+ if (!row) return;
42393
+ const colDef = focusedCell.column.getColDef();
42394
+ if (colDef.cellDataType === "text") {
42395
+ row.setDataValue(focusedCell.column.getColId(), data);
42396
+ } else if (colDef.cellDataType === "number") {
42397
+ if (!Number.isNaN(Number(data))) {
42398
+ row.setDataValue(focusedCell.column.getColId(), Number(data));
42399
+ }
42400
+ } else if (colDef.cellDataType === "date") {
42401
+ if (!Number.isNaN(Date.parse(data))) {
42402
+ row.setDataValue(focusedCell.column.getColId(), new Date(data));
42403
+ }
42404
+ } else if (colDef.cellDataType === "boolean") {
42405
+ if (data === "true") {
42406
+ row.setDataValue(focusedCell.column.getColId(), true);
42407
+ } else if (data === "false") {
42408
+ row.setDataValue(focusedCell.column.getColId(), false);
42409
+ }
42410
+ }
42411
+ }
42412
+ const onCellClicked = (params) => {
42413
+ const clickedCellColumn = params.column.getColId();
42414
+ const clickedCellRow = params.rowIndex;
42415
+ if (clickedCellRow === null || params.api.isEditing({ rowIndex: clickedCellRow, column: params.column, rowPinned: null }))
42416
+ return;
42417
+ const wasAlreadyFocused = lastFocusedCell.value && lastFocusedCell.value.rowIndex === clickedCellRow && lastFocusedCell.value.colId === clickedCellColumn;
42418
+ if (wasAlreadyFocused && params.column.getColDef()?.editable) {
42419
+ params.api.startEditingCell({
42420
+ rowIndex: clickedCellRow,
42421
+ colKey: clickedCellColumn
42422
+ });
42423
+ }
42424
+ lastFocusedCell.value = {
42425
+ rowIndex: clickedCellRow,
42426
+ colId: clickedCellColumn
41692
42427
  };
42428
+ };
42429
+ const resetLastFocusedCell = () => {
42430
+ lastFocusedCell.value = null;
42431
+ };
42432
+ const onSortChanged2 = async (event) => {
42433
+ const sortedColumn = event.columns?.filter((col) => col.getSort() !== null).pop() ?? null;
42434
+ if (sortedColumn) {
42435
+ const colId = sortedColumn.getColId();
42436
+ const columnDef = colDefs.value.find((col) => col.colId === colId);
42437
+ currentSortBy.value = columnDef?.field || colId;
42438
+ currentSortOrder.value = sortedColumn.getSort() ?? "asc";
42439
+ } else {
42440
+ currentSortBy.value = DEFAULT_ID_COLUMN_NAME;
42441
+ currentSortOrder.value = "asc";
42442
+ }
42443
+ };
42444
+ onClickOutside(gridContainerRef, () => {
42445
+ resetLastFocusedCell();
42446
+ initializedGridApi.value.clearFocusedCell();
42447
+ });
42448
+ return {
42449
+ onGridReady,
42450
+ setGridData,
42451
+ focusFirstEditableCell,
42452
+ onCellEditingStarted,
42453
+ onCellEditingStopped,
42454
+ createColumnDef,
42455
+ loadColumns,
42456
+ colDefs,
42457
+ deleteColumn,
42458
+ insertColumnAtIndex,
42459
+ addColumn,
42460
+ moveColumn,
42461
+ gridApi: initializedGridApi,
42462
+ handleCopyFocusedCell,
42463
+ onCellClicked,
42464
+ resetLastFocusedCell,
42465
+ currentSortBy,
42466
+ currentSortOrder,
42467
+ onSortChanged: onSortChanged2
42468
+ };
42469
+ };
42470
+ const useDataStoreSelection = ({
42471
+ gridApi
42472
+ }) => {
42473
+ const selectedRowIds = ref(/* @__PURE__ */ new Set());
42474
+ const selectedCount = computed(() => selectedRowIds.value.size);
42475
+ const rowSelection = {
42476
+ mode: "multiRow",
42477
+ enableClickSelection: false,
42478
+ checkboxes: (params) => params.data?.id !== ADD_ROW_ROW_ID,
42479
+ isRowSelectable: (params) => params.data?.id !== ADD_ROW_ROW_ID
42480
+ };
42481
+ const onSelectionChanged = () => {
42482
+ const selectedNodes = gridApi.value.getSelectedNodes();
42483
+ const newSelectedIds = /* @__PURE__ */ new Set();
42484
+ selectedNodes.forEach((node) => {
42485
+ if (typeof node.data?.id === "number") {
42486
+ newSelectedIds.add(node.data.id);
42487
+ }
42488
+ });
42489
+ selectedRowIds.value = newSelectedIds;
42490
+ };
42491
+ const handleClearSelection = () => {
42492
+ selectedRowIds.value = /* @__PURE__ */ new Set();
42493
+ gridApi.value.deselectAll();
42494
+ };
42495
+ return {
42496
+ selectedRowIds,
42497
+ selectedCount,
42498
+ rowSelection,
42499
+ onSelectionChanged,
42500
+ handleClearSelection
42501
+ };
42502
+ };
42503
+ const useDataStoreOperations = ({
42504
+ colDefs,
42505
+ rowData,
42506
+ deleteGridColumn,
42507
+ addGridColumn,
42508
+ setGridData,
42509
+ insertGridColumnAtIndex,
42510
+ moveGridColumn,
42511
+ dataStoreId,
42512
+ projectId,
42513
+ gridApi,
42514
+ totalItems,
42515
+ setTotalItems,
42516
+ ensureItemOnPage,
42517
+ focusFirstEditableCell,
42518
+ toggleSave,
42519
+ currentPage,
42520
+ pageSize,
42521
+ currentSortBy,
42522
+ currentSortOrder,
42523
+ handleClearSelection,
42524
+ selectedRowIds,
42525
+ handleCopyFocusedCell
42526
+ }) => {
42527
+ const i18n = useI18n();
42528
+ const toast = useToast();
42529
+ const message = useMessage();
42530
+ const dataStoreStore = useDataStoreStore();
42531
+ const contentLoading = ref(false);
42532
+ const telemetry2 = useTelemetry();
42533
+ const dataStoreTypes = useDataStoreTypes();
42534
+ async function onDeleteColumn(columnId) {
42535
+ const columnToDelete = colDefs.value.find((col) => col.colId === columnId);
42536
+ if (!columnToDelete) return;
42537
+ const promptResponse = await message.confirm(
42538
+ i18n.baseText("dataStore.deleteColumn.confirm.message", {
42539
+ interpolate: { name: columnToDelete.headerName ?? "" }
42540
+ }),
42541
+ i18n.baseText("dataStore.deleteColumn.confirm.title"),
42542
+ {
42543
+ confirmButtonText: i18n.baseText("generic.delete"),
42544
+ cancelButtonText: i18n.baseText("generic.cancel")
42545
+ }
42546
+ );
42547
+ if (promptResponse !== MODAL_CONFIRM) {
42548
+ return;
42549
+ }
42550
+ const columnToDeleteIndex = colDefs.value.findIndex((col) => col.colId === columnId);
42551
+ deleteGridColumn(columnId);
42552
+ const rowDataOldValue = [...rowData.value];
42553
+ rowData.value = rowData.value.map((row) => {
42554
+ const { [columnToDelete.field]: _, ...rest } = row;
42555
+ return rest;
42556
+ });
42557
+ setGridData({ rowData: rowData.value });
42558
+ try {
42559
+ await dataStoreStore.deleteDataStoreColumn(dataStoreId, projectId, columnId);
42560
+ telemetry2.track("User deleted data table column", {
42561
+ column_id: columnId,
42562
+ column_type: columnToDelete.cellDataType,
42563
+ data_table_id: dataStoreId
42564
+ });
42565
+ } catch (error) {
42566
+ toast.showError(error, i18n.baseText("dataStore.deleteColumn.error"));
42567
+ insertGridColumnAtIndex(columnToDelete, columnToDeleteIndex);
42568
+ rowData.value = rowDataOldValue;
42569
+ setGridData({ rowData: rowData.value });
42570
+ }
41693
42571
  }
41694
- });
42572
+ async function onAddColumn(column) {
42573
+ try {
42574
+ const newColumn = await dataStoreStore.addDataStoreColumn(dataStoreId, projectId, column);
42575
+ addGridColumn(newColumn);
42576
+ rowData.value = rowData.value.map((row) => {
42577
+ return { ...row, [newColumn.name]: null };
42578
+ });
42579
+ setGridData({ rowData: rowData.value });
42580
+ telemetry2.track("User added data table column", {
42581
+ column_id: newColumn.id,
42582
+ column_type: newColumn.type,
42583
+ data_table_id: dataStoreId
42584
+ });
42585
+ return { success: true, httpStatus: 200 };
42586
+ } catch (error) {
42587
+ const addColumnError = dataStoreTypes.getAddColumnError(error);
42588
+ return {
42589
+ success: false,
42590
+ httpStatus: addColumnError.httpStatus,
42591
+ errorMessage: addColumnError.message
42592
+ };
42593
+ }
42594
+ }
42595
+ const onColumnMoved = async (moveEvent) => {
42596
+ if (!moveEvent.finished || moveEvent.source !== "uiColumnMoved" || moveEvent.toIndex === void 0 || !moveEvent.column) {
42597
+ return;
42598
+ }
42599
+ const oldIndex = colDefs.value.findIndex((col) => col.colId === moveEvent.column.getColId());
42600
+ const newIndex = moveEvent.toIndex - 2;
42601
+ try {
42602
+ await dataStoreStore.moveDataStoreColumn(
42603
+ dataStoreId,
42604
+ projectId,
42605
+ moveEvent.column.getColId(),
42606
+ newIndex
42607
+ );
42608
+ moveGridColumn(oldIndex, newIndex);
42609
+ } catch (error) {
42610
+ toast.showError(error, i18n.baseText("dataStore.moveColumn.error"));
42611
+ gridApi.value.moveColumnByIndex(moveEvent.toIndex, oldIndex + 1);
42612
+ }
42613
+ };
42614
+ async function onAddRowClick() {
42615
+ try {
42616
+ await ensureItemOnPage(totalItems.value + 1);
42617
+ contentLoading.value = true;
42618
+ toggleSave(true);
42619
+ const insertedRow = await dataStoreStore.insertEmptyRow(dataStoreId, projectId);
42620
+ const newRow = insertedRow;
42621
+ rowData.value.push(newRow);
42622
+ setTotalItems(totalItems.value + 1);
42623
+ setGridData({ rowData: rowData.value });
42624
+ focusFirstEditableCell(newRow.id);
42625
+ telemetry2.track("User added row to data table", {
42626
+ data_table_id: dataStoreId
42627
+ });
42628
+ } catch (error) {
42629
+ toast.showError(error, i18n.baseText("dataStore.addRow.error"));
42630
+ } finally {
42631
+ toggleSave(false);
42632
+ contentLoading.value = false;
42633
+ }
42634
+ }
42635
+ const onCellValueChanged = async (params) => {
42636
+ const { data, api, oldValue, colDef } = params;
42637
+ const value = params.data[colDef.field];
42638
+ const cellType = isAGGridCellType(colDef.cellDataType) ? dataStoreTypes.mapToDataStoreColumnType(colDef.cellDataType) : void 0;
42639
+ if (value === void 0 || areValuesEqual(oldValue, value, cellType)) {
42640
+ return;
42641
+ }
42642
+ if (typeof data.id !== "number") {
42643
+ throw new Error("Expected row id to be a number");
42644
+ }
42645
+ const fieldName = String(colDef.field);
42646
+ const id = data.id;
42647
+ try {
42648
+ toggleSave(true);
42649
+ await dataStoreStore.updateRow(dataStoreId, projectId, id, {
42650
+ [fieldName]: value
42651
+ });
42652
+ telemetry2.track("User edited data table content", {
42653
+ data_table_id: dataStoreId,
42654
+ column_id: colDef.colId,
42655
+ column_type: colDef.cellDataType
42656
+ });
42657
+ } catch (error) {
42658
+ const validOldValue = isDataStoreValue(oldValue) ? oldValue : null;
42659
+ const revertedData = { ...data, [fieldName]: validOldValue };
42660
+ api.applyTransaction({
42661
+ update: [revertedData]
42662
+ });
42663
+ toast.showError(error, i18n.baseText("dataStore.updateRow.error"));
42664
+ } finally {
42665
+ toggleSave(false);
42666
+ }
42667
+ };
42668
+ async function fetchDataStoreRows() {
42669
+ try {
42670
+ contentLoading.value = true;
42671
+ const fetchedRows = await dataStoreStore.fetchDataStoreContent(
42672
+ dataStoreId,
42673
+ projectId,
42674
+ currentPage.value,
42675
+ pageSize.value,
42676
+ `${currentSortBy.value}:${currentSortOrder.value}`
42677
+ );
42678
+ rowData.value = fetchedRows.data;
42679
+ setTotalItems(fetchedRows.count);
42680
+ setGridData({ rowData: rowData.value, colDefs: colDefs.value });
42681
+ handleClearSelection();
42682
+ } catch (error) {
42683
+ toast.showError(error, i18n.baseText("dataStore.fetchContent.error"));
42684
+ } finally {
42685
+ contentLoading.value = false;
42686
+ }
42687
+ }
42688
+ const handleDeleteSelected = async () => {
42689
+ if (selectedRowIds.value.size === 0) return;
42690
+ const confirmResponse = await message.confirm(
42691
+ i18n.baseText("dataStore.deleteRows.confirmation", {
42692
+ adjustToNumber: selectedRowIds.value.size,
42693
+ interpolate: { count: selectedRowIds.value.size }
42694
+ }),
42695
+ i18n.baseText("dataStore.deleteRows.title"),
42696
+ {
42697
+ confirmButtonText: i18n.baseText("generic.delete"),
42698
+ cancelButtonText: i18n.baseText("generic.cancel")
42699
+ }
42700
+ );
42701
+ if (confirmResponse !== MODAL_CONFIRM) {
42702
+ return;
42703
+ }
42704
+ try {
42705
+ toggleSave(true);
42706
+ const idsToDelete = Array.from(selectedRowIds.value);
42707
+ await dataStoreStore.deleteRows(dataStoreId, projectId, idsToDelete);
42708
+ await fetchDataStoreRows();
42709
+ telemetry2.track("User deleted rows in data table", {
42710
+ data_table_id: dataStoreId,
42711
+ deleted_row_count: idsToDelete.length
42712
+ });
42713
+ } catch (error) {
42714
+ toast.showError(error, i18n.baseText("dataStore.deleteRows.error"));
42715
+ } finally {
42716
+ toggleSave(false);
42717
+ }
42718
+ };
42719
+ const onCellKeyDown = async (params) => {
42720
+ const event = params.event;
42721
+ const target = event.target;
42722
+ const isSelectionColumn = params.column.getColId() === "ag-Grid-SelectionColumn";
42723
+ const isEditing2 = params.api.getEditingCells().length > 0 || target instanceof HTMLInputElement && !isSelectionColumn;
42724
+ if (isEditing2) {
42725
+ return;
42726
+ }
42727
+ if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === "c") {
42728
+ event.preventDefault();
42729
+ await handleCopyFocusedCell(params);
42730
+ return;
42731
+ }
42732
+ if (event.key === "Escape") {
42733
+ handleClearSelection();
42734
+ return;
42735
+ }
42736
+ if (event.key !== "Delete" && event.key !== "Backspace" || selectedRowIds.value.size === 0) {
42737
+ return;
42738
+ }
42739
+ event.preventDefault();
42740
+ await handleDeleteSelected();
42741
+ };
42742
+ return {
42743
+ onDeleteColumn,
42744
+ onAddColumn,
42745
+ onColumnMoved,
42746
+ onAddRowClick,
42747
+ contentLoading,
42748
+ onCellValueChanged,
42749
+ fetchDataStoreRows,
42750
+ handleDeleteSelected,
42751
+ onCellKeyDown
42752
+ };
42753
+ };
41695
42754
  const _sfc_main$1 = /* @__PURE__ */ defineComponent({
41696
42755
  __name: "DataStoreTable",
41697
42756
  props: {
@@ -41715,572 +42774,84 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
41715
42774
  UndoRedoEditModule,
41716
42775
  CellStyleModule,
41717
42776
  PinnedRowModule,
41718
- ScrollApiModule
42777
+ ScrollApiModule,
42778
+ ColumnApiModule
41719
42779
  ]);
41720
42780
  const props = __props;
41721
42781
  const emit = __emit;
42782
+ const gridContainerRef = useTemplateRef("gridContainerRef");
41722
42783
  const i18n = useI18n();
41723
- const toast = useToast();
41724
- const message = useMessage();
41725
- const { mapToAGCellType } = useDataStoreTypes();
41726
- const dataStoreStore = useDataStoreStore();
41727
- const { copy: copyToClipboard } = useClipboard({ onPaste: onClipboardPaste });
41728
- const gridApi = ref(null);
41729
- const colDefs = ref([]);
42784
+ const dataStoreGridBase = useDataStoreGridBase({
42785
+ gridContainerRef,
42786
+ onDeleteColumn: onDeleteColumnFunction,
42787
+ onAddRowClick: onAddRowClickFunction,
42788
+ onAddColumn: onAddColumnFunction
42789
+ });
41730
42790
  const rowData = ref([]);
41731
- const rowSelection = {
41732
- mode: "multiRow",
41733
- enableClickSelection: false,
41734
- checkboxes: (params) => params.data?.id !== ADD_ROW_ROW_ID,
41735
- isRowSelectable: (params) => params.data?.id !== ADD_ROW_ROW_ID
41736
- };
41737
- const currentSortBy = ref(DEFAULT_ID_COLUMN_NAME);
41738
- const currentSortOrder = ref("asc");
41739
- const contentLoading = ref(false);
41740
- const lastFocusedCell = ref(null);
41741
- const isTextEditorOpen = ref(false);
41742
- const gridContainer = useTemplateRef("gridContainer");
41743
- const pageSizeOptions = [10, 20, 50];
41744
- const currentPage = ref(1);
41745
- const pageSize = ref(20);
41746
- const totalItems = ref(0);
41747
- const rows = ref([]);
41748
- const selectedRowIds = ref(/* @__PURE__ */ new Set());
41749
- const selectedCount = computed(() => selectedRowIds.value.size);
41750
42791
  const hasRecords = computed(() => rowData.value.length > 0);
41751
- const onGridReady = (params) => {
41752
- gridApi.value = params.api;
41753
- if (gridContainer?.value) {
41754
- params.api.setGridOption("popupParent", gridContainer.value);
41755
- }
41756
- };
41757
- const refreshGridData = () => {
41758
- if (!gridApi.value) return;
41759
- gridApi.value.setGridOption("columnDefs", colDefs.value);
41760
- gridApi.value.setGridOption("rowData", rowData.value);
41761
- gridApi.value.setGridOption("pinnedBottomRowData", [{ id: ADD_ROW_ROW_ID }]);
41762
- };
41763
- const focusFirstEditableCell = (rowId) => {
41764
- if (!gridApi.value) return;
41765
- const rowNode = gridApi.value.getRowNode(String(rowId));
41766
- if (rowNode?.rowIndex === null) return;
41767
- const firstEditableCol = colDefs.value[1];
41768
- if (!firstEditableCol?.colId) return;
41769
- gridApi.value.ensureIndexVisible(rowNode.rowIndex);
41770
- gridApi.value.setFocusedCell(rowNode.rowIndex, firstEditableCol.colId);
41771
- gridApi.value.startEditingCell({ rowIndex: rowNode.rowIndex, colKey: firstEditableCol.colId });
41772
- };
41773
- const setCurrentPage = async (page) => {
41774
- currentPage.value = page;
41775
- await fetchDataStoreContent();
41776
- };
41777
- const setPageSize = async (size) => {
41778
- pageSize.value = size;
41779
- currentPage.value = 1;
41780
- await fetchDataStoreContent();
41781
- };
41782
- const onDeleteColumn = async (columnId) => {
41783
- if (!gridApi.value) return;
41784
- const columnToDelete = colDefs.value.find((col) => col.colId === columnId);
41785
- if (!columnToDelete) return;
41786
- const promptResponse = await message.confirm(
41787
- i18n.baseText("dataStore.deleteColumn.confirm.message", {
41788
- interpolate: { name: columnToDelete.headerName ?? "" }
41789
- }),
41790
- i18n.baseText("dataStore.deleteColumn.confirm.title"),
41791
- {
41792
- confirmButtonText: i18n.baseText("generic.delete"),
41793
- cancelButtonText: i18n.baseText("generic.cancel")
41794
- }
41795
- );
41796
- if (promptResponse !== MODAL_CONFIRM) {
41797
- return;
41798
- }
41799
- const columnToDeleteIndex = colDefs.value.findIndex((col) => col.colId === columnId);
41800
- colDefs.value = colDefs.value.filter((def) => def.colId !== columnId);
41801
- const rowDataOldValue = [...rowData.value];
41802
- rowData.value = rowData.value.map((row) => {
41803
- const { [columnToDelete.field]: _, ...rest } = row;
41804
- return rest;
41805
- });
41806
- refreshGridData();
41807
- try {
41808
- await dataStoreStore.deleteDataStoreColumn(
41809
- props.dataStore.id,
41810
- props.dataStore.projectId,
41811
- columnId
41812
- );
41813
- } catch (error) {
41814
- toast.showError(error, i18n.baseText("dataStore.deleteColumn.error"));
41815
- colDefs.value.splice(columnToDeleteIndex, 0, columnToDelete);
41816
- rowData.value = rowDataOldValue;
41817
- refreshGridData();
41818
- }
41819
- };
41820
- const onAddColumn = async (column) => {
41821
- try {
41822
- const newColumn = await dataStoreStore.addDataStoreColumn(
41823
- props.dataStore.id,
41824
- props.dataStore.projectId,
41825
- column
41826
- );
41827
- if (!newColumn) {
41828
- throw new Error(i18n.baseText("generic.unknownError"));
41829
- }
41830
- colDefs.value = [
41831
- ...colDefs.value.slice(0, -1),
41832
- createColumnDef(newColumn),
41833
- ...colDefs.value.slice(-1)
41834
- ];
41835
- rowData.value = rowData.value.map((row) => {
41836
- return { ...row, [newColumn.name]: null };
41837
- });
41838
- refreshGridData();
41839
- return true;
41840
- } catch (error) {
41841
- toast.showError(error, i18n.baseText("dataStore.addColumn.error"));
41842
- return false;
41843
- }
41844
- };
41845
- const createColumnDef = (col, extraProps = {}) => {
41846
- const columnDef = {
41847
- colId: col.id,
41848
- field: col.name,
41849
- headerName: col.name,
41850
- sortable: true,
41851
- flex: 1,
41852
- editable: (params) => params.data?.id !== ADD_ROW_ROW_ID,
41853
- resizable: true,
41854
- lockPinned: true,
41855
- headerComponent: _sfc_main$6,
41856
- headerComponentParams: { onDelete: onDeleteColumn, allowMenuActions: true },
41857
- cellEditorPopup: false,
41858
- cellDataType: mapToAGCellType(col.type),
41859
- cellClass: (params) => {
41860
- if (params.data?.id === ADD_ROW_ROW_ID) {
41861
- return "add-row-cell";
41862
- }
41863
- if (params.column.getUserProvidedColDef()?.cellDataType === "boolean") {
41864
- return "boolean-cell";
41865
- }
41866
- return "";
41867
- },
41868
- valueGetter: (params) => {
41869
- if (params.data?.[col.name] === null || params.data?.[col.name] === void 0) {
41870
- return null;
41871
- }
41872
- if (col.type === "date") {
41873
- const value = params.data?.[col.name];
41874
- if (typeof value === "string") {
41875
- return new Date(value);
41876
- }
41877
- }
41878
- return params.data?.[col.name];
41879
- },
41880
- cellRendererSelector: (params) => {
41881
- if (params.data?.id === ADD_ROW_ROW_ID || col.id === "add-column") {
41882
- return {};
41883
- }
41884
- let rowValue = params.data?.[col.name];
41885
- if (rowValue === void 0) {
41886
- rowValue = null;
41887
- }
41888
- if (rowValue === null) {
41889
- return { component: _sfc_main$3, params: { value: NULL_VALUE } };
41890
- }
41891
- if (rowValue === "") {
41892
- return { component: _sfc_main$3, params: { value: EMPTY_VALUE } };
41893
- }
41894
- return void 0;
41895
- }
41896
- };
41897
- if (col.type === "string") {
41898
- columnDef.cellEditor = "agLargeTextCellEditor";
41899
- columnDef.cellEditorPopup = true;
41900
- columnDef.cellEditorPopupPosition = "over";
41901
- columnDef.cellEditorParams = (params) => ({
41902
- value: params.value ?? "",
41903
- // Rely on the backend to limit the length of the value
41904
- maxLength: 999999999
41905
- });
41906
- columnDef.valueSetter = (params) => {
41907
- let originalValue = params.data[col.name];
41908
- if (originalValue === void 0) {
41909
- originalValue = null;
41910
- }
41911
- let newValue = params.newValue;
41912
- if (!isDataStoreValue(newValue)) {
41913
- return false;
41914
- }
41915
- if (originalValue === null && newValue === "") {
41916
- return false;
41917
- }
41918
- if (isTextEditorOpen.value && newValue === null) {
41919
- newValue = "";
41920
- }
41921
- params.data[col.name] = newValue;
41922
- return true;
41923
- };
41924
- }
41925
- if (col.type === "date") {
41926
- columnDef.cellEditorSelector = () => ({
41927
- component: _sfc_main$2
41928
- });
41929
- columnDef.valueFormatter = (params) => {
41930
- const value = params.value;
41931
- if (value === null || value === void 0) return "";
41932
- return value.toISOString();
41933
- };
41934
- }
41935
- return {
41936
- ...columnDef,
41937
- ...extraProps
41938
- };
41939
- };
41940
- const onColumnMoved = async (moveEvent) => {
41941
- if (!moveEvent.finished || moveEvent.source !== "uiColumnMoved" || moveEvent.toIndex === void 0 || !moveEvent.column) {
41942
- return;
41943
- }
41944
- const oldIndex = colDefs.value.findIndex((col) => col.colId === moveEvent.column.getColId());
41945
- try {
41946
- await dataStoreStore.moveDataStoreColumn(
41947
- props.dataStore.id,
41948
- props.dataStore.projectId,
41949
- moveEvent.column.getColId(),
41950
- moveEvent.toIndex - 2
41951
- // ag grid index start from 1 and also we need to account for the id column
41952
- );
41953
- const fromIndex = oldIndex - 1;
41954
- const toIndex = moveEvent.toIndex - 2;
41955
- const middleWithIndex = colDefs.value.slice(1, -1).map((col, index) => ({ ...col, index }));
41956
- const reorderedMiddle = reorderItem(middleWithIndex, fromIndex, toIndex).sort((a, b) => a.index - b.index).map(({ index, ...col }) => col);
41957
- colDefs.value = [colDefs.value[0], ...reorderedMiddle, colDefs.value[colDefs.value.length - 1]];
41958
- refreshGridData();
41959
- } catch (error) {
41960
- toast.showError(error, i18n.baseText("dataStore.moveColumn.error"));
41961
- gridApi.value?.moveColumnByIndex(moveEvent.toIndex, oldIndex);
41962
- }
41963
- };
41964
- const onAddRowClick = async () => {
41965
- try {
41966
- if (currentPage.value * pageSize.value < totalItems.value + 1) {
41967
- await setCurrentPage(Math.ceil((totalItems.value + 1) / pageSize.value));
41968
- }
41969
- contentLoading.value = true;
41970
- emit("toggleSave", true);
41971
- const insertedRow = await dataStoreStore.insertEmptyRow(props.dataStore);
41972
- const newRow = insertedRow;
41973
- rowData.value.push(newRow);
41974
- totalItems.value += 1;
41975
- refreshGridData();
41976
- await nextTick();
41977
- focusFirstEditableCell(newRow.id);
41978
- } catch (error) {
41979
- toast.showError(error, i18n.baseText("dataStore.addRow.error"));
41980
- } finally {
41981
- emit("toggleSave", false);
41982
- contentLoading.value = false;
41983
- }
41984
- };
41985
- const initColumnDefinitions = () => {
41986
- const systemDateColumnOptions = {
41987
- editable: false,
41988
- suppressMovable: true,
41989
- lockPinned: true,
41990
- lockPosition: "right",
41991
- headerComponentParams: {
41992
- allowMenuActions: false
41993
- }
41994
- };
41995
- colDefs.value = [
41996
- // Always add the ID column, it's not returned by the back-end but all data stores have it
41997
- // We use it as a placeholder for new datastores
41998
- createColumnDef(
41999
- {
42000
- id: DEFAULT_ID_COLUMN_NAME,
42001
- name: DEFAULT_ID_COLUMN_NAME,
42002
- type: "string"
42003
- },
42004
- {
42005
- editable: false,
42006
- sortable: false,
42007
- suppressMovable: true,
42008
- headerComponent: null,
42009
- lockPosition: true,
42010
- minWidth: DATA_STORE_ID_COLUMN_WIDTH,
42011
- maxWidth: DATA_STORE_ID_COLUMN_WIDTH,
42012
- resizable: false,
42013
- cellClass: (params) => params.data?.id === ADD_ROW_ROW_ID ? "add-row-cell" : "id-column",
42014
- cellRendererSelector: (params) => {
42015
- if (params.value === ADD_ROW_ROW_ID) {
42016
- return {
42017
- component: _sfc_main$4,
42018
- params: { onClick: onAddRowClick }
42019
- };
42020
- }
42021
- return void 0;
42022
- }
42023
- }
42024
- ),
42025
- // Append other columns
42026
- ...orderBy(props.dataStore.columns, "index").map((col) => createColumnDef(col)),
42027
- createColumnDef(
42028
- {
42029
- index: props.dataStore.columns.length + 1,
42030
- id: "createdAt",
42031
- name: "createdAt",
42032
- type: "date"
42033
- },
42034
- systemDateColumnOptions
42035
- ),
42036
- createColumnDef(
42037
- {
42038
- index: props.dataStore.columns.length + 2,
42039
- id: "updatedAt",
42040
- name: "updatedAt",
42041
- type: "date"
42042
- },
42043
- systemDateColumnOptions
42044
- ),
42045
- createColumnDef(
42046
- {
42047
- index: props.dataStore.columns.length + 3,
42048
- id: "add-column",
42049
- name: "Add Column",
42050
- type: "string"
42051
- },
42052
- {
42053
- editable: false,
42054
- suppressMovable: true,
42055
- lockPinned: true,
42056
- lockPosition: "right",
42057
- resizable: false,
42058
- headerComponent: _sfc_main$5,
42059
- headerComponentParams: { onAddColumn }
42060
- }
42061
- )
42062
- ];
42063
- };
42064
- const onCellValueChanged = async (params) => {
42065
- const { data, api, oldValue, colDef } = params;
42066
- const value = params.data[colDef.field];
42067
- if (value === void 0 || value === oldValue) {
42068
- return;
42069
- }
42070
- if (typeof data.id !== "number") {
42071
- throw new Error("Expected row id to be a number");
42072
- }
42073
- const fieldName = String(colDef.field);
42074
- const id = data.id;
42075
- try {
42076
- emit("toggleSave", true);
42077
- await dataStoreStore.updateRow(props.dataStore.id, props.dataStore.projectId, id, {
42078
- [fieldName]: value
42079
- });
42080
- } catch (error) {
42081
- const validOldValue = isDataStoreValue(oldValue) ? oldValue : null;
42082
- const revertedData = { ...data, [fieldName]: validOldValue };
42083
- api.applyTransaction({
42084
- update: [revertedData]
42085
- });
42086
- toast.showError(error, i18n.baseText("dataStore.updateRow.error"));
42087
- } finally {
42088
- emit("toggleSave", false);
42089
- }
42090
- };
42091
- const onCellClicked = (params) => {
42092
- const clickedCellColumn = params.column.getColId();
42093
- const clickedCellRow = params.rowIndex;
42094
- if (clickedCellRow === null || params.api.isEditing({ rowIndex: clickedCellRow, column: params.column, rowPinned: null }))
42095
- return;
42096
- const wasAlreadyFocused = lastFocusedCell.value && lastFocusedCell.value.rowIndex === clickedCellRow && lastFocusedCell.value.colId === clickedCellColumn;
42097
- if (wasAlreadyFocused && params.column.getColDef()?.editable) {
42098
- params.api.startEditingCell({
42099
- rowIndex: clickedCellRow,
42100
- colKey: clickedCellColumn
42101
- });
42102
- }
42103
- lastFocusedCell.value = {
42104
- rowIndex: clickedCellRow,
42105
- colId: clickedCellColumn
42106
- };
42107
- };
42108
- const fetchDataStoreContent = async () => {
42109
- try {
42110
- contentLoading.value = true;
42111
- const fetchedRows = await dataStoreStore.fetchDataStoreContent(
42112
- props.dataStore.id,
42113
- props.dataStore.projectId,
42114
- currentPage.value,
42115
- pageSize.value,
42116
- `${currentSortBy.value}:${currentSortOrder.value}`
42117
- );
42118
- rowData.value = fetchedRows.data;
42119
- totalItems.value = fetchedRows.count;
42120
- refreshGridData();
42121
- handleClearSelection();
42122
- } catch (error) {
42123
- toast.showError(error, i18n.baseText("dataStore.fetchContent.error"));
42124
- } finally {
42125
- contentLoading.value = false;
42126
- if (gridApi.value) {
42127
- gridApi.value.refreshHeader();
42128
- }
42129
- }
42130
- };
42131
- onClickOutside(gridContainer, () => {
42132
- resetLastFocusedCell();
42133
- gridApi.value?.clearFocusedCell();
42134
- });
42135
- function onClipboardPaste(data) {
42136
- if (!gridApi.value) return;
42137
- const focusedCell = gridApi.value.getFocusedCell();
42138
- const isEditing2 = gridApi.value.getEditingCells().length > 0;
42139
- if (!focusedCell || isEditing2) return;
42140
- const row = gridApi.value.getDisplayedRowAtIndex(focusedCell.rowIndex);
42141
- if (!row) return;
42142
- const colDef = focusedCell.column.getColDef();
42143
- if (colDef.cellDataType === "text") {
42144
- row.setDataValue(focusedCell.column.getColId(), data);
42145
- } else if (colDef.cellDataType === "number") {
42146
- if (!Number.isNaN(Number(data))) {
42147
- row.setDataValue(focusedCell.column.getColId(), Number(data));
42148
- }
42149
- } else if (colDef.cellDataType === "date") {
42150
- if (!Number.isNaN(Date.parse(data))) {
42151
- row.setDataValue(focusedCell.column.getColId(), new Date(data));
42152
- }
42153
- } else if (colDef.cellDataType === "boolean") {
42154
- if (data === "true") {
42155
- row.setDataValue(focusedCell.column.getColId(), true);
42156
- } else if (data === "false") {
42157
- row.setDataValue(focusedCell.column.getColId(), false);
42158
- }
42159
- }
42160
- }
42161
- const resetLastFocusedCell = () => {
42162
- lastFocusedCell.value = null;
42163
- };
42164
- const initialize = async () => {
42165
- initColumnDefinitions();
42166
- await fetchDataStoreContent();
42167
- };
42168
- const onSortChanged2 = async (event) => {
42169
- const oldSortBy = currentSortBy.value;
42170
- const oldSortOrder = currentSortOrder.value;
42171
- const sortedColumn = event.columns?.filter((col) => col.getSort() !== null).pop() ?? null;
42172
- if (sortedColumn) {
42173
- const colId = sortedColumn.getColId();
42174
- const columnDef = colDefs.value.find((col) => col.colId === colId);
42175
- currentSortBy.value = columnDef?.field || colId;
42176
- currentSortOrder.value = sortedColumn.getSort() ?? "asc";
42177
- } else {
42178
- currentSortBy.value = DEFAULT_ID_COLUMN_NAME;
42179
- currentSortOrder.value = "asc";
42180
- }
42181
- if (oldSortBy !== currentSortBy.value || oldSortOrder !== currentSortOrder.value) {
42182
- currentPage.value = 1;
42183
- await fetchDataStoreContent();
42184
- }
42185
- };
42186
- onMounted(async () => {
42187
- await initialize();
42792
+ const {
42793
+ currentPage,
42794
+ pageSize,
42795
+ totalItems,
42796
+ pageSizeOptions,
42797
+ ensureItemOnPage,
42798
+ setTotalItems,
42799
+ setCurrentPage,
42800
+ setPageSize
42801
+ } = useDataStorePagination({
42802
+ onChange: fetchDataStoreRowsFunction
42803
+ });
42804
+ const selection = useDataStoreSelection({
42805
+ gridApi: dataStoreGridBase.gridApi
42806
+ });
42807
+ const dataStoreOperations = useDataStoreOperations({
42808
+ colDefs: dataStoreGridBase.colDefs,
42809
+ rowData,
42810
+ deleteGridColumn: dataStoreGridBase.deleteColumn,
42811
+ setGridData: dataStoreGridBase.setGridData,
42812
+ insertGridColumnAtIndex: dataStoreGridBase.insertColumnAtIndex,
42813
+ dataStoreId: props.dataStore.id,
42814
+ projectId: props.dataStore.projectId,
42815
+ addGridColumn: dataStoreGridBase.addColumn,
42816
+ moveGridColumn: dataStoreGridBase.moveColumn,
42817
+ gridApi: dataStoreGridBase.gridApi,
42818
+ totalItems,
42819
+ setTotalItems,
42820
+ ensureItemOnPage,
42821
+ focusFirstEditableCell: dataStoreGridBase.focusFirstEditableCell,
42822
+ toggleSave: emit.bind(null, "toggleSave"),
42823
+ currentPage,
42824
+ pageSize,
42825
+ currentSortBy: dataStoreGridBase.currentSortBy,
42826
+ currentSortOrder: dataStoreGridBase.currentSortOrder,
42827
+ handleClearSelection: selection.handleClearSelection,
42828
+ selectedRowIds: selection.selectedRowIds,
42829
+ handleCopyFocusedCell: dataStoreGridBase.handleCopyFocusedCell
42830
+ });
42831
+ async function onDeleteColumnFunction(columnId) {
42832
+ await dataStoreOperations.onDeleteColumn(columnId);
42833
+ }
42834
+ async function onAddColumnFunction(column) {
42835
+ return await dataStoreOperations.onAddColumn(column);
42836
+ }
42837
+ async function onAddRowClickFunction() {
42838
+ await dataStoreOperations.onAddRowClick();
42839
+ }
42840
+ async function fetchDataStoreRowsFunction() {
42841
+ await dataStoreOperations.fetchDataStoreRows();
42842
+ }
42843
+ const initialize = async (params) => {
42844
+ dataStoreGridBase.onGridReady(params);
42845
+ dataStoreGridBase.loadColumns(props.dataStore.columns);
42846
+ await dataStoreOperations.fetchDataStoreRows();
42847
+ };
42848
+ const customNoRowsOverlay = `<div class="no-rows-overlay ag-overlay-no-rows-center" data-test-id="data-store-no-rows-overlay">${i18n.baseText("dataStore.noRows")}</div>`;
42849
+ watch([dataStoreGridBase.currentSortBy, dataStoreGridBase.currentSortOrder], async () => {
42850
+ await setCurrentPage(1);
42188
42851
  });
42189
- const onCellEditingStarted = (params) => {
42190
- if (params.column.getColDef().cellDataType === "text") {
42191
- isTextEditorOpen.value = true;
42192
- } else {
42193
- isTextEditorOpen.value = false;
42194
- }
42195
- };
42196
- const onCellEditingStopped = (params) => {
42197
- if (params.column.getColDef().cellDataType === "text") {
42198
- isTextEditorOpen.value = false;
42199
- }
42200
- };
42201
- const onSelectionChanged = () => {
42202
- if (!gridApi.value) return;
42203
- const selectedNodes = gridApi.value.getSelectedNodes();
42204
- const newSelectedIds = /* @__PURE__ */ new Set();
42205
- selectedNodes.forEach((node) => {
42206
- if (typeof node.data?.id === "number") {
42207
- newSelectedIds.add(node.data.id);
42208
- }
42209
- });
42210
- selectedRowIds.value = newSelectedIds;
42211
- };
42212
- const onCellKeyDown = async (params) => {
42213
- if (params.api.getEditingCells().length > 0) {
42214
- return;
42215
- }
42216
- const event = params.event;
42217
- if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === "c") {
42218
- event.preventDefault();
42219
- await handleCopyFocusedCell(params);
42220
- return;
42221
- }
42222
- if (event.key !== "Delete" && event.key !== "Backspace" || selectedRowIds.value.size === 0) {
42223
- return;
42224
- }
42225
- event.preventDefault();
42226
- await handleDeleteSelected();
42227
- };
42228
- const handleCopyFocusedCell = async (params) => {
42229
- const focused = params.api.getFocusedCell();
42230
- if (!focused) {
42231
- return;
42232
- }
42233
- const row = params.api.getDisplayedRowAtIndex(focused.rowIndex);
42234
- const colDef = focused.column.getColDef();
42235
- if (row?.data && colDef.field) {
42236
- const rawValue = row.data[colDef.field];
42237
- const text = rawValue === null || rawValue === void 0 ? "" : String(rawValue);
42238
- await copyToClipboard(text);
42239
- }
42240
- };
42241
- const handleDeleteSelected = async () => {
42242
- if (selectedRowIds.value.size === 0) return;
42243
- const confirmResponse = await message.confirm(
42244
- i18n.baseText("dataStore.deleteRows.confirmation", {
42245
- adjustToNumber: selectedRowIds.value.size,
42246
- interpolate: { count: selectedRowIds.value.size }
42247
- }),
42248
- i18n.baseText("dataStore.deleteRows.title"),
42249
- {
42250
- confirmButtonText: i18n.baseText("generic.delete"),
42251
- cancelButtonText: i18n.baseText("generic.cancel")
42252
- }
42253
- );
42254
- if (confirmResponse !== MODAL_CONFIRM) {
42255
- return;
42256
- }
42257
- try {
42258
- emit("toggleSave", true);
42259
- const idsToDelete = Array.from(selectedRowIds.value);
42260
- await dataStoreStore.deleteRows(props.dataStore.id, props.dataStore.projectId, idsToDelete);
42261
- rows.value = rows.value.filter((row) => !selectedRowIds.value.has(row.id));
42262
- rowData.value = rows.value;
42263
- await fetchDataStoreContent();
42264
- toast.showToast({
42265
- title: i18n.baseText("dataStore.deleteRows.success"),
42266
- message: "",
42267
- type: "success"
42268
- });
42269
- } catch (error) {
42270
- toast.showError(error, i18n.baseText("dataStore.deleteRows.error"));
42271
- } finally {
42272
- emit("toggleSave", false);
42273
- }
42274
- };
42275
- const handleClearSelection = () => {
42276
- selectedRowIds.value = /* @__PURE__ */ new Set();
42277
- if (gridApi.value) {
42278
- gridApi.value.deselectAll();
42279
- }
42280
- };
42281
42852
  __expose({
42282
- addRow: onAddRowClick,
42283
- addColumn: onAddColumn
42853
+ addRow: dataStoreOperations.onAddRowClick,
42854
+ addColumn: dataStoreOperations.onAddColumn
42284
42855
  });
42285
42856
  return (_ctx, _cache) => {
42286
42857
  const _component_el_pagination = resolveComponent("el-pagination");
@@ -42288,8 +42859,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
42288
42859
  class: normalizeClass(_ctx.$style.wrapper)
42289
42860
  }, [
42290
42861
  createBaseVNode("div", {
42291
- ref_key: "gridContainer",
42292
- ref: gridContainer,
42862
+ ref_key: "gridContainerRef",
42863
+ ref: gridContainerRef,
42293
42864
  class: normalizeClass([_ctx.$style["grid-container"], { [_ctx.$style["has-records"]]: hasRecords.value }]),
42294
42865
  "data-test-id": "data-store-grid"
42295
42866
  }, [
@@ -42301,58 +42872,59 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
42301
42872
  "animate-rows": false,
42302
42873
  theme: unref(n8nTheme),
42303
42874
  "suppress-drag-leave-hides-columns": true,
42304
- loading: contentLoading.value,
42305
- "row-selection": rowSelection,
42875
+ loading: unref(dataStoreOperations).contentLoading.value,
42876
+ "row-selection": unref(selection).rowSelection,
42306
42877
  "get-row-id": (params) => String(params.data.id),
42307
42878
  "stop-editing-when-cells-lose-focus": true,
42308
42879
  "undo-redo-cell-editing": true,
42309
42880
  "suppress-multi-sort": true,
42310
- onGridReady,
42311
- onCellValueChanged,
42312
- onColumnMoved,
42313
- onCellClicked,
42314
- onCellEditingStarted,
42315
- onCellEditingStopped,
42316
- onColumnHeaderClicked: resetLastFocusedCell,
42317
- onSelectionChanged,
42318
- onSortChanged: onSortChanged2,
42319
- onCellKeyDown
42320
- }, null, 8, ["row-height", "header-height", "theme", "loading", "get-row-id"])
42881
+ "overlay-no-rows-template": customNoRowsOverlay,
42882
+ onGridReady: initialize,
42883
+ onCellValueChanged: unref(dataStoreOperations).onCellValueChanged,
42884
+ onColumnMoved: unref(dataStoreOperations).onColumnMoved,
42885
+ onCellClicked: unref(dataStoreGridBase).onCellClicked,
42886
+ onCellEditingStarted: unref(dataStoreGridBase).onCellEditingStarted,
42887
+ onCellEditingStopped: unref(dataStoreGridBase).onCellEditingStopped,
42888
+ onColumnHeaderClicked: unref(dataStoreGridBase).resetLastFocusedCell,
42889
+ onSelectionChanged: unref(selection).onSelectionChanged,
42890
+ onSortChanged: unref(dataStoreGridBase).onSortChanged,
42891
+ onCellKeyDown: unref(dataStoreOperations).onCellKeyDown
42892
+ }, null, 8, ["row-height", "header-height", "theme", "loading", "row-selection", "get-row-id", "onCellValueChanged", "onColumnMoved", "onCellClicked", "onCellEditingStarted", "onCellEditingStopped", "onColumnHeaderClicked", "onSelectionChanged", "onSortChanged", "onCellKeyDown"])
42321
42893
  ], 2),
42322
42894
  createBaseVNode("div", {
42323
42895
  class: normalizeClass(_ctx.$style.footer)
42324
42896
  }, [
42325
42897
  createVNode(_component_el_pagination, {
42326
- "current-page": currentPage.value,
42898
+ "current-page": unref(currentPage),
42327
42899
  "onUpdate:currentPage": [
42328
- _cache[0] || (_cache[0] = ($event) => currentPage.value = $event),
42329
- setCurrentPage
42900
+ _cache[0] || (_cache[0] = ($event) => isRef(currentPage) ? currentPage.value = $event : null),
42901
+ unref(setCurrentPage)
42330
42902
  ],
42331
- "page-size": pageSize.value,
42332
- "onUpdate:pageSize": _cache[1] || (_cache[1] = ($event) => pageSize.value = $event),
42903
+ "page-size": unref(pageSize),
42904
+ "onUpdate:pageSize": _cache[1] || (_cache[1] = ($event) => isRef(pageSize) ? pageSize.value = $event : null),
42333
42905
  "data-test-id": "data-store-content-pagination",
42334
42906
  background: "",
42335
- total: totalItems.value,
42336
- "page-sizes": pageSizeOptions,
42907
+ total: unref(totalItems),
42908
+ "page-sizes": unref(pageSizeOptions),
42337
42909
  layout: "total, prev, pager, next, sizes",
42338
- onSizeChange: setPageSize
42339
- }, null, 8, ["current-page", "page-size", "total"])
42910
+ onSizeChange: unref(setPageSize)
42911
+ }, null, 8, ["current-page", "page-size", "total", "page-sizes", "onUpdate:currentPage", "onSizeChange"])
42340
42912
  ], 2),
42341
42913
  createVNode(SelectedItemsInfo, {
42342
- "selected-count": selectedCount.value,
42343
- onDeleteSelected: handleDeleteSelected,
42344
- onClearSelection: handleClearSelection
42345
- }, null, 8, ["selected-count"])
42914
+ "selected-count": unref(selection).selectedCount.value,
42915
+ onDeleteSelected: unref(dataStoreOperations).handleDeleteSelected,
42916
+ onClearSelection: unref(selection).handleClearSelection
42917
+ }, null, 8, ["selected-count", "onDeleteSelected", "onClearSelection"])
42346
42918
  ], 2);
42347
42919
  };
42348
42920
  }
42349
42921
  });
42350
- const wrapper = "_wrapper_1bnk4_123";
42351
- const footer = "_footer_1bnk4_241";
42922
+ const wrapper = "_wrapper_1x5db_123";
42923
+ const footer = "_footer_1x5db_252";
42352
42924
  const style0$1 = {
42353
42925
  wrapper,
42354
- "grid-container": "_grid-container_1bnk4_130",
42355
- "has-records": "_has-records_1bnk4_234",
42926
+ "grid-container": "_grid-container_1x5db_130",
42927
+ "has-records": "_has-records_1x5db_242",
42356
42928
  footer
42357
42929
  };
42358
42930
  const cssModules$1 = {
@@ -42426,7 +42998,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
42426
42998
  };
42427
42999
  const onAddColumn = async (column) => {
42428
43000
  if (!dataStoreTableRef.value) {
42429
- return false;
43001
+ return {
43002
+ success: false,
43003
+ errorMessage: i18n.baseText("dataStore.error.tableNotInitialized")
43004
+ };
42430
43005
  }
42431
43006
  return await dataStoreTableRef.value.addColumn(column);
42432
43007
  };
@@ -42484,7 +43059,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
42484
43059
  ]),
42485
43060
  _: 1
42486
43061
  }, 8, ["onClick"]),
42487
- createVNode(_sfc_main$5, {
43062
+ createVNode(_sfc_main$4, {
42488
43063
  "use-text-trigger": true,
42489
43064
  "popover-id": "ds-details-add-column-popover",
42490
43065
  params: { onAddColumn }