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
@@ -1,4 +1,6 @@
1
1
  import { BasePlugin } from '../../plugin';
2
+ import type { BaseEventContext } from '../../plugin';
3
+ import { RendererAction, RendererEvent } from '../../event-action';
2
4
  export declare class TextareaControlPlugin extends BasePlugin {
3
5
  rendererName: string;
4
6
  $schema: string;
@@ -15,6 +17,10 @@ export declare class TextareaControlPlugin extends BasePlugin {
15
17
  name: string;
16
18
  };
17
19
  previewSchema: any;
20
+ notRenderFormZone: boolean;
18
21
  panelTitle: string;
19
- panelBody: any[];
22
+ events: RendererEvent[];
23
+ actions: RendererAction[];
24
+ panelJustify: boolean;
25
+ panelBodyCreator: (context: BaseEventContext) => any;
20
26
  }
@@ -1,4 +1,5 @@
1
- import { BasePlugin } from '../../plugin';
1
+ import { BasePlugin, BaseEventContext } from '../../plugin';
2
+ import { RendererAction, RendererEvent } from '../../event-action';
2
3
  export declare class TransferPlugin extends BasePlugin {
3
4
  rendererName: string;
4
5
  $schema: string;
@@ -22,6 +23,8 @@ export declare class TransferPlugin extends BasePlugin {
22
23
  };
23
24
  previewSchema: any;
24
25
  panelTitle: string;
26
+ events: RendererEvent[];
27
+ actions: RendererAction[];
25
28
  panelDefinitions: {
26
29
  options: {
27
30
  label: string;
@@ -64,5 +67,5 @@ export declare class TransferPlugin extends BasePlugin {
64
67
  })[];
65
68
  };
66
69
  };
67
- panelBody: any[];
70
+ panelBodyCreator: (context: BaseEventContext) => any;
68
71
  }
@@ -1,4 +1,5 @@
1
- import { BasePlugin } from '../../plugin';
1
+ import { RendererAction, RendererEvent } from '../../event-action';
2
+ import { BaseEventContext, BasePlugin } from '../../plugin';
2
3
  export declare class TreeSelectControlPlugin extends BasePlugin {
3
4
  rendererName: string;
4
5
  $schema: string;
@@ -26,7 +27,10 @@ export declare class TreeSelectControlPlugin extends BasePlugin {
26
27
  })[];
27
28
  };
28
29
  previewSchema: any;
30
+ notRenderFormZone: boolean;
29
31
  panelTitle: string;
32
+ events: RendererEvent[];
33
+ actions: RendererAction[];
30
34
  panelDefinitions: {
31
35
  options: {
32
36
  label: string;
@@ -69,5 +73,5 @@ export declare class TreeSelectControlPlugin extends BasePlugin {
69
73
  })[];
70
74
  };
71
75
  };
