vxe-table 3.17.0-beta.10 → 3.17.0-beta.12
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/es/grid/src/grid.js +88 -23
- package/es/style.css +1 -1
- package/es/table/src/methods.js +17 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +104 -29
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +125 -32
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/src/methods.js +19 -1
- package/lib/table/src/methods.min.js +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +1 -1
- package/packages/grid/src/grid.ts +99 -23
- package/packages/table/src/methods.ts +18 -1
- package/packages/table/src/props.ts +1 -1
- /package/es/{iconfont.1753519899264.ttf → iconfont.1753674925084.ttf} +0 -0
- /package/es/{iconfont.1753519899264.woff → iconfont.1753674925084.woff} +0 -0
- /package/es/{iconfont.1753519899264.woff2 → iconfont.1753674925084.woff2} +0 -0
- /package/lib/{iconfont.1753519899264.ttf → iconfont.1753674925084.ttf} +0 -0
- /package/lib/{iconfont.1753519899264.woff → iconfont.1753674925084.woff} +0 -0
- /package/lib/{iconfont.1753519899264.woff2 → iconfont.1753674925084.woff2} +0 -0
package/es/grid/src/grid.js
CHANGED
|
@@ -23,9 +23,11 @@ function getTableOns(_vm) {
|
|
|
23
23
|
if (proxyConfig) {
|
|
24
24
|
if (proxyOpts.sort) {
|
|
25
25
|
ons['sort-change'] = _vm.sortChangeEvent;
|
|
26
|
+
ons['clear-all-sort'] = _vm.clearAllSortEvent;
|
|
26
27
|
}
|
|
27
28
|
if (proxyOpts.filter) {
|
|
28
29
|
ons['filter-change'] = _vm.filterChangeEvent;
|
|
30
|
+
ons['clear-all-filter'] = _vm.clearAllFilterEvent;
|
|
29
31
|
}
|
|
30
32
|
}
|
|
31
33
|
return ons;
|
|
@@ -251,6 +253,12 @@ export default {
|
|
|
251
253
|
const pagerOpts = $xeGrid.computePagerOpts;
|
|
252
254
|
return pagerOpts.total;
|
|
253
255
|
},
|
|
256
|
+
computePageCount() {
|
|
257
|
+
const $xeGrid = this;
|
|
258
|
+
const reactData = $xeGrid.reactData;
|
|
259
|
+
const { tablePage } = reactData;
|
|
260
|
+
return Math.max(Math.ceil(tablePage.total / tablePage.pageSize), 1);
|
|
261
|
+
},
|
|
254
262
|
computeIsLoading() {
|
|
255
263
|
const $xeGrid = this;
|
|
256
264
|
const props = $xeGrid;
|
|
@@ -321,7 +329,7 @@ export default {
|
|
|
321
329
|
tablePage.pageSize = pageSize;
|
|
322
330
|
}
|
|
323
331
|
if (total) {
|
|
324
|
-
tablePage.
|
|
332
|
+
tablePage.total = total;
|
|
325
333
|
}
|
|
326
334
|
}
|
|
327
335
|
}
|
|
@@ -919,29 +927,63 @@ export default {
|
|
|
919
927
|
return $xeGrid.$nextTick();
|
|
920
928
|
},
|
|
921
929
|
homePage() {
|
|
930
|
+
const $xeGrid = this;
|
|
931
|
+
const reactData = $xeGrid.reactData;
|
|
932
|
+
const { tablePage } = reactData;
|
|
933
|
+
tablePage.currentPage = 1;
|
|
934
|
+
return $xeGrid.$nextTick();
|
|
935
|
+
},
|
|
936
|
+
homePageByEvent(evnt) {
|
|
922
937
|
const $xeGrid = this;
|
|
923
938
|
const $pager = $xeGrid.$refs.refPager;
|
|
924
939
|
if ($pager) {
|
|
925
|
-
|
|
940
|
+
$pager.homePageByEvent(evnt);
|
|
926
941
|
}
|
|
927
|
-
return $xeGrid.$nextTick();
|
|
928
942
|
},
|
|
929
943
|
endPage() {
|
|
944
|
+
const $xeGrid = this;
|
|
945
|
+
const reactData = $xeGrid.reactData;
|
|
946
|
+
const { tablePage } = reactData;
|
|
947
|
+
const pageCount = $xeGrid.computePageCount;
|
|
948
|
+
tablePage.currentPage = pageCount;
|
|
949
|
+
return $xeGrid.$nextTick();
|
|
950
|
+
},
|
|
951
|
+
endPageByEvent(evnt) {
|
|
930
952
|
const $xeGrid = this;
|
|
931
953
|
const $pager = $xeGrid.$refs.refPager;
|
|
932
954
|
if ($pager) {
|
|
933
|
-
|
|
955
|
+
$pager.endPageByEvent(evnt);
|
|
934
956
|
}
|
|
957
|
+
},
|
|
958
|
+
setCurrentPage(currentPage) {
|
|
959
|
+
const $xeGrid = this;
|
|
960
|
+
const reactData = $xeGrid.reactData;
|
|
961
|
+
const { tablePage } = reactData;
|
|
962
|
+
const pageCount = $xeGrid.computePageCount;
|
|
963
|
+
tablePage.currentPage = Math.min(pageCount, Math.max(1, XEUtils.toNumber(currentPage)));
|
|
935
964
|
return $xeGrid.$nextTick();
|
|
936
965
|
},
|
|
937
|
-
|
|
966
|
+
setCurrentPageByEvent(evnt, currentPage) {
|
|
938
967
|
const $xeGrid = this;
|
|
939
968
|
const $pager = $xeGrid.$refs.refPager;
|
|
940
969
|
if ($pager) {
|
|
941
|
-
|
|
970
|
+
$pager.setCurrentPageByEvent(evnt, currentPage);
|
|
942
971
|
}
|
|
972
|
+
},
|
|
973
|
+
setPageSize(pageSize) {
|
|
974
|
+
const $xeGrid = this;
|
|
975
|
+
const reactData = $xeGrid.reactData;
|
|
976
|
+
const { tablePage } = reactData;
|
|
977
|
+
tablePage.pageSize = Math.max(1, XEUtils.toNumber(pageSize));
|
|
943
978
|
return $xeGrid.$nextTick();
|
|
944
979
|
},
|
|
980
|
+
setPageSizeByEvent(evnt, pageSize) {
|
|
981
|
+
const $xeGrid = this;
|
|
982
|
+
const $pager = $xeGrid.$refs.refPager;
|
|
983
|
+
if ($pager) {
|
|
984
|
+
$pager.setPageSizeByEvent(evnt, pageSize);
|
|
985
|
+
}
|
|
986
|
+
},
|
|
945
987
|
triggerToolbarCommitEvent(params, evnt) {
|
|
946
988
|
const $xeGrid = this;
|
|
947
989
|
const { code } = params;
|
|
@@ -961,7 +1003,24 @@ export default {
|
|
|
961
1003
|
$xeGrid.triggerToolbarCommitEvent(tool, evnt);
|
|
962
1004
|
$xeGrid.dispatchEvent('toolbar-tool-click', { code: tool.code, tool }, evnt);
|
|
963
1005
|
},
|
|
964
|
-
|
|
1006
|
+
pageChangeEvent(params) {
|
|
1007
|
+
const $xeGrid = this;
|
|
1008
|
+
const props = $xeGrid;
|
|
1009
|
+
const reactData = $xeGrid.reactData;
|
|
1010
|
+
const { proxyConfig } = props;
|
|
1011
|
+
const { tablePage } = reactData;
|
|
1012
|
+
const { $event, currentPage, pageSize } = params;
|
|
1013
|
+
const proxyOpts = $xeGrid.computeProxyOpts;
|
|
1014
|
+
tablePage.currentPage = currentPage;
|
|
1015
|
+
tablePage.pageSize = pageSize;
|
|
1016
|
+
$xeGrid.dispatchEvent('page-change', params, $event);
|
|
1017
|
+
if (proxyConfig && isEnableConf(proxyOpts)) {
|
|
1018
|
+
$xeGrid.commitProxy('query').then((rest) => {
|
|
1019
|
+
$xeGrid.dispatchEvent('proxy-query', rest, $event);
|
|
1020
|
+
});
|
|
1021
|
+
}
|
|
1022
|
+
},
|
|
1023
|
+
handleSortEvent(params) {
|
|
965
1024
|
const $xeGrid = this;
|
|
966
1025
|
const props = $xeGrid;
|
|
967
1026
|
const reactData = $xeGrid.reactData;
|
|
@@ -979,26 +1038,18 @@ export default {
|
|
|
979
1038
|
});
|
|
980
1039
|
}
|
|
981
1040
|
}
|
|
1041
|
+
},
|
|
1042
|
+
sortChangeEvent(params) {
|
|
1043
|
+
const $xeGrid = this;
|
|
1044
|
+
$xeGrid.handleSortEvent(params);
|
|
982
1045
|
$xeGrid.dispatchEvent('sort-change', params, params.$event);
|
|
983
1046
|
},
|
|
984
|
-
|
|
1047
|
+
clearAllSortEvent(params) {
|
|
985
1048
|
const $xeGrid = this;
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
const { proxyConfig } = props;
|
|
989
|
-
const { tablePage } = reactData;
|
|
990
|
-
const { $event, currentPage, pageSize } = params;
|
|
991
|
-
const proxyOpts = $xeGrid.computeProxyOpts;
|
|
992
|
-
tablePage.currentPage = currentPage;
|
|
993
|
-
tablePage.pageSize = pageSize;
|
|
994
|
-
$xeGrid.dispatchEvent('page-change', params, $event);
|
|
995
|
-
if (proxyConfig && isEnableConf(proxyOpts)) {
|
|
996
|
-
$xeGrid.commitProxy('query').then((rest) => {
|
|
997
|
-
$xeGrid.dispatchEvent('proxy-query', rest, $event);
|
|
998
|
-
});
|
|
999
|
-
}
|
|
1049
|
+
$xeGrid.handleSortEvent(params);
|
|
1050
|
+
$xeGrid.dispatchEvent('clear-all-sort', params, params.$event);
|
|
1000
1051
|
},
|
|
1001
|
-
|
|
1052
|
+
handleFilterEvent(params) {
|
|
1002
1053
|
const $xeGrid = this;
|
|
1003
1054
|
const props = $xeGrid;
|
|
1004
1055
|
const reactData = $xeGrid.reactData;
|
|
@@ -1016,8 +1067,17 @@ export default {
|
|
|
1016
1067
|
});
|
|
1017
1068
|
}
|
|
1018
1069
|
}
|
|
1070
|
+
},
|
|
1071
|
+
filterChangeEvent(params) {
|
|
1072
|
+
const $xeGrid = this;
|
|
1073
|
+
$xeGrid.handleFilterEvent(params);
|
|
1019
1074
|
$xeGrid.dispatchEvent('filter-change', params, params.$event);
|
|
1020
1075
|
},
|
|
1076
|
+
clearAllFilterEvent(params) {
|
|
1077
|
+
const $xeGrid = this;
|
|
1078
|
+
$xeGrid.handleFilterEvent(params);
|
|
1079
|
+
$xeGrid.dispatchEvent('clear-all-filter', params, params.$event);
|
|
1080
|
+
},
|
|
1021
1081
|
submitFormEvent(params) {
|
|
1022
1082
|
const $xeGrid = this;
|
|
1023
1083
|
const props = $xeGrid;
|
|
@@ -1065,6 +1125,11 @@ export default {
|
|
|
1065
1125
|
$xeGrid.zoom();
|
|
1066
1126
|
$xeGrid.dispatchEvent('zoom', { type: reactData.isZMax ? 'max' : 'revert' }, evnt);
|
|
1067
1127
|
},
|
|
1128
|
+
getParams() {
|
|
1129
|
+
const $xeGrid = this;
|
|
1130
|
+
const props = $xeGrid;
|
|
1131
|
+
return props.params;
|
|
1132
|
+
},
|
|
1068
1133
|
zoom() {
|
|
1069
1134
|
const $xeGrid = this;
|
|
1070
1135
|
const reactData = $xeGrid.reactData;
|