vxe-table 3.24.3 → 3.25.0-beta.0

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 (73) hide show
  1. package/es/grid/src/grid.js +26 -7
  2. package/es/style.css +1 -1
  3. package/es/table/module/custom/panel.js +3 -2
  4. package/es/table/module/edit/mixin.js +5 -4
  5. package/es/table/module/export/mixin.js +6 -4
  6. package/es/table/module/filter/mixin.js +2 -2
  7. package/es/table/module/keyboard/mixin.js +4 -3
  8. package/es/table/module/menu/mixin.js +3 -3
  9. package/es/table/render/index.js +5 -3
  10. package/es/table/src/body.js +4 -4
  11. package/es/table/src/header.js +4 -3
  12. package/es/table/src/methods.js +77 -49
  13. package/es/table/src/table.js +30 -27
  14. package/es/table/src/util.js +6 -3
  15. package/es/ui/index.js +1 -1
  16. package/es/ui/src/log.js +1 -1
  17. package/es/ui/src/utils.js +9 -0
  18. package/lib/grid/src/grid.js +28 -6
  19. package/lib/grid/src/grid.min.js +1 -1
  20. package/lib/index.umd.js +5202 -5144
  21. package/lib/index.umd.min.js +1 -1
  22. package/lib/style.css +1 -1
  23. package/lib/table/module/custom/panel.js +2 -1
  24. package/lib/table/module/custom/panel.min.js +1 -1
  25. package/lib/table/module/edit/mixin.js +4 -3
  26. package/lib/table/module/edit/mixin.min.js +1 -1
  27. package/lib/table/module/export/mixin.js +9 -3
  28. package/lib/table/module/export/mixin.min.js +1 -1
  29. package/lib/table/module/filter/mixin.js +1 -1
  30. package/lib/table/module/filter/mixin.min.js +1 -1
  31. package/lib/table/module/keyboard/mixin.js +4 -3
  32. package/lib/table/module/keyboard/mixin.min.js +1 -1
  33. package/lib/table/module/menu/mixin.js +2 -2
  34. package/lib/table/module/menu/mixin.min.js +1 -1
  35. package/lib/table/render/index.js +4 -2
  36. package/lib/table/render/index.min.js +1 -1
  37. package/lib/table/src/body.js +3 -3
  38. package/lib/table/src/body.min.js +1 -1
  39. package/lib/table/src/header.js +3 -2
  40. package/lib/table/src/header.min.js +1 -1
  41. package/lib/table/src/methods.js +33 -31
  42. package/lib/table/src/methods.min.js +1 -1
  43. package/lib/table/src/table.js +33 -26
  44. package/lib/table/src/table.min.js +1 -1
  45. package/lib/table/src/util.js +8 -2
  46. package/lib/table/src/util.min.js +1 -1
  47. package/lib/ui/index.js +1 -1
  48. package/lib/ui/index.min.js +1 -1
  49. package/lib/ui/src/log.js +1 -1
  50. package/lib/ui/src/log.min.js +1 -1
  51. package/lib/ui/src/utils.js +10 -0
  52. package/lib/ui/src/utils.min.js +1 -1
  53. package/package.json +2 -2
  54. package/packages/grid/src/grid.ts +28 -7
  55. package/packages/table/module/custom/panel.ts +3 -2
  56. package/packages/table/module/edit/mixin.ts +5 -4
  57. package/packages/table/module/export/mixin.ts +6 -4
  58. package/packages/table/module/filter/mixin.ts +2 -2
  59. package/packages/table/module/keyboard/mixin.ts +4 -3
  60. package/packages/table/module/menu/mixin.ts +3 -3
  61. package/packages/table/render/index.ts +5 -3
  62. package/packages/table/src/body.ts +4 -4
  63. package/packages/table/src/header.ts +4 -3
  64. package/packages/table/src/methods.ts +74 -47
  65. package/packages/table/src/table.ts +30 -27
  66. package/packages/table/src/util.ts +6 -3
  67. package/packages/ui/src/utils.ts +10 -0
  68. /package/es/{iconfont.1790757586395.ttf → iconfont.1791880417274.ttf} +0 -0
  69. /package/es/{iconfont.1790757586395.woff → iconfont.1791880417274.woff} +0 -0
  70. /package/es/{iconfont.1790757586395.woff2 → iconfont.1791880417274.woff2} +0 -0
  71. /package/lib/{iconfont.1790757586395.ttf → iconfont.1791880417274.ttf} +0 -0
  72. /package/lib/{iconfont.1790757586395.woff → iconfont.1791880417274.woff} +0 -0
  73. /package/lib/{iconfont.1790757586395.woff2 → iconfont.1791880417274.woff2} +0 -0
@@ -1,13 +1,13 @@
1
1
  import { defineVxeComponent } from '../../ui/src/comp';
2
2
  import XEUtils from 'xe-utils';