72
- panelBody: any[];
76
+ panelBodyCreator: (context: BaseEventContext) => any[];
73
77
  }
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { BasePlugin } from '../plugin';
2
+ import { BasePlugin, BaseEventContext } from '../plugin';
3
3
  export declare class IFramePlugin extends BasePlugin {
4
4
  rendererName: string;
5
5
  $schema: string;
@@ -17,7 +17,7 @@ export declare class IFramePlugin extends BasePlugin {
17
17
  tpl: string;
18
18
  };
19
19
  panelTitle: string;
20
- panelBody: any[];
20
+ panelBodyCreator: (context: BaseEventContext) => any[];
21
21
  renderRenderer(props: any): import("react").DetailedReactHTMLElement<{
22
22
  key: any;
23
23
  className: string;
@@ -41,122 +41,7 @@ export declare class NavPlugin extends BasePlugin {
41
41
  label: string;
42
42
  to: string;
43
43
  };
44
- items: ({
45
- type: string;
46
- name: string;
47
- label: string;
48
- required: boolean;
49
- direction?: undefined;
50
- className?: undefined;
51
- labelRemark?: undefined;
52
- body?: undefined;
53
- mode?: undefined;
54
- pipeIn?: undefined;
55
- pipeOut?: undefined;
56
- messages?: undefined;
57
- $ref?: undefined;
58
- visibleOn?: undefined;
59
- addButtonText?: undefined;
60
- } | {
61
- type: string;
62
- name: string;
63
- label: string;
64
- required?: undefined;
65
- direction?: undefined;
66
- className?: undefined;
67
- labelRemark?: undefined;
68
- body?: undefined;
69
- mode?: undefined;
70
- pipeIn?: undefined;
71
- pipeOut?: undefined;
72
- messages?: undefined;
73
- $ref?: undefined;
74
- visibleOn?: undefined;
75
- addButtonText?: undefined;
76
- } | {
77
- type: string;
78
- label: string;
79
- direction: string;
80
- className: string;
81
- labelRemark: {
82
- trigger: string;
83
- rootClose: boolean;
84
- className: string;
85
- content: string;
86
- placement: string;
87
- };
88
- body: ({
89
- name: string;
90
- type: string;
91
- inline: boolean;
92
- options: ({
93
- label: string;
94
- value: boolean;
95
- } | {
96
- label: string;
97
- value: string;
98
- })[];
99
- autoComplete?: undefined;
100
- visibleOn?: undefined;
101
- placeholder?: undefined;
102
- className?: undefined;
103
- } | {
104
- name: string;
105
- autoComplete: boolean;
106
- visibleOn: string;
107
- type: string;
108
- placeholder: string;
109
- className: string;
110
- inline?: undefined;
111
- options?: undefined;
112
- })[];
113
- name?: undefined;
114
- required?: undefined;
115
- mode?: undefined;
116
- pipeIn?: undefined;
117
- pipeOut?: undefined;
118
- messages?: undefined;
119
- $ref?: undefined;
120
- visibleOn?: undefined;
121
- addButtonText?: undefined;
122
- } | {
123
- type: string;
124
- label: string;
125
- name: string;
126
- mode: string;
127
- className: string;
128
- pipeIn: (value: any) => boolean;
129
- pipeOut: (value: any) => {
130
- label: string;
131
- to: string;
132
- }[] | undefined;
133
- messages: {
134
- validateFailed: string;
135
- };
136
- required?: undefined;
137
- direction?: undefined;
138
- labelRemark?: undefined;
139
- body?: undefined;
140
- $ref?: undefined;
141
- visibleOn?: undefined;
142
- addButtonText?: undefined;
143
- } | {
144
- name: string;
145
- $ref: string;
146
- visibleOn: string;
147
- label: string;
148
- addButtonText: string;
149
- type?: undefined;
150
- required?: undefined;
151
- direction?: undefined;
152
- className?: undefined;
153
- labelRemark?: undefined;
154
- body?: undefined;
155
- mode?: undefined;
156
- pipeIn?: undefined;
157
- pipeOut?: undefined;
158
- messages?: undefined;
159
- })[];
44
+ items: any[];
160
45
  };
161
46
  };
162
47
  panelBody: any[];
@@ -1,7 +1,11 @@
1
1
  import { BaseEventContext, BasePlugin, BasicPanelItem, BasicToolbarItem, BuildPanelEventContext } from '../../plugin';
