vxe-table 3.11.15 → 3.11.17

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 (55) hide show
  1. package/README.md +1 -1
  2. package/es/index.css +1 -1
  3. package/es/index.min.css +1 -1
  4. package/es/locale/lang/zh-CHT.js +2 -2
  5. package/es/style.css +1 -1
  6. package/es/style.min.css +1 -1
  7. package/es/table/src/header.js +39 -4
  8. package/es/table/src/methods.js +5 -1
  9. package/es/table/src/table.js +9 -2
  10. package/es/table/src/util.js +10 -9
  11. package/es/table/style.css +13 -1
  12. package/es/table/style.min.css +1 -1
  13. package/es/ui/index.js +6 -2
  14. package/es/ui/src/log.js +1 -1
  15. package/es/vxe-table/style.css +13 -1
  16. package/es/vxe-table/style.min.css +1 -1
  17. package/lib/index.css +1 -1
  18. package/lib/index.min.css +1 -1
  19. package/lib/index.umd.js +66 -19
  20. package/lib/index.umd.min.js +1 -1
  21. package/lib/locale/lang/zh-CHT.js +2 -2
  22. package/lib/locale/lang/zh-CHT.min.js +1 -1
  23. package/lib/locale/lang/zh-CHT.umd.js +2 -2
  24. package/lib/style.css +1 -1
  25. package/lib/style.min.css +1 -1
  26. package/lib/table/src/header.js +39 -5
  27. package/lib/table/src/header.min.js +1 -1
  28. package/lib/table/src/methods.js +5 -1
  29. package/lib/table/src/methods.min.js +1 -1
  30. package/lib/table/src/table.js +5 -1
  31. package/lib/table/src/table.min.js +1 -1
  32. package/lib/table/src/util.js +10 -9
  33. package/lib/table/src/util.min.js +1 -1
  34. package/lib/table/style/style.css +13 -1
  35. package/lib/table/style/style.min.css +1 -1
  36. package/lib/ui/index.js +6 -2
  37. package/lib/ui/index.min.js +1 -1
  38. package/lib/ui/src/log.js +1 -1
  39. package/lib/ui/src/log.min.js +1 -1
  40. package/lib/vxe-table/style/style.css +13 -1
  41. package/lib/vxe-table/style/style.min.css +1 -1
  42. package/package.json +2 -2
  43. package/packages/locale/lang/zh-CHT.ts +2 -2
  44. package/packages/table/src/header.ts +39 -4
  45. package/packages/table/src/methods.ts +5 -1
  46. package/packages/table/src/table.ts +9 -1
  47. package/packages/table/src/util.ts +10 -9
  48. package/packages/ui/index.ts +5 -1
  49. package/styles/components/table.scss +13 -1
  50. /package/es/{iconfont.1733108997206.ttf → iconfont.1733292006395.ttf} +0 -0
  51. /package/es/{iconfont.1733108997206.woff → iconfont.1733292006395.woff} +0 -0
  52. /package/es/{iconfont.1733108997206.woff2 → iconfont.1733292006395.woff2} +0 -0
  53. /package/lib/{iconfont.1733108997206.ttf → iconfont.1733292006395.ttf} +0 -0
  54. /package/lib/{iconfont.1733108997206.woff → iconfont.1733292006395.woff} +0 -0
  55. /package/lib/{iconfont.1733108997206.woff2 → iconfont.1733292006395.woff2} +0 -0
