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.
Files changed (216) hide show
  1. package/dist/6dbcbb49b6fd405190a9.png +0 -0
  2. package/dist/component/Control/APIControl.d.ts +1101 -447
  3. package/dist/component/Control/ActionAPIControl.d.ts +1158 -0
  4. package/dist/component/Control/BadgeControl.d.ts +133 -0
  5. package/dist/component/Control/BaseControl.d.ts +248 -0
  6. package/dist/component/Control/DataBindingControl.d.ts +14 -0
  7. package/dist/component/Control/DataPickerControl.d.ts +13 -0
  8. package/dist/component/Control/DateShortCutControl.d.ts +83 -0
  9. package/dist/component/Control/FormulaControl.d.ts +51 -0
  10. package/dist/component/Control/OptionControl.d.ts +23 -34
  11. package/dist/component/Control/StatusControl.d.ts +39 -0
  12. package/dist/component/Control/SwitchMoreControl.d.ts +224 -0
  13. package/dist/component/Control/ValidationControl.d.ts +50 -15
  14. package/dist/component/Control/ValidationItem.d.ts +46 -0
  15. package/dist/component/Control/style-control/Background.d.ts +17 -0
  16. package/dist/component/Control/style-control/Border.d.ts +18 -0
  17. package/dist/component/Control/style-control/BoxModel.d.ts +17 -0
  18. package/dist/component/Control/style-control/BoxShadow.d.ts +18 -0
  19. package/dist/component/Control/style-control/Display.d.ts +14 -0
  20. package/dist/component/Control/style-control/Font.d.ts +16 -0
  21. package/dist/component/Control/style-control/font-family.d.ts +11 -0
  22. package/dist/component/Control/style-control/transformation.d.ts +29 -0
  23. package/dist/component/Control/style-control/types.d.ts +8 -0
  24. package/dist/component/Editor.d.ts +16 -0
  25. package/dist/component/RegionWrapper.d.ts +10 -0
  26. package/dist/component/VRenderer.d.ts +10 -0
  27. package/dist/component/schemaTpl.d.ts +8 -0
  28. package/dist/component/validator.d.ts +62 -0
  29. package/dist/dnd/index.d.ts +1 -1
  30. package/dist/event-action/action-config-panel.d.ts +8 -0
  31. package/dist/event-action/actions.d.ts +3 -0
  32. package/dist/event-action/comp-action-select.d.ts +11 -0
  33. package/dist/event-action/config.d.ts +13 -0
  34. package/dist/event-action/index.d.ts +459 -0
  35. package/dist/event-action/schema.d.ts +32 -0
  36. package/dist/exports.min.js +1 -1
  37. package/dist/index.d.ts +23 -5
  38. package/dist/index.min.js +1 -1
  39. package/dist/manager.d.ts +46 -1
  40. package/dist/plugin/Alert.d.ts +4 -2
  41. package/dist/plugin/Button.d.ts +5 -1
  42. package/dist/plugin/ButtonGroup.d.ts +13 -34
  43. package/dist/plugin/ButtonToolbar.d.ts +4 -10
  44. package/dist/plugin/CRUD.d.ts +2 -0
  45. package/dist/plugin/Chart.d.ts +2 -0
  46. package/dist/plugin/Collapse.d.ts +1 -0
  47. package/dist/plugin/CollapseGroup.d.ts +28 -4
  48. package/dist/plugin/Container.d.ts +2 -1
  49. package/dist/plugin/Dialog.d.ts +12 -2
  50. package/dist/plugin/Drawer.d.ts +12 -2
  51. package/dist/plugin/DropDownButton.d.ts +11 -11
  52. package/dist/plugin/Form/ButtonGroupSelect.d.ts +7 -2
  53. package/dist/plugin/Form/ButtonToolbar.d.ts +8 -7
  54. package/dist/plugin/Form/ChainedSelect.d.ts +3 -0
  55. package/dist/plugin/Form/Checkbox.d.ts +7 -2
  56. package/dist/plugin/Form/Checkboxes.d.ts +8 -2
  57. package/dist/plugin/Form/CodeEditor.d.ts +7 -22
  58. package/dist/plugin/Form/Combo.d.ts +3 -0
  59. package/dist/plugin/Form/Control.d.ts +6 -2
  60. package/dist/plugin/Form/DiffEditor.d.ts +7 -1
  61. package/dist/plugin/Form/Form.d.ts +6 -0
  62. package/dist/plugin/Form/Formula.d.ts +1 -25
  63. package/dist/plugin/Form/InputDate.d.ts +8 -2
  64. package/dist/plugin/Form/InputDateRange.d.ts +8 -2
  65. package/dist/plugin/Form/InputDateTime.d.ts +4 -4
  66. package/dist/plugin/Form/InputDateTimeRange.d.ts +4 -4
  67. package/dist/plugin/Form/InputEmail.d.ts +1 -0
  68. package/dist/plugin/Form/InputExcel.d.ts +6 -41
  69. package/dist/plugin/Form/InputFile.d.ts +7 -3
  70. package/dist/plugin/Form/InputKV.d.ts +6 -0
  71. package/dist/plugin/Form/InputMonth.d.ts +1 -0
  72. package/dist/plugin/Form/InputMonthRange.d.ts +4 -4
  73. package/dist/plugin/Form/InputPassword.d.ts +1 -0
  74. package/dist/plugin/Form/InputQuarter.d.ts +1 -0
  75. package/dist/plugin/Form/InputQuarterRange.d.ts +4 -4
  76. package/dist/plugin/Form/InputRange.d.ts +3 -0
  77. package/dist/plugin/Form/InputRating.d.ts +9 -3
  78. package/dist/plugin/Form/InputText.d.ts +24 -2
  79. package/dist/plugin/Form/InputTime.d.ts +3 -3
  80. package/dist/plugin/Form/InputTimeRange.d.ts +20 -0
  81. package/dist/plugin/Form/InputTree.d.ts +6 -2
  82. package/dist/plugin/Form/InputURL.d.ts +1 -0
  83. package/dist/plugin/Form/InputYear.d.ts +1 -0
  84. package/dist/plugin/Form/InputYearRange.d.ts +20 -0
  85. package/dist/plugin/Form/ListSelect.d.ts +6 -2
  86. package/dist/plugin/Form/LocationPicker.d.ts +1 -31
  87. package/dist/plugin/Form/NestedSelect.d.ts +5 -2
  88. package/dist/plugin/Form/Radios.d.ts +7 -2
  89. package/dist/plugin/Form/Select.d.ts +7 -2
  90. package/dist/plugin/Form/Switch.d.ts +7 -2
  91. package/dist/plugin/Form/TabsTransfer.d.ts +5 -2
  92. package/dist/plugin/Form/Textarea.d.ts +7 -1
  93. package/dist/plugin/Form/Transfer.d.ts +5 -2
  94. package/dist/plugin/Form/TreeSelect.d.ts +6 -2
  95. package/dist/plugin/IFrame.d.ts +2 -2
  96. package/dist/plugin/Nav.d.ts +1 -116
  97. package/dist/plugin/Others/Action.d.ts +5 -1
  98. package/dist/plugin/Page.d.ts +5 -2
  99. package/dist/plugin/Progress.d.ts +5 -1
  100. package/dist/plugin/Table.d.ts +2 -0
  101. package/dist/plugin/Tabs.d.ts +33 -2
  102. package/dist/plugin/TooltipWrapper.d.ts +10 -0
  103. package/dist/plugin/Tpl.d.ts +2 -1
  104. package/dist/plugin/Wizard.d.ts +4 -1
  105. package/dist/plugin.d.ts +37 -1
  106. package/dist/store/editor.d.ts +65 -38
  107. package/dist/store/node.d.ts +16 -0
  108. package/dist/style.css +1 -1
  109. package/dist/util.d.ts +36 -3
  110. package/package.json +14 -8
  111. package/src/component/schemaTpl.tsx +1198 -474
  112. package/src/plugin/.DS_Store +0 -0
  113. package/src/plugin/Alert.tsx +69 -48
  114. package/src/plugin/AnchorNav.tsx +1 -0
  115. package/src/plugin/Audio.tsx +9 -15
  116. package/src/plugin/Avatar.tsx +2 -1
  117. package/src/plugin/Breadcrumb.tsx +2 -1
  118. package/src/plugin/Button.tsx +257 -188
  119. package/src/plugin/ButtonGroup.tsx +99 -38
  120. package/src/plugin/ButtonToolbar.tsx +7 -13
  121. package/src/plugin/CRUD.tsx +77 -135
  122. package/src/plugin/Card.tsx +1 -0
  123. package/src/plugin/Cards.tsx +8 -14
  124. package/src/plugin/Carousel.tsx +1 -1
  125. package/src/plugin/Chart.tsx +26 -14
  126. package/src/plugin/Collapse.tsx +78 -78
  127. package/src/plugin/CollapseGroup.tsx +165 -83
  128. package/src/plugin/Container.tsx +59 -6
  129. package/src/plugin/Custom.tsx +2 -8
  130. package/src/plugin/CustomRegion.tsx +4 -3
  131. package/src/plugin/Dialog.tsx +55 -24
  132. package/src/plugin/Drawer.tsx +65 -35
  133. package/src/plugin/DropDownButton.tsx +95 -79
  134. package/src/plugin/Flex.tsx +123 -65
  135. package/src/plugin/Form/ButtonGroupSelect.tsx +114 -26
  136. package/src/plugin/Form/ButtonToolbar.tsx +62 -55
  137. package/src/plugin/Form/ChainedSelect.tsx +45 -0
  138. package/src/plugin/Form/Checkbox.tsx +122 -33
  139. package/src/plugin/Form/Checkboxes.tsx +154 -87
  140. package/src/plugin/Form/CodeEditor.tsx +163 -34
  141. package/src/plugin/Form/Combo.tsx +104 -65
  142. package/src/plugin/Form/Control.tsx +16 -70
  143. package/src/plugin/Form/DiffEditor.tsx +158 -54
  144. package/src/plugin/Form/FieldSet.tsx +6 -11
  145. package/src/plugin/Form/Form.tsx +277 -70
  146. package/src/plugin/Form/Formula.tsx +8 -14
  147. package/src/plugin/Form/InputArray.tsx +7 -16
  148. package/src/plugin/Form/InputCity.tsx +1 -1
  149. package/src/plugin/Form/InputDate.tsx +344 -121
  150. package/src/plugin/Form/InputDateRange.tsx +303 -161
  151. package/src/plugin/Form/InputDateTime.tsx +6 -150
  152. package/src/plugin/Form/InputDateTimeRange.tsx +7 -187
  153. package/src/plugin/Form/InputEmail.tsx +1 -0
  154. package/src/plugin/Form/InputExcel.tsx +70 -27
  155. package/src/plugin/Form/InputFile.tsx +326 -152
  156. package/src/plugin/Form/InputImage.tsx +1 -1
  157. package/src/plugin/Form/InputKV.tsx +61 -0
  158. package/src/plugin/Form/InputMonth.tsx +3 -1
  159. package/src/plugin/Form/InputMonthRange.tsx +6 -160
  160. package/src/plugin/Form/InputNumber.tsx +1 -1
  161. package/src/plugin/Form/InputPassword.tsx +2 -0
  162. package/src/plugin/Form/InputQuarter.tsx +3 -1
  163. package/src/plugin/Form/InputQuarterRange.tsx +6 -160
  164. package/src/plugin/Form/InputRange.tsx +74 -4
  165. package/src/plugin/Form/InputRating.tsx +347 -35
  166. package/src/plugin/Form/InputRichText.tsx +2 -3
  167. package/src/plugin/Form/InputTable.tsx +33 -49
  168. package/src/plugin/Form/InputTag.tsx +1 -1
  169. package/src/plugin/Form/InputText.tsx +310 -132
  170. package/src/plugin/Form/InputTime.tsx +4 -53
  171. package/src/plugin/Form/InputTimeRange.tsx +41 -0
  172. package/src/plugin/Form/InputTree.tsx +196 -46
  173. package/src/plugin/Form/InputURL.tsx +2 -0
  174. package/src/plugin/Form/InputYear.tsx +2 -0
  175. package/src/plugin/Form/InputYearRange.tsx +41 -0
  176. package/src/plugin/Form/Item.tsx +17 -18
  177. package/src/plugin/Form/ListSelect.tsx +75 -20
  178. package/src/plugin/Form/LocationPicker.tsx +2 -7
  179. package/src/plugin/Form/MatrixCheckboxes.tsx +1 -1
  180. package/src/plugin/Form/NestedSelect.tsx +110 -43
  181. package/src/plugin/Form/Picker.tsx +2 -5
  182. package/src/plugin/Form/Radios.tsx +122 -52
  183. package/src/plugin/Form/Select.tsx +239 -168
  184. package/src/plugin/Form/Static.tsx +1 -1
  185. package/src/plugin/Form/Switch.tsx +170 -58
  186. package/src/plugin/Form/TabsTransfer.tsx +175 -79
  187. package/src/plugin/Form/Textarea.tsx +146 -36
  188. package/src/plugin/Form/Transfer.tsx +295 -233
  189. package/src/plugin/Form/TreeSelect.tsx +287 -146
  190. package/src/plugin/Grid.tsx +340 -312
  191. package/src/plugin/HBox.tsx +1 -0
  192. package/src/plugin/IFrame.tsx +21 -12
  193. package/src/plugin/Image.tsx +7 -12
  194. package/src/plugin/Images.tsx +7 -12
  195. package/src/plugin/Link.tsx +6 -12
  196. package/src/plugin/List.tsx +6 -10
  197. package/src/plugin/ListItem.tsx +1 -0
  198. package/src/plugin/Nav.tsx +7 -9
  199. package/src/plugin/Others/Action.tsx +16 -10
  200. package/src/plugin/Others/BasicToolbar.tsx +4 -1
  201. package/src/plugin/Others/TableCell.tsx +19 -39
  202. package/src/plugin/Page.tsx +315 -229
  203. package/src/plugin/Panel.tsx +6 -7
  204. package/src/plugin/Plain.tsx +3 -6
  205. package/src/plugin/Progress.tsx +234 -94
  206. package/src/plugin/Service.tsx +10 -6
  207. package/src/plugin/Table.tsx +49 -20
  208. package/src/plugin/TableView.tsx +212 -106
  209. package/src/plugin/Tabs.tsx +306 -146
  210. package/src/plugin/TooltipWrapper.tsx +231 -135
  211. package/src/plugin/Tpl.tsx +68 -52
  212. package/src/plugin/Video.tsx +9 -20
  213. package/src/plugin/Wizard.tsx +537 -336
  214. package/src/plugin/Wrapper.tsx +82 -61
  215. package/src/plugin.ts +66 -4
  216. package/static/empty.png +0 -0
