vxe-table 3.10.4 → 3.10.5

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 (48) hide show
  1. package/es/grid/src/grid.js +1 -1
  2. package/es/style.css +1 -1
  3. package/es/style.min.css +1 -1
  4. package/es/table/module/custom/mixin.js +130 -2
  5. package/es/table/module/custom/panel.js +327 -338
  6. package/es/table/module/export/export-panel.js +2 -2
  7. package/es/table/src/methods.js +9 -28
  8. package/es/table/style.css +42 -37
  9. package/es/table/style.min.css +1 -1
  10. package/es/ui/index.js +1 -1
  11. package/es/ui/src/log.js +1 -1
  12. package/es/vxe-table/style.css +42 -37
  13. package/es/vxe-table/style.min.css +1 -1
  14. package/lib/grid/src/grid.js +1 -1
  15. package/lib/grid/src/grid.min.js +1 -1
  16. package/lib/index.umd.js +372 -297
  17. package/lib/index.umd.min.js +1 -1
  18. package/lib/style.css +1 -1
  19. package/lib/style.min.css +1 -1
  20. package/lib/table/module/custom/mixin.js +176 -2
  21. package/lib/table/module/custom/mixin.min.js +1 -1
  22. package/lib/table/module/custom/panel.js +182 -255
  23. package/lib/table/module/custom/panel.min.js +1 -1
  24. package/lib/table/module/export/export-panel.js +2 -2
  25. package/lib/table/module/export/export-panel.min.js +1 -1
  26. package/lib/table/src/methods.js +9 -35
  27. package/lib/table/src/methods.min.js +1 -1
  28. package/lib/table/style/style.css +42 -37
  29. package/lib/table/style/style.min.css +1 -1
  30. package/lib/ui/index.js +1 -1
  31. package/lib/ui/index.min.js +1 -1
  32. package/lib/ui/src/log.js +1 -1
  33. package/lib/ui/src/log.min.js +1 -1
  34. package/lib/vxe-table/style/style.css +42 -37
  35. package/lib/vxe-table/style/style.min.css +1 -1
  36. package/package.json +2 -2
  37. package/packages/grid/src/grid.ts +1 -1
  38. package/packages/table/module/custom/mixin.ts +131 -2
  39. package/packages/table/module/custom/panel.ts +332 -337
  40. package/packages/table/module/export/export-panel.ts +2 -2
  41. package/packages/table/src/methods.ts +9 -28
  42. package/styles/components/table-module/custom.scss +21 -5
  43. /package/es/{iconfont.1730945625063.ttf → iconfont.1730971767552.ttf} +0 -0
  44. /package/es/{iconfont.1730945625063.woff → iconfont.1730971767552.woff} +0 -0
  45. /package/es/{iconfont.1730945625063.woff2 → iconfont.1730971767552.woff2} +0 -0
  46. /package/lib/{iconfont.1730945625063.ttf → iconfont.1730971767552.ttf} +0 -0
  47. /package/lib/{iconfont.1730945625063.woff → iconfont.1730971767552.woff} +0 -0
  48. /package/lib/{iconfont.1730945625063.woff2 → iconfont.1730971767552.woff2} +0 -0
@@ -36,6 +36,135 @@ export default {
36
36
  }
37
37
  return this.$nextTick()
38
38
  },
