@nocobase/flow-engine 2.0.0-alpha.10

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 (638) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +30 -0
  3. package/lib/ContextPathProxy.d.ts +17 -0
  4. package/lib/ContextPathProxy.js +65 -0
  5. package/lib/ElementProxy.d.ts +17 -0
  6. package/lib/ElementProxy.js +93 -0
  7. package/lib/FlowContextProvider.d.ts +24 -0
  8. package/lib/FlowContextProvider.js +82 -0
  9. package/lib/FlowDefinition.d.ts +423 -0
  10. package/lib/FlowDefinition.js +257 -0
  11. package/lib/JSRunner.d.ts +32 -0
  12. package/lib/JSRunner.js +95 -0
  13. package/lib/ReactView.d.ts +20 -0
  14. package/lib/ReactView.js +120 -0
  15. package/lib/ViewScopedFlowEngine.d.ts +23 -0
  16. package/lib/ViewScopedFlowEngine.js +81 -0
  17. package/lib/acl/Acl.d.ts +31 -0
  18. package/lib/acl/Acl.js +115 -0
  19. package/lib/action-registry/BaseActionRegistry.d.ts +23 -0
  20. package/lib/action-registry/BaseActionRegistry.js +57 -0
  21. package/lib/action-registry/EngineActionRegistry.d.ts +20 -0
  22. package/lib/action-registry/EngineActionRegistry.js +47 -0
  23. package/lib/action-registry/ModelActionRegistry.d.ts +34 -0
  24. package/lib/action-registry/ModelActionRegistry.js +79 -0
  25. package/lib/components/DynamicFlowsEditor.d.ts +17 -0
  26. package/lib/components/DynamicFlowsEditor.js +49 -0
  27. package/lib/components/FieldModelRenderer.d.ts +10 -0
  28. package/lib/components/FieldModelRenderer.js +100 -0
  29. package/lib/components/FlowContextSelector.d.ts +11 -0
  30. package/lib/components/FlowContextSelector.js +221 -0
  31. package/lib/components/FlowErrorFallback.d.ts +25 -0
  32. package/lib/components/FlowErrorFallback.js +264 -0
  33. package/lib/components/FlowModelRenderer.d.ts +61 -0
  34. package/lib/components/FlowModelRenderer.js +214 -0
  35. package/lib/components/FormItem.d.ts +18 -0
  36. package/lib/components/FormItem.js +151 -0
  37. package/lib/components/common/FlowSettingsButton.d.ts +11 -0
  38. package/lib/components/common/FlowSettingsButton.js +66 -0
  39. package/lib/components/common/index.d.ts +9 -0
  40. package/lib/components/common/index.js +30 -0
  41. package/lib/components/common/withFlowDesignMode.d.ts +26 -0
  42. package/lib/components/common/withFlowDesignMode.js +61 -0
  43. package/lib/components/dnd/findModelUidPosition.d.ts +13 -0
  44. package/lib/components/dnd/findModelUidPosition.js +50 -0
  45. package/lib/components/dnd/gridDragPlanner.d.ts +130 -0
  46. package/lib/components/dnd/gridDragPlanner.js +497 -0
  47. package/lib/components/dnd/index.d.ts +24 -0
  48. package/lib/components/dnd/index.js +164 -0
  49. package/lib/components/index.d.ts +18 -0
  50. package/lib/components/index.js +48 -0
  51. package/lib/components/settings/independents/dropdown/FlowsDropdownButton.d.ts +46 -0
  52. package/lib/components/settings/independents/dropdown/FlowsDropdownButton.js +225 -0
  53. package/lib/components/settings/independents/dropdown/index.d.ts +9 -0
  54. package/lib/components/settings/independents/dropdown/index.js +30 -0
  55. package/lib/components/settings/independents/index.d.ts +1 -0
  56. package/lib/components/settings/independents/index.js +30 -0
  57. package/lib/components/settings/index.d.ts +10 -0
  58. package/lib/components/settings/index.js +32 -0
  59. package/lib/components/settings/wrappers/contextual/DefaultSettingsIcon.d.ts +24 -0
  60. package/lib/components/settings/wrappers/contextual/DefaultSettingsIcon.js +501 -0
  61. package/lib/components/settings/wrappers/contextual/FlowsContextMenu.d.ts +45 -0
  62. package/lib/components/settings/wrappers/contextual/FlowsContextMenu.js +231 -0
  63. package/lib/components/settings/wrappers/contextual/FlowsFloatContextMenu.d.ts +111 -0
  64. package/lib/components/settings/wrappers/contextual/FlowsFloatContextMenu.js +484 -0
  65. package/lib/components/settings/wrappers/contextual/StepRequiredSettingsDialog.d.ts +26 -0
  66. package/lib/components/settings/wrappers/contextual/StepRequiredSettingsDialog.js +342 -0
  67. package/lib/components/settings/wrappers/contextual/StepSettings.d.ts +23 -0
  68. package/lib/components/settings/wrappers/contextual/StepSettings.js +110 -0
  69. package/lib/components/settings/wrappers/contextual/StepSettingsDialog.d.ts +20 -0
  70. package/lib/components/settings/wrappers/contextual/StepSettingsDialog.js +212 -0
  71. package/lib/components/settings/wrappers/contextual/StepSettingsDrawer.d.ts +20 -0
  72. package/lib/components/settings/wrappers/contextual/StepSettingsDrawer.js +47 -0
  73. package/lib/components/settings/wrappers/contextual/index.d.ts +14 -0
  74. package/lib/components/settings/wrappers/contextual/index.js +40 -0
  75. package/lib/components/settings/wrappers/embedded/FlowSettings.d.ts +33 -0
  76. package/lib/components/settings/wrappers/embedded/FlowSettings.js +207 -0
  77. package/lib/components/settings/wrappers/embedded/FlowsSettings.d.ts +41 -0
  78. package/lib/components/settings/wrappers/embedded/FlowsSettings.js +84 -0
  79. package/lib/components/settings/wrappers/embedded/FlowsSettingsContent.d.ts +16 -0
  80. package/lib/components/settings/wrappers/embedded/FlowsSettingsContent.js +88 -0
  81. package/lib/components/settings/wrappers/embedded/index.d.ts +10 -0
  82. package/lib/components/settings/wrappers/embedded/index.js +32 -0
  83. package/lib/components/settings/wrappers/index.d.ts +2 -0
  84. package/lib/components/settings/wrappers/index.js +32 -0
  85. package/lib/components/subModel/AddSubModelButton.d.ts +62 -0
  86. package/lib/components/subModel/AddSubModelButton.js +415 -0
  87. package/lib/components/subModel/LazyDropdown.d.ts +55 -0
  88. package/lib/components/subModel/LazyDropdown.js +524 -0
  89. package/lib/components/subModel/index.d.ts +10 -0
  90. package/lib/components/subModel/index.js +32 -0
  91. package/lib/components/subModel/utils.d.ts +34 -0
  92. package/lib/components/subModel/utils.js +287 -0
  93. package/lib/components/variables/InlineVariableTag.d.ts +21 -0
  94. package/lib/components/variables/InlineVariableTag.js +123 -0
  95. package/lib/components/variables/SlateVariableEditor.d.ts +46 -0
  96. package/lib/components/variables/SlateVariableEditor.js +302 -0
  97. package/lib/components/variables/VariableInput.d.ts +11 -0
  98. package/lib/components/variables/VariableInput.js +334 -0
  99. package/lib/components/variables/VariableTag.d.ts +11 -0
  100. package/lib/components/variables/VariableTag.js +189 -0
  101. package/lib/components/variables/VariableTrigger.d.ts +20 -0
  102. package/lib/components/variables/VariableTrigger.js +136 -0
  103. package/lib/components/variables/index.d.ts +15 -0
  104. package/lib/components/variables/index.js +53 -0
  105. package/lib/components/variables/types.d.ts +93 -0
  106. package/lib/components/variables/types.js +24 -0
  107. package/lib/components/variables/useResolvedMetaTree.d.ts +19 -0
  108. package/lib/components/variables/useResolvedMetaTree.js +91 -0
  109. package/lib/components/variables/utils.d.ts +22 -0
  110. package/lib/components/variables/utils.js +177 -0
  111. package/lib/data-source/index.d.ts +180 -0
  112. package/lib/data-source/index.js +737 -0
  113. package/lib/data-source/jioToJoiSchema.d.ts +19 -0
  114. package/lib/data-source/jioToJoiSchema.js +114 -0
  115. package/lib/data-source/sortCollectionsByInherits.d.ts +10 -0
  116. package/lib/data-source/sortCollectionsByInherits.js +71 -0
  117. package/lib/decorators/index.d.ts +9 -0
  118. package/lib/decorators/index.js +36 -0
  119. package/lib/decorators/largeField.d.ts +9 -0
  120. package/lib/decorators/largeField.js +42 -0
  121. package/lib/emitter.d.ts +16 -0
  122. package/lib/emitter.js +58 -0
  123. package/lib/event-registry/BaseEventRegistry.d.ts +22 -0
  124. package/lib/event-registry/BaseEventRegistry.js +57 -0
  125. package/lib/event-registry/EngineEventRegistry.d.ts +19 -0
  126. package/lib/event-registry/EngineEventRegistry.js +47 -0
  127. package/lib/event-registry/ModelEventRegistry.d.ts +33 -0
  128. package/lib/event-registry/ModelEventRegistry.js +79 -0
  129. package/lib/executor/FlowExecutor.d.ts +25 -0
  130. package/lib/executor/FlowExecutor.js +290 -0
  131. package/lib/flow-registry/BaseFlowRegistry.d.ts +46 -0
  132. package/lib/flow-registry/BaseFlowRegistry.js +86 -0
  133. package/lib/flow-registry/GlobalFlowRegistry.d.ts +22 -0
  134. package/lib/flow-registry/GlobalFlowRegistry.js +95 -0
  135. package/lib/flow-registry/InstanceFlowRegistry.d.ts +21 -0
  136. package/lib/flow-registry/InstanceFlowRegistry.js +59 -0
  137. package/lib/flow-registry/index.d.ts +11 -0
  138. package/lib/flow-registry/index.js +34 -0
  139. package/lib/flowContext.d.ts +243 -0
  140. package/lib/flowContext.js +1337 -0
  141. package/lib/flowEngine.d.ts +340 -0
  142. package/lib/flowEngine.js +781 -0
  143. package/lib/flowI18n.d.ts +46 -0
  144. package/lib/flowI18n.js +117 -0
  145. package/lib/flowSettings.d.ts +266 -0
  146. package/lib/flowSettings.js +850 -0
  147. package/lib/hooks/index.d.ts +14 -0
  148. package/lib/hooks/index.js +40 -0
  149. package/lib/hooks/useApplyAutoFlows.d.ts +21 -0
  150. package/lib/hooks/useApplyAutoFlows.js +63 -0
  151. package/lib/hooks/useFlowModel.d.ts +29 -0
  152. package/lib/hooks/useFlowModel.js +72 -0
  153. package/lib/hooks/useFlowModelById.d.ts +11 -0
  154. package/lib/hooks/useFlowModelById.js +61 -0
  155. package/lib/hooks/useFlowSettingsContext.d.ts +20 -0
  156. package/lib/hooks/useFlowSettingsContext.js +61 -0
  157. package/lib/hooks/useFlowStep.d.ts +17 -0
  158. package/lib/hooks/useFlowStep.js +56 -0
  159. package/lib/hooks/useNiceDropdownMaxHeight.d.ts +13 -0
  160. package/lib/hooks/useNiceDropdownMaxHeight.js +52 -0
  161. package/lib/index.d.ts +30 -0
  162. package/lib/index.js +93 -0
  163. package/lib/locale/en-US.json +61 -0
  164. package/lib/locale/index.d.ts +141 -0
  165. package/lib/locale/index.js +70 -0
  166. package/lib/locale/zh-CN.json +61 -0
  167. package/lib/models/CollectionFieldModel.d.ts +52 -0
  168. package/lib/models/CollectionFieldModel.js +280 -0
  169. package/lib/models/DisplayItemModel.d.ts +12 -0
  170. package/lib/models/DisplayItemModel.js +41 -0
  171. package/lib/models/EditableItemModel.d.ts +12 -0
  172. package/lib/models/EditableItemModel.js +41 -0
  173. package/lib/models/FilterableItemModel.d.ts +12 -0
  174. package/lib/models/FilterableItemModel.js +41 -0
  175. package/lib/models/flowModel.d.ts +342 -0
  176. package/lib/models/flowModel.js +1154 -0
  177. package/lib/models/forkFlowModel.d.ts +83 -0
  178. package/lib/models/forkFlowModel.js +280 -0
  179. package/lib/models/index.d.ts +14 -0
  180. package/lib/models/index.js +40 -0
  181. package/lib/provider.d.ts +22 -0
  182. package/lib/provider.js +115 -0
  183. package/lib/resources/apiResource.d.ts +34 -0
  184. package/lib/resources/apiResource.js +153 -0
  185. package/lib/resources/baseRecordResource.d.ts +61 -0
  186. package/lib/resources/baseRecordResource.js +264 -0
  187. package/lib/resources/filterItem.d.ts +33 -0
  188. package/lib/resources/filterItem.js +93 -0
  189. package/lib/resources/flowResource.d.ts +45 -0
  190. package/lib/resources/flowResource.js +146 -0
  191. package/lib/resources/index.d.ts +15 -0
  192. package/lib/resources/index.js +42 -0
  193. package/lib/resources/multiRecordResource.d.ts +53 -0
  194. package/lib/resources/multiRecordResource.js +230 -0
  195. package/lib/resources/singleRecordResource.d.ts +23 -0
  196. package/lib/resources/singleRecordResource.js +111 -0
  197. package/lib/resources/sqlResource.d.ts +73 -0
  198. package/lib/resources/sqlResource.js +294 -0
  199. package/lib/runjs-context/contexts/FormJSFieldItemRunJSContext.d.ts +11 -0
  200. package/lib/runjs-context/contexts/FormJSFieldItemRunJSContext.js +73 -0
  201. package/lib/runjs-context/contexts/JSBlockRunJSContext.d.ts +11 -0
  202. package/lib/runjs-context/contexts/JSBlockRunJSContext.js +91 -0
  203. package/lib/runjs-context/contexts/JSCollectionActionRunJSContext.d.ts +11 -0
  204. package/lib/runjs-context/contexts/JSCollectionActionRunJSContext.js +58 -0
  205. package/lib/runjs-context/contexts/JSColumnRunJSContext.d.ts +15 -0
  206. package/lib/runjs-context/contexts/JSColumnRunJSContext.js +78 -0
  207. package/lib/runjs-context/contexts/JSFieldRunJSContext.d.ts +11 -0
  208. package/lib/runjs-context/contexts/JSFieldRunJSContext.js +74 -0
  209. package/lib/runjs-context/contexts/JSItemRunJSContext.d.ts +11 -0
  210. package/lib/runjs-context/contexts/JSItemRunJSContext.js +70 -0
  211. package/lib/runjs-context/contexts/JSRecordActionRunJSContext.d.ts +11 -0
  212. package/lib/runjs-context/contexts/JSRecordActionRunJSContext.js +60 -0
  213. package/lib/runjs-context/contexts/base.d.ts +9 -0
  214. package/lib/runjs-context/contexts/base.js +169 -0
  215. package/lib/runjs-context/helpers.d.ts +20 -0
  216. package/lib/runjs-context/helpers.js +88 -0
  217. package/lib/runjs-context/registry.d.ts +20 -0
  218. package/lib/runjs-context/registry.js +61 -0
  219. package/lib/runjs-context/setup.d.ts +9 -0
  220. package/lib/runjs-context/setup.js +82 -0
  221. package/lib/runjs-context/snippets/global/api-request.snippet.d.ts +11 -0
  222. package/lib/runjs-context/snippets/global/api-request.snippet.js +57 -0
  223. package/lib/runjs-context/snippets/global/import-esm.snippet.d.ts +11 -0
  224. package/lib/runjs-context/snippets/global/import-esm.snippet.js +58 -0
  225. package/lib/runjs-context/snippets/global/message-error.snippet.d.ts +11 -0
  226. package/lib/runjs-context/snippets/global/message-error.snippet.js +47 -0
  227. package/lib/runjs-context/snippets/global/message-success.snippet.d.ts +11 -0
  228. package/lib/runjs-context/snippets/global/message-success.snippet.js +47 -0
  229. package/lib/runjs-context/snippets/global/notification-open.snippet.d.ts +11 -0
  230. package/lib/runjs-context/snippets/global/notification-open.snippet.js +50 -0
  231. package/lib/runjs-context/snippets/global/open-view-dialog.snippet.d.ts +11 -0
  232. package/lib/runjs-context/snippets/global/open-view-dialog.snippet.js +54 -0
  233. package/lib/runjs-context/snippets/global/open-view-drawer.snippet.d.ts +11 -0
  234. package/lib/runjs-context/snippets/global/open-view-drawer.snippet.js +54 -0
  235. package/lib/runjs-context/snippets/global/query-selector.snippet.d.ts +11 -0
  236. package/lib/runjs-context/snippets/global/query-selector.snippet.js +53 -0
  237. package/lib/runjs-context/snippets/global/require-amd.snippet.d.ts +11 -0
  238. package/lib/runjs-context/snippets/global/require-amd.snippet.js +49 -0
  239. package/lib/runjs-context/snippets/global/window-open.snippet.d.ts +11 -0
  240. package/lib/runjs-context/snippets/global/window-open.snippet.js +48 -0
  241. package/lib/runjs-context/snippets/index.d.ts +22 -0
  242. package/lib/runjs-context/snippets/index.js +213 -0
  243. package/lib/runjs-context/snippets/scene/block/add-event-listener.snippet.d.ts +11 -0
  244. package/lib/runjs-context/snippets/scene/block/add-event-listener.snippet.js +55 -0
  245. package/lib/runjs-context/snippets/scene/block/api-fetch-render-list.snippet.d.ts +11 -0
  246. package/lib/runjs-context/snippets/scene/block/api-fetch-render-list.snippet.js +64 -0
  247. package/lib/runjs-context/snippets/scene/block/chartjs-bar.snippet.d.ts +11 -0
  248. package/lib/runjs-context/snippets/scene/block/chartjs-bar.snippet.js +99 -0
  249. package/lib/runjs-context/snippets/scene/block/echarts-init.snippet.d.ts +11 -0
  250. package/lib/runjs-context/snippets/scene/block/echarts-init.snippet.js +63 -0
  251. package/lib/runjs-context/snippets/scene/block/render-button-handler.snippet.d.ts +11 -0
  252. package/lib/runjs-context/snippets/scene/block/render-button-handler.snippet.js +52 -0
  253. package/lib/runjs-context/snippets/scene/block/render-iframe.snippet.d.ts +11 -0
  254. package/lib/runjs-context/snippets/scene/block/render-iframe.snippet.js +57 -0
  255. package/lib/runjs-context/snippets/scene/block/render-info-card.snippet.d.ts +11 -0
  256. package/lib/runjs-context/snippets/scene/block/render-info-card.snippet.js +72 -0
  257. package/lib/runjs-context/snippets/scene/block/render-react.snippet.d.ts +11 -0
  258. package/lib/runjs-context/snippets/scene/block/render-react.snippet.js +57 -0
  259. package/lib/runjs-context/snippets/scene/block/render-statistics.snippet.d.ts +11 -0
  260. package/lib/runjs-context/snippets/scene/block/render-statistics.snippet.js +100 -0
  261. package/lib/runjs-context/snippets/scene/block/render-timeline.snippet.d.ts +11 -0
  262. package/lib/runjs-context/snippets/scene/block/render-timeline.snippet.js +85 -0
  263. package/lib/runjs-context/snippets/scene/block/resource-example.snippet.d.ts +11 -0
  264. package/lib/runjs-context/snippets/scene/block/resource-example.snippet.js +60 -0
  265. package/lib/runjs-context/snippets/scene/block/three-users-orbit.snippet.d.ts +11 -0
  266. package/lib/runjs-context/snippets/scene/block/three-users-orbit.snippet.js +283 -0
  267. package/lib/runjs-context/snippets/scene/block/vue-component.snippet.d.ts +11 -0
  268. package/lib/runjs-context/snippets/scene/block/vue-component.snippet.js +124 -0
  269. package/lib/runjs-context/snippets/scene/detail/color-by-value.snippet.d.ts +11 -0
  270. package/lib/runjs-context/snippets/scene/detail/color-by-value.snippet.js +52 -0
  271. package/lib/runjs-context/snippets/scene/detail/copy-to-clipboard.snippet.d.ts +11 -0
  272. package/lib/runjs-context/snippets/scene/detail/copy-to-clipboard.snippet.js +64 -0
  273. package/lib/runjs-context/snippets/scene/detail/format-number.snippet.d.ts +11 -0
  274. package/lib/runjs-context/snippets/scene/detail/format-number.snippet.js +51 -0
  275. package/lib/runjs-context/snippets/scene/detail/innerHTML-value.snippet.d.ts +11 -0
  276. package/lib/runjs-context/snippets/scene/detail/innerHTML-value.snippet.js +50 -0
  277. package/lib/runjs-context/snippets/scene/detail/percentage-bar.snippet.d.ts +11 -0
  278. package/lib/runjs-context/snippets/scene/detail/percentage-bar.snippet.js +82 -0
  279. package/lib/runjs-context/snippets/scene/detail/relative-time.snippet.d.ts +11 -0
  280. package/lib/runjs-context/snippets/scene/detail/relative-time.snippet.js +80 -0
  281. package/lib/runjs-context/snippets/scene/detail/status-tag.snippet.d.ts +11 -0
  282. package/lib/runjs-context/snippets/scene/detail/status-tag.snippet.js +74 -0
  283. package/lib/runjs-context/snippets/scene/form/calculate-total.snippet.d.ts +11 -0
  284. package/lib/runjs-context/snippets/scene/form/calculate-total.snippet.js +63 -0
  285. package/lib/runjs-context/snippets/scene/form/cascade-select.snippet.d.ts +11 -0
  286. package/lib/runjs-context/snippets/scene/form/cascade-select.snippet.js +81 -0
  287. package/lib/runjs-context/snippets/scene/form/conditional-required.snippet.d.ts +11 -0
  288. package/lib/runjs-context/snippets/scene/form/conditional-required.snippet.js +64 -0
  289. package/lib/runjs-context/snippets/scene/form/copy-field-values.snippet.d.ts +11 -0
  290. package/lib/runjs-context/snippets/scene/form/copy-field-values.snippet.js +74 -0
  291. package/lib/runjs-context/snippets/scene/form/render-basic.snippet.d.ts +11 -0
  292. package/lib/runjs-context/snippets/scene/form/render-basic.snippet.js +53 -0
  293. package/lib/runjs-context/snippets/scene/form/set-disabled.snippet.d.ts +11 -0
  294. package/lib/runjs-context/snippets/scene/form/set-disabled.snippet.js +69 -0
  295. package/lib/runjs-context/snippets/scene/form/set-field-value.snippet.d.ts +11 -0
  296. package/lib/runjs-context/snippets/scene/form/set-field-value.snippet.js +68 -0
  297. package/lib/runjs-context/snippets/scene/form/set-required.snippet.d.ts +11 -0
  298. package/lib/runjs-context/snippets/scene/form/set-required.snippet.js +69 -0
  299. package/lib/runjs-context/snippets/scene/form/toggle-multiple-fields.snippet.d.ts +11 -0
  300. package/lib/runjs-context/snippets/scene/form/toggle-multiple-fields.snippet.js +67 -0
  301. package/lib/runjs-context/snippets/scene/form/toggle-visible.snippet.d.ts +11 -0
  302. package/lib/runjs-context/snippets/scene/form/toggle-visible.snippet.js +69 -0
  303. package/lib/runjs-context/snippets/scene/table/cell-open-dialog.snippet.d.ts +11 -0
  304. package/lib/runjs-context/snippets/scene/table/cell-open-dialog.snippet.js +64 -0
  305. package/lib/runjs-context/snippets/scene/table/collection-selected-count.snippet.d.ts +11 -0
  306. package/lib/runjs-context/snippets/scene/table/collection-selected-count.snippet.js +53 -0
  307. package/lib/runjs-context/snippets/scene/table/concat-fields.snippet.d.ts +11 -0
  308. package/lib/runjs-context/snippets/scene/table/concat-fields.snippet.js +79 -0
  309. package/lib/runjs-context/snippets/scene/table/destroy-selected.snippet.d.ts +11 -0
  310. package/lib/runjs-context/snippets/scene/table/destroy-selected.snippet.js +55 -0
  311. package/lib/runjs-context/snippets/scene/table/export-selected-json.snippet.d.ts +11 -0
  312. package/lib/runjs-context/snippets/scene/table/export-selected-json.snippet.js +64 -0
  313. package/lib/runjs-context/snippets/scene/table/iterate-selected-rows.snippet.d.ts +11 -0
  314. package/lib/runjs-context/snippets/scene/table/iterate-selected-rows.snippet.js +52 -0
  315. package/lib/runjs-context/snippets/types.d.ts +24 -0
  316. package/lib/runjs-context/snippets/types.js +24 -0
  317. package/lib/types.d.ts +407 -0
  318. package/lib/types.js +43 -0
  319. package/lib/utils/autoFlowError.d.ts +16 -0
  320. package/lib/utils/autoFlowError.js +53 -0
  321. package/lib/utils/constants.d.ts +29 -0
  322. package/lib/utils/constants.js +77 -0
  323. package/lib/utils/context.d.ts +40 -0
  324. package/lib/utils/context.js +63 -0
  325. package/lib/utils/createCollectionContextMeta.d.ts +11 -0
  326. package/lib/utils/createCollectionContextMeta.js +117 -0
  327. package/lib/utils/exceptions.d.ts +22 -0
  328. package/lib/utils/exceptions.js +62 -0
  329. package/lib/utils/flow-definitions.d.ts +11 -0
  330. package/lib/utils/flow-definitions.js +40 -0
  331. package/lib/utils/index.d.ts +22 -0
  332. package/lib/utils/index.js +115 -0
  333. package/lib/utils/inheritance.d.ts +16 -0
  334. package/lib/utils/inheritance.js +53 -0
  335. package/lib/utils/params-resolvers.d.ts +51 -0
  336. package/lib/utils/params-resolvers.js +309 -0
  337. package/lib/utils/parsePathnameToViewParams.d.ts +34 -0
  338. package/lib/utils/parsePathnameToViewParams.js +84 -0
  339. package/lib/utils/safeGlobals.d.ts +16 -0
  340. package/lib/utils/safeGlobals.js +179 -0
  341. package/lib/utils/schema-utils.d.ts +40 -0
  342. package/lib/utils/schema-utils.js +161 -0
  343. package/lib/utils/serverContextParams.d.ts +29 -0
  344. package/lib/utils/serverContextParams.js +106 -0
  345. package/lib/utils/setupRuntimeContextSteps.d.ts +19 -0
  346. package/lib/utils/setupRuntimeContextSteps.js +88 -0
  347. package/lib/utils/translation.d.ts +18 -0
  348. package/lib/utils/translation.js +58 -0
  349. package/lib/utils/variablesParams.d.ts +52 -0
  350. package/lib/utils/variablesParams.js +161 -0
  351. package/lib/views/DialogComponent.d.ts +22 -0
  352. package/lib/views/DialogComponent.js +98 -0
  353. package/lib/views/DrawerComponent.d.ts +11 -0
  354. package/lib/views/DrawerComponent.js +101 -0
  355. package/lib/views/FlowView.d.ts +76 -0
  356. package/lib/views/FlowView.js +81 -0
  357. package/lib/views/PageComponent.d.ts +10 -0
  358. package/lib/views/PageComponent.js +168 -0
  359. package/lib/views/ViewNavigation.d.ts +45 -0
  360. package/lib/views/ViewNavigation.js +97 -0
  361. package/lib/views/createViewMeta.d.ts +44 -0
  362. package/lib/views/createViewMeta.js +377 -0
  363. package/lib/views/index.d.ts +14 -0
  364. package/lib/views/index.js +51 -0
  365. package/lib/views/useDialog.d.ts +32 -0
  366. package/lib/views/useDialog.js +200 -0
  367. package/lib/views/useDrawer.d.ts +33 -0
  368. package/lib/views/useDrawer.js +220 -0
  369. package/lib/views/usePage.d.ts +32 -0
  370. package/lib/views/usePage.js +194 -0
  371. package/lib/views/usePatchElement.d.ts +10 -0
  372. package/lib/views/usePatchElement.js +54 -0
  373. package/lib/views/usePopover.d.ts +17 -0
  374. package/lib/views/usePopover.js +159 -0
  375. package/package.json +37 -0
  376. package/src/ContextPathProxy.ts +45 -0
  377. package/src/ElementProxy.ts +69 -0
  378. package/src/FlowContextProvider.tsx +42 -0
  379. package/src/FlowDefinition.ts +275 -0
  380. package/src/JSRunner.ts +84 -0
  381. package/src/ReactView.tsx +104 -0
  382. package/src/ViewScopedFlowEngine.ts +75 -0
  383. package/src/__tests__/ElementProxy.test.ts +51 -0
  384. package/src/__tests__/JSRunner.test.ts +92 -0
  385. package/src/__tests__/ReactView.test.tsx +63 -0
  386. package/src/__tests__/context-path-proxy.test.ts +35 -0
  387. package/src/__tests__/flow-engine.test.ts +189 -0
  388. package/src/__tests__/flowContext.test.ts +2012 -0
  389. package/src/__tests__/flowContextCreateJSRunner.test.ts +163 -0
  390. package/src/__tests__/flowEngine.saveModel.test.ts +171 -0
  391. package/src/__tests__/flowI18n.test.ts +28 -0
  392. package/src/__tests__/flowModel.getFlows.test.ts +61 -0
  393. package/src/__tests__/flowModel.openView.navigation.test.ts +78 -0
  394. package/src/__tests__/flowRunJSContextDefine.test.ts +508 -0
  395. package/src/__tests__/flowRuntimeContext.test.ts +187 -0
  396. package/src/__tests__/flowSettings.open.test.tsx +1920 -0
  397. package/src/__tests__/flowSettings.test.ts +566 -0
  398. package/src/__tests__/globalFlowRegistry.test.ts +77 -0
  399. package/src/__tests__/isFieldInterfaceMatch.test.ts +51 -0
  400. package/src/__tests__/metaTreeNodeCache.test.ts +234 -0
  401. package/src/__tests__/path-aggregation.test.ts +85 -0
  402. package/src/__tests__/provider.test.tsx +28 -0
  403. package/src/__tests__/renderHiddenInConfig.test.tsx +91 -0
  404. package/src/__tests__/runjsContext.test.ts +241 -0
  405. package/src/__tests__/runjsContextImplementations.test.ts +217 -0
  406. package/src/__tests__/runjsContextRuntime.test.ts +269 -0
  407. package/src/__tests__/runjsEdgeCases.test.ts +281 -0
  408. package/src/__tests__/runjsLocales.test.ts +36 -0
  409. package/src/__tests__/runjsRuntimeFeatures.test.ts +449 -0
  410. package/src/__tests__/runjsSnippets.test.ts +140 -0
  411. package/src/__tests__/viewScopedFlowEngine.test.ts +212 -0
  412. package/src/acl/Acl.tsx +109 -0
  413. package/src/acl/__tests__/Acl.test.tsx +72 -0
  414. package/src/action-registry/BaseActionRegistry.ts +46 -0
  415. package/src/action-registry/EngineActionRegistry.ts +32 -0
  416. package/src/action-registry/ModelActionRegistry.ts +75 -0
  417. package/src/action-registry/__tests__/engineActionRegistry.test.ts +43 -0
  418. package/src/action-registry/__tests__/modelActionRegistry.test.ts +107 -0
  419. package/src/components/DynamicFlowsEditor.tsx +318 -0
  420. package/src/components/FieldModelRenderer.tsx +68 -0
  421. package/src/components/FlowContextSelector.tsx +255 -0
  422. package/src/components/FlowErrorFallback.tsx +316 -0
  423. package/src/components/FlowModelRenderer.tsx +362 -0
  424. package/src/components/FormItem.tsx +136 -0
  425. package/src/components/__tests__/flow-model-render-error-fallback.test.tsx +226 -0
  426. package/src/components/__tests__/gridDragPlanner.test.ts +494 -0
  427. package/src/components/common/FlowSettingsButton.tsx +30 -0
  428. package/src/components/common/index.ts +10 -0
  429. package/src/components/common/withFlowDesignMode.tsx +49 -0
  430. package/src/components/dnd/README.md +149 -0
  431. package/src/components/dnd/findModelUidPosition.ts +26 -0
  432. package/src/components/dnd/gridDragPlanner.ts +659 -0
  433. package/src/components/dnd/index.tsx +128 -0
  434. package/src/components/index.ts +20 -0
  435. package/src/components/settings/independents/dropdown/FlowsDropdownButton.tsx +279 -0
  436. package/src/components/settings/independents/dropdown/index.ts +10 -0
  437. package/src/components/settings/independents/index.ts +2 -0
  438. package/src/components/settings/index.ts +11 -0
  439. package/src/components/settings/wrappers/contextual/DefaultSettingsIcon.tsx +617 -0
  440. package/src/components/settings/wrappers/contextual/FlowsContextMenu.tsx +292 -0
  441. package/src/components/settings/wrappers/contextual/FlowsFloatContextMenu.tsx +655 -0
  442. package/src/components/settings/wrappers/contextual/StepRequiredSettingsDialog.tsx +446 -0
  443. package/src/components/settings/wrappers/contextual/StepSettings.tsx +109 -0
  444. package/src/components/settings/wrappers/contextual/StepSettingsDialog.tsx +223 -0
  445. package/src/components/settings/wrappers/contextual/StepSettingsDrawer.tsx +32 -0
  446. package/src/components/settings/wrappers/contextual/index.ts +15 -0
  447. package/src/components/settings/wrappers/embedded/FlowSettings.tsx +258 -0
  448. package/src/components/settings/wrappers/embedded/FlowsSettings.tsx +111 -0
  449. package/src/components/settings/wrappers/embedded/FlowsSettingsContent.tsx +96 -0
  450. package/src/components/settings/wrappers/embedded/index.ts +11 -0
  451. package/src/components/settings/wrappers/index.ts +5 -0
  452. package/src/components/subModel/AddSubModelButton.tsx +575 -0
  453. package/src/components/subModel/LazyDropdown.tsx +714 -0
  454. package/src/components/subModel/__tests__/AddSubModelButton.test.tsx +1185 -0
  455. package/src/components/subModel/__tests__/buildWrapperFieldChildren.test.ts +192 -0
  456. package/src/components/subModel/__tests__/utils.test.ts +425 -0
  457. package/src/components/subModel/index.ts +12 -0
  458. package/src/components/subModel/utils.ts +278 -0
  459. package/src/components/variables/InlineVariableTag.tsx +97 -0
  460. package/src/components/variables/SlateVariableEditor.tsx +384 -0
  461. package/src/components/variables/VariableInput.tsx +360 -0
  462. package/src/components/variables/VariableTag.tsx +175 -0
  463. package/src/components/variables/VariableTrigger.tsx +116 -0
  464. package/src/components/variables/__tests__/FlowContextSelector.test.tsx +553 -0
  465. package/src/components/variables/__tests__/VariableInput.test.tsx +550 -0
  466. package/src/components/variables/__tests__/VariableTag.test.tsx +347 -0
  467. package/src/components/variables/__tests__/test-utils.tsx +62 -0
  468. package/src/components/variables/__tests__/utils.test.ts +310 -0
  469. package/src/components/variables/index.ts +16 -0
  470. package/src/components/variables/types.ts +100 -0
  471. package/src/components/variables/useResolvedMetaTree.ts +76 -0
  472. package/src/components/variables/utils.ts +192 -0
  473. package/src/data-source/__tests__/collection.test.ts +58 -0
  474. package/src/data-source/__tests__/index.test.ts +82 -0
  475. package/src/data-source/__tests__/jioToJoiSchema.test.ts +56 -0
  476. package/src/data-source/__tests__/sortCollectionsByInherits.test.ts +125 -0
  477. package/src/data-source/index.ts +816 -0
  478. package/src/data-source/jioToJoiSchema.ts +103 -0
  479. package/src/data-source/sortCollectionsByInherits.ts +61 -0
  480. package/src/decorators/index.ts +10 -0
  481. package/src/decorators/largeField.ts +14 -0
  482. package/src/emitter.ts +33 -0
  483. package/src/event-registry/BaseEventRegistry.ts +40 -0
  484. package/src/event-registry/EngineEventRegistry.ts +26 -0
  485. package/src/event-registry/ModelEventRegistry.ts +69 -0
  486. package/src/event-registry/__tests__/engineEventRegistry.test.ts +48 -0
  487. package/src/executor/FlowExecutor.ts +302 -0
  488. package/src/executor/__tests__/eventStep.test.ts +157 -0
  489. package/src/executor/__tests__/flowExecutor.test.ts +309 -0
  490. package/src/flow-registry/BaseFlowRegistry.ts +91 -0
  491. package/src/flow-registry/GlobalFlowRegistry.ts +82 -0
  492. package/src/flow-registry/InstanceFlowRegistry.ts +39 -0
  493. package/src/flow-registry/__tests__/globalFlowRegistry.test.ts +141 -0
  494. package/src/flow-registry/__tests__/instance-and-global-registry.test.ts +67 -0
  495. package/src/flow-registry/__tests__/instanceFlowRegistry.test.ts +83 -0
  496. package/src/flow-registry/index.ts +12 -0
  497. package/src/flowContext.ts +1742 -0
  498. package/src/flowEngine.ts +905 -0
  499. package/src/flowI18n.ts +96 -0
  500. package/src/flowSettings.ts +1045 -0
  501. package/src/hooks/index.ts +15 -0
  502. package/src/hooks/useApplyAutoFlows.ts +53 -0
  503. package/src/hooks/useFlowModel.tsx +59 -0
  504. package/src/hooks/useFlowModelById.ts +37 -0
  505. package/src/hooks/useFlowSettingsContext.tsx +37 -0
  506. package/src/hooks/useFlowStep.tsx +19 -0
  507. package/src/hooks/useNiceDropdownMaxHeight.ts +34 -0
  508. package/src/index.ts +46 -0
  509. package/src/locale/en-US.json +61 -0
  510. package/src/locale/index.ts +38 -0
  511. package/src/locale/zh-CN.json +61 -0
  512. package/src/models/CollectionFieldModel.tsx +306 -0
  513. package/src/models/DisplayItemModel.tsx +13 -0
  514. package/src/models/EditableItemModel.tsx +13 -0
  515. package/src/models/FilterableItemModel.tsx +13 -0
  516. package/src/models/__tests__/CollectionFieldModel.test.ts +122 -0
  517. package/src/models/__tests__/defaultParams-on-create.test.ts +83 -0
  518. package/src/models/__tests__/flow-model-oninit.test.ts +44 -0
  519. package/src/models/__tests__/flowModel.actions.integration.test.ts +100 -0
  520. package/src/models/__tests__/flowModel.getFlows.sort.test.ts +100 -0
  521. package/src/models/__tests__/flowModel.test.ts +2869 -0
  522. package/src/models/__tests__/flowRegistry.test.ts +512 -0
  523. package/src/models/__tests__/forkFlowModel.test.ts +1047 -0
  524. package/src/models/__tests__/model-actions.test.ts +70 -0
  525. package/src/models/__tests__/model-events.test.ts +69 -0
  526. package/src/models/flowModel.tsx +1421 -0
  527. package/src/models/forkFlowModel.ts +319 -0
  528. package/src/models/index.ts +17 -0
  529. package/src/provider.tsx +103 -0
  530. package/src/resources/__tests__/apiResource.test.ts +201 -0
  531. package/src/resources/__tests__/baseRecordResource.test.ts +262 -0
  532. package/src/resources/__tests__/filterItem.test.ts +260 -0
  533. package/src/resources/__tests__/flowResource.test.ts +127 -0
  534. package/src/resources/apiResource.ts +148 -0
  535. package/src/resources/baseRecordResource.ts +279 -0
  536. package/src/resources/filterItem.ts +74 -0
  537. package/src/resources/flowResource.ts +143 -0
  538. package/src/resources/index.ts +17 -0
  539. package/src/resources/multiRecordResource.ts +219 -0
  540. package/src/resources/singleRecordResource.ts +83 -0
  541. package/src/resources/sqlResource.ts +299 -0
  542. package/src/runjs-context/contexts/FormJSFieldItemRunJSContext.ts +46 -0
  543. package/src/runjs-context/contexts/JSBlockRunJSContext.ts +64 -0
  544. package/src/runjs-context/contexts/JSCollectionActionRunJSContext.ts +31 -0
  545. package/src/runjs-context/contexts/JSColumnRunJSContext.ts +58 -0
  546. package/src/runjs-context/contexts/JSFieldRunJSContext.ts +48 -0
  547. package/src/runjs-context/contexts/JSItemRunJSContext.ts +43 -0
  548. package/src/runjs-context/contexts/JSRecordActionRunJSContext.ts +33 -0
  549. package/src/runjs-context/contexts/base.ts +155 -0
  550. package/src/runjs-context/helpers.ts +58 -0
  551. package/src/runjs-context/registry.ts +34 -0
  552. package/src/runjs-context/setup.ts +51 -0
  553. package/src/runjs-context/snippets/global/api-request.snippet.ts +38 -0
  554. package/src/runjs-context/snippets/global/import-esm.snippet.ts +39 -0
  555. package/src/runjs-context/snippets/global/message-error.snippet.ts +26 -0
  556. package/src/runjs-context/snippets/global/message-success.snippet.ts +26 -0
  557. package/src/runjs-context/snippets/global/notification-open.snippet.ts +31 -0
  558. package/src/runjs-context/snippets/global/open-view-dialog.snippet.ts +33 -0
  559. package/src/runjs-context/snippets/global/open-view-drawer.snippet.ts +33 -0
  560. package/src/runjs-context/snippets/global/query-selector.snippet.ts +34 -0
  561. package/src/runjs-context/snippets/global/require-amd.snippet.ts +30 -0
  562. package/src/runjs-context/snippets/global/window-open.snippet.ts +29 -0
  563. package/src/runjs-context/snippets/index.ts +195 -0
  564. package/src/runjs-context/snippets/scene/block/add-event-listener.snippet.ts +41 -0
  565. package/src/runjs-context/snippets/scene/block/api-fetch-render-list.snippet.ts +45 -0
  566. package/src/runjs-context/snippets/scene/block/chartjs-bar.snippet.ts +80 -0
  567. package/src/runjs-context/snippets/scene/block/echarts-init.snippet.ts +44 -0
  568. package/src/runjs-context/snippets/scene/block/render-button-handler.snippet.ts +33 -0
  569. package/src/runjs-context/snippets/scene/block/render-iframe.snippet.ts +38 -0
  570. package/src/runjs-context/snippets/scene/block/render-info-card.snippet.ts +53 -0
  571. package/src/runjs-context/snippets/scene/block/render-react.snippet.ts +38 -0
  572. package/src/runjs-context/snippets/scene/block/render-statistics.snippet.ts +81 -0
  573. package/src/runjs-context/snippets/scene/block/render-timeline.snippet.ts +66 -0
  574. package/src/runjs-context/snippets/scene/block/resource-example.snippet.ts +46 -0
  575. package/src/runjs-context/snippets/scene/block/three-users-orbit.snippet.ts +264 -0
  576. package/src/runjs-context/snippets/scene/block/vue-component.snippet.ts +105 -0
  577. package/src/runjs-context/snippets/scene/detail/color-by-value.snippet.ts +33 -0
  578. package/src/runjs-context/snippets/scene/detail/copy-to-clipboard.snippet.ts +45 -0
  579. package/src/runjs-context/snippets/scene/detail/format-number.snippet.ts +32 -0
  580. package/src/runjs-context/snippets/scene/detail/innerHTML-value.snippet.ts +31 -0
  581. package/src/runjs-context/snippets/scene/detail/percentage-bar.snippet.ts +63 -0
  582. package/src/runjs-context/snippets/scene/detail/relative-time.snippet.ts +61 -0
  583. package/src/runjs-context/snippets/scene/detail/status-tag.snippet.ts +55 -0
  584. package/src/runjs-context/snippets/scene/form/calculate-total.snippet.ts +44 -0
  585. package/src/runjs-context/snippets/scene/form/cascade-select.snippet.ts +62 -0
  586. package/src/runjs-context/snippets/scene/form/conditional-required.snippet.ts +45 -0
  587. package/src/runjs-context/snippets/scene/form/copy-field-values.snippet.ts +55 -0
  588. package/src/runjs-context/snippets/scene/form/render-basic.snippet.ts +39 -0
  589. package/src/runjs-context/snippets/scene/form/set-disabled.snippet.ts +50 -0
  590. package/src/runjs-context/snippets/scene/form/set-field-value.snippet.ts +49 -0
  591. package/src/runjs-context/snippets/scene/form/set-required.snippet.ts +50 -0
  592. package/src/runjs-context/snippets/scene/form/toggle-multiple-fields.snippet.ts +48 -0
  593. package/src/runjs-context/snippets/scene/form/toggle-visible.snippet.ts +50 -0
  594. package/src/runjs-context/snippets/scene/table/cell-open-dialog.snippet.ts +45 -0
  595. package/src/runjs-context/snippets/scene/table/collection-selected-count.snippet.ts +34 -0
  596. package/src/runjs-context/snippets/scene/table/concat-fields.snippet.ts +60 -0
  597. package/src/runjs-context/snippets/scene/table/destroy-selected.snippet.ts +36 -0
  598. package/src/runjs-context/snippets/scene/table/export-selected-json.snippet.ts +45 -0
  599. package/src/runjs-context/snippets/scene/table/iterate-selected-rows.snippet.ts +33 -0
  600. package/src/runjs-context/snippets/types.ts +21 -0
  601. package/src/types.ts +484 -0
  602. package/src/utils/__tests__/context.test.ts +93 -0
  603. package/src/utils/__tests__/params-resolvers.test.ts +652 -0
  604. package/src/utils/__tests__/parsePathnameToViewParams.test.ts +104 -0
  605. package/src/utils/__tests__/safeGlobals.test.ts +29 -0
  606. package/src/utils/__tests__/utils.test.ts +1021 -0
  607. package/src/utils/__tests__/variablesParams.test.ts +52 -0
  608. package/src/utils/autoFlowError.ts +29 -0
  609. package/src/utils/constants.ts +60 -0
  610. package/src/utils/context.ts +70 -0
  611. package/src/utils/createCollectionContextMeta.ts +122 -0
  612. package/src/utils/exceptions.ts +36 -0
  613. package/src/utils/flow-definitions.ts +16 -0
  614. package/src/utils/index.ts +62 -0
  615. package/src/utils/inheritance.ts +39 -0
  616. package/src/utils/params-resolvers.ts +482 -0
  617. package/src/utils/parsePathnameToViewParams.ts +103 -0
  618. package/src/utils/safeGlobals.ts +188 -0
  619. package/src/utils/schema-utils.ts +201 -0
  620. package/src/utils/serverContextParams.ts +112 -0
  621. package/src/utils/setupRuntimeContextSteps.ts +89 -0
  622. package/src/utils/translation.ts +37 -0
  623. package/src/utils/variablesParams.ts +184 -0
  624. package/src/views/DialogComponent.tsx +79 -0
  625. package/src/views/DrawerComponent.tsx +72 -0
  626. package/src/views/FlowView.tsx +103 -0
  627. package/src/views/PageComponent.tsx +150 -0
  628. package/src/views/ViewNavigation.ts +122 -0
  629. package/src/views/__tests__/FlowView.test.ts +31 -0
  630. package/src/views/__tests__/ViewNavigation.test.ts +191 -0
  631. package/src/views/__tests__/usePatchElement.test.tsx +28 -0
  632. package/src/views/createViewMeta.ts +402 -0
  633. package/src/views/index.tsx +15 -0
  634. package/src/views/useDialog.tsx +194 -0
  635. package/src/views/useDrawer.tsx +229 -0
  636. package/src/views/usePage.tsx +185 -0
  637. package/src/views/usePatchElement.tsx +27 -0
  638. package/src/views/usePopover.tsx +131 -0
