amis-editor 4.2.0-beta.2 → 5.1.9-beta.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/6dbcbb49b6fd405190a9.png +0 -0
- package/dist/component/Editor.d.ts +16 -0
- package/dist/component/RegionWrapper.d.ts +10 -0
- package/dist/component/VRenderer.d.ts +10 -0
- package/dist/component/base/BackTop.d.ts +1 -1
- package/dist/component/control/APIControl.d.ts +1158 -0
- package/dist/component/control/ActionAPIControl.d.ts +1158 -0
- package/dist/component/control/BadgeControl.d.ts +133 -0
- package/dist/component/control/BaseControl.d.ts +248 -0
- package/dist/component/control/DataBindingControl.d.ts +14 -0
- package/dist/component/control/DataPickerControl.d.ts +13 -0
- package/dist/component/control/DateShortCutControl.d.ts +83 -0
- package/dist/component/control/FormulaControl.d.ts +51 -0
- package/dist/component/{Control → control}/OptionControl.d.ts +23 -34
- package/dist/component/{Control → control}/PopoverEdit.d.ts +0 -0
- package/dist/component/control/StatusControl.d.ts +44 -0
- package/dist/component/control/SwitchMoreControl.d.ts +224 -0
- package/dist/component/control/ValidationControl.d.ts +65 -0
- package/dist/component/control/ValidationItem.d.ts +46 -0
- package/dist/component/control/style-control/Background.d.ts +17 -0
- package/dist/component/control/style-control/Border.d.ts +18 -0
- package/dist/component/control/style-control/BoxModel.d.ts +17 -0
- package/dist/component/control/style-control/BoxShadow.d.ts +18 -0
- package/dist/component/control/style-control/Display.d.ts +14 -0
- package/dist/component/control/style-control/Font.d.ts +16 -0
- package/dist/component/control/style-control/font-family.d.ts +11 -0
- package/dist/component/control/style-control/transformation.d.ts +29 -0
- package/dist/component/control/style-control/types.d.ts +8 -0
- package/dist/component/schemaTpl.d.ts +8 -0
- package/dist/component/validator.d.ts +62 -0
- package/dist/dnd/index.d.ts +1 -1
- package/dist/event-action/action-config-panel.d.ts +8 -0
- package/dist/event-action/actions.d.ts +3 -0
- package/dist/event-action/comp-action-select.d.ts +11 -0
- package/dist/event-action/config.d.ts +13 -0
- package/dist/event-action/index.d.ts +459 -0
- package/dist/event-action/schema.d.ts +32 -0
- package/dist/exports.min.js +1 -1
- package/dist/index.d.ts +23 -5
- package/dist/index.min.js +1 -1
- package/dist/manager.d.ts +46 -1
- package/dist/plugin/Alert.d.ts +4 -2
- package/dist/plugin/Button.d.ts +5 -1
- package/dist/plugin/ButtonGroup.d.ts +13 -34
- package/dist/plugin/ButtonToolbar.d.ts +4 -10
- package/dist/plugin/CRUD.d.ts +2 -0
- package/dist/plugin/Chart.d.ts +2 -0
- package/dist/plugin/Collapse.d.ts +1 -0
- package/dist/plugin/CollapseGroup.d.ts +28 -4
- package/dist/plugin/Container.d.ts +2 -1
- package/dist/plugin/Dialog.d.ts +12 -2
- package/dist/plugin/Drawer.d.ts +12 -2
- package/dist/plugin/DropDownButton.d.ts +11 -11
- package/dist/plugin/Form/ButtonGroupSelect.d.ts +7 -2
- package/dist/plugin/Form/ButtonToolbar.d.ts +8 -7
- package/dist/plugin/Form/ChainedSelect.d.ts +3 -0
- package/dist/plugin/Form/Checkbox.d.ts +7 -2
- package/dist/plugin/Form/Checkboxes.d.ts +8 -2
- package/dist/plugin/Form/CodeEditor.d.ts +7 -22
- package/dist/plugin/Form/Combo.d.ts +3 -0
- package/dist/plugin/Form/Control.d.ts +6 -2
- package/dist/plugin/Form/DiffEditor.d.ts +7 -1
- package/dist/plugin/Form/Form.d.ts +6 -0
- package/dist/plugin/Form/Formula.d.ts +1 -25
- package/dist/plugin/Form/InputDate.d.ts +8 -2
- package/dist/plugin/Form/InputDateRange.d.ts +8 -2
- package/dist/plugin/Form/InputDateTime.d.ts +4 -4
- package/dist/plugin/Form/InputDateTimeRange.d.ts +4 -4
- package/dist/plugin/Form/InputEmail.d.ts +1 -0
- package/dist/plugin/Form/InputExcel.d.ts +6 -41
- package/dist/plugin/Form/InputFile.d.ts +7 -3
- package/dist/plugin/Form/InputKV.d.ts +6 -0
- package/dist/plugin/Form/InputMonth.d.ts +1 -0
- package/dist/plugin/Form/InputMonthRange.d.ts +4 -4
- package/dist/plugin/Form/InputPassword.d.ts +1 -0
- package/dist/plugin/Form/InputQuarter.d.ts +1 -0
- package/dist/plugin/Form/InputQuarterRange.d.ts +4 -4
- package/dist/plugin/Form/InputRange.d.ts +3 -0
- package/dist/plugin/Form/InputRating.d.ts +9 -3
- package/dist/plugin/Form/InputText.d.ts +24 -2
- package/dist/plugin/Form/InputTime.d.ts +3 -3
- package/dist/plugin/Form/InputTimeRange.d.ts +20 -0
- package/dist/plugin/Form/InputTree.d.ts +6 -2
- package/dist/plugin/Form/InputURL.d.ts +1 -0
- package/dist/plugin/Form/InputYear.d.ts +1 -0
- package/dist/plugin/Form/InputYearRange.d.ts +20 -0
- package/dist/plugin/Form/ListSelect.d.ts +6 -2
- package/dist/plugin/Form/LocationPicker.d.ts +1 -31
- package/dist/plugin/Form/NestedSelect.d.ts +5 -2
- package/dist/plugin/Form/Radios.d.ts +7 -2
- package/dist/plugin/Form/Select.d.ts +7 -2
- package/dist/plugin/Form/Switch.d.ts +7 -2
- package/dist/plugin/Form/TabsTransfer.d.ts +5 -2
- package/dist/plugin/Form/Textarea.d.ts +7 -1
- package/dist/plugin/Form/Transfer.d.ts +5 -2
- package/dist/plugin/Form/TreeSelect.d.ts +6 -2
- package/dist/plugin/IFrame.d.ts +2 -2
- package/dist/plugin/Nav.d.ts +1 -116
- package/dist/plugin/Others/Action.d.ts +5 -1
- package/dist/plugin/Page.d.ts +5 -2
- package/dist/plugin/Progress.d.ts +5 -1
- package/dist/plugin/Table.d.ts +2 -0
- package/dist/plugin/Tabs.d.ts +33 -2
- package/dist/plugin/TooltipWrapper.d.ts +10 -0
- package/dist/plugin/Tpl.d.ts +2 -1
- package/dist/plugin/Wizard.d.ts +4 -1
- package/dist/plugin.d.ts +37 -1
- package/dist/store/editor.d.ts +55 -28
- package/dist/store/node.d.ts +16 -0
- package/dist/style.css +1 -1
- package/dist/util.d.ts +36 -3
- package/package.json +14 -8
- package/src/component/schemaTpl.tsx +1209 -474
- package/src/plugin/Alert.tsx +69 -48
- package/src/plugin/AnchorNav.tsx +1 -0
- package/src/plugin/Audio.tsx +9 -15
- package/src/plugin/Avatar.tsx +2 -1
- package/src/plugin/Breadcrumb.tsx +2 -1
- package/src/plugin/Button.tsx +257 -188
- package/src/plugin/ButtonGroup.tsx +99 -38
- package/src/plugin/ButtonToolbar.tsx +7 -13
- package/src/plugin/CRUD.tsx +78 -136
- package/src/plugin/Card.tsx +1 -0
- package/src/plugin/Cards.tsx +8 -14
- package/src/plugin/Carousel.tsx +1 -1
- package/src/plugin/Chart.tsx +26 -14
- package/src/plugin/Collapse.tsx +78 -78
- package/src/plugin/CollapseGroup.tsx +165 -83
- package/src/plugin/Container.tsx +59 -6
- package/src/plugin/Custom.tsx +2 -8
- package/src/plugin/CustomRegion.tsx +4 -3
- package/src/plugin/Dialog.tsx +55 -24
- package/src/plugin/Drawer.tsx +65 -35
- package/src/plugin/DropDownButton.tsx +95 -79
- package/src/plugin/Flex.tsx +123 -65
- package/src/plugin/Form/ButtonGroupSelect.tsx +114 -26
- package/src/plugin/Form/ButtonToolbar.tsx +62 -55
- package/src/plugin/Form/ChainedSelect.tsx +45 -0
- package/src/plugin/Form/Checkbox.tsx +122 -33
- package/src/plugin/Form/Checkboxes.tsx +154 -87
- package/src/plugin/Form/CodeEditor.tsx +163 -34
- package/src/plugin/Form/Combo.tsx +104 -65
- package/src/plugin/Form/Control.tsx +16 -70
- package/src/plugin/Form/DiffEditor.tsx +158 -54
- package/src/plugin/Form/FieldSet.tsx +6 -11
- package/src/plugin/Form/Form.tsx +277 -70
- package/src/plugin/Form/Formula.tsx +8 -14
- package/src/plugin/Form/InputArray.tsx +7 -16
- package/src/plugin/Form/InputCity.tsx +1 -1
- package/src/plugin/Form/InputDate.tsx +344 -121
- package/src/plugin/Form/InputDateRange.tsx +303 -161
- package/src/plugin/Form/InputDateTime.tsx +6 -150
- package/src/plugin/Form/InputDateTimeRange.tsx +7 -187
- package/src/plugin/Form/InputEmail.tsx +1 -0
- package/src/plugin/Form/InputExcel.tsx +70 -27
- package/src/plugin/Form/InputFile.tsx +326 -152
- package/src/plugin/Form/InputImage.tsx +1 -1
- package/src/plugin/Form/InputKV.tsx +61 -0
- package/src/plugin/Form/InputMonth.tsx +3 -1
- package/src/plugin/Form/InputMonthRange.tsx +6 -160
- package/src/plugin/Form/InputNumber.tsx +1 -1
- package/src/plugin/Form/InputPassword.tsx +2 -0
- package/src/plugin/Form/InputQuarter.tsx +3 -1
- package/src/plugin/Form/InputQuarterRange.tsx +6 -160
- package/src/plugin/Form/InputRange.tsx +74 -4
- package/src/plugin/Form/InputRating.tsx +347 -35
- package/src/plugin/Form/InputRichText.tsx +2 -3
- package/src/plugin/Form/InputTable.tsx +33 -49
- package/src/plugin/Form/InputTag.tsx +1 -1
- package/src/plugin/Form/InputText.tsx +310 -132
- package/src/plugin/Form/InputTime.tsx +4 -53
- package/src/plugin/Form/InputTimeRange.tsx +41 -0
- package/src/plugin/Form/InputTree.tsx +196 -46
- package/src/plugin/Form/InputURL.tsx +2 -0
- package/src/plugin/Form/InputYear.tsx +2 -0
- package/src/plugin/Form/InputYearRange.tsx +41 -0
- package/src/plugin/Form/Item.tsx +17 -18
- package/src/plugin/Form/ListSelect.tsx +75 -20
- package/src/plugin/Form/LocationPicker.tsx +2 -7
- package/src/plugin/Form/MatrixCheckboxes.tsx +1 -1
- package/src/plugin/Form/NestedSelect.tsx +110 -43
- package/src/plugin/Form/Picker.tsx +2 -5
- package/src/plugin/Form/Radios.tsx +122 -52
- package/src/plugin/Form/Select.tsx +239 -168
- package/src/plugin/Form/Static.tsx +1 -1
- package/src/plugin/Form/Switch.tsx +170 -58
- package/src/plugin/Form/TabsTransfer.tsx +175 -79
- package/src/plugin/Form/Textarea.tsx +146 -36
- package/src/plugin/Form/Transfer.tsx +295 -233
- package/src/plugin/Form/TreeSelect.tsx +287 -146
- package/src/plugin/Grid.tsx +340 -312
- package/src/plugin/HBox.tsx +1 -0
- package/src/plugin/IFrame.tsx +21 -12
- package/src/plugin/Image.tsx +7 -12
- package/src/plugin/Images.tsx +7 -12
- package/src/plugin/Link.tsx +6 -12
- package/src/plugin/List.tsx +6 -10
- package/src/plugin/ListItem.tsx +1 -0
- package/src/plugin/Nav.tsx +7 -9
- package/src/plugin/Others/Action.tsx +16 -10
- package/src/plugin/Others/BasicToolbar.tsx +4 -1
- package/src/plugin/Others/TableCell.tsx +19 -39
- package/src/plugin/Page.tsx +315 -229
- package/src/plugin/Panel.tsx +6 -7
- package/src/plugin/Plain.tsx +3 -6
- package/src/plugin/Progress.tsx +234 -94
- package/src/plugin/Service.tsx +10 -6
- package/src/plugin/Table.tsx +49 -20
- package/src/plugin/TableView.tsx +212 -106
- package/src/plugin/Tabs.tsx +306 -146
- package/src/plugin/TooltipWrapper.tsx +231 -135
- package/src/plugin/Tpl.tsx +68 -52
- package/src/plugin/Video.tsx +9 -20
- package/src/plugin/Wizard.tsx +537 -336
- package/src/plugin/Wrapper.tsx +82 -61
- package/src/plugin.ts +66 -4
- package/static/empty.png +0 -0
- package/dist/component/Control/APIControl.d.ts +0 -504
- package/dist/component/Control/ValidationControl.d.ts +0 -30
- package/dist/component/remarkTpl.d.ts +0 -150
package/src/plugin/Flex.tsx
CHANGED
@@ -49,79 +49,137 @@ export class FlexPlugin extends BasePlugin {
|
|
49
49
|
panelBody = [
|
50
50
|
getSchemaTpl('tabs', [
|
51
51
|
{
|
52
|
-
title: '
|
52
|
+
title: '属性',
|
53
|
+
className: 'p-none',
|
53
54
|
body: [
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
55
|
+
getSchemaTpl('collapseGroup', [
|
56
|
+
{
|
57
|
+
title: '布局',
|
58
|
+
body: [
|
59
|
+
{
|
60
|
+
name: 'justify',
|
61
|
+
type: 'select',
|
62
|
+
value: 'center',
|
63
|
+
label: '子节点水平分布方式',
|
64
|
+
menuTpl:
|
65
|
+
"<div class='flex justify-between'><span>${label}</span><span class='text-muted text-sm'>${value}</span></div>",
|
66
|
+
options: [
|
67
|
+
{
|
68
|
+
label: '起始端对齐',
|
69
|
+
value: 'flex-start'
|
70
|
+
},
|
71
|
+
{
|
72
|
+
label: '居中对齐',
|
73
|
+
value: 'center'
|
74
|
+
},
|
75
|
+
{
|
76
|
+
label: '末尾端对齐',
|
77
|
+
value: 'flex-end'
|
78
|
+
},
|
79
|
+
{
|
80
|
+
label: '均匀分布(首尾留空)',
|
81
|
+
value: 'space-around'
|
82
|
+
},
|
83
|
+
{
|
84
|
+
label: '均匀分布(首尾对齐)',
|
85
|
+
value: 'space-between'
|
86
|
+
},
|
87
|
+
{
|
88
|
+
label: '均匀分布(元素等间距)',
|
89
|
+
value: 'space-evenly'
|
90
|
+
},
|
91
|
+
{
|
92
|
+
label: '均匀分布(自动拉伸)',
|
93
|
+
value: 'stretch'
|
94
|
+
}
|
95
|
+
]
|
96
|
+
},
|
97
|
+
{
|
98
|
+
name: 'alignItems',
|
99
|
+
type: 'select',
|
100
|
+
value: 'center',
|
101
|
+
label: '子节点垂直方向位置',
|
102
|
+
menuTpl:
|
103
|
+
"<div class='flex justify-between'><span>${label}</span><span class='text-muted text-sm'>${value}</span></div>",
|
104
|
+
options: [
|
105
|
+
{
|
106
|
+
label: '起始端对齐',
|
107
|
+
value: 'flex-start'
|
108
|
+
},
|
109
|
+
{
|
110
|
+
label: '居中对齐',
|
111
|
+
value: 'center'
|
112
|
+
},
|
113
|
+
{
|
114
|
+
label: '末尾端对齐',
|
115
|
+
value: 'flex-end'
|
116
|
+
},
|
117
|
+
{
|
118
|
+
label: '基线对齐',
|
119
|
+
value: 'baseline'
|
120
|
+
},
|
121
|
+
{
|
122
|
+
label: '自动拉伸',
|
123
|
+
value: 'stretch'
|
124
|
+
}
|
125
|
+
]
|
126
|
+
},
|
127
|
+
{
|
128
|
+
name: 'direction',
|
129
|
+
type: 'button-group-select',
|
130
|
+
size: 'sm',
|
131
|
+
label: '布局方向',
|
132
|
+
value: 'row',
|
133
|
+
mode: 'row',
|
134
|
+
options: [
|
135
|
+
{label: '水平', value: 'row'},
|
136
|
+
{label: '垂直', value: 'column'}
|
137
|
+
]
|
138
|
+
}
|
139
|
+
]
|
61
140
|
},
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
]
|
89
|
-
},
|
90
|
-
{
|
91
|
-
name: 'alignItems',
|
92
|
-
type: 'select',
|
93
|
-
value: 'center',
|
94
|
-
label: '子节点垂直方向位置',
|
95
|
-
options: [
|
96
|
-
'stretch',
|
97
|
-
'start',
|
98
|
-
'flex-start',
|
99
|
-
'flex-end',
|
100
|
-
'end',
|
101
|
-
'center',
|
102
|
-
'baseline'
|
103
|
-
]
|
104
|
-
},
|
105
|
-
{
|
106
|
-
name: 'direction',
|
107
|
-
type: 'radios',
|
108
|
-
label: '布局方向',
|
109
|
-
value: 'column',
|
110
|
-
inline: true,
|
111
|
-
options: [
|
112
|
-
{label: '水平', value: 'row'},
|
113
|
-
{label: '垂直', value: 'column'}
|
114
|
-
]
|
115
|
-
}
|
141
|
+
{
|
142
|
+
title: '子节点管理',
|
143
|
+
body: [
|
144
|
+
{
|
145
|
+
name: 'items',
|
146
|
+
label: false,
|
147
|
+
type: 'combo',
|
148
|
+
scaffold: {
|
149
|
+
type: 'wrapper',
|
150
|
+
body: '子节点内容'
|
151
|
+
},
|
152
|
+
minLength: 2,
|
153
|
+
multiple: true,
|
154
|
+
// draggable: true,
|
155
|
+
draggableTip: '',
|
156
|
+
items: [
|
157
|
+
{
|
158
|
+
type: 'tpl',
|
159
|
+
tpl:
|
160
|
+
'<span class="label label-default">子节点${index | plus}</span>'
|
161
|
+
}
|
162
|
+
]
|
163
|
+
}
|
164
|
+
]
|
165
|
+
}
|
166
|
+
])
|
116
167
|
]
|
117
168
|
},
|
118
169
|
{
|
119
170
|
title: '外观',
|
120
|
-
|
171
|
+
className: 'p-none',
|
172
|
+
body: getSchemaTpl('collapseGroup', [
|
173
|
+
...getSchemaTpl('style:common', ['display']),
|
174
|
+
{
|
175
|
+
title: 'CSS 类名',
|
176
|
+
body: [getSchemaTpl('className', {label: '外层CSS类名'})]
|
177
|
+
}
|
178
|
+
])
|
121
179
|
},
|
122
180
|
{
|
123
|
-
title: '
|
124
|
-
body: [getSchemaTpl('visible')]
|
181
|
+
title: '状态',
|
182
|
+
body: [getSchemaTpl('visible'), getSchemaTpl('disabled')]
|
125
183
|
}
|
126
184
|
])
|
127
185
|
];
|
@@ -1,5 +1,8 @@
|
|
1
1
|
import {registerEditorPlugin} from '../../manager';
|
2
|
-
import {BasePlugin} from '../../plugin';
|
2
|
+
import {BasePlugin, BaseEventContext} from '../../plugin';
|
3
|
+
|
4
|
+
import {formItemControl} from '../../component/control/BaseControl';
|
5
|
+
import {RendererAction, RendererEvent} from '../../event-action';
|
3
6
|
import {getSchemaTpl} from '../../component/schemaTpl';
|
4
7
|
|
5
8
|
export class ButtonGroupControlPlugin extends BasePlugin {
|
@@ -36,40 +39,125 @@ export class ButtonGroupControlPlugin extends BasePlugin {
|
|
36
39
|
body: {
|
37
40
|
...this.scaffold,
|
38
41
|
value: 'a',
|
39
|
-
label: '
|
40
|
-
description: '
|
42
|
+
label: '按钮点选',
|
43
|
+
description: '按钮点选可以当选项用。'
|
41
44
|
}
|
42
45
|
};
|
43
46
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
47
|
+
notRenderFormZone = true;
|
48
|
+
|
49
|
+
panelTitle = '按钮点选';
|
50
|
+
|
51
|
+
// 事件定义
|
52
|
+
events: RendererEvent[] = [
|
53
|
+
{
|
54
|
+
eventName: 'change',
|
55
|
+
eventLabel: '值变化',
|
56
|
+
description: '选中值变化时触发',
|
57
|
+
dataSchema: [
|
58
|
+
{
|
59
|
+
type: 'object',
|
60
|
+
properties: {
|
61
|
+
'event.data.value': {
|
62
|
+
type: 'string',
|
63
|
+
title: '选中值'
|
64
|
+
}
|
65
|
+
}
|
66
|
+
}
|
67
|
+
]
|
68
|
+
}
|
69
|
+
];
|
49
70
|
|
71
|
+
// 动作定义
|
72
|
+
actions: RendererAction[] = [
|
73
|
+
{
|
74
|
+
actionType: 'clear',
|
75
|
+
actionLabel: '清空',
|
76
|
+
description: '清除选中值'
|
77
|
+
},
|
78
|
+
{
|
79
|
+
actionType: 'reset',
|
80
|
+
actionLabel: '重置',
|
81
|
+
description: '将值重置为resetValue,若没有配置resetValue,则清空'
|
82
|
+
},
|
50
83
|
{
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
source: '${options}',
|
55
|
-
visibleOn: 'typeof this.value !== "undefined"',
|
56
|
-
multiple: true
|
84
|
+
actionType: 'reload',
|
85
|
+
actionLabel: '重新加载',
|
86
|
+
description: '触发组件数据刷新并重新渲染'
|
57
87
|
},
|
88
|
+
{
|
89
|
+
actionType: 'setValue',
|
90
|
+
actionLabel: '赋值',
|
91
|
+
description: '触发组件数据更新'
|
92
|
+
}
|
93
|
+
];
|
58
94
|
|
59
|
-
|
60
|
-
getSchemaTpl('source'),
|
95
|
+
panelJustify = true;
|
61
96
|
|
62
|
-
|
97
|
+
panelBodyCreator = (context: BaseEventContext) => {
|
98
|
+
return formItemControl(
|
99
|
+
{
|
100
|
+
common: {
|
101
|
+
replace: true,
|
102
|
+
body: [
|
103
|
+
getSchemaTpl('formItemName', {
|
104
|
+
required: true
|
105
|
+
}),
|
106
|
+
getSchemaTpl('label'),
|
107
|
+
getSchemaTpl('value'),
|
108
|
+
getSchemaTpl('multiple'),
|
109
|
+
getSchemaTpl('extractValue')
|
110
|
+
]
|
111
|
+
},
|
112
|
+
option: {
|
113
|
+
title: '按钮管理',
|
114
|
+
body: [getSchemaTpl('optionControl'), getSchemaTpl('autoFill')]
|
115
|
+
},
|
116
|
+
style: {
|
117
|
+
// reverse: true,
|
118
|
+
body: [
|
119
|
+
getSchemaTpl('size'),
|
63
120
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
121
|
+
getSchemaTpl('buttonLevel', {
|
122
|
+
label: '按钮样式',
|
123
|
+
name: 'btnLevel'
|
124
|
+
}),
|
125
|
+
|
126
|
+
{
|
127
|
+
type: 'button-group-select',
|
128
|
+
name: 'vertical',
|
129
|
+
label: '布局方向',
|
130
|
+
value: false,
|
131
|
+
options: [
|
132
|
+
{
|
133
|
+
label: '水平',
|
134
|
+
value: false
|
135
|
+
},
|
136
|
+
{
|
137
|
+
label: '垂直',
|
138
|
+
value: true
|
139
|
+
}
|
140
|
+
]
|
141
|
+
},
|
142
|
+
|
143
|
+
{
|
144
|
+
type: 'switch',
|
145
|
+
name: 'tiled',
|
146
|
+
label: '平铺模式',
|
147
|
+
value: false
|
148
|
+
},
|
149
|
+
|
150
|
+
getSchemaTpl('buttonLevel', {
|
151
|
+
label: '按钮选中样式',
|
152
|
+
name: 'btnActiveLevel'
|
153
|
+
})
|
154
|
+
]
|
155
|
+
},
|
156
|
+
status: {}
|
157
|
+
},
|
158
|
+
context
|
159
|
+
);
|
160
|
+
};
|
73
161
|
}
|
74
162
|
|
75
163
|
registerEditorPlugin(ButtonGroupControlPlugin);
|
@@ -1,7 +1,12 @@
|
|
1
1
|
import {registerEditorPlugin} from '../../manager';
|
2
|
-
import {BasePlugin, RegionConfig} from '../../plugin';
|
2
|
+
import {BasePlugin, RegionConfig, BaseEventContext} from '../../plugin';
|
3
3
|
import {getSchemaTpl} from '../../component/schemaTpl';
|
4
4
|
|
5
|
+
import {
|
6
|
+
BUTTON_DEFAULT_ACTION,
|
7
|
+
formItemControl
|
8
|
+
} from '../../component/control/BaseControl';
|
9
|
+
|
5
10
|
export class ButtonToolbarControlPlugin extends BasePlugin {
|
6
11
|
// 关联渲染器名字
|
7
12
|
rendererName = 'button-toolbar';
|
@@ -20,20 +25,12 @@ export class ButtonToolbarControlPlugin extends BasePlugin {
|
|
20
25
|
{
|
21
26
|
type: 'button',
|
22
27
|
label: '按钮1',
|
23
|
-
|
24
|
-
dialog: {
|
25
|
-
title: '系统提示',
|
26
|
-
body: '对你点击了'
|
27
|
-
}
|
28
|
+
...BUTTON_DEFAULT_ACTION
|
28
29
|
},
|
29
30
|
{
|
30
31
|
type: 'button',
|
31
32
|
label: '按钮2',
|
32
|
-
|
33
|
-
dialog: {
|
34
|
-
title: '系统提示',
|
35
|
-
body: '对你点击了'
|
36
|
-
}
|
33
|
+
...BUTTON_DEFAULT_ACTION
|
37
34
|
}
|
38
35
|
]
|
39
36
|
};
|
@@ -57,54 +54,64 @@ export class ButtonToolbarControlPlugin extends BasePlugin {
|
|
57
54
|
}
|
58
55
|
];
|
59
56
|
|
60
|
-
|
61
|
-
panelBody = [
|
62
|
-
getSchemaTpl('tabs', [
|
63
|
-
{
|
64
|
-
title: '常规',
|
65
|
-
body: [
|
66
|
-
getSchemaTpl('label'),
|
67
|
-
getSchemaTpl('description'),
|
57
|
+
notRenderFormZone = true;
|
68
58
|
|
69
|
-
|
70
|
-
getSchemaTpl('labelRemark')
|
71
|
-
]
|
72
|
-
},
|
59
|
+
panelTitle = '工具栏';
|
73
60
|
|
61
|
+
panelBodyCreator = (context: BaseEventContext) => {
|
62
|
+
return formItemControl(
|
74
63
|
{
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
64
|
+
common: {
|
65
|
+
replace: true,
|
66
|
+
body: [
|
67
|
+
getSchemaTpl('formItemName', {
|
68
|
+
required: true
|
69
|
+
}),
|
70
|
+
getSchemaTpl('label'),
|
71
|
+
getSchemaTpl('value'),
|
72
|
+
getSchemaTpl('remark'),
|
73
|
+
getSchemaTpl('labelRemark'),
|
74
|
+
getSchemaTpl('description')
|
75
|
+
]
|
76
|
+
},
|
77
|
+
option: {
|
78
|
+
title: '按钮管理',
|
79
|
+
replace: true,
|
80
|
+
body: [
|
81
|
+
{
|
82
|
+
name: 'buttons',
|
83
|
+
type: 'combo',
|
84
|
+
label: '',
|
85
|
+
multiple: true,
|
86
|
+
addable: true,
|
87
|
+
minLength: 1,
|
88
|
+
draggable: true,
|
89
|
+
draggableTip: '',
|
90
|
+
editable: false,
|
91
|
+
visibleOn: 'this.buttons && this.buttons.length',
|
92
|
+
items: [
|
93
|
+
{
|
94
|
+
type: 'tpl',
|
95
|
+
inline: false,
|
96
|
+
tpl:
|
97
|
+
'<span class="label label-default"><% if (data.type === "button-group") { %> 按钮组 <% } else { %><%= data.label %><% if (data.icon) { %><i class="<%= data.icon %>"/><% }%><% } %></span>'
|
98
|
+
}
|
99
|
+
],
|
100
|
+
addButtonText: '新增按钮',
|
101
|
+
scaffold: {
|
102
|
+
type: 'button',
|
103
|
+
label: '按钮'
|
104
|
+
}
|
105
|
+
}
|
106
|
+
]
|
107
|
+
},
|
108
|
+
event: {
|
109
|
+
hidden: false
|
110
|
+
}
|
100
111
|
},
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
body: [getSchemaTpl('ref'), getSchemaTpl('visible')]
|
105
|
-
}
|
106
|
-
])
|
107
|
-
];
|
112
|
+
context
|
113
|
+
);
|
114
|
+
};
|
108
115
|
}
|
109
116
|
|
110
117
|
registerEditorPlugin(ButtonToolbarControlPlugin);
|
@@ -6,6 +6,7 @@ import {
|
|
6
6
|
SubRendererInfo
|
7
7
|
} from '../../plugin';
|
8
8
|
import {getSchemaTpl} from '../../component/schemaTpl';
|
9
|
+
import {RendererAction, RendererEvent} from '../../event-action';
|
9
10
|
|
10
11
|
export class ChainedSelectControlPlugin extends BasePlugin {
|
11
12
|
// 关联渲染器名字
|
@@ -35,6 +36,50 @@ export class ChainedSelectControlPlugin extends BasePlugin {
|
|
35
36
|
}
|
36
37
|
};
|
37
38
|
|
39
|
+
// 事件定义
|
40
|
+
events: RendererEvent[] = [
|
41
|
+
{
|
42
|
+
eventName: 'change',
|
43
|
+
eventLabel: '值变化',
|
44
|
+
description: '选中值变化时触发',
|
45
|
+
dataSchema: [
|
46
|
+
{
|
47
|
+
type: 'object',
|
48
|
+
properties: {
|
49
|
+
'event.data.value': {
|
50
|
+
type: 'string',
|
51
|
+
title: '选中值'
|
52
|
+
}
|
53
|
+
}
|
54
|
+
}
|
55
|
+
]
|
56
|
+
}
|
57
|
+
];
|
58
|
+
|
59
|
+
// 动作定义
|
60
|
+
actions: RendererAction[] = [
|
61
|
+
{
|
62
|
+
actionType: 'clear',
|
63
|
+
actionLabel: '清空',
|
64
|
+
description: '清除选中值'
|
65
|
+
},
|
66
|
+
{
|
67
|
+
actionType: 'reset',
|
68
|
+
actionLabel: '重置',
|
69
|
+
description: '将值重置为resetValue,若没有配置resetValue,则清空'
|
70
|
+
},
|
71
|
+
{
|
72
|
+
actionType: 'reload',
|
73
|
+
actionLabel: '重新加载',
|
74
|
+
description: '触发组件数据刷新并重新渲染'
|
75
|
+
},
|
76
|
+
{
|
77
|
+
actionType: 'setValue',
|
78
|
+
actionLabel: '赋值',
|
79
|
+
description: '触发组件数据更新'
|
80
|
+
}
|
81
|
+
];
|
82
|
+
|
38
83
|
panelTitle = '级联选择';
|
39
84
|
panelBody = [
|
40
85
|
getSchemaTpl('switchDefaultValue'),
|