39
+ _saveCustom () {
40
+ const $xeTable = this
41
+
42
+ const { customOpts, customColumnList } = this
43
+ const { allowVisible, allowSort, allowFixed, allowResizable } = customOpts
44
+ XEUtils.eachTree(customColumnList, (column, index, items, path, parent) => {
45
+ if (parent) {
46
+ // 更新子列信息
47
+ column.fixed = parent.fixed
48
+ } else {
49
+ if (allowSort) {
50
+ const sortIndex = index + 1
51
+ column.renderSortNumber = sortIndex
52
+ }
53
+ if (allowFixed) {
54
+ column.fixed = column.renderFixed
55
+ }
56
+ }
57
+ if (allowResizable) {
58
+ if (column.renderVisible && (!column.children || column.children.length)) {
59
+ if (column.renderResizeWidth !== column.renderWidth) {
60
+ column.resizeWidth = column.renderResizeWidth
61
+ column.renderWidth = column.renderResizeWidth
62
+ }
63
+ }
64
+ }
65
+ if (allowVisible) {
66
+ column.visible = column.renderVisible
67
+ }
68
+ })
69
+ $xeTable.closeCustom()
70
+ return $xeTable.saveCustomStore('confirm')
71
+ },
72
+ _cancelCustom () {
73
+ const $xeTable = this
74
+
75
+ const { customStore, customOpts, customColumnList } = $xeTable
76
+ const { oldSortMaps, oldFixedMaps, oldVisibleMaps } = customStore
77
+ const { allowVisible, allowSort, allowFixed, allowResizable } = customOpts
78
+ XEUtils.eachTree(customColumnList, column => {
79
+ const colid = column.getKey()
80
+ const visible = !!oldVisibleMaps[colid]
81
+ const fixed = oldFixedMaps[colid] || ''
82
+ if (allowVisible) {
83
+ column.renderVisible = visible
84
+ column.visible = visible
85
+ }
86
+ if (allowFixed) {
87
+ column.renderFixed = fixed
88
+ column.fixed = fixed
89
+ }
90
+ if (allowSort) {
91
+ column.renderSortNumber = oldSortMaps[colid] || 0
92
+ }
93
+ if (allowResizable) {
94
+ column.renderResizeWidth = column.renderWidth
95
+ }
96
+ }, { children: 'children' })
97
+ return $xeTable.$nextTick()
98
+ },
99
+ _resetCustom (options: any) {
100
+ const { collectColumn, customOpts } = this
101
+ const { checkMethod } = customOpts
102
+ const opts = Object.assign({
103
+ visible: true,
104
+ resizable: options === true,
105
+ fixed: options === true,
106
+ sort: options === true
107
+ }, options)
108
+ XEUtils.eachTree(collectColumn, (column) => {
109
+ if (opts.resizable) {
110
+ column.resizeWidth = 0
111
+ }
112
+ if (opts.fixed) {
113
+ column.fixed = column.defaultFixed
114
+ }
115
+ if (opts.sort) {
116
+ column.renderSortNumber = column.sortNumber
117
+ }
118
+ if (!checkMethod || checkMethod({ column })) {
119
+ column.visible = column.defaultVisible
120
+ }
121
+ column.renderResizeWidth = column.renderWidth
122
+ })
123
+ this.saveCustomStore('reset')
124
+ return this.handleCustom()
125
+ },
126
+ _toggleCustomAllCheckbox () {
127
+ const { customStore } = this
128
+ const isAll = !customStore.isAll
129
+ return this.setCustomAllCheckbox(isAll)
130
+ },
131
+ _setCustomAllCheckbox (checked: boolean) {
132
+ const $xeTable = this
133
+
134
+ const { customStore } = this
135
+ const { customColumnList, customOpts } = this
136
+ const { checkMethod, visibleMethod } = customOpts
137
+ const isAll = !!checked
138
+ if (customOpts.immediate) {
139
+ XEUtils.eachTree(customColumnList, (column) => {
140
+ if (visibleMethod && !visibleMethod({ column })) {
141
+ return
142
+ }
143
+ if (checkMethod && !checkMethod({ column })) {
144
+ return
145
+ }
146
+ column.visible = isAll
147
+ column.renderVisible = isAll
148
+ column.halfVisible = false
149
+ })
150
+ customStore.isAll = isAll
151
+ $xeTable.handleCustom()
152
+ $xeTable.saveCustomStore('update:visible')
153
+ } else {
154
+ XEUtils.eachTree(customColumnList, (column) => {
155
+ if (visibleMethod && !visibleMethod({ column })) {
156
+ return
157
+ }
158
+ if (checkMethod && !checkMethod({ column })) {
159
+ return
160
+ }
161
+ column.renderVisible = isAll
162
+ column.halfVisible = false
163
+ })
164
+ customStore.isAll = isAll
165
+ }
166
+ $xeTable.checkCustomStatus()
167
+ },
39
168
  calcMaxHeight () {
40
169
  const { $el, customStore } = this
41
170
  // 判断面板不能大于表格高度
@@ -43,7 +172,7 @@ export default {
43
172
  if ($el) {
44
173
  tableHeight = $el.clientHeight - 28
45
174
  }
46
- customStore.maxHeight = Math.max(4, tableHeight)
175
+ customStore.maxHeight = Math.max(88, tableHeight)
47
176
  },
48
177
  checkCustomStatus () {
49
178
  const { customStore, collectColumn, customOpts } = this
@@ -75,7 +204,7 @@ export default {
75
204
  this.emitCustomEvent('open', evnt)
76
205
  }
77
206
  },
78
- customColseEvent (evnt: any) {
207
+ customCloseEvent (evnt: any) {
79
208
  const { customStore } = this
80
209
  if (customStore.visible) {
81
210
  customStore.activeBtn = false