@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
@@ -0,0 +1,89 @@
1
+ import { useMemo } from 'react';
2
+ import { useCompile, useGetFilterOptions } from '../../../schema-component';
3
+ var getChildren = function getChildren(options, _ref) {
4
+ var depth = _ref.depth,
5
+ maxDepth = _ref.maxDepth,
6
+ loadChildren = _ref.loadChildren,
7
+ compile = _ref.compile;
8
+ var result = options.map(function (option) {
9
+ if (!option.target) {
10
+ return {
11
+ key: option.name,
12
+ value: option.name,
13
+ label: compile(option.title),
14
+ depth: depth
15
+ };
16
+ }
17
+ if (depth >= maxDepth) {
18
+ return null;
19
+ }
20
+ return {
21
+ key: option.name,
22
+ value: option.name,
23
+ label: compile(option.title),
24
+ children: [],
25
+ isLeaf: false,
26
+ field: option,
27
+ depth: depth,
28
+ loadChildren: loadChildren
29
+ };
30
+ }).filter(Boolean);
31
+ return result;
32
+ };
33
+ export var useFormVariable = function useFormVariable(_ref2) {
34
+ var blockForm = _ref2.blockForm,
35
+ rootCollection = _ref2.rootCollection,
36
+ operator = _ref2.operator,
37
+ schema = _ref2.schema,
38
+ level = _ref2.level;
39
+ var compile = useCompile();
40
+ var getFilterOptions = useGetFilterOptions();
41
+ var loadChildren = function loadChildren(option) {
42
+ var _option$field;
43
+ if (!((_option$field = option.field) === null || _option$field === void 0 ? void 0 : _option$field.target)) {
44
+ return new Promise(function (resolve) {
45
+ resolve(void 0);
46
+ });
47
+ }
48
+ var collectionName = option.field.target;
49
+ var fields = getFilterOptions(collectionName);
50
+ var allowFields = option.depth === 0 ? fields.filter(function (field) {
51
+ return Object.keys(blockForm.fields).some(function (name) {
52
+ return name.includes(".".concat(field.name));
53
+ });
54
+ }) : fields;
55
+ return new Promise(function (resolve) {
56
+ setTimeout(function () {
57
+ var children = getChildren(allowFields, {
58
+ depth: option.depth + 1,
59
+ maxDepth: 4,
60
+ loadChildren: loadChildren,
61
+ compile: compile
62
+ }) || [];
63
+ if (children.length === 0) {
64
+ option.disabled = true;
65
+ resolve();
66
+ return;
67
+ }
68
+ option.children = children;
69
+ resolve();
70
+ // 延迟 5 毫秒,防止阻塞主线程,导致 UI 卡顿
71
+ }, 5);
72
+ });
73
+ };
74
+ var result = useMemo(function () {
75
+ return blockForm && {
76
+ label: "{{t(\"Current form\")}}",
77
+ value: '$form',
78
+ key: '$form',
79
+ children: [],
80
+ isLeaf: false,
81
+ field: {
82
+ target: rootCollection
83
+ },
84
+ depth: 0,
85
+ loadChildren: loadChildren
86
+ };
87
+ }, [rootCollection]);
88
+ return result;
89
+ };
@@ -0,0 +1,8 @@
1
+ export declare const useIterationVariable: ({ blockForm, collectionField, operator, schema, level, rootCollection, }: {
2
+ blockForm?: any;
3
+ collectionField: any;
4
+ operator?: any;
5
+ schema: any;
6
+ level?: number;
7
+ rootCollection?: string;
8
+ }) => any;
@@ -0,0 +1,77 @@
1
+ import { useMemo } from 'react';
2
+ import { useCompile, useGetFilterOptions } from '../../../schema-component';
3
+ var getChildren = function getChildren(options, _ref) {
4
+ var schema = _ref.schema,
5
+ operator = _ref.operator,
6
+ maxDepth = _ref.maxDepth,
7
+ _ref$count = _ref.count,
8
+ count = _ref$count === void 0 ? 1 : _ref$count,
9
+ getFilterOptions = _ref.getFilterOptions;
10
+ if (count > maxDepth) {
11
+ return [];
12
+ }
13
+ var result = options.map(function (option) {
14
+ if (option.type !== 'belongsTo' && option.type !== 'hasOne' || !option.target) {
15
+ return {
16
+ key: option.name,
17
+ value: option.name,
18
+ label: option.title,
19
+ // TODO: 现在是通过组件的名称来过滤能够被选择的选项,这样的坏处是不够精确,后续可以优化
20
+ // disabled: schema?.['x-component'] !== option.schema?.['x-component'],
21
+ disabled: false
22
+ };
23
+ }
24
+ var children = getChildren(getFilterOptions(option.target), {
25
+ schema: schema,
26
+ operator: operator,
27
+ maxDepth: maxDepth,
28
+ count: count + 1,
29
+ getFilterOptions: getFilterOptions
30
+ }) || [];
31
+ return {
32
+ key: option.name,
33
+ value: option.name,
34
+ label: option.title,
35
+ children: children,
36
+ disabled: children.every(function (child) {
37
+ return child.disabled;
38
+ })
39
+ };
40
+ });
41
+ return result;
42
+ };
43
+ export var useIterationVariable = function useIterationVariable(_ref2) {
44
+ var blockForm = _ref2.blockForm,
45
+ collectionField = _ref2.collectionField,
46
+ operator = _ref2.operator,
47
+ schema = _ref2.schema,
48
+ level = _ref2.level,
49
+ rootCollection = _ref2.rootCollection;
50
+ var compile = useCompile();
51
+ var getFilterOptions = useGetFilterOptions();
52
+ var fields = getFilterOptions(collectionField === null || collectionField === void 0 ? void 0 : collectionField.collectionName);
53
+ var children = useMemo(function () {
54
+ var allowFields = fields.filter(function (field) {
55
+ return Object.keys(blockForm.fields).some(function (name) {
56
+ return name.includes(field.name);
57
+ });
58
+ });
59
+ return getChildren(allowFields, {
60
+ schema: schema,
61
+ operator: operator,
62
+ maxDepth: level || 3,
63
+ getFilterOptions: getFilterOptions
64
+ }) || [];
65
+ }, [operator, schema, blockForm]);
66
+ return useMemo(function () {
67
+ return rootCollection !== (collectionField === null || collectionField === void 0 ? void 0 : collectionField.collectionName) && children.length > 0 ? compile({
68
+ label: "{{t(\"Current object\")}}",
69
+ value: '$iteration',
70
+ key: '$iteration',
71
+ disabled: children.every(function (option) {
72
+ return option.disabled;
73
+ }),
74
+ children: children
75
+ }) : null;
76
+ }, [children]);
77
+ };
@@ -1,12 +1,5 @@
1
- export declare const useVariableOptions: () => ({
2
- label: string;
3
- value: string;
4
- key: string;
5
- disabled: boolean;
6
- children: {
7
- key: string;
8
- value: string;
9
- label: string;
10
- disabled: boolean;
11
- }[];
12
- } | import("../type").Option)[];
1
+ export declare const useVariableOptions: ({ form, collectionField, rootCollection }: {
2
+ form: any;
3
+ collectionField: any;
4
+ rootCollection: any;
5
+ }) => any[];
@@ -2,7 +2,12 @@ import { useMemo } from 'react';
2
2
  import { useValues } from '../../../schema-component/antd/filter/useValues';
