vxe-table 3.10.16 → 3.11.1

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 (122) hide show
  1. package/README.md +1 -1
  2. package/es/locale/lang/en-US.js +1 -0
  3. package/es/locale/lang/es-ES.js +1 -0
  4. package/es/locale/lang/hu-HU.js +1 -0
  5. package/es/locale/lang/ja-JP.js +1 -0
  6. package/es/locale/lang/ko-KR.js +1 -0
  7. package/es/locale/lang/pt-BR.js +1 -0
  8. package/es/locale/lang/ru-RU.js +1 -0
  9. package/es/locale/lang/uk-UA.js +1 -0
  10. package/es/locale/lang/vi-VN.js +1 -0
  11. package/es/locale/lang/zh-CHT.js +1 -0
  12. package/es/locale/lang/zh-CN.js +1 -0
  13. package/es/style.css +1 -1
  14. package/es/style.min.css +1 -1
  15. package/es/table/module/custom/mixin.js +5 -1
  16. package/es/table/module/edit/mixin.js +32 -15
  17. package/es/table/src/body.js +40 -24
  18. package/es/table/src/cell.js +75 -32
  19. package/es/table/src/footer.js +159 -131
  20. package/es/table/src/header.js +128 -90
  21. package/es/table/src/methods.js +284 -65
  22. package/es/table/src/props.js +5 -1
  23. package/es/table/src/table.js +64 -20
  24. package/es/table/style.css +33 -20
  25. package/es/table/style.min.css +1 -1
  26. package/es/ui/index.js +9 -4
  27. package/es/ui/src/log.js +1 -1
  28. package/es/vxe-table/style.css +33 -20
  29. package/es/vxe-table/style.min.css +1 -1
  30. package/helper/vetur/attributes.json +1 -1
  31. package/helper/vetur/tags.json +1 -1
  32. package/lib/index.umd.js +917 -449
  33. package/lib/index.umd.min.js +1 -1
  34. package/lib/locale/lang/en-US.js +1 -0
  35. package/lib/locale/lang/en-US.min.js +1 -1
  36. package/lib/locale/lang/en-US.umd.js +1 -0
  37. package/lib/locale/lang/es-ES.js +1 -0
  38. package/lib/locale/lang/es-ES.min.js +1 -1
  39. package/lib/locale/lang/es-ES.umd.js +1 -0
  40. package/lib/locale/lang/hu-HU.js +1 -0
  41. package/lib/locale/lang/hu-HU.min.js +1 -1
  42. package/lib/locale/lang/hu-HU.umd.js +1 -0
  43. package/lib/locale/lang/ja-JP.js +1 -0
  44. package/lib/locale/lang/ja-JP.min.js +1 -1
  45. package/lib/locale/lang/ja-JP.umd.js +1 -0
  46. package/lib/locale/lang/ko-KR.js +1 -0
  47. package/lib/locale/lang/ko-KR.min.js +1 -1
  48. package/lib/locale/lang/ko-KR.umd.js +1 -0
  49. package/lib/locale/lang/pt-BR.js +1 -0
  50. package/lib/locale/lang/pt-BR.min.js +1 -1
  51. package/lib/locale/lang/pt-BR.umd.js +1 -0
  52. package/lib/locale/lang/ru-RU.js +1 -0
  53. package/lib/locale/lang/ru-RU.min.js +1 -1
  54. package/lib/locale/lang/ru-RU.umd.js +1 -0
  55. package/lib/locale/lang/uk-UA.js +1 -0
  56. package/lib/locale/lang/uk-UA.min.js +1 -1
  57. package/lib/locale/lang/uk-UA.umd.js +1 -0
  58. package/lib/locale/lang/vi-VN.js +1 -0
  59. package/lib/locale/lang/vi-VN.min.js +1 -1
  60. package/lib/locale/lang/zh-CHT.js +1 -0
  61. package/lib/locale/lang/zh-CHT.min.js +1 -1
  62. package/lib/locale/lang/zh-CHT.umd.js +1 -0
  63. package/lib/locale/lang/zh-CN.js +1 -0
  64. package/lib/locale/lang/zh-CN.min.js +1 -1
  65. package/lib/locale/lang/zh-CN.umd.js +1 -0
  66. package/lib/style.css +1 -1
  67. package/lib/style.min.css +1 -1
  68. package/lib/table/module/custom/mixin.js +5 -1
  69. package/lib/table/module/custom/mixin.min.js +1 -1
  70. package/lib/table/module/edit/mixin.js +34 -15
  71. package/lib/table/module/edit/mixin.min.js +1 -1
  72. package/lib/table/src/body.js +31 -15
  73. package/lib/table/src/body.min.js +1 -1
  74. package/lib/table/src/cell.js +82 -35
  75. package/lib/table/src/cell.min.js +1 -1
  76. package/lib/table/src/footer.js +198 -161
  77. package/lib/table/src/footer.min.js +1 -1
  78. package/lib/table/src/header.js +169 -128
  79. package/lib/table/src/header.min.js +1 -1
  80. package/lib/table/src/methods.js +313 -68
  81. package/lib/table/src/methods.min.js +1 -1
  82. package/lib/table/src/props.js +5 -1
  83. package/lib/table/src/props.min.js +1 -1
  84. package/lib/table/src/table.js +70 -20
  85. package/lib/table/src/table.min.js +1 -1
  86. package/lib/table/style/style.css +33 -20
  87. package/lib/table/style/style.min.css +1 -1
  88. package/lib/ui/index.js +9 -4
  89. package/lib/ui/index.min.js +1 -1
  90. package/lib/ui/src/log.js +1 -1
  91. package/lib/ui/src/log.min.js +1 -1
  92. package/lib/vxe-table/style/style.css +33 -20
  93. package/lib/vxe-table/style/style.min.css +1 -1
  94. package/package.json +3 -3
  95. package/packages/locale/lang/en-US.ts +1 -0
  96. package/packages/locale/lang/es-ES.ts +1 -0
  97. package/packages/locale/lang/hu-HU.ts +1 -0
  98. package/packages/locale/lang/ja-JP.ts +1 -0
  99. package/packages/locale/lang/ko-KR.ts +1 -0
  100. package/packages/locale/lang/pt-BR.ts +1 -0
  101. package/packages/locale/lang/ru-RU.ts +1 -0
  102. package/packages/locale/lang/uk-UA.ts +1 -0
  103. package/packages/locale/lang/vi-VN.ts +1 -0
  104. package/packages/locale/lang/zh-CHT.ts +1 -0
  105. package/packages/locale/lang/zh-CN.ts +1 -0
  106. package/packages/table/module/custom/mixin.ts +5 -1
  107. package/packages/table/module/edit/mixin.ts +32 -15
  108. package/packages/table/src/body.ts +43 -25
  109. package/packages/table/src/cell.ts +120 -67
  110. package/packages/table/src/footer.ts +164 -150
  111. package/packages/table/src/header.ts +136 -90
  112. package/packages/table/src/methods.ts +296 -67
  113. package/packages/table/src/props.ts +5 -1
  114. package/packages/table/src/table.ts +71 -19
  115. package/packages/ui/index.ts +8 -3
  116. package/styles/components/table.scss +42 -35
  117. /package/es/{iconfont.1731633464058.ttf → iconfont.1731937243466.ttf} +0 -0
  118. /package/es/{iconfont.1731633464058.woff → iconfont.1731937243466.woff} +0 -0
  119. /package/es/{iconfont.1731633464058.woff2 → iconfont.1731937243466.woff2} +0 -0
  120. /package/lib/{iconfont.1731633464058.ttf → iconfont.1731937243466.ttf} +0 -0
  121. /package/lib/{iconfont.1731633464058.woff → iconfont.1731937243466.woff} +0 -0
  122. /package/lib/{iconfont.1731633464058.woff2 → iconfont.1731937243466.woff2} +0 -0
