@nocobase/client 0.7.4-alpha.7 → 0.7.5-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 (275) hide show
  1. package/es/block-provider/TableBlockProvider.js +3 -3
  2. package/es/collection-manager/Configuration/AddFieldAction.js +38 -41
  3. package/es/collection-manager/Configuration/EditFieldAction.js +64 -41
  4. package/es/collection-manager/interfaces/email.js +4 -2
  5. package/es/collection-manager/interfaces/formula.js +1 -1
  6. package/es/collection-manager/interfaces/index.d.ts +1 -0
  7. package/es/collection-manager/interfaces/index.js +1 -0
  8. package/es/collection-manager/interfaces/input.js +4 -2
  9. package/es/collection-manager/interfaces/integer.js +4 -2
  10. package/es/collection-manager/interfaces/m2m.js +2 -2
  11. package/es/collection-manager/interfaces/m2o.js +7 -3
  12. package/es/collection-manager/interfaces/number.js +3 -2
  13. package/es/collection-manager/interfaces/o2m.js +8 -4
  14. package/es/collection-manager/interfaces/o2o.js +19 -6
  15. package/es/collection-manager/interfaces/password.js +4 -2
  16. package/es/collection-manager/interfaces/percent.js +2 -1
  17. package/es/collection-manager/interfaces/phone.js +4 -2
  18. package/es/collection-manager/interfaces/properties/index.d.ts +7 -0
  19. package/es/collection-manager/interfaces/properties/index.js +91 -0
  20. package/es/collection-manager/interfaces/sequence.d.ts +2 -0
  21. package/es/collection-manager/interfaces/sequence.js +431 -0
  22. package/es/locale/en_US.d.ts +1 -0
  23. package/es/locale/en_US.js +2 -1
  24. package/es/locale/index.js +24 -0
  25. package/es/locale/ja_JP.d.ts +590 -0
  26. package/es/locale/ja_JP.js +591 -0
  27. package/es/locale/ru_RU.d.ts +560 -0
  28. package/es/locale/ru_RU.js +559 -0
  29. package/es/locale/zh_CN.d.ts +27 -0
  30. package/es/locale/zh_CN.js +30 -3
  31. package/es/route-switch/antd/admin-layout/index.js +19 -4
  32. package/es/schema-component/antd/action/Action.js +3 -1
  33. package/es/schema-component/antd/action/ActionBar.js +8 -1
  34. package/es/schema-component/antd/cron/Cron.d.ts +6 -0
  35. package/es/schema-component/antd/cron/Cron.js +49 -0
  36. package/es/schema-component/antd/cron/index.d.ts +1 -0
  37. package/es/schema-component/antd/cron/index.js +1 -0
  38. package/es/schema-component/antd/cron/locale/zh-CN.d.ts +34 -0
  39. package/es/schema-component/antd/cron/locale/zh-CN.js +37 -0
  40. package/es/schema-component/antd/filter/Filter.Action.Designer.js +1 -0
  41. package/es/schema-component/antd/formula-input/Compute.js +1 -1
  42. package/es/schema-component/antd/grid/Grid.js +134 -25
  43. package/es/schema-component/antd/index.d.ts +1 -0
  44. package/es/schema-component/antd/index.js +1 -0
  45. package/es/schema-component/antd/record-picker/InputRecordPicker.js +4 -2
  46. package/es/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +5 -2
  47. package/es/schema-component/antd/record-picker/util.d.ts +5 -0
  48. package/es/schema-component/antd/record-picker/util.js +37 -0
  49. package/es/schema-component/antd/upload/shared.js +6 -2
  50. package/es/schema-component/common/dnd-context/index.js +30 -4
  51. package/es/schema-component/hooks/useDesignable.d.ts +2 -2
  52. package/es/schema-component/hooks/useDesignable.js +130 -26
  53. package/es/schema-initializer/SchemaInitializer.d.ts +1 -0
  54. package/es/schema-initializer/SchemaInitializer.js +6 -2
  55. package/es/schema-initializer/buttons/TabPaneInitializers.d.ts +2 -1
  56. package/es/schema-initializer/buttons/TabPaneInitializers.js +9 -3
  57. package/es/schema-initializer/items/ActionInitializer.d.ts +1 -0
  58. package/es/schema-initializer/items/ActionInitializer.js +13 -0
  59. package/es/schema-initializer/items/BlockInitializer.d.ts +1 -0
  60. package/es/schema-initializer/items/BlockInitializer.js +18 -0
  61. package/es/schema-initializer/items/BulkDestroyActionInitializer.d.ts +1 -0
  62. package/es/schema-initializer/items/BulkDestroyActionInitializer.js +27 -0
  63. package/es/schema-initializer/items/CalendarBlockInitializer.d.ts +1 -0
  64. package/es/schema-initializer/items/CalendarBlockInitializer.js +124 -0
  65. package/es/schema-initializer/items/CollectionFieldInitializer.d.ts +1 -0
  66. package/es/schema-initializer/items/CollectionFieldInitializer.js +15 -0
  67. package/es/schema-initializer/items/CreateActionInitializer.d.ts +1 -0
  68. package/es/schema-initializer/items/CreateActionInitializer.js +60 -0
  69. package/es/schema-initializer/items/CreateFormBlockInitializer.d.ts +1 -0
  70. package/es/schema-initializer/items/CreateFormBlockInitializer.js +102 -0
  71. package/es/schema-initializer/items/CreateSubmitActionInitializer.d.ts +1 -0
  72. package/es/schema-initializer/items/CreateSubmitActionInitializer.js +24 -0
  73. package/es/schema-initializer/items/CustomizeActionInitializer.d.ts +1 -0
  74. package/es/schema-initializer/items/CustomizeActionInitializer.js +11 -0
  75. package/es/schema-initializer/items/DataBlockInitializer.d.ts +1 -0
  76. package/es/schema-initializer/items/DataBlockInitializer.js +88 -0
  77. package/es/schema-initializer/items/DestroyActionInitializer.d.ts +1 -0
  78. package/es/schema-initializer/items/DestroyActionInitializer.js +27 -0
  79. package/es/schema-initializer/items/DetailsBlockInitializer.d.ts +1 -0
  80. package/es/schema-initializer/items/DetailsBlockInitializer.js +55 -0
  81. package/es/schema-initializer/items/FilterActionInitializer.d.ts +1 -0
  82. package/es/schema-initializer/items/FilterActionInitializer.js +24 -0
  83. package/es/schema-initializer/items/FormBlockInitializer.d.ts +1 -0
  84. package/es/schema-initializer/items/FormBlockInitializer.js +30 -0
  85. package/es/schema-initializer/items/G2PlotInitializer.d.ts +1 -0
  86. package/es/schema-initializer/items/G2PlotInitializer.js +25 -0
  87. package/es/schema-initializer/items/InitializerWithSwitch.d.ts +1 -0
  88. package/es/schema-initializer/items/InitializerWithSwitch.js +32 -0
  89. package/es/schema-initializer/items/KanbanBlockInitializer.d.ts +1 -0
  90. package/es/schema-initializer/items/KanbanBlockInitializer.js +138 -0
  91. package/es/schema-initializer/items/MarkdownBlockInitializer.d.ts +1 -0
  92. package/es/schema-initializer/items/MarkdownBlockInitializer.js +32 -0
  93. package/es/schema-initializer/items/PrintActionInitializer.d.ts +1 -0
  94. package/es/schema-initializer/items/PrintActionInitializer.js +23 -0
  95. package/es/schema-initializer/items/RecordAssociationBlockInitializer.d.ts +1 -0
  96. package/es/schema-initializer/items/RecordAssociationBlockInitializer.js +90 -0
  97. package/es/schema-initializer/items/RecordAssociationCalendarBlockInitializer.d.ts +1 -0
  98. package/es/schema-initializer/items/RecordAssociationCalendarBlockInitializer.js +160 -0
  99. package/es/schema-initializer/items/RecordAssociationDetailsBlockInitializer.d.ts +1 -0
  100. package/es/schema-initializer/items/RecordAssociationDetailsBlockInitializer.js +90 -0
  101. package/es/schema-initializer/items/RecordAssociationFormBlockInitializer.d.ts +1 -0
  102. package/es/schema-initializer/items/RecordAssociationFormBlockInitializer.js +112 -0
  103. package/es/schema-initializer/items/RecordFormBlockInitializer.d.ts +1 -0
  104. package/es/schema-initializer/items/RecordFormBlockInitializer.js +109 -0
  105. package/es/schema-initializer/items/RecordReadPrettyAssociationFormBlockInitializer.d.ts +1 -0
  106. package/es/schema-initializer/items/RecordReadPrettyAssociationFormBlockInitializer.js +116 -0
  107. package/es/schema-initializer/items/RecordReadPrettyFormBlockInitializer.d.ts +1 -0
  108. package/es/schema-initializer/items/RecordReadPrettyFormBlockInitializer.js +114 -0
  109. package/es/schema-initializer/items/RefreshActionInitializer.d.ts +1 -0
  110. package/es/schema-initializer/items/RefreshActionInitializer.js +23 -0
  111. package/es/schema-initializer/items/SubmitActionInitializer.d.ts +1 -0
  112. package/es/schema-initializer/items/SubmitActionInitializer.js +24 -0
  113. package/es/schema-initializer/items/TableActionColumnInitializer.d.ts +1 -0
  114. package/es/schema-initializer/items/TableActionColumnInitializer.js +34 -0
  115. package/es/schema-initializer/items/TableBlockInitializer.d.ts +1 -0
  116. package/es/schema-initializer/items/TableBlockInitializer.js +55 -0
  117. package/es/schema-initializer/items/TableCollectionFieldInitializer.d.ts +1 -0
  118. package/es/schema-initializer/items/TableCollectionFieldInitializer.js +15 -0
  119. package/es/schema-initializer/items/TableSelectorInitializer.d.ts +1 -0
  120. package/es/schema-initializer/items/TableSelectorInitializer.js +67 -0
  121. package/es/schema-initializer/items/UpdateActionInitializer.d.ts +1 -0
  122. package/es/schema-initializer/items/UpdateActionInitializer.js +59 -0
  123. package/es/schema-initializer/items/UpdateSubmitActionInitializer.d.ts +1 -0
  124. package/es/schema-initializer/items/UpdateSubmitActionInitializer.js +24 -0
  125. package/es/schema-initializer/items/ViewActionInitializer.d.ts +1 -0
  126. package/es/schema-initializer/items/ViewActionInitializer.js +58 -0
  127. package/es/schema-initializer/items/index.d.ts +35 -35
  128. package/es/schema-initializer/items/index.js +35 -1589
  129. package/es/schema-initializer/style.less +4 -0
  130. package/es/schema-templates/SchemaTemplateManagerProvider.js +2 -5
  131. package/es/system-settings/SystemSettingsShortcut.js +7 -0
  132. package/es/user/SigninPage.d.ts +11 -2
  133. package/es/user/SigninPage.js +140 -33
  134. package/es/user/SignupPage.d.ts +7 -1
  135. package/es/user/SignupPage.js +54 -10
  136. package/es/user/VerificationCode.d.ts +7 -0
  137. package/es/user/VerificationCode.js +129 -0
  138. package/lib/block-provider/TableBlockProvider.js +3 -3
  139. package/lib/collection-manager/Configuration/AddFieldAction.js +38 -40
  140. package/lib/collection-manager/Configuration/EditFieldAction.js +65 -40
  141. package/lib/collection-manager/interfaces/email.js +3 -1
  142. package/lib/collection-manager/interfaces/formula.js +1 -1
  143. package/lib/collection-manager/interfaces/index.d.ts +1 -0
  144. package/lib/collection-manager/interfaces/index.js +13 -0
  145. package/lib/collection-manager/interfaces/input.js +3 -1
  146. package/lib/collection-manager/interfaces/integer.js +3 -1
  147. package/lib/collection-manager/interfaces/m2m.js +1 -1
  148. package/lib/collection-manager/interfaces/m2o.js +6 -2
  149. package/lib/collection-manager/interfaces/number.js +4 -3
  150. package/lib/collection-manager/interfaces/o2m.js +7 -3
  151. package/lib/collection-manager/interfaces/o2o.js +18 -5
  152. package/lib/collection-manager/interfaces/password.js +3 -1
  153. package/lib/collection-manager/interfaces/percent.js +1 -0
  154. package/lib/collection-manager/interfaces/phone.js +3 -1
  155. package/lib/collection-manager/interfaces/properties/index.d.ts +7 -0
  156. package/lib/collection-manager/interfaces/properties/index.js +94 -1
  157. package/lib/collection-manager/interfaces/sequence.d.ts +2 -0
  158. package/lib/collection-manager/interfaces/sequence.js +455 -0
  159. package/lib/locale/en_US.d.ts +1 -0
  160. package/lib/locale/en_US.js +2 -1
  161. package/lib/locale/index.js +28 -0
  162. package/lib/locale/ja_JP.d.ts +590 -0
  163. package/lib/locale/ja_JP.js +598 -0
  164. package/lib/locale/ru_RU.d.ts +560 -0
  165. package/lib/locale/ru_RU.js +566 -0
  166. package/lib/locale/zh_CN.d.ts +27 -0
  167. package/lib/locale/zh_CN.js +30 -3
  168. package/lib/route-switch/antd/admin-layout/index.js +19 -4
  169. package/lib/schema-component/antd/action/Action.js +2 -0
  170. package/lib/schema-component/antd/action/ActionBar.js +9 -1
  171. package/lib/schema-component/antd/cron/Cron.d.ts +6 -0
  172. package/lib/schema-component/antd/cron/Cron.js +67 -0
  173. package/lib/schema-component/antd/cron/index.d.ts +1 -0
  174. package/lib/schema-component/antd/cron/index.js +18 -0
  175. package/lib/schema-component/antd/cron/locale/zh-CN.d.ts +34 -0
  176. package/lib/schema-component/antd/cron/locale/zh-CN.js +44 -0
  177. package/lib/schema-component/antd/filter/Filter.Action.Designer.js +1 -0
  178. package/lib/schema-component/antd/formula-input/Compute.js +1 -1
  179. package/lib/schema-component/antd/grid/Grid.js +132 -23
  180. package/lib/schema-component/antd/index.d.ts +1 -0
  181. package/lib/schema-component/antd/index.js +13 -0
  182. package/lib/schema-component/antd/record-picker/InputRecordPicker.js +5 -2
  183. package/lib/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +6 -2
  184. package/lib/schema-component/antd/record-picker/util.d.ts +5 -0
  185. package/lib/schema-component/antd/record-picker/util.js +55 -0
  186. package/lib/schema-component/antd/upload/shared.js +5 -1
  187. package/lib/schema-component/common/dnd-context/index.js +35 -5
  188. package/lib/schema-component/hooks/useDesignable.d.ts +2 -2
  189. package/lib/schema-component/hooks/useDesignable.js +132 -28
  190. package/lib/schema-initializer/SchemaInitializer.d.ts +1 -0
  191. package/lib/schema-initializer/SchemaInitializer.js +7 -2
  192. package/lib/schema-initializer/buttons/TabPaneInitializers.d.ts +2 -1
  193. package/lib/schema-initializer/buttons/TabPaneInitializers.js +13 -4
  194. package/lib/schema-initializer/items/ActionInitializer.d.ts +1 -0
  195. package/lib/schema-initializer/items/ActionInitializer.js +26 -0
  196. package/lib/schema-initializer/items/BlockInitializer.d.ts +1 -0
  197. package/lib/schema-initializer/items/BlockInitializer.js +31 -0
  198. package/lib/schema-initializer/items/BulkDestroyActionInitializer.d.ts +1 -0
  199. package/lib/schema-initializer/items/BulkDestroyActionInitializer.js +40 -0
  200. package/lib/schema-initializer/items/CalendarBlockInitializer.d.ts +1 -0
  201. package/lib/schema-initializer/items/CalendarBlockInitializer.js +148 -0
  202. package/lib/schema-initializer/items/CollectionFieldInitializer.d.ts +1 -0
  203. package/lib/schema-initializer/items/CollectionFieldInitializer.js +28 -0
  204. package/lib/schema-initializer/items/CreateActionInitializer.d.ts +1 -0
  205. package/lib/schema-initializer/items/CreateActionInitializer.js +73 -0
  206. package/lib/schema-initializer/items/CreateFormBlockInitializer.d.ts +1 -0
  207. package/lib/schema-initializer/items/CreateFormBlockInitializer.js +120 -0
  208. package/lib/schema-initializer/items/CreateSubmitActionInitializer.d.ts +1 -0
  209. package/lib/schema-initializer/items/CreateSubmitActionInitializer.js +37 -0
  210. package/lib/schema-initializer/items/CustomizeActionInitializer.d.ts +1 -0
  211. package/lib/schema-initializer/items/CustomizeActionInitializer.js +24 -0
  212. package/lib/schema-initializer/items/DataBlockInitializer.d.ts +1 -0
  213. package/lib/schema-initializer/items/DataBlockInitializer.js +104 -0
  214. package/lib/schema-initializer/items/DestroyActionInitializer.d.ts +1 -0
  215. package/lib/schema-initializer/items/DestroyActionInitializer.js +40 -0
  216. package/lib/schema-initializer/items/DetailsBlockInitializer.d.ts +1 -0
  217. package/lib/schema-initializer/items/DetailsBlockInitializer.js +71 -0
  218. package/lib/schema-initializer/items/FilterActionInitializer.d.ts +1 -0
  219. package/lib/schema-initializer/items/FilterActionInitializer.js +37 -0
  220. package/lib/schema-initializer/items/FormBlockInitializer.d.ts +1 -0
  221. package/lib/schema-initializer/items/FormBlockInitializer.js +45 -0
  222. package/lib/schema-initializer/items/G2PlotInitializer.d.ts +1 -0
  223. package/lib/schema-initializer/items/G2PlotInitializer.js +38 -0
  224. package/lib/schema-initializer/items/InitializerWithSwitch.d.ts +1 -0
  225. package/lib/schema-initializer/items/InitializerWithSwitch.js +47 -0
  226. package/lib/schema-initializer/items/KanbanBlockInitializer.d.ts +1 -0
  227. package/lib/schema-initializer/items/KanbanBlockInitializer.js +163 -0
  228. package/lib/schema-initializer/items/MarkdownBlockInitializer.d.ts +1 -0
  229. package/lib/schema-initializer/items/MarkdownBlockInitializer.js +47 -0
  230. package/lib/schema-initializer/items/PrintActionInitializer.d.ts +1 -0
  231. package/lib/schema-initializer/items/PrintActionInitializer.js +36 -0
  232. package/lib/schema-initializer/items/RecordAssociationBlockInitializer.d.ts +1 -0
  233. package/lib/schema-initializer/items/RecordAssociationBlockInitializer.js +107 -0
  234. package/lib/schema-initializer/items/RecordAssociationCalendarBlockInitializer.d.ts +1 -0
  235. package/lib/schema-initializer/items/RecordAssociationCalendarBlockInitializer.js +185 -0
  236. package/lib/schema-initializer/items/RecordAssociationDetailsBlockInitializer.d.ts +1 -0
  237. package/lib/schema-initializer/items/RecordAssociationDetailsBlockInitializer.js +107 -0
  238. package/lib/schema-initializer/items/RecordAssociationFormBlockInitializer.d.ts +1 -0
  239. package/lib/schema-initializer/items/RecordAssociationFormBlockInitializer.js +128 -0
  240. package/lib/schema-initializer/items/RecordFormBlockInitializer.d.ts +1 -0
  241. package/lib/schema-initializer/items/RecordFormBlockInitializer.js +127 -0
  242. package/lib/schema-initializer/items/RecordReadPrettyAssociationFormBlockInitializer.d.ts +1 -0
  243. package/lib/schema-initializer/items/RecordReadPrettyAssociationFormBlockInitializer.js +133 -0
  244. package/lib/schema-initializer/items/RecordReadPrettyFormBlockInitializer.d.ts +1 -0
  245. package/lib/schema-initializer/items/RecordReadPrettyFormBlockInitializer.js +132 -0
  246. package/lib/schema-initializer/items/RefreshActionInitializer.d.ts +1 -0
  247. package/lib/schema-initializer/items/RefreshActionInitializer.js +36 -0
  248. package/lib/schema-initializer/items/SubmitActionInitializer.d.ts +1 -0
  249. package/lib/schema-initializer/items/SubmitActionInitializer.js +37 -0
  250. package/lib/schema-initializer/items/TableActionColumnInitializer.d.ts +1 -0
  251. package/lib/schema-initializer/items/TableActionColumnInitializer.js +47 -0
  252. package/lib/schema-initializer/items/TableBlockInitializer.d.ts +1 -0
  253. package/lib/schema-initializer/items/TableBlockInitializer.js +71 -0
  254. package/lib/schema-initializer/items/TableCollectionFieldInitializer.d.ts +1 -0
  255. package/lib/schema-initializer/items/TableCollectionFieldInitializer.js +28 -0
  256. package/lib/schema-initializer/items/TableSelectorInitializer.d.ts +1 -0
  257. package/lib/schema-initializer/items/TableSelectorInitializer.js +84 -0
  258. package/lib/schema-initializer/items/UpdateActionInitializer.d.ts +1 -0
  259. package/lib/schema-initializer/items/UpdateActionInitializer.js +72 -0
  260. package/lib/schema-initializer/items/UpdateSubmitActionInitializer.d.ts +1 -0
  261. package/lib/schema-initializer/items/UpdateSubmitActionInitializer.js +37 -0
  262. package/lib/schema-initializer/items/ViewActionInitializer.d.ts +1 -0
  263. package/lib/schema-initializer/items/ViewActionInitializer.js +71 -0
  264. package/lib/schema-initializer/items/index.d.ts +35 -35
  265. package/lib/schema-initializer/items/index.js +400 -1659
  266. package/lib/schema-initializer/style.less +4 -0
  267. package/lib/schema-templates/SchemaTemplateManagerProvider.js +2 -5
  268. package/lib/system-settings/SystemSettingsShortcut.js +7 -0
  269. package/lib/user/SigninPage.d.ts +11 -2
  270. package/lib/user/SigninPage.js +150 -34
  271. package/lib/user/SignupPage.d.ts +7 -1
  272. package/lib/user/SignupPage.js +56 -10
  273. package/lib/user/VerificationCode.d.ts +7 -0
  274. package/lib/user/VerificationCode.js +148 -0
  275. package/package.json +6 -4
