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
@@ -1,6 +1,11 @@
|
|
1
|
+
/**
|
2
|
+
* @file 文字提示容器
|
3
|
+
*/
|
4
|
+
|
1
5
|
import {registerEditorPlugin} from '../manager';
|
2
6
|
import {BasePlugin, RegionConfig, BaseEventContext} from '../plugin';
|
3
7
|
import {defaultValue, getSchemaTpl} from '../component/schemaTpl';
|
8
|
+
import {tipedLabel} from '../component/control/BaseControl';
|
4
9
|
|
5
10
|
export class TooltipWrapperPlugin extends BasePlugin {
|
6
11
|
rendererName = 'tooltip-wrapper';
|
@@ -22,7 +27,10 @@ export class TooltipWrapperPlugin extends BasePlugin {
|
|
22
27
|
type: 'tpl',
|
23
28
|
tpl: '内容'
|
24
29
|
}
|
25
|
-
]
|
30
|
+
],
|
31
|
+
enterable: true,
|
32
|
+
showArrow: true,
|
33
|
+
offset: [0, 0]
|
26
34
|
};
|
27
35
|
|
28
36
|
previewSchema = {
|
@@ -38,152 +46,240 @@ export class TooltipWrapperPlugin extends BasePlugin {
|
|
38
46
|
];
|
39
47
|
|
40
48
|
panelTitle = this.name;
|
49
|
+
|
50
|
+
panelJustify = true;
|
51
|
+
|
41
52
|
panelBodyCreator = (context: BaseEventContext) => {
|
42
53
|
return [
|
43
54
|
getSchemaTpl('tabs', [
|
44
55
|
{
|
45
56
|
title: '属性',
|
57
|
+
className: 'p-none',
|
46
58
|
body: [
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
59
|
+
getSchemaTpl('collapseGroup', [
|
60
|
+
{
|
61
|
+
title: '常用',
|
62
|
+
body: [
|
63
|
+
{
|
64
|
+
type: 'input-text',
|
65
|
+
name: 'title',
|
66
|
+
label: '提示标题'
|
67
|
+
},
|
68
|
+
{
|
69
|
+
type: 'textarea',
|
70
|
+
name: 'tooltip',
|
71
|
+
label: '提示内容'
|
72
|
+
},
|
73
|
+
|
74
|
+
{
|
75
|
+
name: 'trigger',
|
76
|
+
type: 'select',
|
77
|
+
label: tipedLabel('触发方式', '默认方式为”鼠标悬停“'),
|
78
|
+
multiple: true,
|
79
|
+
value: ['hover'],
|
80
|
+
pipeIn: (value: any) =>
|
81
|
+
Array.isArray(value) ? value.join(',') : [],
|
82
|
+
pipeOut: (value: any) =>
|
83
|
+
value && value.length ? value.split(',') : undefined,
|
84
|
+
options: [
|
85
|
+
{
|
86
|
+
label: '鼠标悬停',
|
87
|
+
value: 'hover'
|
88
|
+
},
|
89
|
+
|
90
|
+
{
|
91
|
+
label: '点击',
|
92
|
+
value: 'click'
|
93
|
+
}
|
94
|
+
]
|
95
|
+
},
|
96
|
+
{
|
97
|
+
type: 'button-group-select',
|
98
|
+
name: 'placement',
|
99
|
+
label: '提示位置',
|
100
|
+
size: 'sm',
|
101
|
+
className: 'ae-buttonGroupSelect--justify',
|
102
|
+
options: [
|
103
|
+
{
|
104
|
+
label: '上',
|
105
|
+
value: 'top'
|
106
|
+
// icon: 'fa fa-arrow-up'
|
107
|
+
},
|
108
|
+
{
|
109
|
+
label: '下',
|
110
|
+
value: 'bottom'
|
111
|
+
// icon: 'fa fa-arrow-down'
|
112
|
+
},
|
113
|
+
{
|
114
|
+
label: '左',
|
115
|
+
value: 'left'
|
116
|
+
// icon: 'fa fa-arrow-left'
|
117
|
+
},
|
118
|
+
{
|
119
|
+
label: '右',
|
120
|
+
value: 'right'
|
121
|
+
// icon: 'fa fa-arrow-right'
|
122
|
+
}
|
123
|
+
],
|
124
|
+
pipeIn: defaultValue('top')
|
125
|
+
},
|
126
|
+
{
|
127
|
+
type: 'button-group-select',
|
128
|
+
name: 'tooltipTheme',
|
129
|
+
label: '主题色',
|
130
|
+
size: 'sm',
|
131
|
+
className: 'ae-buttonGroupSelect--justify',
|
132
|
+
options: [
|
133
|
+
{
|
134
|
+
label: '亮色',
|
135
|
+
value: 'light',
|
136
|
+
icon: 'far fa-sun'
|
137
|
+
},
|
138
|
+
{
|
139
|
+
label: '暗色',
|
140
|
+
value: 'dark',
|
141
|
+
icon: 'far fa-moon'
|
142
|
+
}
|
143
|
+
],
|
144
|
+
pipeIn: defaultValue('light')
|
145
|
+
},
|
146
|
+
{
|
147
|
+
name: 'inline',
|
148
|
+
label: '容器内联',
|
149
|
+
type: 'switch',
|
150
|
+
mode: 'row',
|
151
|
+
inputClassName:
|
152
|
+
'inline-flex justify-between flex-row-reverse'
|
153
|
+
},
|
154
|
+
{
|
155
|
+
name: 'rootClose',
|
156
|
+
visibleOn: '~this.trigger.indexOf("click")',
|
157
|
+
label: '点击容器外部关闭提示',
|
158
|
+
type: 'switch',
|
159
|
+
mode: 'row',
|
160
|
+
inputClassName:
|
161
|
+
'inline-flex justify-between flex-row-reverse'
|
162
|
+
}
|
163
|
+
]
|
78
164
|
},
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
165
|
+
{
|
166
|
+
title: '高级',
|
167
|
+
body: [
|
168
|
+
{
|
169
|
+
name: 'wrapperComponent',
|
170
|
+
label: '容器标签',
|
171
|
+
type: 'input-text',
|
172
|
+
options: [
|
173
|
+
'article',
|
174
|
+
'aside',
|
175
|
+
'code',
|
176
|
+
'div',
|
177
|
+
'footer',
|
178
|
+
'header',
|
179
|
+
'p',
|
180
|
+
'section'
|
181
|
+
],
|
182
|
+
validations: {
|
183
|
+
isAlphanumeric: true,
|
184
|
+
matchRegexp: '/^(?!.*script).*$/' // 禁用一下script标签
|
185
|
+
},
|
186
|
+
validationErrors: {
|
187
|
+
isAlpha: 'HTML标签不合法,请重新输入',
|
188
|
+
matchRegexp: 'HTML标签不合法,请重新输入'
|
189
|
+
},
|
190
|
+
validateOnChange: false
|
191
|
+
},
|
192
|
+
{
|
193
|
+
type: 'input-group',
|
194
|
+
label: tipedLabel(
|
195
|
+
'浮层偏移量',
|
196
|
+
'提示浮层位置相对”水平“、”垂直“的偏移量'
|
197
|
+
),
|
198
|
+
body: [
|
199
|
+
{
|
200
|
+
type: 'input-number',
|
201
|
+
name: 'offset',
|
202
|
+
suffix: 'px',
|
203
|
+
pipeIn: (value: any) =>
|
204
|
+
Array.isArray(value) ? value[0] || 0 : 0,
|
205
|
+
pipeOut: (value: any, oldValue: any, data: any) => [
|
206
|
+
value,
|
207
|
+
data.offset[1]
|
208
|
+
]
|
209
|
+
},
|
210
|
+
{
|
211
|
+
type: 'input-number',
|
212
|
+
name: 'offset',
|
213
|
+
suffix: 'px',
|
214
|
+
pipeIn: (value: any) =>
|
215
|
+
Array.isArray(value) ? value[1] || 0 : 0,
|
216
|
+
pipeOut: (value: any, oldValue: any, data: any) => [
|
217
|
+
data.offset[0],
|
218
|
+
value
|
219
|
+
]
|
220
|
+
}
|
221
|
+
]
|
222
|
+
},
|
223
|
+
{
|
224
|
+
type: 'switch',
|
225
|
+
label: tipedLabel(
|
226
|
+
'可进入浮层',
|
227
|
+
'关闭后鼠标进入提示浮层后也关闭浮层'
|
228
|
+
),
|
229
|
+
name: 'enterable',
|
230
|
+
inputClassName: 'is-inline'
|
231
|
+
},
|
232
|
+
{
|
233
|
+
type: 'switch',
|
234
|
+
label: tipedLabel(
|
235
|
+
'展示浮层箭头',
|
236
|
+
'关闭后提示浮层不展示指向箭头'
|
237
|
+
),
|
238
|
+
name: 'showArrow',
|
239
|
+
inputClassName: 'is-inline'
|
240
|
+
},
|
96
241
|
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
{
|
119
|
-
label: '左',
|
120
|
-
value: 'left',
|
121
|
-
icon: 'fa fa-arrow-left'
|
122
|
-
},
|
123
|
-
{
|
124
|
-
label: '右',
|
125
|
-
value: 'right',
|
126
|
-
icon: 'fa fa-arrow-right'
|
127
|
-
}
|
128
|
-
],
|
129
|
-
pipeIn: defaultValue('top')
|
130
|
-
},
|
131
|
-
{
|
132
|
-
type: 'button-group-select',
|
133
|
-
name: 'tooltipTheme',
|
134
|
-
label: '主题色',
|
135
|
-
options: [
|
136
|
-
{
|
137
|
-
label: '亮色',
|
138
|
-
value: 'light',
|
139
|
-
icon: 'fa fa-sun'
|
140
|
-
},
|
141
|
-
{
|
142
|
-
label: '暗色',
|
143
|
-
value: 'dark',
|
144
|
-
icon: 'fas fa-moon'
|
145
|
-
}
|
146
|
-
],
|
147
|
-
pipeIn: defaultValue('light')
|
148
|
-
},
|
149
|
-
{
|
150
|
-
name: 'inline',
|
151
|
-
label: '容器内联',
|
152
|
-
type: 'switch',
|
153
|
-
mode: 'row',
|
154
|
-
inputClassName: 'inline-flex justify-between flex-row-reverse'
|
155
|
-
},
|
156
|
-
{
|
157
|
-
name: 'rootClose',
|
158
|
-
visibleOn: '~this.trigger.indexOf("click")',
|
159
|
-
label: '点击容器外部关闭提示',
|
160
|
-
type: 'switch',
|
161
|
-
mode: 'row',
|
162
|
-
inputClassName: 'inline-flex justify-between flex-row-reverse'
|
163
|
-
},
|
164
|
-
{
|
165
|
-
label: '延迟关闭时间',
|
166
|
-
type: 'input-number',
|
167
|
-
min: 0,
|
168
|
-
step: 100,
|
169
|
-
name: 'delay',
|
170
|
-
suffix: 'ms',
|
171
|
-
pipeIn: defaultValue(0)
|
172
|
-
}
|
242
|
+
{
|
243
|
+
label: '延迟打开',
|
244
|
+
type: 'input-number',
|
245
|
+
min: 0,
|
246
|
+
step: 100,
|
247
|
+
name: 'mouseEnterDelay',
|
248
|
+
suffix: 'ms',
|
249
|
+
pipeIn: defaultValue(0)
|
250
|
+
},
|
251
|
+
{
|
252
|
+
label: '延迟关闭',
|
253
|
+
type: 'input-number',
|
254
|
+
min: 0,
|
255
|
+
step: 100,
|
256
|
+
name: 'mouseLeaveDelay',
|
257
|
+
suffix: 'ms',
|
258
|
+
pipeIn: defaultValue(0)
|
259
|
+
}
|
260
|
+
]
|
261
|
+
}
|
262
|
+
])
|
173
263
|
]
|
174
264
|
},
|
175
265
|
{
|
176
266
|
title: '外观',
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
267
|
+
className: 'p-none',
|
268
|
+
body: getSchemaTpl('collapseGroup', [
|
269
|
+
...getSchemaTpl('style:common'),
|
270
|
+
{
|
271
|
+
title: 'CSS 类名',
|
272
|
+
body: [
|
273
|
+
getSchemaTpl('className', {
|
274
|
+
label: '内容区CSS类名'
|
275
|
+
}),
|
276
|
+
getSchemaTpl('className', {
|
277
|
+
label: '浮层CSS类名',
|
278
|
+
name: 'tooltipClassName'
|
279
|
+
})
|
280
|
+
]
|
281
|
+
}
|
282
|
+
])
|
187
283
|
}
|
188
284
|
])
|
189
285
|
];
|
package/src/plugin/Tpl.tsx
CHANGED
@@ -1,13 +1,25 @@
|
|
1
1
|
import {registerEditorPlugin} from '../manager';
|
2
|
-
import {
|
3
|
-
BaseEventContext,
|
4
|
-
BasePlugin} from '../plugin';
|
2
|
+
import {BaseEventContext, BasePlugin} from '../plugin';
|
5
3
|
import {defaultValue, getSchemaTpl, setSchemaTpl} from '../component/schemaTpl';
|
4
|
+
import {tipedLabel} from '../component/control/BaseControl';
|
6
5
|
|
7
6
|
setSchemaTpl('tpl:content', {
|
7
|
+
label: tipedLabel(
|
8
|
+
'文字内容',
|
9
|
+
'支持使用 <code>\\${xxx}</code> 来获取变量,或者用 lodash.template 语法来写模板逻辑。<a target="_blank" href="/amis/zh-CN/docs/concepts/template">详情</a>'
|
10
|
+
),
|
11
|
+
type: 'textarea',
|
12
|
+
minRows: 5,
|
13
|
+
language: 'html',
|
14
|
+
visibleOn: 'data.wrapperComponent !== undefined',
|
15
|
+
pipeIn: (value: any, data: any) => value || (data && data.html),
|
16
|
+
name: 'tpl'
|
17
|
+
});
|
18
|
+
|
19
|
+
setSchemaTpl('tpl:rich-text', {
|
8
20
|
label: '内容',
|
9
|
-
// type: 'textarea',
|
10
21
|
type: 'input-rich-text',
|
22
|
+
mode: 'normal',
|
11
23
|
buttons: [
|
12
24
|
'paragraphFormat',
|
13
25
|
'quote',
|
@@ -32,22 +44,21 @@ setSchemaTpl('tpl:content', {
|
|
32
44
|
],
|
33
45
|
minRows: 5,
|
34
46
|
language: 'html',
|
35
|
-
|
47
|
+
visibleOn: 'data.wrapperComponent === undefined',
|
36
48
|
pipeIn: (value: any, data: any) => value || (data && data.html),
|
37
|
-
name: 'tpl'
|
38
|
-
description:
|
39
|
-
'支持使用 <code>\\${xxx}</code> 来获取变量,或者用 lodash.template 语法来写模板逻辑。<a target="_blank" href="/amis/zh-CN/docs/concepts/template">详情</a>'
|
49
|
+
name: 'tpl'
|
40
50
|
});
|
41
51
|
|
42
52
|
setSchemaTpl('tpl:wrapperComponent', {
|
43
53
|
name: 'wrapperComponent',
|
44
54
|
type: 'select',
|
45
|
-
pipeIn:
|
46
|
-
|
55
|
+
pipeIn: (value: any) => (value === undefined ? 'rich-text' : value),
|
56
|
+
pipeOut: (value: any) => (value === 'rich-text' ? undefined : value),
|
57
|
+
label: '文字格式',
|
47
58
|
options: [
|
48
59
|
{
|
49
60
|
label: '普通文字',
|
50
|
-
value: '
|
61
|
+
value: ''
|
51
62
|
},
|
52
63
|
{
|
53
64
|
label: '段落',
|
@@ -76,24 +87,15 @@ setSchemaTpl('tpl:wrapperComponent', {
|
|
76
87
|
{
|
77
88
|
label: '六级标题',
|
78
89
|
value: 'h6'
|
90
|
+
},
|
91
|
+
{
|
92
|
+
label: '富文本',
|
93
|
+
value: 'rich-text'
|
79
94
|
}
|
80
|
-
]
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
label: '内联模式',
|
85
|
-
type: 'switch',
|
86
|
-
name: 'inline',
|
87
|
-
mode: 'inline',
|
88
|
-
className: 'w-full',
|
89
|
-
pipeIn: defaultValue(true),
|
90
|
-
labelRemark: {
|
91
|
-
trigger: 'click',
|
92
|
-
className: 'm-l-xs',
|
93
|
-
rootClose: true,
|
94
|
-
content:
|
95
|
-
'内联模式采用 <code>span</code> 标签、非内联将采用 <code>div</code> 标签作为容器。',
|
96
|
-
placement: 'left'
|
95
|
+
],
|
96
|
+
onChange: (value: string, oldValue: string, model: any, form: any) => {
|
97
|
+
(value === undefined || oldValue === undefined) &&
|
98
|
+
form.setValueByName('tpl', '');
|
97
99
|
}
|
98
100
|
});
|
99
101
|
|
@@ -116,41 +118,55 @@ export class TplPlugin extends BasePlugin {
|
|
116
118
|
scaffold: any = {
|
117
119
|
type: 'tpl',
|
118
120
|
tpl: '请编辑内容',
|
119
|
-
inline:
|
121
|
+
inline: true,
|
122
|
+
wrapperComponent: ''
|
120
123
|
};
|
121
124
|
|
122
125
|
panelTitle = '文字';
|
126
|
+
panelJustify = true;
|
123
127
|
panelBodyCreator = (context: BaseEventContext) => {
|
124
128
|
// 在表格/CRUD/模型列表的一列里边
|
125
129
|
const isInTable: boolean = /\/cell\/field\/tpl$/.test(context.path);
|
126
130
|
|
127
|
-
return [
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
131
|
+
return getSchemaTpl('tabs', [
|
132
|
+
{
|
133
|
+
title: '属性',
|
134
|
+
body: getSchemaTpl('collapseGroup', [
|
135
|
+
{
|
136
|
+
title: '基本',
|
137
|
+
body: [
|
138
|
+
!isInTable ? getSchemaTpl('tpl:wrapperComponent') : null,
|
139
|
+
getSchemaTpl('switch', {
|
140
|
+
label: tipedLabel(
|
141
|
+
'内联模式',
|
142
|
+
'内联模式默认采用 <code>span</code> 标签包裹内容、非内联将默认采用 <code>div</code> 标签作为容器。'
|
143
|
+
),
|
144
|
+
name: 'inline',
|
145
|
+
pipeIn: defaultValue(true),
|
146
|
+
hiddenOn:'data.wrapperComponent !== ""'
|
147
|
+
}),
|
148
|
+
getSchemaTpl('tpl:content'),
|
149
|
+
getSchemaTpl('tpl:rich-text')
|
150
|
+
]
|
151
|
+
},
|
152
|
+
getSchemaTpl('status')
|
153
|
+
])
|
154
|
+
},
|
155
|
+
{
|
156
|
+
title: '外观',
|
157
|
+
body: getSchemaTpl('collapseGroup', [
|
158
|
+
...getSchemaTpl('style:common', ['layout']),
|
159
|
+
getSchemaTpl('style:classNames', {
|
160
|
+
isFormItem: false
|
161
|
+
})
|
162
|
+
])
|
163
|
+
}
|
164
|
+
]);
|
150
165
|
};
|
151
166
|
|
152
167
|
popOverBody = [
|
153
168
|
getSchemaTpl('tpl:content'),
|
169
|
+
getSchemaTpl('tpl:rich-text'),
|
154
170
|
getSchemaTpl('tpl:wrapperComponent')
|
155
171
|
];
|
156
172
|
}
|
package/src/plugin/Video.tsx
CHANGED
@@ -48,30 +48,21 @@ export class VideoPlugin extends BasePlugin {
|
|
48
48
|
'可以写静态值,也可以用变量取比如:<code>\\${videoPoster}</code>'
|
49
49
|
},
|
50
50
|
|
51
|
-
{
|
51
|
+
getSchemaTpl('switch', {
|
52
52
|
name: 'autoPlay',
|
53
|
-
type: 'switch',
|
54
|
-
mode: 'inline',
|
55
|
-
className: 'block',
|
56
53
|
label: '自动播放'
|
57
|
-
},
|
54
|
+
}),
|
58
55
|
|
59
|
-
{
|
56
|
+
getSchemaTpl('switch', {
|
60
57
|
name: 'muted',
|
61
|
-
type: 'switch',
|
62
|
-
mode: 'inline',
|
63
|
-
className: 'block',
|
64
58
|
label: '静音'
|
65
|
-
},
|
59
|
+
}),
|
66
60
|
|
67
|
-
{
|
61
|
+
getSchemaTpl('switch', {
|
68
62
|
name: 'isLive',
|
69
|
-
type: 'switch',
|
70
|
-
mode: 'inline',
|
71
|
-
className: 'block',
|
72
63
|
label: '直播流',
|
73
64
|
description: '如果是直播流,请勾选,否则有可能不能正常播放。'
|
74
|
-
}
|
65
|
+
})
|
75
66
|
]
|
76
67
|
},
|
77
68
|
{
|
@@ -103,13 +94,11 @@ export class VideoPlugin extends BasePlugin {
|
|
103
94
|
]
|
104
95
|
},
|
105
96
|
|
106
|
-
{
|
97
|
+
getSchemaTpl('switch', {
|
107
98
|
name: 'splitPoster',
|
108
|
-
type: 'switch',
|
109
|
-
mode: 'inline',
|
110
|
-
className: 'block',
|
111
99
|
label: '分开显示封面'
|
112
|
-
},
|
100
|
+
}),
|
101
|
+
|
113
102
|
getSchemaTpl('className')
|
114
103
|
]
|
115
104
|
},
|