amis-editor 4.2.0-beta.3 → 5.1.8
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/Editor.d.ts +16 -0
- package/dist/component/RegionWrapper.d.ts +10 -0
- package/dist/component/ScaffoldModal.d.ts +1 -1
- package/dist/component/VRenderer.d.ts +10 -0
- package/dist/component/control/APIControl.d.ts +1158 -0
- 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 → control}/OptionControl.d.ts +23 -34
- package/dist/component/{Control → control}/PopoverEdit.d.ts +0 -0
- 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 +65 -0
- 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/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 +55 -28
- 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
- package/dist/component/Control/APIControl.d.ts +0 -504
- package/dist/component/Control/ValidationControl.d.ts +0 -30
- package/dist/component/remarkTpl.d.ts +0 -150
@@ -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 {};
|
@@ -0,0 +1,65 @@
|
|
1
|
+
/**
|
2
|
+
* @file 表单项校验配置
|
3
|
+
*/
|
4
|
+
import React from 'react';
|
5
|
+
import { ValidatorData } from './ValidationItem';
|
6
|
+
import type { FormControlProps } from 'amis-core';
|
7
|
+
import { Validator, ValidatorTag } from '../validator';
|
8
|
+
export declare type ValidatorFilter = string[] | ((ctx: any) => string[]);
|
9
|
+
export interface ValidationControlProps extends FormControlProps {
|
10
|
+
/**
|
11
|
+
* 匹配验证器标签进行默认和顶部可选的验证器展示
|
12
|
+
*/
|
13
|
+
tag: ValidatorTag | ((ctx: any) => ValidatorTag);
|
14
|
+
}
|
15
|
+
interface ValidationControlState {
|
16
|
+
avaliableValids: {
|
17
|
+
moreValidators: Record<string, Validator>;
|
18
|
+
defaultValidators: Record<string, Validator>;
|
19
|
+
builtInValidators: Record<string, Validator>;
|
20
|
+
};
|
21
|
+
}
|
22
|
+
export default class ValidationControl extends React.Component<ValidationControlProps, ValidationControlState> {
|
23
|
+
constructor(props: ValidationControlProps);
|
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;
|
61
|
+
render(): JSX.Element;
|
62
|
+
}
|
63
|
+
export declare class ValidationControlRenderer extends ValidationControl {
|
64
|
+
}
|
65
|
+
export {};
|
@@ -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';
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { SchemaCollection } from 'amis/lib/Schema';
|
1
2
|
/**
|
2
3
|
* 样式相关的属性面板,因为预计会比较多所以拆出来
|
3
4
|
*/
|
@@ -13,7 +14,14 @@ export declare const styleTpl: {
|
|
13
14
|
body: any[];
|
14
15
|
}[];
|
15
16
|
};
|
17
|
+
export declare function getCollapseCate(config: {
|
18
|
+
name: string;
|
19
|
+
body: SchemaCollection;
|
20
|
+
visibleOn?: string;
|
21
|
+
tools: SchemaCollection;
|
22
|
+
}): void;
|
16
23
|
export declare function getSchemaTpl(name: string, patch?: object): any;
|
17
24
|
export declare function setSchemaTpl(name: string, value: any): void;
|
18
25
|
export declare function valuePipeOut(value: any): any;
|
26
|
+
export declare function undefinedPipeOut(value: any): any;
|
19
27
|
export declare function defaultValue(defaultValue: any, strictMode?: boolean): (value: any) => any;
|
@@ -0,0 +1,62 @@
|
|
1
|
+
import { SchemaObject } from 'amis/lib/schema';
|
2
|
+
/**
|
3
|
+
* 校验规则类名
|
4
|
+
*/
|
5
|
+
export declare enum ValidationGroup {
|
6
|
+
Pattern = "\u6587\u672C",
|
7
|
+
Number = "\u6570\u5B57",
|
8
|
+
Regex = "\u6B63\u5219",
|
9
|
+
Others = "\u5176\u4ED6"
|
10
|
+
}
|
11
|
+
export interface Validator {
|
12
|
+
/**
|
13
|
+
* 校验规则名称,英文
|
14
|
+
*/
|
15
|
+
name: string;
|
16
|
+
/**
|
17
|
+
* 校验规则标题
|
18
|
+
*/
|
19
|
+
label: string;
|
20
|
+
/**
|
21
|
+
* 校验不通过的提示,没有则表示用户不能自定义配置
|
22
|
+
*/
|
23
|
+
message?: string;
|
24
|
+
/**
|
25
|
+
* 分类
|
26
|
+
*/
|
27
|
+
group?: string;
|
28
|
+
/**
|
29
|
+
* 快速编辑的表单
|
30
|
+
*/
|
31
|
+
schema?: SchemaObject[];
|
32
|
+
/**
|
33
|
+
* 输入类型,true则表示是默认
|
34
|
+
*/
|
35
|
+
tag: Partial<Record<ValidatorTag, ValidTagMatchType>>;
|
36
|
+
}
|
37
|
+
declare enum ValidTagMatchType {
|
38
|
+
isDefault = 1,
|
39
|
+
isMore = 2,
|
40
|
+
isBuiltIn = 3
|
41
|
+
}
|
42
|
+
export declare const registerValidator: (...config: Array<Validator>) => void;
|
43
|
+
export declare const getValidatorsByTag: (tag: ValidatorTag) => {
|
44
|
+
defaultValidators: Record<string, Validator>;
|
45
|
+
moreValidators: Record<string, Validator>;
|
46
|
+
builtInValidators: Record<string, Validator>;
|
47
|
+
};
|
48
|
+
export declare const getValidator: (name: string) => Validator | undefined;
|
49
|
+
export declare enum ValidatorTag {
|
50
|
+
All = "0",
|
51
|
+
Text = "1",
|
52
|
+
MultiSelect = "2",
|
53
|
+
Check = "3",
|
54
|
+
Email = "4",
|
55
|
+
Password = "5",
|
56
|
+
URL = "6",
|
57
|
+
Number = "7",
|
58
|
+
File = "8",
|
59
|
+
Date = "9",
|
60
|
+
Code = "10"
|
61
|
+
}
|
62
|
+
export {};
|
package/dist/dnd/index.d.ts
CHANGED
@@ -56,7 +56,7 @@ export declare class EditorDNDManager {
|
|
56
56
|
* 比如 table 列区域的拖拽就是放根线表示拖入的位置。
|
57
57
|
* @param region
|
58
58
|
*/
|
59
|
-
makeDNDModeInstance(region: EditorNodeType):
|
59
|
+
makeDNDModeInstance(region: EditorNodeType): DNDModeInterface | null;
|
60
60
|
/**
|
61
61
|
* 拖拽入口,一个是拖拽按钮 toolbar,一个是 outline 里面的导航项
|
62
62
|
* @param id
|
@@ -0,0 +1,11 @@
|
|
1
|
+
/**
|
2
|
+
* 组件专有动作选择器
|
3
|
+
*/
|
4
|
+
import { Option } from 'amis';
|
5
|
+
import { RendererProps } from 'amis-core';
|
6
|
+
import React from 'react';
|
7
|
+
export declare const BASE_ACTION_PROPS: string[];
|
8
|
+
export default class CmptActionSelect extends React.Component<RendererProps> {
|
9
|
+
onChange(option: Option): void;
|
10
|
+
render(): JSX.Element;
|
11
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { ActionConfigItemsMap } from './index';
|
2
|
+
export declare const DATA_CONTAINER: string[];
|
3
|
+
export declare const IS_DATA_CONTAINER: string;
|
4
|
+
export declare const getComboWrapper: (items: any, multiple?: boolean) => {
|
5
|
+
type: string;
|
6
|
+
name: string;
|
7
|
+
multiple: boolean;
|
8
|
+
strictMode: boolean;
|
9
|
+
items: any[];
|
10
|
+
};
|
11
|
+
export declare const FORMITEM_CMPTS: string[];
|
12
|
+
export declare const SUPPORT_DISABLED_CMPTS: string[];
|
13
|
+
export declare const COMMON_ACTION_SCHEMA_MAP: ActionConfigItemsMap;
|