vxe-table 4.20.9 → 4.20.11

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 (39) hide show
  1. package/dist/all.esm.js +339 -204
  2. package/dist/style.css +1 -1
  3. package/es/grid/src/grid.js +252 -161
  4. package/es/style.css +1 -1
  5. package/es/table/module/custom/panel.js +3 -3
  6. package/es/table/module/export/hook.js +53 -33
  7. package/es/table/render/index.js +12 -2
  8. package/es/table/src/table.js +17 -3
  9. package/es/ui/index.js +1 -1
  10. package/es/ui/src/log.js +1 -1
  11. package/lib/grid/src/grid.js +321 -204
  12. package/lib/grid/src/grid.min.js +1 -1
  13. package/lib/index.umd.js +442 -259
  14. package/lib/index.umd.min.js +1 -1
  15. package/lib/style.css +1 -1
  16. package/lib/table/module/custom/panel.js +3 -3
  17. package/lib/table/module/custom/panel.min.js +1 -1
  18. package/lib/table/module/export/hook.js +67 -40
  19. package/lib/table/module/export/hook.min.js +1 -1
  20. package/lib/table/render/index.js +24 -2
  21. package/lib/table/render/index.min.js +1 -1
  22. package/lib/table/src/table.js +3 -3
  23. package/lib/table/src/table.min.js +1 -1
  24. package/lib/ui/index.js +1 -1
  25. package/lib/ui/index.min.js +1 -1
  26. package/lib/ui/src/log.js +1 -1
  27. package/lib/ui/src/log.min.js +1 -1
  28. package/package.json +2 -2
  29. package/packages/grid/src/grid.ts +243 -153
  30. package/packages/table/module/custom/panel.ts +3 -3
  31. package/packages/table/module/export/hook.ts +51 -30
  32. package/packages/table/render/index.ts +12 -2
  33. package/packages/table/src/table.ts +17 -3
  34. /package/es/{iconfont.1785242738274.ttf → iconfont.1786329229929.ttf} +0 -0
  35. /package/es/{iconfont.1785242738274.woff → iconfont.1786329229929.woff} +0 -0
  36. /package/es/{iconfont.1785242738274.woff2 → iconfont.1786329229929.woff2} +0 -0
  37. /package/lib/{iconfont.1785242738274.ttf → iconfont.1786329229929.ttf} +0 -0
  38. /package/lib/{iconfont.1785242738274.woff → iconfont.1786329229929.woff} +0 -0
  39. /package/lib/{iconfont.1785242738274.woff2 → iconfont.1786329229929.woff2} +0 -0
