@nocobase/client 0.10.0-alpha.2 → 0.10.0-alpha.3

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 (194) hide show
  1. package/es/acl/Configuration/MenuItemsProvider.js +3 -3
  2. package/es/application/Application.js +2 -2
  3. package/es/auth/SigninPage.js +12 -9
  4. package/es/collection-manager/Configuration/AddCollectionAction.js +31 -25
  5. package/es/collection-manager/Configuration/AddFieldAction.js +45 -32
  6. package/es/collection-manager/Configuration/AddSubFieldAction.js +24 -19
  7. package/es/collection-manager/Configuration/ConfigurationTabs.js +57 -50
  8. package/es/collection-manager/hooks/useOptions.js +39 -36
  9. package/es/collection-manager/interfaces/integer.js +1 -1
  10. package/es/collection-manager/interfaces/number.js +3 -3
  11. package/es/collection-manager/interfaces/percent.js +3 -3
  12. package/es/formula/Expression.js +66 -46
  13. package/es/hooks/index.d.ts +1 -0
  14. package/es/hooks/index.js +1 -0
  15. package/es/hooks/useAdminSchemaUid.d.ts +1 -0
  16. package/es/hooks/useAdminSchemaUid.js +6 -0
  17. package/es/hooks/useMenuItem.d.ts +37 -0
  18. package/es/hooks/useMenuItem.js +90 -0
  19. package/es/index.d.ts +2 -3
  20. package/es/index.js +3 -4
  21. package/es/locale/en_US.d.ts +3 -1
  22. package/es/locale/en_US.js +4 -2
  23. package/es/locale/es_ES.d.ts +1 -1
  24. package/es/locale/es_ES.js +1 -1
  25. package/es/locale/ja_JP.d.ts +3 -1
  26. package/es/locale/ja_JP.js +4 -2
  27. package/es/locale/pt_BR.d.ts +1 -1
  28. package/es/locale/pt_BR.js +1 -1
  29. package/es/locale/ru_RU.d.ts +1 -1
  30. package/es/locale/ru_RU.js +1 -1
  31. package/es/locale/zh_CN.d.ts +3 -1
  32. package/es/locale/zh_CN.js +3 -1
  33. package/es/pm/Card.js +5 -5
  34. package/es/pm/PluginManagerLink.js +16 -12
  35. package/es/pm/index.d.ts +2 -1
  36. package/es/pm/index.js +36 -22
  37. package/es/route-switch/antd/admin-layout/index.js +4 -4
  38. package/es/schema-component/antd/action/Action.Designer.js +3 -5
  39. package/es/schema-component/antd/action/Action.Drawer.js +1 -1
  40. package/es/schema-component/antd/action/ActionBar.js +1 -1
  41. package/es/schema-component/antd/association-field/SubTable.js +1 -1
  42. package/es/schema-component/antd/calendar/DeleteEvent.js +1 -1
  43. package/es/schema-component/antd/cascader/Cascader.js +1 -1
  44. package/es/schema-component/antd/form-item/FormItem.js +10 -3
  45. package/es/schema-component/antd/grid-card/GridCard.Designer.js +3 -4
  46. package/es/schema-component/antd/index.less +1 -3
  47. package/es/schema-component/antd/menu/Menu.js +306 -156
  48. package/es/schema-component/antd/page/Page.js +29 -23
  49. package/es/schema-component/antd/remote-select/RemoteSelect.js +58 -10
  50. package/es/schema-component/antd/remote-select/utils.d.ts +4 -0
  51. package/es/schema-component/antd/remote-select/utils.js +31 -0
  52. package/es/schema-component/antd/table-v2/FilterDynamicComponent.js +17 -2
  53. package/es/schema-component/antd/table-v2/Table.Column.Designer.js +51 -12
  54. package/es/schema-component/antd/table-v2/Table.js +9 -7
  55. package/es/schema-component/antd/tabs/Tabs.js +35 -22
  56. package/es/schema-component/antd/tabs/context.d.ts +1 -1
  57. package/es/schema-component/antd/upload/ReadPretty.js +7 -3
  58. package/es/schema-component/antd/variable/VariableSelect.js +1 -1
  59. package/es/schema-component/common/utils/uitls.d.ts +1 -0
  60. package/es/schema-component/common/utils/uitls.js +1 -1
  61. package/es/schema-initializer/SchemaInitializer.d.ts +7 -2
  62. package/es/schema-initializer/SchemaInitializer.js +155 -102
  63. package/es/schema-initializer/SelectCollection.d.ts +1 -2
  64. package/es/schema-initializer/SelectCollection.js +19 -16
  65. package/es/schema-initializer/buttons/TableActionColumnInitializers.js +1 -1
  66. package/es/schema-initializer/buttons/TableActionInitializers.js +5 -5
  67. package/es/schema-initializer/buttons/TableColumnInitializers.js +3 -2
  68. package/es/schema-initializer/components/CreateRecordAction.js +37 -27
  69. package/es/schema-initializer/components/assigned-field/AssignedField.js +2 -1
  70. package/es/schema-initializer/items/CalendarBlockInitializer.js +2 -2
  71. package/es/schema-initializer/utils.d.ts +0 -1
  72. package/es/schema-initializer/utils.js +40 -25
  73. package/es/schema-settings/SchemaSettings.js +123 -46
  74. package/es/schema-settings/VariableInput/hooks/useFormVariable.d.ts +19 -0
  75. package/es/schema-settings/VariableInput/hooks/useFormVariable.js +89 -0
  76. package/es/schema-settings/VariableInput/hooks/useIterationVariable.d.ts +8 -0
  77. package/es/schema-settings/VariableInput/hooks/useIterationVariable.js +77 -0
  78. package/es/schema-settings/VariableInput/hooks/useVariableOptions.d.ts +5 -12
  79. package/es/schema-settings/VariableInput/hooks/useVariableOptions.js +19 -3
  80. package/es/schema-templates/BlockTemplateDetails.js +5 -1
  81. package/es/schema-templates/BlockTemplatePage.js +4 -1
  82. package/es/user/ChangePassword.d.ts +1 -2
  83. package/es/user/ChangePassword.js +30 -26
  84. package/es/user/CurrentUser.js +172 -141
  85. package/es/user/EditProfile.d.ts +1 -2
  86. package/es/user/EditProfile.js +30 -24
  87. package/es/user/LanguageSettings.d.ts +1 -2
  88. package/es/user/LanguageSettings.js +67 -64
  89. package/es/user/SigninPage.js +25 -22
  90. package/es/user/SwitchRole.d.ts +1 -2
  91. package/es/user/SwitchRole.js +54 -49
  92. package/es/user/ThemeSettings.d.ts +1 -2
  93. package/es/user/ThemeSettings.js +56 -52
  94. package/lib/acl/Configuration/MenuItemsProvider.js +3 -3
  95. package/lib/application/Application.js +2 -2
  96. package/lib/auth/SigninPage.js +25 -22
  97. package/lib/collection-manager/Configuration/AddCollectionAction.js +29 -23
  98. package/lib/collection-manager/Configuration/AddFieldAction.js +43 -30
  99. package/lib/collection-manager/Configuration/AddSubFieldAction.js +22 -17
  100. package/lib/collection-manager/Configuration/ConfigurationTabs.js +57 -49
  101. package/lib/collection-manager/hooks/useOptions.js +39 -36
  102. package/lib/collection-manager/interfaces/integer.js +1 -1
  103. package/lib/collection-manager/interfaces/number.js +3 -3
  104. package/lib/collection-manager/interfaces/percent.js +3 -3
  105. package/lib/formula/Expression.js +64 -44
  106. package/lib/hooks/index.d.ts +1 -0
  107. package/lib/hooks/index.js +11 -0
  108. package/lib/hooks/useAdminSchemaUid.d.ts +1 -0
  109. package/lib/hooks/useAdminSchemaUid.js +13 -0
  110. package/lib/hooks/useMenuItem.d.ts +37 -0
  111. package/lib/hooks/useMenuItem.js +104 -0
  112. package/lib/index.d.ts +2 -3
  113. package/lib/index.js +22 -33
  114. package/lib/locale/en_US.d.ts +3 -1
  115. package/lib/locale/en_US.js +4 -2
  116. package/lib/locale/es_ES.d.ts +1 -1
  117. package/lib/locale/es_ES.js +1 -1
  118. package/lib/locale/ja_JP.d.ts +3 -1
  119. package/lib/locale/ja_JP.js +4 -2
  120. package/lib/locale/pt_BR.d.ts +1 -1
  121. package/lib/locale/pt_BR.js +1 -1
  122. package/lib/locale/ru_RU.d.ts +1 -1
  123. package/lib/locale/ru_RU.js +1 -1
  124. package/lib/locale/zh_CN.d.ts +3 -1
  125. package/lib/locale/zh_CN.js +3 -1
  126. package/lib/pm/Card.js +6 -6
  127. package/lib/pm/PluginManagerLink.js +15 -10
  128. package/lib/pm/index.d.ts +2 -1
  129. package/lib/pm/index.js +37 -23
  130. package/lib/route-switch/antd/admin-layout/index.js +3 -3
  131. package/lib/schema-component/antd/action/Action.Designer.js +2 -4
  132. package/lib/schema-component/antd/action/Action.Drawer.js +1 -1
  133. package/lib/schema-component/antd/association-field/SubTable.js +1 -1
  134. package/lib/schema-component/antd/calendar/DeleteEvent.js +1 -1
  135. package/lib/schema-component/antd/cascader/Cascader.js +1 -1
  136. package/lib/schema-component/antd/form-item/FormItem.js +10 -3
  137. package/lib/schema-component/antd/grid-card/GridCard.Designer.js +4 -5
  138. package/lib/schema-component/antd/index.less +1 -3
  139. package/lib/schema-component/antd/menu/Menu.js +304 -154
  140. package/lib/schema-component/antd/page/Page.js +29 -23
  141. package/lib/schema-component/antd/remote-select/RemoteSelect.js +55 -7
  142. package/lib/schema-component/antd/remote-select/utils.d.ts +4 -0
  143. package/lib/schema-component/antd/remote-select/utils.js +41 -0
  144. package/lib/schema-component/antd/table-v2/FilterDynamicComponent.js +17 -2
  145. package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +50 -11
  146. package/lib/schema-component/antd/table-v2/Table.js +9 -7
  147. package/lib/schema-component/antd/tabs/Tabs.js +34 -21
  148. package/lib/schema-component/antd/tabs/context.d.ts +1 -1
  149. package/lib/schema-component/antd/upload/ReadPretty.js +7 -3
  150. package/lib/schema-component/antd/variable/VariableSelect.js +1 -1
  151. package/lib/schema-component/common/utils/uitls.d.ts +1 -0
  152. package/lib/schema-component/common/utils/uitls.js +3 -1
  153. package/lib/schema-initializer/SchemaInitializer.d.ts +7 -2
  154. package/lib/schema-initializer/SchemaInitializer.js +154 -101
  155. package/lib/schema-initializer/SelectCollection.d.ts +1 -2
  156. package/lib/schema-initializer/SelectCollection.js +22 -17
  157. package/lib/schema-initializer/buttons/TableActionColumnInitializers.js +1 -1
  158. package/lib/schema-initializer/buttons/TableActionInitializers.js +5 -5
  159. package/lib/schema-initializer/buttons/TableColumnInitializers.js +2 -1
  160. package/lib/schema-initializer/components/CreateRecordAction.js +35 -25
  161. package/lib/schema-initializer/components/assigned-field/AssignedField.js +2 -1
  162. package/lib/schema-initializer/items/CalendarBlockInitializer.js +9 -9
  163. package/lib/schema-initializer/utils.d.ts +0 -1
  164. package/lib/schema-initializer/utils.js +41 -25
  165. package/lib/schema-settings/SchemaSettings.js +122 -45
  166. package/lib/schema-settings/VariableInput/hooks/useFormVariable.d.ts +19 -0
  167. package/lib/schema-settings/VariableInput/hooks/useFormVariable.js +96 -0
  168. package/lib/schema-settings/VariableInput/hooks/useIterationVariable.d.ts +8 -0
  169. package/lib/schema-settings/VariableInput/hooks/useIterationVariable.js +84 -0
  170. package/lib/schema-settings/VariableInput/hooks/useVariableOptions.d.ts +5 -12
  171. package/lib/schema-settings/VariableInput/hooks/useVariableOptions.js +19 -3
  172. package/lib/schema-templates/BlockTemplateDetails.js +5 -1
  173. package/lib/schema-templates/BlockTemplatePage.js +5 -2
  174. package/lib/user/ChangePassword.d.ts +1 -2
  175. package/lib/user/ChangePassword.js +30 -26
  176. package/lib/user/CurrentUser.js +166 -135
  177. package/lib/user/EditProfile.d.ts +1 -2
  178. package/lib/user/EditProfile.js +31 -25
  179. package/lib/user/LanguageSettings.d.ts +1 -2
  180. package/lib/user/LanguageSettings.js +66 -63
  181. package/lib/user/SigninPage.js +25 -22
  182. package/lib/user/SwitchRole.d.ts +1 -2
  183. package/lib/user/SwitchRole.js +57 -51
  184. package/lib/user/ThemeSettings.d.ts +1 -2
  185. package/lib/user/ThemeSettings.js +59 -54
  186. package/package.json +9 -8
  187. package/es/settings-form/SettingsForm.d.ts +0 -13
  188. package/es/settings-form/SettingsForm.js +0 -309
  189. package/es/settings-form/index.d.ts +0 -1
  190. package/es/settings-form/index.js +0 -1
  191. package/lib/settings-form/SettingsForm.d.ts +0 -13
  192. package/lib/settings-form/SettingsForm.js +0 -320
  193. package/lib/settings-form/index.d.ts +0 -1
  194. package/lib/settings-form/index.js +0 -16
