@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,75 +4,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
4
|
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; }
|
|
5
5
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
6
|
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); }
|
|
7
|
-
import {
|
|
8
|
-
import { constraintsProps, recordPickerSelector, recordPickerViewer, relationshipType, reverseFieldProperties } from './properties';
|
|
9
|
-
var internalSchameInitialize = function internalSchameInitialize(schema, _ref) {
|
|
10
|
-
var field = _ref.field,
|
|
11
|
-
block = _ref.block,
|
|
12
|
-
readPretty = _ref.readPretty,
|
|
13
|
-
action = _ref.action;
|
|
14
|
-
if (block === 'Form') {
|
|
15
|
-
if (schema['x-component'] === 'FormField') {
|
|
16
|
-
var association = "".concat(field.collectionName, ".").concat(field.name);
|
|
17
|
-
schema.type = 'void';
|
|
18
|
-
schema.properties = {
|
|
19
|
-
block: {
|
|
20
|
-
type: 'void',
|
|
21
|
-
'x-decorator': 'FormFieldProvider',
|
|
22
|
-
'x-decorator-props': {
|
|
23
|
-
collection: field.target,
|
|
24
|
-
association: association,
|
|
25
|
-
resource: association,
|
|
26
|
-
action: action,
|
|
27
|
-
fieldName: field.name,
|
|
28
|
-
readPretty: readPretty
|
|
29
|
-
},
|
|
30
|
-
'x-component': 'CardItem',
|
|
31
|
-
'x-component-props': {
|
|
32
|
-
bordered: true
|
|
33
|
-
},
|
|
34
|
-
properties: _defineProperty({}, field.name, {
|
|
35
|
-
type: 'object',
|
|
36
|
-
'x-component': 'FormV2',
|
|
37
|
-
'x-component-props': {
|
|
38
|
-
useProps: '{{ useFormFieldProps }}'
|
|
39
|
-
},
|
|
40
|
-
properties: {
|
|
41
|
-
__form_grid: {
|
|
42
|
-
type: 'void',
|
|
43
|
-
'x-component': 'Grid',
|
|
44
|
-
'x-initializer': 'FormItemInitializers',
|
|
45
|
-
properties: {}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
})
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
} else if (schema['x-component'] === 'AssociationSelect') {
|
|
52
|
-
Object.assign(schema, {
|
|
53
|
-
type: 'string',
|
|
54
|
-
'x-designer': 'AssociationSelect.Designer'
|
|
55
|
-
});
|
|
56
|
-
} else {
|
|
57
|
-
schema.type = 'string';
|
|
58
|
-
schema['properties'] = {
|
|
59
|
-
viewer: cloneDeep(recordPickerViewer),
|
|
60
|
-
selector: cloneDeep(recordPickerSelector)
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
return schema;
|
|
64
|
-
}
|
|
65
|
-
schema.type = 'string';
|
|
66
|
-
if (readPretty) {
|
|
67
|
-
schema['properties'] = {
|
|
68
|
-
viewer: cloneDeep(recordPickerViewer)
|
|
69
|
-
};
|
|
70
|
-
} else {
|
|
71
|
-
schema['properties'] = {
|
|
72
|
-
selector: cloneDeep(recordPickerSelector)
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
};
|
|
7
|
+
import { constraintsProps, relationshipType, reverseFieldProperties } from './properties';
|
|
76
8
|
export var o2o = {
|
|
77
9
|
name: 'o2o',
|
|
78
10
|
type: 'object',
|
|
@@ -86,7 +18,7 @@ export var o2o = {
|
|
|
86
18
|
// name,
|
|
87
19
|
uiSchema: {
|
|
88
20
|
// title,
|
|
89
|
-
'x-component': '
|
|
21
|
+
'x-component': 'AssociationField',
|
|
90
22
|
'x-component-props': {
|
|
91
23
|
// mode: 'tags',
|
|
92
24
|
multiple: false,
|
|
@@ -103,7 +35,7 @@ export var o2o = {
|
|
|
103
35
|
// name,
|
|
104
36
|
uiSchema: {
|
|
105
37
|
// title,
|
|
106
|
-
'x-component': '
|
|
38
|
+
'x-component': 'AssociationField',
|
|
107
39
|
'x-component-props': {
|
|
108
40
|
// mode: 'tags',
|
|
109
41
|
multiple: false,
|
|
@@ -116,17 +48,11 @@ export var o2o = {
|
|
|
116
48
|
}
|
|
117
49
|
},
|
|
118
50
|
availableTypes: ['hasOne'],
|
|
119
|
-
schemaInitialize: function schemaInitialize(schema,
|
|
120
|
-
var field =
|
|
121
|
-
block =
|
|
122
|
-
readPretty =
|
|
123
|
-
action =
|
|
124
|
-
internalSchameInitialize(schema, {
|
|
125
|
-
field: field,
|
|
126
|
-
block: block,
|
|
127
|
-
readPretty: readPretty,
|
|
128
|
-
action: action
|
|
129
|
-
});
|
|
51
|
+
schemaInitialize: function schemaInitialize(schema, _ref) {
|
|
52
|
+
var field = _ref.field,
|
|
53
|
+
block = _ref.block,
|
|
54
|
+
readPretty = _ref.readPretty,
|
|
55
|
+
action = _ref.action;
|
|
130
56
|
if (['Table', 'Kanban'].includes(block)) {
|
|
131
57
|
schema['x-component-props'] = schema['x-component-props'] || {};
|
|
132
58
|
schema['x-component-props']['ellipsis'] = true;
|
|
@@ -254,7 +180,8 @@ export var o2o = {
|
|
|
254
180
|
// },
|
|
255
181
|
// },
|
|
256
182
|
]
|
|
257
|
-
}
|
|
183
|
+
},
|
|
184
|
+
invariable: true
|
|
258
185
|
};
|
|
259
186
|
export var oho = {
|
|
260
187
|
name: 'oho',
|
|
@@ -269,7 +196,7 @@ export var oho = {
|
|
|
269
196
|
// name,
|
|
270
197
|
uiSchema: {
|
|
271
198
|
// title,
|
|
272
|
-
'x-component': '
|
|
199
|
+
'x-component': 'AssociationField',
|
|
273
200
|
'x-component-props': {
|
|
274
201
|
// mode: 'tags',
|
|
275
202
|
multiple: false,
|
|
@@ -286,7 +213,7 @@ export var oho = {
|
|
|
286
213
|
// name,
|
|
287
214
|
uiSchema: {
|
|
288
215
|
// title,
|
|
289
|
-
'x-component': '
|
|
216
|
+
'x-component': 'AssociationField',
|
|
290
217
|
'x-component-props': {
|
|
291
218
|
// mode: 'tags',
|
|
292
219
|
multiple: false,
|
|
@@ -298,17 +225,12 @@ export var oho = {
|
|
|
298
225
|
}
|
|
299
226
|
}
|
|
300
227
|
},
|
|
301
|
-
schemaInitialize: function schemaInitialize(schema,
|
|
302
|
-
var field =
|
|
303
|
-
block =
|
|
304
|
-
readPretty =
|
|
305
|
-
action =
|
|
306
|
-
|
|
307
|
-
field: field,
|
|
308
|
-
block: block,
|
|
309
|
-
readPretty: readPretty,
|
|
310
|
-
action: action
|
|
311
|
-
});
|
|
228
|
+
schemaInitialize: function schemaInitialize(schema, _ref2) {
|
|
229
|
+
var field = _ref2.field,
|
|
230
|
+
block = _ref2.block,
|
|
231
|
+
readPretty = _ref2.readPretty,
|
|
232
|
+
action = _ref2.action;
|
|
233
|
+
schema['type'] = 'object';
|
|
312
234
|
if (['Table', 'Kanban'].includes(block)) {
|
|
313
235
|
schema['x-component-props'] = schema['x-component-props'] || {};
|
|
314
236
|
schema['x-component-props']['ellipsis'] = true;
|
|
@@ -427,7 +349,8 @@ export var oho = {
|
|
|
427
349
|
// },
|
|
428
350
|
// },
|
|
429
351
|
]
|
|
430
|
-
}
|
|
352
|
+
},
|
|
353
|
+
invariable: true
|
|
431
354
|
};
|
|
432
355
|
export var obo = {
|
|
433
356
|
name: 'obo',
|
|
@@ -442,7 +365,7 @@ export var obo = {
|
|
|
442
365
|
// name,
|
|
443
366
|
uiSchema: {
|
|
444
367
|
// title,
|
|
445
|
-
'x-component': '
|
|
368
|
+
'x-component': 'AssociationField',
|
|
446
369
|
'x-component-props': {
|
|
447
370
|
// mode: 'tags',
|
|
448
371
|
multiple: false,
|
|
@@ -458,7 +381,7 @@ export var obo = {
|
|
|
458
381
|
// name,
|
|
459
382
|
uiSchema: {
|
|
460
383
|
// title,
|
|
461
|
-
'x-component': '
|
|
384
|
+
'x-component': 'AssociationField',
|
|
462
385
|
'x-component-props': {
|
|
463
386
|
// mode: 'tags',
|
|
464
387
|
multiple: false,
|
|
@@ -470,18 +393,13 @@ export var obo = {
|
|
|
470
393
|
}
|
|
471
394
|
}
|
|
472
395
|
},
|
|
473
|
-
schemaInitialize: function schemaInitialize(schema,
|
|
474
|
-
var field =
|
|
475
|
-
block =
|
|
476
|
-
readPretty =
|
|
477
|
-
action =
|
|
478
|
-
targetCollection =
|
|
479
|
-
|
|
480
|
-
field: field,
|
|
481
|
-
block: block,
|
|
482
|
-
readPretty: readPretty,
|
|
483
|
-
action: action
|
|
484
|
-
});
|
|
396
|
+
schemaInitialize: function schemaInitialize(schema, _ref3) {
|
|
397
|
+
var field = _ref3.field,
|
|
398
|
+
block = _ref3.block,
|
|
399
|
+
readPretty = _ref3.readPretty,
|
|
400
|
+
action = _ref3.action,
|
|
401
|
+
targetCollection = _ref3.targetCollection;
|
|
402
|
+
schema['type'] = 'object';
|
|
485
403
|
if (['Table', 'Kanban'].includes(block)) {
|
|
486
404
|
schema['x-component-props'] = schema['x-component-props'] || {};
|
|
487
405
|
schema['x-component-props']['ellipsis'] = true;
|
|
@@ -494,16 +412,6 @@ export var obo = {
|
|
|
494
412
|
};
|
|
495
413
|
schema['x-component-props'].fieldNames.label = targetCollection.titleField;
|
|
496
414
|
}
|
|
497
|
-
if ((targetCollection === null || targetCollection === void 0 ? void 0 : targetCollection.template) === 'file') {
|
|
498
|
-
var fieldNames = schema['x-component-props']['fieldNames'] || {
|
|
499
|
-
label: 'preview',
|
|
500
|
-
value: 'id'
|
|
501
|
-
};
|
|
502
|
-
fieldNames.label = 'preview';
|
|
503
|
-
schema['x-component-props']['fieldNames'] = fieldNames;
|
|
504
|
-
schema['x-component-props'].quickUpload = true;
|
|
505
|
-
schema['x-component-props'].selectFile = true;
|
|
506
|
-
}
|
|
507
415
|
},
|
|
508
416
|
properties: _objectSpread(_objectSpread({
|
|
509
417
|
'uiSchema.title': {
|
|
@@ -617,5 +525,6 @@ export var obo = {
|
|
|
617
525
|
// },
|
|
618
526
|
// },
|
|
619
527
|
]
|
|
620
|
-
}
|
|
528
|
+
},
|
|
529
|
+
invariable: true
|
|
621
530
|
};
|
|
@@ -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
|
};
|
|
@@ -26,7 +26,7 @@ export var tree = {
|
|
|
26
26
|
onDelete: 'CASCADE',
|
|
27
27
|
uiSchema: {
|
|
28
28
|
title: '{{t("Parent")}}',
|
|
29
|
-
'x-component': '
|
|
29
|
+
'x-component': 'AssociationField',
|
|
30
30
|
'x-component-props': {
|
|
31
31
|
// mode: 'tags',
|
|
32
32
|
multiple: false,
|
|
@@ -45,7 +45,7 @@ export var tree = {
|
|
|
45
45
|
onDelete: 'CASCADE',
|
|
46
46
|
uiSchema: {
|
|
47
47
|
title: '{{t("Children")}}',
|
|
48
|
-
'x-component': '
|
|
48
|
+
'x-component': 'AssociationField',
|
|
49
49
|
'x-component-props': {
|
|
50
50
|
// mode: 'tags',
|
|
51
51
|
multiple: true,
|
|
@@ -21,6 +21,7 @@ import { mergeFilter } from '../block-provider/SharedFilterProvider';
|
|
|
21
21
|
import { useCollection } from '../collection-manager';
|
|
22
22
|
import { removeNullCondition } from '../schema-component';
|
|
23
23
|
import { useAssociatedFields } from './utils';
|
|
24
|
+
import { uniqBy } from 'lodash';
|
|
24
25
|
var FilterContext = /*#__PURE__*/createContext(null);
|
|
25
26
|
/**
|
|
26
27
|
* 主要用于记录当前页面中的数据区块的信息,用于在过滤区块中使用
|
|
@@ -121,8 +122,9 @@ export var useFilterBlock = function useFilterBlock() {
|
|
|
121
122
|
existingBlock.defaultFilter = block.defaultFilter;
|
|
122
123
|
return;
|
|
123
124
|
}
|
|
125
|
+
// 由于 setDataBlocks 是异步操作,所以上面的 existingBlock 在判断时有可能用的是旧的 dataBlocks,所以下面还需要根据 uid 进行去重操作
|
|
124
126
|
setDataBlocks(function (prev) {
|
|
125
|
-
return [].concat(_toConsumableArray(prev), [block]);
|
|
127
|
+
return uniqBy([].concat(_toConsumableArray(prev), [block]), 'uid');
|
|
126
128
|
});
|
|
127
129
|
};
|
|
128
130
|
var getDataBlocks = function getDataBlocks() {
|
package/es/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/es/locale/en_US.js
CHANGED
|
@@ -210,7 +210,7 @@ export default {
|
|
|
210
210
|
"Association fields filter": "Association fields filter",
|
|
211
211
|
"PK & FK fields": "PK & FK fields",
|
|
212
212
|
"Association fields": "Association fields",
|
|
213
|
-
"
|
|
213
|
+
"Choices fields": "Choices fields",
|
|
214
214
|
"System fields": "System fields",
|
|
215
215
|
"General fields": "General fields",
|
|
216
216
|
"Inherited fields": "Inherited fields",
|
|
@@ -241,6 +241,7 @@ export default {
|
|
|
241
241
|
"Link to": "Link to",
|
|
242
242
|
"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.",
|
|
243
243
|
"Sub-table": "Sub-table",
|
|
244
|
+
"Sub-details": "Sub-details",
|
|
244
245
|
"System info": "System info",
|
|
245
246
|
"Created at": "Created at",
|
|
246
247
|
"Last updated at": "Last updated at",
|
|
@@ -281,12 +282,14 @@ export default {
|
|
|
281
282
|
"Display field title": "Display field title",
|
|
282
283
|
"Field component": "Field component",
|
|
283
284
|
"Subtable": "Subtable",
|
|
284
|
-
"Subform": "
|
|
285
|
+
"Subform": "Sub-form",
|
|
286
|
+
"Field mode": "Field mode",
|
|
287
|
+
"Allow add new data": "Allow add new data",
|
|
285
288
|
"Record picker": "Record picker",
|
|
286
289
|
"Toggles the subfield mode": "Toggles the subfield mode",
|
|
287
290
|
"Selector mode": "Selector mode",
|
|
288
291
|
"Subtable mode": "Subtable mode",
|
|
289
|
-
"Subform mode": "
|
|
292
|
+
"Subform mode": "Sub-form mode",
|
|
290
293
|
"Edit block title": "Edit block title",
|
|
291
294
|
"Block title": "Block title",
|
|
292
295
|
"Pattern": "Pattern",
|
package/es/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/es/locale/ja_JP.js
CHANGED
|
@@ -556,6 +556,9 @@ export default {
|
|
|
556
556
|
"Field component": "フィールドコンポーネント",
|
|
557
557
|
"Subtable": "サブテーブル",
|
|
558
558
|
"Subform": "サブフォーム",
|
|
559
|
+
"Sub-details": "サブリスト",
|
|
560
|
+
"Field mode": "フィールドコンポーネント",
|
|
561
|
+
"Allow add new data": "データの追加を許可",
|
|
559
562
|
"Regular expression": "正規表現",
|
|
560
563
|
"Enabled languages": "利用可能な言語",
|
|
561
564
|
"View all plugins": "すべてのプラグラインを見る",
|
|
@@ -577,7 +580,7 @@ export default {
|
|
|
577
580
|
"Enable SMS authentication": "SMS認証を有効にする",
|
|
578
581
|
"Display association fields": "関連付けられたコレクションのフィールドを表示",
|
|
579
582
|
"Set default value": "デフォルト値を設定",
|
|
580
|
-
"
|
|
583
|
+
"Choices fields": "チョイスフィールド",
|
|
581
584
|
"Editable": "編集可能",
|
|
582
585
|
"Readonly": "読み取り専用(編集不可)",
|
|
583
586
|
"Easy-reading": "読取り専用(読取りモード)",
|
package/es/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/es/locale/pt_BR.js
CHANGED
|
@@ -170,7 +170,7 @@ export default {
|
|
|
170
170
|
"Association fields filter": "Filtro de campos de associação",
|
|
171
171
|
"PK & FK fields": "Campos PK & FK",
|
|
172
172
|
"Association fields": "Campos de associação",
|
|
173
|
-
"
|
|
173
|
+
"Choices fields": "Campos de opções",
|
|
174
174
|
"System fields": "Campos do sistema",
|
|
175
175
|
"General fields": "Campos gerais",
|
|
176
176
|
"Inherited fields": "Campos herdados",
|
package/es/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/es/locale/zh_CN.js
CHANGED
|
@@ -214,6 +214,7 @@ export default {
|
|
|
214
214
|
"Edit collection": "编辑数据表",
|
|
215
215
|
"Configure fields": "配置字段",
|
|
216
216
|
"Configure columns": "配置字段",
|
|
217
|
+
"Please select the records you want to delete": "请选择要删除的记录",
|
|
217
218
|
"Edit field": "编辑字段",
|
|
218
219
|
"Override": "重写",
|
|
219
220
|
"Override field": "重写字段",
|
|
@@ -221,7 +222,7 @@ export default {
|
|
|
221
222
|
"Association fields filter": "关系筛选",
|
|
222
223
|
"PK & FK fields": "主外键字段",
|
|
223
224
|
"Association fields": "关系字段",
|
|
224
|
-
"
|
|
225
|
+
"Choices fields": "选项字段",
|
|
225
226
|
"System fields": "系统字段",
|
|
226
227
|
"General fields": "普通字段",
|
|
227
228
|
"Inherited fields": "继承字段",
|
|
@@ -300,11 +301,14 @@ export default {
|
|
|
300
301
|
"Field component": "字段组件",
|
|
301
302
|
"Subtable": "子表格",
|
|
302
303
|
"Subform": "子表单",
|
|
304
|
+
"Sub-details": "子详情",
|
|
303
305
|
"Record picker": "数据选择器",
|
|
304
306
|
"Toggles the subfield mode": "切换子字段模式",
|
|
305
307
|
"Selector mode": "选择器模式",
|
|
306
308
|
"Subtable mode": "子表格模式",
|
|
307
309
|
"Subform mode": "子表单模式",
|
|
310
|
+
"Field mode": "字段组件",
|
|
311
|
+
"Allow add new data": "允许添加数据",
|
|
308
312
|
"Edit block title": "编辑区块标题",
|
|
309
313
|
"Block title": "区块标题",
|
|
310
314
|
"Pattern": "模式",
|
|
@@ -58,6 +58,7 @@ export var ActionDesigner = function ActionDesigner(props) {
|
|
|
58
58
|
dn = _useDesignable.dn;
|
|
59
59
|
var _useTranslation2 = useTranslation(),
|
|
60
60
|
t = _useTranslation2.t;
|
|
61
|
+
var isAction = useLinkageAction();
|
|
61
62
|
var isPopupAction = ['create', 'update', 'view', 'customize:popup'].includes(fieldSchema['x-action'] || '');
|
|
62
63
|
var isUpdateModePopupAction = ['customize:bulkUpdate', 'customize:bulkEdit'].includes(fieldSchema['x-action']);
|
|
63
64
|
var _useState = useState(),
|
|
@@ -65,9 +66,8 @@ export var ActionDesigner = function ActionDesigner(props) {
|
|
|
65
66
|
initialSchema = _useState2[0],
|
|
66
67
|
setInitialSchema = _useState2[1];
|
|
67
68
|
var actionType = (_fieldSchema$xAction = fieldSchema['x-action']) !== null && _fieldSchema$xAction !== void 0 ? _fieldSchema$xAction : '';
|
|
68
|
-
var isLinkageAction = linkageAction ||
|
|
69
|
+
var isLinkageAction = linkageAction || isAction;
|
|
69
70
|
var isChildCollectionAction = getChildrenCollections(name).length > 0 && fieldSchema['x-action'] === 'create';
|
|
70
|
-
var isSupportEditButton = fieldSchema['x-action'] !== 'expandAll';
|
|
71
71
|
var isLink = fieldSchema['x-component'] === 'Action.Link';
|
|
72
72
|
useEffect(function () {
|
|
73
73
|
var schemaUid = uid();
|
|
@@ -96,8 +96,7 @@ export var ActionDesigner = function ActionDesigner(props) {
|
|
|
96
96
|
'x-component': 'Input',
|
|
97
97
|
title: t('Button title'),
|
|
98
98
|
default: fieldSchema.title,
|
|
99
|
-
'x-component-props': {}
|
|
100
|
-
'x-visible': isSupportEditButton
|
|
99
|
+
'x-component-props': {}
|
|
101
100
|
// description: `原字段标题:${collectionField?.uiSchema?.title}`,
|
|
102
101
|
},
|
|
103
102
|
|
|
@@ -107,7 +106,7 @@ export var ActionDesigner = function ActionDesigner(props) {
|
|
|
107
106
|
title: t('Button icon'),
|
|
108
107
|
default: fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xCompon = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon === void 0 ? void 0 : _fieldSchema$xCompon.icon,
|
|
109
108
|
'x-component-props': {},
|
|
110
|
-
'x-visible':
|
|
109
|
+
'x-visible': !isLink
|
|
111
110
|
// description: `原字段标题:${collectionField?.uiSchema?.title}`,
|
|
112
111
|
},
|
|
113
112
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useField, useFieldSchema } from '@formily/react';
|
|
2
|
+
import React, { useMemo } from 'react';
|
|
3
|
+
import { useCollectionManager } from '../../../collection-manager';
|
|
4
|
+
import { AssociationFieldContext } from './context';
|
|
5
|
+
export function AssociationFieldProvider(props) {
|
|
6
|
+
var field = useField();
|
|
7
|
+
var _useCollectionManager = useCollectionManager(),
|
|
8
|
+
getCollectionField = _useCollectionManager.getCollectionField;
|
|
9
|
+
var fieldSchema = useFieldSchema();
|
|
10
|
+
var collectionField = useMemo(function () {
|
|
11
|
+
return getCollectionField(fieldSchema['x-collection-field']);
|
|
12
|
+
}, [fieldSchema['x-collection-field']]);
|
|
13
|
+
return /*#__PURE__*/React.createElement(AssociationFieldContext.Provider, {
|
|
14
|
+
value: {
|
|
15
|
+
options: collectionField,
|
|
16
|
+
field: field
|
|
17
|
+
}
|
|
18
|
+
}, props.children);
|
|
19
|
+
}
|
|
@@ -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 {};
|