@@ -1219,7 +1219,7 @@ export default defineVxeComponent({
1219
1219
  }, VxeUIRadioGroupComponent
1220
1220
  ? [
1221
1221
  h(VxeUIRadioGroupComponent, {
1222
- modelValue: column.renderAlign || '',
1222
+ modelValue: column.renderAlign || 'left',
1223
1223
  type: 'button',
1224
1224
  strict: false,
1225
1225
  disabled: isHidden,
@@ -1240,7 +1240,7 @@ export default defineVxeComponent({
1240
1240
  : (VxeUIRadioGroupComponent
1241
1241
  ? [
1242
1242
  h(VxeUIRadioGroupComponent, {
1243
- modelValue: column.renderHeaderAlign || '',
1243
+ modelValue: column.renderHeaderAlign || 'left',
1244
1244
  type: 'button',
1245
1245
  strict: false,
1246
1246
  disabled: isHidden,
@@ -1261,7 +1261,7 @@ export default defineVxeComponent({
1261
1261
  : (VxeUIRadioGroupComponent
1262
1262
  ? [
1263
1263
  h(VxeUIRadioGroupComponent, {
1264
- modelValue: column.renderFooterAlign || '',
1264
+ modelValue: column.renderFooterAlign || 'left',
1265
1265
  type: 'button',
1266
1266
  strict: false,
1267
1267
  disabled: isHidden,
@@ -1588,15 +1588,17 @@ hooks.add('tableExportModule', {
1588
1588
  const { computeProxyOpts } = $xeGGWrapper.getComputeMaps();
1589
1589
  const proxyOpts = computeProxyOpts.value;
1590
1590
  const { sortData } = gridReactData;
1591
- const { beforeQueryAll, afterQueryAll, ajax = {} } = proxyOpts;
1591
+ const { beforeQueryAll: oldBeforeQueryAll, afterQueryAll: oldAfterQueryAll, ajax = {} } = proxyOpts;
1592
1592
  const resConfigs = proxyOpts.response || proxyOpts.props || {};
1593
- const ajaxMethods = ajax.queryAll;
1594
- const queryAllSuccessMethods = ajax.queryAllSuccess;
1595
- const queryAllErrorMethods = ajax.queryAllError;
1596
- if (!ajaxMethods) {
1593
+ const beforeQueryAllMethod = ajax.beforeQueryAll;
1594
+ const queryAllMethod = ajax.queryAll;
1595
+ const afterQueryAllMethod = ajax.afterQueryAll;
1596
+ const queryAllSuccessMethod = ajax.queryAllSuccess;
1597
+ const queryAllErrorMethod = ajax.queryAllError;
1598
+ if (!queryAllMethod) {
1597
1599
  errLog('vxe.error.notFunc', ['proxy-config.ajax.queryAll']);
1598
1600
  }
1599
- if (ajaxMethods) {
1601
+ if (queryAllMethod) {
1600
1602
  const params = {
1601
1603
  $table: $xeTable,
1602
1604
  $grid: $xeGrid,
@@ -1607,37 +1609,55 @@ hooks.add('tableExportModule', {
1607
1609
  form: gridReactData.formData,
1608
1610
  options: handleOptions
1609
1611
  };
1610
- return Promise.resolve((beforeQueryAll || ajaxMethods)(params))
1611
- .then(rest => {
1612
- const listProp = resConfigs.list;
1613
- let tdData = [];
1614
- if (listProp) {
1615
- if (XEUtils.isFunction(listProp)) {
1616
- tdData = listProp({ data: rest, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt });
1612
+ const handleQueryAll = () => {
1613
+ return Promise.resolve((oldBeforeQueryAll || queryAllMethod)(params))
1614
+ .then((rest) => {
1615
+ if (afterQueryAllMethod) {
1616
+ afterQueryAllMethod(Object.assign(Object.assign({}, params), { response: rest, status: 'success' }));
1617
1617
  }
1618
1618
  else {
1619
- tdData = XEUtils.isArray(rest) ? rest : XEUtils.get(rest, listProp);
1619
+ const listProp = resConfigs.list;
1620
+ let tdData = [];
1621
+ if (listProp) {
1622
+ if (XEUtils.isFunction(listProp)) {
1623
+ tdData = listProp({ data: rest, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt });
1624
+ }
1625
+ else {
1626
+ tdData = XEUtils.isArray(rest) ? rest : XEUtils.get(rest, listProp);
1627
+ }
1628
+ }
1629
+ else {
1630
+ if (XEUtils.isArray(rest)) {
1631
+ tdData = rest;
1632
+ }
1633
+ }
1634
+ handleOptions.data = tdData;
1635
+ if (oldAfterQueryAll) {
1636
+ oldAfterQueryAll(Object.assign(Object.assign({}, params), { response: rest }));
1637
+ }
1620
1638
  }
1621
- }
1622
- else {
1623
- if (XEUtils.isArray(rest)) {
1624
- tdData = rest;
1639
+ if (queryAllSuccessMethod) {
1640
+ queryAllSuccessMethod(Object.assign(Object.assign({}, params), { response: rest }));
1625
1641
  }
1626
- }
1627
- handleOptions.data = tdData;
1628
- if (afterQueryAll) {
1629
- afterQueryAll(params);
1630
- }
1631
- if (queryAllSuccessMethods) {
1632
- queryAllSuccessMethods(Object.assign(Object.assign({}, params), { response: rest }));
1633
- }
1634
- return handleExport(handleOptions);
1635
- })
1636
- .catch((rest) => {
1637
- if (queryAllErrorMethods) {
1638
- queryAllErrorMethods(Object.assign(Object.assign({}, params), { response: rest }));
1639
- }
1640
- });
1642
+ return handleExport(handleOptions);
1643
+ })
1644
+ .catch((rest) => {
1645
+ if (afterQueryAllMethod) {
1646
+ afterQueryAllMethod(Object.assign(Object.assign({}, params), { response: rest, status: 'error' }));
1647
+ }
1648
+ if (queryAllErrorMethod) {
1649
+ queryAllErrorMethod(Object.assign(Object.assign({}, params), { response: rest }));
1650
+ }
1651
+ });
1652
+ };
1653
+ if (beforeQueryAllMethod) {
1654
+ return Promise.resolve(beforeQueryAllMethod(params)).then(status => {
1655
+ if (status !== false) {
1656
+ return handleQueryAll();
1657
+ }
1658
+ });
1659
+ }
1660
+ return handleQueryAll();
1641
1661
  }
1642
1662
  }
1643
1663
  }
@@ -844,7 +844,12 @@ renderer.mixin({
844
844
  },
845
845
  FormatNumberInput: {
846
846
  renderTableDefault: handleNumberCell,
847
- tableFilterDefaultMethod: handleInputFilterMethod,
847
+ tableFilterDefaultMethod({ option, row, column }) {
848
+ const { data } = option;
849
+ const cellValue = XEUtils.get(row, column.field);
850
+ /* eslint-disable eqeqeq */
851
+ return cellValue == data;
852
+ },
848
853
  tableExportMethod(params) {
849
854
  const { row, column } = params;
850
855
  const cellValue = XEUtils.get(row, column.field);
@@ -896,7 +901,12 @@ renderer.mixin({
896
901
  createTableFilterOptions: defaultFilterOptions,
897
902
  renderTableFilter: defaultFilterRender,
898
903
  renderTableFloatingFilter: defaultFloatingFilterRender,
899
- tableFilterDefaultMethod: handleInputFilterMethod,
904
+ tableFilterDefaultMethod({ option, row, column }) {
905
+ const { data } = option;
906
+ const cellValue = XEUtils.get(row, column.field);
907
+ /* eslint-disable eqeqeq */
908
+ return cellValue == data;
909
+ },
900
910
  tableExportMethod(params) {
901
911
  const { row, column } = params;
902
912
  const cellValue = XEUtils.get(row, column.field);
@@ -3438,7 +3438,7 @@ export default defineVxeComponent({
3438
3438
  return;
3439
3439
  }
3440
3440
  internalData.rsePending = true;
3441
- handleLazyRecalculate(false, true, true, {
3441
+ handleLazyRecalculate(true, true, true, {
3442
3442
  minRunDelay: 200
3443
3443
  }).then(() => {
3444
3444
  internalData.rsePending = false;
@@ -5377,6 +5377,18 @@ export default defineVxeComponent({
5377
5377
  }
5378
5378
  const { editConfig } = props;
5379
5379
  const { formatter, editRender, cellRender } = column;
5380
+ let etOpSize = null;
5381
+ let etOgSize = null;
5382
+ let clOpSize = null;
5383
+ let clOgSize = null;
5384
+ if (editRender) {
5385
+ etOpSize = editRender.options ? editRender.options.length : 0;
5386
+ etOgSize = editRender.optionGroups ? editRender.optionGroups.length : 0;
5387
+ }
5388
+ if (cellRender) {
5389
+ clOpSize = cellRender.options ? cellRender.options.length : 0;
5390
+ clOgSize = cellRender.optionGroups ? cellRender.optionGroups.length : 0;
5391
+ }
5380
5392
  // formatter > tableCellFormatter
5381
5393
  const renderOpts = formatter ? null : (editConfig && isEnableConf(editRender) ? editRender : (isEnableConf(cellRender) ? cellRender : null));
5382
5394
  const compConf = renderOpts ? renderer.get(renderOpts.name) : null;
@@ -5395,7 +5407,8 @@ export default defineVxeComponent({
5395
5407
  formatData = fullAllDataRowIdData[rowid].formatData = {};
5396
5408
  }
5397
5409
  if (rowRest && formatData[colid]) {
5398
- if (formatData[colid].value === cellValue) {
5410
+ const ftValue = formatData[colid].value;
5411
+ if (ftValue && ftValue[0] === cellValue && ftValue[1] === etOpSize && ftValue[2] === etOgSize && ftValue[3] === clOpSize && ftValue[4] === clOgSize) {
5399
5412
  return formatData[colid].label;
5400
5413
  }
5401
5414
  }
@@ -5427,7 +5440,8 @@ export default defineVxeComponent({
5427
5440
  cellLabel = tcFormatter(renderOpts, formatParams);
5428
5441
  }
5429
5442
  if (formatData) {
5430
- formatData[colid] = { value: cellValue, label: cellLabel };
5443
+ const ftValue = [cellValue, etOpSize, etOgSize, clOpSize, clOgSize];
5444
+ formatData[colid] = { value: ftValue, label: cellLabel };
5431
5445
  }
5432
5446
  }
5433
5447
  return cellLabel;
package/es/ui/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  import { getFuncText } from './src/utils';
3
- export const version = "4.20.9";
3
+ export const version = "4.20.11";
4
4
  VxeUI.version = version;
5
5
  VxeUI.tableVersion = version;
6
6
  VxeUI.setConfig({
package/es/ui/src/log.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  const { log } = VxeUI;
3
- const tableVersion = `table v${"4.20.9"}`;
3
+ const tableVersion = `table v${"4.20.11"}`;
4
4
  export function createComponentLog(name) {
5
5
  const uiVersion = VxeUI.uiVersion ? `ui v${VxeUI.uiVersion}` : '';
6
6
  const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : '';