@nocobase/client 0.10.0-alpha.2 → 0.10.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/acl/Configuration/MenuItemsProvider.js +3 -3
- package/es/application/Application.js +2 -2
- package/es/auth/SigninPage.js +12 -9
- 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 +90 -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 +4 -4
- 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/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/grid-card/GridCard.Designer.js +3 -4
- package/es/schema-component/antd/index.less +1 -3
- 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 +58 -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 +9 -7
- 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 +155 -102
- 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 +123 -46
- 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/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 +104 -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 +3 -3
- 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/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/grid-card/GridCard.Designer.js +4 -5
- package/lib/schema-component/antd/index.less +1 -3
- 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 +55 -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 +9 -7
- 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 +154 -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 +122 -45
- 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,19 @@
|
|
|
1
|
+
import { Schema } from '@formily/react';
|
|
2
|
+
export declare const useFormVariable: ({ blockForm, rootCollection, operator, schema, level, }: {
|
|
3
|
+
blockForm?: any;
|
|
4
|
+
rootCollection: string;
|
|
5
|
+
operator?: any;
|
|
6
|
+
schema: Schema;
|
|
7
|
+
level?: number;
|
|
8
|
+
}) => {
|
|
9
|
+
label: string;
|
|
10
|
+
value: string;
|
|
11
|
+
key: string;
|
|
12
|
+
children: any[];
|
|
13
|
+
isLeaf: boolean;
|
|
14
|
+
field: {
|
|
15
|
+
target: string;
|
|
16
|
+
};
|
|
17
|
+
depth: number;
|
|
18
|
+
loadChildren: (option: any) => Promise<void>;
|
|
19
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useFormVariable = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _schemaComponent = require("../../../schema-component");
|
|
9
|
+
var getChildren = function getChildren(options, _ref) {
|
|
10
|
+
var depth = _ref.depth,
|
|
11
|
+
maxDepth = _ref.maxDepth,
|
|
12
|
+
loadChildren = _ref.loadChildren,
|
|
13
|
+
compile = _ref.compile;
|
|
14
|
+
var result = options.map(function (option) {
|
|
15
|
+
if (!option.target) {
|
|
16
|
+
return {
|
|
17
|
+
key: option.name,
|
|
18
|
+
value: option.name,
|
|
19
|
+
label: compile(option.title),
|
|
20
|
+
depth: depth
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
if (depth >= maxDepth) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
key: option.name,
|
|
28
|
+
value: option.name,
|
|
29
|
+
label: compile(option.title),
|
|
30
|
+
children: [],
|
|
31
|
+
isLeaf: false,
|
|
32
|
+
field: option,
|
|
33
|
+
depth: depth,
|
|
34
|
+
loadChildren: loadChildren
|
|
35
|
+
};
|
|
36
|
+
}).filter(Boolean);
|
|
37
|
+
return result;
|
|
38
|
+
};
|
|
39
|
+
var useFormVariable = function useFormVariable(_ref2) {
|
|
40
|
+
var blockForm = _ref2.blockForm,
|
|
41
|
+
rootCollection = _ref2.rootCollection,
|
|
42
|
+
operator = _ref2.operator,
|
|
43
|
+
schema = _ref2.schema,
|
|
44
|
+
level = _ref2.level;
|
|
45
|
+
var compile = (0, _schemaComponent.useCompile)();
|
|
46
|
+
var getFilterOptions = (0, _schemaComponent.useGetFilterOptions)();
|
|
47
|
+
var loadChildren = function loadChildren(option) {
|
|
48
|
+
var _option$field;
|
|
49
|
+
if (!((_option$field = option.field) === null || _option$field === void 0 ? void 0 : _option$field.target)) {
|
|
50
|
+
return new Promise(function (resolve) {
|
|
51
|
+
resolve(void 0);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
var collectionName = option.field.target;
|
|
55
|
+
var fields = getFilterOptions(collectionName);
|
|
56
|
+
var allowFields = option.depth === 0 ? fields.filter(function (field) {
|
|
57
|
+
return Object.keys(blockForm.fields).some(function (name) {
|
|
58
|
+
return name.includes(".".concat(field.name));
|
|
59
|
+
});
|
|
60
|
+
}) : fields;
|
|
61
|
+
return new Promise(function (resolve) {
|
|
62
|
+
setTimeout(function () {
|
|
63
|
+
var children = getChildren(allowFields, {
|
|
64
|
+
depth: option.depth + 1,
|
|
65
|
+
maxDepth: 4,
|
|
66
|
+
loadChildren: loadChildren,
|
|
67
|
+
compile: compile
|
|
68
|
+
}) || [];
|
|
69
|
+
if (children.length === 0) {
|
|
70
|
+
option.disabled = true;
|
|
71
|
+
resolve();
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
option.children = children;
|
|
75
|
+
resolve();
|
|
76
|
+
// 延迟 5 毫秒,防止阻塞主线程,导致 UI 卡顿
|
|
77
|
+
}, 5);
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
var result = (0, _react.useMemo)(function () {
|
|
81
|
+
return blockForm && {
|
|
82
|
+
label: "{{t(\"Current form\")}}",
|
|
83
|
+
value: '$form',
|
|
84
|
+
key: '$form',
|
|
85
|
+
children: [],
|
|
86
|
+
isLeaf: false,
|
|
87
|
+
field: {
|
|
88
|
+
target: rootCollection
|
|
89
|
+
},
|
|
90
|
+
depth: 0,
|
|
91
|
+
loadChildren: loadChildren
|
|
92
|
+
};
|
|
93
|
+
}, [rootCollection]);
|
|
94
|
+
return result;
|
|
95
|
+
};
|
|
96
|
+
exports.useFormVariable = useFormVariable;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useIterationVariable = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _schemaComponent = require("../../../schema-component");
|
|
9
|
+
var getChildren = function getChildren(options, _ref) {
|
|
10
|
+
var schema = _ref.schema,
|
|
11
|
+
operator = _ref.operator,
|
|
12
|
+
maxDepth = _ref.maxDepth,
|
|
13
|
+
_ref$count = _ref.count,
|
|
14
|
+
count = _ref$count === void 0 ? 1 : _ref$count,
|
|
15
|
+
getFilterOptions = _ref.getFilterOptions;
|
|
16
|
+
if (count > maxDepth) {
|
|
17
|
+
return [];
|
|
18
|
+
}
|
|
19
|
+
var result = options.map(function (option) {
|
|
20
|
+
if (option.type !== 'belongsTo' && option.type !== 'hasOne' || !option.target) {
|
|
21
|
+
return {
|
|
22
|
+
key: option.name,
|
|
23
|
+
value: option.name,
|
|
24
|
+
label: option.title,
|
|
25
|
+
// TODO: 现在是通过组件的名称来过滤能够被选择的选项,这样的坏处是不够精确,后续可以优化
|
|
26
|
+
// disabled: schema?.['x-component'] !== option.schema?.['x-component'],
|
|
27
|
+
disabled: false
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
var children = getChildren(getFilterOptions(option.target), {
|
|
31
|
+
schema: schema,
|
|
32
|
+
operator: operator,
|
|
33
|
+
maxDepth: maxDepth,
|
|
34
|
+
count: count + 1,
|
|
35
|
+
getFilterOptions: getFilterOptions
|
|
36
|
+
}) || [];
|
|
37
|
+
return {
|
|
38
|
+
key: option.name,
|
|
39
|
+
value: option.name,
|
|
40
|
+
label: option.title,
|
|
41
|
+
children: children,
|
|
42
|
+
disabled: children.every(function (child) {
|
|
43
|
+
return child.disabled;
|
|
44
|
+
})
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
return result;
|
|
48
|
+
};
|
|
49
|
+
var useIterationVariable = function useIterationVariable(_ref2) {
|
|
50
|
+
var blockForm = _ref2.blockForm,
|
|
51
|
+
collectionField = _ref2.collectionField,
|
|
52
|
+
operator = _ref2.operator,
|
|
53
|
+
schema = _ref2.schema,
|
|
54
|
+
level = _ref2.level,
|
|
55
|
+
rootCollection = _ref2.rootCollection;
|
|
56
|
+
var compile = (0, _schemaComponent.useCompile)();
|
|
57
|
+
var getFilterOptions = (0, _schemaComponent.useGetFilterOptions)();
|
|
58
|
+
var fields = getFilterOptions(collectionField === null || collectionField === void 0 ? void 0 : collectionField.collectionName);
|
|
59
|
+
var children = (0, _react.useMemo)(function () {
|
|
60
|
+
var allowFields = fields.filter(function (field) {
|
|
61
|
+
return Object.keys(blockForm.fields).some(function (name) {
|
|
62
|
+
return name.includes(field.name);
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
return getChildren(allowFields, {
|
|
66
|
+
schema: schema,
|
|
67
|
+
operator: operator,
|
|
68
|
+
maxDepth: level || 3,
|
|
69
|
+
getFilterOptions: getFilterOptions
|
|
70
|
+
}) || [];
|
|
71
|
+
}, [operator, schema, blockForm]);
|
|
72
|
+
return (0, _react.useMemo)(function () {
|
|
73
|
+
return rootCollection !== (collectionField === null || collectionField === void 0 ? void 0 : collectionField.collectionName) && children.length > 0 ? compile({
|
|
74
|
+
label: "{{t(\"Current object\")}}",
|
|
75
|
+
value: '$iteration',
|
|
76
|
+
key: '$iteration',
|
|
77
|
+
disabled: children.every(function (option) {
|
|
78
|
+
return option.disabled;
|
|
79
|
+
}),
|
|
80
|
+
children: children
|
|
81
|
+
}) : null;
|
|
82
|
+
}, [children]);
|
|
83
|
+
};
|
|
84
|
+
exports.useIterationVariable = useIterationVariable;
|
|
@@ -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[];
|
|
@@ -8,7 +8,12 @@ var _react = require("react");
|
|
|
8
8
|
var _useValues2 = require("../../../schema-component/antd/filter/useValues");
|
|
9
9
|
var _useDateVariable = require("./useDateVariable");
|
|
10
10
|
var _useUserVariable = require("./useUserVariable");
|
|
11
|
-
var
|
|
11
|
+
var _useFormVariable = require("./useFormVariable");
|
|
12
|
+
var _useIterationVariable = require("./useIterationVariable");
|
|
13
|
+
var useVariableOptions = function useVariableOptions(_ref) {
|
|
14
|
+
var form = _ref.form,
|
|
15
|
+
collectionField = _ref.collectionField,
|
|
16
|
+
rootCollection = _ref.rootCollection;
|
|
12
17
|
var _useValues = (0, _useValues2.useValues)(),
|
|
13
18
|
operator = _useValues.operator,
|
|
14
19
|
schema = _useValues.schema;
|
|
@@ -20,9 +25,20 @@ var useVariableOptions = function useVariableOptions() {
|
|
|
20
25
|
operator: operator,
|
|
21
26
|
schema: schema
|
|
22
27
|
});
|
|
28
|
+
var formVariabele = (0, _useFormVariable.useFormVariable)({
|
|
29
|
+
blockForm: form,
|
|
30
|
+
rootCollection: rootCollection,
|
|
31
|
+
schema: schema
|
|
32
|
+
});
|
|
33
|
+
var iterationVariabele = (0, _useIterationVariable.useIterationVariable)({
|
|
34
|
+
blockForm: form,
|
|
35
|
+
collectionField: collectionField,
|
|
36
|
+
schema: schema,
|
|
37
|
+
rootCollection: rootCollection
|
|
38
|
+
});
|
|
23
39
|
var result = (0, _react.useMemo)(function () {
|
|
24
|
-
return [userVariable, dateVariable];
|
|
25
|
-
}, [dateVariable, userVariable]);
|
|
40
|
+
return [userVariable, dateVariable, formVariabele, iterationVariabele].filter(Boolean);
|
|
41
|
+
}, [dateVariable, userVariable, formVariabele, iterationVariabele]);
|
|
26
42
|
if (!operator || !schema) return [];
|
|
27
43
|
return result;
|
|
28
44
|
};
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.BlockTemplateDetails = void 0;
|
|
8
|
+
var _proLayout = require("@ant-design/pro-layout");
|
|
8
9
|
var _antd = require("antd");
|
|
9
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
11
|
var _reactRouterDom = require("react-router-dom");
|
|
@@ -92,7 +93,10 @@ var BlockTemplateDetails = function BlockTemplateDetails() {
|
|
|
92
93
|
if (loading) {
|
|
93
94
|
return /*#__PURE__*/_react.default.createElement(_antd.Spin, null);
|
|
94
95
|
}
|
|
95
|
-
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(
|
|
96
|
+
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_proLayout.PageHeader, {
|
|
97
|
+
style: {
|
|
98
|
+
backgroundColor: 'white'
|
|
99
|
+
},
|
|
96
100
|
onBack: function onBack() {
|
|
97
101
|
navigate('/admin/plugins/block-templates');
|
|
98
102
|
},
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.BlockTemplatesPane = exports.BlockTemplatePage = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _proLayout = require("@ant-design/pro-layout");
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _reactI18next = require("react-i18next");
|
|
10
10
|
var _collectionManager = require("../collection-manager");
|
|
@@ -15,7 +15,10 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
15
15
|
var BlockTemplatePage = function BlockTemplatePage() {
|
|
16
16
|
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
17
17
|
t = _useTranslation.t;
|
|
18
|
-
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(
|
|
18
|
+
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_proLayout.PageHeader, {
|
|
19
|
+
style: {
|
|
20
|
+
backgroundColor: 'white'
|
|
21
|
+
},
|
|
19
22
|
ghost: false,
|
|
20
23
|
title: t('Block templates')
|
|
21
24
|
}), /*#__PURE__*/_react.default.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;
|
|
@@ -4,15 +4,13 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
7
|
+
exports.useChangePassword = void 0;
|
|
8
8
|
var _react = require("@formily/react");
|
|
9
9
|
var _shared = require("@formily/shared");
|
|
10
|
-
var _antd = require("antd");
|
|
11
10
|
var _react2 = _interopRequireWildcard(require("react"));
|
|
12
11
|
var _reactI18next = require("react-i18next");
|
|
13
12
|
var _ = require("../");
|
|
14
13
|
var _apiClient = require("../api-client");
|
|
15
|
-
var _CurrentUser = require("./CurrentUser");
|
|
16
14
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
15
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
18
16
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
@@ -159,33 +157,39 @@ var schema = {
|
|
|
159
157
|
}
|
|
160
158
|
})
|
|
161
159
|
};
|
|
162
|
-
var
|
|
160
|
+
var useChangePassword = function useChangePassword() {
|
|
161
|
+
var ctx = (0, _react2.useContext)(_.DropdownVisibleContext);
|
|
163
162
|
var _useState = (0, _react2.useState)(false),
|
|
164
163
|
_useState2 = _slicedToArray(_useState, 2),
|
|
165
164
|
visible = _useState2[0],
|
|
166
165
|
setVisible = _useState2[1];
|
|
167
166
|
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
168
167
|
t = _useTranslation.t;
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
168
|
+
return (0, _react2.useMemo)(function () {
|
|
169
|
+
return {
|
|
170
|
+
key: 'password',
|
|
171
|
+
eventKey: 'ChangePassword',
|
|
172
|
+
onClick: function onClick() {
|
|
173
|
+
setVisible(true);
|
|
174
|
+
ctx === null || ctx === void 0 ? void 0 : ctx.setVisible(false);
|
|
175
|
+
},
|
|
176
|
+
label: /*#__PURE__*/_react2.default.createElement(_react2.default.Fragment, null, t('Change password'), /*#__PURE__*/_react2.default.createElement(_.ActionContextProvider, {
|
|
177
|
+
value: {
|
|
178
|
+
visible: visible,
|
|
179
|
+
setVisible: setVisible
|
|
180
|
+
}
|
|
181
|
+
}, /*#__PURE__*/_react2.default.createElement("div", {
|
|
182
|
+
onClick: function onClick(e) {
|
|
183
|
+
return e.stopPropagation();
|
|
184
|
+
}
|
|
185
|
+
}, /*#__PURE__*/_react2.default.createElement(_.SchemaComponent, {
|
|
186
|
+
scope: {
|
|
187
|
+
useCloseAction: useCloseAction,
|
|
188
|
+
useSaveCurrentUserValues: useSaveCurrentUserValues
|
|
189
|
+
},
|
|
190
|
+
schema: schema
|
|
191
|
+
}))))
|
|
192
|
+
};
|
|
193
|
+
}, [visible]);
|
|
190
194
|
};
|
|
191
|
-
exports.
|
|
195
|
+
exports.useChangePassword = useChangePassword;
|