@@ -98,6 +98,53 @@ function renderEmptyBody (h: CreateElement, _vm: any) {
98
98
  return emptyContent
99
99
  }
100
100
 
101
+ const renderDragTipContents = (h: CreateElement, $xeTable: any) => {
102
+ const props = $xeTable
103
+ const reactData = $xeTable
104
+
105
+ const { dragConfig } = props
106
+ const { dragRow, dragCol, dragTipText } = reactData
107
+ const columnDragOpts = $xeTable.computeColumnDragOpts
108
+ const rowDragOpts = $xeTable.computeRowDragOpts
109
+ const rowDragSlots = rowDragOpts.slots || {}
110
+ const rTipSlot = rowDragSlots.tip || (dragConfig && dragConfig.slots ? dragConfig.slots.rowTip : null)
111
+ const columnDragSlots = columnDragOpts.slots || {}
112
+ const cTipSlot = columnDragSlots.tip
113
+
114
+ if (dragRow && rTipSlot) {
115
+ return $xeTable.callSlot(rTipSlot, { row: dragRow }, h)
116
+ }
117
+ if (dragCol && cTipSlot) {
118
+ return $xeTable.callSlot(cTipSlot, { column: dragCol }, h)
119
+ }
120
+ return [h('span', dragTipText)]
121
+ }
122
+
123
+ const renderDragTip = (h: CreateElement, $xeTable: any) => {
124
+ const rowOpts = $xeTable.computeRowOpts
125
+ const columnOpts = $xeTable.computeColumnOpts
126
+
127
+ if (rowOpts.drag || columnOpts.drag) {
128
+ return h('div', {
129
+ class: 'vxe-table--drag-wrapper'
130
+ }, [
131
+ h('div', {
132
+ ref: 'refDragRowLineElem',
133
+ class: 'vxe-table--drag-row-line'
134
+ }),
135
+ h('div', {
136
+ ref: 'refDragColLineElem',
137
+ class: 'vxe-table--drag-col-line'
138
+ }),
139
+ h('div', {
140
+ ref: 'refDragTipElem',
141
+ class: 'vxe-table--drag-sort-tip'
142
+ }, renderDragTipContents(h, $xeTable))
143
+ ])
144
+ }
145
+ return renderEmptyElement($xeTable)
146
+ }
147
+
101
148
  function handleUupdateResize (_vm: any) {
102
149
  const { $el } = _vm
103
150
  if ($el && $el.clientWidth && $el.clientHeight) {
@@ -352,9 +399,15 @@ export default {
352
399
  isHeader: false,
353
400
  isFooter: false
354
401
  },
402
+
403
+ scrollVMLoading: false,
355
404
  isDragRowMove: false,
356
405
  dragRow: null,
406
+ isDragColMove: false,
407
+ dragCol: null,
357
408
  dragTipText: '',
409
+
410
+ _isResize: false,
358
411
  _isLoading: false
359
412
  }
360
413
  },
