vxe-table 3.15.35 → 3.15.37

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 (41) hide show
  1. package/es/grid/src/grid.js +50 -17
  2. package/es/style.css +1 -1
  3. package/es/table/module/edit/mixin.js +2 -2
  4. package/es/table/module/keyboard/mixin.js +4 -1
  5. package/es/table/module/validator/mixin.js +11 -2
  6. package/es/table/src/methods.js +56 -22
  7. package/es/toolbar/src/toolbar.js +0 -6
  8. package/es/ui/index.js +1 -1
  9. package/es/ui/src/log.js +1 -1
  10. package/lib/grid/src/grid.js +57 -24
  11. package/lib/grid/src/grid.min.js +1 -1
  12. package/lib/index.umd.js +141 -63
  13. package/lib/index.umd.min.js +1 -1
  14. package/lib/style.css +1 -1
  15. package/lib/table/module/edit/mixin.js +2 -2
  16. package/lib/table/module/edit/mixin.min.js +1 -1
  17. package/lib/table/module/keyboard/mixin.js +2 -2
  18. package/lib/table/module/keyboard/mixin.min.js +1 -1
  19. package/lib/table/module/validator/mixin.js +14 -2
  20. package/lib/table/module/validator/mixin.min.js +1 -1
  21. package/lib/table/src/methods.js +63 -24
  22. package/lib/table/src/methods.min.js +1 -1
  23. package/lib/toolbar/src/toolbar.js +0 -4
  24. package/lib/toolbar/src/toolbar.min.js +1 -1
  25. package/lib/ui/index.js +1 -1
  26. package/lib/ui/index.min.js +1 -1
  27. package/lib/ui/src/log.js +1 -1
  28. package/lib/ui/src/log.min.js +1 -1
  29. package/package.json +1 -1
  30. package/packages/grid/src/grid.ts +56 -17
  31. package/packages/table/module/edit/mixin.ts +2 -2
  32. package/packages/table/module/keyboard/mixin.ts +4 -1
  33. package/packages/table/module/validator/mixin.ts +11 -3
  34. package/packages/table/src/methods.ts +60 -23
  35. package/packages/toolbar/src/toolbar.ts +0 -4
  36. /package/es/{iconfont.1749202936550.ttf → iconfont.1749517658045.ttf} +0 -0
  37. /package/es/{iconfont.1749202936550.woff → iconfont.1749517658045.woff} +0 -0
  38. /package/es/{iconfont.1749202936550.woff2 → iconfont.1749517658045.woff2} +0 -0
  39. /package/lib/{iconfont.1749202936550.ttf → iconfont.1749517658045.ttf} +0 -0
  40. /package/lib/{iconfont.1749202936550.woff → iconfont.1749517658045.woff} +0 -0
  41. /package/lib/{iconfont.1749202936550.woff2 → iconfont.1749517658045.woff2} +0 -0
@@ -11,6 +11,32 @@ const { getConfig, getI18n, commands, globalEvents, globalMixins, renderEmptyEle
11
11
  const methods = {};
12
12
  const propKeys = Object.keys(tableComponentProps);
13
13
  const defaultLayouts = [['Form'], ['Toolbar', 'Top', 'Table', 'Bottom', 'Pager']];
14
+ function initPages($xeGrid, propKey) {
15
+ const props = $xeGrid;
16
+ const reactData = $xeGrid;
17
+ const { tablePage } = reactData;
18
+ const { pagerConfig } = props;
19
+ const pagerOpts = $xeGrid.computePagerOpts;
20
+ if (pagerConfig && isEnableConf(pagerOpts)) {
21
+ if (propKey) {
22
+ if (pagerOpts[propKey]) {
23
+ tablePage[propKey] = XEUtils.toNumber(pagerOpts[propKey]);
24
+ }
25
+ }
26
+ else {
27
+ const { currentPage, pageSize, total } = pagerOpts;
28
+ if (currentPage) {
29
+ tablePage.currentPage = currentPage;
30
+ }
31
+ if (pageSize) {
32
+ tablePage.pageSize = pageSize;
33
+ }
34
+ if (total) {
35
+ tablePage.pageSize = total;
36
+ }
37
+ }
38
+ }
39
+ }
14
40
  function renderDefaultForm(h, $xeGrid) {
15
41
  const VxeUIFormComponent = VxeUI.getComponent('VxeForm');
16
42
  const props = $xeGrid;
@@ -515,10 +541,20 @@ export default {
515
541
  footKeys
516
542
  };
517
543
  },
518
- computePageConfFlag() {
544
+ computeCustomCurrentPageFlag() {
545
+ const $xeGrid = this;
546
+ const pagerOpts = $xeGrid.computePagerOpts;
547
+ return pagerOpts.currentPage;
548
+ },
549
+ computeCustomPageSizeFlag() {
519
550
  const $xeGrid = this;
520
551
  const pagerOpts = $xeGrid.computePagerOpts;
521
- return `${pagerOpts.currentPage}${pagerOpts.pageSize}`;
552
+ return pagerOpts.pageSize;
553
+ },
554
+ computeCustomTotalFlag() {
555
+ const $xeGrid = this;
556
+ const pagerOpts = $xeGrid.computePagerOpts;
557
+ return pagerOpts.total;
522
558
  }
523
559
  },
524
560
  watch: {
@@ -538,8 +574,17 @@ export default {
538
574
  proxyConfig() {
539
575
  this.initProxy();
540
576
  },
541
- computePageConfFlag() {
542
- this.initPages();
577
+ computeCustomCurrentPageFlag() {
578
+ const $xeGrid = this;
579
+ initPages($xeGrid, 'currentPage');
580
+ },
581
+ computeCustomPageSizeFlag() {
582
+ const $xeGrid = this;
583
+ initPages($xeGrid, 'pageSize');
584
+ },
585
+ computeCustomTotalFlag() {
586
+ const $xeGrid = this;
587
+ initPages($xeGrid, 'total');
543
588
  }
544
589
  },
545
590
  created() {
@@ -573,7 +618,7 @@ export default {
573
618
  }
574
619
  }
575
620
  });
576
- this.initPages();
621
+ initPages($xeGrid);
577
622
  globalEvents.on(this, 'keydown', this.handleGlobalKeydownEvent);
578
623
  },
579
624
  mounted() {
@@ -659,18 +704,6 @@ export default {
659
704
  }
660
705
  });
661
706
  },
662
- initPages() {
663
- const { tablePage, pagerConfig, pagerOpts } = this;
664
- const { currentPage, pageSize } = pagerOpts;
665
- if (pagerConfig) {
666
- if (currentPage) {
667
- tablePage.currentPage = currentPage;
668
- }
669
- if (pageSize) {
670
- tablePage.pageSize = pageSize;
671
- }
672
- }
673
- },
674
707
  initProxy() {
675
708
  const { proxyInited, proxyConfig, proxyOpts, formConfig, formOpts } = this;
676
709
  if (proxyConfig) {