@nocobase/client-v2 2.1.0-alpha.40 → 2.1.0-alpha.46

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 (338) hide show
  1. package/es/Application.d.ts +7 -0
  2. package/es/BaseApplication.d.ts +13 -0
  3. package/es/RouterManager.d.ts +1 -0
  4. package/es/authRedirect.d.ts +12 -0
  5. package/es/collection-field-interface/CollectionFieldInterface.d.ts +51 -15
  6. package/es/collection-field-interface/CollectionFieldInterfaceManager.d.ts +82 -3
  7. package/es/collection-manager/field-configure.d.ts +80 -0
  8. package/es/collection-manager/field-validation.d.ts +43 -0
  9. package/es/collection-manager/filter-operators/index.d.ts +46 -0
  10. package/es/collection-manager/filter-operators/operators.d.ts +30 -0
  11. package/es/collection-manager/interfaces/checkbox.d.ts +1 -41
  12. package/es/collection-manager/interfaces/checkboxGroup.d.ts +12 -44
  13. package/es/collection-manager/interfaces/collection.d.ts +12 -51
  14. package/es/collection-manager/interfaces/color.d.ts +1 -16
  15. package/es/collection-manager/interfaces/createdAt.d.ts +1 -44
  16. package/es/collection-manager/interfaces/createdBy.d.ts +0 -4
  17. package/es/collection-manager/interfaces/dateOnly.d.ts +7 -44
  18. package/es/collection-manager/interfaces/datetime.d.ts +1 -44
  19. package/es/collection-manager/interfaces/datetimeNoTz.d.ts +1 -44
  20. package/es/collection-manager/interfaces/email.d.ts +1 -29
  21. package/es/collection-manager/interfaces/id.d.ts +1 -16
  22. package/es/collection-manager/interfaces/index.d.ts +2 -3
  23. package/es/collection-manager/interfaces/input.d.ts +1 -102
  24. package/es/collection-manager/interfaces/integer.d.ts +1 -95
  25. package/es/collection-manager/interfaces/json.d.ts +16 -7
  26. package/es/collection-manager/interfaces/m2m.d.ts +11 -19
  27. package/es/collection-manager/interfaces/m2o.d.ts +11 -19
  28. package/es/collection-manager/interfaces/markdown.d.ts +1 -63
  29. package/es/collection-manager/interfaces/multipleSelect.d.ts +12 -44
  30. package/es/collection-manager/interfaces/nanoid.d.ts +1 -34
  31. package/es/collection-manager/interfaces/number.d.ts +1 -87
  32. package/es/collection-manager/interfaces/o2m.d.ts +12 -24
  33. package/es/collection-manager/interfaces/obo.d.ts +207 -0
  34. package/es/collection-manager/interfaces/oho.d.ts +207 -0
  35. package/es/collection-manager/interfaces/password.d.ts +1 -56
  36. package/es/collection-manager/interfaces/percent.d.ts +1 -84
  37. package/es/collection-manager/interfaces/phone.d.ts +1 -25
  38. package/es/collection-manager/interfaces/properties/index.d.ts +0 -28
  39. package/es/collection-manager/interfaces/radioGroup.d.ts +1 -29
  40. package/es/collection-manager/interfaces/richText.d.ts +1 -63
  41. package/es/collection-manager/interfaces/select.d.ts +12 -44
  42. package/es/collection-manager/interfaces/snowflake-id.d.ts +1 -34
  43. package/es/collection-manager/interfaces/tableoid.d.ts +1 -10
  44. package/es/collection-manager/interfaces/textarea.d.ts +1 -51
  45. package/es/collection-manager/interfaces/time.d.ts +1 -16
  46. package/es/collection-manager/interfaces/types.d.ts +3 -12
  47. package/es/collection-manager/interfaces/unixTimestamp.d.ts +1 -44
  48. package/es/collection-manager/interfaces/updatedAt.d.ts +1 -44
  49. package/es/collection-manager/interfaces/updatedBy.d.ts +0 -4
  50. package/es/collection-manager/interfaces/url.d.ts +1 -20
  51. package/es/collection-manager/interfaces/uuid.d.ts +1 -34
  52. package/es/collection-manager/template-fields.d.ts +53 -0
  53. package/es/components/KeepAlive.d.ts +22 -0
  54. package/es/components/RouterBridge.d.ts +9 -0
  55. package/es/components/form/DialogFormLayout.d.ts +5 -29
  56. package/es/components/form/TypedVariableInput.d.ts +75 -0
  57. package/es/components/form/VariableInput.d.ts +53 -2
  58. package/es/components/form/filter/CollectionFilter.d.ts +49 -0
  59. package/es/components/form/filter/CollectionFilterItem.d.ts +49 -0
  60. package/es/components/form/filter/DateFilterDynamicComponent.d.ts +57 -0
  61. package/es/components/form/filter/FilterValueInput.d.ts +29 -0
  62. package/es/components/form/filter/index.d.ts +11 -0
  63. package/es/components/form/filter/useFilterActionProps.d.ts +96 -0
  64. package/es/components/form/index.d.ts +2 -0
  65. package/es/data-source/ExtendCollectionsProvider.d.ts +50 -0
  66. package/es/data-source/index.d.ts +9 -0
  67. package/es/flow/FlowPage.d.ts +2 -1
  68. package/es/flow/admin-shell/AdminLayoutRouteCoordinator.d.ts +8 -40
  69. package/es/flow/admin-shell/BaseLayoutModel.d.ts +89 -0
  70. package/es/flow/admin-shell/BaseLayoutRouteCoordinator.d.ts +74 -0
  71. package/es/flow/admin-shell/admin-layout/AdminLayoutEntryGuard.d.ts +12 -0
  72. package/es/flow/admin-shell/admin-layout/AdminLayoutMenuModels.d.ts +1 -0
  73. package/es/flow/admin-shell/admin-layout/AdminLayoutModel.d.ts +7 -92
  74. package/es/flow/admin-shell/admin-layout/AppListRender.d.ts +11 -0
  75. package/es/flow/admin-shell/admin-layout/index.d.ts +3 -0
  76. package/es/flow/admin-shell/admin-layout/useApplications.d.ts +3 -2
  77. package/es/flow/admin-shell/useAdminLayoutRoutePage.d.ts +2 -2
  78. package/es/flow/admin-shell/useLayoutRoutePage.d.ts +23 -0
  79. package/es/flow/components/ConditionBuilder.d.ts +1 -0
  80. package/es/flow/components/FieldAssignRulesEditor.d.ts +3 -1
  81. package/es/flow/components/FieldAssignValueInput.d.ts +1 -0
  82. package/es/flow/components/FlowRoute.d.ts +10 -1
  83. package/es/flow/components/fieldAssignOptions.d.ts +10 -0
  84. package/es/flow/components/filter/LinkageFilterItem.d.ts +1 -0
  85. package/es/flow/components/filter/VariableFilterItem.d.ts +1 -0
  86. package/es/flow/components/filter/index.d.ts +2 -0
  87. package/es/flow/components/filter/metaTreeAssociationDepth.d.ts +13 -0
  88. package/es/flow/components/filter/useFilterOptions.d.ts +66 -0
  89. package/es/flow/index.d.ts +4 -0
  90. package/es/flow/models/base/AssociationFieldGroupModel.d.ts +2 -33
  91. package/es/flow/models/base/PageModel/PageModel.d.ts +3 -1
  92. package/es/flow/models/blocks/assign-form/assignFieldValuesFlow.d.ts +92 -0
  93. package/es/flow/models/blocks/assign-form/index.d.ts +1 -0
  94. package/es/flow/models/blocks/form/FormActionGroupModel.d.ts +1 -0
  95. package/es/flow/models/blocks/form/FormActionModel.d.ts +9 -2
  96. package/es/flow/models/blocks/table/TableBlockModel.d.ts +10 -0
  97. package/es/flow/models/blocks/table/TableColumnModel.d.ts +2 -0
  98. package/es/flow/models/fields/AssociationFieldModel/SubTableFieldModel/index.d.ts +1 -1
  99. package/es/flow-compat/passwordUtils.d.ts +1 -1
  100. package/es/index.d.ts +6 -0
  101. package/es/index.mjs +552 -459
  102. package/es/layout-manager/LayoutContentRoute.d.ts +14 -0
  103. package/es/layout-manager/LayoutManager.d.ts +22 -0
  104. package/es/layout-manager/LayoutRoute.d.ts +14 -0
  105. package/es/layout-manager/index.d.ts +13 -0
  106. package/es/layout-manager/types.d.ts +20 -0
  107. package/es/layout-manager/utils.d.ts +14 -0
  108. package/es/nocobase-buildin-plugin/index.d.ts +3 -10
  109. package/es/settings-center/index.d.ts +1 -1
  110. package/es/settings-center/plugin-manager/BulkEnableButton.d.ts +15 -0
  111. package/es/settings-center/plugin-manager/PluginCard.d.ts +15 -0
  112. package/es/settings-center/plugin-manager/PluginDetail.d.ts +16 -0
  113. package/es/settings-center/{PluginManagerPage.d.ts → plugin-manager/index.d.ts} +1 -7
  114. package/es/settings-center/plugin-manager/types.d.ts +34 -0
  115. package/lib/index.js +552 -459
  116. package/package.json +8 -7
  117. package/src/Application.tsx +51 -12
  118. package/src/BaseApplication.tsx +32 -0
  119. package/src/PluginSettingsManager.ts +1 -1
  120. package/src/RouterManager.tsx +17 -1
  121. package/src/__tests__/PluginSettingsManager.test.ts +41 -2
  122. package/src/__tests__/app.test.tsx +17 -1
  123. package/src/__tests__/globalDeps.test.ts +1 -0
  124. package/src/__tests__/nocobase-buildin-plugin-auth.test.tsx +50 -2
  125. package/src/__tests__/plugin-manager.test.tsx +177 -0
  126. package/src/__tests__/settings-center.test.tsx +24 -2
  127. package/src/authRedirect.ts +43 -0
  128. package/src/collection-field-interface/CollectionFieldInterface.ts +71 -77
  129. package/src/collection-field-interface/CollectionFieldInterfaceManager.ts +201 -4
  130. package/src/collection-manager/field-configure.ts +548 -0
  131. package/src/collection-manager/field-validation.ts +195 -0
  132. package/src/collection-manager/filter-operators/index.ts +176 -0
  133. package/src/collection-manager/{interfaces/properties → filter-operators}/operators.ts +24 -13
  134. package/src/collection-manager/interfaces/checkbox.ts +2 -9
  135. package/src/collection-manager/interfaces/checkboxGroup.ts +2 -10
  136. package/src/collection-manager/interfaces/collection.ts +2 -15
  137. package/src/collection-manager/interfaces/color.ts +2 -2
  138. package/src/collection-manager/interfaces/createdAt.ts +2 -2
  139. package/src/collection-manager/interfaces/createdBy.ts +1 -12
  140. package/src/collection-manager/interfaces/dateOnly.ts +8 -2
  141. package/src/collection-manager/interfaces/datetime.ts +2 -2
  142. package/src/collection-manager/interfaces/datetimeNoTz.ts +2 -2
  143. package/src/collection-manager/interfaces/email.ts +2 -9
  144. package/src/collection-manager/interfaces/id.ts +1 -2
  145. package/src/collection-manager/interfaces/index.ts +2 -3
  146. package/src/collection-manager/interfaces/input.ts +2 -133
  147. package/src/collection-manager/interfaces/integer.ts +2 -71
  148. package/src/collection-manager/interfaces/json.tsx +17 -11
  149. package/src/collection-manager/interfaces/m2m.tsx +0 -21
  150. package/src/collection-manager/interfaces/m2o.tsx +0 -22
  151. package/src/collection-manager/interfaces/markdown.ts +2 -51
  152. package/src/collection-manager/interfaces/multipleSelect.ts +2 -14
  153. package/src/collection-manager/interfaces/nanoid.ts +2 -2
  154. package/src/collection-manager/interfaces/number.ts +2 -85
  155. package/src/collection-manager/interfaces/o2m.tsx +1 -22
  156. package/src/collection-manager/interfaces/obo.tsx +145 -0
  157. package/src/collection-manager/interfaces/oho.tsx +145 -0
  158. package/src/collection-manager/interfaces/password.ts +2 -44
  159. package/src/collection-manager/interfaces/percent.ts +2 -74
  160. package/src/collection-manager/interfaces/phone.ts +2 -2
  161. package/src/collection-manager/interfaces/properties/index.ts +0 -133
  162. package/src/collection-manager/interfaces/radioGroup.ts +2 -2
  163. package/src/collection-manager/interfaces/richText.ts +2 -51
  164. package/src/collection-manager/interfaces/select.ts +2 -14
  165. package/src/collection-manager/interfaces/snowflake-id.ts +2 -2
  166. package/src/collection-manager/interfaces/tableoid.ts +1 -2
  167. package/src/collection-manager/interfaces/textarea.ts +2 -51
  168. package/src/collection-manager/interfaces/time.ts +2 -2
  169. package/src/collection-manager/interfaces/types.ts +4 -12
  170. package/src/collection-manager/interfaces/unixTimestamp.tsx +2 -2
  171. package/src/collection-manager/interfaces/updatedAt.ts +2 -2
  172. package/src/collection-manager/interfaces/updatedBy.ts +1 -12
  173. package/src/collection-manager/interfaces/url.ts +2 -4
  174. package/src/collection-manager/interfaces/uuid.ts +2 -2
  175. package/src/collection-manager/template-fields.ts +109 -0
  176. package/src/components/KeepAlive.tsx +131 -0
  177. package/src/components/README.md +138 -6
  178. package/src/components/README.zh-CN.md +138 -7
  179. package/src/components/RouterBridge.tsx +28 -4
  180. package/src/components/__tests__/KeepAlive.test.tsx +63 -0
  181. package/src/components/__tests__/RouterBridge.test.tsx +27 -0
  182. package/src/components/form/DialogFormLayout.tsx +5 -29
  183. package/src/components/form/TypedVariableInput.tsx +441 -0
  184. package/src/components/form/VariableInput.tsx +101 -28
  185. package/src/components/form/__tests__/TypedVariableInput.test.tsx +152 -0
  186. package/src/components/form/__tests__/VariableInput.test.ts +85 -0
  187. package/src/components/form/filter/CollectionFilter.tsx +111 -0
  188. package/src/components/form/filter/CollectionFilterItem.tsx +184 -0
  189. package/src/components/form/filter/DateFilterDynamicComponent.tsx +283 -0
  190. package/src/components/form/filter/FilterValueInput.tsx +198 -0
  191. package/src/components/form/filter/__tests__/CollectionFilterItem.test.tsx +247 -0
  192. package/src/components/form/filter/__tests__/DateFilterDynamicComponent.test.tsx +148 -0
  193. package/src/components/form/filter/__tests__/FilterValueInput.test.tsx +243 -0
  194. package/src/components/form/filter/__tests__/compileFilterGroup.test.ts +146 -0
  195. package/src/components/form/filter/index.ts +13 -0
  196. package/src/components/form/filter/useFilterActionProps.ts +203 -0
  197. package/src/components/form/index.tsx +2 -0
  198. package/src/data-source/ExtendCollectionsProvider.tsx +144 -0
  199. package/src/data-source/__tests__/ExtendCollectionsProvider.test.tsx +264 -0
  200. package/src/data-source/index.ts +10 -0
  201. package/src/flow/FlowPage.tsx +35 -7
  202. package/src/flow/__tests__/FlowPage.test.tsx +79 -0
  203. package/src/flow/__tests__/FlowRoute.test.tsx +537 -3
  204. package/src/flow/actions/__tests__/linkageRules.hiddenSync.restore.test.ts +100 -0
  205. package/src/flow/actions/__tests__/linkageRules.subFormSetFieldProps.test.ts +191 -0
  206. package/src/flow/actions/__tests__/linkageRulesRefresh.test.ts +23 -1
  207. package/src/flow/actions/__tests__/openView.subModelKey.test.tsx +33 -0
  208. package/src/flow/actions/aclCheck.tsx +4 -0
  209. package/src/flow/actions/aclCheckRefresh.tsx +4 -0
  210. package/src/flow/actions/dataScope.tsx +8 -1
  211. package/src/flow/actions/dateTimeFormat.tsx +12 -8
  212. package/src/flow/actions/linkageRules.tsx +127 -2
  213. package/src/flow/actions/linkageRulesRefresh.tsx +2 -3
  214. package/src/flow/actions/openView.tsx +28 -4
  215. package/src/flow/actions/setTargetDataScope.tsx +1 -1
  216. package/src/flow/admin-shell/AdminLayoutRouteCoordinator.ts +11 -329
  217. package/src/flow/admin-shell/BaseLayoutModel.tsx +455 -0
  218. package/src/flow/admin-shell/BaseLayoutRouteCoordinator.ts +502 -0
  219. package/src/flow/admin-shell/__tests__/AdminLayoutRouteCoordinator.test.ts +547 -3
  220. package/src/flow/admin-shell/admin-layout/AdminLayoutComponent.tsx +35 -7
  221. package/src/flow/admin-shell/admin-layout/AdminLayoutEntryGuard.tsx +160 -0
  222. package/src/flow/admin-shell/admin-layout/AdminLayoutMenuModels.tsx +15 -13
  223. package/src/flow/admin-shell/admin-layout/AdminLayoutModel.tsx +28 -201
  224. package/src/flow/admin-shell/admin-layout/AdminLayoutSlotModels.tsx +11 -2
  225. package/src/flow/admin-shell/admin-layout/AppListRender.tsx +139 -0
  226. package/src/flow/admin-shell/admin-layout/__tests__/AdminLayoutMenuModels.test.ts +76 -27
  227. package/src/flow/admin-shell/admin-layout/__tests__/AdminLayoutModel.test.tsx +149 -27
  228. package/src/flow/admin-shell/admin-layout/index.ts +3 -0
  229. package/src/flow/admin-shell/admin-layout/resolveAdminRouteRuntimeTarget.test.ts +11 -0
  230. package/src/flow/admin-shell/admin-layout/resolveAdminRouteRuntimeTarget.ts +2 -4
  231. package/src/flow/admin-shell/admin-layout/useApplications.tsx +34 -1
  232. package/src/flow/admin-shell/useAdminLayoutRoutePage.ts +10 -26
  233. package/src/flow/admin-shell/useLayoutRoutePage.ts +61 -0
  234. package/src/flow/common/Markdown/Edit.tsx +32 -4
  235. package/src/flow/components/AdminLayout.tsx +4 -154
  236. package/src/flow/components/ConditionBuilder.tsx +12 -2
  237. package/src/flow/components/FieldAssignRulesEditor.tsx +37 -46
  238. package/src/flow/components/FieldAssignValueInput.tsx +8 -4
  239. package/src/flow/components/FlowRoute.tsx +105 -15
  240. package/src/flow/components/__tests__/FieldAssignRulesEditor.test.tsx +112 -1
  241. package/src/flow/components/__tests__/fieldAssignOptions.test.ts +71 -1
  242. package/src/flow/components/code-editor/__tests__/runjsCompletions.test.ts +272 -27
  243. package/src/flow/components/code-editor/runjsCompletions.ts +490 -9
  244. package/src/flow/components/fieldAssignOptions.ts +23 -6
  245. package/src/flow/components/filter/LinkageFilterItem.tsx +22 -9
  246. package/src/flow/components/filter/VariableFilterItem.tsx +27 -9
  247. package/src/flow/components/filter/__tests__/fieldsToOptions.test.ts +48 -0
  248. package/src/flow/components/filter/__tests__/metaTreeAssociationDepth.test.ts +60 -0
  249. package/src/flow/components/filter/fieldsToOptions.ts +9 -4
  250. package/src/flow/components/filter/index.ts +3 -0
  251. package/src/flow/components/filter/metaTreeAssociationDepth.ts +69 -0
  252. package/src/flow/components/filter/useFilterOptions.ts +102 -0
  253. package/src/flow/index.ts +4 -0
  254. package/src/flow/models/actions/FilterActionModel.tsx +15 -3
  255. package/src/flow/models/actions/UpdateRecordActionModel.tsx +14 -95
  256. package/src/flow/models/actions/UpdateRecordActionUtils.ts +4 -7
  257. package/src/flow/models/actions/__tests__/AssignFormRefill.test.ts +116 -1
  258. package/src/flow/models/base/ActionModel.tsx +8 -1
  259. package/src/flow/models/base/AssociationFieldGroupModel.tsx +20 -3
  260. package/src/flow/models/base/GridModel.tsx +1 -1
  261. package/src/flow/models/base/PageModel/ChildPageModel.tsx +5 -1
  262. package/src/flow/models/base/PageModel/PageModel.tsx +51 -18
  263. package/src/flow/models/base/PageModel/RootPageModel.tsx +6 -13
  264. package/src/flow/models/base/PageModel/__tests__/ChildPageModel.test.ts +12 -0
  265. package/src/flow/models/base/PageModel/__tests__/PageModel.test.ts +102 -1
  266. package/src/flow/models/base/RouteModel.tsx +1 -1
  267. package/src/flow/models/base/__tests__/AssociationFieldGroupModel.test.ts +86 -0
  268. package/src/flow/models/base/__tests__/GridModel.render.test.tsx +53 -0
  269. package/src/flow/models/blocks/assign-form/AssignFormGridModel.tsx +12 -3
  270. package/src/flow/models/blocks/assign-form/AssignFormItemModel.tsx +77 -6
  271. package/src/flow/models/blocks/assign-form/__tests__/assignFieldValuesFlow.editor.test.tsx +216 -0
  272. package/src/flow/models/blocks/assign-form/assignFieldValuesFlow.tsx +308 -0
  273. package/src/flow/models/blocks/assign-form/index.ts +1 -0
  274. package/src/flow/models/blocks/filter-form/FilterFormItemModel.tsx +1 -1
  275. package/src/flow/models/blocks/filter-form/__tests__/FilterFormItemModel.defineChildren.test.ts +6 -1
  276. package/src/flow/models/blocks/filter-manager/flow-actions/connectFields.tsx +48 -6
  277. package/src/flow/models/blocks/form/FormActionGroupModel.tsx +14 -0
  278. package/src/flow/models/blocks/form/FormActionModel.tsx +30 -3
  279. package/src/flow/models/blocks/form/FormAssociationItemModel.tsx +9 -0
  280. package/src/flow/models/blocks/form/FormItemModel.tsx +17 -1
  281. package/src/flow/models/blocks/form/__tests__/FormActionGroupModel.test.ts +46 -0
  282. package/src/flow/models/blocks/form/__tests__/FormBlockModel.test.tsx +17 -0
  283. package/src/flow/models/blocks/form/__tests__/FormItemModel.defineChildren.test.ts +27 -2
  284. package/src/flow/models/blocks/form/__tests__/submitHandler.test.ts +71 -0
  285. package/src/flow/models/blocks/form/submitHandler.ts +8 -1
  286. package/src/flow/models/blocks/form/submitValues.ts +4 -1
  287. package/src/flow/models/blocks/form/value-runtime/__tests__/runtime.test.ts +29 -0
  288. package/src/flow/models/blocks/form/value-runtime/runtime.ts +5 -1
  289. package/src/flow/models/blocks/table/TableBlockModel.tsx +118 -16
  290. package/src/flow/models/blocks/table/TableColumnModel.tsx +15 -5
  291. package/src/flow/models/blocks/table/TableCustomColumnModel.tsx +2 -2
  292. package/src/flow/models/blocks/table/__tests__/TableBlockModel.rowSelection.test.tsx +114 -0
  293. package/src/flow/models/blocks/table/__tests__/TableColumnModel.test.tsx +18 -0
  294. package/src/flow/models/fields/AssociationFieldModel/SubFormFieldModel.tsx +7 -1
  295. package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableColumnModel.tsx +6 -7
  296. package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableField.tsx +1 -1
  297. package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/index.tsx +6 -5
  298. package/src/flow/models/fields/ClickableFieldModel.tsx +9 -1
  299. package/src/flow/models/fields/CollectionSelectorFieldModel.tsx +8 -2
  300. package/src/flow/models/fields/DisplayEnumFieldModel.tsx +8 -2
  301. package/src/flow/models/fields/DisplayTimeFieldModel.tsx +1 -1
  302. package/src/flow/models/fields/TimeFieldModel.tsx +1 -1
  303. package/src/flow/models/fields/__tests__/TimeFieldModel.test.tsx +61 -0
  304. package/src/flow/models/fields/mobile-components/MobileDatePicker.tsx +19 -3
  305. package/src/flow/models/fields/mobile-components/MobileLazySelect.tsx +5 -3
  306. package/src/flow/models/fields/mobile-components/__tests__/MobileDatePicker.test.tsx +94 -0
  307. package/src/flow/models/fields/mobile-components/__tests__/MobileSelect.test.tsx +70 -0
  308. package/src/flow/models/topbar/TopbarActionModel.tsx +1 -1
  309. package/src/flow/utils/__tests__/dateTimeFormat.test.ts +91 -0
  310. package/src/index.ts +6 -0
  311. package/src/layout-manager/LayoutContentRoute.tsx +90 -0
  312. package/src/layout-manager/LayoutManager.tsx +185 -0
  313. package/src/layout-manager/LayoutRoute.tsx +138 -0
  314. package/src/layout-manager/__tests__/LayoutManager.test.tsx +335 -0
  315. package/src/layout-manager/__tests__/LayoutRoute.test.tsx +473 -0
  316. package/src/layout-manager/index.ts +14 -0
  317. package/src/layout-manager/types.ts +22 -0
  318. package/src/layout-manager/utils.ts +37 -0
  319. package/src/nocobase-buildin-plugin/index.tsx +69 -67
  320. package/src/nocobase-buildin-plugin/plugins/LocalePlugin.ts +1 -0
  321. package/src/settings-center/index.ts +1 -1
  322. package/src/settings-center/plugin-manager/BulkEnableButton.tsx +111 -0
  323. package/src/settings-center/plugin-manager/PluginCard.tsx +270 -0
  324. package/src/settings-center/plugin-manager/PluginDetail.tsx +195 -0
  325. package/src/settings-center/plugin-manager/index.tsx +254 -0
  326. package/src/settings-center/plugin-manager/types.ts +35 -0
  327. package/src/settings-center/utils.tsx +8 -1
  328. package/src/theme/__tests__/globalStyles.test.ts +24 -0
  329. package/src/theme/globalStyles.ts +10 -0
  330. package/src/utils/globalDeps.ts +2 -0
  331. package/es/collection-manager/interfaces/linkTo.d.ts +0 -90
  332. package/es/collection-manager/interfaces/o2o.d.ts +0 -621
  333. package/es/collection-manager/interfaces/properties/operators.d.ts +0 -294
  334. package/es/collection-manager/interfaces/subTable.d.ts +0 -172
  335. package/src/collection-manager/interfaces/linkTo.ts +0 -120
  336. package/src/collection-manager/interfaces/o2o.tsx +0 -561
  337. package/src/collection-manager/interfaces/subTable.ts +0 -218
  338. package/src/settings-center/PluginManagerPage.tsx +0 -162
