vxe-table 4.18.4 → 4.18.6

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 (159) hide show
  1. package/LICENSE +20 -20
  2. package/README.en.md +118 -118
  3. package/README.ja-JP.md +117 -117
  4. package/README.md +268 -268
  5. package/README.zh-TW.md +117 -117
  6. package/es/grid/style.css +4 -0
  7. package/es/grid/style.min.css +1 -1
  8. package/es/index.css +1 -1
  9. package/es/index.min.css +1 -1
  10. package/es/style.css +1 -1
  11. package/es/style.min.css +1 -1
  12. package/es/table/src/table.js +82 -22
  13. package/es/table/src/util.js +3 -4
  14. package/es/table/style.css +48 -18
  15. package/es/ui/index.js +1 -1
  16. package/es/ui/src/log.js +1 -1
  17. package/es/vxe-grid/style.css +4 -0
  18. package/es/vxe-grid/style.min.css +1 -1
  19. package/es/vxe-table/style.css +48 -18
  20. package/lib/grid/style/style.css +4 -0
  21. package/lib/grid/style/style.min.css +1 -1
  22. package/lib/index.common.js +1 -2
  23. package/lib/index.css +1 -1
  24. package/lib/index.min.css +1 -1
  25. package/lib/index.umd.js +2833 -2733
  26. package/lib/index.umd.min.js +1 -1
  27. package/lib/style.css +1 -1
  28. package/lib/style.min.css +1 -1
  29. package/lib/table/src/table.js +7 -6
  30. package/lib/table/src/table.min.js +1 -1
  31. package/lib/table/src/util.js +4 -6
  32. package/lib/table/src/util.min.js +1 -1
  33. package/lib/table/style/style.css +48 -18
  34. package/lib/ui/index.js +1 -1
  35. package/lib/ui/index.min.js +1 -1
  36. package/lib/ui/src/log.js +1 -1
  37. package/lib/ui/src/log.min.js +1 -1
  38. package/lib/v-x-e-table/index.js +1 -2
  39. package/lib/v-x-e-table/index.min.js +1 -1
  40. package/lib/vxe-colgroup/index.js +1 -2
  41. package/lib/vxe-colgroup/index.min.js +1 -1
  42. package/lib/vxe-column/index.js +1 -2
  43. package/lib/vxe-column/index.min.js +1 -1
  44. package/lib/vxe-grid/index.js +1 -2
  45. package/lib/vxe-grid/index.min.js +1 -1
  46. package/lib/vxe-grid/style/style.css +4 -0
  47. package/lib/vxe-grid/style/style.min.css +1 -1
  48. package/lib/vxe-table/index.js +1 -2
  49. package/lib/vxe-table/index.min.js +1 -1
  50. package/lib/vxe-table/style/style.css +48 -18
  51. package/lib/vxe-toolbar/index.js +1 -2
  52. package/lib/vxe-toolbar/index.min.js +1 -1
  53. package/lib/vxe-ui/index.js +1 -2
  54. package/lib/vxe-ui/index.min.js +1 -1
  55. package/lib/vxe-v-x-e-table/index.js +1 -2
  56. package/lib/vxe-v-x-e-table/index.min.js +1 -1
  57. package/package.json +91 -91
  58. package/packages/colgroup/index.ts +22 -22
  59. package/packages/column/index.ts +22 -22
  60. package/packages/components.ts +43 -43
  61. package/packages/grid/index.ts +18 -18
  62. package/packages/grid/src/emits.ts +19 -19
  63. package/packages/grid/src/grid.ts +1768 -1768
  64. package/packages/grid/src/props.ts +23 -23
  65. package/packages/index.ts +4 -4
  66. package/packages/locale/lang/ar-EG.ts +832 -832
  67. package/packages/locale/lang/de-DE.ts +832 -832
  68. package/packages/locale/lang/en-US.ts +832 -832
  69. package/packages/locale/lang/es-ES.ts +832 -832
  70. package/packages/locale/lang/fr-FR.ts +832 -832
  71. package/packages/locale/lang/hu-HU.ts +832 -832
  72. package/packages/locale/lang/hy-AM.ts +832 -832
  73. package/packages/locale/lang/id-ID.ts +832 -832
  74. package/packages/locale/lang/it-IT.ts +832 -832
  75. package/packages/locale/lang/ja-JP.ts +832 -832
  76. package/packages/locale/lang/ko-KR.ts +832 -832
  77. package/packages/locale/lang/ms-MY.ts +832 -832
  78. package/packages/locale/lang/nb-NO.ts +832 -832
  79. package/packages/locale/lang/pt-BR.ts +832 -832
  80. package/packages/locale/lang/ru-RU.ts +832 -832
  81. package/packages/locale/lang/th-TH.ts +832 -832
  82. package/packages/locale/lang/ug-CN.ts +832 -832
  83. package/packages/locale/lang/uk-UA.ts +832 -832
  84. package/packages/locale/lang/uz-UZ.ts +832 -832
  85. package/packages/locale/lang/vi-VN.ts +832 -832
  86. package/packages/locale/lang/zh-CHT.ts +832 -832
  87. package/packages/locale/lang/zh-CN.ts +832 -832
  88. package/packages/locale/lang/zh-HK.ts +3 -3
  89. package/packages/locale/lang/zh-MO.ts +3 -3
  90. package/packages/locale/lang/zh-TC.ts +3 -3
  91. package/packages/locale/lang/zh-TW.ts +3 -3
  92. package/packages/table/index.ts +26 -26
  93. package/packages/table/module/custom/hook.ts +359 -359
  94. package/packages/table/module/custom/panel.ts +1331 -1331
  95. package/packages/table/module/edit/hook.ts +1032 -1032
  96. package/packages/table/module/export/export-panel.ts +567 -567
  97. package/packages/table/module/export/hook.ts +1654 -1654
  98. package/packages/table/module/export/import-panel.ts +266 -266
  99. package/packages/table/module/export/util.ts +24 -24
  100. package/packages/table/module/filter/hook.ts +468 -468
  101. package/packages/table/module/filter/panel.ts +301 -301
  102. package/packages/table/module/keyboard/hook.ts +495 -495
  103. package/packages/table/module/menu/hook.ts +325 -325
  104. package/packages/table/module/menu/panel.ts +201 -201
  105. package/packages/table/module/validator/hook.ts +631 -631
  106. package/packages/table/render/index.ts +1440 -1440
  107. package/packages/table/src/body.ts +932 -932
  108. package/packages/table/src/cell.ts +1290 -1290
  109. package/packages/table/src/column.ts +190 -190
  110. package/packages/table/src/columnInfo.ts +225 -225
  111. package/packages/table/src/emits.ts +123 -123
  112. package/packages/table/src/footer.ts +368 -368
  113. package/packages/table/src/group.ts +59 -59
  114. package/packages/table/src/header.ts +559 -559
  115. package/packages/table/src/props.ts +324 -324
  116. package/packages/table/src/store.ts +14 -14
  117. package/packages/table/src/table.ts +14001 -13939
  118. package/packages/table/src/use/cell-view.ts +44 -44
  119. package/packages/table/src/use/index.ts +1 -1
  120. package/packages/table/src/util.ts +1064 -1064
  121. package/packages/toolbar/index.ts +18 -18
  122. package/packages/toolbar/src/toolbar.ts +701 -701
  123. package/packages/ui/index.ts +530 -530
  124. package/packages/ui/src/anime.ts +52 -52
  125. package/packages/ui/src/comp.ts +3 -3
  126. package/packages/ui/src/dom.ts +236 -236
  127. package/packages/ui/src/log.ts +8 -8
  128. package/packages/ui/src/utils.ts +56 -56
  129. package/packages/ui/src/vn.ts +55 -55
  130. package/packages/v-x-e-table/index.d.ts +4 -4
  131. package/packages/v-x-e-table/index.ts +4 -4
  132. package/styles/all.scss +7 -7
  133. package/styles/base.scss +16 -16
  134. package/styles/components/grid.scss +89 -85
  135. package/styles/components/icon.scss +225 -225
  136. package/styles/components/old-icon.scss +715 -715
  137. package/styles/components/table-module/all.scss +6 -6
  138. package/styles/components/table-module/custom.scss +527 -527
  139. package/styles/components/table-module/export.scss +130 -130
  140. package/styles/components/table-module/filter.scss +130 -130
  141. package/styles/components/table-module/menu.scss +81 -81
  142. package/styles/components/table.scss +2679 -2679
  143. package/styles/components/toolbar.scss +119 -119
  144. package/styles/default.scss +2 -2
  145. package/styles/helpers/baseMixin.scss +95 -95
  146. package/styles/index.scss +4 -4
  147. package/styles/modules.scss +5 -5
  148. package/styles/theme/base.scss +93 -93
  149. package/styles/theme/dark.scss +49 -49
  150. package/styles/theme/light.scss +44 -44
  151. package/styles/variable.scss +43 -43
  152. package/types/all.d.ts +37 -37
  153. package/types/index.d.ts +4 -4
  154. /package/es/{iconfont.1773644074946.ttf → iconfont.1773972993993.ttf} +0 -0
  155. /package/es/{iconfont.1773644074946.woff → iconfont.1773972993993.woff} +0 -0
  156. /package/es/{iconfont.1773644074946.woff2 → iconfont.1773972993993.woff2} +0 -0
  157. /package/lib/{iconfont.1773644074946.ttf → iconfont.1773972993993.ttf} +0 -0
  158. /package/lib/{iconfont.1773644074946.woff → iconfont.1773972993993.woff} +0 -0
  159. /package/lib/{iconfont.1773644074946.woff2 → iconfont.1773972993993.woff2} +0 -0
