vxe-table 3.12.1-beta.4 → 3.12.1-beta.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.
Files changed (44) hide show
  1. package/es/grid/src/grid.js +79 -38
  2. package/es/grid/style.css +15 -6
  3. package/es/grid/style.min.css +1 -1
  4. package/es/index.css +1 -1
  5. package/es/index.min.css +1 -1
  6. package/es/style.css +1 -1
  7. package/es/style.min.css +1 -1
  8. package/es/table/module/custom/panel.js +1 -0
  9. package/es/table/src/methods.js +4 -2
  10. package/es/ui/index.js +1 -1
  11. package/es/ui/src/log.js +1 -1
  12. package/es/vxe-grid/style.css +15 -6
  13. package/es/vxe-grid/style.min.css +1 -1
  14. package/lib/grid/src/grid.js +69 -30
  15. package/lib/grid/src/grid.min.js +1 -1
  16. package/lib/grid/style/style.css +15 -6
  17. package/lib/grid/style/style.min.css +1 -1
  18. package/lib/index.css +1 -1
  19. package/lib/index.min.css +1 -1
  20. package/lib/index.umd.js +76 -34
  21. package/lib/index.umd.min.js +1 -1
  22. package/lib/style.css +1 -1
  23. package/lib/style.min.css +1 -1
  24. package/lib/table/module/custom/panel.js +1 -0
  25. package/lib/table/module/custom/panel.min.js +1 -1
  26. package/lib/table/src/methods.js +4 -2
  27. package/lib/table/src/methods.min.js +1 -1
  28. package/lib/ui/index.js +1 -1
  29. package/lib/ui/index.min.js +1 -1
  30. package/lib/ui/src/log.js +1 -1
  31. package/lib/ui/src/log.min.js +1 -1
  32. package/lib/vxe-grid/style/style.css +15 -6
  33. package/lib/vxe-grid/style/style.min.css +1 -1
  34. package/package.json +2 -2
  35. package/packages/grid/src/grid.ts +86 -40
  36. package/packages/table/module/custom/panel.ts +1 -0
  37. package/packages/table/src/methods.ts +4 -2
  38. package/styles/components/grid.scss +14 -6
  39. /package/es/{iconfont.1735908447074.ttf → iconfont.1735915735443.ttf} +0 -0
  40. /package/es/{iconfont.1735908447074.woff → iconfont.1735915735443.woff} +0 -0
  41. /package/es/{iconfont.1735908447074.woff2 → iconfont.1735915735443.woff2} +0 -0
  42. /package/lib/{iconfont.1735908447074.ttf → iconfont.1735915735443.ttf} +0 -0
  43. /package/lib/{iconfont.1735908447074.woff → iconfont.1735915735443.woff} +0 -0
  44. /package/lib/{iconfont.1735908447074.woff2 → iconfont.1735915735443.woff2} +0 -0
@@ -10,6 +10,7 @@ import { warnLog, errLog } from '../../ui/src/log';
10
10
  const { getConfig, getI18n, commands, globalEvents, globalMixins, renderEmptyElement } = VxeUI;
11
11
  const methods = {};
12
12
  const propKeys = Object.keys(tableComponentProps);
13
+ const defaultLayouts = [['Form'], ['Toolbar', 'Top', 'Table', 'Bottom', 'Pager']];
13
14
  function renderDefaultForm(h, $xeGrid) {
14
15
  const VxeUIFormComponent = VxeUI.getComponent('VxeForm');
15
16
  const props = $xeGrid;
@@ -274,46 +275,73 @@ function renderPager(h, $xeGrid) {
274
275
  }
275
276
  return renderEmptyElement($xeGrid);
276
277
  }
