vxe-table 4.23.7 → 4.23.9

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 (148) hide show
  1. package/dist/all.esm.js +5859 -4018
  2. package/es/colgroup/index.js +1 -1
  3. package/es/column/index.js +1 -1
  4. package/es/components.d.ts +3 -0
  5. package/es/components.js +4 -8
  6. package/es/grid/index.js +1 -1
  7. package/es/grid/src/emits.js +1 -15
  8. package/es/grid/src/grid.js +398 -121
  9. package/es/grid/src/props.js +1 -1
  10. package/es/index.esm.js +6 -0
  11. package/es/index.js +6 -0
  12. package/es/table/index.js +1 -1
  13. package/es/table/module/custom/hook.js +50 -43
  14. package/es/table/module/custom/panel.js +778 -528
  15. package/es/table/module/edit/hook.js +141 -63
  16. package/es/table/module/export/export-panel.js +400 -317
  17. package/es/table/module/export/hook.js +396 -338
  18. package/es/table/module/export/import-panel.js +153 -124
  19. package/es/table/module/filter/hook.js +17 -3
  20. package/es/table/module/filter/panel.js +147 -85
  21. package/es/table/module/keyboard/hook.js +9 -5
  22. package/es/table/module/menu/hook.js +1 -1
  23. package/es/table/module/menu/panel.js +198 -127
  24. package/es/table/module/validator/hook.js +1 -1
  25. package/es/table/render/index.js +152 -99
  26. package/es/table/src/body.js +356 -234
  27. package/es/table/src/cell.js +427 -270
  28. package/es/table/src/columnInfo.js +2 -1
  29. package/es/table/src/footer.js +145 -100
  30. package/es/table/src/group.js +7 -3
  31. package/es/table/src/header.js +230 -173
  32. package/es/table/src/props.js +1 -1
  33. package/es/table/src/table.js +1504 -1031
  34. package/es/table/src/util.js +15 -19
  35. package/es/toolbar/index.js +1 -1
  36. package/es/toolbar/src/toolbar.js +133 -76
  37. package/es/ui/index.d.ts +0 -1
  38. package/es/ui/index.js +1 -2
  39. package/es/ui/src/dom.js +9 -6
  40. package/es/ui/src/log.js +1 -1
  41. package/es/ui/src/utils.d.ts +1 -1
  42. package/es/v-x-e-table/index.d.ts +0 -1
  43. package/es/v-x-e-table/index.js +0 -1
  44. package/lib/colgroup/index.js +5 -5
  45. package/lib/column/index.js +5 -5
  46. package/lib/components.js +8 -12
  47. package/lib/grid/index.js +4 -4
  48. package/lib/grid/src/emits.js +1 -15
  49. package/lib/grid/src/grid.js +419 -142
  50. package/lib/grid/src/props.js +2 -2
  51. package/lib/index.common.js +6 -0
  52. package/lib/index.js +6 -0
  53. package/lib/index.umd.js +5825 -3945
  54. package/lib/index.umd.min.js +3 -3
  55. package/lib/table/index.js +5 -5
  56. package/lib/table/module/custom/hook.js +51 -44
  57. package/lib/table/module/custom/panel.js +790 -540
  58. package/lib/table/module/edit/hook.js +142 -64
  59. package/lib/table/module/export/export-panel.js +406 -323
  60. package/lib/table/module/export/hook.js +419 -361
  61. package/lib/table/module/export/import-panel.js +157 -128
  62. package/lib/table/module/filter/hook.js +18 -4
  63. package/lib/table/module/filter/panel.js +149 -87
  64. package/lib/table/module/keyboard/hook.js +10 -6
  65. package/lib/table/module/menu/hook.js +2 -2
  66. package/lib/table/module/menu/panel.js +199 -128
  67. package/lib/table/module/validator/hook.js +2 -2
  68. package/lib/table/render/index.js +153 -100
  69. package/lib/table/src/body.js +357 -235
  70. package/lib/table/src/cell.js +428 -271
  71. package/lib/table/src/columnInfo.js +3 -2
  72. package/lib/table/src/footer.js +146 -101
  73. package/lib/table/src/group.js +7 -3
  74. package/lib/table/src/header.js +231 -174
  75. package/lib/table/src/props.js +2 -2
  76. package/lib/table/src/table.js +1487 -1045
  77. package/lib/table/src/util.js +15 -19
  78. package/lib/toolbar/index.js +4 -4
  79. package/lib/toolbar/src/toolbar.js +135 -78
  80. package/lib/ui/index.js +1 -3
  81. package/lib/ui/src/dom.js +9 -6
  82. package/lib/ui/src/log.js +1 -1
  83. package/lib/v-x-e-table/index.js +0 -2
  84. package/package.json +8 -3
  85. package/packages/colgroup/index.ts +22 -22
  86. package/packages/column/index.ts +22 -22
  87. package/packages/components.ts +41 -43
  88. package/packages/grid/index.ts +18 -18
  89. package/packages/grid/src/emits.ts +5 -19
  90. package/packages/grid/src/grid.ts +2229 -1925
  91. package/packages/grid/src/props.ts +22 -23
  92. package/packages/index.ts +11 -4
  93. package/packages/locale/lang/fr-FR.ts +15 -15
  94. package/packages/locale/lang/it-IT.ts +4 -4
  95. package/packages/locale/lang/uk-UA.ts +1 -1
  96. package/packages/locale/lang/uz-UZ.ts +13 -13
  97. package/packages/locale/lang/zh-CN.ts +907 -907
  98. package/packages/table/index.ts +26 -26
  99. package/packages/table/module/custom/hook.ts +510 -503
  100. package/packages/table/module/custom/panel.ts +2002 -1743
  101. package/packages/table/module/edit/hook.ts +1224 -1131
  102. package/packages/table/module/export/export-panel.ts +697 -611
  103. package/packages/table/module/export/hook.ts +2160 -2059
  104. package/packages/table/module/export/import-panel.ts +319 -279
  105. package/packages/table/module/export/util.ts +25 -24
  106. package/packages/table/module/filter/hook.ts +519 -501
  107. package/packages/table/module/filter/panel.ts +368 -304
  108. package/packages/table/module/keyboard/hook.ts +498 -494
  109. package/packages/table/module/menu/hook.ts +330 -330
  110. package/packages/table/module/menu/panel.ts +272 -201
  111. package/packages/table/module/validator/hook.ts +653 -635
  112. package/packages/table/render/index.ts +1819 -1744
  113. package/packages/table/src/body.ts +1078 -955
  114. package/packages/table/src/cell.ts +1524 -1359
  115. package/packages/table/src/column.ts +192 -192
  116. package/packages/table/src/columnInfo.ts +232 -232
  117. package/packages/table/src/emits.ts +134 -134
  118. package/packages/table/src/footer.ts +425 -380
  119. package/packages/table/src/group.ts +67 -63
  120. package/packages/table/src/header.ts +642 -581
  121. package/packages/table/src/props.ts +336 -336
  122. package/packages/table/src/store.ts +14 -14
  123. package/packages/table/src/table.ts +16011 -15454
  124. package/packages/table/src/use/cell-view.ts +41 -44
  125. package/packages/table/src/use/index.ts +1 -1
  126. package/packages/table/src/util.ts +1206 -1216
  127. package/packages/toolbar/index.ts +18 -18
  128. package/packages/toolbar/src/toolbar.ts +768 -706
  129. package/packages/ui/index.ts +519 -521
  130. package/packages/ui/src/anime.ts +51 -52
  131. package/packages/ui/src/comp.ts +3 -3
  132. package/packages/ui/src/dom.ts +466 -463
  133. package/packages/ui/src/log.ts +19 -19
  134. package/packages/ui/src/utils.ts +66 -66
  135. package/packages/ui/src/vn.ts +55 -55
  136. package/packages/v-x-e-table/index.d.ts +3 -4
  137. package/packages/v-x-e-table/index.ts +3 -4
  138. package/types/all.d.ts +76 -76
  139. package/types/index.d.ts +4 -4
  140. /package/dist/{iconfont.1792979665397.ttf → iconfont.1793009263429.ttf} +0 -0
  141. /package/dist/{iconfont.1792979665397.woff → iconfont.1793009263429.woff} +0 -0
  142. /package/dist/{iconfont.1792979665397.woff2 → iconfont.1793009263429.woff2} +0 -0
  143. /package/es/{iconfont.1792979665397.ttf → iconfont.1793009263429.ttf} +0 -0
  144. /package/es/{iconfont.1792979665397.woff → iconfont.1793009263429.woff} +0 -0
  145. /package/es/{iconfont.1792979665397.woff2 → iconfont.1793009263429.woff2} +0 -0
  146. /package/lib/{iconfont.1792979665397.ttf → iconfont.1793009263429.ttf} +0 -0
  147. /package/lib/{iconfont.1792979665397.woff → iconfont.1793009263429.woff} +0 -0
  148. /package/lib/{iconfont.1792979665397.woff2 → iconfont.1793009263429.woff2} +0 -0
