@tmagic/editor 1.5.2 → 1.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/style.css +366 -6
  2. package/dist/tmagic-editor.js +1421 -509
  3. package/dist/tmagic-editor.umd.cjs +1436 -523
  4. package/package.json +7 -7
  5. package/src/components/SplitView.vue +1 -1
  6. package/src/fields/DisplayConds.vue +2 -1
  7. package/src/fields/StyleSetter/Index.vue +69 -0
  8. package/src/fields/StyleSetter/components/BackgroundPosition.vue +71 -0
  9. package/src/fields/StyleSetter/components/Border.vue +104 -0
  10. package/src/fields/StyleSetter/components/Box.vue +73 -0
  11. package/src/fields/StyleSetter/components/Position.vue +54 -0
  12. package/src/fields/StyleSetter/icons/background-position/LeftBottom.vue +7 -0
  13. package/src/fields/StyleSetter/icons/background-position/LeftCenter.vue +7 -0
  14. package/src/fields/StyleSetter/icons/background-position/LeftTop.vue +12 -0
  15. package/src/fields/StyleSetter/icons/background-position/index.ts +3 -0
  16. package/src/fields/StyleSetter/icons/background-repeat/NoRepeat.vue +8 -0
  17. package/src/fields/StyleSetter/icons/background-repeat/Repeat.vue +31 -0
  18. package/src/fields/StyleSetter/icons/background-repeat/RepeatX.vue +8 -0
  19. package/src/fields/StyleSetter/icons/background-repeat/RepeatY.vue +8 -0
  20. package/src/fields/StyleSetter/icons/background-repeat/index.ts +4 -0
  21. package/src/fields/StyleSetter/icons/display/Block.vue +7 -0
  22. package/src/fields/StyleSetter/icons/display/Flex.vue +7 -0
  23. package/src/fields/StyleSetter/icons/display/Inline.vue +7 -0
  24. package/src/fields/StyleSetter/icons/display/InlineBlock.vue +7 -0
  25. package/src/fields/StyleSetter/icons/display/None.vue +7 -0
  26. package/src/fields/StyleSetter/icons/display/index.ts +5 -0
  27. package/src/fields/StyleSetter/icons/flex-direction/Column.vue +7 -0
  28. package/src/fields/StyleSetter/icons/flex-direction/ColumnReverse.vue +7 -0
  29. package/src/fields/StyleSetter/icons/flex-direction/Row.vue +7 -0
  30. package/src/fields/StyleSetter/icons/flex-direction/RowReverse.vue +7 -0
  31. package/src/fields/StyleSetter/icons/flex-direction/index.ts +4 -0
  32. package/src/fields/StyleSetter/icons/justify-content/Center.vue +5 -0
  33. package/src/fields/StyleSetter/icons/justify-content/FlexEnd.vue +5 -0
  34. package/src/fields/StyleSetter/icons/justify-content/FlexStart.vue +5 -0
  35. package/src/fields/StyleSetter/icons/justify-content/SpaceAround.vue +7 -0
  36. package/src/fields/StyleSetter/icons/justify-content/SpaceBetween.vue +5 -0
  37. package/src/fields/StyleSetter/icons/justify-content/index.ts +5 -0
  38. package/src/fields/StyleSetter/icons/text-align/Center.vue +7 -0
  39. package/src/fields/StyleSetter/icons/text-align/Left.vue +7 -0
  40. package/src/fields/StyleSetter/icons/text-align/Right.vue +7 -0
  41. package/src/fields/StyleSetter/icons/text-align/index.ts +3 -0
  42. package/src/fields/StyleSetter/pro/Background.vue +78 -0
  43. package/src/fields/StyleSetter/pro/Border.vue +35 -0
  44. package/src/fields/StyleSetter/pro/Font.vue +90 -0
  45. package/src/fields/StyleSetter/pro/Layout.vue +164 -0
  46. package/src/fields/StyleSetter/pro/Position.vue +48 -0
  47. package/src/fields/StyleSetter/pro/index.ts +5 -0
  48. package/src/index.ts +3 -0
  49. package/src/layouts/props-panel/FormPanel.vue +1 -1
  50. package/src/layouts/props-panel/PropsPanel.vue +32 -2
  51. package/src/services/editor.ts +2 -2
  52. package/src/theme/props-panel.scss +13 -0
  53. package/src/theme/resizer.scss +2 -2
  54. package/src/theme/style-setter/background.scss +113 -0
  55. package/src/theme/style-setter/border.scss +53 -0
  56. package/src/theme/style-setter/index.scss +28 -0
  57. package/src/theme/style-setter/layout.scss +199 -0
  58. package/src/theme/theme.scss +1 -0
  59. package/src/utils/props.ts +52 -297
  60. package/types/index.d.ts +425 -110
