@nocobase/client 0.7.4-alpha.7 → 0.7.6-alpha.1

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 (316) hide show
  1. package/es/application/Application.js +1 -3
  2. package/es/block-provider/TableBlockProvider.js +3 -3
  3. package/es/collection-manager/Configuration/AddFieldAction.js +38 -41
  4. package/es/collection-manager/Configuration/ConfigurationTable.js +8 -3
  5. package/es/collection-manager/Configuration/EditFieldAction.js +64 -41
  6. package/es/collection-manager/Configuration/schemas/collections.d.ts +2 -0
  7. package/es/collection-manager/Configuration/schemas/collections.js +23 -1
  8. package/es/collection-manager/action-hooks.d.ts +5 -0
  9. package/es/collection-manager/action-hooks.js +14 -1
  10. package/es/collection-manager/interfaces/email.js +4 -2
  11. package/es/collection-manager/interfaces/formula.js +1 -1
  12. package/es/collection-manager/interfaces/index.d.ts +1 -0
  13. package/es/collection-manager/interfaces/index.js +1 -0
  14. package/es/collection-manager/interfaces/input.js +4 -2
  15. package/es/collection-manager/interfaces/integer.js +4 -2
  16. package/es/collection-manager/interfaces/m2m.js +2 -2
  17. package/es/collection-manager/interfaces/m2o.js +7 -3
  18. package/es/collection-manager/interfaces/number.js +3 -2
  19. package/es/collection-manager/interfaces/o2m.js +8 -4
  20. package/es/collection-manager/interfaces/o2o.js +19 -6
  21. package/es/collection-manager/interfaces/password.js +4 -2
  22. package/es/collection-manager/interfaces/percent.js +2 -1
  23. package/es/collection-manager/interfaces/phone.js +4 -2
  24. package/es/collection-manager/interfaces/properties/index.d.ts +7 -0
  25. package/es/collection-manager/interfaces/properties/index.js +91 -0
  26. package/es/collection-manager/interfaces/sequence.d.ts +2 -0
  27. package/es/collection-manager/interfaces/sequence.js +431 -0
  28. package/es/index.d.ts +0 -1
  29. package/es/index.js +0 -1
  30. package/es/locale/en_US.d.ts +1 -0
  31. package/es/locale/en_US.js +2 -1
  32. package/es/locale/index.js +36 -0
  33. package/es/locale/ja_JP.d.ts +590 -0
  34. package/es/locale/ja_JP.js +591 -0
  35. package/es/locale/ru_RU.d.ts +560 -0
  36. package/es/locale/ru_RU.js +559 -0
  37. package/es/locale/tr_TR.d.ts +560 -0
  38. package/es/locale/tr_TR.js +559 -0
  39. package/es/locale/zh_CN.d.ts +30 -0
  40. package/es/locale/zh_CN.js +34 -4
  41. package/es/route-switch/antd/admin-layout/index.js +19 -4
  42. package/es/schema-component/antd/action/Action.js +3 -1
  43. package/es/schema-component/antd/action/ActionBar.js +8 -1
  44. package/es/schema-component/antd/cron/Cron.d.ts +6 -0
  45. package/es/schema-component/antd/cron/Cron.js +49 -0
  46. package/es/schema-component/antd/cron/index.d.ts +1 -0
  47. package/es/schema-component/antd/cron/index.js +1 -0
  48. package/es/schema-component/antd/cron/locale/zh-CN.d.ts +34 -0
  49. package/es/schema-component/antd/cron/locale/zh-CN.js +37 -0
  50. package/es/schema-component/antd/filter/Filter.Action.Designer.js +1 -0
  51. package/es/schema-component/antd/filter/useFilterActionProps.d.ts +12 -1
  52. package/es/schema-component/antd/filter/useFilterActionProps.js +24 -10
  53. package/es/schema-component/antd/filter/useValues.js +0 -1
  54. package/es/schema-component/antd/formula-input/Compute.js +1 -1
  55. package/es/schema-component/antd/grid/Grid.js +134 -25
  56. package/es/schema-component/antd/index.d.ts +1 -0
  57. package/es/schema-component/antd/index.js +1 -0
  58. package/es/schema-component/antd/record-picker/InputRecordPicker.js +4 -2
  59. package/es/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +5 -2
  60. package/es/schema-component/antd/record-picker/util.d.ts +5 -0
  61. package/es/schema-component/antd/record-picker/util.js +37 -0
  62. package/es/schema-component/antd/upload/shared.js +6 -2
  63. package/es/schema-component/common/dnd-context/index.js +30 -4
  64. package/es/schema-component/hooks/useDesignable.d.ts +2 -2
  65. package/es/schema-component/hooks/useDesignable.js +130 -26
  66. package/es/schema-initializer/SchemaInitializer.d.ts +1 -0
  67. package/es/schema-initializer/SchemaInitializer.js +6 -2
  68. package/es/schema-initializer/buttons/TabPaneInitializers.d.ts +2 -1
  69. package/es/schema-initializer/buttons/TabPaneInitializers.js +9 -3
  70. package/es/schema-initializer/items/ActionInitializer.d.ts +1 -0
  71. package/es/schema-initializer/items/ActionInitializer.js +13 -0
  72. package/es/schema-initializer/items/BlockInitializer.d.ts +1 -0
  73. package/es/schema-initializer/items/BlockInitializer.js +18 -0
  74. package/es/schema-initializer/items/BulkDestroyActionInitializer.d.ts +1 -0
  75. package/es/schema-initializer/items/BulkDestroyActionInitializer.js +27 -0
  76. package/es/schema-initializer/items/CalendarBlockInitializer.d.ts +1 -0
  77. package/es/schema-initializer/items/CalendarBlockInitializer.js +124 -0
  78. package/es/schema-initializer/items/CollectionFieldInitializer.d.ts +1 -0
  79. package/es/schema-initializer/items/CollectionFieldInitializer.js +15 -0
  80. package/es/schema-initializer/items/CreateActionInitializer.d.ts +1 -0
  81. package/es/schema-initializer/items/CreateActionInitializer.js +60 -0
  82. package/es/schema-initializer/items/CreateFormBlockInitializer.d.ts +1 -0
  83. package/es/schema-initializer/items/CreateFormBlockInitializer.js +102 -0
  84. package/es/schema-initializer/items/CreateSubmitActionInitializer.d.ts +1 -0
  85. package/es/schema-initializer/items/CreateSubmitActionInitializer.js +24 -0
  86. package/es/schema-initializer/items/CustomizeActionInitializer.d.ts +1 -0
  87. package/es/schema-initializer/items/CustomizeActionInitializer.js +11 -0
  88. package/es/schema-initializer/items/DataBlockInitializer.d.ts +1 -0
  89. package/es/schema-initializer/items/DataBlockInitializer.js +88 -0
  90. package/es/schema-initializer/items/DestroyActionInitializer.d.ts +1 -0
  91. package/es/schema-initializer/items/DestroyActionInitializer.js +27 -0
  92. package/es/schema-initializer/items/DetailsBlockInitializer.d.ts +1 -0
  93. package/es/schema-initializer/items/DetailsBlockInitializer.js +55 -0
  94. package/es/schema-initializer/items/FilterActionInitializer.d.ts +1 -0
  95. package/es/schema-initializer/items/FilterActionInitializer.js +24 -0
  96. package/es/schema-initializer/items/FormBlockInitializer.d.ts +1 -0
  97. package/es/schema-initializer/items/FormBlockInitializer.js +30 -0
  98. package/es/schema-initializer/items/G2PlotInitializer.d.ts +1 -0
  99. package/es/schema-initializer/items/G2PlotInitializer.js +25 -0
  100. package/es/schema-initializer/items/InitializerWithSwitch.d.ts +1 -0
  101. package/es/schema-initializer/items/InitializerWithSwitch.js +32 -0
  102. package/es/schema-initializer/items/KanbanBlockInitializer.d.ts +1 -0
  103. package/es/schema-initializer/items/KanbanBlockInitializer.js +138 -0
  104. package/es/schema-initializer/items/MarkdownBlockInitializer.d.ts +1 -0
  105. package/es/schema-initializer/items/MarkdownBlockInitializer.js +32 -0
  106. package/es/schema-initializer/items/PrintActionInitializer.d.ts +1 -0
  107. package/es/schema-initializer/items/PrintActionInitializer.js +23 -0
  108. package/es/schema-initializer/items/RecordAssociationBlockInitializer.d.ts +1 -0
  109. package/es/schema-initializer/items/RecordAssociationBlockInitializer.js +90 -0
  110. package/es/schema-initializer/items/RecordAssociationCalendarBlockInitializer.d.ts +1 -0
  111. package/es/schema-initializer/items/RecordAssociationCalendarBlockInitializer.js +160 -0
  112. package/es/schema-initializer/items/RecordAssociationDetailsBlockInitializer.d.ts +1 -0
  113. package/es/schema-initializer/items/RecordAssociationDetailsBlockInitializer.js +90 -0
  114. package/es/schema-initializer/items/RecordAssociationFormBlockInitializer.d.ts +1 -0
  115. package/es/schema-initializer/items/RecordAssociationFormBlockInitializer.js +112 -0
  116. package/es/schema-initializer/items/RecordFormBlockInitializer.d.ts +1 -0
  117. package/es/schema-initializer/items/RecordFormBlockInitializer.js +109 -0
  118. package/es/schema-initializer/items/RecordReadPrettyAssociationFormBlockInitializer.d.ts +1 -0
  119. package/es/schema-initializer/items/RecordReadPrettyAssociationFormBlockInitializer.js +116 -0
  120. package/es/schema-initializer/items/RecordReadPrettyFormBlockInitializer.d.ts +1 -0
  121. package/es/schema-initializer/items/RecordReadPrettyFormBlockInitializer.js +114 -0
  122. package/es/schema-initializer/items/RefreshActionInitializer.d.ts +1 -0
  123. package/es/schema-initializer/items/RefreshActionInitializer.js +23 -0
  124. package/es/schema-initializer/items/SubmitActionInitializer.d.ts +1 -0
  125. package/es/schema-initializer/items/SubmitActionInitializer.js +24 -0
  126. package/es/schema-initializer/items/TableActionColumnInitializer.d.ts +1 -0
  127. package/es/schema-initializer/items/TableActionColumnInitializer.js +34 -0
  128. package/es/schema-initializer/items/TableBlockInitializer.d.ts +1 -0
  129. package/es/schema-initializer/items/TableBlockInitializer.js +55 -0
  130. package/es/schema-initializer/items/TableCollectionFieldInitializer.d.ts +1 -0
  131. package/es/schema-initializer/items/TableCollectionFieldInitializer.js +15 -0
  132. package/es/schema-initializer/items/TableSelectorInitializer.d.ts +1 -0
  133. package/es/schema-initializer/items/TableSelectorInitializer.js +67 -0
  134. package/es/schema-initializer/items/UpdateActionInitializer.d.ts +1 -0
  135. package/es/schema-initializer/items/UpdateActionInitializer.js +59 -0
  136. package/es/schema-initializer/items/UpdateSubmitActionInitializer.d.ts +1 -0
  137. package/es/schema-initializer/items/UpdateSubmitActionInitializer.js +24 -0
  138. package/es/schema-initializer/items/ViewActionInitializer.d.ts +1 -0
  139. package/es/schema-initializer/items/ViewActionInitializer.js +58 -0
  140. package/es/schema-initializer/items/index.d.ts +35 -35
  141. package/es/schema-initializer/items/index.js +35 -1589
  142. package/es/schema-initializer/style.less +4 -0
  143. package/es/schema-templates/SchemaTemplateManagerProvider.js +2 -5
  144. package/es/system-settings/SystemSettingsShortcut.js +7 -0
  145. package/es/user/SigninPage.d.ts +11 -2
  146. package/es/user/SigninPage.js +140 -33
  147. package/es/user/SignupPage.d.ts +13 -2
  148. package/es/user/SignupPage.js +57 -11
  149. package/es/user/VerificationCode.d.ts +7 -0
  150. package/es/user/VerificationCode.js +129 -0
  151. package/lib/application/Application.js +1 -4
  152. package/lib/block-provider/TableBlockProvider.js +3 -3
  153. package/lib/collection-manager/Configuration/AddFieldAction.js +38 -40
  154. package/lib/collection-manager/Configuration/ConfigurationTable.js +7 -2
  155. package/lib/collection-manager/Configuration/EditFieldAction.js +65 -40
  156. package/lib/collection-manager/Configuration/schemas/collections.d.ts +2 -0
  157. package/lib/collection-manager/Configuration/schemas/collections.js +24 -1
  158. package/lib/collection-manager/action-hooks.d.ts +5 -0
  159. package/lib/collection-manager/action-hooks.js +31 -14
  160. package/lib/collection-manager/interfaces/email.js +3 -1
  161. package/lib/collection-manager/interfaces/formula.js +1 -1
  162. package/lib/collection-manager/interfaces/index.d.ts +1 -0
  163. package/lib/collection-manager/interfaces/index.js +13 -0
  164. package/lib/collection-manager/interfaces/input.js +3 -1
  165. package/lib/collection-manager/interfaces/integer.js +3 -1
  166. package/lib/collection-manager/interfaces/m2m.js +1 -1
  167. package/lib/collection-manager/interfaces/m2o.js +6 -2
  168. package/lib/collection-manager/interfaces/number.js +4 -3
  169. package/lib/collection-manager/interfaces/o2m.js +7 -3
  170. package/lib/collection-manager/interfaces/o2o.js +18 -5
  171. package/lib/collection-manager/interfaces/password.js +3 -1
  172. package/lib/collection-manager/interfaces/percent.js +1 -0
  173. package/lib/collection-manager/interfaces/phone.js +3 -1
  174. package/lib/collection-manager/interfaces/properties/index.d.ts +7 -0
  175. package/lib/collection-manager/interfaces/properties/index.js +94 -1
  176. package/lib/collection-manager/interfaces/sequence.d.ts +2 -0
  177. package/lib/collection-manager/interfaces/sequence.js +455 -0
  178. package/lib/index.d.ts +0 -1
  179. package/lib/index.js +0 -13
  180. package/lib/locale/en_US.d.ts +1 -0
  181. package/lib/locale/en_US.js +2 -1
  182. package/lib/locale/index.js +42 -0
  183. package/lib/locale/ja_JP.d.ts +590 -0
  184. package/lib/locale/ja_JP.js +598 -0
  185. package/lib/locale/ru_RU.d.ts +560 -0
  186. package/lib/locale/ru_RU.js +566 -0
  187. package/lib/locale/tr_TR.d.ts +560 -0
  188. package/lib/locale/tr_TR.js +566 -0
  189. package/lib/locale/zh_CN.d.ts +30 -0
  190. package/lib/locale/zh_CN.js +34 -4
  191. package/lib/route-switch/antd/admin-layout/index.js +19 -4
  192. package/lib/schema-component/antd/action/Action.js +2 -0
  193. package/lib/schema-component/antd/action/ActionBar.js +9 -1
  194. package/lib/schema-component/antd/cron/Cron.d.ts +6 -0
  195. package/lib/schema-component/antd/cron/Cron.js +67 -0
  196. package/lib/schema-component/antd/cron/index.d.ts +1 -0
  197. package/lib/{file-manager → schema-component/antd/cron}/index.js +4 -4
  198. package/lib/schema-component/antd/cron/locale/zh-CN.d.ts +34 -0
  199. package/lib/schema-component/antd/cron/locale/zh-CN.js +44 -0
  200. package/lib/schema-component/antd/filter/Filter.Action.Designer.js +1 -0
  201. package/lib/schema-component/antd/filter/useFilterActionProps.d.ts +12 -1
  202. package/lib/schema-component/antd/filter/useFilterActionProps.js +34 -11
  203. package/lib/schema-component/antd/filter/useValues.js +0 -1
  204. package/lib/schema-component/antd/formula-input/Compute.js +1 -1
  205. package/lib/schema-component/antd/grid/Grid.js +132 -23
  206. package/lib/schema-component/antd/index.d.ts +1 -0
  207. package/lib/schema-component/antd/index.js +13 -0
  208. package/lib/schema-component/antd/record-picker/InputRecordPicker.js +5 -2
  209. package/lib/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +6 -2
  210. package/lib/schema-component/antd/record-picker/util.d.ts +5 -0
  211. package/lib/schema-component/antd/record-picker/util.js +55 -0
  212. package/lib/schema-component/antd/upload/shared.js +5 -1
  213. package/lib/schema-component/common/dnd-context/index.js +35 -5
  214. package/lib/schema-component/hooks/useDesignable.d.ts +2 -2
  215. package/lib/schema-component/hooks/useDesignable.js +132 -28
  216. package/lib/schema-initializer/SchemaInitializer.d.ts +1 -0
  217. package/lib/schema-initializer/SchemaInitializer.js +7 -2
  218. package/lib/schema-initializer/buttons/TabPaneInitializers.d.ts +2 -1
  219. package/lib/schema-initializer/buttons/TabPaneInitializers.js +13 -4
  220. package/lib/schema-initializer/items/ActionInitializer.d.ts +1 -0
  221. package/lib/schema-initializer/items/ActionInitializer.js +26 -0
  222. package/lib/schema-initializer/items/BlockInitializer.d.ts +1 -0
  223. package/lib/schema-initializer/items/BlockInitializer.js +31 -0
  224. package/lib/schema-initializer/items/BulkDestroyActionInitializer.d.ts +1 -0
  225. package/lib/schema-initializer/items/BulkDestroyActionInitializer.js +40 -0
  226. package/lib/schema-initializer/items/CalendarBlockInitializer.d.ts +1 -0
  227. package/lib/schema-initializer/items/CalendarBlockInitializer.js +148 -0
  228. package/lib/schema-initializer/items/CollectionFieldInitializer.d.ts +1 -0
  229. package/lib/schema-initializer/items/CollectionFieldInitializer.js +28 -0
  230. package/lib/schema-initializer/items/CreateActionInitializer.d.ts +1 -0
  231. package/lib/schema-initializer/items/CreateActionInitializer.js +73 -0
  232. package/lib/schema-initializer/items/CreateFormBlockInitializer.d.ts +1 -0
  233. package/lib/schema-initializer/items/CreateFormBlockInitializer.js +120 -0
  234. package/lib/schema-initializer/items/CreateSubmitActionInitializer.d.ts +1 -0
  235. package/lib/schema-initializer/items/CreateSubmitActionInitializer.js +37 -0
  236. package/lib/schema-initializer/items/CustomizeActionInitializer.d.ts +1 -0
  237. package/lib/schema-initializer/items/CustomizeActionInitializer.js +24 -0
  238. package/lib/schema-initializer/items/DataBlockInitializer.d.ts +1 -0
  239. package/lib/schema-initializer/items/DataBlockInitializer.js +104 -0
  240. package/lib/schema-initializer/items/DestroyActionInitializer.d.ts +1 -0
  241. package/lib/schema-initializer/items/DestroyActionInitializer.js +40 -0
  242. package/lib/schema-initializer/items/DetailsBlockInitializer.d.ts +1 -0
  243. package/lib/schema-initializer/items/DetailsBlockInitializer.js +71 -0
  244. package/lib/schema-initializer/items/FilterActionInitializer.d.ts +1 -0
  245. package/lib/schema-initializer/items/FilterActionInitializer.js +37 -0
  246. package/lib/schema-initializer/items/FormBlockInitializer.d.ts +1 -0
  247. package/lib/schema-initializer/items/FormBlockInitializer.js +45 -0
  248. package/lib/schema-initializer/items/G2PlotInitializer.d.ts +1 -0
  249. package/lib/schema-initializer/items/G2PlotInitializer.js +38 -0
  250. package/lib/schema-initializer/items/InitializerWithSwitch.d.ts +1 -0
  251. package/lib/schema-initializer/items/InitializerWithSwitch.js +47 -0
  252. package/lib/schema-initializer/items/KanbanBlockInitializer.d.ts +1 -0
  253. package/lib/schema-initializer/items/KanbanBlockInitializer.js +163 -0
  254. package/lib/schema-initializer/items/MarkdownBlockInitializer.d.ts +1 -0
  255. package/lib/schema-initializer/items/MarkdownBlockInitializer.js +47 -0
  256. package/lib/schema-initializer/items/PrintActionInitializer.d.ts +1 -0
  257. package/lib/schema-initializer/items/PrintActionInitializer.js +36 -0
  258. package/lib/schema-initializer/items/RecordAssociationBlockInitializer.d.ts +1 -0
  259. package/lib/schema-initializer/items/RecordAssociationBlockInitializer.js +107 -0
  260. package/lib/schema-initializer/items/RecordAssociationCalendarBlockInitializer.d.ts +1 -0
  261. package/lib/schema-initializer/items/RecordAssociationCalendarBlockInitializer.js +185 -0
  262. package/lib/schema-initializer/items/RecordAssociationDetailsBlockInitializer.d.ts +1 -0
  263. package/lib/schema-initializer/items/RecordAssociationDetailsBlockInitializer.js +107 -0
  264. package/lib/schema-initializer/items/RecordAssociationFormBlockInitializer.d.ts +1 -0
  265. package/lib/schema-initializer/items/RecordAssociationFormBlockInitializer.js +128 -0
  266. package/lib/schema-initializer/items/RecordFormBlockInitializer.d.ts +1 -0
  267. package/lib/schema-initializer/items/RecordFormBlockInitializer.js +127 -0
  268. package/lib/schema-initializer/items/RecordReadPrettyAssociationFormBlockInitializer.d.ts +1 -0
  269. package/lib/schema-initializer/items/RecordReadPrettyAssociationFormBlockInitializer.js +133 -0
  270. package/lib/schema-initializer/items/RecordReadPrettyFormBlockInitializer.d.ts +1 -0
  271. package/lib/schema-initializer/items/RecordReadPrettyFormBlockInitializer.js +132 -0
  272. package/lib/schema-initializer/items/RefreshActionInitializer.d.ts +1 -0
  273. package/lib/schema-initializer/items/RefreshActionInitializer.js +36 -0
  274. package/lib/schema-initializer/items/SubmitActionInitializer.d.ts +1 -0
  275. package/lib/schema-initializer/items/SubmitActionInitializer.js +37 -0
  276. package/lib/schema-initializer/items/TableActionColumnInitializer.d.ts +1 -0
  277. package/lib/schema-initializer/items/TableActionColumnInitializer.js +47 -0
  278. package/lib/schema-initializer/items/TableBlockInitializer.d.ts +1 -0
  279. package/lib/schema-initializer/items/TableBlockInitializer.js +71 -0
  280. package/lib/schema-initializer/items/TableCollectionFieldInitializer.d.ts +1 -0
  281. package/lib/schema-initializer/items/TableCollectionFieldInitializer.js +28 -0
  282. package/lib/schema-initializer/items/TableSelectorInitializer.d.ts +1 -0
  283. package/lib/schema-initializer/items/TableSelectorInitializer.js +84 -0
  284. package/lib/schema-initializer/items/UpdateActionInitializer.d.ts +1 -0
  285. package/lib/schema-initializer/items/UpdateActionInitializer.js +72 -0
  286. package/lib/schema-initializer/items/UpdateSubmitActionInitializer.d.ts +1 -0
  287. package/lib/schema-initializer/items/UpdateSubmitActionInitializer.js +37 -0
  288. package/lib/schema-initializer/items/ViewActionInitializer.d.ts +1 -0
  289. package/lib/schema-initializer/items/ViewActionInitializer.js +71 -0
  290. package/lib/schema-initializer/items/index.d.ts +35 -35
  291. package/lib/schema-initializer/items/index.js +400 -1659
  292. package/lib/schema-initializer/style.less +4 -0
  293. package/lib/schema-templates/SchemaTemplateManagerProvider.js +2 -5
  294. package/lib/system-settings/SystemSettingsShortcut.js +7 -0
  295. package/lib/user/SigninPage.d.ts +11 -2
  296. package/lib/user/SigninPage.js +150 -34
  297. package/lib/user/SignupPage.d.ts +13 -2
  298. package/lib/user/SignupPage.js +59 -11
  299. package/lib/user/VerificationCode.d.ts +7 -0
  300. package/lib/user/VerificationCode.js +148 -0
  301. package/package.json +6 -4
  302. package/es/file-manager/FileStorageShortcut.d.ts +0 -1
  303. package/es/file-manager/FileStorageShortcut.js +0 -61
  304. package/es/file-manager/StorageOptions.d.ts +0 -2
  305. package/es/file-manager/StorageOptions.js +0 -121
  306. package/es/file-manager/index.d.ts +0 -1
  307. package/es/file-manager/index.js +0 -1
  308. package/es/file-manager/schemas/storage.d.ts +0 -2
  309. package/es/file-manager/schemas/storage.js +0 -349
  310. package/lib/file-manager/FileStorageShortcut.d.ts +0 -1
  311. package/lib/file-manager/FileStorageShortcut.js +0 -85
  312. package/lib/file-manager/StorageOptions.d.ts +0 -2
  313. package/lib/file-manager/StorageOptions.js +0 -138
  314. package/lib/file-manager/index.d.ts +0 -1
  315. package/lib/file-manager/schemas/storage.d.ts +0 -2
  316. package/lib/file-manager/schemas/storage.js +0 -360
