amis-editor 4.2.0-beta.3 → 5.1.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (221) 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/ScaffoldModal.d.ts +1 -1
  5. package/dist/component/VRenderer.d.ts +10 -0
  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 +39 -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 +1198 -474
  114. package/src/plugin/.DS_Store +0 -0
  115. package/src/plugin/Alert.tsx +69 -48
  116. package/src/plugin/AnchorNav.tsx +1 -0
  117. package/src/plugin/Audio.tsx +9 -15
  118. package/src/plugin/Avatar.tsx +2 -1
  119. package/src/plugin/Breadcrumb.tsx +2 -1
  120. package/src/plugin/Button.tsx +257 -188
  121. package/src/plugin/ButtonGroup.tsx +99 -38
  122. package/src/plugin/ButtonToolbar.tsx +7 -13
  123. package/src/plugin/CRUD.tsx +77 -135
  124. package/src/plugin/Card.tsx +1 -0
  125. package/src/plugin/Cards.tsx +8 -14
  126. package/src/plugin/Carousel.tsx +1 -1
  127. package/src/plugin/Chart.tsx +26 -14
  128. package/src/plugin/Collapse.tsx +78 -78
  129. package/src/plugin/CollapseGroup.tsx +165 -83
  130. package/src/plugin/Container.tsx +59 -6
  131. package/src/plugin/Custom.tsx +2 -8
  132. package/src/plugin/CustomRegion.tsx +4 -3
  133. package/src/plugin/Dialog.tsx +55 -24
  134. package/src/plugin/Drawer.tsx +65 -35
  135. package/src/plugin/DropDownButton.tsx +95 -79
  136. package/src/plugin/Flex.tsx +123 -65
  137. package/src/plugin/Form/ButtonGroupSelect.tsx +114 -26
  138. package/src/plugin/Form/ButtonToolbar.tsx +62 -55
  139. package/src/plugin/Form/ChainedSelect.tsx +45 -0
  140. package/src/plugin/Form/Checkbox.tsx +122 -33
  141. package/src/plugin/Form/Checkboxes.tsx +154 -87
  142. package/src/plugin/Form/CodeEditor.tsx +163 -34
  143. package/src/plugin/Form/Combo.tsx +104 -65
  144. package/src/plugin/Form/Control.tsx +16 -70
  145. package/src/plugin/Form/DiffEditor.tsx +158 -54
  146. package/src/plugin/Form/FieldSet.tsx +6 -11
  147. package/src/plugin/Form/Form.tsx +277 -70
  148. package/src/plugin/Form/Formula.tsx +8 -14
  149. package/src/plugin/Form/InputArray.tsx +7 -16
  150. package/src/plugin/Form/InputCity.tsx +1 -1
  151. package/src/plugin/Form/InputDate.tsx +344 -121
  152. package/src/plugin/Form/InputDateRange.tsx +303 -161
  153. package/src/plugin/Form/InputDateTime.tsx +6 -150
  154. package/src/plugin/Form/InputDateTimeRange.tsx +7 -187
  155. package/src/plugin/Form/InputEmail.tsx +1 -0
  156. package/src/plugin/Form/InputExcel.tsx +70 -27
  157. package/src/plugin/Form/InputFile.tsx +326 -152
  158. package/src/plugin/Form/InputImage.tsx +1 -1
  159. package/src/plugin/Form/InputKV.tsx +61 -0
  160. package/src/plugin/Form/InputMonth.tsx +3 -1
  161. package/src/plugin/Form/InputMonthRange.tsx +6 -160
  162. package/src/plugin/Form/InputNumber.tsx +1 -1
  163. package/src/plugin/Form/InputPassword.tsx +2 -0
  164. package/src/plugin/Form/InputQuarter.tsx +3 -1
  165. package/src/plugin/Form/InputQuarterRange.tsx +6 -160
  166. package/src/plugin/Form/InputRange.tsx +74 -4
  167. package/src/plugin/Form/InputRating.tsx +347 -35
  168. package/src/plugin/Form/InputRichText.tsx +2 -3
  169. package/src/plugin/Form/InputTable.tsx +33 -49
  170. package/src/plugin/Form/InputTag.tsx +1 -1
  171. package/src/plugin/Form/InputText.tsx +310 -132
  172. package/src/plugin/Form/InputTime.tsx +4 -53
  173. package/src/plugin/Form/InputTimeRange.tsx +41 -0
  174. package/src/plugin/Form/InputTree.tsx +196 -46
  175. package/src/plugin/Form/InputURL.tsx +2 -0
  176. package/src/plugin/Form/InputYear.tsx +2 -0
  177. package/src/plugin/Form/InputYearRange.tsx +41 -0
  178. package/src/plugin/Form/Item.tsx +17 -18
  179. package/src/plugin/Form/ListSelect.tsx +75 -20
  180. package/src/plugin/Form/LocationPicker.tsx +2 -7
  181. package/src/plugin/Form/MatrixCheckboxes.tsx +1 -1
  182. package/src/plugin/Form/NestedSelect.tsx +110 -43
  183. package/src/plugin/Form/Picker.tsx +2 -5
  184. package/src/plugin/Form/Radios.tsx +122 -52
  185. package/src/plugin/Form/Select.tsx +239 -168
  186. package/src/plugin/Form/Static.tsx +1 -1
  187. package/src/plugin/Form/Switch.tsx +170 -58
  188. package/src/plugin/Form/TabsTransfer.tsx +175 -79
  189. package/src/plugin/Form/Textarea.tsx +146 -36
  190. package/src/plugin/Form/Transfer.tsx +295 -233
  191. package/src/plugin/Form/TreeSelect.tsx +287 -146
  192. package/src/plugin/Grid.tsx +340 -312
  193. package/src/plugin/HBox.tsx +1 -0
  194. package/src/plugin/IFrame.tsx +21 -12
  195. package/src/plugin/Image.tsx +7 -12
  196. package/src/plugin/Images.tsx +7 -12
  197. package/src/plugin/Link.tsx +6 -12
  198. package/src/plugin/List.tsx +6 -10
  199. package/src/plugin/ListItem.tsx +1 -0
  200. package/src/plugin/Nav.tsx +7 -9
  201. package/src/plugin/Others/Action.tsx +16 -10
  202. package/src/plugin/Others/BasicToolbar.tsx +4 -1
  203. package/src/plugin/Others/TableCell.tsx +19 -39
  204. package/src/plugin/Page.tsx +315 -229
  205. package/src/plugin/Panel.tsx +6 -7
  206. package/src/plugin/Plain.tsx +3 -6
  207. package/src/plugin/Progress.tsx +234 -94
  208. package/src/plugin/Service.tsx +10 -6
  209. package/src/plugin/Table.tsx +49 -20
  210. package/src/plugin/TableView.tsx +212 -106
  211. package/src/plugin/Tabs.tsx +306 -146
  212. package/src/plugin/TooltipWrapper.tsx +231 -135
  213. package/src/plugin/Tpl.tsx +68 -52
  214. package/src/plugin/Video.tsx +9 -20
  215. package/src/plugin/Wizard.tsx +537 -336
  216. package/src/plugin/Wrapper.tsx +82 -61
  217. package/src/plugin.ts +66 -4
  218. package/static/empty.png +0 -0
  219. package/dist/component/Control/APIControl.d.ts +0 -504
  220. package/dist/component/Control/ValidationControl.d.ts +0 -30
  221. package/dist/component/remarkTpl.d.ts +0 -150