package/lib/index.umd.js CHANGED
@@ -2220,7 +2220,7 @@ function getClass(property, params) {
2220
2220
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
2221
2221
 
2222
2222
 
2223
- const version = "3.11.15";
2223
+ const version = "3.11.17";
2224
2224
  core_.VxeUI.version = version;
2225
2225
  core_.VxeUI.tableVersion = version;
2226
2226
  core_.VxeUI.setConfig({
@@ -2253,6 +2253,10 @@ core_.VxeUI.setConfig({
2253
2253
  resizeConfig: {
2254
2254
  // refreshDelay: 250
2255
2255
  },
2256
+ resizableConfig: {
2257
+ dragMode: 'auto',
2258
+ showDragTip: true
2259
+ },
2256
2260
  radioConfig: {
2257
2261
  // trigger: 'default'
2258
2262
  strict: true
@@ -2276,7 +2280,7 @@ core_.VxeUI.setConfig({
2276
2280
  autoPos: true,
2277
2281
  message: 'inline',
2278
2282
  msgMode: 'single',
2279
- theme: 'normal'
2283
+ theme: 'beautify'
2280
2284
  },
2281
2285
  columnConfig: {
2282
2286
  maxFixedSize: 4
@@ -2774,7 +2778,7 @@ function isNodeElement(elem) {
2774
2778
  const {
2775
2779
  log: log_log
2776
2780
  } = core_.VxeUI;
2777
- const log_version = `table v${"3.11.15"}`;
2781
+ const log_version = `table v${"3.11.17"}`;
2778
2782
  const warnLog = log_log.create('warn', log_version);
2779
2783
  const errLog = log_log.create('error', log_version);
2780
2784
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -3058,7 +3062,7 @@ function getPaddingLeftRightSize(elem) {
3058
3062
  }
3059
3063
  return 0;
3060
3064
  }
3061
- function getElemenMarginWidth(elem) {
3065
+ function getElementMarginWidth(elem) {
3062
3066
  if (elem) {
3063
3067
  const computedStyle = getComputedStyle(elem);
3064
3068
  const marginLeft = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(computedStyle.marginLeft);
@@ -3183,14 +3187,15 @@ function getColReMinWidth(params) {
3183
3187
  let mWidth = minTitleWidth + paddingLeftRight;
3184
3188
  // 默认最小宽处理
3185
3189
  if (hasEllipsis) {
3186
- const checkboxIconWidth = getPaddingLeftRightSize(queryCellElement(cell, '--title>.vxe-cell--checkbox'));
3187
- const requiredIconWidth = getElemenMarginWidth(queryCellElement(cell, '>.vxe-cell--required-icon'));
3188
- const editIconWidth = getElemenMarginWidth(queryCellElement(cell, '>.vxe-cell--edit-icon'));
3189
- const prefixIconWidth = getElemenMarginWidth(queryCellElement(cell, '>.vxe-cell-title-prefix-icon'));
3190
- const suffixIconWidth = getElemenMarginWidth(queryCellElement(cell, '>.vxe-cell-title-suffix-icon'));
3191
- const sortIconWidth = getElemenMarginWidth(queryCellElement(cell, '>.vxe-cell--sort'));
3192
- const filterIconWidth = getElemenMarginWidth(queryCellElement(cell, '>.vxe-cell--filter'));
3193
- mWidth += checkboxIconWidth + requiredIconWidth + editIconWidth + prefixIconWidth + suffixIconWidth + filterIconWidth + sortIconWidth;
3190
+ const dragIconWidth = getPaddingLeftRightSize(queryCellElement(cell, '>.vxe-cell--drag-handle'));
3191
+ const checkboxIconWidth = getPaddingLeftRightSize(queryCellElement(cell, '>.vxe-cell--checkbox'));
3192
+ const requiredIconWidth = getElementMarginWidth(queryCellElement(cell, '>.vxe-cell--required-icon'));
3193
+ const editIconWidth = getElementMarginWidth(queryCellElement(cell, '>.vxe-cell--edit-icon'));
3194
+ const prefixIconWidth = getElementMarginWidth(queryCellElement(cell, '>.vxe-cell-title-prefix-icon'));
3195
+ const suffixIconWidth = getElementMarginWidth(queryCellElement(cell, '>.vxe-cell-title-suffix-icon'));
3196
+ const sortIconWidth = getElementMarginWidth(queryCellElement(cell, '>.vxe-cell--sort'));
3197
+ const filterIconWidth = getElementMarginWidth(queryCellElement(cell, '>.vxe-cell--filter'));
3198
+ mWidth += dragIconWidth + checkboxIconWidth + requiredIconWidth + editIconWidth + prefixIconWidth + suffixIconWidth + filterIconWidth + sortIconWidth;
3194
3199
  }
3195
3200
  // 如果设置最小宽
3196
3201
  if (colMinWidth) {
@@ -5289,8 +5294,12 @@ const updateRowDropTipContent = ($xeTable, tdEl) => {
5289
5294
  const updateColDropOrigin = ($xeTable, column) => {
5290
5295
  const el = $xeTable.$el;
5291
5296
  if (el) {
5297
+ const colQuerys = [];
5298
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree([column], item => {
5299
+ colQuerys.push(`[colid="${item.id}"]`);
5300
+ });
5292
5301
  const clss = 'col--drag-origin';
5293
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`[colid="${column.id}"]`), elem => {
5302
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(colQuerys.join(',')), elem => {
5294
5303
  addClass(elem, clss);
5295
5304
  });
5296
5305
  }
@@ -14323,28 +14332,36 @@ function renderHeads(h, _vm, headerGroups) {
14323
14332
  this.headerColumn = $xetable.isGroup ? convertHeaderColumnToRows(this.tableGroupColumn) : [];
14324
14333
  },
14325
14334
  resizeMousedown(evnt, params) {
14335
+ const $xeTable = this.$parent;
14336
+ const tableInternalData = $xeTable;
14326
14337
  const {
14327
14338
  column
14328
14339
  } = params;
14329
14340
  const {
14330
14341
  $parent: $xetable,
14331
- $el,
14332
14342
  fixedType
14333
14343
  } = this;
14344
+ const {
14345
+ visibleColumn
14346
+ } = tableInternalData;
14334
14347
  const {
14335
14348
  tableBody,
14336
14349
  leftContainer,
14337
- rightContainer,
14338
- resizeBar: resizeBarElem
14350
+ rightContainer
14339
14351
  } = $xetable.$refs;
14352
+ const tableEl = $xeTable.$el;
14353
+ const resizeBarElem = $xetable.$refs.resizeBar;
14354
+ const resizeTipElem = $xetable.$refs.refCellResizeTip;
14355
+ const wrapperElem = this.$el;
14340
14356
  const {
14341
14357
  target: dragBtnElem,
14342
14358
  clientX: dragClientX
14343
14359
  } = evnt;
14344
14360
  const cell = params.cell = dragBtnElem.parentNode;
14361
+ const resizableOpts = $xeTable.computeResizableOpts;
14345
14362
  let dragLeft = 0;
14346
14363
  const tableBodyElem = tableBody.$el;
14347
- const pos = getOffsetPos(dragBtnElem, $el);
14364
+ const pos = getOffsetPos(dragBtnElem, tableEl);
14348
14365
  const dragBtnWidth = dragBtnElem.clientWidth;
14349
14366
  const dragBtnOffsetWidth = Math.floor(dragBtnWidth / 2);
14350
14367
  const minInterval = getColReMinWidth(params) - dragBtnOffsetWidth; // 列之间的最小间距
@@ -14390,7 +14407,24 @@ function renderHeads(h, _vm, headerGroups) {
14390
14407
  // left = Math.min(left, tableBodyElem.clientWidth + tableBodyElem.scrollLeft - 40)
14391
14408
  }
14392
14409
  dragLeft = Math.max(left, dragMinLeft);
14393
- resizeBarElem.style.left = `${dragLeft - scrollLeft}px`;
14410
+ const resizeBarLeft = dragLeft - scrollLeft;
14411
+ resizeBarElem.style.left = `${resizeBarLeft}px`;
14412
+ if (resizableOpts.showDragTip && resizeTipElem) {
14413
+ const tableWidth = tableEl.clientWidth;
14414
+ const wrapperRect = wrapperElem.getBoundingClientRect();
14415
+ const resizeBarWidth = resizeBarElem.clientWidth;
14416
+ const resizeTipWidth = resizeTipElem.clientWidth;
14417
+ const resizeTipHeight = resizeTipElem.clientHeight;
14418
+ let resizeTipLeft = -resizeTipWidth;
14419
+ if (resizeBarLeft < resizeTipWidth + resizeBarWidth) {
14420
+ resizeTipLeft = resizeTipWidth + resizeBarWidth - resizeBarLeft;
14421
+ } else if (resizeBarLeft > tableWidth) {
14422
+ resizeTipLeft += tableWidth - resizeBarLeft;
14423
+ }
14424
+ resizeTipElem.style.left = `${resizeTipLeft}px`;
14425
+ resizeTipElem.style.top = `${Math.min(tableEl.clientHeight - resizeTipHeight, Math.max(0, evnt.clientY - wrapperRect.y - resizeTipHeight / 2))}px`;
14426
+ resizeTipElem.textContent = `${column.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft)}px`;
14427
+ }
14394
14428
  };
14395
14429
  $xetable._isResize = true;
14396
14430
  addClass($xetable.$el, 'drag--resize');
@@ -14401,6 +14435,15 @@ function renderHeads(h, _vm, headerGroups) {
14401
14435
  document.onmouseup = domMouseup;
14402
14436
  const resizeWidth = column.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft);
14403
14437
  column.resizeWidth = resizeWidth;
14438
+ if (resizableOpts.dragMode === 'fixed') {
14439
+ visibleColumn.forEach(item => {
14440
+ if (item.id !== column.id) {
14441
+ if (!item.resizeWidth) {
14442
+ item.resizeWidth = item.renderWidth;
14443
+ }
14444
+ }
14445
+ });
14446
+ }
14404
14447
  resizeBarElem.style.display = 'none';
14405
14448
  $xetable._isResize = false;
14406
14449
  $xetable._lastResizeTime = Date.now();
@@ -23269,6 +23312,7 @@ function handleUupdateResize(_vm) {
23269
23312
  rowOpts,
23270
23313
  checkboxOpts,
23271
23314
  loadingOpts,
23315
+ resizableOpts,
23272
23316
  editRules
23273
23317
  } = $xeTable;
23274
23318
  const {
@@ -23420,7 +23464,10 @@ function handleUupdateResize(_vm) {
23420
23464
  'padding-bottom': `${scrollbarHeight}px`
23421
23465
  } : {},
23422
23466
  ref: 'resizeBar'
23423
- }),
23467
+ }, resizableOpts.showDragTip ? [h('div', {
23468
+ ref: 'refCellResizeTip',
23469
+ class: 'vxe-table--resizable-number-tip'
23470
+ }, '23432px')] : []),
23424
23471
  /**
23425
23472
  * 加载中
23426
23473
  */