vxe-table 4.17.49 → 4.17.50
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/style.css +1 -1
- package/es/table/src/table.js +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +3 -3
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/src/table.js +1 -1
- package/lib/table/src/table.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/table/src/table.ts +1 -1
- /package/es/{iconfont.1772182532931.ttf → iconfont.1773049129598.ttf} +0 -0
- /package/es/{iconfont.1772182532931.woff → iconfont.1773049129598.woff} +0 -0
- /package/es/{iconfont.1772182532931.woff2 → iconfont.1773049129598.woff2} +0 -0
- /package/lib/{iconfont.1772182532931.ttf → iconfont.1773049129598.ttf} +0 -0
- /package/lib/{iconfont.1772182532931.woff → iconfont.1773049129598.woff} +0 -0
- /package/lib/{iconfont.1772182532931.woff2 → iconfont.1773049129598.woff2} +0 -0
package/lib/table/src/table.js
CHANGED
|
@@ -373,7 +373,7 @@ if(virtualXOpts.scrollToLeftOnChange){targetScrollLeft=0;}if(virtualYOpts.scroll
|
|
|
373
373
|
* @param {Array/Row} rows 行数据
|
|
374
374
|
* @param {String} field 字段名
|
|
375
375
|
*/clearData(rows,field){const{tableFullData,visibleColumn}=internalData;if(!arguments.length){rows=tableFullData;}else if(rows&&!_xeUtils.default.isArray(rows)){rows=[rows];}if(field){rows.forEach(row=>_xeUtils.default.set(row,field,null));}else{rows.forEach(row=>{visibleColumn.forEach(column=>{if(column.field){(0,_util.setCellValue)(row,column,null);}});});}return(0,_vue.nextTick)();},getCellElement(row,fieldOrColumn){const{elemStore}=internalData;const column=(0,_util.handleFieldOrColumn)($xeTable,fieldOrColumn);if(!column){return null;}const rowid=(0,_util.getRowid)($xeTable,row);const bodyScrollElem=(0,_util.getRefElem)(elemStore['main-body-scroll']);const leftScrollElem=(0,_util.getRefElem)(elemStore['left-body-scroll']);const rightScrollElem=(0,_util.getRefElem)(elemStore['right-body-scroll']);let bodyElem;if(column){if(column.fixed){if(column.fixed==='left'){if(leftScrollElem){bodyElem=leftScrollElem;}}else{if(rightScrollElem){bodyElem=rightScrollElem;}}}if(!bodyElem){bodyElem=bodyScrollElem;}if(bodyElem){return bodyElem.querySelector(`.vxe-body--row[rowid="${rowid}"] .${column.id}`);}}return null;},getCellLabel(row,fieldOrColumn){const column=(0,_util.handleFieldOrColumn)($xeTable,fieldOrColumn);if(!column){return null;}const{editConfig}=props;const{formatter,editRender,cellRender}=column;// formatter > tableCellFormatter
|
|
376
|
-
const renderOpts=formatter?null:editConfig&&(0,_utils.isEnableConf)(editRender)?editRender:(0,_utils.isEnableConf)(cellRender)?cellRender:null;const compConf=renderOpts?renderer.get(renderOpts.name):null;const tcFormatter=compConf?compConf.tableCellFormatter:null;const cellValue=(0,_util.getCellValue)(row,column);let cellLabel=cellValue;if(formatter||tcFormatter){let formatData;const{fullAllDataRowIdData}=internalData;const rowid=(0,_util.getRowid)($xeTable,row);const colid=column.id;const rowRest=fullAllDataRowIdData[rowid];if(rowRest){formatData=rowRest.formatData;if(!formatData){formatData=fullAllDataRowIdData[rowid].formatData={};}if(rowRest&&formatData[colid]){if(formatData[colid].value===cellValue){return formatData[colid].label;}}}const formatParams={$table:$xeTable,cellValue,row,rowIndex:$xeTable.getRowIndex(row),column,columnIndex:$xeTable.getColumnIndex(column)};if(formatter){if(_xeUtils.default.isString(formatter)){const gFormatOpts=formats.get(formatter);const tcFormatMethod=gFormatOpts?gFormatOpts.tableCellFormatMethod||gFormatOpts.cellFormatMethod:null;cellLabel=tcFormatMethod?tcFormatMethod(formatParams):'';}else if(_xeUtils.default.isArray(formatter)){const gFormatOpts=formats.get(formatter[0]);const tcFormatMethod=gFormatOpts?gFormatOpts.tableCellFormatMethod||gFormatOpts.cellFormatMethod:null;cellLabel=tcFormatMethod?tcFormatMethod(formatParams,...formatter.slice(1)):'';}else{cellLabel
|
|
376
|
+
const renderOpts=formatter?null:editConfig&&(0,_utils.isEnableConf)(editRender)?editRender:(0,_utils.isEnableConf)(cellRender)?cellRender:null;const compConf=renderOpts?renderer.get(renderOpts.name):null;const tcFormatter=compConf?compConf.tableCellFormatter:null;const cellValue=(0,_util.getCellValue)(row,column);let cellLabel=cellValue;if(formatter||tcFormatter){let formatData;const{fullAllDataRowIdData}=internalData;const rowid=(0,_util.getRowid)($xeTable,row);const colid=column.id;const rowRest=fullAllDataRowIdData[rowid];if(rowRest){formatData=rowRest.formatData;if(!formatData){formatData=fullAllDataRowIdData[rowid].formatData={};}if(rowRest&&formatData[colid]){if(formatData[colid].value===cellValue){return formatData[colid].label;}}}const formatParams={$table:$xeTable,cellValue,row,rowIndex:$xeTable.getRowIndex(row),column,columnIndex:$xeTable.getColumnIndex(column)};if(formatter){if(_xeUtils.default.isString(formatter)){const gFormatOpts=formats.get(formatter);const tcFormatMethod=gFormatOpts?gFormatOpts.tableCellFormatMethod||gFormatOpts.cellFormatMethod:null;cellLabel=tcFormatMethod?tcFormatMethod(formatParams):'';}else if(_xeUtils.default.isArray(formatter)){const gFormatOpts=formats.get(formatter[0]);const tcFormatMethod=gFormatOpts?gFormatOpts.tableCellFormatMethod||gFormatOpts.cellFormatMethod:null;cellLabel=tcFormatMethod?tcFormatMethod(formatParams,...formatter.slice(1)):'';}else{cellLabel=formatter(formatParams);}}else if(renderOpts&&tcFormatter){cellLabel=tcFormatter(renderOpts,formatParams);}if(formatData){formatData[colid]={value:cellValue,label:cellLabel};}}return cellLabel;},getFooterCellLabel(row,fieldOrColumn){const column=(0,_util.handleFieldOrColumn)($xeTable,fieldOrColumn);if(!column){return null;}const{footerFormatter}=column;const _columnIndex=$xeTable.getVTColumnIndex(column);let itemValue='';// 兼容老模式
|
|
377
377
|
if(_xeUtils.default.isArray(row)){itemValue=row[_columnIndex];}else{itemValue=_xeUtils.default.get(row,column.field);}let cellLabel=itemValue;if(footerFormatter){let formatData;const{footerTableData}=reactData;const{footerFullDataRowData}=internalData;const colid=column.id;const $rowIndex=footerTableData.indexOf(row);let rowRest=null;if($rowIndex>-1){rowRest=footerFullDataRowData[$rowIndex];if(!rowRest){rowRest=footerFullDataRowData[$rowIndex]={};}formatData=rowRest.formatData;if(!formatData){formatData=footerFullDataRowData[$rowIndex].formatData={};}if(rowRest&&formatData[colid]){if(formatData[colid].value===itemValue){return formatData[colid].label;}}}const footerFormatParams={$table:$xeTable,cellValue:itemValue,itemValue,row,items:row,$rowIndex,column,_columnIndex,columnIndex:$xeTable.getColumnIndex(column)};if(_xeUtils.default.isString(footerFormatter)){const gFormatOpts=formats.get(footerFormatter);const fcFormatMethod=gFormatOpts?gFormatOpts.tableFooterCellFormatMethod:null;cellLabel=fcFormatMethod?fcFormatMethod(footerFormatParams):'';}else if(_xeUtils.default.isArray(footerFormatter)){const gFormatOpts=formats.get(footerFormatter[0]);const fcFormatMethod=gFormatOpts?gFormatOpts.tableFooterCellFormatMethod:null;cellLabel=fcFormatMethod?fcFormatMethod(footerFormatParams,...footerFormatter.slice(1)):'';}else{cellLabel=footerFormatter(footerFormatParams);}if(formatData){formatData[colid]={value:itemValue,label:cellLabel};}}return cellLabel;},/**
|
|
378
378
|
* 检查是否为临时行数据
|
|
379
379
|
*/isInsertByRow(row){const rowid=(0,_util.getRowid)($xeTable,row);return!!reactData.insertRowFlag&&!!internalData.insertRowMaps[rowid];},isRemoveByRow(row){const rowid=(0,_util.getRowid)($xeTable,row);return!!reactData.removeRowFlag&&!!internalData.removeRowMaps[rowid];},/**
|