@@ -0,0 +1,294 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __create = Object.create;
11
+ var __defProp = Object.defineProperty;
12
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
13
+ var __getOwnPropNames = Object.getOwnPropertyNames;
14
+ var __getProtoOf = Object.getPrototypeOf;
15
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
16
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
17
+ var __export = (target, all) => {
18
+ for (var name in all)
19
+ __defProp(target, name, { get: all[name], enumerable: true });
20
+ };
21
+ var __copyProps = (to, from, except, desc) => {
22
+ if (from && typeof from === "object" || typeof from === "function") {
23
+ for (let key of __getOwnPropNames(from))
24
+ if (!__hasOwnProp.call(to, key) && key !== except)
25
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
26
+ }
27
+ return to;
28
+ };
29
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
30
+ // If the importer is in node compatibility mode or this is not an ESM
31
+ // file that has been converted to a CommonJS file using a Babel-
32
+ // compatible transform (i.e. "__esModule" has not been set), then set
33
+ // "default" to the CommonJS "module.exports" for node compatibility.
34
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
35
+ mod
36
+ ));
37
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
38
+ var sqlResource_exports = {};
39
+ __export(sqlResource_exports, {
40
+ FlowSQLRepository: () => FlowSQLRepository,
41
+ SQLResource: () => SQLResource
42
+ });
43
+ module.exports = __toCommonJS(sqlResource_exports);
44
+ var import_reactive = require("@formily/reactive");
45
+ var import_lodash = __toESM(require("lodash"));
46
+ var import_flowContext = require("../flowContext");
47
+ var import_baseRecordResource = require("./baseRecordResource");
48
+ function transformSQL(template) {
49
+ let index = 1;
50
+ const bind = {};
51
+ const sql = template.replace(/{{\s*([^}]+)\s*}}/g, (_2, expr) => {
52
+ const key = `__var${index}`;
53
+ bind[key] = `{{${expr.trim()}}}`;
54
+ index++;
55
+ return `$${key}`;
56
+ });
57
+ return { sql, bind };
58
+ }
59
+ __name(transformSQL, "transformSQL");
60
+ const _FlowSQLRepository = class _FlowSQLRepository {
61
+ ctx;
62
+ constructor(ctx) {
63
+ this.ctx = new import_flowContext.FlowContext();
64
+ this.ctx.addDelegate(ctx);
65
+ this.ctx.defineProperty("offset", {
66
+ get: /* @__PURE__ */ __name(() => 0, "get"),
67
+ cache: false
68
+ });
69
+ this.ctx.defineProperty("limit", {
70
+ get: /* @__PURE__ */ __name(() => 20, "get"),
71
+ cache: false
72
+ });
73
+ }
74
+ async run(sql, options = {}) {
75
+ const result = transformSQL(sql);
76
+ const bind = await this.ctx.resolveJsonTemplate(result.bind);
77
+ const { data } = await this.ctx.api.request({
78
+ method: "POST",
79
+ url: "flowSql:run",
80
+ data: {
81
+ sql: result.sql,
82
+ ...options,
83
+ bind: {
84
+ ...bind,
85
+ ...options.bind
86
+ }
87
+ }
88
+ });
89
+ return data == null ? void 0 : data.data;
90
+ }
91
+ async save(data) {
92
+ await this.ctx.api.request({
93
+ method: "POST",
94
+ url: "flowSql:save",
95
+ data: {
96
+ ...data
97
+ }
98
+ });
99
+ }
100
+ async runById(uid, options) {
101
+ const response = await this.ctx.api.request({
102
+ method: "GET",
103
+ url: "flowSql:getBind",
104
+ params: {
105
+ uid
106
+ }
107
+ });
108
+ const bind = await this.ctx.resolveJsonTemplate(response.data.data || {});
109
+ const { data } = await this.ctx.api.request({
110
+ method: "POST",
111
+ url: "flowSql:runById",
112
+ data: {
113
+ uid,
114
+ ...options,
115
+ bind: {
116
+ ...bind,
117
+ ...options.bind
118
+ }
119
+ }
120
+ });
121
+ return data == null ? void 0 : data.data;
122
+ }
123
+ async destroy(uid) {
124
+ await this.ctx.api.request({
125
+ url: "flowSql:destroy",
126
+ params: {
127
+ filterByTk: uid
128
+ }
129
+ });
130
+ }
131
+ };
132
+ __name(_FlowSQLRepository, "FlowSQLRepository");
133
+ let FlowSQLRepository = _FlowSQLRepository;
134
+ const _SQLResource = class _SQLResource extends import_baseRecordResource.BaseRecordResource {
135
+ _data = import_reactive.observable.ref(null);
136
+ _meta = import_reactive.observable.ref({});
137
+ refreshTimer = null;
138
+ _debugEnabled = false;
139
+ _sql;
140
+ // 请求配置 - 与 APIClient 接口保持一致
141
+ request = {
142
+ // url: null as string | null,
143
+ method: "post",
144
+ params: {},
145
+ data: {},
146
+ headers: {}
147
+ };
148
+ get refreshActionName() {
149
+ return this._debugEnabled ? "run" : "runById";
150
+ }
151
+ get supportsFilter() {
152
+ return true;
153
+ }
154
+ constructor(context) {
155
+ super(context);
156
+ context.defineProperty("limit", {
157
+ get: /* @__PURE__ */ __name(() => this.getPageSize(), "get"),
158
+ cache: false
159
+ });
160
+ context.defineProperty("offset", {
161
+ get: /* @__PURE__ */ __name(() => {
162
+ const page = this.getPage();
163
+ const pageSize = this.getPageSize();
164
+ return (page - 1) * pageSize;
165
+ }, "get"),
166
+ cache: false
167
+ });
168
+ }
169
+ buildURL(action) {
170
+ return `flowSql:${action || this.refreshActionName}`;
171
+ }
172
+ setPage(page) {
173
+ this.addRequestParameter("page", page);
174
+ return this.setMeta({ page });
175
+ }
176
+ getPage() {
177
+ return this.getMeta("page") || 1;
178
+ }
179
+ setPageSize(pageSize) {
180
+ this.addRequestParameter("pageSize", pageSize);
181
+ return this.setMeta({ pageSize });
182
+ }
183
+ setDebug(enabled) {
184
+ this._debugEnabled = enabled;
185
+ return this;
186
+ }
187
+ getPageSize() {
188
+ return this.getMeta("pageSize") || 20;
189
+ }
190
+ async next() {
191
+ this.setPage(this.getPage() + 1);
192
+ await this.refresh();
193
+ }
194
+ async previous() {
195
+ if (this.getPage() > 1) {
196
+ this.setPage(this.getPage() - 1);
197
+ await this.refresh();
198
+ }
199
+ }
200
+ async goto(page) {
201
+ if (page > 0) {
202
+ this.request.params.page = page;
203
+ await this.refresh();
204
+ }
205
+ }
206
+ setDataSourceKey(dataSourceKey) {
207
+ this.request.data.dataSourceKey = dataSourceKey;
208
+ return this;
209
+ }
210
+ setSQLType(type) {
211
+ this.request.data.type = type;
212
+ return this;
213
+ }
214
+ setSQL(sql) {
215
+ this._sql = sql;
216
+ return this;
217
+ }
218
+ setFilterByTk(filterByTk) {
219
+ this.request.data.uid = filterByTk;
220
+ return this;
221
+ }
222
+ setFilter(filter) {
223
+ this.request.data.filter = filter;
224
+ return this;
225
+ }
226
+ setBind(bind) {
227
+ this.request.data.bind = bind;
228
+ return this;
229
+ }
230
+ async run() {
231
+ return this._debugEnabled ? await this.runBySQL() : await this.runById();
232
+ }
233
+ async runBySQL() {
234
+ const sql = this._sql;
235
+ const result = transformSQL(sql);
236
+ const bind = await this.context.resolveJsonTemplate(result.bind);
237
+ const options = import_lodash.default.cloneDeep({
238
+ method: "post",
239
+ ...this.getRefreshRequestOptions()
240
+ });
241
+ options.data.bind = bind;
242
+ options.data.sql = result.sql;
243
+ return await this.runAction("run", options);
244
+ }
245
+ async runById() {
246
+ const { data } = await this.runAction("getBind", {
247
+ method: "get",
248
+ params: {
249
+ uid: this.request.data.uid
250
+ }
251
+ });
252
+ const bind = await this.context.resolveJsonTemplate(data);
253
+ this.setBind(bind);
254
+ return await this.runAction("runById", {
255
+ method: "post",
256
+ ...this.getRefreshRequestOptions()
257
+ });
258
+ }
259
+ /**
260
+ * 在同一个事件循环内多次调用 refresh 方法时,只有最后一次调用会生效。避免触发多次相同的接口请求。
261
+ * @returns
262
+ */
263
+ async refresh() {
264
+ if (this.refreshTimer) {
265
+ clearTimeout(this.refreshTimer);
266
+ }
267
+ return new Promise((resolve, reject) => {
268
+ this.refreshTimer = setTimeout(async () => {
269
+ try {
270
+ this.clearError();
271
+ this.loading = true;
272
+ const { data, meta } = await this.run();
273
+ this.setData(data).setMeta(meta);
274
+ this.emit("refresh");
275
+ this.loading = false;
276
+ resolve();
277
+ } catch (error) {
278
+ this.setError(error);
279
+ reject(error instanceof Error ? error : new Error(String(error)));
280
+ } finally {
281
+ this.refreshTimer = null;
282
+ this.loading = false;
283
+ }
284
+ });
285
+ });
286
+ }
287
+ };
288
+ __name(_SQLResource, "SQLResource");
289
+ let SQLResource = _SQLResource;
290
+ // Annotate the CommonJS export names for ESM import in node:
291
+ 0 && (module.exports = {
292
+ FlowSQLRepository,
293
+ SQLResource
294
+ });
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import { FlowRunJSContext } from '../../flowContext';
10
+ export declare class FormJSFieldItemRunJSContext extends FlowRunJSContext {
11
+ }
@@ -0,0 +1,73 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
15
+ var __export = (target, all) => {
16
+ for (var name in all)
17
+ __defProp(target, name, { get: all[name], enumerable: true });
18
+ };
19
+ var __copyProps = (to, from, except, desc) => {
20
+ if (from && typeof from === "object" || typeof from === "function") {
21
+ for (let key of __getOwnPropNames(from))
22
+ if (!__hasOwnProp.call(to, key) && key !== except)
23
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
24
+ }
25
+ return to;
26
+ };
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var FormJSFieldItemRunJSContext_exports = {};
29
+ __export(FormJSFieldItemRunJSContext_exports, {
30
+ FormJSFieldItemRunJSContext: () => FormJSFieldItemRunJSContext
31
+ });
32
+ module.exports = __toCommonJS(FormJSFieldItemRunJSContext_exports);
33
+ var import_flowContext = require("../../flowContext");
34
+ const _FormJSFieldItemRunJSContext = class _FormJSFieldItemRunJSContext extends import_flowContext.FlowRunJSContext {
35
+ };
36
+ __name(_FormJSFieldItemRunJSContext, "FormJSFieldItemRunJSContext");
37
+ let FormJSFieldItemRunJSContext = _FormJSFieldItemRunJSContext;
38
+ FormJSFieldItemRunJSContext.define({
39
+ label: "FormJSFieldItem RunJS context",
40
+ properties: {
41
+ element: `ElementProxy instance providing a safe DOM container for form field rendering.
42
+ Supports innerHTML, append, and other DOM manipulation methods.`,
43
+ value: `Current field value (read-only in display mode; in controlled scenarios, use setProps to modify).`,
44
+ record: `Current record data object (read-only).
45
+ Contains all field values of the parent record.`
46
+ },
47
+ methods: {
48
+ onRefReady: `Wait for form field container DOM element to be ready before executing callback.
49
+ Parameters: (ref: React.RefObject, callback: (element: HTMLElement) => void, timeout?: number) => void`,
50
+ setProps: `Set form field properties programmatically.
51
+ Parameters: (fieldModel: any, props: { value?: any, disabled?: boolean, visible?: boolean }) => void
52
+ Example: ctx.setProps(fieldModel, { value: "new value" })`
53
+ }
54
+ });
55
+ FormJSFieldItemRunJSContext.define(
56
+ {
57
+ label: "\u8868\u5355 JS \u5B57\u6BB5\u9879 RunJS \u4E0A\u4E0B\u6587",
58
+ properties: {
59
+ element: "ElementProxy\uFF0C\u8868\u5355\u5B57\u6BB5\u5BB9\u5668",
60
+ value: "\u5B57\u6BB5\u503C\uFF08\u5C55\u793A\u6A21\u5F0F\u4E3A\u53EA\u8BFB\uFF1B\u53D7\u63A7\u573A\u666F\u7528 setProps \u4FEE\u6539\uFF09",
61
+ record: "\u5F53\u524D\u8BB0\u5F55\uFF08\u53EA\u8BFB\uFF09"
62
+ },
63
+ methods: {
64
+ onRefReady: "\u5BB9\u5668\u5C31\u7EEA\u56DE\u8C03",
65
+ setProps: "\u8BBE\u7F6E\u8868\u5355\u9879\u5C5E\u6027\uFF1A`setProps(fieldModel, { value })`\uFF08\u7531\u8054\u52A8/\u8868\u5355\u4E0A\u4E0B\u6587\u63D0\u4F9B\uFF09"
66
+ }
67
+ },
68
+ { locale: "zh-CN" }
69
+ );
70
+ // Annotate the CommonJS export names for ESM import in node:
71
+ 0 && (module.exports = {
72
+ FormJSFieldItemRunJSContext
73
+ });
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import { FlowRunJSContext } from '../../flowContext';
10
+ export declare class JSBlockRunJSContext extends FlowRunJSContext {
11
+ }
@@ -0,0 +1,91 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
15
+ var __export = (target, all) => {
16
+ for (var name in all)
17
+ __defProp(target, name, { get: all[name], enumerable: true });
18
+ };
19
+ var __copyProps = (to, from, except, desc) => {
20
+ if (from && typeof from === "object" || typeof from === "function") {
21
+ for (let key of __getOwnPropNames(from))
22
+ if (!__hasOwnProp.call(to, key) && key !== except)
23
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
24
+ }
25
+ return to;
26
+ };
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var JSBlockRunJSContext_exports = {};
29
+ __export(JSBlockRunJSContext_exports, {
30
+ JSBlockRunJSContext: () => JSBlockRunJSContext
31
+ });
32
+ module.exports = __toCommonJS(JSBlockRunJSContext_exports);
33
+ var import_flowContext = require("../../flowContext");
34
+ const _JSBlockRunJSContext = class _JSBlockRunJSContext extends import_flowContext.FlowRunJSContext {
35
+ };
36
+ __name(_JSBlockRunJSContext, "JSBlockRunJSContext");
37
+ let JSBlockRunJSContext = _JSBlockRunJSContext;
38
+ JSBlockRunJSContext.define({
39
+ label: "RunJS context",
40
+ properties: {
41
+ element: {
42
+ description: `ElementProxy instance providing a safe DOM container.
43
+ Supports innerHTML, append, and other DOM manipulation methods.
44
+ Use this to render content in the JS block.`,
45
+ detail: "ElementProxy",
46
+ properties: {
47
+ innerHTML: "Set or read the HTML content of the container element."
48
+ }
49
+ },
50
+ record: `Current record data object (read-only).
51
+ Available when the JS block is within a data block or detail view context.`,
52
+ value: "Current value of the field or component, if available in the current context.",
53
+ React: "React library",
54
+ antd: "Ant Design library"
55
+ },
56
+ methods: {
57
+ onRefReady: `Wait for container DOM element to be ready before executing callback.
58
+ Parameters: (ref: React.RefObject, callback: (element: HTMLElement) => void, timeout?: number) => void
59
+ Example: ctx.onRefReady(ctx.ref, (el) => { el.innerHTML = "Ready!" })`,
60
+ requireAsync: "Load external library: `const lib = await ctx.requireAsync(url)`",
61
+ importAsync: "Dynamically import ESM module: `const mod = await ctx.importAsync(url)`"
62
+ }
63
+ });
64
+ JSBlockRunJSContext.define(
65
+ {
66
+ label: "RunJS \u4E0A\u4E0B\u6587",
67
+ properties: {
68
+ element: {
69
+ description: "ElementProxy\uFF0C\u5B89\u5168\u7684 DOM \u5BB9\u5668\uFF0C\u652F\u6301 innerHTML/append \u7B49",
70
+ detail: "ElementProxy",
71
+ properties: {
72
+ innerHTML: "\u8BFB\u53D6\u6216\u8BBE\u7F6E\u5BB9\u5668\u7684 HTML \u5185\u5BB9"
73
+ }
74
+ },
75
+ record: "\u5F53\u524D\u8BB0\u5F55\uFF08\u53EA\u8BFB\uFF0C\u7528\u4E8E\u6570\u636E\u533A\u5757/\u8BE6\u60C5\u7B49\u573A\u666F\uFF09",
76
+ value: "\u5F53\u524D\u503C\uFF08\u82E5\u5B58\u5728\uFF09",
77
+ React: "React \u5E93",
78
+ antd: "Ant Design \u5E93"
79
+ },
80
+ methods: {
81
+ onRefReady: "\u5BB9\u5668 ref \u5C31\u7EEA\u56DE\u8C03\uFF1A\n```js\nctx.onRefReady(ctx.ref, el => { /* ... */ })\n```",
82
+ requireAsync: "\u52A0\u8F7D\u5916\u90E8\u5E93\uFF1A`const lib = await ctx.requireAsync(url)`",
83
+ importAsync: "\u6309 URL \u52A8\u6001\u5BFC\u5165 ESM \u6A21\u5757\uFF1A`const mod = await ctx.importAsync(url)`"
84
+ }
85
+ },
86
+ { locale: "zh-CN" }
87
+ );
88
+ // Annotate the CommonJS export names for ESM import in node:
89
+ 0 && (module.exports = {
90
+ JSBlockRunJSContext
91
+ });
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import { FlowRunJSContext } from '../../flowContext';
10
+ export declare class JSCollectionActionRunJSContext extends FlowRunJSContext {
11
+ }
@@ -0,0 +1,58 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
15
+ var __export = (target, all) => {
16
+ for (var name in all)
17
+ __defProp(target, name, { get: all[name], enumerable: true });
18
+ };
19
+ var __copyProps = (to, from, except, desc) => {
20
+ if (from && typeof from === "object" || typeof from === "function") {
21
+ for (let key of __getOwnPropNames(from))
22
+ if (!__hasOwnProp.call(to, key) && key !== except)
23
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
24
+ }
25
+ return to;
26
+ };
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var JSCollectionActionRunJSContext_exports = {};
29
+ __export(JSCollectionActionRunJSContext_exports, {
30
+ JSCollectionActionRunJSContext: () => JSCollectionActionRunJSContext
31
+ });
32
+ module.exports = __toCommonJS(JSCollectionActionRunJSContext_exports);
33
+ var import_flowContext = require("../../flowContext");
34
+ const _JSCollectionActionRunJSContext = class _JSCollectionActionRunJSContext extends import_flowContext.FlowRunJSContext {
35
+ };
36
+ __name(_JSCollectionActionRunJSContext, "JSCollectionActionRunJSContext");
37
+ let JSCollectionActionRunJSContext = _JSCollectionActionRunJSContext;
38
+ JSCollectionActionRunJSContext.define({
39
+ label: "JSCollectionAction RunJS context",
40
+ properties: {
41
+ resource: `Collection resource instance providing access to selected rows, pagination, and data operations.
42
+ Use ctx.resource.selectedRows to get selected records.
43
+ Use ctx.resource.pagination for page info.`
44
+ }
45
+ });
46
+ JSCollectionActionRunJSContext.define(
47
+ {
48
+ label: "JS \u96C6\u5408\u52A8\u4F5C RunJS \u4E0A\u4E0B\u6587",
49
+ properties: {
50
+ resource: "\u5217\u8868\u8D44\u6E90\uFF08\u5305\u542B\u9009\u4E2D\u884C/\u5206\u9875\u4FE1\u606F\u7B49\uFF09"
51
+ }
52
+ },
53
+ { locale: "zh-CN" }
54
+ );
55
+ // Annotate the CommonJS export names for ESM import in node:
56
+ 0 && (module.exports = {
57
+ JSCollectionActionRunJSContext
58
+ });
@@ -0,0 +1,15 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import { FlowRunJSContext } from '../../flowContext';
10
+ /**
11
+ * RunJS context for JSColumnModel (table custom column).
12
+ * Focused on per-row rendering with access to current record and cell element.
13
+ */
14
+ export declare class JSColumnRunJSContext extends FlowRunJSContext {
15
+ }
@@ -0,0 +1,78 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
15
+ var __export = (target, all) => {
16
+ for (var name in all)
17
+ __defProp(target, name, { get: all[name], enumerable: true });
18
+ };
19
+ var __copyProps = (to, from, except, desc) => {
20
+ if (from && typeof from === "object" || typeof from === "function") {
21
+ for (let key of __getOwnPropNames(from))
22
+ if (!__hasOwnProp.call(to, key) && key !== except)
23
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
24
+ }
25
+ return to;
26
+ };
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var JSColumnRunJSContext_exports = {};
29
+ __export(JSColumnRunJSContext_exports, {
30
+ JSColumnRunJSContext: () => JSColumnRunJSContext
31
+ });
32
+ module.exports = __toCommonJS(JSColumnRunJSContext_exports);
33
+ var import_flowContext = require("../../flowContext");
34
+ const _JSColumnRunJSContext = class _JSColumnRunJSContext extends import_flowContext.FlowRunJSContext {
35
+ };
36
+ __name(_JSColumnRunJSContext, "JSColumnRunJSContext");
37
+ let JSColumnRunJSContext = _JSColumnRunJSContext;
38
+ JSColumnRunJSContext.define({
39
+ label: "JSColumn RunJS context",
40
+ properties: {
41
+ element: "ElementProxy instance providing a safe DOM container for the current table cell. Supports innerHTML/append and basic DOM APIs.",
42
+ record: "Current row record object (read-only).",
43
+ recordIndex: "Index of the current row in the page (0-based).",
44
+ collection: "Collection definition metadata (read-only).",
45
+ viewer: "View controller providing dialog/drawer/embed helpers for interactions initiated from the cell (e.g., open details).",
46
+ React: "React library",
47
+ antd: "Ant Design library"
48
+ },
49
+ methods: {
50
+ onRefReady: "Wait for cell DOM element to be ready before executing callback. Parameters: (ref, callback, timeout?) => void",
51
+ requireAsync: "Load external library by URL: `const lib = await ctx.requireAsync(url)`",
52
+ importAsync: "Dynamically import ESM module by URL: `const mod = await ctx.importAsync(url)`"
53
+ }
54
+ });
55
+ JSColumnRunJSContext.define(
56
+ {
57
+ label: "JS \u5217 RunJS \u4E0A\u4E0B\u6587",
58
+ properties: {
59
+ element: "ElementProxy\uFF0C\u8868\u683C\u5355\u5143\u683C\u7684\u5B89\u5168 DOM \u5BB9\u5668\uFF0C\u652F\u6301 innerHTML/append \u7B49",
60
+ record: "\u5F53\u524D\u884C\u8BB0\u5F55\u5BF9\u8C61\uFF08\u53EA\u8BFB\uFF09",
61
+ recordIndex: "\u5F53\u524D\u884C\u7D22\u5F15\uFF08\u4ECE 0 \u5F00\u59CB\uFF09",
62
+ collection: "\u96C6\u5408\u5B9A\u4E49\u5143\u6570\u636E\uFF08\u53EA\u8BFB\uFF09",
63
+ viewer: "\u89C6\u56FE\u63A7\u5236\u5668\uFF0C\u53EF\u7528\u4E8E\u5728\u5355\u5143\u683C\u4E2D\u89E6\u53D1\u62BD\u5C49/\u5BF9\u8BDD\u6846/\u5185\u5D4C\u7B49\u4EA4\u4E92",
64
+ React: "React \u5E93",
65
+ antd: "Ant Design \u5E93"
66
+ },
67
+ methods: {
68
+ onRefReady: "\u7B49\u5F85\u5355\u5143\u683C DOM \u5C31\u7EEA\u540E\u6267\u884C\u56DE\u8C03\u3002\u53C2\u6570\uFF1A(ref, callback, timeout?)",
69
+ requireAsync: "\u6309 URL \u5F02\u6B65\u52A0\u8F7D\u5916\u90E8\u5E93\uFF1A`const lib = await ctx.requireAsync(url)`",
70
+ importAsync: "\u6309 URL \u52A8\u6001\u5BFC\u5165 ESM \u6A21\u5757\uFF1A`const mod = await ctx.importAsync(url)`"
71
+ }
72
+ },
73
+ { locale: "zh-CN" }
74
+ );
75
+ // Annotate the CommonJS export names for ESM import in node:
76
+ 0 && (module.exports = {
77
+ JSColumnRunJSContext
78
+ });
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import { FlowRunJSContext } from '../../flowContext';
10
+ export declare class JSFieldRunJSContext extends FlowRunJSContext {
11
+ }