@@ -0,0 +1,133 @@
1
+ /**
2
+ * @file 角标控件
3
+ */
4
+ import React from 'react';
5
+ import type { FormControlProps } from 'amis-core';
6
+ import type { SchemaExpression } from 'amis/lib/Schema';
7
+ export interface BadgeControlProps extends FormControlProps {
8
+ /**
9
+ * 角标类型
10
+ */
11
+ mode?: 'text' | 'dot' | 'ribbon';
12
+ /**
13
+ * 文本内容
14
+ */
15
+ text?: string | number;
16
+ /**
17
+ * 角标大小
18
+ */
19
+ size?: any;
20
+ /**
21
+ * 角标位置,优先级大于position
22
+ */
23
+ offset?: [number | string, number | string];
24
+ /**
25
+ * 角标位置
26
+ */
27
+ position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
28
+ /**
29
+ * 封顶的数字值
30
+ */
31
+ overflowCount?: number;
32
+ /**
33
+ * 动态控制是否显示
34
+ */
35
+ visibleOn?: SchemaExpression;
36
+ /**
37
+ * 是否显示动画
38
+ */
39
+ animation?: boolean;
40
+ /**
41
+ * 角标的自定义样式
42
+ */
43
+ style?: {
44
+ [propName: string]: any;
45
+ };
46
+ /**
47
+ * 提示类型
48
+ */
49
+ level?: 'info' | 'warning' | 'success' | 'danger' | SchemaExpression;
50
+ }
51
+ interface BadgeControlState {
52
+ checked: boolean;
53
+ }
54
+ interface BadgeForm extends Partial<Pick<BadgeControlProps, 'mode' | 'text' | 'size' | 'position' | 'overflowCount' | 'visibleOn' | 'animation' | 'style' | 'level'>> {
55
+ offset: {
56
+ x: number;
57
+ y: number;
58
+ };
59
+ }
60
+ export default class BadgeControl extends React.Component<BadgeControlProps, BadgeControlState> {
61
+ static defaultProps: {
62
+ mode: string;
63
+ overflowCount: number;
64
+ position: string;
65
+ level: string;
66
+ animation: boolean;
67
+ };
68
+ constructor(props: BadgeControlProps);
69
+ componentDidUpdate(prevProps: BadgeControlProps): void;
70
+ transformBadgeValue(): BadgeForm;
71
+ normalizeBadgeValue(form: BadgeForm): {
72
+ style: import("lodash").Dictionary<any>;
73
+ offset: number[];
74
+ text?: string | number | undefined;
75
+ size?: any;
76
+ mode?: "text" | "dot" | "ribbon" | undefined;
77
+ visibleOn?: string | undefined;
78
+ level?: string | undefined;
79
+ position?: "top-right" | "top-left" | "bottom-right" | "bottom-left" | undefined;
80
+ overflowCount?: number | undefined;
81
+ animation?: boolean | undefined;
82
+ } | {
83
+ style?: {
84
+ [propName: string]: any;
85
+ } | undefined;
86
+ offset: number[];
87
+ text?: string | number | undefined;
88
+ size?: any;
89
+ mode?: "text" | "dot" | "ribbon" | undefined;
90
+ visibleOn?: string | undefined;
91
+ level?: string | undefined;
92
+ position?: "top-right" | "top-left" | "bottom-right" | "bottom-left" | undefined;
93
+ overflowCount?: number | undefined;
94
+ animation?: boolean | undefined;
95
+ } | {
96
+ style: import("lodash").Dictionary<any>;
97
+ offset: {
98
+ x: number;
99
+ y: number;
100
+ };
101
+ text?: string | number | undefined;
102
+ size?: any;
103
+ mode?: "text" | "dot" | "ribbon" | undefined;
104
+ visibleOn?: string | undefined;
105
+ level?: string | undefined;
106
+ position?: "top-right" | "top-left" | "bottom-right" | "bottom-left" | undefined;
107
+ overflowCount?: number | undefined;
108
+ animation?: boolean | undefined;
109
+ } | {
110
+ style?: {
111
+ [propName: string]: any;
112
+ } | undefined;
113
+ offset: {
114
+ x: number;
115
+ y: number;
116
+ };
117
+ text?: string | number | undefined;
118
+ size?: any;
119
+ mode?: "text" | "dot" | "ribbon" | undefined;
120
+ visibleOn?: string | undefined;
121
+ level?: string | undefined;
122
+ position?: "top-right" | "top-left" | "bottom-right" | "bottom-left" | undefined;
123
+ overflowCount?: number | undefined;
124
+ animation?: boolean | undefined;
125
+ };
126
+ handleSwitchChange(checked: boolean): void;
127
+ handleSubmit(form: BadgeForm, action: any): void;
128
+ renderBody(): JSX.Element;
129
+ render(): JSX.Element;
130
+ }
131
+ export declare class BadgeControlRenderer extends BadgeControl {
132
+ }
133
+ export {};
@@ -0,0 +1,248 @@
1
+ import type { BaseEventContext } from '../../plugin';
2
+ import { SchemaObject } from 'amis/lib/Schema';
3
+ export declare const BUTTON_DEFAULT_ACTION: {
4
+ onEvent: {
5
+ click: {
6
+ actions: never[];
7
+ };
8
+ };
9
+ };
10
+ export declare type PrimitiveType = string | number | boolean;
11
+ /**
12
+ * 校验项
13
+ * 数组项为 ValidationType 或 对象形式的配置
14
+ * 对象形式配置规则 优先匹配 isShow 形式,后匹配 isHidden 形式
15
+ * 如下:
16
+ */
17
+ export declare type ValidationOptions = Array<{
18
+ option: string;
19
+ isShow?: {
20
+ [key: string]: PrimitiveType | Array<PrimitiveType>;
21
+ };
22
+ isHidden?: {
23
+ [key: string]: PrimitiveType | Array<PrimitiveType>;
24
+ };
25
+ }>;
26
+ export declare type FormItemControlPanel = 'property' | 'common' | 'option' | 'status' | 'validation' | 'style' | 'option' | 'event';
27
+ /**
28
+ * Label提示
29
+ * 支持传入Schema或String,传入String则使用默认配置,如下:
30
+ *
31
+ * @default
32
+ * ```
33
+ * className: 'ae-BaseRemark',
34
+ * icon: 'fa fa-question-circle',
35
+ * trigger: ['hover', 'click'],
36
+ * placement: 'left'
37
+ * ```
38
+ */
39
+ export declare const BaseLabelMark: (schema: Record<string, any> | string) => {
40
+ content: any;
41
+ className: string;
42
+ icon: string;
43
+ trigger: string[];
44
+ placement: string;
45
+ } | undefined;
46
+ /**
47
+ * 表单项组件面板
48
+ *
49
+ * @param {Object=} panels
50
+ * @param {string=} key
51
+ * `property` 属性
52
+ * `common` 常用
53
+ * `status` 状态
54
+ * `validation` 校验
55
+ * `style` 样式
56
+ * `event` 事件
57
+ * @param {string=} panels.body - 配置面板Schema
58
+ * @param {boolean=} panels.replace - 是否完全替换默认Schema,默认追加
59
+ * @param {Array} panels.validation.validationType - 默认显示的校验类型
60
+ */
61
+ export declare const formItemControl: (panels: Partial<Record<FormItemControlPanel, {
62
+ /**
63
+ * 标题
64
+ */
65
+ title?: string;
66
+ /**
67
+ * 配置项内容
68
+ */
69
+ body?: any;
70
+ /**
71
+ * 是否完全替换默认配置项
72
+ */
73
+ replace?: boolean;
74
+ /**
75
+ * 配置项倒序排列
76
+ */
77
+ reverse?: boolean;
78
+ /**
79
+ * 是否隐藏面板
80
+ */
81
+ hidden?: boolean;
82
+ /**
83
+ * 配置项排序优先级
84
+ */
85
+ order?: Record<string, number>;
86
+ /**
87
+ * 默认支持的校验规则
88
+ */
89
+ validationType?: ValidationOptions;
90
+ }>>, context?: BaseEventContext) => Array<any>;
91
+ export declare function tipedLabel(body: string | Array<SchemaObject>, tip: string): {
92
+ type: string;
93
+ tooltip: string;
94
+ tooltipTheme: string;
95
+ placement: string;
96
+ tooltipStyle: {
97
+ fontSize: string;
98
+ };
99
+ className: string;
100
+ body: string | SchemaObject[];
101
+ };
102
+ /**
103
+ * 信息提示组件模版
104
+ */
105
+ export declare function remarkTpl(config: {
106
+ name: 'remark' | 'labelRemark';
107
+ label: string;
108
+ labelRemark?: string;
109
+ }): {
110
+ type: string;
111
+ formType: string;
112
+ className: string;
113
+ label: string | {
114
+ type: string;
115
+ tooltip: string;
116
+ tooltipTheme: string;
117
+ placement: string;
118
+ tooltipStyle: {
119
+ fontSize: string;
120
+ };
121
+ className: string;
122
+ body: string | SchemaObject[];
123
+ };
124
+ bulk: boolean;
125
+ name: "labelRemark" | "remark";
126
+ pipeIn: (value: any) => boolean;
127
+ pipeOut: (value: any) => any;
128
+ form: {
129
+ size: string;
130
+ className: string;
131
+ mode: string;
132
+ horizontal: {
133
+ left: number;
134
+ right: number;
135
+ justify: boolean;
136
+ };
137
+ body: {
138
+ type: string;
139
+ className: string;
140
+ gap: string;
141
+ columns: ({
142
+ md: string;
143
+ body: ({
144
+ name: string;
145
+ type: string;
146
+ label: string;
147
+ placeholder: string;
148
+ } | {
149
+ name: string;
150
+ type: string;
151
+ label: string;
152
+ placeholder?: undefined;
153
+ })[];
154
+ } | {
155
+ md: string;
156
+ body: ({
157
+ name: string;
158
+ type: string;
159
+ size: string;
160
+ label: string;
161
+ options: {
162
+ label: string;
163
+ value: string;
164
+ }[];
165
+ className?: undefined;
166
+ labelRemark?: undefined;
167
+ multiple?: undefined;
168
+ pipeIn?: undefined;
169
+ pipeOut?: undefined;
170
+ visibleOn?: undefined;
171
+ mode?: undefined;
172
+ inputClassName?: undefined;
173
+ } | {
174
+ name: string;
175
+ label: string;
176
+ type: string;
177
+ className: string;
178
+ size?: undefined;
179
+ options?: undefined;
180
+ labelRemark?: undefined;
181
+ multiple?: undefined;
182
+ pipeIn?: undefined;
183
+ pipeOut?: undefined;
184
+ visibleOn?: undefined;
185
+ mode?: undefined;
186
+ inputClassName?: undefined;
187
+ } | {
188
+ name: string;
189
+ label: string;
190
+ type: string;
191
+ labelRemark: {
192
+ content: any;
193
+ className: string;
194
+ icon: string;
195
+ trigger: string[];
196
+ placement: string;
197
+ } | undefined;
198
+ size?: undefined;
199
+ options?: undefined;
200
+ className?: undefined;
201
+ multiple?: undefined;
202
+ pipeIn?: undefined;
203
+ pipeOut?: undefined;
204
+ visibleOn?: undefined;
205
+ mode?: undefined;
206
+ inputClassName?: undefined;
207
+ } | {
208
+ name: string;
209
+ type: string;
210
+ label: string;
211
+ labelRemark: {
212
+ content: any;
213
+ className: string;
214
+ icon: string;
215
+ trigger: string[];
216
+ placement: string;
217
+ } | undefined;
218
+ multiple: boolean;
219
+ pipeIn: (value: any) => string | never[];
220
+ pipeOut: (value: any) => any;
221
+ options: {
222
+ label: string;
223
+ value: string;
224
+ }[];
225
+ size?: undefined;
226
+ className?: undefined;
227
+ visibleOn?: undefined;
228
+ mode?: undefined;
229
+ inputClassName?: undefined;
230
+ } | {
231
+ name: string;
232
+ visibleOn: string;
233
+ label: string;
234
+ type: string;
235
+ mode: string;
236
+ inputClassName: string;
237
+ size?: undefined;
238
+ options?: undefined;
239
+ className?: undefined;
240
+ labelRemark?: undefined;
241
+ multiple?: undefined;
242
+ pipeIn?: undefined;
243
+ pipeOut?: undefined;
244
+ })[];
245
+ })[];
246
+ };
247
+ };
248
+ };
@@ -0,0 +1,14 @@
1
+ import type { FormControlProps } from 'amis-core';
2
+ import React from 'react';
3
+ export declare class DataBindingControl extends React.Component<FormControlProps> {
4
+ handleConfirm(result: {
5
+ value: string;
6
+ schema: any;
7
+ }): void;
8
+ handlePickerOpen(): Promise<{
9
+ schemas: any;
10
+ }>;
11
+ render(): JSX.Element;
12
+ }
13
+ export declare class DataBindingControlRenderer extends DataBindingControl {
14
+ }
@@ -0,0 +1,13 @@
1
+ import type { FormControlProps } from 'amis-core';
2
+ import React from 'react';
3
+ declare class DataPickerControl extends React.Component<FormControlProps> {
4
+ handleConfirm(value: string): void;
5
+ handlePickerOpen(): Promise<{
6
+ variables: any[];
7
+ variableMode: string;
8
+ }>;
9
+ render(): JSX.Element;
10
+ }
11
+ export declare class DataPickerControlRenderer extends DataPickerControl {
12
+ }
13
+ export {};
@@ -0,0 +1,83 @@
1
+ /**
2
+ * @file 时间选择器的快捷键
3
+ */
4
+ import React from 'react';
5
+ import Sortable from 'sortablejs';
6
+ import type { FormControlProps } from 'amis-core';
7
+ import type { BaseEventContext } from '../../plugin';
8
+ declare type RangesType = Array<string | {
9
+ label: string;
10
+ range: any;
11
+ }>;
12
+ declare type DropDownOption = {
13
+ [key: string]: string;
14
+ };
15
+ export interface DateShortCutControlProps extends FormControlProps {
16
+ className?: string;
17
+ /**
18
+ * 编辑器上下文数据,用于获取字段所在Form的其他字段
19
+ */
20
+ context: BaseEventContext;
21
+ dropDownOption: DropDownOption;
22
+ }
23
+ interface OptionsType {
24
+ label: string;
25
+ type: string;
26
+ inputValue: string;
27
+ }
28
+ interface DateShortCutControlState {
29
+ options: Array<OptionsType>;
30
+ }
31
+ export declare class DateShortCutControl extends React.PureComponent<DateShortCutControlProps, DateShortCutControlState> {
32
+ sortable?: Sortable;
33
+ drag?: HTMLElement | null;
34
+ target: HTMLElement | null;
35
+ dropDownOptionArr: Array<{
36
+ label: string;
37
+ value: string;
38
+ }>;
39
+ static defaultProps: Partial<DateShortCutControlProps>;
40
+ constructor(props: DateShortCutControlProps);
41
+ initOptions(ranges: RangesType): void;
42
+ /**
43
+ * 添加
44
+ */
45
+ addItem(item: {
46
+ label: string;
47
+ value: string;
48
+ }): void;
49
+ dragRef(ref: any): void;
50
+ scrollToBottom(): void;
51
+ /**
52
+ * 初始化拖动
53
+ */
54
+ initDragging(): void;
55
+ /**
56
+ * 拖动的销毁
57
+ */
58
+ destroyDragging(): void;
59
+ /**
60
+ * 生成内容体
61
+ */
62
+ renderContent(): JSX.Element;
63
+ /**
64
+ * 生成选项
65
+ */
66
+ renderOption(option: OptionsType, index: number): JSX.Element;
67
+ /**
68
+ * 输入框的改变
69
+ */
70
+ onInputChange(index: number, value: string, key: 'inputValue' | 'label'): void;
71
+ /**
72
+ * 删除选项
73
+ */
74
+ handleDelete(index: number, e: React.UIEvent<any>): void;
75
+ /**
76
+ * 更新options字段的统一出口
77
+ */
78
+ onChangeOptions(): void;
79
+ render(): JSX.Element;
80
+ }
81
+ export declare class DateShortCutControlRender extends DateShortCutControl {
82
+ }
83
+ export {};
@@ -0,0 +1,51 @@
1
+ /**
2
+ * @file 表达式控件
3
+ */
4
+ /// <reference types="lodash" />
5
+ import React from 'react';
6
+ import type { VariableItem, FuncGroup } from 'amis-ui/lib/components/formula/Editor';
7
+ import type { FormControlProps } from 'amis-core';
8
+ import type { BaseEventContext } from '../../plugin';
9
+ export interface FormulaControlProps extends FormControlProps {
10
+ /**
11
+ * evalMode 即直接就是表达式,否则
12
+ * 需要 ${这里面才是表达式}
13
+ * 默认为 true
14
+ */
15
+ evalMode?: boolean;
16
+ /**
17
+ * 用于提示的变量集合,默认为空
18
+ */
19
+ variables: Array<VariableItem>;
20
+ /**
21
+ * 变量展现模式,可选值:'tabs' | 'tree'
22
+ */
23
+ variableMode?: 'tabs' | 'tree';
24
+ /**
25
+ * 函数集合,默认不需要传,即 amis-formula 里面那个函数
26
+ * 如果有扩充,则需要传。
27
+ */
28
+ functions: Array<FuncGroup>;
29
+ /**
30
+ * 顶部标题,默认为表达式
31
+ */
32
+ header: string;
33
+ /**
34
+ * 编辑器上下文数据,用于获取字段所在Form的其他字段
35
+ */
36
+ context: BaseEventContext;
37
+ /**
38
+ * simple 简易模式
39
+ */
40
+ simple?: boolean;
41
+ }
42
+ export default class FormulaControl extends React.Component<FormulaControlProps> {
43
+ static defaultProps: Partial<FormulaControlProps>;
44
+ constructor(props: FormulaControlProps);
45
+ normalizeVariables(variables?: Array<VariableItem>): any[];
46
+ handleConfirm(value: any): void;
47
+ handleSimpleInputChange: import("lodash").DebouncedFunc<(value: string) => void>;
48
+ render(): JSX.Element;
49
+ }
50
+ export declare class FormulaControlRenderer extends FormulaControl {
51
+ }
@@ -6,6 +6,7 @@ import Sortable from 'sortablejs';
6
6
  import type { Option } from 'amis';