@@ -47,50 +47,7 @@ export declare class UpdatedAtFieldInterface extends CollectionFieldInterface {
47
47
  };
48
48
  };
49
49
  filterable: {
50
- operators: ({
51
- label: string;
52
- value: string;
53
- selected: boolean;
54
- schema: {
55
- 'x-component': string;
56
- 'x-component-props': {
57
- isRange: boolean;
58
- };
59
- };
60
- onlyFilterAction: boolean;
61
- noValue?: undefined;
62
- } | {
63
- label: string;
64
- value: string;
65
- schema: {
66
- 'x-component': string;
67
- 'x-component-props': {
68
- isRange: boolean;
69
- };
70
- };
71
- onlyFilterAction: boolean;
72
- selected?: undefined;
73
- noValue?: undefined;
74
- } | {
75
- label: string;
76
- value: string;
77
- schema: {
78
- 'x-component': string;
79
- 'x-component-props': {
80
- isRange: boolean;
81
- };
82
- };
83
- selected?: undefined;
84
- onlyFilterAction?: undefined;
85
- noValue?: undefined;
86
- } | {
87
- label: string;
88
- value: string;
89
- noValue: boolean;
90
- selected?: undefined;
91
- schema?: undefined;
92
- onlyFilterAction?: undefined;
93
- })[];
50
+ operators: string;
94
51
  };
95
52
  titleUsable: boolean;
96
53
  }
@@ -6,7 +6,6 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
- import { ISchema } from '@formily/react';
10
9
  import { CollectionFieldInterface } from '../../collection-field-interface/CollectionFieldInterface';
11
10
  export declare class UpdatedByFieldInterface extends CollectionFieldInterface {
12
11
  name: string;
@@ -56,8 +55,5 @@ export declare class UpdatedByFieldInterface extends CollectionFieldInterface {
56
55
  nested: boolean;
57
56
  children: any[];
58
57
  };
59
- schemaInitialize(schema: ISchema, { block }: {
60
- block: any;
61
- }): void;
62
58
  description: string;
63
59
  }
@@ -6,7 +6,6 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
- import { ISchema } from '@formily/react';
10
9
  import { CollectionFieldInterface } from '../../collection-field-interface/CollectionFieldInterface';
11
10
  export declare class UrlFieldInterface extends CollectionFieldInterface {
12
11
  name: string;
@@ -26,9 +25,6 @@ export declare class UrlFieldInterface extends CollectionFieldInterface {
26
25
  value: string;
27
26
  }[];
28
27
  availableTypes: string[];
29
- schemaInitialize(schema: ISchema, { block }: {
30
- block: any;
31
- }): void;
32
28
  validationType: string;
33
29
  availableValidationOptions: string[];
34
30
  properties: {
@@ -52,21 +48,6 @@ export declare class UrlFieldInterface extends CollectionFieldInterface {
52
48
  };
53
49
  titleUsable: boolean;
54
50
  filterable: {
55
- operators: ({
56
- label: string;
57
- value: string;
58
- selected: boolean;
59
- noValue?: undefined;
60
- } | {
61
- label: string;
62
- value: string;
63
- selected?: undefined;
64
- noValue?: undefined;
65
- } | {
66
- label: string;
67
- value: string;
68
- noValue: boolean;
69
- selected?: undefined;
70
- })[];
51
+ operators: string;
71
52
  };
72
53
  }
@@ -69,15 +69,6 @@ export declare class UUIDFieldInterface extends CollectionFieldInterface {
69
69
  'x-decorator': string;
70
70
  'x-component': string;
71
71
  'x-disabled': string;
72
- 'x-reactions': {
73
- dependencies: string[];
74
- when: string;
75
- fulfill: {
76
- state: {
77
- value: boolean;
78
- };
79
- };
80
- }[];
81
72
  };
82
73
  unique: {
83
74
  type: string;
@@ -85,36 +76,12 @@ export declare class UUIDFieldInterface extends CollectionFieldInterface {
85
76
  'x-decorator': string;
86
77
  'x-component': string;
87
78
  'x-disabled': string;
88
- 'x-reactions': {
89
- dependencies: string[];
90
- when: string;
91
- fulfill: {
92
- state: {
93
- value: boolean;
94
- };
95
- };
96
- }[];
97
79
  };
98
80
  };
99
81
  };
100
82
  };
101
83
  filterable: {
102
- operators: ({
103
- label: string;
104
- value: string;
105
- selected: boolean;
106
- noValue?: undefined;
107
- } | {
108
- label: string;
109
- value: string;
110
- selected?: undefined;
111
- noValue?: undefined;
112
- } | {
113
- label: string;
114
- value: string;
115
- noValue: boolean;
116
- selected?: undefined;
117
- })[];
84
+ operators: string;
118
85
  };
119
86
  titleUsable: boolean;
120
87
  }
@@ -0,0 +1,53 @@
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 type { ReactNode } from 'react';
10
+ export interface CollectionTemplateFieldOption {
11
+ label: ReactNode;
12
+ value: string | number | boolean;
13
+ [key: string]: unknown;
14
+ }
15
+ export interface CollectionTemplateField {
16
+ name: string;
17
+ interface?: string;
18
+ type?: string;
19
+ title?: ReactNode;
20
+ options?: CollectionTemplateFieldOption[];
21
+ component?: string;
22
+ componentProps?: Record<string, unknown>;
23
+ uiSchema?: Record<string, unknown>;
24
+ [key: string]: unknown;
25
+ }
26
+ interface FieldInterfaceConfigureLike {
27
+ default?: {
28
+ uiSchema?: Record<string, unknown>;
29
+ [key: string]: unknown;
30
+ };
31
+ }
32
+ interface FieldInterfaceLike {
33
+ default?: {
34
+ uiSchema?: Record<string, unknown>;
35
+ [key: string]: unknown;
36
+ };
37
+ }
38
+ export interface CollectionTemplateFieldNormalizeManager {
39
+ getFieldInterfaceConfigure?: (name: string, collectionInfo?: Record<string, unknown>) => FieldInterfaceConfigureLike | undefined;
40
+ getFieldInterface?: (name: string) => FieldInterfaceLike | undefined;
41
+ }
42
+ export interface NormalizeCollectionTemplateFieldOptions {
43
+ collectionInfo?: Record<string, unknown>;
44
+ }
45
+ export declare function normalizeCollectionTemplateField(field: CollectionTemplateField, manager?: CollectionTemplateFieldNormalizeManager, options?: NormalizeCollectionTemplateFieldOptions): {
46
+ [key: string]: unknown;
47
+ uiSchema?: Record<string, unknown>;
48
+ } & CollectionTemplateField;
49
+ export declare function normalizeCollectionTemplateFields(fields?: CollectionTemplateField[], manager?: CollectionTemplateFieldNormalizeManager, options?: NormalizeCollectionTemplateFieldOptions): ({
50
+ [key: string]: unknown;
51
+ uiSchema?: Record<string, unknown>;
52
+ } & CollectionTemplateField)[];
53
+ export {};
@@ -0,0 +1,22 @@
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 React, { FC } from 'react';
10
+ export declare const KeepAliveProvider: FC<{
11
+ active: boolean;
12
+ parentActive: boolean;
13
+ }>;
14
+ export declare const useKeepAlive: () => {
15
+ active: boolean;
16
+ };
17
+ interface KeepAliveProps {
18
+ uid: string;
19
+ children: (uid: string) => React.ReactNode;
20
+ }
21
+ export declare const KeepAlive: FC<KeepAliveProps>;
22
+ export {};
@@ -7,7 +7,16 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  import { Application } from '../Application';
10
+ type LayoutMatchLike = {
11
+ id: string;
12
+ pathname: string;
13
+ };
14
+ type LayoutDefinitionLike = {
15
+ routeName: string;
16
+ };
17
+ export declare function findDeepestLayoutMatch(layouts?: LayoutDefinitionLike[], matches?: LayoutMatchLike[]): LayoutMatchLike;
10
18
  export declare function useRouterSync(app: Application): void;
