amis-editor 4.2.0-beta.2 → 5.1.9
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/6dbcbb49b6fd405190a9.png +0 -0
- package/dist/component/Control/APIControl.d.ts +1101 -447
- package/dist/component/Control/ActionAPIControl.d.ts +1158 -0
- package/dist/component/Control/BadgeControl.d.ts +133 -0
- package/dist/component/Control/BaseControl.d.ts +248 -0
- package/dist/component/Control/DataBindingControl.d.ts +14 -0
- package/dist/component/Control/DataPickerControl.d.ts +13 -0
- package/dist/component/Control/DateShortCutControl.d.ts +83 -0
- package/dist/component/Control/FormulaControl.d.ts +51 -0
- package/dist/component/Control/OptionControl.d.ts +23 -34
- package/dist/component/Control/StatusControl.d.ts +39 -0
- package/dist/component/Control/SwitchMoreControl.d.ts +224 -0
- package/dist/component/Control/ValidationControl.d.ts +50 -15
- package/dist/component/Control/ValidationItem.d.ts +46 -0
- package/dist/component/Control/style-control/Background.d.ts +17 -0
- package/dist/component/Control/style-control/Border.d.ts +18 -0
- package/dist/component/Control/style-control/BoxModel.d.ts +17 -0
- package/dist/component/Control/style-control/BoxShadow.d.ts +18 -0
- package/dist/component/Control/style-control/Display.d.ts +14 -0
- package/dist/component/Control/style-control/Font.d.ts +16 -0
- package/dist/component/Control/style-control/font-family.d.ts +11 -0
- package/dist/component/Control/style-control/transformation.d.ts +29 -0
- package/dist/component/Control/style-control/types.d.ts +8 -0
- package/dist/component/Editor.d.ts +16 -0
- package/dist/component/RegionWrapper.d.ts +10 -0
- package/dist/component/VRenderer.d.ts +10 -0
- package/dist/component/schemaTpl.d.ts +8 -0
- package/dist/component/validator.d.ts +62 -0
- package/dist/dnd/index.d.ts +1 -1
- package/dist/event-action/action-config-panel.d.ts +8 -0
- package/dist/event-action/actions.d.ts +3 -0
- package/dist/event-action/comp-action-select.d.ts +11 -0
- package/dist/event-action/config.d.ts +13 -0
- package/dist/event-action/index.d.ts +459 -0
- package/dist/event-action/schema.d.ts +32 -0
- package/dist/exports.min.js +1 -1
- package/dist/index.d.ts +23 -5
- package/dist/index.min.js +1 -1
- package/dist/manager.d.ts +46 -1
- package/dist/plugin/Alert.d.ts +4 -2
- package/dist/plugin/Button.d.ts +5 -1
- package/dist/plugin/ButtonGroup.d.ts +13 -34
- package/dist/plugin/ButtonToolbar.d.ts +4 -10
- package/dist/plugin/CRUD.d.ts +2 -0
- package/dist/plugin/Chart.d.ts +2 -0
- package/dist/plugin/Collapse.d.ts +1 -0
- package/dist/plugin/CollapseGroup.d.ts +28 -4
- package/dist/plugin/Container.d.ts +2 -1
- package/dist/plugin/Dialog.d.ts +12 -2
- package/dist/plugin/Drawer.d.ts +12 -2
- package/dist/plugin/DropDownButton.d.ts +11 -11
- package/dist/plugin/Form/ButtonGroupSelect.d.ts +7 -2
- package/dist/plugin/Form/ButtonToolbar.d.ts +8 -7
- package/dist/plugin/Form/ChainedSelect.d.ts +3 -0
- package/dist/plugin/Form/Checkbox.d.ts +7 -2
- package/dist/plugin/Form/Checkboxes.d.ts +8 -2
- package/dist/plugin/Form/CodeEditor.d.ts +7 -22
- package/dist/plugin/Form/Combo.d.ts +3 -0
- package/dist/plugin/Form/Control.d.ts +6 -2
- package/dist/plugin/Form/DiffEditor.d.ts +7 -1
- package/dist/plugin/Form/Form.d.ts +6 -0
- package/dist/plugin/Form/Formula.d.ts +1 -25
- package/dist/plugin/Form/InputDate.d.ts +8 -2
- package/dist/plugin/Form/InputDateRange.d.ts +8 -2
- package/dist/plugin/Form/InputDateTime.d.ts +4 -4
- package/dist/plugin/Form/InputDateTimeRange.d.ts +4 -4
- package/dist/plugin/Form/InputEmail.d.ts +1 -0
- package/dist/plugin/Form/InputExcel.d.ts +6 -41
- package/dist/plugin/Form/InputFile.d.ts +7 -3
- package/dist/plugin/Form/InputKV.d.ts +6 -0
- package/dist/plugin/Form/InputMonth.d.ts +1 -0
- package/dist/plugin/Form/InputMonthRange.d.ts +4 -4
- package/dist/plugin/Form/InputPassword.d.ts +1 -0
- package/dist/plugin/Form/InputQuarter.d.ts +1 -0
- package/dist/plugin/Form/InputQuarterRange.d.ts +4 -4
- package/dist/plugin/Form/InputRange.d.ts +3 -0
- package/dist/plugin/Form/InputRating.d.ts +9 -3
- package/dist/plugin/Form/InputText.d.ts +24 -2
- package/dist/plugin/Form/InputTime.d.ts +3 -3
- package/dist/plugin/Form/InputTimeRange.d.ts +20 -0
- package/dist/plugin/Form/InputTree.d.ts +6 -2
- package/dist/plugin/Form/InputURL.d.ts +1 -0
- package/dist/plugin/Form/InputYear.d.ts +1 -0
- package/dist/plugin/Form/InputYearRange.d.ts +20 -0
- package/dist/plugin/Form/ListSelect.d.ts +6 -2
- package/dist/plugin/Form/LocationPicker.d.ts +1 -31
- package/dist/plugin/Form/NestedSelect.d.ts +5 -2
- package/dist/plugin/Form/Radios.d.ts +7 -2
- package/dist/plugin/Form/Select.d.ts +7 -2
- package/dist/plugin/Form/Switch.d.ts +7 -2
- package/dist/plugin/Form/TabsTransfer.d.ts +5 -2
- package/dist/plugin/Form/Textarea.d.ts +7 -1
- package/dist/plugin/Form/Transfer.d.ts +5 -2
- package/dist/plugin/Form/TreeSelect.d.ts +6 -2
- package/dist/plugin/IFrame.d.ts +2 -2
- package/dist/plugin/Nav.d.ts +1 -116
- package/dist/plugin/Others/Action.d.ts +5 -1
- package/dist/plugin/Page.d.ts +5 -2
- package/dist/plugin/Progress.d.ts +5 -1
- package/dist/plugin/Table.d.ts +2 -0
- package/dist/plugin/Tabs.d.ts +33 -2
- package/dist/plugin/TooltipWrapper.d.ts +10 -0
- package/dist/plugin/Tpl.d.ts +2 -1
- package/dist/plugin/Wizard.d.ts +4 -1
- package/dist/plugin.d.ts +37 -1
- package/dist/store/editor.d.ts +65 -38
- package/dist/store/node.d.ts +16 -0
- package/dist/style.css +1 -1
- package/dist/util.d.ts +36 -3
- package/package.json +14 -8
- package/src/component/schemaTpl.tsx +1198 -474
- package/src/plugin/.DS_Store +0 -0
- package/src/plugin/Alert.tsx +69 -48
- package/src/plugin/AnchorNav.tsx +1 -0
- package/src/plugin/Audio.tsx +9 -15
- package/src/plugin/Avatar.tsx +2 -1
- package/src/plugin/Breadcrumb.tsx +2 -1
- package/src/plugin/Button.tsx +257 -188
- package/src/plugin/ButtonGroup.tsx +99 -38
- package/src/plugin/ButtonToolbar.tsx +7 -13
- package/src/plugin/CRUD.tsx +77 -135
- package/src/plugin/Card.tsx +1 -0
- package/src/plugin/Cards.tsx +8 -14
- package/src/plugin/Carousel.tsx +1 -1
- package/src/plugin/Chart.tsx +26 -14
- package/src/plugin/Collapse.tsx +78 -78
- package/src/plugin/CollapseGroup.tsx +165 -83
- package/src/plugin/Container.tsx +59 -6
- package/src/plugin/Custom.tsx +2 -8
- package/src/plugin/CustomRegion.tsx +4 -3
- package/src/plugin/Dialog.tsx +55 -24
- package/src/plugin/Drawer.tsx +65 -35
- package/src/plugin/DropDownButton.tsx +95 -79
- package/src/plugin/Flex.tsx +123 -65
- package/src/plugin/Form/ButtonGroupSelect.tsx +114 -26
- package/src/plugin/Form/ButtonToolbar.tsx +62 -55
- package/src/plugin/Form/ChainedSelect.tsx +45 -0
- package/src/plugin/Form/Checkbox.tsx +122 -33
- package/src/plugin/Form/Checkboxes.tsx +154 -87
- package/src/plugin/Form/CodeEditor.tsx +163 -34
- package/src/plugin/Form/Combo.tsx +104 -65
- package/src/plugin/Form/Control.tsx +16 -70
- package/src/plugin/Form/DiffEditor.tsx +158 -54
- package/src/plugin/Form/FieldSet.tsx +6 -11
- package/src/plugin/Form/Form.tsx +277 -70
- package/src/plugin/Form/Formula.tsx +8 -14
- package/src/plugin/Form/InputArray.tsx +7 -16
- package/src/plugin/Form/InputCity.tsx +1 -1
- package/src/plugin/Form/InputDate.tsx +344 -121
- package/src/plugin/Form/InputDateRange.tsx +303 -161
- package/src/plugin/Form/InputDateTime.tsx +6 -150
- package/src/plugin/Form/InputDateTimeRange.tsx +7 -187
- package/src/plugin/Form/InputEmail.tsx +1 -0
- package/src/plugin/Form/InputExcel.tsx +70 -27
- package/src/plugin/Form/InputFile.tsx +326 -152
- package/src/plugin/Form/InputImage.tsx +1 -1
- package/src/plugin/Form/InputKV.tsx +61 -0
- package/src/plugin/Form/InputMonth.tsx +3 -1
- package/src/plugin/Form/InputMonthRange.tsx +6 -160
- package/src/plugin/Form/InputNumber.tsx +1 -1
- package/src/plugin/Form/InputPassword.tsx +2 -0
- package/src/plugin/Form/InputQuarter.tsx +3 -1
- package/src/plugin/Form/InputQuarterRange.tsx +6 -160
- package/src/plugin/Form/InputRange.tsx +74 -4
- package/src/plugin/Form/InputRating.tsx +347 -35
- package/src/plugin/Form/InputRichText.tsx +2 -3
- package/src/plugin/Form/InputTable.tsx +33 -49
- package/src/plugin/Form/InputTag.tsx +1 -1
- package/src/plugin/Form/InputText.tsx +310 -132
- package/src/plugin/Form/InputTime.tsx +4 -53
- package/src/plugin/Form/InputTimeRange.tsx +41 -0
- package/src/plugin/Form/InputTree.tsx +196 -46
- package/src/plugin/Form/InputURL.tsx +2 -0
- package/src/plugin/Form/InputYear.tsx +2 -0
- package/src/plugin/Form/InputYearRange.tsx +41 -0
- package/src/plugin/Form/Item.tsx +17 -18
- package/src/plugin/Form/ListSelect.tsx +75 -20
- package/src/plugin/Form/LocationPicker.tsx +2 -7
- package/src/plugin/Form/MatrixCheckboxes.tsx +1 -1
- package/src/plugin/Form/NestedSelect.tsx +110 -43
- package/src/plugin/Form/Picker.tsx +2 -5
- package/src/plugin/Form/Radios.tsx +122 -52
- package/src/plugin/Form/Select.tsx +239 -168
- package/src/plugin/Form/Static.tsx +1 -1
- package/src/plugin/Form/Switch.tsx +170 -58
- package/src/plugin/Form/TabsTransfer.tsx +175 -79
- package/src/plugin/Form/Textarea.tsx +146 -36
- package/src/plugin/Form/Transfer.tsx +295 -233
- package/src/plugin/Form/TreeSelect.tsx +287 -146
- package/src/plugin/Grid.tsx +340 -312
- package/src/plugin/HBox.tsx +1 -0
- package/src/plugin/IFrame.tsx +21 -12
- package/src/plugin/Image.tsx +7 -12
- package/src/plugin/Images.tsx +7 -12
- package/src/plugin/Link.tsx +6 -12
- package/src/plugin/List.tsx +6 -10
- package/src/plugin/ListItem.tsx +1 -0
- package/src/plugin/Nav.tsx +7 -9
- package/src/plugin/Others/Action.tsx +16 -10
- package/src/plugin/Others/BasicToolbar.tsx +4 -1
- package/src/plugin/Others/TableCell.tsx +19 -39
- package/src/plugin/Page.tsx +315 -229
- package/src/plugin/Panel.tsx +6 -7
- package/src/plugin/Plain.tsx +3 -6
- package/src/plugin/Progress.tsx +234 -94
- package/src/plugin/Service.tsx +10 -6
- package/src/plugin/Table.tsx +49 -20
- package/src/plugin/TableView.tsx +212 -106
- package/src/plugin/Tabs.tsx +306 -146
- package/src/plugin/TooltipWrapper.tsx +231 -135
- package/src/plugin/Tpl.tsx +68 -52
- package/src/plugin/Video.tsx +9 -20
- package/src/plugin/Wizard.tsx +537 -336
- package/src/plugin/Wrapper.tsx +82 -61
- package/src/plugin.ts +66 -4
- package/static/empty.png +0 -0
@@ -0,0 +1,39 @@
|
|
1
|
+
/**
|
2
|
+
* @file 状态配置组件
|
3
|
+
*/
|
4
|
+
import React from 'react';
|
5
|
+
import { Option } from 'amis';
|
6
|
+
import type { FormControlProps } from 'amis-core';
|
7
|
+
import type { SchemaCollection } from 'amis/lib/Schema';
|
8
|
+
import type { FormSchema } from 'amis/lib/schema';
|
9
|
+
export interface StatusControlProps extends FormControlProps {
|
10
|
+
name: string;
|
11
|
+
expressioName: string;
|
12
|
+
trueValue?: boolean;
|
13
|
+
falseValue?: boolean;
|
14
|
+
options?: Option[];
|
15
|
+
children?: SchemaCollection;
|
16
|
+
messages?: Pick<FormSchema, 'messages'>;
|
17
|
+
}
|
18
|
+
interface StatusControlState {
|
19
|
+
checked: boolean;
|
20
|
+
}
|
21
|
+
export declare class StatusControl extends React.Component<StatusControlProps, StatusControlState> {
|
22
|
+
static defaultProps: {
|
23
|
+
trueValue: boolean;
|
24
|
+
falseValue: boolean;
|
25
|
+
};
|
26
|
+
constructor(props: StatusControlProps);
|
27
|
+
initState(): {
|
28
|
+
checked: boolean;
|
29
|
+
};
|
30
|
+
shouldComponentUpdate(nextProps: StatusControlProps, nextState: StatusControlState): boolean;
|
31
|
+
handleSwitch(value: boolean): void;
|
32
|
+
handleSubmit(values: any): void;
|
33
|
+
handleSelect(value: true | ''): void;
|
34
|
+
render(): JSX.Element;
|
35
|
+
renderContent(): JSX.Element;
|
36
|
+
}
|
37
|
+
export declare class StatusControlRenderer extends StatusControl {
|
38
|
+
}
|
39
|
+
export {};
|
@@ -0,0 +1,224 @@
|
|
1
|
+
/**
|
2
|
+
* @file 开关 + 更多编辑组合控件
|
3
|
+
* 使用时需关注所有的配置项是一个object还是整个data中,可使用bulk来区分
|
4
|
+
*
|
5
|
+
*/
|
6
|
+
import React from 'react';
|
7
|
+
import type { Action } from 'amis/lib/types';
|
8
|
+
import type { SchemaCollection } from 'amis/lib/Schema';
|
9
|
+
import type { IScopedContext } from 'amis-core';
|
10
|
+
import type { FormSchema } from 'amis/lib/schema';
|
11
|
+
import type { FormControlProps } from 'amis-core';
|
12
|
+
export interface SwitchMoreProps extends FormControlProps {
|
13
|
+
className?: string;
|
14
|
+
form?: Omit<FormSchema, 'type'>;
|
15
|
+
formType: 'extend' | 'dialog' | 'pop';
|
16
|
+
body?: SchemaCollection;
|
17
|
+
rootClose?: boolean;
|
18
|
+
autoFocus?: boolean;
|
19
|
+
overlay?: boolean;
|
20
|
+
container?: React.ReactNode | Function;
|
21
|
+
target?: React.ReactNode | Function;
|
22
|
+
trueValue?: any;
|
23
|
+
falseValue?: any;
|
24
|
+
removable?: boolean;
|
25
|
+
hiddenOnDefault?: boolean;
|
26
|
+
bulk?: boolean;
|
27
|
+
onRemove?: (e: React.UIEvent<any> | void) => void;
|
28
|
+
onClose: (e: React.UIEvent<any> | void) => void;
|
29
|
+
defaultData?: any;
|
30
|
+
}
|
31
|
+
interface SwitchMoreState {
|
32
|
+
/**
|
33
|
+
* 是否展示更多编辑内容
|
34
|
+
*/
|
35
|
+
show: boolean;
|
36
|
+
/**
|
37
|
+
* 是否开启编辑
|
38
|
+
*/
|
39
|
+
checked: boolean;
|
40
|
+
}
|
41
|
+
export default class SwitchMore extends React.Component<SwitchMoreProps, SwitchMoreState> {
|
42
|
+
static defaultProps: Pick<SwitchMoreProps, 'container' | 'autoFocus' | 'overlay' | 'rootClose' | 'trueValue' | 'falseValue' | 'formType' | 'bulk'>;
|
43
|
+
overlay: HTMLElement | null;
|
44
|
+
formNames: null | Array<string>;
|
45
|
+
constructor(props: SwitchMoreProps);
|
46
|
+
initState(): {
|
47
|
+
checked: boolean;
|
48
|
+
show: boolean;
|
49
|
+
};
|
50
|
+
getFormItemNames(): any[];
|
51
|
+
overlayRef(ref: any): void;
|
52
|
+
openPopover(): void;
|
53
|
+
toogleExtend(): void;
|
54
|
+
closePopover(): void;
|
55
|
+
handleDelete(e: React.UIEvent<any> | void): void;
|
56
|
+
handleSwitchChange(checked: boolean): void;
|
57
|
+
handleSubmit(values: any): void;
|
58
|
+
handleAction(e: React.UIEvent<any> | void, action: Action, data: object, throwErrors?: boolean, delegate?: IScopedContext): void;
|
59
|
+
renderActions(): JSX.Element[] | null;
|
60
|
+
renderPopover(): JSX.Element;
|
61
|
+
renderExtend(): JSX.Element | null;
|
62
|
+
renderDialogMore(): {
|
63
|
+
type: string;
|
64
|
+
btnLabel: string;
|
65
|
+
className: string;
|
66
|
+
itemClassName: string;
|
67
|
+
icon: string;
|
68
|
+
form: {
|
69
|
+
className?: import("amis").SchemaClassName | undefined;
|
70
|
+
id?: string | undefined;
|
71
|
+
data: any;
|
72
|
+
onEvent?: {
|
73
|
+
[propName: string]: {
|
74
|
+
weight?: number | undefined;
|
75
|
+
actions: import("amis").ListenerAction[];
|
76
|
+
};
|
77
|
+
} | undefined;
|
78
|
+
name?: string | undefined;
|
79
|
+
persistData?: string | undefined;
|
80
|
+
rules?: {
|
81
|
+
rule: string;
|
82
|
+
message: string;
|
83
|
+
name?: string | string[] | undefined;
|
84
|
+
}[] | undefined;
|
85
|
+
messages?: {
|
86
|
+
validateFailed?: string | undefined;
|
87
|
+
} | undefined;
|
88
|
+
horizontal: import("amis").FormHorizontal;
|
89
|
+
labelAlign?: import("amis-core/lib/renderers/Item").LabelAlign | undefined;
|
90
|
+
labelWidth?: string | number | undefined;
|
91
|
+
disabled?: boolean | undefined;
|
92
|
+
api?: string | import("amis").BaseApiObject | undefined;
|
93
|
+
visible?: boolean | undefined;
|
94
|
+
hidden?: boolean | undefined;
|
95
|
+
body?: SchemaCollection | undefined;
|
96
|
+
title: any;
|
97
|
+
initFetchOn?: string | undefined;
|
98
|
+
initFetch?: boolean | undefined;
|
99
|
+
submitOnChange: boolean;
|
100
|
+
mode: string;
|
101
|
+
$ref?: string | undefined;
|
102
|
+
disabledOn?: string | undefined;
|
103
|
+
hiddenOn?: string | undefined;
|
104
|
+
visibleOn?: string | undefined;
|
105
|
+
wrapWithPanel: boolean;
|
106
|
+
actions?: import("amis/lib/renderers/Action").ActionSchema[] | undefined;
|
107
|
+
reload?: string | undefined;
|
108
|
+
tabs?: any;
|
109
|
+
interval?: number | undefined;
|
110
|
+
silentPolling?: boolean | undefined;
|
111
|
+
stopAutoRefreshWhen?: string | undefined;
|
112
|
+
fieldSet?: any;
|
113
|
+
panelClassName: import("amis").ClassName;
|
114
|
+
preventEnterSubmit: boolean;
|
115
|
+
debug?: boolean | undefined;
|
116
|
+
initApi?: string | import("amis").BaseApiObject | undefined;
|
117
|
+
initAsyncApi?: string | import("amis").BaseApiObject | undefined;
|
118
|
+
initFinishedField?: string | undefined;
|
119
|
+
initCheckInterval?: number | undefined;
|
120
|
+
clearPersistDataAfterSubmit?: boolean | undefined;
|
121
|
+
feedback?: any;
|
122
|
+
asyncApi?: string | import("amis").BaseApiObject | undefined;
|
123
|
+
checkInterval?: number | undefined;
|
124
|
+
finishedField?: string | undefined;
|
125
|
+
resetAfterSubmit?: boolean | undefined;
|
126
|
+
clearAfterSubmit?: boolean | undefined;
|
127
|
+
columnCount?: number | undefined;
|
128
|
+
autoFocus: boolean | undefined;
|
129
|
+
primaryField?: string | undefined;
|
130
|
+
redirect?: string | undefined;
|
131
|
+
submitOnInit?: boolean | undefined;
|
132
|
+
submitText?: string | undefined;
|
133
|
+
target?: string | undefined;
|
134
|
+
affixFooter?: boolean | undefined;
|
135
|
+
promptPageLeave?: boolean | undefined;
|
136
|
+
promptPageLeaveMessage?: string | undefined;
|
137
|
+
type: string;
|
138
|
+
bodyClassName: string;
|
139
|
+
actionsClassName: string;
|
140
|
+
wrapperComponent: string;
|
141
|
+
formLazyChange: boolean;
|
142
|
+
};
|
143
|
+
};
|
144
|
+
renderForm(): {
|
145
|
+
className?: import("amis").SchemaClassName | undefined;
|
146
|
+
id?: string | undefined;
|
147
|
+
data: any;
|
148
|
+
onEvent?: {
|
149
|
+
[propName: string]: {
|
150
|
+
weight?: number | undefined;
|
151
|
+
actions: import("amis").ListenerAction[];
|
152
|
+
};
|
153
|
+
} | undefined;
|
154
|
+
name?: string | undefined;
|
155
|
+
persistData?: string | undefined;
|
156
|
+
rules?: {
|
157
|
+
rule: string;
|
158
|
+
message: string;
|
159
|
+
name?: string | string[] | undefined;
|
160
|
+
}[] | undefined;
|
161
|
+
messages?: {
|
162
|
+
validateFailed?: string | undefined;
|
163
|
+
} | undefined;
|
164
|
+
horizontal: import("amis").FormHorizontal;
|
165
|
+
labelAlign?: import("amis-core/lib/renderers/Item").LabelAlign | undefined;
|
166
|
+
labelWidth?: string | number | undefined;
|
167
|
+
disabled?: boolean | undefined;
|
168
|
+
api?: string | import("amis").BaseApiObject | undefined;
|
169
|
+
visible?: boolean | undefined;
|
170
|
+
hidden?: boolean | undefined;
|
171
|
+
body?: SchemaCollection | undefined;
|
172
|
+
title?: string | undefined;
|
173
|
+
initFetchOn?: string | undefined;
|
174
|
+
initFetch?: boolean | undefined;
|
175
|
+
submitOnChange: boolean;
|
176
|
+
mode: string;
|
177
|
+
$ref?: string | undefined;
|
178
|
+
disabledOn?: string | undefined;
|
179
|
+
hiddenOn?: string | undefined;
|
180
|
+
visibleOn?: string | undefined;
|
181
|
+
wrapWithPanel: boolean;
|
182
|
+
actions?: import("amis/lib/renderers/Action").ActionSchema[] | undefined;
|
183
|
+
reload?: string | undefined;
|
184
|
+
tabs?: any;
|
185
|
+
interval?: number | undefined;
|
186
|
+
silentPolling?: boolean | undefined;
|
187
|
+
stopAutoRefreshWhen?: string | undefined;
|
188
|
+
fieldSet?: any;
|
189
|
+
panelClassName: import("amis").ClassName;
|
190
|
+
preventEnterSubmit: boolean;
|
191
|
+
debug?: boolean | undefined;
|
192
|
+
initApi?: string | import("amis").BaseApiObject | undefined;
|
193
|
+
initAsyncApi?: string | import("amis").BaseApiObject | undefined;
|
194
|
+
initFinishedField?: string | undefined;
|
195
|
+
initCheckInterval?: number | undefined;
|
196
|
+
clearPersistDataAfterSubmit?: boolean | undefined;
|
197
|
+
feedback?: any;
|
198
|
+
asyncApi?: string | import("amis").BaseApiObject | undefined;
|
199
|
+
checkInterval?: number | undefined;
|
200
|
+
finishedField?: string | undefined;
|
201
|
+
resetAfterSubmit?: boolean | undefined;
|
202
|
+
clearAfterSubmit?: boolean | undefined;
|
203
|
+
columnCount?: number | undefined;
|
204
|
+
autoFocus: boolean | undefined;
|
205
|
+
primaryField?: string | undefined;
|
206
|
+
redirect?: string | undefined;
|
207
|
+
submitOnInit?: boolean | undefined;
|
208
|
+
submitText?: string | undefined;
|
209
|
+
target?: string | undefined;
|
210
|
+
affixFooter?: boolean | undefined;
|
211
|
+
promptPageLeave?: boolean | undefined;
|
212
|
+
promptPageLeaveMessage?: string | undefined;
|
213
|
+
type: string;
|
214
|
+
bodyClassName: string;
|
215
|
+
actionsClassName: string;
|
216
|
+
wrapperComponent: string;
|
217
|
+
formLazyChange: boolean;
|
218
|
+
};
|
219
|
+
renderMoreSection(): JSX.Element | null;
|
220
|
+
render(): JSX.Element | null;
|
221
|
+
}
|
222
|
+
export declare class SwitchMoreRenderer extends SwitchMore {
|
223
|
+
}
|
224
|
+
export {};
|
@@ -1,28 +1,63 @@
|
|
1
1
|
/**
|
2
2
|
* @file 表单项校验配置
|
3
3
|
*/
|
4
|
-
/// <reference types="lodash" />
|
5
4
|
import React from 'react';
|
5
|
+
import { ValidatorData } from './ValidationItem';
|
6
6
|
import type { FormControlProps } from 'amis-core';
|
7
|
+
import { Validator, ValidatorTag } from '../validator';
|
8
|
+
export declare type ValidatorFilter = string[] | ((ctx: any) => string[]);
|
7
9
|
export interface ValidationControlProps extends FormControlProps {
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
value: boolean | string | number;
|
13
|
-
checked: boolean;
|
14
|
-
message?: string;
|
10
|
+
/**
|
11
|
+
* 匹配验证器标签进行默认和顶部可选的验证器展示
|
12
|
+
*/
|
13
|
+
tag: ValidatorTag | ((ctx: any) => ValidatorTag);
|
15
14
|
}
|
16
15
|
interface ValidationControlState {
|
17
|
-
|
16
|
+
avaliableValids: {
|
17
|
+
moreValidators: Record<string, Validator>;
|
18
|
+
defaultValidators: Record<string, Validator>;
|
19
|
+
builtInValidators: Record<string, Validator>;
|
20
|
+
};
|
18
21
|
}
|
19
|
-
export
|
20
|
-
validationRules: Record<string, string>;
|
22
|
+
export default class ValidationControl extends React.Component<ValidationControlProps, ValidationControlState> {
|
21
23
|
constructor(props: ValidationControlProps);
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
24
|
+
componentWillReceiveProps(nextProps: ValidationControlProps): void;
|
25
|
+
getAvaliableValids(props: ValidationControlProps): {
|
26
|
+
defaultValidators: Record<string, Validator>;
|
27
|
+
moreValidators: Record<string, Validator>;
|
28
|
+
builtInValidators: Record<string, Validator>;
|
29
|
+
};
|
30
|
+
transformValid(data: any): ValidatorData[];
|
31
|
+
/**
|
32
|
+
* 统一更新校验相关字段
|
33
|
+
*/
|
34
|
+
updateValidation(validators: ValidatorData[]): void;
|
35
|
+
/**
|
36
|
+
* 添加规则
|
37
|
+
*
|
38
|
+
* @param {Validator} valid 校验规则配置
|
39
|
+
*/
|
40
|
+
handleAddValidator(valid: Validator): void;
|
41
|
+
/**
|
42
|
+
* 更新校验规则
|
43
|
+
*/
|
44
|
+
handleEditRule(data: ValidatorData): void;
|
45
|
+
/**
|
46
|
+
* 删除校验规则
|
47
|
+
*/
|
48
|
+
handleRemoveRule(valid: string): void;
|
49
|
+
/**
|
50
|
+
* 开关默认规则
|
51
|
+
*/
|
52
|
+
handleSwitchRule(checked: boolean, data: ValidatorData): void;
|
53
|
+
/**
|
54
|
+
* 添加规则下拉框
|
55
|
+
*/
|
56
|
+
renderDropdown(): JSX.Element;
|
57
|
+
/**
|
58
|
+
* 规则列表
|
59
|
+
*/
|
60
|
+
renderValidaton(): JSX.Element;
|
26
61
|
render(): JSX.Element;
|
27
62
|
}
|
28
63
|
export declare class ValidationControlRenderer extends ValidationControl {
|
@@ -0,0 +1,46 @@
|
|
1
|
+
/**
|
2
|
+
* @file 校验项
|
3
|
+
*/
|
4
|
+
import React from 'react';
|
5
|
+
import { Validator } from '../validator';
|
6
|
+
export declare type ValidatorData = {
|
7
|
+
name: string;
|
8
|
+
value?: any;
|
9
|
+
message?: string;
|
10
|
+
isBuiltIn?: boolean;
|
11
|
+
};
|
12
|
+
export interface ValidationItemProps {
|
13
|
+
/**
|
14
|
+
* 组件的CSS主题前缀
|
15
|
+
*/
|
16
|
+
classPrefix?: string;
|
17
|
+
/**
|
18
|
+
* 校验配置
|
19
|
+
*/
|
20
|
+
data: ValidatorData;
|
21
|
+
/**
|
22
|
+
* 是否是默认props,默认可开关
|
23
|
+
*/
|
24
|
+
isDefault: boolean;
|
25
|
+
validator: Validator;
|
26
|
+
onEdit?: (data: ValidatorData) => void;
|
27
|
+
onDelete?: (name: string) => void;
|
28
|
+
onSwitch?: (checked: boolean, data?: ValidatorData) => void;
|
29
|
+
}
|
30
|
+
interface ValidationItemState {
|
31
|
+
value: string | number | boolean | undefined;
|
32
|
+
checked: boolean;
|
33
|
+
message: string;
|
34
|
+
isBuiltIn: boolean | undefined;
|
35
|
+
}
|
36
|
+
export default class ValidationItem extends React.Component<ValidationItemProps, ValidationItemState> {
|
37
|
+
validator: Validator;
|
38
|
+
constructor(props: ValidationItemProps);
|
39
|
+
handleEdit(value: any, action: any): void;
|
40
|
+
handleDelete(): void;
|
41
|
+
handleSwitch(checked: boolean): void;
|
42
|
+
renderActions(): JSX.Element | null;
|
43
|
+
renderInputControl(): JSX.Element | null;
|
44
|
+
render(): JSX.Element;
|
45
|
+
}
|
46
|
+
export {};
|
@@ -0,0 +1,17 @@
|
|
1
|
+
/**
|
2
|
+
* @file Background.ts
|
3
|
+
* @description 背景设置
|
4
|
+
*/
|
5
|
+
import React from 'react';
|
6
|
+
import type { FormControlProps } from 'amis-core';
|
7
|
+
import type { PlainObject } from './types';
|
8
|
+
interface BackgroundProps extends FormControlProps {
|
9
|
+
receiver?: string;
|
10
|
+
value?: PlainObject;
|
11
|
+
onChange: (value: PlainObject) => void;
|
12
|
+
}
|
13
|
+
declare const Background: React.FC<BackgroundProps>;
|
14
|
+
export default Background;
|
15
|
+
export declare class BackgroundRenderer extends React.Component<FormControlProps> {
|
16
|
+
render(): JSX.Element;
|
17
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
/**
|
2
|
+
* @file 边框圆角
|
3
|
+
* @description 边框 & 圆角设置
|
4
|
+
*/
|
5
|
+
import React from 'react';
|
6
|
+
import type { PlainObject } from './types';
|
7
|
+
import type { FormControlProps } from 'amis-core';
|
8
|
+
declare function BoxBorder({ disableBorder, disableRadius, onChange, value }: {
|
9
|
+
disableBorder?: boolean;
|
10
|
+
disableRadius?: boolean;
|
11
|
+
onChange: (value: PlainObject) => void;
|
12
|
+
value?: PlainObject;
|
13
|
+
}): JSX.Element;
|
14
|
+
declare const _default: typeof BoxBorder;
|
15
|
+
export default _default;
|
16
|
+
export declare class BorderRenderer extends React.Component<FormControlProps> {
|
17
|
+
render(): JSX.Element;
|
18
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
/**
|
2
|
+
* @file BoxModel
|
3
|
+
* @description 盒模型控件,支持编辑 margin & padding
|
4
|
+
*/
|
5
|
+
import React from 'react';
|
6
|
+
import type { FormControlProps } from 'amis-core';
|
7
|
+
import type { PlainObject } from './types';
|
8
|
+
export declare type Direction = 'left' | 'right' | 'top' | 'bottom';
|
9
|
+
declare function BoxModel({ value, onChange }: {
|
10
|
+
value?: PlainObject;
|
11
|
+
onChange: (value: PlainObject) => void;
|
12
|
+
}): JSX.Element;
|
13
|
+
declare const _default: typeof BoxModel;
|
14
|
+
export default _default;
|
15
|
+
export declare class BoxModelRenderer extends React.Component<FormControlProps> {
|
16
|
+
render(): JSX.Element;
|
17
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
/**
|
2
|
+
* @file 阴影
|
3
|
+
* @description 阴影配置
|
4
|
+
* @grammar
|
5
|
+
* x偏移量 | y偏移量 | 阴影颜色
|
6
|
+
* x偏移量 | y偏移量 | 阴影模糊半径 | 阴影颜色
|
7
|
+
* 插页(阴影向内) | x偏移量 | y偏移量 | 阴影模糊半径 | 阴影扩散半径 | 阴影颜色
|
8
|
+
*/
|
9
|
+
import React from 'react';
|
10
|
+
import type { FormControlProps } from 'amis-core';
|
11
|
+
declare function BoxShadow({ value, onChange }: {
|
12
|
+
value?: string;
|
13
|
+
onChange: (value: any) => void;
|
14
|
+
}): JSX.Element;
|
15
|
+
export default BoxShadow;
|
16
|
+
export declare class BoxShadowRenderer extends React.Component<FormControlProps> {
|
17
|
+
render(): JSX.Element;
|
18
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
/**
|
2
|
+
* @file Display
|
3
|
+
* @description 布局展示相关控件
|
4
|
+
*/
|
5
|
+
import React from 'react';
|
6
|
+
import type { FormControlProps } from 'amis-core';
|
7
|
+
import type { PlainObject } from './types';
|
8
|
+
export interface DisplayProps extends FormControlProps {
|
9
|
+
value?: PlainObject;
|
10
|
+
onChange: (value: PlainObject) => void;
|
11
|
+
}
|
12
|
+
export default class DisplayRenderer extends React.Component<FormControlProps> {
|
13
|
+
render(): JSX.Element;
|
14
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
/**
|
2
|
+
* @file Font
|
3
|
+
* @description 文字样式相关控件
|
4
|
+
*/
|
5
|
+
import React from 'react';
|
6
|
+
import type { FormControlProps } from 'amis-core';
|
7
|
+
import type { PlainObject } from './types';
|
8
|
+
export interface FontProps extends FormControlProps {
|
9
|
+
value?: PlainObject;
|
10
|
+
onChange: (value: PlainObject) => void;
|
11
|
+
}
|
12
|
+
declare const Font: React.FC<FontProps>;
|
13
|
+
export default Font;
|
14
|
+
export declare class FontRenderer extends React.Component<FormControlProps> {
|
15
|
+
render(): JSX.Element;
|
16
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
/**
|
2
|
+
* @file font.ts
|
3
|
+
* @description 字体选项与字体名称的对应列表
|
4
|
+
* @link http://icode.baidu.com/repos/baidu/legend/frontend/tree/master:frontend/client/widgets/attributeEditor/stringAttributeEditor/fontFamilyAttributeEditor
|
5
|
+
*/
|
6
|
+
export declare const fontFamilyList: {
|
7
|
+
label: string;
|
8
|
+
value: string;
|
9
|
+
}[];
|
10
|
+
export declare const fontFamilyMap: {};
|
11
|
+
export declare const fontFamilyMirror: {};
|
@@ -0,0 +1,29 @@
|
|
1
|
+
/**
|
2
|
+
* @file transformation.ts
|
3
|
+
* @description CSS样式解析和编译
|
4
|
+
*/
|
5
|
+
import type { LengthUnit } from './types';
|
6
|
+
export interface LengthObj {
|
7
|
+
length?: number;
|
8
|
+
unit: LengthUnit;
|
9
|
+
}
|
10
|
+
export declare function parseBoxShadow(inputStr: string): {
|
11
|
+
inset: boolean;
|
12
|
+
x: string | number;
|
13
|
+
y: string | number;
|
14
|
+
blur: string | number;
|
15
|
+
spread: string | number;
|
16
|
+
color: string | undefined;
|
17
|
+
};
|
18
|
+
export declare function normalizeBoxShadow(config: {
|
19
|
+
x: LengthObj;
|
20
|
+
y: LengthObj;
|
21
|
+
blur: LengthObj;
|
22
|
+
spread: LengthObj;
|
23
|
+
color: string;
|
24
|
+
inset: boolean;
|
25
|
+
}): {
|
26
|
+
boxShadow: string;
|
27
|
+
} | {
|
28
|
+
boxShadow: undefined;
|
29
|
+
};
|
@@ -0,0 +1,8 @@
|
|
1
|
+
/**
|
2
|
+
* @file control declaration
|
3
|
+
* @description 公共控件相关声明
|
4
|
+
*/
|
5
|
+
export declare type PlainObject = Record<string, any>;
|
6
|
+
export declare type StyleObject = Record<'marginTop', any>;
|
7
|
+
export declare type BoxShadowProps = 'x' | 'y' | 'blur' | 'spread' | 'color' | 'inset';
|
8
|
+
export declare type LengthUnit = 'px' | 'em' | 'rem' | 'vw' | 'vh';
|
@@ -4,6 +4,7 @@ import { SchemaObject } from 'amis/lib/Schema';
|
|
4
4
|
import { EditorManager, PluginClass } from '../manager';
|
5
5
|
import { RenderOptions } from 'amis';
|
6
6
|
import { PluginEventListener } from '../plugin';
|
7
|
+
import { ActionConfigItemsMap, ActionTypeNode } from '../event-action';
|
7
8
|
export interface EditorProps extends PluginEventListener {
|
8
9
|
value: SchemaObject;
|
9
10
|
onChange: (value: SchemaObject) => void;
|
@@ -13,6 +14,7 @@ export interface EditorProps extends PluginEventListener {
|
|
13
14
|
autoFocus?: boolean;
|
14
15
|
className?: string;
|
15
16
|
$schemaUrl?: string;
|
17
|
+
schemas?: Array<any>;
|
16
18
|
theme?: string;
|
17
19
|
showCustomRenderersPanel?: boolean;
|
18
20
|
amisDocHost?: string;
|
@@ -38,6 +40,20 @@ export interface EditorProps extends PluginEventListener {
|
|
38
40
|
previewProps?: any;
|
39
41
|
iframeUrl?: string;
|
40
42
|
isHiddenProps?: (key: string) => boolean;
|
43
|
+
/**
|
44
|
+
* 事件动作面板相关配置
|
45
|
+
*/
|
46
|
+
actionOptions?: {
|
47
|
+
showOldEntry?: boolean;
|
48
|
+
/**
|
49
|
+
* 通用动作集(事件动作面板左侧动作树)
|
50
|
+
*/
|
51
|
+
actionTreeGetter?: (actionTree: ActionTypeNode[]) => ActionTypeNode[];
|
52
|
+
/**
|
53
|
+
* 自定义动作配置
|
54
|
+
*/
|
55
|
+
customActionGetter?: (manager: EditorManager) => ActionConfigItemsMap;
|
56
|
+
};
|
41
57
|
onUndo?: () => void;
|
42
58
|
onRedo?: () => void;
|
43
59
|
onSave?: () => void;
|
@@ -26,6 +26,7 @@ export declare class RegionWrapper extends React.Component<RegionWrapperProps> {
|
|
26
26
|
parentRegion: string;
|
27
27
|
isCommonConfig: boolean;
|
28
28
|
id: string;
|
29
|
+
type: string;
|
29
30
|
label: string;
|
30
31
|
regionInfo: (RegionConfig & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IMaybe<import("mobx-state-tree").IType<RegionConfig, RegionConfig, RegionConfig>>>) | undefined;
|
31
32
|
path: string;
|
@@ -48,6 +49,8 @@ export declare class RegionWrapper extends React.Component<RegionWrapperProps> {
|
|
48
49
|
} & {
|
49
50
|
readonly info: RendererInfo;
|
50
51
|
setInfo(value: RendererInfo): void;
|
52
|
+
readonly rendererConfig: import("amis-core").RendererConfig | undefined;
|
53
|
+
setRendererConfig(value: import("amis-core").RendererConfig): void;
|
51
54
|
readonly isVitualRenderer: boolean;
|
52
55
|
readonly clickable: boolean;
|
53
56
|
readonly draggable: boolean;
|
@@ -66,6 +69,7 @@ export declare class RegionWrapper extends React.Component<RegionWrapperProps> {
|
|
66
69
|
isExists(id: string): boolean;
|
67
70
|
getChildById(id: string): any;
|
68
71
|
readonly parent: any;
|
72
|
+
readonly ancestorField: any;
|
69
73
|
readonly host: any;
|
70
74
|
readonly firstChild: any;
|
71
75
|
readonly index: any;
|
@@ -78,6 +82,7 @@ export declare class RegionWrapper extends React.Component<RegionWrapperProps> {
|
|
78
82
|
updateIsCommonConfig: (value: boolean) => void;
|
79
83
|
addChild(props: {
|
80
84
|
id: string;
|
85
|
+
type: string;
|
81
86
|
label: string;
|
82
87
|
path: string;
|
83
88
|
isCommonConfig?: boolean | undefined;
|
@@ -106,6 +111,7 @@ export declare class RegionWrapper extends React.Component<RegionWrapperProps> {
|
|
106
111
|
parentRegion: import("mobx-state-tree").IType<string | undefined, string, string>;
|
107
112
|
isCommonConfig: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
108
113
|
id: import("mobx-state-tree").IType<string | undefined, string, string>;
|
114
|
+
type: import("mobx-state-tree").IType<string | undefined, string, string>;
|
109
115
|
label: import("mobx-state-tree").IType<string | undefined, string, string>;
|
110
116
|
regionInfo: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IType<RegionConfig, RegionConfig, RegionConfig>>;
|
111
117
|
path: import("mobx-state-tree").IType<string | undefined, string, string>;
|
@@ -128,6 +134,8 @@ export declare class RegionWrapper extends React.Component<RegionWrapperProps> {
|
|
128
134
|
} & {
|
129
135
|
readonly info: RendererInfo;
|
130
136
|
setInfo(value: RendererInfo): void;
|
137
|
+
readonly rendererConfig: import("amis-core").RendererConfig | undefined;
|
138
|
+
setRendererConfig(value: import("amis-core").RendererConfig): void;
|
131
139
|
readonly isVitualRenderer: boolean;
|
132
140
|
readonly clickable: boolean;
|
133
141
|
readonly draggable: boolean;
|
@@ -146,6 +154,7 @@ export declare class RegionWrapper extends React.Component<RegionWrapperProps> {
|
|
146
154
|
isExists(id: string): boolean;
|
147
155
|
getChildById(id: string): any;
|
148
156
|
readonly parent: any;
|
157
|
+
readonly ancestorField: any;
|
149
158
|
readonly host: any;
|
150
159
|
readonly firstChild: any;
|
151
160
|
readonly index: any;
|
@@ -158,6 +167,7 @@ export declare class RegionWrapper extends React.Component<RegionWrapperProps> {
|
|
158
167
|
updateIsCommonConfig: (value: boolean) => void;
|
159
168
|
addChild(props: {
|
160
169
|
id: string;
|
170
|
+
type: string;
|
161
171
|
label: string;
|
162
172
|
path: string;
|
163
173
|
isCommonConfig?: boolean | undefined;
|