amis-editor 4.2.0-beta.2 → 5.1.9-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. package/dist/6dbcbb49b6fd405190a9.png +0 -0
  2. package/dist/component/Editor.d.ts +16 -0
  3. package/dist/component/RegionWrapper.d.ts +10 -0
  4. package/dist/component/VRenderer.d.ts +10 -0
  5. package/dist/component/base/BackTop.d.ts +1 -1
  6. package/dist/component/control/APIControl.d.ts +1158 -0
  7. package/dist/component/control/ActionAPIControl.d.ts +1158 -0
  8. package/dist/component/control/BadgeControl.d.ts +133 -0
  9. package/dist/component/control/BaseControl.d.ts +248 -0
  10. package/dist/component/control/DataBindingControl.d.ts +14 -0
  11. package/dist/component/control/DataPickerControl.d.ts +13 -0
  12. package/dist/component/control/DateShortCutControl.d.ts +83 -0
  13. package/dist/component/control/FormulaControl.d.ts +51 -0
  14. package/dist/component/{Control → control}/OptionControl.d.ts +23 -34
  15. package/dist/component/{Control → control}/PopoverEdit.d.ts +0 -0
  16. package/dist/component/control/StatusControl.d.ts +44 -0
  17. package/dist/component/control/SwitchMoreControl.d.ts +224 -0
  18. package/dist/component/control/ValidationControl.d.ts +65 -0
  19. package/dist/component/control/ValidationItem.d.ts +46 -0
  20. package/dist/component/control/style-control/Background.d.ts +17 -0
  21. package/dist/component/control/style-control/Border.d.ts +18 -0
  22. package/dist/component/control/style-control/BoxModel.d.ts +17 -0
  23. package/dist/component/control/style-control/BoxShadow.d.ts +18 -0
  24. package/dist/component/control/style-control/Display.d.ts +14 -0
  25. package/dist/component/control/style-control/Font.d.ts +16 -0
  26. package/dist/component/control/style-control/font-family.d.ts +11 -0
  27. package/dist/component/control/style-control/transformation.d.ts +29 -0
  28. package/dist/component/control/style-control/types.d.ts +8 -0
  29. package/dist/component/schemaTpl.d.ts +8 -0
  30. package/dist/component/validator.d.ts +62 -0
  31. package/dist/dnd/index.d.ts +1 -1
  32. package/dist/event-action/action-config-panel.d.ts +8 -0
  33. package/dist/event-action/actions.d.ts +3 -0
  34. package/dist/event-action/comp-action-select.d.ts +11 -0
  35. package/dist/event-action/config.d.ts +13 -0
  36. package/dist/event-action/index.d.ts +459 -0
  37. package/dist/event-action/schema.d.ts +32 -0
  38. package/dist/exports.min.js +1 -1
  39. package/dist/index.d.ts +23 -5
  40. package/dist/index.min.js +1 -1
  41. package/dist/manager.d.ts +46 -1
  42. package/dist/plugin/Alert.d.ts +4 -2
  43. package/dist/plugin/Button.d.ts +5 -1
  44. package/dist/plugin/ButtonGroup.d.ts +13 -34
  45. package/dist/plugin/ButtonToolbar.d.ts +4 -10
  46. package/dist/plugin/CRUD.d.ts +2 -0
  47. package/dist/plugin/Chart.d.ts +2 -0
  48. package/dist/plugin/Collapse.d.ts +1 -0
  49. package/dist/plugin/CollapseGroup.d.ts +28 -4
  50. package/dist/plugin/Container.d.ts +2 -1
  51. package/dist/plugin/Dialog.d.ts +12 -2
  52. package/dist/plugin/Drawer.d.ts +12 -2
  53. package/dist/plugin/DropDownButton.d.ts +11 -11
  54. package/dist/plugin/Form/ButtonGroupSelect.d.ts +7 -2
  55. package/dist/plugin/Form/ButtonToolbar.d.ts +8 -7
  56. package/dist/plugin/Form/ChainedSelect.d.ts +3 -0
  57. package/dist/plugin/Form/Checkbox.d.ts +7 -2
  58. package/dist/plugin/Form/Checkboxes.d.ts +8 -2
  59. package/dist/plugin/Form/CodeEditor.d.ts +7 -22
  60. package/dist/plugin/Form/Combo.d.ts +3 -0
  61. package/dist/plugin/Form/Control.d.ts +6 -2
  62. package/dist/plugin/Form/DiffEditor.d.ts +7 -1
  63. package/dist/plugin/Form/Form.d.ts +6 -0
  64. package/dist/plugin/Form/Formula.d.ts +1 -25
  65. package/dist/plugin/Form/InputDate.d.ts +8 -2
  66. package/dist/plugin/Form/InputDateRange.d.ts +8 -2
  67. package/dist/plugin/Form/InputDateTime.d.ts +4 -4
  68. package/dist/plugin/Form/InputDateTimeRange.d.ts +4 -4
  69. package/dist/plugin/Form/InputEmail.d.ts +1 -0
  70. package/dist/plugin/Form/InputExcel.d.ts +6 -41
  71. package/dist/plugin/Form/InputFile.d.ts +7 -3
  72. package/dist/plugin/Form/InputKV.d.ts +6 -0
  73. package/dist/plugin/Form/InputMonth.d.ts +1 -0
  74. package/dist/plugin/Form/InputMonthRange.d.ts +4 -4
  75. package/dist/plugin/Form/InputPassword.d.ts +1 -0
  76. package/dist/plugin/Form/InputQuarter.d.ts +1 -0
  77. package/dist/plugin/Form/InputQuarterRange.d.ts +4 -4
  78. package/dist/plugin/Form/InputRange.d.ts +3 -0
  79. package/dist/plugin/Form/InputRating.d.ts +9 -3
  80. package/dist/plugin/Form/InputText.d.ts +24 -2
  81. package/dist/plugin/Form/InputTime.d.ts +3 -3
  82. package/dist/plugin/Form/InputTimeRange.d.ts +20 -0
  83. package/dist/plugin/Form/InputTree.d.ts +6 -2
  84. package/dist/plugin/Form/InputURL.d.ts +1 -0
  85. package/dist/plugin/Form/InputYear.d.ts +1 -0
  86. package/dist/plugin/Form/InputYearRange.d.ts +20 -0
  87. package/dist/plugin/Form/ListSelect.d.ts +6 -2
  88. package/dist/plugin/Form/LocationPicker.d.ts +1 -31
  89. package/dist/plugin/Form/NestedSelect.d.ts +5 -2
  90. package/dist/plugin/Form/Radios.d.ts +7 -2
  91. package/dist/plugin/Form/Select.d.ts +7 -2
  92. package/dist/plugin/Form/Switch.d.ts +7 -2
  93. package/dist/plugin/Form/TabsTransfer.d.ts +5 -2
  94. package/dist/plugin/Form/Textarea.d.ts +7 -1
  95. package/dist/plugin/Form/Transfer.d.ts +5 -2
  96. package/dist/plugin/Form/TreeSelect.d.ts +6 -2
  97. package/dist/plugin/IFrame.d.ts +2 -2
  98. package/dist/plugin/Nav.d.ts +1 -116
  99. package/dist/plugin/Others/Action.d.ts +5 -1
  100. package/dist/plugin/Page.d.ts +5 -2
  101. package/dist/plugin/Progress.d.ts +5 -1
  102. package/dist/plugin/Table.d.ts +2 -0
  103. package/dist/plugin/Tabs.d.ts +33 -2
  104. package/dist/plugin/TooltipWrapper.d.ts +10 -0
  105. package/dist/plugin/Tpl.d.ts +2 -1
  106. package/dist/plugin/Wizard.d.ts +4 -1
  107. package/dist/plugin.d.ts +37 -1
  108. package/dist/store/editor.d.ts +55 -28
  109. package/dist/store/node.d.ts +16 -0
  110. package/dist/style.css +1 -1
  111. package/dist/util.d.ts +36 -3
  112. package/package.json +14 -8
  113. package/src/component/schemaTpl.tsx +1209 -474
  114. package/src/plugin/Alert.tsx +69 -48
  115. package/src/plugin/AnchorNav.tsx +1 -0
  116. package/src/plugin/Audio.tsx +9 -15
  117. package/src/plugin/Avatar.tsx +2 -1
  118. package/src/plugin/Breadcrumb.tsx +2 -1
  119. package/src/plugin/Button.tsx +257 -188
  120. package/src/plugin/ButtonGroup.tsx +99 -38
  121. package/src/plugin/ButtonToolbar.tsx +7 -13
  122. package/src/plugin/CRUD.tsx +78 -136
  123. package/src/plugin/Card.tsx +1 -0
  124. package/src/plugin/Cards.tsx +8 -14
  125. package/src/plugin/Carousel.tsx +1 -1
  126. package/src/plugin/Chart.tsx +26 -14
  127. package/src/plugin/Collapse.tsx +78 -78
  128. package/src/plugin/CollapseGroup.tsx +165 -83
  129. package/src/plugin/Container.tsx +59 -6
  130. package/src/plugin/Custom.tsx +2 -8
  131. package/src/plugin/CustomRegion.tsx +4 -3
  132. package/src/plugin/Dialog.tsx +55 -24
  133. package/src/plugin/Drawer.tsx +65 -35
  134. package/src/plugin/DropDownButton.tsx +95 -79
  135. package/src/plugin/Flex.tsx +123 -65
  136. package/src/plugin/Form/ButtonGroupSelect.tsx +114 -26
  137. package/src/plugin/Form/ButtonToolbar.tsx +62 -55
  138. package/src/plugin/Form/ChainedSelect.tsx +45 -0
  139. package/src/plugin/Form/Checkbox.tsx +122 -33
  140. package/src/plugin/Form/Checkboxes.tsx +154 -87
  141. package/src/plugin/Form/CodeEditor.tsx +163 -34
  142. package/src/plugin/Form/Combo.tsx +104 -65
  143. package/src/plugin/Form/Control.tsx +16 -70
  144. package/src/plugin/Form/DiffEditor.tsx +158 -54
  145. package/src/plugin/Form/FieldSet.tsx +6 -11
  146. package/src/plugin/Form/Form.tsx +277 -70
  147. package/src/plugin/Form/Formula.tsx +8 -14
  148. package/src/plugin/Form/InputArray.tsx +7 -16
  149. package/src/plugin/Form/InputCity.tsx +1 -1
  150. package/src/plugin/Form/InputDate.tsx +344 -121
  151. package/src/plugin/Form/InputDateRange.tsx +303 -161
  152. package/src/plugin/Form/InputDateTime.tsx +6 -150
  153. package/src/plugin/Form/InputDateTimeRange.tsx +7 -187
  154. package/src/plugin/Form/InputEmail.tsx +1 -0
  155. package/src/plugin/Form/InputExcel.tsx +70 -27
  156. package/src/plugin/Form/InputFile.tsx +326 -152
  157. package/src/plugin/Form/InputImage.tsx +1 -1
  158. package/src/plugin/Form/InputKV.tsx +61 -0
  159. package/src/plugin/Form/InputMonth.tsx +3 -1
  160. package/src/plugin/Form/InputMonthRange.tsx +6 -160
  161. package/src/plugin/Form/InputNumber.tsx +1 -1
  162. package/src/plugin/Form/InputPassword.tsx +2 -0
  163. package/src/plugin/Form/InputQuarter.tsx +3 -1
  164. package/src/plugin/Form/InputQuarterRange.tsx +6 -160
  165. package/src/plugin/Form/InputRange.tsx +74 -4
  166. package/src/plugin/Form/InputRating.tsx +347 -35
  167. package/src/plugin/Form/InputRichText.tsx +2 -3
  168. package/src/plugin/Form/InputTable.tsx +33 -49
  169. package/src/plugin/Form/InputTag.tsx +1 -1
  170. package/src/plugin/Form/InputText.tsx +310 -132
  171. package/src/plugin/Form/InputTime.tsx +4 -53
  172. package/src/plugin/Form/InputTimeRange.tsx +41 -0
  173. package/src/plugin/Form/InputTree.tsx +196 -46
  174. package/src/plugin/Form/InputURL.tsx +2 -0
  175. package/src/plugin/Form/InputYear.tsx +2 -0
  176. package/src/plugin/Form/InputYearRange.tsx +41 -0
  177. package/src/plugin/Form/Item.tsx +17 -18
  178. package/src/plugin/Form/ListSelect.tsx +75 -20
  179. package/src/plugin/Form/LocationPicker.tsx +2 -7
  180. package/src/plugin/Form/MatrixCheckboxes.tsx +1 -1
  181. package/src/plugin/Form/NestedSelect.tsx +110 -43
  182. package/src/plugin/Form/Picker.tsx +2 -5
  183. package/src/plugin/Form/Radios.tsx +122 -52
  184. package/src/plugin/Form/Select.tsx +239 -168
  185. package/src/plugin/Form/Static.tsx +1 -1
  186. package/src/plugin/Form/Switch.tsx +170 -58
  187. package/src/plugin/Form/TabsTransfer.tsx +175 -79
  188. package/src/plugin/Form/Textarea.tsx +146 -36
  189. package/src/plugin/Form/Transfer.tsx +295 -233
  190. package/src/plugin/Form/TreeSelect.tsx +287 -146
  191. package/src/plugin/Grid.tsx +340 -312
  192. package/src/plugin/HBox.tsx +1 -0
  193. package/src/plugin/IFrame.tsx +21 -12
  194. package/src/plugin/Image.tsx +7 -12
  195. package/src/plugin/Images.tsx +7 -12
  196. package/src/plugin/Link.tsx +6 -12
  197. package/src/plugin/List.tsx +6 -10
  198. package/src/plugin/ListItem.tsx +1 -0
  199. package/src/plugin/Nav.tsx +7 -9
  200. package/src/plugin/Others/Action.tsx +16 -10
  201. package/src/plugin/Others/BasicToolbar.tsx +4 -1
  202. package/src/plugin/Others/TableCell.tsx +19 -39
  203. package/src/plugin/Page.tsx +315 -229
  204. package/src/plugin/Panel.tsx +6 -7
  205. package/src/plugin/Plain.tsx +3 -6
  206. package/src/plugin/Progress.tsx +234 -94
  207. package/src/plugin/Service.tsx +10 -6
  208. package/src/plugin/Table.tsx +49 -20
  209. package/src/plugin/TableView.tsx +212 -106
  210. package/src/plugin/Tabs.tsx +306 -146
  211. package/src/plugin/TooltipWrapper.tsx +231 -135
  212. package/src/plugin/Tpl.tsx +68 -52
  213. package/src/plugin/Video.tsx +9 -20
  214. package/src/plugin/Wizard.tsx +537 -336
  215. package/src/plugin/Wrapper.tsx +82 -61
  216. package/src/plugin.ts +66 -4
  217. package/static/empty.png +0 -0
  218. package/dist/component/Control/APIControl.d.ts +0 -504
  219. package/dist/component/Control/ValidationControl.d.ts +0 -30
  220. package/dist/component/remarkTpl.d.ts +0 -150
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import {registerEditorPlugin} from '../manager';
3
- import {BasePlugin, RegionConfig, RendererInfo} from '../plugin';
3
+ import {BaseEventContext, BasePlugin, RegionConfig, RendererInfo} from '../plugin';
4
4
  import {defaultValue, getSchemaTpl} from '../component/schemaTpl';
