@zhangqingcq/vgce 0.1.7 → 0.1.9

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 (39) hide show
  1. package/README.md +135 -92
  2. package/dist/style.css +1 -1
  3. package/dist/vgce.js +11044 -10941
  4. package/dist/vgce.umd.cjs +33 -33
  5. package/package.json +1 -1
  6. package/src/assets/base.less +69 -68
  7. package/src/assets/svgs/text-box.svg +1 -0
  8. package/src/assets/variables.less +6 -6
  9. package/src/components/svg-editor/center-panel.vue +3 -2
  10. package/src/components/svg-editor/index.vue +7 -5
  11. package/src/components/svg-viewer.vue +7 -4
  12. package/src/config/files/text-box.vue +72 -0
  13. package/src/config/index.ts +5 -3
  14. package/src/config/svg/animation/index.ts +3 -2
  15. package/src/config/svg/animation/thermometer.ts +2 -1
  16. package/src/config/svg/custom/clock-a.ts +2 -1
  17. package/src/config/svg/custom/index.ts +6 -5
  18. package/src/config/svg/custom/light.ts +2 -1
  19. package/src/config/svg/custom/svg-text.ts +2 -1
  20. package/src/config/svg/custom/switch-r.ts +2 -1
  21. package/src/config/svg/index.ts +6 -10
  22. package/src/config/svg/stateful/alert-light.ts +2 -1
  23. package/src/config/svg/stateful/index.ts +3 -2
  24. package/src/config/svg/stateless/bot-2.ts +2 -1
  25. package/src/config/svg/stateless/bot-9.ts +2 -1
  26. package/src/config/svg/stateless/hamburger.ts +2 -1
  27. package/src/config/svg/stateless/hotpot.ts +2 -1
  28. package/src/config/svg/stateless/index.ts +6 -5
  29. package/src/config/vue/component/button.ts +2 -1
  30. package/src/config/vue/component/common-table.ts +2 -1
  31. package/src/config/vue/component/index.ts +9 -7
  32. package/src/config/vue/component/now-time.ts +2 -1
  33. package/src/config/vue/component/progress.ts +2 -1
  34. package/src/config/vue/component/tag.ts +2 -1
  35. package/src/config/vue/component/text-box.ts +66 -0
  36. package/src/config/vue/echarts/index.ts +3 -2
  37. package/src/config/vue/echarts/pie-charts.ts +2 -1
  38. package/src/config/vue/index.ts +4 -3
  39. package/src/utils/index.ts +3 -2
@@ -1,7 +1,7 @@
1
1
  import { EConfigItemPropsType, EDoneJsonType } from '@/config/types'
2
2
  import type { IConfigItem } from '@/config/types'
3
3
 
