@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.
- package/es/acl/Configuration/MenuItemsProvider.js +3 -3
- package/es/application/Application.js +2 -2
- package/es/auth/SigninPage.js +12 -9
- package/es/block-provider/GanttBlockProvider.js +5 -4
- package/es/block-provider/TableBlockProvider.d.ts +1 -0
- package/es/block-provider/TableBlockProvider.js +51 -17
- package/es/collection-manager/Configuration/AddCollectionAction.js +31 -25
- package/es/collection-manager/Configuration/AddFieldAction.js +45 -32
- package/es/collection-manager/Configuration/AddSubFieldAction.js +24 -19
- package/es/collection-manager/Configuration/ConfigurationTabs.js +57 -50
- package/es/collection-manager/hooks/useOptions.js +39 -36
- package/es/collection-manager/interfaces/integer.js +1 -1
- package/es/collection-manager/interfaces/number.js +3 -3
- package/es/collection-manager/interfaces/percent.js +3 -3
- package/es/formula/Expression.js +66 -46
- package/es/hooks/index.d.ts +1 -0
- package/es/hooks/index.js +1 -0
- package/es/hooks/useAdminSchemaUid.d.ts +1 -0
- package/es/hooks/useAdminSchemaUid.js +6 -0
- package/es/hooks/useMenuItem.d.ts +37 -0
- package/es/hooks/useMenuItem.js +93 -0
- package/es/index.d.ts +2 -3
- package/es/index.js +3 -4
- package/es/locale/en_US.d.ts +3 -1
- package/es/locale/en_US.js +4 -2
- package/es/locale/es_ES.d.ts +1 -1
- package/es/locale/es_ES.js +1 -1
- package/es/locale/ja_JP.d.ts +3 -1
- package/es/locale/ja_JP.js +4 -2
- package/es/locale/pt_BR.d.ts +1 -1
- package/es/locale/pt_BR.js +1 -1
- package/es/locale/ru_RU.d.ts +1 -1
- package/es/locale/ru_RU.js +1 -1
- package/es/locale/zh_CN.d.ts +3 -1
- package/es/locale/zh_CN.js +3 -1
- package/es/pm/Card.js +5 -5
- package/es/pm/PluginManagerLink.js +16 -12
- package/es/pm/index.d.ts +2 -1
- package/es/pm/index.js +36 -22
- package/es/route-switch/antd/admin-layout/index.js +5 -5
- package/es/schema-component/antd/action/Action.Designer.js +3 -5
- package/es/schema-component/antd/action/Action.Drawer.js +1 -1
- package/es/schema-component/antd/action/ActionBar.js +1 -1
- package/es/schema-component/antd/association-field/Editable.js +1 -2
- package/es/schema-component/antd/association-field/Nester.js +7 -1
- package/es/schema-component/antd/association-field/SubTable.js +1 -1
- package/es/schema-component/antd/calendar/DeleteEvent.js +1 -1
- package/es/schema-component/antd/cascader/Cascader.js +1 -1
- package/es/schema-component/antd/form-item/FormItem.js +10 -3
- package/es/schema-component/antd/form-v2/Form.js +2 -2
- package/es/schema-component/antd/gantt/components/gantt/gantt.js +0 -1
- package/es/schema-component/antd/gantt/components/grid/grid-body.js +3 -3
- package/es/schema-component/antd/gantt/components/task-item/bar/bar-small.js +1 -1
- package/es/schema-component/antd/gantt/components/task-item/task-item.js +1 -1
- package/es/schema-component/antd/gantt/helpers/bar-helper.d.ts +1 -1
- package/es/schema-component/antd/gantt/helpers/bar-helper.js +4 -4
- package/es/schema-component/antd/gantt/helpers/other-helper.js +3 -1
- package/es/schema-component/antd/grid/Grid.js +2 -2
- package/es/schema-component/antd/grid-card/GridCard.Designer.js +3 -4
- package/es/schema-component/antd/grid-card/GridCard.Item.js +3 -3
- package/es/schema-component/antd/index.less +1 -3
- package/es/schema-component/antd/list/List.Decorator.js +3 -3
- package/es/schema-component/antd/list/List.Item.js +2 -2
- package/es/schema-component/antd/list/List.d.ts +2 -2
- package/es/schema-component/antd/list/List.js +6 -6
- package/es/schema-component/antd/menu/Menu.js +306 -156
- package/es/schema-component/antd/page/Page.js +29 -23
- package/es/schema-component/antd/remote-select/RemoteSelect.js +60 -10
- package/es/schema-component/antd/remote-select/utils.d.ts +4 -0
- package/es/schema-component/antd/remote-select/utils.js +31 -0
- package/es/schema-component/antd/table-v2/FilterDynamicComponent.js +17 -2
- package/es/schema-component/antd/table-v2/Table.Column.Designer.js +51 -12
- package/es/schema-component/antd/table-v2/Table.js +28 -47
- package/es/schema-component/antd/table-v2/utils.d.ts +0 -1
- package/es/schema-component/antd/table-v2/utils.js +0 -28
- package/es/schema-component/antd/tabs/Tabs.js +35 -22
- package/es/schema-component/antd/tabs/context.d.ts +1 -1
- package/es/schema-component/antd/upload/ReadPretty.js +7 -3
- package/es/schema-component/antd/variable/VariableSelect.js +1 -1
- package/es/schema-component/common/utils/uitls.d.ts +1 -0
- package/es/schema-component/common/utils/uitls.js +1 -1
- package/es/schema-initializer/SchemaInitializer.d.ts +7 -2
- package/es/schema-initializer/SchemaInitializer.js +158 -103
- package/es/schema-initializer/SelectCollection.d.ts +1 -2
- package/es/schema-initializer/SelectCollection.js +19 -16
- package/es/schema-initializer/buttons/TableActionColumnInitializers.js +1 -1
- package/es/schema-initializer/buttons/TableActionInitializers.js +5 -5
- package/es/schema-initializer/buttons/TableColumnInitializers.js +3 -2
- package/es/schema-initializer/components/CreateRecordAction.js +37 -27
- package/es/schema-initializer/components/assigned-field/AssignedField.js +2 -1
- package/es/schema-initializer/items/CalendarBlockInitializer.js +2 -2
- package/es/schema-initializer/utils.d.ts +0 -1
- package/es/schema-initializer/utils.js +40 -25
- package/es/schema-settings/SchemaSettings.js +110 -29
- package/es/schema-settings/VariableInput/hooks/useFormVariable.d.ts +19 -0
- package/es/schema-settings/VariableInput/hooks/useFormVariable.js +89 -0
- package/es/schema-settings/VariableInput/hooks/useIterationVariable.d.ts +8 -0
- package/es/schema-settings/VariableInput/hooks/useIterationVariable.js +77 -0
- package/es/schema-settings/VariableInput/hooks/useVariableOptions.d.ts +5 -12
- package/es/schema-settings/VariableInput/hooks/useVariableOptions.js +19 -3
- package/es/schema-templates/BlockTemplateDetails.js +5 -1
- package/es/schema-templates/BlockTemplatePage.js +4 -1
- package/es/user/ChangePassword.d.ts +1 -2
- package/es/user/ChangePassword.js +30 -26
- package/es/user/CurrentUser.js +172 -141
- package/es/user/EditProfile.d.ts +1 -2
- package/es/user/EditProfile.js +30 -24
- package/es/user/LanguageSettings.d.ts +1 -2
- package/es/user/LanguageSettings.js +67 -64
- package/es/user/SigninPage.js +25 -22
- package/es/user/SwitchRole.d.ts +1 -2
- package/es/user/SwitchRole.js +54 -49
- package/es/user/ThemeSettings.d.ts +1 -2
- package/es/user/ThemeSettings.js +56 -52
- package/lib/acl/Configuration/MenuItemsProvider.js +3 -3
- package/lib/application/Application.js +2 -2
- package/lib/auth/SigninPage.js +25 -22
- package/lib/block-provider/GanttBlockProvider.js +5 -4
- package/lib/block-provider/TableBlockProvider.d.ts +1 -0
- package/lib/block-provider/TableBlockProvider.js +53 -17
- package/lib/collection-manager/Configuration/AddCollectionAction.js +29 -23
- package/lib/collection-manager/Configuration/AddFieldAction.js +43 -30
- package/lib/collection-manager/Configuration/AddSubFieldAction.js +22 -17
- package/lib/collection-manager/Configuration/ConfigurationTabs.js +57 -49
- package/lib/collection-manager/hooks/useOptions.js +39 -36
- package/lib/collection-manager/interfaces/integer.js +1 -1
- package/lib/collection-manager/interfaces/number.js +3 -3
- package/lib/collection-manager/interfaces/percent.js +3 -3
- package/lib/formula/Expression.js +64 -44
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/index.js +11 -0
- package/lib/hooks/useAdminSchemaUid.d.ts +1 -0
- package/lib/hooks/useAdminSchemaUid.js +13 -0
- package/lib/hooks/useMenuItem.d.ts +37 -0
- package/lib/hooks/useMenuItem.js +108 -0
- package/lib/index.d.ts +2 -3
- package/lib/index.js +22 -33
- package/lib/locale/en_US.d.ts +3 -1
- package/lib/locale/en_US.js +4 -2
- package/lib/locale/es_ES.d.ts +1 -1
- package/lib/locale/es_ES.js +1 -1
- package/lib/locale/ja_JP.d.ts +3 -1
- package/lib/locale/ja_JP.js +4 -2
- package/lib/locale/pt_BR.d.ts +1 -1
- package/lib/locale/pt_BR.js +1 -1
- package/lib/locale/ru_RU.d.ts +1 -1
- package/lib/locale/ru_RU.js +1 -1
- package/lib/locale/zh_CN.d.ts +3 -1
- package/lib/locale/zh_CN.js +3 -1
- package/lib/pm/Card.js +6 -6
- package/lib/pm/PluginManagerLink.js +15 -10
- package/lib/pm/index.d.ts +2 -1
- package/lib/pm/index.js +37 -23
- package/lib/route-switch/antd/admin-layout/index.js +4 -4
- package/lib/schema-component/antd/action/Action.Designer.js +2 -4
- package/lib/schema-component/antd/action/Action.Drawer.js +1 -1
- package/lib/schema-component/antd/association-field/Editable.js +0 -1
- package/lib/schema-component/antd/association-field/Nester.js +6 -0
- package/lib/schema-component/antd/association-field/SubTable.js +1 -1
- package/lib/schema-component/antd/calendar/DeleteEvent.js +1 -1
- package/lib/schema-component/antd/cascader/Cascader.js +1 -1
- package/lib/schema-component/antd/form-item/FormItem.js +10 -3
- package/lib/schema-component/antd/form-v2/Form.js +2 -2
- package/lib/schema-component/antd/gantt/components/gantt/gantt.js +0 -1
- package/lib/schema-component/antd/gantt/components/grid/grid-body.js +2 -2
- package/lib/schema-component/antd/gantt/components/task-item/bar/bar-small.js +1 -1
- package/lib/schema-component/antd/gantt/components/task-item/task-item.js +1 -1
- package/lib/schema-component/antd/gantt/helpers/bar-helper.d.ts +1 -1
- package/lib/schema-component/antd/gantt/helpers/bar-helper.js +4 -4
- package/lib/schema-component/antd/gantt/helpers/other-helper.js +3 -1
- package/lib/schema-component/antd/grid/Grid.js +1 -1
- package/lib/schema-component/antd/grid-card/GridCard.Designer.js +4 -5
- package/lib/schema-component/antd/grid-card/GridCard.Item.js +8 -8
- package/lib/schema-component/antd/index.less +1 -3
- package/lib/schema-component/antd/list/List.Decorator.js +3 -3
- package/lib/schema-component/antd/list/List.Item.js +6 -6
- package/lib/schema-component/antd/list/List.d.ts +2 -2
- package/lib/schema-component/antd/list/List.js +24 -24
- package/lib/schema-component/antd/menu/Menu.js +304 -154
- package/lib/schema-component/antd/page/Page.js +29 -23
- package/lib/schema-component/antd/remote-select/RemoteSelect.js +57 -7
- package/lib/schema-component/antd/remote-select/utils.d.ts +4 -0
- package/lib/schema-component/antd/remote-select/utils.js +41 -0
- package/lib/schema-component/antd/table-v2/FilterDynamicComponent.js +17 -2
- package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +50 -11
- package/lib/schema-component/antd/table-v2/Table.js +26 -45
- package/lib/schema-component/antd/table-v2/utils.d.ts +0 -1
- package/lib/schema-component/antd/table-v2/utils.js +0 -29
- package/lib/schema-component/antd/tabs/Tabs.js +34 -21
- package/lib/schema-component/antd/tabs/context.d.ts +1 -1
- package/lib/schema-component/antd/upload/ReadPretty.js +7 -3
- package/lib/schema-component/antd/variable/VariableSelect.js +1 -1
- package/lib/schema-component/common/utils/uitls.d.ts +1 -0
- package/lib/schema-component/common/utils/uitls.js +3 -1
- package/lib/schema-initializer/SchemaInitializer.d.ts +7 -2
- package/lib/schema-initializer/SchemaInitializer.js +155 -101
- package/lib/schema-initializer/SelectCollection.d.ts +1 -2
- package/lib/schema-initializer/SelectCollection.js +22 -17
- package/lib/schema-initializer/buttons/TableActionColumnInitializers.js +1 -1
- package/lib/schema-initializer/buttons/TableActionInitializers.js +5 -5
- package/lib/schema-initializer/buttons/TableColumnInitializers.js +2 -1
- package/lib/schema-initializer/components/CreateRecordAction.js +35 -25
- package/lib/schema-initializer/components/assigned-field/AssignedField.js +2 -1
- package/lib/schema-initializer/items/CalendarBlockInitializer.js +9 -9
- package/lib/schema-initializer/utils.d.ts +0 -1
- package/lib/schema-initializer/utils.js +41 -25
- package/lib/schema-settings/SchemaSettings.js +106 -27
- package/lib/schema-settings/VariableInput/hooks/useFormVariable.d.ts +19 -0
- package/lib/schema-settings/VariableInput/hooks/useFormVariable.js +96 -0
- package/lib/schema-settings/VariableInput/hooks/useIterationVariable.d.ts +8 -0
- package/lib/schema-settings/VariableInput/hooks/useIterationVariable.js +84 -0
- package/lib/schema-settings/VariableInput/hooks/useVariableOptions.d.ts +5 -12
- package/lib/schema-settings/VariableInput/hooks/useVariableOptions.js +19 -3
- package/lib/schema-templates/BlockTemplateDetails.js +5 -1
- package/lib/schema-templates/BlockTemplatePage.js +5 -2
- package/lib/user/ChangePassword.d.ts +1 -2
- package/lib/user/ChangePassword.js +30 -26
- package/lib/user/CurrentUser.js +166 -135
- package/lib/user/EditProfile.d.ts +1 -2
- package/lib/user/EditProfile.js +31 -25
- package/lib/user/LanguageSettings.d.ts +1 -2
- package/lib/user/LanguageSettings.js +66 -63
- package/lib/user/SigninPage.js +25 -22
- package/lib/user/SwitchRole.d.ts +1 -2
- package/lib/user/SwitchRole.js +57 -51
- package/lib/user/ThemeSettings.d.ts +1 -2
- package/lib/user/ThemeSettings.js +59 -54
- package/package.json +9 -8
- package/es/settings-form/SettingsForm.d.ts +0 -13
- package/es/settings-form/SettingsForm.js +0 -309
- package/es/settings-form/index.d.ts +0 -1
- package/es/settings-form/index.js +0 -1
- package/lib/settings-form/SettingsForm.d.ts +0 -13
- package/lib/settings-form/SettingsForm.js +0 -320
- package/lib/settings-form/index.d.ts +0 -1
- 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,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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
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
|
|
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 '
|
|
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
|
-
|
|
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 {
|
|
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
|
|
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
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
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
|
};
|