@@ -1,4 +1,12 @@
1
- var _templateObject, _templateObject2, _templateObject3, _templateObject4;
1
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
2
+
3
+ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
4
+
5
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6
+
7
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
8
+
9
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
10
 
3
11
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4
12
 
@@ -12,24 +20,16 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
12
20
 
13
21
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
14
22
 
15
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
16
-
17
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
18
-
19
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
20
-
21
- function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
22
-
23
- import { useDndContext, useDndMonitor, useDroppable } from '@dnd-kit/core';
23
+ import { useDndContext, useDndMonitor, useDraggable, useDroppable } from '@dnd-kit/core';
24
24
  import { css } from '@emotion/css';
25
25
  import { observer, RecursionField, Schema, useField, useFieldSchema } from '@formily/react';
26
26
  import { uid } from '@formily/shared';
27
27
  import cls from 'classnames';
28
28
  import React, { createContext, useContext, useEffect, useRef, useState } from 'react';
29
- import { useFormBlockContext, useSchemaInitializer } from '../../../';
29
+ import { useDesignable, useFormBlockContext, useSchemaInitializer } from '../../../';
30
30
  import { DndContext } from '../../common/dnd-context';
31
- var GridRowContext = /*#__PURE__*/createContext(null);
32
- var GridColContext = /*#__PURE__*/createContext(null);
31
+ var GridRowContext = /*#__PURE__*/createContext({});
32
+ var GridColContext = /*#__PURE__*/createContext({});
33
33
  var GridContext = /*#__PURE__*/createContext({});
