vxe-table 4.23.8 → 4.23.10

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 (126) hide show
  1. package/dist/all.esm.js +5683 -3798
  2. package/es/components.d.ts +1 -0
  3. package/es/components.js +2 -7
  4. package/es/grid/src/emits.js +1 -15
  5. package/es/grid/src/grid.js +397 -120
  6. package/es/index.esm.js +5 -3
  7. package/es/index.js +5 -3
  8. package/es/table/module/custom/hook.js +49 -42
  9. package/es/table/module/custom/panel.js +777 -527
  10. package/es/table/module/edit/hook.js +140 -62
  11. package/es/table/module/export/export-panel.js +399 -316
  12. package/es/table/module/export/hook.js +395 -337
  13. package/es/table/module/export/import-panel.js +152 -123
  14. package/es/table/module/filter/hook.js +16 -2
  15. package/es/table/module/filter/panel.js +146 -84
  16. package/es/table/module/keyboard/hook.js +8 -4
  17. package/es/table/module/menu/panel.js +197 -126
  18. package/es/table/render/index.js +151 -98
  19. package/es/table/src/body.js +355 -233
  20. package/es/table/src/cell.js +426 -269
  21. package/es/table/src/columnInfo.js +1 -0
  22. package/es/table/src/footer.js +144 -99
  23. package/es/table/src/group.js +7 -3
  24. package/es/table/src/header.js +229 -172
  25. package/es/table/src/table.js +1503 -1030
  26. package/es/table/src/util.js +15 -19
  27. package/es/toolbar/src/toolbar.js +132 -75
  28. package/es/ui/index.js +1 -1
  29. package/es/ui/src/dom.js +9 -6
  30. package/es/ui/src/log.js +1 -1
  31. package/es/ui/src/utils.d.ts +1 -1
  32. package/lib/components.js +2 -7
  33. package/lib/grid/src/emits.js +1 -15
  34. package/lib/grid/src/grid.js +397 -120
  35. package/lib/index.common.js +5 -3
  36. package/lib/index.js +5 -3
  37. package/lib/index.umd.js +5652 -3797
  38. package/lib/index.umd.min.js +3 -3
  39. package/lib/table/module/custom/hook.js +49 -42
  40. package/lib/table/module/custom/panel.js +777 -527
  41. package/lib/table/module/edit/hook.js +140 -62
  42. package/lib/table/module/export/export-panel.js +399 -316
  43. package/lib/table/module/export/hook.js +395 -337
  44. package/lib/table/module/export/import-panel.js +152 -123
  45. package/lib/table/module/filter/hook.js +16 -2
  46. package/lib/table/module/filter/panel.js +146 -84
  47. package/lib/table/module/keyboard/hook.js +8 -4
  48. package/lib/table/module/menu/panel.js +197 -126
  49. package/lib/table/render/index.js +151 -98
  50. package/lib/table/src/body.js +355 -233
  51. package/lib/table/src/cell.js +426 -269
  52. package/lib/table/src/columnInfo.js +1 -0
  53. package/lib/table/src/footer.js +144 -99
  54. package/lib/table/src/group.js +7 -3
  55. package/lib/table/src/header.js +229 -172
  56. package/lib/table/src/table.js +1471 -1029
  57. package/lib/table/src/util.js +15 -19
  58. package/lib/toolbar/src/toolbar.js +132 -75
  59. package/lib/ui/index.js +1 -1
  60. package/lib/ui/src/dom.js +9 -6
  61. package/lib/ui/src/log.js +1 -1
  62. package/package.json +2 -2
  63. package/packages/colgroup/index.ts +22 -22
  64. package/packages/column/index.ts +22 -22
  65. package/packages/components.ts +42 -44
  66. package/packages/grid/index.ts +18 -18
  67. package/packages/grid/src/emits.ts +5 -19
  68. package/packages/grid/src/grid.ts +2229 -1925
  69. package/packages/grid/src/props.ts +22 -23
  70. package/packages/index.ts +13 -11
  71. package/packages/locale/lang/fr-FR.ts +15 -15
  72. package/packages/locale/lang/it-IT.ts +4 -4
  73. package/packages/locale/lang/uk-UA.ts +1 -1
  74. package/packages/locale/lang/uz-UZ.ts +13 -13
  75. package/packages/locale/lang/zh-CN.ts +907 -907
  76. package/packages/table/index.ts +26 -26
  77. package/packages/table/module/custom/hook.ts +510 -503
  78. package/packages/table/module/custom/panel.ts +2002 -1743
  79. package/packages/table/module/edit/hook.ts +1224 -1131
  80. package/packages/table/module/export/export-panel.ts +697 -611
  81. package/packages/table/module/export/hook.ts +2160 -2059
  82. package/packages/table/module/export/import-panel.ts +319 -279
  83. package/packages/table/module/export/util.ts +25 -24
  84. package/packages/table/module/filter/hook.ts +519 -501
  85. package/packages/table/module/filter/panel.ts +368 -304
  86. package/packages/table/module/keyboard/hook.ts +498 -494
  87. package/packages/table/module/menu/hook.ts +330 -330
  88. package/packages/table/module/menu/panel.ts +272 -201
  89. package/packages/table/module/validator/hook.ts +653 -635
  90. package/packages/table/render/index.ts +1819 -1744
  91. package/packages/table/src/body.ts +1078 -955
  92. package/packages/table/src/cell.ts +1524 -1359
  93. package/packages/table/src/column.ts +192 -192
  94. package/packages/table/src/columnInfo.ts +232 -232
  95. package/packages/table/src/emits.ts +134 -134
  96. package/packages/table/src/footer.ts +425 -380
  97. package/packages/table/src/group.ts +67 -63
  98. package/packages/table/src/header.ts +642 -581
  99. package/packages/table/src/props.ts +336 -336
  100. package/packages/table/src/store.ts +14 -14
  101. package/packages/table/src/table.ts +16011 -15454
  102. package/packages/table/src/use/cell-view.ts +41 -44
  103. package/packages/table/src/use/index.ts +1 -1
  104. package/packages/table/src/util.ts +1206 -1216
  105. package/packages/toolbar/index.ts +18 -18
  106. package/packages/toolbar/src/toolbar.ts +768 -706
  107. package/packages/ui/index.ts +519 -520
  108. package/packages/ui/src/anime.ts +51 -52
  109. package/packages/ui/src/comp.ts +3 -3
  110. package/packages/ui/src/dom.ts +466 -463
  111. package/packages/ui/src/log.ts +19 -19
  112. package/packages/ui/src/utils.ts +66 -66
  113. package/packages/ui/src/vn.ts +55 -55
  114. package/packages/v-x-e-table/index.d.ts +3 -3
  115. package/packages/v-x-e-table/index.ts +3 -3
  116. package/types/all.d.ts +76 -76
  117. package/types/index.d.ts +4 -4
  118. /package/dist/{iconfont.1793007753347.ttf → iconfont.1793015256719.ttf} +0 -0
  119. /package/dist/{iconfont.1793007753347.woff → iconfont.1793015256719.woff} +0 -0
  120. /package/dist/{iconfont.1793007753347.woff2 → iconfont.1793015256719.woff2} +0 -0
  121. /package/es/{iconfont.1793007753347.ttf → iconfont.1793015256719.ttf} +0 -0
  122. /package/es/{iconfont.1793007753347.woff → iconfont.1793015256719.woff} +0 -0
  123. /package/es/{iconfont.1793007753347.woff2 → iconfont.1793015256719.woff2} +0 -0
  124. /package/lib/{iconfont.1793007753347.ttf → iconfont.1793015256719.ttf} +0 -0
  125. /package/lib/{iconfont.1793007753347.woff → iconfont.1793015256719.woff} +0 -0
  126. /package/lib/{iconfont.1793007753347.woff2 → iconfont.1793015256719.woff2} +0 -0
