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/Tabs.tsx
CHANGED
@@ -6,6 +6,7 @@ import {
|
|
6
6
|
BasicToolbarItem,
|
7
7
|
PluginEvent,
|
8
8
|
PreventClickEventContext,
|
9
|
+
RegionConfig,
|
9
10
|
RendererInfo,
|
10
11
|
VRendererConfig
|
11
12
|
} from '../plugin';
|
@@ -15,6 +16,9 @@ import {VRenderer} from '../component/VRenderer';
|
|
15
16
|
import findIndex from 'lodash/findIndex';
|
16
17
|
import {RegionWrapper as Region} from '../component/RegionWrapper';
|
17
18
|
import {Tab} from 'amis';
|
19
|
+
import {tipedLabel} from '../component/control/BaseControl';
|
20
|
+
import {getComboWrapper} from '../event-action/schema';
|
21
|
+
import {getEventControlConfig} from '../util';
|
18
22
|
|
19
23
|
export class TabsPlugin extends BasePlugin {
|
20
24
|
// 关联渲染器名字
|
@@ -46,111 +50,247 @@ export class TabsPlugin extends BasePlugin {
|
|
46
50
|
...this.scaffold
|
47
51
|
};
|
48
52
|
|
53
|
+
notRenderFormZone = true;
|
54
|
+
|
55
|
+
regions: Array<RegionConfig> = [
|
56
|
+
{
|
57
|
+
key: 'toolbar',
|
58
|
+
label: '工具栏',
|
59
|
+
preferTag: '展示'
|
60
|
+
}
|
61
|
+
];
|
62
|
+
|
49
63
|
panelTitle = '选项卡';
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
title: '选项卡',
|
65
|
-
body: {
|
66
|
-
type: 'tpl',
|
67
|
-
tpl: '内容',
|
68
|
-
inline: false
|
69
|
-
}
|
70
|
-
},
|
71
|
-
addButtonText: '新增选项卡',
|
72
|
-
draggableTip: ''
|
64
|
+
|
65
|
+
events = [
|
66
|
+
{
|
67
|
+
eventName: 'change',
|
68
|
+
eventLabel: '选项卡切换',
|
69
|
+
description: '选项卡切换',
|
70
|
+
dataSchema: [
|
71
|
+
{
|
72
|
+
type: 'object',
|
73
|
+
properties: {
|
74
|
+
value: {
|
75
|
+
type: 'string',
|
76
|
+
title: '选项卡索引'
|
77
|
+
}
|
73
78
|
}
|
74
|
-
|
79
|
+
}
|
80
|
+
]
|
81
|
+
}
|
82
|
+
];
|
83
|
+
|
84
|
+
actions = [
|
85
|
+
{
|
86
|
+
actionType: 'changeActiveKey',
|
87
|
+
actionLabel: '修改激活tab值',
|
88
|
+
description: '修改当前激活tab项的key',
|
89
|
+
config: ['activeKey'],
|
90
|
+
desc: (info: any) => {
|
91
|
+
return (
|
92
|
+
<div>
|
93
|
+
<span className="variable-right">{info?.__rendererLabel}</span>
|
94
|
+
激活第
|
95
|
+
<span className="variable-left variable-right">
|
96
|
+
{info?.args?.activeKey}
|
97
|
+
</span>
|
98
|
+
项
|
99
|
+
</div>
|
100
|
+
);
|
75
101
|
},
|
102
|
+
schema: getComboWrapper({
|
103
|
+
type: 'input-formula',
|
104
|
+
variables: '${variables}',
|
105
|
+
evalMode: false,
|
106
|
+
variableMode: 'tabs',
|
107
|
+
label: '激活项',
|
108
|
+
size: 'lg',
|
109
|
+
name: 'activeKey',
|
110
|
+
mode: 'horizontal'
|
111
|
+
})
|
112
|
+
}
|
113
|
+
];
|
114
|
+
|
115
|
+
panelJustify = true;
|
116
|
+
panelBodyCreator = (context: BaseEventContext) => {
|
117
|
+
const isNewTabMode =
|
118
|
+
'data.tabsMode !=="vertical" && data.tabsMode !=="sidebar" && data.tabsMode !=="chrome"';
|
119
|
+
|
120
|
+
return getSchemaTpl('tabs', [
|
76
121
|
{
|
77
|
-
title: '
|
78
|
-
body: [
|
122
|
+
title: '属性',
|
123
|
+
body: getSchemaTpl('collapseGroup', [
|
79
124
|
{
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
{
|
103
|
-
|
104
|
-
|
105
|
-
|
125
|
+
title: '基本',
|
126
|
+
body: [
|
127
|
+
getSchemaTpl('combo-container', {
|
128
|
+
type: 'combo',
|
129
|
+
label: '选项卡',
|
130
|
+
mode: 'normal',
|
131
|
+
name: 'tabs',
|
132
|
+
draggableTip: '',
|
133
|
+
draggable: true,
|
134
|
+
multiple: true,
|
135
|
+
minLength: 1,
|
136
|
+
scaffold: {
|
137
|
+
title: '选项卡',
|
138
|
+
body: {
|
139
|
+
type: 'tpl',
|
140
|
+
tpl: '内容',
|
141
|
+
inline: false
|
142
|
+
}
|
143
|
+
},
|
144
|
+
items: [{type: 'input-text', name: 'title', required: true}]
|
145
|
+
}),
|
146
|
+
|
147
|
+
getSchemaTpl('switch', {
|
148
|
+
name: 'showTip',
|
149
|
+
label: tipedLabel(
|
150
|
+
'标题提示',
|
151
|
+
'鼠标移动到选项卡标题时弹出提示,适用于标题超长时进行完整提示'
|
152
|
+
),
|
153
|
+
visibleOn: isNewTabMode,
|
154
|
+
clearValueOnHidden: true
|
155
|
+
})
|
156
|
+
]
|
157
|
+
},
|
158
|
+
getSchemaTpl('status'),
|
159
|
+
{
|
160
|
+
title: '高级',
|
161
|
+
body: [
|
106
162
|
{
|
107
|
-
|
108
|
-
|
163
|
+
type: 'ae-formulaControl',
|
164
|
+
label: tipedLabel(
|
165
|
+
'关联数据',
|
166
|
+
'可用<code>\\${xxx}</code>取值,根据该数据来动态重复渲染所配置的选项卡'
|
167
|
+
),
|
168
|
+
name: 'source'
|
109
169
|
},
|
110
|
-
{
|
111
|
-
|
112
|
-
|
113
|
-
|
170
|
+
getSchemaTpl('switch', {
|
171
|
+
name: 'mountOnEnter',
|
172
|
+
label: tipedLabel(
|
173
|
+
'激活时渲染内容',
|
174
|
+
'只有激活选项卡时才进行内容渲染,提升渲染性能'
|
175
|
+
)
|
176
|
+
}),
|
177
|
+
getSchemaTpl('switch', {
|
178
|
+
name: 'unmountOnExit',
|
179
|
+
label: tipedLabel(
|
180
|
+
'隐藏后销毁内容',
|
181
|
+
'激活其他选项卡时销毁当前内容,使其再次激活时内容可以重新渲染,适用于数据容器需要每次渲染实时获取数据的场景'
|
182
|
+
)
|
183
|
+
})
|
114
184
|
]
|
115
|
-
}
|
116
|
-
|
117
|
-
getSchemaTpl('className', {
|
118
|
-
name: 'contentClassName',
|
119
|
-
label: '选项卡成员 CSS 类名'
|
120
|
-
}),
|
121
|
-
|
122
|
-
getSchemaTpl('subFormItemMode'),
|
123
|
-
getSchemaTpl('subFormHorizontalMode'),
|
124
|
-
getSchemaTpl('subFormHorizontal')
|
125
|
-
]
|
185
|
+
}
|
186
|
+
])
|
126
187
|
},
|
127
188
|
{
|
128
|
-
title: '
|
189
|
+
title: '外观',
|
129
190
|
body: [
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
191
|
+
getSchemaTpl('collapseGroup', [
|
192
|
+
{
|
193
|
+
title: '基本',
|
194
|
+
body: [
|
195
|
+
{
|
196
|
+
name: 'tabsMode',
|
197
|
+
label: '样式',
|
198
|
+
type: 'select',
|
199
|
+
options: [
|
200
|
+
{
|
201
|
+
label: '默认',
|
202
|
+
value: ''
|
203
|
+
},
|
204
|
+
{
|
205
|
+
label: '线型',
|
206
|
+
value: 'line'
|
207
|
+
},
|
208
|
+
{
|
209
|
+
label: '简约',
|
210
|
+
value: 'simple'
|
211
|
+
},
|
212
|
+
{
|
213
|
+
label: '加强',
|
214
|
+
value: 'strong'
|
215
|
+
},
|
216
|
+
{
|
217
|
+
label: '卡片',
|
218
|
+
value: 'card'
|
219
|
+
},
|
220
|
+
{
|
221
|
+
label: '仿 Chrome',
|
222
|
+
value: 'chrome'
|
223
|
+
},
|
224
|
+
{
|
225
|
+
label: '水平铺满',
|
226
|
+
value: 'tiled'
|
227
|
+
},
|
228
|
+
{
|
229
|
+
label: '选择器',
|
230
|
+
value: 'radio'
|
231
|
+
},
|
232
|
+
{
|
233
|
+
label: '垂直',
|
234
|
+
value: 'vertical'
|
235
|
+
},
|
236
|
+
{
|
237
|
+
label: '侧边栏',
|
238
|
+
value: 'sidebar'
|
239
|
+
}
|
240
|
+
],
|
241
|
+
pipeIn: defaultValue('')
|
242
|
+
},
|
139
243
|
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
244
|
+
getSchemaTpl('horizontal-align', {
|
245
|
+
label: '标题区位置',
|
246
|
+
name: 'sidePosition',
|
247
|
+
pipeIn: defaultValue('left'),
|
248
|
+
visibleOn: 'data.tabsMode === "sidebar"',
|
249
|
+
clearValueOnHidden: true
|
250
|
+
})
|
251
|
+
]
|
252
|
+
},
|
253
|
+
getSchemaTpl('style:classNames', {
|
254
|
+
isFormItem: false,
|
255
|
+
schema: [
|
256
|
+
getSchemaTpl('className', {
|
257
|
+
name: 'linksClassName',
|
258
|
+
label: '标题区'
|
259
|
+
}),
|
260
|
+
|
261
|
+
getSchemaTpl('className', {
|
262
|
+
name: 'toolbarClassName',
|
263
|
+
label: '工具栏'
|
264
|
+
}),
|
265
|
+
|
266
|
+
getSchemaTpl('className', {
|
267
|
+
name: 'contentClassName',
|
268
|
+
label: '内容区'
|
269
|
+
}),
|
270
|
+
|
271
|
+
getSchemaTpl('className', {
|
272
|
+
name: 'showTipClassName',
|
273
|
+
label: '提示',
|
274
|
+
visibleOn: 'data.showTip',
|
275
|
+
clearValueOnHidden: true
|
276
|
+
})
|
277
|
+
]
|
278
|
+
})
|
279
|
+
])
|
280
|
+
]
|
281
|
+
},
|
282
|
+
{
|
283
|
+
title: '事件',
|
284
|
+
className: 'p-none',
|
285
|
+
body: [
|
286
|
+
getSchemaTpl('eventControl', {
|
287
|
+
name: 'onEvent',
|
288
|
+
...getEventControlConfig(this.manager, context)
|
289
|
+
})
|
150
290
|
]
|
151
291
|
}
|
152
|
-
])
|
153
|
-
|
292
|
+
]);
|
293
|
+
};
|
154
294
|
|
155
295
|
patchContainers = ['tabs.body'];
|
156
296
|
|
@@ -162,70 +302,89 @@ export class TabsPlugin extends BasePlugin {
|
|
162
302
|
}
|
163
303
|
},
|
164
304
|
panelTitle: '卡片',
|
165
|
-
|
166
|
-
|
305
|
+
panelJustify: true,
|
306
|
+
panelBodyCreator: (context: BaseEventContext) => {
|
307
|
+
return getSchemaTpl('tabs', [
|
167
308
|
{
|
168
|
-
title: '
|
169
|
-
body: [
|
309
|
+
title: '属性',
|
310
|
+
body: getSchemaTpl('collapseGroup', [
|
170
311
|
{
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
312
|
+
title: '基本',
|
313
|
+
body: [
|
314
|
+
{
|
315
|
+
name: 'title',
|
316
|
+
label: '标题',
|
317
|
+
type: 'input-text',
|
318
|
+
required: true
|
319
|
+
},
|
320
|
+
|
321
|
+
{
|
322
|
+
type: 'ae-switch-more',
|
323
|
+
formType: 'extend',
|
324
|
+
mode: 'normal',
|
325
|
+
label: '标题图标',
|
326
|
+
form: {
|
327
|
+
body: [
|
328
|
+
getSchemaTpl('icon'),
|
329
|
+
|
330
|
+
getSchemaTpl('horizontal-align', {
|
331
|
+
label: '位置',
|
332
|
+
name: 'iconPosition',
|
333
|
+
pipeIn: defaultValue('left'),
|
334
|
+
visibleOn: 'data.icon',
|
335
|
+
clearValueOnHidden: true
|
336
|
+
})
|
337
|
+
]
|
338
|
+
}
|
339
|
+
},
|
340
|
+
|
341
|
+
{
|
342
|
+
label: tipedLabel(
|
343
|
+
'Hash',
|
344
|
+
'设置后,会同步更新地址栏的 Hash。'
|
345
|
+
),
|
346
|
+
name: 'hash',
|
347
|
+
type: 'input-text'
|
348
|
+
}
|
349
|
+
]
|
175
350
|
},
|
176
|
-
getSchemaTpl('
|
351
|
+
getSchemaTpl('status', {disabled: true}),
|
177
352
|
{
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
353
|
+
title: '高级',
|
354
|
+
body: [
|
355
|
+
getSchemaTpl('switch', {
|
356
|
+
name: 'mountOnEnter',
|
357
|
+
label: tipedLabel(
|
358
|
+
'激活时才渲染',
|
359
|
+
'当选项卡选中后才渲染其内容区,可提高渲染性能。'
|
360
|
+
),
|
361
|
+
visibleOn: '!this.reload',
|
362
|
+
clearValueOnHidden: true
|
363
|
+
}),
|
364
|
+
|
365
|
+
getSchemaTpl('switch', {
|
366
|
+
name: 'unmountOnExit',
|
367
|
+
label: tipedLabel(
|
368
|
+
'隐藏即销毁',
|
369
|
+
'关闭选项卡则销毁其内容去,配置「激活时才渲染」选项可实现每次选中均重新加载的效果。'
|
370
|
+
),
|
371
|
+
visibleOn: '!this.reload',
|
372
|
+
clearValueOnHidden: true
|
373
|
+
})
|
374
|
+
]
|
182
375
|
}
|
183
|
-
]
|
376
|
+
])
|
184
377
|
},
|
185
378
|
{
|
186
379
|
title: '外观',
|
187
|
-
body:
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
},
|
193
|
-
{
|
194
|
-
title: '其他',
|
195
|
-
body: [
|
196
|
-
{
|
197
|
-
type: 'switch',
|
198
|
-
name: 'reload',
|
199
|
-
label: '内容刷新',
|
200
|
-
mode: 'inline',
|
201
|
-
className: 'block',
|
202
|
-
description:
|
203
|
-
'配置后,每次点开内容都会重新刷新,如果配置了,下面两个选项就不用配置了。'
|
204
|
-
},
|
205
|
-
{
|
206
|
-
type: 'switch',
|
207
|
-
name: 'mountOnEnter',
|
208
|
-
visibleOn: '!this.reload',
|
209
|
-
label: '激活时才渲染',
|
210
|
-
mode: 'inline',
|
211
|
-
className: 'block',
|
212
|
-
description:
|
213
|
-
'设置后选项卡的内容只有点开才会渲染,如果有选项卡放的可拉取接口的组件,那么这个接口只有在点开的时候才会拉取。'
|
214
|
-
},
|
215
|
-
{
|
216
|
-
visibleOn: '!this.reload',
|
217
|
-
type: 'switch',
|
218
|
-
name: 'unmountOnExit',
|
219
|
-
label: '隐藏即销毁',
|
220
|
-
mode: 'inline',
|
221
|
-
className: 'block',
|
222
|
-
description:
|
223
|
-
'设置后,如果选项卡内容关闭则销毁,配置「激活时才渲染」选项可以做到卡片内容每次点开都重新加载的效果。'
|
224
|
-
}
|
225
|
-
]
|
380
|
+
body: getSchemaTpl('collapseGroup', [
|
381
|
+
getSchemaTpl('style:classNames', {
|
382
|
+
isFormItem: false
|
383
|
+
})
|
384
|
+
])
|
226
385
|
}
|
227
|
-
])
|
228
|
-
|
386
|
+
]);
|
387
|
+
}
|
229
388
|
};
|
230
389
|
|
231
390
|
wrapperProps = {
|
@@ -258,6 +417,7 @@ export class TabsPlugin extends BasePlugin {
|
|
258
417
|
children: (
|
259
418
|
<VRenderer
|
260
419
|
key={id}
|
420
|
+
type={info.type}
|
261
421
|
plugin={info.plugin}
|
262
422
|
renderer={info.renderer}
|
263
423
|
$schema="/schemas/TabSchema.json"
|