vxe-table 4.6.17 → 4.6.19

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 (74) hide show
  1. package/README.en.md +173 -0
  2. package/README.zh-TW.md +172 -0
  3. package/es/form/src/form-gather.js +1 -1
  4. package/es/grid/src/grid.js +3 -3
  5. package/es/icon/style.css +1 -1
  6. package/es/menu/src/hooks.js +3 -2
  7. package/es/radio/style.css +1 -1
  8. package/es/style.css +1 -1
  9. package/es/style.min.css +1 -1
  10. package/es/table/src/table.js +15 -2
  11. package/es/table/style.css +4 -1
  12. package/es/tools/log.js +1 -1
  13. package/es/v-x-e-table/index.js +17 -2
  14. package/es/v-x-e-table/src/theme.js +4 -0
  15. package/es/vxe-radio/style.css +1 -1
  16. package/es/vxe-table/style.css +4 -1
  17. package/lib/form/src/form-gather.js +1 -1
  18. package/lib/form/src/form-gather.min.js +1 -1
  19. package/lib/grid/src/grid.js +3 -3
  20. package/lib/grid/src/grid.min.js +1 -1
  21. package/lib/icon/style/style.css +1 -1
  22. package/lib/icon/style/style.min.css +1 -1
  23. package/lib/index.umd.js +129 -41
  24. package/lib/index.umd.min.js +1 -1
  25. package/lib/menu/src/hooks.js +3 -2
  26. package/lib/menu/src/hooks.min.js +1 -1
  27. package/lib/radio/style/style.css +1 -1
  28. package/lib/radio/style/style.min.css +1 -1
  29. package/lib/style.css +1 -1
  30. package/lib/style.min.css +1 -1
  31. package/lib/table/src/table.js +15 -2
  32. package/lib/table/src/table.min.js +1 -1
  33. package/lib/table/style/style.css +4 -1
  34. package/lib/table/style/style.min.css +1 -1
  35. package/lib/tools/log.js +1 -1
  36. package/lib/tools/log.min.js +1 -1
  37. package/lib/v-x-e-table/index.js +26 -3
  38. package/lib/v-x-e-table/index.min.js +1 -1
  39. package/lib/v-x-e-table/src/theme.js +5 -0
  40. package/lib/v-x-e-table/src/theme.min.js +1 -1
  41. package/lib/vxe-radio/style/style.css +1 -1
  42. package/lib/vxe-radio/style/style.min.css +1 -1
  43. package/lib/vxe-table/style/style.css +4 -1
  44. package/lib/vxe-table/style/style.min.css +1 -1
  45. package/package.json +4 -4
  46. package/packages/form/src/form-gather.ts +1 -1
  47. package/packages/grid/src/grid.ts +3 -3
  48. package/packages/menu/src/hooks.ts +3 -2
  49. package/packages/table/src/table.ts +15 -2
  50. package/packages/v-x-e-table/index.ts +21 -2
  51. package/packages/v-x-e-table/src/theme.ts +5 -0
  52. package/styles/checkbox.scss +1 -1
  53. package/styles/custom.scss +1 -1
  54. package/styles/export.scss +1 -1
  55. package/styles/radio.scss +1 -1
  56. package/styles/table.scss +4 -1
  57. package/styles/theme/dark.scss +1 -0
  58. package/styles/theme/default.scss +1 -0
  59. package/styles/variable.scss +1 -0
  60. package/types/table.d.ts +7 -1
  61. package/types/v-x-e-table/index.d.ts +14 -1
  62. package/types/v-x-e-table/menus.d.ts +8 -0
  63. /package/es/icon/style/{iconfont.1716777871692.ttf → iconfont.1726118382121.ttf} +0 -0
  64. /package/es/icon/style/{iconfont.1716777871692.woff → iconfont.1726118382121.woff} +0 -0
  65. /package/es/icon/style/{iconfont.1716777871692.woff2 → iconfont.1726118382121.woff2} +0 -0
  66. /package/es/{iconfont.1716777871692.ttf → iconfont.1726118382121.ttf} +0 -0
  67. /package/es/{iconfont.1716777871692.woff → iconfont.1726118382121.woff} +0 -0
  68. /package/es/{iconfont.1716777871692.woff2 → iconfont.1726118382121.woff2} +0 -0
  69. /package/lib/icon/style/{iconfont.1716777871692.ttf → iconfont.1726118382121.ttf} +0 -0
  70. /package/lib/icon/style/{iconfont.1716777871692.woff → iconfont.1726118382121.woff} +0 -0
  71. /package/lib/icon/style/{iconfont.1716777871692.woff2 → iconfont.1726118382121.woff2} +0 -0
  72. /package/lib/{iconfont.1716777871692.ttf → iconfont.1726118382121.ttf} +0 -0
  73. /package/lib/{iconfont.1716777871692.woff → iconfont.1726118382121.woff} +0 -0
  74. /package/lib/{iconfont.1716777871692.woff2 → iconfont.1726118382121.woff2} +0 -0
