@nocobase/client 0.7.2-alpha.6 → 0.7.4-alpha.1
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/application/Application.d.ts +1 -0
- package/es/application/Application.js +7 -1
- package/es/block-provider/FormBlockProvider.js +8 -3
- package/es/block-provider/TableFieldProvider.d.ts +1 -0
- package/es/block-provider/TableFieldProvider.js +5 -2
- package/es/block-provider/TableSelectorProvider.js +41 -13
- package/es/block-provider/hooks/index.d.ts +6 -0
- package/es/block-provider/hooks/index.js +159 -65
- package/es/collection-manager/CollectionField.js +4 -2
- package/es/collection-manager/Configuration/index.js +5 -1
- package/es/collection-manager/Configuration/schemas/collections.js +2 -1
- package/es/collection-manager/interfaces/input.js +103 -0
- package/es/collection-manager/interfaces/integer.js +63 -0
- package/es/collection-manager/interfaces/m2m.js +2 -0
- package/es/collection-manager/interfaces/m2o.js +1 -0
- package/es/collection-manager/interfaces/markdown.js +34 -0
- package/es/collection-manager/interfaces/number.js +55 -0
- package/es/collection-manager/interfaces/o2m.js +1 -0
- package/es/collection-manager/interfaces/o2o.js +3 -0
- package/es/collection-manager/interfaces/password.js +36 -1
- package/es/collection-manager/interfaces/percent.js +97 -0
- package/es/collection-manager/interfaces/properties/index.d.ts +1 -0
- package/es/collection-manager/interfaces/properties/index.js +1 -0
- package/es/collection-manager/interfaces/properties/operators.js +4 -4
- package/es/collection-manager/interfaces/richText.js +34 -0
- package/es/collection-manager/interfaces/textarea.js +34 -0
- package/es/file-manager/FileStorageShortcut.js +2 -2
- package/es/locale/en_US.d.ts +8 -2
- package/es/locale/en_US.js +9 -3
- package/es/locale/zh_CN.d.ts +26 -2
- package/es/locale/zh_CN.js +27 -3
- package/es/plugin-manager/PluginManager.d.ts +1 -0
- package/es/plugin-manager/PluginManager.js +20 -6
- package/es/schema-component/antd/action/Action.Modal.js +1 -1
- package/es/schema-component/antd/calendar/Calendar.Designer.js +16 -10
- package/es/schema-component/antd/date-picker/DatePicker.d.ts +1 -1
- package/es/schema-component/antd/date-picker/DatePicker.js +1 -1
- package/es/schema-component/antd/date-picker/ReadPretty.js +1 -1
- package/es/schema-component/antd/date-picker/util.d.ts +0 -10
- package/es/schema-component/antd/date-picker/util.js +1 -79
- package/es/schema-component/antd/form-item/FormItem.js +161 -10
- package/es/schema-component/antd/grid/Grid.js +72 -6
- package/es/schema-component/antd/input-number/InputNumber.d.ts +1 -5
- package/es/schema-component/antd/input-number/InputNumber.js +25 -1
- package/es/schema-component/antd/input-number/ReadPretty.js +2 -4
- package/es/schema-component/antd/kanban/Kanban.Card.Designer.js +20 -14
- package/es/schema-component/antd/menu/Menu.js +6 -3
- package/es/schema-component/antd/percent/Percent.js +2 -2
- package/es/schema-component/antd/record-picker/InputRecordPicker.js +27 -13
- package/es/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +5 -3
- package/es/schema-component/antd/table/Table.Array.js +2 -2
- package/es/schema-component/antd/table/Table.Void.js +11 -1
- package/es/schema-component/antd/table-v2/Table.Column.Designer.js +3 -1
- package/es/schema-component/antd/table-v2/Table.d.ts +0 -11
- package/es/schema-component/antd/table-v2/Table.js +163 -92
- package/es/schema-component/antd/table-v2/TableField.js +3 -0
- package/es/schema-component/antd/tabs/Tabs.Designer.js +23 -12
- package/es/schema-component/antd/tabs/Tabs.js +7 -1
- package/es/schema-component/antd/time-picker/ReadPretty.js +11 -5
- package/es/schema-component/core/DesignableSwitch.js +7 -1
- package/es/schema-component/hooks/useDesignable.js +21 -21
- package/es/schema-component/hooks/useProps.js +1 -1
- package/es/schema-initializer/buttons/FormItemInitializers.js +14 -3
- package/es/schema-initializer/buttons/ReadPrettyFormActionInitializers.js +8 -0
- package/es/schema-initializer/buttons/ReadPrettyFormItemInitializers.js +14 -3
- package/es/schema-initializer/buttons/RecordBlockInitializers.js +32 -3
- package/es/schema-initializer/buttons/TabPaneInitializers.js +11 -3
- package/es/schema-initializer/buttons/TableActionInitializers.js +11 -0
- package/es/schema-initializer/components/assigned-field/AssignedField.d.ts +4 -0
- package/es/schema-initializer/components/assigned-field/AssignedField.js +255 -69
- package/es/schema-initializer/items/index.d.ts +2 -0
- package/es/schema-initializer/items/index.js +48 -2
- package/es/schema-initializer/utils.js +22 -2
- package/es/system-settings/SystemSettingsShortcut.js +35 -12
- package/lib/application/Application.d.ts +1 -0
- package/lib/application/Application.js +11 -2
- package/lib/block-provider/FormBlockProvider.js +7 -2
- package/lib/block-provider/TableFieldProvider.d.ts +1 -0
- package/lib/block-provider/TableFieldProvider.js +4 -1
- package/lib/block-provider/TableSelectorProvider.js +41 -13
- package/lib/block-provider/hooks/index.d.ts +6 -0
- package/lib/block-provider/hooks/index.js +168 -67
- package/lib/collection-manager/CollectionField.js +5 -2
- package/lib/collection-manager/Configuration/index.js +5 -0
- package/lib/collection-manager/Configuration/schemas/collections.js +2 -1
- package/lib/collection-manager/interfaces/input.js +104 -0
- package/lib/collection-manager/interfaces/integer.js +65 -0
- package/lib/collection-manager/interfaces/m2m.js +2 -0
- package/lib/collection-manager/interfaces/m2o.js +1 -0
- package/lib/collection-manager/interfaces/markdown.js +35 -0
- package/lib/collection-manager/interfaces/number.js +56 -0
- package/lib/collection-manager/interfaces/o2m.js +1 -0
- package/lib/collection-manager/interfaces/o2o.js +3 -0
- package/lib/collection-manager/interfaces/password.js +37 -1
- package/lib/collection-manager/interfaces/percent.js +99 -0
- package/lib/collection-manager/interfaces/properties/index.d.ts +1 -0
- package/lib/collection-manager/interfaces/properties/index.js +1 -0
- package/lib/collection-manager/interfaces/properties/operators.js +4 -4
- package/lib/collection-manager/interfaces/richText.js +35 -0
- package/lib/collection-manager/interfaces/textarea.js +35 -0
- package/lib/file-manager/FileStorageShortcut.js +1 -1
- package/lib/locale/en_US.d.ts +8 -2
- package/lib/locale/en_US.js +9 -3
- package/lib/locale/zh_CN.d.ts +26 -2
- package/lib/locale/zh_CN.js +27 -3
- package/lib/plugin-manager/PluginManager.d.ts +1 -0
- package/lib/plugin-manager/PluginManager.js +23 -5
- package/lib/schema-component/antd/action/Action.Modal.js +1 -1
- package/lib/schema-component/antd/calendar/Calendar.Designer.js +16 -10
- package/lib/schema-component/antd/date-picker/DatePicker.d.ts +1 -1
- package/lib/schema-component/antd/date-picker/DatePicker.js +2 -2
- package/lib/schema-component/antd/date-picker/ReadPretty.js +6 -6
- package/lib/schema-component/antd/date-picker/util.d.ts +0 -10
- package/lib/schema-component/antd/date-picker/util.js +6 -89
- package/lib/schema-component/antd/form-item/FormItem.js +164 -12
- package/lib/schema-component/antd/grid/Grid.js +69 -3
- package/lib/schema-component/antd/input-number/InputNumber.d.ts +1 -5
- package/lib/schema-component/antd/input-number/InputNumber.js +28 -1
- package/lib/schema-component/antd/input-number/ReadPretty.js +2 -5
- package/lib/schema-component/antd/kanban/Kanban.Card.Designer.js +20 -14
- package/lib/schema-component/antd/menu/Menu.js +6 -3
- package/lib/schema-component/antd/percent/Percent.js +2 -2
- package/lib/schema-component/antd/record-picker/InputRecordPicker.js +27 -12
- package/lib/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +4 -2
- package/lib/schema-component/antd/table/Table.Array.js +2 -2
- package/lib/schema-component/antd/table/Table.Void.js +11 -1
- package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +3 -1
- package/lib/schema-component/antd/table-v2/Table.d.ts +0 -11
- package/lib/schema-component/antd/table-v2/Table.js +172 -94
- package/lib/schema-component/antd/table-v2/TableField.js +3 -0
- package/lib/schema-component/antd/tabs/Tabs.Designer.js +23 -12
- package/lib/schema-component/antd/tabs/Tabs.js +8 -1
- package/lib/schema-component/antd/time-picker/ReadPretty.js +10 -3
- package/lib/schema-component/core/DesignableSwitch.js +8 -1
- package/lib/schema-component/hooks/useDesignable.js +21 -21
- package/lib/schema-component/hooks/useProps.js +1 -1
- package/lib/schema-initializer/buttons/FormItemInitializers.js +14 -2
- package/lib/schema-initializer/buttons/ReadPrettyFormActionInitializers.js +8 -0
- package/lib/schema-initializer/buttons/ReadPrettyFormItemInitializers.js +14 -2
- package/lib/schema-initializer/buttons/RecordBlockInitializers.js +34 -4
- package/lib/schema-initializer/buttons/TabPaneInitializers.js +11 -3
- package/lib/schema-initializer/buttons/TableActionInitializers.js +11 -0
- package/lib/schema-initializer/components/assigned-field/AssignedField.d.ts +4 -0
- package/lib/schema-initializer/components/assigned-field/AssignedField.js +257 -66
- package/lib/schema-initializer/items/index.d.ts +2 -0
- package/lib/schema-initializer/items/index.js +54 -2
- package/lib/schema-initializer/utils.js +22 -2
- package/lib/system-settings/SystemSettingsShortcut.js +37 -13
- package/package.json +7 -4
|
@@ -39,28 +39,39 @@ var TabsDesigner = function TabsDesigner() {
|
|
|
39
39
|
properties: {
|
|
40
40
|
title: {
|
|
41
41
|
title: t('Tab name'),
|
|
42
|
+
required: true,
|
|
42
43
|
'x-decorator': 'FormItem',
|
|
43
44
|
'x-component': 'Input',
|
|
44
45
|
'x-component-props': {}
|
|
46
|
+
},
|
|
47
|
+
icon: {
|
|
48
|
+
title: t('Icon'),
|
|
49
|
+
'x-decorator': 'FormItem',
|
|
50
|
+
'x-component': 'IconPicker',
|
|
51
|
+
'x-component-props': {}
|
|
45
52
|
}
|
|
46
53
|
}
|
|
47
54
|
},
|
|
48
55
|
initialValues: {
|
|
49
|
-
title: field.title
|
|
56
|
+
title: field.title,
|
|
57
|
+
icon: field.componentProps.icon
|
|
50
58
|
},
|
|
51
59
|
onSubmit: function onSubmit(_ref) {
|
|
52
|
-
var
|
|
60
|
+
var _schema;
|
|
53
61
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
var title = _ref.title,
|
|
63
|
+
icon = _ref.icon;
|
|
64
|
+
var props = fieldSchema['x-component-props'] || {};
|
|
65
|
+
fieldSchema.title = title;
|
|
66
|
+
field.title = title;
|
|
67
|
+
props.icon = icon;
|
|
68
|
+
field.componentProps.icon = icon;
|
|
69
|
+
fieldSchema['x-component-props'] = fieldSchema['x-component-props'] || {};
|
|
70
|
+
fieldSchema['x-component-props'].icon = icon;
|
|
71
|
+
dn.emit('patch', {
|
|
72
|
+
schema: (_schema = {}, _defineProperty(_schema, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema, "title", title), _defineProperty(_schema, 'x-component-props', props), _schema)
|
|
73
|
+
});
|
|
74
|
+
dn.refresh();
|
|
64
75
|
}
|
|
65
76
|
}), /*#__PURE__*/_react2.default.createElement(_2.SchemaSettings.Divider, null), /*#__PURE__*/_react2.default.createElement(_2.SchemaSettings.Remove, null));
|
|
66
77
|
};
|
|
@@ -15,6 +15,8 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
15
15
|
|
|
16
16
|
var _react2 = _interopRequireDefault(require("react"));
|
|
17
17
|
|
|
18
|
+
var _icon = require("../../../icon");
|
|
19
|
+
|
|
18
20
|
var _schemaInitializer = require("../../../schema-initializer");
|
|
19
21
|
|
|
20
22
|
var _common = require("../../common");
|
|
@@ -61,6 +63,11 @@ Tabs.TabPane = (0, _react.observer)(function (props) {
|
|
|
61
63
|
var field = (0, _react.useField)();
|
|
62
64
|
return /*#__PURE__*/_react2.default.createElement(_common.SortableItem, {
|
|
63
65
|
className: (0, _classnames.default)('nb-action-link', designerCss, props.className)
|
|
64
|
-
}, props.
|
|
66
|
+
}, props.icon && /*#__PURE__*/_react2.default.createElement(_icon.Icon, {
|
|
67
|
+
style: {
|
|
68
|
+
marginRight: 2
|
|
69
|
+
},
|
|
70
|
+
type: props.icon
|
|
71
|
+
}), " ", props.tab || field.title, /*#__PURE__*/_react2.default.createElement(Designer, null));
|
|
65
72
|
});
|
|
66
73
|
Tabs.Designer = _Tabs.TabsDesigner;
|
|
@@ -11,17 +11,24 @@ var _shared = require("@formily/shared");
|
|
|
11
11
|
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
13
|
|
|
14
|
+
var _moment = _interopRequireDefault(require("moment"));
|
|
15
|
+
|
|
14
16
|
var _react = _interopRequireDefault(require("react"));
|
|
15
17
|
|
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
19
|
|
|
18
20
|
var ReadPretty = function ReadPretty(props) {
|
|
19
|
-
var
|
|
21
|
+
var value = props.value,
|
|
22
|
+
_props$format = props.format,
|
|
23
|
+
format = _props$format === void 0 ? 'HH:mm:ss' : _props$format;
|
|
20
24
|
var prefixCls = (0, _builtins__.usePrefixCls)('description-text', props);
|
|
25
|
+
var values = (0, _shared.toArr)(value);
|
|
21
26
|
|
|
22
27
|
var getLabels = function getLabels() {
|
|
23
|
-
var labels = (
|
|
24
|
-
|
|
28
|
+
var labels = values.map(function (v) {
|
|
29
|
+
return (0, _moment.default)(v, 'HH:mm:ss').format(format);
|
|
30
|
+
});
|
|
31
|
+
return labels.join('~');
|
|
25
32
|
};
|
|
26
33
|
|
|
27
34
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -15,6 +15,8 @@ var _ = require("..");
|
|
|
15
15
|
|
|
16
16
|
var _pluginManager = require("../../plugin-manager");
|
|
17
17
|
|
|
18
|
+
var _reactHotkeysHook = require("react-hotkeys-hook");
|
|
19
|
+
|
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
21
|
|
|
20
22
|
var DesignableSwitch = function DesignableSwitch() {
|
|
@@ -29,12 +31,17 @@ var DesignableSwitch = function DesignableSwitch() {
|
|
|
29
31
|
|
|
30
32
|
if (designable) {
|
|
31
33
|
style['backgroundColor'] = '#f18b62';
|
|
32
|
-
}
|
|
34
|
+
} // 快捷键切换编辑状态
|
|
35
|
+
|
|
33
36
|
|
|
37
|
+
(0, _reactHotkeysHook.useHotkeys)('Ctrl+Shift+U', function () {
|
|
38
|
+
return setDesignable(!designable);
|
|
39
|
+
}, [designable]);
|
|
34
40
|
return /*#__PURE__*/_react.default.createElement(_pluginManager.PluginManager.Toolbar.Item, {
|
|
35
41
|
selected: designable,
|
|
36
42
|
icon: /*#__PURE__*/_react.default.createElement(_icons.HighlightOutlined, null),
|
|
37
43
|
title: t('UI Editor'),
|
|
44
|
+
subtitle: 'Ctrl+Shift+U',
|
|
38
45
|
style: style,
|
|
39
46
|
onClick: function onClick() {
|
|
40
47
|
setDesignable(!designable);
|
|
@@ -755,6 +755,27 @@ var Designable = /*#__PURE__*/function () {
|
|
|
755
755
|
wrap = _options$wrap4 === void 0 ? defaultWrap : _options$wrap4,
|
|
756
756
|
breakRemoveOn = options.breakRemoveOn,
|
|
757
757
|
removeParentsIfNoChildren = options.removeParentsIfNoChildren;
|
|
758
|
+
var order = 0;
|
|
759
|
+
var newOrder = 0;
|
|
760
|
+
var start = false;
|
|
761
|
+
var properties = {};
|
|
762
|
+
this.current.parent.mapProperties(function (property, key) {
|
|
763
|
+
property['x-index'] = order;
|
|
764
|
+
|
|
765
|
+
if (key === _this4.current.name) {
|
|
766
|
+
++order;
|
|
767
|
+
newOrder = order;
|
|
768
|
+
start = true;
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
++order;
|
|
772
|
+
|
|
773
|
+
if (start && key !== _this4.current.name) {
|
|
774
|
+
properties[key] = property;
|
|
775
|
+
|
|
776
|
+
_this4.current.parent.removeProperty(key);
|
|
777
|
+
}
|
|
778
|
+
});
|
|
758
779
|
|
|
759
780
|
if (_react.Schema.isSchemaInstance(schema)) {
|
|
760
781
|
if (this.parentsIn(schema)) {
|
|
@@ -778,27 +799,6 @@ var Designable = /*#__PURE__*/function () {
|
|
|
778
799
|
schema = (0, _cloneDeep.default)(schema);
|
|
779
800
|
}
|
|
780
801
|
|
|
781
|
-
var order = 0;
|
|
782
|
-
var newOrder = 0;
|
|
783
|
-
var start = false;
|
|
784
|
-
var properties = {};
|
|
785
|
-
this.current.parent.mapProperties(function (property, key) {
|
|
786
|
-
property['x-index'] = order;
|
|
787
|
-
|
|
788
|
-
if (key === _this4.current.name) {
|
|
789
|
-
++order;
|
|
790
|
-
newOrder = order;
|
|
791
|
-
start = true;
|
|
792
|
-
}
|
|
793
|
-
|
|
794
|
-
++order;
|
|
795
|
-
|
|
796
|
-
if (start && key !== _this4.current.name) {
|
|
797
|
-
properties[key] = property;
|
|
798
|
-
|
|
799
|
-
_this4.current.parent.removeProperty(key);
|
|
800
|
-
}
|
|
801
|
-
});
|
|
802
802
|
this.prepareProperty(schema);
|
|
803
803
|
var wrapped = wrap(schema);
|
|
804
804
|
var s = this.current.parent.addProperty(wrapped.name || (0, _shared.uid)(), wrapped);
|
|
@@ -17,7 +17,7 @@ var useProps = function useProps(props, options) {
|
|
|
17
17
|
var useProps = props.useProps,
|
|
18
18
|
props1 = _objectWithoutProperties(props, _excluded);
|
|
19
19
|
|
|
20
|
-
var props2 =
|
|
20
|
+
var props2 = typeof useProps === 'function' ? useProps() : {};
|
|
21
21
|
return (0, _shared.merge)(props1 || {}, props2, options);
|
|
22
22
|
};
|
|
23
23
|
|
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.FormItemInitializers = void 0;
|
|
7
7
|
|
|
8
|
+
var _lodash = require("lodash");
|
|
9
|
+
|
|
8
10
|
var _react = _interopRequireDefault(require("react"));
|
|
9
11
|
|
|
10
12
|
var _reactI18next = require("react-i18next");
|
|
@@ -22,14 +24,24 @@ var FormItemInitializers = function FormItemInitializers(props) {
|
|
|
22
24
|
|
|
23
25
|
var insertPosition = props.insertPosition,
|
|
24
26
|
component = props.component;
|
|
27
|
+
var associationFields = (0, _utils.useAssociatedFormItemInitializerFields)({
|
|
28
|
+
readPretty: true,
|
|
29
|
+
block: 'Form'
|
|
30
|
+
});
|
|
25
31
|
return /*#__PURE__*/_react.default.createElement(_SchemaInitializer.SchemaInitializer.Button, {
|
|
26
32
|
wrap: _utils.gridRowColWrap,
|
|
27
33
|
icon: 'SettingOutlined',
|
|
28
|
-
items: [{
|
|
34
|
+
items: (0, _lodash.union)([{
|
|
29
35
|
type: 'itemGroup',
|
|
30
36
|
title: t('Display fields'),
|
|
31
37
|
children: (0, _utils.useFormItemInitializerFields)()
|
|
38
|
+
}], associationFields.length > 0 ? [{
|
|
39
|
+
type: 'divider'
|
|
32
40
|
}, {
|
|
41
|
+
type: 'itemGroup',
|
|
42
|
+
title: t('Display association fields'),
|
|
43
|
+
children: associationFields
|
|
44
|
+
}] : [], [{
|
|
33
45
|
type: 'divider'
|
|
34
46
|
}, {
|
|
35
47
|
type: 'item',
|
|
@@ -45,7 +57,7 @@ var FormItemInitializers = function FormItemInitializers(props) {
|
|
|
45
57
|
content: t('This is a demo text, **supports Markdown syntax**.')
|
|
46
58
|
}
|
|
47
59
|
}
|
|
48
|
-
}],
|
|
60
|
+
}]),
|
|
49
61
|
insertPosition: insertPosition,
|
|
50
62
|
component: component,
|
|
51
63
|
title: component ? null : t('Configure fields')
|
|
@@ -33,6 +33,14 @@ var ReadPrettyFormActionInitializers = {
|
|
|
33
33
|
'x-component': 'Action',
|
|
34
34
|
'x-decorator': 'ACLActionProvider'
|
|
35
35
|
}
|
|
36
|
+
}, {
|
|
37
|
+
type: 'item',
|
|
38
|
+
title: '{{t("Print")}}',
|
|
39
|
+
component: 'PrintActionInitializer',
|
|
40
|
+
schema: {
|
|
41
|
+
'x-component': 'Action',
|
|
42
|
+
'x-decorator': 'ACLActionProvider'
|
|
43
|
+
}
|
|
36
44
|
}]
|
|
37
45
|
}, {
|
|
38
46
|
type: 'divider'
|
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.ReadPrettyFormItemInitializers = void 0;
|
|
7
7
|
|
|
8
|
+
var _lodash = require("lodash");
|
|
9
|
+
|
|
8
10
|
var _react = _interopRequireDefault(require("react"));
|
|
9
11
|
|
|
10
12
|
var _reactI18next = require("react-i18next");
|
|
@@ -21,14 +23,24 @@ var ReadPrettyFormItemInitializers = function ReadPrettyFormItemInitializers(pro
|
|
|
21
23
|
|
|
22
24
|
var insertPosition = props.insertPosition,
|
|
23
25
|
component = props.component;
|
|
26
|
+
var associationFields = (0, _utils.useAssociatedFormItemInitializerFields)({
|
|
27
|
+
readPretty: true,
|
|
28
|
+
block: 'Form'
|
|
29
|
+
});
|
|
24
30
|
return /*#__PURE__*/_react.default.createElement(_SchemaInitializer.SchemaInitializer.Button, {
|
|
25
31
|
wrap: _utils.gridRowColWrap,
|
|
26
32
|
icon: 'SettingOutlined',
|
|
27
|
-
items: [{
|
|
33
|
+
items: (0, _lodash.union)([{
|
|
28
34
|
type: 'itemGroup',
|
|
29
35
|
title: t('Display fields'),
|
|
30
36
|
children: (0, _utils.useFormItemInitializerFields)()
|
|
37
|
+
}], associationFields.length > 0 ? [{
|
|
38
|
+
type: 'divider'
|
|
31
39
|
}, {
|
|
40
|
+
type: 'itemGroup',
|
|
41
|
+
title: t('Display association fields'),
|
|
42
|
+
children: associationFields
|
|
43
|
+
}] : [], [{
|
|
32
44
|
type: 'divider'
|
|
33
45
|
}, {
|
|
34
46
|
type: 'item',
|
|
@@ -44,7 +56,7 @@ var ReadPrettyFormItemInitializers = function ReadPrettyFormItemInitializers(pro
|
|
|
44
56
|
content: t('This is a demo text, **supports Markdown syntax**.')
|
|
45
57
|
}
|
|
46
58
|
}
|
|
47
|
-
}],
|
|
59
|
+
}]),
|
|
48
60
|
insertPosition: insertPosition,
|
|
49
61
|
component: component,
|
|
50
62
|
title: component ? null : t('Configure fields')
|
|
@@ -5,7 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.RecordBlockInitializers = void 0;
|
|
7
7
|
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = require("@formily/react");
|
|
9
|
+
|
|
10
|
+
var _react2 = _interopRequireDefault(require("react"));
|
|
9
11
|
|
|
10
12
|
var _reactI18next = require("react-i18next");
|
|
11
13
|
|
|
@@ -15,9 +17,37 @@ var _utils = require("../utils");
|
|
|
15
17
|
|
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
19
|
|
|
20
|
+
var recursiveParent = function recursiveParent(schema) {
|
|
21
|
+
var _schema$xDecorator;
|
|
22
|
+
|
|
23
|
+
if (!schema) return null;
|
|
24
|
+
|
|
25
|
+
if ((_schema$xDecorator = schema['x-decorator']) === null || _schema$xDecorator === void 0 ? void 0 : _schema$xDecorator.endsWith('BlockProvider')) {
|
|
26
|
+
var _schema$xDecoratorP;
|
|
27
|
+
|
|
28
|
+
return (_schema$xDecoratorP = schema['x-decorator-props']) === null || _schema$xDecoratorP === void 0 ? void 0 : _schema$xDecoratorP['collection'];
|
|
29
|
+
} else {
|
|
30
|
+
return recursiveParent(schema.parent);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
18
34
|
var useRelationFields = function useRelationFields() {
|
|
19
|
-
var
|
|
20
|
-
|
|
35
|
+
var fieldSchema = (0, _react.useFieldSchema)();
|
|
36
|
+
|
|
37
|
+
var _useCollectionManager = (0, _.useCollectionManager)(),
|
|
38
|
+
getCollectionFields = _useCollectionManager.getCollectionFields;
|
|
39
|
+
|
|
40
|
+
var fields = [];
|
|
41
|
+
|
|
42
|
+
if (fieldSchema['x-initializer']) {
|
|
43
|
+
fields = (0, _.useCollection)().fields;
|
|
44
|
+
} else {
|
|
45
|
+
var collection = recursiveParent(fieldSchema.parent);
|
|
46
|
+
|
|
47
|
+
if (collection) {
|
|
48
|
+
fields = getCollectionFields(collection);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
21
51
|
|
|
22
52
|
var relationFields = fields.filter(function (field) {
|
|
23
53
|
return ['linkTo', 'subTable', 'o2m', 'm2m', 'obo', 'oho', 'o2o', 'm2o'].includes(field.interface);
|
|
@@ -100,7 +130,7 @@ var RecordBlockInitializers = function RecordBlockInitializers(props) {
|
|
|
100
130
|
|
|
101
131
|
var insertPosition = props.insertPosition,
|
|
102
132
|
component = props.component;
|
|
103
|
-
return /*#__PURE__*/
|
|
133
|
+
return /*#__PURE__*/_react2.default.createElement(_.SchemaInitializer.Button, {
|
|
104
134
|
wrap: _utils.gridRowColWrap,
|
|
105
135
|
insertPosition: insertPosition,
|
|
106
136
|
component: component,
|
|
@@ -32,7 +32,8 @@ var TabPaneInitializers = function TabPaneInitializers() {
|
|
|
32
32
|
return {
|
|
33
33
|
run: function run() {
|
|
34
34
|
return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
35
|
-
var title;
|
|
35
|
+
var _form$values, title, icon;
|
|
36
|
+
|
|
36
37
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
37
38
|
while (1) {
|
|
38
39
|
switch (_context.prev = _context.next) {
|
|
@@ -41,13 +42,15 @@ var TabPaneInitializers = function TabPaneInitializers() {
|
|
|
41
42
|
return form.submit();
|
|
42
43
|
|
|
43
44
|
case 2:
|
|
44
|
-
|
|
45
|
+
_form$values = form.values, title = _form$values.title, icon = _form$values.icon;
|
|
45
46
|
insertBeforeEnd({
|
|
46
47
|
type: 'void',
|
|
47
48
|
title: title,
|
|
48
49
|
'x-component': 'Tabs.TabPane',
|
|
49
50
|
'x-designer': 'Tabs.Designer',
|
|
50
|
-
'x-component-props': {
|
|
51
|
+
'x-component-props': {
|
|
52
|
+
icon: icon
|
|
53
|
+
},
|
|
51
54
|
properties: {
|
|
52
55
|
grid: {
|
|
53
56
|
type: 'void',
|
|
@@ -106,6 +109,11 @@ var TabPaneInitializers = function TabPaneInitializers() {
|
|
|
106
109
|
'x-component': 'Input',
|
|
107
110
|
'x-decorator': 'FormItem'
|
|
108
111
|
},
|
|
112
|
+
icon: {
|
|
113
|
+
title: '{{t("Icon")}}',
|
|
114
|
+
'x-component': 'IconPicker',
|
|
115
|
+
'x-decorator': 'FormItem'
|
|
116
|
+
},
|
|
109
117
|
footer: {
|
|
110
118
|
'x-component': 'Action.Modal.Footer',
|
|
111
119
|
type: 'void',
|
|
@@ -43,6 +43,17 @@ var TableActionInitializers = {
|
|
|
43
43
|
skipScopeCheck: true
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
+
}, {
|
|
47
|
+
type: 'item',
|
|
48
|
+
title: "{{t('Refresh')}}",
|
|
49
|
+
component: 'RefreshActionInitializer',
|
|
50
|
+
schema: {
|
|
51
|
+
'x-align': 'right',
|
|
52
|
+
'x-decorator': 'ACLActionProvider',
|
|
53
|
+
'x-acl-action-props': {
|
|
54
|
+
skipScopeCheck: true
|
|
55
|
+
}
|
|
56
|
+
}
|
|
46
57
|
}]
|
|
47
58
|
}]
|
|
48
59
|
};
|