3
3
  import { useDateVariable } from './useDateVariable';
4
4
  import { useUserVariable } from './useUserVariable';
5
- export var useVariableOptions = function useVariableOptions() {
5
+ import { useFormVariable } from './useFormVariable';
6
+ import { useIterationVariable } from './useIterationVariable';
7
+ export var useVariableOptions = function useVariableOptions(_ref) {
8
+ var form = _ref.form,
9
+ collectionField = _ref.collectionField,
10
+ rootCollection = _ref.rootCollection;
6
11
  var _useValues = useValues(),
7
12
  operator = _useValues.operator,
8
13
  schema = _useValues.schema;
@@ -14,9 +19,20 @@ export var useVariableOptions = function useVariableOptions() {
14
19
  operator: operator,
15
20
  schema: schema
16
21
  });
22
+ var formVariabele = useFormVariable({
23
+ blockForm: form,
24
+ rootCollection: rootCollection,
25
+ schema: schema
26
+ });
27
+ var iterationVariabele = useIterationVariable({
28
+ blockForm: form,
29
+ collectionField: collectionField,
30
+ schema: schema,
31
+ rootCollection: rootCollection
32
+ });
17
33
  var result = useMemo(function () {
18
- return [userVariable, dateVariable];
19
- }, [dateVariable, userVariable]);
34
+ return [userVariable, dateVariable, formVariabele, iterationVariabele].filter(Boolean);
35
+ }, [dateVariable, userVariable, formVariabele, iterationVariabele]);
20
36
  if (!operator || !schema) return [];
21
37
  return result;
22
38
  };
@@ -10,7 +10,8 @@ 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 { PageHeader as AntdPageHeader, Input, Spin } from 'antd';
13
+ import { PageHeader as AntdPageHeader } from '@ant-design/pro-layout';
14
+ import { Input, Spin } from 'antd';
14
15
  import React, { useContext, useState } from 'react';
15
16
  import { useNavigate, useParams } from 'react-router-dom';
16
17
  import { useAPIClient, useRequest, useSchemaTemplateManager } from '..';