5
- import {isObject, noop} from '../util';
5
+ import {getEventControlConfig, isObject, noop} from '../util';
6
6
 
7
7
  export class DialogPlugin extends BasePlugin {
8
8
  // 关联渲染器名字
@@ -43,9 +43,41 @@ export class DialogPlugin extends BasePlugin {
43
43
  }
44
44
  ];
45
45
 
46
+ // 现在没用,后面弹窗优化后有用
47
+ events = [
48
+ {
49
+ eventName: 'confirm',
50
+ eventLabel: '确认',
51
+ description: '确认'
52
+ },
53
+ {
54
+ eventName: 'cancel',
55
+ eventLabel: '取消',
56
+ description: '取消'
57
+ }
58
+ ];
59
+
60
+ actions = [
61
+ {
62
+ actionType: 'confirm',
63
+ actionLabel: '确认',
64
+ description: '确认操作'
65
+ },
66
+ {
67
+ actionType: 'cancel',
68
+ actionLabel: '取消',
69
+ description: '取消操作'
70
+ },
71
+ {
72
+ actionType: 'setValue',
73
+ actionLabel: '更新数据',
74
+ description: '触发组件数据更新'
75
+ }
76
+ ];
77
+
46
78
  panelTitle = '弹框';
47
- panelBody = [
48
- getSchemaTpl('tabs', [
79
+ panelBodyCreator = (context: BaseEventContext) => {
80
+ return getSchemaTpl('tabs', [
49
81
  {
50
82
  title: '常规',
51
83
  body: [
@@ -55,15 +87,13 @@ export class DialogPlugin extends BasePlugin {
55
87
  name: 'title'
56
88
  },
57
89
 
58
- {
59
- type: 'switch',
90
+ getSchemaTpl('switch', {
60
91
  label: '数据映射',
61
92
  name: 'data',
62
- mode: 'inline',
63
93
  className: 'block m-b-xs',
64
94
  pipeIn: (value: any) => !!value,
65
95
  pipeOut: (value: any) => (value ? {'&': '$$'} : null)
66
- },
96
+ }),
67
97
 
68
98
  {
69
99
  type: 'tpl',
@@ -85,23 +115,17 @@ export class DialogPlugin extends BasePlugin {
85
115
  }
86
116
  },
87
117
 
88
- {
118
+ getSchemaTpl('switch', {
89
119
  label: '按 Esc 关闭弹框',
90
- type: 'switch',
91
120
  name: 'closeOnEsc',
92
- mode: 'inline',
93
- className: 'block',
94
121
  value: false
95
- },
122
+ }),
96
123
 
97
- {
124
+ getSchemaTpl('switch', {
98
125
  label: '点击弹框外区域关闭弹框',
99
- type: 'switch',
100
126
  name: 'closeOnOutside',
101
- mode: 'inline',
102
- className: 'block',
103
127
  value: false
104
- }
128
+ })
105
129
  ]
106
130
  },
107
131
  {
@@ -138,14 +162,11 @@ export class DialogPlugin extends BasePlugin {
138
162
  ]
139
163
  },
140
164
 
141
- {
165
+ getSchemaTpl('switch', {
142
166
  label: '是否显示关闭按钮',
143
- type: 'switch',
144
167
  name: 'showCloseButton',
145
- mode: 'inline',
146
- className: 'block',
147
168
  value: true
148
- },
169
+ }),
149
170
 
150
171
  getSchemaTpl('className', {
151
172
  name: 'headerClassName',
@@ -157,9 +178,19 @@ export class DialogPlugin extends BasePlugin {
157
178
  label: '内容 CSS 类名'
158
179
  })
159
180
  ]
181
+ },
182
+ {
183
+ title: '事件',
184
+ className: 'p-none',
185
+ body: [
186
+ getSchemaTpl('eventControl', {
187
+ name: 'onEvent',
188
+ ...getEventControlConfig(this.manager, context)
189
+ })
190
+ ]
160
191
  }
161
192
  ])
162
- ];
193
+ };
163
194
 
164
195
  buildSubRenderers() {}
165
196
  }
