@nocobase/client 0.9.2-alpha.4 → 0.9.3-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/block-provider/DetailsBlockProvider.js +13 -1
- package/es/block-provider/FormBlockProvider.js +30 -13
- package/es/block-provider/hooks/index.d.ts +10 -0
- package/es/block-provider/hooks/index.js +498 -281
- package/es/collection-manager/Configuration/CollectionFields.js +1 -2
- package/es/collection-manager/Configuration/EditFieldAction.js +0 -1
- package/es/collection-manager/Configuration/OverridingCollectionField.js +0 -1
- package/es/collection-manager/action-hooks.d.ts +1 -1
- package/es/collection-manager/action-hooks.js +18 -7
- package/es/collection-manager/interfaces/createdBy.js +1 -1
- package/es/collection-manager/interfaces/linkTo.js +3 -39
- package/es/collection-manager/interfaces/m2m.js +4 -38
- package/es/collection-manager/interfaces/m2o.js +4 -38
- package/es/collection-manager/interfaces/o2m.js +4 -68
- package/es/collection-manager/interfaces/o2o.js +25 -119
- package/es/collection-manager/interfaces/updatedBy.js +1 -1
- package/es/collection-manager/templates/tree.js +2 -2
- package/es/filter-provider/FilterProvider.js +3 -1
- package/es/locale/en_US.d.ts +3 -0
- package/es/locale/en_US.js +5 -2
- package/es/locale/ja_JP.d.ts +3 -0
- package/es/locale/ja_JP.js +3 -0
- package/es/locale/zh_CN.d.ts +4 -0
- package/es/locale/zh_CN.js +4 -0
- package/es/schema-component/antd/action/Action.Designer.js +4 -5
- package/es/schema-component/antd/association-field/AssociationFieldProvider.d.ts +2 -0
- package/es/schema-component/antd/association-field/AssociationFieldProvider.js +19 -0
- package/es/schema-component/antd/association-field/AssociationSelect.d.ts +14 -0
- package/es/schema-component/antd/association-field/AssociationSelect.js +118 -0
- package/es/schema-component/antd/association-field/Editable.d.ts +2 -0
- package/es/schema-component/antd/association-field/Editable.js +88 -0
- package/es/schema-component/antd/association-field/FileManager.d.ts +4 -0
- package/es/schema-component/antd/association-field/FileManager.js +243 -0
- package/es/schema-component/antd/association-field/InternalNester.d.ts +1 -0
- package/es/schema-component/antd/association-field/InternalNester.js +28 -0
- package/es/schema-component/antd/association-field/InternalPicker.d.ts +2 -0
- package/es/schema-component/antd/association-field/InternalPicker.js +267 -0
- package/es/schema-component/antd/association-field/InternalSubTable.d.ts +1 -0
- package/es/schema-component/antd/association-field/InternalSubTable.js +28 -0
- package/es/schema-component/antd/association-field/InternalViewer.d.ts +2 -0
- package/es/schema-component/antd/association-field/InternalViewer.js +115 -0
- package/es/schema-component/antd/association-field/Nester.d.ts +1 -0
- package/es/schema-component/antd/association-field/Nester.js +80 -0
- package/es/schema-component/antd/association-field/ReadPretty.d.ts +2 -0
- package/es/schema-component/antd/association-field/ReadPretty.js +38 -0
- package/es/schema-component/antd/association-field/SubTable.d.ts +1 -0
- package/es/schema-component/antd/association-field/SubTable.js +25 -0
- package/es/schema-component/antd/association-field/context.d.ts +7 -0
- package/es/schema-component/antd/association-field/context.js +2 -0
- package/es/schema-component/antd/association-field/hooks.d.ts +8 -0
- package/es/schema-component/antd/association-field/hooks.js +96 -0
- package/es/schema-component/antd/association-field/index.d.ts +1 -0
- package/es/schema-component/antd/association-field/index.js +14 -0
- package/es/schema-component/antd/association-field/schema.d.ts +142 -0
- package/es/schema-component/antd/association-field/schema.js +141 -0
- package/es/schema-component/antd/association-field/util.d.ts +8 -0
- package/es/schema-component/antd/association-field/util.js +84 -0
- package/es/schema-component/antd/expand-action/Expand.Action.Design.d.ts +1 -0
- package/es/schema-component/antd/expand-action/Expand.Action.Design.js +112 -0
- package/es/schema-component/antd/expand-action/Expand.Action.d.ts +1 -0
- package/es/schema-component/antd/expand-action/Expand.Action.js +40 -0
- package/es/schema-component/antd/expand-action/index.d.ts +1 -0
- package/es/schema-component/antd/expand-action/index.js +5 -0
- package/es/schema-component/antd/filter/Filter.Action.Designer.js +10 -12
- package/es/schema-component/antd/filter/FilterItem.js +1 -1
- package/es/schema-component/antd/filter/useOperators.d.ts +1 -1
- package/es/schema-component/antd/form-item/FormItem.d.ts +2 -1
- package/es/schema-component/antd/form-item/FormItem.js +183 -52
- package/es/schema-component/antd/form-item/SchemaSettingOptions.js +36 -58
- package/es/schema-component/antd/form-v2/utils.js +3 -1
- package/es/schema-component/antd/gantt/components/other/tooltip.js +1 -1
- package/es/schema-component/antd/index.d.ts +3 -1
- package/es/schema-component/antd/index.js +3 -1
- package/es/schema-component/antd/menu/Menu.js +6 -3
- package/es/schema-component/antd/record-picker/InputRecordPicker.d.ts +1 -0
- package/es/schema-component/antd/record-picker/InputRecordPicker.js +32 -12
- package/es/schema-component/antd/remote-select/RemoteSelect.js +16 -18
- package/es/schema-component/antd/table-v2/Table.Column.Designer.js +18 -9
- package/es/schema-component/antd/table-v2/Table.Index.d.ts +1 -0
- package/es/schema-component/antd/table-v2/Table.Index.js +6 -0
- package/es/schema-component/antd/table-v2/Table.js +9 -5
- package/es/schema-component/antd/table-v2/index.js +3 -1
- package/es/schema-component/antd/table-v2/utils.js +1 -1
- package/es/schema-component/antd/variable/Input.js +5 -5
- package/es/schema-component/antd/variable/TextArea.js +2 -5
- package/es/schema-component/common/dnd-context/index.js +3 -2
- package/es/schema-component/common/sortable-item/SortableItem.js +4 -1
- package/es/schema-component/common/utils/uitls.js +1 -1
- package/es/schema-component/hooks/index.d.ts +1 -0
- package/es/schema-component/hooks/index.js +2 -1
- package/es/schema-component/hooks/useFieldModeOptions.d.ts +4 -0
- package/es/schema-component/hooks/useFieldModeOptions.js +105 -0
- package/es/schema-initializer/components/CreateRecordAction.d.ts +1 -1
- package/es/schema-initializer/components/CreateRecordAction.js +4 -3
- package/es/schema-initializer/items/ExpandActionInitializer.d.ts +0 -1
- package/es/schema-initializer/items/ExpandActionInitializer.js +9 -34
- package/es/schema-initializer/items/SelectActionInitializer.d.ts +1 -0
- package/es/schema-initializer/items/SelectActionInitializer.js +65 -0
- package/es/schema-initializer/items/index.d.ts +1 -0
- package/es/schema-initializer/items/index.js +2 -1
- package/es/schema-initializer/utils.js +20 -8
- package/es/schema-settings/LinkageRules/FilterDynamicComponent.js +1 -1
- package/es/schema-settings/LinkageRules/Variables.d.ts +1 -1
- package/es/schema-settings/LinkageRules/Variables.js +7 -4
- package/es/schema-settings/SchemaSettings.js +2 -2
- package/lib/block-provider/DetailsBlockProvider.js +13 -1
- package/lib/block-provider/FormBlockProvider.js +31 -15
- package/lib/block-provider/hooks/index.d.ts +10 -0
- package/lib/block-provider/hooks/index.js +509 -289
- package/lib/collection-manager/Configuration/CollectionFields.js +1 -2
- package/lib/collection-manager/Configuration/EditFieldAction.js +0 -1
- package/lib/collection-manager/Configuration/OverridingCollectionField.js +0 -1
- package/lib/collection-manager/action-hooks.d.ts +1 -1
- package/lib/collection-manager/action-hooks.js +18 -7
- package/lib/collection-manager/interfaces/createdBy.js +1 -1
- package/lib/collection-manager/interfaces/linkTo.js +2 -38
- package/lib/collection-manager/interfaces/m2m.js +3 -37
- package/lib/collection-manager/interfaces/m2o.js +3 -37
- package/lib/collection-manager/interfaces/o2m.js +6 -70
- package/lib/collection-manager/interfaces/o2o.js +30 -124
- package/lib/collection-manager/interfaces/updatedBy.js +1 -1
- package/lib/collection-manager/templates/tree.js +2 -2
- package/lib/filter-provider/FilterProvider.js +3 -1
- package/lib/locale/en_US.d.ts +3 -0
- package/lib/locale/en_US.js +5 -2
- package/lib/locale/ja_JP.d.ts +3 -0
- package/lib/locale/ja_JP.js +3 -0
- package/lib/locale/zh_CN.d.ts +4 -0
- package/lib/locale/zh_CN.js +4 -0
- package/lib/schema-component/antd/action/Action.Designer.js +4 -5
- package/lib/schema-component/antd/association-field/AssociationFieldProvider.d.ts +2 -0
- package/lib/schema-component/antd/association-field/AssociationFieldProvider.js +28 -0
- package/lib/schema-component/antd/association-field/AssociationSelect.d.ts +14 -0
- package/lib/schema-component/antd/association-field/AssociationSelect.js +129 -0
- package/lib/schema-component/antd/association-field/Editable.d.ts +2 -0
- package/lib/schema-component/antd/association-field/Editable.js +97 -0
- package/lib/schema-component/antd/association-field/FileManager.d.ts +4 -0
- package/lib/schema-component/antd/association-field/FileManager.js +253 -0
- package/lib/schema-component/antd/association-field/InternalNester.d.ts +1 -0
- package/lib/schema-component/antd/association-field/InternalNester.js +39 -0
- package/lib/schema-component/antd/association-field/InternalPicker.d.ts +2 -0
- package/lib/schema-component/antd/association-field/InternalPicker.js +277 -0
- package/lib/schema-component/antd/association-field/InternalSubTable.d.ts +1 -0
- package/lib/schema-component/antd/association-field/InternalSubTable.js +39 -0
- package/lib/schema-component/antd/association-field/InternalViewer.d.ts +2 -0
- package/lib/schema-component/antd/association-field/InternalViewer.js +126 -0
- package/lib/schema-component/antd/association-field/Nester.d.ts +1 -0
- package/lib/schema-component/antd/association-field/Nester.js +89 -0
- package/lib/schema-component/antd/association-field/ReadPretty.d.ts +2 -0
- package/lib/schema-component/antd/association-field/ReadPretty.js +47 -0
- package/lib/schema-component/antd/association-field/SubTable.d.ts +1 -0
- package/lib/schema-component/antd/association-field/SubTable.js +33 -0
- package/lib/schema-component/antd/association-field/context.d.ts +7 -0
- package/lib/schema-component/antd/association-field/context.js +9 -0
- package/lib/schema-component/antd/association-field/hooks.d.ts +8 -0
- package/lib/schema-component/antd/association-field/hooks.js +107 -0
- package/lib/schema-component/antd/association-field/index.d.ts +1 -0
- package/lib/schema-component/antd/association-field/index.js +21 -0
- package/lib/schema-component/antd/association-field/schema.d.ts +142 -0
- package/lib/schema-component/antd/association-field/schema.js +148 -0
- package/lib/schema-component/antd/association-field/util.d.ts +8 -0
- package/lib/schema-component/antd/association-field/util.js +98 -0
- package/lib/schema-component/antd/expand-action/Expand.Action.Design.d.ts +1 -0
- package/lib/schema-component/antd/expand-action/Expand.Action.Design.js +120 -0
- package/lib/schema-component/antd/expand-action/Expand.Action.d.ts +1 -0
- package/lib/schema-component/antd/expand-action/Expand.Action.js +48 -0
- package/lib/schema-component/antd/expand-action/index.d.ts +1 -0
- package/lib/schema-component/antd/expand-action/index.js +12 -0
- package/lib/schema-component/antd/filter/Filter.Action.Designer.js +10 -12
- package/lib/schema-component/antd/filter/FilterItem.js +1 -1
- package/lib/schema-component/antd/filter/useOperators.d.ts +1 -1
- package/lib/schema-component/antd/form-item/FormItem.d.ts +2 -1
- package/lib/schema-component/antd/form-item/FormItem.js +180 -48
- package/lib/schema-component/antd/form-item/SchemaSettingOptions.js +34 -56
- package/lib/schema-component/antd/form-v2/utils.js +3 -1
- package/lib/schema-component/antd/gantt/components/other/tooltip.js +1 -1
- package/lib/schema-component/antd/index.d.ts +3 -1
- package/lib/schema-component/antd/index.js +33 -11
- package/lib/schema-component/antd/menu/Menu.js +6 -3
- package/lib/schema-component/antd/record-picker/InputRecordPicker.d.ts +1 -0
- package/lib/schema-component/antd/record-picker/InputRecordPicker.js +34 -13
- package/lib/schema-component/antd/remote-select/RemoteSelect.js +15 -17
- package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +18 -9
- package/lib/schema-component/antd/table-v2/Table.Index.d.ts +1 -0
- package/lib/schema-component/antd/table-v2/Table.Index.js +14 -0
- package/lib/schema-component/antd/table-v2/Table.js +9 -5
- package/lib/schema-component/antd/table-v2/index.js +3 -1
- package/lib/schema-component/antd/table-v2/utils.js +1 -1
- package/lib/schema-component/antd/variable/Input.js +5 -5
- package/lib/schema-component/antd/variable/TextArea.js +2 -5
- package/lib/schema-component/common/dnd-context/index.js +3 -2
- package/lib/schema-component/common/sortable-item/SortableItem.js +4 -1
- package/lib/schema-component/common/utils/uitls.js +1 -1
- package/lib/schema-component/hooks/index.d.ts +1 -0
- package/lib/schema-component/hooks/index.js +11 -0
- package/lib/schema-component/hooks/useFieldModeOptions.d.ts +4 -0
- package/lib/schema-component/hooks/useFieldModeOptions.js +112 -0
- package/lib/schema-initializer/components/CreateRecordAction.d.ts +1 -1
- package/lib/schema-initializer/components/CreateRecordAction.js +4 -3
- package/lib/schema-initializer/items/ExpandActionInitializer.d.ts +0 -1
- package/lib/schema-initializer/items/ExpandActionInitializer.js +11 -37
- package/lib/schema-initializer/items/SelectActionInitializer.d.ts +1 -0
- package/lib/schema-initializer/items/SelectActionInitializer.js +73 -0
- package/lib/schema-initializer/items/index.d.ts +1 -0
- package/lib/schema-initializer/items/index.js +11 -0
- package/lib/schema-initializer/utils.js +20 -8
- package/lib/schema-settings/LinkageRules/FilterDynamicComponent.js +1 -1
- package/lib/schema-settings/LinkageRules/Variables.d.ts +1 -1
- package/lib/schema-settings/LinkageRules/Variables.js +7 -4
- package/lib/schema-settings/SchemaSettings.js +3 -3
- package/package.json +5 -6
|
@@ -44,9 +44,13 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
44
44
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
45
45
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
46
46
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
47
|
-
var
|
|
48
|
-
var _schema$reducePropert;
|
|
47
|
+
var useArrayField = function useArrayField(props) {
|
|
49
48
|
var field = (0, _react.useField)();
|
|
49
|
+
return props.field || field;
|
|
50
|
+
};
|
|
51
|
+
var useTableColumns = function useTableColumns(props) {
|
|
52
|
+
var _schema$reducePropert;
|
|
53
|
+
var field = useArrayField(props);
|
|
50
54
|
var schema = (0, _react.useFieldSchema)();
|
|
51
55
|
var _useACLFieldWhitelist = (0, _ACLProvider.useACLFieldWhitelist)(),
|
|
52
56
|
schemaInWhitelist = _useACLFieldWhitelist.schemaInWhitelist;
|
|
@@ -87,8 +91,8 @@ var useTableColumns = function useTableColumns() {
|
|
|
87
91
|
}, /*#__PURE__*/_react2.default.createElement(_2.RecordProvider, {
|
|
88
92
|
record: record
|
|
89
93
|
}, /*#__PURE__*/_react2.default.createElement(_react.RecursionField, {
|
|
94
|
+
basePath: field.address.concat(record.__index || index),
|
|
90
95
|
schema: s,
|
|
91
|
-
name: record.__index || index,
|
|
92
96
|
onlyRenderProperties: true
|
|
93
97
|
})));
|
|
94
98
|
}
|
|
@@ -188,8 +192,6 @@ var useValidator = function useValidator(validator) {
|
|
|
188
192
|
};
|
|
189
193
|
var Table = (0, _react.observer)(function (props) {
|
|
190
194
|
var _schema$parent, _schema$parent2, _field$data, _fieldSchema$parent, _fieldSchema$parent$x, _field$value4, _field$value4$slice;
|
|
191
|
-
var field = (0, _react.useField)();
|
|
192
|
-
var columns = useTableColumns();
|
|
193
195
|
var pagination1 = props.pagination,
|
|
194
196
|
useProps = props.useProps,
|
|
195
197
|
onChange = props.onChange,
|
|
@@ -210,6 +212,8 @@ var Table = (0, _react.observer)(function (props) {
|
|
|
210
212
|
required = _others1$others.required,
|
|
211
213
|
_onExpand = _others1$others.onExpand,
|
|
212
214
|
others = _objectWithoutProperties(_others1$others, _excluded3);
|
|
215
|
+
var field = useArrayField(others);
|
|
216
|
+
var columns = useTableColumns(others);
|
|
213
217
|
var schema = (0, _react.useFieldSchema)();
|
|
214
218
|
var isTableSelector = (schema === null || schema === void 0 ? void 0 : (_schema$parent = schema.parent) === null || _schema$parent === void 0 ? void 0 : _schema$parent['x-decorator']) === 'TableSelectorProvider';
|
|
215
219
|
var ctx = isTableSelector ? (0, _2.useTableSelectorContext)() : (0, _2.useTableBlockContext)();
|
|
@@ -13,6 +13,7 @@ var _Table3 = require("./Table.Column");
|
|
|
13
13
|
var _TableColumn = require("./Table.Column.ActionBar");
|
|
14
14
|
var _TableColumn2 = require("./Table.Column.Decorator");
|
|
15
15
|
var _TableColumn3 = require("./Table.Column.Designer");
|
|
16
|
+
var _Table4 = require("./Table.Index");
|
|
16
17
|
var _TableSelector = require("./TableSelector");
|
|
17
18
|
var _TableBlockDesigner = require("./TableBlockDesigner");
|
|
18
19
|
Object.keys(_TableBlockDesigner).forEach(function (key) {
|
|
@@ -57,4 +58,5 @@ TableV2.Column.ActionBar = _TableColumn.TableColumnActionBar;
|
|
|
57
58
|
TableV2.Column.Decorator = _TableColumn2.TableColumnDecorator;
|
|
58
59
|
TableV2.Column.Designer = _TableColumn3.TableColumnDesigner;
|
|
59
60
|
TableV2.ActionColumnDesigner = _Table2.TableActionColumnDesigner;
|
|
60
|
-
TableV2.Selector = _TableSelector.TableSelector;
|
|
61
|
+
TableV2.Selector = _TableSelector.TableSelector;
|
|
62
|
+
TableV2.Index = _Table4.TableIndex;
|
|
@@ -41,7 +41,7 @@ function getIdsWithChildren(nodes) {
|
|
|
41
41
|
var node = _step.value;
|
|
42
42
|
if (node.children && node.children.length > 0) {
|
|
43
43
|
ids.push(node.id);
|
|
44
|
-
ids.push.apply(ids, _toConsumableArray(getIdsWithChildren(node.children)));
|
|
44
|
+
ids.push.apply(ids, _toConsumableArray(getIdsWithChildren(node === null || node === void 0 ? void 0 : node.children)));
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
} catch (err) {
|
|
@@ -52,7 +52,7 @@ var ConstantTypes = {
|
|
|
52
52
|
string: {
|
|
53
53
|
label: "{{t(\"String\")}}",
|
|
54
54
|
value: 'string',
|
|
55
|
-
component: function
|
|
55
|
+
component: function StringComponent(_ref) {
|
|
56
56
|
var _onChange = _ref.onChange,
|
|
57
57
|
value = _ref.value;
|
|
58
58
|
return /*#__PURE__*/_react2.default.createElement(_antd.Input, {
|
|
@@ -67,7 +67,7 @@ var ConstantTypes = {
|
|
|
67
67
|
number: {
|
|
68
68
|
label: '{{t("Number")}}',
|
|
69
69
|
value: 'number',
|
|
70
|
-
component: function
|
|
70
|
+
component: function NumberComponent(_ref2) {
|
|
71
71
|
var onChange = _ref2.onChange,
|
|
72
72
|
value = _ref2.value;
|
|
73
73
|
return /*#__PURE__*/_react2.default.createElement(_antd.InputNumber, {
|
|
@@ -80,7 +80,7 @@ var ConstantTypes = {
|
|
|
80
80
|
boolean: {
|
|
81
81
|
label: "{{t(\"Boolean\")}}",
|
|
82
82
|
value: 'boolean',
|
|
83
|
-
component: function
|
|
83
|
+
component: function BooleanComponent(_ref3) {
|
|
84
84
|
var onChange = _ref3.onChange,
|
|
85
85
|
value = _ref3.value;
|
|
86
86
|
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
@@ -103,7 +103,7 @@ var ConstantTypes = {
|
|
|
103
103
|
date: {
|
|
104
104
|
label: '{{t("Date")}}',
|
|
105
105
|
value: 'date',
|
|
106
|
-
component: function
|
|
106
|
+
component: function DateComponent(_ref4) {
|
|
107
107
|
var _onChange2 = _ref4.onChange,
|
|
108
108
|
value = _ref4.value;
|
|
109
109
|
return /*#__PURE__*/_react2.default.createElement(_antd.DatePicker, {
|
|
@@ -123,7 +123,7 @@ var ConstantTypes = {
|
|
|
123
123
|
null: {
|
|
124
124
|
label: "{{t(\"Null\")}}",
|
|
125
125
|
value: 'null',
|
|
126
|
-
component: function
|
|
126
|
+
component: function NullComponent() {
|
|
127
127
|
var _useTranslation2 = (0, _reactI18next.useTranslation)(),
|
|
128
128
|
t = _useTranslation2.t;
|
|
129
129
|
return /*#__PURE__*/_react2.default.createElement(_antd.Input, {
|
|
@@ -9,7 +9,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
var _antd = require("antd");
|
|
10
10
|
var _react2 = require("@formily/react");
|
|
11
11
|
var _css = require("@emotion/css");
|
|
12
|
-
var _reactI18next = require("react-i18next");
|
|
13
12
|
var sanitizeHTML = _interopRequireWildcard(require("sanitize-html"));
|
|
14
13
|
var _2 = require("../..");
|
|
15
14
|
var _VariableSelect = require("./VariableSelect");
|
|
@@ -224,8 +223,6 @@ function TextArea(props) {
|
|
|
224
223
|
_props$multiline = props.multiline,
|
|
225
224
|
multiline = _props$multiline === void 0 ? true : _props$multiline;
|
|
226
225
|
var compile = (0, _2.useCompile)();
|
|
227
|
-
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
228
|
-
t = _useTranslation.t;
|
|
229
226
|
var inputRef = (0, _react.useRef)(null);
|
|
230
227
|
var options = compile((_ref2 = typeof scope === 'function' ? scope() : scope) !== null && _ref2 !== void 0 ? _ref2 : []);
|
|
231
228
|
var form = (0, _react2.useForm)();
|
|
@@ -343,7 +340,7 @@ function TextArea(props) {
|
|
|
343
340
|
if (ev.key === 'Enter') {
|
|
344
341
|
ev.preventDefault();
|
|
345
342
|
}
|
|
346
|
-
setIME(ev.keyCode === 229);
|
|
343
|
+
setIME(ev.keyCode === 229 && ![' ', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'Enter'].includes(ev.key));
|
|
347
344
|
// if (ev.key === 'Control') {
|
|
348
345
|
// console.debug(getSelection().getRangeAt(0));
|
|
349
346
|
// }
|
|
@@ -401,7 +398,7 @@ function TextArea(props) {
|
|
|
401
398
|
onInsert: onInsert
|
|
402
399
|
}) : null);
|
|
403
400
|
}
|
|
404
|
-
TextArea.ReadPretty = function (props) {
|
|
401
|
+
TextArea.ReadPretty = function ReadPretty(props) {
|
|
405
402
|
var _ref5;
|
|
406
403
|
var value = props.value,
|
|
407
404
|
_props$multiline2 = props.multiline,
|
|
@@ -31,7 +31,7 @@ var useDragEnd = function useDragEnd(props) {
|
|
|
31
31
|
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
32
32
|
t = _useTranslation.t;
|
|
33
33
|
return function (event) {
|
|
34
|
-
var _active$data, _active$data$current, _over$data, _over$data$current, _over$data2, _over$data2$current, _over$data3, _over$data3$current, _over$data4, _over$data4$current, _over$data5, _over$data5$current;
|
|
34
|
+
var _active$data, _active$data$current, _over$data, _over$data$current, _over$data2, _over$data2$current, _over$data3, _over$data3$current, _over$data4, _over$data4$current, _over$data5, _over$data5$current, _over$data$current$re;
|
|
35
35
|
var active = event.active,
|
|
36
36
|
over = event.over;
|
|
37
37
|
var activeSchema = active === null || active === void 0 ? void 0 : (_active$data = active.data) === null || _active$data === void 0 ? void 0 : (_active$data$current = _active$data.current) === null || _active$data$current === void 0 ? void 0 : _active$data$current.schema;
|
|
@@ -40,6 +40,7 @@ var useDragEnd = function useDragEnd(props) {
|
|
|
40
40
|
var breakRemoveOn = over === null || over === void 0 ? void 0 : (_over$data3 = over.data) === null || _over$data3 === void 0 ? void 0 : (_over$data3$current = _over$data3.current) === null || _over$data3$current === void 0 ? void 0 : _over$data3$current.breakRemoveOn;
|
|
41
41
|
var wrapSchema = over === null || over === void 0 ? void 0 : (_over$data4 = over.data) === null || _over$data4 === void 0 ? void 0 : (_over$data4$current = _over$data4.current) === null || _over$data4$current === void 0 ? void 0 : _over$data4$current.wrapSchema;
|
|
42
42
|
var onSuccess = over === null || over === void 0 ? void 0 : (_over$data5 = over.data) === null || _over$data5 === void 0 ? void 0 : (_over$data5$current = _over$data5.current) === null || _over$data5$current === void 0 ? void 0 : _over$data5$current.onSuccess;
|
|
43
|
+
var removeParentsIfNoChildren = (_over$data$current$re = over.data.current.removeParentsIfNoChildren) !== null && _over$data$current$re !== void 0 ? _over$data$current$re : true;
|
|
43
44
|
if (!activeSchema || !overSchema) {
|
|
44
45
|
var _props$onDragEnd;
|
|
45
46
|
props === null || props === void 0 ? void 0 : (_props$onDragEnd = props.onDragEnd) === null || _props$onDragEnd === void 0 ? void 0 : _props$onDragEnd.call(props, event);
|
|
@@ -68,7 +69,7 @@ var useDragEnd = function useDragEnd(props) {
|
|
|
68
69
|
dn.insertAdjacent(insertAdjacent, activeSchema, {
|
|
69
70
|
wrap: wrapSchema,
|
|
70
71
|
breakRemoveOn: breakRemoveOn,
|
|
71
|
-
removeParentsIfNoChildren:
|
|
72
|
+
removeParentsIfNoChildren: removeParentsIfNoChildren,
|
|
72
73
|
onSuccess: onSuccess
|
|
73
74
|
});
|
|
74
75
|
props === null || props === void 0 ? void 0 : (_props$onDragEnd4 = props.onDragEnd) === null || _props$onDragEnd4 === void 0 ? void 0 : _props$onDragEnd4.call(props, event);
|
|
@@ -84,15 +84,18 @@ var useSortableItemId = function useSortableItemId(props) {
|
|
|
84
84
|
return field.address.toString();
|
|
85
85
|
};
|
|
86
86
|
var SortableItem = (0, _react.observer)(function (props) {
|
|
87
|
+
var _others$removeParents;
|
|
87
88
|
var _useSortableItemProps = useSortableItemProps(props),
|
|
88
89
|
schema = _useSortableItemProps.schema,
|
|
89
90
|
id = _useSortableItemProps.id,
|
|
90
91
|
others = _objectWithoutProperties(_useSortableItemProps, _excluded2);
|
|
92
|
+
var removeParentsIfNoChildren = (_others$removeParents = others.removeParentsIfNoChildren) !== null && _others$removeParents !== void 0 ? _others$removeParents : true;
|
|
91
93
|
return /*#__PURE__*/_react2.default.createElement(SortableProvider, {
|
|
92
94
|
id: id,
|
|
93
95
|
data: {
|
|
94
96
|
insertAdjacent: 'afterEnd',
|
|
95
|
-
schema: schema
|
|
97
|
+
schema: schema,
|
|
98
|
+
removeParentsIfNoChildren: removeParentsIfNoChildren
|
|
96
99
|
}
|
|
97
100
|
}, /*#__PURE__*/_react2.default.createElement(Sortable, _objectSpread({}, others), props.children));
|
|
98
101
|
});
|
|
@@ -74,7 +74,7 @@ var getValue = function getValue(str, values) {
|
|
|
74
74
|
var regex = /{{(.*?)}}/;
|
|
75
75
|
var matches = str === null || str === void 0 ? void 0 : (_str$match3 = str.match) === null || _str$match3 === void 0 ? void 0 : _str$match3.call(str, regex);
|
|
76
76
|
if (matches) {
|
|
77
|
-
return getVariableValue(str, values);
|
|
77
|
+
return getVariableValue(str, (0, _flat2.default)(values));
|
|
78
78
|
} else {
|
|
79
79
|
return str;
|
|
80
80
|
}
|
|
@@ -123,4 +123,15 @@ Object.keys(_useTableSize).forEach(function (key) {
|
|
|
123
123
|
return _useTableSize[key];
|
|
124
124
|
}
|
|
125
125
|
});
|
|
126
|
+
});
|
|
127
|
+
var _useFieldModeOptions = require("./useFieldModeOptions");
|
|
128
|
+
Object.keys(_useFieldModeOptions).forEach(function (key) {
|
|
129
|
+
if (key === "default" || key === "__esModule") return;
|
|
130
|
+
if (key in exports && exports[key] === _useFieldModeOptions[key]) return;
|
|
131
|
+
Object.defineProperty(exports, key, {
|
|
132
|
+
enumerable: true,
|
|
133
|
+
get: function get() {
|
|
134
|
+
return _useFieldModeOptions[key];
|
|
135
|
+
}
|
|
136
|
+
});
|
|
126
137
|
});
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useFieldModeOptions = void 0;
|
|
7
|
+
var _react = require("@formily/react");
|
|
8
|
+
var _react2 = require("react");
|
|
9
|
+
var _reactI18next = require("react-i18next");
|
|
10
|
+
var _collectionManager = require("../../collection-manager");
|
|
11
|
+
var useFieldModeOptions = function useFieldModeOptions() {
|
|
12
|
+
var _fieldSchema$xCompon;
|
|
13
|
+
var _useCollectionManager = (0, _collectionManager.useCollectionManager)(),
|
|
14
|
+
getCollectionJoinField = _useCollectionManager.getCollectionJoinField,
|
|
15
|
+
getCollection = _useCollectionManager.getCollection;
|
|
16
|
+
var fieldSchema = (0, _react.useFieldSchema)();
|
|
17
|
+
var field = (0, _react.useField)();
|
|
18
|
+
var isReadPretty = field.readPretty;
|
|
19
|
+
var _useCollection = (0, _collectionManager.useCollection)(),
|
|
20
|
+
getField = _useCollection.getField;
|
|
21
|
+
var collectionField = getField(fieldSchema['name']) || getCollectionJoinField(fieldSchema['x-collection-field']);
|
|
22
|
+
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
23
|
+
t = _useTranslation.t;
|
|
24
|
+
var _ref = ((_fieldSchema$xCompon = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon === void 0 ? void 0 : _fieldSchema$xCompon.fieldNames) || {},
|
|
25
|
+
label = _ref.label;
|
|
26
|
+
var fieldModeOptions = (0, _react2.useMemo)(function () {
|
|
27
|
+
if (!collectionField || !(collectionField === null || collectionField === void 0 ? void 0 : collectionField.interface)) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (!['o2o', 'oho', 'obo', 'o2m', 'linkTo', 'm2o', 'm2m'].includes(collectionField.interface)) return;
|
|
31
|
+
var collection = getCollection(collectionField.target);
|
|
32
|
+
if ((collection === null || collection === void 0 ? void 0 : collection.template) === 'file') {
|
|
33
|
+
return isReadPretty ? [{
|
|
34
|
+
label: t('Title'),
|
|
35
|
+
value: 'Select'
|
|
36
|
+
}, {
|
|
37
|
+
label: t('File manager'),
|
|
38
|
+
value: 'FileManager'
|
|
39
|
+
}] : [{
|
|
40
|
+
label: t('File manager'),
|
|
41
|
+
value: 'FileManager'
|
|
42
|
+
}, {
|
|
43
|
+
label: t('Record picker'),
|
|
44
|
+
value: 'Picker'
|
|
45
|
+
}, {
|
|
46
|
+
label: t('Select'),
|
|
47
|
+
value: 'Select'
|
|
48
|
+
}];
|
|
49
|
+
}
|
|
50
|
+
switch (collectionField.interface) {
|
|
51
|
+
case 'o2m':
|
|
52
|
+
return isReadPretty ? [{
|
|
53
|
+
label: t('Title'),
|
|
54
|
+
value: 'Select'
|
|
55
|
+
},
|
|
56
|
+
// { label: t('Subtable'), value: 'SubTable' },
|
|
57
|
+
{
|
|
58
|
+
label: t('Sub-details'),
|
|
59
|
+
value: 'Nester'
|
|
60
|
+
}] : [{
|
|
61
|
+
label: t('Record picker'),
|
|
62
|
+
value: 'Picker'
|
|
63
|
+
},
|
|
64
|
+
// { label: t('Subtable'), value: 'SubTable' },
|
|
65
|
+
{
|
|
66
|
+
label: t('Select'),
|
|
67
|
+
value: 'Select'
|
|
68
|
+
}, {
|
|
69
|
+
label: t('Subform'),
|
|
70
|
+
value: 'Nester'
|
|
71
|
+
}];
|
|
72
|
+
case 'm2o':
|
|
73
|
+
case 'm2m':
|
|
74
|
+
case 'linkTo':
|
|
75
|
+
return isReadPretty ? [{
|
|
76
|
+
label: t('Title'),
|
|
77
|
+
value: 'Select'
|
|
78
|
+
}, {
|
|
79
|
+
label: t('Sub-details'),
|
|
80
|
+
value: 'Nester'
|
|
81
|
+
}] : [{
|
|
82
|
+
label: t('Record picker'),
|
|
83
|
+
value: 'Picker'
|
|
84
|
+
}, {
|
|
85
|
+
label: t('Select'),
|
|
86
|
+
value: 'Select'
|
|
87
|
+
}, {
|
|
88
|
+
label: t('Subform'),
|
|
89
|
+
value: 'Nester'
|
|
90
|
+
}];
|
|
91
|
+
default:
|
|
92
|
+
return isReadPretty ? [{
|
|
93
|
+
label: t('Title'),
|
|
94
|
+
value: 'Select'
|
|
95
|
+
}, {
|
|
96
|
+
label: t('Sub-details'),
|
|
97
|
+
value: 'Nester'
|
|
98
|
+
}] : [{
|
|
99
|
+
label: t('Record picker'),
|
|
100
|
+
value: 'Picker'
|
|
101
|
+
}, {
|
|
102
|
+
label: t('Select'),
|
|
103
|
+
value: 'Select'
|
|
104
|
+
}, {
|
|
105
|
+
label: t('Subform'),
|
|
106
|
+
value: 'Nester'
|
|
107
|
+
}];
|
|
108
|
+
}
|
|
109
|
+
}, [t, collectionField === null || collectionField === void 0 ? void 0 : collectionField.interface, label]);
|
|
110
|
+
return fieldModeOptions;
|
|
111
|
+
};
|
|
112
|
+
exports.useFieldModeOptions = useFieldModeOptions;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export declare const actionDesignerCss: string;
|
|
3
|
-
export declare const CreateRecordAction: React.MemoExoticComponent<React.FunctionComponent<
|
|
3
|
+
export declare const CreateRecordAction: React.MemoExoticComponent<React.FunctionComponent<Pick<any, string | number | symbol>>>;
|
|
@@ -117,6 +117,7 @@ var CreateRecordAction = (0, _react.observer)(function (props) {
|
|
|
117
117
|
var compile = (0, _schemaComponent.useCompile)();
|
|
118
118
|
var _useDesignable = (0, _.useDesignable)(),
|
|
119
119
|
designable = _useDesignable.designable;
|
|
120
|
+
var icon = props.icon || /*#__PURE__*/_react2.default.createElement(_icons.PlusOutlined, null);
|
|
120
121
|
var menu = /*#__PURE__*/_react2.default.createElement(_antd.Menu, null, inheritsCollections.map(function (option) {
|
|
121
122
|
return /*#__PURE__*/_react2.default.createElement(_antd.Menu.Item, {
|
|
122
123
|
key: option.name,
|
|
@@ -160,16 +161,16 @@ var CreateRecordAction = (0, _react.observer)(function (props) {
|
|
|
160
161
|
setVisible(true);
|
|
161
162
|
setCurrentCollection(collection.name);
|
|
162
163
|
}
|
|
163
|
-
},
|
|
164
|
+
}, icon, props.children) : /*#__PURE__*/_react2.default.createElement(_antd.Dropdown, {
|
|
164
165
|
overlay: menu
|
|
165
166
|
}, /*#__PURE__*/_react2.default.createElement(_antd.Button, {
|
|
166
|
-
icon:
|
|
167
|
+
icon: icon,
|
|
167
168
|
type: 'primary'
|
|
168
169
|
}, props.children, " ", /*#__PURE__*/_react2.default.createElement(_icons.DownOutlined, null))) : /*#__PURE__*/_react2.default.createElement(_antd.Button, {
|
|
169
170
|
type: componentType,
|
|
170
171
|
disabled: field.disabled,
|
|
171
172
|
danger: componentType === 'danger',
|
|
172
|
-
icon:
|
|
173
|
+
icon: icon,
|
|
173
174
|
onClick: function onClick(info) {
|
|
174
175
|
setVisible(true);
|
|
175
176
|
setCurrentCollection(collection.name);
|
|
@@ -3,33 +3,30 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.ExpandActionInitializer =
|
|
6
|
+
exports.ExpandActionInitializer = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _antd = require("antd");
|
|
9
|
-
var _css = require("@emotion/css");
|
|
10
|
-
var _reactI18next = require("react-i18next");
|
|
11
|
-
var _react2 = require("@formily/react");
|
|
12
8
|
var _ActionInitializer = require("./ActionInitializer");
|
|
13
|
-
var
|
|
14
|
-
var _icons = require("@ant-design/icons");
|
|
15
|
-
var _templateObject;
|
|
9
|
+
var _reactI18next = require("react-i18next");
|
|
16
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
11
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
18
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
19
12
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
20
13
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
21
14
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
22
15
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
23
16
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
24
17
|
var ExpandActionInitializer = function ExpandActionInitializer(props) {
|
|
18
|
+
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
19
|
+
t = _useTranslation.t;
|
|
25
20
|
var schema = {
|
|
26
21
|
'x-action': 'expandAll',
|
|
27
22
|
'x-component': 'Action',
|
|
28
|
-
'x-designer': 'Action.
|
|
23
|
+
'x-designer': 'Expand.Action.Design',
|
|
29
24
|
'x-component-props': {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
titleExpand: t("Expand all"),
|
|
26
|
+
titleCollapse: t("Collapse all"),
|
|
27
|
+
iconExpand: 'nodeexpandoutlined',
|
|
28
|
+
iconCollapse: 'nodecollapseoutlined',
|
|
29
|
+
component: 'Expand.Action',
|
|
33
30
|
useAction: function useAction() {
|
|
34
31
|
return {
|
|
35
32
|
run: function run() {}
|
|
@@ -41,27 +38,4 @@ var ExpandActionInitializer = function ExpandActionInitializer(props) {
|
|
|
41
38
|
schema: schema
|
|
42
39
|
}));
|
|
43
40
|
};
|
|
44
|
-
exports.ExpandActionInitializer = ExpandActionInitializer;
|
|
45
|
-
var actionDesignerCss = (0, _css.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n &:hover {\n .general-schema-designer {\n display: block;\n }\n }\n .general-schema-designer {\n position: absolute;\n z-index: 999;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: none;\n background: rgba(241, 139, 98, 0.06);\n border: 0;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n pointer-events: none;\n > .general-schema-designer-icons {\n position: absolute;\n right: 2px;\n top: 2px;\n line-height: 16px;\n pointer-events: all;\n .ant-space-item {\n background-color: #f18b62;\n color: #fff;\n line-height: 16px;\n width: 16px;\n padding-left: 1px;\n }\n }\n }\n"])));
|
|
46
|
-
var ExpandActionComponent = function ExpandActionComponent(props) {
|
|
47
|
-
var _schema$parent, _schema$parent$parent;
|
|
48
|
-
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
49
|
-
t = _useTranslation.t;
|
|
50
|
-
var schema = (0, _react2.useFieldSchema)();
|
|
51
|
-
var isTableSelector = ((_schema$parent = schema.parent) === null || _schema$parent === void 0 ? void 0 : (_schema$parent$parent = _schema$parent.parent) === null || _schema$parent$parent === void 0 ? void 0 : _schema$parent$parent['x-decorator']) === 'TableSelectorProvider';
|
|
52
|
-
var ctx = isTableSelector ? (0, _.useTableSelectorContext)() : (0, _.useTableBlockContext)();
|
|
53
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
54
|
-
className: actionDesignerCss
|
|
55
|
-
}, ctx.params['tree'] && /*#__PURE__*/_react.default.createElement(_antd.Button, {
|
|
56
|
-
onClick: function onClick() {
|
|
57
|
-
ctx === null || ctx === void 0 ? void 0 : ctx.setExpandFlag();
|
|
58
|
-
},
|
|
59
|
-
icon: (ctx === null || ctx === void 0 ? void 0 : ctx.expandFlag) ? /*#__PURE__*/_react.default.createElement(_icons.NodeCollapseOutlined, null) : /*#__PURE__*/_react.default.createElement(_icons.NodeExpandOutlined, null),
|
|
60
|
-
type: props.type
|
|
61
|
-
}, props.children[1], /*#__PURE__*/_react.default.createElement("span", {
|
|
62
|
-
style: {
|
|
63
|
-
marginLeft: 10
|
|
64
|
-
}
|
|
65
|
-
}, (ctx === null || ctx === void 0 ? void 0 : ctx.expandFlag) ? t('Collapse all') : t('Expand all'))));
|
|
66
|
-
};
|
|
67
|
-
exports.ExpandActionComponent = ExpandActionComponent;
|
|
41
|
+
exports.ExpandActionInitializer = ExpandActionInitializer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SelectActionInitializer: (props: any) => JSX.Element;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SelectActionInitializer = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _ActionInitializer = require("./ActionInitializer");
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
11
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
13
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
14
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
15
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
16
|
+
var SelectActionInitializer = function SelectActionInitializer(props) {
|
|
17
|
+
var schema = {
|
|
18
|
+
type: 'void',
|
|
19
|
+
title: '{{ t("Select") }}',
|
|
20
|
+
'x-action': 'update',
|
|
21
|
+
'x-designer': 'Action.Designer',
|
|
22
|
+
'x-component': 'Action',
|
|
23
|
+
'x-component-props': {
|
|
24
|
+
openMode: 'drawer'
|
|
25
|
+
},
|
|
26
|
+
properties: {
|
|
27
|
+
drawer: {
|
|
28
|
+
type: 'void',
|
|
29
|
+
'x-component': 'AssociationField.Selector',
|
|
30
|
+
title: '{{ t("Select record") }}',
|
|
31
|
+
'x-component-props': {
|
|
32
|
+
className: 'nb-record-picker-selector'
|
|
33
|
+
},
|
|
34
|
+
properties: {
|
|
35
|
+
grid: {
|
|
36
|
+
type: 'void',
|
|
37
|
+
'x-component': 'Grid',
|
|
38
|
+
'x-initializer': 'TableSelectorInitializers',
|
|
39
|
+
properties: {}
|
|
40
|
+
},
|
|
41
|
+
footer: {
|
|
42
|
+
'x-component': 'Action.Container.Footer',
|
|
43
|
+
'x-component-props': {},
|
|
44
|
+
properties: {
|
|
45
|
+
actions: {
|
|
46
|
+
type: 'void',
|
|
47
|
+
'x-component': 'ActionBar',
|
|
48
|
+
'x-component-props': {},
|
|
49
|
+
properties: {
|
|
50
|
+
submit: {
|
|
51
|
+
title: '{{ t("Submit") }}',
|
|
52
|
+
'x-action': 'submit',
|
|
53
|
+
'x-component': 'Action',
|
|
54
|
+
'x-designer': 'Action.Designer',
|
|
55
|
+
'x-component-props': {
|
|
56
|
+
type: 'primary',
|
|
57
|
+
htmlType: 'submit',
|
|
58
|
+
useProps: '{{ usePickActionProps }}'
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
return /*#__PURE__*/_react.default.createElement(_ActionInitializer.ActionInitializer, _objectSpread(_objectSpread({}, props), {}, {
|
|
70
|
+
schema: schema
|
|
71
|
+
}));
|
|
72
|
+
};
|
|
73
|
+
exports.SelectActionInitializer = SelectActionInitializer;
|
|
@@ -552,4 +552,15 @@ Object.keys(_ViewActionInitializer).forEach(function (key) {
|
|
|
552
552
|
return _ViewActionInitializer[key];
|
|
553
553
|
}
|
|
554
554
|
});
|
|
555
|
+
});
|
|
556
|
+
var _SelectActionInitializer = require("./SelectActionInitializer");
|
|
557
|
+
Object.keys(_SelectActionInitializer).forEach(function (key) {
|
|
558
|
+
if (key === "default" || key === "__esModule") return;
|
|
559
|
+
if (key in exports && exports[key] === _SelectActionInitializer[key]) return;
|
|
560
|
+
Object.defineProperty(exports, key, {
|
|
561
|
+
enumerable: true,
|
|
562
|
+
get: function get() {
|
|
563
|
+
return _SelectActionInitializer[key];
|
|
564
|
+
}
|
|
565
|
+
});
|
|
555
566
|
});
|
|
@@ -280,12 +280,15 @@ var useFormItemInitializerFields = function useFormItemInitializerFields(options
|
|
|
280
280
|
var _field$uiSchema3, _field$uiSchema4;
|
|
281
281
|
var interfaceConfig = getInterface(field.interface);
|
|
282
282
|
var targetCollection = getCollection(field.target);
|
|
283
|
-
|
|
283
|
+
// const component =
|
|
284
|
+
// field.interface === 'o2m' && targetCollection?.template !== 'file' && !snapshot
|
|
285
|
+
// ? 'TableField'
|
|
286
|
+
// : 'CollectionField';
|
|
284
287
|
var schema = {
|
|
285
288
|
type: 'string',
|
|
286
289
|
name: field.name,
|
|
287
290
|
'x-designer': 'FormItem.Designer',
|
|
288
|
-
'x-component':
|
|
291
|
+
'x-component': 'CollectionField',
|
|
289
292
|
'x-decorator': 'FormItem',
|
|
290
293
|
'x-collection-field': "".concat(name, ".").concat(field.name),
|
|
291
294
|
'x-component-props': {},
|
|
@@ -345,13 +348,16 @@ var useFilterFormItemInitializerFields = function useFilterFormItemInitializerFi
|
|
|
345
348
|
var _field$uiSchema6;
|
|
346
349
|
var interfaceConfig = getInterface(field.interface);
|
|
347
350
|
var targetCollection = getCollection(field.target);
|
|
348
|
-
|
|
351
|
+
// const component =
|
|
352
|
+
// field.interface === 'o2m' && targetCollection?.template !== 'file' && !snapshot
|
|
353
|
+
// ? 'TableField'
|
|
354
|
+
// : 'CollectionField';
|
|
349
355
|
var schema = {
|
|
350
356
|
type: 'string',
|
|
351
357
|
name: field.name,
|
|
352
358
|
required: false,
|
|
353
359
|
'x-designer': 'FormItem.FilterFormDesigner',
|
|
354
|
-
'x-component':
|
|
360
|
+
'x-component': 'CollectionField',
|
|
355
361
|
'x-decorator': 'FormItem',
|
|
356
362
|
'x-collection-field': "".concat(name, ".").concat(field.name),
|
|
357
363
|
'x-component-props': {}
|
|
@@ -539,13 +545,16 @@ var useInheritsFormItemInitializerFields = function useInheritsFormItemInitializ
|
|
|
539
545
|
var _field$uiSchema10, _field$uiSchema11, _field$uiSchema12;
|
|
540
546
|
var interfaceConfig = getInterface(field.interface);
|
|
541
547
|
var targetCollection = getCollection(field.target);
|
|
542
|
-
|
|
548
|
+
// const component =
|
|
549
|
+
// field.interface === 'o2m' && targetCollection?.template !== 'file' && !snapshot
|
|
550
|
+
// ? 'TableField'
|
|
551
|
+
// : 'CollectionField';
|
|
543
552
|
var schema = {
|
|
544
553
|
type: 'string',
|
|
545
554
|
name: field.name,
|
|
546
555
|
title: (field === null || field === void 0 ? void 0 : (_field$uiSchema10 = field.uiSchema) === null || _field$uiSchema10 === void 0 ? void 0 : _field$uiSchema10.title) || field.name,
|
|
547
556
|
'x-designer': 'FormItem.Designer',
|
|
548
|
-
'x-component':
|
|
557
|
+
'x-component': 'CollectionField',
|
|
549
558
|
'x-decorator': 'FormItem',
|
|
550
559
|
'x-collection-field': "".concat(name, ".").concat(field.name),
|
|
551
560
|
'x-component-props': {},
|
|
@@ -600,14 +609,17 @@ var useFilterInheritsFormItemInitializerFields = function useFilterInheritsFormI
|
|
|
600
609
|
var _field$uiSchema13, _field$uiSchema14, _field$uiSchema15;
|
|
601
610
|
var interfaceConfig = getInterface(field.interface);
|
|
602
611
|
var targetCollection = getCollection(field.target);
|
|
603
|
-
|
|
612
|
+
// const component =
|
|
613
|
+
// field.interface === 'o2m' && targetCollection?.template !== 'file' && !snapshot
|
|
614
|
+
// ? 'TableField'
|
|
615
|
+
// : 'CollectionField';
|
|
604
616
|
var schema = {
|
|
605
617
|
type: 'string',
|
|
606
618
|
name: field.name,
|
|
607
619
|
title: (field === null || field === void 0 ? void 0 : (_field$uiSchema13 = field.uiSchema) === null || _field$uiSchema13 === void 0 ? void 0 : _field$uiSchema13.title) || field.name,
|
|
608
620
|
required: false,
|
|
609
621
|
'x-designer': 'FormItem.FilterFormDesigner',
|
|
610
|
-
'x-component':
|
|
622
|
+
'x-component': 'CollectionField',
|
|
611
623
|
'x-decorator': 'FormItem',
|
|
612
624
|
'x-collection-field': "".concat(name, ".").concat(field.name),
|
|
613
625
|
'x-component-props': {},
|