@nocobase/plugin-flow-engine 2.1.0-alpha.23 → 2.1.0-alpha.25
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/dist/ai/ai-employees/nathan/skills/frontend-developer/SKILLS.md +2 -2
- package/dist/externalVersion.js +10 -10
- package/dist/node_modules/ses/package.json +1 -1
- package/dist/node_modules/zod/package.json +1 -1
- package/dist/server/flow-surfaces/action-scope.d.ts +1 -0
- package/dist/server/flow-surfaces/action-scope.js +4 -0
- package/dist/server/flow-surfaces/apply/compiler.js +4 -2
- package/dist/server/flow-surfaces/association-interfaces.d.ts +10 -0
- package/dist/server/flow-surfaces/association-interfaces.js +39 -0
- package/dist/server/flow-surfaces/association-title-field.d.ts +1 -1
- package/dist/server/flow-surfaces/association-title-field.js +38 -4
- package/dist/server/flow-surfaces/blueprint/compile-blocks.js +72 -5
- package/dist/server/flow-surfaces/blueprint/public-types.d.ts +9 -1
- package/dist/server/flow-surfaces/builder.d.ts +27 -1
- package/dist/server/flow-surfaces/builder.js +105 -5
- package/dist/server/flow-surfaces/catalog.d.ts +2 -1
- package/dist/server/flow-surfaces/catalog.js +316 -119
- package/dist/server/flow-surfaces/compose-compiler.d.ts +8 -0
- package/dist/server/flow-surfaces/compose-compiler.js +9 -1
- package/dist/server/flow-surfaces/configure-options.js +72 -6
- package/dist/server/flow-surfaces/core-field-default-bindings.d.ts +12 -0
- package/dist/server/flow-surfaces/core-field-default-bindings.js +157 -0
- package/dist/server/flow-surfaces/default-action-popup.js +2 -2
- package/dist/server/flow-surfaces/default-block-actions.js +24 -0
- package/dist/server/flow-surfaces/field-binding-registry.d.ts +1 -0
- package/dist/server/flow-surfaces/field-binding-registry.js +5 -0
- package/dist/server/flow-surfaces/field-semantics.d.ts +1 -1
- package/dist/server/flow-surfaces/field-semantics.js +7 -4
- package/dist/server/flow-surfaces/field-type-resolver.d.ts +46 -0
- package/dist/server/flow-surfaces/field-type-resolver.js +322 -0
- package/dist/server/flow-surfaces/index.js +61 -2
- package/dist/server/flow-surfaces/node-use-sets.js +4 -0
- package/dist/server/flow-surfaces/placement.js +3 -0
- package/dist/server/flow-surfaces/public-data-surface-default-filter.d.ts +4 -0
- package/dist/server/flow-surfaces/public-data-surface-default-filter.js +45 -4
- package/dist/server/flow-surfaces/service-helpers.js +3 -70
- package/dist/server/flow-surfaces/service-utils.d.ts +13 -1
- package/dist/server/flow-surfaces/service-utils.js +58 -6
- package/dist/server/flow-surfaces/service.d.ts +59 -2
- package/dist/server/flow-surfaces/service.js +2269 -234
- package/dist/server/flow-surfaces/support-matrix.d.ts +1 -1
- package/dist/server/flow-surfaces/support-matrix.js +23 -0
- package/dist/server/flow-surfaces/surface-context.js +8 -5
- package/dist/swagger/flow-surfaces.d.ts +173 -2
- package/dist/swagger/flow-surfaces.examples.d.ts +59 -15
- package/dist/swagger/flow-surfaces.examples.js +69 -11
- package/dist/swagger/flow-surfaces.js +86 -17
- package/dist/swagger/index.d.ts +173 -2
- package/package.json +2 -2
|
@@ -33,7 +33,7 @@ __export(compose_compiler_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(compose_compiler_exports);
|
|
34
34
|
var import_errors = require("./errors");
|
|
35
35
|
var import_defaults = require("./blueprint/defaults");
|
|
36
|
-
const LIST_LIKE_COMPOSE_BLOCK_TYPES = /* @__PURE__ */ new Set(["list", "gridCard"]);
|
|
36
|
+
const LIST_LIKE_COMPOSE_BLOCK_TYPES = /* @__PURE__ */ new Set(["list", "gridCard", "kanban"]);
|
|
37
37
|
function compileComposeExecutionPlan(input) {
|
|
38
38
|
const blocks = compileComposeBlockTasks(input.gridUid, input.normalizedBlocks);
|
|
39
39
|
const fields = compileComposeFieldTasks(input.normalizedBlocks);
|
|
@@ -123,6 +123,14 @@ function buildComposeFieldCreatePayload(fieldSpec) {
|
|
|
123
123
|
...fieldSpec.associationPathName ? { associationPathName: fieldSpec.associationPathName } : {},
|
|
124
124
|
...fieldSpec.renderer ? { renderer: fieldSpec.renderer } : {},
|
|
125
125
|
...fieldSpec.type ? { type: fieldSpec.type } : {},
|
|
126
|
+
...fieldSpec.fieldType ? { fieldType: fieldSpec.fieldType } : {},
|
|
127
|
+
...typeof fieldSpec.fields !== "undefined" ? { fields: fieldSpec.fields } : {},
|
|
128
|
+
...typeof fieldSpec.selectorFields !== "undefined" ? { selectorFields: fieldSpec.selectorFields } : {},
|
|
129
|
+
...fieldSpec.titleField ? { titleField: fieldSpec.titleField } : {},
|
|
130
|
+
...fieldSpec.openMode ? { openMode: fieldSpec.openMode } : {},
|
|
131
|
+
...fieldSpec.popupSize ? { popupSize: fieldSpec.popupSize } : {},
|
|
132
|
+
...typeof fieldSpec.pageSize !== "undefined" ? { pageSize: fieldSpec.pageSize } : {},
|
|
133
|
+
...typeof fieldSpec.showIndex !== "undefined" ? { showIndex: fieldSpec.showIndex } : {},
|
|
126
134
|
...fieldSpec.popup ? { popup: fieldSpec.popup } : {},
|
|
127
135
|
...fieldSpec.__autoPopupForRelationField ? { __autoPopupForRelationField: true } : {},
|
|
128
136
|
...fieldSpec[import_defaults.FLOW_SURFACE_APPLY_BLUEPRINT_POPUP_DEFAULTS_KEY] ? {
|
|
@@ -34,6 +34,7 @@ __export(configure_options_exports, {
|
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(configure_options_exports);
|
|
36
36
|
var import_approval = require("./approval");
|
|
37
|
+
var import_field_type_resolver = require("./field-type-resolver");
|
|
37
38
|
const stringOption = (description, extra = {}) => ({
|
|
38
39
|
type: "string",
|
|
39
40
|
...description ? { description } : {},
|
|
@@ -90,9 +91,25 @@ const DISPLAY_STYLE = stringOption("Display style", {
|
|
|
90
91
|
enum: ["text", "tag"],
|
|
91
92
|
example: "tag"
|
|
92
93
|
});
|
|
93
|
-
const
|
|
94
|
-
|
|
94
|
+
const FIELD_TYPE = stringOption("Public relation field presentation type", {
|
|
95
|
+
enum: [...import_field_type_resolver.FLOW_SURFACE_PUBLIC_RELATION_FIELD_TYPES],
|
|
96
|
+
example: "popupSubTable"
|
|
95
97
|
});
|
|
98
|
+
const RELATION_FIELDS = arrayOption("Relation target fields", {
|
|
99
|
+
example: ["title", "name"]
|
|
100
|
+
});
|
|
101
|
+
const SELECTOR_FIELDS = arrayOption("Record picker selector fields", {
|
|
102
|
+
example: ["title", "code"]
|
|
103
|
+
});
|
|
104
|
+
const RELATION_FIELD_TYPE_OPTIONS = {
|
|
105
|
+
fieldType: FIELD_TYPE,
|
|
106
|
+
fields: RELATION_FIELDS,
|
|
107
|
+
selectorFields: SELECTOR_FIELDS,
|
|
108
|
+
openMode: stringOption("Popup open mode", { example: "drawer" }),
|
|
109
|
+
popupSize: stringOption("Popup size", { example: "medium" }),
|
|
110
|
+
pageSize: numberOption("Page size", { example: 10 }),
|
|
111
|
+
showIndex: booleanOption("Whether to show index", { example: true })
|
|
112
|
+
};
|
|
96
113
|
const CONFIRM = objectOption("Confirmation dialog configuration. You can also pass a boolean directly.", {
|
|
97
114
|
example: {
|
|
98
115
|
enable: true,
|
|
@@ -219,6 +236,49 @@ const CALENDAR_OPTIONS = {
|
|
|
219
236
|
quickCreatePopup: OPEN_VIEW,
|
|
220
237
|
eventPopup: OPEN_VIEW
|
|
221
238
|
};
|
|
239
|
+
const TREE_OPTIONS = {
|
|
240
|
+
...COMMON_BLOCK_HEADER_OPTIONS,
|
|
241
|
+
...COMMON_HEIGHT_OPTIONS,
|
|
242
|
+
resource: COMMON_RESOURCE,
|
|
243
|
+
searchable: booleanOption("Whether search is enabled", { example: true }),
|
|
244
|
+
defaultExpandAll: booleanOption("Whether all tree nodes are expanded by default", { example: false }),
|
|
245
|
+
includeDescendants: booleanOption("Whether child nodes are included when filtering", { example: true }),
|
|
246
|
+
titleField: stringOption("Tree node title field", { example: "title" }),
|
|
247
|
+
fieldNames: objectOption("Tree field names", { example: { title: "title", key: "id", children: "children" } }),
|
|
248
|
+
pageSize: numberOption("Root records per page", { example: 200 }),
|
|
249
|
+
dataScope: FILTER_GROUP,
|
|
250
|
+
sorting: SORTING
|
|
251
|
+
};
|
|
252
|
+
const KANBAN_OPTIONS = {
|
|
253
|
+
...COMMON_BLOCK_HEADER_OPTIONS,
|
|
254
|
+
...COMMON_HEIGHT_OPTIONS,
|
|
255
|
+
resource: COMMON_RESOURCE,
|
|
256
|
+
groupField: stringOption("Grouping field", { example: "status" }),
|
|
257
|
+
groupTitleField: stringOption("Association grouping title field", { example: "title" }),
|
|
258
|
+
groupColorField: stringOption("Association grouping color field", { example: "color" }),
|
|
259
|
+
groupOptions: arrayOption("Ordered kanban group options", {
|
|
260
|
+
example: [
|
|
261
|
+
{ value: "todo", label: "To do", color: "blue" },
|
|
262
|
+
{ value: "done", label: "Done", color: "green" }
|
|
263
|
+
]
|
|
264
|
+
}),
|
|
265
|
+
styleVariant: stringOption("Kanban style variant", { enum: ["default", "filled"], example: "filled" }),
|
|
266
|
+
sorting: SORTING,
|
|
267
|
+
dragEnabled: booleanOption("Whether drag sorting is enabled", { example: true }),
|
|
268
|
+
dragSortBy: stringOption("Drag-sort field", { example: "status_sort" }),
|
|
269
|
+
quickCreateEnabled: booleanOption("Whether per-column quick create is enabled", { example: true }),
|
|
270
|
+
quickCreatePopup: OPEN_VIEW,
|
|
271
|
+
enableCardClick: booleanOption("Whether cards can be clicked to open a popup", { example: true }),
|
|
272
|
+
cardPopup: OPEN_VIEW,
|
|
273
|
+
cardLayout: stringOption("Kanban card layout", { example: "vertical" }),
|
|
274
|
+
cardLabelAlign: stringOption("Kanban card label alignment", { example: "left" }),
|
|
275
|
+
cardLabelWidth: stringOption("Kanban card label width", { example: "120px" }),
|
|
276
|
+
cardLabelWrap: booleanOption("Whether kanban card labels should wrap", { example: false }),
|
|
277
|
+
cardColon: booleanOption("Whether kanban card labels display a colon", { example: true }),
|
|
278
|
+
pageSize: numberOption("Page size", { example: 20 }),
|
|
279
|
+
columnWidth: numberOption("Column width", { example: 300 }),
|
|
280
|
+
dataScope: FILTER_GROUP
|
|
281
|
+
};
|
|
222
282
|
const GRID_CARD_OPTIONS = {
|
|
223
283
|
...COMMON_BLOCK_HEADER_OPTIONS,
|
|
224
284
|
...COMMON_HEIGHT_OPTIONS,
|
|
@@ -356,7 +416,7 @@ const TABLE_FIELD_WRAPPER_OPTIONS = {
|
|
|
356
416
|
editable: booleanOption("Whether editable", { example: false }),
|
|
357
417
|
dataIndex: stringOption("Data index"),
|
|
358
418
|
titleField: stringOption("Association display title field", { example: "title" }),
|
|
359
|
-
|
|
419
|
+
...RELATION_FIELD_TYPE_OPTIONS,
|
|
360
420
|
clickToOpen: booleanOption("Whether clicking can open details", { example: true }),
|
|
361
421
|
openView: OPEN_VIEW,
|
|
362
422
|
code: JS_CODE,
|
|
@@ -372,7 +432,7 @@ const DETAILS_FIELD_WRAPPER_OPTIONS = {
|
|
|
372
432
|
disabled: booleanOption("Whether disabled", { example: false }),
|
|
373
433
|
pattern: stringOption("Display mode"),
|
|
374
434
|
titleField: stringOption("Association display title field", { example: "title" }),
|
|
375
|
-
|
|
435
|
+
...RELATION_FIELD_TYPE_OPTIONS,
|
|
376
436
|
labelWidth: stringOption("Label width", { example: "120px" }),
|
|
377
437
|
labelWrap: booleanOption("Whether labels should wrap", { example: false }),
|
|
378
438
|
clickToOpen: booleanOption("Whether clicking can open details", { example: true }),
|
|
@@ -392,7 +452,7 @@ const FILTER_FIELD_WRAPPER_OPTIONS = {
|
|
|
392
452
|
allowMultiple: booleanOption("Whether multiple selection is allowed", { example: false }),
|
|
393
453
|
maxCount: numberOption("Maximum count", { example: 5 }),
|
|
394
454
|
name: stringOption("Field name override"),
|
|
395
|
-
|
|
455
|
+
...RELATION_FIELD_TYPE_OPTIONS,
|
|
396
456
|
labelWidth: stringOption("Label width", { example: "120px" }),
|
|
397
457
|
labelWrap: booleanOption("Whether labels should wrap", { example: false }),
|
|
398
458
|
clickToOpen: booleanOption("Whether clicking can open details", { example: false }),
|
|
@@ -416,7 +476,7 @@ const FORM_FIELD_WRAPPER_OPTIONS = {
|
|
|
416
476
|
pattern: stringOption("Input mode"),
|
|
417
477
|
titleField: stringOption("Association display title field", { example: "title" }),
|
|
418
478
|
name: stringOption("Field name override"),
|
|
419
|
-
|
|
479
|
+
...RELATION_FIELD_TYPE_OPTIONS,
|
|
420
480
|
labelWidth: stringOption("Label width", { example: "120px" }),
|
|
421
481
|
labelWrap: booleanOption("Whether labels should wrap", { example: false }),
|
|
422
482
|
clickToOpen: booleanOption("Whether clicking can open details", { example: false }),
|
|
@@ -714,6 +774,12 @@ function getConfigureOptionsForUse(use) {
|
|
|
714
774
|
case "CalendarBlockModel":
|
|
715
775
|
options = cloneOptions(CALENDAR_OPTIONS);
|
|
716
776
|
break;
|
|
777
|
+
case "TreeBlockModel":
|
|
778
|
+
options = cloneOptions(TREE_OPTIONS);
|
|
779
|
+
break;
|
|
780
|
+
case "KanbanBlockModel":
|
|
781
|
+
options = cloneOptions(KANBAN_OPTIONS);
|
|
782
|
+
break;
|
|
717
783
|
case "FormBlockModel":
|
|
718
784
|
case "CreateFormModel":
|
|
719
785
|
options = cloneOptions(FORM_COMMON_OPTIONS);
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
export type FlowSurfaceFieldDefaultBindingScope = 'display' | 'editable' | 'filter';
|
|
10
|
+
export declare const CORE_FIELD_DEFAULT_BINDING_MATRIX: Record<FlowSurfaceFieldDefaultBindingScope, Record<string, string>>;
|
|
11
|
+
export declare function getSharedFieldDefaultBindingUse(scope: FlowSurfaceFieldDefaultBindingScope, fieldInterface?: string): string | undefined;
|
|
12
|
+
export declare function inferSharedFieldDefaultBindingUse(scope: FlowSurfaceFieldDefaultBindingScope, fieldInterface?: string): string;
|
|
@@ -0,0 +1,157 @@
|
|
|
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
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __export = (target, all) => {
|
|
15
|
+
for (var name in all)
|
|
16
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
+
};
|
|
18
|
+
var __copyProps = (to, from, except, desc) => {
|
|
19
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
+
for (let key of __getOwnPropNames(from))
|
|
21
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
+
}
|
|
24
|
+
return to;
|
|
25
|
+
};
|
|
26
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
+
var core_field_default_bindings_exports = {};
|
|
28
|
+
__export(core_field_default_bindings_exports, {
|
|
29
|
+
CORE_FIELD_DEFAULT_BINDING_MATRIX: () => CORE_FIELD_DEFAULT_BINDING_MATRIX,
|
|
30
|
+
getSharedFieldDefaultBindingUse: () => getSharedFieldDefaultBindingUse,
|
|
31
|
+
inferSharedFieldDefaultBindingUse: () => inferSharedFieldDefaultBindingUse
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(core_field_default_bindings_exports);
|
|
34
|
+
const CORE_FIELD_DEFAULT_BINDING_MATRIX = {
|
|
35
|
+
display: {
|
|
36
|
+
richText: "DisplayHtmlFieldModel",
|
|
37
|
+
number: "DisplayNumberFieldModel",
|
|
38
|
+
integer: "DisplayNumberFieldModel",
|
|
39
|
+
id: "DisplayNumberFieldModel",
|
|
40
|
+
snowflakeId: "DisplayNumberFieldModel",
|
|
41
|
+
json: "DisplayJSONFieldModel",
|
|
42
|
+
select: "DisplayEnumFieldModel",
|
|
43
|
+
multipleSelect: "DisplayEnumFieldModel",
|
|
44
|
+
radioGroup: "DisplayEnumFieldModel",
|
|
45
|
+
checkboxGroup: "DisplayEnumFieldModel",
|
|
46
|
+
collection: "DisplayEnumFieldModel",
|
|
47
|
+
tableoid: "DisplayEnumFieldModel",
|
|
48
|
+
icon: "DisplayIconFieldModel",
|
|
49
|
+
checkbox: "DisplayCheckboxFieldModel",
|
|
50
|
+
password: "DisplayPasswordFieldModel",
|
|
51
|
+
percent: "DisplayPercentFieldModel",
|
|
52
|
+
date: "DisplayDateTimeFieldModel",
|
|
53
|
+
datetimeNoTz: "DisplayDateTimeFieldModel",
|
|
54
|
+
createdAt: "DisplayDateTimeFieldModel",
|
|
55
|
+
datetime: "DisplayDateTimeFieldModel",
|
|
56
|
+
updatedAt: "DisplayDateTimeFieldModel",
|
|
57
|
+
unixTimestamp: "DisplayDateTimeFieldModel",
|
|
58
|
+
input: "DisplayTextFieldModel",
|
|
59
|
+
email: "DisplayTextFieldModel",
|
|
60
|
+
phone: "DisplayTextFieldModel",
|
|
61
|
+
uuid: "DisplayTextFieldModel",
|
|
62
|
+
textarea: "DisplayTextFieldModel",
|
|
63
|
+
nanoid: "DisplayTextFieldModel",
|
|
64
|
+
url: "DisplayURLFieldModel",
|
|
65
|
+
color: "DisplayColorFieldModel",
|
|
66
|
+
time: "DisplayTimeFieldModel"
|
|
67
|
+
},
|
|
68
|
+
editable: {
|
|
69
|
+
json: "JsonFieldModel",
|
|
70
|
+
textarea: "TextareaFieldModel",
|
|
71
|
+
icon: "IconFieldModel",
|
|
72
|
+
radioGroup: "RadioGroupFieldModel",
|
|
73
|
+
color: "ColorFieldModel",
|
|
74
|
+
select: "SelectFieldModel",
|
|
75
|
+
multipleSelect: "SelectFieldModel",
|
|
76
|
+
checkboxGroup: "CheckboxGroupFieldModel",
|
|
77
|
+
checkbox: "CheckboxFieldModel",
|
|
78
|
+
password: "PasswordFieldModel",
|
|
79
|
+
number: "NumberFieldModel",
|
|
80
|
+
integer: "NumberFieldModel",
|
|
81
|
+
id: "NumberFieldModel",
|
|
82
|
+
snowflakeId: "NumberFieldModel",
|
|
83
|
+
percent: "PercentFieldModel",
|
|
84
|
+
datetimeNoTz: "DateTimeNoTzFieldModel",
|
|
85
|
+
date: "DateOnlyFieldModel",
|
|
86
|
+
datetime: "DateTimeTzFieldModel",
|
|
87
|
+
createdAt: "DateTimeTzFieldModel",
|
|
88
|
+
updatedAt: "DateTimeTzFieldModel",
|
|
89
|
+
unixTimestamp: "DateTimeTzFieldModel",
|
|
90
|
+
time: "TimeFieldModel",
|
|
91
|
+
collection: "CollectionSelectorFieldModel",
|
|
92
|
+
tableoid: "CollectionSelectorFieldModel",
|
|
93
|
+
richText: "RichTextFieldModel",
|
|
94
|
+
input: "InputFieldModel",
|
|
95
|
+
email: "InputFieldModel",
|
|
96
|
+
phone: "InputFieldModel",
|
|
97
|
+
uuid: "InputFieldModel",
|
|
98
|
+
url: "InputFieldModel",
|
|
99
|
+
nanoid: "InputFieldModel"
|
|
100
|
+
},
|
|
101
|
+
filter: {
|
|
102
|
+
date: "DateOnlyFilterFieldModel",
|
|
103
|
+
datetimeNoTz: "DateTimeNoTzFilterFieldModel",
|
|
104
|
+
createdAt: "DateTimeTzFilterFieldModel",
|
|
105
|
+
datetime: "DateTimeTzFilterFieldModel",
|
|
106
|
+
updatedAt: "DateTimeTzFilterFieldModel",
|
|
107
|
+
unixTimestamp: "DateTimeTzFilterFieldModel",
|
|
108
|
+
select: "SelectFieldModel",
|
|
109
|
+
multipleSelect: "SelectFieldModel",
|
|
110
|
+
radioGroup: "SelectFieldModel",
|
|
111
|
+
checkboxGroup: "SelectFieldModel",
|
|
112
|
+
checkbox: "SelectFieldModel",
|
|
113
|
+
number: "NumberFieldModel",
|
|
114
|
+
integer: "NumberFieldModel",
|
|
115
|
+
id: "NumberFieldModel",
|
|
116
|
+
snowflakeId: "NumberFieldModel",
|
|
117
|
+
time: "TimeFieldModel",
|
|
118
|
+
percent: "PercentFieldModel",
|
|
119
|
+
input: "InputFieldModel",
|
|
120
|
+
email: "InputFieldModel",
|
|
121
|
+
phone: "InputFieldModel",
|
|
122
|
+
uuid: "InputFieldModel",
|
|
123
|
+
url: "InputFieldModel",
|
|
124
|
+
nanoid: "InputFieldModel"
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
const SUPPLEMENTAL_FIELD_DEFAULT_BINDING_MATRIX = {
|
|
128
|
+
display: {
|
|
129
|
+
formula: "DisplayDateTimeFieldModel"
|
|
130
|
+
},
|
|
131
|
+
editable: {},
|
|
132
|
+
filter: {}
|
|
133
|
+
};
|
|
134
|
+
const FIELD_DEFAULT_BINDING_FALLBACKS = {
|
|
135
|
+
display: "DisplayTextFieldModel",
|
|
136
|
+
editable: "InputFieldModel",
|
|
137
|
+
filter: "InputFieldModel"
|
|
138
|
+
};
|
|
139
|
+
function normalizeFieldInterface(fieldInterface) {
|
|
140
|
+
return String(fieldInterface || "").trim();
|
|
141
|
+
}
|
|
142
|
+
function getSharedFieldDefaultBindingUse(scope, fieldInterface) {
|
|
143
|
+
const normalized = normalizeFieldInterface(fieldInterface);
|
|
144
|
+
if (!normalized) {
|
|
145
|
+
return void 0;
|
|
146
|
+
}
|
|
147
|
+
return CORE_FIELD_DEFAULT_BINDING_MATRIX[scope][normalized] || SUPPLEMENTAL_FIELD_DEFAULT_BINDING_MATRIX[scope][normalized];
|
|
148
|
+
}
|
|
149
|
+
function inferSharedFieldDefaultBindingUse(scope, fieldInterface) {
|
|
150
|
+
return getSharedFieldDefaultBindingUse(scope, fieldInterface) || FIELD_DEFAULT_BINDING_FALLBACKS[scope];
|
|
151
|
+
}
|
|
152
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
153
|
+
0 && (module.exports = {
|
|
154
|
+
CORE_FIELD_DEFAULT_BINDING_MATRIX,
|
|
155
|
+
getSharedFieldDefaultBindingUse,
|
|
156
|
+
inferSharedFieldDefaultBindingUse
|
|
157
|
+
});
|
|
@@ -50,7 +50,7 @@ __export(default_action_popup_exports, {
|
|
|
50
50
|
});
|
|
51
51
|
module.exports = __toCommonJS(default_action_popup_exports);
|
|
52
52
|
var import_lodash = __toESM(require("lodash"));
|
|
53
|
-
var
|
|
53
|
+
var import_association_interfaces = require("./association-interfaces");
|
|
54
54
|
var import_service_helpers = require("./service-helpers");
|
|
55
55
|
const DEFAULT_ACTION_POPUP_SYSTEM_FIELD_NAMES = /* @__PURE__ */ new Set(["id", "createdBy", "createdById", "updatedBy", "updatedById"]);
|
|
56
56
|
const DEFAULT_ACTION_POPUP_SYSTEM_FIELD_INTERFACES = /* @__PURE__ */ new Set([
|
|
@@ -198,7 +198,7 @@ function isFlowSurfaceDefaultActionPopupAuditTimestampField(field) {
|
|
|
198
198
|
}
|
|
199
199
|
function isFlowSurfaceDefaultActionPopupMultiValueAssociationField(field) {
|
|
200
200
|
const fieldInterface = String((0, import_service_helpers.getFieldInterface)(field) || "").trim();
|
|
201
|
-
return
|
|
201
|
+
return import_association_interfaces.MULTI_VALUE_ASSOCIATION_INTERFACES.has(fieldInterface);
|
|
202
202
|
}
|
|
203
203
|
function isFlowSurfaceDefaultActionPopupAssociationField(field) {
|
|
204
204
|
const fieldType = String((0, import_service_helpers.getFieldType)(field) || "").trim();
|
|
@@ -81,6 +81,30 @@ const FLOW_SURFACE_DEFAULT_BLOCK_ACTIONS = {
|
|
|
81
81
|
},
|
|
82
82
|
{ type: "refresh", scope: "actions" }
|
|
83
83
|
],
|
|
84
|
+
calendar: [
|
|
85
|
+
{ type: "filter", scope: "actions" },
|
|
86
|
+
{
|
|
87
|
+
type: "addNew",
|
|
88
|
+
scope: "actions",
|
|
89
|
+
popup: {
|
|
90
|
+
tryTemplate: true,
|
|
91
|
+
[FLOW_SURFACE_INTERNAL_AUTO_SAVE_DEFAULT_POPUP_TEMPLATE_KEY]: true
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
{ type: "refresh", scope: "actions" }
|
|
95
|
+
],
|
|
96
|
+
kanban: [
|
|
97
|
+
{ type: "filter", scope: "actions" },
|
|
98
|
+
{
|
|
99
|
+
type: "addNew",
|
|
100
|
+
scope: "actions",
|
|
101
|
+
popup: {
|
|
102
|
+
tryTemplate: true,
|
|
103
|
+
[FLOW_SURFACE_INTERNAL_AUTO_SAVE_DEFAULT_POPUP_TEMPLATE_KEY]: true
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
{ type: "refresh", scope: "actions" }
|
|
107
|
+
],
|
|
84
108
|
createForm: [{ type: "submit", scope: "actions" }],
|
|
85
109
|
editForm: [{ type: "submit", scope: "actions" }],
|
|
86
110
|
details: [
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
+
export { MULTI_VALUE_ASSOCIATION_INTERFACES, SINGLE_VALUE_ASSOCIATION_INTERFACES } from './association-interfaces';
|
|
9
10
|
export type FlowSurfaceFieldBindingScope = 'display' | 'editable' | 'filter';
|
|
10
11
|
export type FlowSurfaceFieldBindingResolution = {
|
|
11
12
|
modelClassName: string;
|
|
@@ -26,12 +26,15 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
26
26
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
27
|
var field_binding_registry_exports = {};
|
|
28
28
|
__export(field_binding_registry_exports, {
|
|
29
|
+
MULTI_VALUE_ASSOCIATION_INTERFACES: () => import_association_interfaces2.MULTI_VALUE_ASSOCIATION_INTERFACES,
|
|
30
|
+
SINGLE_VALUE_ASSOCIATION_INTERFACES: () => import_association_interfaces2.SINGLE_VALUE_ASSOCIATION_INTERFACES,
|
|
29
31
|
getRegisteredFieldUses: () => getRegisteredFieldUses,
|
|
30
32
|
resolveRegisteredFieldBinding: () => resolveRegisteredFieldBinding
|
|
31
33
|
});
|
|
32
34
|
module.exports = __toCommonJS(field_binding_registry_exports);
|
|
33
35
|
var import_field_semantics = require("./field-semantics");
|
|
34
36
|
var import_service_helpers = require("./service-helpers");
|
|
37
|
+
var import_association_interfaces2 = require("./association-interfaces");
|
|
35
38
|
const FILE_MANAGER_PLUGIN = "@nocobase/plugin-file-manager";
|
|
36
39
|
const ATTACHMENT_URL_PLUGIN = "@nocobase/plugin-field-attachment-url";
|
|
37
40
|
const CODE_PLUGIN = "@nocobase/plugin-field-code";
|
|
@@ -386,6 +389,8 @@ function resolveRegisteredFieldBinding(input) {
|
|
|
386
389
|
}
|
|
387
390
|
// Annotate the CommonJS export names for ESM import in node:
|
|
388
391
|
0 && (module.exports = {
|
|
392
|
+
MULTI_VALUE_ASSOCIATION_INTERFACES,
|
|
393
|
+
SINGLE_VALUE_ASSOCIATION_INTERFACES,
|
|
389
394
|
getRegisteredFieldUses,
|
|
390
395
|
resolveRegisteredFieldBinding
|
|
391
396
|
});
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export { MULTI_VALUE_ASSOCIATION_INTERFACES } from './association-interfaces';
|
|
10
10
|
export declare function normalizeFieldContainerKind(containerUse?: string): "form" | "details" | "table" | "filter-form";
|
|
11
11
|
export declare function shouldUseAssociationTitleTextDisplay(input: {
|
|
12
12
|
containerUse?: string;
|
|
@@ -26,12 +26,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
26
26
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
27
|
var field_semantics_exports = {};
|
|
28
28
|
__export(field_semantics_exports, {
|
|
29
|
-
MULTI_VALUE_ASSOCIATION_INTERFACES: () => MULTI_VALUE_ASSOCIATION_INTERFACES,
|
|
29
|
+
MULTI_VALUE_ASSOCIATION_INTERFACES: () => import_association_interfaces2.MULTI_VALUE_ASSOCIATION_INTERFACES,
|
|
30
30
|
normalizeFieldContainerKind: () => normalizeFieldContainerKind,
|
|
31
31
|
shouldUseAssociationTitleTextDisplay: () => shouldUseAssociationTitleTextDisplay
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(field_semantics_exports);
|
|
34
34
|
var import_approval = require("./approval");
|
|
35
|
+
var import_association_interfaces = require("./association-interfaces");
|
|
36
|
+
var import_association_interfaces2 = require("./association-interfaces");
|
|
35
37
|
const FORM_FIELD_CONTAINER_USES = /* @__PURE__ */ new Set([
|
|
36
38
|
"FormBlockModel",
|
|
37
39
|
"CreateFormModel",
|
|
@@ -47,12 +49,13 @@ const DETAILS_FIELD_CONTAINER_USES = /* @__PURE__ */ new Set([
|
|
|
47
49
|
"DetailsItemModel",
|
|
48
50
|
"ListBlockModel",
|
|
49
51
|
"GridCardBlockModel",
|
|
52
|
+
"KanbanBlockModel",
|
|
50
53
|
"ListItemModel",
|
|
51
|
-
"GridCardItemModel"
|
|
54
|
+
"GridCardItemModel",
|
|
55
|
+
"KanbanCardItemModel"
|
|
52
56
|
]);
|
|
53
57
|
const FILTER_FIELD_CONTAINER_USES = /* @__PURE__ */ new Set(["FilterFormBlockModel", "FilterFormGridModel", "FilterFormItemModel"]);
|
|
54
58
|
const TABLE_FIELD_CONTAINER_USES = /* @__PURE__ */ new Set(["TableBlockModel", "TableColumnModel"]);
|
|
55
|
-
const MULTI_VALUE_ASSOCIATION_INTERFACES = /* @__PURE__ */ new Set(["m2m", "o2m", "mbm"]);
|
|
56
59
|
function normalizeFieldContainerKind(containerUse) {
|
|
57
60
|
const normalized = (0, import_approval.normalizeApprovalSemanticUse)(containerUse);
|
|
58
61
|
if (FORM_FIELD_CONTAINER_USES.has(normalized)) {
|
|
@@ -71,7 +74,7 @@ function normalizeFieldContainerKind(containerUse) {
|
|
|
71
74
|
}
|
|
72
75
|
function shouldUseAssociationTitleTextDisplay(input) {
|
|
73
76
|
const containerKind = normalizeFieldContainerKind(input.containerUse);
|
|
74
|
-
return (containerKind === "table" || containerKind === "details") && !String(input.associationPathName || "").trim() && MULTI_VALUE_ASSOCIATION_INTERFACES.has(String(input.fieldInterface || "").trim());
|
|
77
|
+
return (containerKind === "table" || containerKind === "details") && !String(input.associationPathName || "").trim() && import_association_interfaces.MULTI_VALUE_ASSOCIATION_INTERFACES.has(String(input.fieldInterface || "").trim());
|
|
75
78
|
}
|
|
76
79
|
// Annotate the CommonJS export names for ESM import in node:
|
|
77
80
|
0 && (module.exports = {
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
export declare const FLOW_SURFACE_PUBLIC_RELATION_FIELD_TYPES: readonly ["text", "select", "picker", "subForm", "subFormList", "subDetails", "subDetailsList", "subTable", "popupSubTable"];
|
|
10
|
+
export type FlowSurfacePublicRelationFieldType = (typeof FLOW_SURFACE_PUBLIC_RELATION_FIELD_TYPES)[number];
|
|
11
|
+
export declare const FLOW_SURFACE_RESERVED_RELATION_FIELD_TYPES: readonly ["cascade", "upload", "preview"];
|
|
12
|
+
export declare const FLOW_SURFACE_PUBLIC_FIELD_TYPE_SET: Set<string>;
|
|
13
|
+
export declare const FLOW_SURFACE_INTERNAL_FIELD_KEYS: string[];
|
|
14
|
+
export declare function assertNoInternalFieldKeys(input: Record<string, any> | undefined, context: string): void;
|
|
15
|
+
export declare function normalizePublicFieldType(value: any, context: string): FlowSurfacePublicRelationFieldType | undefined;
|
|
16
|
+
export declare function normalizePublicFieldNameList(value: any, context: string): string[] | undefined;
|
|
17
|
+
export declare function getPublicFieldTypeForUse(use?: string): FlowSurfacePublicRelationFieldType | undefined;
|
|
18
|
+
export declare function resolveRelationFieldType(input: {
|
|
19
|
+
fieldType: any;
|
|
20
|
+
containerUse: string;
|
|
21
|
+
field: any;
|
|
22
|
+
dataSourceKey: string;
|
|
23
|
+
getCollection: (dataSourceKey: string, collectionName: string) => any;
|
|
24
|
+
fields?: any;
|
|
25
|
+
selectorFields?: any;
|
|
26
|
+
titleField?: any;
|
|
27
|
+
openMode?: any;
|
|
28
|
+
popupSize?: any;
|
|
29
|
+
pageSize?: any;
|
|
30
|
+
showIndex?: any;
|
|
31
|
+
applyDefaults?: boolean;
|
|
32
|
+
context: string;
|
|
33
|
+
}): {
|
|
34
|
+
fieldType: "select" | "subForm" | "text" | "picker" | "subFormList" | "subDetails" | "subDetailsList" | "subTable" | "popupSubTable";
|
|
35
|
+
fieldUse: string;
|
|
36
|
+
cardinality: "single" | "multi";
|
|
37
|
+
targetCollection: any;
|
|
38
|
+
fields: any[];
|
|
39
|
+
selectorFields: any[];
|
|
40
|
+
titleField: any;
|
|
41
|
+
openMode: any;
|
|
42
|
+
popupSize: any;
|
|
43
|
+
pageSize: any;
|
|
44
|
+
showIndex: any;
|
|
45
|
+
};
|
|
46
|
+
export declare function usesNestedRelationFields(fieldUse?: string): boolean;
|