@@ -1,7 +1,7 @@
1
1
  import {registerEditorPlugin} from '../manager';
2
- import {BasePlugin, RegionConfig, RendererInfo} from '../plugin';
2
+ import {BaseEventContext, BasePlugin, RegionConfig, RendererInfo} from '../plugin';
3
3
  import {defaultValue, getSchemaTpl} from '../component/schemaTpl';
4
- import {noop} from '../util';
4
+ import {getEventControlConfig, noop} from '../util';
5
5
  import {InlineModal} from './Dialog';
6
6
 
7
7
  export class DrawerPlugin extends BasePlugin {
@@ -44,9 +44,41 @@ export class DrawerPlugin extends BasePlugin {
44
44
  }
45
45
  ];
46
46
 
47
+ // 现在没用,后面弹窗优化后有用
48
+ events = [
49
+ {
50
+ eventName: 'confirm',
51
+ eventLabel: '确认',
52
+ description: '确认'
53
+ },
54
+ {
55
+ eventName: 'cancel',
56
+ eventLabel: '取消',
57
+ description: '取消'
58
+ }
59
+ ];
60
+
61
+ actions = [
62
+ {
63
+ actionType: 'confirm',
64
+ actionLabel: '确认',
65
+ description: '确认操作'
66
+ },
67
+ {
68
+ actionType: 'cancel',
69
+ actionLabel: '取消',
70
+ description: '取消操作'
71
+ },
72
+ {
73
+ actionType: 'setValue',
74
+ actionLabel: '更新数据',
75
+ description: '触发组件数据更新'
76
+ }
77
+ ];
78
+
47
79
  panelTitle = '弹框';
