@nocobase/client-v2 2.1.0-beta.38 → 2.1.0-beta.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/Application.d.ts +6 -0
- package/es/collection-field-interface/CollectionFieldInterface.d.ts +51 -15
- package/es/collection-field-interface/CollectionFieldInterfaceManager.d.ts +82 -3
- package/es/collection-manager/field-configure.d.ts +80 -0
- package/es/collection-manager/field-validation.d.ts +43 -0
- package/es/collection-manager/filter-operators/index.d.ts +46 -0
- package/es/collection-manager/filter-operators/operators.d.ts +30 -0
- package/es/collection-manager/interfaces/checkbox.d.ts +1 -41
- package/es/collection-manager/interfaces/checkboxGroup.d.ts +12 -44
- package/es/collection-manager/interfaces/collection.d.ts +12 -51
- package/es/collection-manager/interfaces/color.d.ts +1 -16
- package/es/collection-manager/interfaces/createdAt.d.ts +1 -44
- package/es/collection-manager/interfaces/createdBy.d.ts +0 -4
- package/es/collection-manager/interfaces/dateOnly.d.ts +7 -44
- package/es/collection-manager/interfaces/datetime.d.ts +1 -44
- package/es/collection-manager/interfaces/datetimeNoTz.d.ts +1 -44
- package/es/collection-manager/interfaces/email.d.ts +1 -29
- package/es/collection-manager/interfaces/id.d.ts +1 -16
- package/es/collection-manager/interfaces/index.d.ts +2 -3
- package/es/collection-manager/interfaces/input.d.ts +1 -102
- package/es/collection-manager/interfaces/integer.d.ts +1 -95
- package/es/collection-manager/interfaces/json.d.ts +16 -7
- package/es/collection-manager/interfaces/m2m.d.ts +11 -19
- package/es/collection-manager/interfaces/m2o.d.ts +11 -19
- package/es/collection-manager/interfaces/markdown.d.ts +1 -63
- package/es/collection-manager/interfaces/multipleSelect.d.ts +12 -44
- package/es/collection-manager/interfaces/nanoid.d.ts +1 -34
- package/es/collection-manager/interfaces/number.d.ts +1 -87
- package/es/collection-manager/interfaces/o2m.d.ts +12 -24
- package/es/collection-manager/interfaces/obo.d.ts +207 -0
- package/es/collection-manager/interfaces/oho.d.ts +207 -0
- package/es/collection-manager/interfaces/password.d.ts +1 -56
- package/es/collection-manager/interfaces/percent.d.ts +1 -84
- package/es/collection-manager/interfaces/phone.d.ts +1 -25
- package/es/collection-manager/interfaces/properties/index.d.ts +0 -28
- package/es/collection-manager/interfaces/radioGroup.d.ts +1 -29
- package/es/collection-manager/interfaces/richText.d.ts +1 -63
- package/es/collection-manager/interfaces/select.d.ts +12 -44
- package/es/collection-manager/interfaces/snowflake-id.d.ts +1 -34
- package/es/collection-manager/interfaces/tableoid.d.ts +1 -10
- package/es/collection-manager/interfaces/textarea.d.ts +1 -51
- package/es/collection-manager/interfaces/time.d.ts +1 -16
- package/es/collection-manager/interfaces/types.d.ts +3 -12
- package/es/collection-manager/interfaces/unixTimestamp.d.ts +1 -44
- package/es/collection-manager/interfaces/updatedAt.d.ts +1 -44
- package/es/collection-manager/interfaces/updatedBy.d.ts +0 -4
- package/es/collection-manager/interfaces/url.d.ts +1 -20
- package/es/collection-manager/interfaces/uuid.d.ts +1 -34
- package/es/collection-manager/template-fields.d.ts +53 -0
- package/es/components/form/VariableInput.d.ts +53 -2
- package/es/components/form/filter/CollectionFilter.d.ts +9 -1
- package/es/components/form/filter/CollectionFilterItem.d.ts +10 -2
- package/es/flow/components/filter/useFilterOptions.d.ts +13 -1
- package/es/flow/models/blocks/assign-form/assignFieldValuesFlow.d.ts +84 -0
- package/es/flow/models/blocks/assign-form/index.d.ts +1 -0
- package/es/flow/models/blocks/form/FormActionModel.d.ts +9 -2
- package/es/index.d.ts +4 -0
- package/es/index.mjs +105 -142
- package/lib/index.js +106 -143
- package/package.json +7 -7
- package/src/Application.tsx +24 -0
- package/src/collection-field-interface/CollectionFieldInterface.ts +71 -77
- package/src/collection-field-interface/CollectionFieldInterfaceManager.ts +201 -4
- package/src/collection-manager/field-configure.ts +548 -0
- package/src/collection-manager/field-validation.ts +195 -0
- package/src/collection-manager/filter-operators/index.ts +176 -0
- package/src/collection-manager/{interfaces/properties → filter-operators}/operators.ts +24 -13
- package/src/collection-manager/interfaces/checkbox.ts +2 -9
- package/src/collection-manager/interfaces/checkboxGroup.ts +2 -10
- package/src/collection-manager/interfaces/collection.ts +2 -15
- package/src/collection-manager/interfaces/color.ts +2 -2
- package/src/collection-manager/interfaces/createdAt.ts +2 -2
- package/src/collection-manager/interfaces/createdBy.ts +1 -12
- package/src/collection-manager/interfaces/dateOnly.ts +8 -2
- package/src/collection-manager/interfaces/datetime.ts +2 -2
- package/src/collection-manager/interfaces/datetimeNoTz.ts +2 -2
- package/src/collection-manager/interfaces/email.ts +2 -9
- package/src/collection-manager/interfaces/id.ts +1 -2
- package/src/collection-manager/interfaces/index.ts +2 -3
- package/src/collection-manager/interfaces/input.ts +2 -133
- package/src/collection-manager/interfaces/integer.ts +2 -71
- package/src/collection-manager/interfaces/json.tsx +17 -11
- package/src/collection-manager/interfaces/m2m.tsx +0 -21
- package/src/collection-manager/interfaces/m2o.tsx +0 -22
- package/src/collection-manager/interfaces/markdown.ts +2 -51
- package/src/collection-manager/interfaces/multipleSelect.ts +2 -14
- package/src/collection-manager/interfaces/nanoid.ts +2 -2
- package/src/collection-manager/interfaces/number.ts +2 -85
- package/src/collection-manager/interfaces/o2m.tsx +1 -22
- package/src/collection-manager/interfaces/obo.tsx +145 -0
- package/src/collection-manager/interfaces/oho.tsx +145 -0
- package/src/collection-manager/interfaces/password.ts +2 -44
- package/src/collection-manager/interfaces/percent.ts +2 -74
- package/src/collection-manager/interfaces/phone.ts +2 -2
- package/src/collection-manager/interfaces/properties/index.ts +0 -133
- package/src/collection-manager/interfaces/radioGroup.ts +2 -2
- package/src/collection-manager/interfaces/richText.ts +2 -51
- package/src/collection-manager/interfaces/select.ts +2 -14
- package/src/collection-manager/interfaces/snowflake-id.ts +2 -2
- package/src/collection-manager/interfaces/tableoid.ts +1 -2
- package/src/collection-manager/interfaces/textarea.ts +2 -51
- package/src/collection-manager/interfaces/time.ts +2 -2
- package/src/collection-manager/interfaces/types.ts +4 -12
- package/src/collection-manager/interfaces/unixTimestamp.tsx +2 -2
- package/src/collection-manager/interfaces/updatedAt.ts +2 -2
- package/src/collection-manager/interfaces/updatedBy.ts +1 -12
- package/src/collection-manager/interfaces/url.ts +2 -4
- package/src/collection-manager/interfaces/uuid.ts +2 -2
- package/src/collection-manager/template-fields.ts +109 -0
- package/src/components/README.md +1 -0
- package/src/components/README.zh-CN.md +1 -0
- package/src/components/form/VariableInput.tsx +101 -28
- package/src/components/form/__tests__/VariableInput.test.ts +85 -0
- package/src/components/form/filter/CollectionFilter.tsx +11 -1
- package/src/components/form/filter/CollectionFilterItem.tsx +12 -4
- package/src/components/form/filter/__tests__/CollectionFilterItem.test.tsx +42 -0
- package/src/components/form/filter/useFilterActionProps.ts +7 -4
- package/src/flow/components/filter/useFilterOptions.ts +27 -5
- package/src/flow/models/actions/UpdateRecordActionModel.tsx +14 -95
- package/src/flow/models/actions/UpdateRecordActionUtils.ts +4 -7
- package/src/flow/models/actions/__tests__/AssignFormRefill.test.ts +26 -1
- package/src/flow/models/blocks/assign-form/AssignFormItemModel.tsx +63 -2
- package/src/flow/models/blocks/assign-form/assignFieldValuesFlow.tsx +206 -0
- package/src/flow/models/blocks/assign-form/index.ts +1 -0
- package/src/flow/models/blocks/form/FormActionModel.tsx +30 -3
- package/src/flow/models/blocks/form/__tests__/submitHandler.test.ts +71 -0
- package/src/flow/models/blocks/form/submitHandler.ts +8 -1
- package/src/flow/models/fields/CollectionSelectorFieldModel.tsx +8 -2
- package/src/flow/models/fields/DisplayEnumFieldModel.tsx +8 -2
- package/src/index.ts +4 -0
- package/es/collection-manager/interfaces/linkTo.d.ts +0 -90
- package/es/collection-manager/interfaces/o2o.d.ts +0 -621
- package/es/collection-manager/interfaces/properties/operators.d.ts +0 -294
- package/es/collection-manager/interfaces/subTable.d.ts +0 -172
- package/src/collection-manager/interfaces/linkTo.ts +0 -120
- package/src/collection-manager/interfaces/o2o.tsx +0 -561
- package/src/collection-manager/interfaces/subTable.ts +0 -218
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import { ISchema } from '@formily/react';
|
|
11
|
-
import { uid } from '@formily/shared';
|
|
12
|
-
import { defaultProps } from './properties';
|
|
13
|
-
import { CollectionFieldInterface } from '../../collection-field-interface/CollectionFieldInterface';
|
|
14
|
-
|
|
15
|
-
export class SubTableFieldInterface extends CollectionFieldInterface {
|
|
16
|
-
name = 'subTable';
|
|
17
|
-
type = 'object';
|
|
18
|
-
group = 'relation';
|
|
19
|
-
order = 2;
|
|
20
|
-
title = '{{t("Sub-table")}}';
|
|
21
|
-
isAssociation = true;
|
|
22
|
-
default = {
|
|
23
|
-
type: 'hasMany',
|
|
24
|
-
uiSchema: {
|
|
25
|
-
type: 'void',
|
|
26
|
-
'x-component': 'TableField',
|
|
27
|
-
'x-component-props': {},
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
availableTypes = ['hasMany'];
|
|
31
|
-
schemaInitialize(schema: ISchema, { field, readPretty }) {
|
|
32
|
-
const association = `${field.collectionName}.${field.name}`;
|
|
33
|
-
schema['type'] = 'void';
|
|
34
|
-
schema['x-component'] = 'TableField';
|
|
35
|
-
schema['properties'] = {
|
|
36
|
-
block: {
|
|
37
|
-
type: 'void',
|
|
38
|
-
'x-decorator': 'TableFieldProvider',
|
|
39
|
-
'x-acl-action': `${field.target}:list`,
|
|
40
|
-
'x-decorator-props': {
|
|
41
|
-
collection: field.target,
|
|
42
|
-
association: association,
|
|
43
|
-
resource: association,
|
|
44
|
-
action: 'list',
|
|
45
|
-
params: {
|
|
46
|
-
paginate: false,
|
|
47
|
-
},
|
|
48
|
-
showIndex: true,
|
|
49
|
-
dragSort: false,
|
|
50
|
-
},
|
|
51
|
-
properties: {
|
|
52
|
-
actions: {
|
|
53
|
-
type: 'void',
|
|
54
|
-
'x-initializer': 'subTable:configureActions',
|
|
55
|
-
'x-component': 'TableField.ActionBar',
|
|
56
|
-
'x-component-props': {},
|
|
57
|
-
},
|
|
58
|
-
[field.name]: {
|
|
59
|
-
type: 'array',
|
|
60
|
-
'x-initializer': 'table:configureColumns',
|
|
61
|
-
'x-component': 'TableV2',
|
|
62
|
-
'x-use-component-props': 'useTableFieldProps',
|
|
63
|
-
'x-component-props': {
|
|
64
|
-
rowSelection: {
|
|
65
|
-
type: 'checkbox',
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
initialize = (values: any) => {
|
|
74
|
-
if (!values.target) {
|
|
75
|
-
values.target = `t_${uid()}`;
|
|
76
|
-
}
|
|
77
|
-
if (!values.foreignKey) {
|
|
78
|
-
values.foreignKey = `f_${uid()}`;
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
properties = {
|
|
82
|
-
...defaultProps,
|
|
83
|
-
subtable: {
|
|
84
|
-
type: 'void',
|
|
85
|
-
'x-component': 'SubFieldDataSourceProvider',
|
|
86
|
-
properties: {
|
|
87
|
-
actions: {
|
|
88
|
-
type: 'void',
|
|
89
|
-
'x-component': 'ActionBar',
|
|
90
|
-
'x-component-props': {
|
|
91
|
-
// style: {
|
|
92
|
-
// marginBottom: 16,
|
|
93
|
-
// },
|
|
94
|
-
},
|
|
95
|
-
properties: {
|
|
96
|
-
delete: {
|
|
97
|
-
type: 'void',
|
|
98
|
-
title: '{{ t("Delete") }}',
|
|
99
|
-
'x-component': 'Action',
|
|
100
|
-
'x-component-props': {
|
|
101
|
-
useAction: '{{ ds.useBulkDestroyAction }}',
|
|
102
|
-
confirm: {
|
|
103
|
-
title: "{{t('Delete record')}}",
|
|
104
|
-
content: "{{t('Are you sure you want to delete it?')}}",
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
create: {
|
|
109
|
-
type: 'void',
|
|
110
|
-
title: '{{ t("Add new") }}',
|
|
111
|
-
'x-component': 'AddSubFieldAction',
|
|
112
|
-
'x-component-props': {
|
|
113
|
-
type: 'primary',
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
children: {
|
|
119
|
-
type: 'array',
|
|
120
|
-
title: '{{t("Fields")}}',
|
|
121
|
-
'x-decorator': 'FormItem',
|
|
122
|
-
'x-component': 'Table.Array',
|
|
123
|
-
'x-component-props': {
|
|
124
|
-
pagination: false,
|
|
125
|
-
expandable: {
|
|
126
|
-
childrenColumnName: '__nochildren__',
|
|
127
|
-
},
|
|
128
|
-
rowKey: 'name',
|
|
129
|
-
rowSelection: {
|
|
130
|
-
type: 'checkbox',
|
|
131
|
-
},
|
|
132
|
-
useSelectedRowKeys: '{{ ds.useSelectedRowKeys }}',
|
|
133
|
-
useDataSource: '{{ ds.useDataSource }}',
|
|
134
|
-
// scroll: { x: '100%' },
|
|
135
|
-
},
|
|
136
|
-
properties: {
|
|
137
|
-
column1: {
|
|
138
|
-
type: 'void',
|
|
139
|
-
title: '{{ t("Field display name") }}',
|
|
140
|
-
'x-component': 'Table.Column',
|
|
141
|
-
properties: {
|
|
142
|
-
'uiSchema.title': {
|
|
143
|
-
type: 'number',
|
|
144
|
-
'x-component': 'Input',
|
|
145
|
-
'x-read-pretty': true,
|
|
146
|
-
},
|
|
147
|
-
},
|
|
148
|
-
},
|
|
149
|
-
column2: {
|
|
150
|
-
type: 'void',
|
|
151
|
-
title: '{{ t("Field name") }}',
|
|
152
|
-
'x-component': 'Table.Column',
|
|
153
|
-
properties: {
|
|
154
|
-
name: {
|
|
155
|
-
'x-component': 'Input',
|
|
156
|
-
'x-read-pretty': true,
|
|
157
|
-
},
|
|
158
|
-
},
|
|
159
|
-
},
|
|
160
|
-
column3: {
|
|
161
|
-
type: 'void',
|
|
162
|
-
title: '{{ t("Field interface") }}',
|
|
163
|
-
'x-component': 'Table.Column',
|
|
164
|
-
properties: {
|
|
165
|
-
interface: {
|
|
166
|
-
'x-component': 'Input',
|
|
167
|
-
'x-read-pretty': true,
|
|
168
|
-
},
|
|
169
|
-
},
|
|
170
|
-
},
|
|
171
|
-
column4: {
|
|
172
|
-
type: 'void',
|
|
173
|
-
title: '{{ t("Actions") }}',
|
|
174
|
-
'x-component': 'Table.Column',
|
|
175
|
-
properties: {
|
|
176
|
-
actions: {
|
|
177
|
-
type: 'void',
|
|
178
|
-
'x-component': 'Space',
|
|
179
|
-
'x-component-props': {
|
|
180
|
-
split: '|',
|
|
181
|
-
},
|
|
182
|
-
properties: {
|
|
183
|
-
update: {
|
|
184
|
-
type: 'void',
|
|
185
|
-
title: '{{ t("Edit") }}',
|
|
186
|
-
'x-component': 'EditSubFieldAction',
|
|
187
|
-
'x-component-props': {
|
|
188
|
-
// useAction: '{{ ds.useUpdateAction }}',
|
|
189
|
-
},
|
|
190
|
-
},
|
|
191
|
-
delete: {
|
|
192
|
-
type: 'void',
|
|
193
|
-
title: '{{ t("Delete") }}',
|
|
194
|
-
'x-component': 'Action.Link',
|
|
195
|
-
'x-component-props': {
|
|
196
|
-
useAction: '{{ ds.useDestroyAction }}',
|
|
197
|
-
confirm: {
|
|
198
|
-
title: "{{t('Delete record')}}",
|
|
199
|
-
content: "{{t('Are you sure you want to delete it?')}}",
|
|
200
|
-
},
|
|
201
|
-
},
|
|
202
|
-
},
|
|
203
|
-
},
|
|
204
|
-
},
|
|
205
|
-
},
|
|
206
|
-
},
|
|
207
|
-
},
|
|
208
|
-
},
|
|
209
|
-
},
|
|
210
|
-
},
|
|
211
|
-
// children: {
|
|
212
|
-
// type: 'array',
|
|
213
|
-
// title: '{{t("Sub-table fields")}}',
|
|
214
|
-
// 'x-decorator': 'FormItem',
|
|
215
|
-
// 'x-component': 'DatabaseField',
|
|
216
|
-
// },
|
|
217
|
-
};
|
|
218
|
-
}
|