vxe-table 4.16.4 → 4.16.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.
@@ -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.5";
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.5"}`;
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.5";
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.5"}`;
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,