@@ -46,305 +46,60 @@ export const styleTabConfig: TabPaneConfig = {
46
46
  items: [
47
47
  {
48
48
  name: 'style',
49
+ labelWidth: '100px',
50
+ type: 'style-setter',
49
51
  items: [
50
52
  {
51
- type: 'fieldset',
52
- legend: '位置',
53
- items: [
54
- {
55
- type: 'data-source-field-select',
56
- name: 'position',
57
- text: '固定定位',
58
- labelPosition: 'left',
59
- checkStrictly: false,
60
- dataSourceFieldType: ['string'],
61
- fieldConfig: {
62
- type: 'checkbox',
63
- activeValue: 'fixed',
64
- inactiveValue: 'absolute',
65
- defaultValue: 'absolute',
66
- },
67
- },
68
- {
69
- type: 'data-source-field-select',
70
- name: 'left',
71
- text: 'left',
72
- checkStrictly: false,
73
- dataSourceFieldType: ['string', 'number'],
74
- fieldConfig: {
75
- type: 'text',
76
- },
77
- },
78
- {
79
- type: 'data-source-field-select',
80
- name: 'top',
81
- text: 'top',
82
- checkStrictly: false,
83
- dataSourceFieldType: ['string', 'number'],
84
- fieldConfig: {
85
- type: 'text',
86
- },
87
- disabled: (_vm: FormState, { model }: any) =>
88
- model.position === 'fixed' && model._magic_position === 'fixedBottom',
89
- },
90
- {
91
- type: 'data-source-field-select',
92
- name: 'right',
93
- text: 'right',
94
- checkStrictly: false,
95
- dataSourceFieldType: ['string', 'number'],
96
- fieldConfig: {
97
- type: 'text',
98
- },
99
- },
100
- {
101
- type: 'data-source-field-select',
102
- name: 'bottom',
103
- text: 'bottom',
104
- checkStrictly: false,
105
- dataSourceFieldType: ['string', 'number'],
106
- fieldConfig: {
107
- type: 'text',
108
- },
109
- disabled: (_vm: FormState, { model }: any) =>
110
- model.position === 'fixed' && model._magic_position === 'fixedTop',
111
- },
112
- ],
113
- },
114
- {
115
- type: 'fieldset',
116
- legend: '盒子',
117
- items: [
118
- {
119
- type: 'data-source-field-select',
120
- name: 'display',
121
- text: 'display',
122
- checkStrictly: false,
123
- dataSourceFieldType: ['string'],
124
- fieldConfig: {
125
- type: 'select',
126
- clearable: true,
127
- allowCreate: true,
128
- options: [
129
- { text: 'block', value: 'block' },
130
- { text: 'flex', value: 'flex' },
131
- { text: 'none', value: 'none' },
132
- { text: 'inline-block', value: 'inline-block' },
133
- { text: 'grid', value: 'grid' },
134
- { text: 'inline', value: 'inline' },
135
- { text: 'initial', value: 'initial' },
136
- ],
137
- },
138
- },
139
- {
140
- type: 'data-source-field-select',
141
- name: 'width',
142
- text: '宽度',
143
- checkStrictly: false,
144
- dataSourceFieldType: ['string', 'number'],
145
- fieldConfig: {
146
- type: 'text',
147
- },
148
- },
149
- {
150
- type: 'data-source-field-select',
151
- name: 'height',
152
- text: '高度',
153
- checkStrictly: false,
154
- dataSourceFieldType: ['string', 'number'],
155
- fieldConfig: {
156
- type: 'text',
157
- },
158
- },
159
- {
160
- type: 'data-source-field-select',
161
- text: 'overflow',
162
- name: 'overflow',
163
- checkStrictly: false,
164
- dataSourceFieldType: ['string'],
165
- fieldConfig: {
166
- type: 'select',
167
- clearable: true,
168
- allowCreate: true,
169
- options: [
170
- { text: 'visible', value: 'visible' },
171
- { text: 'hidden', value: 'hidden' },
172
- { text: 'clip', value: 'clip' },
173
- { text: 'scroll', value: 'scroll' },
174
- { text: 'auto', value: 'auto' },
175
- { text: 'overlay', value: 'overlay' },
176
- { text: 'initial', value: 'initial' },
177
- ],
178
- },
179
- },
180
- ],
181
- },
182
- {
183
- type: 'fieldset',
184
- legend: '边框',
185
- items: [
186
- {
187
- type: 'data-source-field-select',
188
- name: 'borderWidth',
189
- text: '宽度',
190
- defaultValue: '0',
191
- checkStrictly: false,
192
- dataSourceFieldType: ['string', 'number'],
193
- fieldConfig: {
194
- type: 'text',
195
- },
196
- },
197
- {
198
- type: 'data-source-field-select',
199
- name: 'borderColor',
200
- text: '颜色',
201
- checkStrictly: false,
202
- dataSourceFieldType: ['string'],
203
- fieldConfig: {
204
- type: 'text',
205
- },
206
- },
207
- {
208
- type: 'data-source-field-select',
209
- name: 'borderStyle',
210
- text: '样式',
211
- defaultValue: 'none',
212
- checkStrictly: false,
213
- dataSourceFieldType: ['string'],
214
- fieldConfig: {
215
- type: 'select',
216
- options: [
217
- { text: 'none', value: 'none' },
218
- { text: 'hidden', value: 'hidden' },
219
- { text: 'dotted', value: 'dotted' },
220
- { text: 'dashed', value: 'dashed' },
221
- { text: 'solid', value: 'solid' },
222
- { text: 'double', value: 'double' },
223
- { text: 'groove', value: 'groove' },
224
- { text: 'ridge', value: 'ridge' },
225
- { text: 'inset', value: 'inset' },
226
- { text: 'outset', value: 'outset' },
227
- ],
228
- },
229
- },
230
- ],
231
- },
232
- {
233
- type: 'fieldset',
234
- legend: '背景',
235
- items: [
236
- {
237
- type: 'data-source-field-select',
238
- name: 'backgroundImage',
239
- text: '背景图',
240
- checkStrictly: false,
241
- dataSourceFieldType: ['string'],
242
- fieldConfig: {
243
- type: 'img-upload',
244
- },
245
- },
246
- {
247
- type: 'data-source-field-select',
248
- name: 'backgroundColor',
249
- text: '背景颜色',
250
- checkStrictly: false,
251
- dataSourceFieldType: ['string'],
252
- fieldConfig: {
253
- type: 'colorPicker',
254
- },
255
- },
256
- {
257
- type: 'data-source-field-select',
258
- name: 'backgroundRepeat',
259
- text: '背景图重复',
260
- defaultValue: 'no-repeat',
261
- checkStrictly: false,
262
- dataSourceFieldType: ['string'],
263
- fieldConfig: {
264
- type: 'select',
265
- options: [
266
- { text: 'repeat', value: 'repeat' },
267
- { text: 'repeat-x', value: 'repeat-x' },
268
- { text: 'repeat-y', value: 'repeat-y' },
269
- { text: 'no-repeat', value: 'no-repeat' },
270
- { text: 'inherit', value: 'inherit' },
271
- ],
272
- },
273
- },
274
- {
275
- type: 'data-source-field-select',
276
- name: 'backgroundSize',
277
- text: '背景图大小',
278
- defaultValue: '100% 100%',
279
- checkStrictly: false,
280
- dataSourceFieldType: ['string'],
281
- fieldConfig: {
282
- type: 'text',
283
- },
284
- },
285
- ],
286
- },
287
- {
288
- type: 'fieldset',
289
- legend: '字体',
290
- items: [
291
- {
292
- type: 'data-source-field-select',
293
- name: 'color',
294
- text: '颜色',
295
- checkStrictly: false,
296
- dataSourceFieldType: ['string'],
297
- fieldConfig: {
298
- type: 'colorPicker',
299
- },
300
- },
301
- {
302
- type: 'data-source-field-select',
303
- name: 'fontSize',
304
- text: '大小',
305
- checkStrictly: false,
306
- dataSourceFieldType: ['string', 'number'],
307
- fieldConfig: {
308
- type: 'text',
309
- },
310
- },
311
- {
312
- type: 'data-source-field-select',
313
- name: 'fontWeight',
314
- text: '粗细',
315
- checkStrictly: false,
316
- dataSourceFieldType: ['string', 'number'],
317
- fieldConfig: {
318
- type: 'text',
319
- },
320
- },
321
- ],
322
- },
323
- {
324
- type: 'fieldset',
325
- legend: '变形',
326
- name: 'transform',
327
- items: [
328
- {
329
- type: 'data-source-field-select',
330
- name: 'rotate',
331
- text: '旋转角度',
332
- checkStrictly: false,
333
- dataSourceFieldType: ['string'],
334
- fieldConfig: {
335
- type: 'text',
336
- },
337
- },
338
- {
339
- type: 'data-source-field-select',
340
- name: 'scale',
341
- text: '缩放',
342
- checkStrictly: false,
343
- dataSourceFieldType: ['number', 'string'],
344
- fieldConfig: {
345
- type: 'text',
346
- },
347
- },
53
+ names: [
54
+ 'display',
55
+ 'flexDirection',
56
+ 'justifyContent',
57
+ 'alignItems',
58
+ 'flexWrap',
59
+ 'marginTop',
60
+ 'marginRight',
61
+ 'marginBottom',
62
+ 'marginLeft',
63
+ 'paddingTop',
64
+ 'paddingRight',
65
+ 'paddingBottom',
66
+ 'paddingLeft',
67
+ 'width',
68
+ 'height',
69
+ 'overflow',
70
+ 'fontSize',
71
+ 'lineHeight',
72
+ 'fontWeight',
73
+ 'color',
74
+ 'textAlign',
75
+ 'backgroundColor',
76
+ 'backgroundImage',
77
+ 'backgroundSize',
78
+ 'backgroundPosition',
79
+ 'backgroundRepeat',
80
+ 'position',
81
+ 'zIndex',
82
+ 'top',
83
+ 'right',
84
+ 'bottom',
85
+ 'left',
86
+ 'borderRadius',
87
+ 'borderTopWidth',
88
+ 'borderTopStyle',
89
+ 'borderTopColor',
90
+ 'borderRightColor',
91
+ 'borderRightWidth',
92
+ 'borderRightStyle',
93
+ 'borderRightColor',
94
+ 'borderBottomWidth',
95
+ 'borderBottomStyle',
96
+ 'borderBottomColor',
97
+ 'borderLeftStyle',
98
+ 'borderLeftWidth',
99
+ 'borderLeftColor',
100
+ 'borderWidth',
101
+ 'borderStyle',
102
+ 'borderColor',
348
103
  ],
349
104
  },
350
105
  ],