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.
- package/dist/all.esm.js +5859 -4018
- package/es/colgroup/index.js +1 -1
- package/es/column/index.js +1 -1
- package/es/components.d.ts +3 -0
- package/es/components.js +4 -8
- package/es/grid/index.js +1 -1
- package/es/grid/src/emits.js +1 -15
- package/es/grid/src/grid.js +398 -121
- package/es/grid/src/props.js +1 -1
- package/es/index.esm.js +6 -0
- package/es/index.js +6 -0
- package/es/table/index.js +1 -1
- package/es/table/module/custom/hook.js +50 -43
- package/es/table/module/custom/panel.js +778 -528
- package/es/table/module/edit/hook.js +141 -63
- package/es/table/module/export/export-panel.js +400 -317
- package/es/table/module/export/hook.js +396 -338
- package/es/table/module/export/import-panel.js +153 -124
- package/es/table/module/filter/hook.js +17 -3
- package/es/table/module/filter/panel.js +147 -85
- package/es/table/module/keyboard/hook.js +9 -5
- package/es/table/module/menu/hook.js +1 -1
- package/es/table/module/menu/panel.js +198 -127
- package/es/table/module/validator/hook.js +1 -1
- package/es/table/render/index.js +152 -99
- package/es/table/src/body.js +356 -234
- package/es/table/src/cell.js +427 -270
- package/es/table/src/columnInfo.js +2 -1
- package/es/table/src/footer.js +145 -100
- package/es/table/src/group.js +7 -3
- package/es/table/src/header.js +230 -173
- package/es/table/src/props.js +1 -1
- package/es/table/src/table.js +1504 -1031
- package/es/table/src/util.js +15 -19
- package/es/toolbar/index.js +1 -1
- package/es/toolbar/src/toolbar.js +133 -76
- package/es/ui/index.d.ts +0 -1
- package/es/ui/index.js +1 -2
- package/es/ui/src/dom.js +9 -6
- package/es/ui/src/log.js +1 -1
- package/es/ui/src/utils.d.ts +1 -1
- package/es/v-x-e-table/index.d.ts +0 -1
- package/es/v-x-e-table/index.js +0 -1
- package/lib/colgroup/index.js +5 -5
- package/lib/column/index.js +5 -5
- package/lib/components.js +8 -12
- package/lib/grid/index.js +4 -4
- package/lib/grid/src/emits.js +1 -15
- package/lib/grid/src/grid.js +419 -142
- package/lib/grid/src/props.js +2 -2
- package/lib/index.common.js +6 -0
- package/lib/index.js +6 -0
- package/lib/index.umd.js +5825 -3945
- package/lib/index.umd.min.js +3 -3
- package/lib/table/index.js +5 -5
- package/lib/table/module/custom/hook.js +51 -44
- package/lib/table/module/custom/panel.js +790 -540
- package/lib/table/module/edit/hook.js +142 -64
- package/lib/table/module/export/export-panel.js +406 -323
- package/lib/table/module/export/hook.js +419 -361
- package/lib/table/module/export/import-panel.js +157 -128
- package/lib/table/module/filter/hook.js +18 -4
- package/lib/table/module/filter/panel.js +149 -87
- package/lib/table/module/keyboard/hook.js +10 -6
- package/lib/table/module/menu/hook.js +2 -2
- package/lib/table/module/menu/panel.js +199 -128
- package/lib/table/module/validator/hook.js +2 -2
- package/lib/table/render/index.js +153 -100
- package/lib/table/src/body.js +357 -235
- package/lib/table/src/cell.js +428 -271
- package/lib/table/src/columnInfo.js +3 -2
- package/lib/table/src/footer.js +146 -101
- package/lib/table/src/group.js +7 -3
- package/lib/table/src/header.js +231 -174
- package/lib/table/src/props.js +2 -2
- package/lib/table/src/table.js +1487 -1045
- package/lib/table/src/util.js +15 -19
- package/lib/toolbar/index.js +4 -4
- package/lib/toolbar/src/toolbar.js +135 -78
- package/lib/ui/index.js +1 -3
- package/lib/ui/src/dom.js +9 -6
- package/lib/ui/src/log.js +1 -1
- package/lib/v-x-e-table/index.js +0 -2
- package/package.json +8 -3
- package/packages/colgroup/index.ts +22 -22
- package/packages/column/index.ts +22 -22
- package/packages/components.ts +41 -43
- package/packages/grid/index.ts +18 -18
- package/packages/grid/src/emits.ts +5 -19
- package/packages/grid/src/grid.ts +2229 -1925
- package/packages/grid/src/props.ts +22 -23
- package/packages/index.ts +11 -4
- package/packages/locale/lang/fr-FR.ts +15 -15
- package/packages/locale/lang/it-IT.ts +4 -4
- package/packages/locale/lang/uk-UA.ts +1 -1
- package/packages/locale/lang/uz-UZ.ts +13 -13
- package/packages/locale/lang/zh-CN.ts +907 -907
- package/packages/table/index.ts +26 -26
- package/packages/table/module/custom/hook.ts +510 -503
- package/packages/table/module/custom/panel.ts +2002 -1743
- package/packages/table/module/edit/hook.ts +1224 -1131
- package/packages/table/module/export/export-panel.ts +697 -611
- package/packages/table/module/export/hook.ts +2160 -2059
- package/packages/table/module/export/import-panel.ts +319 -279
- package/packages/table/module/export/util.ts +25 -24
- package/packages/table/module/filter/hook.ts +519 -501
- package/packages/table/module/filter/panel.ts +368 -304
- package/packages/table/module/keyboard/hook.ts +498 -494
- package/packages/table/module/menu/hook.ts +330 -330
- package/packages/table/module/menu/panel.ts +272 -201
- package/packages/table/module/validator/hook.ts +653 -635
- package/packages/table/render/index.ts +1819 -1744
- package/packages/table/src/body.ts +1078 -955
- package/packages/table/src/cell.ts +1524 -1359
- package/packages/table/src/column.ts +192 -192
- package/packages/table/src/columnInfo.ts +232 -232
- package/packages/table/src/emits.ts +134 -134
- package/packages/table/src/footer.ts +425 -380
- package/packages/table/src/group.ts +67 -63
- package/packages/table/src/header.ts +642 -581
- package/packages/table/src/props.ts +336 -336
- package/packages/table/src/store.ts +14 -14
- package/packages/table/src/table.ts +16011 -15454
- package/packages/table/src/use/cell-view.ts +41 -44
- package/packages/table/src/use/index.ts +1 -1
- package/packages/table/src/util.ts +1206 -1216
- package/packages/toolbar/index.ts +18 -18
- package/packages/toolbar/src/toolbar.ts +768 -706
- package/packages/ui/index.ts +519 -521
- package/packages/ui/src/anime.ts +51 -52
- package/packages/ui/src/comp.ts +3 -3
- package/packages/ui/src/dom.ts +466 -463
- package/packages/ui/src/log.ts +19 -19
- package/packages/ui/src/utils.ts +66 -66
- package/packages/ui/src/vn.ts +55 -55
- package/packages/v-x-e-table/index.d.ts +3 -4
- package/packages/v-x-e-table/index.ts +3 -4
- package/types/all.d.ts +76 -76
- package/types/index.d.ts +4 -4
- /package/dist/{iconfont.1792979665397.ttf → iconfont.1793009263429.ttf} +0 -0
- /package/dist/{iconfont.1792979665397.woff → iconfont.1793009263429.woff} +0 -0
- /package/dist/{iconfont.1792979665397.woff2 → iconfont.1793009263429.woff2} +0 -0
- /package/es/{iconfont.1792979665397.ttf → iconfont.1793009263429.ttf} +0 -0
- /package/es/{iconfont.1792979665397.woff → iconfont.1793009263429.woff} +0 -0
- /package/es/{iconfont.1792979665397.woff2 → iconfont.1793009263429.woff2} +0 -0
- /package/lib/{iconfont.1792979665397.ttf → iconfont.1793009263429.ttf} +0 -0
- /package/lib/{iconfont.1792979665397.woff → iconfont.1793009263429.woff} +0 -0
- /package/lib/{iconfont.1792979665397.woff2 → iconfont.1793009263429.woff2} +0 -0
package/es/table/render/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h, resolveComponent } from "vue";
|
|
2
2
|
import XEUtils from "xe-utils";
|
|
3
|
-
import { VxeUI } from "
|
|
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(
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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(
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
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
|
-
|
|
246
|
-
|
|
247
|
-
|
|
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(
|
|
318
|
-
|
|
319
|
-
|
|
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(
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
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(
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
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(
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
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(
|
|
673
|
-
|
|
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(
|
|
732
|
-
|
|
733
|
-
|
|
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(
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
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
|
-
|
|
1064
|
-
|
|
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(
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
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(
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
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: {
|