@@ -1,1719 +1,460 @@
1
1
  "use strict";
2
2
 
3
- 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); }
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
8
- exports.ViewActionInitializer = exports.UpdateSubmitActionInitializer = exports.UpdateActionInitializer = exports.TableSelectorInitializer = exports.TableCollectionFieldInitializer = exports.TableBlockInitializer = exports.TableActionColumnInitializer = exports.SubmitActionInitializer = exports.RefreshActionInitializer = exports.RecordReadPrettyFormBlockInitializer = exports.RecordReadPrettyAssociationFormBlockInitializer = exports.RecordFormBlockInitializer = exports.RecordAssociationFormBlockInitializer = exports.RecordAssociationDetailsBlockInitializer = exports.RecordAssociationCalendarBlockInitializer = exports.RecordAssociationBlockInitializer = exports.PrintActionInitializer = exports.MarkdownBlockInitializer = exports.KanbanBlockInitializer = exports.InitializerWithSwitch = exports.G2PlotInitializer = exports.FormBlockInitializer = exports.FilterActionInitializer = exports.DetailsBlockInitializer = exports.DestroyActionInitializer = exports.DataBlockInitializer = exports.CustomizeActionInitializer = exports.CreateSubmitActionInitializer = exports.CreateFormBlockInitializer = exports.CreateActionInitializer = exports.CollectionFieldInitializer = exports.CalendarBlockInitializer = exports.BulkDestroyActionInitializer = exports.BlockInitializer = exports.ActionInitializer = void 0;
9
6
 
10
- var _icons = require("@ant-design/icons");
7
+ var _ActionInitializer = require("./ActionInitializer");
8
+
9
+ Object.keys(_ActionInitializer).forEach(function (key) {
10
+ if (key === "default" || key === "__esModule") return;
11
+ if (key in exports && exports[key] === _ActionInitializer[key]) return;
12
+ Object.defineProperty(exports, key, {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _ActionInitializer[key];
16
+ }
17
+ });
18
+ });
19
+
20
+ var _BlockInitializer = require("./BlockInitializer");
21
+
22
+ Object.keys(_BlockInitializer).forEach(function (key) {
23
+ if (key === "default" || key === "__esModule") return;
24
+ if (key in exports && exports[key] === _BlockInitializer[key]) return;
25
+ Object.defineProperty(exports, key, {
26
+ enumerable: true,
27
+ get: function get() {
28
+ return _BlockInitializer[key];
29
+ }
30
+ });
31
+ });
32
+
33
+ var _BulkDestroyActionInitializer = require("./BulkDestroyActionInitializer");
34
+
35
+ Object.keys(_BulkDestroyActionInitializer).forEach(function (key) {
36
+ if (key === "default" || key === "__esModule") return;
37
+ if (key in exports && exports[key] === _BulkDestroyActionInitializer[key]) return;
38
+ Object.defineProperty(exports, key, {
39
+ enumerable: true,
40
+ get: function get() {
41
+ return _BulkDestroyActionInitializer[key];
42
+ }
43
+ });
44
+ });
45
+
46
+ var _CalendarBlockInitializer = require("./CalendarBlockInitializer");
11
47
 
12
- var _antd = require("@formily/antd");
48
+ Object.keys(_CalendarBlockInitializer).forEach(function (key) {
49
+ if (key === "default" || key === "__esModule") return;
50
+ if (key in exports && exports[key] === _CalendarBlockInitializer[key]) return;
51
+ Object.defineProperty(exports, key, {
52
+ enumerable: true,
53
+ get: function get() {
54
+ return _CalendarBlockInitializer[key];
55
+ }
56
+ });
57
+ });
13
58
 
14
- var _react = require("@formily/react");
59
+ var _CollectionFieldInitializer = require("./CollectionFieldInitializer");
15
60
 
16
- var _shared = require("@formily/shared");
61
+ Object.keys(_CollectionFieldInitializer).forEach(function (key) {
62
+ if (key === "default" || key === "__esModule") return;
63
+ if (key in exports && exports[key] === _CollectionFieldInitializer[key]) return;
64
+ Object.defineProperty(exports, key, {
65
+ enumerable: true,
66
+ get: function get() {
67
+ return _CollectionFieldInitializer[key];
68
+ }
69
+ });
70
+ });
17
71
 
18
- var _react2 = _interopRequireWildcard(require("react"));
72
+ var _CreateActionInitializer = require("./CreateActionInitializer");
19
73
 
