vxe-table 3.12.16 → 3.12.17

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/index.css +1 -1
  2. package/es/index.min.css +1 -1
  3. package/es/style.css +1 -1
  4. package/es/style.min.css +1 -1
  5. package/es/table/module/edit/mixin.js +5 -5
  6. package/es/table/src/body.js +60 -47
  7. package/es/table/src/methods.js +123 -24
  8. package/es/table/src/table.js +101 -23
  9. package/es/table/style.css +26 -0
  10. package/es/table/style.min.css +1 -1
  11. package/es/ui/index.js +1 -1
  12. package/es/ui/src/log.js +1 -1
  13. package/es/vxe-table/style.css +26 -0
  14. package/es/vxe-table/style.min.css +1 -1
  15. package/lib/index.css +1 -1
  16. package/lib/index.min.css +1 -1
  17. package/lib/index.umd.js +350 -113
  18. package/lib/index.umd.min.js +1 -1
  19. package/lib/style.css +1 -1
  20. package/lib/style.min.css +1 -1
  21. package/lib/table/module/edit/mixin.js +10 -5
  22. package/lib/table/module/edit/mixin.min.js +1 -1
  23. package/lib/table/src/body.js +71 -59
  24. package/lib/table/src/body.min.js +1 -1
  25. package/lib/table/src/methods.js +141 -23
  26. package/lib/table/src/methods.min.js +1 -1
  27. package/lib/table/src/table.js +126 -24
  28. package/lib/table/src/table.min.js +1 -1
  29. package/lib/table/style/style.css +26 -0
  30. package/lib/table/style/style.min.css +1 -1
  31. package/lib/ui/index.js +1 -1
  32. package/lib/ui/index.min.js +1 -1
  33. package/lib/ui/src/log.js +1 -1
  34. package/lib/ui/src/log.min.js +1 -1
  35. package/lib/vxe-table/style/style.css +26 -0
  36. package/lib/vxe-table/style/style.min.css +1 -1
  37. package/package.json +1 -1
  38. package/packages/table/module/edit/mixin.ts +5 -5
  39. package/packages/table/src/body.ts +62 -48
  40. package/packages/table/src/methods.ts +125 -24
  41. package/packages/table/src/table.ts +108 -24
  42. package/styles/components/table.scss +26 -0
  43. /package/es/{iconfont.1739333092714.ttf → iconfont.1739428244406.ttf} +0 -0
  44. /package/es/{iconfont.1739333092714.woff → iconfont.1739428244406.woff} +0 -0
  45. /package/es/{iconfont.1739333092714.woff2 → iconfont.1739428244406.woff2} +0 -0
  46. /package/lib/{iconfont.1739333092714.ttf → iconfont.1739428244406.ttf} +0 -0
  47. /package/lib/{iconfont.1739333092714.woff → iconfont.1739428244406.woff} +0 -0
  48. /package/lib/{iconfont.1739333092714.woff2 → iconfont.1739428244406.woff2} +0 -0
@@ -2,6 +2,7 @@ import { CreateElement } from 'vue'
2
2
  import XEUtils from 'xe-utils'
3
3
  import { getFuncText, isEnableConf } from '../../ui/src/utils'
4
4
  import { initTpImg } from '../../ui/src/dom'
5
+ import { getRowid } from './util'
5
6
  import { VxeUI } from '../../ui'
6
7
  import methods from './methods'
7
8
  import TableBodyComponent from './body'
@@ -187,6 +188,79 @@ function handleUpdateResize (_vm: any) {
187
188
  }
188
189
  }
189
190
 