package/lib/index.umd.js CHANGED
@@ -1961,10 +1961,12 @@ __webpack_require__.d(__webpack_exports__, {
1961
1961
  VxeUI: function() { return /* reexport */ VxeUI; },
1962
1962
  _t: function() { return /* reexport */ _t; },
1963
1963
  commands: function() { return /* reexport */ commands; },
1964
+ component: function() { return /* reexport */ component; },
1964
1965
  config: function() { return /* reexport */ config; },
1965
1966
  "default": function() { return /* binding */ entry_lib; },
1966
1967
  drawer: function() { return /* reexport */ drawer; },
1967
1968
  formats: function() { return /* reexport */ formats; },
1969
+ getComponent: function() { return /* reexport */ getComponent; },
1968
1970
  globalConfs: function() { return /* reexport */ globalConfs; },
1969
1971
  globalStore: function() { return /* reexport */ globalStore; },
1970
1972
  hooks: function() { return /* reexport */ hooks; },
@@ -1980,9 +1982,11 @@ __webpack_require__.d(__webpack_exports__, {
1980
1982
  setIcon: function() { return /* reexport */ setIcon; },
1981
1983
  setup: function() { return /* reexport */ setup; },
1982
1984
  t: function() { return /* reexport */ t; },
1985
+ tableVersion: function() { return /* reexport */ tableVersion; },
1983
1986
  use: function() { return /* reexport */ use; },
1984
1987
  v: function() { return /* reexport */ v; },
1985
- validators: function() { return /* reexport */ validators; }
1988
+ validators: function() { return /* reexport */ validators; },
1989
+ version: function() { return /* reexport */ version; }
1986
1990
  });
1987
1991
 
1988
1992
  // NAMESPACE OBJECT: ./packages/all.ts
@@ -2063,9 +2067,11 @@ __webpack_require__.d(all_namespaceObject, {
2063
2067
  VxeUI: function() { return VxeUI; },
2064
2068
  _t: function() { return _t; },
2065
2069
  commands: function() { return commands; },
2070
+ component: function() { return component; },
2066
2071
  config: function() { return config; },
2067
2072
  drawer: function() { return drawer; },
2068
2073
  formats: function() { return formats; },
2074
+ getComponent: function() { return getComponent; },
2069
2075
  globalConfs: function() { return globalConfs; },
2070
2076
  globalStore: function() { return globalStore; },
2071
2077
  hooks: function() { return hooks; },
@@ -2081,9 +2087,11 @@ __webpack_require__.d(all_namespaceObject, {
2081
2087
  setIcon: function() { return setIcon; },
2082
2088
  setup: function() { return setup; },
2083
2089
  t: function() { return t; },
2090
+ tableVersion: function() { return tableVersion; },
2084
2091
  use: function() { return use; },
2085
2092
  v: function() { return v; },
2086
- validators: function() { return validators; }
2093
+ validators: function() { return validators; },
2094
+ version: function() { return version; }
2087
2095
  });
2088
2096
 
2089
2097
  ;// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
@@ -2498,44 +2506,89 @@ const GlobalConfig = {
2498
2506
  };
2499
2507
  /* harmony default export */ var conf = (GlobalConfig);
2500
2508
  ;// CONCATENATED MODULE: ./node_modules/dom-zindex/es/index.esm.js
2509
+ var winDom = null;
2510
+ var bodyEl = null;
2501
2511
  var storeEl = null;
2502
2512
  var storeId = 'z-index-manage';
2513
+ var styleEl = null;
2514
+ var styleId = 'z-index-style';
2503
2515
  var storeMainKey = 'm';
2504
2516
  var storeSubKey = 's';
2505
2517
  var storeData = {
2506
2518
  m: 1000,
2507
2519
  s: 1000
2508
2520
  };
2509
- function isDocument() {
2510
- return typeof document !== 'undefined';
2521
+ function getDocument() {
2522
+ if (!winDom) {
2523
+ if (typeof document !== 'undefined') {
2524
+ winDom = document;
2525
+ }
2526
+ }
2527
+ return winDom;
2528
+ }
2529
+ function getBody() {
2530
+ if (winDom && !bodyEl) {
2531
+ bodyEl = winDom.body || winDom.getElementsByTagName('body')[0];
2532
+ }
2533
+ return bodyEl;
2511
2534
  }
2512
2535
  function getDomMaxZIndex() {
2513
2536
  var max = 0;
2514
- if (isDocument()) {
2515
- var allElem = document.body.getElementsByTagName('*');
2516
- for (var i = 0; i < allElem.length; i++) {
2517
- var elem = allElem[i];
2518
- if (elem && elem.style && elem.nodeType === 1) {
2519
- var zIndex = elem.style.zIndex;
2520
- if (zIndex && /^\d+$/.test(zIndex)) {
2521
- max = Math.max(max, Number(zIndex));
2537
+ var dom = getDocument();
2538
+ if (dom) {
2539
+ var body = getBody();
2540
+ if (body) {
2541
+ var allElem = body.getElementsByTagName('*');
2542
+ for (var i = 0; i < allElem.length; i++) {
2543
+ var elem = allElem[i];
2544
+ if (elem && elem.style && elem.nodeType === 1) {
2545
+ var zIndex = elem.style.zIndex;
2546
+ if (zIndex && /^\d+$/.test(zIndex)) {
2547
+ max = Math.max(max, Number(zIndex));
2548
+ }
2522
2549
  }
2523
2550
  }
2524
2551
  }
2525
2552
  }
2526
2553
  return max;
2527
2554
  }
2528
- function getDom() {
2555
+ function getStyle() {
2556
+ if (!styleEl) {
2557
+ var dom = getDocument();
2558
+ if (dom) {
2559
+ styleEl = dom.getElementById(styleId);
2560
+ if (!styleEl) {
2561
+ styleEl = dom.createElement('style');
2562
+ styleEl.id = styleId;
2563
+ dom.getElementsByTagName('head')[0].appendChild(styleEl);
2564
+ }
2565
+ }
2566
+ }
2567
+ return styleEl;
2568
+ }
2569
+ function updateVar() {
2570
+ var styEl = getStyle();
2571
+ if (styEl) {
2572
+ var prefixes = '--dom-';
2573
+ var propKey = '-z-index';
2574
+ styEl.innerHTML = ':root{' + prefixes + 'main' + propKey + ':' + getCurrent() + ';' + prefixes + 'sub' + propKey + ':' + getSubCurrent() + '}';
2575
+ }
2576
+ }
2577
+ function getStoreDom() {
2529
2578
  if (!storeEl) {
2530
- if (isDocument()) {
2531
- storeEl = document.getElementById(storeId);
2579
+ var dom = getDocument();
2580
+ if (dom) {
2581
+ storeEl = dom.getElementById(storeId);
2532
2582
  if (!storeEl) {
2533
- storeEl = document.createElement('div');
2534
- storeEl.id = storeId;
2535
- storeEl.style.display = 'none';
2536
- document.body.appendChild(storeEl);
2537
- setCurrent(storeData.m);
2538
- setSubCurrent(storeData.s);
2583
+ var body = getBody();
2584
+ if (body) {
2585
+ storeEl = dom.createElement('div');
2586
+ storeEl.id = storeId;
2587
+ storeEl.style.display = 'none';
2588
+ body.appendChild(storeEl);
2589
+ setCurrent(storeData.m);
2590
+ setSubCurrent(storeData.s);
2591
+ }
2539
2592
  }
2540
2593
  }
2541
2594
  }
@@ -2546,15 +2599,16 @@ function createSetHandle(key) {
2546
2599
  if (value) {
2547
2600
  value = Number(value);
2548
2601
  storeData[key] = value;
2549
- var doc = getDom();
2550
- if (doc) {
2551
- if (doc.dataset) {
2552
- doc.dataset[key] = value + '';
2602
+ var el = getStoreDom();
2603
+ if (el) {
2604
+ if (el.dataset) {
2605
+ el.dataset[key] = value + '';
2553
2606
  } else {
2554
- doc.setAttribute('data-' + key, value + '');
2607
+ el.setAttribute('data-' + key, value + '');
2555
2608
  }
2556
2609
  }
2557
2610
  }
2611
+ updateVar();
2558
2612
  return storeData[key];
2559
2613
  };
2560
2614
  }
@@ -2562,9 +2616,9 @@ var setCurrent = createSetHandle(storeMainKey);
2562
2616
  function createGetHandle(key, nextMethod) {
2563
2617
  return function getCurrent(currZindex) {
2564
2618
  var zIndex;
2565
- var doc = getDom();
2566
- if (doc) {
2567
- var domVal = doc.dataset ? doc.dataset[key] : doc.getAttribute('data-' + key);
2619
+ var el = getStoreDom();
2620
+ if (el) {
2621
+ var domVal = el.dataset ? el.dataset[key] : el.getAttribute('data-' + key);
2568
2622
  if (domVal) {
2569
2623
  zIndex = Number(domVal);
2570
2624
  }
@@ -2606,11 +2660,12 @@ var DomZIndex = {
2606
2660
  getSubNext: getSubNext,
2607
2661
  getMax: getDomMaxZIndex
2608
2662
  };
2663
+ updateVar();
2609
2664
  /* harmony default export */ var index_esm = (DomZIndex);
2610
2665
  ;// CONCATENATED MODULE: ./packages/tools/log.ts
2611
2666
 
2612
2667
  function getLog(message, params) {
2613
- return `[vxe-table v${"4.6.17"}] ${conf.i18n(message, params)}`;
2668
+ return `[vxe-table v${"4.6.19"}] ${conf.i18n(message, params)}`;
2614
2669
  }
2615
2670
  function outLog(type) {
2616
2671
  return function (message, params) {
@@ -4896,6 +4951,7 @@ function setTheme(name) {
4896
4951
  if (!theme || theme === 'default') {
4897
4952
  theme = 'light';
4898
4953
  }
4954
+ conf.theme = theme;
4899
4955
  if (typeof document !== 'undefined') {
4900
4956
  const documentElement = document.documentElement;
4901
4957
  if (documentElement) {
@@ -4903,6 +4959,9 @@ function setTheme(name) {
4903
4959
  }
4904
4960
  }
4905
4961
  }
4962
+ function getTheme() {
4963
+ return conf.theme;
4964
+ }
4906
4965
  ;// CONCATENATED MODULE: ./packages/v-x-e-table/index.ts
4907
4966
 
4908
4967
 
@@ -5017,9 +5076,21 @@ function setIcon(options) {
5017
5076
  return VXETable;
5018
5077
  }
5019
5078
  const globalStore = {};
5079
+ const components = {};
5080
+ function getComponent(name) {
5081
+ return components[name] || null;
5082
+ }
5083
+ function component(comp) {
5084
+ if (comp && comp.name) {
5085
+ components[comp.name] = comp;
5086
+ }
5087
+ }
5088
+ const version = "4.6.19";
5089
+ const tableVersion = version;
5020
5090
  const VXETable = {
5021
5091
  v,
5022
- version: "4.6.17",
5092
+ version,
5093
+ tableVersion,
5023
5094
  setConfig,
5024
5095
  setIcon,
5025
5096
  globalStore,
@@ -5033,6 +5104,9 @@ const VXETable = {
5033
5104
  use,
5034
5105
  t,
5035
5106
  _t,
5107
+ setTheme: setTheme,
5108
+ getTheme: getTheme,
5109
+ getComponent,
5036
5110
  // 已废弃
5037
5111
  config,
5038
5112
  setup,
@@ -6247,8 +6321,9 @@ const tableMenuHook = {
6247
6321
  $grid: $xetable.xegrid,
6248
6322
  $event: evnt
6249
6323
  });
6250
- if (gMenuOpts && gMenuOpts.menuMethod) {
6251
- gMenuOpts.menuMethod(params, evnt);
6324
+ const tmMethod = gMenuOpts ? gMenuOpts.tableMenuMethod || gMenuOpts.menuMethod : null;
6325
+ if (tmMethod) {
6326
+ tmMethod(params, evnt);
6252
6327
  }
6253
6328
  $xetable.dispatchEvent('menu-click', params, evnt);
6254
6329
  menuMethods.closeMenu();
@@ -22011,7 +22086,7 @@ const sortStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_SORT';
22011
22086
  const val = props[key];
22012
22087
  let num = 0;
22013
22088
  if (val) {
22014
- if (val === 'auto') {
22089
+ if (val === '100%' || val === 'auto') {
22015
22090
  num = parentHeight;
22016
22091
  } else {
22017
22092
  const excludeHeight = $xetable.getExcludeHeight();
@@ -24338,6 +24413,19 @@ const sortStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_SORT';
24338
24413
  return tableMethods.recalculate();
24339
24414
  });
24340
24415
  },
24416
+ /**
24417
+ * 修改行数据
24418
+ */
24419
+ setRow(rows, record) {
24420
+ if (record) {
24421
+ let rest = rows;
24422
+ if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows)) {
24423
+ rest = [rows];
24424
+ }
24425
+ rest.forEach(item => Object.assign(item, record));
24426
+ }
24427
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
24428
+ },
24341
24429
  /**
24342
24430
  * 局部加载行数据并恢复到初始状态
24343
24431
  * 对于行数据需要局部更改的场景中可能会用到
@@ -27009,7 +27097,7 @@ const sortStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_SORT';
27009
27097
  const el = refElem.value;
27010
27098
  if (el) {
27011
27099
  const parentElem = el.parentNode;
27012
- const parentPaddingSize = height === 'auto' ? getPaddingTopBottomSize(parentElem) : 0;
27100
+ const parentPaddingSize = height === '100%' || height === 'auto' ? getPaddingTopBottomSize(parentElem) : 0;
27013
27101
  return Math.floor($xegrid ? $xegrid.getParentHeight() : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getComputedStyle(parentElem).height) - parentPaddingSize);
27014
27102
  }
27015
27103
  return 0;
@@ -31757,9 +31845,9 @@ const gridComponentEmits = [...emits, 'page-change', 'form-submit', 'form-submit
31757
31845
  const tableProps = Object.assign({}, tableExtendProps);
31758
31846
  if (isZMax) {
31759
31847
  if (tableExtendProps.maxHeight) {
31760
- tableProps.maxHeight = 'auto';
31848
+ tableProps.maxHeight = '100%';
31761
31849
  } else {
31762
- tableProps.height = 'auto';
31850
+ tableProps.height = '100%';
31763
31851
  }
31764
31852
  }
31765
31853
  if (proxyConfig && isEnableConf(proxyOpts)) {
@@ -32857,7 +32945,7 @@ const gridComponentEmits = [...emits, 'page-change', 'form-submit', 'form-submit
32857
32945
  const topWrapper = refTopWrapper.value;
32858
32946
  const bottomWrapper = refBottomWrapper.value;
32859
32947
  const pagerWrapper = refPagerWrapper.value;
32860
- const parentPaddingSize = isZMax || height !== 'auto' ? 0 : getPaddingTopBottomSize(el.parentNode);
32948
+ const parentPaddingSize = isZMax || !(height === 'auto' || height === '100%') ? 0 : getPaddingTopBottomSize(el.parentNode);
32861
32949
  return parentPaddingSize + getPaddingTopBottomSize(el) + getOffsetHeight(formWrapper) + getOffsetHeight(toolbarWrapper) + getOffsetHeight(topWrapper) + getOffsetHeight(bottomWrapper) + getOffsetHeight(pagerWrapper);
32862
32950
  },
32863
32951
  getParentHeight() {
@@ -34501,7 +34589,6 @@ dynamicApp.component(form_item.name, form_item);
34501
34589
  const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
34502
34590
  const $xeform = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeform', {});
34503
34591
  const formGather = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeformgather', null);
34504
- const defaultSlot = slots.default;
34505
34592
  const formItem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)(createItem($xeform, props));
34506
34593
  const xeformitem = {
34507
34594
  formItem
@@ -34526,6 +34613,7 @@ dynamicApp.component(form_item.name, form_item);
34526
34613
  field
34527
34614
  } = props;
34528
34615
  const span = props.span || ($xeform ? $xeform.props.span : null);
34616
+ const defaultSlot = slots.default;
34529
34617
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
34530
34618
  ref: refElem,
34531
34619
  class: ['vxe-form--gather vxe-form--item-row', formItem.id, span ? `vxe-form--item-col_${span} is--span` : '', className ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(className) ? className({
@@ -36178,7 +36266,7 @@ dynamicApp.component(pulldown.name, pulldown);
36178
36266
 
36179
36267
 
36180
36268
  // 按需加载的组件
36181
- const components = [
36269
+ const all_components = [
36182
36270
  // 功能模块
36183
36271
  VxeTableFilterModule, VxeTableMenuModule, VxeTableEditModule, VxeTableExportModule, VxeTableKeyboardModule, VxeTableValidatorModule, VxeTableCustomModule,
36184
36272
  // 可选组件
@@ -36197,7 +36285,7 @@ function install(app, options) {
36197
36285
  setTheme(options.theme);
36198
36286
  }
36199
36287
  }
36200
- components.forEach(component => component.install(app));
36288
+ all_components.forEach(component => component.install(app));
36201
36289
  }
36202
36290
 
36203
36291
  // Table module