vxe-table 3.23.1 → 3.23.2

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 (53) 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/src/body.js +12 -4
  6. package/es/table/src/footer.js +12 -4
  7. package/es/table/src/header.js +12 -4
  8. package/es/table/src/methods.js +1 -2
  9. package/es/table/src/table.js +8 -0
  10. package/es/table/style.css +35 -60
  11. package/es/table/style.min.css +1 -1
  12. package/es/ui/index.js +1 -1
  13. package/es/ui/src/log.js +1 -1
  14. package/es/vxe-table/style.css +35 -60
  15. package/es/vxe-table/style.min.css +1 -1
  16. package/lib/index.css +1 -1
  17. package/lib/index.min.css +1 -1
  18. package/lib/index.umd.js +44 -12
  19. package/lib/index.umd.min.js +1 -1
  20. package/lib/style.css +1 -1
  21. package/lib/style.min.css +1 -1
  22. package/lib/table/src/body.js +11 -3
  23. package/lib/table/src/body.min.js +1 -1
  24. package/lib/table/src/footer.js +11 -3
  25. package/lib/table/src/footer.min.js +1 -1
  26. package/lib/table/src/header.js +11 -3
  27. package/lib/table/src/header.min.js +1 -1
  28. package/lib/table/src/methods.js +1 -1
  29. package/lib/table/src/methods.min.js +1 -1
  30. package/lib/table/src/table.js +8 -0
  31. package/lib/table/src/table.min.js +1 -1
  32. package/lib/table/style/style.css +35 -60
  33. package/lib/table/style/style.min.css +1 -1
  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/vxe-table/style/style.css +35 -60
  39. package/lib/vxe-table/style/style.min.css +1 -1
  40. package/package.json +2 -2
  41. package/packages/table/src/body.ts +13 -4
  42. package/packages/table/src/footer.ts +14 -4
  43. package/packages/table/src/header.ts +14 -4
  44. package/packages/table/src/methods.ts +1 -2
  45. package/packages/table/src/table.ts +9 -0
  46. package/packages/ui/src/utils.ts +1 -1
  47. package/styles/components/table.scss +37 -75
  48. /package/es/{iconfont.1787542588120.ttf → iconfont.1787677388170.ttf} +0 -0
  49. /package/es/{iconfont.1787542588120.woff → iconfont.1787677388170.woff} +0 -0
  50. /package/es/{iconfont.1787542588120.woff2 → iconfont.1787677388170.woff2} +0 -0
  51. /package/lib/{iconfont.1787542588120.ttf → iconfont.1787677388170.ttf} +0 -0
  52. /package/lib/{iconfont.1787542588120.woff → iconfont.1787677388170.woff} +0 -0
  53. /package/lib/{iconfont.1787542588120.woff2 → iconfont.1787677388170.woff2} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vxe-table",
3
- "version": "3.23.1",
3
+ "version": "3.23.2",
4
4
  "description": "A PC-end table component based on Vxe UI, supporting copy-paste, data pivot table, and high-performance virtual list table solution.",
5
5
  "scripts": {
6
6
  "update": "npm install --legacy-peer-deps",
@@ -65,7 +65,7 @@
65
65
  "vue-i18n": "^8.15.1",
66
66
  "vue-router": "^3.5.1",
67
67
  "vue-template-compiler": "2.6.14",
68
- "vxe-pc-ui": "3.17.14"
68
+ "vxe-pc-ui": "3.17.18"
69
69
  },
