@nocobase/client 0.9.0-alpha.2 → 0.9.1-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 (291) hide show
  1. package/es/acl/ACLProvider.js +4 -7
  2. package/es/api-client/APIClient.js +6 -0
  3. package/es/block-provider/BlockProvider.js +9 -6
  4. package/es/block-provider/FormBlockProvider.js +3 -1
  5. package/es/block-provider/KanbanBlockProvider.js +1 -1
  6. package/es/block-provider/SharedFilterProvider.js +9 -1
  7. package/es/block-provider/TableBlockProvider.js +1 -1
  8. package/es/block-provider/TableSelectorProvider.js +2 -2
  9. package/es/block-provider/hooks/index.js +22 -7
  10. package/es/collection-manager/CollectionManagerProvider.d.ts +1 -0
  11. package/es/collection-manager/CollectionManagerProvider.js +71 -9
  12. package/es/collection-manager/CollectionManagerShortcut.js +36 -23
  13. package/es/collection-manager/Configuration/AddCategoryAction.d.ts +2 -0
  14. package/es/collection-manager/Configuration/AddCategoryAction.js +117 -0
  15. package/es/collection-manager/Configuration/AddCollectionAction.js +8 -3
  16. package/es/collection-manager/Configuration/AddFieldAction.js +1 -0
  17. package/es/collection-manager/Configuration/ConfigurationTable.js +33 -4
  18. package/es/collection-manager/Configuration/ConfigurationTabs.d.ts +1 -0
  19. package/es/collection-manager/Configuration/ConfigurationTabs.js +381 -0
  20. package/es/collection-manager/Configuration/EditCategoryAction.d.ts +2 -0
  21. package/es/collection-manager/Configuration/EditCategoryAction.js +150 -0
  22. package/es/collection-manager/Configuration/EditCollectionAction.js +6 -2
  23. package/es/collection-manager/Configuration/OverridingCollectionField.js +17 -8
  24. package/es/collection-manager/Configuration/components/CollectionCategory.d.ts +2 -0
  25. package/es/collection-manager/Configuration/components/CollectionCategory.js +13 -0
  26. package/es/collection-manager/Configuration/index.d.ts +3 -0
  27. package/es/collection-manager/Configuration/index.js +3 -0
  28. package/es/collection-manager/Configuration/schemas/collections.d.ts +3 -0
  29. package/es/collection-manager/Configuration/schemas/collections.js +309 -176
  30. package/es/collection-manager/Configuration/templates.d.ts +1 -0
  31. package/es/collection-manager/Configuration/templates.js +1 -1
  32. package/es/collection-manager/action-hooks.js +3 -1
  33. package/es/collection-manager/context.d.ts +4 -0
  34. package/es/collection-manager/context.js +5 -1
  35. package/es/collection-manager/hooks/useCollectionManager.d.ts +7 -0
  36. package/es/collection-manager/hooks/useCollectionManager.js +51 -6
  37. package/es/collection-manager/interfaces/m2m.js +2 -2
  38. package/es/collection-manager/interfaces/properties/index.d.ts +0 -56
  39. package/es/collection-manager/interfaces/properties/index.js +1 -2
  40. package/es/collection-manager/templates/calendar.js +1 -1
  41. package/es/collection-manager/templates/general.js +1 -1
  42. package/es/collection-manager/templates/properties/index.d.ts +12 -1
  43. package/es/collection-manager/templates/properties/index.js +11 -0
  44. package/es/i18n/i18n.js +3 -1
  45. package/es/locale/en_US.d.ts +23 -0
  46. package/es/locale/en_US.js +23 -0
  47. package/es/locale/ja_JP.d.ts +23 -0
  48. package/es/locale/ja_JP.js +24 -1
  49. package/es/locale/ru_RU.d.ts +1 -0
  50. package/es/locale/ru_RU.js +1 -0
  51. package/es/locale/zh_CN.d.ts +43 -4
  52. package/es/locale/zh_CN.js +44 -5
  53. package/es/route-switch/antd/admin-layout/index.js +13 -33
  54. package/es/schema-component/antd/action/Action.Designer.js +22 -15
  55. package/es/schema-component/antd/action/Action.js +25 -3
  56. package/es/schema-component/antd/action/utils.d.ts +1 -0
  57. package/es/schema-component/antd/action/utils.js +49 -0
  58. package/es/schema-component/antd/association-filter/AssociationFilter.js +4 -4
  59. package/es/schema-component/antd/association-select/AssociationSelect.d.ts +2 -2
  60. package/es/schema-component/antd/association-select/useServiceOptions.js +47 -6
  61. package/es/schema-component/antd/calendar/Calendar.Designer.js +17 -36
  62. package/es/schema-component/antd/checkbox/Checkbox.js +9 -8
  63. package/es/schema-component/antd/date-picker/util.d.ts +1 -1
  64. package/es/schema-component/antd/date-picker/util.js +1 -1
  65. package/es/schema-component/antd/filter/DynamicComponent.js +3 -1
  66. package/es/schema-component/antd/filter/Filter.js +2 -1
  67. package/es/schema-component/antd/filter/FilterGroup.js +7 -4
  68. package/es/schema-component/antd/filter/FilterItem.js +3 -2
  69. package/es/schema-component/antd/filter/context.d.ts +1 -0
  70. package/es/schema-component/antd/filter/useValues.js +14 -11
  71. package/es/schema-component/antd/form/Form.js +11 -5
  72. package/es/schema-component/antd/form-item/FormItem.js +17 -8
  73. package/es/schema-component/antd/form-v2/Form.Designer.js +2 -0
  74. package/es/schema-component/antd/form-v2/Form.js +90 -7
  75. package/es/schema-component/antd/form-v2/utils.d.ts +5 -0
  76. package/es/schema-component/antd/form-v2/utils.js +161 -0
  77. package/es/schema-component/antd/grid/Grid.js +10 -5
  78. package/es/schema-component/antd/icon-picker/IconPicker.js +1 -0
  79. package/es/schema-component/antd/index.d.ts +1 -0
  80. package/es/schema-component/antd/index.js +1 -0
  81. package/es/schema-component/antd/input/Input.d.ts +2 -1
  82. package/es/schema-component/antd/input/Json.d.ts +5 -3
  83. package/es/schema-component/antd/input/Json.js +3 -2
  84. package/es/schema-component/antd/input-number/InputNumber.js +3 -1
  85. package/es/schema-component/antd/page/FixedBlock.js +3 -1
  86. package/es/schema-component/antd/page/Page.js +11 -5
  87. package/es/schema-component/antd/page/PageTabDesigner.js +3 -3
  88. package/es/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +3 -1
  89. package/es/schema-component/antd/record-picker/RecordPicker.js +1 -2
  90. package/es/schema-component/antd/record-picker/util.js +7 -0
  91. package/es/schema-component/antd/remote-select/RemoteSelect.js +76 -36
  92. package/es/schema-component/antd/rich-text/RichText.js +4 -2
  93. package/es/schema-component/antd/select/Select.js +14 -4
  94. package/es/schema-component/antd/table/Table.Array.js +10 -3
  95. package/es/schema-component/antd/table-v2/Table.Column.Designer.js +2 -2
  96. package/es/schema-component/antd/table-v2/TableBlockDesigner.js +3 -2
  97. package/es/schema-component/antd/tabs/Tabs.Designer.js +1 -0
  98. package/es/schema-component/antd/time-picker/TimePicker.js +1 -1
  99. package/es/schema-component/antd/variable/Input.d.ts +2 -0
  100. package/es/schema-component/antd/variable/Input.js +244 -0
  101. package/es/schema-component/antd/variable/JSONInput.d.ts +2 -0
  102. package/es/schema-component/antd/variable/JSONInput.js +82 -0
  103. package/es/schema-component/antd/variable/TextArea.d.ts +2 -0
  104. package/es/schema-component/antd/variable/TextArea.js +322 -0
  105. package/es/schema-component/antd/variable/Variable.d.ts +8 -0
  106. package/es/schema-component/antd/variable/Variable.js +11 -0
  107. package/es/schema-component/antd/variable/index.d.ts +1 -0
  108. package/es/schema-component/antd/variable/index.js +1 -0
  109. package/es/schema-component/common/sortable-item/SortableItem.js +36 -6
  110. package/es/schema-component/common/utils/logic.js +523 -0
  111. package/es/schema-component/common/utils/uitls.d.ts +1 -0
  112. package/es/schema-component/common/utils/uitls.js +89 -0
  113. package/es/schema-initializer/SchemaInitializer.js +0 -1
  114. package/es/schema-initializer/buttons/TableActionColumnInitializers.d.ts +1 -0
  115. package/es/schema-initializer/buttons/TableActionColumnInitializers.js +1 -3
  116. package/es/schema-initializer/index.d.ts +2 -1
  117. package/es/schema-initializer/index.js +2 -1
  118. package/es/schema-initializer/items/CalendarBlockInitializer.js +24 -41
  119. package/es/schema-initializer/utils.js +22 -7
  120. package/es/schema-settings/LinkageRules/DynamicComponent.d.ts +1 -0
  121. package/es/schema-settings/LinkageRules/DynamicComponent.js +113 -0
  122. package/es/schema-settings/LinkageRules/FilterDynamicComponent.d.ts +2 -0
  123. package/es/schema-settings/LinkageRules/FilterDynamicComponent.js +15 -0
  124. package/es/schema-settings/LinkageRules/LinkageRuleAction.d.ts +3 -0
  125. package/es/schema-settings/LinkageRules/LinkageRuleAction.js +162 -0
  126. package/es/schema-settings/LinkageRules/LinkageRuleActionGroup.d.ts +3 -0
  127. package/es/schema-settings/LinkageRules/LinkageRuleActionGroup.js +71 -0
  128. package/es/schema-settings/LinkageRules/ValueDynamicComponent.d.ts +1 -0
  129. package/es/schema-settings/LinkageRules/ValueDynamicComponent.js +82 -0
  130. package/es/schema-settings/LinkageRules/Variables.d.ts +7 -0
  131. package/es/schema-settings/LinkageRules/Variables.js +115 -0
  132. package/es/schema-settings/LinkageRules/action-hooks.d.ts +1 -0
  133. package/es/schema-settings/LinkageRules/action-hooks.js +115 -0
  134. package/es/schema-settings/LinkageRules/context.d.ts +13 -0
  135. package/es/schema-settings/LinkageRules/context.js +4 -0
  136. package/es/schema-settings/LinkageRules/index.d.ts +2 -0
  137. package/es/schema-settings/LinkageRules/index.js +132 -0
  138. package/es/schema-settings/LinkageRules/type.d.ts +13 -0
  139. package/es/schema-settings/LinkageRules/type.js +15 -0
  140. package/es/schema-settings/LinkageRules/useValues.d.ts +1 -0
  141. package/es/schema-settings/LinkageRules/useValues.js +84 -0
  142. package/es/schema-settings/SchemaSettings.d.ts +4 -1
  143. package/es/schema-settings/SchemaSettings.js +153 -26
  144. package/es/schema-templates/BlockTemplate.js +9 -1
  145. package/es/system-settings/SystemSettingsShortcut.js +1 -1
  146. package/lib/acl/ACLProvider.js +4 -7
  147. package/lib/api-client/APIClient.js +6 -0
  148. package/lib/block-provider/BlockProvider.js +9 -6
  149. package/lib/block-provider/FormBlockProvider.js +3 -1
  150. package/lib/block-provider/KanbanBlockProvider.js +1 -1
  151. package/lib/block-provider/SharedFilterProvider.js +9 -3
  152. package/lib/block-provider/TableBlockProvider.js +1 -1
  153. package/lib/block-provider/TableSelectorProvider.js +2 -2
  154. package/lib/block-provider/hooks/index.js +23 -7
  155. package/lib/collection-manager/CollectionManagerProvider.d.ts +1 -0
  156. package/lib/collection-manager/CollectionManagerProvider.js +81 -16
  157. package/lib/collection-manager/CollectionManagerShortcut.js +36 -23
  158. package/lib/collection-manager/Configuration/AddCategoryAction.d.ts +2 -0
  159. package/lib/collection-manager/Configuration/AddCategoryAction.js +145 -0
  160. package/lib/collection-manager/Configuration/AddCollectionAction.js +8 -3
  161. package/lib/collection-manager/Configuration/AddFieldAction.js +1 -0
  162. package/lib/collection-manager/Configuration/ConfigurationTable.js +34 -4
  163. package/lib/collection-manager/Configuration/ConfigurationTabs.d.ts +1 -0
  164. package/lib/collection-manager/Configuration/ConfigurationTabs.js +407 -0
  165. package/lib/collection-manager/Configuration/EditCategoryAction.d.ts +2 -0
  166. package/lib/collection-manager/Configuration/EditCategoryAction.js +178 -0
  167. package/lib/collection-manager/Configuration/EditCollectionAction.js +6 -2
  168. package/lib/collection-manager/Configuration/OverridingCollectionField.js +17 -8
  169. package/lib/collection-manager/Configuration/components/CollectionCategory.d.ts +2 -0
  170. package/lib/collection-manager/Configuration/components/CollectionCategory.js +27 -0
  171. package/lib/collection-manager/Configuration/index.d.ts +3 -0
  172. package/lib/collection-manager/Configuration/index.js +39 -0
  173. package/lib/collection-manager/Configuration/schemas/collections.d.ts +3 -0
  174. package/lib/collection-manager/Configuration/schemas/collections.js +316 -178
  175. package/lib/collection-manager/Configuration/templates.d.ts +1 -0
  176. package/lib/collection-manager/Configuration/templates.js +2 -0
  177. package/lib/collection-manager/action-hooks.js +3 -1
  178. package/lib/collection-manager/context.d.ts +4 -0
  179. package/lib/collection-manager/context.js +7 -2
  180. package/lib/collection-manager/hooks/useCollectionManager.d.ts +7 -0
  181. package/lib/collection-manager/hooks/useCollectionManager.js +52 -6
  182. package/lib/collection-manager/interfaces/m2m.js +2 -2
  183. package/lib/collection-manager/interfaces/properties/index.d.ts +0 -56
  184. package/lib/collection-manager/interfaces/properties/index.js +1 -2
  185. package/lib/collection-manager/templates/calendar.js +1 -1
  186. package/lib/collection-manager/templates/general.js +1 -1
  187. package/lib/collection-manager/templates/properties/index.d.ts +12 -1
  188. package/lib/collection-manager/templates/properties/index.js +11 -0
  189. package/lib/i18n/i18n.js +3 -1
  190. package/lib/locale/en_US.d.ts +23 -0
  191. package/lib/locale/en_US.js +23 -0
  192. package/lib/locale/ja_JP.d.ts +23 -0
  193. package/lib/locale/ja_JP.js +24 -1
  194. package/lib/locale/ru_RU.d.ts +1 -0
  195. package/lib/locale/ru_RU.js +1 -0
  196. package/lib/locale/zh_CN.d.ts +43 -4
  197. package/lib/locale/zh_CN.js +44 -5
  198. package/lib/route-switch/antd/admin-layout/index.js +13 -33
  199. package/lib/schema-component/antd/action/Action.Designer.js +24 -14
  200. package/lib/schema-component/antd/action/Action.js +27 -2
  201. package/lib/schema-component/antd/action/utils.d.ts +1 -0
  202. package/lib/schema-component/antd/action/utils.js +58 -2
  203. package/lib/schema-component/antd/association-filter/AssociationFilter.js +3 -3
  204. package/lib/schema-component/antd/association-select/AssociationSelect.d.ts +2 -2
  205. package/lib/schema-component/antd/association-select/useServiceOptions.js +47 -4
  206. package/lib/schema-component/antd/calendar/Calendar.Designer.js +15 -33
  207. package/lib/schema-component/antd/checkbox/Checkbox.js +8 -7
  208. package/lib/schema-component/antd/date-picker/util.d.ts +1 -1
  209. package/lib/schema-component/antd/date-picker/util.js +1 -1
  210. package/lib/schema-component/antd/filter/DynamicComponent.js +3 -1
  211. package/lib/schema-component/antd/filter/Filter.js +2 -1
  212. package/lib/schema-component/antd/filter/FilterGroup.js +7 -4
  213. package/lib/schema-component/antd/filter/FilterItem.js +3 -2
  214. package/lib/schema-component/antd/filter/context.d.ts +1 -0
  215. package/lib/schema-component/antd/filter/useValues.js +15 -11
  216. package/lib/schema-component/antd/form/Form.js +9 -3
  217. package/lib/schema-component/antd/form-item/FormItem.js +21 -7
  218. package/lib/schema-component/antd/form-v2/Form.Designer.js +2 -0
  219. package/lib/schema-component/antd/form-v2/Form.js +89 -5
  220. package/lib/schema-component/antd/form-v2/utils.d.ts +5 -0
  221. package/lib/schema-component/antd/form-v2/utils.js +181 -0
  222. package/lib/schema-component/antd/grid/Grid.js +10 -5
  223. package/lib/schema-component/antd/icon-picker/IconPicker.js +1 -0
  224. package/lib/schema-component/antd/index.d.ts +1 -0
  225. package/lib/schema-component/antd/index.js +13 -0
  226. package/lib/schema-component/antd/input/Input.d.ts +2 -1
  227. package/lib/schema-component/antd/input/Json.d.ts +5 -3
  228. package/lib/schema-component/antd/input/Json.js +6 -3
  229. package/lib/schema-component/antd/input-number/InputNumber.js +2 -0
  230. package/lib/schema-component/antd/page/FixedBlock.js +3 -1
  231. package/lib/schema-component/antd/page/Page.js +14 -5
  232. package/lib/schema-component/antd/page/PageTabDesigner.js +1 -1
  233. package/lib/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +3 -1
  234. package/lib/schema-component/antd/record-picker/RecordPicker.js +1 -2
  235. package/lib/schema-component/antd/record-picker/util.js +7 -0
  236. package/lib/schema-component/antd/remote-select/RemoteSelect.js +76 -37
  237. package/lib/schema-component/antd/rich-text/RichText.js +4 -2
  238. package/lib/schema-component/antd/select/Select.js +14 -4
  239. package/lib/schema-component/antd/table/Table.Array.js +8 -1
  240. package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +2 -2
  241. package/lib/schema-component/antd/table-v2/TableBlockDesigner.js +3 -2
  242. package/lib/schema-component/antd/tabs/Tabs.Designer.js +1 -0
  243. package/lib/schema-component/antd/time-picker/TimePicker.js +1 -1
  244. package/lib/schema-component/antd/variable/Input.d.ts +2 -0
  245. package/lib/schema-component/antd/variable/Input.js +262 -0
  246. package/lib/schema-component/antd/variable/JSONInput.d.ts +2 -0
  247. package/lib/schema-component/antd/variable/JSONInput.js +100 -0
  248. package/lib/schema-component/antd/variable/TextArea.d.ts +2 -0
  249. package/lib/schema-component/antd/variable/TextArea.js +341 -0
  250. package/lib/schema-component/antd/variable/Variable.d.ts +8 -0
  251. package/lib/schema-component/antd/variable/Variable.js +25 -0
  252. package/lib/schema-component/antd/variable/index.d.ts +1 -0
  253. package/lib/schema-component/antd/variable/index.js +18 -0
  254. package/lib/schema-component/common/sortable-item/SortableItem.js +36 -6
  255. package/lib/schema-component/common/utils/logic.js +525 -0
  256. package/lib/schema-component/common/utils/uitls.d.ts +1 -0
  257. package/lib/schema-component/common/utils/uitls.js +103 -0
  258. package/lib/schema-initializer/SchemaInitializer.js +0 -1
  259. package/lib/schema-initializer/buttons/TableActionColumnInitializers.d.ts +1 -0
  260. package/lib/schema-initializer/buttons/TableActionColumnInitializers.js +3 -1
  261. package/lib/schema-initializer/index.d.ts +2 -1
  262. package/lib/schema-initializer/index.js +51 -2
  263. package/lib/schema-initializer/items/CalendarBlockInitializer.js +16 -33
  264. package/lib/schema-initializer/utils.js +22 -6
  265. package/lib/schema-settings/LinkageRules/DynamicComponent.d.ts +1 -0
  266. package/lib/schema-settings/LinkageRules/DynamicComponent.js +139 -0
  267. package/lib/schema-settings/LinkageRules/FilterDynamicComponent.d.ts +2 -0
  268. package/lib/schema-settings/LinkageRules/FilterDynamicComponent.js +27 -0
  269. package/lib/schema-settings/LinkageRules/LinkageRuleAction.d.ts +3 -0
  270. package/lib/schema-settings/LinkageRules/LinkageRuleAction.js +190 -0
  271. package/lib/schema-settings/LinkageRules/LinkageRuleActionGroup.d.ts +3 -0
  272. package/lib/schema-settings/LinkageRules/LinkageRuleActionGroup.js +90 -0
  273. package/lib/schema-settings/LinkageRules/ValueDynamicComponent.d.ts +1 -0
  274. package/lib/schema-settings/LinkageRules/ValueDynamicComponent.js +104 -0
  275. package/lib/schema-settings/LinkageRules/Variables.d.ts +7 -0
  276. package/lib/schema-settings/LinkageRules/Variables.js +124 -0
  277. package/lib/schema-settings/LinkageRules/action-hooks.d.ts +1 -0
  278. package/lib/schema-settings/LinkageRules/action-hooks.js +127 -0
  279. package/lib/schema-settings/LinkageRules/context.d.ts +13 -0
  280. package/lib/schema-settings/LinkageRules/context.js +15 -0
  281. package/lib/schema-settings/LinkageRules/index.d.ts +2 -0
  282. package/lib/schema-settings/LinkageRules/index.js +149 -0
  283. package/lib/schema-settings/LinkageRules/type.d.ts +13 -0
  284. package/lib/schema-settings/LinkageRules/type.js +22 -0
  285. package/lib/schema-settings/LinkageRules/useValues.d.ts +1 -0
  286. package/lib/schema-settings/LinkageRules/useValues.js +95 -0
  287. package/lib/schema-settings/SchemaSettings.d.ts +4 -1
  288. package/lib/schema-settings/SchemaSettings.js +176 -48
  289. package/lib/schema-templates/BlockTemplate.js +9 -1
  290. package/lib/system-settings/SystemSettingsShortcut.js +1 -1
  291. package/package.json +4 -4