@@ -85,6 +86,9 @@ export var BlockTemplateDetails = function BlockTemplateDetails() {
85
86
  return /*#__PURE__*/React.createElement(Spin, null);
86
87
  }
87
88
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(AntdPageHeader, {
89
+ style: {
90
+ backgroundColor: 'white'
91
+ },
88
92
  onBack: function onBack() {
89
93
  navigate('/admin/plugins/block-templates');
90
94
  },
@@ -1,4 +1,4 @@
1
- import { PageHeader as AntdPageHeader } from 'antd';
1
+ import { PageHeader as AntdPageHeader } from '@ant-design/pro-layout';
2
2
  import React from 'react';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import { CollectionManagerProvider } from '../collection-manager';
@@ -9,6 +9,9 @@ export var BlockTemplatePage = function BlockTemplatePage() {
9
9
  var _useTranslation = useTranslation(),
10
10
  t = _useTranslation.t;
11
11
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(AntdPageHeader, {
12
+ style: {
13
+ backgroundColor: 'white'
14
+ },
12
15
  ghost: false,
13
16
  title: t('Block templates')
14
17
  }), /*#__PURE__*/React.createElement("div", {
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const ChangePassword: () => React.JSX.Element;
1
+ export declare const useChangePassword: () => import("antd/lib/menu/hooks/useItems").ItemType;
@@ -13,12 +13,10 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
13
13
  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); }); }; }
14
14
  import { useForm } from '@formily/react';
15
15
  import { uid } from '@formily/shared';
16
- import { Menu } from 'antd';
17
- import React, { useContext, useState } from 'react';
16
+ import React, { useContext, useMemo, useState } from 'react';
18
17
  import { useTranslation } from 'react-i18next';
19
- import { ActionContextProvider, SchemaComponent, useActionContext } from '../';
18
+ import { ActionContextProvider, DropdownVisibleContext, SchemaComponent, useActionContext } from '../';
20
19
  import { useAPIClient } from '../api-client';
21
- import { DropdownVisibleContext } from './CurrentUser';
22
20
  var useCloseAction = function useCloseAction() {
23
21
  var _useActionContext = useActionContext(),
24
22
  setVisible = _useActionContext.setVisible;
@@ -151,32 +149,38 @@ var schema = {
151
149
  }
152
150
  })
153
151
  };
154
- export var ChangePassword = function ChangePassword() {
152
+ export var useChangePassword = function useChangePassword() {
153
+ var ctx = useContext(DropdownVisibleContext);
155
154
  var _useState = useState(false),
156
155
  _useState2 = _slicedToArray(_useState, 2),
157
156
  visible = _useState2[0],
158
157
  setVisible = _useState2[1];
159
158
  var _useTranslation = useTranslation(),
160
159
  t = _useTranslation.t;
161
- var ctx = useContext(DropdownVisibleContext);
162
- return /*#__PURE__*/React.createElement(ActionContextProvider, {
163
- value: {
164
- visible: visible,
165
- setVisible: setVisible
166
- }
167
- }, /*#__PURE__*/React.createElement(Menu.Item, {
168
- key: "password",
169
- eventKey: 'ChangePassword',
170
- onClick: function onClick() {
171
- var _ctx$setVisible;
172
- ctx === null || ctx === void 0 ? void 0 : (_ctx$setVisible = ctx.setVisible) === null || _ctx$setVisible === void 0 ? void 0 : _ctx$setVisible.call(ctx, false);
173
- setVisible(true);
174
- }
175
- }, t('Change password')), /*#__PURE__*/React.createElement(SchemaComponent, {
176
- scope: {
177
- useCloseAction: useCloseAction,
178
- useSaveCurrentUserValues: useSaveCurrentUserValues
179
- },
180
- schema: schema
181
- }));
160
+ return useMemo(function () {
161
+ return {
162
+ key: 'password',
163
+ eventKey: 'ChangePassword',
164
+ onClick: function onClick() {
165
+ setVisible(true);
166
+ ctx === null || ctx === void 0 ? void 0 : ctx.setVisible(false);
167
+ },
168
+ label: /*#__PURE__*/React.createElement(React.Fragment, null, t('Change password'), /*#__PURE__*/React.createElement(ActionContextProvider, {
169
+ value: {
170
+ visible: visible,
171
+ setVisible: setVisible
172
+ }
173
+ }, /*#__PURE__*/React.createElement("div", {
174
+ onClick: function onClick(e) {
175
+ return e.stopPropagation();
176
+ }
177
+ }, /*#__PURE__*/React.createElement(SchemaComponent, {
178
+ scope: {
179
+ useCloseAction: useCloseAction,
180
+ useSaveCurrentUserValues: useSaveCurrentUserValues
181
+ },
182
+ schema: schema
183
+ }))))
184
+ };
185
+ }, [visible]);
182
186
  };