vxe-gantt 0.0.3 → 3.0.0-beta.0

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 (106) hide show
  1. package/README.md +14 -46
  2. package/es/components.js +3 -2
  3. package/es/gantt/src/gantt-body.js +83 -49
  4. package/es/gantt/src/gantt-chart.js +91 -43
  5. package/es/gantt/src/gantt-header.js +63 -36
  6. package/es/gantt/src/gantt-view.js +638 -586
  7. package/es/gantt/src/gantt.js +1347 -1178
  8. package/es/gantt/src/util.js +1 -4
  9. package/es/gantt/style.css +42 -17
  10. package/es/gantt/style.min.css +1 -1
  11. package/es/index.esm.js +5 -2
  12. package/es/style.css +1 -1
  13. package/es/style.min.css +1 -1
  14. package/es/ui/index.js +9 -3
  15. package/es/ui/src/comp.js +1 -2
  16. package/es/ui/src/log.js +3 -2
  17. package/es/ui/src/utils.js +17 -17
  18. package/es/vxe-gantt/style.css +42 -17
  19. package/es/vxe-gantt/style.min.css +1 -1
  20. package/helper/vetur/attributes.json +1 -1
  21. package/helper/vetur/tags.json +1 -1
  22. package/lib/components.js +20 -19
  23. package/lib/components.min.js +1 -1
  24. package/lib/gantt/index.js +3 -3
  25. package/lib/gantt/index.min.js +1 -1
  26. package/lib/gantt/src/gantt-body.js +109 -87
  27. package/lib/gantt/src/gantt-body.min.js +1 -1
  28. package/lib/gantt/src/gantt-chart.js +109 -69
  29. package/lib/gantt/src/gantt-chart.min.js +1 -1
  30. package/lib/gantt/src/gantt-header.js +75 -56
  31. package/lib/gantt/src/gantt-header.min.js +1 -1
  32. package/lib/gantt/src/gantt-view.js +684 -686
  33. package/lib/gantt/src/gantt-view.min.js +1 -1
  34. package/lib/gantt/src/gantt.js +1631 -1559
  35. package/lib/gantt/src/gantt.min.js +1 -1
  36. package/lib/gantt/src/util.js +1 -4
  37. package/lib/gantt/src/util.min.js +1 -1
  38. package/lib/gantt/style/style.css +42 -17
  39. package/lib/gantt/style/style.min.css +1 -1
  40. package/lib/index.common.js +12 -7
  41. package/lib/index.umd.js +10705 -5870
  42. package/lib/index.umd.min.js +1 -1
  43. package/lib/style.css +1 -1
  44. package/lib/style.min.css +1 -1
  45. package/lib/ui/index.js +12 -16
  46. package/lib/ui/index.min.js +1 -1
  47. package/lib/ui/src/comp.js +3 -2
  48. package/lib/ui/src/comp.min.js +1 -1
  49. package/lib/ui/src/dom.js +33 -33
  50. package/lib/ui/src/dom.min.js +1 -1
  51. package/lib/ui/src/log.js +4 -3
  52. package/lib/ui/src/log.min.js +1 -1
  53. package/lib/ui/src/utils.js +21 -24
  54. package/lib/ui/src/utils.min.js +1 -1
  55. package/lib/vxe-gantt/index.js +4 -2
  56. package/lib/vxe-gantt/index.min.js +1 -1
  57. package/lib/vxe-gantt/style/style.css +42 -17
  58. package/lib/vxe-gantt/style/style.min.css +1 -1
  59. package/lib/vxe-ui/index.js +4 -2
  60. package/lib/vxe-ui/index.min.js +1 -1
  61. package/package.json +13 -13
  62. package/packages/components.ts +8 -5
  63. package/packages/gantt/index.ts +2 -2
  64. package/packages/gantt/src/gantt-body.ts +89 -53
  65. package/packages/gantt/src/gantt-chart.ts +100 -49
  66. package/packages/gantt/src/gantt-header.ts +69 -39
  67. package/packages/gantt/src/gantt-view.ts +692 -624
  68. package/packages/gantt/src/gantt.ts +1460 -1240
  69. package/packages/gantt/src/util.ts +1 -4
  70. package/packages/index.ts +6 -2
  71. package/packages/ui/index.ts +9 -3
  72. package/packages/ui/src/comp.ts +2 -2
  73. package/packages/ui/src/log.ts +3 -1
  74. package/packages/ui/src/utils.ts +22 -21
  75. package/styles/components/gantt-module/gantt-chart.scss +28 -9
  76. package/styles/components/gantt.scss +12 -7
  77. package/styles/theme/base.scss +5 -1
  78. package/types/all.d.ts +3 -3
  79. package/types/index.d.ts +2 -2
  80. package/README.en.md +0 -72
  81. package/README.ja-JP.md +0 -72
  82. package/README.zh-TW.md +0 -73
  83. package/es/gantt/src/emits.js +0 -4
  84. package/es/gantt/src/grid-emits.js +0 -16
  85. package/es/gantt/src/grid-props.js +0 -7
  86. package/es/gantt/src/props.js +0 -2
  87. package/es/gantt/src/table-emits.js +0 -97
  88. package/es/gantt/src/table-props.js +0 -298
  89. package/lib/gantt/src/emits.js +0 -8
  90. package/lib/gantt/src/emits.min.js +0 -1
  91. package/lib/gantt/src/grid-emits.js +0 -8
  92. package/lib/gantt/src/grid-emits.min.js +0 -1
  93. package/lib/gantt/src/grid-props.js +0 -24
  94. package/lib/gantt/src/grid-props.min.js +0 -1
  95. package/lib/gantt/src/props.js +0 -13
  96. package/lib/gantt/src/props.min.js +0 -1
  97. package/lib/gantt/src/table-emits.js +0 -7
  98. package/lib/gantt/src/table-emits.min.js +0 -1
  99. package/lib/gantt/src/table-props.js +0 -306
  100. package/lib/gantt/src/table-props.min.js +0 -1
  101. package/packages/gantt/src/emits.ts +0 -7
  102. package/packages/gantt/src/grid-emits.ts +0 -19
  103. package/packages/gantt/src/grid-props.ts +0 -23
  104. package/packages/gantt/src/props.ts +0 -13
  105. package/packages/gantt/src/table-emits.ts +0 -109
  106. package/packages/gantt/src/table-props.ts +0 -304
