amis-editor 4.2.0-beta.0 → 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/VRenderer.d.ts +10 -0
  5. package/dist/component/base/ShortcutKey.d.ts +23 -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 +1 -1
  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 +24 -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 +65 -38
  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 -9
  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
@@ -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
- type: 'input-text',
49
- name: 'title',
50
- label: '提示标题'
51
- },
52
- {
53
- type: 'textarea',
54
- name: 'tooltip',
55
- label: '提示内容'
56
- },
57
- {
58
- name: 'wrapperComponent',
59
- label: '容器标签',
60
- type: 'input-text',
61
- options: [
62
- 'article',
63
- 'aside',
64
- 'code',
65
- 'div',
66
- 'footer',
67
- 'header',
68
- 'p',
69
- 'section'
70
- ],
71
- validations: {
72
- isAlphanumeric: true,
73
- matchRegexp: '/^(?!.*script).*$/' // 禁用一下script标签
74
- },
75
- validationErrors: {
76
- isAlpha: 'HTML标签不合法,请重新输入',
77
- matchRegexp: 'HTML标签不合法,请重新输入'
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
- validateOnChange: false
80
- },
81
- {
82
- name: 'trigger',
83
- type: 'select',
84
- label: '触发方式',
85
- multiple: true,
86
- value: ['hover'],
87
- pipeIn: (value: any) =>
88
- Array.isArray(value) ? value.join(',') : [],
89
- pipeOut: (value: any) =>
90
- value && value.length ? value.split(',') : undefined,
91
- options: [
92
- {
93
- label: '鼠标悬停',
94
- value: 'hover'
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
- label: '点击',
99
- value: 'click'
100
- }
101
- ]
102
- },
103
- {
104
- type: 'button-group-select',
105
- name: 'placement',
106
- label: '提示位置',
107
- options: [
108
- {
109
- label: '上',
110
- value: 'top',
111
- icon: 'fa fa-arrow-up'
112
- },
113
- {
114
- label: '下',
115
- value: 'bottom',
116
- icon: 'fa fa-arrow-down'
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
- body: [
178
- getSchemaTpl('className', {
179
- label: '内容区CSS类名'
180
- }),
181
- getSchemaTpl('className', {
182
- label: '浮层CSS类名',
183
- name: 'tooltipClassName'
184
- }),
185
- getSchemaTpl('style')
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
  ];
@@ -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
- // visibleOn: 'data.__mode !="input-rich-text"',
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: defaultValue('div'),
46
- label: '格式',
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: 'div'
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
- setSchemaTpl('tpl:inline', {
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: false
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
- getSchemaTpl('tabs', [
129
- {
130
- title: '常规',
131
- body: [
132
- getSchemaTpl('tpl:content'),
133
- !isInTable ? getSchemaTpl('tpl:wrapperComponent') : null
134
- ]
135
- },
136
- {
137
- title: '外观',
138
- body: [
139
- getSchemaTpl('tpl:inline'),
140
- getSchemaTpl('className'),
141
- getSchemaTpl('style')
142
- ]
143
- },
144
- {
145
- title: '显隐',
146
- body: [getSchemaTpl('ref'), getSchemaTpl('visible')]
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
  }
@@ -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
  },