34
34
 
35
35
  var breakRemoveOnGrid = function breakRemoveOnGrid(s) {
@@ -50,6 +50,11 @@ var ColDivider = function ColDivider(props) {
50
50
  isOver = _useDroppable.isOver,
51
51
  setNodeRef = _useDroppable.setNodeRef;
52
52
 
53
+ var _useDesignable = useDesignable(),
54
+ dn = _useDesignable.dn,
55
+ designable = _useDesignable.designable;
56
+
57
+ var dividerRef = useRef();
53
58
  var droppableStyle = {
54
59
  backgroundColor: isOver ? 'rgba(241, 139, 98, .1)' : undefined
55
60
  };
@@ -68,11 +73,89 @@ var ColDivider = function ColDivider(props) {
68
73
  }
69
74
  }
70
75
 
76
+ var prevSchema = props.cols[props.index];
77
+ var nextSchema = props.cols[props.index + 1];
78
+
79
+ var _useDraggable = useDraggable({
80
+ disabled: props.first || props.last || !designable,
81
+ id: props.id,
82
+ data: {
83
+ dividerRef: dividerRef,
84
+ prevSchema: prevSchema,
85
+ nextSchema: nextSchema
86
+ }
87
+ }),
88
+ attributes = _useDraggable.attributes,
89
+ listeners = _useDraggable.listeners,
90
+ setDraggableNodeRef = _useDraggable.setNodeRef,
91
+ isDragging = _useDraggable.isDragging;
92
+
93
+ var _useState = useState([0, 0]),
94
+ _useState2 = _slicedToArray(_useState, 2),
95
+ clientWidths = _useState2[0],
96
+ setClientWidths = _useState2[1];
97
+
98
+ useDndMonitor({
99
+ onDragStart: function onDragStart(event) {
100
+ if (!isDragging) {
101
+ return;
102
+ }
103
+
104
+ var el = dividerRef.current;
105
+ var prev = el.previousElementSibling;
106
+ var next = el.nextElementSibling;
107
+ setClientWidths([prev.clientWidth, next.clientWidth]);
108
+ },
109
+ onDragMove: function onDragMove(event) {
110
+ if (!isDragging) {
111
+ return;
112
+ }
113
+
114
+ var el = dividerRef.current;
115
+ var prev = el.previousElementSibling;
116
+ var next = el.nextElementSibling;
117
+ prev.style.width = "calc(".concat(clientWidths[0], "px + ").concat(event.delta.x, "px)");
118
+ next.style.width = "calc(".concat(clientWidths[1], "px - ").concat(event.delta.x, "px)");
119
+ },
120
+ onDragEnd: function onDragEnd(event) {
121
+ var _ref, _ref2;
122
+
123
+ if (clientWidths[0] <= 0 || clientWidths[1] <= 0) {
124
+ return;
125
+ }
126
+
127
+ setClientWidths([0, 0]);
128
+
129
+ if (!prevSchema || !nextSchema) {
130
+ return;
131
+ }
132
+
133
+ var el = dividerRef.current;
134
+ var prev = el.previousElementSibling;
135
+ var next = el.nextElementSibling;
136
+ prevSchema['x-component-props'] = prevSchema['x-component-props'] || {};
137
+ nextSchema['x-component-props'] = nextSchema['x-component-props'] || {};
138
+ prevSchema['x-component-props']['width'] = 100 * ((prev === null || prev === void 0 ? void 0 : prev.clientWidth) + 24 + 24 / props.cols.length) / el.parentElement.clientWidth;
139
+ nextSchema['x-component-props']['width'] = 100 * ((next === null || next === void 0 ? void 0 : next.clientWidth) + 24 + 24 / props.cols.length) / el.parentElement.clientWidth;
140
+ dn.emit('batchPatch', {
141
+ schemas: [(_ref = {}, _defineProperty(_ref, 'x-uid', prevSchema['x-uid']), _defineProperty(_ref, 'x-component-props', _objectSpread({}, prevSchema['x-component-props'])), _ref), (_ref2 = {}, _defineProperty(_ref2, 'x-uid', nextSchema['x-uid']), _defineProperty(_ref2, 'x-component-props', _objectSpread({}, nextSchema['x-component-props'])), _ref2)]
142
+ });
143
+ }
144
+ });
71
145
  return /*#__PURE__*/React.createElement("div", {
72
- ref: visible ? setNodeRef : null,
146
+ ref: function ref(el) {
147
+ if (visible) {
148
+ setNodeRef(el);
149
+ dividerRef.current = el;
150
+ }
151
+ },
73
152
  className: cls('nb-col-divider', css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 24px;\n "])))),
74
153
  style: _objectSpread({}, droppableStyle)
75
- });
154
+ }, /*#__PURE__*/React.createElement("div", _objectSpread(_objectSpread(_objectSpread({
155
+ ref: setDraggableNodeRef
156
+ }, listeners), attributes), {}, {
157
+ className: props.first || props.last || !designable ? null : css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n &::before {\n content: ' ';\n width: 12px;\n height: 100%;\n left: 6px;\n position: absolute;\n cursor: col-resize;\n }\n &:hover {\n &::before {\n background: rgba(241, 139, 98, 0.06) !important;\n }\n }\n width: 24px;\n height: 100%;\n position: absolute;\n cursor: col-resize;\n "])))
158
+ })));
76
159
  };