11
19
  export declare function RouterBridge({ app }: {
12
20
  app: any;
13
21
  }): any;
22
+ export {};
@@ -12,17 +12,9 @@ export interface DialogFormLayoutProps {
12
12
  title: React.ReactNode;
13
13
  /** Form body — typically a `<Form>` wrapping `<Form.Item>` fields. */
14
14
  children: React.ReactNode;
15
- /**
16
- * Called before the dialog is closed by the Cancel button or the
17
- * top-right close (X) icon. Use for "discard changes" confirmations.
18
- */
15
+ /** Called before the dialog is closed by the Cancel button or the top-right close (X) icon. Use for "discard changes" confirmations. */
19
16
  onCancel?: () => void | Promise<void>;
20
- /**
21
- * Called when the Submit button is clicked. Caller owns validation
22
- * + the actual API call; the dialog is closed automatically when
23
- * `onSubmit` resolves. Throw from `onSubmit` to keep the dialog open
24
- * (e.g. on a validation error).
25
- */
17
+ /** Called when the Submit button is clicked. Caller owns validation + the actual API call; the dialog is closed automatically when `onSubmit` resolves. Throw from `onSubmit` to keep the dialog open (e.g. on a validation error). */
26
18
  onSubmit?: () => void | Promise<void>;
27
19
  /** Drives the Submit button's loading state. */
28
20
  submitting?: boolean;
@@ -30,29 +22,13 @@ export interface DialogFormLayoutProps {
30
22
  submitText?: React.ReactNode;
31
23
  /** Override the Cancel button label. Defaults to "Cancel". */
32
24
  cancelText?: React.ReactNode;
33
- /**
34
- * Full override of the footer content. When provided, the default
35
- * Cancel + Submit buttons are replaced. Useful for forms that need
36
- * extra actions (e.g. Preview, Save draft).
37
- */
25
+ /** Full override of the footer content. When provided, the default Cancel + Submit buttons are replaced. Useful for forms that need extra actions (e.g. Preview, Save draft). */
38
26
  footer?: React.ReactNode;
39
27
  }
40
28
  /**
41
- * Standard layout for dialog-hosted forms — the dialog counterpart of
42
- * `DrawerFormLayout`. Title sits left-aligned in the dialog's native
43
- * header (no inline close icon — the dialog provides its own X in the
44
- * top-right when opened with `viewer.dialog({ closable: true, ... })`),
45
- * the form body fills the middle, and a Cancel + Submit footer sits
46
- * at the bottom.
29
+ * Standard layout for dialog-hosted forms — the dialog counterpart of `DrawerFormLayout`. Title sits left-aligned in the dialog's native header, the form body fills the middle, and a Cancel + Submit footer sits at the bottom. Neither this layout nor `DrawerFormLayout` renders a close icon — both rely on the caller passing `closable: true` at the `viewer.dialog` / `viewer.drawer` call site to surface antd Modal's native top-right X (Dialog) or antd Drawer's native left-side X (Drawer).
47
30
  *
48
- * Why not just reuse `DrawerFormLayout`? `DrawerFormLayout` injects a
49
- * `<CloseOutlined>` button next to the title — that's the drawer
50
- * visual contract (close lives near the title in a side panel). In a
51
- * centered dialog the native top-right close button is the expected
52
- * affordance, so a separate layout keeps the visual contract clean.
53
- *
54
- * Callers own the `<Form>` instance, validation, and the actual API
55
- * call. This component only handles the chrome and close behaviour.
31
+ * Callers own the `<Form>` instance, validation, and the actual API call. This component only handles the chrome and close behaviour.
56
32
  *
57
33
  * Example:
58
34
  *
@@ -0,0 +1,75 @@
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 { type MetaTreeNode } from '@nocobase/flow-engine';
10
+ import React from 'react';
11
+ import { type VariableDelimiters } from './VariableInput';
12
+ /**
13
+ * Constant types this input can edit. Subset of v1 `Variable.Input`
14
+ * `useTypedConstant` — drops `'object'` (no v2 JSON editor yet) and `'null'`
15
+ * (handled by the dedicated `nullable` prop).
16
+ */
17
+ export type TypedConstantType = 'string' | 'number' | 'boolean' | 'date';
18
+ /**
19
+ * One allowed constant type. Either a bare type name (`'number'`) or a
20
+ * `[type, editorProps]` pair (`['number', { min: 1, max: 65535 }]`) where
21
+ * `editorProps` is forwarded to the antd editor for that type — same
22
+ * shape as v1 `useTypedConstant`.
23
+ */
24
+ export type TypedConstantSpec = TypedConstantType | [TypedConstantType, Record<string, unknown>];
25
+ export interface TypedVariableInputProps {
26
+ /**
27
+ * Stored value. A `{{ ... }}` string is treated as a variable reference;
28
+ * anything else is a constant of the inferred type.
29
+ */
30
+ value?: unknown;
31
+ onChange?: (next: unknown) => void;
32
+ /**
33
+ * Allowed constant types. The `Constant` switcher entry always exposes a
34
+ * typed submenu (matching v1 `Variable.Input`) so users can see what type
35
+ * the constant is, even when only one type is permitted. Default: all four
36
+ * supported types.
37
+ */
38
+ types?: TypedConstantSpec[];
39
+ /**
40
+ * Restrict the variable picker to specific top-level meta-tree namespaces
41
+ * (e.g. `['$env']`). When omitted, every registered top-level property is
42
+ * exposed — matching `VariableInput`'s default behaviour.
43
+ */
44
+ namespaces?: string[];
45
+ /** Additional leaves appended to the picker after the namespace-filtered nodes. */
46
+ extraNodes?: MetaTreeNode[];
47
+ /**
48
+ * When true (default), the switcher exposes a `Null` option that resets the
49
+ * value to `null`. When false, the value is constrained to one of the
50
+ * allowed types or a variable reference.
51
+ */
52
+ nullable?: boolean;
53
+ /** Variable-token delimiters. Default `['{{', '}}']` — see `VariableInput`. */
54
+ delimiters?: VariableDelimiters;
55
+ disabled?: boolean;
56
+ placeholder?: string;
57
+ style?: React.CSSProperties;
58
+ className?: string;
59
+ }
60
+ /**
61
+ * Constant-or-variable input. Port of v1 `Variable.Input` typed-constant
62
+ * Cascader pattern (the `[Null | Constant<type> | Variable<…namespaces>]`
63
+ * switcher). Use this when a field can accept either a typed literal
64
+ * (number, boolean, date, string) or a variable reference like
65
+ * `{{ $env.SMTP_PORT }}` — see `plugin-notification-email`'s port / secure
66
+ * fields for the canonical example.
67
+ *
68
+ * Pure literal fields should keep using the antd primitive
69
+ * (`InputNumber`, `Select`, `DatePicker`). Pure variable fields should keep
70
+ * using `EnvVariableInput` / `VariableInput`. This component carries the
71
+ * Cascader switcher overhead, so reach for it only when the field
72
+ * genuinely accepts both shapes.
73
+ */
74
+ export declare function TypedVariableInput(props: TypedVariableInputProps): React.JSX.Element;
75
+ export default TypedVariableInput;
@@ -8,8 +8,45 @@
8
8
  */
9
9
  import { type MetaTreeNode, type VariableHybridInputConverters } from '@nocobase/flow-engine';
10
10
  import React from 'react';
11
- export declare function parseVariablePath(value?: string): string[] | undefined;
12
- export declare function formatVariablePath(meta?: MetaTreeNode): string | undefined;
11
+ /**
12
+ * The flow-engine defaults emit `{{ ctx.$X.Y }}` and only parse the same
13
+ * shape back into a path — but NocoBase server templates (and v1 stored
14
+ * values) use the bare `{{$X.Y}}` form without the `ctx.` prefix. These
15
+ * converters keep the picker's output stable against v1 and let already-
16
+ * stored values round-trip to a labelled pill instead of falling back to a
17
+ * raw `{{…}}` literal.
18
+ */
19
+ /**
20
+ * Variable delimiters: opening + closing tokens. Default `['{{', '}}']`
21
+ * matches NocoBase server template convention (Handlebars HTML-escaped
22
+ * output). Pass `['{{{', '}}}']` to switch to Handlebars' raw/unescaped
23
+ * form — required for fields whose content is rendered as HTML (e.g.
24
+ * in-app message body) so the variable expansion bypasses HTML escaping.
25
+ *
26
+ * Restrict to literal-token pairs, since the regex builder escapes them
27
+ * verbatim.
28
+ */
29
+ export type VariableDelimiters = readonly [string, string];
30
+ /**
31
+ * Factory: returns a `parseValueToPath` bound to the given delimiters.
32
+ * Anchored (`^…$`) — only treats the whole input as a single variable
33
+ * reference, matching the v1 single-line picker behaviour.
34
+ */
35
+ export declare function makeParseVariablePath(delimiters?: VariableDelimiters): (value?: string) => string[] | undefined;
36
+ /**
37
+ * Factory: returns a `formatPathToValue` bound to the given delimiters.
38
+ * No inner spaces — matches the v1 storage shape exactly so round-trips
39
+ * through the API stay byte-stable.
40
+ */
41
+ export declare function makeFormatVariablePath(delimiters?: VariableDelimiters): (meta?: MetaTreeNode) => string | undefined;
42
+ /**
43
+ * Factory: returns a global regex matching every occurrence of the
44
+ * variable token within a longer string. Used by `VariableHybridInput`
45
+ * to render embedded variables as pills.
46
+ */
47
+ export declare function makeVariableRegExp(delimiters?: VariableDelimiters): RegExp;
48
+ export declare const parseVariablePath: (value?: string) => string[] | undefined;
49
+ export declare const formatVariablePath: (meta?: MetaTreeNode) => string | undefined;
13
50
  /**
14
51
  * Resolve the meta tree the variable picker should expose. Filters the global
15
52
  * meta tree by `namespaces` (top-level property names like `'$env'`,
@@ -48,8 +85,22 @@ export interface VariableInputProps {
48
85
  * Override the converters used by the underlying `VariableHybridInput`.
49
86
  * Mostly useful when the caller wants to constrain `formatPathToValue` to a
50
87
  * specific namespace (see `EnvVariableInput` for that pattern).
88
+ *
89
+ * Takes precedence over `delimiters` when both are set on the same field
90
+ * (an explicit converter wins over the delimiter-derived one).
51
91
  */
52
92
  converters?: VariableHybridInputConverters;
93
+ /**
94
+ * Token pair wrapping variable references in the stored string. Defaults
95
+ * to `['{{', '}}']` — the standard NocoBase server-template form,
96
+ * HTML-escaped by Handlebars. Pass `['{{{', '}}}']` for fields rendered
97
+ * as HTML where escaping would corrupt the variable value (e.g. the
98
+ * in-app message body).
99
+ *
100
+ * Ignored when `converters` is also supplied — caller-provided converters
101
+ * win.
102
+ */
103
+ delimiters?: VariableDelimiters;
53
104
  className?: string;
54
105
  style?: React.CSSProperties;
55
106
  }