7
7
  import type { FormControlProps } from 'amis-core';
8
8
  import type { OptionValue } from 'amis-core';
9
+ import { SchemaApi } from 'amis/lib/Schema';
9
10
  export declare type valueType = 'text' | 'boolean' | 'number';
10
11
  export interface PopoverForm {
11
12
  optionLabel: string;
@@ -20,21 +21,18 @@ export interface OptionControlProps extends FormControlProps {
20
21
  }
21
22
  export interface OptionControlState {
22
23
  options: Array<OptionControlItem>;
23
- popOverData: any;
24
- popOverCtx?: {
25
- mode: 'add' | 'edit';
26
- index?: number;
27
- };
24
+ api: SchemaApi;
25
+ labelField: string;
26
+ valueField: string;
28
27
  source: 'custom' | 'api' | 'form';
29
- sourceOptions: Array<Option>;
30
28
  }
31
- export declare class OptionControl extends React.Component<OptionControlProps, OptionControlState> {
29
+ export default class OptionControl extends React.Component<OptionControlProps, OptionControlState> {
32
30
  sortable?: Sortable;
33
31
  drag?: HTMLElement | null;
34
32
  target: HTMLElement | null;
33
+ $comp: string;
35
34
  internalProps: string[];
36
35
  constructor(props: OptionControlProps);
37
- componentDidUpdate(prevProps: OptionControlProps): void;
38
36
  /**
39
37
  * 获取当前选项值的类型
40
38
  */
@@ -48,19 +46,9 @@ export declare class OptionControl extends React.Component<OptionControlProps, O
48
46
  */
49
47
  transformOptionValue(value: any): string;
50
48
  transformOptions(props: OptionControlProps): {
49
+ label: string | undefined;
50
+ value: any;
51
51
  checked: boolean;
52
- label?: string | undefined;
53
- scopeLabel?: string | undefined;
54
- value?: any;
55
- disabled?: boolean | undefined;
56
- children?: import("amis").Options | undefined;
57
- visible?: boolean | undefined;
58
- hidden?: boolean | undefined;
59
- description?: string | undefined;
60
- defer?: boolean | undefined;
61
- deferApi?: string | import("amis").BaseApiObject | undefined;
62
- loading?: boolean | undefined;
63
- loaded?: boolean | undefined;
64
52
  }[];
65
53
  /**
66
54
  * 处理当前组件的默认值
@@ -69,7 +57,7 @@ export declare class OptionControl extends React.Component<OptionControlProps, O
69
57
  /**
70
58
  * 更新options字段的统一出口
71
59
  */
72
- onChangeOptions(): void;
60
+ onChange(): void;
73
61
  targetRef(ref: any): void;
74
62
  dragRef(ref: any): void;
75
63
  initDragging(): void;
@@ -78,14 +66,11 @@ export declare class OptionControl extends React.Component<OptionControlProps, O
78
66
  /**
79
67
  * 切换选项类型
80
68
  */
81
- handleSourceChange(option: {
82
- label: string;
83
- value: 'custom' | 'api' | 'form';
84
- }): void;
69
+ handleSourceChange(source: 'custom' | 'api' | 'form'): void;
85
70
  /**
86
71
  * 删除选项
87
72
  */
88
- handleDelete(index: number, e: React.UIEvent<any>): void;
73
+ handleDelete(index: number): void;
89
74
  /**
90
75
  * 设置默认选项
91
76
  */
@@ -93,22 +78,19 @@ export declare class OptionControl extends React.Component<OptionControlProps, O
93
78
  /**
94
79
  * 编辑选项
95
80
  */
96
- handleEdit(index: number, e: React.UIEvent<any>): void;
97
- handleEditLabel(index: number, e: React.FocusEvent<HTMLInputElement>): void;
81
+ toggleEdit(index: number): void;
82
+ handleEditLabel(index: number, value: string): void;
98
83
  handleAdd(): void;
99
- handlePopoverSubmit(values: PopoverForm, action: any): void;
100
- closePopoverEdit(): boolean;
84
+ handleValueTypeChange(index: number, type: valueType): void;
85
+ handleValueChange(index: number, value: string): void;
101
86
  handleBatchAdd(values: {
102
87
  batchOption: string;
103
88
  }, action: any): void;
104
89
  renderHeader(): JSX.Element;
105
90
  renderOption(props: any): JSX.Element;
106
- renderPopover(): JSX.Element;
107
91
  buildBatchAddSchema(): {
108
92
  type: string;
109
93
  actionType: string;
110
- level: string;
111
- size: string;
112
94
  label: string;
113
95
  dialog: {
114
96
  title: string;
@@ -119,7 +101,10 @@ export declare class OptionControl extends React.Component<OptionControlProps, O
119
101
  body: ({
120
102
  type: string;
121
103
  level: string;
122
- body: string;
104
+ body: {
105
+ type: string;
106
+ tpl: string;
107
+ }[];
123
108
  showIcon: boolean;
124
109
  className: string;
125
110
  wrapWithPanel?: undefined;
@@ -157,6 +142,10 @@ export declare class OptionControl extends React.Component<OptionControlProps, O
157
142
  })[];
158
143
  };
159
144
  };
145
+ handleAPIChange(source: SchemaApi): void;
146
+ handleLableFieldChange(labelField: string): void;
147
+ handleValueFieldChange(valueField: string): void;
148
+ renderApiPanel(): JSX.Element | null;
160
149
  render(): JSX.Element;
161
150
  }
162
151
  export declare class OptionControlRenderer extends OptionControl {