@@ -1,42 +1,63 @@
1
- import { h, inject, ref, Ref, onMounted, onUnmounted } from 'vue'
1
+ import { CreateElement } from 'vue'
2
2
  import { defineVxeComponent } from '../../ui/src/comp'
3
3
 
4
- import type { VxeGanttViewConstructor, VxeGanttViewPrivateMethods } from '../../../types'
4
+ import type { VxeGanttViewConstructor, VxeGanttViewPrivateMethods, VxeGanttConstructor, VxeGanttPrivateMethods } from '../../../types'
5
5
 
6
6
  export default defineVxeComponent({
7
7
  name: 'VxeGanttView',
8
- setup () {
9
- const $xeGanttView = inject('$xeGanttView', {} as VxeGanttViewConstructor & VxeGanttViewPrivateMethods)
10
-
11
- const { reactData, internalData } = $xeGanttView
12
-
13
- const refElem = ref() as Ref<HTMLDivElement>
14
- const refHeaderScroll = ref() as Ref<HTMLDivElement>
15
- const refHeaderTable = ref() as Ref<HTMLTableElement>
16
- const refHeaderXSpace = ref() as Ref<HTMLDivElement>
8
+ inject: {
9
+ $xeGantt: {
10
+ default: null
11
+ },
12
+ $xeGanttView: {
13
+ default: null
14
+ }
15
+ },
16
+ props: {},
17
+ data () {
18
+ return {}
19
+ },
20
+ computed: {
21
+ ...({} as {
22
+ $xeGantt(): (VxeGanttConstructor & VxeGanttPrivateMethods)
23
+ $xeGanttView(): (VxeGanttViewConstructor & VxeGanttViewPrivateMethods)
24
+ })
25
+ },
26
+ methods: {
27
+ //
28
+ // Render
29
+ //
30
+ renderVN (h: CreateElement) {
31
+ const _vm = this
32
+ const $xeGanttView = _vm.$xeGanttView
33
+ const { reactData } = $xeGanttView
17
34
 
18
- const renderVN = () => {
19
- const { tableColumn, headerGroups } = reactData
35
+ const { tableColumn, headerGroups, viewCellWidth } = reactData
20
36
  return h('div', {
21
- ref: refElem,
37
+ ref: 'refElem',
22
38
  class: 'vxe-gantt-view--header-wrapper'
23
39
  }, [
24
40
  h('div', {
25
- ref: refHeaderScroll,
41
+ ref: 'refHeaderScroll',
26
42
  class: 'vxe-gantt-view--header-inner-wrapper',
27
- onScroll: $xeGanttView.triggerHeaderScrollEvent
43
+ on: {
44
+ scroll: $xeGanttView.triggerHeaderScrollEvent
45
+ }
28
46
  }, [
29
47
  h('div', {
30
- ref: refHeaderXSpace,
48
+ ref: 'refHeaderXSpace',
31
49
  class: 'vxe-body--x-space'
32
50
  }),
33
51
  h('table', {
34
- ref: refHeaderTable,
52
+ ref: 'refHeaderTable',
35
53
  class: 'vxe-gantt-view--header-table'
36
54
  }, [
37
55
  h('colgroup', {}, tableColumn.map((column, cIndex) => {
38
56
  return h('col', {
39
- key: cIndex
57
+ key: cIndex,
58
+ style: {
59
+ width: `${viewCellWidth}px`
60
+ }
40
61
  })
41
62
  })),
42
63
  h('thead', {}, headerGroups.map((cols, rIndex) => {
@@ -46,8 +67,10 @@ export default defineVxeComponent({
46
67
  return h('th', {
47
68
  key: cIndex,
48
69
  class: 'vxe-gantt-view--header-column',
49
- colspan: column.children ? column.children.length : null,
50
- title: `${column.field}`
70
+ attrs: {
71
+ colspan: column.children ? column.children.length : null,
72
+ title: `${column.field}`
73
+ }
51
74
  }, column.title)
52
75
  }))
53
76
  }))
@@ -55,25 +78,32 @@ export default defineVxeComponent({
55
78
  ])
56
79
  ])
57
80
  }
81
+ },
82
+ mounted () {
83
+ const _vm = this
84
+ const $xeGanttView = _vm.$xeGanttView
85
+ const { internalData } = $xeGanttView
58
86
 
59
- onMounted(() => {
60
- const { elemStore } = internalData
61
- const prefix = 'main-header-'
62
- elemStore[`${prefix}wrapper`] = refElem
63
- elemStore[`${prefix}scroll`] = refHeaderScroll
64
- elemStore[`${prefix}table`] = refHeaderTable
65
- elemStore[`${prefix}xSpace`] = refHeaderXSpace
66
- })
67
-
68
- onUnmounted(() => {
69
- const { elemStore } = internalData
70
- const prefix = 'main-header-'
71
- elemStore[`${prefix}wrapper`] = null
72
- elemStore[`${prefix}scroll`] = null
73
- elemStore[`${prefix}table`] = null
74
- elemStore[`${prefix}xSpace`] = null
75
- })
87
+ const { elemStore } = internalData
88
+ const prefix = 'main-header-'
89
+ elemStore[`${prefix}wrapper`] = _vm.$refs.refElem as HTMLDivElement
90
+ elemStore[`${prefix}scroll`] = _vm.$refs.refHeaderScroll as HTMLDivElement
91
+ elemStore[`${prefix}table`] = _vm.$refs.refHeaderTable as HTMLDivElement
92
+ elemStore[`${prefix}xSpace`] = _vm.$refs.refHeaderXSpace as HTMLDivElement
93
+ },
94
+ destroyed () {
95
+ const _vm = this
96
+ const $xeGanttView = _vm.$xeGanttView
97
+ const { internalData } = $xeGanttView
76
98
 
77
- return renderVN
99
+ const { elemStore } = internalData
100
+ const prefix = 'main-header-'
101
+ elemStore[`${prefix}wrapper`] = null
102
+ elemStore[`${prefix}scroll`] = null
103
+ elemStore[`${prefix}table`] = null
104
+ elemStore[`${prefix}xSpace`] = null
105
+ },
106
+ render (this: any, h) {
107
+ return this.renderVN(h)
78
108
  }
79
109
  })