amis-editor 4.2.0-beta.2 → 5.1.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (216) hide show
  1. package/dist/6dbcbb49b6fd405190a9.png +0 -0
  2. package/dist/component/Control/APIControl.d.ts +1101 -447
  3. package/dist/component/Control/ActionAPIControl.d.ts +1158 -0
  4. package/dist/component/Control/BadgeControl.d.ts +133 -0
  5. package/dist/component/Control/BaseControl.d.ts +248 -0
  6. package/dist/component/Control/DataBindingControl.d.ts +14 -0
  7. package/dist/component/Control/DataPickerControl.d.ts +13 -0
  8. package/dist/component/Control/DateShortCutControl.d.ts +83 -0
  9. package/dist/component/Control/FormulaControl.d.ts +51 -0
  10. package/dist/component/Control/OptionControl.d.ts +23 -34
  11. package/dist/component/Control/StatusControl.d.ts +39 -0
  12. package/dist/component/Control/SwitchMoreControl.d.ts +224 -0
  13. package/dist/component/Control/ValidationControl.d.ts +50 -15
  14. package/dist/component/Control/ValidationItem.d.ts +46 -0
  15. package/dist/component/Control/style-control/Background.d.ts +17 -0
  16. package/dist/component/Control/style-control/Border.d.ts +18 -0
  17. package/dist/component/Control/style-control/BoxModel.d.ts +17 -0
  18. package/dist/component/Control/style-control/BoxShadow.d.ts +18 -0
  19. package/dist/component/Control/style-control/Display.d.ts +14 -0
  20. package/dist/component/Control/style-control/Font.d.ts +16 -0
  21. package/dist/component/Control/style-control/font-family.d.ts +11 -0
  22. package/dist/component/Control/style-control/transformation.d.ts +29 -0
  23. package/dist/component/Control/style-control/types.d.ts +8 -0
  24. package/dist/component/Editor.d.ts +16 -0
  25. package/dist/component/RegionWrapper.d.ts +10 -0
  26. package/dist/component/VRenderer.d.ts +10 -0
  27. package/dist/component/schemaTpl.d.ts +8 -0
  28. package/dist/component/validator.d.ts +62 -0
  29. package/dist/dnd/index.d.ts +1 -1
  30. package/dist/event-action/action-config-panel.d.ts +8 -0
  31. package/dist/event-action/actions.d.ts +3 -0
  32. package/dist/event-action/comp-action-select.d.ts +11 -0
  33. package/dist/event-action/config.d.ts +13 -0
  34. package/dist/event-action/index.d.ts +459 -0
  35. package/dist/event-action/schema.d.ts +32 -0
  36. package/dist/exports.min.js +1 -1
  37. package/dist/index.d.ts +23 -5
  38. package/dist/index.min.js +1 -1
  39. package/dist/manager.d.ts +46 -1
  40. package/dist/plugin/Alert.d.ts +4 -2
  41. package/dist/plugin/Button.d.ts +5 -1
  42. package/dist/plugin/ButtonGroup.d.ts +13 -34
  43. package/dist/plugin/ButtonToolbar.d.ts +4 -10
  44. package/dist/plugin/CRUD.d.ts +2 -0
  45. package/dist/plugin/Chart.d.ts +2 -0
  46. package/dist/plugin/Collapse.d.ts +1 -0
  47. package/dist/plugin/CollapseGroup.d.ts +28 -4
  48. package/dist/plugin/Container.d.ts +2 -1
  49. package/dist/plugin/Dialog.d.ts +12 -2
  50. package/dist/plugin/Drawer.d.ts +12 -2
  51. package/dist/plugin/DropDownButton.d.ts +11 -11
  52. package/dist/plugin/Form/ButtonGroupSelect.d.ts +7 -2
  53. package/dist/plugin/Form/ButtonToolbar.d.ts +8 -7
  54. package/dist/plugin/Form/ChainedSelect.d.ts +3 -0
  55. package/dist/plugin/Form/Checkbox.d.ts +7 -2
  56. package/dist/plugin/Form/Checkboxes.d.ts +8 -2
  57. package/dist/plugin/Form/CodeEditor.d.ts +7 -22
  58. package/dist/plugin/Form/Combo.d.ts +3 -0
  59. package/dist/plugin/Form/Control.d.ts +6 -2
  60. package/dist/plugin/Form/DiffEditor.d.ts +7 -1
  61. package/dist/plugin/Form/Form.d.ts +6 -0
  62. package/dist/plugin/Form/Formula.d.ts +1 -25
  63. package/dist/plugin/Form/InputDate.d.ts +8 -2
  64. package/dist/plugin/Form/InputDateRange.d.ts +8 -2
  65. package/dist/plugin/Form/InputDateTime.d.ts +4 -4
  66. package/dist/plugin/Form/InputDateTimeRange.d.ts +4 -4
  67. package/dist/plugin/Form/InputEmail.d.ts +1 -0
  68. package/dist/plugin/Form/InputExcel.d.ts +6 -41
  69. package/dist/plugin/Form/InputFile.d.ts +7 -3
  70. package/dist/plugin/Form/InputKV.d.ts +6 -0
  71. package/dist/plugin/Form/InputMonth.d.ts +1 -0
  72. package/dist/plugin/Form/InputMonthRange.d.ts +4 -4
  73. package/dist/plugin/Form/InputPassword.d.ts +1 -0
  74. package/dist/plugin/Form/InputQuarter.d.ts +1 -0
  75. package/dist/plugin/Form/InputQuarterRange.d.ts +4 -4
  76. package/dist/plugin/Form/InputRange.d.ts +3 -0
  77. package/dist/plugin/Form/InputRating.d.ts +9 -3
  78. package/dist/plugin/Form/InputText.d.ts +24 -2
  79. package/dist/plugin/Form/InputTime.d.ts +3 -3
  80. package/dist/plugin/Form/InputTimeRange.d.ts +20 -0
  81. package/dist/plugin/Form/InputTree.d.ts +6 -2
  82. package/dist/plugin/Form/InputURL.d.ts +1 -0
  83. package/dist/plugin/Form/InputYear.d.ts +1 -0
  84. package/dist/plugin/Form/InputYearRange.d.ts +20 -0
  85. package/dist/plugin/Form/ListSelect.d.ts +6 -2
  86. package/dist/plugin/Form/LocationPicker.d.ts +1 -31
  87. package/dist/plugin/Form/NestedSelect.d.ts +5 -2
  88. package/dist/plugin/Form/Radios.d.ts +7 -2
  89. package/dist/plugin/Form/Select.d.ts +7 -2
  90. package/dist/plugin/Form/Switch.d.ts +7 -2
  91. package/dist/plugin/Form/TabsTransfer.d.ts +5 -2
  92. package/dist/plugin/Form/Textarea.d.ts +7 -1
  93. package/dist/plugin/Form/Transfer.d.ts +5 -2
  94. package/dist/plugin/Form/TreeSelect.d.ts +6 -2
  95. package/dist/plugin/IFrame.d.ts +2 -2
  96. package/dist/plugin/Nav.d.ts +1 -116
  97. package/dist/plugin/Others/Action.d.ts +5 -1
  98. package/dist/plugin/Page.d.ts +5 -2
  99. package/dist/plugin/Progress.d.ts +5 -1
  100. package/dist/plugin/Table.d.ts +2 -0
  101. package/dist/plugin/Tabs.d.ts +33 -2
  102. package/dist/plugin/TooltipWrapper.d.ts +10 -0
  103. package/dist/plugin/Tpl.d.ts +2 -1
  104. package/dist/plugin/Wizard.d.ts +4 -1
  105. package/dist/plugin.d.ts +37 -1
  106. package/dist/store/editor.d.ts +65 -38
  107. package/dist/store/node.d.ts +16 -0
  108. package/dist/style.css +1 -1
  109. package/dist/util.d.ts +36 -3
  110. package/package.json +14 -8
  111. package/src/component/schemaTpl.tsx +1198 -474
  112. package/src/plugin/.DS_Store +0 -0
  113. package/src/plugin/Alert.tsx +69 -48
  114. package/src/plugin/AnchorNav.tsx +1 -0
  115. package/src/plugin/Audio.tsx +9 -15
  116. package/src/plugin/Avatar.tsx +2 -1
  117. package/src/plugin/Breadcrumb.tsx +2 -1
  118. package/src/plugin/Button.tsx +257 -188
  119. package/src/plugin/ButtonGroup.tsx +99 -38
  120. package/src/plugin/ButtonToolbar.tsx +7 -13
  121. package/src/plugin/CRUD.tsx +77 -135
  122. package/src/plugin/Card.tsx +1 -0
  123. package/src/plugin/Cards.tsx +8 -14
  124. package/src/plugin/Carousel.tsx +1 -1
  125. package/src/plugin/Chart.tsx +26 -14
  126. package/src/plugin/Collapse.tsx +78 -78
  127. package/src/plugin/CollapseGroup.tsx +165 -83
  128. package/src/plugin/Container.tsx +59 -6
  129. package/src/plugin/Custom.tsx +2 -8
  130. package/src/plugin/CustomRegion.tsx +4 -3
  131. package/src/plugin/Dialog.tsx +55 -24
  132. package/src/plugin/Drawer.tsx +65 -35
  133. package/src/plugin/DropDownButton.tsx +95 -79
  134. package/src/plugin/Flex.tsx +123 -65
  135. package/src/plugin/Form/ButtonGroupSelect.tsx +114 -26
  136. package/src/plugin/Form/ButtonToolbar.tsx +62 -55
  137. package/src/plugin/Form/ChainedSelect.tsx +45 -0
  138. package/src/plugin/Form/Checkbox.tsx +122 -33
  139. package/src/plugin/Form/Checkboxes.tsx +154 -87
  140. package/src/plugin/Form/CodeEditor.tsx +163 -34
  141. package/src/plugin/Form/Combo.tsx +104 -65
  142. package/src/plugin/Form/Control.tsx +16 -70
  143. package/src/plugin/Form/DiffEditor.tsx +158 -54
  144. package/src/plugin/Form/FieldSet.tsx +6 -11
  145. package/src/plugin/Form/Form.tsx +277 -70
  146. package/src/plugin/Form/Formula.tsx +8 -14
  147. package/src/plugin/Form/InputArray.tsx +7 -16
  148. package/src/plugin/Form/InputCity.tsx +1 -1
  149. package/src/plugin/Form/InputDate.tsx +344 -121
  150. package/src/plugin/Form/InputDateRange.tsx +303 -161
  151. package/src/plugin/Form/InputDateTime.tsx +6 -150
  152. package/src/plugin/Form/InputDateTimeRange.tsx +7 -187
  153. package/src/plugin/Form/InputEmail.tsx +1 -0
  154. package/src/plugin/Form/InputExcel.tsx +70 -27
  155. package/src/plugin/Form/InputFile.tsx +326 -152
  156. package/src/plugin/Form/InputImage.tsx +1 -1
  157. package/src/plugin/Form/InputKV.tsx +61 -0
  158. package/src/plugin/Form/InputMonth.tsx +3 -1
  159. package/src/plugin/Form/InputMonthRange.tsx +6 -160
  160. package/src/plugin/Form/InputNumber.tsx +1 -1
  161. package/src/plugin/Form/InputPassword.tsx +2 -0
  162. package/src/plugin/Form/InputQuarter.tsx +3 -1
  163. package/src/plugin/Form/InputQuarterRange.tsx +6 -160
  164. package/src/plugin/Form/InputRange.tsx +74 -4
  165. package/src/plugin/Form/InputRating.tsx +347 -35
  166. package/src/plugin/Form/InputRichText.tsx +2 -3
  167. package/src/plugin/Form/InputTable.tsx +33 -49
  168. package/src/plugin/Form/InputTag.tsx +1 -1
  169. package/src/plugin/Form/InputText.tsx +310 -132
  170. package/src/plugin/Form/InputTime.tsx +4 -53
  171. package/src/plugin/Form/InputTimeRange.tsx +41 -0
  172. package/src/plugin/Form/InputTree.tsx +196 -46
  173. package/src/plugin/Form/InputURL.tsx +2 -0
  174. package/src/plugin/Form/InputYear.tsx +2 -0
  175. package/src/plugin/Form/InputYearRange.tsx +41 -0
  176. package/src/plugin/Form/Item.tsx +17 -18
  177. package/src/plugin/Form/ListSelect.tsx +75 -20
  178. package/src/plugin/Form/LocationPicker.tsx +2 -7
  179. package/src/plugin/Form/MatrixCheckboxes.tsx +1 -1
  180. package/src/plugin/Form/NestedSelect.tsx +110 -43
  181. package/src/plugin/Form/Picker.tsx +2 -5
  182. package/src/plugin/Form/Radios.tsx +122 -52
  183. package/src/plugin/Form/Select.tsx +239 -168
  184. package/src/plugin/Form/Static.tsx +1 -1
  185. package/src/plugin/Form/Switch.tsx +170 -58
  186. package/src/plugin/Form/TabsTransfer.tsx +175 -79
  187. package/src/plugin/Form/Textarea.tsx +146 -36
  188. package/src/plugin/Form/Transfer.tsx +295 -233
  189. package/src/plugin/Form/TreeSelect.tsx +287 -146
  190. package/src/plugin/Grid.tsx +340 -312
  191. package/src/plugin/HBox.tsx +1 -0
  192. package/src/plugin/IFrame.tsx +21 -12
  193. package/src/plugin/Image.tsx +7 -12
  194. package/src/plugin/Images.tsx +7 -12
  195. package/src/plugin/Link.tsx +6 -12
  196. package/src/plugin/List.tsx +6 -10
  197. package/src/plugin/ListItem.tsx +1 -0
  198. package/src/plugin/Nav.tsx +7 -9
  199. package/src/plugin/Others/Action.tsx +16 -10
  200. package/src/plugin/Others/BasicToolbar.tsx +4 -1
  201. package/src/plugin/Others/TableCell.tsx +19 -39
  202. package/src/plugin/Page.tsx +315 -229
  203. package/src/plugin/Panel.tsx +6 -7
  204. package/src/plugin/Plain.tsx +3 -6
  205. package/src/plugin/Progress.tsx +234 -94
  206. package/src/plugin/Service.tsx +10 -6
  207. package/src/plugin/Table.tsx +49 -20
  208. package/src/plugin/TableView.tsx +212 -106
  209. package/src/plugin/Tabs.tsx +306 -146
  210. package/src/plugin/TooltipWrapper.tsx +231 -135
  211. package/src/plugin/Tpl.tsx +68 -52
  212. package/src/plugin/Video.tsx +9 -20
  213. package/src/plugin/Wizard.tsx +537 -336
  214. package/src/plugin/Wrapper.tsx +82 -61
  215. package/src/plugin.ts +66 -4
  216. package/static/empty.png +0 -0
@@ -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
  },