@@ -176,183 +176,195 @@ export class GridPlugin extends BasePlugin {
176
176
  panelWithOutOthers = false;
177
177
  panelBodyCreator(context: BaseEventContext) {
178
178
  const asSecondFactor = context.secondFactor;
179
+
179
180
  return [
180
- getSchemaTpl('fieldSet', {
181
- title: '插入',
182
- collapsable: false,
183
- body: [
184
- asSecondFactor
185
- ? null
186
- : {
187
- type: 'wrapper',
188
- size: 'none',
189
- className: 'grid grid-cols-2 gap-4 mb-4',
181
+ getSchemaTpl('tabs', [
182
+ {
183
+ title: '属性',
184
+ className: 'p-none',
185
+ body: [
186
+ getSchemaTpl('collapseGroup', [
187
+ {
188
+ title: '插入',
189
+ body: [
190
+ asSecondFactor
191
+ ? null
192
+ : {
193
+ type: 'wrapper',
194
+ size: 'none',
195
+ className: 'grid grid-cols-2 gap-4 mb-4',
196
+ body: [
197
+ {
198
+ children: (
199
+ <Button
200
+ size="sm"
201
+ onClick={() =>
202
+ this.insertRowAfter(context.node)
203
+ }
204
+ >
205
+ <Icon className="icon" icon="arrow-to-bottom" />
206
+ <span>下方插入新行</span>
207
+ </Button>
208
+ )
209
+ },
210
+ {
211
+ children: (
212
+ <Button
213
+ size="sm"
214
+ onClick={() =>
215
+ this.insertRowBefore(context.node)
216
+ }
217
+ >
218
+ <Icon
219
+ className="icon"
220
+ icon="top-arrow-to-top"
221
+ />
222
+ <span>上方插入新行</span>
223
+ </Button>
224
+ )
225
+ }
226
+ ]
227
+ }
228
+ ].filter(item => item)
229
+ },
230
+ {
231
+ title: '布局',
190
232
  body: [
191
233
  {
192
- children: (
193
- <Button
194
- size="sm"
195
- onClick={() => this.insertRowAfter(context.node)}
196
- >
197
- <Icon className="icon" icon="arrow-to-bottom" />
198
- <span>下方插入新行</span>
199
- </Button>
200
- )
234
+ label: '列数',
235
+ name: 'columns',
236
+ type: 'select',
237
+ pipeIn: (value: any) =>
238
+ Array.isArray(value) ? value.length : undefined,
239
+ pipeOut: (value: any, origin: any) => {
240
+ if (Array.isArray(origin)) {
241
+ if (origin.length > value) {
242
+ origin = origin.concat();
243
+ origin.splice(value - 1, origin.length - value);
244
+ } else {
245
+ origin = origin.concat(
246
+ repeatArray(
247
+ {
248
+ body: []
249
+ },
250
+ value - origin.length
251
+ )
252
+ );
253
+ }
254
+ }
255
+
256
+ return origin;
257
+ },
258
+ options: repeatArray(null, 12).map((_, index) => ({
259
+ label: `${index + 1}`,
260
+ value: index + 1
261
+ }))
201
262
  },
202
- {
203
- children: (
204
- <Button
205
- size="sm"
206
- onClick={() => this.insertRowBefore(context.node)}
207
- >
208
- <Icon className="icon" icon="top-arrow-to-top" />
209
- <span>上方插入新行</span>
210
- </Button>
211
- )
212
- }
213
- ]
214
- },
215
263
 
216
- {
217
- label: '列数',
218
- name: 'columns',
219
- type: 'select',
220
- pipeIn: (value: any) =>
221
- Array.isArray(value) ? value.length : undefined,
222
- pipeOut: (value: any, origin: any) => {
223
- if (Array.isArray(origin)) {
224
- if (origin.length > value) {
225
- origin = origin.concat();
226
- origin.splice(value - 1, origin.length - value);
227
- } else {
228
- origin = origin.concat(
229
- repeatArray(
264
+ {
265
+ type: 'button-group-select',
266
+ name: 'gap',
267
+ label: '列间距',
268
+ size: 'sm',
269
+ clearable: true,
270
+ tiled: true,
271
+ options: [
230
272
  {
231
- body: []
273
+ label: '无',
274
+ value: 'none'
232
275
  },
233
- value - origin.length
234
- )
235
- );
236
- }
237
- }
238
-
239
- return origin;
240
- },
241
- options: repeatArray(null, 12).map((_, index) => ({
242
- label: `${index + 1}`,
243
- value: index + 1
244
- }))
245
- },
246
-
247
- {
248
- type: 'button-group-select',
249
- name: 'gap',
250
- label: '列间距',
251
- size: 'sm',
252
- clearable: true,
253
- tiled: true,
254
- options: [
255
- {
256
- label: '',
257
- value: 'none'
258
- },
259
- {
260
- label: '极小',
261
- value: 'xs'
262
- },
263
- {
264
- label: '',
265
- value: 'sm'
266
- },
267
- {
268
- label: '正常',
269
- value: 'base'
270
- },
271
- {
272
- label: '',
273
- value: 'md'
274
- },
275
- {
276
- label: '',
277
- value: 'lg'
278
- }
279
- ]
280
- }
281
- ].filter(item => item)
282
- }),
283
-
284
- getSchemaTpl('fieldSet', {
285
- title: '对齐',
286
- collapsable: false,
287
- body: [
288
- {
289
- type: 'button-group-select',
290
- name: 'align',
291
- size: 'sm',
292
- label: '水平对齐',
293
- tiled: true,
294
- pipeIn: defaultValue('left'),
295
- options: [
296
- {
297
- value: 'left',
298
- label: '左对齐'
299
- },
300
- {
301
- value: 'center',
302
- label: '中间对齐'
303
- },
304
- {
305
- value: 'right',
306
- label: '右对齐'
307
- },
308
- {
309
- value: 'between',
310
- label: '两端对齐'
311
- }
312
- ]
313
- },
314
- {
315
- type: 'button-group-select',
316
- name: 'valign',
317
- size: 'sm',
318
- label: '垂直对齐',
319
- tiled: true,
320
- pipeIn: defaultValue('top'),
321
- options: [
322
- {
323
- value: 'top',
324
- label: '顶部对齐'
325
- },
326
- {
327
- value: 'middle',
328
- label: '中间对齐'
329
- },
330
- {
331
- value: 'bottom',
332
- label: '底部对齐'
333
- },
334
- {
335
- value: 'between',
336
- label: '两端对齐'
276
+ {
277
+ label: '极小',
278
+ value: 'xs'
279
+ },
280
+ {
281
+ label: '小',
282
+ value: 'sm'
283
+ },
284
+ {
285
+ label: '正常',
286
+ value: 'base'
287
+ },
288
+ {
289
+ label: '中',
290
+ value: 'md'
291
+ },
292
+ {
293
+ label: '',
294
+ value: 'lg'
295
+ }
296
+ ]
297
+ },
298
+ {
299
+ type: 'button-group-select',
300
+ name: 'align',
301
+ size: 'sm',
302
+ label: '水平对齐',
303
+ tiled: true,
304
+ pipeIn: defaultValue('left'),
305
+ options: [
306
+ {
307
+ value: 'left',
308
+ label: '左对齐'
309
+ },
310
+ {
311
+ value: 'center',
312
+ label: '中间对齐'
313
+ },
314
+ {
315
+ value: 'right',
316
+ label: '右对齐'
317
+ },
318
+ {
319
+ value: 'between',
320
+ label: '两端对齐'
321
+ }
322
+ ]
323
+ },
324
+ {
325
+ type: 'button-group-select',
326
+ name: 'valign',
327
+ size: 'sm',
328
+ label: '垂直对齐',
329
+ tiled: true,
330
+ pipeIn: defaultValue('top'),
331
+ options: [
332
+ {
333
+ value: 'top',
334
+ label: '顶部对齐'
335
+ },
336
+ {
337
+ value: 'middle',
338
+ label: '中间对齐'
339
+ },
340
+ {
341
+ value: 'bottom',
342
+ label: '底部对齐'
343
+ },
344
+ {
345
+ value: 'between',
346
+ label: '两端对齐'
347
+ }
348
+ ]
349
+ }
350
+ ]
337
351
  }
338
- ]
339
- }
340
- ]
341
- }),
342
-
343
- this.panelWithOutOthers
344
- ? null
345
- : getSchemaTpl('fieldSet', {
346
- title: '其他',
347
- collapsable: true,
348
- body: [
349
- getSchemaTpl('className'),
350
- getSchemaTpl('subFormItemMode'),
351
- getSchemaTpl('subFormHorizontalMode'),
352
- getSchemaTpl('subFormHorizontal')
353
- ]
354
- })
355
- ].filter(item => item);
352
+ ])
353
+ ]
354
+ },
355
+ this.panelWithOutOthers
356
+ ? null
357
+ : {
358
+ title: '外观',
359
+ body: [
360
+ getSchemaTpl('className'),
361
+ getSchemaTpl('subFormItemMode'),
362
+ getSchemaTpl('subFormHorizontalMode'),
363
+ getSchemaTpl('subFormHorizontal')
364
+ ]
365
+ }
366
+ ])
367
+ ];
356
368
  }