277
- const defaultLayouts = ['Form', 'Toolbar', 'Top', 'Table', 'Bottom', 'Pager'];
278
- function renderLayout(h, _vm) {
279
- const { layouts } = _vm;
280
- const vns = [];
281
- const currLayouts = (layouts && layouts.length ? layouts : (getConfig().grid.layouts || defaultLayouts));
282
- currLayouts.forEach((name) => {
283
- switch (name) {
278
+ function renderChildLayout(h, $xeGrid, layoutKeys) {
279
+ const childVNs = [];
280
+ layoutKeys.forEach(key => {
281
+ switch (key) {
284
282
  case 'Form':
285
- vns.push(renderForm(h, _vm));
283
+ childVNs.push(renderForm(h, $xeGrid));
286
284
  break;
287
285
  case 'Toolbar':
288
- vns.push(renderToolbar(h, _vm));
286
+ childVNs.push(renderToolbar(h, $xeGrid));
289
287
  break;
290
288
  case 'Top':
291
- vns.push(renderTop(h, _vm));
289
+ childVNs.push(renderTop(h, $xeGrid));
292
290
  break;
293
291
  case 'Table':
294
- vns.push(h('div', {
292
+ childVNs.push(h('div', {
295
293
  key: 'table',
296
294
  class: 'vxe-grid--table-container'
297
295
  }, [
298
- renderTableLeft(h, _vm),
299
- renderTable(h, _vm),
300
- renderTableRight(h, _vm)
296
+ renderTableLeft(h, $xeGrid),
297
+ renderTable(h, $xeGrid),
298
+ renderTableRight(h, $xeGrid)
301
299
  ]));
302
300
  break;
303
301
  case 'Bottom':
304
- vns.push(renderBottom(h, _vm));
302
+ childVNs.push(renderBottom(h, $xeGrid));
305
303
  break;
306
304
  case 'Pager':
307
- vns.push(renderPager(h, _vm));
305
+ childVNs.push(renderPager(h, $xeGrid));
308
306
  break;
309
307
  default:
310
- if (process.env.NODE_ENV === 'development') {
311
- errLog('vxe.error.notProp', [`layouts -> ${name}`]);
312
- }
308
+ errLog('vxe.error.notProp', [`layouts -> ${key}`]);
313
309
  break;
314
310
  }
315
311
  });
316
- return vns;
312
+ return childVNs;
313
+ }
314
+ function renderLayout(h, $xeGrid) {
315
+ const slots = $xeGrid.$scopedSlots;
316
+ const currLayoutConf = $xeGrid.computeCurrLayoutConf;
317
+ const { headKeys, bodyKeys, footKeys } = currLayoutConf;
318
+ const asideLeftSlot = slots.asideLeft || slots['aside-left'];
319
+ const asideRightSlot = slots.asideRight || slots['aside-right'];
320
+ return [
321
+ h('div', {
322
+ class: 'vxe-grid--layout-header-wrapper'
323
+ }, renderChildLayout(h, $xeGrid, headKeys)),
324
+ h('div', {
325
+ class: 'vxe-grid--layout-body-wrapper'
326
+ }, [
327
+ asideLeftSlot
328
+ ? h('div', {
329
+ class: 'vxe-grid--layout-aside-left-wrapper'
330
+ }, asideLeftSlot({}))
331
+ : renderEmptyElement($xeGrid),
332
+ h('div', {
333
+ class: 'vxe-grid--layout-body-content-wrapper'
334
+ }, renderChildLayout(h, $xeGrid, bodyKeys)),
335
+ asideRightSlot
336
+ ? h('div', {
337
+ class: 'vxe-grid--layout-aside-right-wrapper'
338
+ }, asideRightSlot({}))
339
+ : renderEmptyElement($xeGrid)
340
+ ]),
341
+ h('div', {
342
+ class: 'vxe-grid--layout-footer-wrapper'
343
+ }, renderChildLayout(h, $xeGrid, footKeys))
344
+ ];
317
345
  }
318
346
  Object.keys(VxeTableComponent.methods).forEach((name) => {
319
347
  methods[name] = function (...args) {
@@ -437,6 +465,36 @@ export default {
437
465
  }
438
466
  return tableProps;
439
467
  },
468
+ computeCurrLayoutConf() {
469
+ const $xeGrid = this;
470
+ const props = $xeGrid;
471
+ const { layouts } = props;
472
+ let confs = [];
473
+ if (layouts && layouts.length) {
474
+ confs = layouts;
475
+ }
476
+ else {
477
+ confs = getConfig().grid.layouts || defaultLayouts;
478
+ }
479
+ let headKeys = [];
480
+ let bodyKeys = [];
481
+ let footKeys = [];
482
+ if (confs.length) {
483
+ if (XEUtils.isArray(confs[0])) {
484
+ headKeys = confs[0];
485
+ bodyKeys = (confs[1] || []);
486
+ footKeys = (confs[2] || []);
487
+ }
488
+ else {
489
+ bodyKeys = confs;
490
+ }
491
+ }
492
+ return {
493
+ headKeys,
494
+ bodyKeys,
495
+ footKeys
496
+ };
497
+ },
440
498
  computePageConfFlag() {
441
499
  const $xeGrid = this;
442
500
  const pagerOpts = $xeGrid.computePagerOpts;
@@ -516,11 +574,8 @@ export default {
516
574
  const $xeGrid = this;
517
575
  const props = $xeGrid;
518
576
  const reactData = $xeGrid;
519
- const slots = $xeGrid.$scopedSlots;
520
577
  const vSize = $xeGrid.computeSize;
521
578
  const styles = $xeGrid.computeStyles;
522
- const asideLeftSlot = slots.asideLeft || slots['aside-left'];
523
- const asideRightSlot = slots.asideRight || slots['aside-right'];
524
579
  return h('div', {
525
580
  class: ['vxe-grid', {
526
581
  [`size--${vSize}`]: vSize,
@@ -530,21 +585,7 @@ export default {
530
585
  'is--loading': props.loading || reactData.tableLoading
531
586
  }],
532
587
  style: styles
533
- }, [
534
- asideLeftSlot
535
- ? h('div', {
536
- class: 'vxe-grid--aside-left-wrapper'
537
- }, asideLeftSlot.call($xeGrid, {}))
538
- : renderEmptyElement($xeGrid),
539
- h('div', {
540
- class: 'vxe-grid--body-content-wrapper'
541
- }, renderLayout(h, $xeGrid)),
542
- asideRightSlot
543
- ? h('div', {
544
- class: 'vxe-grid--aside-right-wrapper'
545
- }, asideRightSlot.call($xeGrid, {}))
546
- : renderEmptyElement($xeGrid)
547
- ]);
588
+ }, renderLayout(h, $xeGrid));
548
589
  },
549
590
  methods: Object.assign(Object.assign(Object.assign({}, methods), { callSlot(slotFunc, params, h, vNodes) {
550
591
  if (slotFunc) {
package/es/grid/style.css CHANGED
@@ -1,8 +1,8 @@
1
1
  .vxe-grid {
2
2
  position: relative;
3
- display: flex;
4
- flex-direction: row;
5
3
  overflow: auto;
4
+ display: flex;
5
+ flex-direction: column;
6
6
  }
7
7
  .vxe-grid.is--loading:before {
8
8
  content: "";
@@ -49,17 +49,26 @@
49
49
  overflow: hidden;
50
50
  }
51
51
 
52
- .vxe-grid--aside-left-wrapper,
53
- .vxe-grid--aside-right-wrapper {
54
- flex-shrink: 0;
52
+ .vxe-grid--layout-body-wrapper {
53
+ display: flex;
54
+ flex-direction: row;
55
55
  overflow: auto;
56
+ flex-grow: 1;
56
57
  }
57
58
 
58
- .vxe-grid--body-content-wrapper {
59
+ .vxe-grid--layout-body-content-wrapper {
59
60
  flex-grow: 1;
60
61
  overflow: auto;
61
62
  }
62
63
 
64
+ .vxe-grid--layout-header-wrapper,
65
+ .vxe-grid--layout-footer-wrapper,
66
+ .vxe-grid--layout-aside-left-wrapper,
67
+ .vxe-grid--layout-aside-left-wrapper {
68
+ flex-shrink: 0;
69
+ overflow: auto;
70
+ }
71
+
63
72
  .vxe-grid {
64
73
  font-size: var(--vxe-ui-font-size-default);
65
74
  }
@@ -1 +1 @@
1
- .vxe-grid{position:relative;display:flex;flex-direction:row;overflow:auto}.vxe-grid.is--loading:before{content:"";position:absolute;top:0;left:0;width:100%;height:100%;z-index:99;-webkit-user-select:none;-moz-user-select:none;user-select:none;background-color:var(--vxe-ui-loading-background-color)}.vxe-grid.is--loading>.vxe-table .vxe-loading{background-color:transparent}.vxe-grid.is--maximize{position:fixed;top:0;left:0;width:100%;height:100%;padding:.5em 1em;background-color:var(--vxe-ui-layout-background-color)}.vxe-grid .vxe-grid--bottom-wrapper,.vxe-grid .vxe-grid--form-wrapper,.vxe-grid .vxe-grid--top-wrapper{position:relative}.vxe-grid .vxe-grid--table-container{display:flex;flex-direction:row}.vxe-grid .vxe-grid--left-wrapper,.vxe-grid .vxe-grid--right-wrapper{flex-shrink:0;overflow:auto;outline:0}.vxe-grid .vxe-grid--table-wrapper{flex-grow:1;overflow:hidden}.vxe-grid--aside-left-wrapper,.vxe-grid--aside-right-wrapper{flex-shrink:0;overflow:auto}.vxe-grid--body-content-wrapper{flex-grow:1;overflow:auto}.vxe-grid{font-size:var(--vxe-ui-font-size-default)}.vxe-grid.size--medium{font-size:var(--vxe-ui-font-size-medium)}.vxe-grid.size--small{font-size:var(--vxe-ui-font-size-small)}.vxe-grid.size--mini{font-size:var(--vxe-ui-font-size-mini)}
1
+ .vxe-grid{position:relative;overflow:auto;display:flex;flex-direction:column}.vxe-grid.is--loading:before{content:"";position:absolute;top:0;left:0;width:100%;height:100%;z-index:99;-webkit-user-select:none;-moz-user-select:none;user-select:none;background-color:var(--vxe-ui-loading-background-color)}.vxe-grid.is--loading>.vxe-table .vxe-loading{background-color:transparent}.vxe-grid.is--maximize{position:fixed;top:0;left:0;width:100%;height:100%;padding:.5em 1em;background-color:var(--vxe-ui-layout-background-color)}.vxe-grid .vxe-grid--bottom-wrapper,.vxe-grid .vxe-grid--form-wrapper,.vxe-grid .vxe-grid--top-wrapper{position:relative}.vxe-grid .vxe-grid--table-container{display:flex;flex-direction:row}.vxe-grid .vxe-grid--left-wrapper,.vxe-grid .vxe-grid--right-wrapper{flex-shrink:0;overflow:auto;outline:0}.vxe-grid .vxe-grid--table-wrapper{flex-grow:1;overflow:hidden}.vxe-grid--layout-body-wrapper{display:flex;flex-direction:row;overflow:auto;flex-grow:1}.vxe-grid--layout-body-content-wrapper{flex-grow:1;overflow:auto}.vxe-grid--layout-aside-left-wrapper,.vxe-grid--layout-footer-wrapper,.vxe-grid--layout-header-wrapper{flex-shrink:0;overflow:auto}.vxe-grid{font-size:var(--vxe-ui-font-size-default)}.vxe-grid.size--medium{font-size:var(--vxe-ui-font-size-medium)}.vxe-grid.size--small{font-size:var(--vxe-ui-font-size-small)}.vxe-grid.size--mini{font-size:var(--vxe-ui-font-size-mini)}