77
160
 
78
161
  var RowDivider = function RowDivider(props) {
@@ -91,10 +174,10 @@ var RowDivider = function RowDivider(props) {
91
174
  droppableStyle['backgroundColor'] = 'rgba(241, 139, 98, .1)';
92
175
  }
93
176
 
94
- var _useState = useState(false),
95
- _useState2 = _slicedToArray(_useState, 2),
96
- active = _useState2[0],
97
- setActive = _useState2[1];
177
+ var _useState3 = useState(false),
178
+ _useState4 = _slicedToArray(_useState3, 2),
179
+ active = _useState4[0],
180
+ setActive = _useState4[1];
98
181
 
99
182
  var dndContext = useDndContext();
100
183
  var currentSchema = props.rows[props.index];
@@ -128,7 +211,7 @@ var RowDivider = function RowDivider(props) {
128
211
  });
129
212
  return /*#__PURE__*/React.createElement("span", {
130
213
  ref: visible ? setNodeRef : null,
131
- className: cls('nb-row-divider', css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n height: 24px;\n width: 100%;\n position: absolute;\n margin-top: -24px;\n "])))),
214
+ className: cls('nb-row-divider', css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n height: 24px;\n width: 100%;\n position: absolute;\n margin-top: -24px;\n "])))),
132
215
  style: _objectSpread({
133
216
  zIndex: active ? 1000 : -1
134
217
  }, droppableStyle)
@@ -275,10 +358,11 @@ Grid.Row = observer(function (props) {
275
358
  var cols = useColProperties();
276
359
  return /*#__PURE__*/React.createElement(GridRowContext.Provider, {
277
360
  value: {
361
+ schema: fieldSchema,
278
362
  cols: cols
279
363
  }
280
364
  }, /*#__PURE__*/React.createElement("div", {
281
- className: cls('nb-grid-row', css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin: 0 -24px;\n display: flex;\n position: relative;\n /* z-index: 0; */\n "]))))
365
+ className: cls('nb-grid-row', css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n margin: 0 -24px;\n display: flex;\n position: relative;\n /* z-index: 0; */\n "]))))
282
366
  }, /*#__PURE__*/React.createElement(ColDivider, {
283
367
  cols: cols,
284
368
  first: true,
@@ -298,6 +382,7 @@ Grid.Row = observer(function (props) {
298
382
  }), /*#__PURE__*/React.createElement(ColDivider, {
299
383
  cols: cols,
300
384
  index: index,
385
+ last: index === cols.length - 1,
301
386
  id: "".concat(addr, "_").concat(index + 1),
302
387
  data: {
303
388
  breakRemoveOn: breakRemoveOnRow,
@@ -309,15 +394,39 @@ Grid.Row = observer(function (props) {
309
394
  })));
310
395
  });
311
396
  Grid.Col = observer(function (props) {
397
+ var _schema$xComponentP;
398
+
312
399
  var _useContext = useContext(GridRowContext),
313
400
  cols = _useContext.cols;
314
401
 
315
- var w = props.width || 100 / cols.length;
402
+ var schema = useFieldSchema();
403
+ var field = useField();
404
+ var w = (schema === null || schema === void 0 ? void 0 : (_schema$xComponentP = schema['x-component-props']) === null || _schema$xComponentP === void 0 ? void 0 : _schema$xComponentP['width']) || 100 / cols.length;
316
405
  var width = "calc(".concat(w, "% - 24px - 24px / ").concat(cols.length, ")");
317
- return /*#__PURE__*/React.createElement("div", {
406
+
407
+ var _useDroppable3 = useDroppable({
408
+ id: field.address.toString(),
409
+ data: {
410
+ insertAdjacent: 'beforeEnd',
411
+ schema: schema,
412
+ wrapSchema: function wrapSchema(s) {
413
+ return s;
414
+ }
415
+ }
416
+ }),
417
+ isOver = _useDroppable3.isOver,
418
+ setNodeRef = _useDroppable3.setNodeRef;
419
+
420
+ return /*#__PURE__*/React.createElement(GridColContext.Provider, {
421
+ value: {
422
+ cols: cols,
423
+ schema: schema
424
+ }
425
+ }, /*#__PURE__*/React.createElement("div", {
426
+ ref: setNodeRef,
318
427
  style: {
319
428
  width: width
320
429
  },
321
- className: cls('nb-grid-col', css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: relative;\n /* z-index: 0; */\n "]))))
322
- }, props.children);
430
+ className: cls('nb-grid-col', css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n position: relative;\n /* z-index: 0; */\n "]))))
431
+ }, props.children));
323
432
  });
@@ -4,6 +4,7 @@ export * from './calendar';
4
4
  export * from './card-item';
5
5
  export * from './cascader';
6
6
  export * from './checkbox';
7
+ export * from './cron';
7
8
  export * from './color-select';
8
9
  export * from './date-picker';
9
10
  export * from './filter';
@@ -4,6 +4,7 @@ export * from './calendar';
4
4
  export * from './card-item';
5
5
  export * from './cascader';
6
6
  export * from './checkbox';
7
+ export * from './cron';
7
8
  export * from './color-select';
8
9
  export * from './date-picker';
9
10
  export * from './filter';
@@ -33,6 +33,7 @@ import { FormProvider, SchemaComponentOptions } from '../../core';
33
33
  import { useCompile } from '../../hooks';
34
34
  import { ActionContext, useActionContext } from '../action';
35
35
  import { useFieldNames } from './useFieldNames';
36
+ import { getLabelFormatValue, useLabelUiSchema } from './util';
36
37
  var RecordPickerContext = /*#__PURE__*/createContext(null);
37
38
 
38
39
  var useTableSelectorProps = function useTableSelectorProps() {
@@ -130,6 +131,7 @@ export var InputRecordPicker = function InputRecordPicker(props) {
130
131
  var fieldSchema = useFieldSchema();
131
132
  var collectionField = useAssociation(props);
132
133
  var compile = useCompile();
134
+ var labelUiSchema = useLabelUiSchema(collectionField, (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.label) || 'label');
133
135
 
134
136
  var _useState3 = useState([]),
135
137
  _useState4 = _slicedToArray(_useState3, 2),
@@ -145,12 +147,12 @@ export var InputRecordPicker = function InputRecordPicker(props) {
145
147
  if (value) {
146
148
  var opts = (Array.isArray(value) ? value : value ? [value] : []).map(function (option) {
147
149
  var label = option[fieldNames.label];
148
- return _objectSpread(_objectSpread({}, option), {}, _defineProperty({}, fieldNames.label, compile(label)));
150
+ return _objectSpread(_objectSpread({}, option), {}, _defineProperty({}, fieldNames.label, getLabelFormatValue(labelUiSchema, compile(label))));
149
151
  });
150
152
  setOptions(opts);
151
153
  setSelectedRows(opts);
152
154
  }
153
- }, [value]);
155
+ }, [value, fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.label]);
154
156
 
155
157
  var getValue = function getValue() {
156
158
  if (multiple == null) return null; // console.log('getValue', multiple, value, Array.isArray(value));
@@ -21,6 +21,7 @@ import { useCompile } from '../../hooks';
21
21
  import { ActionContext } from '../action';
22
22
  import { EllipsisWithTooltip } from '../input/EllipsisWithTooltip';
23
23
  import { useFieldNames } from './useFieldNames';
24
+ import { getLabelFormatValue, useLabelUiSchema } from './util';
24
25
  export var ReadPrettyRecordPicker = observer(function (props) {
25
26
  var ellipsis = props.ellipsis;
26
27
  var fieldSchema = useFieldSchema();
@@ -53,10 +54,12 @@ export var ReadPrettyRecordPicker = observer(function (props) {
53
54
  setRecord = _useState6[1];
54
55
 
55
56
  var compile = useCompile();
57
+ var labelUiSchema = useLabelUiSchema(collectionField, (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.label) || 'label');
56
58
  var ellipsisWithTooltipRef = useRef();
57
59
 
58
60
  var renderRecords = function renderRecords() {
59
61
  return toArr(field.value).map(function (record, index, arr) {
62
+ var val = compile(record === null || record === void 0 ? void 0 : record[(fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.label) || 'label']) || (record === null || record === void 0 ? void 0 : record[(fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value) || 'value']) || (record === null || record === void 0 ? void 0 : record.id);
60
63
  return /*#__PURE__*/React.createElement(Fragment, {
61
64
  key: "".concat(record.id, "_").concat(index)
62
65
  }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("a", {
@@ -69,12 +72,12 @@ export var ReadPrettyRecordPicker = observer(function (props) {
69
72
  setRecord(record);
70
73
  ellipsisWithTooltipRef === null || ellipsisWithTooltipRef === void 0 ? void 0 : (_ellipsisWithTooltipR = ellipsisWithTooltipRef.current) === null || _ellipsisWithTooltipR === void 0 ? void 0 : _ellipsisWithTooltipR.setPopoverVisible(false);
71
74
  }
72
- }, compile(record === null || record === void 0 ? void 0 : record[(fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.label) || 'label']) || (record === null || record === void 0 ? void 0 : record[(fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value) || 'value']) || (record === null || record === void 0 ? void 0 : record.id))), index < arr.length - 1 ? /*#__PURE__*/React.createElement("span", {
75
+ }, getLabelFormatValue(labelUiSchema, val))), index < arr.length - 1 ? /*#__PURE__*/React.createElement("span", {
73
76
  style: {
74
77
  marginRight: 4,
75
78
  color: '#aaa'
76
79
  }
77
- }, ", ") : null);
80
+ }, ",") : null);
78
81
  });
79
82
  };
80
83
 
@@ -0,0 +1,5 @@
1
+ import { ISchema } from '@formily/react';
2
+ import { CollectionFieldOptions } from '../../../collection-manager';
3
+ export declare const useLabelUiSchema: (collectionField: CollectionFieldOptions, label: string) => ISchema;
4
+ export declare const getDatePickerLabels: (props: any) => string;
5
+ export declare const getLabelFormatValue: (labelUiSchema: ISchema, value: any) => string;
@@ -0,0 +1,37 @@
1
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2
+
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
+
5
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+
7
+ import { isArr } from '@formily/shared';
8
+ import { getDefaultFormat, str2moment } from '@nocobase/utils/client';
9
+ import { useCollectionManager } from '../../../collection-manager';
10
+ export var useLabelUiSchema = function useLabelUiSchema(collectionField, label) {
11
+ var _useCollectionManager = useCollectionManager(),
12
+ getCollectionJoinField = _useCollectionManager.getCollectionJoinField;
13
+
14
+ if (!collectionField) {
15
+ return;
16
+ }
17
+
18
+ var labelField = getCollectionJoinField("".concat(collectionField.target, ".").concat(label));
19
+ return labelField === null || labelField === void 0 ? void 0 : labelField.uiSchema;
20
+ };
21
+ export var getDatePickerLabels = function getDatePickerLabels(props) {
22
+ var format = getDefaultFormat(props);
23
+ var m = str2moment(props.value, props);
24
+ var labels = m && m.isValid() ? m.format(format) : props.value;
25
+ return isArr(labels) ? labels.join('~') : labels;
26
+ };
27
+ export var getLabelFormatValue = function getLabelFormatValue(labelUiSchema, value) {
28
+ switch (labelUiSchema === null || labelUiSchema === void 0 ? void 0 : labelUiSchema['x-component']) {
29
+ case 'DatePicker':
30
+ return getDatePickerLabels(_objectSpread(_objectSpread({}, labelUiSchema === null || labelUiSchema === void 0 ? void 0 : labelUiSchema['x-component-props']), {}, {
31
+ value: value
32
+ }));
33
+
34
+ default:
35
+ return value;
36
+ }
37
+ };
@@ -24,7 +24,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
24
24
 
25
25
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
26
26
 
27
- import { useField } from '@formily/react';
27
+ import { useField, useForm } from '@formily/react';
28
28
  import { reaction } from '@formily/reactive';
29
29
  import { isArr, isValid, toArr as toArray } from '@formily/shared';
30
30
  import { useEffect } from 'react';
@@ -197,6 +197,7 @@ export function useUploadProps(_ref) {
197
197
  (_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, normalizeFileList(_toConsumableArray(param.fileList)));
198
198
  };
199
199
 
200
+ var form = useForm();
200
201
  var api = useAPIClient();
201
202
  return _objectSpread(_objectSpread({}, props), {}, {
202
203
  customRequest: function customRequest(_ref2) {
@@ -218,6 +219,7 @@ export function useUploadProps(_ref) {
218
219
  }
219
220
 
220
221
  formData.append(filename, file);
222
+ form.disabled = true;
221
223
  api.axios.post(action, formData, {
222
224
  withCredentials: withCredentials,
223
225
  headers: headers,
@@ -231,7 +233,9 @@ export function useUploadProps(_ref) {
231
233
  }).then(function (_ref4) {
232
234
  var data = _ref4.data;
233
235
  onSuccess(data, file);
234
- }).catch(onError);
236
+ }).catch(onError).finally(function () {
237
+ form.disabled = false;
238
+ });
235
239
  return {
236
240
  abort: function abort() {
237
241
  console.log('upload progress is aborted.');
@@ -4,9 +4,21 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
 
5
5
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
6
 
7
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
+
9
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
10
+
11
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
12
+
13
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
14
+
15
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
16
+
17
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
+
7
19
  import { DndContext as DndKitContext, DragOverlay, rectIntersection } from '@dnd-kit/core';
8
20
  import { observer } from '@formily/react';
9
- import React from 'react';
21
+ import React, { useState } from 'react';
10
22
  import { useTranslation } from 'react-i18next';
11
23
  import { useAPIClient } from '../../../';
12
24
  import { createDesignable, useDesignable } from '../../hooks';
@@ -21,7 +33,7 @@ var useDragEnd = function useDragEnd(props) {
21
33
  t = _useTranslation.t;
22
34
 
23
35
  return function (event) {
24
- var _active$data, _active$data$current, _over$data, _over$data$current, _over$data2, _over$data2$current, _over$data3, _over$data3$current, _over$data4, _over$data4$current;
36
+ var _active$data, _active$data$current, _over$data, _over$data$current, _over$data2, _over$data2$current, _over$data3, _over$data3$current, _over$data4, _over$data4$current, _over$data5, _over$data5$current;
25
37
 
26
38
  var active = event.active,
27
39
  over = event.over;
@@ -30,6 +42,7 @@ var useDragEnd = function useDragEnd(props) {
30
42
  var insertAdjacent = over === null || over === void 0 ? void 0 : (_over$data2 = over.data) === null || _over$data2 === void 0 ? void 0 : (_over$data2$current = _over$data2.current) === null || _over$data2$current === void 0 ? void 0 : _over$data2$current.insertAdjacent;
31
43
  var breakRemoveOn = over === null || over === void 0 ? void 0 : (_over$data3 = over.data) === null || _over$data3 === void 0 ? void 0 : (_over$data3$current = _over$data3.current) === null || _over$data3$current === void 0 ? void 0 : _over$data3$current.breakRemoveOn;
32
44
  var wrapSchema = over === null || over === void 0 ? void 0 : (_over$data4 = over.data) === null || _over$data4 === void 0 ? void 0 : (_over$data4$current = _over$data4.current) === null || _over$data4$current === void 0 ? void 0 : _over$data4$current.wrapSchema;
45
+ var onSuccess = over === null || over === void 0 ? void 0 : (_over$data5 = over.data) === null || _over$data5 === void 0 ? void 0 : (_over$data5$current = _over$data5.current) === null || _over$data5$current === void 0 ? void 0 : _over$data5$current.onSuccess;
33
46
 
34
47
  if (!activeSchema || !overSchema) {
35
48
  var _props$onDragEnd;
@@ -67,7 +80,8 @@ var useDragEnd = function useDragEnd(props) {
67
80
  dn.insertAdjacent(insertAdjacent, activeSchema, {
68
81
  wrap: wrapSchema,
69
82
  breakRemoveOn: breakRemoveOn,
70
- removeParentsIfNoChildren: true
83
+ removeParentsIfNoChildren: true,
84
+ onSuccess: onSuccess
71
85
  });
72
86
  props === null || props === void 0 ? void 0 : (_props$onDragEnd4 = props.onDragEnd) === null || _props$onDragEnd4 === void 0 ? void 0 : _props$onDragEnd4.call(props, event);
73
87
  return;
@@ -79,16 +93,28 @@ export var DndContext = observer(function (props) {
79
93
  var _useTranslation2 = useTranslation(),
80
94
  t = _useTranslation2.t;
81
95
 
96
+ var _useState = useState(true),
97
+ _useState2 = _slicedToArray(_useState, 2),
98
+ visible = _useState2[0],
99
+ setVisible = _useState2[1];
100
+
82
101
  return /*#__PURE__*/React.createElement(DndKitContext, _objectSpread(_objectSpread({
83
102
  collisionDetection: rectIntersection
84
103
  }, props), {}, {
104
+ onDragStart: function onDragStart(event) {
105
+ var _active$data2, _active$data2$current;
106
+
107
+ var active = event.active;
108
+ var activeSchema = active === null || active === void 0 ? void 0 : (_active$data2 = active.data) === null || _active$data2 === void 0 ? void 0 : (_active$data2$current = _active$data2.current) === null || _active$data2$current === void 0 ? void 0 : _active$data2$current.schema;
109
+ setVisible(!!activeSchema);
110
+ },
85
111
  onDragEnd: useDragEnd(props)
86
112
  }), /*#__PURE__*/React.createElement(DragOverlay, {
87
113
  dropAnimation: {
88
114
  duration: 10,
89
115
  easing: 'cubic-bezier(0.18, 0.67, 0.6, 1.22)'
90
116
  }
91
- }, /*#__PURE__*/React.createElement("span", {
117
+ }, visible && /*#__PURE__*/React.createElement("span", {
92
118
  style: {
93
119
  whiteSpace: 'nowrap'
94
120
  }
@@ -35,8 +35,8 @@ export declare class Designable {
35
35
  constructor(options: CreateDesignableProps);
36
36
  loadAPIClientEvents(): void;
37
37
  prepareProperty(schema: ISchema): void;
38
- on(name: 'insertAdjacent' | 'remove' | 'error' | 'patch', listener: any): void;
39
- emit(name: 'insertAdjacent' | 'remove' | 'error' | 'patch', ...args: any[]): void;
38
+ on(name: 'insertAdjacent' | 'remove' | 'error' | 'patch' | 'batchPatch', listener: any): void;
39
+ emit(name: 'insertAdjacent' | 'remove' | 'error' | 'patch' | 'batchPatch', ...args: any[]): void;
40
40
  parentsIn(schema: Schema): boolean;
41
41
  refresh(): void;
42
42
  insertAdjacent(position: Position, schema: ISchema, options?: InsertAdjacentOptions): void;