48
- panelBody = [
49
- getSchemaTpl('tabs', [
80
+ panelBodyCreator = (context: BaseEventContext) => {
81
+ return getSchemaTpl('tabs', [
50
82
  {
51
83
  title: '常规',
52
84
  body: [
@@ -103,15 +135,13 @@ export class DrawerPlugin extends BasePlugin {
103
135
  description: '定义弹框从什么位置呼出'
104
136
  },
105
137
 
106
- {
107
- type: 'switch',
138
+ getSchemaTpl('switch', {
108
139
  label: '数据映射',
109
140
  name: 'data',
110
- mode: 'inline',
111
- className: 'w-full m-b-xs',
141
+ className: 'm-b-xs',
112
142
  pipeIn: (value: any) => !!value,
113
143
  pipeOut: (value: any) => (value ? {'&': '$$'} : null)
114
- },
144
+ }),
115
145
 
116
146
  {
117
147
  type: 'tpl',
@@ -130,21 +160,15 @@ export class DrawerPlugin extends BasePlugin {
130
160
  '<p>当开启数据映射时,弹框中的数据只会包含设置的部分,请绑定数据。如:<code>{"a": "\\${a}", "b": 2}</code></p><p>如果希望在默认的基础上定制,请先添加一个 Key 为 `&` Value 为 `\\$$` 作为第一行。</p><div>当值为 <code>__undefined</code>时,表示删除对应的字段,可以结合<code>{"&": "\\$$"}</code>来达到黑名单效果。</div>'
131
161
  },
132
162
 
133
- {
134
- type: 'switch',
163
+ getSchemaTpl('switch', {
135
164
  name: 'closeOnOutside',
136
- label: '点击外部关闭弹框',
137
- mode: 'inline',
138
- className: 'block'
139
- },
165
+ label: '点击外部关闭弹框'
166
+ }),
140
167
 
141
- {
142
- label: '按 Esc 可关闭?',
143
- type: 'switch',
144
- name: 'closeOnEsc',
145
- mode: 'inline',
146
- className: 'block'
147
- }
168
+ getSchemaTpl('switch', {
169
+ label: '按 Esc 可关闭',
170
+ name: 'closeOnEsc'
171
+ })
148
172
  ]
149
173
  },
150
174
  {
@@ -180,33 +204,39 @@ export class DrawerPlugin extends BasePlugin {
180
204
  }
181
205
  ]
182
206
  },
183
- {
184
- type: 'switch',
207
+
208
+ getSchemaTpl('switch', {
185
209
  name: 'overlay',
186
210
  label: '是否显示蒙层',
187
- mode: 'inline',
188
- className: 'block',
189
211
  pipeIn: defaultValue(true)
190
- },
212
+ }),
191
213
 
192
- {
193
- type: 'switch',
214
+ getSchemaTpl('switch', {
194
215
  name: 'resizable',
195
216
  label: '可拉拽',
196
- mode: 'inline',
197
- className: 'block',
198
- pipeIn: defaultValue(false),
199
- description: '定义弹框是否可拉拽调整大小'
200
- },
217
+ description: '定义弹框是否可拉拽调整大小',
218
+ pipeIn: defaultValue(false)
219
+ }),
220
+
201
221
  getSchemaTpl('className'),
202
222
  getSchemaTpl('className', {
203
223
  label: 'bodyClassName 类名',
204
224
  name: 'bodyClassName'
205
225
  })
206
226
  ]
227
+ },
228
+ {
229
+ title: '事件',
230
+ className: 'p-none',
231
+ body: [
232
+ getSchemaTpl('eventControl', {
233
+ name: 'onEvent',
234
+ ...getEventControlConfig(this.manager, context)
235
+ })
236
+ ]
207
237
  }
208
238
  ])
209
- ];
239
+ };
210
240
 