@@ -263,13 +263,17 @@ function parseXML(tableConf, content) {
263
263
  return { fields, rows };
264
264
  }
265
265
  function clearColumnConvert(columns) {
266
- import_xe_utils.default.eachTree(columns, (column) => {
267
- delete column._level;
268
- delete column._colSpan;
269
- delete column._rowSpan;
270
- delete column._children;
271
- delete column.childNodes;
272
- }, { children: "children" });
266
+ import_xe_utils.default.eachTree(
267
+ columns,
268
+ (column) => {
269
+ delete column._level;
270
+ delete column._colSpan;
271
+ delete column._rowSpan;
272
+ delete column._children;
273
+ delete column.childNodes;
274
+ },
275
+ { children: "children" }
276
+ );
273
277
  }
274
278
  const tableExportMethodKeys = ["exportData", "importByFile", "importData", "saveFile", "readFile", "print", "getPrintHtml", "openImport", "closeImport", "openExport", "closeExport", "openPrint", "closePrint"];
275
279
  hooks.add("tableExportModule", {
@@ -325,136 +329,140 @@ hooks.add("tableExportModule", {
325
329
  const rest = [];
326
330
  const expandMaps = {};
327
331
  const useMaps = {};
328
- import_xe_utils.default.eachTree(datas, (item, $rowIndex, items, path, parentItem, nodes) => {
329
- const row = item._row || item;
330
- const rowid = handleGetRowId(row);
331
- if (useMaps[rowid]) {
332
- return;
333
- }
334
- const parentRow = parentItem && parentItem._row ? parentItem._row : parentItem;
335
- const pRowid = parentRow ? handleGetRowId(parentRow) : "";
336
- if (isRowGroupAllExpanded || !parentRow || expandMaps[pRowid] && $xeTable.isRowExpandByRow(parentRow)) {
337
- const hasRowChild = mapChildrenField && row[mapChildrenField] && row[mapChildrenField].length;
338
- const item2 = {
339
- _row: row,
340
- _level: nodes.length - 1,
341
- _hasChild: hasRowChild,
342
- _expand: hasRowChild && $xeTable.isRowExpandByRow(row)
343
- };
344
- columns.forEach((column, $columnIndex) => {
345
- const { field, editRender, cellRender, aggFunc, rowGroupNode } = column;
346
- let cellValue = "";
347
- const renderOpts = editRender || cellRender;
348
- let bodyExportMethod = column.exportMethod || columnOpts.exportMethod;
349
- if (!bodyExportMethod && renderOpts && renderOpts.name) {
350
- const compConf = rendererOpts[renderOpts.name] || renderer.get(renderOpts.name);
351
- if (compConf) {
352
- bodyExportMethod = compConf.tableExportMethod || compConf.exportMethod;
353
- }
354
- }
355
- if (!bodyExportMethod) {
356
- bodyExportMethod = columnOpts.exportMethod;
357
- }
358
- if (bodyExportMethod) {
359
- cellValue = bodyExportMethod({ $table: $xeTable, row, column, options: opts });
360
- } else {
361
- switch (column.type) {
362
- case "seq": {
363
- const seqVal = path.map((num, i) => i % 2 === 0 ? Number(num) + 1 : ".").join("");
364
- cellValue = expMode === "all" ? seqVal : getSeq(seqVal, row, $rowIndex, column, $columnIndex);
365
- break;
366
- }
367
- case "checkbox": {
368
- cellValue = toBooleanValue($xeTable.isCheckedByCheckboxRow(row));
369
- item2._checkboxLabel = checkboxOpts.labelField ? import_xe_utils.default.get(row, checkboxOpts.labelField) : "";
370
- item2._checkboxDisabled = checkboxOpts.checkMethod && !checkboxOpts.checkMethod({ $table: $xeTable, row });
371
- break;
372
- }
373
- case "radio": {
374
- cellValue = toBooleanValue($xeTable.isCheckedByRadioRow(row));
375
- item2._radioLabel = radioOpts.labelField ? import_xe_utils.default.get(row, radioOpts.labelField) : "";
376
- item2._radioDisabled = radioOpts.checkMethod && !radioOpts.checkMethod({ $table: $xeTable, row });
377
- break;
332
+ import_xe_utils.default.eachTree(
333
+ datas,
334
+ (item, $rowIndex, items, path, parentItem, nodes) => {
335
+ const row = item._row || item;
336
+ const rowid = handleGetRowId(row);
337
+ if (useMaps[rowid]) {
338
+ return;
339
+ }
340
+ const parentRow = parentItem && parentItem._row ? parentItem._row : parentItem;
341
+ const pRowid = parentRow ? handleGetRowId(parentRow) : "";
342
+ if (isRowGroupAllExpanded || !parentRow || expandMaps[pRowid] && $xeTable.isRowExpandByRow(parentRow)) {
343
+ const hasRowChild = mapChildrenField && row[mapChildrenField] && row[mapChildrenField].length;
344
+ const item2 = {
345
+ _row: row,
346
+ _level: nodes.length - 1,
347
+ _hasChild: hasRowChild,
348
+ _expand: hasRowChild && $xeTable.isRowExpandByRow(row)
349
+ };
350
+ columns.forEach((column, $columnIndex) => {
351
+ const { field, editRender, cellRender, aggFunc, rowGroupNode } = column;
352
+ let cellValue = "";
353
+ const renderOpts = editRender || cellRender;
354
+ let bodyExportMethod = column.exportMethod || columnOpts.exportMethod;
355
+ if (!bodyExportMethod && renderOpts && renderOpts.name) {
356
+ const compConf = rendererOpts[renderOpts.name] || renderer.get(renderOpts.name);
357
+ if (compConf) {
358
+ bodyExportMethod = compConf.tableExportMethod || compConf.exportMethod;
378
359
  }
379
- default: {
380
- if (field && row.isAggregate) {
381
- const aggRow = row;
382
- const aggData = aggRow.aggData;
383
- const currAggData = aggData ? aggData[field] : null;
384
- const groupField = aggRow.groupField;
385
- const groupContent = aggRow.groupContent;
386
- const childList = mapChildrenField ? aggRow[mapChildrenField] || [] : [];
387
- const childCount = aggRow.childCount;
388
- const colRest = fullColumnFieldData[groupField] || {};
389
- const ctParams = {
390
- $table: $xeTable,
391
- groupField,
392
- groupColumn: colRest ? colRest.column : null,
393
- column,
394
- groupValue: groupContent,
395
- childList,
396
- childCount,
397
- aggValue: null,
398
- /**
399
- * 已废弃
400
- * @deprecated
401
- */
402
- children: childList,
403
- /**
404
- * 已废弃
405
- * @deprecated
406
- */
407
- totalValue: childCount
408
- };
409
- if (aggMode === "column" ? field === aggRow.groupField : rowGroupNode) {
410
- cellValue = groupContent;
411
- if (contentMethod) {
412
- cellValue = `${contentMethod(ctParams)}`;
413
- }
414
- if (showTotal) {
415
- cellValue = getI18n("vxe.table.rowGroupContentTotal", [cellValue, totalMethod ? totalMethod(ctParams) : childCount, childCount]);
416
- }
417
- } else if ($xeTable.getPivotTableAggregateCellAggValue) {
418
- const aggParams = {
360
+ }
361
+ if (!bodyExportMethod) {
362
+ bodyExportMethod = columnOpts.exportMethod;
363
+ }
364
+ if (bodyExportMethod) {
365
+ cellValue = bodyExportMethod({ $table: $xeTable, row, column, options: opts });
366
+ } else {
367
+ switch (column.type) {
368
+ case "seq": {
369
+ const seqVal = path.map((num, i) => i % 2 === 0 ? Number(num) + 1 : ".").join("");
370
+ cellValue = expMode === "all" ? seqVal : getSeq(seqVal, row, $rowIndex, column, $columnIndex);
371
+ break;
372
+ }
373
+ case "checkbox": {
374
+ cellValue = toBooleanValue($xeTable.isCheckedByCheckboxRow(row));
375
+ item2._checkboxLabel = checkboxOpts.labelField ? import_xe_utils.default.get(row, checkboxOpts.labelField) : "";
376
+ item2._checkboxDisabled = checkboxOpts.checkMethod && !checkboxOpts.checkMethod({ $table: $xeTable, row });
377
+ break;
378
+ }
379
+ case "radio": {
380
+ cellValue = toBooleanValue($xeTable.isCheckedByRadioRow(row));
381
+ item2._radioLabel = radioOpts.labelField ? import_xe_utils.default.get(row, radioOpts.labelField) : "";
382
+ item2._radioDisabled = radioOpts.checkMethod && !radioOpts.checkMethod({ $table: $xeTable, row });
383
+ break;
384
+ }
385
+ default: {
386
+ if (field && row.isAggregate) {
387
+ const aggRow = row;
388
+ const aggData = aggRow.aggData;
389
+ const currAggData = aggData ? aggData[field] : null;
390
+ const groupField = aggRow.groupField;
391
+ const groupContent = aggRow.groupContent;
392
+ const childList = mapChildrenField ? aggRow[mapChildrenField] || [] : [];
393
+ const childCount = aggRow.childCount;
394
+ const colRest = fullColumnFieldData[groupField] || {};
395
+ const ctParams = {
419
396
  $table: $xeTable,
420
- row,
421
- column
397
+ groupField,
398
+ groupColumn: colRest ? colRest.column : null,
399
+ column,
400
+ groupValue: groupContent,
401
+ childList,
402
+ childCount,
403
+ aggValue: null,
404
+ /**
405
+ * 已废弃
406
+ * @deprecated
407
+ */
408
+ children: childList,
409
+ /**
410
+ * 已废弃
411
+ * @deprecated
412
+ */
413
+ totalValue: childCount
422
414
  };
423
- cellValue = $xeTable.getPivotTableAggregateCellAggValue(aggParams);
424
- } else if (aggFunc === true || countFields && countFields.includes(field)) {
425
- cellValue = currAggData ? currAggData.value : childCount;
426
- ctParams.aggValue = cellValue;
427
- if (formatValuesMethod) {
428
- cellValue = formatValuesMethod(ctParams);
415
+ if (aggMode === "column" ? field === aggRow.groupField : rowGroupNode) {
416
+ cellValue = groupContent;
417
+ if (contentMethod) {
418
+ cellValue = `${contentMethod(ctParams)}`;
419
+ }
420
+ if (showTotal) {
421
+ cellValue = getI18n("vxe.table.rowGroupContentTotal", [cellValue, totalMethod ? totalMethod(ctParams) : childCount, childCount]);
422
+ }
423
+ } else if ($xeTable.getPivotTableAggregateCellAggValue) {
424
+ const aggParams = {
425
+ $table: $xeTable,
426
+ row,
427
+ column
428
+ };
429
+ cellValue = $xeTable.getPivotTableAggregateCellAggValue(aggParams);
430
+ } else if (aggFunc === true || countFields && countFields.includes(field)) {
431
+ cellValue = currAggData ? currAggData.value : childCount;
432
+ ctParams.aggValue = cellValue;
433
+ if (formatValuesMethod) {
434
+ cellValue = formatValuesMethod(ctParams);
435
+ }
429
436
  }
430
- }
431
- } else if (opts.original) {
432
- cellValue = (0, import_util.getCellValue)(row, column);
433
- } else {
434
- cellValue = $xeTable.getCellLabel(row, column);
435
- if (column.type === "html") {
436
- htmlCellElem.innerHTML = cellValue;
437
- cellValue = htmlCellElem.innerText.trim();
437
+ } else if (opts.original) {
438
+ cellValue = (0, import_util.getCellValue)(row, column);
438
439
  } else {
439
- const cell = $xeTable.getCellElement(row, column);
440
- if (cell && !(0, import_dom.hasClass)(cell, "is--progress")) {
441
- cellValue = cell.innerText.trim();
440
+ cellValue = $xeTable.getCellLabel(row, column);
441
+ if (column.type === "html") {
442
+ htmlCellElem.innerHTML = cellValue;
443
+ cellValue = htmlCellElem.innerText.trim();
444
+ } else {
445
+ const cell = $xeTable.getCellElement(row, column);
446
+ if (cell && !(0, import_dom.hasClass)(cell, "is--progress")) {
447
+ cellValue = cell.innerText.trim();
448
+ }
442
449
  }
443
450
  }
451
+ break;
444
452
  }
445
- break;
446
453
  }
447
454
  }
455
+ item2[column.id] = toStringValue(cellValue);
456
+ });
457
+ useMaps[rowid] = true;
458
+ if (pRowid) {
459
+ expandMaps[pRowid] = true;
448
460
  }
449
- item2[column.id] = toStringValue(cellValue);
450
- });
451
- useMaps[rowid] = true;
452
- if (pRowid) {
453
- expandMaps[pRowid] = true;
461
+ rest.push(Object.assign(item2, row));
454
462
  }
455
- rest.push(Object.assign(item2, row));
456
- }
457
- }, { children: mapChildrenField });
463
+ },
464
+ { children: mapChildrenField }
465
+ );
458
466
  return rest;
459
467
  }
460
468
  if (treeConfig) {
@@ -463,84 +471,88 @@ hooks.add("tableExportModule", {
463
471
  const rest = [];
464
472
  const expandMaps = {};
465
473
  const useMaps = {};
466
- import_xe_utils.default.eachTree(datas, (item, $rowIndex, items, path, parentItem, nodes) => {
467
- const row = item._row || item;
468
- const rowid = handleGetRowId(row);
469
- if (useMaps[rowid]) {
470
- return;
471
- }
472
- const parentRow = parentItem && parentItem._row ? parentItem._row : parentItem;
473
- const pRowid = parentRow ? handleGetRowId(parentRow) : "";
474
- if (isTreeAllExpanded || !parentRow || expandMaps[pRowid] && $xeTable.isTreeExpandByRow(parentRow)) {
475
- const hasRowChild = row[childrenField] && row[childrenField].length;
476
- const item2 = {
477
- _row: row,
478
- _level: nodes.length - 1,
479
- _hasChild: hasRowChild,
480
- _expand: hasRowChild && $xeTable.isTreeExpandByRow(row)
481
- };
482
- const rowRest = fullAllDataRowIdData[rowid] || {};
483
- columns.forEach((column, $columnIndex) => {
484
- let cellValue = "";
485
- const renderOpts = column.editRender || column.cellRender;
486
- let bodyExportMethod = column.exportMethod || columnOpts.exportMethod;
487
- if (!bodyExportMethod && renderOpts && renderOpts.name) {
488
- const compConf = rendererOpts[renderOpts.name] || renderer.get(renderOpts.name);
489
- if (compConf) {
490
- bodyExportMethod = compConf.tableExportMethod || compConf.exportMethod;
474
+ import_xe_utils.default.eachTree(
475
+ datas,
476
+ (item, $rowIndex, items, path, parentItem, nodes) => {
477
+ const row = item._row || item;
478
+ const rowid = handleGetRowId(row);
479
+ if (useMaps[rowid]) {
480
+ return;
481
+ }
482
+ const parentRow = parentItem && parentItem._row ? parentItem._row : parentItem;
483
+ const pRowid = parentRow ? handleGetRowId(parentRow) : "";
484
+ if (isTreeAllExpanded || !parentRow || expandMaps[pRowid] && $xeTable.isTreeExpandByRow(parentRow)) {
485
+ const hasRowChild = row[childrenField] && row[childrenField].length;
486
+ const item2 = {
487
+ _row: row,
488
+ _level: nodes.length - 1,
489
+ _hasChild: hasRowChild,
490
+ _expand: hasRowChild && $xeTable.isTreeExpandByRow(row)
491
+ };
492
+ const rowRest = fullAllDataRowIdData[rowid] || {};
493
+ columns.forEach((column, $columnIndex) => {
494
+ let cellValue = "";
495
+ const renderOpts = column.editRender || column.cellRender;
496
+ let bodyExportMethod = column.exportMethod || columnOpts.exportMethod;
497
+ if (!bodyExportMethod && renderOpts && renderOpts.name) {
498
+ const compConf = rendererOpts[renderOpts.name] || renderer.get(renderOpts.name);
499
+ if (compConf) {
500
+ bodyExportMethod = compConf.tableExportMethod || compConf.exportMethod;
501
+ }
491
502
  }
492
- }
493
- if (!bodyExportMethod) {
494
- bodyExportMethod = columnOpts.exportMethod;
495
- }
496
- if (bodyExportMethod) {
497
- cellValue = bodyExportMethod({ $table: $xeTable, row, column, options: opts });
498
- } else {
499
- switch (column.type) {
500
- case "seq": {
501
- let seqVal = path.map((num, i) => i % 2 === 0 ? Number(num) + 1 : ".").join("");
502
- if (seqMode === "increasing") {
503
- seqVal = rowRest ? rowRest._index + 1 : -1;
503
+ if (!bodyExportMethod) {
504
+ bodyExportMethod = columnOpts.exportMethod;
505
+ }
506
+ if (bodyExportMethod) {
507
+ cellValue = bodyExportMethod({ $table: $xeTable, row, column, options: opts });
508
+ } else {
509
+ switch (column.type) {
510
+ case "seq": {
511
+ let seqVal = path.map((num, i) => i % 2 === 0 ? Number(num) + 1 : ".").join("");
512
+ if (seqMode === "increasing") {
513
+ seqVal = rowRest ? rowRest._index + 1 : -1;
514
+ }
515
+ cellValue = expMode === "all" ? seqVal : getSeq(seqVal, row, $rowIndex, column, $columnIndex);
516
+ break;
504
517
  }
505
- cellValue = expMode === "all" ? seqVal : getSeq(seqVal, row, $rowIndex, column, $columnIndex);
506
- break;
507
- }
508
- case "checkbox":
509
- cellValue = toBooleanValue($xeTable.isCheckedByCheckboxRow(row));
510
- item2._checkboxLabel = checkboxOpts.labelField ? import_xe_utils.default.get(row, checkboxOpts.labelField) : "";
511
- item2._checkboxDisabled = checkboxOpts.checkMethod && !checkboxOpts.checkMethod({ $table: $xeTable, row });
512
- break;
513
- case "radio":
514
- cellValue = toBooleanValue($xeTable.isCheckedByRadioRow(row));
515
- item2._radioLabel = radioOpts.labelField ? import_xe_utils.default.get(row, radioOpts.labelField) : "";
516
- item2._radioDisabled = radioOpts.checkMethod && !radioOpts.checkMethod({ $table: $xeTable, row });
517
- break;
518
- default:
519
- if (opts.original) {
520
- cellValue = (0, import_util.getCellValue)(row, column);
521
- } else {
522
- cellValue = $xeTable.getCellLabel(row, column);
523
- if (column.type === "html") {
524
- htmlCellElem.innerHTML = cellValue;
525
- cellValue = htmlCellElem.innerText.trim();
518
+ case "checkbox":
519
+ cellValue = toBooleanValue($xeTable.isCheckedByCheckboxRow(row));
520
+ item2._checkboxLabel = checkboxOpts.labelField ? import_xe_utils.default.get(row, checkboxOpts.labelField) : "";
521
+ item2._checkboxDisabled = checkboxOpts.checkMethod && !checkboxOpts.checkMethod({ $table: $xeTable, row });
522
+ break;
523
+ case "radio":
524
+ cellValue = toBooleanValue($xeTable.isCheckedByRadioRow(row));
525
+ item2._radioLabel = radioOpts.labelField ? import_xe_utils.default.get(row, radioOpts.labelField) : "";
526
+ item2._radioDisabled = radioOpts.checkMethod && !radioOpts.checkMethod({ $table: $xeTable, row });
527
+ break;
528
+ default:
529
+ if (opts.original) {
530
+ cellValue = (0, import_util.getCellValue)(row, column);
526
531
  } else {
527
- const cell = $xeTable.getCellElement(row, column);
528
- if (cell && !(0, import_dom.hasClass)(cell, "is--progress")) {
529
- cellValue = cell.innerText.trim();
532
+ cellValue = $xeTable.getCellLabel(row, column);
533
+ if (column.type === "html") {
534
+ htmlCellElem.innerHTML = cellValue;
535
+ cellValue = htmlCellElem.innerText.trim();
536
+ } else {
537
+ const cell = $xeTable.getCellElement(row, column);
538
+ if (cell && !(0, import_dom.hasClass)(cell, "is--progress")) {
539
+ cellValue = cell.innerText.trim();
540
+ }
530
541
  }
531
542
  }
532
- }
543
+ }
533
544
  }
545
+ item2[column.id] = toStringValue(cellValue);
546
+ });
547
+ useMaps[rowid] = true;
548
+ if (pRowid) {
549
+ expandMaps[pRowid] = true;
534
550
  }
535
- item2[column.id] = toStringValue(cellValue);
536
- });
537
- useMaps[rowid] = true;
538
- if (pRowid) {
539
- expandMaps[pRowid] = true;
551
+ rest.push(Object.assign(item2, row));
540
552
  }
541
- rest.push(Object.assign(item2, row));
542
- }
543
- }, { children: childrenField });
553
+ },
554
+ { children: childrenField }
555
+ );
544
556
  return rest;
545
557
  }
546
558
  return datas.map((row, $rowIndex) => {
@@ -713,13 +725,17 @@ hooks.add("tableExportModule", {
713
725
  }
714
726
  let childWidth = 0;
715
727
  let countChild = 0;
716
- import_xe_utils.default.eachTree([column], (item) => {
717
- if (!item.childNodes || !column.childNodes.length) {
718
- countChild++;
719
- }
720
- const ptWidth = printWidthMaps[item.id];
721
- childWidth += ptWidth || 0;
722
- }, { children: "childNodes" });
728
+ import_xe_utils.default.eachTree(
729
+ [column],
730
+ (item) => {
731
+ if (!item.childNodes || !column.childNodes.length) {
732
+ countChild++;
733
+ }
734
+ const ptWidth = printWidthMaps[item.id];
735
+ childWidth += ptWidth || 0;
736
+ },
737
+ { children: "childNodes" }
738
+ );
723
739
  const colWidth = childWidth - countChild;
724
740
  colWidthMaps[column.id] = colWidth;
725
741
  printWidthMaps[column.id] = import_xe_utils.default.floor(colWidth / tableWidth * 180, 2);
@@ -763,19 +779,8 @@ hooks.add("tableExportModule", {
763
779
  return colWidthMaps[column.id] ? "width:" + (0, import_dom.toCssUnit)(colWidthMaps[column.id]) : "";
764
780
  };
765
781
  const allCls = "check-all";
766
- const clss = [
767
- "vxe-table",
768
- `border--${toTableBorder(border)}`,
769
- isPrint ? "is--print" : "",
770
- isAutoWidth ? "is--auto-width" : "",
771
- isScaleWidth ? "is--scale-width" : "",
772
- isDefaultWidth ? "is--default-width" : "",
773
- isHeader ? "is--header" : ""
774
- ].filter((cls) => cls);
775
- const tables = [
776
- `<table class="${clss.join(" ")}" border="0" cellspacing="0" cellpadding="0">`,
777
- `<colgroup>${columns.map((column) => `<col style="${getHeaderWidthStyle(column)}">`).join("")}</colgroup>`
778
- ];
782
+ const clss = ["vxe-table", `border--${toTableBorder(border)}`, isPrint ? "is--print" : "", isAutoWidth ? "is--auto-width" : "", isScaleWidth ? "is--scale-width" : "", isDefaultWidth ? "is--default-width" : "", isHeader ? "is--header" : ""].filter((cls) => cls);
783
+ const tables = [`<table class="${clss.join(" ")}" border="0" cellspacing="0" cellpadding="0">`, `<colgroup>${columns.map((column) => `<col style="${getHeaderWidthStyle(column)}">`).join("")}</colgroup>`];
779
784
  if (isHeader) {
780
785
  tables.push("<thead>");
781
786
  if (isColgroup && !original) {
@@ -1221,17 +1226,20 @@ hooks.add("tableExportModule", {
1221
1226
  const proxyOpts = $xeGGWrapper ? $xeGGWrapper.getComputeMaps().computeProxyOpts.value : {};
1222
1227
  const hasFooter = !!footerTableData.length;
1223
1228
  const hasMerge = !!(mergeBodyList.length || mergeFooterList.length);
1224
- const defOpts = Object.assign({
1225
- message: true,
1226
- isHeader: showHeader,
1227
- isTitle: showHeader,
1228
- isFooter: showFooter,
1229
- isColgroup: isGroup,
1230
- isMerge: hasMerge,
1231
- useStyle: true,
1232
- current: "current",
1233
- modes: (proxyOpts.ajax && proxyOpts.ajax.queryAll ? ["all"] : []).concat(["current", "selected", "empty"])
1234
- }, options);
1229
+ const defOpts = Object.assign(
1230
+ {
1231
+ message: true,
1232
+ isHeader: showHeader,
1233
+ isTitle: showHeader,
1234
+ isFooter: showFooter,
1235
+ isColgroup: isGroup,
1236
+ isMerge: hasMerge,
1237
+ useStyle: true,
1238
+ current: "current",
1239
+ modes: (proxyOpts.ajax && proxyOpts.ajax.queryAll ? ["all"] : []).concat(["current", "selected", "empty"])
1240
+ },
1241
+ options
1242
+ );
1235
1243
  if (import_xe_utils.default.isBoolean(defOpts.isAllExpand)) {
1236
1244
  warnLog("vxe.error.delProp", ["isAllExpand", "isTreeAllExpanded"]);
1237
1245
  defOpts.isTreeAllExpanded = defOpts.isAllExpand;
@@ -1306,9 +1314,13 @@ hooks.add("tableExportModule", {
1306
1314
  exportStore.isPrint = !!isPrint;
1307
1315
  exportStore.hasColgroup = isGroup;
1308
1316
  exportStore.visible = true;
1309
- Object.assign(exportParams, {
1310
- mode: selectRecords.length ? "selected" : "current"
1311
- }, defOpts);
1317
+ Object.assign(
1318
+ exportParams,
1319
+ {
1320
+ mode: selectRecords.length ? "selected" : "current"
1321
+ },
1322
+ defOpts
1323
+ );
1312
1324
  const { filename, sheetName, mode, type } = exportParams;
1313
1325
  if (filename) {
1314
1326
  if (import_xe_utils.default.isFunction(filename)) {
@@ -1370,32 +1382,36 @@ hooks.add("tableExportModule", {
1370
1382
  const treeOpts = computeTreeOpts.value;
1371
1383
  const proxyOpts = $xeGGWrapper ? $xeGGWrapper.getComputeMaps().computeProxyOpts.value : {};
1372
1384
  const hasMerge = !!(mergeBodyList.length || mergeFooterList.length);
1373
- const opts = Object.assign({
1374
- message: true,
1375
- isHeader: showHeader,
1376
- isTitle: showHeader,
1377
- isFooter: showFooter,
1378
- isColgroup: isGroup,
1379
- isMerge: hasMerge,
1380
- useStyle: true,
1381
- current: "current",
1382
- modes: (proxyOpts.ajax && proxyOpts.ajax.queryAll ? ["all"] : []).concat(["current", "selected", "empty"]),
1383
- download: true,
1384
- type: "csv"
1385
- // filename: '',
1386
- // sheetName: '',
1387
- // original: false,
1388
- // isTreeAllExpanded: false,
1389
- // isRowGroupAllExpanded: false,
1390
- // data: null,
1391
- // remote: false,
1392
- // dataFilterMethod: null,
1393
- // footerFilterMethod: null,
1394
- // exportMethod: null,
1395
- // columnFilterMethod: null,
1396
- // beforeExportMethod: null,
1397
- // afterExportMethod: null
1398
- }, exportOpts, options);
1385
+ const opts = Object.assign(
1386
+ {
1387
+ message: true,
1388
+ isHeader: showHeader,
1389
+ isTitle: showHeader,
1390
+ isFooter: showFooter,
1391
+ isColgroup: isGroup,
1392
+ isMerge: hasMerge,
1393
+ useStyle: true,
1394
+ current: "current",
1395
+ modes: (proxyOpts.ajax && proxyOpts.ajax.queryAll ? ["all"] : []).concat(["current", "selected", "empty"]),
1396
+ download: true,
1397
+ type: "csv"
1398
+ // filename: '',
1399
+ // sheetName: '',
1400
+ // original: false,
1401
+ // isTreeAllExpanded: false,
1402
+ // isRowGroupAllExpanded: false,
1403
+ // data: null,
1404
+ // remote: false,
1405
+ // dataFilterMethod: null,
1406
+ // footerFilterMethod: null,
1407
+ // exportMethod: null,
1408
+ // columnFilterMethod: null,
1409
+ // beforeExportMethod: null,
1410
+ // afterExportMethod: null
1411
+ },
1412
+ exportOpts,
1413
+ options
1414
+ );
1399
1415
  if (import_xe_utils.default.isBoolean(opts.isAllExpand)) {
1400
1416
  warnLog("vxe.error.delProp", ["isAllExpand", "isTreeAllExpanded"]);
1401
1417
  opts.isTreeAllExpanded = opts.isAllExpand;
@@ -1434,23 +1450,27 @@ hooks.add("tableExportModule", {
1434
1450
  isCustomCol = true;
1435
1451
  customCols = import_xe_utils.default.searchTree(columns, () => true, { children: "children", mapChildren: "childNodes", original: true });
1436
1452
  } else {
1437
- customCols = import_xe_utils.default.searchTree(collectColumn, (column) => {
1438
- const isColGroup = column.children && column.children.length > 0;
1439
- let isChecked = false;
1440
- const isExtraChecked = extraFdMaps[column.field];
1441
- if (columns) {
1442
- isChecked = handleFilterColumns(opts, column, columns);
1443
- } else if (excludeFields || includeFields) {
1444
- isChecked = handleFilterFields(opts, column, includeFields, includeFdMaps, excludeFdMaps, extraFdMaps);
1445
- } else {
1446
- if (isExtraChecked) {
1447
- isChecked = true;
1453
+ customCols = import_xe_utils.default.searchTree(
1454
+ collectColumn,
1455
+ (column) => {
1456
+ const isColGroup = column.children && column.children.length > 0;
1457
+ let isChecked = false;
1458
+ const isExtraChecked = extraFdMaps[column.field];
1459
+ if (columns) {
1460
+ isChecked = handleFilterColumns(opts, column, columns);
1461
+ } else if (excludeFields || includeFields) {
1462
+ isChecked = handleFilterFields(opts, column, includeFields, includeFdMaps, excludeFdMaps, extraFdMaps);
1448
1463
  } else {
1449
- isChecked = column.visible && (isColGroup || defaultFilterExportColumn(column));
1464
+ if (isExtraChecked) {
1465
+ isChecked = true;
1466
+ } else {
1467
+ isChecked = column.visible && (isColGroup || defaultFilterExportColumn(column));
1468
+ }
1450
1469
  }
1451
- }
1452
- return isChecked;
1453
- }, { children: "children", mapChildren: "childNodes", original: true });
1470
+ return isChecked;
1471
+ },
1472
+ { children: "children", mapChildren: "childNodes", original: true }
1473
+ );
1454
1474
  }
1455
1475
  const handleOptions = Object.assign({}, opts, { filename: "", sheetName: "", _columnConfs: columns });
1456
1476
  if (!isCustomCol && !columnFilterMethod) {
@@ -1460,33 +1480,37 @@ hooks.add("tableExportModule", {
1460
1480
  if (customCols) {
1461
1481
  handleOptions._isCustomColumn = true;
1462
1482
  groups = import_xe_utils.default.searchTree(
1463
- import_xe_utils.default.mapTree(customCols, (item) => {
1464
- let targetColumn;
1465
- if (item) {
1466
- if ((0, import_util.isColumnInfo)(item)) {
1467
- targetColumn = item;
1468
- } else if (import_xe_utils.default.isString(item)) {
1469
- targetColumn = $xeTable.getColumnByField(item);
1470
- } else {
1471
- const colid = item.id || item.colId;
1472
- const type2 = item.type;
1473
- const field = item.field;
1474
- if (colid) {
1475
- targetColumn = $xeTable.getColumnById(colid);
1476
- } else if (field && type2) {
1477
- targetColumn = tableFullColumn.find((column) => column.field === field && column.type === type2);
1478
- } else if (field) {
1479
- targetColumn = $xeTable.getColumnByField(field);
1480
- } else if (type2) {
1481
- targetColumn = tableFullColumn.find((column) => column.type === type2);
1483
+ import_xe_utils.default.mapTree(
1484
+ customCols,
1485
+ (item) => {
1486
+ let targetColumn;
1487
+ if (item) {
1488
+ if ((0, import_util.isColumnInfo)(item)) {
1489
+ targetColumn = item;
1490
+ } else if (import_xe_utils.default.isString(item)) {
1491
+ targetColumn = $xeTable.getColumnByField(item);
1492
+ } else {
1493
+ const colid = item.id || item.colId;
1494
+ const type2 = item.type;
1495
+ const field = item.field;
1496
+ if (colid) {
1497
+ targetColumn = $xeTable.getColumnById(colid);
1498
+ } else if (field && type2) {
1499
+ targetColumn = tableFullColumn.find((column) => column.field === field && column.type === type2);
1500
+ } else if (field) {
1501
+ targetColumn = $xeTable.getColumnByField(field);
1502
+ } else if (type2) {
1503
+ targetColumn = tableFullColumn.find((column) => column.type === type2);
1504
+ }
1482
1505
  }
1506
+ return targetColumn || {};
1483
1507
  }
1484
- return targetColumn || {};
1508
+ },
1509
+ {
1510
+ children: "childNodes",
1511
+ mapChildren: "_children"
1485
1512
  }
1486
- }, {
1487
- children: "childNodes",
1488
- mapChildren: "_children"
1489
- }),
1513
+ ),
1490
1514
  (column, index) => (0, import_util.isColumnInfo)(column) && (!columnFilterMethod || columnFilterMethod({ $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt, column, $columnIndex: index })),
1491
1515
  {
1492
1516
  children: "_children",
@@ -1495,15 +1519,23 @@ hooks.add("tableExportModule", {
1495
1519
  }
1496
1520
  );
1497
1521
  } else {
1498
- groups = import_xe_utils.default.searchTree(isGroup ? collectColumn : tableFullColumn, (column, index) => column.visible && (!columnFilterMethod || columnFilterMethod({ $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt, column, $columnIndex: index })), { children: "children", mapChildren: "childNodes", original: true });
1522
+ groups = import_xe_utils.default.searchTree(isGroup ? collectColumn : tableFullColumn, (column, index) => column.visible && (!columnFilterMethod || columnFilterMethod({ $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt, column, $columnIndex: index })), {
1523
+ children: "children",
1524
+ mapChildren: "childNodes",
1525
+ original: true
1526
+ });
1499
1527
  }
1500
1528
  const cols = [];
1501
- import_xe_utils.default.eachTree(groups, (column) => {
1502
- const isColGroup = column.children && column.children.length;
1503
- if (!isColGroup) {
1504
- cols.push(column);
1505
- }
1506
- }, { children: "childNodes" });
1529
+ import_xe_utils.default.eachTree(
1530
+ groups,
1531
+ (column) => {
1532
+ const isColGroup = column.children && column.children.length;
1533
+ if (!isColGroup) {
1534
+ cols.push(column);
1535
+ }
1536
+ },
1537
+ { children: "childNodes" }
1538
+ );
1507
1539
  handleOptions.columns = cols;
1508
1540
  handleOptions.colgroups = convertToRows(groups);
1509
1541
  if (filename) {
@@ -1668,11 +1700,15 @@ hooks.add("tableExportModule", {
1668
1700
  },
1669
1701
  importData(options) {
1670
1702
  const importOpts = computeImportOpts.value;
1671
- const opts = Object.assign({
1672
- types: import_xe_utils.default.keys(importOpts._typeMaps)
1673
- // beforeImportMethod: null,
1674
- // afterImportMethod: null
1675
- }, importOpts, options);
1703
+ const opts = Object.assign(
1704
+ {
1705
+ types: import_xe_utils.default.keys(importOpts._typeMaps)
1706
+ // beforeImportMethod: null,
1707
+ // afterImportMethod: null
1708
+ },
1709
+ importOpts,
1710
+ options
1711
+ );
1676
1712
  const { beforeImportMethod, afterImportMethod } = opts;
1677
1713
  if (beforeImportMethod) {
1678
1714
  const biRest = beforeImportMethod({ options: opts, $table: $xeTable });
@@ -1705,15 +1741,20 @@ hooks.add("tableExportModule", {
1705
1741
  const $xeGrid = $xeTable.xeGrid;
1706
1742
  const $xeGantt = $xeTable.xeGantt;
1707
1743
  const printOpts = computePrintOpts.value;
1708
- const opts = Object.assign({
1709
- original: false
1710
- // beforePrintMethod
1711
- }, printOpts, options, {
1712
- type: "html",
1713
- download: false,
1714
- remote: false,
1715
- print: true
1716
- });
1744
+ const opts = Object.assign(
1745
+ {
1746
+ original: false
1747
+ // beforePrintMethod
1748
+ },
1749
+ printOpts,
1750
+ options,
1751
+ {
1752
+ type: "html",
1753
+ download: false,
1754
+ remote: false,
1755
+ print: true
1756
+ }
1757
+ );
1717
1758
  const { sheetName } = opts;
1718
1759
  let printTitle = "";
1719
1760
  if (sheetName) {
@@ -1824,15 +1865,20 @@ hooks.add("tableExportModule", {
1824
1865
  },
1825
1866
  getPrintHtml(options) {
1826
1867
  const printOpts = computePrintOpts.value;
1827
- const opts = Object.assign({
1828
- original: false
1829
- // beforePrintMethod
1830
- }, printOpts, options, {
1831
- type: "html",
1832
- download: false,
1833
- remote: false,
1834
- print: true
1835
- });
1868
+ const opts = Object.assign(
1869
+ {
1870
+ original: false
1871
+ // beforePrintMethod
1872
+ },
1873
+ printOpts,
1874
+ options,
1875
+ {
1876
+ type: "html",
1877
+ download: false,
1878
+ remote: false,
1879
+ print: true
1880
+ }
1881
+ );
1836
1882
  return $xeTable.exportData(opts).then(({ content }) => {
1837
1883
  return {
1838
1884
  html: content
@@ -1849,12 +1895,16 @@ hooks.add("tableExportModule", {
1849
1895
  const { treeConfig, importConfig } = props;
1850
1896
  const { initStore, importStore, importParams } = reactData;
1851
1897
  const importOpts = computeImportOpts.value;
1852
- const defOpts = Object.assign({
1853
- mode: "insertTop",
1854
- message: true,
1855
- types: import_xe_utils.default.keys(importOpts._typeMaps),
1856
- modes: ["insertTop", "covering"]
1857
- }, importOpts, options);
1898
+ const defOpts = Object.assign(
1899
+ {
1900
+ mode: "insertTop",
1901
+ message: true,
1902
+ types: import_xe_utils.default.keys(importOpts._typeMaps),
1903
+ modes: ["insertTop", "covering"]
1904
+ },
1905
+ importOpts,
1906
+ options
1907
+ );
1858
1908
  const types = defOpts.types || [];
1859
1909
  const modes = defOpts.modes || [];
1860
1910
  const isTree = !!treeConfig;
@@ -1905,10 +1955,14 @@ hooks.add("tableExportModule", {
1905
1955
  openExport(options) {
1906
1956
  const { exportConfig } = props;
1907
1957
  const exportOpts = computeExportOpts.value;
1908
- const defOpts = Object.assign({
1909
- message: true,
1910
- types: import_xe_utils.default.keys(exportOpts._typeMaps)
1911
- }, exportOpts, options);
1958
+ const defOpts = Object.assign(
1959
+ {
1960
+ message: true,
1961
+ types: import_xe_utils.default.keys(exportOpts._typeMaps)
1962
+ },
1963
+ exportOpts,
1964
+ options
1965
+ );
1912
1966
  if (!(0, import_utils.hasEnableConf)(exportConfig, exportOpts)) {
1913
1967
  errLog("vxe.error.reqProp", ["export-config"]);
1914
1968
  }
@@ -1918,9 +1972,13 @@ hooks.add("tableExportModule", {
1918
1972
  openPrint(options) {
1919
1973
  const { printConfig } = props;
1920
1974
  const printOpts = computePrintOpts.value;
1921
- const defOpts = Object.assign({
1922
- message: true
1923
- }, printOpts, options);
1975
+ const defOpts = Object.assign(
1976
+ {
1977
+ message: true
1978
+ },
1979
+ printOpts,
1980
+ options
1981
+ );
1924
1982
  if (!(0, import_utils.hasEnableConf)(printConfig, printOpts)) {
1925
1983
  errLog("vxe.error.reqProp", ["print-config"]);
1926
1984
  }