vxe-table 3.11.38 → 3.11.39
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/render/index.js +44 -11
- package/es/table/src/body.js +29 -26
- package/es/table/src/footer.js +29 -18
- package/es/table/src/header.js +25 -7
- package/es/table/src/methods.js +25 -16
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +192 -126
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/render/index.js +44 -11
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/body.js +47 -47
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/footer.js +41 -32
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +35 -15
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +23 -19
- 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/table/render/index.ts +45 -11
- package/packages/table/src/body.ts +32 -26
- package/packages/table/src/footer.ts +33 -18
- package/packages/table/src/header.ts +25 -7
- package/packages/table/src/methods.ts +25 -19
- /package/es/{iconfont.1735003904481.ttf → iconfont.1735027791418.ttf} +0 -0
- /package/es/{iconfont.1735003904481.woff → iconfont.1735027791418.woff} +0 -0
- /package/es/{iconfont.1735003904481.woff2 → iconfont.1735027791418.woff2} +0 -0
- /package/lib/{iconfont.1735003904481.ttf → iconfont.1735027791418.ttf} +0 -0
- /package/lib/{iconfont.1735003904481.woff → iconfont.1735027791418.woff} +0 -0
- /package/lib/{iconfont.1735003904481.woff2 → iconfont.1735027791418.woff2} +0 -0
package/lib/ui/index.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.VXETable=void 0,Object.defineProperty(exports,"VxeUI",{enumerable:!0,get:function(){return _core.VxeUI}}),exports.version=exports.validators=exports.use=exports.t=exports.setup=exports.setTheme=exports.setLanguage=exports.setIcon=exports.setI18n=exports.setConfig=exports.saveFile=exports.renderer=exports.readFile=exports.print=exports.modal=exports.menus=exports.log=exports.interceptor=exports.globalResize=exports.globalEvents=exports.getTheme=exports.getIcon=exports.getI18n=exports.getConfig=exports.formats=exports.default=exports.config=exports.commands=exports.clipboard=exports._t=void 0;var _core=require("@vxe-ui/core"),_utils=require("./src/utils");let version=exports.version="3.11.
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.VXETable=void 0,Object.defineProperty(exports,"VxeUI",{enumerable:!0,get:function(){return _core.VxeUI}}),exports.version=exports.validators=exports.use=exports.t=exports.setup=exports.setTheme=exports.setLanguage=exports.setIcon=exports.setI18n=exports.setConfig=exports.saveFile=exports.renderer=exports.readFile=exports.print=exports.modal=exports.menus=exports.log=exports.interceptor=exports.globalResize=exports.globalEvents=exports.getTheme=exports.getIcon=exports.getI18n=exports.getConfig=exports.formats=exports.default=exports.config=exports.commands=exports.clipboard=exports._t=void 0;var _core=require("@vxe-ui/core"),_utils=require("./src/utils");let version=exports.version="3.11.39",iconPrefix=(_core.VxeUI.version=version,_core.VxeUI.tableVersion=version,_core.VxeUI.setConfig({emptyCell:" ",table:{fit:!0,showHeader:!0,animat:!0,delayHover:250,autoResize:!0,padding:!0,minHeight:144,resizeConfig:{},resizableConfig:{dragMode:"auto",showDragTip:!0},radioConfig:{strict:!0},rowDragConfig:{showIcon:!0,animation:!0},columnDragConfig:{showIcon:!0,animation:!0},checkboxConfig:{strict:!0},tooltipConfig:{enterable:!0},validConfig:{showMessage:!0,autoClear:!0,autoPos:!0,message:"inline",msgMode:"single",theme:"beautify"},columnConfig:{maxFixedSize:4},customConfig:{allowVisible:!0,allowResizable:!0,allowFixed:!0,allowSort:!0,showFooter:!0,placement:"top-right",modalOptions:{showMaximize:!0,mask:!0,lockView:!0,resize:!0,escClosable:!0},drawerOptions:{mask:!0,lockView:!0,escClosable:!0,resize:!0}},sortConfig:{showIcon:!0,iconLayout:"vertical"},filterConfig:{showIcon:!0},treeConfig:{rowField:"id",parentField:"parentId",childrenField:"children",hasChildField:"hasChild",mapChildrenField:"_X_ROW_CHILD",indent:20,showIcon:!0},expandConfig:{showIcon:!0},editConfig:{showIcon:!0,showAsterisk:!0,autoFocus:!0},importConfig:{_typeMaps:{csv:1,html:1,xml:1,txt:1}},exportConfig:{_typeMaps:{csv:1,html:1,xml:1,txt:1}},printConfig:{},mouseConfig:{extension:!0},keyboardConfig:{isEsc:!0},areaConfig:{autoClear:!0,selectCellByHeader:!0,selectCellByBody:!0},clipConfig:{isCopy:!0,isCut:!0,isPaste:!0},fnrConfig:{isFind:!0,isReplace:!0},scrollX:{gt:60},scrollY:{gt:100}},grid:{formConfig:{enabled:!0},pagerConfig:{enabled:!0},toolbarConfig:{enabled:!0},proxyConfig:{enabled:!0,autoLoad:!0,showResponseMsg:!0,showActiveMsg:!0,props:{list:null,result:"result",total:"page.total",message:"message"}}},toolbar:{}}),"vxe-table-icon-"),setTheme=(_core.VxeUI.setIcon({TABLE_SORT_ASC:iconPrefix+"caret-up",TABLE_SORT_DESC:iconPrefix+"caret-down",TABLE_FILTER_NONE:iconPrefix+"funnel",TABLE_FILTER_MATCH:iconPrefix+"funnel",TABLE_EDIT:iconPrefix+"edit",TABLE_TITLE_PREFIX:iconPrefix+"question-circle-fill",TABLE_TITLE_SUFFIX:iconPrefix+"question-circle-fill",TABLE_TREE_LOADED:iconPrefix+"spinner roll",TABLE_TREE_OPEN:iconPrefix+"caret-right rotate90",TABLE_TREE_CLOSE:iconPrefix+"caret-right",TABLE_EXPAND_LOADED:iconPrefix+"spinner roll",TABLE_EXPAND_OPEN:iconPrefix+"arrow-right rotate90",TABLE_EXPAND_CLOSE:iconPrefix+"arrow-right",TABLE_CHECKBOX_CHECKED:iconPrefix+"checkbox-checked-fill",TABLE_CHECKBOX_UNCHECKED:iconPrefix+"checkbox-unchecked",TABLE_CHECKBOX_INDETERMINATE:iconPrefix+"checkbox-indeterminate-fill",TABLE_RADIO_CHECKED:iconPrefix+"radio-checked-fill",TABLE_RADIO_UNCHECKED:iconPrefix+"radio-unchecked",TABLE_CUSTOM_SORT:iconPrefix+"drag-handle",TABLE_MENU_OPTIONS:iconPrefix+"arrow-right",TABLE_DRAG_ROW:iconPrefix+"drag-handle",TABLE_DRAG_COLUMN:iconPrefix+"drag-handle",TABLE_DRAG_STATUS_ROW:iconPrefix+"sort",TABLE_DRAG_STATUS_SUB_ROW:iconPrefix+"add-sub",TABLE_DRAG_STATUS_COLUMN:iconPrefix+"swap",TABLE_DRAG_DISABLED:iconPrefix+"no-drop",TOOLBAR_TOOLS_REFRESH:iconPrefix+"repeat",TOOLBAR_TOOLS_REFRESH_LOADING:iconPrefix+"repeat roll",TOOLBAR_TOOLS_IMPORT:iconPrefix+"upload",TOOLBAR_TOOLS_EXPORT:iconPrefix+"download",TOOLBAR_TOOLS_PRINT:iconPrefix+"print",TOOLBAR_TOOLS_FULLSCREEN:iconPrefix+"fullscreen",TOOLBAR_TOOLS_MINIMIZE:iconPrefix+"minimize",TOOLBAR_TOOLS_CUSTOM:iconPrefix+"custom-column",TOOLBAR_TOOLS_FIXED_LEFT:iconPrefix+"fixed-left",TOOLBAR_TOOLS_FIXED_LEFT_ACTIVE:iconPrefix+"fixed-left-fill",TOOLBAR_TOOLS_FIXED_RIGHT:iconPrefix+"fixed-right",TOOLBAR_TOOLS_FIXED_RIGHT_ACTIVE:iconPrefix+"fixed-right-fill"}),exports.setTheme=_core.VxeUI.setTheme),getTheme=exports.getTheme=_core.VxeUI.getTheme,setConfig=exports.setConfig=_core.VxeUI.setConfig,getConfig=exports.getConfig=_core.VxeUI.getConfig,setIcon=exports.setIcon=_core.VxeUI.setIcon,getIcon=exports.getIcon=_core.VxeUI.getIcon,setLanguage=exports.setLanguage=_core.VxeUI.setLanguage,setI18n=exports.setI18n=_core.VxeUI.setI18n,getI18n=exports.getI18n=_core.VxeUI.getI18n,globalEvents=exports.globalEvents=_core.VxeUI.globalEvents,globalResize=exports.globalResize=_core.VxeUI.globalResize,renderer=exports.renderer=_core.VxeUI.renderer,validators=exports.validators=_core.VxeUI.validators,menus=exports.menus=_core.VxeUI.menus,formats=exports.formats=_core.VxeUI.formats,commands=exports.commands=_core.VxeUI.commands,interceptor=exports.interceptor=_core.VxeUI.interceptor,clipboard=exports.clipboard=_core.VxeUI.clipboard,log=exports.log=_core.VxeUI.log,use=exports.use=_core.VxeUI.use,setup=e=>_core.VxeUI.setConfig(e),config=(exports.setup=setup,_core.VxeUI.setup=setup,e=>_core.VxeUI.setConfig(e)),t=(exports.config=config,_core.VxeUI.config=config,(e,o)=>_core.VxeUI.getI18n(e,o)),_t=(exports.t=t,_core.VxeUI.t=t,(e,o)=>(0,_utils.getFuncText)(e,o)),VXETable=(exports._t=_t,_core.VxeUI._t=_t,exports.VXETable=_core.VxeUI),saveFile=e=>_core.VxeUI.saveFile(e),readFile=(exports.saveFile=saveFile,e=>_core.VxeUI.readFile(e)),print=(exports.readFile=readFile,e=>_core.VxeUI.print(e)),modal=(exports.print=print,exports.modal={get(e){return _core.VxeUI.modal.get(e)},close(e){return _core.VxeUI.modal.close(e)},open(e){return _core.VxeUI.modal.open(e)},alert(e,o,r){return _core.VxeUI.modal.alert(e,o,r)},confirm(e,o,r){return _core.VxeUI.modal.confirm(e,o,r)},message(e,o){return _core.VxeUI.modal.message(e,o)},notification(e,o,r){return _core.VxeUI.modal.notification(e,o,r)}});var _default=exports.default=_core.VxeUI;
|
package/lib/ui/src/log.js
CHANGED
|
@@ -8,6 +8,6 @@ var _core = require("@vxe-ui/core");
|
|
|
8
8
|
const {
|
|
9
9
|
log
|
|
10
10
|
} = _core.VxeUI;
|
|
11
|
-
const version = `table v${"3.11.
|
|
11
|
+
const version = `table v${"3.11.39"}`;
|
|
12
12
|
const warnLog = exports.warnLog = log.create('warn', version);
|
|
13
13
|
const errLog = exports.errLog = log.create('error', version);
|
package/lib/ui/src/log.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.warnLog=exports.errLog=void 0;var _core=require("@vxe-ui/core");let log=_core.VxeUI.log,version="table v3.11.
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.warnLog=exports.errLog=void 0;var _core=require("@vxe-ui/core");let log=_core.VxeUI.log,version="table v3.11.39",warnLog=exports.warnLog=log.create("warn",version),errLog=exports.errLog=log.create("error",version);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vxe-table",
|
|
3
|
-
"version": "3.11.
|
|
3
|
+
"version": "3.11.39",
|
|
4
4
|
"description": "一个基于 vue 的 PC 端表格组件,支持增删改查、虚拟树、拖拽排序,懒加载、快捷菜单、数据校验、树形结构、打印、导入导出、自定义模板、渲染器、JSON 配置式...",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"update": "npm install --legacy-peer-deps",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"style": "lib/style.css",
|
|
29
29
|
"typings": "types/index.d.ts",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"vxe-pc-ui": "^3.3.
|
|
31
|
+
"vxe-pc-ui": "^3.3.46"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@babel/plugin-transform-modules-commonjs": "^7.25.7",
|
|
@@ -14,6 +14,10 @@ const componentDefaultModelProp = 'value'
|
|
|
14
14
|
|
|
15
15
|
const defaultCompProps = {}
|
|
16
16
|
|
|
17
|
+
function handleDefaultValue (value: any, defaultVal: any, initVal: any) {
|
|
18
|
+
return XEUtils.eqNull(value) ? (XEUtils.eqNull(defaultVal) ? initVal : defaultVal) : value
|
|
19
|
+
}
|
|
20
|
+
|
|
17
21
|
function parseDate (value: any, props: any) {
|
|
18
22
|
return value && props.valueFormat ? XEUtils.toStringDate(value, props.valueFormat) : value
|
|
19
23
|
}
|
|
@@ -623,13 +627,25 @@ renderer.mixin({
|
|
|
623
627
|
if (cellValue) {
|
|
624
628
|
const numberInputConfig = getConfig().numberInput || {}
|
|
625
629
|
if (type === 'float') {
|
|
626
|
-
const
|
|
630
|
+
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true)
|
|
631
|
+
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 1)
|
|
627
632
|
cellValue = XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits)
|
|
633
|
+
if (!autoFill) {
|
|
634
|
+
cellValue = XEUtils.toNumber(cellValue)
|
|
635
|
+
}
|
|
628
636
|
} else if (type === 'amount') {
|
|
629
|
-
const
|
|
637
|
+
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true)
|
|
638
|
+
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 2)
|
|
639
|
+
const showCurrency = handleDefaultValue(props.showCurrency, numberInputConfig.showCurrency, false)
|
|
630
640
|
cellValue = XEUtils.commafy(XEUtils.toNumber(cellValue), { digits })
|
|
631
|
-
|
|
632
|
-
|
|
641
|
+
if (!autoFill) {
|
|
642
|
+
const [iStr, dStr] = cellValue.split('.')
|
|
643
|
+
if (dStr) {
|
|
644
|
+
const dRest = dStr.replace(/0+$/, '')
|
|
645
|
+
cellValue = dRest ? [iStr, '.', dRest].join('') : iStr
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
if (showCurrency) {
|
|
633
649
|
cellValue = `${props.currencySymbol || numberInputConfig.currencySymbol || getI18n('vxe.numberInput.currencySymbol') || ''}${cellValue}`
|
|
634
650
|
}
|
|
635
651
|
}
|
|
@@ -641,18 +657,36 @@ renderer.mixin({
|
|
|
641
657
|
const { row, column, _columnIndex } = params
|
|
642
658
|
const { type } = props
|
|
643
659
|
// 兼容老模式
|
|
644
|
-
const
|
|
645
|
-
if (XEUtils.isNumber(
|
|
660
|
+
const itemValue = XEUtils.isArray(row) ? row[_columnIndex] : XEUtils.get(row, column.field)
|
|
661
|
+
if (XEUtils.isNumber(itemValue)) {
|
|
646
662
|
const numberInputConfig = getConfig().numberInput || {}
|
|
647
663
|
if (type === 'float') {
|
|
648
|
-
const
|
|
649
|
-
|
|
664
|
+
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true)
|
|
665
|
+
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 1)
|
|
666
|
+
let amountLabel = XEUtils.toFixed(XEUtils.floor(itemValue, digits), digits)
|
|
667
|
+
if (!autoFill) {
|
|
668
|
+
amountLabel = XEUtils.toNumber(amountLabel)
|
|
669
|
+
}
|
|
670
|
+
return amountLabel
|
|
650
671
|
} else if (type === 'amount') {
|
|
651
|
-
const
|
|
652
|
-
|
|
672
|
+
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true)
|
|
673
|
+
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 2)
|
|
674
|
+
const showCurrency = handleDefaultValue(props.showCurrency, numberInputConfig.showCurrency, false)
|
|
675
|
+
let amountLabel = XEUtils.commafy(XEUtils.toNumber(itemValue), { digits })
|
|
676
|
+
if (!autoFill) {
|
|
677
|
+
const [iStr, dStr] = amountLabel.split('.')
|
|
678
|
+
if (dStr) {
|
|
679
|
+
const dRest = dStr.replace(/0+$/, '')
|
|
680
|
+
amountLabel = dRest ? [iStr, '.', dRest].join('') : iStr
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
if (showCurrency) {
|
|
684
|
+
amountLabel = `${props.currencySymbol || numberInputConfig.currencySymbol || getI18n('vxe.numberInput.currencySymbol') || ''}${amountLabel}`
|
|
685
|
+
}
|
|
686
|
+
return amountLabel
|
|
653
687
|
}
|
|
654
688
|
}
|
|
655
|
-
return getFuncText(
|
|
689
|
+
return getFuncText(itemValue, 1)
|
|
656
690
|
},
|
|
657
691
|
renderTableDefault: defaultEditRender,
|
|
658
692
|
renderTableFilter: defaultFilterRender,
|
|
@@ -579,44 +579,50 @@ export default {
|
|
|
579
579
|
elemStore[`${prefix}emptyBlock`] = null
|
|
580
580
|
},
|
|
581
581
|
render (this: any, h: CreateElement) {
|
|
582
|
+
const props = this
|
|
582
583
|
const $xeTable = this.$parent
|
|
584
|
+
const tableProps = $xeTable
|
|
585
|
+
const tableReactData = $xeTable
|
|
586
|
+
const tableInternalData = $xeTable
|
|
583
587
|
|
|
584
|
-
const {
|
|
588
|
+
const { tId, $scopedSlots } = $xeTable
|
|
589
|
+
const { fixedColumn, fixedType, tableColumn } = props
|
|
585
590
|
|
|
591
|
+
const { showOverflow: allColumnOverflow, spanMethod, footerSpanMethod, mouseConfig } = tableProps
|
|
592
|
+
const { tableData, scrollXLoad, scrollYLoad, isAllOverflow, isDragRowMove, expandColumn } = tableReactData
|
|
593
|
+
const { visibleColumn } = tableInternalData
|
|
586
594
|
const rowOpts = $xeTable.computeRowOpts
|
|
595
|
+
const sYOpts = $xeTable.computeSYOpts
|
|
596
|
+
const emptyOpts = $xeTable.computeEmptyOpts
|
|
597
|
+
const mouseOpts = $xeTable.computeMouseOpts
|
|
587
598
|
const rowDragOpts = $xeTable.computeRowDragOpts
|
|
588
|
-
|
|
589
|
-
|
|
599
|
+
|
|
600
|
+
let renderColumnList = tableColumn
|
|
601
|
+
|
|
590
602
|
if (fixedType) {
|
|
591
|
-
//
|
|
592
|
-
if (
|
|
593
|
-
|
|
594
|
-
|
|
603
|
+
// 如果是使用优化模式
|
|
604
|
+
if (scrollXLoad || scrollYLoad || (allColumnOverflow && isAllOverflow)) {
|
|
605
|
+
// 如果不支持优化模式
|
|
606
|
+
if (expandColumn || spanMethod || footerSpanMethod) {
|
|
607
|
+
renderColumnList = visibleColumn
|
|
595
608
|
} else {
|
|
596
|
-
|
|
597
|
-
// 检查固定列是否被合并,合并范围是否超出固定列
|
|
598
|
-
// if (mergeList.length && !isMergeLeftFixedExceeded && fixedType === 'left') {
|
|
599
|
-
// tableColumn = fixedColumn
|
|
600
|
-
// } else if (mergeList.length && !isMergeRightFixedExceeded && fixedType === 'right') {
|
|
601
|
-
// tableColumn = fixedColumn
|
|
602
|
-
// } else {
|
|
603
|
-
// tableColumn = visibleColumn
|
|
604
|
-
// }
|
|
609
|
+
renderColumnList = fixedColumn || []
|
|
605
610
|
}
|
|
606
611
|
} else {
|
|
607
|
-
|
|
612
|
+
renderColumnList = visibleColumn
|
|
608
613
|
}
|
|
609
614
|
}
|
|
615
|
+
|
|
610
616
|
let emptyContent
|
|
611
617
|
if ($scopedSlots.empty) {
|
|
612
|
-
emptyContent = $scopedSlots.empty.call(this, { $table: $
|
|
618
|
+
emptyContent = $scopedSlots.empty.call(this, { $table: $xeTable, $grid: $xeTable.xegrid }, h)
|
|
613
619
|
} else {
|
|
614
620
|
const compConf = emptyOpts.name ? renderer.get(emptyOpts.name) : null
|
|
615
621
|
const rtEmptyView = compConf ? (compConf.renderTableEmpty || compConf.renderTableEmptyView || compConf.renderEmpty) : null
|
|
616
622
|
if (rtEmptyView) {
|
|
617
|
-
emptyContent = getSlotVNs(rtEmptyView.call(this, h, emptyOpts, { $table: $
|
|
623
|
+
emptyContent = getSlotVNs(rtEmptyView.call(this, h, emptyOpts, { $table: $xeTable }))
|
|
618
624
|
} else {
|
|
619
|
-
emptyContent =
|
|
625
|
+
emptyContent = tableProps.emptyText || getI18n('vxe.table.emptyText')
|
|
620
626
|
}
|
|
621
627
|
}
|
|
622
628
|
|
|
@@ -636,7 +642,7 @@ export default {
|
|
|
636
642
|
on: ons
|
|
637
643
|
}, [
|
|
638
644
|
fixedType
|
|
639
|
-
?
|
|
645
|
+
? renderEmptyElement($xeTable)
|
|
640
646
|
: h('div', {
|
|
641
647
|
class: 'vxe-body--x-space',
|
|
642
648
|
ref: 'xSpace'
|
|
@@ -660,7 +666,7 @@ export default {
|
|
|
660
666
|
*/
|
|
661
667
|
h('colgroup', {
|
|
662
668
|
ref: 'colgroup'
|
|
663
|
-
},
|
|
669
|
+
}, renderColumnList.map((column: any, $columnIndex: any) => {
|
|
664
670
|
return h('col', {
|
|
665
671
|
attrs: {
|
|
666
672
|
name: column.id
|
|
@@ -677,10 +683,10 @@ export default {
|
|
|
677
683
|
tag: 'tbody',
|
|
678
684
|
name: `vxe-body--row-list${isDragRowMove ? '' : '-disabled'}`
|
|
679
685
|
}
|
|
680
|
-
}, renderRows(h, this, $
|
|
686
|
+
}, renderRows(h, this, $xeTable, fixedType, tableData, renderColumnList))
|
|
681
687
|
: h('tbody', {
|
|
682
688
|
ref: 'tbody'
|
|
683
|
-
}, renderRows(h, this, $
|
|
689
|
+
}, renderRows(h, this, $xeTable, fixedType, tableData, renderColumnList))
|
|
684
690
|
]),
|
|
685
691
|
h('div', {
|
|
686
692
|
class: 'vxe-table--checkbox-range'
|
|
@@ -697,8 +703,8 @@ export default {
|
|
|
697
703
|
class: 'vxe-table--cell-main-area-btn',
|
|
698
704
|
on: {
|
|
699
705
|
mousedown (evnt: any) {
|
|
700
|
-
if ($
|
|
701
|
-
$
|
|
706
|
+
if ($xeTable.triggerCellAreaExtendMousedownEvent) {
|
|
707
|
+
$xeTable.triggerCellAreaExtendMousedownEvent(evnt, { $table: $xeTable, fixed: fixedType, type: renderType })
|
|
702
708
|
}
|
|
703
709
|
}
|
|
704
710
|
}
|
|
@@ -8,7 +8,7 @@ import type { VxeTableDefines } from '../../../types'
|
|
|
8
8
|
|
|
9
9
|
const renderType = 'footer'
|
|
10
10
|
|
|
11
|
-
const { renderer } = VxeUI
|
|
11
|
+
const { renderer, renderEmptyElement } = VxeUI
|
|
12
12
|
|
|
13
13
|
function mergeFooterMethod (mergeFooterList: any, _rowIndex: any, _columnIndex: any) {
|
|
14
14
|
for (let mIndex = 0; mIndex < mergeFooterList.length; mIndex++) {
|
|
@@ -155,18 +155,19 @@ function renderRows (h: CreateElement, _vm: any, tableColumn: VxeTableDefines.Co
|
|
|
155
155
|
: [])
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
function renderHeads (h: CreateElement, _vm: any,
|
|
158
|
+
function renderHeads (h: CreateElement, _vm: any, renderColumnList: VxeTableDefines.ColumnInfo[]) {
|
|
159
159
|
const $xeTable = _vm.$parent
|
|
160
|
+
const props = _vm
|
|
160
161
|
|
|
161
162
|
const columnOpts = $xeTable.computeColumnOpts
|
|
162
163
|
const columnDragOpts = $xeTable.computeColumnDragOpts
|
|
163
164
|
|
|
164
|
-
const {
|
|
165
|
-
const { footerRowClassName, footerRowStyle, isDragColMove } = $
|
|
165
|
+
const { fixedType, footerTableData } = props
|
|
166
|
+
const { footerRowClassName, footerRowStyle, isDragColMove } = $xeTable
|
|
166
167
|
|
|
167
168
|
return footerTableData.map((row: any, $rowIndex: any) => {
|
|
168
169
|
const _rowIndex = $rowIndex
|
|
169
|
-
const rowParams = { $table: $
|
|
170
|
+
const rowParams = { $table: $xeTable, row, _rowIndex, $rowIndex, fixed: fixedType, type: renderType }
|
|
170
171
|
|
|
171
172
|
if (columnOpts.drag && columnDragOpts.animation) {
|
|
172
173
|
return h('transition-group', {
|
|
@@ -180,7 +181,7 @@ function renderHeads (h: CreateElement, _vm: any, footerTableData: any[]) {
|
|
|
180
181
|
],
|
|
181
182
|
style: footerRowStyle ? (XEUtils.isFunction(footerRowStyle) ? footerRowStyle(rowParams) : footerRowStyle) : null
|
|
182
183
|
}
|
|
183
|
-
}, renderRows(h, _vm,
|
|
184
|
+
}, renderRows(h, _vm, renderColumnList, footerTableData, row, $rowIndex, _rowIndex))
|
|
184
185
|
}
|
|
185
186
|
return h('tr', {
|
|
186
187
|
key: $rowIndex,
|
|
@@ -189,7 +190,7 @@ function renderHeads (h: CreateElement, _vm: any, footerTableData: any[]) {
|
|
|
189
190
|
footerRowClassName ? XEUtils.isFunction(footerRowClassName) ? footerRowClassName(rowParams) : footerRowClassName : ''
|
|
190
191
|
],
|
|
191
192
|
style: footerRowStyle ? (XEUtils.isFunction(footerRowStyle) ? footerRowStyle(rowParams) : footerRowStyle) : null
|
|
192
|
-
}, renderRows(h, _vm,
|
|
193
|
+
}, renderRows(h, _vm, renderColumnList, footerTableData, row, $rowIndex, _rowIndex))
|
|
193
194
|
})
|
|
194
195
|
}
|
|
195
196
|
|
|
@@ -223,19 +224,33 @@ export default {
|
|
|
223
224
|
elemStore[`${prefix}xSpace`] = null
|
|
224
225
|
},
|
|
225
226
|
render (h: CreateElement) {
|
|
226
|
-
|
|
227
|
-
const
|
|
227
|
+
const props = this
|
|
228
|
+
const $xeTable = this.$parent
|
|
229
|
+
const tableProps = $xeTable
|
|
230
|
+
const tableReactData = $xeTable
|
|
231
|
+
const tableInternalData = $xeTable
|
|
232
|
+
|
|
233
|
+
const { tId } = $xeTable
|
|
234
|
+
const { fixedType, fixedColumn, tableColumn } = props
|
|
235
|
+
|
|
236
|
+
const { spanMethod, footerSpanMethod, showFooterOverflow: allColumnFooterOverflow } = tableProps
|
|
237
|
+
const { visibleColumn } = tableInternalData
|
|
238
|
+
const { scrollbarWidth } = tableReactData
|
|
239
|
+
|
|
240
|
+
let renderColumnList = tableColumn
|
|
241
|
+
|
|
228
242
|
// 如果是使用优化模式
|
|
229
243
|
if (fixedType) {
|
|
230
|
-
//
|
|
231
|
-
if (
|
|
232
|
-
|
|
233
|
-
|
|
244
|
+
// 如果是使用优化模式
|
|
245
|
+
if (allColumnFooterOverflow) {
|
|
246
|
+
// 如果不支持优化模式
|
|
247
|
+
if (spanMethod || footerSpanMethod) {
|
|
248
|
+
renderColumnList = visibleColumn
|
|
234
249
|
} else {
|
|
235
|
-
|
|
250
|
+
renderColumnList = fixedColumn || []
|
|
236
251
|
}
|
|
237
252
|
} else {
|
|
238
|
-
|
|
253
|
+
renderColumnList = visibleColumn
|
|
239
254
|
}
|
|
240
255
|
}
|
|
241
256
|
|
|
@@ -252,7 +267,7 @@ export default {
|
|
|
252
267
|
on: ons
|
|
253
268
|
}, [
|
|
254
269
|
fixedType
|
|
255
|
-
?
|
|
270
|
+
? renderEmptyElement($xeTable)
|
|
256
271
|
: h('div', {
|
|
257
272
|
class: 'vxe-body--x-space',
|
|
258
273
|
ref: 'xSpace'
|
|
@@ -272,7 +287,7 @@ export default {
|
|
|
272
287
|
*/
|
|
273
288
|
h('colgroup', {
|
|
274
289
|
ref: 'colgroup'
|
|
275
|
-
},
|
|
290
|
+
}, renderColumnList.map((column: any, $columnIndex: any) => {
|
|
276
291
|
return h('col', {
|
|
277
292
|
attrs: {
|
|
278
293
|
name: column.id
|
|
@@ -293,7 +308,7 @@ export default {
|
|
|
293
308
|
*/
|
|
294
309
|
h('tfoot', {
|
|
295
310
|
ref: 'tfoot'
|
|
296
|
-
}, renderHeads(h, this,
|
|
311
|
+
}, renderHeads(h, this, renderColumnList))
|
|
297
312
|
])
|
|
298
313
|
])
|
|
299
314
|
},
|
|
@@ -7,7 +7,7 @@ import { convertHeaderColumnToRows, getColReMinWidth } from './util'
|
|
|
7
7
|
|
|
8
8
|
import type { VxeTableDefines } from '../../../types'
|
|
9
9
|
|
|
10
|
-
const { renderer } = VxeUI
|
|
10
|
+
const { renderer, renderEmptyElement } = VxeUI
|
|
11
11
|
|
|
12
12
|
const cellType = 'header'
|
|
13
13
|
|
|
@@ -209,17 +209,35 @@ export default {
|
|
|
209
209
|
elemStore[`${prefix}repair`] = null
|
|
210
210
|
},
|
|
211
211
|
render (h: CreateElement) {
|
|
212
|
-
const
|
|
213
|
-
const
|
|
212
|
+
const props = this
|
|
213
|
+
const $xeTable = this.$parent
|
|
214
|
+
const tableProps = $xeTable
|
|
215
|
+
const tableReactData = $xeTable
|
|
216
|
+
const tableInternalData = $xeTable
|
|
217
|
+
|
|
218
|
+
const { tId } = $xeTable
|
|
219
|
+
const { fixedType, fixedColumn, tableColumn } = props
|
|
220
|
+
const { headerColumn } = this
|
|
221
|
+
|
|
222
|
+
const { showHeaderOverflow: allColumnHeaderOverflow, spanMethod, footerSpanMethod } = tableProps
|
|
223
|
+
const { isGroup, scrollbarWidth } = tableReactData
|
|
224
|
+
const { visibleColumn } = tableInternalData
|
|
214
225
|
let headerGroups = headerColumn
|
|
215
226
|
let renderColumnList = tableColumn
|
|
216
227
|
if (isGroup) {
|
|
217
228
|
renderColumnList = visibleColumn
|
|
218
229
|
} else {
|
|
219
|
-
// 如果是使用优化模式
|
|
220
230
|
if (fixedType) {
|
|
221
|
-
|
|
222
|
-
|
|
231
|
+
// 如果是使用优化模式
|
|
232
|
+
if (allColumnHeaderOverflow) {
|
|
233
|
+
// 如果不支持优化模式
|
|
234
|
+
if (spanMethod || footerSpanMethod) {
|
|
235
|
+
renderColumnList = visibleColumn
|
|
236
|
+
} else {
|
|
237
|
+
renderColumnList = fixedColumn || []
|
|
238
|
+
}
|
|
239
|
+
} else {
|
|
240
|
+
renderColumnList = visibleColumn
|
|
223
241
|
}
|
|
224
242
|
}
|
|
225
243
|
headerGroups = [renderColumnList]
|
|
@@ -231,7 +249,7 @@ export default {
|
|
|
231
249
|
}
|
|
232
250
|
}, [
|
|
233
251
|
fixedType
|
|
234
|
-
?
|
|
252
|
+
? renderEmptyElement($xeTable)
|
|
235
253
|
: h('div', {
|
|
236
254
|
class: 'vxe-body--x-space',
|
|
237
255
|
ref: 'xSpace'
|
|
@@ -2969,11 +2969,8 @@ const Methods = {
|
|
|
2969
2969
|
editStore,
|
|
2970
2970
|
currentRow,
|
|
2971
2971
|
mouseConfig,
|
|
2972
|
-
keyboardConfig,
|
|
2973
|
-
keyboardOpts,
|
|
2974
2972
|
spanMethod,
|
|
2975
|
-
|
|
2976
|
-
mergeFooterList,
|
|
2973
|
+
expandColumn,
|
|
2977
2974
|
footerSpanMethod,
|
|
2978
2975
|
isAllOverflow,
|
|
2979
2976
|
visibleColumn
|
|
@@ -3034,10 +3031,17 @@ const Methods = {
|
|
|
3034
3031
|
if (isGroup) {
|
|
3035
3032
|
renderColumnList = visibleColumn
|
|
3036
3033
|
} else {
|
|
3037
|
-
// 如果是使用优化模式
|
|
3038
3034
|
if (fixedType) {
|
|
3039
|
-
|
|
3040
|
-
|
|
3035
|
+
// 如果是使用优化模式
|
|
3036
|
+
if (allColumnHeaderOverflow) {
|
|
3037
|
+
// 如果不支持优化模式
|
|
3038
|
+
if (spanMethod || footerSpanMethod) {
|
|
3039
|
+
renderColumnList = visibleColumn
|
|
3040
|
+
} else {
|
|
3041
|
+
renderColumnList = fixedColumn || []
|
|
3042
|
+
}
|
|
3043
|
+
} else {
|
|
3044
|
+
renderColumnList = visibleColumn
|
|
3041
3045
|
}
|
|
3042
3046
|
}
|
|
3043
3047
|
}
|
|
@@ -3129,19 +3133,20 @@ const Methods = {
|
|
|
3129
3133
|
let tWidth = tableWidth
|
|
3130
3134
|
let renderColumnList = tableColumn
|
|
3131
3135
|
|
|
3132
|
-
// 如果是使用优化模式
|
|
3133
3136
|
if (fixedType) {
|
|
3134
|
-
//
|
|
3135
|
-
if (
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
} else {
|
|
3137
|
+
// 如果是使用优化模式
|
|
3138
|
+
if (scrollXLoad || scrollYLoad || (allColumnOverflow && isAllOverflow)) {
|
|
3139
|
+
// 如果不支持优化模式
|
|
3140
|
+
if (expandColumn || spanMethod || footerSpanMethod) {
|
|
3139
3141
|
renderColumnList = visibleColumn
|
|
3142
|
+
} else {
|
|
3143
|
+
renderColumnList = fixedColumn || []
|
|
3140
3144
|
}
|
|
3141
3145
|
} else {
|
|
3142
3146
|
renderColumnList = visibleColumn
|
|
3143
3147
|
}
|
|
3144
3148
|
}
|
|
3149
|
+
|
|
3145
3150
|
tWidth = renderColumnList.reduce((previous: any, column: any) => previous + column.renderWidth, 0)
|
|
3146
3151
|
|
|
3147
3152
|
if (tableElem) {
|
|
@@ -3156,19 +3161,20 @@ const Methods = {
|
|
|
3156
3161
|
let tWidth = tableWidth
|
|
3157
3162
|
let renderColumnList = tableColumn
|
|
3158
3163
|
|
|
3159
|
-
// 如果是使用优化模式
|
|
3160
3164
|
if (fixedType) {
|
|
3161
|
-
//
|
|
3162
|
-
if (
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
} else {
|
|
3165
|
+
// 如果是使用优化模式
|
|
3166
|
+
if (allColumnFooterOverflow) {
|
|
3167
|
+
// 如果不支持优化模式
|
|
3168
|
+
if (spanMethod || footerSpanMethod) {
|
|
3166
3169
|
renderColumnList = visibleColumn
|
|
3170
|
+
} else {
|
|
3171
|
+
renderColumnList = fixedColumn || []
|
|
3167
3172
|
}
|
|
3168
3173
|
} else {
|
|
3169
3174
|
renderColumnList = visibleColumn
|
|
3170
3175
|
}
|
|
3171
3176
|
}
|
|
3177
|
+
|
|
3172
3178
|
tWidth = renderColumnList.reduce((previous: any, column: any) => previous + column.renderWidth, 0)
|
|
3173
3179
|
|
|
3174
3180
|
if (isNodeElement(wrapperElem)) {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|