vxe-table 4.11.9 → 4.11.11

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.
@@ -319,7 +319,7 @@ hooks.add('tableEditModule', {
319
319
  }
320
320
  return nextTick().then(() => $xeTable.updateCellAreas());
321
321
  };
322
- const handleEditActive = (params, evnt, isFocus) => {
322
+ const handleEditActive = (params, evnt, isFocus, isPos) => {
323
323
  const { editConfig, mouseConfig } = props;
324
324
  const { editStore, tableColumn } = reactData;
325
325
  const editOpts = computeEditOpts.value;
@@ -410,7 +410,7 @@ hooks.add('tableEditModule', {
410
410
  column.renderHeight = cell.offsetHeight;
411
411
  actived.args = params;
412
412
  actived.column = column;
413
- if (isFocus) {
413
+ if (isPos) {
414
414
  setTimeout(() => {
415
415
  $xeTable.handleFocus(params, evnt);
416
416
  });
@@ -437,7 +437,7 @@ hooks.add('tableEditModule', {
437
437
  columnIndex: $xeTable.getColumnIndex(column),
438
438
  cell,
439
439
  $table: $xeTable
440
- }, null, false);
440
+ }, null, isPos, isPos);
441
441
  internalData._lastCallTime = Date.now();
442
442
  }
443
443
  return nextTick();
@@ -775,10 +775,12 @@ hooks.add('tableEditModule', {
775
775
  setEditRow(row, fieldOrColumn) {
776
776
  const { visibleColumn } = internalData;
777
777
  let column = XEUtils.find(visibleColumn, column => isEnableConf(column.editRender));
778
+ let isPos = false;
778
779
  if (fieldOrColumn) {
780
+ isPos = true;
779
781
  column = XEUtils.isString(fieldOrColumn) ? $xeTable.getColumnByField(fieldOrColumn) : fieldOrColumn;
780
782
  }
781
- return handleEditCell(row, column, false);
783
+ return handleEditCell(row, column, isPos);
782
784
  },
783
785
  setActiveCell(row, fieldOrColumn) {
784
786
  if (process.env.NODE_ENV === 'development') {
@@ -822,7 +824,7 @@ hooks.add('tableEditModule', {
822
824
  * 处理激活编辑
823
825
  */
824
826
  handleEdit(params, evnt) {
825
- return handleEditActive(params, evnt, true);
827
+ return handleEditActive(params, evnt, true, true);
826
828
  },
827
829
  /**
828
830
  * @deprecated
@@ -1819,16 +1819,10 @@ export default defineComponent({
1819
1819
  if (layout === 'header') {
1820
1820
  // 表头体样式处理
1821
1821
  // 横向滚动渲染
1822
- let tWidth = tableWidth;
1823
1822
  let renderColumnList = tableColumn;
1824
1823
  let isOptimizeMode = false;
1825
1824
  if (isGroup) {
1826
1825
  renderColumnList = visibleColumn;
1827
- if (fixedType) {
1828
- if (wrapperElem) {
1829
- wrapperElem.style.width = tWidth ? `${tWidth}px` : '';
1830
- }
1831
- }
1832
1826
  }
1833
1827
  else {
1834
1828
  // 如果是使用优化模式
@@ -1846,24 +1840,34 @@ export default defineComponent({
1846
1840
  if (isOptimizeMode) {
1847
1841
  renderColumnList = fixedColumn || [];
1848
1842
  }
1849
- if (!isOptimizeMode) {
1843
+ }
1844
+ }
1845
+ const tWidth = renderColumnList.reduce((previous, column) => previous + column.renderWidth, 0);
1846
+ if (fixedType) {
1847
+ if (isGroup) {
1848
+ if (wrapperElem) {
1849
+ wrapperElem.style.width = tableWidth ? `${tableWidth}px` : '';
1850
+ }
1851
+ }
1852
+ else {
1853
+ if (isOptimizeMode) {
1850
1854
  if (wrapperElem) {
1851
1855
  wrapperElem.style.width = tWidth ? `${tWidth}px` : '';
1852
1856
  }
1853
1857
  }
1858
+ else {
1859
+ if (wrapperElem) {
1860
+ wrapperElem.style.width = tableWidth ? `${tableWidth}px` : '';
1861
+ }
1862
+ }
1854
1863
  }
1855
1864
  }
1856
- tWidth = renderColumnList.reduce((previous, column) => previous + column.renderWidth, 0);
1857
1865
  if (currScrollElem) {
1858
1866
  currScrollElem.style.height = `${headerHeight}px`;
1859
1867
  }
1860
1868
  if (tableElem) {
1861
1869
  tableElem.style.width = tWidth ? `${tWidth}px` : '';
1862
1870
  }
1863
- const repairElem = getRefElem(elemStore[`${name}-${layout}-repair`]);
1864
- if (repairElem) {
1865
- repairElem.style.width = `${tableWidth}px`;
1866
- }
1867
1871
  const listElem = getRefElem(elemStore[`${name}-${layout}-list`]);
1868
1872
  if (isGroup && listElem) {
1869
1873
  XEUtils.arrayEach(listElem.querySelectorAll('.col--group'), (thElem) => {
@@ -1905,7 +1909,6 @@ export default defineComponent({
1905
1909
  fixedWrapperElem.style.height = `${customHeight > 0 ? customHeight : (tableHeight + headerHeight + footerHeight + osbHeight)}px`;
1906
1910
  fixedWrapperElem.style.width = `${fixedColumn.reduce((previous, column) => previous + column.renderWidth, 0)}px`;
1907
1911
  }
1908
- let tWidth = tableWidth;
1909
1912
  let renderColumnList = tableColumn;
1910
1913
  let isOptimizeMode = false;
1911
1914
  // 如果是使用优化模式
@@ -1922,13 +1925,20 @@ export default defineComponent({
1922
1925
  if (isOptimizeMode) {
1923
1926
  renderColumnList = fixedColumn || [];
1924
1927
  }
1925
- if (!isOptimizeMode) {
1928
+ }
1929
+ const tWidth = renderColumnList.reduce((previous, column) => previous + column.renderWidth, 0);
1930
+ if (fixedType) {
1931
+ if (isOptimizeMode) {
1926
1932
  if (wrapperElem) {
1927
1933
  wrapperElem.style.width = tWidth ? `${tWidth}px` : '';
1928
1934
  }
1929
1935
  }
1936
+ else {
1937
+ if (wrapperElem) {
1938
+ wrapperElem.style.width = tableWidth ? `${tableWidth}px` : '';
1939
+ }
1940
+ }
1930
1941
  }
1931
- tWidth = renderColumnList.reduce((previous, column) => previous + column.renderWidth, 0);
1932
1942
  if (tableElem) {
1933
1943
  tableElem.style.width = tWidth ? `${tWidth}px` : '';
1934
1944
  // 兼容性处理
@@ -1940,7 +1950,6 @@ export default defineComponent({
1940
1950
  }
1941
1951
  }
1942
1952
  else if (layout === 'footer') {
1943
- let tWidth = tableWidth;
1944
1953
  let renderColumnList = tableColumn;
1945
1954
  let isOptimizeMode = false;
1946
1955
  // 如果是使用优化模式
@@ -1957,13 +1966,20 @@ export default defineComponent({
1957
1966
  if (isOptimizeMode) {
1958
1967
  renderColumnList = fixedColumn || [];
1959
1968
  }
1960
- if (!isOptimizeMode) {
1969
+ }
1970
+ const tWidth = renderColumnList.reduce((previous, column) => previous + column.renderWidth, 0);
1971
+ if (fixedType) {
1972
+ if (isOptimizeMode) {
1961
1973
  if (wrapperElem) {
1962
1974
  wrapperElem.style.width = tWidth ? `${tWidth}px` : '';
1963
1975
  }
1964
1976
  }
1977
+ else {
1978
+ if (wrapperElem) {
1979
+ wrapperElem.style.width = tableWidth ? `${tableWidth}px` : '';
1980
+ }
1981
+ }
1965
1982
  }
1966
- tWidth = renderColumnList.reduce((previous, column) => previous + column.renderWidth, 0);
1967
1983
  if (currScrollElem) {
1968
1984
  currScrollElem.style.height = `${footerHeight}px`;
1969
1985
  // 如果是固定列
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.11.9";
3
+ export const version = "4.11.11";
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.11.9"}`;
3
+ const version = `table v${"4.11.11"}`;
4
4
  export const warnLog = log.create('warn', version);
5
5
  export const errLog = log.create('error', version);