forked from alibaba/lowcode-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfield-config.ts
More file actions
106 lines (104 loc) · 2.28 KB
/
field-config.ts
File metadata and controls
106 lines (104 loc) · 2.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import { TitleContent } from './title';
import { SetterType, DynamicSetter } from './setter-config';
import { SettingTarget } from './setting-target';
import { LiveTextEditingConfig } from './metadata';
/**
* extra props for field
*/
export interface FieldExtraProps {
/**
* 是否必填参数
*/
isRequired?: boolean;
/**
* default value of target prop for setter use
*/
defaultValue?: any;
/**
* get value for field
*/
getValue?: (target: SettingTarget, fieldValue: any) => any;
/**
* set value for field
*/
setValue?: (target: SettingTarget, value: any) => void;
/**
* the field conditional show, is not set always true
* @default undefined
*/
condition?: (target: SettingTarget) => boolean;
/**
* autorun when something change
*/
autorun?: (target: SettingTarget) => void;
/**
* is this field is a virtual field that not save to schema
*/
virtual?: (target: SettingTarget) => boolean;
/**
* default collapsed when display accordion
*/
defaultCollapsed?: boolean;
/**
* important field
*/
important?: boolean;
/**
* internal use
*/
forceInline?: number;
/**
* 是否支持变量配置
*/
supportVariable?: boolean;
/**
* compatiable vision display
*/
display?: 'accordion' | 'inline' | 'block' | 'plain' | 'popup' | 'entry';
// @todo 这个 omit 是否合理?
/**
* @todo 待补充文档
*/
liveTextEditing?: Omit<LiveTextEditingConfig, 'propTarget'>;
}
/**
* 属性面板配置
*/
export interface FieldConfig extends FieldExtraProps {
/**
* 面板配置隶属于单个 field 还是分组
*/
type?: 'field' | 'group';
/**
* the name of this setting field, which used in quickEditor
*/
name: string | number;
/**
* the field title
* @default sameas .name
*/
title?: TitleContent;
/**
* 单个属性的 setter 配置
*
* the field body contains when .type = 'field'
*/
setter?: SetterType | DynamicSetter;
/**
* the setting items which group body contains when .type = 'group'
*/
items?: FieldConfig[];
/**
* extra props for field
* 其他配置属性(不做流通要求)
*/
extraProps?: FieldExtraProps;
/**
* @deprecated
*/
description?: TitleContent;
/**
* @deprecated
*/
isExtends?: boolean;
}