amis-editor 4.0.1-beta.10 → 4.0.1-beta.28

Sign up to get free protection for your applications and to get access to all the features.
Files changed (174) hide show
  1. package/dist/cebfe0bc5a1dbde02da1.svg +10 -0
  2. package/dist/component/Control/APIControl.d.ts +504 -0
  3. package/dist/component/Control/OptionControl.d.ts +163 -0
  4. package/dist/component/Control/PopoverEdit.d.ts +57 -0
  5. package/dist/component/Control/ValidationControl.d.ts +30 -0
  6. package/dist/component/Editor.d.ts +1 -0
  7. package/dist/component/Panel/AMisCodeEditor.d.ts +37 -0
  8. package/dist/component/Panel/AvailableRenderersPanel.d.ts +10 -0
  9. package/dist/component/Panel/CodeEditorPanel.d.ts +6 -0
  10. package/dist/component/Panel/ContextMenuPanel.d.ts +8 -0
  11. package/dist/component/Panel/DrawerPanel.d.ts +15 -0
  12. package/dist/component/Panel/InsertSubRendererPanel.d.ts +11 -0
  13. package/dist/component/Panel/LeftPanels.d.ts +20 -0
  14. package/dist/component/Panel/Outline.d.ts +18 -0
  15. package/dist/component/Panel/RenderersPanel.d.ts +32 -0
  16. package/dist/component/Panel/RightPanels.d.ts +21 -0
  17. package/dist/component/Panel/TargetNamePanel.d.ts +7 -0
  18. package/dist/component/Preview.d.ts +1 -0
  19. package/dist/component/ScaffoldModal.d.ts +1 -1
  20. package/dist/component/base/BackTop.d.ts +26 -0
  21. package/dist/component/base/ErrorRenderer.d.ts +4 -0
  22. package/dist/component/base/InputComponentName.d.ts +8 -0
  23. package/dist/component/base/SearchRendererPanel.d.ts +59 -0
  24. package/dist/component/base/WidthDraggableBtn.d.ts +16 -0
  25. package/dist/component/base/WidthDraggableContainer.d.ts +2 -0
  26. package/dist/component/remarkTpl.d.ts +150 -0
  27. package/dist/exports.d.ts +8 -0
  28. package/dist/exports.min.js +1 -0
  29. package/dist/index.d.ts +18 -14
  30. package/dist/index.min.js +1 -1
  31. package/dist/manager.d.ts +3 -0
  32. package/dist/plugin/Alert.d.ts +2 -1
  33. package/dist/plugin/AnchorNav.d.ts +1 -0
  34. package/dist/plugin/Audio.d.ts +1 -0
  35. package/dist/plugin/Avatar.d.ts +1 -0
  36. package/dist/plugin/Breadcrumb.d.ts +1 -0
  37. package/dist/plugin/Button.d.ts +1 -0
  38. package/dist/plugin/ButtonGroup.d.ts +1 -0
  39. package/dist/plugin/ButtonToolbar.d.ts +1 -0
  40. package/dist/plugin/CRUD.d.ts +1 -0
  41. package/dist/plugin/Card.d.ts +1 -1
  42. package/dist/plugin/Cards.d.ts +1 -0
  43. package/dist/plugin/Carousel.d.ts +1 -0
  44. package/dist/plugin/Chart.d.ts +1 -0
  45. package/dist/plugin/CodeView.d.ts +1 -0
  46. package/dist/plugin/Collapse.d.ts +1 -0
  47. package/dist/plugin/Container.d.ts +1 -0
  48. package/dist/plugin/Custom.d.ts +1 -0
  49. package/dist/plugin/Date.d.ts +1 -0
  50. package/dist/plugin/Datetime.d.ts +1 -0
  51. package/dist/plugin/Dialog.d.ts +1 -0
  52. package/dist/plugin/Divider.d.ts +1 -0
  53. package/dist/plugin/Drawer.d.ts +1 -0
  54. package/dist/plugin/DropDownButton.d.ts +1 -0
  55. package/dist/plugin/Each.d.ts +1 -0
  56. package/dist/plugin/ErrorRenderer.d.ts +1 -0
  57. package/dist/plugin/Flex.d.ts +1 -1
  58. package/dist/plugin/Form/ButtonGroupSelect.d.ts +1 -0
  59. package/dist/plugin/Form/ButtonToolbar.d.ts +1 -0
  60. package/dist/plugin/Form/ChainedSelect.d.ts +1 -0
  61. package/dist/plugin/Form/Checkbox.d.ts +1 -0
  62. package/dist/plugin/Form/Checkboxes.d.ts +1 -0
  63. package/dist/plugin/Form/CodeEditor.d.ts +40 -0
  64. package/dist/plugin/Form/Combo.d.ts +1 -0
  65. package/dist/plugin/Form/ConditionBuilder.d.ts +1 -0
  66. package/dist/plugin/Form/Control.d.ts +1 -0
  67. package/dist/plugin/Form/DiffEditor.d.ts +1 -0
  68. package/dist/plugin/Form/FieldSet.d.ts +1 -0
  69. package/dist/plugin/Form/Form.d.ts +1 -0
  70. package/dist/plugin/Form/Formula.d.ts +1 -0
  71. package/dist/plugin/Form/Group.d.ts +1 -0
  72. package/dist/plugin/Form/Hidden.d.ts +1 -0
  73. package/dist/plugin/Form/InputArray.d.ts +1 -0
  74. package/dist/plugin/Form/InputCity.d.ts +1 -0
  75. package/dist/plugin/Form/InputColor.d.ts +1 -0
  76. package/dist/plugin/Form/InputDate.d.ts +1 -0
  77. package/dist/plugin/Form/InputDateRange.d.ts +1 -0
  78. package/dist/plugin/Form/InputDateTime.d.ts +1 -0
  79. package/dist/plugin/Form/InputDateTimeRange.d.ts +1 -0
  80. package/dist/plugin/Form/InputEmail.d.ts +1 -0
  81. package/dist/plugin/Form/InputExcel.d.ts +1 -0
  82. package/dist/plugin/Form/InputFile.d.ts +1 -0
  83. package/dist/plugin/Form/InputGroup.d.ts +1 -0
  84. package/dist/plugin/Form/InputImage.d.ts +1 -0
  85. package/dist/plugin/Form/InputKV.d.ts +1 -0
  86. package/dist/plugin/Form/InputMonth.d.ts +1 -0
  87. package/dist/plugin/Form/InputMonthRange.d.ts +1 -0
  88. package/dist/plugin/Form/InputNumber.d.ts +1 -0
  89. package/dist/plugin/Form/InputPassword.d.ts +1 -0
  90. package/dist/plugin/Form/InputQuarter.d.ts +1 -0
  91. package/dist/plugin/Form/InputQuarterRange.d.ts +1 -0
  92. package/dist/plugin/Form/InputRange.d.ts +1 -0
  93. package/dist/plugin/Form/InputRating.d.ts +2 -1
  94. package/dist/plugin/Form/InputRepeat.d.ts +1 -0
  95. package/dist/plugin/Form/InputRichText.d.ts +1 -0
  96. package/dist/plugin/Form/InputSubForm.d.ts +1 -0
  97. package/dist/plugin/Form/InputTable.d.ts +1 -1
  98. package/dist/plugin/Form/InputTag.d.ts +1 -0
  99. package/dist/plugin/Form/InputText.d.ts +1 -0
  100. package/dist/plugin/Form/InputTime.d.ts +1 -0
  101. package/dist/plugin/Form/InputTree.d.ts +1 -0
  102. package/dist/plugin/Form/InputURL.d.ts +1 -0
  103. package/dist/plugin/Form/InputYear.d.ts +1 -0
  104. package/dist/plugin/Form/ListSelect.d.ts +1 -0
  105. package/dist/plugin/Form/LocationPicker.d.ts +1 -0
  106. package/dist/plugin/Form/MatrixCheckboxes.d.ts +1 -0
  107. package/dist/plugin/Form/NestedSelect.d.ts +1 -0
  108. package/dist/plugin/Form/Picker.d.ts +1 -0
  109. package/dist/plugin/Form/Radios.d.ts +1 -0
  110. package/dist/plugin/Form/Select.d.ts +1 -0
  111. package/dist/plugin/Form/Static.d.ts +1 -1
  112. package/dist/plugin/Form/Switch.d.ts +1 -0
  113. package/dist/plugin/Form/TabsTransfer.d.ts +1 -0
  114. package/dist/plugin/Form/Textarea.d.ts +1 -0
  115. package/dist/plugin/Form/Transfer.d.ts +1 -0
  116. package/dist/plugin/Form/TreeSelect.d.ts +1 -0
  117. package/dist/plugin/Form/UUID.d.ts +1 -0
  118. package/dist/plugin/Grid.d.ts +1 -0
  119. package/dist/plugin/HBox.d.ts +1 -1
  120. package/dist/plugin/IFrame.d.ts +1 -0
  121. package/dist/plugin/Image.d.ts +1 -0
  122. package/dist/plugin/Images.d.ts +1 -0
  123. package/dist/plugin/Json.d.ts +1 -0
  124. package/dist/plugin/Link.d.ts +1 -0
  125. package/dist/plugin/List.d.ts +1 -0
  126. package/dist/plugin/ListItem.d.ts +1 -1
  127. package/dist/plugin/Log.d.ts +1 -0
  128. package/dist/plugin/Mapping.d.ts +1 -0
  129. package/dist/plugin/Markdown.d.ts +1 -0
  130. package/dist/plugin/Nav.d.ts +1 -0
  131. package/dist/plugin/Operation.d.ts +1 -0
  132. package/dist/plugin/Others/Action.d.ts +6 -0
  133. package/dist/plugin/Others/BasicToolbar.d.ts +11 -0
  134. package/dist/plugin/Others/DataDebug.d.ts +19 -0
  135. package/dist/plugin/Others/TableCell.d.ts +8 -0
  136. package/dist/plugin/Others/Unknown.d.ts +5 -0
  137. package/dist/plugin/Page.d.ts +1 -0
  138. package/dist/plugin/Panel/AvailableRenderers.d.ts +8 -0
  139. package/dist/plugin/Panel/Code.d.ts +9 -0
  140. package/dist/plugin/Panel/Name.d.ts +8 -0
  141. package/dist/plugin/Panel.d.ts +16 -3
  142. package/dist/plugin/Plain.d.ts +1 -0
  143. package/dist/plugin/Progress.d.ts +1 -0
  144. package/dist/plugin/Property.d.ts +1 -0
  145. package/dist/plugin/QRCode.d.ts +1 -0
  146. package/dist/plugin/Reset.d.ts +1 -0
  147. package/dist/plugin/Service.d.ts +1 -0
  148. package/dist/plugin/Sparkline.d.ts +1 -0
  149. package/dist/plugin/Status.d.ts +1 -0
  150. package/dist/plugin/Steps.d.ts +1 -0
  151. package/dist/plugin/Submit.d.ts +1 -0
  152. package/dist/plugin/Table.d.ts +1 -0
  153. package/dist/plugin/TableCell.d.ts +0 -1
  154. package/dist/plugin/TableView.d.ts +1 -0
  155. package/dist/plugin/Tabs.d.ts +1 -0
  156. package/dist/plugin/Tasks.d.ts +1 -0
  157. package/dist/plugin/Time.d.ts +1 -0
  158. package/dist/plugin/Tpl.d.ts +1 -0
  159. package/dist/plugin/Video.d.ts +1 -0
  160. package/dist/plugin/WebComponent.d.ts +3 -26
  161. package/dist/plugin/Wizard.d.ts +1 -0
  162. package/dist/plugin/Wrapper.d.ts +1 -0
  163. package/dist/plugin.d.ts +9 -3
  164. package/dist/store/editor.d.ts +50 -4
  165. package/dist/style.css +1 -1
  166. package/dist/util.d.ts +3 -3
  167. package/package.json +17 -14
  168. package/static/Code-hover.png +0 -0
  169. package/static/Code.png +0 -0
  170. package/static/Outline-hover.png +0 -0
  171. package/static/Outline.png +0 -0
  172. package/static/Renderers-hover.png +0 -0
  173. package/static/Renderers.png +0 -0
  174. package/static/side_hide_left.svg +10 -0
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="6px" height="8px" viewBox="0 0 6 8" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <g id="折叠icon" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
4
+ <g id="折叠icon svg" transform="translate(-305.000000, -566.000000)" fill="#A1A6B3" fill-rule="nonzero">
5
+ <g id="折叠icon svg g" transform="translate(60.000000, 60.000000)">
6
+ <path d="M245.77735,506.518233 L250.375962,509.583975 C250.605727,509.737151 250.667814,510.047586 250.514637,510.27735 C250.47802,510.332276 250.430888,510.379408 250.375962,510.416025 L245.77735,513.481767 C245.547586,513.634943 245.237151,513.572856 245.083975,513.343092 C245.029219,513.260958 245,513.164454 245,513.065741 L245,506.934259 C245,506.658116 245.223858,506.434259 245.5,506.434259 C245.598712,506.434259 245.695216,506.463478 245.77735,506.518233 Z" id="矩形" transform="translate(248.000000, 510.000000) scale(-1, 1) translate(-248.000000, -510.000000) "></path>
7
+ </g>
8
+ </g>
9
+ </g>
10
+ </svg>
@@ -0,0 +1,504 @@
1
+ import React from 'react';
2
+ import { SchemaApi } from 'amis';
3
+ import type { FormControlProps } from 'amis/lib/renderers/Form/Item';
4
+ export interface APIControlProps extends FormControlProps {
5
+ name?: string;
6
+ label?: string;
7
+ value?: any;
8
+ /**
9
+ * 接口消息设置描述信息
10
+ */
11
+ messageDesc?: string;
12
+ }
13
+ export interface APIControlState {
14
+ apiStr: string;
15
+ }
16
+ export declare class APIControl extends React.Component<APIControlProps, APIControlState> {
17
+ constructor(props: APIControlProps);
18
+ componentDidUpdate(prevProps: APIControlProps): void;
19
+ transformApi2Str(value: any): string;
20
+ handleSubmit(values: SchemaApi, action: any): void;
21
+ buildActionsSchema(): {
22
+ type: string;
23
+ justify: string;
24
+ alignItems: string;
25
+ className: string;
26
+ items: ({
27
+ label: string;
28
+ type: string;
29
+ acitonType: string;
30
+ level: string;
31
+ size: string;
32
+ disabled: boolean;
33
+ actionType?: undefined;
34
+ dialog?: undefined;
35
+ } | {
36
+ label: string;
37
+ type: string;
38
+ acitonType: string;
39
+ level: string;
40
+ size: string;
41
+ actionType: string;
42
+ dialog: {
43
+ title: string;
44
+ size: string;
45
+ className: string;
46
+ headerClassName: string;
47
+ bodyClassName: string;
48
+ closeOnEsc: boolean;
49
+ closeOnOutside: boolean;
50
+ showCloseButton: boolean;
51
+ body: {
52
+ type: string;
53
+ mode: string;
54
+ onSubmit: (values: SchemaApi, action: any) => void;
55
+ body: {
56
+ type: string;
57
+ tabs: ({
58
+ title: string;
59
+ tab: {
60
+ type: string;
61
+ gap: string;
62
+ align: string;
63
+ valign: string;
64
+ columns: ({
65
+ md: number;
66
+ body: ({
67
+ label: string;
68
+ name: string;
69
+ value: string;
70
+ type: string;
71
+ mode: string;
72
+ options: {
73
+ value: string;
74
+ label: string;
75
+ }[];
76
+ placeholder?: undefined;
77
+ required?: undefined;
78
+ description?: undefined;
79
+ size?: undefined;
80
+ disabled?: undefined;
81
+ } | {
82
+ label: string;
83
+ type: string;
84
+ name: string;
85
+ placeholder: string;
86
+ required: boolean;
87
+ value?: undefined;
88
+ mode?: undefined;
89
+ options?: undefined;
90
+ description?: undefined;
91
+ size?: undefined;
92
+ disabled?: undefined;
93
+ } | {
94
+ label: string;
95
+ type: string;
96
+ name: string;
97
+ placeholder: string;
98
+ description: string;
99
+ value?: undefined;
100
+ mode?: undefined;
101
+ options?: undefined;
102
+ required?: undefined;
103
+ size?: undefined;
104
+ disabled?: undefined;
105
+ } | {
106
+ label: string;
107
+ type: string;
108
+ name: string;
109
+ description: string;
110
+ size: string;
111
+ mode: string;
112
+ options: {
113
+ label: string;
114
+ value: string;
115
+ }[];
116
+ disabled: boolean;
117
+ value?: undefined;
118
+ placeholder?: undefined;
119
+ required?: undefined;
120
+ })[];
121
+ } | {
122
+ md: number;
123
+ body: ({
124
+ label: string;
125
+ type: string;
126
+ name: string;
127
+ mode: string;
128
+ inputClassName: string;
129
+ pipeIn: (value: any) => boolean;
130
+ pipeOut: (value: any) => 3000 | undefined;
131
+ min?: undefined;
132
+ step?: undefined;
133
+ visibleOn?: undefined;
134
+ description?: undefined;
135
+ className?: undefined;
136
+ direction?: undefined;
137
+ labelRemark?: undefined;
138
+ body?: undefined;
139
+ placeholder?: undefined;
140
+ } | {
141
+ label: string;
142
+ type: string;
143
+ name: string;
144
+ mode: string;
145
+ min: number;
146
+ step: number;
147
+ visibleOn: string;
148
+ description: string;
149
+ className: string;
150
+ pipeIn: (value: any) => number;
151
+ inputClassName?: undefined;
152
+ pipeOut?: undefined;
153
+ direction?: undefined;
154
+ labelRemark?: undefined;
155
+ body?: undefined;
156
+ placeholder?: undefined;
157
+ } | {
158
+ label: string;
159
+ type: string;
160
+ name: string;
161
+ mode: string;
162
+ description: string;
163
+ inputClassName: string;
164
+ pipeIn: (value: any) => boolean;
165
+ pipeOut: (value: any) => "blob" | undefined;
166
+ min?: undefined;
167
+ step?: undefined;
168
+ visibleOn?: undefined;
169
+ className?: undefined;
170
+ direction?: undefined;
171
+ labelRemark?: undefined;
172
+ body?: undefined;
173
+ placeholder?: undefined;
174
+ } | {
175
+ type: string;
176
+ label: string;
177
+ name: string;
178
+ mode: string;
179
+ description: string;
180
+ inputClassName: string;
181
+ pipeIn?: undefined;
182
+ pipeOut?: undefined;
183
+ min?: undefined;
184
+ step?: undefined;
185
+ visibleOn?: undefined;
186
+ className?: undefined;
187
+ direction?: undefined;
188
+ labelRemark?: undefined;
189
+ body?: undefined;
190
+ placeholder?: undefined;
191
+ } | {
192
+ label: string;
193
+ type: string;
194
+ visibleOn: string;
195
+ direction: string;
196
+ labelRemark: {
197
+ trigger: string;
198
+ rootClose: boolean;
199
+ content: string;
200
+ placement: string;
201
+ };
202
+ body: ({
203
+ name: string;
204
+ type: string;
205
+ inline: boolean;
206
+ onChange: () => void;
207
+ options: ({
208
+ label: string;
209
+ value: boolean;
210
+ } | {
211
+ label: string;
212
+ value: string;
213
+ })[];
214
+ autoComplete?: undefined;
215
+ visibleOn?: undefined;
216
+ placeholder?: undefined;
217
+ className?: undefined;
218
+ } | {
219
+ name: string;
220
+ autoComplete: boolean;
221
+ visibleOn: string;
222
+ type: string;
223
+ placeholder: string;
224
+ className: string;
225
+ inline?: undefined;
226
+ onChange?: undefined;
227
+ options?: undefined;
228
+ })[];
229
+ name?: undefined;
230
+ mode?: undefined;
231
+ inputClassName?: undefined;
232
+ pipeIn?: undefined;
233
+ pipeOut?: undefined;
234
+ min?: undefined;
235
+ step?: undefined;
236
+ description?: undefined;
237
+ className?: undefined;
238
+ placeholder?: undefined;
239
+ } | {
240
+ label: string;
241
+ type: string;
242
+ name: string;
243
+ mode: string;
244
+ visibleOn: string;
245
+ inputClassName: string;
246
+ pipeIn: (value: any) => boolean;
247
+ pipeOut: (value: any) => 3000 | undefined;
248
+ min?: undefined;
249
+ step?: undefined;
250
+ description?: undefined;
251
+ className?: undefined;
252
+ direction?: undefined;
253
+ labelRemark?: undefined;
254
+ body?: undefined;
255
+ placeholder?: undefined;
256
+ } | {
257
+ label: string;
258
+ name: string;
259
+ type: string;
260
+ mode: string;
261
+ visibleOn: string;
262
+ step: number;
263
+ className: string;
264
+ description: string;
265
+ inputClassName?: undefined;
266
+ pipeIn?: undefined;
267
+ pipeOut?: undefined;
268
+ min?: undefined;
269
+ direction?: undefined;
270
+ labelRemark?: undefined;
271
+ body?: undefined;
272
+ placeholder?: undefined;
273
+ } | {
274
+ label: string;
275
+ name: string;
276
+ type: string;
277
+ mode: string;
278
+ visibleOn: string;
279
+ description: string;
280
+ inputClassName: string;
281
+ pipeIn?: undefined;
282
+ pipeOut?: undefined;
283
+ min?: undefined;
284
+ step?: undefined;
285
+ className?: undefined;
286
+ direction?: undefined;
287
+ labelRemark?: undefined;
288
+ body?: undefined;
289
+ placeholder?: undefined;
290
+ } | {
291
+ label: string;
292
+ name: string;
293
+ type: string;
294
+ mode: string;
295
+ visibleOn: string;
296
+ placeholder: string;
297
+ labelRemark: {
298
+ trigger: string;
299
+ rootClose: boolean;
300
+ content: string;
301
+ placement: string;
302
+ };
303
+ inputClassName?: undefined;
304
+ pipeIn?: undefined;
305
+ pipeOut?: undefined;
306
+ min?: undefined;
307
+ step?: undefined;
308
+ description?: undefined;
309
+ className?: undefined;
310
+ direction?: undefined;
311
+ body?: undefined;
312
+ })[];
313
+ })[];
314
+ }[];
315
+ } | {
316
+ title: string;
317
+ tab: ({
318
+ type: string;
319
+ title: string;
320
+ body: {
321
+ type: string;
322
+ gap: string;
323
+ align: string;
324
+ valign: string;
325
+ columns: ({
326
+ md: number;
327
+ body: ({
328
+ type: string;
329
+ label: string;
330
+ name: string;
331
+ mode: string;
332
+ className: string;
333
+ inputClassName: string;
334
+ labelRemark: {
335
+ trigger: string;
336
+ rootClose: boolean;
337
+ content: string;
338
+ placement: string;
339
+ };
340
+ pipeIn: (value: any) => boolean;
341
+ pipeOut: (value: any) => {
342
+ '&': string;
343
+ } | null;
344
+ syncDefaultValue?: undefined;
345
+ visibleOn?: undefined;
346
+ descriptionClassName?: undefined;
347
+ description?: undefined;
348
+ } | {
349
+ type: string;
350
+ syncDefaultValue: boolean;
351
+ name: string;
352
+ visibleOn: string;
353
+ descriptionClassName: string;
354
+ description: string;
355
+ label?: undefined;
356
+ mode?: undefined;
357
+ className?: undefined;
358
+ inputClassName?: undefined;
359
+ labelRemark?: undefined;
360
+ pipeIn?: undefined;
361
+ pipeOut?: undefined;
362
+ })[];
363
+ } | {
364
+ md: number;
365
+ body: ({
366
+ type: string;
367
+ label: string;
368
+ name: string;
369
+ mode: string;
370
+ className: string;
371
+ inputClassName: string;
372
+ labelRemark: {
373
+ trigger: string;
374
+ rootClose: boolean;
375
+ content: string;
376
+ placement: string;
377
+ };
378
+ pipeIn: (value: any) => boolean;
379
+ pipeOut: (value: any) => {
380
+ '&': string;
381
+ } | null;
382
+ syncDefaultValue?: undefined;
383
+ visibleOn?: undefined;
384
+ descriptionClassName?: undefined;
385
+ } | {
386
+ type: string;
387
+ syncDefaultValue: boolean;
388
+ name: string;
389
+ visibleOn: string;
390
+ descriptionClassName: string;
391
+ label?: undefined;
392
+ mode?: undefined;
393
+ className?: undefined;
394
+ inputClassName?: undefined;
395
+ labelRemark?: undefined;
396
+ pipeIn?: undefined;
397
+ pipeOut?: undefined;
398
+ })[];
399
+ })[];
400
+ }[];
401
+ collapsable?: undefined;
402
+ collapsed?: undefined;
403
+ } | {
404
+ type: string;
405
+ title: string;
406
+ body: ({
407
+ type: string;
408
+ label: string;
409
+ name: string;
410
+ mode: string;
411
+ className: string;
412
+ inputClassName: string;
413
+ labelRemark: {
414
+ trigger: string;
415
+ rootClose: boolean;
416
+ content: string;
417
+ placement: string;
418
+ };
419
+ pipeIn: (value: any) => boolean;
420
+ pipeOut: (value: any) => {} | null;
421
+ syncDefaultValue?: undefined;
422
+ multiple?: undefined;
423
+ visibleOn?: undefined;
424
+ items?: undefined;
425
+ } | {
426
+ type: string;
427
+ name: string;
428
+ mode: string;
429
+ syncDefaultValue: boolean;
430
+ multiple: boolean;
431
+ visibleOn: string;
432
+ items: ({
433
+ type: string;
434
+ name: string;
435
+ placeholder: string;
436
+ unique: boolean;
437
+ required: boolean;
438
+ options: {
439
+ label: string;
440
+ value: string;
441
+ }[];
442
+ disabled?: undefined;
443
+ } | {
444
+ type: string;
445
+ name: string;
446
+ placeholder: string;
447
+ disabled: boolean;
448
+ unique?: undefined;
449
+ required?: undefined;
450
+ options?: undefined;
451
+ })[];
452
+ pipeIn: (value: any) => any;
453
+ pipeOut: (value: any) => any;
454
+ label?: undefined;
455
+ className?: undefined;
456
+ inputClassName?: undefined;
457
+ labelRemark?: undefined;
458
+ })[];
459
+ collapsable?: undefined;
460
+ collapsed?: undefined;
461
+ } | {
462
+ title: string;
463
+ type: string;
464
+ collapsable: boolean;
465
+ collapsed: boolean;
466
+ body: {
467
+ type: string;
468
+ columns: {
469
+ body: {
470
+ label: string;
471
+ name: string;
472
+ type: string;
473
+ allowFullscreen: boolean;
474
+ description: string;
475
+ }[];
476
+ md: number;
477
+ }[];
478
+ }[];
479
+ })[];
480
+ } | {
481
+ title: string;
482
+ tab: {
483
+ label: string;
484
+ type: string;
485
+ name: string;
486
+ multiLine: boolean;
487
+ description: string;
488
+ items: {
489
+ label: string;
490
+ type: string;
491
+ name: string;
492
+ }[];
493
+ }[];
494
+ })[];
495
+ }[];
496
+ }[];
497
+ };
498
+ disabled?: undefined;
499
+ })[];
500
+ };
501
+ render(): JSX.Element;
502
+ }
503
+ export declare class APIControlRenderer extends APIControl {
504
+ }
@@ -0,0 +1,163 @@
1
+ /**
2
+ * @file 组件选项组件的可视化编辑控件
3
+ */
4
+ import React from 'react';
5
+ import Sortable from 'sortablejs';
6
+ import type { Option } from 'amis';
7
+ import type { FormControlProps } from 'amis/lib/renderers/Form/Item';
8
+ import type { OptionValue } from 'amis/lib/components/Select';
9
+ export declare type valueType = 'text' | 'boolean' | 'number';
10
+ export interface PopoverForm {
11
+ optionLabel: string;
12
+ optionValue: any;
13
+ optionValueType: valueType;
14
+ }
15
+ export declare type OptionControlItem = Option & {
16
+ checked: boolean;
17
+ };
18
+ export interface OptionControlProps extends FormControlProps {
19
+ className?: string;
20
+ }
21
+ export interface OptionControlState {
22
+ options: Array<OptionControlItem>;
23
+ popOverData: any;
24
+ popOverCtx?: {
25
+ mode: 'add' | 'edit';
26
+ index?: number;
27
+ };
28
+ source: 'custom' | 'api' | 'form';
29
+ sourceOptions: Array<Option>;
30
+ }
31
+ export declare class OptionControl extends React.Component<OptionControlProps, OptionControlState> {
32
+ sortable?: Sortable;
33
+ drag?: HTMLElement | null;
34
+ target: HTMLElement | null;
35
+ internalProps: string[];
36
+ constructor(props: OptionControlProps);
37
+ componentDidUpdate(prevProps: OptionControlProps): void;
38
+ /**
39
+ * 获取当前选项值的类型
40
+ */
41
+ getOptionValueType(value: any): valueType;
42
+ /**
43
+ * 将当前选项值转换为选择的类型
44
+ */
45
+ normalizeOptionValue(value: any, valueType: valueType): string | number | boolean;
46
+ /**
47
+ * 处理填入输入框的值
48
+ */
49
+ transformOptionValue(value: any): string;
50
+ transformOptions(props: OptionControlProps): {
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?: import("amis").SchemaApi | undefined;
62
+ loading?: boolean | undefined;
63
+ loaded?: boolean | undefined;
64
+ }[];
65
+ /**
66
+ * 处理当前组件的默认值
67
+ */
68
+ normalizeValue(): OptionValue | OptionValue[];
69
+ /**
70
+ * 更新options字段的统一出口
71
+ */
72
+ onChangeOptions(): void;
73
+ targetRef(ref: any): void;
74
+ dragRef(ref: any): void;
75
+ initDragging(): void;
76
+ destroyDragging(): void;
77
+ scroll2Bottom(): void;
78
+ /**
79
+ * 切换选项类型
80
+ */
81
+ handleSourceChange(option: {
82
+ label: string;
83
+ value: 'custom' | 'api' | 'form';
84
+ }): void;
85
+ /**
86
+ * 删除选项
87
+ */
88
+ handleDelete(index: number, e: React.UIEvent<any>): void;
89
+ /**
90
+ * 设置默认选项
91
+ */
92
+ handleToggleDefaultValue(index: number, checked: any, shift?: boolean): void;
93
+ /**
94
+ * 编辑选项
95
+ */
96
+ handleEdit(index: number, e: React.UIEvent<any>): void;
97
+ handleEditLabel(index: number, e: React.FocusEvent<HTMLInputElement>): void;
98
+ handleAdd(): void;
99
+ handlePopoverSubmit(values: PopoverForm, action: any): void;
100
+ closePopoverEdit(): boolean;
101
+ handleBatchAdd(values: {
102
+ batchOption: string;
103
+ }, action: any): void;
104
+ renderHeader(): JSX.Element;
105
+ renderOption(props: any): JSX.Element;
106
+ renderPopover(): JSX.Element;
107
+ buildBatchAddSchema(): {
108
+ type: string;
109
+ actionType: string;
110
+ level: string;
111
+ size: string;
112
+ label: string;
113
+ dialog: {
114
+ title: string;
115
+ headerClassName: string;
116
+ closeOnEsc: boolean;
117
+ closeOnOutside: boolean;
118
+ showCloseButton: boolean;
119
+ body: ({
120
+ type: string;
121
+ level: string;
122
+ body: string;
123
+ showIcon: boolean;
124
+ className: string;
125
+ wrapWithPanel?: undefined;
126
+ mode?: undefined;
127
+ wrapperComponent?: undefined;
128
+ resetAfterSubmit?: undefined;
129
+ autoFocus?: undefined;
130
+ preventEnterSubmit?: undefined;
131
+ horizontal?: undefined;
132
+ } | {
133
+ type: string;
134
+ wrapWithPanel: boolean;
135
+ mode: string;
136
+ wrapperComponent: string;
137
+ resetAfterSubmit: boolean;
138
+ autoFocus: boolean;
139
+ preventEnterSubmit: boolean;
140
+ horizontal: {
141
+ left: number;
142
+ right: number;
143
+ };
144
+ body: {
145
+ name: string;
146
+ type: string;
147
+ label: string;
148
+ placeholder: string;
149
+ trimContents: boolean;
150
+ minRows: number;
151
+ maxRows: number;
152
+ required: boolean;
153
+ }[];
154
+ level?: undefined;
155
+ showIcon?: undefined;
156
+ className?: undefined;
157
+ })[];
158
+ };
159
+ };
160
+ render(): JSX.Element;
161
+ }
162
+ export declare class OptionControlRenderer extends OptionControl {
163
+ }