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

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 (236) 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/block-provider/GanttBlockProvider.js +5 -4
  5. package/es/block-provider/TableBlockProvider.d.ts +1 -0
  6. package/es/block-provider/TableBlockProvider.js +51 -17
  7. package/es/collection-manager/Configuration/AddCollectionAction.js +31 -25
  8. package/es/collection-manager/Configuration/AddFieldAction.js +45 -32
  9. package/es/collection-manager/Configuration/AddSubFieldAction.js +24 -19
  10. package/es/collection-manager/Configuration/ConfigurationTabs.js +57 -50
  11. package/es/collection-manager/hooks/useOptions.js +39 -36
  12. package/es/collection-manager/interfaces/integer.js +1 -1
  13. package/es/collection-manager/interfaces/number.js +3 -3
  14. package/es/collection-manager/interfaces/percent.js +3 -3
  15. package/es/formula/Expression.js +66 -46
  16. package/es/hooks/index.d.ts +1 -0
  17. package/es/hooks/index.js +1 -0
  18. package/es/hooks/useAdminSchemaUid.d.ts +1 -0
  19. package/es/hooks/useAdminSchemaUid.js +6 -0
  20. package/es/hooks/useMenuItem.d.ts +37 -0
  21. package/es/hooks/useMenuItem.js +93 -0
  22. package/es/index.d.ts +2 -3
  23. package/es/index.js +3 -4
  24. package/es/locale/en_US.d.ts +3 -1
  25. package/es/locale/en_US.js +4 -2
  26. package/es/locale/es_ES.d.ts +1 -1
  27. package/es/locale/es_ES.js +1 -1
  28. package/es/locale/ja_JP.d.ts +3 -1
  29. package/es/locale/ja_JP.js +4 -2
  30. package/es/locale/pt_BR.d.ts +1 -1
  31. package/es/locale/pt_BR.js +1 -1
  32. package/es/locale/ru_RU.d.ts +1 -1
  33. package/es/locale/ru_RU.js +1 -1
  34. package/es/locale/zh_CN.d.ts +3 -1
  35. package/es/locale/zh_CN.js +3 -1
  36. package/es/pm/Card.js +5 -5
  37. package/es/pm/PluginManagerLink.js +16 -12
  38. package/es/pm/index.d.ts +2 -1
  39. package/es/pm/index.js +36 -22
  40. package/es/route-switch/antd/admin-layout/index.js +5 -5
  41. package/es/schema-component/antd/action/Action.Designer.js +3 -5
  42. package/es/schema-component/antd/action/Action.Drawer.js +1 -1
  43. package/es/schema-component/antd/action/ActionBar.js +1 -1
  44. package/es/schema-component/antd/association-field/Editable.js +1 -2
  45. package/es/schema-component/antd/association-field/Nester.js +7 -1
  46. package/es/schema-component/antd/association-field/SubTable.js +1 -1
  47. package/es/schema-component/antd/calendar/DeleteEvent.js +1 -1
  48. package/es/schema-component/antd/cascader/Cascader.js +1 -1
  49. package/es/schema-component/antd/form-item/FormItem.js +10 -3
  50. package/es/schema-component/antd/form-v2/Form.js +2 -2
  51. package/es/schema-component/antd/gantt/components/gantt/gantt.js +0 -1
  52. package/es/schema-component/antd/gantt/components/grid/grid-body.js +3 -3
  53. package/es/schema-component/antd/gantt/components/task-item/bar/bar-small.js +1 -1
  54. package/es/schema-component/antd/gantt/components/task-item/task-item.js +1 -1
  55. package/es/schema-component/antd/gantt/helpers/bar-helper.d.ts +1 -1
  56. package/es/schema-component/antd/gantt/helpers/bar-helper.js +4 -4
  57. package/es/schema-component/antd/gantt/helpers/other-helper.js +3 -1
  58. package/es/schema-component/antd/grid/Grid.js +2 -2
  59. package/es/schema-component/antd/grid-card/GridCard.Designer.js +3 -4
  60. package/es/schema-component/antd/grid-card/GridCard.Item.js +3 -3
  61. package/es/schema-component/antd/index.less +1 -3
  62. package/es/schema-component/antd/list/List.Decorator.js +3 -3
  63. package/es/schema-component/antd/list/List.Item.js +2 -2
  64. package/es/schema-component/antd/list/List.d.ts +2 -2
  65. package/es/schema-component/antd/list/List.js +6 -6
  66. package/es/schema-component/antd/menu/Menu.js +306 -156
  67. package/es/schema-component/antd/page/Page.js +29 -23
  68. package/es/schema-component/antd/remote-select/RemoteSelect.js +60 -10
  69. package/es/schema-component/antd/remote-select/utils.d.ts +4 -0
  70. package/es/schema-component/antd/remote-select/utils.js +31 -0
  71. package/es/schema-component/antd/table-v2/FilterDynamicComponent.js +17 -2
  72. package/es/schema-component/antd/table-v2/Table.Column.Designer.js +51 -12
  73. package/es/schema-component/antd/table-v2/Table.js +28 -47
  74. package/es/schema-component/antd/table-v2/utils.d.ts +0 -1
  75. package/es/schema-component/antd/table-v2/utils.js +0 -28
  76. package/es/schema-component/antd/tabs/Tabs.js +35 -22
  77. package/es/schema-component/antd/tabs/context.d.ts +1 -1
  78. package/es/schema-component/antd/upload/ReadPretty.js +7 -3
  79. package/es/schema-component/antd/variable/VariableSelect.js +1 -1
  80. package/es/schema-component/common/utils/uitls.d.ts +1 -0
  81. package/es/schema-component/common/utils/uitls.js +1 -1
  82. package/es/schema-initializer/SchemaInitializer.d.ts +7 -2
  83. package/es/schema-initializer/SchemaInitializer.js +158 -103
  84. package/es/schema-initializer/SelectCollection.d.ts +1 -2
  85. package/es/schema-initializer/SelectCollection.js +19 -16
  86. package/es/schema-initializer/buttons/TableActionColumnInitializers.js +1 -1
  87. package/es/schema-initializer/buttons/TableActionInitializers.js +5 -5
  88. package/es/schema-initializer/buttons/TableColumnInitializers.js +3 -2
  89. package/es/schema-initializer/components/CreateRecordAction.js +37 -27
  90. package/es/schema-initializer/components/assigned-field/AssignedField.js +2 -1
  91. package/es/schema-initializer/items/CalendarBlockInitializer.js +2 -2
  92. package/es/schema-initializer/utils.d.ts +0 -1
  93. package/es/schema-initializer/utils.js +40 -25
  94. package/es/schema-settings/SchemaSettings.js +110 -29
  95. package/es/schema-settings/VariableInput/hooks/useFormVariable.d.ts +19 -0
  96. package/es/schema-settings/VariableInput/hooks/useFormVariable.js +89 -0
  97. package/es/schema-settings/VariableInput/hooks/useIterationVariable.d.ts +8 -0
  98. package/es/schema-settings/VariableInput/hooks/useIterationVariable.js +77 -0
  99. package/es/schema-settings/VariableInput/hooks/useVariableOptions.d.ts +5 -12
  100. package/es/schema-settings/VariableInput/hooks/useVariableOptions.js +19 -3
  101. package/es/schema-templates/BlockTemplateDetails.js +5 -1
  102. package/es/schema-templates/BlockTemplatePage.js +4 -1
  103. package/es/user/ChangePassword.d.ts +1 -2
  104. package/es/user/ChangePassword.js +30 -26
  105. package/es/user/CurrentUser.js +172 -141
  106. package/es/user/EditProfile.d.ts +1 -2
  107. package/es/user/EditProfile.js +30 -24
  108. package/es/user/LanguageSettings.d.ts +1 -2
  109. package/es/user/LanguageSettings.js +67 -64
  110. package/es/user/SigninPage.js +25 -22
  111. package/es/user/SwitchRole.d.ts +1 -2
  112. package/es/user/SwitchRole.js +54 -49
  113. package/es/user/ThemeSettings.d.ts +1 -2
  114. package/es/user/ThemeSettings.js +56 -52
  115. package/lib/acl/Configuration/MenuItemsProvider.js +3 -3
  116. package/lib/application/Application.js +2 -2
  117. package/lib/auth/SigninPage.js +25 -22
  118. package/lib/block-provider/GanttBlockProvider.js +5 -4
  119. package/lib/block-provider/TableBlockProvider.d.ts +1 -0
  120. package/lib/block-provider/TableBlockProvider.js +53 -17
  121. package/lib/collection-manager/Configuration/AddCollectionAction.js +29 -23
  122. package/lib/collection-manager/Configuration/AddFieldAction.js +43 -30
  123. package/lib/collection-manager/Configuration/AddSubFieldAction.js +22 -17
  124. package/lib/collection-manager/Configuration/ConfigurationTabs.js +57 -49
  125. package/lib/collection-manager/hooks/useOptions.js +39 -36
  126. package/lib/collection-manager/interfaces/integer.js +1 -1
  127. package/lib/collection-manager/interfaces/number.js +3 -3
  128. package/lib/collection-manager/interfaces/percent.js +3 -3
  129. package/lib/formula/Expression.js +64 -44
  130. package/lib/hooks/index.d.ts +1 -0
  131. package/lib/hooks/index.js +11 -0
  132. package/lib/hooks/useAdminSchemaUid.d.ts +1 -0
  133. package/lib/hooks/useAdminSchemaUid.js +13 -0
  134. package/lib/hooks/useMenuItem.d.ts +37 -0
  135. package/lib/hooks/useMenuItem.js +108 -0
  136. package/lib/index.d.ts +2 -3
  137. package/lib/index.js +22 -33
  138. package/lib/locale/en_US.d.ts +3 -1
  139. package/lib/locale/en_US.js +4 -2
  140. package/lib/locale/es_ES.d.ts +1 -1
  141. package/lib/locale/es_ES.js +1 -1
  142. package/lib/locale/ja_JP.d.ts +3 -1
  143. package/lib/locale/ja_JP.js +4 -2
  144. package/lib/locale/pt_BR.d.ts +1 -1
  145. package/lib/locale/pt_BR.js +1 -1
  146. package/lib/locale/ru_RU.d.ts +1 -1
  147. package/lib/locale/ru_RU.js +1 -1
  148. package/lib/locale/zh_CN.d.ts +3 -1
  149. package/lib/locale/zh_CN.js +3 -1
  150. package/lib/pm/Card.js +6 -6
  151. package/lib/pm/PluginManagerLink.js +15 -10
  152. package/lib/pm/index.d.ts +2 -1
  153. package/lib/pm/index.js +37 -23
  154. package/lib/route-switch/antd/admin-layout/index.js +4 -4
  155. package/lib/schema-component/antd/action/Action.Designer.js +2 -4
  156. package/lib/schema-component/antd/action/Action.Drawer.js +1 -1
  157. package/lib/schema-component/antd/association-field/Editable.js +0 -1
  158. package/lib/schema-component/antd/association-field/Nester.js +6 -0
  159. package/lib/schema-component/antd/association-field/SubTable.js +1 -1
  160. package/lib/schema-component/antd/calendar/DeleteEvent.js +1 -1
  161. package/lib/schema-component/antd/cascader/Cascader.js +1 -1
  162. package/lib/schema-component/antd/form-item/FormItem.js +10 -3
  163. package/lib/schema-component/antd/form-v2/Form.js +2 -2
  164. package/lib/schema-component/antd/gantt/components/gantt/gantt.js +0 -1
  165. package/lib/schema-component/antd/gantt/components/grid/grid-body.js +2 -2
  166. package/lib/schema-component/antd/gantt/components/task-item/bar/bar-small.js +1 -1
  167. package/lib/schema-component/antd/gantt/components/task-item/task-item.js +1 -1
  168. package/lib/schema-component/antd/gantt/helpers/bar-helper.d.ts +1 -1
  169. package/lib/schema-component/antd/gantt/helpers/bar-helper.js +4 -4
  170. package/lib/schema-component/antd/gantt/helpers/other-helper.js +3 -1
  171. package/lib/schema-component/antd/grid/Grid.js +1 -1
  172. package/lib/schema-component/antd/grid-card/GridCard.Designer.js +4 -5
  173. package/lib/schema-component/antd/grid-card/GridCard.Item.js +8 -8
  174. package/lib/schema-component/antd/index.less +1 -3
  175. package/lib/schema-component/antd/list/List.Decorator.js +3 -3
  176. package/lib/schema-component/antd/list/List.Item.js +6 -6
  177. package/lib/schema-component/antd/list/List.d.ts +2 -2
  178. package/lib/schema-component/antd/list/List.js +24 -24
  179. package/lib/schema-component/antd/menu/Menu.js +304 -154
  180. package/lib/schema-component/antd/page/Page.js +29 -23
  181. package/lib/schema-component/antd/remote-select/RemoteSelect.js +57 -7
  182. package/lib/schema-component/antd/remote-select/utils.d.ts +4 -0
  183. package/lib/schema-component/antd/remote-select/utils.js +41 -0
  184. package/lib/schema-component/antd/table-v2/FilterDynamicComponent.js +17 -2
  185. package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +50 -11
  186. package/lib/schema-component/antd/table-v2/Table.js +26 -45
  187. package/lib/schema-component/antd/table-v2/utils.d.ts +0 -1
  188. package/lib/schema-component/antd/table-v2/utils.js +0 -29
  189. package/lib/schema-component/antd/tabs/Tabs.js +34 -21
  190. package/lib/schema-component/antd/tabs/context.d.ts +1 -1
  191. package/lib/schema-component/antd/upload/ReadPretty.js +7 -3
  192. package/lib/schema-component/antd/variable/VariableSelect.js +1 -1
  193. package/lib/schema-component/common/utils/uitls.d.ts +1 -0
  194. package/lib/schema-component/common/utils/uitls.js +3 -1
  195. package/lib/schema-initializer/SchemaInitializer.d.ts +7 -2
  196. package/lib/schema-initializer/SchemaInitializer.js +155 -101
  197. package/lib/schema-initializer/SelectCollection.d.ts +1 -2
  198. package/lib/schema-initializer/SelectCollection.js +22 -17
  199. package/lib/schema-initializer/buttons/TableActionColumnInitializers.js +1 -1
  200. package/lib/schema-initializer/buttons/TableActionInitializers.js +5 -5
  201. package/lib/schema-initializer/buttons/TableColumnInitializers.js +2 -1
  202. package/lib/schema-initializer/components/CreateRecordAction.js +35 -25
  203. package/lib/schema-initializer/components/assigned-field/AssignedField.js +2 -1
  204. package/lib/schema-initializer/items/CalendarBlockInitializer.js +9 -9
  205. package/lib/schema-initializer/utils.d.ts +0 -1
  206. package/lib/schema-initializer/utils.js +41 -25
  207. package/lib/schema-settings/SchemaSettings.js +106 -27
  208. package/lib/schema-settings/VariableInput/hooks/useFormVariable.d.ts +19 -0
  209. package/lib/schema-settings/VariableInput/hooks/useFormVariable.js +96 -0
  210. package/lib/schema-settings/VariableInput/hooks/useIterationVariable.d.ts +8 -0
  211. package/lib/schema-settings/VariableInput/hooks/useIterationVariable.js +84 -0
  212. package/lib/schema-settings/VariableInput/hooks/useVariableOptions.d.ts +5 -12
  213. package/lib/schema-settings/VariableInput/hooks/useVariableOptions.js +19 -3
  214. package/lib/schema-templates/BlockTemplateDetails.js +5 -1
  215. package/lib/schema-templates/BlockTemplatePage.js +5 -2
  216. package/lib/user/ChangePassword.d.ts +1 -2
  217. package/lib/user/ChangePassword.js +30 -26
  218. package/lib/user/CurrentUser.js +166 -135
  219. package/lib/user/EditProfile.d.ts +1 -2
  220. package/lib/user/EditProfile.js +31 -25
  221. package/lib/user/LanguageSettings.d.ts +1 -2
  222. package/lib/user/LanguageSettings.js +66 -63
  223. package/lib/user/SigninPage.js +25 -22
  224. package/lib/user/SwitchRole.d.ts +1 -2
  225. package/lib/user/SwitchRole.js +57 -51
  226. package/lib/user/ThemeSettings.d.ts +1 -2
  227. package/lib/user/ThemeSettings.js +59 -54
  228. package/package.json +9 -8
  229. package/es/settings-form/SettingsForm.d.ts +0 -13
  230. package/es/settings-form/SettingsForm.js +0 -309
  231. package/es/settings-form/index.d.ts +0 -1
  232. package/es/settings-form/index.js +0 -1
  233. package/lib/settings-form/SettingsForm.d.ts +0 -13
  234. package/lib/settings-form/SettingsForm.js +0 -320
  235. package/lib/settings-form/index.d.ts +0 -1
  236. package/lib/settings-form/index.js +0 -16