@@ -1,6 +1,6 @@
1
1
  import { h, resolveComponent } from "vue";
2
2
  import XEUtils from "xe-utils";
3
- import { VxeUI } from "../../ui";
3
+ import { VxeUI } from "@vxe-ui/core";
4
4
  import { getCellValue, setCellValue } from "../../table/src/util";
5
5
  import { getFuncText, formatText, isEmptyValue, hasEnableConf } from "../../ui/src/utils";
6
6
  import { getOnName, getModelEvent, getChangeEvent, hasInputType } from "../../ui/src/vn";
@@ -72,14 +72,22 @@ function isImmediateCell(renderOpts, params) {
72
72
  function getCellLabelVNs(renderOpts, params, cellLabel, opts) {
73
73
  const { placeholder } = renderOpts;
74
74
  return [
75
- h("span", {
76
- key: 1,
77
- class: ["vxe-cell--label", opts ? opts.class : ""]
78
- }, placeholder && isEmptyValue(cellLabel) ? [
79
- h("span", {
80
- class: "vxe-cell--placeholder"
81
- }, formatText(getFuncText(placeholder), 1))
82
- ] : formatText(cellLabel, 1))
75
+ h(
76
+ "span",
77
+ {
78
+ key: 1,
79
+ class: ["vxe-cell--label", opts ? opts.class : ""]
80
+ },
81
+ placeholder && isEmptyValue(cellLabel) ? [
82
+ h(
83
+ "span",
84
+ {
85
+ class: "vxe-cell--placeholder"
86
+ },
87
+ formatText(getFuncText(placeholder), 1)
88
+ )
89
+ ] : formatText(cellLabel, 1)
90
+ )
83
91
  ];
84
92
  }
85
93
  function getNativeElementOns(renderOpts, params, eFns) {
@@ -223,30 +231,35 @@ function getFilterOns(renderOpts, params, option) {
223
231
  function getFloatingFilterOns(renderOpts, params, option) {
224
232
  const { $table, column } = params;
225
233
  if (hasInputType(renderOpts)) {
226
- return getComponentOns(renderOpts, params, {
227
- model(value) {
228
- option.data = value;
229
- },
230
- change() {
231
- updateFilterChangeOption(params, !isEmptyValue(option.data), option);
232
- },
233
- clear() {
234
- updateFilterChangeOption(params, !isEmptyValue(option.data), option);
235
- saveFilterEvent(params);
236
- },
237
- blur() {
238
- $table.saveFilterByEvent(new Event("change"), column);
239
- }
240
- }, renderOpts.name === "VxeNumberInput" ? {
241
- [getOnName("plus-number")]() {
242
- updateFilterChangeOption(params, !isEmptyValue(option.data), option);
243
- saveFilterEvent(params);
234
+ return getComponentOns(
235
+ renderOpts,
236
+ params,
237
+ {
238
+ model(value) {
239
+ option.data = value;
240
+ },
241
+ change() {
242
+ updateFilterChangeOption(params, !isEmptyValue(option.data), option);
243
+ },
244
+ clear() {
245
+ updateFilterChangeOption(params, !isEmptyValue(option.data), option);
246
+ saveFilterEvent(params);
247
+ },
248
+ blur() {
249
+ $table.saveFilterByEvent(new Event("change"), column);
250
+ }
244
251
  },
245
- [getOnName("minus-number")]() {
246
- updateFilterChangeOption(params, !isEmptyValue(option.data), option);
247
- saveFilterEvent(params);
248
- }
249
- } : {});
252
+ renderOpts.name === "VxeNumberInput" ? {
253
+ [getOnName("plus-number")]() {
254
+ updateFilterChangeOption(params, !isEmptyValue(option.data), option);
255
+ saveFilterEvent(params);
256
+ },
257
+ [getOnName("minus-number")]() {
258
+ updateFilterChangeOption(params, !isEmptyValue(option.data), option);
259
+ saveFilterEvent(params);
260
+ }
261
+ } : {}
262
+ );
250
263
  }
251
264
  return getComponentOns(renderOpts, params, {
252
265
  model(value) {
@@ -314,9 +327,13 @@ function nativeInputCellRender(renderOpts, renderParams) {
314
327
  const { row, column } = renderParams;
315
328
  const cellValue = XEUtils.get(row, column.field);
316
329
  const cellVNs = [
317
- h("span", {
318
- key: 1
319
- }, cellValue)
330
+ h(
331
+ "span",
332
+ {
333
+ key: 1
334
+ },
335
+ cellValue
336
+ )
320
337
  ];
321
338
  return getNativeInputRenderCellVNs(cellValue, cellVNs, renderOpts, renderParams);
322
339
  }
@@ -413,10 +430,14 @@ function renderNativeOptgroups(renderOpts, params, renderOptionsMethods) {
413
430
  const groupLabel = optionGroupProps.label || "label";
414
431
  if (optionGroups) {
415
432
  return optionGroups.map((group, gIndex) => {
416
- return h("optgroup", {
417
- key: gIndex,
418
- label: group[groupLabel]
419
- }, renderOptionsMethods(group[groupOptions], renderOpts, params));
433
+ return h(
434
+ "optgroup",
435
+ {
436
+ key: gIndex,
437
+ label: group[groupLabel]
438
+ },
439
+ renderOptionsMethods(group[groupOptions], renderOpts, params)
440
+ );
420
441
  });
421
442
  }
422
443
  return [];
@@ -430,13 +451,17 @@ function renderNativeOptions(options, renderOpts, params) {
430
451
  const cellValue = isImmediateCell(renderOpts, params) ? getCellValue(row, column) : column.model.value;
431
452
  if (options) {
432
453
  return options.map((option, oIndex) => {
433
- return h("option", {
434
- key: oIndex,
435
- value: option[valueProp],
436
- disabled: option[disabledProp],
437
- /* eslint-disable eqeqeq */
438
- selected: option[valueProp] == cellValue
439
- }, option[labelProp]);
454
+ return h(
455
+ "option",
456
+ {
457
+ key: oIndex,
458
+ value: option[valueProp],
459
+ disabled: option[disabledProp],
460
+ /* eslint-disable eqeqeq */
461
+ selected: option[valueProp] == cellValue
462
+ },
463
+ option[labelProp]
464
+ );
440
465
  });
441
466
  }
442
467
  return [];
@@ -477,9 +502,7 @@ function defaultFloatingFilterRender(renderOpts, params) {
477
502
  ];
478
503
  }
479
504
  function defaultFilterOptions() {
480
- return [
481
- { data: null }
482
- ];
505
+ return [{ data: null }];
483
506
  }
484
507
  function oldFilterRender(renderOpts, params) {
485
508
  const { column } = params;
@@ -598,16 +621,17 @@ function handleTreeSelectCellValue(cellValue, renderOpts) {
598
621
  const childrenProp = optionProps.children || "children";
599
622
  if (!(cellValue === null || cellValue === void 0)) {
600
623
  const keyMaps = {};
601
- XEUtils.eachTree(options, (item) => {
602
- keyMaps[XEUtils.get(item, valueProp)] = item;
603
- }, { children: childrenProp });
604
- return XEUtils.map(
605
- XEUtils.isArray(cellValue) ? cellValue : [cellValue],
606
- (value) => {
607
- const item = keyMaps[value];
608
- return item ? XEUtils.get(item, labelProp) : item;
609
- }
610
- ).join(", ");
624
+ XEUtils.eachTree(
625
+ options,
626
+ (item) => {
627
+ keyMaps[XEUtils.get(item, valueProp)] = item;
628
+ },
629
+ { children: childrenProp }
630
+ );
631
+ return XEUtils.map(XEUtils.isArray(cellValue) ? cellValue : [cellValue], (value) => {
632
+ const item = keyMaps[value];
633
+ return item ? XEUtils.get(item, labelProp) : item;
634
+ }).join(", ");
611
635
  }
612
636
  return "";
613
637
  }
@@ -669,9 +693,14 @@ function handleNumberCell(cellValue, renderOpts, params) {
669
693
  }
670
694
  }
671
695
  }
672
- return getCellLabelVNs(renderOpts, params, cellValue, isNegative ? {
673
- class: "is--negative"
674
- } : {});
696
+ return getCellLabelVNs(
697
+ renderOpts,
698
+ params,
699
+ cellValue,
700
+ isNegative ? {
701
+ class: "is--negative"
702
+ } : {}
703
+ );
675
704
  }
676
705
  function handleFormatDatePicker(renderOpts, renderParams) {
677
706
  const { props = {} } = renderOpts;
@@ -728,10 +757,14 @@ function handleSetSelectValue(renderOpts, renderParams) {
728
757
  }
729
758
  }
730
759
  if (isMultiVal) {
731
- XEUtils.set(row, field, (isMultiVal ? cellValue.split(",") : [cellValue]).map((label) => {
732
- const item = labelMpas[label];
733
- return item ? item[valueProp] : label;
734
- }));
760
+ XEUtils.set(
761
+ row,
762
+ field,
763
+ (isMultiVal ? cellValue.split(",") : [cellValue]).map((label) => {
764
+ const item = labelMpas[label];
765
+ return item ? item[valueProp] : label;
766
+ })
767
+ );
735
768
  } else {
736
769
  XEUtils.set(row, field, cellValue);
737
770
  }
@@ -1054,19 +1087,24 @@ renderer.mixin({
1054
1087
  return [
1055
1088
  h(getDefaultComponent(renderOpts), {
1056
1089
  ...getCellEditProps(renderOpts, params, cellValue, seProps),
1057
- ...getComponentOns(renderOpts, params, {
1058
- model(cellValue2) {
1059
- model.update = true;
1060
- model.value = cellValue2;
1061
- setCellValue(row, column, cellValue2);
1090
+ ...getComponentOns(
1091
+ renderOpts,
1092
+ params,
1093
+ {
1094
+ model(cellValue2) {
1095
+ model.update = true;
1096
+ model.value = cellValue2;
1097
+ setCellValue(row, column, cellValue2);
1098
+ },
1099
+ change() {
1100
+ $table.updateStatus(params);
1101
+ },
1102
+ blur() {
1103
+ $table.handleCellRuleUpdateStatus("blur", params);
1104
+ }
1062
1105
  },
1063
- change() {
1064
- $table.updateStatus(params);
1065
- },
1066
- blur() {
1067
- $table.handleCellRuleUpdateStatus("blur", params);
1068
- }
1069
- }, seOs)
1106
+ seOs
1107
+ )
1070
1108
  })
1071
1109
  ];
1072
1110
  },
@@ -1094,13 +1132,18 @@ renderer.mixin({
1094
1132
  return [
1095
1133
  h(getDefaultComponent(renderOpts), {
1096
1134
  ...getCellEditProps(renderOpts, params, cellValue, seProps),
1097
- ...getComponentOns(renderOpts, params, {
1098
- model(cellValue2) {
1099
- model.update = true;
1100
- model.value = cellValue2;
1101
- setCellValue(row, column, cellValue2);
1102
- }
1103
- }, seOs)
1135
+ ...getComponentOns(
1136
+ renderOpts,
1137
+ params,
1138
+ {
1139
+ model(cellValue2) {
1140
+ model.update = true;
1141
+ model.value = cellValue2;
1142
+ setCellValue(row, column, cellValue2);
1143
+ }
1144
+ },
1145
+ seOs
1146
+ )
1104
1147
  })
1105
1148
  ];
1106
1149
  },
@@ -1409,20 +1452,30 @@ renderer.mixin({
1409
1452
  const customSize = props ? props.size : null;
1410
1453
  const vSize = customSize || computeSize.value;
1411
1454
  const cellValue = XEUtils.get(row, column.field);
1412
- return h("span", {
1413
- class: ["vxe-color-picker--readonly", {
1414
- [`size--${vSize}`]: vSize
1415
- }]
1416
- }, [
1417
- h("div", {
1418
- class: ["vxe-color-picker--readonly-color", {
1419
- "is--empty": !cellValue
1420
- }],
1421
- style: cellValue ? {
1422
- backgroundColor: cellValue
1423
- } : void 0
1424
- })
1425
- ]);
1455
+ return h(
1456
+ "span",
1457
+ {
1458
+ class: [
1459
+ "vxe-color-picker--readonly",
1460
+ {
1461
+ [`size--${vSize}`]: vSize
1462
+ }
1463
+ ]
1464
+ },
1465
+ [
1466
+ h("div", {
1467
+ class: [
1468
+ "vxe-color-picker--readonly-color",
1469
+ {
1470
+ "is--empty": !cellValue
1471
+ }
1472
+ ],
1473
+ style: cellValue ? {
1474
+ backgroundColor: cellValue
1475
+ } : void 0
1476
+ })
1477
+ ]
1478
+ );
1426
1479
  }
1427
1480
  },
1428
1481
  VxeIconPicker: {