vxe-table 4.23.8 → 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 (126) hide show
  1. package/dist/all.esm.js +5715 -3783
  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 +1 -0
  7. package/es/index.js +1 -0
  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 +1 -0
  36. package/lib/index.js +1 -0
  37. package/lib/index.umd.js +5732 -3800
  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 +41 -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 +11 -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.1793009263429.ttf} +0 -0
  119. /package/dist/{iconfont.1793007753347.woff → iconfont.1793009263429.woff} +0 -0
  120. /package/dist/{iconfont.1793007753347.woff2 → iconfont.1793009263429.woff2} +0 -0
  121. /package/es/{iconfont.1793007753347.ttf → iconfont.1793009263429.ttf} +0 -0
  122. /package/es/{iconfont.1793007753347.woff → iconfont.1793009263429.woff} +0 -0
  123. /package/es/{iconfont.1793007753347.woff2 → iconfont.1793009263429.woff2} +0 -0
  124. /package/lib/{iconfont.1793007753347.ttf → iconfont.1793009263429.ttf} +0 -0
  125. /package/lib/{iconfont.1793007753347.woff → iconfont.1793009263429.woff} +0 -0
  126. /package/lib/{iconfont.1793007753347.woff2 → iconfont.1793009263429.woff2} +0 -0
@@ -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: {