package/es/pm/index.js CHANGED
@@ -9,9 +9,10 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
9
9
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
10
10
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
11
11
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
12
+ import { PageHeader } from '@ant-design/pro-layout';
12
13
  import { css } from '@emotion/css';
13
- import { Layout, Menu, PageHeader, Result, Spin, Tabs } from 'antd';
14
- import { sortBy } from 'lodash';
14
+ import { Layout, Menu, Result, Spin, Tabs } from 'antd';
15
+ import _, { sortBy } from 'lodash';
15
16
  import React, { createContext, useContext, useEffect, useMemo } from 'react';
16
17
  import { useTranslation } from 'react-i18next';
17
18
  import { Navigate, useNavigate, useParams } from 'react-router-dom';
@@ -109,23 +110,28 @@ var PluginList = function PluginList(props) {
109
110
  }
110
111
  }, []);
111
112
  return snippets.includes('pm') ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(PageHeader, {
113
+ style: {
114
+ backgroundColor: 'white',
115
+ paddingBottom: 0
116
+ },
112
117
  ghost: false,
113
118
  title: t('Plugin manager'),
114
119
  footer: /*#__PURE__*/React.createElement(Tabs, {
115
120
  activeKey: tabName,
116
121
  onChange: function onChange(activeKey) {
117
122
  navigate("/admin/pm/list/".concat(activeKey));
118
- }
119
- }, /*#__PURE__*/React.createElement(Tabs.TabPane, {
120
- tab: t('Local'),
121
- key: 'local'
122
- }), /*#__PURE__*/React.createElement(Tabs.TabPane, {
123
- tab: t('Built-in'),
124
- key: 'built-in'
125
- }), /*#__PURE__*/React.createElement(Tabs.TabPane, {
126
- tab: t('Marketplace'),
127
- key: 'marketplace'
128
- }))
123
+ },
124
+ items: [{
125
+ key: 'local',
126
+ label: t('Local')
127
+ }, {
128
+ key: 'built-in',
129
+ label: t('Built-in')
130
+ }, {
131
+ key: 'marketplace',
132
+ label: t('Marketplace')
133
+ }]
134
+ })
129
135
  }), /*#__PURE__*/React.createElement("div", {
130
136
  className: 'm24',
131
137
  style: {
@@ -190,7 +196,7 @@ var settings = {
190
196
  }
191
197
  }
192
198
  };
193
- export var getPluginsTabs = function getPluginsTabs(items, snippets) {
199
+ export var getPluginsTabs = _.memoize(function (items, snippets) {
194
200
  var pluginsTabs = Object.keys(items).map(function (plugin) {
195
201
  var tabsObj = items[plugin].tabs;
196
202
  var tabs = sortBy(Object.keys(tabsObj).map(function (tab) {
@@ -213,7 +219,7 @@ export var getPluginsTabs = function getPluginsTabs(items, snippets) {
213
219
  return sortBy(pluginsTabs, function (o) {
214
220
  return !o.isAllow;
215
221
  });
216
- };
222
+ });
217
223
  var SettingsCenter = function SettingsCenter(props) {
218
224
  var _activePlugin$tabs$fi, _items$pluginName2, _items$pluginName2$ta, _items$pluginName2$ta2, _items$pluginName3, _plugin$tabs;
219
225
  var _useACLRoleContext2 = useACLRoleContext(),
@@ -289,19 +295,27 @@ var SettingsCenter = function SettingsCenter(props) {
289
295
  },
290
296
  items: menuItems
291
297
  })), /*#__PURE__*/React.createElement(Layout.Content, null, aclPluginTabCheck && /*#__PURE__*/React.createElement(PageHeader, {
298
+ style: {
299
+ backgroundColor: 'white',
300
+ paddingBottom: 0
301
+ },
292
302
  ghost: false,
293
303
  title: compile((_items$pluginName3 = items[pluginName]) === null || _items$pluginName3 === void 0 ? void 0 : _items$pluginName3.title),
294
304
  footer: /*#__PURE__*/React.createElement(Tabs, {
295
305
  activeKey: tabName,
296
306
  onChange: function onChange(activeKey) {
297
307
  navigate("/admin/settings/".concat(pluginName, "/").concat(activeKey));
298
- }
299
- }, (_plugin$tabs = plugin.tabs) === null || _plugin$tabs === void 0 ? void 0 : _plugin$tabs.map(function (tab) {
300
- return tab.isAllow && /*#__PURE__*/React.createElement(Tabs.TabPane, {
301
- tab: compile(tab === null || tab === void 0 ? void 0 : tab.title),
302
- key: tab.key
303
- });
304
- }))
308
+ },
309
+ items: (_plugin$tabs = plugin.tabs) === null || _plugin$tabs === void 0 ? void 0 : _plugin$tabs.map(function (tab) {
310
+ if (!tab.isAllow) {
311
+ return null;
312
+ }
313
+ return {
314
+ label: compile(tab === null || tab === void 0 ? void 0 : tab.title),
315
+ key: tab.key
316
+ };
317
+ })
318
+ })
305
319
  }), /*#__PURE__*/React.createElement("div", {
306
320
  className: 'm24',
307
321
  style: {
@@ -16,7 +16,7 @@ import { css } from '@emotion/css';
16
16
  import { Layout, Spin } from 'antd';
17
17
  import React, { createContext, useContext, useEffect, useMemo, useRef, useState } from 'react';
18
18
  import { Outlet, useNavigate, useParams } from 'react-router-dom';
19
- import { ACLRolesCheckProvider, CurrentAppInfoProvider, CurrentUser, CurrentUserProvider, PinnedPluginList, RemoteCollectionManagerProvider, RemoteSchemaTemplateManagerProvider, SchemaComponent, findByUid, findMenuItem, useACLRoleContext, useDocumentTitle, useRequest, useRoute, useSystemSettings } from '../../../';
19
+ import { ACLRolesCheckProvider, CurrentAppInfoProvider, CurrentUser, CurrentUserProvider, PinnedPluginList, RemoteCollectionManagerProvider, RemoteSchemaTemplateManagerProvider, SchemaComponent, findByUid, findMenuItem, useACLRoleContext, useAdminSchemaUid, useDocumentTitle, useRequest, useSystemSettings } from '../../../';
20
20
  import { useCollectionManager } from '../../../collection-manager';
21
21
  var filterByACL = function filterByACL(schema, options) {
22
22
  var allowAll = options.allowAll,
@@ -60,7 +60,6 @@ var MenuEditor = function MenuEditor(props) {
60
60
  var defaultSelectedUid = params.name;
61
61
  var sideMenuRef = props.sideMenuRef;
62
62
  var ctx = useACLRoleContext();
63
- var route = useRoute();
64
63
  var _useState = useState(null),
65
64
  _useState2 = _slicedToArray(_useState, 2),
66
65
  current = _useState2[0],
@@ -72,10 +71,11 @@ var MenuEditor = function MenuEditor(props) {
72
71
  setCurrent(schema);
73
72
  navigate("/admin/".concat(schema['x-uid']));
74
73
  };
74
+ var adminSchemaUid = useAdminSchemaUid();
75
75
  var _useRequest = useRequest({
76
- url: "/uiSchemas:getJsonSchema/".concat(route.uiSchemaUid)
76
+ url: "/uiSchemas:getJsonSchema/".concat(adminSchemaUid)
77
77
  }, {
78
- refreshDeps: [route.uiSchemaUid],
78
+ refreshDeps: [adminSchemaUid],
79
79
  onSuccess: function onSuccess(data) {
80
80
  var schema = filterByACL(data === null || data === void 0 ? void 0 : data.data, ctx);
81
81
  // url 为 `/admin` 的情况
@@ -15,7 +15,7 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
15
15
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
16
16
  import { connect, mapProps, useField, useFieldSchema } from '@formily/react';
17
17
  import { isValid, uid } from '@formily/shared';
18
- import { Tree as AntdTree, Menu } from 'antd';
18
+ import { Tree as AntdTree } from 'antd';
19
19
  import { cloneDeep } from 'lodash';
20
20
  import React, { useEffect, useState } from 'react';
21
21
  import { useTranslation } from 'react-i18next';
@@ -49,7 +49,7 @@ var MenuGroup = function MenuGroup(props) {
49
49
  if (!['customize:popup', 'customize:update', 'customize:save', 'customize:table:request', 'customize:form:request'].includes(actionType)) {
50
50
  return /*#__PURE__*/React.createElement(React.Fragment, null, props.children);
51
51
  }
52
- return /*#__PURE__*/React.createElement(Menu.ItemGroup, {
52
+ return /*#__PURE__*/React.createElement(SchemaSettings.ItemGroup, {
53
53
  title: "".concat(t('Customize'), " > ").concat(actionTitles[actionType])
54
54
  }, props.children);
55
55
  };
@@ -63,9 +63,7 @@ export var ActionDesigner = function ActionDesigner(props) {
63
63
  var _useCollection = useCollection(),
64
64
  name = _useCollection.name;
65
65
  var _useCollectionManager = useCollectionManager(),
66
- getChildrenCollections = _useCollectionManager.getChildrenCollections,
67
- getCollection = _useCollectionManager.getCollection,
68
- getCollectionField = _useCollectionManager.getCollectionField;
66
+ getChildrenCollections = _useCollectionManager.getChildrenCollections;
69
67
  var _useDesignable = useDesignable(),
70
68
  dn = _useDesignable.dn;
71
69
  var _useTranslation2 = useTranslation(),
@@ -45,7 +45,7 @@ export var ActionDrawer = observer(function (props) {
45
45
  width: openSizeWidthMap.get(openSize),
46
46
  title: field.title
47
47
  }, others), drawerProps), modalProps), {}, {
48
- style: _objectSpread(_objectSpread({}, drawerProps === null || drawerProps === void 0 ? void 0 : drawerProps.style), others === null || others === void 0 ? void 0 : others.style),
48
+ rootStyle: _objectSpread(_objectSpread({}, drawerProps === null || drawerProps === void 0 ? void 0 : drawerProps.style), others === null || others === void 0 ? void 0 : others.style),
49
49
  destroyOnClose: true,
50
50
  open: visible,
51
51
  onClose: function onClose() {
@@ -9,7 +9,7 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
9
9
  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; }
10
10
  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; }
11
11
  import { cx } from '@emotion/css';
12
- import { observer, RecursionField, useFieldSchema } from '@formily/react';
12
+ import { RecursionField, observer, useFieldSchema } from '@formily/react';
13
13
  import { Space } from 'antd';
14
14
  import React, { useContext } from 'react';
15
15
  import { createPortal } from 'react-dom';
@@ -35,7 +35,7 @@ export var SubTable = observer(function (props) {
35
35
  return /*#__PURE__*/React.createElement("div", {
36
36
  className: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ant-table-footer {\n padding: 0 !important;\n }\n .ant-formily-item-error-help {\n display: none;\n }\n .ant-description-textarea {\n line-height: 34px;\n }\n .ant-table-cell .ant-formily-item-error-help {\n display: block;\n position: absolute;\n font-size: 12px;\n top: 100%;\n background: #fff;\n width: 100%;\n margin-top: 3px;\n padding: 3px;\n z-index: 1;\n border-radius: 3px;\n box-shadow: 0 0 10px #eee;\n animation: none;\n transform: translateY(0);\n opacity: 1;\n }\n "])))
37
37
  }, /*#__PURE__*/React.createElement(Table, {
38
- className: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .ant-select-selector {\n /* min-height: 31px; */\n }\n .ant-formily-item.ant-formily-item-feedback-layout-loose {\n margin-bottom: 0px !important;\n }\n .ant-formily-editable {\n vertical-align: sub;\n }\n .ant-table table {\n }\n td:not(.ant-table-selection-column) {\n padding: 0 !important;\n }\n "]))),
38
+ className: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .ant-select-selector {\n /* min-height: 31px; */\n }\n .ant-formily-item.ant-formily-item-feedback-layout-loose {\n margin-bottom: 0px !important;\n }\n .ant-formily-editable {\n vertical-align: sub;\n }\n .ant-table table {\n }\n td:not(.ant-table-selection-column) {\n padding: 5px !important;\n }\n "]))),
39
39
  bordered: true,
40
40
  size: 'small',
41
41
  field: field,
@@ -94,7 +94,7 @@ export var DeleteEvent = observer(function () {
94
94
  t = _useTranslation.t;
95
95
  return /*#__PURE__*/createPortal( /*#__PURE__*/React.createElement(Modal, {
96
96
  title: cron ? t('Delete events') : null,
97
- visible: visible,
97
+ open: visible,
98
98
  onCancel: function onCancel() {
99
99
  return setVisible(false);
100
100
  },
@@ -76,7 +76,7 @@ export var Cascader = connect(function (props) {
76
76
  }));
77
77
  };
78
78
  var handelDropDownVisible = function handelDropDownVisible(value) {
79
- if (value && !field.dataSource) {
79
+ if (value && !field.dataSource.length) {
80
80
  run();
81
81
  }
82
82
  };
@@ -83,6 +83,7 @@ FormItem.Designer = function Designer() {
83
83
  getField = _useCollection.getField;
84
84
  var _useFormBlockContext = useFormBlockContext(),
85
85
  form = _useFormBlockContext.form;
86
+ var ctx = useBlockRequestContext();
86
87
  var field = useField();
87
88
  var fieldSchema = useFieldSchema();
88
89
  var _useTranslation = useTranslation(),
@@ -399,12 +400,15 @@ FormItem.Designer = function Designer() {
399
400
  properties: {
400
401
  filter: {
401
402
  default: defaultFilter,
402
- // title: '数据范围',
403
403
  enum: dataSource,
404
404
  'x-component': 'Filter',
405
405
  'x-component-props': {
406
406
  dynamicComponent: function dynamicComponent(props) {
407
- return FilterDynamicComponent(_objectSpread({}, props));
407
+ return FilterDynamicComponent(_objectSpread(_objectSpread({}, props), {}, {
408
+ form: form,
409
+ collectionField: collectionField,
410
+ rootCollection: ctx.props.collection || ctx.props.resource
411
+ }));
408
412
  }
409
413
  }
410
414
  }
@@ -416,7 +420,6 @@ FormItem.Designer = function Designer() {
416
420
  filter = removeNullCondition(filter);
417
421
  _.set(field.componentProps, 'service.params.filter', filter);
418
422
  fieldSchema['x-component-props'] = field.componentProps;
419
- field.componentProps = field.componentProps;
420
423
  dn.emit('patch', {
421
424
  schema: (_schema5 = {}, _defineProperty(_schema5, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema5, 'x-component-props', field.componentProps), _schema5)
422
425
  });
@@ -778,6 +781,10 @@ FormItem.Designer = function Designer() {
778
781
  export function isFileCollection(collection) {
779
782
  return (collection === null || collection === void 0 ? void 0 : collection.template) === 'file';
780
783
  }
784
+ function extractFirstPart(path) {
785
+ var firstDotIndex = path.indexOf('.');
786
+ return firstDotIndex !== -1 ? path.slice(0, firstDotIndex) : path;
787
+ }
781
788
  FormItem.FilterFormDesigner = FilterFormDesigner;
782
789
  export function getFieldDefaultValue(fieldSchema, collectionField) {
783
790
  var _fieldSchema$default, _collectionField$uiSc5;
@@ -4,21 +4,20 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
5
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
6
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
- import { useFieldSchema, useField } from '@formily/react';
8
- import React, { useMemo } from 'react';
9
7
  import { ArrayItems } from '@formily/antd';
8
+ import { useField, useFieldSchema } from '@formily/react';
10
9
  import { Slider } from 'antd';
11
10
  import _ from 'lodash';
11
+ import React, { useMemo } from 'react';
12
12
  import { useTranslation } from 'react-i18next';
13
13
  import { useCollection, useCollectionFilterOptions, useSortFields } from '../../../collection-manager';
14
14
  import { GeneralSchemaDesigner, SchemaSettings } from '../../../schema-settings';
15
15
  import { useSchemaTemplate } from '../../../schema-templates';
16
+ import { SchemaComponentOptions } from '../../core';
16
17
  import { useDesignable } from '../../hooks';
17
18
  import { removeNullCondition } from '../filter';
18
19
  import { FilterDynamicComponent } from '../table-v2/FilterDynamicComponent';
19
- import { SchemaComponentOptions } from '../../core';
20
20
  import { defaultColumnCount, gridSizes, pageSizeOptions, screenSizeMaps, screenSizeTitleMaps } from './options';
21
- Slider;
22
21
  var columnCountMarks = [1, 2, 3, 4, 6, 8, 12, 24].reduce(function (obj, cur) {
23
22
  obj[cur] = cur;
24
23
  return obj;
@@ -42,7 +42,5 @@
42
42
  }
43
43
 
44
44
  html body {
45
- --adm-font-family: -apple-system, BlinkMacSystemFont, Segoe UI, PingFang SC, Hiragino Sans GB,
46
- Microsoft YaHei, Helvetica Neue, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji,
47
- Segoe UI Symbol;
45
+ --adm-font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
48
46
  }