@@ -0,0 +1,49 @@
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 type { Collection } from '@nocobase/flow-engine';
10
+ import { type ButtonProps, type PopoverProps } from 'antd';
11
+ import React, { FC } from 'react';
12
+ import { CompiledFilter } from './useFilterActionProps';
13
+ export interface CollectionFilterProps {
14
+ /** Collection whose fields drive the filter row's field picker. */
15
+ collection: Collection | undefined;
16
+ /** Called on Submit or Reset with the compiled NocoBase filter param (`undefined` when cleared). */
17
+ onChange: (filter: CompiledFilter) => void;
18
+ /** Translator. Defaults to identity. */
19
+ t?: (key: string, options?: Record<string, any>) => string;
20
+ /** Whitelist of root-level field names to expose. */
21
+ filterableFieldNames?: string[];
22
+ /**
23
+ * Blacklist of root-level field names to drop. Mirrors v1's `nonfilterable: [...]` on `Filter.Action`. When both `filterableFieldNames` and this prop are supplied, both apply (final = whitelist ∩ ¬blacklist).
24
+ */
25
+ nonfilterableFieldNames?: string[];
26
+ /**
27
+ * Bypass the `filterableFieldNames` whitelist.
28
+ *
29
+ * Legacy escape hatch — prefer adjusting `filterableFieldNames` / `nonfilterableFieldNames` instead.
30
+ */
31
+ noIgnore?: boolean;
32
+ /** Override the trigger button's label. Defaults to `t('Filter')`, or the v1-style `t('{{count}} filter items', { count })` when conditions are present. */
33
+ buttonText?: React.ReactNode;
34
+ /** Swap the default `t('Filter')` label for v1's `t('{{count}} filter items', { count })` when conditions are present. Defaults to `true`. */
35
+ showCount?: boolean;
36
+ /** Pass-through props for the antd `<Popover>`. */
37
+ popoverProps?: Omit<PopoverProps, 'open' | 'onOpenChange' | 'content' | 'children'>;
38
+ /** Pass-through props for the trigger `<Button>`. */
39
+ buttonProps?: Omit<ButtonProps, 'icon' | 'type' | 'children' | 'onClick'>;
40
+ /** Min-width applied to the popover body. Defaults to `520`. */
41
+ popoverMinWidth?: number;
42
+ }
43
+ /**
44
+ * Filter button bound to a collection. Renders an antd `<Popover>` over a `<Button>`; the popover hosts a multi-condition filter form (field picker, operator, value). Submit dismisses the popover and emits the compiled filter via `onChange`; Reset keeps the popover open and emits `undefined`.
45
+ *
46
+ * Pair with `<ExtendCollectionsProvider>` when the target collection is client-only (e.g. a `schema-only` server collection that isn't auto-published to the v2 data source).
47
+ */
48
+ export declare const CollectionFilter: FC<CollectionFilterProps>;
49
+ export default CollectionFilter;
@@ -0,0 +1,49 @@
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 { Collection } from '@nocobase/flow-engine';
10
+ import React, { FC } from 'react';
11
+ export interface CollectionFilterItemValue {
12
+ path: string;
13
+ operator: string;
14
+ /** Operator-dependent — string for default ops, descriptor for $date*, etc. */
15
+ value: any;
16
+ }
17
+ export interface CollectionFilterItemProps {
18
+ /** Reactive filter row managed by the parent `FilterContainer`. */
19
+ value: CollectionFilterItemValue;
20
+ /** Target collection whose fields populate the field selector. */
21
+ collection: Collection;
22
+ /** Whitelist of field names to expose; empty/undefined means all filterable fields. */
23
+ filterableFieldNames?: string[];
24
+ /**
25
+ * Blacklist of field names to drop. Mirrors v1's `nonfilterable: [...]` on `Filter.Action`. When both whitelist and blacklist are supplied, both apply (final = whitelist ∩ ¬blacklist).
26
+ */
27
+ nonfilterableFieldNames?: string[];
28
+ /**
29
+ * Bypass the `filterableFieldNames` whitelist (matches the legacy FilterItem `noIgnore`).
30
+ *
31
+ * Legacy escape hatch — prefer adjusting `filterableFieldNames` / `nonfilterableFieldNames` instead.
32
+ */
33
+ noIgnore?: boolean;
34
+ /** Translator; defaults to identity so callers can omit it. */
35
+ t?: (key: string) => string;
36
+ }
37
+ /**
38
+ * Filter row bound directly to a `Collection`, with no `FlowModel` dependency. Use this from settings pages or other surfaces that need a filter UI but don't have (and shouldn't synthesise) a block model just to satisfy `FilterItem`. Pair with `FilterContainer` via either an inline wrapper or `createCollectionFilterItem(collection)`.
39
+ *
40
+ * The field selector is an antd `Cascader`, mirroring v1's `Filter.Action` so association fields (belongsTo / m2o / etc.) can be drilled into — picking `user.username` is a first-class action. The value renderer is delegated to `FilterValueInput`, which dispatches to interface-specific controls (the smart date picker for `$date*` operators, tag-mode Select for array/enum, etc.) the same way v1's `DynamicComponent` did.
41
+ */
42
+ export declare const CollectionFilterItem: FC<CollectionFilterItemProps>;
43
+ /**
44
+ * Convenience factory returning a `FilterContainer`-compatible `FilterItem` component bound to a specific collection. Avoids creating an inline closure on every parent render, which would otherwise reset any focused inner antd control.
45
+ */
46
+ export declare function createCollectionFilterItem(collection: Collection, bound?: Pick<CollectionFilterItemProps, 'filterableFieldNames' | 'nonfilterableFieldNames' | 'noIgnore' | 't'>): React.FC<{
47
+ value: CollectionFilterItemValue;
48
+ }>;
49
+ export default CollectionFilterItem;
@@ -0,0 +1,57 @@
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 { type Dayjs } from 'dayjs';
10
+ import React from 'react';
11
+ /**
12
+ * Value shape used by NocoBase's `$date*` filter operators. Two flavours:
13
+ *
14
+ * - For "Exact day" mode: a **formatted string** at the granularity of the picker — `"2026-02-15"` (date), `"2026-02"` (month), `"2026"` (year), `"2026-Q1"` (quarter). For `$dateBetween` (`isRange`), a `[string, string]` tuple. Strings (not Dayjs) so the value serializes verbatim into the query string the same way v1 does (`filter=%7B%22$and%22:[%7B%22lockedTs%22:%7B%22$dateOn%22:%222026-02%22%7D%7D]%7D`).
15
+ * - For relative modes (Today / Past 3 days / This Week / …): a `{ type, number?, unit? }` descriptor that the server resolves to a concrete range at query time.
16
+ */
17
+ export type DateFilterValue = string | [string, string] | {
18
+ type: string;
19
+ number?: number;
20
+ unit?: 'day' | 'week' | 'month' | 'year';
21
+ } | null | undefined;
22
+ export interface DateFilterDynamicComponentProps {
23
+ value?: DateFilterValue;
24
+ onChange?: (value: DateFilterValue) => void;
25
+ /** `true` for `$dateBetween`; renders a `DatePicker.RangePicker`. */
26
+ isRange?: boolean;
27
+ /**
28
+ * Translator. Defaults to identity so callers can omit it when running outside a translation context (tests, storybook).
29
+ */
30
+ t?: (key: string) => string;
31
+ }
32
+ type PickerMode = 'date' | 'month' | 'quarter' | 'year';
33
+ /**
34
+ * The exact format strings NocoBase's `$date*` server operators expect per picker granularity. Mirrors v1's `getPickerFormat` output under `underFilter=true`, so the URL-encoded query stays identical.
35
+ *
36
+ * Exported for unit tests and for downstream callers that need to parse / format `$date*` values outside this component.
37
+ */
38
+ export declare const FORMAT_BY_PICKER: Record<PickerMode, string>;
39
+ /**
40
+ * Parse a granularity-formatted string back into a `Dayjs`. Returns `null` on missing or unparseable input so the DatePicker's controlled-value contract stays clean.
41
+ */
42
+ export declare const parseDateFilterValue: (value: string | undefined, picker: PickerMode) => Dayjs | null;
43
+ /**
44
+ * Format a `Dayjs` (typically from `DatePicker.onChange`) into the server-facing string at the active picker's granularity. Returns `undefined` for empty input so callers can drop the value entirely.
45
+ */
46
+ export declare const formatDateFilterValue: (value: Dayjs | null | undefined, picker: PickerMode) => string | undefined;
47
+ /**
48
+ * v2 port of v1's `DateFilterDynamicComponent` — a multi-mode value input for the `$date*` operator family. Three sub-controls glued in a `Space.Compact` row:
49
+ *
50
+ * 1. Mode select — `Exact day` / `Past` / `Next` / `Today` / `This Week` / … Picking a relative mode emits a `{ type, number?, unit? }` descriptor that the server resolves at query time; picking `Exact day` emits a raw `Dayjs` instead.
51
+ * 2. Picker granularity — only when mode is `Exact day`: `Date` / `Month` / `Quarter` / `Year`. Controls the antd `DatePicker`'s `picker` mode so admins can filter to e.g. "any day in 2026-03".
52
+ * 3. Date input — antd `DatePicker` for single dates, or `DatePicker.RangePicker` when `isRange` is true (used by `$dateBetween`).
53
+ *
54
+ * v1 wired its own `<DatePicker.FilterWithPicker>` for the third slot; v2 inlines the picker-granularity selector here so we don't have to fork antd's DatePicker. Drops v1's `@emotion/css` (uses antd token spacing) and the `useCompile` schema-template chain (call sites pass a plain `t` translator).
55
+ */
56
+ export declare const DateFilterDynamicComponent: React.FC<DateFilterDynamicComponentProps>;
57
+ export default DateFilterDynamicComponent;
@@ -0,0 +1,29 @@
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 React from 'react';
10
+ import type { FilterOperator, FilterOption } from '../../../flow/components/filter/useFilterOptions';
11
+ export interface FilterValueInputProps {
12
+ /** The currently selected leaf field option from the field picker. */
13
+ field?: FilterOption;
14
+ /** The currently selected operator (full object, not just `.value`). */
15
+ operator?: FilterOperator;
16
+ /** Current value. Shape depends on operator/field. */
17
+ value: any;
18
+ /** Notify the parent when the user edits the value. */
19
+ onChange: (value: any) => void;
20
+ /** Translator used by sub-renderers. */
21
+ t?: (key: string) => string;
22
+ /** Optional placeholder for the fallback `Input`. */
23
+ placeholder?: string;
24
+ }
25
+ /**
26
+ * Interface-aware value renderer for filter rows. Returns `null` for `noValue` operators (`$empty`, `$notEmpty`). Otherwise dispatches the effective `x-component` (operator schema > field uiSchema > Input) to a small registry of antd controls.
27
+ */
28
+ export declare const FilterValueInput: React.FC<FilterValueInputProps>;
29
+ export default FilterValueInput;
@@ -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
+ export { CollectionFilter } from './CollectionFilter';
10
+ export type { CollectionFilterProps } from './CollectionFilter';
11
+ export type { CompiledFilter } from './useFilterActionProps';