2
2
  export declare class ActionPlugin extends BasePlugin {
3
3
  panelTitle: string;
4
- panelBodyCreator: (context: BaseEventContext) => any[];
4
+ panelBodyCreator: (context: BaseEventContext) => {
5
+ type: string;
6
+ className: string;
7
+ body: any[];
8
+ }[];
5
9
  buildEditorPanel(context: BuildPanelEventContext, panels: Array<BasicPanelItem>): void;
6
10
  buildEditorToolbar({ id, schema, info }: BaseEventContext, toolbars: Array<BasicToolbarItem>): void;
7
11
  editDetail(id: string): void;
@@ -1,5 +1,6 @@
1
1
  import { ContainerWrapper } from '../component/ContainerWrapper';
2
- import { BasePlugin } from '../plugin';
2
+ import { BaseEventContext, BasePlugin } from '../plugin';
3
+ import { RendererAction, RendererEvent } from '../event-action';
3
4
  import type { SchemaObject } from 'amis/lib/Schema';
4
5
  export declare class PagePlugin extends BasePlugin {
5
6
  rendererName: string;
@@ -11,6 +12,8 @@ export declare class PagePlugin extends BasePlugin {
11
12
  icon: string;
12
13
  scaffold: SchemaObject;
13
14
  previewSchema: SchemaObject;
15
+ events: RendererEvent[];
16
+ actions: RendererAction[];
14
17
  regions: ({
15
18
  key: string;
16
19
  label: string;
@@ -24,5 +27,5 @@ export declare class PagePlugin extends BasePlugin {
24
27
  })[];
25
28
  wrapper: typeof ContainerWrapper;
26
29
  panelTitle: string;
27
- panelBody: any[];
30
+ panelBodyCreator: (context: BaseEventContext) => any[];
28
31
  }
@@ -3,6 +3,7 @@ export declare class ProgressPlugin extends BasePlugin {
3
3
  rendererName: string;
4
4
  $schema: string;
5
5
  name: string;
6
+ searchKeywords: string;
6
7
  isBaseComponent: boolean;
7
8
  description: string;
8
9
  docLink: string;
@@ -11,11 +12,14 @@ export declare class ProgressPlugin extends BasePlugin {
11
12
  scaffold: {
12
13
  type: string;
13
14
  value: number;
15
+ strokeWidth: number;
14
16
  };
15
17
  previewSchema: {
16
18
  type: string;
17
19
  value: number;
20
+ strokeWidth: number;
18
21
  };
19
22
  panelTitle: string;
20
- panelBodyCreator: (context: BaseEventContext) => any[];
23
+ panelJustify: boolean;
24
+ panelBodyCreator: (context: BaseEventContext) => any;
21
25
  }
@@ -1,4 +1,5 @@
1
1
  import { BasePlugin, BaseEventContext, PluginEvent, RegionConfig, RendererInfoResolveEventContext, BasicRendererInfo, InsertEventContext, ScaffoldForm } from '../plugin';
2
+ import { EditorNodeType } from '../store/node';
2
3
  import { SchemaObject } from 'amis/lib/Schema';
3
4
  export declare class TablePlugin extends BasePlugin {
4
5
  rendererName: string;
@@ -17,4 +18,5 @@ export declare class TablePlugin extends BasePlugin {
17
18
  filterProps(props: any): any;
18
19
  getRendererInfo(context: RendererInfoResolveEventContext): BasicRendererInfo | void;
19
20
  beforeInsert(event: PluginEvent<InsertEventContext>): void;
21
+ buildDataSchemas(node: EditorNodeType, region?: EditorNodeType): Promise<any>;
20
22
  }
@@ -1,4 +1,4 @@
1
- import { BaseEventContext, BasePlugin, BasicToolbarItem, PluginEvent, PreventClickEventContext, VRendererConfig } from '../plugin';
1
+ import { BaseEventContext, BasePlugin, BasicToolbarItem, PluginEvent, PreventClickEventContext, RegionConfig, VRendererConfig } from '../plugin';
2
2
  export declare class TabsPlugin extends BasePlugin {
3
3
  rendererName: string;
4
4
  $schema: string;
@@ -22,8 +22,39 @@ export declare class TabsPlugin extends BasePlugin {
22
22
  body: string;
23
23
  }[];
24
24
  };
25
+ notRenderFormZone: boolean;
26
+ regions: Array<RegionConfig>;
25
27
  panelTitle: string;
26
- panelBody: any[];
28
+ events: {
29
+ eventName: string;
30
+ eventLabel: string;
31
+ description: string;
32
+ dataSchema: {
33
+ type: string;
34
+ properties: {
35
+ value: {
36
+ type: string;
37
+ title: string;
38
+ };
39
+ };
40
+ }[];
41
+ }[];
42
+ actions: {
43
+ actionType: string;
44
+ actionLabel: string;
45
+ description: string;
46
+ config: string[];
47
+ desc: (info: any) => JSX.Element;
48
+ schema: {
49
+ type: string;
50
+ name: string;
51
+ multiple: boolean;
52
+ strictMode: boolean;
53
+ items: any[];
54
+ };
55
+ }[];
56
+ panelJustify: boolean;
57
+ panelBodyCreator: (context: BaseEventContext) => any;
27
58
  patchContainers: string[];
28
59
  vRendererConfig: VRendererConfig;
29
60
  wrapperProps: {
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @file 文字提示容器
3
+ */
1
4
  import { BasePlugin, RegionConfig, BaseEventContext } from '../plugin';
2
5
  export declare class TooltipWrapperPlugin extends BasePlugin {
3
6
  rendererName: string;
@@ -15,6 +18,9 @@ export declare class TooltipWrapperPlugin extends BasePlugin {
15
18
  type: string;
16
19
  tpl: string;
17
20
  }[];
21
+ enterable: boolean;
22
+ showArrow: boolean;
23
+ offset: number[];
18
24
  };
19
25
  previewSchema: {
20
26
  className: string;
@@ -24,8 +30,12 @@ export declare class TooltipWrapperPlugin extends BasePlugin {
24
30
  type: string;
25
31
  tpl: string;
26
32
  }[];
33
+ enterable: boolean;
34
+ showArrow: boolean;
35
+ offset: number[];
27
36
  };
28
37
  regions: Array<RegionConfig>;
29
38
  panelTitle: string;
39
+ panelJustify: boolean;
30
40
  panelBodyCreator: (context: BaseEventContext) => any[];
31
41
  }
@@ -14,6 +14,7 @@ export declare class TplPlugin extends BasePlugin {
14
14
  };
15
15
  scaffold: any;
16
16
  panelTitle: string;
17
- panelBodyCreator: (context: BaseEventContext) => any[];
17
+ panelJustify: boolean;
18
+ panelBodyCreator: (context: BaseEventContext) => any;
18
19
  popOverBody: any[];
19
20
  }
@@ -1,4 +1,5 @@
1
1
  import { BaseEventContext, BasePlugin, BasicToolbarItem, VRendererConfig } from '../plugin';
2
+ import { RendererAction, RendererEvent } from '../event-action';
2
3
  export declare class WizardPlugin extends BasePlugin {
3
4
  rendererName: string;
4
5
  $schema: string;
@@ -31,8 +32,10 @@ export declare class WizardPlugin extends BasePlugin {
31
32
  }[];
32
33
  }[];
33
34
  };
35
+ events: RendererEvent[];
36
+ actions: RendererAction[];
34
37
  panelTitle: string;
35
- panelBody: any[];
38
+ panelBodyCreator: (context: BaseEventContext) => any[];
36
39
  /**
37
40
  * 补充切换的 toolbar
38
41
  * @param context
package/dist/plugin.d.ts CHANGED
@@ -9,6 +9,7 @@ import { DNDModeInterface } from './dnd/interface';
9
9
  import { EditorDNDManager } from './dnd';
10
10
  import React from 'react';
11
11
  import { DiffChange } from './util';
12
+ import { RendererAction, RendererEvent } from './event-action';
12
13
  import type { RendererConfig } from 'amis-core/lib/factory';
13
14
  import type { MenuDivider, MenuItem } from 'amis-ui/lib/components/ContextMenu';
14
15
  import type { BaseSchema } from 'amis/lib/Schema';
@@ -96,6 +97,10 @@ export interface VRendererConfig {
96
97
  */
97
98
  panelControls?: Array<any>;
98
99
  panelDefinitions?: any;
100
+ /**
101
+ * 配置面板两端对齐布局
102
+ */
103
+ panelJustify?: boolean;
99
104
  /**
100
105
  * @deprecated 用panelBodyCreator 代替
101
106
  */
@@ -115,6 +120,7 @@ export interface RendererScaffoldInfo {
115
120
  */
116
121
  name: string;
117
122
  icon?: string;
123
+ searchKeywords?: string;
118
124
  description?: string;
119
125
  docLink?: string;
120
126
  previewSchema?: any;
@@ -193,6 +199,7 @@ export interface RendererInfo extends RendererScaffoldInfo {
193
199
  */
194
200
  scaffoldForm?: ScaffoldForm;
195
201
  id: string;
202
+ type: string;
196
203
  plugin: PluginInterface;
197
204
  extraPlugin?: PluginInterface;
198
205
  renderer: RendererConfig;
@@ -208,7 +215,7 @@ export interface RendererInfo extends RendererScaffoldInfo {
208
215
  hostId?: string;
209
216
  memberIndex?: number;
210
217
  }
211
- export declare type BasicRendererInfo = Omit<RendererInfo, 'id' | 'plugin' | 'renderer' | 'schemaPath'>;
218
+ export declare type BasicRendererInfo = Omit<RendererInfo, 'id' | 'type' | 'plugin' | 'renderer' | 'schemaPath'>;
212
219
  export interface PopOverForm {
213
220
  title?: string;
214
221
  /**
@@ -317,6 +324,7 @@ export interface PanelItem {
317
324
  position?: 'left' | 'right';
318
325
  render?: (props: PanelProps) => JSX.Element;
319
326
  menus?: Array<any>;
327
+ isNotConfigPanel?: boolean;
320
328
  }
321
329
  export declare type BasicPanelItem = Omit<PanelItem, 'order'> & Partial<Pick<PanelItem, 'order'>>;
322
330
  export interface EventContext {
@@ -432,6 +440,7 @@ export declare type PluginEvent<T, P = any> = {
432
440
  setData: (data: P) => void;
433
441
  prevented?: boolean;
434
442
  stoped?: boolean;
443
+ pending?: Promise<any>;
435
444
  data?: P;
436
445
  };
437
446
  export declare type PluginEventFn = (e: PluginEvent<EventContext>) => false | void;
@@ -518,6 +527,25 @@ export interface PluginInterface extends Partial<BasicRendererInfo>, Partial<Bas
518
527
  panelDefinitions?: any;
519
528
  panelApi?: any;
520
529
  panelSubmitOnChange?: boolean;
530
+ /**
531
+ * 隐藏右侧面板表单项Tab
532
+ * TODO: 正式上线后要干掉这个属性
533
+ */
534
+ notRenderFormZone?: boolean;
535
+ /**
536
+ *
537
+ * 事件定义集合
538
+ */
539
+ events?: RendererEvent[];
540
+ /**
541
+ *
542
+ * 专有动作定义集合
543
+ */
544
+ actions?: RendererAction[];
545
+ /**
546
+ * 右侧面板是否需要两端对齐布局
547
+ */
548
+ panelJustify?: boolean;
521
549
  /**
522
550
  * @deprecated 用 panelBodyCreator
523
551
  */
@@ -555,6 +583,14 @@ export interface PluginInterface extends Partial<BasicRendererInfo>, Partial<Bas
555
583
  */
556
584
  asyncUpdateCustomSubRenderersInfo?: (context: RendererEventContext, subRenderers: Array<SubRendererInfo>, renderers: Array<RendererConfig>) => void;
557
585
  markDom?: (dom: HTMLElement | Array<HTMLElement>, props: any) => void;
586
+ /**
587
+ * 获取上下文数据结构
588
+ *
589
+ * @param node 当前容器节点
590
+ * @param region 所属容器节点
591
+ */
592
+ buildDataSchemas?: (node: EditorNodeType, region?: EditorNodeType) => any | Promise<any>;
593
+ rendererBeforeDispatchEvent?: (node: EditorNodeType, e: any, data: any) => void;
558
594
  }
559
595
  /**
560
596
  * 基类,所有插件都继承这个好了,可以少写些逻辑。