20
- var _reactI18next = require("react-i18next");
74
+ Object.keys(_CreateActionInitializer).forEach(function (key) {
75
+ if (key === "default" || key === "__esModule") return;
76
+ if (key in exports && exports[key] === _CreateActionInitializer[key]) return;
77
+ Object.defineProperty(exports, key, {
78
+ enumerable: true,
79
+ get: function get() {
80
+ return _CreateActionInitializer[key];
81
+ }
82
+ });
83
+ });
21
84
 
22
- var _apiClient = require("../../api-client");
85
+ var _CreateFormBlockInitializer = require("./CreateFormBlockInitializer");
23
86
 
24
- var _blockProvider = require("../../block-provider");
87
+ Object.keys(_CreateFormBlockInitializer).forEach(function (key) {
88
+ if (key === "default" || key === "__esModule") return;
89
+ if (key in exports && exports[key] === _CreateFormBlockInitializer[key]) return;
90
+ Object.defineProperty(exports, key, {
91
+ enumerable: true,
92
+ get: function get() {
93
+ return _CreateFormBlockInitializer[key];
94
+ }
95
+ });
96
+ });
25
97
 
26
- var _collectionManager = require("../../collection-manager");
98
+ var _CreateSubmitActionInitializer = require("./CreateSubmitActionInitializer");
27
99
 
28
- var _schemaComponent = require("../../schema-component");
100
+ Object.keys(_CreateSubmitActionInitializer).forEach(function (key) {
101
+ if (key === "default" || key === "__esModule") return;
102
+ if (key in exports && exports[key] === _CreateSubmitActionInitializer[key]) return;
103
+ Object.defineProperty(exports, key, {
104
+ enumerable: true,
105
+ get: function get() {
106
+ return _CreateSubmitActionInitializer[key];
107
+ }
108
+ });
109
+ });
29
110
 
30
- var _schemaTemplates = require("../../schema-templates");
111
+ var _CustomizeActionInitializer = require("./CustomizeActionInitializer");
31
112
 
32
- var _SchemaInitializer = require("../SchemaInitializer");
113
+ Object.keys(_CustomizeActionInitializer).forEach(function (key) {
114
+ if (key === "default" || key === "__esModule") return;
115
+ if (key in exports && exports[key] === _CustomizeActionInitializer[key]) return;
116
+ Object.defineProperty(exports, key, {
117
+ enumerable: true,
118
+ get: function get() {
119
+ return _CustomizeActionInitializer[key];
120
+ }
121
+ });
122
+ });
33
123
 
34
- var _utils = require("../utils");
124
+ var _DataBlockInitializer = require("./DataBlockInitializer");
35
125
 
36
- var _excluded = ["item", "insert"],
37
- _excluded2 = ["templateWrap", "onCreateBlockSchema", "componentType", "createBlockSchema", "insert"],
38
- _excluded3 = ["onCreateBlockSchema", "componentType", "createBlockSchema", "insert"],
39
- _excluded4 = ["onCreateBlockSchema", "componentType", "createBlockSchema", "insert"],
40
- _excluded5 = ["onCreateBlockSchema", "componentType", "createBlockSchema", "insert"],
41
- _excluded6 = ["item", "onCreateBlockSchema", "componentType", "createBlockSchema", "insert"],
42
- _excluded7 = ["item", "onCreateBlockSchema", "componentType", "createBlockSchema", "insert"],
43
- _excluded8 = ["item", "onCreateBlockSchema", "componentType", "createBlockSchema", "insert"],
44
- _excluded9 = ["item", "onCreateBlockSchema", "componentType", "createBlockSchema", "insert"],
45
- _excluded10 = ["item", "onCreateBlockSchema", "componentType", "createBlockSchema", "insert"],
46
- _excluded11 = ["onCreateBlockSchema", "componentType", "createBlockSchema", "insert"];
126
+ Object.keys(_DataBlockInitializer).forEach(function (key) {
127
+ if (key === "default" || key === "__esModule") return;
128
+ if (key in exports && exports[key] === _DataBlockInitializer[key]) return;
129
+ Object.defineProperty(exports, key, {
130
+ enumerable: true,
131
+ get: function get() {
132
+ return _DataBlockInitializer[key];
133
+ }
134
+ });
135
+ });
47
136
 
48
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
137
+ var _DestroyActionInitializer = require("./DestroyActionInitializer");
49
138
 
50
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
139
+ Object.keys(_DestroyActionInitializer).forEach(function (key) {
140
+ if (key === "default" || key === "__esModule") return;
141
+ if (key in exports && exports[key] === _DestroyActionInitializer[key]) return;
142
+ Object.defineProperty(exports, key, {
143
+ enumerable: true,
144
+ get: function get() {
145
+ return _DestroyActionInitializer[key];
146
+ }
147
+ });
148
+ });
51
149
 
52
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
150
+ var _DetailsBlockInitializer = require("./DetailsBlockInitializer");
53
151
 
54
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
152
+ Object.keys(_DetailsBlockInitializer).forEach(function (key) {
153
+ if (key === "default" || key === "__esModule") return;
154
+ if (key in exports && exports[key] === _DetailsBlockInitializer[key]) return;
155
+ Object.defineProperty(exports, key, {
156
+ enumerable: true,
157
+ get: function get() {
158
+ return _DetailsBlockInitializer[key];
159
+ }
160
+ });
161
+ });
55
162
 
56
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
163
+ var _FilterActionInitializer = require("./FilterActionInitializer");
57
164
 
58
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
165
+ Object.keys(_FilterActionInitializer).forEach(function (key) {
166
+ if (key === "default" || key === "__esModule") return;
167
+ if (key in exports && exports[key] === _FilterActionInitializer[key]) return;
168
+ Object.defineProperty(exports, key, {
169
+ enumerable: true,
170
+ get: function get() {
171
+ return _FilterActionInitializer[key];
172
+ }
173
+ });
174
+ });
59
175
 
60
- 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; }
176
+ var _FormBlockInitializer = require("./FormBlockInitializer");
61
177
 
62
- 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; }
178
+ Object.keys(_FormBlockInitializer).forEach(function (key) {
179
+ if (key === "default" || key === "__esModule") return;
180
+ if (key in exports && exports[key] === _FormBlockInitializer[key]) return;
181
+ Object.defineProperty(exports, key, {
182
+ enumerable: true,
183
+ get: function get() {
184
+ return _FormBlockInitializer[key];
185
+ }
186
+ });
187
+ });
63
188
 
64
- 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; }
189
+ var _G2PlotInitializer = require("./G2PlotInitializer");
65
190
 