@@ -280,7 +280,7 @@ export default {
280
280
  "Display field title": "Mostrar título de campo",
281
281
  "Field component": "Componente del campo",
282
282
  "Subtable": "Subtabla",
283
- "Subform": "Subformulario",
283
+ "Sub-form": "Subformulario",
284
284
  "Record picker": "Selector de registros",
285
285
  "Toggles the subfield mode": "Alterna el modo de subcampo",
286
286
  "Selector mode": "Modo selector",
@@ -540,7 +540,7 @@ declare const _default: {
540
540
  "Quick upload": string;
541
541
  "Select file": string;
542
542
  Subtable: string;
543
- Subform: string;
543
+ "Sub-form": string;
544
544
  "Sub-details": string;
545
545
  "Field mode": string;
546
546
  "Allow add new data": string;
@@ -612,5 +612,7 @@ declare const _default: {
612
612
  "Update or create": string;
613
613
  "Find by the following fields": string;
614
614
  Create: string;
615
+ "Current form": string;
616
+ "Current object": string;
615
617
  };
616
618
  export default _default;
@@ -540,7 +540,7 @@ export default {
540
540
  "Quick upload": "クイックアップロード",
541
541
  "Select file": "ファイルを選択",
542
542
  "Subtable": "サブテーブル",
543
- "Subform": "サブフォーム",
543
+ "Sub-form": "サブフォーム",
544
544
  "Sub-details": "サブリスト",
545
545
  "Field mode": "フィールドコンポーネント",
546
546
  "Allow add new data": "データの追加を許可",
@@ -612,5 +612,7 @@ export default {
612
612
  "First or create": "存在しない場合に追加",
613
613
  "Update or create": "存在しなければ新規、存在すれば更新",
614
614
  "Find by the following fields": "次のフィールドで検索",
615
- "Create": "新規のみ"
615
+ "Create": "新規のみ",
616
+ "Current form": "現在のフォーム",
617
+ "Current object": "現在のオブジェクト"
616
618
  };
@@ -244,7 +244,7 @@ declare const _default: {
244
244
  "Select file": string;
245
245
  "Allow multiple": string;
246
246
  Subtable: string;
247
- Subform: string;
247
+ "Sub-form": string;
248
248
  "Record picker": string;
249
249
  "Toggles the subfield mode": string;
250
250
  "Selector mode": string;
@@ -244,7 +244,7 @@ export default {
244
244
  "Select file": "Selecionar arquivo",
245
245
  "Allow multiple": "Permitir múltiplos",
246
246
  "Subtable": "Subtabela",
247
- "Subform": "Subformulário",
247
+ "Sub-form": "Subformulário",
248
248
  "Record picker": "Selecionador de registros",
249
249
  "Toggles the subfield mode": "Alterna o modo de subcampo",
250
250
  "Selector mode": "Modo de seleção",
@@ -478,7 +478,7 @@ declare const _default: {
478
478
  "Quick upload": string;
479
479
  "Select file": string;
480
480
  Subtable: string;
481
- Subform: string;
481
+ "Sub-form": string;
482
482
  "Regular expression": string;
483
483
  "Enabled languages": string;
484
484
  "View all plugins": string;
@@ -478,7 +478,7 @@ export default {
478
478
  "Quick upload": "Быстрая загрузка",
479
479
  "Select file": "Выбрать файл",
480
480
  "Subtable": "Подтаблица",
481
- "Subform": "Подформа",
481
+ "Sub-form": "Подформа",
482
482
  "Regular expression": "Образец",
483
483
  "Enabled languages": "Включенные языки",
484
484
  "View all plugins": "Посмотреть все плагины",
@@ -313,7 +313,7 @@ declare const _default: {
313
313
  "Quick upload": string;
314
314
  "Select file": string;
315
315
  Subtable: string;
316
- Subform: string;
316
+ "Sub-form": string;
317
317
  "Sub-details": string;
318
318
  "Record picker": string;
319
319
  "Toggles the subfield mode": string;
@@ -748,6 +748,8 @@ declare const _default: {
748
748
  "Update or create": string;
749
749
  "Find by the following fields": string;
750
750
  Create: string;
751
+ "Current form": string;
752
+ "Current object": string;
751
753
  "Quick create": string;
752
754
  Dropdown: string;
753
755
  "Pop-up": string;
@@ -313,7 +313,7 @@ export default {
313
313
  "Quick upload": "快速上传",
314
314
  "Select file": "选择文件",
315
315
  "Subtable": "子表格",
316
- "Subform": "子表单",
316
+ "Sub-form": "子表单",
317
317
  "Sub-details": "子详情",
318
318
  "Record picker": "数据选择器",
319
319
  "Toggles the subfield mode": "切换子字段模式",
@@ -749,6 +749,8 @@ export default {
749
749
  "Update or create": "不存在时新增,存在时更新",
750
750
  "Find by the following fields": "通过以下字段查找",
751
751
  "Create": "仅新增",
752
+ "Current form": "当前表单",
753
+ "Current object": "当前对象",
752
754
  "Quick create": "快速创建",
753
755
  "Dropdown": "下拉菜单",
754
756
  "Pop-up": "弹窗",
package/es/pm/Card.js CHANGED
@@ -10,14 +10,14 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
10
10
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
11
11
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
12
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
- import React, { useEffect, useMemo, useState, useCallback } from 'react';
14
- import { useAPIClient, useRequest } from '../api-client';
15
- import { Avatar, Card, message, Modal, Popconfirm, Spin, Switch, Tabs, Tag, Tooltip, Typography } from 'antd';
13
+ import { DeleteOutlined, SettingOutlined } from '@ant-design/icons';
16
14
  import { css } from '@emotion/css';
15
+ import { Avatar, Card, Modal, Popconfirm, Spin, Switch, Tabs, Tag, Tooltip, Typography, message } from 'antd';
17
16
  import cls from 'classnames';
18
- import { useNavigate } from 'react-router-dom';
17
+ import React, { useCallback, useEffect, useMemo, useState } from 'react';
19
18
  import { useTranslation } from 'react-i18next';
20
- import { DeleteOutlined, SettingOutlined } from '@ant-design/icons';
19
+ import { useNavigate } from 'react-router-dom';
20
+ import { useAPIClient, useRequest } from '../api-client';
21
21
  import { useParseMarkdown } from '../schema-component/antd/markdown/util';
22
22
  /**
23
23
  * get color by string
@@ -16,12 +16,13 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
16
16
  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); }
17
17
  import { ApiOutlined, SettingOutlined } from '@ant-design/icons';
18
18
  import { Button, Dropdown, Tooltip } from 'antd';
19
- import React, { useContext, useState } from 'react';
19
+ import _ from 'lodash';
20
+ import React, { useContext, useMemo, useState } from 'react';
20
21
  import { useTranslation } from 'react-i18next';
21
22
  import { useNavigate } from 'react-router-dom';
22
23
  import { useACLRoleContext } from '../acl/ACLProvider';
23
24
  import { ActionContextProvider, useCompile } from '../schema-component';
24
- import { getPluginsTabs, SettingsCenterContext } from './index';
25
+ import { SettingsCenterContext, getPluginsTabs } from './index';
25
26
  export var PluginManagerLink = function PluginManagerLink() {
26
27
  var _useTranslation = useTranslation(),
27
28
  t = _useTranslation.t;
@@ -36,7 +37,7 @@ export var PluginManagerLink = function PluginManagerLink() {
36
37
  }
37
38
  }));
38
39
  };
39
- var getBookmarkTabs = function getBookmarkTabs(data) {
40
+ var getBookmarkTabs = _.memoize(function (data) {
40
41
  var bookmarkTabs = [];
41
42
  data.forEach(function (plugin) {
42
43
  var tabs = plugin.tabs;
@@ -47,7 +48,7 @@ var getBookmarkTabs = function getBookmarkTabs(data) {
47
48
  });
48
49
  });
49
50
  return bookmarkTabs;
50
- };
51
+ });
51
52
  export var SettingsCenterDropdown = function SettingsCenterDropdown() {
52
53
  var _useACLRoleContext = useACLRoleContext(),
53
54
  _useACLRoleContext$sn = _useACLRoleContext.snippets,
@@ -63,14 +64,8 @@ export var SettingsCenterDropdown = function SettingsCenterDropdown() {
63
64
  var itemData = useContext(SettingsCenterContext);
64
65
  var pluginsTabs = getPluginsTabs(itemData, snippets);
65
66
  var bookmarkTabs = getBookmarkTabs(pluginsTabs);
66
- return /*#__PURE__*/React.createElement(ActionContextProvider, {
67
- value: {
68
- visible: visible,
69
- setVisible: setVisible
70
- }
71
- }, /*#__PURE__*/React.createElement(Dropdown, {
72
- placement: "bottom",
73
- menu: {
67
+ var menu = useMemo(function () {
68
+ return {
74
69
  items: [].concat(_toConsumableArray(bookmarkTabs.map(function (tab) {
75
70
  return {
76
71
  key: "/admin/settings/".concat(tab.path),
@@ -86,7 +81,16 @@ export var SettingsCenterDropdown = function SettingsCenterDropdown() {
86
81
  var key = _ref.key;
87
82
  navigate(key);
88
83
  }
84
+ };
85
+ }, [bookmarkTabs]);
86
+ return /*#__PURE__*/React.createElement(ActionContextProvider, {
87
+ value: {
88
+ visible: visible,
89
+ setVisible: setVisible
89
90
  }
91
+ }, /*#__PURE__*/React.createElement(Dropdown, {
92
+ placement: "bottom",
93
+ menu: menu
90
94
  }, /*#__PURE__*/React.createElement(Button, {
91
95
  icon: /*#__PURE__*/React.createElement(SettingOutlined, null)
92
96
  })));
package/es/pm/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import _ from 'lodash';
1
2
  import React from 'react';
2
3
  export interface TData {
3
4
  data: IPluginData[];
@@ -29,7 +30,7 @@ export interface AllowedActions {
29
30
  destroy: number[];
30
31
  }
31
32
  export declare const SettingsCenterContext: React.Context<any>;
32
- export declare const getPluginsTabs: (items: any, snippets: any) => any[];
33
+ export declare const getPluginsTabs: ((items: any, snippets: any) => any[]) & _.MemoizedFunction;
33
34
  export declare const SettingsCenterProvider: (props: any) => React.JSX.Element;
34
35
  export declare const PMProvider: (props: any) => React.JSX.Element;
35
36
  export default PMProvider;
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,14 +71,15 @@ 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` 的情况
82
- if (params['*'] === 'admin') {
82
+ if (params['*'] === 'admin' || params['*'] === 'admin/') {
83
83
  var _s2 = findMenuItem(schema);
84
84
  if (_s2) {
85
85
  navigate("/admin/".concat(_s2['x-uid']));
@@ -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';
@@ -7,7 +7,7 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
7
7
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
8
8
  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); } }
9
9
  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); }); }; }
10
- import { observer, useField, useFieldSchema, useForm } from '@formily/react';
10
+ import { observer, useField, useForm } from '@formily/react';
11
11
  import React from 'react';
12
12
  import { SchemaComponentOptions } from '../../';
13
13
  import { useAssociationCreateActionProps as useCAP } from '../../../block-provider/hooks';
@@ -23,7 +23,6 @@ var EditableAssociationField = observer(function (props) {
23
23
  var multiple = props.multiple;
24
24
  var field = useField();
25
25
  var form = useForm();
26
- var fieldSchema = useFieldSchema();
27
26
  var _useAssociationFieldC = useAssociationFieldContext(),
28
27
  collectionField = _useAssociationFieldC.options,
29
28
  currentMode = _useAssociationFieldC.currentMode;
@@ -9,8 +9,9 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
9
9
  import { CloseOutlined, PlusOutlined } from '@ant-design/icons';
10
10
  import { css } from '@emotion/css';
11
11
  import { spliceArrayState } from '@formily/core/esm/shared/internals';
12
- import { RecursionField, observer, useFieldSchema } from '@formily/react';
12
+ import { observer, RecursionField, useFieldSchema } from '@formily/react';
13
13
  import { action } from '@formily/reactive';
14
+ import { each } from '@formily/shared';
14
15
  import { Button, Card, Divider, Tooltip } from 'antd';
15
16
  import React, { useContext } from 'react';
16
17
  import { useTranslation } from 'react-i18next';
@@ -77,6 +78,11 @@ var ToManyNester = observer(function (props) {
77
78
  insertCount: 1
78
79
  });
79
80
  field.value.splice(index + 1, 0, {});
81
+ each(field.form.fields, function (field, key) {
82
+ if (!field) {
83
+ delete field.form.fields[key];
84
+ }
85
+ });
80
86
  return field.onInput(field.value);
81
87
  });
82
88
  }
@@ -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;
@@ -163,7 +163,7 @@ var WithForm = function WithForm(props) {
163
163
  form.removeEffects(id);
164
164
  };
165
165
  }, [linkageRules]);
166
- return fieldSchema['x-decorator'] === 'Form' ? /*#__PURE__*/React.createElement(FormDecorator, _objectSpread({}, props)) : /*#__PURE__*/React.createElement(FormComponent, _objectSpread({}, props));
166
+ return fieldSchema['x-decorator'] === 'FormV2' ? /*#__PURE__*/React.createElement(FormDecorator, _objectSpread({}, props)) : /*#__PURE__*/React.createElement(FormComponent, _objectSpread({}, props));
167
167
  };
168
168
  var WithoutForm = function WithoutForm(props) {
169
169
  var fieldSchema = useFieldSchema();
@@ -179,7 +179,7 @@ var WithoutForm = function WithoutForm(props) {
179
179
  }
180
180
  });
181
181
  }, []);
182
- return fieldSchema['x-decorator'] === 'Form' ? /*#__PURE__*/React.createElement(FormDecorator, _objectSpread({
182
+ return fieldSchema['x-decorator'] === 'FormV2' ? /*#__PURE__*/React.createElement(FormDecorator, _objectSpread({
183
183
  form: form
184
184
  }, props)) : /*#__PURE__*/React.createElement(FormComponent, _objectSpread({
185
185
  form: form
@@ -238,7 +238,6 @@ export var Gantt = function Gantt(props) {
238
238
  useEffect(function () {
239
239
  tableCtx.field.onExpandClick = handleTableExpanderClick;
240
240
  tableCtx.field.onRowSelect = handleRowSelect;
241
- tableCtx.setExpandFlag(true);
242
241
  }, []);
243
242
  useEffect(function () {
244
243
  expandAndCollapseAll === null || expandAndCollapseAll === void 0 ? void 0 : expandAndCollapseAll(!expandFlag);
@@ -1,11 +1,11 @@
1
1
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
2
2
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
3
3
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
4
- import React from 'react';
5
4
  import { cx } from '@emotion/css';
6
- import { addToDate } from '../../helpers/date-helper';
7
- import { gridRowLine, gridRow, gridTick, gridHeightRow } from './style';
8
5
  import { uid } from '@nocobase/utils/client';
6
+ import React from 'react';
7
+ import { addToDate } from '../../helpers/date-helper';
8
+ import { gridHeightRow, gridRow, gridRowLine, gridTick } from './style';
9
9
  var empty = [{
10
10
  id: uid()
11
11
  }, {
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
1
  import { cx } from '@emotion/css';
2
+ import React from 'react';
3
3
  import { getProgressPoint } from '../../../helpers/bar-helper';
4
4
  import { BarDisplay } from './bar-display';
5
5
  import { BarProgressHandle } from './bar-progress-handle';