191
+ function renderRowExpandedVNs (h: CreateElement, $xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
192
+ const props = $xeTable
193
+ const reactData = $xeTable as unknown as TableReactData
194
+ const internalData = $xeTable as unknown as TableInternalData
195
+
196
+ const { treeConfig } = props
197
+ const { expandColumn } = reactData
198
+ const tableRowExpandedList: any[] = ($xeTable as any).computeTableRowExpandedList
199
+ const expandOpts = $xeTable.computeExpandOpts
200
+ const { mode } = expandOpts
201
+ if (mode !== 'fixed') {
202
+ return renderEmptyElement($xeTable)
203
+ }
204
+ const expandVNs = [
205
+ h('div', {
206
+ key: 'repY',
207
+ ref: 'refRowExpandYSpaceElem'
208
+ })
209
+ ]
210
+
211
+ if (expandColumn) {
212
+ tableRowExpandedList.forEach((row) => {
213
+ const expandOpts = $xeTable.computeExpandOpts
214
+ const { height: expandHeight, padding } = expandOpts
215
+ const { fullAllDataRowIdData } = internalData
216
+ const treeOpts = $xeTable.computeTreeOpts
217
+ const { transform, seqMode } = treeOpts
218
+ const cellStyle: Record<string, string> = {}
219
+ const rowid = getRowid($xeTable, row)
220
+ const rest = fullAllDataRowIdData[rowid]
221
+ let rowLevel = 0
222
+ let seq: string | number = -1
223
+ let _rowIndex = 0
224
+ const rowIndex = $xeTable.getRowIndex(row)
225
+ const $rowIndex = $xeTable.getVMRowIndex(row)
226
+ if (rest) {
227
+ rowLevel = rest.level
228
+ if (treeConfig && transform && seqMode === 'increasing') {
229
+ seq = rest._index + 1
230
+ } else {
231
+ seq = rest.seq
232
+ }
233
+ _rowIndex = rest._index
234
+ }
235
+ if (expandHeight) {
236
+ cellStyle.height = `${expandHeight}px`
237
+ }
238
+ if (treeConfig) {
239
+ cellStyle.paddingLeft = `${(rowLevel * treeOpts.indent) + 30}px`
240
+ }
241
+ const expandParams = { $table: $xeTable, seq, column: expandColumn, fixed: '', type: 'body', level: rowLevel, row, rowIndex, $rowIndex, _rowIndex }
242
+ expandVNs.push(
243
+ h('div', {
244
+ key: rowid,
245
+ class: ['vxe-body--row-expanded-cell', {
246
+ 'is--padding': padding,
247
+ 'is--ellipsis': expandHeight
248
+ }],
249
+ attrs: {
250
+ rowid
251
+ },
252
+ style: cellStyle
253
+ }, expandColumn.renderData(h, expandParams))
254
+ )
255
+ })
256
+ }
257
+
258
+ return h('div', {
259
+ ref: 'refRowExpandElem',
260
+ class: 'vxe-table--row-expanded-wrapper'
261
+ }, expandVNs)
262
+ }
263
+
190
264
  function renderScrollX (h: CreateElement, $xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
191
265
  return h('div', {
192
266
  key: 'vsx',
@@ -259,12 +333,20 @@ function renderViewport (h: CreateElement, $xeTable: VxeTableConstructor & VxeTa
259
333
  const reactData = $xeTable as unknown as TableReactData
260
334
 
261
335
  const { showHeader, showFooter } = props
262
- const { overflowX, tableData, tableColumn, tableGroupColumn, footerTableData, columnStore } = reactData
336
+ const { overflowX, scrollYLoad, tableData, tableColumn, tableGroupColumn, footerTableData, columnStore } = reactData
263
337
  const { leftList, rightList } = columnStore
338
+ const leftFixedWidth = $xeTable.computeLeftFixedWidth
339
+ const rightFixedWidth = $xeTable.computeRightFixedWidth
340
+
341
+ const ons: Record<string, any> = {}
342
+ if (scrollYLoad || leftFixedWidth || rightFixedWidth) {
343
+ ons.onWheel = $xeTable.triggerBodyWheelEvent
344
+ }
264
345
 
265
346
  return h('div', {
266
347
  ref: 'refTableViewportElem',
267
- class: 'vxe-table--viewport-wrapper'
348
+ class: 'vxe-table--viewport-wrapper',
349
+ on: ons
268
350
  }, [
269
351
  h('div', {
270
352
  class: 'vxe-table--main-wrapper'
@@ -310,7 +392,8 @@ function renderViewport (h: CreateElement, $xeTable: VxeTableConstructor & VxeTa
310
392
  }, [
311
393
  leftList && leftList.length && overflowX ? renderFixed(h, $xeTable, 'left') : renderEmptyElement($xeTable),
312
394
  rightList && rightList.length && overflowX ? renderFixed(h, $xeTable, 'right') : renderEmptyElement($xeTable)
313
- ])
395
+ ]),
396
+ renderRowExpandedVNs(h, $xeTable)
314
397
  ])
315
398
  }
316
399
 
@@ -583,8 +666,9 @@ export default {
583
666
 
584
667
  scrollVMLoading: false,
585
668
 
586
- calcCellHeightFlag: 0,
587
- resizeHeightFlag: 0,
669
+ rowExpandHeightFlag: 1,
670
+ calcCellHeightFlag: 1,
671
+ resizeHeightFlag: 1,
588
672
 
589
673
  isCustomStatus: false,
590
674
 
@@ -986,6 +1070,25 @@ export default {
986
1070
  computeCustomOpts () {
987
1071
  return Object.assign({}, getConfig().table.customConfig, this.customConfig)
988
1072
  },
1073
+ computeTableRowExpandedList () {
1074
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
1075
+ const reactData = $xeTable as unknown as TableReactData
1076
+
1077
+ const { rowExpandedMaps, tableData, expandColumn } = reactData
1078
+ const expandList: any[] = []
1079
+ if (expandColumn) {
1080
+ const rowKeys: Record<string, boolean> = {}
1081
+ tableData.forEach(row => {
1082
+ rowKeys[getRowid($xeTable, row)] = true
1083
+ })
1084
+ XEUtils.each(rowExpandedMaps, (row, rowid) => {
1085
+ if (rowKeys[rowid]) {
1086
+ expandList.push(row)
1087
+ }
1088
+ })
1089
+ }
1090
+ return expandList
1091
+ },
989
1092
  computeAutoWidthColumnList () {
990
1093
  const { tableColumn, visibleColumn } = this
991
1094
  return tableColumn.length || visibleColumn.length ? visibleColumn.filter((column: any) => column.width === 'auto' || column.minWidth === 'auto') : []
@@ -1439,30 +1542,11 @@ export default {
1439
1542
  mounted () {
1440
1543
  const $xeTable = this
1441
1544
  const props = $xeTable
1442
- const reactData = $xeTable
1443
1545
 
1444
- const { rowHeightStore } = reactData
1445
- const varEl = $xeTable.$refs.refVarElem
1446
1546
  const columnOpts = $xeTable.computeColumnOpts
1447
1547
  const rowOpts = $xeTable.computeRowOpts
1448
1548
  const customOpts = $xeTable.computeCustomOpts
1449
1549
 
1450
- if (varEl) {
1451
- const [defEl, mediumEl, smallEl, miniEl] = varEl.children
1452
- if (defEl) {
1453
- rowHeightStore.default = defEl.clientHeight
1454
- }
1455
- if (mediumEl) {
1456
- rowHeightStore.medium = mediumEl.clientHeight
1457
- }
1458
- if (smallEl) {
1459
- rowHeightStore.small = smallEl.clientHeight
1460
- }
1461
- if (miniEl) {
1462
- rowHeightStore.mini = miniEl.clientHeight
1463
- }
1464
- }
1465
-
1466
1550
  if (columnOpts.drag || rowOpts.drag || customOpts.allowSort) {
1467
1551
  initTpImg()
1468
1552
  }
@@ -1629,6 +1629,32 @@
1629
1629
  }
1630
1630
 
1631
1631
  /*展开行*/
1632
+ .vxe-table--row-expanded-wrapper {
1633
+ position: absolute;
1634
+ top: 0;
1635
+ left: 0;
1636
+ width: 100%;
1637
+ height: 100%;
1638
+ overflow: hidden;
1639
+ pointer-events: none;
1640
+ }
1641
+ .vxe-body--row-expanded-cell {
1642
+ position: absolute;
1643
+ z-index: 5;
1644
+ top: 0;
1645
+ left: 0;
1646
+ width: 100%;
1647
+ overflow: auto;
1648
+ background-color: var(--vxe-ui-layout-background-color);
1649
+ pointer-events: all;
1650
+ &.is--padding {
1651
+ padding: var(--vxe-ui-table-expand-padding-default);
1652
+ }
1653
+ }
1654
+ .vxe-body--row-expanded-place-column {
1655
+ border-bottom: var(--vxe-ui-table-border-width) solid var(--vxe-ui-table-border-color);
1656
+ border-right: var(--vxe-ui-table-border-width) solid var(--vxe-ui-table-border-color);
1657
+ }
1632
1658
  .vxe-table--expanded {
1633
1659
  cursor: pointer;
1634
1660
  .vxe-table--expand-btn {