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
@@ -23,13 +23,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
23
23
  ));
24
24
  var import_vue = require("vue");
25
25
  var import_xe_utils = __toESM(require("xe-utils"));
26
- var import_ui = require("../../ui");
26
+ var import_core = require("@vxe-ui/core");
27
27
  var import_util = require("../../table/src/util");
28
28
  var import_utils = require("../../ui/src/utils");
29
29
  var import_vn = require("../../ui/src/vn");
30
30
  var import_log = require("../../ui/src/log");
31
31
  const { errLog } = (0, import_log.createComponentLog)("table");
32
- const { getConfig, renderer, getI18n, getComponent } = import_ui.VxeUI;
32
+ const { getConfig, renderer, getI18n, getComponent } = import_core.VxeUI;
33
33
  const componentDefaultModelProp = "modelValue";
34
34
  const defaultCompProps = {};
35
35
  function handleDefaultValue(value, defaultVal, initVal) {
@@ -95,14 +95,22 @@ function isImmediateCell(renderOpts, params) {
95
95
  function getCellLabelVNs(renderOpts, params, cellLabel, opts) {
96
96
  const { placeholder } = renderOpts;
97
97
  return [
98
- (0, import_vue.h)("span", {
99
- key: 1,
100
- class: ["vxe-cell--label", opts ? opts.class : ""]
101
- }, placeholder && (0, import_utils.isEmptyValue)(cellLabel) ? [
102
- (0, import_vue.h)("span", {
103
- class: "vxe-cell--placeholder"
104
- }, (0, import_utils.formatText)((0, import_utils.getFuncText)(placeholder), 1))
105
- ] : (0, import_utils.formatText)(cellLabel, 1))
98
+ (0, import_vue.h)(
99
+ "span",
100
+ {
101
+ key: 1,
102
+ class: ["vxe-cell--label", opts ? opts.class : ""]
103
+ },
104
+ placeholder && (0, import_utils.isEmptyValue)(cellLabel) ? [
105
+ (0, import_vue.h)(
106
+ "span",
107
+ {
108
+ class: "vxe-cell--placeholder"
109
+ },
110
+ (0, import_utils.formatText)((0, import_utils.getFuncText)(placeholder), 1)
111
+ )
112
+ ] : (0, import_utils.formatText)(cellLabel, 1)
113
+ )
106
114
  ];
107
115
  }
108
116
  function getNativeElementOns(renderOpts, params, eFns) {
@@ -246,30 +254,35 @@ function getFilterOns(renderOpts, params, option) {
246
254
  function getFloatingFilterOns(renderOpts, params, option) {
247
255
  const { $table, column } = params;
248
256
  if ((0, import_vn.hasInputType)(renderOpts)) {
249
- return getComponentOns(renderOpts, params, {
250
- model(value) {
251
- option.data = value;
252
- },
253
- change() {
254
- updateFilterChangeOption(params, !(0, import_utils.isEmptyValue)(option.data), option);
255
- },
256
- clear() {
257
- updateFilterChangeOption(params, !(0, import_utils.isEmptyValue)(option.data), option);
258
- saveFilterEvent(params);
259
- },
260
- blur() {
261
- $table.saveFilterByEvent(new Event("change"), column);
262
- }
263
- }, renderOpts.name === "VxeNumberInput" ? {
264
- [(0, import_vn.getOnName)("plus-number")]() {
265
- updateFilterChangeOption(params, !(0, import_utils.isEmptyValue)(option.data), option);
266
- saveFilterEvent(params);
257
+ return getComponentOns(
258
+ renderOpts,
259
+ params,
260
+ {
261
+ model(value) {
262
+ option.data = value;
263
+ },
264
+ change() {
265
+ updateFilterChangeOption(params, !(0, import_utils.isEmptyValue)(option.data), option);
266
+ },
267
+ clear() {
268
+ updateFilterChangeOption(params, !(0, import_utils.isEmptyValue)(option.data), option);
269
+ saveFilterEvent(params);
270
+ },
271
+ blur() {
272
+ $table.saveFilterByEvent(new Event("change"), column);
273
+ }
267
274
  },
268
- [(0, import_vn.getOnName)("minus-number")]() {
269
- updateFilterChangeOption(params, !(0, import_utils.isEmptyValue)(option.data), option);
270
- saveFilterEvent(params);
271
- }
272
- } : {});
275
+ renderOpts.name === "VxeNumberInput" ? {
276
+ [(0, import_vn.getOnName)("plus-number")]() {
277
+ updateFilterChangeOption(params, !(0, import_utils.isEmptyValue)(option.data), option);
278
+ saveFilterEvent(params);
279
+ },
280
+ [(0, import_vn.getOnName)("minus-number")]() {
281
+ updateFilterChangeOption(params, !(0, import_utils.isEmptyValue)(option.data), option);
282
+ saveFilterEvent(params);
283
+ }
284
+ } : {}
285
+ );
273
286
  }
274
287
  return getComponentOns(renderOpts, params, {
275
288
  model(value) {
@@ -337,9 +350,13 @@ function nativeInputCellRender(renderOpts, renderParams) {
337
350
  const { row, column } = renderParams;
338
351
  const cellValue = import_xe_utils.default.get(row, column.field);
339
352
  const cellVNs = [
340
- (0, import_vue.h)("span", {
341
- key: 1
342
- }, cellValue)
353
+ (0, import_vue.h)(
354
+ "span",
355
+ {
356
+ key: 1
357
+ },
358
+ cellValue
359
+ )
343
360
  ];
344
361
  return getNativeInputRenderCellVNs(cellValue, cellVNs, renderOpts, renderParams);
345
362
  }
@@ -436,10 +453,14 @@ function renderNativeOptgroups(renderOpts, params, renderOptionsMethods) {
436
453
  const groupLabel = optionGroupProps.label || "label";
437
454
  if (optionGroups) {
438
455
  return optionGroups.map((group, gIndex) => {
439
- return (0, import_vue.h)("optgroup", {
440
- key: gIndex,
441
- label: group[groupLabel]
442
- }, renderOptionsMethods(group[groupOptions], renderOpts, params));
456
+ return (0, import_vue.h)(
457
+ "optgroup",
458
+ {
459
+ key: gIndex,
460
+ label: group[groupLabel]
461
+ },
462
+ renderOptionsMethods(group[groupOptions], renderOpts, params)
463
+ );
443
464
  });
444
465
  }
445
466
  return [];
@@ -453,13 +474,17 @@ function renderNativeOptions(options, renderOpts, params) {
453
474
  const cellValue = isImmediateCell(renderOpts, params) ? (0, import_util.getCellValue)(row, column) : column.model.value;
454
475
  if (options) {
455
476
  return options.map((option, oIndex) => {
456
- return (0, import_vue.h)("option", {
457
- key: oIndex,
458
- value: option[valueProp],
459
- disabled: option[disabledProp],
460
- /* eslint-disable eqeqeq */
461
- selected: option[valueProp] == cellValue
462
- }, option[labelProp]);
477
+ return (0, import_vue.h)(
478
+ "option",
479
+ {
480
+ key: oIndex,
481
+ value: option[valueProp],
482
+ disabled: option[disabledProp],
483
+ /* eslint-disable eqeqeq */
484
+ selected: option[valueProp] == cellValue
485
+ },
486
+ option[labelProp]
487
+ );
463
488
  });
464
489
  }
465
490
  return [];
@@ -500,9 +525,7 @@ function defaultFloatingFilterRender(renderOpts, params) {
500
525
  ];
501
526
  }
502
527
  function defaultFilterOptions() {
503
- return [
504
- { data: null }
505
- ];
528
+ return [{ data: null }];
506
529
  }
507
530
  function oldFilterRender(renderOpts, params) {
508
531
  const { column } = params;
@@ -621,16 +644,17 @@ function handleTreeSelectCellValue(cellValue, renderOpts) {
621
644
  const childrenProp = optionProps.children || "children";
622
645
  if (!(cellValue === null || cellValue === void 0)) {
623
646
  const keyMaps = {};
624
- import_xe_utils.default.eachTree(options, (item) => {
625
- keyMaps[import_xe_utils.default.get(item, valueProp)] = item;
626
- }, { children: childrenProp });
627
- return import_xe_utils.default.map(
628
- import_xe_utils.default.isArray(cellValue) ? cellValue : [cellValue],
629
- (value) => {
630
- const item = keyMaps[value];
631
- return item ? import_xe_utils.default.get(item, labelProp) : item;
632
- }
633
- ).join(", ");
647
+ import_xe_utils.default.eachTree(
648
+ options,
649
+ (item) => {
650
+ keyMaps[import_xe_utils.default.get(item, valueProp)] = item;
651
+ },
652
+ { children: childrenProp }
653
+ );
654
+ return import_xe_utils.default.map(import_xe_utils.default.isArray(cellValue) ? cellValue : [cellValue], (value) => {
655
+ const item = keyMaps[value];
656
+ return item ? import_xe_utils.default.get(item, labelProp) : item;
657
+ }).join(", ");
634
658
  }
635
659
  return "";
636
660
  }
@@ -692,9 +716,14 @@ function handleNumberCell(cellValue, renderOpts, params) {
692
716
  }
693
717
  }
694
718
  }
695
- return getCellLabelVNs(renderOpts, params, cellValue, isNegative ? {
696
- class: "is--negative"
697
- } : {});
719
+ return getCellLabelVNs(
720
+ renderOpts,
721
+ params,
722
+ cellValue,
723
+ isNegative ? {
724
+ class: "is--negative"
725
+ } : {}
726
+ );
698
727
  }
699
728
  function handleFormatDatePicker(renderOpts, renderParams) {
700
729
  const { props = {} } = renderOpts;
@@ -751,10 +780,14 @@ function handleSetSelectValue(renderOpts, renderParams) {
751
780
  }
752
781
  }
753
782
  if (isMultiVal) {
754
- import_xe_utils.default.set(row, field, (isMultiVal ? cellValue.split(",") : [cellValue]).map((label) => {
755
- const item = labelMpas[label];
756
- return item ? item[valueProp] : label;
757
- }));
783
+ import_xe_utils.default.set(
784
+ row,
785
+ field,
786
+ (isMultiVal ? cellValue.split(",") : [cellValue]).map((label) => {
787
+ const item = labelMpas[label];
788
+ return item ? item[valueProp] : label;
789
+ })
790
+ );
758
791
  } else {
759
792
  import_xe_utils.default.set(row, field, cellValue);
760
793
  }
@@ -1077,19 +1110,24 @@ renderer.mixin({
1077
1110
  return [
1078
1111
  (0, import_vue.h)(getDefaultComponent(renderOpts), {
1079
1112
  ...getCellEditProps(renderOpts, params, cellValue, seProps),
1080
- ...getComponentOns(renderOpts, params, {
1081
- model(cellValue2) {
1082
- model.update = true;
1083
- model.value = cellValue2;
1084
- (0, import_util.setCellValue)(row, column, cellValue2);
1113
+ ...getComponentOns(
1114
+ renderOpts,
1115
+ params,
1116
+ {
1117
+ model(cellValue2) {
1118
+ model.update = true;
1119
+ model.value = cellValue2;
1120
+ (0, import_util.setCellValue)(row, column, cellValue2);
1121
+ },
1122
+ change() {
1123
+ $table.updateStatus(params);
1124
+ },
1125
+ blur() {
1126
+ $table.handleCellRuleUpdateStatus("blur", params);
1127
+ }
1085
1128
  },
1086
- change() {
1087
- $table.updateStatus(params);
1088
- },
1089
- blur() {
1090
- $table.handleCellRuleUpdateStatus("blur", params);
1091
- }
1092
- }, seOs)
1129
+ seOs
1130
+ )
1093
1131
  })
1094
1132
  ];
1095
1133
  },
@@ -1117,13 +1155,18 @@ renderer.mixin({
1117
1155
  return [
1118
1156
  (0, import_vue.h)(getDefaultComponent(renderOpts), {
1119
1157
  ...getCellEditProps(renderOpts, params, cellValue, seProps),
1120
- ...getComponentOns(renderOpts, params, {
1121
- model(cellValue2) {
1122
- model.update = true;
1123
- model.value = cellValue2;
1124
- (0, import_util.setCellValue)(row, column, cellValue2);
1125
- }
1126
- }, seOs)
1158
+ ...getComponentOns(
1159
+ renderOpts,
1160
+ params,
1161
+ {
1162
+ model(cellValue2) {
1163
+ model.update = true;
1164
+ model.value = cellValue2;
1165
+ (0, import_util.setCellValue)(row, column, cellValue2);
1166
+ }
1167
+ },
1168
+ seOs
1169
+ )
1127
1170
  })
1128
1171
  ];
1129
1172
  },
@@ -1432,20 +1475,30 @@ renderer.mixin({
1432
1475
  const customSize = props ? props.size : null;
1433
1476
  const vSize = customSize || computeSize.value;
1434
1477
  const cellValue = import_xe_utils.default.get(row, column.field);
1435
- return (0, import_vue.h)("span", {
1436
- class: ["vxe-color-picker--readonly", {
1437
- [`size--${vSize}`]: vSize
1438
- }]
1439
- }, [
1440
- (0, import_vue.h)("div", {
1441
- class: ["vxe-color-picker--readonly-color", {
1442
- "is--empty": !cellValue
1443
- }],
1444
- style: cellValue ? {
1445
- backgroundColor: cellValue
1446
- } : void 0
1447
- })
1448
- ]);
1478
+ return (0, import_vue.h)(
1479
+ "span",
1480
+ {
1481
+ class: [
1482
+ "vxe-color-picker--readonly",
1483
+ {
1484
+ [`size--${vSize}`]: vSize
1485
+ }
1486
+ ]
1487
+ },
1488
+ [
1489
+ (0, import_vue.h)("div", {
1490
+ class: [
1491
+ "vxe-color-picker--readonly-color",
1492
+ {
1493
+ "is--empty": !cellValue
1494
+ }
1495
+ ],
1496
+ style: cellValue ? {
1497
+ backgroundColor: cellValue
1498
+ } : void 0
1499
+ })
1500
+ ]
1501
+ );
1449
1502
  }
1450
1503
  },
1451
1504
  VxeIconPicker: {