70
70
  "vetur": {
71
71
  "tags": "helper/vetur/tags.json",
@@ -2,7 +2,7 @@ import { PropType, CreateElement } from 'vue'
2
2
  import XEUtils from 'xe-utils'
3
3
  import { VxeUI } from '../../ui'
4
4
  import { defineVxeComponent } from '../../ui/src/comp'
5
- import { isEnableConf, getClass } from '../../ui/src/utils'
5
+ import { isEnableConf, getClass, getDefaultConfig } from '../../ui/src/utils'
6
6
  import { getRowid, createHandleGetRowId, getCellRestHeight } from './util'
7
7
  import { updateCellTitle } from '../../ui/src/dom'
8
8
  import { getSlotVNs } from '../../ui/src/vn'
@@ -144,8 +144,14 @@ function renderTdColumn (
144
144
  const isEdit = isEnableConf(editRender)
145
145
  const resizeHeight = resizeHeightFlag ? rowRest.resizeHeight : 0
146
146
  let fixedHiddenColumn = overflowX && (fixedType ? column.fixed !== fixedType : !!column.fixed)
147
- const isCellPadding = XEUtils.eqNull(padding) ? (allPadding === null ? cellOpts.padding : allPadding) : padding
148
- const cellOverflow = XEUtils.eqNull(showOverflow) ? allShowOverflow : showOverflow
147
+ const cellPadding = getDefaultConfig(padding, (allPadding === null ? cellOpts.padding : allPadding))
148
+ const isAllCellPadding = cellPadding === true
149
+ const isCellPaddingTop = cellPadding ? (isAllCellPadding || cellPadding.top !== false) : false
150
+ const isCellPaddingBottom = cellPadding ? (isAllCellPadding || cellPadding.bottom !== false) : false
151
+ const isCellPaddingLeft = cellPadding ? (isAllCellPadding || cellPadding.left !== false) : false
152
+ const isCellPaddingRight = cellPadding ? (isAllCellPadding || cellPadding.right !== false) : false
153
+
154
+ const cellOverflow = getDefaultConfig(showOverflow, allShowOverflow)
149
155
  const showEllipsis = cellOverflow === 'ellipsis'
150
156
  const showTitle = cellOverflow === 'title'
151
157
  const showTooltip = cellOverflow === true ? tooltipOpts.mode === 'tooltip' : cellOverflow === 'tooltip'
@@ -466,7 +472,10 @@ function renderTdColumn (
466
472
  'col--max-height': maxHeight,
467
473
  'fixed--width': !isAutoCellWidth,
468
474
  'fixed--hidden': fixedHiddenColumn,
469
- 'is--padding': isCellPadding,
475
+ 'is--pg-top': isCellPaddingTop,
476
+ 'is--pg-bottom': isCellPaddingBottom,
477
+ 'is--pg-left': isCellPaddingLeft,
478
+ 'is--pg-right': isCellPaddingRight,
470
479
  'is--progress': (fixedHiddenColumn && isAllOverflow) || isVNPreEmptyStatus,
471
480
  'is--drag-cell': isRowDragCell && (isCrossDrag || isPeerDrag || !rowLevel),
472
481
  'is--drag-disabled': isDisabledDrag,
@@ -2,7 +2,7 @@ import { PropType, CreateElement } from 'vue'
2
2
  import XEUtils from 'xe-utils'
3
3
  import { VxeUI } from '../../ui'
4
4
  import { defineVxeComponent } from '../../ui/src/comp'
5
- import { getClass } from '../../ui/src/utils'
5
+ import { getClass, getDefaultConfig } from '../../ui/src/utils'
6
6
  import { updateCellTitle } from '../../ui/src/dom'
7
7
  import { getCalcHeight } from './util'
8
8
 
@@ -44,8 +44,15 @@ function renderRows (h: CreateElement, _vm: any, isOptimizeMode: boolean, tableC
44
44
  const compConf = renderOpts ? renderer.get(renderOpts.name) : null
45
45
  const showAllTip = footerTooltipOpts.showAll
46
46
  const fixedHiddenColumn = overflowX && (fixedType ? column.fixed !== fixedType : !!column.fixed)
47
- const isPadding = XEUtils.isBoolean(footerCellOpts.padding) ? footerCellOpts.padding : cellOpts.padding
48
- const footOverflow = XEUtils.eqNull(showFooterOverflow) ? allColumnFooterOverflow : showFooterOverflow
47
+
48
+ const cellPadding = getDefaultConfig(footerCellOpts.padding, cellOpts.padding)
49
+ const isAllCellPadding = cellPadding === true
50
+ const isCellPaddingTop = cellPadding ? (isAllCellPadding || cellPadding.top !== false) : false
51
+ const isCellPaddingBottom = cellPadding ? (isAllCellPadding || cellPadding.bottom !== false) : false
52
+ const isCellPaddingLeft = cellPadding ? (isAllCellPadding || cellPadding.left !== false) : false
53
+ const isCellPaddingRight = cellPadding ? (isAllCellPadding || cellPadding.right !== false) : false
54
+
55
+ const footOverflow = getDefaultConfig(showFooterOverflow, allColumnFooterOverflow)
49
56
  const footAlign = footerAlign || (compConf ? compConf.tableFooterCellAlign : '') || allFooterAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign
50
57
  const showEllipsis = (footOverflow === true ? footerTooltipOpts.mode : footOverflow) === 'ellipsis'
51
58
  const showTitle = (footOverflow === true ? footerTooltipOpts.mode : footOverflow) === 'title'
@@ -155,7 +162,10 @@ function renderRows (h: CreateElement, _vm: any, isOptimizeMode: boolean, tableC
155
162
  'col--last': isLastColumn,
156
163
  'fixed--width': !isAutoCellWidth,
157
164
  'fixed--hidden': fixedHiddenColumn,
158
- 'is--padding': isPadding,
165
+ 'is--pg-top': isCellPaddingTop,
166
+ 'is--pg-bottom': isCellPaddingBottom,
167
+ 'is--pg-left': isCellPaddingLeft,
168
+ 'is--pg-right': isCellPaddingRight,
159
169
  'col--ellipsis': hasEllipsis,
160
170
  'col--current': currentColumn === column
161
171
  }, getClass(footerClassName, cellParams), getClass(footerCellClassName, cellParams)],
@@ -2,7 +2,7 @@ import { PropType, CreateElement } from 'vue'
2
2
  import XEUtils from 'xe-utils'
3
3
  import { VxeUI } from '../../ui'
4
4
  import { defineVxeComponent } from '../../ui/src/comp'
5
- import { isEnableConf, getClass } from '../../ui/src/utils'
5
+ import { isEnableConf, getClass, getDefaultConfig } from '../../ui/src/utils'
6
6
  import { getCalcHeight, convertHeaderColumnToRows, convertHeaderToGridRows } from './util'
7
7
  import { getSlotVNs } from '../../ui/src/vn'
8
8
 
@@ -46,8 +46,15 @@ function renderRows (h: CreateElement, _vm: any, isGroup: boolean, isOptimizeMod
46
46
  const compConf = renderOpts ? renderer.get(renderOpts.name) : null
47
47
  const isColGroup = column.children && column.children.length
48
48
  const fixedHiddenColumn = overflowX && !isColGroup && (fixedType ? column.fixed !== fixedType : !!column.fixed)
49
- const isPadding = XEUtils.isBoolean(headerCellOpts.padding) ? headerCellOpts.padding : cellOpts.padding
50
- const headOverflow = XEUtils.eqNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow
49
+
50
+ const cellPadding = getDefaultConfig(headerCellOpts.padding, cellOpts.padding)
51
+ const isAllCellPadding = cellPadding === true
52
+ const isCellPaddingTop = cellPadding ? (isAllCellPadding || cellPadding.top !== false) : false
53
+ const isCellPaddingBottom = cellPadding ? (isAllCellPadding || cellPadding.bottom !== false) : false
54
+ const isCellPaddingLeft = cellPadding ? (isAllCellPadding || cellPadding.left !== false) : false
55
+ const isCellPaddingRight = cellPadding ? (isAllCellPadding || cellPadding.right !== false) : false
56
+
57
+ const headOverflow = getDefaultConfig(showHeaderOverflow, allColumnHeaderOverflow)
51
58
  const headAlign = headerAlign || (compConf ? compConf.tableHeaderCellAlign : '') || allHeaderAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign
52
59
  const showEllipsis = headOverflow === 'ellipsis'
53
60
  const showTitle = headOverflow === 'title'
@@ -170,7 +177,10 @@ function renderRows (h: CreateElement, _vm: any, isGroup: boolean, isOptimizeMod
170
177
  'col--group': isColGroup,
171
178
  'col--ellipsis': hasEllipsis,
172
179
  'fixed--width': !isAutoCellWidth,
173
- 'is--padding': isPadding,
180
+ 'is--pg-top': isCellPaddingTop,
181
+ 'is--pg-bottom': isCellPaddingBottom,
182
+ 'is--pg-left': isCellPaddingLeft,
183
+ 'is--pg-right': isCellPaddingRight,
174
184
  'is--sortable': column.sortable,
175
185
  'col--filter': !!filters,
176
186
  'is--filter-active': hasFilter,
@@ -2634,10 +2634,9 @@ const calcCellHeight = ($xeTable: VxeTableConstructor) => {
2634
2634
  if (!el || !el.clientWidth) {
2635
2635
  return
2636
2636
  }
2637
- const cellOpts = $xeTable.computeCellOpts
2638
2637
  const treeOpts = $xeTable.computeTreeOpts
2639
2638
  const defaultRowHeight = $xeTable.computeDefaultRowHeight
2640
- if (!isAllOverflow && (scrollYLoad || scrollXLoad || cellOpts.maxHeight || (treeConfig && treeOpts.showLine))) {
2639
+ if (!isAllOverflow && (scrollYLoad || scrollXLoad || (treeConfig && treeOpts.showLine))) {
2641
2640
  const { handleGetRowId } = createHandleGetRowId($xeTable)
2642
2641
  el.setAttribute('data-calc-row', 'Y')
2643
2642
  tableData.forEach(row => {
@@ -1508,6 +1508,12 @@ export default {
1508
1508
  const scrollbarXOpts = $xeTable.computeScrollbarXOpts
1509
1509
  const scrollbarYOpts = $xeTable.computeScrollbarYOpts
1510
1510
  return `${scrollbarXOpts.visible}${scrollbarYOpts.visible}`
1511
+ },
1512
+ computeCellConfHeitht () {
1513
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
1514
+
1515
+ const cellOpts = $xeTable.computeCellOpts
1516
+ return cellOpts.height
1511
1517
  }
1512
1518
  } as any,
1513
1519
  watch: {
@@ -1595,6 +1601,9 @@ export default {
1595
1601
  computeScrollbarVisible () {
1596
1602
  this.reLayoutFlag++
1597
1603
  },
1604
+ computeCellConfHeitht () {
1605
+ this.reLayoutFlag++
1606
+ },
1598
1607
  reLayoutFlag () {
1599
1608
  const $xeTable = this
1600
1609
 
@@ -55,6 +55,6 @@ export function getClass (property: any, params: any) {
55
55
  return property ? XEUtils.isFunction(property) ? property(params) : property : ''
56
56
  }
57
57
 
58
- export function getDefaultConfig (val1: any, def1: any) {
58
+ export function getDefaultConfig <T = any, D = any> (val1: T, def1: D): (T | D) {
59
59
  return XEUtils.eqNull(val1) ? def1 : val1
60
60
  }
@@ -8,20 +8,27 @@
8
8
  // 局部变量
9
9
  .vxe-table {
10
10
  --vxe-ui-table-current-font-size: var(--vxe-ui-font-size-default);
11
+ --vxe-ui-table-current-cell-padding: var(--vxe-ui-table-cell-padding-default);
12
+ --vxe-ui-table-current-row-line-height: var(--vxe-ui-table-row-line-height);
11
13
  &.size--xlarge {
12
14
  --vxe-ui-table-current-font-size: var(--vxe-ui-font-size-xlarge);
15
+ --vxe-ui-table-current-cell-padding: var(--vxe-ui-table-cell-padding-xlarge);
13
16
  }
14
17
  &.size--large {
15
18
  --vxe-ui-table-current-font-size: var(--vxe-ui-font-size-large);
19
+ --vxe-ui-table-current-cell-padding: var(--vxe-ui-table-cell-padding-large);
16
20
  }
17
21
  &.size--medium {
18
22
  --vxe-ui-table-current-font-size: var(--vxe-ui-font-size-medium);
23
+ --vxe-ui-table-current-cell-padding: var(--vxe-ui-table-cell-padding-medium);
19
24
  }
20
25
  &.size--small {
21
26
  --vxe-ui-table-current-font-size: var(--vxe-ui-font-size-small);
27
+ --vxe-ui-table-current-cell-padding: var(--vxe-ui-table-cell-padding-small);
22
28
  }
23
29
  &.size--mini {
24
30
  --vxe-ui-table-current-font-size: var(--vxe-ui-font-size-mini);
31
+ --vxe-ui-table-current-cell-padding: var(--vxe-ui-table-cell-padding-mini);
25
32
  }
26
33
  }
27
34
 
@@ -1392,6 +1399,34 @@ $btnThemeList: (
1392
1399
  white-space: nowrap;
1393
1400
  }
1394
1401
 
1402
+ .vxe-header--column,
1403
+ .vxe-body--column,
1404
+ .vxe-footer--column {
1405
+ &.is--pg-top {
1406
+ .vxe-cell {
1407
+ padding-top: var(--vxe-ui-table-current-cell-padding);
1408
+ }
1409
+ }
1410
+ &.is--pg-bottom {
1411
+ .vxe-cell {
1412
+ padding-bottom: var(--vxe-ui-table-current-cell-padding);
1413
+ }
1414
+ }
1415
+ &.is--pg-left {
1416
+ .vxe-cell {
1417
+ padding-left: var(--vxe-ui-table-current-cell-padding);
1418
+ }
1419
+ }
1420
+ &.is--pg-right {
1421
+ .vxe-cell {
1422
+ padding-right: var(--vxe-ui-table-current-cell-padding);
1423
+ }
1424
+ }
1425
+ .vxe-default-textarea {
1426
+ padding: var(--vxe-ui-table-current-cell-padding);
1427
+ }
1428
+ }
1429
+
1395
1430
  /*table*/
1396
1431
  .vxe-table--render-default {
1397
1432
  position: relative;
@@ -1504,7 +1539,7 @@ $btnThemeList: (
1504
1539
  .vxe-body--column,
1505
1540
  .vxe-footer--column {
1506
1541
  position: relative;
1507
- line-height: var(--vxe-ui-table-row-line-height);
1542
+ line-height: var(--vxe-ui-table-current-row-line-height);
1508
1543
  text-align: left;
1509
1544
  &.col--center {
1510
1545
  text-align: center;
@@ -1573,7 +1608,7 @@ $btnThemeList: (
1573
1608
  .vxe-body--column,
1574
1609
  .vxe-footer--column {
1575
1610
  position: relative;
1576
- line-height: var(--vxe-ui-table-row-line-height);
1611
+ line-height: var(--vxe-ui-table-current-row-line-height);
1577
1612
  text-align: left;
1578
1613
  &.col--current {
1579
1614
  background-color: var(--vxe-ui-table-column-current-background-color);
@@ -1857,18 +1892,6 @@ $btnThemeList: (
1857
1892
  .vxe-table--empty-block {
1858
1893
  min-height: var(--vxe-ui-table-row-height-medium);
1859
1894
  }
1860
- .vxe-header--column,
1861
- .vxe-body--column,
1862
- .vxe-footer--column {
1863
- &.is--padding {
1864
- .vxe-cell {
1865
- padding: var(--vxe-ui-table-cell-padding-medium);
1866
- .vxe-default-textarea {
1867
- padding: var(--vxe-ui-table-cell-padding-medium);
1868
- }
1869
- }
1870
- }
1871
- }
1872
1895
  .vxe-cell {
1873
1896
  .vxe-default-input,
1874
1897
  .vxe-default-textarea,
@@ -1890,18 +1913,6 @@ $btnThemeList: (
1890
1913
  .vxe-table--empty-block {
1891
1914
  min-height: var(--vxe-ui-table-row-height-small);
1892
1915
  }
1893
- .vxe-header--column,
1894
- .vxe-body--column,
1895
- .vxe-footer--column {
1896
- &.is--padding {
1897
- .vxe-cell {
1898
- padding: var(--vxe-ui-table-cell-padding-small);
1899
- .vxe-default-textarea {
1900
- padding: var(--vxe-ui-table-cell-padding-small);
1901
- }
1902
- }
1903
- }
1904
- }
1905
1916
  .vxe-cell {
1906
1917
  .vxe-default-input,
1907
1918
  .vxe-default-textarea,
@@ -1923,18 +1934,6 @@ $btnThemeList: (
1923
1934
  .vxe-table--empty-block {
1924
1935
  min-height: var(--vxe-ui-table-row-height-mini);
1925
1936
  }
1926
- .vxe-header--column,
1927
- .vxe-body--column,
1928
- .vxe-footer--column {
1929
- &.is--padding {
1930
- .vxe-cell {
1931
- padding: var(--vxe-ui-table-cell-padding-mini);
1932
- .vxe-default-textarea {
1933
- padding: var(--vxe-ui-table-cell-padding-mini);
1934
- }
1935
- }
1936
- }
1937
- }
1938
1937
  .vxe-cell {
1939
1938
  .vxe-default-input,
1940
1939
  .vxe-default-textarea,
@@ -1951,19 +1950,6 @@ $btnThemeList: (
1951
1950
  padding: 0 var(--vxe-ui-table-cell-padding-mini);
1952
1951
  }
1953
1952
  }
1954
-
1955
- .vxe-header--column,
1956
- .vxe-body--column,
1957
- .vxe-footer--column {
1958
- &.is--padding {
1959
- .vxe-cell {
1960
- padding: var(--vxe-ui-table-cell-padding-default);
1961
- .vxe-default-textarea {
1962
- padding: var(--vxe-ui-table-cell-padding-default);
1963
- }
1964
- }
1965
- }
1966
- }
1967
1953
 
1968
1954
  .vxe-cell {
1969
1955
  white-space: pre-line;
@@ -2396,30 +2382,6 @@ $btnThemeList: (
2396
2382
  }
2397
2383
  }
2398
2384
 
2399
- &.size--medium {
2400
- .vxe-cell--checkbox {
2401
- font-size: var(--vxe-checkbox-font-size-medium);
2402
- }
2403
- .vxe-cell--radio {
2404
- font-size: var(--vxe-radio-font-size-medium);
2405
- }
2406
- }
2407
- &.size--small {
2408
- .vxe-cell--checkbox {
2409
- font-size: var(--vxe-checkbox-font-size-small);
2410
- }
2411
- .vxe-cell--radio {
2412
- font-size: var(--vxe-radio-font-size-small);
2413
- }
2414
- }
2415
- &.size--mini {
2416
- .vxe-cell--checkbox {
2417
- font-size: var(--vxe-checkbox-font-size-mini);
2418
- }
2419
- .vxe-cell--radio {
2420
- font-size: var(--vxe-radio-font-size-mini);
2421
- }
2422
- }
2423
2385
 
2424
2386
  /*暂无数据*/
2425
2387
  .vxe-table--empty-placeholder,