357
369
 
358
370
  vRendererConfig: VRendererConfig = {
@@ -369,155 +381,170 @@ export class GridPlugin extends BasePlugin {
369
381
  const host = context.node.host;
370
382
 
371
383
  return [
372
- getSchemaTpl('fieldSet', {
373
- title: '插入',
374
- collapsable: false,
375
- body: [
376
- {
377
- type: 'wrapper',
378
- size: 'none',
379
- className: 'grid grid-cols-2 gap-4',
380
- body: [
381
- host.isSecondFactor
382
- ? null
383
- : {
384
- children: (
385
- <Button
386
- size="sm"
387
- onClick={() => this.insertRowAfter(context.node.host)}
388
- >
389
- <Icon className="icon" icon="arrow-to-bottom" />
390
- <span>下方插入新行</span>
391
- </Button>
392
- )
393
- },
394
- host.isSecondFactor
395
- ? null
396
- : {
397
- children: (
398
- <Button
399
- size="sm"
400
- onClick={() =>
401
- this.insertRowBefore(context.node.host)
402
- }
403
- >
404
- <Icon className="icon" icon="top-arrow-to-top" />
405
- <span>上方插入新行</span>
406
- </Button>
407
- )
408
- },
409
- {
410
- children: (
411
- <Button
412
- size="sm"
413
- onClick={() => this.insertColumnBefore(context)}
414
- >
415
- <Icon className="icon" icon="left-arrow-to-left" />
416
- <span>左侧插入新列</span>
417
- </Button>
418
- )
419
- },
420
- {
421
- children: (
422
- <Button
423
- size="sm"
424
- onClick={() => this.insertColumnAfter(context)}
425
- >
426
- <Icon className="icon" icon="arrow-to-right" />
427
- <span>右侧插入新列</span>
428
- </Button>
429
- )
430
- }
431
- ].filter(item => item)
432
- }
433
- ]
434
- }),
435
- getSchemaTpl('fieldSet', {
436
- title: '宽度设置',
437
- collapsable: false,
438
- body: [
439
- {
440
- type: 'button-group-select',
441
- name: 'md',
442
- size: 'sm',
443
- label: false,
444
- pipeIn: (value: any) =>
445
- typeof value === 'number' ? 'manual' : value || '',
446
- pipeOut: (value: any) => (value === 'manual' ? 1 : value),
447
- tiled: true,
448
- options: [
449
- {
450
- value: '',
451
- label: '适配宽度'
452
- },
453
- {
454
- value: 'auto',
455
- label: '适配内容'
456
- },
457
- {
458
- value: 'manual',
459
- label: '手动'
460
- }
461
- ]
462
- },
463
-
464
- {
465
- visibleOn: 'typeof this.md === "number"',
466
- label: '宽度占比',
467
- type: 'input-range',
468
- name: 'md',
469
- min: 1,
470
- max: 12,
471
- step: 1
472
- }
473
- ]
474
- }),
475
-
476
- getSchemaTpl('fieldSet', {
477
- title: '垂直对齐',
478
- collapsable: false,
479
- body: [
480
- {
481
- type: 'button-group-select',
482
- name: 'valign',
483
- size: 'sm',
484
- label: false,
485
- tiled: true,
486
- clearable: true,
487
- options: [
488
- {
489
- value: 'top',
490
- label: '顶部对齐'
491
- },
384
+ getSchemaTpl('tabs', [
385
+ {
386
+ title: '属性',
387
+ className: 'p-none',
388
+ body: [
389
+ getSchemaTpl('collapseGroup', [
492
390
  {
493
- value: 'middle',
494
- label: '中间对齐'
391
+ title: '插入',
392
+ body: [
393
+ {
394
+ type: 'wrapper',
395
+ size: 'none',
396
+ className: 'grid grid-cols-2 gap-4',
397
+ body: [
398
+ host.isSecondFactor
399
+ ? null
400
+ : {
401
+ children: (
402
+ <Button
403
+ size="sm"
404
+ onClick={() =>
405
+ this.insertRowAfter(context.node.host)
406
+ }
407
+ >
408
+ <Icon
409
+ className="icon"
410
+ icon="arrow-to-bottom"
411
+ />
412
+ <span>下方插入新行</span>
413
+ </Button>
414
+ )
415
+ },
416
+ host.isSecondFactor
417
+ ? null
418
+ : {
419
+ children: (
420
+ <Button
421
+ size="sm"
422
+ onClick={() =>
423
+ this.insertRowBefore(context.node.host)
424
+ }
425
+ >
426
+ <Icon
427
+ className="icon"
428
+ icon="top-arrow-to-top"
429
+ />
430
+ <span>上方插入新行</span>
431
+ </Button>
432
+ )
433
+ },
434
+ {
435
+ children: (
436
+ <Button
437
+ size="sm"
438
+ onClick={() => this.insertColumnBefore(context)}
439
+ >
440
+ <Icon
441
+ className="icon"
442
+ icon="left-arrow-to-left"
443
+ />
444
+ <span>左侧插入新列</span>
445
+ </Button>
446
+ )
447
+ },
448
+ {
449
+ children: (
450
+ <Button
451
+ size="sm"
452
+ onClick={() => this.insertColumnAfter(context)}
453
+ >
454
+ <Icon className="icon" icon="arrow-to-right" />
455
+ <span>右侧插入新列</span>
456
+ </Button>
457
+ )
458
+ }
459
+ ].filter(item => item)
460
+ }
461
+ ]
495
462
  },
496
463
  {
497
- value: 'bottom',
498
- label: '底部对齐'
464
+ title: '宽度',
465
+ body: [
466
+ {
467
+ type: 'button-group-select',
468
+ name: 'md',
469
+ size: 'sm',
470
+ label: false,
471
+ pipeIn: (value: any) =>
472
+ typeof value === 'number' ? 'manual' : value || '',
473
+ pipeOut: (value: any) => (value === 'manual' ? 1 : value),
474
+ tiled: true,
475
+ options: [
476
+ {
477
+ value: '',
478
+ label: '适配宽度'
479
+ },
480
+ {
481
+ value: 'auto',
482
+ label: '适配内容'
483
+ },
484
+ {
485
+ value: 'manual',
486
+ label: '手动'
487
+ }
488
+ ]
489
+ },
490
+ {
491
+ visibleOn: 'typeof this.md === "number"',
492
+ label: '宽度占比',
493
+ type: 'input-range',
494
+ name: 'md',
495
+ min: 1,
496
+ max: 12,
497
+ step: 1
498
+ }
499
+ ]
499
500
  },
500
501
  {
501
- value: 'between',
502
- label: '两端对齐'
502
+ title: '布局',
503
+ body: [
504
+ {
505
+ type: 'button-group-select',
506
+ name: 'valign',
507
+ size: 'sm',
508
+ label: false,
509
+ tiled: true,
510
+ clearable: true,
511
+ options: [
512
+ {
513
+ value: 'top',
514
+ label: '顶部对齐'
515
+ },
516
+ {
517
+ value: 'middle',
518
+ label: '中间对齐'
519
+ },
520
+ {
521
+ value: 'bottom',
522
+ label: '底部对齐'
523
+ },
524
+ {
525
+ value: 'between',
526
+ label: '两端对齐'
527
+ }
528
+ ]
529
+ }
530
+ ]
503
531
  }
504
- ]
505
- }
506
- ]
507
- }),
508
-
509
- this.panelWithOutOthers
510
- ? null
511
- : getSchemaTpl('fieldSet', {
512
- title: 'CSS 设置',
513
- body: [
514
- getSchemaTpl('className', {
515
- label: '栏 CSS 类名',
516
- name: 'columnClassName'
517
- })
518
- ]
519
- })
520
- ].filter(item => item);
532
+ ])
533
+ ]
534
+ },
535
+ {
536
+ title: '外观',
537
+ body: [
538
+ this.panelWithOutOthers
539
+ ? null
540
+ : getSchemaTpl('className', {
541
+ label: '栏 CSS 类名',
542
+ name: 'columnClassName'
543
+ })
544
+ ]
545
+ }
546
+ ])
547
+ ];
521
548
  }
522
549
  };
523
550
 
@@ -542,6 +569,7 @@ export class GridPlugin extends BasePlugin {
542
569
  return (
543
570
  <VRenderer
544
571
  key={`${node.$$id}-${index}`}
572
+ type={info.type}
545
573
  plugin={info.plugin}
546
574
  renderer={info.renderer}
547
575
  $schema="/schemas/GridColumn.json"