@@ -1,190 +1,190 @@
1
- import { h, onUnmounted, inject, ref, PropType, provide, onMounted, createCommentVNode } from 'vue'
2
- import { defineVxeComponent } from '../../ui/src/comp'
3
- import { XEColumnInstance, watchColumn, assembleColumn, destroyColumn } from './util'
4
- import Cell from './cell'
5
-
6
- import type { VxeTableConstructor, VxeTablePrivateMethods, VxeColumnPropTypes, VxeColumnProps } from '../../../types'
7
-
8
- export const columnProps = {
9
- // 列唯一主键
10
- colId: [String, Number] as PropType<VxeColumnPropTypes.ColId>,
11
- // 渲染类型 index,radio,checkbox,expand,html
12
- type: String as PropType<VxeColumnPropTypes.Type>,
13
- // 列字段名
14
- field: String as PropType<VxeColumnPropTypes.Field>,
15
- // 列标题
16
- title: String as PropType<VxeColumnPropTypes.Title>,
17
- // 列宽度
18
- width: [Number, String] as PropType<VxeColumnPropTypes.Width>,
19
- // 列最小宽度,把剩余宽度按比例分配
20
- minWidth: [Number, String] as PropType<VxeColumnPropTypes.MinWidth>,
21
- // 列最大宽度
22
- maxWidth: [Number, String] as PropType<VxeColumnPropTypes.MaxWidth>,
23
- // 是否允许拖动列宽调整大小
24
- resizable: {
25
- type: Boolean as PropType<VxeColumnPropTypes.Resizable>,
26
- default: null
27
- },
28
- // 将列固定在左侧或者右侧
29
- fixed: String as PropType<VxeColumnPropTypes.Fixed>,
30
- // 列对其方式
31
- align: String as PropType<VxeColumnPropTypes.Align>,
32
- // 表头对齐方式
33
- headerAlign: String as PropType<VxeColumnPropTypes.HeaderAlign>,
34
- // 表尾列的对齐方式
35
- footerAlign: String as PropType<VxeColumnPropTypes.FooterAlign>,
36
- // 当内容过长时显示为省略号
37
- showOverflow: {
38
- type: [Boolean, String] as PropType<VxeColumnPropTypes.ShowOverflow>,
39
- default: null
40
- },
41
- // 当表头内容过长时显示为省略号
42
- showHeaderOverflow: {
43
- type: [Boolean, String] as PropType<VxeColumnPropTypes.ShowHeaderOverflow>,
44
- default: null
45
- },
46
- // 当表尾内容过长时显示为省略号
47
- showFooterOverflow: {
48
- type: [Boolean, String] as PropType<VxeColumnPropTypes.ShowFooterOverflow>,
49
- default: null
50
- },
51
- // 给单元格附加 className
52
- className: [String, Function] as PropType<VxeColumnPropTypes.ClassName>,
53
- // 给表头单元格附加 className
54
- headerClassName: [String, Function] as PropType<VxeColumnPropTypes.HeaderClassName>,
55
- // 给表尾单元格附加 className
56
- footerClassName: [String, Function] as PropType<VxeColumnPropTypes.FooterClassName>,
57
- // 格式化显示内容
58
- formatter: [Function, Array, String] as PropType<VxeColumnPropTypes.Formatter<any>>,
59
- // 格式化表头显示内容
60
- headerFormatter: [Function, Array, String] as PropType<VxeColumnPropTypes.HeaderFormatter>,
61
- // 格式化表尾显示内容
62
- footerFormatter: [Function, Array, String] as PropType<VxeColumnPropTypes.FooterFormatter>,
63
- // 是否显示间距
64
- padding: {
65
- type: Boolean as PropType<VxeColumnPropTypes.Padding>,
66
- default: null
67
- },
68
- // 垂直对齐方式
69
- verticalAlign: {
70
- type: String as PropType<VxeColumnPropTypes.VerticalAlign>,
71
- default: null
72
- },
73
- // 是否允许排序
74
- sortable: Boolean as PropType<VxeColumnPropTypes.Sortable>,
75
- // 自定义排序的属性
76
- sortBy: [String, Function] as PropType<VxeColumnPropTypes.SortBy>,
77
- // 排序的字段类型,比如字符串转数值等
78
- sortType: String as PropType<VxeColumnPropTypes.SortType>,
79
- // 配置筛选条件数组
80
- filters: {
81
- type: Array as PropType<VxeColumnPropTypes.Filters>,
82
- default: null
83
- },
84
- // 筛选是否允许多选
85
- filterMultiple: {
86
- type: Boolean as PropType<VxeColumnPropTypes.FilterMultiple>,
87
- default: true
88
- },
89
- // 自定义筛选方法
90
- filterMethod: Function as PropType<VxeColumnPropTypes.FilterMethod<any>>,
91
- // 筛选重置方法
92
- filterResetMethod: Function as PropType<VxeColumnPropTypes.FilterResetMethod>,
93
- // 筛选复原方法
94
- filterRecoverMethod: Function as PropType<VxeColumnPropTypes.FilterRecoverMethod>,
95
- // 筛选模板配置项
96
- filterRender: Object as PropType<VxeColumnPropTypes.FilterRender>,
97
- // 是否显示浮动筛选
98
- floatingFilters: Object as PropType<VxeColumnPropTypes.FloatingFilters>,
99
- // 设置为分组节点
100
- rowGroupNode: Boolean as PropType<VxeColumnPropTypes.RowGroupNode>,
101
- // 设置为树节点
102
- treeNode: Boolean as PropType<VxeColumnPropTypes.TreeNode>,
103
- // 设置为拖拽排序
104
- dragSort: Boolean as PropType<VxeColumnPropTypes.DragSort>,
105
- // 设置为行高拖拽
106
- rowResize: Boolean as PropType<VxeColumnPropTypes.RowResize>,
107
- // 是否可视
108
- visible: {
109
- type: Boolean as PropType<VxeColumnPropTypes.Visible>,
110
- default: null
111
- },
112
- // 表头单元格数据导出方法
113
- headerExportMethod: Function as PropType<VxeColumnPropTypes.HeaderExportMethod>,
114
- // 单元格数据导出方法
115
- exportMethod: Function as PropType<VxeColumnPropTypes.ExportMethod>,
116
- // 表尾单元格数据导出方法
117
- footerExportMethod: Function as PropType<VxeColumnPropTypes.FooterExportMethod>,
118
- // 已废弃,被 titlePrefix 替换
119
- titleHelp: Object as PropType<VxeColumnPropTypes.TitleHelp>,
120
- // 标题前缀图标配置项
121
- titlePrefix: Object as PropType<VxeColumnPropTypes.TitlePrefix>,
122
- // 标题后缀图标配置项
123
- titleSuffix: Object as PropType<VxeColumnPropTypes.TitleSuffix>,
124
- // 单元格值类型
125
- cellType: String as PropType<VxeColumnPropTypes.CellType>,
126
- // 单元格渲染配置项
127
- cellRender: Object as PropType<VxeColumnPropTypes.CellRender<any>>,
128
- // 单元格编辑渲染配置项
129
- editRender: Object as PropType<VxeColumnPropTypes.EditRender>,
130
- // 内容渲染配置项
131
- contentRender: Object as PropType<VxeColumnPropTypes.ContentRender>,
132
-
133
- // 聚合函数
134
- aggFunc: [Boolean, String] as PropType<VxeColumnPropTypes.AggFunc>,
135
- // 将单元格复制到剪贴板
136
- copyMethod: Function as PropType<VxeColumnPropTypes.CopyMethod>,
137
- // 将剪贴单元格的值清除
138
- cutMethod: Function as PropType<VxeColumnPropTypes.CutMethod>,
139
- // 从剪贴板赋值到单元格
140
- pasteMethod: Function as PropType<VxeColumnPropTypes.PasteMethod>,
141
-
142
- // 额外的参数
143
- params: Object as PropType<VxeColumnPropTypes.Params>
144
- }
145
-
146
- export default defineVxeComponent({
147
- name: 'VxeColumn',
148
- props: columnProps,
149
- setup (props, { slots }) {
150
- const refElem = ref<HTMLDivElement>()
151
- const $xeTable = inject<(VxeTableConstructor & VxeTablePrivateMethods) | null>('$xeTable', null)
152
- const $xeColgroup = inject<XEColumnInstance | null>('$xeColgroup', null)
153
- if (!$xeTable) {
154
- return () => createCommentVNode()
155
- }
156
- const columnConfig = Cell.createColumn($xeTable, props as VxeColumnProps)
157
- columnConfig.slots = slots
158
-
159
- const renderVN = () => {
160
- return h('div', {
161
- ref: refElem
162
- })
163
- }
164
-
165
- const $xeColumn = {
166
- columnConfig,
167
-
168
- renderVN
169
- } as XEColumnInstance
170
-
171
- watchColumn($xeTable, props, columnConfig)
172
-
173
- onMounted(() => {
174
- const elem = refElem.value
175
- if (elem) {
176
- assembleColumn($xeTable, elem, columnConfig, $xeColgroup)
177
- }
178
- })
179
-
180
- onUnmounted(() => {
181
- destroyColumn($xeTable, columnConfig)
182
- })
183
-
184
- provide('$xeColumn', $xeColumn)
185
- provide('$xeGrid', null)
186
- provide('$xeGantt', null)
187
-
188
- return renderVN
189
- }
190
- })
1
+ import { h, onUnmounted, inject, ref, PropType, provide, onMounted, createCommentVNode } from 'vue'
2
+ import { defineVxeComponent } from '../../ui/src/comp'
3
+ import { XEColumnInstance, watchColumn, assembleColumn, destroyColumn } from './util'
4
+ import Cell from './cell'
5
+
6
+ import type { VxeTableConstructor, VxeTablePrivateMethods, VxeColumnPropTypes, VxeColumnProps } from '../../../types'
7
+
8
+ export const columnProps = {
9
+ // 列唯一主键
10
+ colId: [String, Number] as PropType<VxeColumnPropTypes.ColId>,
11
+ // 渲染类型 index,radio,checkbox,expand,html
12
+ type: String as PropType<VxeColumnPropTypes.Type>,
13
+ // 列字段名
14
+ field: String as PropType<VxeColumnPropTypes.Field>,
15
+ // 列标题
16
+ title: String as PropType<VxeColumnPropTypes.Title>,
17
+ // 列宽度
18
+ width: [Number, String] as PropType<VxeColumnPropTypes.Width>,
19
+ // 列最小宽度,把剩余宽度按比例分配
20
+ minWidth: [Number, String] as PropType<VxeColumnPropTypes.MinWidth>,
21
+ // 列最大宽度
22
+ maxWidth: [Number, String] as PropType<VxeColumnPropTypes.MaxWidth>,
23
+ // 是否允许拖动列宽调整大小
24
+ resizable: {
25
+ type: Boolean as PropType<VxeColumnPropTypes.Resizable>,
26
+ default: null
27
+ },
28
+ // 将列固定在左侧或者右侧
29
+ fixed: String as PropType<VxeColumnPropTypes.Fixed>,
30
+ // 列对其方式
31
+ align: String as PropType<VxeColumnPropTypes.Align>,
32
+ // 表头对齐方式
33
+ headerAlign: String as PropType<VxeColumnPropTypes.HeaderAlign>,
34
+ // 表尾列的对齐方式
35
+ footerAlign: String as PropType<VxeColumnPropTypes.FooterAlign>,
36
+ // 当内容过长时显示为省略号
37
+ showOverflow: {
38
+ type: [Boolean, String] as PropType<VxeColumnPropTypes.ShowOverflow>,
39
+ default: null
40
+ },
41
+ // 当表头内容过长时显示为省略号
42
+ showHeaderOverflow: {
43
+ type: [Boolean, String] as PropType<VxeColumnPropTypes.ShowHeaderOverflow>,
44
+ default: null
45
+ },
46
+ // 当表尾内容过长时显示为省略号
47
+ showFooterOverflow: {
48
+ type: [Boolean, String] as PropType<VxeColumnPropTypes.ShowFooterOverflow>,
49
+ default: null
50
+ },
51
+ // 给单元格附加 className
52
+ className: [String, Function] as PropType<VxeColumnPropTypes.ClassName>,
53
+ // 给表头单元格附加 className
54
+ headerClassName: [String, Function] as PropType<VxeColumnPropTypes.HeaderClassName>,
55
+ // 给表尾单元格附加 className
56
+ footerClassName: [String, Function] as PropType<VxeColumnPropTypes.FooterClassName>,
57
+ // 格式化显示内容
58
+ formatter: [Function, Array, String] as PropType<VxeColumnPropTypes.Formatter<any>>,
59
+ // 格式化表头显示内容
60
+ headerFormatter: [Function, Array, String] as PropType<VxeColumnPropTypes.HeaderFormatter>,
61
+ // 格式化表尾显示内容
62
+ footerFormatter: [Function, Array, String] as PropType<VxeColumnPropTypes.FooterFormatter>,
63
+ // 是否显示间距
64
+ padding: {
65
+ type: Boolean as PropType<VxeColumnPropTypes.Padding>,
66
+ default: null
67
+ },
68
+ // 垂直对齐方式
69
+ verticalAlign: {
70
+ type: String as PropType<VxeColumnPropTypes.VerticalAlign>,
71
+ default: null
72
+ },
73
+ // 是否允许排序
74
+ sortable: Boolean as PropType<VxeColumnPropTypes.Sortable>,
75
+ // 自定义排序的属性
76
+ sortBy: [String, Function] as PropType<VxeColumnPropTypes.SortBy>,
77
+ // 排序的字段类型,比如字符串转数值等
78
+ sortType: String as PropType<VxeColumnPropTypes.SortType>,
79
+ // 配置筛选条件数组
80
+ filters: {
81
+ type: Array as PropType<VxeColumnPropTypes.Filters>,
82
+ default: null
83
+ },
84
+ // 筛选是否允许多选
85
+ filterMultiple: {
86
+ type: Boolean as PropType<VxeColumnPropTypes.FilterMultiple>,
87
+ default: true
88
+ },
89
+ // 自定义筛选方法
90
+ filterMethod: Function as PropType<VxeColumnPropTypes.FilterMethod<any>>,
91
+ // 筛选重置方法
92
+ filterResetMethod: Function as PropType<VxeColumnPropTypes.FilterResetMethod>,
93
+ // 筛选复原方法
94
+ filterRecoverMethod: Function as PropType<VxeColumnPropTypes.FilterRecoverMethod>,
95
+ // 筛选模板配置项
96
+ filterRender: Object as PropType<VxeColumnPropTypes.FilterRender>,
97
+ // 是否显示浮动筛选
98
+ floatingFilters: Object as PropType<VxeColumnPropTypes.FloatingFilters>,
99
+ // 设置为分组节点
100
+ rowGroupNode: Boolean as PropType<VxeColumnPropTypes.RowGroupNode>,
101
+ // 设置为树节点
102
+ treeNode: Boolean as PropType<VxeColumnPropTypes.TreeNode>,
103
+ // 设置为拖拽排序
104
+ dragSort: Boolean as PropType<VxeColumnPropTypes.DragSort>,
105
+ // 设置为行高拖拽
106
+ rowResize: Boolean as PropType<VxeColumnPropTypes.RowResize>,
107
+ // 是否可视
108
+ visible: {
109
+ type: Boolean as PropType<VxeColumnPropTypes.Visible>,
110
+ default: null
111
+ },
112
+ // 表头单元格数据导出方法
113
+ headerExportMethod: Function as PropType<VxeColumnPropTypes.HeaderExportMethod>,
114
+ // 单元格数据导出方法
115
+ exportMethod: Function as PropType<VxeColumnPropTypes.ExportMethod>,
116
+ // 表尾单元格数据导出方法
117
+ footerExportMethod: Function as PropType<VxeColumnPropTypes.FooterExportMethod>,
118
+ // 已废弃,被 titlePrefix 替换
119
+ titleHelp: Object as PropType<VxeColumnPropTypes.TitleHelp>,
120
+ // 标题前缀图标配置项
121
+ titlePrefix: Object as PropType<VxeColumnPropTypes.TitlePrefix>,
122
+ // 标题后缀图标配置项
123
+ titleSuffix: Object as PropType<VxeColumnPropTypes.TitleSuffix>,
124
+ // 单元格值类型
125
+ cellType: String as PropType<VxeColumnPropTypes.CellType>,
126
+ // 单元格渲染配置项
127
+ cellRender: Object as PropType<VxeColumnPropTypes.CellRender<any>>,
128
+ // 单元格编辑渲染配置项
129
+ editRender: Object as PropType<VxeColumnPropTypes.EditRender>,
130
+ // 内容渲染配置项
131
+ contentRender: Object as PropType<VxeColumnPropTypes.ContentRender>,
132
+
133
+ // 聚合函数
134
+ aggFunc: [Boolean, String] as PropType<VxeColumnPropTypes.AggFunc>,
135
+ // 将单元格复制到剪贴板
136
+ copyMethod: Function as PropType<VxeColumnPropTypes.CopyMethod>,
137
+ // 将剪贴单元格的值清除
138
+ cutMethod: Function as PropType<VxeColumnPropTypes.CutMethod>,
139
+ // 从剪贴板赋值到单元格
140
+ pasteMethod: Function as PropType<VxeColumnPropTypes.PasteMethod>,
141
+
142
+ // 额外的参数
143
+ params: Object as PropType<VxeColumnPropTypes.Params>
144
+ }
145
+
146
+ export default defineVxeComponent({
147
+ name: 'VxeColumn',
148
+ props: columnProps,
149
+ setup (props, { slots }) {
150
+ const refElem = ref<HTMLDivElement>()
151
+ const $xeTable = inject<(VxeTableConstructor & VxeTablePrivateMethods) | null>('$xeTable', null)
152
+ const $xeColgroup = inject<XEColumnInstance | null>('$xeColgroup', null)
153
+ if (!$xeTable) {
154
+ return () => createCommentVNode()
155
+ }
156
+ const columnConfig = Cell.createColumn($xeTable, props as VxeColumnProps)
157
+ columnConfig.slots = slots
158
+
159
+ const renderVN = () => {
160
+ return h('div', {
161
+ ref: refElem
162
+ })
163
+ }
164
+
165
+ const $xeColumn = {
166
+ columnConfig,
167
+
168
+ renderVN
169
+ } as XEColumnInstance
170
+
171
+ watchColumn($xeTable, props, columnConfig)
172
+
173
+ onMounted(() => {
174
+ const elem = refElem.value
175
+ if (elem) {
176
+ assembleColumn($xeTable, elem, columnConfig, $xeColgroup)
177
+ }
178
+ })
179
+
180
+ onUnmounted(() => {
181
+ destroyColumn($xeTable, columnConfig)
182
+ })
183
+
184
+ provide('$xeColumn', $xeColumn)
185
+ provide('$xeGrid', null)
186
+ provide('$xeGantt', null)
187
+
188
+ return renderVN
189
+ }
190
+ })