vxe-table 3.18.4 → 3.18.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.
@@ -4,6 +4,20 @@ import { getClass } from '../../ui/src/utils';
4
4
  import { getCalcHeight, convertHeaderColumnToRows, convertHeaderToGridRows } from './util';
5
5
  const { renderer, renderEmptyElement } = VxeUI;
6
6
  const cellType = 'header';
7
+ function getColumnFirstChild(column) {
8
+ const { children } = column;
9
+ if (children && children.length) {
10
+ return getColumnFirstChild(children[0]);
11
+ }
12
+ return column;
13
+ }
14
+ function getColumnLastChild(column) {
15
+ const { children } = column;
16
+ if (children && children.length) {
17
+ return getColumnLastChild(children[children.length - 1]);
18
+ }
19
+ return column;
20
+ }
7
21
  function renderRows(h, _vm, isGroup, isOptimizeMode, headerGroups, $rowIndex, cols) {
8
22
  const props = _vm;
9
23
  const $xeTable = _vm.$parent;
@@ -130,6 +144,17 @@ function renderRows(h, _vm, isGroup, isOptimizeMode, headerGroups, $rowIndex, co
130
144
  else {
131
145
  tcStyle.minHeight = `${currCellHeight}px`;
132
146
  }
147
+ if (isColGroup && !isLastRow) {
148
+ const firstCol = getColumnFirstChild(column);
149
+ const lastCol = getColumnLastChild(column);
150
+ if (firstCol && lastCol && firstCol.id !== lastCol.id) {
151
+ const firstColRest = fullColumnIdData[firstCol.id];
152
+ const lastColRest = fullColumnIdData[lastCol.id];
153
+ if (firstColRest && lastColRest) {
154
+ tcStyle.width = `${lastColRest.oLeft - firstColRest.oLeft + lastCol.renderWidth}px`;
155
+ }
156
+ }
157
+ }
133
158
  return h('th', {
134
159
  class: ['vxe-table--column vxe-header--column', colid, fixedHiddenColumn ? 'fixed--hidden' : 'fixed--visible', {
135
160
  [`col--${headAlign}`]: headAlign,
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 = "3.18.4";
3
+ export const version = "3.18.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${"3.18.4"}`;
3
+ const version = `table v${"3.18.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
@@ -2002,7 +2002,7 @@ function getClass(property, params) {
2002
2002
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
2003
2003
 
2004
2004
 
2005
- const version = "3.18.4";
2005
+ const version = "3.18.5";
2006
2006
  core_.VxeUI.version = version;
2007
2007
  core_.VxeUI.tableVersion = version;
2008
2008
  core_.VxeUI.setConfig({
@@ -2678,7 +2678,7 @@ function isNodeElement(elem) {
2678
2678
  const {
2679
2679
  log: log_log
2680
2680
  } = core_.VxeUI;
2681
- const log_version = `table v${"3.18.4"}`;
2681
+ const log_version = `table v${"3.18.5"}`;
2682
2682
  const warnLog = log_log.create('warn', log_version);
2683
2683
  const errLog = log_log.create('error', log_version);
2684
2684
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -20348,6 +20348,24 @@ const {
20348
20348
  renderEmptyElement: header_renderEmptyElement
20349
20349
  } = core_.VxeUI;
20350
20350
  const cellType = 'header';
20351
+ function getColumnFirstChild(column) {
20352
+ const {
20353
+ children
20354
+ } = column;
20355
+ if (children && children.length) {
20356
+ return getColumnFirstChild(children[0]);
20357
+ }
20358
+ return column;
20359
+ }
20360
+ function getColumnLastChild(column) {
20361
+ const {
20362
+ children
20363
+ } = column;
20364
+ if (children && children.length) {
20365
+ return getColumnLastChild(children[children.length - 1]);
20366
+ }
20367
+ return column;
20368
+ }
20351
20369
  function header_renderRows(h, _vm, isGroup, isOptimizeMode, headerGroups, $rowIndex, cols) {
20352
20370
  const props = _vm;
20353
20371
  const $xeTable = _vm.$parent;
@@ -20514,6 +20532,17 @@ function header_renderRows(h, _vm, isGroup, isOptimizeMode, headerGroups, $rowIn
20514
20532
  } else {
20515
20533
  tcStyle.minHeight = `${currCellHeight}px`;
20516
20534
  }
20535
+ if (isColGroup && !isLastRow) {
20536
+ const firstCol = getColumnFirstChild(column);
20537
+ const lastCol = getColumnLastChild(column);
20538
+ if (firstCol && lastCol && firstCol.id !== lastCol.id) {
20539
+ const firstColRest = fullColumnIdData[firstCol.id];
20540
+ const lastColRest = fullColumnIdData[lastCol.id];
20541
+ if (firstColRest && lastColRest) {
20542
+ tcStyle.width = `${lastColRest.oLeft - firstColRest.oLeft + lastCol.renderWidth}px`;
20543
+ }
20544
+ }
20545
+ }
20517
20546
  return h('th', {
20518
20547
  class: ['vxe-table--column vxe-header--column', colid, fixedHiddenColumn ? 'fixed--hidden' : 'fixed--visible', {
20519
20548
  [`col--${headAlign}`]: headAlign,