vxe-table 3.8.5 → 3.8.6-beta.0
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/lib/custom/src/panel.js +10 -3
- package/lib/custom/src/panel.min.js +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.umd.js +76 -22
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/methods.js +64 -17
- package/lib/table/src/methods.min.js +1 -1
- package/lib/tools/log.js +1 -1
- package/lib/tools/log.min.js +1 -1
- package/lib/v-x-e-table/index.js +1 -1
- package/lib/v-x-e-table/index.min.js +1 -1
- package/package.json +1 -1
- package/packages/custom/src/panel.js +10 -3
- package/packages/table/src/methods.js +62 -14
- /package/lib/icon/style/{iconfont.1715055533745.ttf → iconfont.1715127150277.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1715055533745.woff → iconfont.1715127150277.woff} +0 -0
- /package/lib/icon/style/{iconfont.1715055533745.woff2 → iconfont.1715127150277.woff2} +0 -0
- /package/lib/{iconfont.1715055533745.ttf → iconfont.1715127150277.ttf} +0 -0
- /package/lib/{iconfont.1715055533745.woff → iconfont.1715127150277.woff} +0 -0
- /package/lib/{iconfont.1715055533745.woff2 → iconfont.1715127150277.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -11346,7 +11346,7 @@ var es_array_concat = __webpack_require__(8706);
|
|
|
11346
11346
|
|
|
11347
11347
|
|
|
11348
11348
|
function getLog(message, params) {
|
|
11349
|
-
return "[vxe-table v".concat("3.8.
|
|
11349
|
+
return "[vxe-table v".concat("3.8.6-beta.0", "] ").concat(conf.i18n(message, params));
|
|
11350
11350
|
}
|
|
11351
11351
|
function outLog(type) {
|
|
11352
11352
|
return function (message, params) {
|
|
@@ -13067,7 +13067,7 @@ var setup = config;
|
|
|
13067
13067
|
var globalStore = {};
|
|
13068
13068
|
var VXETable = {
|
|
13069
13069
|
v: v,
|
|
13070
|
-
version: "3.8.
|
|
13070
|
+
version: "3.8.6-beta.0",
|
|
13071
13071
|
reg: reg,
|
|
13072
13072
|
use: use,
|
|
13073
13073
|
setup: setup,
|
|
@@ -17139,13 +17139,22 @@ var Methods = {
|
|
|
17139
17139
|
return _this8.loadColumn(columns);
|
|
17140
17140
|
});
|
|
17141
17141
|
},
|
|
17142
|
+
initColumnSort: function initColumnSort() {
|
|
17143
|
+
var collectColumn = this.collectColumn;
|
|
17144
|
+
collectColumn.forEach(function (column, index) {
|
|
17145
|
+
var sortIndex = index + 1;
|
|
17146
|
+
column.sortNumber = sortIndex;
|
|
17147
|
+
column.renderSortNumber = sortIndex;
|
|
17148
|
+
});
|
|
17149
|
+
},
|
|
17142
17150
|
handleColumn: function handleColumn(collectColumn) {
|
|
17143
17151
|
var _this9 = this;
|
|
17144
17152
|
this.collectColumn = collectColumn;
|
|
17145
17153
|
var tableFullColumn = methods_getColumnList(collectColumn);
|
|
17146
17154
|
this.tableFullColumn = tableFullColumn;
|
|
17147
|
-
this.
|
|
17155
|
+
this.initColumnSort();
|
|
17148
17156
|
this.restoreCustomStorage();
|
|
17157
|
+
this.cacheColumnMap();
|
|
17149
17158
|
this.parseColumns().then(function () {
|
|
17150
17159
|
if (_this9.scrollXLoad) {
|
|
17151
17160
|
_this9.loadScrollXData(true);
|
|
@@ -17320,7 +17329,7 @@ var Methods = {
|
|
|
17320
17329
|
* 更新数据列的 Map
|
|
17321
17330
|
* 牺牲数据组装的耗时,用来换取使用过程中的流畅
|
|
17322
17331
|
*/
|
|
17323
|
-
cacheColumnMap: function cacheColumnMap(
|
|
17332
|
+
cacheColumnMap: function cacheColumnMap() {
|
|
17324
17333
|
var _this13 = this;
|
|
17325
17334
|
var tableFullColumn = this.tableFullColumn,
|
|
17326
17335
|
collectColumn = this.collectColumn,
|
|
@@ -17381,9 +17390,6 @@ var Methods = {
|
|
|
17381
17390
|
if (fullColumnIdData[colid]) {
|
|
17382
17391
|
errLog('vxe.error.colRepet', ['colId', colid]);
|
|
17383
17392
|
}
|
|
17384
|
-
if (isInit) {
|
|
17385
|
-
column.sortNumber = index;
|
|
17386
|
-
}
|
|
17387
17393
|
fullColumnIdData[colid] = rest;
|
|
17388
17394
|
fullColumnMap.set(column, rest);
|
|
17389
17395
|
};
|
|
@@ -18336,6 +18342,9 @@ var Methods = {
|
|
|
18336
18342
|
if (opts.resizable) {
|
|
18337
18343
|
this.saveCustomResizable(true);
|
|
18338
18344
|
}
|
|
18345
|
+
if (opts.sort) {
|
|
18346
|
+
this.saveCustomSort(true);
|
|
18347
|
+
}
|
|
18339
18348
|
if (opts.fixed) {
|
|
18340
18349
|
this.saveCustomFixed();
|
|
18341
18350
|
}
|
|
@@ -18353,6 +18362,7 @@ var Methods = {
|
|
|
18353
18362
|
}
|
|
18354
18363
|
}
|
|
18355
18364
|
this.saveCustomVisible();
|
|
18365
|
+
this.saveCustomSort();
|
|
18356
18366
|
this.analyColumnWidth();
|
|
18357
18367
|
return this.refreshColumn(true);
|
|
18358
18368
|
},
|
|
@@ -18361,7 +18371,6 @@ var Methods = {
|
|
|
18361
18371
|
*/
|
|
18362
18372
|
restoreCustomStorage: function restoreCustomStorage() {
|
|
18363
18373
|
var id = this.id,
|
|
18364
|
-
collectColumn = this.collectColumn,
|
|
18365
18374
|
customConfig = this.customConfig,
|
|
18366
18375
|
customOpts = this.customOpts;
|
|
18367
18376
|
var storage = customOpts.storage;
|
|
@@ -18410,22 +18419,21 @@ var Methods = {
|
|
|
18410
18419
|
}
|
|
18411
18420
|
}
|
|
18412
18421
|
// 自定义顺序
|
|
18422
|
+
var hasCustomSort = false;
|
|
18413
18423
|
if (isCustomSort) {
|
|
18414
18424
|
var columnSortStorage = getCustomStorageMap(sortStorageKey)[id];
|
|
18415
18425
|
if (columnSortStorage) {
|
|
18416
|
-
|
|
18417
|
-
colOrderSeqs.forEach(function (orderConf) {
|
|
18418
|
-
var _orderConf$split = orderConf.split('|'),
|
|
18419
|
-
_orderConf$split2 = _slicedToArray(_orderConf$split, 2),
|
|
18420
|
-
colKey = _orderConf$split2[0],
|
|
18421
|
-
sortNumber = _orderConf$split2[1];
|
|
18426
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(columnSortStorage, function (renderSortNumber, colKey) {
|
|
18422
18427
|
if (customMap[colKey]) {
|
|
18423
|
-
customMap[colKey].
|
|
18428
|
+
customMap[colKey].renderSortNumber = renderSortNumber;
|
|
18424
18429
|
} else {
|
|
18425
18430
|
customMap[colKey] = {
|
|
18426
|
-
|
|
18431
|
+
renderSortNumber: renderSortNumber
|
|
18427
18432
|
};
|
|
18428
18433
|
}
|
|
18434
|
+
if (!hasCustomSort) {
|
|
18435
|
+
hasCustomSort = true;
|
|
18436
|
+
}
|
|
18429
18437
|
});
|
|
18430
18438
|
}
|
|
18431
18439
|
}
|
|
@@ -18457,6 +18465,7 @@ var Methods = {
|
|
|
18457
18465
|
});
|
|
18458
18466
|
}
|
|
18459
18467
|
}
|
|
18468
|
+
var collectColumn = this.collectColumn;
|
|
18460
18469
|
var keyMap = {};
|
|
18461
18470
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, function (column) {
|
|
18462
18471
|
var colKey = column.getKey();
|
|
@@ -18468,7 +18477,7 @@ var Methods = {
|
|
|
18468
18477
|
var visible = _ref5.visible,
|
|
18469
18478
|
resizeWidth = _ref5.resizeWidth,
|
|
18470
18479
|
fixed = _ref5.fixed,
|
|
18471
|
-
|
|
18480
|
+
renderSortNumber = _ref5.renderSortNumber;
|
|
18472
18481
|
var column = keyMap[field];
|
|
18473
18482
|
if (column) {
|
|
18474
18483
|
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(resizeWidth)) {
|
|
@@ -18480,11 +18489,17 @@ var Methods = {
|
|
|
18480
18489
|
if (fixed) {
|
|
18481
18490
|
column.fixed = fixed;
|
|
18482
18491
|
}
|
|
18483
|
-
if (
|
|
18484
|
-
column.
|
|
18492
|
+
if (renderSortNumber) {
|
|
18493
|
+
column.renderSortNumber = Number(renderSortNumber);
|
|
18485
18494
|
}
|
|
18486
18495
|
}
|
|
18487
18496
|
});
|
|
18497
|
+
// 如果自定义了顺序
|
|
18498
|
+
if (hasCustomSort) {
|
|
18499
|
+
collectColumn = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(collectColumn, 'renderSortNumber');
|
|
18500
|
+
this.collectColumn = collectColumn;
|
|
18501
|
+
this.tableFullColumn = methods_getColumnList(collectColumn);
|
|
18502
|
+
}
|
|
18488
18503
|
}
|
|
18489
18504
|
},
|
|
18490
18505
|
saveCustomFixed: function saveCustomFixed() {
|
|
@@ -18585,6 +18600,38 @@ var Methods = {
|
|
|
18585
18600
|
localStorage.setItem(resizableStorageKey, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toJSONString(columnWidthStorageMap));
|
|
18586
18601
|
}
|
|
18587
18602
|
},
|
|
18603
|
+
saveCustomSort: function saveCustomSort(isReset) {
|
|
18604
|
+
var id = this.id,
|
|
18605
|
+
collectColumn = this.collectColumn,
|
|
18606
|
+
customConfig = this.customConfig,
|
|
18607
|
+
customOpts = this.customOpts;
|
|
18608
|
+
var storage = customOpts.storage;
|
|
18609
|
+
var isAllStorage = storage === true;
|
|
18610
|
+
var storageOpts = isAllStorage ? {} : Object.assign({}, storage || {});
|
|
18611
|
+
var isSort = isAllStorage || storageOpts.sort;
|
|
18612
|
+
if (customConfig && isSort) {
|
|
18613
|
+
var columnSortStorageMap = getCustomStorageMap(sortStorageKey);
|
|
18614
|
+
var columnWidthStorage;
|
|
18615
|
+
if (!id) {
|
|
18616
|
+
errLog('vxe.error.reqProp', ['id']);
|
|
18617
|
+
return;
|
|
18618
|
+
}
|
|
18619
|
+
if (!isReset) {
|
|
18620
|
+
columnWidthStorage = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isPlainObject(columnSortStorageMap[id]) ? columnSortStorageMap[id] : {};
|
|
18621
|
+
// 排序只支持一级
|
|
18622
|
+
collectColumn.forEach(function (column) {
|
|
18623
|
+
if (column.sortNumber !== column.renderSortNumber) {
|
|
18624
|
+
var colKey = column.getKey();
|
|
18625
|
+
if (colKey) {
|
|
18626
|
+
columnWidthStorage[colKey] = column.renderSortNumber;
|
|
18627
|
+
}
|
|
18628
|
+
}
|
|
18629
|
+
});
|
|
18630
|
+
}
|
|
18631
|
+
columnSortStorageMap[id] = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isEmpty(columnWidthStorage) ? undefined : columnWidthStorage;
|
|
18632
|
+
localStorage.setItem(sortStorageKey, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toJSONString(columnSortStorageMap));
|
|
18633
|
+
}
|
|
18634
|
+
},
|
|
18588
18635
|
handleUpdateDataQueue: function handleUpdateDataQueue() {
|
|
18589
18636
|
this.upDataFlag++;
|
|
18590
18637
|
},
|
|
@@ -35050,9 +35097,7 @@ function renderPopupPanel(h, _vm) {
|
|
|
35050
35097
|
panel_removeClass(trEl, 'active--drag-target');
|
|
35051
35098
|
panel_removeClass(trEl, 'active--drag-origin');
|
|
35052
35099
|
// 更新顺序
|
|
35053
|
-
|
|
35054
|
-
column.renderSortNumber = index;
|
|
35055
|
-
});
|
|
35100
|
+
this.updateColumnSort();
|
|
35056
35101
|
},
|
|
35057
35102
|
sortDragoverEvent: function sortDragoverEvent(evnt) {
|
|
35058
35103
|
var $xetable = this.$xetable,
|
|
@@ -35073,6 +35118,15 @@ function renderPopupPanel(h, _vm) {
|
|
|
35073
35118
|
this.prevDropTrEl = trEl;
|
|
35074
35119
|
}
|
|
35075
35120
|
updateDropHint(this, evnt);
|
|
35121
|
+
},
|
|
35122
|
+
updateColumnSort: function updateColumnSort() {
|
|
35123
|
+
var $xetable = this.$xetable;
|
|
35124
|
+
var customColumnList = $xetable.customColumnList;
|
|
35125
|
+
// 更新顺序
|
|
35126
|
+
customColumnList.forEach(function (column, index) {
|
|
35127
|
+
var sortIndex = index + 1;
|
|
35128
|
+
column.renderSortNumber = sortIndex;
|
|
35129
|
+
});
|
|
35076
35130
|
}
|
|
35077
35131
|
}
|
|
35078
35132
|
});
|