@@ -433,8 +486,11 @@ export default {
433
486
  computeRowOpts () {
434
487
  return Object.assign({}, getConfig().table.rowConfig, this.rowConfig)
435
488
  },
436
- computeDragOpts () {
437
- return Object.assign({}, getConfig().table.dragConfig, this.dragConfig)
489
+ computeRowDragOpts () {
490
+ return Object.assign({}, getConfig().table.rowDragConfig, this.rowDragConfig)
491
+ },
492
+ computeColumnDragOpts () {
493
+ return Object.assign({}, getConfig().table.columnDragConfig, this.columnDragConfig)
438
494
  },
439
495
  resizeOpts () {
440
496
  return this.computeResizeOpts
@@ -857,7 +913,7 @@ export default {
857
913
  if (this.rowOpts.height && !this.showOverflow) {
858
914
  warnLog('vxe.error.notProp', ['table.show-overflow'])
859
915
  }
860
- if (!this.handleUpdateCellAreas) {
916
+ if (!this.handleRecalculateCellAreas) {
861
917
  if (this.clipConfig) {
862
918
  warnLog('vxe.error.notProp', ['clip-config'])
863
919
  }
@@ -869,6 +925,9 @@ export default {
869
925
  return
870
926
  }
871
927
  }
928
+ if (this.dragConfig) {
929
+ warnLog('vxe.error.delProp', ['drag-config', 'row-drag-config'])
930
+ }
872
931
  if (this.treeConfig && treeOpts.children) {
873
932
  warnLog('vxe.error.delProp', ['tree-config.children', 'tree-config.childrenField'])
874
933
  }
@@ -1064,7 +1123,6 @@ export default {
1064
1123
  const VxeUITooltipComponent = VxeUI.getComponent<VxeTooltipComponent>('VxeTooltip')
1065
1124
 
1066
1125
  const $xeTable = this
1067
- const reactData = $xeTable
1068
1126
 
1069
1127
  const {
1070
1128
  _e,
@@ -1084,6 +1142,7 @@ export default {
1084
1142
  treeConfig,
1085
1143
  mouseConfig,
1086
1144
  mouseOpts,
1145
+ areaOpts,
1087
1146
  computeSize,
1088
1147
  validOpts,
1089
1148
  showFooter,
@@ -1110,22 +1169,22 @@ export default {
1110
1169
  loadingOpts,
1111
1170
  editRules
1112
1171
  } = $xeTable
1113
- const { dragRow, dragTipText } = reactData
1114
1172
  const { leftList, rightList } = columnStore
1115
1173
  const currLoading = this._isLoading || loading
1116
1174
  const vSize = computeSize
1117
- const dragOpts = $xeTable.computeDragOpts
1118
1175
  const virtualScrollBars = $xeTable.computeVirtualScrollBars
1119
- const dragSlots = dragOpts.slots || {}
1120
- const rowTipSlot = dragSlots.rowTip
1176
+ const isArea = mouseConfig && mouseOpts.area
1121
1177
  return h('div', {
1178
+ ref: 'refElem',
1122
1179
  class: ['vxe-table', 'vxe-table--render-default', `tid_${tId}`, vSize ? `size--${vSize}` : '', `border--${tableBorder}`, {
1123
1180
  [`valid-msg--${validOpts.msgMode}`]: !!editRules,
1124
1181
  'vxe-editable': !!editConfig,
1125
1182
  'old-cell-valid': editRules && getConfig().cellVaildMode === 'obsolete',
1126
1183
  'cell--highlight': highlightCell,
1127
1184
  'cell--selected': mouseConfig && mouseOpts.selected,
1128
- 'cell--area': mouseConfig && mouseOpts.area,
1185
+ 'cell--area': isArea,
1186
+ 'header-cell--area': isArea && areaOpts.selectCellByHeader,
1187
+ 'body-cell--area': isArea && areaOpts.selectCellByBody,
1129
1188
  'row--highlight': rowOpts.isHover || highlightHoverRow,
1130
1189
  'column--highlight': columnOpts.isHover || highlightHoverColumn,
1131
1190
  'checkbox--range': checkboxOpts.range,
@@ -1362,16 +1421,9 @@ export default {
1362
1421
  })
1363
1422
  : _e(),
1364
1423
  /**
1365
- * 拖拽提示
1366
- */
1367
- rowOpts.drag && (dragRow || dragTipText)
1368
- ? h('div', {
1369
- ref: 'refRowDragTipElem',
1370
- class: 'vxe-table--row-drag-tip'
1371
- }, rowTipSlot
1372
- ? (dragRow ? this.callSlot(rowTipSlot, { row: dragRow }, h) : [renderEmptyElement($xeTable)])
1373
- : (dragTipText ? [h('span', dragTipText)] : [renderEmptyElement($xeTable)]))
1374
- : _e(),
1424
+ * 拖拽提示
1425
+ */
1426
+ renderDragTip(h, this),
1375
1427
  h('div', {}, [
1376
1428
  /**
1377
1429
  * 提示相关
@@ -43,8 +43,11 @@ VxeUI.setConfig({
43
43
  // trigger: 'default'
44
44
  strict: true
45
45
  },
46
- dragConfig: {
47
- showRowIcon: true
46
+ rowDragConfig: {
47
+ showIcon: true
48
+ },
49
+ columnDragConfig: {
50
+ showIcon: true
48
51
  },
49
52
  checkboxConfig: {
50
53
  // trigger: 'default',
@@ -142,7 +145,8 @@ VxeUI.setConfig({
142
145
  },
143
146
  areaConfig: {
144
147
  autoClear: true,
145
- selectCellByHeader: true
148
+ selectCellByHeader: true,
149
+ selectCellByBody: true
146
150
  },
147
151
  clipConfig: {
148
152
  isCopy: true,
@@ -241,6 +245,7 @@ VxeUI.setIcon({
241
245
  TABLE_CUSTOM_SORT: iconPrefix + 'drag-handle',
242
246
  TABLE_MENU_OPTIONS: iconPrefix + 'arrow-right',
243
247
  TABLE_DRAG_ROW: iconPrefix + 'drag-handle',
248
+ TABLE_DRAG_COLUMN: iconPrefix + 'drag-handle',
244
249
 
245
250
  // toolbar
246
251
  TOOLBAR_TOOLS_REFRESH: iconPrefix + 'repeat',
@@ -663,9 +663,13 @@
663
663
  }
664
664
  }
665
665
  }
666
- &.cell--area {
667
- .vxe-table--body-wrapper,
668
- .vxe-body--column {
666
+ &.header-cell--area {
667
+ .vxe-table--header-wrapper {
668
+ user-select: none;
669
+ }
670
+ }
671
+ &.body-cell--area {
672
+ .vxe-table--body-wrapper {
669
673
  user-select: none;
670
674
  }
671
675
  }
@@ -1077,6 +1081,7 @@
1077
1081
  width: 1px;
1078
1082
  height: 100%;
1079
1083
  z-index: 9;
1084
+ pointer-events: none;
1080
1085
  cursor: col-resize;
1081
1086
  &:before {
1082
1087
  content: "";
@@ -1237,7 +1242,32 @@
1237
1242
  }
1238
1243
  }
1239
1244
 
1240
- /*拖拽行*/
1245
+ /*拖拽列*/
1246
+ .vxe-table--drag-col-line {
1247
+ height: 100%;
1248
+ width: 1px;
1249
+ background-color: var(--vxe-ui-font-primary-color);
1250
+ }
1251
+ .vxe-header--column {
1252
+ &.col--drag-origin {
1253
+ & > .vxe-cell {
1254
+ opacity: 0.5;
1255
+ }
1256
+ }
1257
+ }
1258
+ .vxe-header--col-list-move {
1259
+ transition: transform 0.35s;
1260
+ }
1261
+
1262
+ .vxe-table--drag-col-line,
1263
+ .vxe-table--drag-row-line {
1264
+ display: none;
1265
+ position: absolute;
1266
+ top: 0;
1267
+ left: 0;
1268
+ z-index: 9;
1269
+ pointer-events: none;
1270
+ }
1241
1271
  .vxe-cell--drag-handle {
1242
1272
  user-select: none;
1243
1273
  & + span {
@@ -1257,6 +1287,13 @@
1257
1287
  cursor: not-allowed;
1258
1288
  }
1259
1289
  }
1290
+
1291
+ /*拖拽行*/
1292
+ .vxe-table--drag-row-line {
1293
+ width: 100%;
1294
+ height: 1px;
1295
+ background-color: var(--vxe-ui-font-primary-color);
1296
+ }
1260
1297
  .vxe-body--row {
1261
1298
  &.row--drag-origin {
1262
1299
  & > .vxe-body--column {
@@ -1265,41 +1302,11 @@
1265
1302
  }
1266
1303
  }
1267
1304
  }
1268
- &.row--drag-active-target {
1269
- & > .vxe-body--column {
1270
- &::after {
1271
- display: none;
1272
- content: "";
1273
- position: absolute;
1274
- left: 0;
1275
- width: 100%;
1276
- height: 2px;
1277
- background-color: var(--vxe-ui-font-primary-color);
1278
- z-index: 12;
1279
- }
1280
- }
1281
- &[drag-pos="top"] {
1282
- & > .vxe-body--column {
1283
- &::after {
1284
- display: block;
1285
- top: 0;
1286
- }
1287
- }
1288
- }
1289
- &[drag-pos="bottom"] {
1290
- & > .vxe-body--column {
1291
- &::after {
1292
- display: block;
1293
- bottom: 0;
1294
- }
1295
- }
1296
- }
1297
- }
1298
1305
  }
1299
1306
  .vxe-body--row-list-move {
1300
1307
  transition: transform 0.35s;
1301
1308
  }
1302
- .vxe-table--row-drag-tip {
1309
+ .vxe-table--drag-sort-tip {
1303
1310
  display: none;
1304
1311
  position: absolute;
1305
1312
  top: 0;