211
241
  buildSubRenderers() {}
212
242
  }
@@ -10,6 +10,7 @@ import {
10
10
  } from '../plugin';
11
11
  import {defaultValue, getSchemaTpl} from '../component/schemaTpl';
12
12
  import {diff} from '../util';
13
+ import {BUTTON_DEFAULT_ACTION, formItemControl} from '../component/control/BaseControl';
13
14
 
14
15
  export class DropDownButtonPlugin extends BasePlugin {
15
16
  // 关联渲染器名字
@@ -30,21 +31,13 @@ export class DropDownButtonPlugin extends BasePlugin {
30
31
  {
31
32
  type: 'button',
32
33
  label: '按钮1',
33
- actionType: 'dialog',
34
- dialog: {
35
- title: '系统提示',
36
- body: '对你点击了'
37
- }
34
+ ...BUTTON_DEFAULT_ACTION
38
35
  },
39
36
 
40
37
  {
41
38
  type: 'button',
42
39
  label: '按钮2',
43
- actionType: 'dialog',
44
- dialog: {
45
- title: '系统提示',
46
- body: '对你点击了'
47
- }
40
+ ...BUTTON_DEFAULT_ACTION
48
41
  }
49
42
  ]
50
43
  };
@@ -53,10 +46,11 @@ export class DropDownButtonPlugin extends BasePlugin {
53
46
  };
