@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.
Files changed (137) hide show
  1. package/es/Application.d.ts +6 -0
  2. package/es/collection-field-interface/CollectionFieldInterface.d.ts +51 -15
  3. package/es/collection-field-interface/CollectionFieldInterfaceManager.d.ts +82 -3
  4. package/es/collection-manager/field-configure.d.ts +80 -0
  5. package/es/collection-manager/field-validation.d.ts +43 -0
  6. package/es/collection-manager/filter-operators/index.d.ts +46 -0
  7. package/es/collection-manager/filter-operators/operators.d.ts +30 -0
  8. package/es/collection-manager/interfaces/checkbox.d.ts +1 -41
  9. package/es/collection-manager/interfaces/checkboxGroup.d.ts +12 -44
  10. package/es/collection-manager/interfaces/collection.d.ts +12 -51
  11. package/es/collection-manager/interfaces/color.d.ts +1 -16
  12. package/es/collection-manager/interfaces/createdAt.d.ts +1 -44
  13. package/es/collection-manager/interfaces/createdBy.d.ts +0 -4
  14. package/es/collection-manager/interfaces/dateOnly.d.ts +7 -44
  15. package/es/collection-manager/interfaces/datetime.d.ts +1 -44
  16. package/es/collection-manager/interfaces/datetimeNoTz.d.ts +1 -44
  17. package/es/collection-manager/interfaces/email.d.ts +1 -29
  18. package/es/collection-manager/interfaces/id.d.ts +1 -16
  19. package/es/collection-manager/interfaces/index.d.ts +2 -3
  20. package/es/collection-manager/interfaces/input.d.ts +1 -102
  21. package/es/collection-manager/interfaces/integer.d.ts +1 -95
  22. package/es/collection-manager/interfaces/json.d.ts +16 -7
  23. package/es/collection-manager/interfaces/m2m.d.ts +11 -19
  24. package/es/collection-manager/interfaces/m2o.d.ts +11 -19
  25. package/es/collection-manager/interfaces/markdown.d.ts +1 -63
  26. package/es/collection-manager/interfaces/multipleSelect.d.ts +12 -44
  27. package/es/collection-manager/interfaces/nanoid.d.ts +1 -34
  28. package/es/collection-manager/interfaces/number.d.ts +1 -87
  29. package/es/collection-manager/interfaces/o2m.d.ts +12 -24
  30. package/es/collection-manager/interfaces/obo.d.ts +207 -0
  31. package/es/collection-manager/interfaces/oho.d.ts +207 -0
  32. package/es/collection-manager/interfaces/password.d.ts +1 -56
  33. package/es/collection-manager/interfaces/percent.d.ts +1 -84
  34. package/es/collection-manager/interfaces/phone.d.ts +1 -25
  35. package/es/collection-manager/interfaces/properties/index.d.ts +0 -28
  36. package/es/collection-manager/interfaces/radioGroup.d.ts +1 -29
  37. package/es/collection-manager/interfaces/richText.d.ts +1 -63
  38. package/es/collection-manager/interfaces/select.d.ts +12 -44
  39. package/es/collection-manager/interfaces/snowflake-id.d.ts +1 -34
  40. package/es/collection-manager/interfaces/tableoid.d.ts +1 -10
  41. package/es/collection-manager/interfaces/textarea.d.ts +1 -51
  42. package/es/collection-manager/interfaces/time.d.ts +1 -16
  43. package/es/collection-manager/interfaces/types.d.ts +3 -12
  44. package/es/collection-manager/interfaces/unixTimestamp.d.ts +1 -44
  45. package/es/collection-manager/interfaces/updatedAt.d.ts +1 -44
  46. package/es/collection-manager/interfaces/updatedBy.d.ts +0 -4
  47. package/es/collection-manager/interfaces/url.d.ts +1 -20
  48. package/es/collection-manager/interfaces/uuid.d.ts +1 -34
  49. package/es/collection-manager/template-fields.d.ts +53 -0
  50. package/es/components/form/VariableInput.d.ts +53 -2
  51. package/es/components/form/filter/CollectionFilter.d.ts +9 -1
  52. package/es/components/form/filter/CollectionFilterItem.d.ts +10 -2
  53. package/es/flow/components/filter/useFilterOptions.d.ts +13 -1
  54. package/es/flow/models/blocks/assign-form/assignFieldValuesFlow.d.ts +84 -0
  55. package/es/flow/models/blocks/assign-form/index.d.ts +1 -0
  56. package/es/flow/models/blocks/form/FormActionModel.d.ts +9 -2
  57. package/es/index.d.ts +4 -0
  58. package/es/index.mjs +105 -142
  59. package/lib/index.js +106 -143
  60. package/package.json +7 -7
  61. package/src/Application.tsx +24 -0
  62. package/src/collection-field-interface/CollectionFieldInterface.ts +71 -77
  63. package/src/collection-field-interface/CollectionFieldInterfaceManager.ts +201 -4
  64. package/src/collection-manager/field-configure.ts +548 -0
  65. package/src/collection-manager/field-validation.ts +195 -0
  66. package/src/collection-manager/filter-operators/index.ts +176 -0
  67. package/src/collection-manager/{interfaces/properties → filter-operators}/operators.ts +24 -13
  68. package/src/collection-manager/interfaces/checkbox.ts +2 -9
  69. package/src/collection-manager/interfaces/checkboxGroup.ts +2 -10
  70. package/src/collection-manager/interfaces/collection.ts +2 -15
  71. package/src/collection-manager/interfaces/color.ts +2 -2
  72. package/src/collection-manager/interfaces/createdAt.ts +2 -2
  73. package/src/collection-manager/interfaces/createdBy.ts +1 -12
  74. package/src/collection-manager/interfaces/dateOnly.ts +8 -2
  75. package/src/collection-manager/interfaces/datetime.ts +2 -2
  76. package/src/collection-manager/interfaces/datetimeNoTz.ts +2 -2
  77. package/src/collection-manager/interfaces/email.ts +2 -9
  78. package/src/collection-manager/interfaces/id.ts +1 -2
  79. package/src/collection-manager/interfaces/index.ts +2 -3
  80. package/src/collection-manager/interfaces/input.ts +2 -133
  81. package/src/collection-manager/interfaces/integer.ts +2 -71
  82. package/src/collection-manager/interfaces/json.tsx +17 -11
  83. package/src/collection-manager/interfaces/m2m.tsx +0 -21
  84. package/src/collection-manager/interfaces/m2o.tsx +0 -22
  85. package/src/collection-manager/interfaces/markdown.ts +2 -51
  86. package/src/collection-manager/interfaces/multipleSelect.ts +2 -14
  87. package/src/collection-manager/interfaces/nanoid.ts +2 -2
  88. package/src/collection-manager/interfaces/number.ts +2 -85
  89. package/src/collection-manager/interfaces/o2m.tsx +1 -22
  90. package/src/collection-manager/interfaces/obo.tsx +145 -0
  91. package/src/collection-manager/interfaces/oho.tsx +145 -0
  92. package/src/collection-manager/interfaces/password.ts +2 -44
  93. package/src/collection-manager/interfaces/percent.ts +2 -74
  94. package/src/collection-manager/interfaces/phone.ts +2 -2
  95. package/src/collection-manager/interfaces/properties/index.ts +0 -133
  96. package/src/collection-manager/interfaces/radioGroup.ts +2 -2
  97. package/src/collection-manager/interfaces/richText.ts +2 -51
  98. package/src/collection-manager/interfaces/select.ts +2 -14
  99. package/src/collection-manager/interfaces/snowflake-id.ts +2 -2
  100. package/src/collection-manager/interfaces/tableoid.ts +1 -2
  101. package/src/collection-manager/interfaces/textarea.ts +2 -51
  102. package/src/collection-manager/interfaces/time.ts +2 -2
  103. package/src/collection-manager/interfaces/types.ts +4 -12
  104. package/src/collection-manager/interfaces/unixTimestamp.tsx +2 -2
  105. package/src/collection-manager/interfaces/updatedAt.ts +2 -2
  106. package/src/collection-manager/interfaces/updatedBy.ts +1 -12
  107. package/src/collection-manager/interfaces/url.ts +2 -4
  108. package/src/collection-manager/interfaces/uuid.ts +2 -2
  109. package/src/collection-manager/template-fields.ts +109 -0
  110. package/src/components/README.md +1 -0
  111. package/src/components/README.zh-CN.md +1 -0
  112. package/src/components/form/VariableInput.tsx +101 -28
  113. package/src/components/form/__tests__/VariableInput.test.ts +85 -0
  114. package/src/components/form/filter/CollectionFilter.tsx +11 -1
  115. package/src/components/form/filter/CollectionFilterItem.tsx +12 -4
  116. package/src/components/form/filter/__tests__/CollectionFilterItem.test.tsx +42 -0
  117. package/src/components/form/filter/useFilterActionProps.ts +7 -4
  118. package/src/flow/components/filter/useFilterOptions.ts +27 -5
  119. package/src/flow/models/actions/UpdateRecordActionModel.tsx +14 -95
  120. package/src/flow/models/actions/UpdateRecordActionUtils.ts +4 -7
  121. package/src/flow/models/actions/__tests__/AssignFormRefill.test.ts +26 -1
  122. package/src/flow/models/blocks/assign-form/AssignFormItemModel.tsx +63 -2
  123. package/src/flow/models/blocks/assign-form/assignFieldValuesFlow.tsx +206 -0
  124. package/src/flow/models/blocks/assign-form/index.ts +1 -0
  125. package/src/flow/models/blocks/form/FormActionModel.tsx +30 -3
  126. package/src/flow/models/blocks/form/__tests__/submitHandler.test.ts +71 -0
  127. package/src/flow/models/blocks/form/submitHandler.ts +8 -1
  128. package/src/flow/models/fields/CollectionSelectorFieldModel.tsx +8 -2
  129. package/src/flow/models/fields/DisplayEnumFieldModel.tsx +8 -2
  130. package/src/index.ts +4 -0
  131. package/es/collection-manager/interfaces/linkTo.d.ts +0 -90
  132. package/es/collection-manager/interfaces/o2o.d.ts +0 -621
  133. package/es/collection-manager/interfaces/properties/operators.d.ts +0 -294
  134. package/es/collection-manager/interfaces/subTable.d.ts +0 -172
  135. package/src/collection-manager/interfaces/linkTo.ts +0 -120
  136. package/src/collection-manager/interfaces/o2o.tsx +0 -561
  137. package/src/collection-manager/interfaces/subTable.ts +0 -218