4
- export const now_time: IConfigItem = {
4
+ const t: IConfigItem = {
5
5
  name: 'now-time',
6
6
  title: '当前时间',
7
7
  tag: 'now-time',
@@ -61,3 +61,4 @@ export const now_time: IConfigItem = {
61
61
  },
62
62
  events: []
63
63
  }
64
+ export default t
@@ -1,7 +1,7 @@
1
1
  import { EConfigItemPropsType, EDoneJsonType } from '@/config/types'
2
2
  import type { IConfigItem } from '@/config/types'
3
3
 
4
- export const progress_a: IConfigItem = {
4
+ const t: IConfigItem = {
5
5
  name: 'progress-a',
6
6
  tag: 'progress-a',
7
7
  title: '进度条',
@@ -27,3 +27,4 @@ export const progress_a: IConfigItem = {
27
27
  },
28
28
  events: []
29
29
  }
30
+ export default t
@@ -1,7 +1,7 @@
1
1
  import { EConfigItemPropsType, EDoneJsonType } from '@/config/types'
2
2
  import type { IConfigItem } from '@/config/types'
3
3
 
4
- export const el_tag: IConfigItem = {
4
+ const t: IConfigItem = {
5
5
  name: 'el-tag',
6
6
  tag: 'el-tag',
7
7
  title: '标签',
@@ -44,3 +44,4 @@ export const el_tag: IConfigItem = {
44
44
  },
45
45
  events: []
46
46
  }
47
+ export default t
@@ -0,0 +1,66 @@
1
+ import { EConfigItemPropsType, EDoneJsonType } from '@/config/types'
2
+ import type { IConfigItem } from '@/config/types'
3
+
4
+ const t: IConfigItem = {
5
+ name: 'text-box',
6
+ title: '文字背景框',
7
+ tag: 'text-box',
8
+ type: EDoneJsonType.Vue,
9
+ config: {
10
+ can_zoom: false,
11
+ have_anchor: false,
12
+ actual_rect: true
13
+ },
14
+ display: true,
15
+ props: {
16
+ width: {
17
+ title: '宽度',
18
+ type: EConfigItemPropsType.InputNumber,
19
+ val: 250
20
+ },
21
+ height: {
22
+ title: '高度',
23
+ type: EConfigItemPropsType.InputNumber,
24
+ val: 150
25
+ },
26
+ bgColor: {
27
+ title: '背景颜色',
28
+ type: EConfigItemPropsType.Color,
29
+ val: '#000000'
30
+ },
31
+ bgOpacity: {
32
+ title: '背景透明度(%)',
33
+ type: EConfigItemPropsType.InputNumber,
34
+ val: 1
35
+ },
36
+ borderColor: {
37
+ title: '边框颜色',
38
+ type: EConfigItemPropsType.Color,
39
+ val: '#cccccc'
40
+ },
41
+ borderWidth: {
42
+ title: '边框宽度',
43
+ type: EConfigItemPropsType.InputNumber,
44
+ val: 1
45
+ },
46
+ borderRadius: {
47
+ title: '边框圆角',
48
+ type: EConfigItemPropsType.InputNumber,
49
+ val: 5
50
+ },
51
+ borderOpacity: {
52
+ title: '边框透明度(%)',
53
+ type: EConfigItemPropsType.InputNumber,
54
+ val: 100
55
+ }
56
+ },
57
+ common_animations: {
58
+ val: '',
59
+ delay: 'delay-0s',
60
+ speed: 'slow',
61
+ repeat: 'infinite'
62
+ },
63
+ events: []
64
+ }
65
+
66
+ export default t
@@ -1,8 +1,9 @@
1
1
  import type { IConfigComponentGroup } from '@/config/types'
2
- import { pie_charts } from './pie-charts'
2
+ import pie_charts from './pie-charts'
3
3
 
4
- export const echarts_group: IConfigComponentGroup = {
4
+ const t: IConfigComponentGroup = {
5
5
  groupType: 'echarts',
6
6
  title: '图表',
7
7
  list: [pie_charts]
8
8
  }
9
+ export default t
@@ -1,7 +1,7 @@
1
1
  import { EConfigItemPropsType, EDoneJsonType } from '@/config/types'
2
2
  import type { IConfigItem } from '@/config/types'
3
3
 
4
- export const pie_charts: IConfigItem = {
4
+ const t: IConfigItem = {
5
5
  name: 'pie-charts',
6
6
  tag: 'pie-charts',
7
7
  title: '饼图',
@@ -58,3 +58,4 @@ export const pie_charts: IConfigItem = {
58
58
  },
59
59
  events: []
60
60
  }
61
+ export default t
@@ -1,5 +1,6 @@
1
1
  import type { IConfigComponentGroup } from '../types'
2
- import { components } from './component'
3
- import { echarts_group } from './echarts'
2
+ import components from './component'
3
+ import echarts_group from './echarts'
4
4
 
5
- export const vue_config: IConfigComponentGroup[] = Object.seal([components, echarts_group])
5
+ const t: IConfigComponentGroup[] = Object.seal([components, echarts_group])
6
+ export default t
@@ -18,10 +18,11 @@ export const preventDefault = (e: any) => {
18
18
  e.preventDefault()
19
19
  }
20
20
 
21
- export function componentsRegister() {
21
+ export function componentsRegister(data?: Record<string, any>) {
22
22
  //注册所有组件
23
23
  const instance = getCurrentInstance()
24
- for (let key in vueComp) {
24
+ const t = data ? Object.assign(vueComp, data) : vueComp
25
+ for (let key in t) {
25
26
  if (!instance?.appContext?.components.hasOwnProperty(key) && vueComp.hasOwnProperty(key)) {
26
27
  instance?.appContext?.app.component(key, vueComp[key])
27
28
  }