54
47
 
55
48
  panelTitle = '下拉按钮';
56
- panelBodyCreator = (context: BaseEventContext) =>
57
- getSchemaTpl('tabs', [
58
- {
59
- title: '常规',
49
+
50
+ panelBodyCreator = (context: BaseEventContext) => {
51
+ return formItemControl({
52
+ common: {
53
+ replace: true,
60
54
  body: [
61
55
  {
62
56
  children: (
@@ -77,10 +71,10 @@ export class DropDownButtonPlugin extends BasePlugin {
77
71
  name: 'label'
78
72
  },
79
73
  {
74
+ type: 'button-group-select',
80
75
  name: 'trigger',
81
76
  label: '触发方式',
82
- type: 'button-group-select',
83
- pipeIn: defaultValue('click'),
77
+ size: 'sm',
84
78
  options: [
85
79
  {
86
80
  label: '点击',
@@ -90,88 +84,110 @@ export class DropDownButtonPlugin extends BasePlugin {
90
84
  label: '鼠标经过',
91
85
  value: 'hover'
92
86
  }
93
- ]
87
+ ],
88
+ pipeIn: defaultValue('click')
94
89
  },
95
- {
90
+
91
+ getSchemaTpl('switch', {
96
92
  name: 'closeOnOutside',
97
93
  label: '点击外部关闭',
98
- type: 'switch',
99
- mode: 'inline',
100
- className: 'block',
101
94
  pipeIn: defaultValue(true)
102
- },
103
- {
95
+ }),
96
+
97
+ getSchemaTpl('switch', {
104
98
  name: 'closeOnClick',
105
- label: '点击内容关闭',
106
- type: 'switch',
107
- mode: 'inline',
108
- className: 'block'
109
- },
110
- getSchemaTpl('icon'),
111
- getSchemaTpl('icon', {name: 'rightIcon', label: '右侧图标'})
99
+ label: '点击内容关闭'
100
+ })
112
101
  ]
113
102
  },
114
- {
115
- title: '外观',
103
+ status: {
104
+ replace: true,
116
105
  body: [
117
- getSchemaTpl('size'),
118
- {
106
+ // getSchemaTpl('ref'),
107
+ getSchemaTpl('disabled'),
108
+ getSchemaTpl('visible')
109
+ ]
110
+ },
111
+ validation: {
112
+ hidden: true
113
+ },
114
+ style: {
115
+ replace: true,
116
+ body: [
117
+ getSchemaTpl('size', {
118
+ pipeIn: defaultValue('md')
119
+ }),
120
+
121
+ getSchemaTpl('switch', {
122
+ name: 'block',
123
+ label: '块状显示'
124
+ }),
125
+
126
+ getSchemaTpl('buttonLevel', {
119
127
  label: '展示样式',
128
+ name: 'level'
129
+ }),
130
+
131
+ {
120
132
  type: 'button-group-select',
121
- size: 'xs',
122
- name: 'level',
123
- btnActiveClassName: 'active',
124
- clearable: false,
133
+ name: 'align',
134
+ label: '菜单对齐方式',
135
+ size: 'sm',
125
136
  options: [
126
137
  {
127
- label: '默认',
128
- value: 'default',
129
- level: 'default'
138
+ label: '左对齐',
139
+ value: 'left'
130
140
  },
131
141
  {
132
- label: '',
133
- value: 'link',
134
- level: 'link'
135
- },
136
- {
137
- label: '主色',
138
- value: 'primary',
139
- level: 'primary'
140
- },
141
- {
142
- label: '提示',
143
- value: 'info',
144
- level: 'info'
145
- },
146
- {
147
- label: '成功',
148
- value: 'success',
149
- level: 'success'
150
- },
151
- {
152
- label: '警告',
153
- value: 'warning',
154
- level: 'warning'
155
- },
156
- {
157
- label: '严重',
158
- value: 'danger',
159
- level: 'danger'
142
+ label: '右对齐',
143
+ value: 'right'
160
144
  }
161
- ]
145
+ ],
146
+ pipeIn: defaultValue('left')
162
147
  },
163
- getSchemaTpl('className')
148
+
149
+ getSchemaTpl('switch', {
150
+ label: '只显示 icon',
151
+ name: 'iconOnly'
152
+ }),
153
+
154
+ getSchemaTpl('switch', {
155
+ label: '默认是否打开',
156
+ name: 'defaultIsOpened'
157
+ }),
158
+
159
+ getSchemaTpl('switch', {
160
+ label: '隐藏下拉图标',
161
+ name: 'hideCaret'
162
+ }),
163
+
164
+ getSchemaTpl('icon'),
165
+ getSchemaTpl('icon', {
166
+ name: 'rightIcon',
167
+ label: '右侧图标'
168
+ }),
169
+
170
+ getSchemaTpl('className', {
171
+ name: 'className',
172
+ label: '外层 CSS 类名'
173
+ }),
174
+
175
+ getSchemaTpl('className', {
176
+ name: 'btnClassName',
177
+ label: '按钮 CSS 类名'
178
+ }),
179
+
180
+ getSchemaTpl('className', {
181
+ name: 'menuClassName',
182
+ label: '下拉菜单 CSS 类名'
183
+ })
164
184
  ]
165
185
  },
166
- {
167
- title: '显隐',
168
- body: [
169
- getSchemaTpl('ref'),
170
- getSchemaTpl('disabled'),
171
- getSchemaTpl('visible')
172
- ]
186
+ event: {
187
+ hidden: false
173
188
  }
174
- ]);
189
+ }, context);
190
+ }
175
191
 
176
192
  buildEditorToolbar(
177
193
  {id, info}: BaseEventContext,