@@ -1,561 +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 { CollectionFieldInterface } from '../../collection-field-interface/CollectionFieldInterface';
12
- import { getUniqueKeyFromCollection } from './utils';
13
- import { constraintsProps, relationshipType, reverseFieldProperties } from './properties';
14
-
15
- export class O2OFieldInterface extends CollectionFieldInterface {
16
- name = 'o2o';
17
- type = 'object';
18
- group = 'relation';
19
- order = 3;
20
- title = '{{t("One to one")}}';
21
- description = '{{t("One to one description")}}';
22
- isAssociation = true;
23
- validationType = 'object';
24
- default = {
25
- type: 'hasOne',
26
- // name,
27
- uiSchema: {
28
- // title,
29
- 'x-component': 'AssociationField',
30
- 'x-component-props': {
31
- // mode: 'tags',
32
- multiple: false,
33
- // fieldNames: {
34
- // label: 'id',
35
- // value: 'id',
36
- // },
37
- },
38
- },
39
- reverseField: {
40
- interface: 'obo',
41
- type: 'belongsTo',
42
- // title: '{{t("One to one (belongs to)")}}',
43
- // name,
44
- uiSchema: {
45
- // title,
46
- 'x-component': 'AssociationField',
47
- 'x-component-props': {
48
- // mode: 'tags',
49
- multiple: false,
50
- // fieldNames: {
51
- // label: 'id',
52
- // value: 'id',
53
- // },
54
- },
55
- },
56
- },
57
- };
58
- availableTypes = ['hasOne'];
59
- schemaInitialize(schema: ISchema, { field, block, readPretty, action, targetCollection }) {
60
- if (['Table', 'Kanban'].includes(block)) {
61
- schema['x-component-props'] = schema['x-component-props'] || {};
62
- schema['x-component-props']['ellipsis'] = true;
63
-
64
- // 预览文件时需要的参数
65
- schema['x-component-props']['size'] = 'small';
66
- }
67
- schema['x-component-props'] = schema['x-component-props'] || {};
68
- schema['x-component-props'].fieldNames = schema['x-component-props'].fieldNames || {
69
- value: getUniqueKeyFromCollection(targetCollection),
70
- };
71
- schema['x-component-props'].fieldNames.label =
72
- targetCollection?.titleField || getUniqueKeyFromCollection(targetCollection);
73
- }
74
- properties = {
75
- 'uiSchema.title': {
76
- type: 'string',
77
- title: '{{t("Field display name")}}',
78
- required: true,
79
- 'x-decorator': 'FormItem',
80
- 'x-component': 'Input',
81
- },
82
- name: {
83
- type: 'string',
84
- title: '{{t("Field name")}}',
85
- required: true,
86
- 'x-disabled': '{{ !createOnly }}',
87
- 'x-decorator': 'FormItem',
88
- 'x-component': 'Input',
89
- description:
90
- "{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}",
91
- },
92
- type: relationshipType,
93
- grid: {
94
- type: 'void',
95
- 'x-component': 'Grid',
96
- properties: {
97
- row1: {
98
- type: 'void',
99
- 'x-component': 'Grid.Row',
100
- properties: {
101
- col11: {
102
- type: 'void',
103
- 'x-component': 'Grid.Col',
104
- properties: {
105
- source: {
106
- type: 'void',
107
- title: '{{t("Source collection")}}',
108
- 'x-decorator': 'FormItem',
109
- 'x-component': 'SourceCollection',
110
- 'x-disabled': true,
111
- },
112
- },
113
- },
114
- col12: {
115
- type: 'void',
116
- 'x-component': 'Grid.Col',
117
- properties: {
118
- target: {
119
- type: 'string',
120
- title: '{{t("Target collection")}}',
121
- required: true,
122
- 'x-reactions': ['{{useAsyncDataSource(loadCollections)}}'],
123
- 'x-decorator': 'FormItem',
124
- 'x-component': 'Select',
125
- 'x-disabled': '{{ !createOnly }}',
126
- },
127
- },
128
- },
129
- },
130
- },
131
- row2: {
132
- type: 'void',
133
- 'x-component': 'Grid.Row',
134
- properties: {
135
- col21: {
136
- type: 'void',
137
- 'x-component': 'Grid.Col',
138
- properties: {
139
- sourceKey: {
140
- type: 'string',
141
- title: '{{t("Source key")}}',
142
- description: "{{t('Field values must be unique.')}}",
143
- 'x-decorator': 'FormItem',
144
- 'x-component': 'SourceKey',
145
- },
146
- },
147
- },
148
- col22: {
149
- type: 'void',
150
- 'x-component': 'Grid.Col',
151
- properties: {
152
- foreignKey: {
153
- type: 'string',
154
- title: '{{t("Foreign key")}}',
155
- required: true,
156
- default: '{{ useNewId("f_") }}',
157
- description:
158
- "{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}",
159
- 'x-decorator': 'FormItem',
160
- 'x-component': 'ForeignKey',
161
- 'x-validator': 'uid',
162
- 'x-disabled': '{{ !createOnly }}',
163
- },
164
- },
165
- },
166
- },
167
- },
168
- },
169
- },
170
- 'reverseField.name': {
171
- type: 'string',
172
- title: '{{t("Inverse field name")}}',
173
- // required: true,
174
- 'x-hidden': '{{ !createOnly }}',
175
- 'x-decorator': 'FormItem',
176
- 'x-component': 'Input',
177
- description:
178
- "{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}",
179
- },
180
- };
181
- filterable = {
182
- nested: true,
183
- children: [
184
- // {
185
- // name: 'id',
186
- // title: '{{t("Exists")}}',
187
- // operators: [
188
- // { label: '{{t("exists")}}', value: '$exists', noValue: true },
189
- // { label: '{{t("not exists")}}', value: '$notExists', noValue: true },
190
- // ],
191
- // schema: {
192
- // title: '{{t("Exists")}}',
193
- // type: 'string',
194
- // 'x-component': 'Input',
195
- // },
196
- // },
197
- ],
198
- };
199
- }
200
-
201
- export class OHOFieldInterface extends CollectionFieldInterface {
202
- name = 'oho';
203
- type = 'object';
204
- group = 'relation';
205
- order = 3;
206
- title = '{{t("One to one (has one)")}}';
207
- description = '{{t("One to one description")}}';
208
- isAssociation = true;
209
- validationType = 'object';
210
- default = {
211
- type: 'hasOne',
212
- // name,
213
- uiSchema: {
214
- // title,
215
- 'x-component': 'AssociationField',
216
- 'x-component-props': {
217
- // mode: 'tags',
218
- multiple: false,
219
- // fieldNames: {
220
- // label: 'id',
221
- // value: 'id',
222
- // },
223
- },
224
- },
225
- reverseField: {
226
- interface: 'obo',
227
- type: 'belongsTo',
228
- // title: '{{t("One to one (belongs to)")}}',
229
- // name,
230
- uiSchema: {
231
- // title,
232
- 'x-component': 'AssociationField',
233
- 'x-component-props': {
234
- // mode: 'tags',
235
- multiple: false,
236
- // fieldNames: {
237
- // label: 'id',
238
- // value: 'id',
239
- // },
240
- },
241
- },
242
- },
243
- };
244
- availableTypes = ['hasOne'];
245
- schemaInitialize(schema: ISchema, { field, block, readPretty, action, targetCollection }) {
246
- // schema['type'] = 'object';
247
- if (['Table', 'Kanban'].includes(block)) {
248
- schema['x-component-props'] = schema['x-component-props'] || {};
249
- schema['x-component-props']['ellipsis'] = true;
250
-
251
- // 预览文件时需要的参数
252
- schema['x-component-props']['size'] = 'small';
253
- }
254
- schema['x-component-props'] = schema['x-component-props'] || {};
255
- schema['x-component-props'].fieldNames = schema['x-component-props'].fieldNames || {
256
- value: getUniqueKeyFromCollection(targetCollection),
257
- };
258
- schema['x-component-props'].fieldNames.label =
259
- schema['x-component-props'].fieldNames?.label ||
260
- targetCollection?.titleField ||
261
- getUniqueKeyFromCollection(targetCollection);
262
- }
263
- properties = {
264
- 'uiSchema.title': {
265
- type: 'string',
266
- title: '{{t("Field display name")}}',
267
- required: true,
268
- 'x-decorator': 'FormItem',
269
- 'x-component': 'Input',
270
- },
271
- name: {
272
- type: 'string',
273
- title: '{{t("Field name")}}',
274
- required: true,
275
- 'x-disabled': '{{ !createOnly }}',
276
- 'x-decorator': 'FormItem',
277
- 'x-component': 'Input',
278
- description:
279
- "{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}",
280
- },
281
- type: relationshipType,
282
- grid: {
283
- type: 'void',
284
- 'x-component': 'Grid',
285
- properties: {
286
- row1: {
287
- type: 'void',
288
- 'x-component': 'Grid.Row',
289
- properties: {
290
- col11: {
291
- type: 'void',
292
- 'x-component': 'Grid.Col',
293
- properties: {
294
- source: {
295
- type: 'void',
296
- title: '{{t("Source collection")}}',
297
- 'x-decorator': 'FormItem',
298
- 'x-component': 'SourceCollection',
299
- 'x-disabled': true,
300
- },
301
- },
302
- },
303
- col12: {
304
- type: 'void',
305
- 'x-component': 'Grid.Col',
306
- properties: {
307
- target: {
308
- type: 'string',
309
- title: '{{t("Target collection")}}',
310
- required: true,
311
- 'x-reactions': ['{{useAsyncDataSource(loadCollections)}}'],
312
- 'x-decorator': 'FormItem',
313
- 'x-component': 'Select',
314
- 'x-disabled': '{{ !createOnly }}',
315
- },
316
- },
317
- },
318
- },
319
- },
320
- row2: {
321
- type: 'void',
322
- 'x-component': 'Grid.Row',
323
- properties: {
324
- col21: {
325
- type: 'void',
326
- 'x-component': 'Grid.Col',
327
- properties: {
328
- sourceKey: {
329
- type: 'string',
330
- title: '{{t("Source key")}}',
331
- description: "{{t('Field values must be unique.')}}",
332
- 'x-decorator': 'FormItem',
333
- 'x-component': 'SourceKey',
334
- },
335
- },
336
- },
337
- col22: {
338
- type: 'void',
339
- 'x-component': 'Grid.Col',
340
- properties: {
341
- foreignKey: {
342
- type: 'string',
343
- title: '{{t("Foreign key")}}',
344
- required: true,
345
- default: '{{ useNewId("f_") }}',
346
- description:
347
- "{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}",
348
- 'x-decorator': 'FormItem',
349
- 'x-component': 'ForeignKey',
350
- 'x-validator': 'uid',
351
- 'x-disabled': '{{ !createOnly }}',
352
- },
353
- },
354
- },
355
- },
356
- },
357
- },
358
- },
359
- ...constraintsProps,
360
- ...reverseFieldProperties,
361
- };
362
- filterable = {
363
- nested: true,
364
- children: [
365
- // {
366
- // name: 'id',
367
- // title: '{{t("Exists")}}',
368
- // operators: [
369
- // { label: '{{t("exists")}}', value: '$exists', noValue: true },
370
- // { label: '{{t("not exists")}}', value: '$notExists', noValue: true },
371
- // ],
372
- // schema: {
373
- // title: '{{t("Exists")}}',
374
- // type: 'string',
375
- // 'x-component': 'Input',
376
- // },
377
- // },
378
- ],
379
- };
380
- }
381
-
382
- export class OBOFieldInterface extends CollectionFieldInterface {
383
- name = 'obo';
384
- type = 'object';
385
- group = 'relation';
386
- order = 3;
387
- title = '{{t("One to one (belongs to)")}}';
388
- description = '{{t("One to one description")}}';
389
- isAssociation = true;
390
- validationType = 'object';
391
- default = {
392
- type: 'belongsTo',
393
- // name,
394
- uiSchema: {
395
- // title,
396
- 'x-component': 'AssociationField',
397
- 'x-component-props': {
398
- // mode: 'tags',
399
- multiple: false,
400
- // fieldNames: {
401
- // label: 'id',
402
- // value: 'id',
403
- // },
404
- },
405
- },
406
- reverseField: {
407
- interface: 'oho',
408
- type: 'hasOne',
409
- // name,
410
- uiSchema: {
411
- // title,
412
- 'x-component': 'AssociationField',
413
- 'x-component-props': {
414
- // mode: 'tags',
415
- multiple: false,
416
- // fieldNames: {
417
- // label: 'id',
418
- // value: 'id',
419
- // },
420
- },
421
- },
422
- },
423
- };
424
- availableTypes = ['belongsTo'];
425
- schemaInitialize(schema: ISchema, { field, block, readPretty, action, targetCollection }) {
426
- // schema['type'] = 'object';
427
- if (['Table', 'Kanban'].includes(block)) {
428
- schema['x-component-props'] = schema['x-component-props'] || {};
429
- schema['x-component-props']['ellipsis'] = true;
430
- // 预览文件时需要的参数
431
- schema['x-component-props']['size'] = 'small';
432
- }
433
-
434
- schema['x-component-props'] = schema['x-component-props'] || {};
435
- schema['x-component-props'].fieldNames = schema['x-component-props'].fieldNames || {
436
- value: getUniqueKeyFromCollection(targetCollection),
437
- };
438
- schema['x-component-props'].fieldNames.label =
439
- schema['x-component-props'].fieldNames?.label ||
440
- targetCollection?.titleField ||
441
- getUniqueKeyFromCollection(targetCollection);
442
- }
443
- properties = {
444
- 'uiSchema.title': {
445
- type: 'string',
446
- title: '{{t("Field display name")}}',
447
- required: true,
448
- 'x-decorator': 'FormItem',
449
- 'x-component': 'Input',
450
- },
451
- name: {
452
- type: 'string',
453
- title: '{{t("Field name")}}',
454
- required: true,
455
- 'x-disabled': '{{ !createOnly }}',
456
- 'x-decorator': 'FormItem',
457
- 'x-component': 'Input',
458
- description:
459
- "{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}",
460
- },
461
- type: relationshipType,
462
- grid: {
463
- type: 'void',
464
- 'x-component': 'Grid',
465
- properties: {
466
- row1: {
467
- type: 'void',
468
- 'x-component': 'Grid.Row',
469
- properties: {
470
- col11: {
471
- type: 'void',
472
- 'x-component': 'Grid.Col',
473
- properties: {
474
- source: {
475
- type: 'void',
476
- title: '{{t("Source collection")}}',
477
- 'x-decorator': 'FormItem',
478
- 'x-component': 'SourceCollection',
479
- 'x-disabled': true,
480
- },
481
- },
482
- },
483
- col12: {
484
- type: 'void',
485
- 'x-component': 'Grid.Col',
486
- properties: {
487
- target: {
488
- type: 'string',
489
- title: '{{t("Target collection")}}',
490
- required: true,
491
- 'x-reactions': ['{{useAsyncDataSource(loadCollections)}}'],
492
- 'x-decorator': 'FormItem',
493
- 'x-component': 'Select',
494
- 'x-disabled': '{{ !createOnly }}',
495
- },
496
- },
497
- },
498
- },
499
- },
500
- row2: {
501
- type: 'void',
502
- 'x-component': 'Grid.Row',
503
- properties: {
504
- col21: {
505
- type: 'void',
506
- 'x-component': 'Grid.Col',
507
- properties: {
508
- foreignKey: {
509
- type: 'string',
510
- title: '{{t("Foreign key")}}',
511
- required: true,
512
- default: '{{ useNewId("f_") }}',
513
- description:
514
- "{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}",
515
- 'x-decorator': 'FormItem',
516
- 'x-component': 'ForeignKey',
517
- 'x-validator': 'uid',
518
- 'x-disabled': '{{ !createOnly }}',
519
- },
520
- },
521
- },
522
- col22: {
523
- type: 'void',
524
- 'x-component': 'Grid.Col',
525
- properties: {
526
- targetKey: {
527
- type: 'string',
528
- title: '{{t("Target key")}}',
529
- description: "{{t('Field values must be unique.')}}",
530
- 'x-decorator': 'FormItem',
531
- 'x-component': 'TargetKey',
532
- 'x-disabled': '{{ !createOnly }}',
533
- },
534
- },
535
- },
536
- },
537
- },
538
- },
539
- },
540
- ...constraintsProps,
541
- ...reverseFieldProperties,
542
- };
543
- filterable = {
544
- nested: true,
545
- children: [
546
- // {
547
- // name: 'id',
548
- // title: '{{t("Exists")}}',
549
- // operators: [
550
- // { label: '{{t("exists")}}', value: '$exists', noValue: true },
551
- // { label: '{{t("not exists")}}', value: '$notExists', noValue: true },
552
- // ],
553
- // schema: {
554
- // title: '{{t("Exists")}}',
555
- // type: 'string',
556
- // 'x-component': 'Input',
557
- // },
558
- // },
559
- ],
560
- };
561
- }