@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.
Files changed (149) hide show
  1. package/es/application/Application.d.ts +1 -0
  2. package/es/application/Application.js +7 -1
  3. package/es/block-provider/FormBlockProvider.js +8 -3
  4. package/es/block-provider/TableFieldProvider.d.ts +1 -0
  5. package/es/block-provider/TableFieldProvider.js +5 -2
  6. package/es/block-provider/TableSelectorProvider.js +41 -13
  7. package/es/block-provider/hooks/index.d.ts +6 -0
  8. package/es/block-provider/hooks/index.js +159 -65
  9. package/es/collection-manager/CollectionField.js +4 -2
  10. package/es/collection-manager/Configuration/index.js +5 -1
  11. package/es/collection-manager/Configuration/schemas/collections.js +2 -1
  12. package/es/collection-manager/interfaces/input.js +103 -0
  13. package/es/collection-manager/interfaces/integer.js +63 -0
  14. package/es/collection-manager/interfaces/m2m.js +2 -0
  15. package/es/collection-manager/interfaces/m2o.js +1 -0
  16. package/es/collection-manager/interfaces/markdown.js +34 -0
  17. package/es/collection-manager/interfaces/number.js +55 -0
  18. package/es/collection-manager/interfaces/o2m.js +1 -0
  19. package/es/collection-manager/interfaces/o2o.js +3 -0
  20. package/es/collection-manager/interfaces/password.js +36 -1
  21. package/es/collection-manager/interfaces/percent.js +97 -0
  22. package/es/collection-manager/interfaces/properties/index.d.ts +1 -0
  23. package/es/collection-manager/interfaces/properties/index.js +1 -0
  24. package/es/collection-manager/interfaces/properties/operators.js +4 -4
  25. package/es/collection-manager/interfaces/richText.js +34 -0
  26. package/es/collection-manager/interfaces/textarea.js +34 -0
  27. package/es/file-manager/FileStorageShortcut.js +2 -2
  28. package/es/locale/en_US.d.ts +8 -2
  29. package/es/locale/en_US.js +9 -3
  30. package/es/locale/zh_CN.d.ts +26 -2
  31. package/es/locale/zh_CN.js +27 -3
  32. package/es/plugin-manager/PluginManager.d.ts +1 -0
  33. package/es/plugin-manager/PluginManager.js +20 -6
  34. package/es/schema-component/antd/action/Action.Modal.js +1 -1
  35. package/es/schema-component/antd/calendar/Calendar.Designer.js +16 -10
  36. package/es/schema-component/antd/date-picker/DatePicker.d.ts +1 -1
  37. package/es/schema-component/antd/date-picker/DatePicker.js +1 -1
  38. package/es/schema-component/antd/date-picker/ReadPretty.js +1 -1
  39. package/es/schema-component/antd/date-picker/util.d.ts +0 -10
  40. package/es/schema-component/antd/date-picker/util.js +1 -79
  41. package/es/schema-component/antd/form-item/FormItem.js +161 -10
  42. package/es/schema-component/antd/grid/Grid.js +72 -6
  43. package/es/schema-component/antd/input-number/InputNumber.d.ts +1 -5
  44. package/es/schema-component/antd/input-number/InputNumber.js +25 -1
  45. package/es/schema-component/antd/input-number/ReadPretty.js +2 -4
  46. package/es/schema-component/antd/kanban/Kanban.Card.Designer.js +20 -14
  47. package/es/schema-component/antd/menu/Menu.js +6 -3
  48. package/es/schema-component/antd/percent/Percent.js +2 -2
  49. package/es/schema-component/antd/record-picker/InputRecordPicker.js +27 -13
  50. package/es/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +5 -3
  51. package/es/schema-component/antd/table/Table.Array.js +2 -2
  52. package/es/schema-component/antd/table/Table.Void.js +11 -1
  53. package/es/schema-component/antd/table-v2/Table.Column.Designer.js +3 -1
  54. package/es/schema-component/antd/table-v2/Table.d.ts +0 -11
  55. package/es/schema-component/antd/table-v2/Table.js +163 -92
  56. package/es/schema-component/antd/table-v2/TableField.js +3 -0
  57. package/es/schema-component/antd/tabs/Tabs.Designer.js +23 -12
  58. package/es/schema-component/antd/tabs/Tabs.js +7 -1
  59. package/es/schema-component/antd/time-picker/ReadPretty.js +11 -5
  60. package/es/schema-component/core/DesignableSwitch.js +7 -1
  61. package/es/schema-component/hooks/useDesignable.js +21 -21
  62. package/es/schema-component/hooks/useProps.js +1 -1
  63. package/es/schema-initializer/buttons/FormItemInitializers.js +14 -3
  64. package/es/schema-initializer/buttons/ReadPrettyFormActionInitializers.js +8 -0
  65. package/es/schema-initializer/buttons/ReadPrettyFormItemInitializers.js +14 -3
  66. package/es/schema-initializer/buttons/RecordBlockInitializers.js +32 -3
  67. package/es/schema-initializer/buttons/TabPaneInitializers.js +11 -3
  68. package/es/schema-initializer/buttons/TableActionInitializers.js +11 -0
  69. package/es/schema-initializer/components/assigned-field/AssignedField.d.ts +4 -0
  70. package/es/schema-initializer/components/assigned-field/AssignedField.js +255 -69
  71. package/es/schema-initializer/items/index.d.ts +2 -0
  72. package/es/schema-initializer/items/index.js +48 -2
  73. package/es/schema-initializer/utils.js +22 -2
  74. package/es/system-settings/SystemSettingsShortcut.js +35 -12
  75. package/lib/application/Application.d.ts +1 -0
  76. package/lib/application/Application.js +11 -2
  77. package/lib/block-provider/FormBlockProvider.js +7 -2
  78. package/lib/block-provider/TableFieldProvider.d.ts +1 -0
  79. package/lib/block-provider/TableFieldProvider.js +4 -1
  80. package/lib/block-provider/TableSelectorProvider.js +41 -13
  81. package/lib/block-provider/hooks/index.d.ts +6 -0
  82. package/lib/block-provider/hooks/index.js +168 -67
  83. package/lib/collection-manager/CollectionField.js +5 -2
  84. package/lib/collection-manager/Configuration/index.js +5 -0
  85. package/lib/collection-manager/Configuration/schemas/collections.js +2 -1
  86. package/lib/collection-manager/interfaces/input.js +104 -0
  87. package/lib/collection-manager/interfaces/integer.js +65 -0
  88. package/lib/collection-manager/interfaces/m2m.js +2 -0
  89. package/lib/collection-manager/interfaces/m2o.js +1 -0
  90. package/lib/collection-manager/interfaces/markdown.js +35 -0
  91. package/lib/collection-manager/interfaces/number.js +56 -0
  92. package/lib/collection-manager/interfaces/o2m.js +1 -0
  93. package/lib/collection-manager/interfaces/o2o.js +3 -0
  94. package/lib/collection-manager/interfaces/password.js +37 -1
  95. package/lib/collection-manager/interfaces/percent.js +99 -0
  96. package/lib/collection-manager/interfaces/properties/index.d.ts +1 -0
  97. package/lib/collection-manager/interfaces/properties/index.js +1 -0
  98. package/lib/collection-manager/interfaces/properties/operators.js +4 -4
  99. package/lib/collection-manager/interfaces/richText.js +35 -0
  100. package/lib/collection-manager/interfaces/textarea.js +35 -0
  101. package/lib/file-manager/FileStorageShortcut.js +1 -1
  102. package/lib/locale/en_US.d.ts +8 -2
  103. package/lib/locale/en_US.js +9 -3
  104. package/lib/locale/zh_CN.d.ts +26 -2
  105. package/lib/locale/zh_CN.js +27 -3
  106. package/lib/plugin-manager/PluginManager.d.ts +1 -0
  107. package/lib/plugin-manager/PluginManager.js +23 -5
  108. package/lib/schema-component/antd/action/Action.Modal.js +1 -1
  109. package/lib/schema-component/antd/calendar/Calendar.Designer.js +16 -10
  110. package/lib/schema-component/antd/date-picker/DatePicker.d.ts +1 -1
  111. package/lib/schema-component/antd/date-picker/DatePicker.js +2 -2
  112. package/lib/schema-component/antd/date-picker/ReadPretty.js +6 -6
  113. package/lib/schema-component/antd/date-picker/util.d.ts +0 -10
  114. package/lib/schema-component/antd/date-picker/util.js +6 -89
  115. package/lib/schema-component/antd/form-item/FormItem.js +164 -12
  116. package/lib/schema-component/antd/grid/Grid.js +69 -3
  117. package/lib/schema-component/antd/input-number/InputNumber.d.ts +1 -5
  118. package/lib/schema-component/antd/input-number/InputNumber.js +28 -1
  119. package/lib/schema-component/antd/input-number/ReadPretty.js +2 -5
  120. package/lib/schema-component/antd/kanban/Kanban.Card.Designer.js +20 -14
  121. package/lib/schema-component/antd/menu/Menu.js +6 -3
  122. package/lib/schema-component/antd/percent/Percent.js +2 -2
  123. package/lib/schema-component/antd/record-picker/InputRecordPicker.js +27 -12
  124. package/lib/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +4 -2
  125. package/lib/schema-component/antd/table/Table.Array.js +2 -2
  126. package/lib/schema-component/antd/table/Table.Void.js +11 -1
  127. package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +3 -1
  128. package/lib/schema-component/antd/table-v2/Table.d.ts +0 -11
  129. package/lib/schema-component/antd/table-v2/Table.js +172 -94
  130. package/lib/schema-component/antd/table-v2/TableField.js +3 -0
  131. package/lib/schema-component/antd/tabs/Tabs.Designer.js +23 -12
  132. package/lib/schema-component/antd/tabs/Tabs.js +8 -1
  133. package/lib/schema-component/antd/time-picker/ReadPretty.js +10 -3
  134. package/lib/schema-component/core/DesignableSwitch.js +8 -1
  135. package/lib/schema-component/hooks/useDesignable.js +21 -21
  136. package/lib/schema-component/hooks/useProps.js +1 -1
  137. package/lib/schema-initializer/buttons/FormItemInitializers.js +14 -2
  138. package/lib/schema-initializer/buttons/ReadPrettyFormActionInitializers.js +8 -0
  139. package/lib/schema-initializer/buttons/ReadPrettyFormItemInitializers.js +14 -2
  140. package/lib/schema-initializer/buttons/RecordBlockInitializers.js +34 -4
  141. package/lib/schema-initializer/buttons/TabPaneInitializers.js +11 -3
  142. package/lib/schema-initializer/buttons/TableActionInitializers.js +11 -0
  143. package/lib/schema-initializer/components/assigned-field/AssignedField.d.ts +4 -0
  144. package/lib/schema-initializer/components/assigned-field/AssignedField.js +257 -66
  145. package/lib/schema-initializer/items/index.d.ts +2 -0
  146. package/lib/schema-initializer/items/index.js +54 -2
  147. package/lib/schema-initializer/utils.js +22 -2
  148. package/lib/system-settings/SystemSettingsShortcut.js +37 -13
  149. 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 title = _ref.title;
60
+ var _schema;
53
61
 
54
- if (title) {
55
- var _schema;
56
-
57
- fieldSchema.title = title;
58
- field.title = title;
59
- dn.emit('patch', {
60
- schema: (_schema = {}, _defineProperty(_schema, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema, "title", title), _schema)
61
- });
62
- dn.refresh();
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.tab || field.title, /*#__PURE__*/_react2.default.createElement(Designer, null));
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 placeholder = props.placeholder;
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 = (0, _builtins__.formatMomentValue)(props.value, props.format, placeholder);
24
- return (0, _shared.isArr)(labels) ? labels.join('~') : labels;
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 = (useProps === null || useProps === void 0 ? void 0 : useProps()) || {};
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 = _interopRequireDefault(require("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 _useCollection = (0, _.useCollection)(),
20
- fields = _useCollection.fields;
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__*/_react.default.createElement(_.SchemaInitializer.Button, {
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
- title = form.values.title;
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
  };
@@ -1 +1,5 @@
1
+ export declare enum AssignedFieldValueType {
2
+ ConstantValue = "constantValue",
3
+ DynamicValue = "dynamicValue"
4
+ }
1
5
  export declare const AssignedField: (props: any) => JSX.Element;