66
- // Block
67
- var BlockInitializer = function BlockInitializer(props) {
68
- var item = props.item,
69
- insert = props.insert;
70
- return /*#__PURE__*/_react2.default.createElement(_SchemaInitializer.SchemaInitializer.Item, {
71
- onClick: function onClick() {
72
- insert(_objectSpread({}, item.schema));
191
+ Object.keys(_G2PlotInitializer).forEach(function (key) {
192
+ if (key === "default" || key === "__esModule") return;
193
+ if (key in exports && exports[key] === _G2PlotInitializer[key]) return;
194
+ Object.defineProperty(exports, key, {
195
+ enumerable: true,
196
+ get: function get() {
197
+ return _G2PlotInitializer[key];
73
198
  }
74
199
  });
75
- };
200
+ });
76
201
 
77
- exports.BlockInitializer = BlockInitializer;
202
+ var _InitializerWithSwitch = require("./InitializerWithSwitch");
78
203
 
79
- var G2PlotInitializer = function G2PlotInitializer(props) {
80
- var item = props.item,
81
- insert = props.insert,
82
- others = _objectWithoutProperties(props, _excluded);
204
+ Object.keys(_InitializerWithSwitch).forEach(function (key) {
205
+ if (key === "default" || key === "__esModule") return;
206
+ if (key in exports && exports[key] === _InitializerWithSwitch[key]) return;
207
+ Object.defineProperty(exports, key, {
208
+ enumerable: true,
209
+ get: function get() {
210
+ return _InitializerWithSwitch[key];
211
+ }
212
+ });
213
+ });
83
214
 
84
- return /*#__PURE__*/_react2.default.createElement(_SchemaInitializer.SchemaInitializer.Item, _objectSpread(_objectSpread({}, others), {}, {
85
- onClick: function onClick() {
86
- insert(_objectSpread({}, item.schema));
215
+ var _KanbanBlockInitializer = require("./KanbanBlockInitializer");
216
+
217
+ Object.keys(_KanbanBlockInitializer).forEach(function (key) {
218
+ if (key === "default" || key === "__esModule") return;
219
+ if (key in exports && exports[key] === _KanbanBlockInitializer[key]) return;
220
+ Object.defineProperty(exports, key, {
221
+ enumerable: true,
222
+ get: function get() {
223
+ return _KanbanBlockInitializer[key];
87
224
  }
88
- }));
89
- };
225
+ });
226
+ });
227
+
228
+ var _MarkdownBlockInitializer = require("./MarkdownBlockInitializer");
90
229
 
91
- exports.G2PlotInitializer = G2PlotInitializer;
230
+ Object.keys(_MarkdownBlockInitializer).forEach(function (key) {
231
+ if (key === "default" || key === "__esModule") return;
232
+ if (key in exports && exports[key] === _MarkdownBlockInitializer[key]) return;
233
+ Object.defineProperty(exports, key, {
234
+ enumerable: true,
235
+ get: function get() {
236
+ return _MarkdownBlockInitializer[key];
237
+ }
238
+ });
239
+ });
92
240
 
93
- var CustomizeActionInitializer = function CustomizeActionInitializer(props) {
94
- return /*#__PURE__*/_react2.default.createElement(BlockInitializer, _objectSpread({}, props));
95
- };
241
+ var _PrintActionInitializer = require("./PrintActionInitializer");
96
242
 
97
- exports.CustomizeActionInitializer = CustomizeActionInitializer;
243
+ Object.keys(_PrintActionInitializer).forEach(function (key) {
244
+ if (key === "default" || key === "__esModule") return;
245
+ if (key in exports && exports[key] === _PrintActionInitializer[key]) return;
246
+ Object.defineProperty(exports, key, {
247
+ enumerable: true,
248
+ get: function get() {
249
+ return _PrintActionInitializer[key];
250
+ }
251
+ });
252
+ });
98
253
 
99
- var InitializerWithSwitch = function InitializerWithSwitch(props) {
100
- var _item$schema;
254
+ var _RecordAssociationBlockInitializer = require("./RecordAssociationBlockInitializer");
101
255
 
102
- var type = props.type,
103
- schema = props.schema,
104
- item = props.item,
105
- insert = props.insert;
256
+ Object.keys(_RecordAssociationBlockInitializer).forEach(function (key) {
257
+ if (key === "default" || key === "__esModule") return;
258
+ if (key in exports && exports[key] === _RecordAssociationBlockInitializer[key]) return;
259
+ Object.defineProperty(exports, key, {
260
+ enumerable: true,
261
+ get: function get() {
262
+ return _RecordAssociationBlockInitializer[key];
263
+ }
264
+ });
265
+ });
106
266
 
107
- var _useCurrentSchema = (0, _utils.useCurrentSchema)((schema === null || schema === void 0 ? void 0 : schema[type]) || (item === null || item === void 0 ? void 0 : (_item$schema = item.schema) === null || _item$schema === void 0 ? void 0 : _item$schema[type]), type, item.find, item.remove),
108
- exists = _useCurrentSchema.exists,
109
- remove = _useCurrentSchema.remove;
267
+ var _RecordAssociationCalendarBlockInitializer = require("./RecordAssociationCalendarBlockInitializer");
110
268
 
111
- return /*#__PURE__*/_react2.default.createElement(_SchemaInitializer.SchemaInitializer.SwitchItem, {
112
- checked: exists,
113
- title: item.title,
114
- onClick: function onClick() {
115
- var _item$schemaInitializ;
269
+ Object.keys(_RecordAssociationCalendarBlockInitializer).forEach(function (key) {
270
+ if (key === "default" || key === "__esModule") return;
271
+ if (key in exports && exports[key] === _RecordAssociationCalendarBlockInitializer[key]) return;
272
+ Object.defineProperty(exports, key, {
273
+ enumerable: true,
274
+ get: function get() {
275
+ return _RecordAssociationCalendarBlockInitializer[key];
276
+ }
277
+ });
278
+ });
116
279
 
117
- if (exists) {
118
- return remove();
119
- }
280
+ var _RecordAssociationDetailsBlockInitializer = require("./RecordAssociationDetailsBlockInitializer");
120
281
 
121
- var s = (0, _shared.merge)(schema || {}, item.schema || {});
122
- item === null || item === void 0 ? void 0 : (_item$schemaInitializ = item.schemaInitialize) === null || _item$schemaInitializ === void 0 ? void 0 : _item$schemaInitializ.call(item, s);
123
- insert(s);
282
+ Object.keys(_RecordAssociationDetailsBlockInitializer).forEach(function (key) {
283
+ if (key === "default" || key === "__esModule") return;
284
+ if (key in exports && exports[key] === _RecordAssociationDetailsBlockInitializer[key]) return;
285
+ Object.defineProperty(exports, key, {
286
+ enumerable: true,
287
+ get: function get() {
288
+ return _RecordAssociationDetailsBlockInitializer[key];
124
289
  }
125
290
  });
126
- };
127
-
128
- exports.InitializerWithSwitch = InitializerWithSwitch;
129
-
130
- var ActionInitializer = function ActionInitializer(props) {
131
- return /*#__PURE__*/_react2.default.createElement(InitializerWithSwitch, _objectSpread(_objectSpread({}, props), {}, {
132
- type: 'x-action'
133
- }));
134
- };
135
-
136
- exports.ActionInitializer = ActionInitializer;
137
-
138
- var DataBlockInitializer = function DataBlockInitializer(props) {
139
- var templateWrap = props.templateWrap,
140
- onCreateBlockSchema = props.onCreateBlockSchema,
141
- componentType = props.componentType,
142
- createBlockSchema = props.createBlockSchema,
143
- insert = props.insert,
144
- others = _objectWithoutProperties(props, _excluded2);
145
-
146
- var _useSchemaTemplateMan = (0, _schemaTemplates.useSchemaTemplateManager)(),
147
- getTemplateSchemaByMode = _useSchemaTemplateMan.getTemplateSchemaByMode;
148
-
149
- return /*#__PURE__*/_react2.default.createElement(_SchemaInitializer.SchemaInitializer.Item, _objectSpread(_objectSpread({
150
- icon: /*#__PURE__*/_react2.default.createElement(_icons.TableOutlined, null)
151
- }, others), {}, {
152
- onClick: function () {
153
- var _onClick = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(_ref) {
154
- var item, s;
155
- return regeneratorRuntime.wrap(function _callee$(_context) {
156
- while (1) {
157
- switch (_context.prev = _context.next) {
158
- case 0:
159
- item = _ref.item;
160
-
161
- if (!item.template) {
162
- _context.next = 8;
163
- break;
164
- }
165
-
166
- _context.next = 4;
167
- return getTemplateSchemaByMode(item);
168
-
169
- case 4:
170
- s = _context.sent;
171
- templateWrap ? insert(templateWrap(s, {
172
- item: item
173
- })) : insert(s);
174
- _context.next = 9;
175
- break;
176
-
177
- case 8:
178
- if (onCreateBlockSchema) {
179
- onCreateBlockSchema({
180
- item: item
181
- });
182
- } else if (createBlockSchema) {
183
- insert(createBlockSchema({
184
- collection: item.name
185
- }));
186
- }
187
-
188
- case 9:
189
- case "end":
190
- return _context.stop();
191
- }
192
- }
193
- }, _callee);
194
- }));
195
-
196
- function onClick(_x) {
197
- return _onClick.apply(this, arguments);
198
- }
199
-
200
- return onClick;
201
- }(),
202
- items: (0, _utils.useCollectionDataSourceItems)(componentType)
203
- }));
204
- };
205
-
206
- exports.DataBlockInitializer = DataBlockInitializer;
207
-
208
- var TableBlockInitializer = function TableBlockInitializer(props) {
209
- var insert = props.insert;
210
-
211
- var _useCollectionManager = (0, _collectionManager.useCollectionManager)(),
212
- getCollection = _useCollectionManager.getCollection;
213
-
214
- return /*#__PURE__*/_react2.default.createElement(DataBlockInitializer, _objectSpread(_objectSpread({}, props), {}, {
215
- icon: /*#__PURE__*/_react2.default.createElement(_icons.TableOutlined, null),
216
- componentType: 'Table',
217
- onCreateBlockSchema: function () {
218
- var _onCreateBlockSchema = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(_ref2) {
219
- var item, collection, schema;
220
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
221
- while (1) {
222
- switch (_context2.prev = _context2.next) {
223
- case 0:
224
- item = _ref2.item;
225
- collection = getCollection(item.name);
226
- schema = (0, _utils.createTableBlockSchema)({
227
- collection: item.name,
228
- rowKey: collection.filterTargetKey || 'id'
229
- });
230
- insert(schema);
231
-
232
- case 4:
233
- case "end":
234
- return _context2.stop();
235
- }
236
- }
237
- }, _callee2);
238
- }));
239
-
240
- function onCreateBlockSchema(_x2) {
241
- return _onCreateBlockSchema.apply(this, arguments);
242
- }
243
-
244
- return onCreateBlockSchema;
245
- }()
246
- }));
247
- };
248
-
249
- exports.TableBlockInitializer = TableBlockInitializer;
250
-
251
- var FormBlockInitializer = function FormBlockInitializer(props) {
252
- return /*#__PURE__*/_react2.default.createElement(DataBlockInitializer, _objectSpread(_objectSpread({}, props), {}, {
253
- icon: /*#__PURE__*/_react2.default.createElement(_icons.FormOutlined, null),
254
- componentType: 'FormItem',
255
- templateWrap: function templateWrap(templateSchema, _ref3) {
256
- var item = _ref3.item;
257
- var s = (0, _utils.createFormBlockSchema)({
258
- template: templateSchema,
259
- collection: item.name
260
- });
261
-
262
- if (item.template && item.mode === 'reference') {
263
- s['x-template-key'] = item.template.key;
264
- }
265
-
266
- return s;
267
- },
268
- createBlockSchema: _utils.createFormBlockSchema
269
- }));
270
- };
271
-
272
- exports.FormBlockInitializer = FormBlockInitializer;
273
-
274
- var DetailsBlockInitializer = function DetailsBlockInitializer(props) {
275
- var insert = props.insert;
276
-
277
- var _useCollectionManager2 = (0, _collectionManager.useCollectionManager)(),
278
- getCollection = _useCollectionManager2.getCollection;
279
-
280
- return /*#__PURE__*/_react2.default.createElement(DataBlockInitializer, _objectSpread(_objectSpread({}, props), {}, {
281
- icon: /*#__PURE__*/_react2.default.createElement(_icons.TableOutlined, null),
282
- componentType: 'Details',
283
- onCreateBlockSchema: function () {
284
- var _onCreateBlockSchema2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(_ref4) {
285
- var item, collection, schema;
286
- return regeneratorRuntime.wrap(function _callee3$(_context3) {
287
- while (1) {
288
- switch (_context3.prev = _context3.next) {
289
- case 0:
290
- item = _ref4.item;
291
- collection = getCollection(item.name);
292
- schema = (0, _utils.createDetailsBlockSchema)({
293
- collection: item.name,
294
- rowKey: collection.filterTargetKey || 'id'
295
- });
296
- insert(schema);
297
-
298
- case 4:
299
- case "end":
300
- return _context3.stop();
301
- }
302
- }
303
- }, _callee3);
304
- }));
305
-
306
- function onCreateBlockSchema(_x3) {
307
- return _onCreateBlockSchema2.apply(this, arguments);
308
- }
309
-
310
- return onCreateBlockSchema;
311
- }()
312
- }));
313
- };
314
-
315
- exports.DetailsBlockInitializer = DetailsBlockInitializer;
316
-
317
- var CalendarBlockInitializer = function CalendarBlockInitializer(props) {
318
- var insert = props.insert;
319
-
320
- var _useTranslation = (0, _reactI18next.useTranslation)(),
321
- t = _useTranslation.t;
322
-
323
- var _useCollectionManager3 = (0, _collectionManager.useCollectionManager)(),
324
- getCollection = _useCollectionManager3.getCollection;
325
-
326
- var options = (0, _react2.useContext)(_react.SchemaOptionsContext);
327
- return /*#__PURE__*/_react2.default.createElement(DataBlockInitializer, _objectSpread(_objectSpread({}, props), {}, {
328
- componentType: 'Calendar',
329
- icon: /*#__PURE__*/_react2.default.createElement(_icons.FormOutlined, null),
330
- onCreateBlockSchema: function () {
331
- var _onCreateBlockSchema3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(_ref5) {
332
- var _collection$fields, _collection$fields$fi, _collection$fields2, _collection$fields2$f;
333
-
334
- var item, collection, stringFields, dateFields, values;
335
- return regeneratorRuntime.wrap(function _callee4$(_context4) {
336
- while (1) {
337
- switch (_context4.prev = _context4.next) {
338
- case 0:
339
- item = _ref5.item;
340
- collection = getCollection(item.name);
341
- stringFields = collection === null || collection === void 0 ? void 0 : (_collection$fields = collection.fields) === null || _collection$fields === void 0 ? void 0 : (_collection$fields$fi = _collection$fields.filter(function (field) {
342
- return field.type === 'string';
343
- })) === null || _collection$fields$fi === void 0 ? void 0 : _collection$fields$fi.map(function (field) {
344
- var _field$uiSchema;
345
-
346
- return {
347
- label: field === null || field === void 0 ? void 0 : (_field$uiSchema = field.uiSchema) === null || _field$uiSchema === void 0 ? void 0 : _field$uiSchema.title,
348
- value: field.name
349
- };
350
- });
351
- dateFields = collection === null || collection === void 0 ? void 0 : (_collection$fields2 = collection.fields) === null || _collection$fields2 === void 0 ? void 0 : (_collection$fields2$f = _collection$fields2.filter(function (field) {
352
- return field.type === 'date';
353
- })) === null || _collection$fields2$f === void 0 ? void 0 : _collection$fields2$f.map(function (field) {
354
- var _field$uiSchema2;
355
-
356
- return {
357
- label: field === null || field === void 0 ? void 0 : (_field$uiSchema2 = field.uiSchema) === null || _field$uiSchema2 === void 0 ? void 0 : _field$uiSchema2.title,
358
- value: field.name
359
- };
360
- });
361
- _context4.next = 6;
362
- return (0, _antd.FormDialog)(t('Create calendar block'), function () {
363
- return /*#__PURE__*/_react2.default.createElement(_schemaComponent.SchemaComponentOptions, {
364
- scope: options.scope,
365
- components: _objectSpread({}, options.components)
366
- }, /*#__PURE__*/_react2.default.createElement(_antd.FormLayout, {
367
- layout: 'vertical'
368
- }, /*#__PURE__*/_react2.default.createElement(_schemaComponent.SchemaComponent, {
369
- schema: {
370
- properties: {
371
- title: {
372
- title: t('Title field'),
373
- enum: stringFields,
374
- required: true,
375
- 'x-component': 'Select',
376
- 'x-decorator': 'FormItem'
377
- },
378
- start: {
379
- title: t('Start date field'),
380
- enum: dateFields,
381
- required: true,
382
- default: 'createdAt',
383
- 'x-component': 'Select',
384
- 'x-decorator': 'FormItem'
385
- },
386
- end: {
387
- title: t('End date field'),
388
- enum: dateFields,
389
- 'x-component': 'Select',
390
- 'x-decorator': 'FormItem'
391
- }
392
- }
393
- }
394
- })));
395
- }).open({
396
- initialValues: {}
397
- });
398
-
399
- case 6:
400
- values = _context4.sent;
401
- insert((0, _utils.createCalendarBlockSchema)({
402
- collection: item.name,
403
- fieldNames: _objectSpread({}, values)
404
- }));
405
-
406
- case 8:
407
- case "end":
408
- return _context4.stop();
409
- }
410
- }
411
- }, _callee4);
412
- }));
413
-
414
- function onCreateBlockSchema(_x4) {
415
- return _onCreateBlockSchema3.apply(this, arguments);
416
- }
417
-
418
- return onCreateBlockSchema;
419
- }()
420
- }));
421
- };
422
-
423
- exports.CalendarBlockInitializer = CalendarBlockInitializer;
424
-
425
- var KanbanBlockInitializer = function KanbanBlockInitializer(props) {
426
- var insert = props.insert;
427
-
428
- var _useTranslation2 = (0, _reactI18next.useTranslation)(),
429
- t = _useTranslation2.t;
430
-
431
- var _useCollectionManager4 = (0, _collectionManager.useCollectionManager)(),
432
- getCollection = _useCollectionManager4.getCollection;
433
-
434
- var options = (0, _react2.useContext)(_react.SchemaOptionsContext);
435
- var api = (0, _apiClient.useAPIClient)();
436
- return /*#__PURE__*/_react2.default.createElement(DataBlockInitializer, _objectSpread(_objectSpread({}, props), {}, {
437
- componentType: 'Kanban',
438
- icon: /*#__PURE__*/_react2.default.createElement(_icons.FormOutlined, null),
439
- onCreateBlockSchema: function () {
440
- var _onCreateBlockSchema4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(_ref6) {
441
- var _collection$fields3, _collection$fields3$f, _collection$fields4;
442
-
443
- var item, collection, fields, values, sortName, exists;
444
- return regeneratorRuntime.wrap(function _callee5$(_context5) {
445
- while (1) {
446
- switch (_context5.prev = _context5.next) {
447
- case 0:
448
- item = _ref6.item;
449
- collection = getCollection(item.name);
450
- fields = collection === null || collection === void 0 ? void 0 : (_collection$fields3 = collection.fields) === null || _collection$fields3 === void 0 ? void 0 : (_collection$fields3$f = _collection$fields3.filter(function (field) {
451
- return ['select', 'radioGroup'].includes(field.interface);
452
- })) === null || _collection$fields3$f === void 0 ? void 0 : _collection$fields3$f.map(function (field) {
453
- var _field$uiSchema3;
454
-
455
- return {
456
- label: field === null || field === void 0 ? void 0 : (_field$uiSchema3 = field.uiSchema) === null || _field$uiSchema3 === void 0 ? void 0 : _field$uiSchema3.title,
457
- value: field.name,
458
- uiSchema: _objectSpread(_objectSpread({}, field.uiSchema), {}, {
459
- name: field.name
460
- })
461
- };
462
- });
463
- _context5.next = 5;
464
- return (0, _antd.FormDialog)(t('Create kanban block'), function () {
465
- return /*#__PURE__*/_react2.default.createElement(_schemaComponent.SchemaComponentOptions, {
466
- scope: options.scope,
467
- components: _objectSpread({}, options.components)
468
- }, /*#__PURE__*/_react2.default.createElement(_antd.FormLayout, {
469
- layout: 'vertical'
470
- }, /*#__PURE__*/_react2.default.createElement(_schemaComponent.SchemaComponent, {
471
- schema: {
472
- properties: {
473
- groupField: {
474
- title: t('Grouping field'),
475
- enum: fields,
476
- required: true,
477
- description: '{{t("Single select and radio fields can be used as the grouping field")}}',
478
- 'x-component': 'Select',
479
- 'x-component-props': {
480
- objectValue: true,
481
- fieldNames: {
482
- label: 'label',
483
- value: 'value'
484
- }
485
- },
486
- 'x-decorator': 'FormItem'
487
- }
488
- }
489
- }
490
- })));
491
- }).open({
492
- initialValues: {}
493
- });
494
-
495
- case 5:
496
- values = _context5.sent;
497
- sortName = "".concat(values.groupField.value, "_sort");
498
- exists = collection === null || collection === void 0 ? void 0 : (_collection$fields4 = collection.fields) === null || _collection$fields4 === void 0 ? void 0 : _collection$fields4.find(function (field) {
499
- return field.name === sortName;
500
- });
501
-
502
- if (exists) {
503
- _context5.next = 11;
504
- break;
505
- }
506
-
507
- _context5.next = 11;
508
- return api.resource('collections.fields', item.name).create({
509
- values: {
510
- type: 'sort',
511
- name: sortName,
512
- hidden: true,
513
- scopeKey: values.groupField.value
514
- }
515
- });
516
-
517
- case 11:
518
- insert((0, _utils.createKanbanBlockSchema)({
519
- groupField: values.groupField.value,
520
- collection: item.name,
521
- params: {
522
- sort: [sortName],
523
- paginate: false
524
- }
525
- }));
526
-
527
- case 12:
528
- case "end":
529
- return _context5.stop();
530
- }
531
- }
532
- }, _callee5);
533
- }));
534
-
535
- function onCreateBlockSchema(_x5) {
536
- return _onCreateBlockSchema4.apply(this, arguments);
537
- }
538
-
539
- return onCreateBlockSchema;
540
- }()
541
- }));
542
- };
543
-
544
- exports.KanbanBlockInitializer = KanbanBlockInitializer;
545
-
546
- var MarkdownBlockInitializer = function MarkdownBlockInitializer(props) {
547
- var insert = props.insert;
548
-
549
- var _useTranslation3 = (0, _reactI18next.useTranslation)(),
550
- t = _useTranslation3.t;
551
-
552
- return /*#__PURE__*/_react2.default.createElement(_SchemaInitializer.SchemaInitializer.Item, _objectSpread(_objectSpread({}, props), {}, {
553
- icon: /*#__PURE__*/_react2.default.createElement(_icons.FormOutlined, null),
554
- onClick: function onClick() {
555
- insert({
556
- type: 'void',
557
- 'x-designer': 'Markdown.Void.Designer',
558
- 'x-decorator': 'CardItem',
559
- 'x-component': 'Markdown.Void',
560
- 'x-editable': false,
561
- 'x-component-props': {
562
- content: t('This is a demo text, **supports Markdown syntax**.')
563
- }
564
- });
291
+ });
292
+
293
+ var _RecordAssociationFormBlockInitializer = require("./RecordAssociationFormBlockInitializer");
294
+
295
+ Object.keys(_RecordAssociationFormBlockInitializer).forEach(function (key) {
296
+ if (key === "default" || key === "__esModule") return;
297
+ if (key in exports && exports[key] === _RecordAssociationFormBlockInitializer[key]) return;
298
+ Object.defineProperty(exports, key, {
299
+ enumerable: true,
300
+ get: function get() {
301
+ return _RecordAssociationFormBlockInitializer[key];
565
302
  }
566
- }));
567
- };
568
-
569
- exports.MarkdownBlockInitializer = MarkdownBlockInitializer;
570
-
571
- var FilterActionInitializer = function FilterActionInitializer(props) {
572
- var schema = {
573
- type: 'void',
574
- title: '{{ t("Filter") }}',
575
- 'x-action': 'filter',
576
- 'x-designer': 'Filter.Action.Designer',
577
- 'x-component': 'Filter.Action',
578
- 'x-component-props': {
579
- icon: 'FilterOutlined',
580
- useProps: '{{ useFilterActionProps }}'
303
+ });
304
+ });
305
+
306
+ var _RecordFormBlockInitializer = require("./RecordFormBlockInitializer");
307
+
308
+ Object.keys(_RecordFormBlockInitializer).forEach(function (key) {
309
+ if (key === "default" || key === "__esModule") return;
310
+ if (key in exports && exports[key] === _RecordFormBlockInitializer[key]) return;
311
+ Object.defineProperty(exports, key, {
312
+ enumerable: true,
313
+ get: function get() {
314
+ return _RecordFormBlockInitializer[key];
581
315
  }
582
- };
583
- return /*#__PURE__*/_react2.default.createElement(ActionInitializer, _objectSpread(_objectSpread({}, props), {}, {
584
- schema: schema
585
- }));
586
- };
587
-
588
- exports.FilterActionInitializer = FilterActionInitializer;
589
-
590
- var CreateActionInitializer = function CreateActionInitializer(props) {
591
- var schema = {
592
- type: 'void',
593
- title: '{{ t("Add new") }}',
594
- 'x-action': 'create',
595
- 'x-designer': 'Action.Designer',
596
- 'x-component': 'Action',
597
- 'x-component-props': {
598
- icon: 'PlusOutlined',
599
- openMode: 'drawer',
600
- type: 'primary'
601
- },
602
- properties: {
603
- drawer: {
604
- type: 'void',
605
- title: '{{ t("Add record") }}',
606
- 'x-component': 'Action.Container',
607
- 'x-component-props': {
608
- className: 'nb-action-popup'
609
- },
610
- properties: {
611
- tabs: {
612
- type: 'void',
613
- 'x-component': 'Tabs',
614
- 'x-component-props': {},
615
- 'x-initializer': 'TabPaneInitializers',
616
- properties: {
617
- tab1: {
618
- type: 'void',
619
- title: '{{t("Add new")}}',
620
- 'x-component': 'Tabs.TabPane',
621
- 'x-designer': 'Tabs.Designer',
622
- 'x-component-props': {},
623
- properties: {
624
- grid: {
625
- type: 'void',
626
- 'x-component': 'Grid',
627
- 'x-initializer': 'CreateFormBlockInitializers',
628
- properties: {}
629
- }
630
- }
631
- }
632
- }
633
- }
634
- }
635
- }
316
+ });
317
+ });
318
+
319
+ var _RecordReadPrettyAssociationFormBlockInitializer = require("./RecordReadPrettyAssociationFormBlockInitializer");
320
+
321
+ Object.keys(_RecordReadPrettyAssociationFormBlockInitializer).forEach(function (key) {
322
+ if (key === "default" || key === "__esModule") return;
323
+ if (key in exports && exports[key] === _RecordReadPrettyAssociationFormBlockInitializer[key]) return;
324
+ Object.defineProperty(exports, key, {
325
+ enumerable: true,
326
+ get: function get() {
327
+ return _RecordReadPrettyAssociationFormBlockInitializer[key];
636
328
  }
637
- };
638
- return /*#__PURE__*/_react2.default.createElement(ActionInitializer, _objectSpread(_objectSpread({}, props), {}, {
639
- schema: schema
640
- }));
641
- };
642
-
643
- exports.CreateActionInitializer = CreateActionInitializer;
644
-
645
- var ViewActionInitializer = function ViewActionInitializer(props) {
646
- var schema = {
647
- type: 'void',
648
- title: '{{ t("View") }}',
649
- 'x-action': 'view',
650
- 'x-designer': 'Action.Designer',
651
- 'x-component': 'Action',
652
- 'x-component-props': {
653
- openMode: 'drawer'
654
- },
655
- properties: {
656
- drawer: {
657
- type: 'void',
658
- title: '{{ t("View record") }}',
659
- 'x-component': 'Action.Container',
660
- 'x-component-props': {
661
- className: 'nb-action-popup'
662
- },
663
- properties: {
664
- tabs: {
665
- type: 'void',
666
- 'x-component': 'Tabs',
667
- 'x-component-props': {},
668
- 'x-initializer': 'TabPaneInitializers',
669
- properties: {
670
- tab1: {
671
- type: 'void',
672
- title: '{{t("Details")}}',
673
- 'x-component': 'Tabs.TabPane',
674
- 'x-designer': 'Tabs.Designer',
675
- 'x-component-props': {},
676
- properties: {
677
- grid: {
678
- type: 'void',
679
- 'x-component': 'Grid',
680
- 'x-initializer': 'RecordBlockInitializers',
681
- properties: {}
682
- }
683
- }
684
- }
685
- }
686
- }
687
- }
688
- }
329
+ });
330
+ });
331
+
332
+ var _RecordReadPrettyFormBlockInitializer = require("./RecordReadPrettyFormBlockInitializer");
333
+
334
+ Object.keys(_RecordReadPrettyFormBlockInitializer).forEach(function (key) {
335
+ if (key === "default" || key === "__esModule") return;
336
+ if (key in exports && exports[key] === _RecordReadPrettyFormBlockInitializer[key]) return;
337
+ Object.defineProperty(exports, key, {
338
+ enumerable: true,
339
+ get: function get() {
340
+ return _RecordReadPrettyFormBlockInitializer[key];
689
341
  }
690
- };
691
- return /*#__PURE__*/_react2.default.createElement(ActionInitializer, _objectSpread(_objectSpread({}, props), {}, {
692
- schema: schema
693
- }));
694
- };
695
-
696
- exports.ViewActionInitializer = ViewActionInitializer;
697
-
698
- var UpdateActionInitializer = function UpdateActionInitializer(props) {
699
- var schema = {
700
- type: 'void',
701
- title: '{{ t("Edit") }}',
702
- 'x-action': 'update',
703
- 'x-designer': 'Action.Designer',
704
- 'x-component': 'Action',
705
- 'x-component-props': {
706
- openMode: 'drawer',
707
- icon: 'EditOutlined'
708
- },
709
- properties: {
710
- drawer: {
711
- type: 'void',
712
- title: '{{ t("Edit record") }}',
713
- 'x-component': 'Action.Container',
714
- 'x-component-props': {
715
- className: 'nb-action-popup'
716
- },
717
- properties: {
718
- tabs: {
719
- type: 'void',
720
- 'x-component': 'Tabs',
721
- 'x-component-props': {},
722
- 'x-initializer': 'TabPaneInitializers',
723
- properties: {
724
- tab1: {
725
- type: 'void',
726
- title: '{{t("Edit")}}',
727
- 'x-component': 'Tabs.TabPane',
728
- 'x-designer': 'Tabs.Designer',
729
- 'x-component-props': {},
730
- properties: {
731
- grid: {
732
- type: 'void',
733
- 'x-component': 'Grid',
734
- 'x-initializer': 'RecordBlockInitializers',
735
- properties: {}
736
- }
737
- }
738
- }
739
- }
740
- }
741
- }
742
- }
342
+ });
343
+ });
344
+
345
+ var _RefreshActionInitializer = require("./RefreshActionInitializer");
346
+
347
+ Object.keys(_RefreshActionInitializer).forEach(function (key) {
348
+ if (key === "default" || key === "__esModule") return;
349
+ if (key in exports && exports[key] === _RefreshActionInitializer[key]) return;
350
+ Object.defineProperty(exports, key, {
351
+ enumerable: true,
352
+ get: function get() {
353
+ return _RefreshActionInitializer[key];
743
354
  }
744
- };
745
- return /*#__PURE__*/_react2.default.createElement(ActionInitializer, _objectSpread(_objectSpread({}, props), {}, {
746
- schema: schema
747
- }));
748
- };
749
-
750
- exports.UpdateActionInitializer = UpdateActionInitializer;
751
-
752
- var DestroyActionInitializer = function DestroyActionInitializer(props) {
753
- var schema = {
754
- title: '{{ t("Delete") }}',
755
- 'x-action': 'destroy',
756
- 'x-component': 'Action',
757
- 'x-designer': 'Action.Designer',
758
- 'x-component-props': {
759
- icon: 'DeleteOutlined',
760
- confirm: {
761
- title: "{{t('Delete record')}}",
762
- content: "{{t('Are you sure you want to delete it?')}}"
763
- },
764
- useProps: '{{ useDestroyActionProps }}'
355
+ });
356
+ });
357
+
358
+ var _SubmitActionInitializer = require("./SubmitActionInitializer");
359
+
360
+ Object.keys(_SubmitActionInitializer).forEach(function (key) {
361
+ if (key === "default" || key === "__esModule") return;
362
+ if (key in exports && exports[key] === _SubmitActionInitializer[key]) return;
363
+ Object.defineProperty(exports, key, {
364
+ enumerable: true,
365
+ get: function get() {
366
+ return _SubmitActionInitializer[key];
765
367
  }
766
- };
767
- return /*#__PURE__*/_react2.default.createElement(ActionInitializer, _objectSpread(_objectSpread({}, props), {}, {
768
- schema: schema
769
- }));
770
- };
771
-
772
- exports.DestroyActionInitializer = DestroyActionInitializer;
773
-
774
- var PrintActionInitializer = function PrintActionInitializer(props) {
775
- var schema = {
776
- title: '{{ t("Print") }}',
777
- 'x-action': 'print',
778
- 'x-component': 'Action',
779
- 'x-designer': 'Action.Designer',
780
- 'x-component-props': {
781
- icon: 'PrinterOutlined',
782
- useProps: '{{ useDetailPrintActionProps }}'
368
+ });
369
+ });
370
+
371
+ var _TableActionColumnInitializer = require("./TableActionColumnInitializer");
372
+
373
+ Object.keys(_TableActionColumnInitializer).forEach(function (key) {
374
+ if (key === "default" || key === "__esModule") return;
375
+ if (key in exports && exports[key] === _TableActionColumnInitializer[key]) return;
376
+ Object.defineProperty(exports, key, {
377
+ enumerable: true,
378
+ get: function get() {
379
+ return _TableActionColumnInitializer[key];
783
380
  }
784
- };
785
- return /*#__PURE__*/_react2.default.createElement(ActionInitializer, _objectSpread(_objectSpread({}, props), {}, {
786
- schema: schema
787
- }));
788
- };
789
-
790
- exports.PrintActionInitializer = PrintActionInitializer;
791
-
792
- var BulkDestroyActionInitializer = function BulkDestroyActionInitializer(props) {
793
- var schema = {
794
- title: '{{ t("Delete") }}',
795
- 'x-action': 'destroy',
796
- 'x-component': 'Action',
797
- 'x-designer': 'Action.Designer',
798
- 'x-component-props': {
799
- icon: 'DeleteOutlined',
800
- confirm: {
801
- title: "{{t('Delete record')}}",
802
- content: "{{t('Are you sure you want to delete it?')}}"
803
- },
804
- useProps: '{{ useBulkDestroyActionProps }}'
381
+ });
382
+ });
383
+
384
+ var _TableBlockInitializer = require("./TableBlockInitializer");
385
+
386
+ Object.keys(_TableBlockInitializer).forEach(function (key) {
387
+ if (key === "default" || key === "__esModule") return;
388
+ if (key in exports && exports[key] === _TableBlockInitializer[key]) return;
389
+ Object.defineProperty(exports, key, {
390
+ enumerable: true,
391
+ get: function get() {
392
+ return _TableBlockInitializer[key];
805
393
  }
806
- };
807
- return /*#__PURE__*/_react2.default.createElement(ActionInitializer, _objectSpread(_objectSpread({}, props), {}, {
808
- schema: schema
809
- }));
810
- };
811
-
812
- exports.BulkDestroyActionInitializer = BulkDestroyActionInitializer;
813
-
814
- var RefreshActionInitializer = function RefreshActionInitializer(props) {
815
- var schema = {
816
- title: '{{ t("Refresh") }}',
817
- 'x-action': 'refresh',
818
- 'x-component': 'Action',
819
- 'x-designer': 'Action.Designer',
820
- 'x-component-props': {
821
- icon: 'ReloadOutlined',
822
- useProps: '{{ useRefreshActionProps }}'
394
+ });
395
+ });
396
+
397
+ var _TableCollectionFieldInitializer = require("./TableCollectionFieldInitializer");
398
+
399
+ Object.keys(_TableCollectionFieldInitializer).forEach(function (key) {
400
+ if (key === "default" || key === "__esModule") return;
401
+ if (key in exports && exports[key] === _TableCollectionFieldInitializer[key]) return;
402
+ Object.defineProperty(exports, key, {
403
+ enumerable: true,
404
+ get: function get() {
405
+ return _TableCollectionFieldInitializer[key];
823
406
  }
824
- };
825
- return /*#__PURE__*/_react2.default.createElement(ActionInitializer, _objectSpread(_objectSpread({}, props), {}, {
826
- schema: schema
827
- }));
828
- };
829
-
830
- exports.RefreshActionInitializer = RefreshActionInitializer;
831
-
832
- var SubmitActionInitializer = function SubmitActionInitializer(props) {
833
- var schema = {
834
- title: '{{ t("Submit") }}',
835
- 'x-action': 'submit',
836
- 'x-component': 'Action',
837
- 'x-designer': 'Action.Designer',
838
- 'x-component-props': {
839
- type: 'primary',
840
- htmlType: 'submit' // useProps: '{{ bp.useSubmitActionProps }}',
407
+ });
408
+ });
409
+
410
+ var _TableSelectorInitializer = require("./TableSelectorInitializer");
841
411
 
412
+ Object.keys(_TableSelectorInitializer).forEach(function (key) {
413
+ if (key === "default" || key === "__esModule") return;
414
+ if (key in exports && exports[key] === _TableSelectorInitializer[key]) return;
415
+ Object.defineProperty(exports, key, {
416
+ enumerable: true,
417
+ get: function get() {
418
+ return _TableSelectorInitializer[key];
842
419
  }
843
- };
844
- return /*#__PURE__*/_react2.default.createElement(ActionInitializer, _objectSpread(_objectSpread({}, props), {}, {
845
- schema: schema
846
- }));
847
- };
848
-
849
- exports.SubmitActionInitializer = SubmitActionInitializer;
850
-
851
- var CreateSubmitActionInitializer = function CreateSubmitActionInitializer(props) {
852
- var schema = {
853
- title: '{{ t("Submit") }}',
854
- 'x-action': 'submit',
855
- 'x-component': 'Action',
856
- 'x-designer': 'Action.Designer',
857
- 'x-component-props': {
858
- type: 'primary',
859
- htmlType: 'submit',
860
- useProps: '{{ useCreateActionProps }}'
420
+ });
421
+ });
422
+
423
+ var _UpdateActionInitializer = require("./UpdateActionInitializer");
424
+
425
+ Object.keys(_UpdateActionInitializer).forEach(function (key) {
426
+ if (key === "default" || key === "__esModule") return;
427
+ if (key in exports && exports[key] === _UpdateActionInitializer[key]) return;
428
+ Object.defineProperty(exports, key, {
429
+ enumerable: true,
430
+ get: function get() {
431
+ return _UpdateActionInitializer[key];
861
432
  }
862
- };
863
- return /*#__PURE__*/_react2.default.createElement(ActionInitializer, _objectSpread(_objectSpread({}, props), {}, {
864
- schema: schema
865
- }));
866
- };
867
-
868
- exports.CreateSubmitActionInitializer = CreateSubmitActionInitializer;
869
-
870
- var UpdateSubmitActionInitializer = function UpdateSubmitActionInitializer(props) {
871
- var schema = {
872
- title: '{{ t("Submit") }}',
873
- 'x-action': 'submit',
874
- 'x-component': 'Action',
875
- 'x-designer': 'Action.Designer',
876
- 'x-component-props': {
877
- type: 'primary',
878
- htmlType: 'submit',
879
- useProps: '{{ useUpdateActionProps }}'
433
+ });
434
+ });
435
+
436
+ var _UpdateSubmitActionInitializer = require("./UpdateSubmitActionInitializer");
437
+
438
+ Object.keys(_UpdateSubmitActionInitializer).forEach(function (key) {
439
+ if (key === "default" || key === "__esModule") return;
440
+ if (key in exports && exports[key] === _UpdateSubmitActionInitializer[key]) return;
441
+ Object.defineProperty(exports, key, {
442
+ enumerable: true,
443
+ get: function get() {
444
+ return _UpdateSubmitActionInitializer[key];
880
445
  }
881
- };
882
- return /*#__PURE__*/_react2.default.createElement(ActionInitializer, _objectSpread(_objectSpread({}, props), {}, {
883
- schema: schema
884
- }));
885
- };
886
-
887
- exports.UpdateSubmitActionInitializer = UpdateSubmitActionInitializer;
888
-
889
- var CreateFormBlockInitializer = function CreateFormBlockInitializer(props) {
890
- var onCreateBlockSchema = props.onCreateBlockSchema,
891
- componentType = props.componentType,
892
- createBlockSchema = props.createBlockSchema,
893
- insert = props.insert,
894
- others = _objectWithoutProperties(props, _excluded3);
895
-
896
- var _useSchemaTemplateMan2 = (0, _schemaTemplates.useSchemaTemplateManager)(),
897
- getTemplateSchemaByMode = _useSchemaTemplateMan2.getTemplateSchemaByMode;
898
-
899
- var association = (0, _blockProvider.useBlockAssociationContext)();
900
- var collection = (0, _collectionManager.useCollection)();
901
- return /*#__PURE__*/_react2.default.createElement(_SchemaInitializer.SchemaInitializer.Item, _objectSpread(_objectSpread({
902
- icon: /*#__PURE__*/_react2.default.createElement(_icons.FormOutlined, null)
903
- }, others), {}, {
904
- onClick: function () {
905
- var _onClick2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6(_ref7) {
906
- var item, s, blockSchema;
907
- return regeneratorRuntime.wrap(function _callee6$(_context6) {
908
- while (1) {
909
- switch (_context6.prev = _context6.next) {
910
- case 0:
911
- item = _ref7.item;
912
-
913
- if (!item.template) {
914
- _context6.next = 8;
915
- break;
916
- }
917
-
918
- _context6.next = 4;
919
- return getTemplateSchemaByMode(item);
920
-
921
- case 4:
922
- s = _context6.sent;
923
-
924
- if (item.template.componentName === 'FormItem') {
925
- blockSchema = (0, _utils.createFormBlockSchema)({
926
- actionInitializers: 'CreateFormActionInitializers',
927
- association: association,
928
- collection: collection.name,
929
- template: s
930
- });
931
-
932
- if (item.mode === 'reference') {
933
- blockSchema['x-template-key'] = item.template.key;
934
- }
935
-
936
- insert(blockSchema);
937
- } else {
938
- insert(s);
939
- }
940
-
941
- _context6.next = 9;
942
- break;
943
-
944
- case 8:
945
- insert((0, _utils.createFormBlockSchema)({
946
- actionInitializers: 'CreateFormActionInitializers',
947
- association: association,
948
- collection: collection.name
949
- }));
950
-
951
- case 9:
952
- case "end":
953
- return _context6.stop();
954
- }
955
- }
956
- }, _callee6);
957
- }));
958
-
959
- function onClick(_x6) {
960
- return _onClick2.apply(this, arguments);
961
- }
962
-
963
- return onClick;
964
- }(),
965
- items: (0, _utils.useRecordCollectionDataSourceItems)('FormItem')
966
- }));
967
- };
968
-
969
- exports.CreateFormBlockInitializer = CreateFormBlockInitializer;
970
-
971
- var RecordFormBlockInitializer = function RecordFormBlockInitializer(props) {
972
- var onCreateBlockSchema = props.onCreateBlockSchema,
973
- componentType = props.componentType,
974
- createBlockSchema = props.createBlockSchema,
975
- insert = props.insert,
976
- others = _objectWithoutProperties(props, _excluded4);
977
-
978
- var _useSchemaTemplateMan3 = (0, _schemaTemplates.useSchemaTemplateManager)(),
979
- getTemplateSchemaByMode = _useSchemaTemplateMan3.getTemplateSchemaByMode;
980
-
981
- var collection = (0, _collectionManager.useCollection)();
982
- var association = (0, _blockProvider.useBlockAssociationContext)();
983
- console.log('RecordFormBlockInitializer', collection, association);
984
- return /*#__PURE__*/_react2.default.createElement(_SchemaInitializer.SchemaInitializer.Item, _objectSpread(_objectSpread({
985
- icon: /*#__PURE__*/_react2.default.createElement(_icons.FormOutlined, null)
986
- }, others), {}, {
987
- onClick: function () {
988
- var _onClick3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7(_ref8) {
989
- var item, s, blockSchema;
990
- return regeneratorRuntime.wrap(function _callee7$(_context7) {
991
- while (1) {
992
- switch (_context7.prev = _context7.next) {
993
- case 0:
994
- item = _ref8.item;
995
-
996
- if (!item.template) {
997
- _context7.next = 8;
998
- break;
999
- }
1000
-
1001
- _context7.next = 4;
1002
- return getTemplateSchemaByMode(item);
1003
-
1004
- case 4:
1005
- s = _context7.sent;
1006
-
1007
- if (item.template.componentName === 'FormItem') {
1008
- blockSchema = (0, _utils.createFormBlockSchema)({
1009
- association: association,
1010
- collection: collection.name,
1011
- action: 'get',
1012
- useSourceId: '{{ useSourceIdFromParentRecord }}',
1013
- useParams: '{{ useParamsFromRecord }}',
1014
- actionInitializers: 'UpdateFormActionInitializers',
1015
- template: s
1016
- });
1017
-
1018
- if (item.mode === 'reference') {
1019
- blockSchema['x-template-key'] = item.template.key;
1020
- }
1021
-
1022
- insert(blockSchema);
1023
- } else {
1024
- insert(s);
1025
- }
1026
-
1027
- _context7.next = 9;
1028
- break;
1029
-
1030
- case 8:
1031
- insert((0, _utils.createFormBlockSchema)({
1032
- association: association,
1033
- collection: collection.name,
1034
- action: 'get',
1035
- useSourceId: '{{ useSourceIdFromParentRecord }}',
1036
- useParams: '{{ useParamsFromRecord }}',
1037
- actionInitializers: 'UpdateFormActionInitializers'
1038
- }));
1039
-
1040
- case 9:
1041
- case "end":
1042
- return _context7.stop();
1043
- }
1044
- }
1045
- }, _callee7);
1046
- }));
1047
-
1048
- function onClick(_x7) {
1049
- return _onClick3.apply(this, arguments);
1050
- }
1051
-
1052
- return onClick;
1053
- }(),
1054
- items: (0, _utils.useRecordCollectionDataSourceItems)('FormItem')
1055
- }));
1056
- };
1057
-
1058
- exports.RecordFormBlockInitializer = RecordFormBlockInitializer;
1059
-
1060
- var RecordReadPrettyFormBlockInitializer = function RecordReadPrettyFormBlockInitializer(props) {
1061
- var onCreateBlockSchema = props.onCreateBlockSchema,
1062
- componentType = props.componentType,
1063
- createBlockSchema = props.createBlockSchema,
1064
- insert = props.insert,
1065
- others = _objectWithoutProperties(props, _excluded5);
1066
-
1067
- var _useSchemaTemplateMan4 = (0, _schemaTemplates.useSchemaTemplateManager)(),
1068
- getTemplateSchemaByMode = _useSchemaTemplateMan4.getTemplateSchemaByMode;
1069
-
1070
- var collection = (0, _collectionManager.useCollection)();
1071
- var association = (0, _blockProvider.useBlockAssociationContext)();
1072
-
1073
- var _useBlockRequestConte = (0, _blockProvider.useBlockRequestContext)(),
1074
- block = _useBlockRequestConte.block;
1075
-
1076
- var actionInitializers = block !== 'TableField' ? 'ReadPrettyFormActionInitializers' : null;
1077
- return /*#__PURE__*/_react2.default.createElement(_SchemaInitializer.SchemaInitializer.Item, _objectSpread(_objectSpread({
1078
- icon: /*#__PURE__*/_react2.default.createElement(_icons.FormOutlined, null)
1079
- }, others), {}, {
1080
- key: '123',
1081
- onClick: function () {
1082
- var _onClick4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8(_ref9) {
1083
- var item, s, blockSchema;
1084
- return regeneratorRuntime.wrap(function _callee8$(_context8) {
1085
- while (1) {
1086
- switch (_context8.prev = _context8.next) {
1087
- case 0:
1088
- item = _ref9.item;
1089
-
1090
- if (!item.template) {
1091
- _context8.next = 8;
1092
- break;
1093
- }
1094
-
1095
- _context8.next = 4;
1096
- return getTemplateSchemaByMode(item);
1097
-
1098
- case 4:
1099
- s = _context8.sent;
1100
-
1101
- if (item.template.componentName === 'ReadPrettyFormItem') {
1102
- blockSchema = (0, _utils.createReadPrettyFormBlockSchema)({
1103
- actionInitializers: actionInitializers,
1104
- association: association,
1105
- collection: collection.name,
1106
- action: 'get',
1107
- useSourceId: '{{ useSourceIdFromParentRecord }}',
1108
- useParams: '{{ useParamsFromRecord }}',
1109
- template: s
1110
- });
1111
-
1112
- if (item.mode === 'reference') {
1113
- blockSchema['x-template-key'] = item.template.key;
1114
- }
1115
-
1116
- insert(blockSchema);
1117
- } else {
1118
- insert(s);
1119
- }
1120
-
1121
- _context8.next = 9;
1122
- break;
1123
-
1124
- case 8:
1125
- insert((0, _utils.createReadPrettyFormBlockSchema)({
1126
- actionInitializers: actionInitializers,
1127
- association: association,
1128
- collection: collection.name,
1129
- action: 'get',
1130
- useSourceId: '{{ useSourceIdFromParentRecord }}',
1131
- useParams: '{{ useParamsFromRecord }}'
1132
- }));
1133
-
1134
- case 9:
1135
- case "end":
1136
- return _context8.stop();
1137
- }
1138
- }
1139
- }, _callee8);
1140
- }));
1141
-
1142
- function onClick(_x8) {
1143
- return _onClick4.apply(this, arguments);
1144
- }
1145
-
1146
- return onClick;
1147
- }(),
1148
- items: (0, _utils.useRecordCollectionDataSourceItems)('ReadPrettyFormItem')
1149
- }));
1150
- };
1151
-
1152
- exports.RecordReadPrettyFormBlockInitializer = RecordReadPrettyFormBlockInitializer;
1153
-
1154
- var RecordAssociationFormBlockInitializer = function RecordAssociationFormBlockInitializer(props) {
1155
- var item = props.item,
1156
- onCreateBlockSchema = props.onCreateBlockSchema,
1157
- componentType = props.componentType,
1158
- createBlockSchema = props.createBlockSchema,
1159
- insert = props.insert,
1160
- others = _objectWithoutProperties(props, _excluded6);
1161
-
1162
- var _useSchemaTemplateMan5 = (0, _schemaTemplates.useSchemaTemplateManager)(),
1163
- getTemplateSchemaByMode = _useSchemaTemplateMan5.getTemplateSchemaByMode;
1164
-
1165
- var field = item.field;
1166
- var collection = field.target;
1167
- var resource = "".concat(field.collectionName, ".").concat(field.name);
1168
- return /*#__PURE__*/_react2.default.createElement(_SchemaInitializer.SchemaInitializer.Item, _objectSpread(_objectSpread({
1169
- icon: /*#__PURE__*/_react2.default.createElement(_icons.FormOutlined, null)
1170
- }, others), {}, {
1171
- onClick: function () {
1172
- var _onClick5 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee9(_ref10) {
1173
- var item, action, actionInitializers, s, blockSchema;
1174
- return regeneratorRuntime.wrap(function _callee9$(_context9) {
1175
- while (1) {
1176
- switch (_context9.prev = _context9.next) {
1177
- case 0:
1178
- item = _ref10.item;
1179
- action = ['hasOne', 'belongsTo'].includes(field.type) ? 'get' : null;
1180
- actionInitializers = ['hasOne', 'belongsTo'].includes(field.type) ? 'UpdateFormActionInitializers' : 'CreateFormActionInitializers';
1181
-
1182
- if (!item.template) {
1183
- _context9.next = 10;
1184
- break;
1185
- }
1186
-
1187
- _context9.next = 6;
1188
- return getTemplateSchemaByMode(item);
1189
-
1190
- case 6:
1191
- s = _context9.sent;
1192
-
1193
- if (item.template.componentName === 'FormItem') {
1194
- blockSchema = (0, _utils.createFormBlockSchema)({
1195
- collection: collection,
1196
- resource: resource,
1197
- association: resource,
1198
- action: action,
1199
- useSourceId: '{{ useSourceIdFromParentRecord }}',
1200
- useParams: '{{ useParamsFromRecord }}',
1201
- actionInitializers: actionInitializers,
1202
- template: s
1203
- });
1204
-
1205
- if (item.mode === 'reference') {
1206
- blockSchema['x-template-key'] = item.template.key;
1207
- }
1208
-
1209
- insert(blockSchema);
1210
- } else {
1211
- insert(s);
1212
- }
1213
-
1214
- _context9.next = 11;
1215
- break;
1216
-
1217
- case 10:
1218
- insert((0, _utils.createFormBlockSchema)({
1219
- collection: collection,
1220
- resource: resource,
1221
- association: resource,
1222
- action: action,
1223
- useSourceId: '{{ useSourceIdFromParentRecord }}',
1224
- useParams: '{{ useParamsFromRecord }}',
1225
- actionInitializers: actionInitializers
1226
- }));
1227
-
1228
- case 11:
1229
- case "end":
1230
- return _context9.stop();
1231
- }
1232
- }
1233
- }, _callee9);
1234
- }));
1235
-
1236
- function onClick(_x9) {
1237
- return _onClick5.apply(this, arguments);
1238
- }
1239
-
1240
- return onClick;
1241
- }(),
1242
- items: (0, _utils.useRecordCollectionDataSourceItems)('FormItem', item, collection, resource)
1243
- }));
1244
- };
1245
-
1246
- exports.RecordAssociationFormBlockInitializer = RecordAssociationFormBlockInitializer;
1247
-
1248
- var RecordReadPrettyAssociationFormBlockInitializer = function RecordReadPrettyAssociationFormBlockInitializer(props) {
1249
- var item = props.item,
1250
- onCreateBlockSchema = props.onCreateBlockSchema,
1251
- componentType = props.componentType,
1252
- createBlockSchema = props.createBlockSchema,
1253
- insert = props.insert,
1254
- others = _objectWithoutProperties(props, _excluded7);
1255
-
1256
- var _useSchemaTemplateMan6 = (0, _schemaTemplates.useSchemaTemplateManager)(),
1257
- getTemplateSchemaByMode = _useSchemaTemplateMan6.getTemplateSchemaByMode;
1258
-
1259
- var field = item.field;
1260
- var collection = field.target;
1261
- var resource = "".concat(field.collectionName, ".").concat(field.name);
1262
-
1263
- var _useBlockRequestConte2 = (0, _blockProvider.useBlockRequestContext)(),
1264
- block = _useBlockRequestConte2.block;
1265
-
1266
- var actionInitializers = block !== 'TableField' ? 'ReadPrettyFormActionInitializers' : null;
1267
- return /*#__PURE__*/_react2.default.createElement(_SchemaInitializer.SchemaInitializer.Item, _objectSpread(_objectSpread({
1268
- icon: /*#__PURE__*/_react2.default.createElement(_icons.FormOutlined, null)
1269
- }, others), {}, {
1270
- onClick: function () {
1271
- var _onClick6 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee10(_ref11) {
1272
- var item, s, blockSchema;
1273
- return regeneratorRuntime.wrap(function _callee10$(_context10) {
1274
- while (1) {
1275
- switch (_context10.prev = _context10.next) {
1276
- case 0:
1277
- item = _ref11.item;
1278
-
1279
- if (!item.template) {
1280
- _context10.next = 8;
1281
- break;
1282
- }
1283
-
1284
- _context10.next = 4;
1285
- return getTemplateSchemaByMode(item);
1286
-
1287
- case 4:
1288
- s = _context10.sent;
1289
-
1290
- if (item.template.componentName === 'ReadPrettyFormItem') {
1291
- blockSchema = (0, _utils.createReadPrettyFormBlockSchema)({
1292
- actionInitializers: actionInitializers,
1293
- collection: collection,
1294
- resource: resource,
1295
- association: resource,
1296
- action: 'get',
1297
- useSourceId: '{{ useSourceIdFromParentRecord }}',
1298
- useParams: '{{ useParamsFromRecord }}',
1299
- template: s
1300
- });
1301
-
1302
- if (item.mode === 'reference') {
1303
- blockSchema['x-template-key'] = item.template.key;
1304
- }
1305
-
1306
- insert(blockSchema);
1307
- } else {
1308
- insert(s);
1309
- }
1310
-
1311
- _context10.next = 9;
1312
- break;
1313
-
1314
- case 8:
1315
- insert((0, _utils.createReadPrettyFormBlockSchema)({
1316
- actionInitializers: actionInitializers,
1317
- collection: collection,
1318
- resource: resource,
1319
- association: resource,
1320
- action: 'get',
1321
- useSourceId: '{{ useSourceIdFromParentRecord }}',
1322
- useParams: '{{ useParamsFromRecord }}'
1323
- }));
1324
-
1325
- case 9:
1326
- case "end":
1327
- return _context10.stop();
1328
- }
1329
- }
1330
- }, _callee10);
1331
- }));
1332
-
1333
- function onClick(_x10) {
1334
- return _onClick6.apply(this, arguments);
1335
- }
1336
-
1337
- return onClick;
1338
- }(),
1339
- items: (0, _utils.useRecordCollectionDataSourceItems)('ReadPrettyFormItem', item, collection, resource)
1340
- }));
1341
- };
1342
-
1343
- exports.RecordReadPrettyAssociationFormBlockInitializer = RecordReadPrettyAssociationFormBlockInitializer;
1344
-
1345
- var RecordAssociationDetailsBlockInitializer = function RecordAssociationDetailsBlockInitializer(props) {
1346
- var item = props.item,
1347
- onCreateBlockSchema = props.onCreateBlockSchema,
1348
- componentType = props.componentType,
1349
- createBlockSchema = props.createBlockSchema,
1350
- insert = props.insert,
1351
- others = _objectWithoutProperties(props, _excluded8);
1352
-
1353
- var _useSchemaTemplateMan7 = (0, _schemaTemplates.useSchemaTemplateManager)(),
1354
- getTemplateSchemaByMode = _useSchemaTemplateMan7.getTemplateSchemaByMode;
1355
-
1356
- var _useCollectionManager5 = (0, _collectionManager.useCollectionManager)(),
1357
- getCollection = _useCollectionManager5.getCollection;
1358
-
1359
- var field = item.field;
1360
- var collection = getCollection(field.target);
1361
- var resource = "".concat(field.collectionName, ".").concat(field.name);
1362
- return /*#__PURE__*/_react2.default.createElement(_SchemaInitializer.SchemaInitializer.Item, _objectSpread(_objectSpread({
1363
- icon: /*#__PURE__*/_react2.default.createElement(_icons.FormOutlined, null)
1364
- }, others), {}, {
1365
- onClick: function () {
1366
- var _onClick7 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee11(_ref12) {
1367
- var item, s;
1368
- return regeneratorRuntime.wrap(function _callee11$(_context11) {
1369
- while (1) {
1370
- switch (_context11.prev = _context11.next) {
1371
- case 0:
1372
- item = _ref12.item;
1373
-
1374
- if (!item.template) {
1375
- _context11.next = 8;
1376
- break;
1377
- }
1378
-
1379
- _context11.next = 4;
1380
- return getTemplateSchemaByMode(item);
1381
-
1382
- case 4:
1383
- s = _context11.sent;
1384
- insert(s);
1385
- _context11.next = 9;
1386
- break;
1387
-
1388
- case 8:
1389
- insert((0, _utils.createDetailsBlockSchema)({
1390
- collection: field.target,
1391
- resource: resource,
1392
- association: resource,
1393
- rowKey: collection.filterTargetKey || 'id'
1394
- }));
1395
-
1396
- case 9:
1397
- case "end":
1398
- return _context11.stop();
1399
- }
1400
- }
1401
- }, _callee11);
1402
- }));
1403
-
1404
- function onClick(_x11) {
1405
- return _onClick7.apply(this, arguments);
1406
- }
1407
-
1408
- return onClick;
1409
- }(),
1410
- items: (0, _utils.useRecordCollectionDataSourceItems)('Details', item, field.target, resource)
1411
- }));
1412
- };
1413
-
1414
- exports.RecordAssociationDetailsBlockInitializer = RecordAssociationDetailsBlockInitializer;
1415
-
1416
- var RecordAssociationCalendarBlockInitializer = function RecordAssociationCalendarBlockInitializer(props) {
1417
- var item = props.item,
1418
- onCreateBlockSchema = props.onCreateBlockSchema,
1419
- componentType = props.componentType,
1420
- createBlockSchema = props.createBlockSchema,
1421
- insert = props.insert,
1422
- others = _objectWithoutProperties(props, _excluded9);
1423
-
1424
- var _useSchemaTemplateMan8 = (0, _schemaTemplates.useSchemaTemplateManager)(),
1425
- getTemplateSchemaByMode = _useSchemaTemplateMan8.getTemplateSchemaByMode;
1426
-
1427
- var _useTranslation4 = (0, _reactI18next.useTranslation)(),
1428
- t = _useTranslation4.t;
1429
-
1430
- var options = (0, _react2.useContext)(_react.SchemaOptionsContext);
1431
-
1432
- var _useCollectionManager6 = (0, _collectionManager.useCollectionManager)(),
1433
- getCollection = _useCollectionManager6.getCollection;
1434
-
1435
- var field = item.field;
1436
- var collection = getCollection(field.target);
1437
- var resource = "".concat(field.collectionName, ".").concat(field.name);
1438
- return /*#__PURE__*/_react2.default.createElement(_SchemaInitializer.SchemaInitializer.Item, _objectSpread(_objectSpread({
1439
- icon: /*#__PURE__*/_react2.default.createElement(_icons.TableOutlined, null)
1440
- }, others), {}, {
1441
- onClick: function () {
1442
- var _onClick8 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee12(_ref13) {
1443
- var item, s, _collection$fields5, _collection$fields5$f, _collection$fields6, _collection$fields6$f, stringFields, dateFields, values;
1444
-
1445
- return regeneratorRuntime.wrap(function _callee12$(_context12) {
1446
- while (1) {
1447
- switch (_context12.prev = _context12.next) {
1448
- case 0:
1449
- item = _ref13.item;
1450
-
1451
- if (!item.template) {
1452
- _context12.next = 8;
1453
- break;
1454
- }
1455
-
1456
- _context12.next = 4;
1457
- return getTemplateSchemaByMode(item);
1458
-
1459
- case 4:
1460
- s = _context12.sent;
1461
- insert(s);
1462
- _context12.next = 14;
1463
- break;
1464
-
1465
- case 8:
1466
- stringFields = collection === null || collection === void 0 ? void 0 : (_collection$fields5 = collection.fields) === null || _collection$fields5 === void 0 ? void 0 : (_collection$fields5$f = _collection$fields5.filter(function (field) {
1467
- return field.type === 'string';
1468
- })) === null || _collection$fields5$f === void 0 ? void 0 : _collection$fields5$f.map(function (field) {
1469
- var _field$uiSchema4;
1470
-
1471
- return {
1472
- label: field === null || field === void 0 ? void 0 : (_field$uiSchema4 = field.uiSchema) === null || _field$uiSchema4 === void 0 ? void 0 : _field$uiSchema4.title,
1473
- value: field.name
1474
- };
1475
- });
1476
- dateFields = collection === null || collection === void 0 ? void 0 : (_collection$fields6 = collection.fields) === null || _collection$fields6 === void 0 ? void 0 : (_collection$fields6$f = _collection$fields6.filter(function (field) {
1477
- return field.type === 'date';
1478
- })) === null || _collection$fields6$f === void 0 ? void 0 : _collection$fields6$f.map(function (field) {
1479
- var _field$uiSchema5;
1480
-
1481
- return {
1482
- label: field === null || field === void 0 ? void 0 : (_field$uiSchema5 = field.uiSchema) === null || _field$uiSchema5 === void 0 ? void 0 : _field$uiSchema5.title,
1483
- value: field.name
1484
- };
1485
- });
1486
- _context12.next = 12;
1487
- return (0, _antd.FormDialog)(t('Create calendar block'), function () {
1488
- return /*#__PURE__*/_react2.default.createElement(_schemaComponent.SchemaComponentOptions, {
1489
- scope: options.scope,
1490
- components: _objectSpread({}, options.components)
1491
- }, /*#__PURE__*/_react2.default.createElement(_antd.FormLayout, {
1492
- layout: 'vertical'
1493
- }, /*#__PURE__*/_react2.default.createElement(_schemaComponent.SchemaComponent, {
1494
- schema: {
1495
- properties: {
1496
- title: {
1497
- title: t('Title field'),
1498
- enum: stringFields,
1499
- required: true,
1500
- 'x-component': 'Select',
1501
- 'x-decorator': 'FormItem'
1502
- },
1503
- start: {
1504
- title: t('Start date field'),
1505
- enum: dateFields,
1506
- required: true,
1507
- default: 'createdAt',
1508
- 'x-component': 'Select',
1509
- 'x-decorator': 'FormItem'
1510
- },
1511
- end: {
1512
- title: t('End date field'),
1513
- enum: dateFields,
1514
- 'x-component': 'Select',
1515
- 'x-decorator': 'FormItem'
1516
- }
1517
- }
1518
- }
1519
- })));
1520
- }).open({
1521
- initialValues: {}
1522
- });
1523
-
1524
- case 12:
1525
- values = _context12.sent;
1526
- insert((0, _utils.createCalendarBlockSchema)({
1527
- collection: field.target,
1528
- resource: resource,
1529
- association: resource,
1530
- fieldNames: _objectSpread({}, values)
1531
- }));
1532
-
1533
- case 14:
1534
- case "end":
1535
- return _context12.stop();
1536
- }
1537
- }
1538
- }, _callee12);
1539
- }));
1540
-
1541
- function onClick(_x12) {
1542
- return _onClick8.apply(this, arguments);
1543
- }
1544
-
1545
- return onClick;
1546
- }(),
1547
- items: (0, _utils.useRecordCollectionDataSourceItems)('Calendar', item, field.target, resource)
1548
- }));
1549
- };
1550
-
1551
- exports.RecordAssociationCalendarBlockInitializer = RecordAssociationCalendarBlockInitializer;
1552
-
1553
- var RecordAssociationBlockInitializer = function RecordAssociationBlockInitializer(props) {
1554
- var item = props.item,
1555
- onCreateBlockSchema = props.onCreateBlockSchema,
1556
- componentType = props.componentType,
1557
- createBlockSchema = props.createBlockSchema,
1558
- insert = props.insert,
1559
- others = _objectWithoutProperties(props, _excluded10);
1560
-
1561
- var _useSchemaTemplateMan9 = (0, _schemaTemplates.useSchemaTemplateManager)(),
1562
- getTemplateSchemaByMode = _useSchemaTemplateMan9.getTemplateSchemaByMode;
1563
-
1564
- var _useCollectionManager7 = (0, _collectionManager.useCollectionManager)(),
1565
- getCollection = _useCollectionManager7.getCollection;
1566
-
1567
- var field = item.field;
1568
- var collection = getCollection(field.target);
1569
- var resource = "".concat(field.collectionName, ".").concat(field.name);
1570
- return /*#__PURE__*/_react2.default.createElement(_SchemaInitializer.SchemaInitializer.Item, _objectSpread(_objectSpread({
1571
- icon: /*#__PURE__*/_react2.default.createElement(_icons.TableOutlined, null)
1572
- }, others), {}, {
1573
- onClick: function () {
1574
- var _onClick9 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee13(_ref14) {
1575
- var item, s;
1576
- return regeneratorRuntime.wrap(function _callee13$(_context13) {
1577
- while (1) {
1578
- switch (_context13.prev = _context13.next) {
1579
- case 0:
1580
- item = _ref14.item;
1581
-
1582
- if (!item.template) {
1583
- _context13.next = 8;
1584
- break;
1585
- }
1586
-
1587
- _context13.next = 4;
1588
- return getTemplateSchemaByMode(item);
1589
-
1590
- case 4:
1591
- s = _context13.sent;
1592
- insert(s);
1593
- _context13.next = 9;
1594
- break;
1595
-
1596
- case 8:
1597
- insert((0, _utils.createTableBlockSchema)({
1598
- rowKey: collection.filterTargetKey,
1599
- collection: field.target,
1600
- resource: resource,
1601
- association: resource
1602
- }));
1603
-
1604
- case 9:
1605
- case "end":
1606
- return _context13.stop();
1607
- }
1608
- }
1609
- }, _callee13);
1610
- }));
1611
-
1612
- function onClick(_x13) {
1613
- return _onClick9.apply(this, arguments);
1614
- }
1615
-
1616
- return onClick;
1617
- }(),
1618
- items: (0, _utils.useRecordCollectionDataSourceItems)('Table', item, field.target, resource)
1619
- }));
1620
- };
1621
-
1622
- exports.RecordAssociationBlockInitializer = RecordAssociationBlockInitializer;
1623
-
1624
- var TableActionColumnInitializer = function TableActionColumnInitializer(props) {
1625
- var schema = {
1626
- type: 'void',
1627
- title: '{{ t("Actions") }}',
1628
- 'x-decorator': 'TableV2.Column.ActionBar',
1629
- 'x-component': 'TableV2.Column',
1630
- 'x-designer': 'TableV2.ActionColumnDesigner',
1631
- 'x-initializer': 'TableActionColumnInitializers',
1632
- 'x-action-column': 'actions',
1633
- properties: {
1634
- actions: {
1635
- type: 'void',
1636
- 'x-decorator': 'DndContext',
1637
- 'x-component': 'Space',
1638
- 'x-component-props': {
1639
- split: '|'
1640
- },
1641
- properties: {}
1642
- }
446
+ });
447
+ });
448
+
449
+ var _ViewActionInitializer = require("./ViewActionInitializer");
450
+
451
+ Object.keys(_ViewActionInitializer).forEach(function (key) {
452
+ if (key === "default" || key === "__esModule") return;
453
+ if (key in exports && exports[key] === _ViewActionInitializer[key]) return;
454
+ Object.defineProperty(exports, key, {
455
+ enumerable: true,
456
+ get: function get() {
457
+ return _ViewActionInitializer[key];
1643
458
  }
1644
- };
1645
- return /*#__PURE__*/_react2.default.createElement(InitializerWithSwitch, _objectSpread(_objectSpread({}, props), {}, {
1646
- schema: schema,
1647
- type: 'x-action-column'
1648
- }));
1649
- };
1650
-
1651
- exports.TableActionColumnInitializer = TableActionColumnInitializer;
1652
-
1653
- var TableCollectionFieldInitializer = function TableCollectionFieldInitializer(props) {
1654
- var schema = {};
1655
- return /*#__PURE__*/_react2.default.createElement(InitializerWithSwitch, _objectSpread(_objectSpread({}, props), {}, {
1656
- schema: schema,
1657
- type: 'x-collection-field'
1658
- }));
1659
- };
1660
-
1661
- exports.TableCollectionFieldInitializer = TableCollectionFieldInitializer;
1662
-
1663
- var CollectionFieldInitializer = function CollectionFieldInitializer(props) {
1664
- var schema = {};
1665
- return /*#__PURE__*/_react2.default.createElement(InitializerWithSwitch, _objectSpread(_objectSpread({}, props), {}, {
1666
- schema: schema,
1667
- type: 'x-collection-field'
1668
- }));
1669
- };
1670
-
1671
- exports.CollectionFieldInitializer = CollectionFieldInitializer;
1672
-
1673
- var TableSelectorInitializer = function TableSelectorInitializer(props) {
1674
- var onCreateBlockSchema = props.onCreateBlockSchema,
1675
- componentType = props.componentType,
1676
- createBlockSchema = props.createBlockSchema,
1677
- insert = props.insert,
1678
- others = _objectWithoutProperties(props, _excluded11);
1679
-
1680
- var _useSchemaTemplateMan10 = (0, _schemaTemplates.useSchemaTemplateManager)(),
1681
- getTemplateSchemaByMode = _useSchemaTemplateMan10.getTemplateSchemaByMode;
1682
-
1683
- var collection = (0, _collectionManager.useCollection)();
1684
- return /*#__PURE__*/_react2.default.createElement(_SchemaInitializer.SchemaInitializer.Item, _objectSpread(_objectSpread({
1685
- icon: /*#__PURE__*/_react2.default.createElement(_icons.FormOutlined, null)
1686
- }, others), {}, {
1687
- onClick: function () {
1688
- var _onClick10 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee14(_ref15) {
1689
- var item, field;
1690
- return regeneratorRuntime.wrap(function _callee14$(_context14) {
1691
- while (1) {
1692
- switch (_context14.prev = _context14.next) {
1693
- case 0:
1694
- item = _ref15.item;
1695
- field = item.field;
1696
- insert((0, _utils.createTableSelectorSchema)({
1697
- rowKey: collection.filterTargetKey,
1698
- collection: collection.name,
1699
- resource: collection.name
1700
- }));
1701
-
1702
- case 3:
1703
- case "end":
1704
- return _context14.stop();
1705
- }
1706
- }
1707
- }, _callee14);
1708
- }));
1709
-
1710
- function onClick(_x14) {
1711
- return _onClick10.apply(this, arguments);
1712
- }
1713
-
1714
- return onClick;
1715
- }()
1716
- }));
1717
- };
1718
-
1719
- exports.TableSelectorInitializer = TableSelectorInitializer;
459
+ });
460
+ });