@@ -9,6 +9,8 @@ exports.default = exports.InternalAdminLayout = exports.AdminLayout = void 0;
9
9
 
10
10
  var _css = require("@emotion/css");
11
11
 
12
+ var _ahooks = require("ahooks");
13
+
12
14
  var _antd = require("antd");
13
15
 
14
16
  var _react = _interopRequireWildcard(require("react"));
@@ -19,9 +21,7 @@ var _ = require("../../../");
19
21
 
20
22
  var _collectionManager = require("../../../collection-manager");
21
23
 
22
- var _ahooks = require("ahooks");
23
-
24
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
24
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
25
25
 
26
26
  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); }
27
27
 
@@ -202,56 +202,36 @@ var InternalAdminLayout = function InternalAdminLayout(props) {
202
202
  return /*#__PURE__*/_react.default.createElement(_antd.Layout, null, /*#__PURE__*/_react.default.createElement(_antd.Layout.Header, {
203
203
  className: (0, _css.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ant-menu.ant-menu-dark .ant-menu-item-selected,\n .ant-menu-submenu-popup.ant-menu-dark .ant-menu-item-selected {\n background-color: rgba(255, 255, 255, 0.1);\n }\n .ant-menu-dark.ant-menu-horizontal > .ant-menu-item:hover {\n background-color: rgba(255, 255, 255, 0.1);\n }\n\n position: fixed;\n width: 100%;\n height: 46px;\n line-height: 46px;\n padding: 0;\n z-index: 100;\n "])))
204
204
  }, /*#__PURE__*/_react.default.createElement("div", {
205
- className: (0, _css.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n width: 100%;\n height: 100%;\n "])))
205
+ className: (0, _css.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n width: 100%;\n height: 100%;\n display: flex;\n "])))
206
206
  }, /*#__PURE__*/_react.default.createElement("div", {
207
- style: {
208
- position: 'relative',
209
- zIndex: 1,
210
- display: 'flex',
211
- height: '100%',
212
- width: 'calc(100vw - 300px)'
213
- }
207
+ className: (0, _css.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: relative;\n z-index: 1;\n flex: 1 1 auto;\n display: flex;\n height: 100%;\n "])))
214
208
  }, /*#__PURE__*/_react.default.createElement("div", {
215
- style: {
216
- width: 200,
217
- display: 'inline-flex',
218
- color: '#fff',
219
- padding: '0',
220
- alignItems: 'center'
221
- }
209
+ className: (0, _css.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n width: 200px;\n display: inline-flex;\n flex-shrink: 0;\n color: #fff;\n padding: 0;\n align-items: center;\n "])))
222
210
  }, /*#__PURE__*/_react.default.createElement("img", {
223
- className: (0, _css.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding: 0 16px;\n object-fit: contain;\n width: 100%;\n height: 100%;\n "]))),
211
+ className: (0, _css.css)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n padding: 0 16px;\n object-fit: contain;\n width: 100%;\n height: 100%;\n "]))),
224
212
  src: result === null || result === void 0 ? void 0 : (_result$data = result.data) === null || _result$data === void 0 ? void 0 : (_result$data$data = _result$data.data) === null || _result$data$data === void 0 ? void 0 : (_result$data$data$log = _result$data$data.logo) === null || _result$data$data$log === void 0 ? void 0 : _result$data$data$log.url
225
213
  })), /*#__PURE__*/_react.default.createElement("div", {
226
- style: {
227
- width: 'calc(100% - 590px)'
228
- }
214
+ className: (0, _css.css)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n flex: 1 1 auto;\n width: 0;\n "])))
229
215
  }, /*#__PURE__*/_react.default.createElement(MenuEditor, {
230
216
  sideMenuRef: sideMenuRef
231
217
  }))), /*#__PURE__*/_react.default.createElement("div", {
232
- style: {
233
- position: 'absolute',
234
- height: '100%',
235
- zIndex: 10,
236
- top: 0,
237
- right: 0
238
- }
218
+ className: (0, _css.css)(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n position: relative;\n flex-shrink: 0;\n height: 100%;\n z-index: 10;\n "])))
239
219
  }, /*#__PURE__*/_react.default.createElement(_.RemotePluginManagerToolbar, null), /*#__PURE__*/_react.default.createElement(_.CurrentUser, null)))), /*#__PURE__*/_react.default.createElement("div", {
240
220
  style: {
241
221
  '--side-menu-width': "".concat(sideMenuWidth, "px")
242
222
  },
243
- className: (0, _css.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n width: var(--side-menu-width);\n overflow: hidden;\n flex: 0 0 var(--side-menu-width);\n max-width: var(--side-menu-width);\n min-width: var(--side-menu-width);\n pointer-events: none;\n transition: background-color 0.3s ease 0s, min-width 0.3s ease 0s,\n max-width 0.3s cubic-bezier(0.645, 0.045, 0.355, 1) 0s;\n "])))
223
+ className: (0, _css.css)(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n width: var(--side-menu-width);\n overflow: hidden;\n flex: 0 0 var(--side-menu-width);\n max-width: var(--side-menu-width);\n min-width: var(--side-menu-width);\n pointer-events: none;\n /* transition: background-color 0.3s ease 0s, min-width 0.3s ease 0s,\n max-width 0.3s cubic-bezier(0.645, 0.045, 0.355, 1) 0s; */\n "])))
244
224
  }), /*#__PURE__*/_react.default.createElement(_antd.Layout.Sider, {
245
- className: (0, _css.css)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n height: 100%;\n position: fixed;\n padding-top: 46px;\n left: 0;\n top: 0;\n background: rgba(0, 0, 0, 0);\n z-index: 100;\n "]))),
225
+ className: (0, _css.css)(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n height: 100%;\n position: fixed;\n padding-top: 46px;\n left: 0;\n top: 0;\n background: rgba(0, 0, 0, 0);\n z-index: 100;\n "]))),
246
226
  style: {
247
227
  display: 'none'
248
228
  },
249
229
  theme: 'light',
250
230
  ref: sideMenuRef
251
231
  }), /*#__PURE__*/_react.default.createElement(_antd.Layout.Content, {
252
- className: (0, _css.css)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n position: relative;\n overflow-y: auto;\n height: 100vh;\n max-height: 100vh;\n > div {\n position: relative;\n // z-index: 1;\n }\n .ant-layout-footer {\n position: absolute;\n bottom: 0;\n text-align: center;\n width: 100%;\n z-index: 0;\n padding: 0px 50px;\n }\n "])))
232
+ className: (0, _css.css)(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n position: relative;\n overflow-y: auto;\n height: 100vh;\n max-height: 100vh;\n > div {\n position: relative;\n // z-index: 1;\n }\n .ant-layout-footer {\n position: absolute;\n bottom: 0;\n text-align: center;\n width: 100%;\n z-index: 0;\n padding: 0px 50px;\n }\n "])))
253
233
  }, /*#__PURE__*/_react.default.createElement("header", {
254
- className: (0, _css.css)(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n height: 46px;\n line-height: 46px;\n background: transparent;\n pointer-events: none;\n "])))
234
+ className: (0, _css.css)(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n height: 46px;\n line-height: 46px;\n background: transparent;\n pointer-events: none;\n "])))
255
235
  }), service.contentLoading ? /*#__PURE__*/_react.default.createElement(_antd.Spin, null) : props.children));
256
236
  };
257
237
 
@@ -21,6 +21,12 @@ var _ = require("../..");
21
21
 
22
22
  var _schemaSettings = require("../../../schema-settings");
23
23
 
24
+ var _collectionManager = require("../../../collection-manager");
25
+
26
+ var _recordProvider = require("../../../record-provider");
27
+
28
+ var _FormBlockProvider = require("../../../block-provider/FormBlockProvider");
29
+
24
30
  var _utils = require("./utils");
25
31
 
26
32
  var _excluded = ["modalTip"];
@@ -76,7 +82,7 @@ var MenuGroup = function MenuGroup(props) {
76
82
  };
77
83
 
78
84
  var ActionDesigner = function ActionDesigner(props) {
79
- var _fieldSchema$xCompon, _fieldSchema$xCompon2, _fieldSchema$xCompon3, _fieldSchema$xCompon4, _fieldSchema$xCompon5, _fieldSchema$xCompon6, _fieldSchema$xCompon7, _fieldSchema$xCompon8, _fieldSchema$xAction, _fieldSchema$xAction2, _fieldSchema$xAction3, _fieldSchema$xAction4, _fieldSchema$xAction5, _fieldSchema$xAction6, _fieldSchema$xAction7, _fieldSchema$xAction8, _fieldSchema$xAction9, _fieldSchema$xAction10;
85
+ var _fieldSchema$xAction, _fieldSchema$xCompon, _fieldSchema$xCompon2, _fieldSchema$xCompon3, _fieldSchema$xCompon4, _fieldSchema$xCompon5, _fieldSchema$xCompon6, _fieldSchema$xCompon7, _fieldSchema$xCompon8, _fieldSchema$xAction2, _fieldSchema$xAction3, _fieldSchema$xAction4, _fieldSchema$xAction5, _fieldSchema$xAction6, _fieldSchema$xAction7, _fieldSchema$xAction8, _fieldSchema$xAction9, _fieldSchema$xAction10, _fieldSchema$xAction11;
80
86
 
81
87
  var modalTip = props.modalTip,
82
88
  restProps = _objectWithoutProperties(props, _excluded);
@@ -84,23 +90,25 @@ var ActionDesigner = function ActionDesigner(props) {
84
90
  var field = (0, _react.useField)();
85
91
  var fieldSchema = (0, _react.useFieldSchema)();
86
92
 
93
+ var _useCollection = (0, _collectionManager.useCollection)(),
94
+ name = _useCollection.name;
95
+
87
96
  var _useDesignable = (0, _.useDesignable)(),
88
97
  dn = _useDesignable.dn;
89
98
 
90
99
  var _useTranslation2 = (0, _reactI18next.useTranslation)(),
91
100
  t = _useTranslation2.t;
92
101
 
93
- var compile = (0, _.useCompile)();
94
102
  var isPopupAction = ['create', 'update', 'view', 'customize:popup'].includes(fieldSchema['x-action'] || '');
95
103
  var isUpdateModePopupAction = ['customize:bulkUpdate', 'customize:bulkEdit'].includes(fieldSchema['x-action']);
96
- var context = (0, _.useActionContext)();
97
104
 
98
105
  var _useState = (0, _react2.useState)(),
99
106
  _useState2 = _slicedToArray(_useState, 2),
100
107
  initialSchema = _useState2[0],
101
108
  setInitialSchema = _useState2[1];
102
109
 
103
- var actionType = fieldSchema['x-action'] || '';
110
+ var actionType = (_fieldSchema$xAction = fieldSchema['x-action']) !== null && _fieldSchema$xAction !== void 0 ? _fieldSchema$xAction : '';
111
+ var isLinkageAction = Object.keys((0, _FormBlockProvider.useFormBlockContext)()).length > 0 && Object.keys((0, _recordProvider.useRecord)()).length > 0;
104
112
  (0, _react2.useEffect)(function () {
105
113
  var schemaUid = (0, _shared.uid)();
106
114
  var schema = {
@@ -180,6 +188,8 @@ var ActionDesigner = function ActionDesigner(props) {
180
188
  dn.refresh();
181
189
  }
182
190
  }
191
+ }), isLinkageAction && /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.LinkageRules, {
192
+ collectionName: name
183
193
  }), isPopupAction && /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.SelectItem, {
184
194
  title: t('Open mode'),
185
195
  options: [{
@@ -246,7 +256,7 @@ var ActionDesigner = function ActionDesigner(props) {
246
256
  label: t('All'),
247
257
  value: 'all'
248
258
  }],
249
- value: fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction === void 0 ? void 0 : _fieldSchema$xAction['updateMode'],
259
+ value: fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction2 = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction2 === void 0 ? void 0 : _fieldSchema$xAction2['updateMode'],
250
260
  onChange: function onChange(value) {
251
261
  fieldSchema['x-action-settings']['updateMode'] = value;
252
262
  dn.emit('patch', {
@@ -257,12 +267,12 @@ var ActionDesigner = function ActionDesigner(props) {
257
267
  });
258
268
  dn.refresh();
259
269
  }
260
- }), (0, _shared.isValid)(fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction2 = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction2 === void 0 ? void 0 : _fieldSchema$xAction2.assignedValues) && /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.ActionModalItem, {
270
+ }), (0, _shared.isValid)(fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction3 = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction3 === void 0 ? void 0 : _fieldSchema$xAction3.assignedValues) && /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.ActionModalItem, {
261
271
  title: t('Assign field values'),
262
272
  initialSchema: initialSchema,
263
- initialValues: fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction3 = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction3 === void 0 ? void 0 : _fieldSchema$xAction3.assignedValues,
273
+ initialValues: fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction4 = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction4 === void 0 ? void 0 : _fieldSchema$xAction4.assignedValues,
264
274
  modalTip: tips[actionType],
265
- uid: fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction4 = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction4 === void 0 ? void 0 : _fieldSchema$xAction4.schemaUid,
275
+ uid: fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction5 = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction5 === void 0 ? void 0 : _fieldSchema$xAction5.schemaUid,
266
276
  onSubmit: function onSubmit(assignedValues) {
267
277
  var _schema2;
268
278
 
@@ -272,10 +282,10 @@ var ActionDesigner = function ActionDesigner(props) {
272
282
  });
273
283
  dn.refresh();
274
284
  }
275
- }), (0, _shared.isValid)(fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction5 = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction5 === void 0 ? void 0 : _fieldSchema$xAction5.requestSettings) && /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.ActionModalItem, {
285
+ }), (0, _shared.isValid)(fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction6 = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction6 === void 0 ? void 0 : _fieldSchema$xAction6.requestSettings) && /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.ActionModalItem, {
276
286
  title: t('Request settings'),
277
287
  schema: _utils.requestSettingsSchema,
278
- initialValues: fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction6 = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction6 === void 0 ? void 0 : _fieldSchema$xAction6.requestSettings,
288
+ initialValues: fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction7 = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction7 === void 0 ? void 0 : _fieldSchema$xAction7.requestSettings,
279
289
  onSubmit: function onSubmit(requestSettings) {
280
290
  var _schema3;
281
291
 
@@ -285,9 +295,9 @@ var ActionDesigner = function ActionDesigner(props) {
285
295
  });
286
296
  dn.refresh();
287
297
  }
288
- }), (0, _shared.isValid)(fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction7 = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction7 === void 0 ? void 0 : _fieldSchema$xAction7.skipValidator) && /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.SwitchItem, {
298
+ }), (0, _shared.isValid)(fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction8 = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction8 === void 0 ? void 0 : _fieldSchema$xAction8.skipValidator) && /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.SwitchItem, {
289
299
  title: t('Skip required validation'),
290
- checked: !!(fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction8 = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction8 === void 0 ? void 0 : _fieldSchema$xAction8.skipValidator),
300
+ checked: !!(fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction9 = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction9 === void 0 ? void 0 : _fieldSchema$xAction9.skipValidator),
291
301
  onChange: function onChange(value) {
292
302
  var _schema4;
293
303
 
@@ -296,7 +306,7 @@ var ActionDesigner = function ActionDesigner(props) {
296
306
  schema: (_schema4 = {}, _defineProperty(_schema4, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema4, 'x-action-settings', _objectSpread({}, fieldSchema['x-action-settings'])), _schema4)
297
307
  });
298
308
  }
299
- }), (0, _shared.isValid)(fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction9 = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction9 === void 0 ? void 0 : _fieldSchema$xAction9['onSuccess']) && /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.ModalItem, {
309
+ }), (0, _shared.isValid)(fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction10 = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction10 === void 0 ? void 0 : _fieldSchema$xAction10['onSuccess']) && /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.ModalItem, {
300
310
  title: {
301
311
  'customize:save': t('After successful save'),
302
312
  'customize:update': t('After successful update'),
@@ -304,7 +314,7 @@ var ActionDesigner = function ActionDesigner(props) {
304
314
  'customize:form:request': t('After successful request'),
305
315
  'customize:bulkUpdate': t('After successful bulk update')
306
316
  }[actionType],
307
- initialValues: fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction10 = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction10 === void 0 ? void 0 : _fieldSchema$xAction10['onSuccess'],
317
+ initialValues: fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction11 = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction11 === void 0 ? void 0 : _fieldSchema$xAction11['onSuccess'],
308
318
  schema: {
309
319
  type: 'object',
310
320
  title: {
@@ -27,6 +27,8 @@ var _hooks = require("../../hooks");
27
27
 
28
28
  var _useProps2 = require("../../hooks/useProps");
29
29
 
30
+ var _recordProvider = require("../../../record-provider");
31
+
30
32
  var _Action = _interopRequireDefault(require("./Action.Container"));
31
33
 
32
34
  var _Action2 = require("./Action.Designer");
@@ -43,7 +45,11 @@ var _context = require("./context");
43
45
 
44
46
  var _hooks2 = require("./hooks");
45
47
 
46
- var _excluded = ["popover", "confirm", "containerRefKey", "component", "useAction", "className", "icon", "title"];
48
+ var _2 = require("../../");
49
+
50
+ var _utils = require("./utils");
51
+
52
+ var _excluded = ["popover", "confirm", "openMode", "containerRefKey", "component", "useAction", "className", "icon", "title"];
47
53
 
48
54
  var _templateObject, _templateObject2;
49
55
 
@@ -84,6 +90,7 @@ var Action = (0, _react.observer)(function (props) {
84
90
 
85
91
  var popover = props.popover,
86
92
  confirm = props.confirm,
93
+ om = props.openMode,
87
94
  containerRefKey = props.containerRefKey,
88
95
  component = props.component,
89
96
  _props$useAction = props.useAction,
@@ -115,13 +122,28 @@ var Action = (0, _react.observer)(function (props) {
115
122
  var fieldSchema = (0, _react.useFieldSchema)();
116
123
  var compile = (0, _hooks.useCompile)();
117
124
  var form = (0, _react.useForm)();
125
+ var values = (0, _recordProvider.useRecord)();
118
126
  var designerProps = fieldSchema['x-designer-props'];
119
127
  var openMode = fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xCompon = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon === void 0 ? void 0 : _fieldSchema$xCompon['openMode'];
120
128
  var disabled = form.disabled || field.disabled;
121
129
  var openSize = fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xCompon2 = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon2 === void 0 ? void 0 : _fieldSchema$xCompon2['openSize'];
130
+ var linkageRules = (fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema['x-linkage-rules']) || [];
131
+
132
+ var _useDesignable = (0, _2.useDesignable)(),
133
+ designable = _useDesignable.designable;
134
+
135
+ (0, _react2.useEffect)(function () {
136
+ linkageRules.map(function (v) {
137
+ var _v$actions;
138
+
139
+ return (_v$actions = v.actions) === null || _v$actions === void 0 ? void 0 : _v$actions.map(function (h) {
140
+ (0, _utils.linkageAction)(h.operator, field, v.condition, values, designable);
141
+ });
142
+ });
143
+ }, [linkageRules]);
122
144
 
123
145
  var renderButton = function renderButton() {
124
- var _field$data;
146
+ var _field$data, _field$data2;
125
147
 
126
148
  return /*#__PURE__*/_react2.default.createElement(_common.SortableItem, _objectSpread(_objectSpread({}, others), {}, {
127
149
  loading: field === null || field === void 0 ? void 0 : (_field$data = field.data) === null || _field$data === void 0 ? void 0 : _field$data.loading,
@@ -129,6 +151,9 @@ var Action = (0, _react.observer)(function (props) {
129
151
  type: icon
130
152
  }),
131
153
  disabled: disabled,
154
+ style: {
155
+ border: (field === null || field === void 0 ? void 0 : (_field$data2 = field.data) === null || _field$data2 === void 0 ? void 0 : _field$data2.hidden) && '1px dashed #ede9e9'
156
+ },
132
157
  onClick: function onClick(e) {
133
158
  if (!disabled) {
134
159
  e.preventDefault();
@@ -1,2 +1,3 @@
1
1
  import type { ISchema } from '@formily/react';
2
2
  export declare const requestSettingsSchema: ISchema;
3
+ export declare const linkageAction: (operator: any, field: any, condition: any, values: any, designable: any) => any;
@@ -3,7 +3,14 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.requestSettingsSchema = void 0;
6
+ exports.requestSettingsSchema = exports.linkageAction = void 0;
7
+
8
+ var _lodash = require("lodash");
9
+
10
+ var _uitls = require("../../common/utils/uitls");
11
+
12
+ var _type = require("../../../schema-settings/LinkageRules/type");
13
+
7
14
  var validateJSON = {
8
15
  validator: "{{(value, rule)=> {\n if (!value) {\n return '';\n }\n try {\n const val = JSON.parse(value);\n if(!isNaN(val)) {\n return false;\n }\n return true;\n } catch(error) {\n console.error(error);\n return false;\n }\n }}}",
9
16
  message: '{{t("Invalid JSON format")}}'
@@ -64,4 +71,53 @@ var requestSettingsSchema = {
64
71
  }
65
72
  }
66
73
  };
67
- exports.requestSettingsSchema = requestSettingsSchema;
74
+ exports.requestSettingsSchema = requestSettingsSchema;
75
+
76
+ var linkageAction = function linkageAction(operator, field, condition, values, designable) {
77
+ var displayResult = [field.display];
78
+ var disableResult = [field.disabled];
79
+
80
+ switch (operator) {
81
+ case _type.ActionType.Visible:
82
+ if ((0, _uitls.conditionAnalyse)(condition, values)) {
83
+ displayResult.push(operator);
84
+ }
85
+
86
+ field.display = (0, _lodash.last)(displayResult);
87
+ break;
88
+
89
+ case _type.ActionType.Hidden:
90
+ if ((0, _uitls.conditionAnalyse)(condition, values)) {
91
+ if (!designable) {
92
+ displayResult.push(operator);
93
+ } else {
94
+ field.data = field.data || {};
95
+ field.data.hidden = true;
96
+ }
97
+ }
98
+
99
+ field.display = (0, _lodash.last)(displayResult);
100
+ break;
101
+
102
+ case _type.ActionType.Disabled:
103
+ if ((0, _uitls.conditionAnalyse)(condition, values)) {
104
+ disableResult.push(true);
105
+ }
106
+
107
+ field.disabled = (0, _lodash.last)(disableResult);
108
+ break;
109
+
110
+ case _type.ActionType.Active:
111
+ if ((0, _uitls.conditionAnalyse)(condition, values)) {
112
+ disableResult.push(false);
113
+ }
114
+
115
+ field.disabled = (0, _lodash.last)(disableResult);
116
+ break;
117
+
118
+ default:
119
+ return null;
120
+ }
121
+ };
122
+
123
+ exports.linkageAction = linkageAction;
@@ -41,9 +41,9 @@ var AssociationFilter = function AssociationFilter(props) {
41
41
  exists = _useSchemaInitializer.exists,
42
42
  render = _useSchemaInitializer.render;
43
43
 
44
- return /*#__PURE__*/_react2.default.createElement(_common.SortableItem, {
45
- className: (0, _classnames.default)('nb-block-item', props.className, (0, _css.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n &:hover {\n > .general-schema-designer {\n display: block;\n }\n }\n &.nb-form-item:hover {\n > .general-schema-designer {\n background: rgba(241, 139, 98, 0.06) !important;\n border: 0 !important;\n top: -5px !important;\n bottom: -5px !important;\n left: -5px !important;\n right: -5px !important;\n }\n }\n > .general-schema-designer {\n position: absolute;\n z-index: 999;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: none;\n border: 2px solid rgba(241, 139, 98, 0.3);\n pointer-events: none;\n > .general-schema-designer-icons {\n position: absolute;\n right: 2px;\n top: 2px;\n line-height: 16px;\n pointer-events: all;\n .ant-space-item {\n background-color: #f18b62;\n color: #fff;\n line-height: 16px;\n width: 16px;\n padding-left: 1px;\n }\n }\n }\n "]))))
46
- }, /*#__PURE__*/_react2.default.createElement(Designer, null), props.children, render());
44
+ return /*#__PURE__*/_react2.default.createElement(_common.DndContext, null, /*#__PURE__*/_react2.default.createElement(_common.SortableItem, {
45
+ className: (0, _classnames.default)('nb-block-item', props.className, (0, _css.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n &:hover {\n > .general-schema-designer {\n display: block;\n }\n }\n &.nb-form-item:hover {\n > .general-schema-designer {\n background: rgba(241, 139, 98, 0.06) !important;\n border: 0 !important;\n top: -5px !important;\n bottom: -5px !important;\n left: -5px !important;\n right: -5px !important;\n }\n }\n > .general-schema-designer {\n position: absolute;\n z-index: 999;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: none;\n border: 2px solid rgba(241, 139, 98, 0.3);\n pointer-events: none;\n > .general-schema-designer-icons {\n position: absolute;\n right: 2px;\n top: 2px;\n line-height: 16px;\n pointer-events: all;\n .ant-space-item {\n background-color: #f18b62;\n color: #fff;\n line-height: 16px;\n width: 16px;\n padding-left: 1px;\n }\n }\n }\n "]))))
46
+ }, /*#__PURE__*/_react2.default.createElement(Designer, null), props.children, render()));
47
47
  };
48
48
 
49
49
  exports.AssociationFilter = AssociationFilter;
@@ -4,9 +4,9 @@ export declare type AssociationSelectProps<P = any> = RemoteSelectProps<P> & {
4
4
  action?: string;
5
5
  multiple?: boolean;
6
6
  };
7
- interface RemoteSelectInterface {
7
+ interface AssociationSelectInterface {
8
8
  (props: any): React.ReactElement;
9
9
  Designer: React.FC;
10
10
  }
11
- export declare const AssociationSelect: RemoteSelectInterface;
11
+ export declare const AssociationSelect: AssociationSelectInterface;
12
12
  export default AssociationSelect;
@@ -9,30 +9,73 @@ var _react = require("@formily/react");
9
9
 
10
10
  var _react2 = require("react");
11
11
 
12
+ var _SharedFilterProvider = require("../../../block-provider/SharedFilterProvider");
13
+
12
14
  var _collectionManager = require("../../../collection-manager");
13
15
 
16
+ var _recordProvider = require("../../../record-provider");
17
+
14
18
  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; }
15
19
 
16
20
  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; }
17
21
 
18
22
  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; }
19
23
 
24
+ 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); }
25
+
20
26
  function useServiceOptions(props) {
21
27
  var _props$action = props.action,
22
28
  action = _props$action === void 0 ? 'list' : _props$action,
23
- service = props.service;
29
+ service = props.service,
30
+ fieldNames = props.fieldNames;
31
+ var params = (service === null || service === void 0 ? void 0 : service.params) || {};
24
32
  var fieldSchema = (0, _react.useFieldSchema)();
25
33
 
26
34
  var _useCollection = (0, _collectionManager.useCollection)(),
27
35
  getField = _useCollection.getField;
28
36
 
37
+ var _useCollectionManager = (0, _collectionManager.useCollectionManager)(),
38
+ getCollectionFields = _useCollectionManager.getCollectionFields;
39
+
40
+ var record = (0, _recordProvider.useRecord)();
41
+ var normalizeValues = (0, _react2.useCallback)(function (obj) {
42
+ if (obj && _typeof(obj) === 'object') {
43
+ return obj[fieldNames.value];
44
+ }
45
+
46
+ return obj;
47
+ }, [fieldNames.value]);
48
+ var value = (0, _react2.useMemo)(function () {
49
+ if (props.value === undefined || props.value === null) {
50
+ return;
51
+ }
52
+
53
+ if (Array.isArray(props.value)) {
54
+ return props.value.map(normalizeValues);
55
+ } else {
56
+ return [normalizeValues(props.value)];
57
+ }
58
+ }, [props.value, normalizeValues]);
29
59
  var collectionField = (0, _react2.useMemo)(function () {
30
60
  return getField(fieldSchema.name);
31
61
  }, [fieldSchema.name]);
62
+ var sourceValue = record === null || record === void 0 ? void 0 : record[collectionField === null || collectionField === void 0 ? void 0 : collectionField.sourceKey];
63
+ var filter = (0, _react2.useMemo)(function () {
64
+ var isOToAny = ['oho', 'o2m'].includes(collectionField === null || collectionField === void 0 ? void 0 : collectionField.interface);
65
+ return (0, _SharedFilterProvider.mergeFilter)([(0, _SharedFilterProvider.mergeFilter)([isOToAny ? _defineProperty({}, collectionField.foreignKey, {
66
+ $is: null
67
+ }) : null, params === null || params === void 0 ? void 0 : params.filter]), isOToAny && sourceValue !== undefined && sourceValue !== null ? _defineProperty({}, collectionField.foreignKey, {
68
+ $eq: sourceValue
69
+ }) : null, (params === null || params === void 0 ? void 0 : params.filter) && value ? _defineProperty({}, fieldNames.value, _defineProperty({}, '$in', value)) : null], '$or');
70
+ }, [params === null || params === void 0 ? void 0 : params.filter, getCollectionFields, collectionField, sourceValue, value, fieldNames.value]);
32
71
  return (0, _react2.useMemo)(function () {
33
- return _objectSpread({
72
+ return _objectSpread(_objectSpread({
34
73
  resource: collectionField === null || collectionField === void 0 ? void 0 : collectionField.target,
35
74
  action: action
36
- }, service);
37
- }, [collectionField === null || collectionField === void 0 ? void 0 : collectionField.target, action, service]);
75
+ }, service), {}, {
76
+ params: _objectSpread(_objectSpread({}, service === null || service === void 0 ? void 0 : service.params), {}, {
77
+ filter: filter
78
+ })
79
+ });
80
+ }, [collectionField === null || collectionField === void 0 ? void 0 : collectionField.target, action, filter, service]);
38
81
  }
@@ -31,38 +31,18 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
31
31
 
32
32
  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; }
33
33
 
34
- var useOptions = function useOptions() {
35
- var _fields$filter;
36
-
37
- var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'string';
38
- var compile = (0, _.useCompile)();
39
-
40
- var _useCollection = (0, _collectionManager.useCollection)(),
41
- fields = _useCollection.fields;
42
-
43
- var options = fields === null || fields === void 0 ? void 0 : (_fields$filter = fields.filter(function (field) {
44
- return field.type === type;
45
- })) === null || _fields$filter === void 0 ? void 0 : _fields$filter.map(function (field) {
46
- var _field$uiSchema;
47
-
48
- return {
49
- value: field.name,
50
- label: compile(field === null || field === void 0 ? void 0 : (_field$uiSchema = field.uiSchema) === null || _field$uiSchema === void 0 ? void 0 : _field$uiSchema.title)
51
- };
52
- });
53
- return options;
54
- };
55
-
56
34
  var CalendarDesigner = function CalendarDesigner() {
57
35
  var _fieldSchema$xDecora, _fieldSchema$xDecora$, _fieldSchema$xDecora2, _fieldSchema$xDecora3;
58
36
 
59
37
  var field = (0, _react.useField)();
60
38
  var fieldSchema = (0, _react.useFieldSchema)();
61
39
 
62
- var _useCollection2 = (0, _collectionManager.useCollection)(),
63
- name = _useCollection2.name,
64
- title = _useCollection2.title,
65
- fields = _useCollection2.fields;
40
+ var _useCollection = (0, _collectionManager.useCollection)(),
41
+ name = _useCollection.name,
42
+ title = _useCollection.title;
43
+
44
+ var _useCollectionManager = (0, _collectionManager.useCollectionManager)(),
45
+ getCollectionFieldsOptions = _useCollectionManager.getCollectionFieldsOptions;
66
46
 
67
47
  var dataSource = (0, _actionHooks.useCollectionFilterOptions)(name);
68
48
 
@@ -72,8 +52,6 @@ var CalendarDesigner = function CalendarDesigner() {
72
52
  var _useDesignable = (0, _.useDesignable)(),
73
53
  dn = _useDesignable.dn;
74
54
 
75
- var compile = (0, _.useCompile)();
76
-
77
55
  var _useTranslation = (0, _reactI18next.useTranslation)(),
78
56
  t = _useTranslation.t;
79
57
 
@@ -87,7 +65,7 @@ var CalendarDesigner = function CalendarDesigner() {
87
65
  }, /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.BlockTitleItem, null), /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.SelectItem, {
88
66
  title: t('Title field'),
89
67
  value: fieldNames.title,
90
- options: useOptions('string'),
68
+ options: getCollectionFieldsOptions(name, 'string'),
91
69
  onChange: function onChange(title) {
92
70
  var _schema;
93
71
 
@@ -116,10 +94,12 @@ var CalendarDesigner = function CalendarDesigner() {
116
94
  });
117
95
  dn.refresh();
118
96
  }
119
- }), /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.SelectItem, {
97
+ }), /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.CascaderItem, {
120
98
  title: t('Start date field'),
121
99
  value: fieldNames.start,
122
- options: useOptions('date'),
100
+ options: getCollectionFieldsOptions(name, 'date', {
101
+ association: ['o2o', 'obo', 'oho', 'm2o']
102
+ }),
123
103
  onChange: function onChange(start) {
124
104
  var _schema3;
125
105
 
@@ -133,10 +113,12 @@ var CalendarDesigner = function CalendarDesigner() {
133
113
  });
134
114
  dn.refresh();
135
115
  }
136
- }), /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.SelectItem, {
116
+ }), /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.CascaderItem, {
137
117
  title: t('End date field'),
138
118
  value: fieldNames.end,
139
- options: useOptions('date'),
119
+ options: getCollectionFieldsOptions(name, 'date', {
120
+ association: ['o2o', 'obo', 'oho', 'm2o']
121
+ }),
140
122
  onChange: function onChange(end) {
141
123
  var _schema4;
142
124
 
@@ -36,17 +36,18 @@ var Checkbox = (0, _react.connect)(function (props) {
36
36
  }, (0, _react.mapProps)({
37
37
  value: 'checked',
38
38
  onInput: 'onChange'
39
- }, function (props, field) {
40
- // console.log({ props, field });
41
- return _objectSpread({}, props);
42
39
  }), (0, _react.mapReadPretty)(function (props) {
43
- if (!(0, _shared.isValid)(props.value)) {
44
- return null;
40
+ if (props.value) {
41
+ return /*#__PURE__*/_react2.default.createElement(_icons.CheckOutlined, {
42
+ style: {
43
+ color: '#52c41a'
44
+ }
45
+ });
45
46
  }
46
47
 
47
- return props.value ? /*#__PURE__*/_react2.default.createElement(_icons.CheckOutlined, {
48
+ return props.showUnchecked ? /*#__PURE__*/_react2.default.createElement(_icons.CloseOutlined, {
48
49
  style: {
49
- color: '#52c41a'
50
+ color: '#ff4d4f'
50
51
  }
51
52
  }) : null;
52
53
  }));
@@ -5,4 +5,4 @@ export interface Moment2strOptions {
5
5
  picker?: 'year' | 'month' | 'week' | 'quarter';
6
6
  }
7
7
  export declare const moment2str: (value?: moment.Moment | moment.Moment[], options?: Moment2strOptions) => string | string[] | moment.Moment | moment.Moment[];
8
- export declare const mapDateFormat: () => (props: any) => any;
8
+ export declare const mapDateFormat: () => (props: any, field: any) => any;
@@ -73,7 +73,7 @@ var moment2str = function moment2str(value) {
73
73
  exports.moment2str = moment2str;
74
74
 
75
75
  var mapDateFormat = function mapDateFormat() {
76
- return function (props) {
76
+ return function (props, field) {
77
77
  var format = (0, _client.getDefaultFormat)(props);
78
78
  var _onChange = props.onChange;
79
79
  return _objectSpread(_objectSpread({}, props), {}, {
@@ -81,7 +81,8 @@ var VariableCascader = (0, _react.connect)(function (props) {
81
81
 
82
82
  var DynamicComponent = function DynamicComponent(props) {
83
83
  var _useContext = (0, _react2.useContext)(_context.FilterContext),
84
- dynamicComponent = _useContext.dynamicComponent;
84
+ dynamicComponent = _useContext.dynamicComponent,
85
+ disabled = _useContext.disabled;
85
86
 
86
87
  var component = (0, _hooks.useComponent)(dynamicComponent);
87
88
  var form = (0, _react2.useMemo)(function () {
@@ -89,6 +90,7 @@ var DynamicComponent = function DynamicComponent(props) {
89
90
  values: {
90
91
  value: props.value
91
92
  },
93
+ disabled: disabled,
92
94
  effects: function effects() {
93
95
  (0, _core.onFieldValueChange)('value', function (field) {
94
96
  var _props$onChange;