3
3
  import { getLastZIndex, nextZIndex, isEnableConf } from '../../ui/src/utils';
4
- import { getOffsetHeight, getPaddingTopBottomSize, getDomNode, toCssUnit } from '../../ui/src/dom';
4
+ import { getOffsetHeight, getPaddingTopBottomSize, getDomNode, toCssUnit, hasClass } from '../../ui/src/dom';
5
5
  import { VxeUI } from '../../ui';
6
6
  import { getSlotVNs } from '../../ui/src/vn';
7
7
  import { createComponentLog } from '../../ui/src/log';
8
8
  import { tableProps } from '../../table/src/props';
9
- import VxeTableComponent from '../../table/src/table';
10
- import VxeToolbarComponent from '../../toolbar/src/toolbar';
9
+ import VxeTableComponent from '../../table';
10
+ import VxeToolbarComponent from '../../toolbar';
11
11
  const { warnLog, errLog } = createComponentLog('grid');
12
12
  const { getConfig, getI18n, commands, globalEvents, globalMixins, createEvent, GLOBAL_EVENT_KEYS, renderEmptyElement } = VxeUI;
13
13
  const tableMethods = {};
@@ -123,6 +123,11 @@ export default {
123
123
  const props = $xeGrid;
124
124
  return Object.assign({}, getConfig().grid.pagerConfig, props.pagerConfig);
125
125
  },
126
+ computePagerProps() {
127
+ const $xeGrid = this;
128
+ const pagerOpts = $xeGrid.computePagerOpts;
129
+ return Object.assign({}, pagerOpts, { enabled: undefined, slots: undefined });
130
+ },
126
131
  formOpts() {
127
132
  const $xeGrid = this;
128
133
  return $xeGrid.computeFormOpts;
@@ -392,12 +397,25 @@ export default {
392
397
  }
393
398
  return 0;
394
399
  },
400
+ getParentElem() {
401
+ const $xeGrid = this;
402
+ const el = $xeGrid.$refs.refElem;
403
+ if (!el) {
404
+ return null;
405
+ }
406
+ let parentEl = el.parentElement;
407
+ // 如果是虚拟滚动条
408
+ if (parentEl && hasClass(parentEl, 'vxe-scrollbar--view-inner')) {
409
+ parentEl = parentEl.parentElement;
410
+ }
411
+ return parentEl;
412
+ },
395
413
  getParentHeight() {
396
414
  const $xeGrid = this;
397
415
  const reactData = $xeGrid.reactData;
398
416
  const el = $xeGrid.$refs.refElem;
399
417
  if (el) {
400
- const parentEl = el.parentElement;
418
+ const parentEl = $xeGrid.getParentElem();
401
419
  return (reactData.isZMax ? getDomNode().visibleHeight : (parentEl ? XEUtils.toNumber(getComputedStyle(parentEl).height) : 0)) - $xeGrid.getExcludeHeight();
402
420
  }
403
421
  return 0;
@@ -1142,7 +1160,7 @@ export default {
1142
1160
  if ($form) {
1143
1161
  return $form.validate();
1144
1162
  }
1145
- return $xeGrid.$nextTick();
1163
+ return Promise.resolve();
1146
1164
  },
1147
1165
  validateFormField(field) {
1148
1166
  const $xeGrid = this;
@@ -1150,7 +1168,7 @@ export default {
1150
1168
  if ($form) {
1151
1169
  return $form.validateField(field);
1152
1170
  }
1153
- return $xeGrid.$nextTick();
1171
+ return Promise.resolve();
1154
1172
  },
1155
1173
  clearFormValidate(field) {
1156
1174
  const $xeGrid = this;
@@ -1749,6 +1767,7 @@ export default {
1749
1767
  const { proxyConfig, pagerConfig } = props;
1750
1768
  const proxyOpts = $xeGrid.computeProxyOpts;
1751
1769
  const pagerOpts = $xeGrid.computePagerOpts;
1770
+ const pagerProps = $xeGrid.computePagerProps;
1752
1771
  const pagerSlot = slots.pager;
1753
1772
  if ((pagerConfig && isEnableConf(pagerOpts)) || slots.pager) {
1754
1773
  return h('div', {
@@ -1761,7 +1780,7 @@ export default {
1761
1780
  VxeUIPagerComponent
1762
1781
  ? h(VxeUIPagerComponent, {
1763
1782
  ref: 'refPager',
1764
- props: Object.assign(Object.assign({}, pagerOpts), (proxyConfig && isEnableConf(proxyOpts) ? reactData.tablePage : {})),
1783
+ props: Object.assign(Object.assign({}, pagerProps), (proxyConfig && isEnableConf(proxyOpts) ? reactData.tablePage : {})),
1765
1784
  on: {
1766
1785
  'page-change': $xeGrid.pageChangeEvent
1767
1786
  },