vxe-table 3.23.0-beta.1 → 3.23.0-beta.2
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/locale/lang/ar-EG.js +2 -0
- package/es/locale/lang/de-DE.js +2 -0
- package/es/locale/lang/en-US.js +2 -0
- package/es/locale/lang/es-ES.js +2 -0
- package/es/locale/lang/fr-FR.js +2 -0
- package/es/locale/lang/hu-HU.js +2 -0
- package/es/locale/lang/hy-AM.js +2 -0
- package/es/locale/lang/id-ID.js +2 -0
- package/es/locale/lang/it-IT.js +2 -0
- package/es/locale/lang/ja-JP.js +2 -0
- package/es/locale/lang/ko-KR.js +2 -0
- package/es/locale/lang/ms-MY.js +2 -0
- package/es/locale/lang/nb-NO.js +2 -0
- package/es/locale/lang/pt-BR.js +2 -0
- package/es/locale/lang/ru-RU.js +2 -0
- package/es/locale/lang/th-TH.js +2 -0
- package/es/locale/lang/ug-CN.js +2 -0
- package/es/locale/lang/uk-UA.js +2 -0
- package/es/locale/lang/uz-UZ.js +2 -0
- package/es/locale/lang/vi-VN.js +2 -0
- package/es/locale/lang/zh-CHT.js +2 -0
- package/es/locale/lang/zh-CN.js +2 -0
- package/es/style.css +1 -1
- package/es/table/module/export/mixin.js +80 -4
- package/es/table/src/methods.js +3 -0
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +89 -10
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +2 -0
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/ar-EG.umd.js +2 -0
- package/lib/locale/lang/de-DE.js +2 -0
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/de-DE.umd.js +2 -0
- package/lib/locale/lang/en-US.js +2 -0
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +2 -0
- package/lib/locale/lang/es-ES.js +2 -0
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +2 -0
- package/lib/locale/lang/fr-FR.js +2 -0
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/fr-FR.umd.js +2 -0
- package/lib/locale/lang/hu-HU.js +2 -0
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +2 -0
- package/lib/locale/lang/hy-AM.js +2 -0
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/hy-AM.umd.js +2 -0
- package/lib/locale/lang/id-ID.js +2 -0
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/id-ID.umd.js +2 -0
- package/lib/locale/lang/it-IT.js +2 -0
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/it-IT.umd.js +2 -0
- package/lib/locale/lang/ja-JP.js +2 -0
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +2 -0
- package/lib/locale/lang/ko-KR.js +2 -0
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +2 -0
- package/lib/locale/lang/ms-MY.js +2 -0
- package/lib/locale/lang/ms-MY.min.js +1 -1
- package/lib/locale/lang/ms-MY.umd.js +2 -0
- package/lib/locale/lang/nb-NO.js +2 -0
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/nb-NO.umd.js +2 -0
- package/lib/locale/lang/pt-BR.js +2 -0
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +2 -0
- package/lib/locale/lang/ru-RU.js +2 -0
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +2 -0
- package/lib/locale/lang/th-TH.js +2 -0
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/th-TH.umd.js +2 -0
- package/lib/locale/lang/ug-CN.js +2 -0
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/ug-CN.umd.js +2 -0
- package/lib/locale/lang/uk-UA.js +2 -0
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +2 -0
- package/lib/locale/lang/uz-UZ.js +2 -0
- package/lib/locale/lang/uz-UZ.min.js +1 -1
- package/lib/locale/lang/uz-UZ.umd.js +2 -0
- package/lib/locale/lang/vi-VN.js +2 -0
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/vi-VN.umd.js +2 -0
- package/lib/locale/lang/zh-CHT.js +2 -0
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +2 -0
- package/lib/locale/lang/zh-CN.js +2 -0
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +2 -0
- package/lib/style.css +1 -1
- package/lib/table/module/export/mixin.js +84 -7
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/src/methods.js +1 -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 +2 -2
- package/packages/locale/lang/ar-EG.ts +2 -0
- package/packages/locale/lang/de-DE.ts +2 -0
- package/packages/locale/lang/en-US.ts +2 -0
- package/packages/locale/lang/es-ES.ts +2 -0
- package/packages/locale/lang/fr-FR.ts +2 -0
- package/packages/locale/lang/hu-HU.ts +2 -0
- package/packages/locale/lang/hy-AM.ts +2 -0
- package/packages/locale/lang/id-ID.ts +2 -0
- package/packages/locale/lang/it-IT.ts +2 -0
- package/packages/locale/lang/ja-JP.ts +2 -0
- package/packages/locale/lang/ko-KR.ts +2 -0
- package/packages/locale/lang/ms-MY.ts +2 -0
- package/packages/locale/lang/nb-NO.ts +2 -0
- package/packages/locale/lang/pt-BR.ts +2 -0
- package/packages/locale/lang/ru-RU.ts +2 -0
- package/packages/locale/lang/th-TH.ts +2 -0
- package/packages/locale/lang/ug-CN.ts +2 -0
- package/packages/locale/lang/uk-UA.ts +2 -0
- package/packages/locale/lang/uz-UZ.ts +2 -0
- package/packages/locale/lang/vi-VN.ts +2 -0
- package/packages/locale/lang/zh-CHT.ts +2 -0
- package/packages/locale/lang/zh-CN.ts +2 -0
- package/packages/table/module/export/mixin.ts +77 -4
- package/packages/table/src/methods.ts +3 -0
- /package/es/{iconfont.1787020799795.ttf → iconfont.1787119200875.ttf} +0 -0
- /package/es/{iconfont.1787020799795.woff → iconfont.1787119200875.woff} +0 -0
- /package/es/{iconfont.1787020799795.woff2 → iconfont.1787119200875.woff2} +0 -0
- /package/lib/{iconfont.1787020799795.ttf → iconfont.1787119200875.ttf} +0 -0
- /package/lib/{iconfont.1787020799795.woff → iconfont.1787119200875.woff} +0 -0
- /package/lib/{iconfont.1787020799795.woff2 → iconfont.1787119200875.woff2} +0 -0
|
@@ -1586,7 +1586,16 @@ export default {
|
|
|
1586
1586
|
}
|
|
1587
1587
|
if (!handleOptions.print) {
|
|
1588
1588
|
if (beforeExportMethod) {
|
|
1589
|
-
beforeExportMethod({ options: handleOptions, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt });
|
|
1589
|
+
const beRest = beforeExportMethod({ options: handleOptions, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt });
|
|
1590
|
+
if (XEUtils.isBoolean(beRest)) {
|
|
1591
|
+
if (!beRest) {
|
|
1592
|
+
const params = { status: false };
|
|
1593
|
+
return Promise.reject(params);
|
|
1594
|
+
}
|
|
1595
|
+
}
|
|
1596
|
+
else {
|
|
1597
|
+
warnLog('vxe.error.returnErr', ['beforeExportMethod', 'boolean', beRest]);
|
|
1598
|
+
}
|
|
1590
1599
|
}
|
|
1591
1600
|
}
|
|
1592
1601
|
if (!handleOptions.data) {
|
|
@@ -1694,13 +1703,22 @@ export default {
|
|
|
1694
1703
|
const opts = Object.assign({}, options);
|
|
1695
1704
|
const { beforeImportMethod } = opts;
|
|
1696
1705
|
if (beforeImportMethod) {
|
|
1697
|
-
beforeImportMethod({ options: opts, $table: $xeTable });
|
|
1706
|
+
const biRest = beforeImportMethod({ options: opts, $table: $xeTable });
|
|
1707
|
+
if (XEUtils.isBoolean(biRest)) {
|
|
1708
|
+
if (!biRest) {
|
|
1709
|
+
const params = { status: false };
|
|
1710
|
+
return Promise.reject(params);
|
|
1711
|
+
}
|
|
1712
|
+
}
|
|
1713
|
+
else {
|
|
1714
|
+
warnLog('vxe.error.returnErr', ['beforeImportMethod', 'boolean', biRest]);
|
|
1715
|
+
}
|
|
1698
1716
|
}
|
|
1699
1717
|
return handleFileImport($xeTable, file, opts);
|
|
1700
1718
|
},
|
|
1701
1719
|
_importData(options) {
|
|
1702
1720
|
const $xeTable = this;
|
|
1703
|
-
const
|
|
1721
|
+
const importOpts = $xeTable.computeImportOpts;
|
|
1704
1722
|
const opts = Object.assign({
|
|
1705
1723
|
types: XEUtils.keys(importOpts._typeMaps)
|
|
1706
1724
|
// beforeImportMethod: null,
|
|
@@ -1708,7 +1726,16 @@ export default {
|
|
|
1708
1726
|
}, importOpts, options);
|
|
1709
1727
|
const { beforeImportMethod, afterImportMethod } = opts;
|
|
1710
1728
|
if (beforeImportMethod) {
|
|
1711
|
-
beforeImportMethod({ options: opts, $table:
|
|
1729
|
+
const biRest = beforeImportMethod({ options: opts, $table: $xeTable });
|
|
1730
|
+
if (XEUtils.isBoolean(biRest)) {
|
|
1731
|
+
if (!biRest) {
|
|
1732
|
+
const params = { status: false };
|
|
1733
|
+
return Promise.reject(params);
|
|
1734
|
+
}
|
|
1735
|
+
}
|
|
1736
|
+
else {
|
|
1737
|
+
warnLog('vxe.error.returnErr', ['beforeImportMethod', 'boolean', biRest]);
|
|
1738
|
+
}
|
|
1712
1739
|
}
|
|
1713
1740
|
return VxeUI.readFile(opts).catch(e => {
|
|
1714
1741
|
if (afterImportMethod) {
|
|
@@ -1759,6 +1786,7 @@ export default {
|
|
|
1759
1786
|
printTitle = document.title || '';
|
|
1760
1787
|
}
|
|
1761
1788
|
const beforePrintMethod = opts.beforePrintMethod;
|
|
1789
|
+
const printMethod = opts.printMethod;
|
|
1762
1790
|
const tableHtml = opts.html || opts.content;
|
|
1763
1791
|
return new Promise((resolve, reject) => {
|
|
1764
1792
|
if (VxeUI.print) {
|
|
@@ -1778,6 +1806,30 @@ export default {
|
|
|
1778
1806
|
$gantt: $xeGantt
|
|
1779
1807
|
});
|
|
1780
1808
|
}
|
|
1809
|
+
: undefined,
|
|
1810
|
+
beforePrintMethod: beforePrintMethod
|
|
1811
|
+
? ({ html }) => {
|
|
1812
|
+
return beforePrintMethod({
|
|
1813
|
+
html,
|
|
1814
|
+
content: html,
|
|
1815
|
+
options: opts,
|
|
1816
|
+
$table: $xeTable,
|
|
1817
|
+
$grid: $xeGrid,
|
|
1818
|
+
$gantt: $xeGantt
|
|
1819
|
+
});
|
|
1820
|
+
}
|
|
1821
|
+
: undefined,
|
|
1822
|
+
printMethod: printMethod
|
|
1823
|
+
? ({ html }) => {
|
|
1824
|
+
return printMethod({
|
|
1825
|
+
html,
|
|
1826
|
+
content: html,
|
|
1827
|
+
options: opts,
|
|
1828
|
+
$table: $xeTable,
|
|
1829
|
+
$grid: $xeGrid,
|
|
1830
|
+
$gantt: $xeGantt
|
|
1831
|
+
});
|
|
1832
|
+
}
|
|
1781
1833
|
: undefined
|
|
1782
1834
|
}));
|
|
1783
1835
|
}
|
|
@@ -1798,6 +1850,30 @@ export default {
|
|
|
1798
1850
|
$gantt: $xeGantt
|
|
1799
1851
|
});
|
|
1800
1852
|
}
|
|
1853
|
+
: undefined,
|
|
1854
|
+
beforePrintMethod: beforePrintMethod
|
|
1855
|
+
? ({ html }) => {
|
|
1856
|
+
return beforePrintMethod({
|
|
1857
|
+
html,
|
|
1858
|
+
content: html,
|
|
1859
|
+
options: opts,
|
|
1860
|
+
$table: $xeTable,
|
|
1861
|
+
$grid: $xeGrid,
|
|
1862
|
+
$gantt: $xeGantt
|
|
1863
|
+
});
|
|
1864
|
+
}
|
|
1865
|
+
: undefined,
|
|
1866
|
+
printMethod: printMethod
|
|
1867
|
+
? ({ html }) => {
|
|
1868
|
+
return printMethod({
|
|
1869
|
+
html,
|
|
1870
|
+
content: html,
|
|
1871
|
+
options: opts,
|
|
1872
|
+
$table: $xeTable,
|
|
1873
|
+
$grid: $xeGrid,
|
|
1874
|
+
$gantt: $xeGantt
|
|
1875
|
+
});
|
|
1876
|
+
}
|
|
1801
1877
|
: undefined
|
|
1802
1878
|
});
|
|
1803
1879
|
}));
|
package/es/table/src/methods.js
CHANGED
|
@@ -4076,6 +4076,9 @@ function handleSyncScroll($xeTable, isRollX, isRollY) {
|
|
|
4076
4076
|
xRest = $xeTable.updateScrollXData();
|
|
4077
4077
|
}
|
|
4078
4078
|
if (isRollY && scrollYLoad) {
|
|
4079
|
+
if (autoWidthColumnList.length) {
|
|
4080
|
+
calcCellWidth($xeTable);
|
|
4081
|
+
}
|
|
4079
4082
|
yRest = $xeTable.updateScrollYData().then(() => {
|
|
4080
4083
|
if (autoWidthColumnList.length) {
|
|
4081
4084
|
calcCellWidth($xeTable);
|
package/es/ui/index.js
CHANGED
package/es/ui/src/log.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VxeUI } from '@vxe-ui/core';
|
|
2
2
|
const { log } = VxeUI;
|
|
3
|
-
const tableVersion = `table v${"3.23.0-beta.
|
|
3
|
+
const tableVersion = `table v${"3.23.0-beta.2"}`;
|
|
4
4
|
export function createComponentLog(name) {
|
|
5
5
|
const uiVersion = VxeUI.uiVersion ? `ui v${VxeUI.uiVersion}` : '';
|
|
6
6
|
const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : '';
|
package/lib/index.umd.js
CHANGED
|
@@ -3311,7 +3311,7 @@ function getClass(property, params) {
|
|
|
3311
3311
|
/* unused harmony import specifier */ var VxeUI;
|
|
3312
3312
|
|
|
3313
3313
|
|
|
3314
|
-
const version = "3.23.0-beta.
|
|
3314
|
+
const version = "3.23.0-beta.2";
|
|
3315
3315
|
core_.VxeUI.version = version;
|
|
3316
3316
|
core_.VxeUI.tableVersion = version;
|
|
3317
3317
|
core_.VxeUI.setConfig({
|
|
@@ -4105,7 +4105,7 @@ function getPopupContainer(appendTo) {
|
|
|
4105
4105
|
const {
|
|
4106
4106
|
log: log_log
|
|
4107
4107
|
} = core_.VxeUI;
|
|
4108
|
-
const tableVersion = `table v${"3.23.0-beta.
|
|
4108
|
+
const tableVersion = `table v${"3.23.0-beta.2"}`;
|
|
4109
4109
|
function createComponentLog(name) {
|
|
4110
4110
|
const uiVersion = core_.VxeUI.uiVersion ? `ui v${core_.VxeUI.uiVersion}` : '';
|
|
4111
4111
|
const ganttVersion = core_.VxeUI.ganttVersion ? `gantt v${core_.VxeUI.ganttVersion}` : '';
|
|
@@ -8034,7 +8034,7 @@ if(props.spanMethod){methods_warnLog('vxe.error.scrollErrProp',['span-method']);
|
|
|
8034
8034
|
// 如果列被设置为固定,则清除合并状态
|
|
8035
8035
|
if(visibleColumn.length!==internalData.visibleColumn.length||!internalData.visibleColumn.every((column,index)=>column===visibleColumn[index])){$xeTable.clearMergeCells();$xeTable.clearMergeFooterItems();}visibleColumn.forEach((column,index)=>{const colid=column.id;const colRest=fullColumnIdData[colid];if(colRest){colRest._index=index;}});handleTableColumn($xeTable);handleUpdateAggValues($xeTable);if(isReset){return $xeTable.updateFooter().then(()=>{return $xeTable.recalculate();}).then(()=>{$xeTable.updateCellAreas();return $xeTable.recalculate();});}return $xeTable.updateFooter();}function initColumnHierarchy($xeTable){const internalData=$xeTable;const{collectColumn}=internalData;const fullColIdData={};const fullColFieldData={};let sortIndex=1;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn,(column,index,items,path,parentColumn)=>{const{id:colid,field}=column;const parentId=parentColumn?parentColumn.id:null;const rest={$index:-1,_index:-1,column,colid,index,items,parent:parentColumn||null,width:0,oLeft:0};column.parentId=parentId;column.defaultParentId=parentId;column.sortNumber=sortIndex;column.renderSortNumber=sortIndex;sortIndex++;if(field){if(fullColFieldData[field]){methods_errLog('vxe.error.colRepet',['field',field]);}fullColFieldData[field]=rest;}fullColIdData[colid]=rest;});internalData.fullColumnIdData=fullColIdData;internalData.fullColumnFieldData=fullColFieldData;}function buildColumnInfo($xeTable){const props=$xeTable;const $xeToolbar=$xeTable.$refs.$xeToolbar;const reactData=$xeTable;const internalData=$xeTable;const{scrollXLoad,scrollYLoad,expandColumn}=reactData;const expandOpts=$xeTable.computeExpandOpts;cacheColumnMap($xeTable);parseColumns($xeTable,true).then(()=>{if(reactData.scrollXLoad){loadScrollXData($xeTable);}});$xeTable.clearHeaderFormatterCache();$xeTable.clearMergeCells();$xeTable.clearMergeFooterItems();$xeTable.handleTableData(true);$xeTable.handleAggregateSummaryData();if((scrollXLoad||scrollYLoad)&&expandColumn&&expandOpts.mode!=='fixed'){methods_warnLog('vxe.error.scrollErrProp',['column.type=expand']);}return $xeTable.$nextTick().then(()=>{if($xeToolbar){$xeToolbar.syncUpdate({collectColumn:internalData.collectColumn,$table:$xeTable});}if($xeTable.handleUpdateCustomColumn){$xeTable.handleUpdateCustomColumn();}const columnOpts=$xeTable.computeColumnOpts;if(props.showCustomHeader&&reactData.isGroup&&(columnOpts.resizable||props.resizable)){methods_warnLog('vxe.error.notConflictProp',['show-custom-header & colgroup','column-config.resizable=false']);}reactData.isColLoading=false;return handleLazyRecalculate($xeTable,false,true,true);});}function handleInitColumn($xeTable,collectColumn){const reactData=$xeTable;const internalData=$xeTable;internalData.collectColumn=collectColumn;const tFullColumn=getColumnList(collectColumn);internalData.tableFullColumn=tFullColumn;reactData.updateColFlag++;reactData.isColLoading=true;initColumnHierarchy($xeTable);return Promise.resolve(restoreCustomStorage($xeTable)).then(()=>{return buildColumnInfo($xeTable);});}/**
|
|
8036
8036
|
* 纵向 Y 可视渲染处理
|
|
8037
|
-
*/function loadScrollYData($xeTable){const reactData=$xeTable;const internalData=$xeTable;const{isAllOverflow,isScrollYBig}=reactData;const{mergeBodyList,mergeBodyRowMaps,scrollYStore}=internalData;const{preloadSize,startIndex,endIndex,offsetSize}=scrollYStore;const autoOffsetYSize=isAllOverflow?offsetSize:offsetSize+1;const{toVisibleIndex,visibleSize}=handleVirtualYVisible($xeTable);const offsetItem={startIndex:Math.max(0,isScrollYBig?toVisibleIndex-1:toVisibleIndex-1-offsetSize-preloadSize),endIndex:isScrollYBig?toVisibleIndex+visibleSize:toVisibleIndex+visibleSize+autoOffsetYSize+preloadSize};scrollYStore.visibleStartIndex=toVisibleIndex-1;scrollYStore.visibleEndIndex=toVisibleIndex+visibleSize+1;calculateMergerOffsetIndex(mergeBodyList,mergeBodyRowMaps,offsetItem,'row');const{startIndex:offsetStartIndex,endIndex:offsetEndIndex}=offsetItem;if(toVisibleIndex<=startIndex||toVisibleIndex>=endIndex-visibleSize-1){if(startIndex!==offsetStartIndex||endIndex!==offsetEndIndex){scrollYStore.startIndex=offsetStartIndex;scrollYStore.endIndex=offsetEndIndex;$xeTable.updateScrollYData();}}}const createGetRowCacheProp=prop=>{return function(row){const $xeTable=this;const internalData=$xeTable;const{fullAllDataRowIdData}=internalData;if(row){const rowid=getRowid($xeTable,row);const rowRest=fullAllDataRowIdData[rowid];if(rowRest){return rowRest[prop];}}return-1;};};const createGetColumnCacheProp=prop=>{return function(column){const $xeTable=this;const internalData=$xeTable;const{fullColumnIdData}=internalData;if(column){const colRest=fullColumnIdData[column.id];if(colRest){return colRest[prop];}}return-1;};};function lazyScrollXData($xeTable){const internalData=$xeTable;const{lxTimeout,lxRunTime,scrollXStore}=internalData;const{visibleSize}=scrollXStore;const fpsTime=visibleSize>26?26:visibleSize>16?14:6;if(lxTimeout){clearTimeout(lxTimeout);}if(!lxRunTime||lxRunTime+fpsTime<Date.now()){internalData.lxRunTime=Date.now();loadScrollXData($xeTable);}internalData.lxTimeout=setTimeout(()=>{internalData.lxTimeout=undefined;internalData.lxRunTime=undefined;loadScrollXData($xeTable);},fpsTime);}function lazyScrollYData($xeTable){const internalData=$xeTable;const{lyTimeout,lyRunTime,scrollYStore}=internalData;const{visibleSize}=scrollYStore;const fpsTime=visibleSize>30?32:visibleSize>20?18:8;if(lyTimeout){clearTimeout(lyTimeout);}if(!lyRunTime||lyRunTime+fpsTime<Date.now()){internalData.lyRunTime=Date.now();loadScrollYData($xeTable);}internalData.lyTimeout=setTimeout(()=>{internalData.lyTimeout=undefined;internalData.lyRunTime=undefined;loadScrollYData($xeTable);},fpsTime);}function handleSyncScroll($xeTable,isRollX,isRollY){const reactData=$xeTable;const internalData=$xeTable;const{scrollXLoad,scrollYLoad,isAllOverflow}=reactData;const autoWidthColumnList=$xeTable.computeAutoWidthColumnList;internalData.lcsRunTime=Date.now();internalData.lcsTimeout=undefined;internalData.intoRunScroll=false;internalData.inVirtualScroll=false;internalData.inWheelScroll=false;internalData.inHeaderScroll=false;internalData.inBodyScroll=false;internalData.inFooterScroll=false;reactData.lazScrollLoading=false;internalData.scrollRenderType='';let xRest=null;let yRest=null;if(!isAllOverflow){calcCellHeight($xeTable);updateRowOffsetTop($xeTable);}if(isRollX&&scrollXLoad){xRest=$xeTable.updateScrollXData();}if(isRollY&&scrollYLoad){yRest=$xeTable.updateScrollYData().then(()=>{if(autoWidthColumnList.length){calcCellWidth($xeTable);autoCellWidth($xeTable);}if(!isAllOverflow){calcCellHeight($xeTable);updateRowOffsetTop($xeTable);}return $xeTable.updateScrollYSpace();});}updateRowExpandStyle($xeTable);return Promise.all([xRest,yRest,scrollXLoad||scrollYLoad?$xeTable.updateCellAreas():null]);}function checkLastSyncScroll($xeTable,isRollX,isRollY){const reactData=$xeTable;const internalData=$xeTable;const{lcsTimeout}=internalData;reactData.lazScrollLoading=true;if(lcsTimeout){clearTimeout(lcsTimeout);}internalData.lcsTimeout=setTimeout(()=>{handleSyncScroll($xeTable,isRollX,isRollY).then(()=>{if(reactData.scrollXLoad||reactData.scrollYLoad){$xeTable.$nextTick(()=>{updateRowExpandStyle($xeTable);if(!internalData.lcsTimeout){handleSyncScroll($xeTable,isRollX,isRollY);}});}});},240);}const getWheelSpeed=lastScrollTime=>{let multiple=1;const currTime=Date.now();if(lastScrollTime+25>currTime){multiple=1.18;}else if(lastScrollTime+30>currTime){multiple=1.15;}else if(lastScrollTime+40>currTime){multiple=1.12;}else if(lastScrollTime+55>currTime){multiple=1.09;}else if(lastScrollTime+75>currTime){multiple=1.06;}else if(lastScrollTime+100>currTime){multiple=1.03;}return multiple;};const syncGanttScrollTop=($xeTable,scrollTop)=>{const internalData=$xeTable;const $xeGanttView=internalData.xeGanttView;if($xeGanttView){const ganttInternalData=$xeGanttView.internalData;const{elemStore:ganttElemStore}=ganttInternalData;const ganttBodyScrollElem=getRefElem(ganttElemStore['main-body-scroll']);if(ganttBodyScrollElem){ganttBodyScrollElem.scrollTop=scrollTop;}}};function updateHeight($xeTable){const reactData=$xeTable;const internalData=$xeTable;internalData.customHeight=calcTableHeight($xeTable,'height');internalData.customMinHeight=calcTableHeight($xeTable,'minHeight');internalData.customMaxHeight=calcTableHeight($xeTable,'maxHeight');// 如果启用虚拟滚动,纠正高度
|
|
8037
|
+
*/function loadScrollYData($xeTable){const reactData=$xeTable;const internalData=$xeTable;const{isAllOverflow,isScrollYBig}=reactData;const{mergeBodyList,mergeBodyRowMaps,scrollYStore}=internalData;const{preloadSize,startIndex,endIndex,offsetSize}=scrollYStore;const autoOffsetYSize=isAllOverflow?offsetSize:offsetSize+1;const{toVisibleIndex,visibleSize}=handleVirtualYVisible($xeTable);const offsetItem={startIndex:Math.max(0,isScrollYBig?toVisibleIndex-1:toVisibleIndex-1-offsetSize-preloadSize),endIndex:isScrollYBig?toVisibleIndex+visibleSize:toVisibleIndex+visibleSize+autoOffsetYSize+preloadSize};scrollYStore.visibleStartIndex=toVisibleIndex-1;scrollYStore.visibleEndIndex=toVisibleIndex+visibleSize+1;calculateMergerOffsetIndex(mergeBodyList,mergeBodyRowMaps,offsetItem,'row');const{startIndex:offsetStartIndex,endIndex:offsetEndIndex}=offsetItem;if(toVisibleIndex<=startIndex||toVisibleIndex>=endIndex-visibleSize-1){if(startIndex!==offsetStartIndex||endIndex!==offsetEndIndex){scrollYStore.startIndex=offsetStartIndex;scrollYStore.endIndex=offsetEndIndex;$xeTable.updateScrollYData();}}}const createGetRowCacheProp=prop=>{return function(row){const $xeTable=this;const internalData=$xeTable;const{fullAllDataRowIdData}=internalData;if(row){const rowid=getRowid($xeTable,row);const rowRest=fullAllDataRowIdData[rowid];if(rowRest){return rowRest[prop];}}return-1;};};const createGetColumnCacheProp=prop=>{return function(column){const $xeTable=this;const internalData=$xeTable;const{fullColumnIdData}=internalData;if(column){const colRest=fullColumnIdData[column.id];if(colRest){return colRest[prop];}}return-1;};};function lazyScrollXData($xeTable){const internalData=$xeTable;const{lxTimeout,lxRunTime,scrollXStore}=internalData;const{visibleSize}=scrollXStore;const fpsTime=visibleSize>26?26:visibleSize>16?14:6;if(lxTimeout){clearTimeout(lxTimeout);}if(!lxRunTime||lxRunTime+fpsTime<Date.now()){internalData.lxRunTime=Date.now();loadScrollXData($xeTable);}internalData.lxTimeout=setTimeout(()=>{internalData.lxTimeout=undefined;internalData.lxRunTime=undefined;loadScrollXData($xeTable);},fpsTime);}function lazyScrollYData($xeTable){const internalData=$xeTable;const{lyTimeout,lyRunTime,scrollYStore}=internalData;const{visibleSize}=scrollYStore;const fpsTime=visibleSize>30?32:visibleSize>20?18:8;if(lyTimeout){clearTimeout(lyTimeout);}if(!lyRunTime||lyRunTime+fpsTime<Date.now()){internalData.lyRunTime=Date.now();loadScrollYData($xeTable);}internalData.lyTimeout=setTimeout(()=>{internalData.lyTimeout=undefined;internalData.lyRunTime=undefined;loadScrollYData($xeTable);},fpsTime);}function handleSyncScroll($xeTable,isRollX,isRollY){const reactData=$xeTable;const internalData=$xeTable;const{scrollXLoad,scrollYLoad,isAllOverflow}=reactData;const autoWidthColumnList=$xeTable.computeAutoWidthColumnList;internalData.lcsRunTime=Date.now();internalData.lcsTimeout=undefined;internalData.intoRunScroll=false;internalData.inVirtualScroll=false;internalData.inWheelScroll=false;internalData.inHeaderScroll=false;internalData.inBodyScroll=false;internalData.inFooterScroll=false;reactData.lazScrollLoading=false;internalData.scrollRenderType='';let xRest=null;let yRest=null;if(!isAllOverflow){calcCellHeight($xeTable);updateRowOffsetTop($xeTable);}if(isRollX&&scrollXLoad){xRest=$xeTable.updateScrollXData();}if(isRollY&&scrollYLoad){if(autoWidthColumnList.length){calcCellWidth($xeTable);}yRest=$xeTable.updateScrollYData().then(()=>{if(autoWidthColumnList.length){calcCellWidth($xeTable);autoCellWidth($xeTable);}if(!isAllOverflow){calcCellHeight($xeTable);updateRowOffsetTop($xeTable);}return $xeTable.updateScrollYSpace();});}updateRowExpandStyle($xeTable);return Promise.all([xRest,yRest,scrollXLoad||scrollYLoad?$xeTable.updateCellAreas():null]);}function checkLastSyncScroll($xeTable,isRollX,isRollY){const reactData=$xeTable;const internalData=$xeTable;const{lcsTimeout}=internalData;reactData.lazScrollLoading=true;if(lcsTimeout){clearTimeout(lcsTimeout);}internalData.lcsTimeout=setTimeout(()=>{handleSyncScroll($xeTable,isRollX,isRollY).then(()=>{if(reactData.scrollXLoad||reactData.scrollYLoad){$xeTable.$nextTick(()=>{updateRowExpandStyle($xeTable);if(!internalData.lcsTimeout){handleSyncScroll($xeTable,isRollX,isRollY);}});}});},240);}const getWheelSpeed=lastScrollTime=>{let multiple=1;const currTime=Date.now();if(lastScrollTime+25>currTime){multiple=1.18;}else if(lastScrollTime+30>currTime){multiple=1.15;}else if(lastScrollTime+40>currTime){multiple=1.12;}else if(lastScrollTime+55>currTime){multiple=1.09;}else if(lastScrollTime+75>currTime){multiple=1.06;}else if(lastScrollTime+100>currTime){multiple=1.03;}return multiple;};const syncGanttScrollTop=($xeTable,scrollTop)=>{const internalData=$xeTable;const $xeGanttView=internalData.xeGanttView;if($xeGanttView){const ganttInternalData=$xeGanttView.internalData;const{elemStore:ganttElemStore}=ganttInternalData;const ganttBodyScrollElem=getRefElem(ganttElemStore['main-body-scroll']);if(ganttBodyScrollElem){ganttBodyScrollElem.scrollTop=scrollTop;}}};function updateHeight($xeTable){const reactData=$xeTable;const internalData=$xeTable;internalData.customHeight=calcTableHeight($xeTable,'height');internalData.customMinHeight=calcTableHeight($xeTable,'minHeight');internalData.customMaxHeight=calcTableHeight($xeTable,'maxHeight');// 如果启用虚拟滚动,纠正高度
|
|
8038
8038
|
if(reactData.scrollYLoad&&!(internalData.customHeight||internalData.customMinHeight||internalData.customMaxHeight)){internalData.customHeight=300;}}/**
|
|
8039
8039
|
* 计算自适应列宽
|
|
8040
8040
|
*/function calcColumnAutoWidth($xeTable,column,wrapperEl){const reactData=$xeTable;const{scrollYLoad}=reactData;const columnOpts=$xeTable.computeColumnOpts;const{autoOptions}=columnOpts;const{isCalcHeader,isCalcBody,isCalcFooter}=autoOptions||{};const querySelections=[];if(isCalcHeader){querySelections.push(`.vxe-header-cell--wrapper[colid="${column.id}"]`);}if(isCalcBody){querySelections.push(`.vxe-body-cell--wrapper[colid="${column.id}"]`);}if(isCalcFooter){querySelections.push(`.vxe-footer-cell--wrapper[colid="${column.id}"]`);}const cellElemList=querySelections.length?wrapperEl.querySelectorAll(querySelections.join(',')):[];let leftRightPadding=0;const firstCellEl=cellElemList[0];if(firstCellEl&&firstCellEl.parentElement){const cellStyle=getComputedStyle(firstCellEl.parentElement);leftRightPadding=Math.ceil(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellStyle.paddingLeft)+external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellStyle.paddingRight));}let colWidth=(scrollYLoad?column.renderAutoWidth:0)-leftRightPadding;for(let i=0;i<cellElemList.length;i++){const celEl=cellElemList[i];colWidth=Math.max(colWidth,celEl?Math.ceil(celEl.scrollWidth)+4:0);}return colWidth+leftRightPadding;}/**
|
|
@@ -18420,12 +18420,22 @@ const convertToRows = originColumns => {
|
|
|
18420
18420
|
}
|
|
18421
18421
|
if (!handleOptions.print) {
|
|
18422
18422
|
if (beforeExportMethod) {
|
|
18423
|
-
beforeExportMethod({
|
|
18423
|
+
const beRest = beforeExportMethod({
|
|
18424
18424
|
options: handleOptions,
|
|
18425
18425
|
$table: $xeTable,
|
|
18426
18426
|
$grid: $xeGrid,
|
|
18427
18427
|
$gantt: $xeGantt
|
|
18428
18428
|
});
|
|
18429
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(beRest)) {
|
|
18430
|
+
if (!beRest) {
|
|
18431
|
+
const params = {
|
|
18432
|
+
status: false
|
|
18433
|
+
};
|
|
18434
|
+
return Promise.reject(params);
|
|
18435
|
+
}
|
|
18436
|
+
} else {
|
|
18437
|
+
export_mixin_warnLog('vxe.error.returnErr', ['beforeExportMethod', 'boolean', beRest]);
|
|
18438
|
+
}
|
|
18429
18439
|
}
|
|
18430
18440
|
}
|
|
18431
18441
|
if (!handleOptions.data) {
|
|
@@ -18556,18 +18566,26 @@ const convertToRows = originColumns => {
|
|
|
18556
18566
|
beforeImportMethod
|
|
18557
18567
|
} = opts;
|
|
18558
18568
|
if (beforeImportMethod) {
|
|
18559
|
-
beforeImportMethod({
|
|
18569
|
+
const biRest = beforeImportMethod({
|
|
18560
18570
|
options: opts,
|
|
18561
18571
|
$table: $xeTable
|
|
18562
18572
|
});
|
|
18573
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(biRest)) {
|
|
18574
|
+
if (!biRest) {
|
|
18575
|
+
const params = {
|
|
18576
|
+
status: false
|
|
18577
|
+
};
|
|
18578
|
+
return Promise.reject(params);
|
|
18579
|
+
}
|
|
18580
|
+
} else {
|
|
18581
|
+
export_mixin_warnLog('vxe.error.returnErr', ['beforeImportMethod', 'boolean', biRest]);
|
|
18582
|
+
}
|
|
18563
18583
|
}
|
|
18564
18584
|
return handleFileImport($xeTable, file, opts);
|
|
18565
18585
|
},
|
|
18566
18586
|
_importData(options) {
|
|
18567
18587
|
const $xeTable = this;
|
|
18568
|
-
const
|
|
18569
|
-
importOpts
|
|
18570
|
-
} = this;
|
|
18588
|
+
const importOpts = $xeTable.computeImportOpts;
|
|
18571
18589
|
const opts = Object.assign({
|
|
18572
18590
|
types: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(importOpts._typeMaps)
|
|
18573
18591
|
// beforeImportMethod: null,
|
|
@@ -18578,10 +18596,20 @@ const convertToRows = originColumns => {
|
|
|
18578
18596
|
afterImportMethod
|
|
18579
18597
|
} = opts;
|
|
18580
18598
|
if (beforeImportMethod) {
|
|
18581
|
-
beforeImportMethod({
|
|
18599
|
+
const biRest = beforeImportMethod({
|
|
18582
18600
|
options: opts,
|
|
18583
|
-
$table:
|
|
18601
|
+
$table: $xeTable
|
|
18584
18602
|
});
|
|
18603
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(biRest)) {
|
|
18604
|
+
if (!biRest) {
|
|
18605
|
+
const params = {
|
|
18606
|
+
status: false
|
|
18607
|
+
};
|
|
18608
|
+
return Promise.reject(params);
|
|
18609
|
+
}
|
|
18610
|
+
} else {
|
|
18611
|
+
export_mixin_warnLog('vxe.error.returnErr', ['beforeImportMethod', 'boolean', biRest]);
|
|
18612
|
+
}
|
|
18585
18613
|
}
|
|
18586
18614
|
return core_.VxeUI.readFile(opts).catch(e => {
|
|
18587
18615
|
if (afterImportMethod) {
|
|
@@ -18639,6 +18667,7 @@ const convertToRows = originColumns => {
|
|
|
18639
18667
|
printTitle = document.title || '';
|
|
18640
18668
|
}
|
|
18641
18669
|
const beforePrintMethod = opts.beforePrintMethod;
|
|
18670
|
+
const printMethod = opts.printMethod;
|
|
18642
18671
|
const tableHtml = opts.html || opts.content;
|
|
18643
18672
|
return new Promise((resolve, reject) => {
|
|
18644
18673
|
if (core_.VxeUI.print) {
|
|
@@ -18658,6 +18687,30 @@ const convertToRows = originColumns => {
|
|
|
18658
18687
|
$grid: $xeGrid,
|
|
18659
18688
|
$gantt: $xeGantt
|
|
18660
18689
|
});
|
|
18690
|
+
} : undefined,
|
|
18691
|
+
beforePrintMethod: beforePrintMethod ? ({
|
|
18692
|
+
html
|
|
18693
|
+
}) => {
|
|
18694
|
+
return beforePrintMethod({
|
|
18695
|
+
html,
|
|
18696
|
+
content: html,
|
|
18697
|
+
options: opts,
|
|
18698
|
+
$table: $xeTable,
|
|
18699
|
+
$grid: $xeGrid,
|
|
18700
|
+
$gantt: $xeGantt
|
|
18701
|
+
});
|
|
18702
|
+
} : undefined,
|
|
18703
|
+
printMethod: printMethod ? ({
|
|
18704
|
+
html
|
|
18705
|
+
}) => {
|
|
18706
|
+
return printMethod({
|
|
18707
|
+
html,
|
|
18708
|
+
content: html,
|
|
18709
|
+
options: opts,
|
|
18710
|
+
$table: $xeTable,
|
|
18711
|
+
$grid: $xeGrid,
|
|
18712
|
+
$gantt: $xeGantt
|
|
18713
|
+
});
|
|
18661
18714
|
} : undefined
|
|
18662
18715
|
}));
|
|
18663
18716
|
} else {
|
|
@@ -18679,6 +18732,30 @@ const convertToRows = originColumns => {
|
|
|
18679
18732
|
$grid: $xeGrid,
|
|
18680
18733
|
$gantt: $xeGantt
|
|
18681
18734
|
});
|
|
18735
|
+
} : undefined,
|
|
18736
|
+
beforePrintMethod: beforePrintMethod ? ({
|
|
18737
|
+
html
|
|
18738
|
+
}) => {
|
|
18739
|
+
return beforePrintMethod({
|
|
18740
|
+
html,
|
|
18741
|
+
content: html,
|
|
18742
|
+
options: opts,
|
|
18743
|
+
$table: $xeTable,
|
|
18744
|
+
$grid: $xeGrid,
|
|
18745
|
+
$gantt: $xeGantt
|
|
18746
|
+
});
|
|
18747
|
+
} : undefined,
|
|
18748
|
+
printMethod: printMethod ? ({
|
|
18749
|
+
html
|
|
18750
|
+
}) => {
|
|
18751
|
+
return printMethod({
|
|
18752
|
+
html,
|
|
18753
|
+
content: html,
|
|
18754
|
+
options: opts,
|
|
18755
|
+
$table: $xeTable,
|
|
18756
|
+
$grid: $xeGrid,
|
|
18757
|
+
$gantt: $xeGantt
|
|
18758
|
+
});
|
|
18682
18759
|
} : undefined
|
|
18683
18760
|
});
|
|
18684
18761
|
}));
|
|
@@ -28693,6 +28770,8 @@ const Toolbar = VxeToolbar;
|
|
|
28693
28770
|
noTree: '树结构不支持 "{0}"',
|
|
28694
28771
|
noGroup: '数据分组后不支持 "{0}"',
|
|
28695
28772
|
notProp: '不支持的参数 "{0}"',
|
|
28773
|
+
returnErr: '参数 "{0}" 的返回值期望是 "{1}" 实际是 "{2}"',
|
|
28774
|
+
notSupportReturn: '当返回值为 "{0}" 时的参数应该使用用 "{1}" 而不是 "{2}"',
|
|
28696
28775
|
checkProp: '当数据量过大时可能会导致复选框卡顿,建议设置参数 "{0}" 提升渲染速度',
|
|
28697
28776
|
coverProp: '"{0}" 的参数 "{1}" 重复定义,这可能会出现错误',
|
|
28698
28777
|
uniField: '字段名 "{0}" 重复定义,这可能会出现错误',
|