vxe-table 4.16.4 → 4.16.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.
@@ -504,8 +504,7 @@ export default defineVxeComponent({
504
504
  if (!dragCol ||
505
505
  (dragCol && dragCol.id === column.id) ||
506
506
  (!isCrossDrag && column.level > 1) ||
507
- (!immediate && column.level > 1) ||
508
- column.renderFixed) {
507
+ (!immediate && column.level > 1)) {
509
508
  showDropTip(evnt, optEl, false, dragPos);
510
509
  return;
511
510
  }
@@ -643,8 +642,8 @@ export default defineVxeComponent({
643
642
  class: 'vxe-table-custom--sort-option'
644
643
  }, [
645
644
  h('span', Object.assign({ class: ['vxe-table-custom--sort-btn', {
646
- 'is--disabled': isDisabled || isHidden || column.renderFixed
647
- }], title: getI18n('vxe.custom.setting.sortHelpTip') }, (isDisabled || isHidden || column.renderFixed
645
+ 'is--disabled': isDisabled || isHidden
646
+ }], title: getI18n('vxe.custom.setting.sortHelpTip') }, (isDisabled || isHidden
648
647
  ? {}
649
648
  : {
650
649
  onMousedown: sortMousedownEvent,
@@ -936,8 +935,8 @@ export default defineVxeComponent({
936
935
  allowSort
937
936
  ? ((isCrossDrag ? immediate : false) || column.level === 1
938
937
  ? h('div', Object.assign({ class: ['vxe-table-custom-popup--column-sort-btn', {
939
- 'is--disabled': isDisabled || isHidden || column.renderFixed
940
- }], title: getI18n('vxe.custom.setting.sortHelpTip') }, (isDisabled || isHidden || column.renderFixed
938
+ 'is--disabled': isDisabled || isHidden
939
+ }], title: getI18n('vxe.custom.setting.sortHelpTip') }, (isDisabled || isHidden
941
940
  ? {}
942
941
  : {
943
942
  onMousedown: sortMousedownEvent,
@@ -5,6 +5,20 @@ import { VxeUI } from '../../ui';
5
5
  import { getCalcHeight, convertHeaderColumnToRows, convertHeaderToGridRows } from './util';
6
6
  const { renderer, renderEmptyElement } = VxeUI;
7
7
  const renderType = 'header';
8
+ function getColumnFirstChild(column) {
9
+ const { children } = column;
10
+ if (children && children.length) {
11
+ return getColumnFirstChild(children[0]);
12
+ }
13
+ return column;
14
+ }
15
+ function getColumnLastChild(column) {
16
+ const { children } = column;
17
+ if (children && children.length) {
18
+ return getColumnLastChild(children[children.length - 1]);
19
+ }
20
+ return column;
21
+ }
8
22
  export default defineVxeComponent({
9
23
  name: 'VxeTableHeader',
10
24
  props: {
@@ -163,6 +177,17 @@ export default defineVxeComponent({
163
177
  else {
164
178
  tcStyle.minHeight = `${currCellHeight}px`;
165
179
  }
180
+ if (isColGroup && !isLastRow) {
181
+ const firstCol = getColumnFirstChild(column);
182
+ const lastCol = getColumnLastChild(column);
183
+ if (firstCol && lastCol && firstCol.id !== lastCol.id) {
184
+ const firstColRest = fullColumnIdData[firstCol.id];
185
+ const lastColRest = fullColumnIdData[lastCol.id];
186
+ if (firstColRest && lastColRest) {
187
+ tcStyle.width = `${lastColRest.oLeft - firstColRest.oLeft + lastCol.renderWidth}px`;
188
+ }
189
+ }
190
+ }
166
191
  return h('th', Object.assign(Object.assign(Object.assign({ class: ['vxe-table--column vxe-header--column', colid, fixedHiddenColumn ? 'fixed--hidden' : 'fixed--visible', {
167
192
  [`col--${headAlign}`]: headAlign,
168
193
  [`col--${type}`]: type,
package/es/ui/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  import { getFuncText } from './src/utils';
3
- export const version = "4.16.4";
3
+ export const version = "4.16.6";
4
4
  VxeUI.version = version;
5
5
  VxeUI.tableVersion = version;
6
6
  VxeUI.setConfig({
package/es/ui/src/log.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  const { log } = VxeUI;
3
- const version = `table v${"4.16.4"}`;
3
+ const version = `table v${"4.16.6"}`;
4
4
  export const warnLog = log.create('warn', version);
5
5
  export const errLog = log.create('error', version);
package/lib/index.umd.js CHANGED
@@ -3138,7 +3138,7 @@ function eqEmptyValue(cellValue) {
3138
3138
  ;// ./packages/ui/index.ts
3139
3139
 
3140
3140
 
3141
- const version = "4.16.4";
3141
+ const version = "4.16.6";
3142
3142
  core_.VxeUI.version = version;
3143
3143
  core_.VxeUI.tableVersion = version;
3144
3144
  core_.VxeUI.setConfig({
@@ -3641,7 +3641,7 @@ var esnext_iterator_some = __webpack_require__(7550);
3641
3641
  const {
3642
3642
  log: log_log
3643
3643
  } = core_.VxeUI;
3644
- const log_version = `table v${"4.16.4"}`;
3644
+ const log_version = `table v${"4.16.6"}`;
3645
3645
  const warnLog = log_log.create('warn', log_version);
3646
3646
  const errLog = log_log.create('error', log_version);
3647
3647
  ;// ./packages/table/src/columnInfo.ts
@@ -8128,6 +8128,24 @@ const {
8128
8128
  renderEmptyElement: header_renderEmptyElement
8129
8129
  } = core_.VxeUI;
8130
8130
  const header_renderType = 'header';
8131
+ function getColumnFirstChild(column) {
8132
+ const {
8133
+ children
8134
+ } = column;
8135
+ if (children && children.length) {
8136
+ return getColumnFirstChild(children[0]);
8137
+ }
8138
+ return column;
8139
+ }
8140
+ function getColumnLastChild(column) {
8141
+ const {
8142
+ children
8143
+ } = column;
8144
+ if (children && children.length) {
8145
+ return getColumnLastChild(children[children.length - 1]);
8146
+ }
8147
+ return column;
8148
+ }
8131
8149
  /* harmony default export */ var header = (defineVxeComponent({
8132
8150
  name: 'VxeTableHeader',
8133
8151
  props: {
@@ -8352,6 +8370,17 @@ const header_renderType = 'header';
8352
8370
  } else {
8353
8371
  tcStyle.minHeight = `${currCellHeight}px`;
8354
8372
  }
8373
+ if (isColGroup && !isLastRow) {
8374
+ const firstCol = getColumnFirstChild(column);
8375
+ const lastCol = getColumnLastChild(column);
8376
+ if (firstCol && lastCol && firstCol.id !== lastCol.id) {
8377
+ const firstColRest = fullColumnIdData[firstCol.id];
8378
+ const lastColRest = fullColumnIdData[lastCol.id];
8379
+ if (firstColRest && lastColRest) {
8380
+ tcStyle.width = `${lastColRest.oLeft - firstColRest.oLeft + lastCol.renderWidth}px`;
8381
+ }
8382
+ }
8383
+ }
8355
8384
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('th', {
8356
8385
  class: ['vxe-table--column vxe-header--column', colid, fixedHiddenColumn ? 'fixed--hidden' : 'fixed--visible', {
8357
8386
  [`col--${headAlign}`]: headAlign,
@@ -9598,7 +9627,7 @@ function panel_createInternalData() {
9598
9627
  evnt.preventDefault();
9599
9628
  const offsetY = evnt.clientY - optEl.getBoundingClientRect().y;
9600
9629
  const dragPos = offsetY < optEl.clientHeight / 2 ? 'top' : 'bottom';
9601
- if (!dragCol || dragCol && dragCol.id === column.id || !isCrossDrag && column.level > 1 || !immediate && column.level > 1 || column.renderFixed) {
9630
+ if (!dragCol || dragCol && dragCol.id === column.id || !isCrossDrag && column.level > 1 || !immediate && column.level > 1) {
9602
9631
  showDropTip(evnt, optEl, false, dragPos);
9603
9632
  return;
9604
9633
  }
@@ -9745,10 +9774,10 @@ function panel_createInternalData() {
9745
9774
  class: 'vxe-table-custom--sort-option'
9746
9775
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
9747
9776
  class: ['vxe-table-custom--sort-btn', {
9748
- 'is--disabled': isDisabled || isHidden || column.renderFixed
9777
+ 'is--disabled': isDisabled || isHidden
9749
9778
  }],
9750
9779
  title: panel_getI18n('vxe.custom.setting.sortHelpTip'),
9751
- ...(isDisabled || isHidden || column.renderFixed ? {} : {
9780
+ ...(isDisabled || isHidden ? {} : {
9752
9781
  onMousedown: sortMousedownEvent,
9753
9782
  onMouseup: sortMouseupEvent
9754
9783
  })
@@ -9992,10 +10021,10 @@ function panel_createInternalData() {
9992
10021
  class: 'vxe-table-custom-popup--name'
9993
10022
  }, [allowSort ? (isCrossDrag ? immediate : false) || column.level === 1 ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
9994
10023
  class: ['vxe-table-custom-popup--column-sort-btn', {
9995
- 'is--disabled': isDisabled || isHidden || column.renderFixed
10024
+ 'is--disabled': isDisabled || isHidden
9996
10025
  }],
9997
10026
  title: panel_getI18n('vxe.custom.setting.sortHelpTip'),
9998
- ...(isDisabled || isHidden || column.renderFixed ? {} : {
10027
+ ...(isDisabled || isHidden ? {} : {
9999
10028
  onMousedown: sortMousedownEvent,
10000
10029
  onMouseup: sortMouseupEvent
10001
10030
  })