@nocobase/client 0.9.2-alpha.3 → 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/acl/Configuration/schemas/useRoleResourceValues.d.ts +1 -14
- package/es/api-client/hooks/useRequest.d.ts +1 -14
- package/es/api-client/hooks/useRequest.js +48 -53
- package/es/block-provider/DetailsBlockProvider.js +13 -1
- package/es/block-provider/FormBlockProvider.js +30 -13
- package/es/block-provider/hooks/index.d.ts +11 -1
- package/es/block-provider/hooks/index.js +527 -301
- package/es/collection-manager/Configuration/CollectionFields.js +1 -2
- package/es/collection-manager/Configuration/EditCollectionAction.d.ts +1 -14
- package/es/collection-manager/action-hooks.d.ts +4 -43
- 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 +5 -40
- package/es/collection-manager/interfaces/m2m.js +6 -39
- package/es/collection-manager/interfaces/m2o.js +6 -39
- package/es/collection-manager/interfaces/o2m.js +6 -69
- package/es/collection-manager/interfaces/o2o.js +31 -122
- package/es/collection-manager/interfaces/types.d.ts +2 -0
- package/es/collection-manager/interfaces/updatedBy.js +1 -1
- package/es/collection-manager/sub-table.d.ts +1 -14
- package/es/collection-manager/templates/tree.js +2 -2
- package/es/filter-provider/FilterProvider.js +3 -1
- package/es/locale/en_US.d.ts +4 -1
- package/es/locale/en_US.js +6 -3
- package/es/locale/ja_JP.d.ts +4 -1
- package/es/locale/ja_JP.js +4 -1
- package/es/locale/pt_BR.d.ts +1 -1
- package/es/locale/pt_BR.js +1 -1
- package/es/locale/zh_CN.d.ts +5 -1
- package/es/locale/zh_CN.js +5 -1
- 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/association-filter/AssociationFilter.FilterBlockInitializer.js +2 -2
- package/es/schema-component/antd/association-select/AssociationSelect.js +11 -2
- 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 +206 -58
- package/es/schema-component/antd/form-item/SchemaSettingOptions.js +36 -58
- package/es/schema-component/antd/form-v2/utils.js +6 -4
- package/es/schema-component/antd/gantt/components/gantt/gantt.js +3 -3
- 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 +40 -17
- 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 +15 -16
- package/es/schema-component/antd/variable/TextArea.js +2 -5
- package/es/schema-component/antd/variable/Variable.d.ts +2 -0
- package/es/schema-component/antd/variable/Variable.js +5 -2
- 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 +57 -43
- 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 +3 -3
- package/es/schema-settings/VariableInput/VariableInput.d.ts +3 -2
- package/es/schema-settings/VariableInput/VariableInput.js +3 -1
- package/lib/acl/Configuration/schemas/useRoleResourceValues.d.ts +1 -14
- package/lib/api-client/hooks/useRequest.d.ts +1 -14
- package/lib/api-client/hooks/useRequest.js +48 -53
- package/lib/block-provider/DetailsBlockProvider.js +13 -1
- package/lib/block-provider/FormBlockProvider.js +31 -15
- package/lib/block-provider/hooks/index.d.ts +11 -1
- package/lib/block-provider/hooks/index.js +537 -308
- package/lib/collection-manager/Configuration/CollectionFields.js +1 -2
- package/lib/collection-manager/Configuration/EditCollectionAction.d.ts +1 -14
- package/lib/collection-manager/action-hooks.d.ts +4 -43
- 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 +4 -39
- package/lib/collection-manager/interfaces/m2m.js +5 -38
- package/lib/collection-manager/interfaces/m2o.js +5 -38
- package/lib/collection-manager/interfaces/o2m.js +8 -71
- package/lib/collection-manager/interfaces/o2o.js +36 -127
- package/lib/collection-manager/interfaces/types.d.ts +2 -0
- package/lib/collection-manager/interfaces/updatedBy.js +1 -1
- package/lib/collection-manager/sub-table.d.ts +1 -14
- package/lib/collection-manager/templates/tree.js +2 -2
- package/lib/filter-provider/FilterProvider.js +3 -1
- package/lib/locale/en_US.d.ts +4 -1
- package/lib/locale/en_US.js +6 -3
- package/lib/locale/ja_JP.d.ts +4 -1
- package/lib/locale/ja_JP.js +4 -1
- package/lib/locale/pt_BR.d.ts +1 -1
- package/lib/locale/pt_BR.js +1 -1
- package/lib/locale/zh_CN.d.ts +5 -1
- package/lib/locale/zh_CN.js +5 -1
- 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/association-filter/AssociationFilter.FilterBlockInitializer.js +2 -2
- package/lib/schema-component/antd/association-select/AssociationSelect.js +10 -1
- 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 +204 -55
- package/lib/schema-component/antd/form-item/SchemaSettingOptions.js +34 -56
- package/lib/schema-component/antd/form-v2/utils.js +6 -5
- package/lib/schema-component/antd/gantt/components/gantt/gantt.js +3 -3
- 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 +42 -18
- 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 +15 -16
- package/lib/schema-component/antd/variable/TextArea.js +2 -5
- package/lib/schema-component/antd/variable/Variable.d.ts +2 -0
- package/lib/schema-component/antd/variable/Variable.js +6 -2
- 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 +56 -42
- 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 +4 -4
- package/lib/schema-settings/VariableInput/VariableInput.d.ts +3 -2
- package/lib/schema-settings/VariableInput/VariableInput.js +3 -1
- package/package.json +5 -6
|
@@ -4,81 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.oho = exports.obo = exports.o2o = void 0;
|
|
7
|
-
var
|
|
8
|
-
var _properties2 = require("./properties");
|
|
7
|
+
var _properties = require("./properties");
|
|
9
8
|
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); }
|
|
10
9
|
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; }
|
|
11
10
|
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; }
|
|
12
11
|
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; }
|
|
13
12
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
14
13
|
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); }
|
|
15
|
-
var internalSchameInitialize = function internalSchameInitialize(schema, _ref) {
|
|
16
|
-
var field = _ref.field,
|
|
17
|
-
block = _ref.block,
|
|
18
|
-
readPretty = _ref.readPretty,
|
|
19
|
-
action = _ref.action;
|
|
20
|
-
if (block === 'Form') {
|
|
21
|
-
if (schema['x-component'] === 'FormField') {
|
|
22
|
-
var association = "".concat(field.collectionName, ".").concat(field.name);
|
|
23
|
-
schema.type = 'void';
|
|
24
|
-
schema.properties = {
|
|
25
|
-
block: {
|
|
26
|
-
type: 'void',
|
|
27
|
-
'x-decorator': 'FormFieldProvider',
|
|
28
|
-
'x-decorator-props': {
|
|
29
|
-
collection: field.target,
|
|
30
|
-
association: association,
|
|
31
|
-
resource: association,
|
|
32
|
-
action: action,
|
|
33
|
-
fieldName: field.name,
|
|
34
|
-
readPretty: readPretty
|
|
35
|
-
},
|
|
36
|
-
'x-component': 'CardItem',
|
|
37
|
-
'x-component-props': {
|
|
38
|
-
bordered: true
|
|
39
|
-
},
|
|
40
|
-
properties: _defineProperty({}, field.name, {
|
|
41
|
-
type: 'object',
|
|
42
|
-
'x-component': 'FormV2',
|
|
43
|
-
'x-component-props': {
|
|
44
|
-
useProps: '{{ useFormFieldProps }}'
|
|
45
|
-
},
|
|
46
|
-
properties: {
|
|
47
|
-
__form_grid: {
|
|
48
|
-
type: 'void',
|
|
49
|
-
'x-component': 'Grid',
|
|
50
|
-
'x-initializer': 'FormItemInitializers',
|
|
51
|
-
properties: {}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
})
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
} else if (schema['x-component'] === 'AssociationSelect') {
|
|
58
|
-
Object.assign(schema, {
|
|
59
|
-
type: 'string',
|
|
60
|
-
'x-designer': 'AssociationSelect.Designer'
|
|
61
|
-
});
|
|
62
|
-
} else {
|
|
63
|
-
schema.type = 'string';
|
|
64
|
-
schema['properties'] = {
|
|
65
|
-
viewer: (0, _lodash.cloneDeep)(_properties2.recordPickerViewer),
|
|
66
|
-
selector: (0, _lodash.cloneDeep)(_properties2.recordPickerSelector)
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
return schema;
|
|
70
|
-
}
|
|
71
|
-
schema.type = 'string';
|
|
72
|
-
if (readPretty) {
|
|
73
|
-
schema['properties'] = {
|
|
74
|
-
viewer: (0, _lodash.cloneDeep)(_properties2.recordPickerViewer)
|
|
75
|
-
};
|
|
76
|
-
} else {
|
|
77
|
-
schema['properties'] = {
|
|
78
|
-
selector: (0, _lodash.cloneDeep)(_properties2.recordPickerSelector)
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
14
|
var o2o = {
|
|
83
15
|
name: 'o2o',
|
|
84
16
|
type: 'object',
|
|
@@ -92,7 +24,7 @@ var o2o = {
|
|
|
92
24
|
// name,
|
|
93
25
|
uiSchema: {
|
|
94
26
|
// title,
|
|
95
|
-
'x-component': '
|
|
27
|
+
'x-component': 'AssociationField',
|
|
96
28
|
'x-component-props': {
|
|
97
29
|
// mode: 'tags',
|
|
98
30
|
multiple: false,
|
|
@@ -109,7 +41,7 @@ var o2o = {
|
|
|
109
41
|
// name,
|
|
110
42
|
uiSchema: {
|
|
111
43
|
// title,
|
|
112
|
-
'x-component': '
|
|
44
|
+
'x-component': 'AssociationField',
|
|
113
45
|
'x-component-props': {
|
|
114
46
|
// mode: 'tags',
|
|
115
47
|
multiple: false,
|
|
@@ -122,17 +54,11 @@ var o2o = {
|
|
|
122
54
|
}
|
|
123
55
|
},
|
|
124
56
|
availableTypes: ['hasOne'],
|
|
125
|
-
schemaInitialize: function schemaInitialize(schema,
|
|
126
|
-
var field =
|
|
127
|
-
block =
|
|
128
|
-
readPretty =
|
|
129
|
-
action =
|
|
130
|
-
internalSchameInitialize(schema, {
|
|
131
|
-
field: field,
|
|
132
|
-
block: block,
|
|
133
|
-
readPretty: readPretty,
|
|
134
|
-
action: action
|
|
135
|
-
});
|
|
57
|
+
schemaInitialize: function schemaInitialize(schema, _ref) {
|
|
58
|
+
var field = _ref.field,
|
|
59
|
+
block = _ref.block,
|
|
60
|
+
readPretty = _ref.readPretty,
|
|
61
|
+
action = _ref.action;
|
|
136
62
|
if (['Table', 'Kanban'].includes(block)) {
|
|
137
63
|
schema['x-component-props'] = schema['x-component-props'] || {};
|
|
138
64
|
schema['x-component-props']['ellipsis'] = true;
|
|
@@ -157,7 +83,7 @@ var o2o = {
|
|
|
157
83
|
'x-component': 'Input',
|
|
158
84
|
description: "{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}"
|
|
159
85
|
},
|
|
160
|
-
type:
|
|
86
|
+
type: _properties.relationshipType,
|
|
161
87
|
grid: {
|
|
162
88
|
type: 'void',
|
|
163
89
|
'x-component': 'Grid',
|
|
@@ -260,7 +186,8 @@ var o2o = {
|
|
|
260
186
|
// },
|
|
261
187
|
// },
|
|
262
188
|
]
|
|
263
|
-
}
|
|
189
|
+
},
|
|
190
|
+
invariable: true
|
|
264
191
|
};
|
|
265
192
|
exports.o2o = o2o;
|
|
266
193
|
var oho = {
|
|
@@ -276,7 +203,7 @@ var oho = {
|
|
|
276
203
|
// name,
|
|
277
204
|
uiSchema: {
|
|
278
205
|
// title,
|
|
279
|
-
'x-component': '
|
|
206
|
+
'x-component': 'AssociationField',
|
|
280
207
|
'x-component-props': {
|
|
281
208
|
// mode: 'tags',
|
|
282
209
|
multiple: false,
|
|
@@ -293,7 +220,7 @@ var oho = {
|
|
|
293
220
|
// name,
|
|
294
221
|
uiSchema: {
|
|
295
222
|
// title,
|
|
296
|
-
'x-component': '
|
|
223
|
+
'x-component': 'AssociationField',
|
|
297
224
|
'x-component-props': {
|
|
298
225
|
// mode: 'tags',
|
|
299
226
|
multiple: false,
|
|
@@ -305,17 +232,12 @@ var oho = {
|
|
|
305
232
|
}
|
|
306
233
|
}
|
|
307
234
|
},
|
|
308
|
-
schemaInitialize: function schemaInitialize(schema,
|
|
309
|
-
var field =
|
|
310
|
-
block =
|
|
311
|
-
readPretty =
|
|
312
|
-
action =
|
|
313
|
-
|
|
314
|
-
field: field,
|
|
315
|
-
block: block,
|
|
316
|
-
readPretty: readPretty,
|
|
317
|
-
action: action
|
|
318
|
-
});
|
|
235
|
+
schemaInitialize: function schemaInitialize(schema, _ref2) {
|
|
236
|
+
var field = _ref2.field,
|
|
237
|
+
block = _ref2.block,
|
|
238
|
+
readPretty = _ref2.readPretty,
|
|
239
|
+
action = _ref2.action;
|
|
240
|
+
schema['type'] = 'object';
|
|
319
241
|
if (['Table', 'Kanban'].includes(block)) {
|
|
320
242
|
schema['x-component-props'] = schema['x-component-props'] || {};
|
|
321
243
|
schema['x-component-props']['ellipsis'] = true;
|
|
@@ -340,7 +262,7 @@ var oho = {
|
|
|
340
262
|
'x-component': 'Input',
|
|
341
263
|
description: "{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}"
|
|
342
264
|
},
|
|
343
|
-
type:
|
|
265
|
+
type: _properties.relationshipType,
|
|
344
266
|
grid: {
|
|
345
267
|
type: 'void',
|
|
346
268
|
'x-component': 'Grid',
|
|
@@ -416,7 +338,7 @@ var oho = {
|
|
|
416
338
|
}
|
|
417
339
|
}
|
|
418
340
|
}
|
|
419
|
-
},
|
|
341
|
+
}, _properties.constraintsProps), _properties.reverseFieldProperties),
|
|
420
342
|
filterable: {
|
|
421
343
|
nested: true,
|
|
422
344
|
children: [
|
|
@@ -434,7 +356,8 @@ var oho = {
|
|
|
434
356
|
// },
|
|
435
357
|
// },
|
|
436
358
|
]
|
|
437
|
-
}
|
|
359
|
+
},
|
|
360
|
+
invariable: true
|
|
438
361
|
};
|
|
439
362
|
exports.oho = oho;
|
|
440
363
|
var obo = {
|
|
@@ -450,7 +373,7 @@ var obo = {
|
|
|
450
373
|
// name,
|
|
451
374
|
uiSchema: {
|
|
452
375
|
// title,
|
|
453
|
-
'x-component': '
|
|
376
|
+
'x-component': 'AssociationField',
|
|
454
377
|
'x-component-props': {
|
|
455
378
|
// mode: 'tags',
|
|
456
379
|
multiple: false,
|
|
@@ -466,7 +389,7 @@ var obo = {
|
|
|
466
389
|
// name,
|
|
467
390
|
uiSchema: {
|
|
468
391
|
// title,
|
|
469
|
-
'x-component': '
|
|
392
|
+
'x-component': 'AssociationField',
|
|
470
393
|
'x-component-props': {
|
|
471
394
|
// mode: 'tags',
|
|
472
395
|
multiple: false,
|
|
@@ -478,18 +401,13 @@ var obo = {
|
|
|
478
401
|
}
|
|
479
402
|
}
|
|
480
403
|
},
|
|
481
|
-
schemaInitialize: function schemaInitialize(schema,
|
|
482
|
-
var field =
|
|
483
|
-
block =
|
|
484
|
-
readPretty =
|
|
485
|
-
action =
|
|
486
|
-
targetCollection =
|
|
487
|
-
|
|
488
|
-
field: field,
|
|
489
|
-
block: block,
|
|
490
|
-
readPretty: readPretty,
|
|
491
|
-
action: action
|
|
492
|
-
});
|
|
404
|
+
schemaInitialize: function schemaInitialize(schema, _ref3) {
|
|
405
|
+
var field = _ref3.field,
|
|
406
|
+
block = _ref3.block,
|
|
407
|
+
readPretty = _ref3.readPretty,
|
|
408
|
+
action = _ref3.action,
|
|
409
|
+
targetCollection = _ref3.targetCollection;
|
|
410
|
+
schema['type'] = 'object';
|
|
493
411
|
if (['Table', 'Kanban'].includes(block)) {
|
|
494
412
|
schema['x-component-props'] = schema['x-component-props'] || {};
|
|
495
413
|
schema['x-component-props']['ellipsis'] = true;
|
|
@@ -502,16 +420,6 @@ var obo = {
|
|
|
502
420
|
};
|
|
503
421
|
schema['x-component-props'].fieldNames.label = targetCollection.titleField;
|
|
504
422
|
}
|
|
505
|
-
if ((targetCollection === null || targetCollection === void 0 ? void 0 : targetCollection.template) === 'file') {
|
|
506
|
-
var fieldNames = schema['x-component-props']['fieldNames'] || {
|
|
507
|
-
label: 'preview',
|
|
508
|
-
value: 'id'
|
|
509
|
-
};
|
|
510
|
-
fieldNames.label = 'preview';
|
|
511
|
-
schema['x-component-props']['fieldNames'] = fieldNames;
|
|
512
|
-
schema['x-component-props'].quickUpload = true;
|
|
513
|
-
schema['x-component-props'].selectFile = true;
|
|
514
|
-
}
|
|
515
423
|
},
|
|
516
424
|
properties: _objectSpread(_objectSpread({
|
|
517
425
|
'uiSchema.title': {
|
|
@@ -530,7 +438,7 @@ var obo = {
|
|
|
530
438
|
'x-component': 'Input',
|
|
531
439
|
description: "{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}"
|
|
532
440
|
},
|
|
533
|
-
type:
|
|
441
|
+
type: _properties.relationshipType,
|
|
534
442
|
grid: {
|
|
535
443
|
type: 'void',
|
|
536
444
|
'x-component': 'Grid',
|
|
@@ -607,7 +515,7 @@ var obo = {
|
|
|
607
515
|
}
|
|
608
516
|
}
|
|
609
517
|
}
|
|
610
|
-
},
|
|
518
|
+
}, _properties.constraintsProps), _properties.reverseFieldProperties),
|
|
611
519
|
filterable: {
|
|
612
520
|
nested: true,
|
|
613
521
|
children: [
|
|
@@ -625,6 +533,7 @@ var obo = {
|
|
|
625
533
|
// },
|
|
626
534
|
// },
|
|
627
535
|
]
|
|
628
|
-
}
|
|
536
|
+
},
|
|
537
|
+
invariable: true
|
|
629
538
|
};
|
|
630
539
|
exports.obo = obo;
|
|
@@ -2,20 +2,7 @@ import React from 'react';
|
|
|
2
2
|
export declare const DataSourceContext: React.Context<any>;
|
|
3
3
|
export declare const ds: {
|
|
4
4
|
useSelectedRowKeys: () => any[];
|
|
5
|
-
useDataSource: (options: any) =>
|
|
6
|
-
state: {};
|
|
7
|
-
setState: import("ahooks/lib/useSetState").SetState<{}>;
|
|
8
|
-
loading: boolean;
|
|
9
|
-
data?: any;
|
|
10
|
-
error?: Error;
|
|
11
|
-
params: any;
|
|
12
|
-
cancel: () => void;
|
|
13
|
-
refresh: () => void;
|
|
14
|
-
refreshAsync: () => Promise<any>;
|
|
15
|
-
run: (...params: any) => void;
|
|
16
|
-
runAsync: (...params: any) => Promise<any>;
|
|
17
|
-
mutate: (data?: any) => void;
|
|
18
|
-
};
|
|
5
|
+
useDataSource: (options: any) => any;
|
|
19
6
|
useCreateAction: () => {
|
|
20
7
|
run(): Promise<void>;
|
|
21
8
|
};
|
|
@@ -32,7 +32,7 @@ var tree = {
|
|
|
32
32
|
onDelete: 'CASCADE',
|
|
33
33
|
uiSchema: {
|
|
34
34
|
title: '{{t("Parent")}}',
|
|
35
|
-
'x-component': '
|
|
35
|
+
'x-component': 'AssociationField',
|
|
36
36
|
'x-component-props': {
|
|
37
37
|
// mode: 'tags',
|
|
38
38
|
multiple: false,
|
|
@@ -51,7 +51,7 @@ var tree = {
|
|
|
51
51
|
onDelete: 'CASCADE',
|
|
52
52
|
uiSchema: {
|
|
53
53
|
title: '{{t("Children")}}',
|
|
54
|
-
'x-component': '
|
|
54
|
+
'x-component': 'AssociationField',
|
|
55
55
|
'x-component-props': {
|
|
56
56
|
// mode: 'tags',
|
|
57
57
|
multiple: true,
|
|
@@ -12,6 +12,7 @@ var _SharedFilterProvider = require("../block-provider/SharedFilterProvider");
|
|
|
12
12
|
var _collectionManager = require("../collection-manager");
|
|
13
13
|
var _schemaComponent = require("../schema-component");
|
|
14
14
|
var _utils = require("./utils");
|
|
15
|
+
var _lodash = require("lodash");
|
|
15
16
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
17
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
18
|
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; }
|
|
@@ -131,8 +132,9 @@ var useFilterBlock = function useFilterBlock() {
|
|
|
131
132
|
existingBlock.defaultFilter = block.defaultFilter;
|
|
132
133
|
return;
|
|
133
134
|
}
|
|
135
|
+
// 由于 setDataBlocks 是异步操作,所以上面的 existingBlock 在判断时有可能用的是旧的 dataBlocks,所以下面还需要根据 uid 进行去重操作
|
|
134
136
|
setDataBlocks(function (prev) {
|
|
135
|
-
return [].concat(_toConsumableArray(prev), [block]);
|
|
137
|
+
return (0, _lodash.uniqBy)([].concat(_toConsumableArray(prev), [block]), 'uid');
|
|
136
138
|
});
|
|
137
139
|
};
|
|
138
140
|
var getDataBlocks = function getDataBlocks() {
|
package/lib/locale/en_US.d.ts
CHANGED
|
@@ -210,7 +210,7 @@ declare const _default: {
|
|
|
210
210
|
"Association fields filter": string;
|
|
211
211
|
"PK & FK fields": string;
|
|
212
212
|
"Association fields": string;
|
|
213
|
-
"
|
|
213
|
+
"Choices fields": string;
|
|
214
214
|
"System fields": string;
|
|
215
215
|
"General fields": string;
|
|
216
216
|
"Inherited fields": string;
|
|
@@ -241,6 +241,7 @@ declare const _default: {
|
|
|
241
241
|
"Link to": string;
|
|
242
242
|
"Link to description": string;
|
|
243
243
|
"Sub-table": string;
|
|
244
|
+
"Sub-details": string;
|
|
244
245
|
"System info": string;
|
|
245
246
|
"Created at": string;
|
|
246
247
|
"Last updated at": string;
|
|
@@ -282,6 +283,8 @@ declare const _default: {
|
|
|
282
283
|
"Field component": string;
|
|
283
284
|
Subtable: string;
|
|
284
285
|
Subform: string;
|
|
286
|
+
"Field mode": string;
|
|
287
|
+
"Allow add new data": string;
|
|
285
288
|
"Record picker": string;
|
|
286
289
|
"Toggles the subfield mode": string;
|
|
287
290
|
"Selector mode": string;
|
package/lib/locale/en_US.js
CHANGED
|
@@ -216,7 +216,7 @@ var _default = {
|
|
|
216
216
|
"Association fields filter": "Association fields filter",
|
|
217
217
|
"PK & FK fields": "PK & FK fields",
|
|
218
218
|
"Association fields": "Association fields",
|
|
219
|
-
"
|
|
219
|
+
"Choices fields": "Choices fields",
|
|
220
220
|
"System fields": "System fields",
|
|
221
221
|
"General fields": "General fields",
|
|
222
222
|
"Inherited fields": "Inherited fields",
|
|
@@ -247,6 +247,7 @@ var _default = {
|
|
|
247
247
|
"Link to": "Link to",
|
|
248
248
|
"Link to description": "Used to create collection relationships quickly and compatible with most common scenarios. Suitable for non-developer use. When present as a field, it is a drop-down selection used to select records from the target collection. Once created, it will simultaneously generate the associated fields of the current collection in the target collection.",
|
|
249
249
|
"Sub-table": "Sub-table",
|
|
250
|
+
"Sub-details": "Sub-details",
|
|
250
251
|
"System info": "System info",
|
|
251
252
|
"Created at": "Created at",
|
|
252
253
|
"Last updated at": "Last updated at",
|
|
@@ -287,12 +288,14 @@ var _default = {
|
|
|
287
288
|
"Display field title": "Display field title",
|
|
288
289
|
"Field component": "Field component",
|
|
289
290
|
"Subtable": "Subtable",
|
|
290
|
-
"Subform": "
|
|
291
|
+
"Subform": "Sub-form",
|
|
292
|
+
"Field mode": "Field mode",
|
|
293
|
+
"Allow add new data": "Allow add new data",
|
|
291
294
|
"Record picker": "Record picker",
|
|
292
295
|
"Toggles the subfield mode": "Toggles the subfield mode",
|
|
293
296
|
"Selector mode": "Selector mode",
|
|
294
297
|
"Subtable mode": "Subtable mode",
|
|
295
|
-
"Subform mode": "
|
|
298
|
+
"Subform mode": "Sub-form mode",
|
|
296
299
|
"Edit block title": "Edit block title",
|
|
297
300
|
"Block title": "Block title",
|
|
298
301
|
"Pattern": "Pattern",
|
package/lib/locale/ja_JP.d.ts
CHANGED
|
@@ -556,6 +556,9 @@ declare const _default: {
|
|
|
556
556
|
"Field component": string;
|
|
557
557
|
Subtable: string;
|
|
558
558
|
Subform: string;
|
|
559
|
+
"Sub-details": string;
|
|
560
|
+
"Field mode": string;
|
|
561
|
+
"Allow add new data": string;
|
|
559
562
|
"Regular expression": string;
|
|
560
563
|
"Enabled languages": string;
|
|
561
564
|
"View all plugins": string;
|
|
@@ -576,7 +579,7 @@ declare const _default: {
|
|
|
576
579
|
"Enable SMS authentication": string;
|
|
577
580
|
"Display association fields": string;
|
|
578
581
|
"Set default value": string;
|
|
579
|
-
"
|
|
582
|
+
"Choices fields": string;
|
|
580
583
|
Editable: string;
|
|
581
584
|
Readonly: string;
|
|
582
585
|
"Easy-reading": string;
|
package/lib/locale/ja_JP.js
CHANGED
|
@@ -562,6 +562,9 @@ var _default = {
|
|
|
562
562
|
"Field component": "フィールドコンポーネント",
|
|
563
563
|
"Subtable": "サブテーブル",
|
|
564
564
|
"Subform": "サブフォーム",
|
|
565
|
+
"Sub-details": "サブリスト",
|
|
566
|
+
"Field mode": "フィールドコンポーネント",
|
|
567
|
+
"Allow add new data": "データの追加を許可",
|
|
565
568
|
"Regular expression": "正規表現",
|
|
566
569
|
"Enabled languages": "利用可能な言語",
|
|
567
570
|
"View all plugins": "すべてのプラグラインを見る",
|
|
@@ -583,7 +586,7 @@ var _default = {
|
|
|
583
586
|
"Enable SMS authentication": "SMS認証を有効にする",
|
|
584
587
|
"Display association fields": "関連付けられたコレクションのフィールドを表示",
|
|
585
588
|
"Set default value": "デフォルト値を設定",
|
|
586
|
-
"
|
|
589
|
+
"Choices fields": "チョイスフィールド",
|
|
587
590
|
"Editable": "編集可能",
|
|
588
591
|
"Readonly": "読み取り専用(編集不可)",
|
|
589
592
|
"Easy-reading": "読取り専用(読取りモード)",
|
package/lib/locale/pt_BR.d.ts
CHANGED
|
@@ -170,7 +170,7 @@ declare const _default: {
|
|
|
170
170
|
"Association fields filter": string;
|
|
171
171
|
"PK & FK fields": string;
|
|
172
172
|
"Association fields": string;
|
|
173
|
-
"
|
|
173
|
+
"Choices fields": string;
|
|
174
174
|
"System fields": string;
|
|
175
175
|
"General fields": string;
|
|
176
176
|
"Inherited fields": string;
|
package/lib/locale/pt_BR.js
CHANGED
|
@@ -176,7 +176,7 @@ var _default = {
|
|
|
176
176
|
"Association fields filter": "Filtro de campos de associação",
|
|
177
177
|
"PK & FK fields": "Campos PK & FK",
|
|
178
178
|
"Association fields": "Campos de associação",
|
|
179
|
-
"
|
|
179
|
+
"Choices fields": "Campos de opções",
|
|
180
180
|
"System fields": "Campos do sistema",
|
|
181
181
|
"General fields": "Campos gerais",
|
|
182
182
|
"Inherited fields": "Campos herdados",
|
package/lib/locale/zh_CN.d.ts
CHANGED
|
@@ -214,6 +214,7 @@ declare const _default: {
|
|
|
214
214
|
"Edit collection": string;
|
|
215
215
|
"Configure fields": string;
|
|
216
216
|
"Configure columns": string;
|
|
217
|
+
"Please select the records you want to delete": string;
|
|
217
218
|
"Edit field": string;
|
|
218
219
|
Override: string;
|
|
219
220
|
"Override field": string;
|
|
@@ -221,7 +222,7 @@ declare const _default: {
|
|
|
221
222
|
"Association fields filter": string;
|
|
222
223
|
"PK & FK fields": string;
|
|
223
224
|
"Association fields": string;
|
|
224
|
-
"
|
|
225
|
+
"Choices fields": string;
|
|
225
226
|
"System fields": string;
|
|
226
227
|
"General fields": string;
|
|
227
228
|
"Inherited fields": string;
|
|
@@ -300,11 +301,14 @@ declare const _default: {
|
|
|
300
301
|
"Field component": string;
|
|
301
302
|
Subtable: string;
|
|
302
303
|
Subform: string;
|
|
304
|
+
"Sub-details": string;
|
|
303
305
|
"Record picker": string;
|
|
304
306
|
"Toggles the subfield mode": string;
|
|
305
307
|
"Selector mode": string;
|
|
306
308
|
"Subtable mode": string;
|
|
307
309
|
"Subform mode": string;
|
|
310
|
+
"Field mode": string;
|
|
311
|
+
"Allow add new data": string;
|
|
308
312
|
"Edit block title": string;
|
|
309
313
|
"Block title": string;
|
|
310
314
|
Pattern: string;
|
package/lib/locale/zh_CN.js
CHANGED
|
@@ -220,6 +220,7 @@ var _default = {
|
|
|
220
220
|
"Edit collection": "编辑数据表",
|
|
221
221
|
"Configure fields": "配置字段",
|
|
222
222
|
"Configure columns": "配置字段",
|
|
223
|
+
"Please select the records you want to delete": "请选择要删除的记录",
|
|
223
224
|
"Edit field": "编辑字段",
|
|
224
225
|
"Override": "重写",
|
|
225
226
|
"Override field": "重写字段",
|
|
@@ -227,7 +228,7 @@ var _default = {
|
|
|
227
228
|
"Association fields filter": "关系筛选",
|
|
228
229
|
"PK & FK fields": "主外键字段",
|
|
229
230
|
"Association fields": "关系字段",
|
|
230
|
-
"
|
|
231
|
+
"Choices fields": "选项字段",
|
|
231
232
|
"System fields": "系统字段",
|
|
232
233
|
"General fields": "普通字段",
|
|
233
234
|
"Inherited fields": "继承字段",
|
|
@@ -306,11 +307,14 @@ var _default = {
|
|
|
306
307
|
"Field component": "字段组件",
|
|
307
308
|
"Subtable": "子表格",
|
|
308
309
|
"Subform": "子表单",
|
|
310
|
+
"Sub-details": "子详情",
|
|
309
311
|
"Record picker": "数据选择器",
|
|
310
312
|
"Toggles the subfield mode": "切换子字段模式",
|
|
311
313
|
"Selector mode": "选择器模式",
|
|
312
314
|
"Subtable mode": "子表格模式",
|
|
313
315
|
"Subform mode": "子表单模式",
|
|
316
|
+
"Field mode": "字段组件",
|
|
317
|
+
"Allow add new data": "允许添加数据",
|
|
314
318
|
"Edit block title": "编辑区块标题",
|
|
315
319
|
"Block title": "区块标题",
|
|
316
320
|
"Pattern": "模式",
|
|
@@ -66,6 +66,7 @@ var ActionDesigner = function ActionDesigner(props) {
|
|
|
66
66
|
dn = _useDesignable.dn;
|
|
67
67
|
var _useTranslation2 = (0, _reactI18next.useTranslation)(),
|
|
68
68
|
t = _useTranslation2.t;
|
|
69
|
+
var isAction = (0, _hooks.useLinkageAction)();
|
|
69
70
|
var isPopupAction = ['create', 'update', 'view', 'customize:popup'].includes(fieldSchema['x-action'] || '');
|
|
70
71
|
var isUpdateModePopupAction = ['customize:bulkUpdate', 'customize:bulkEdit'].includes(fieldSchema['x-action']);
|
|
71
72
|
var _useState = (0, _react2.useState)(),
|
|
@@ -73,9 +74,8 @@ var ActionDesigner = function ActionDesigner(props) {
|
|
|
73
74
|
initialSchema = _useState2[0],
|
|
74
75
|
setInitialSchema = _useState2[1];
|
|
75
76
|
var actionType = (_fieldSchema$xAction = fieldSchema['x-action']) !== null && _fieldSchema$xAction !== void 0 ? _fieldSchema$xAction : '';
|
|
76
|
-
var isLinkageAction = linkageAction ||
|
|
77
|
+
var isLinkageAction = linkageAction || isAction;
|
|
77
78
|
var isChildCollectionAction = getChildrenCollections(name).length > 0 && fieldSchema['x-action'] === 'create';
|
|
78
|
-
var isSupportEditButton = fieldSchema['x-action'] !== 'expandAll';
|
|
79
79
|
var isLink = fieldSchema['x-component'] === 'Action.Link';
|
|
80
80
|
(0, _react2.useEffect)(function () {
|
|
81
81
|
var schemaUid = (0, _shared.uid)();
|
|
@@ -104,8 +104,7 @@ var ActionDesigner = function ActionDesigner(props) {
|
|
|
104
104
|
'x-component': 'Input',
|
|
105
105
|
title: t('Button title'),
|
|
106
106
|
default: fieldSchema.title,
|
|
107
|
-
'x-component-props': {}
|
|
108
|
-
'x-visible': isSupportEditButton
|
|
107
|
+
'x-component-props': {}
|
|
109
108
|
// description: `原字段标题:${collectionField?.uiSchema?.title}`,
|
|
110
109
|
},
|
|
111
110
|
|
|
@@ -115,7 +114,7 @@ var ActionDesigner = function ActionDesigner(props) {
|
|
|
115
114
|
title: t('Button icon'),
|
|
116
115
|
default: fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xCompon = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon === void 0 ? void 0 : _fieldSchema$xCompon.icon,
|
|
117
116
|
'x-component-props': {},
|
|
118
|
-
'x-visible':
|
|
117
|
+
'x-visible': !isLink
|
|
119
118
|
// description: `原字段标题:${collectionField?.uiSchema?.title}`,
|
|
120
119
|
},
|
|
121
120
|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
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); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.AssociationFieldProvider = AssociationFieldProvider;
|
|
8
|
+
var _react = require("@formily/react");
|
|
9
|
+
var _react2 = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _collectionManager = require("../../../collection-manager");
|
|
11
|
+
var _context = require("./context");
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
|
+
function AssociationFieldProvider(props) {
|
|
15
|
+
var field = (0, _react.useField)();
|
|
16
|
+
var _useCollectionManager = (0, _collectionManager.useCollectionManager)(),
|
|
17
|
+
getCollectionField = _useCollectionManager.getCollectionField;
|
|
18
|
+
var fieldSchema = (0, _react.useFieldSchema)();
|
|
19
|
+
var collectionField = (0, _react2.useMemo)(function () {
|
|
20
|
+
return getCollectionField(fieldSchema['x-collection-field']);
|
|
21
|
+
}, [fieldSchema['x-collection-field']]);
|
|
22
|
+
return /*#__PURE__*/_react2.default.createElement(_context.AssociationFieldContext.Provider, {
|
|
23
|
+
value: {
|
|
24
|
+
options: collectionField,
|
|
25
|
+
field: field
|
|
26
|
+
}
|
|
27
|
+
}, props.children);
|
|
28
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { RemoteSelectProps } from '../remote-select';
|
|
3
|
+
export declare type AssociationSelectProps<P = any> = RemoteSelectProps<P> & {
|
|
4
|
+
action?: string;
|
|
5
|
+
multiple?: boolean;
|
|
6
|
+
};
|
|
7
|
+
interface AssociationSelectInterface {
|
|
8
|
+
(props: any): React.ReactElement;
|
|
9
|
+
Designer: React.FC;
|
|
10
|
+
FilterDesigner: React.FC;
|
|
11
|
+
}
|
|
12
|
+
export declare const AssociationSelect: AssociationSelectInterface;
|
|
13
|
+
export declare const AssociationSelectReadPretty: React.ForwardRefExoticComponent<Pick<Partial<any>, string | number | symbol> & React.RefAttributes<unknown>>;
|
|
14
|
+
export {};
|