vxe-table 4.19.11 → 4.19.13
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/dist/all.esm.js +227 -220
- package/dist/style.css +1 -1
- package/dist/style.min.css +1 -1
- package/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/menu/panel.js +7 -7
- package/es/table/src/cell.js +16 -12
- package/es/table/src/columnInfo.js +77 -77
- package/es/table/src/table.js +7 -3
- package/es/table/style.css +29 -13
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +29 -13
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +259 -249
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/menu/panel.js +8 -8
- package/lib/table/module/menu/panel.min.js +1 -1
- package/lib/table/src/cell.js +6 -4
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/columnInfo.js +85 -77
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/table.js +3 -3
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +29 -13
- package/lib/table/style/style.min.css +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/lib/vxe-table/style/style.css +29 -13
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/table/module/menu/panel.ts +7 -7
- package/packages/table/src/cell.ts +16 -12
- package/packages/table/src/columnInfo.ts +80 -80
- package/packages/table/src/table.ts +7 -3
- package/packages/table/src/util.ts +1 -1
- package/styles/components/table-module/menu.scss +5 -2
- package/styles/components/table.scss +24 -6
- /package/es/{iconfont.1781074420923.ttf → iconfont.1781229243647.ttf} +0 -0
- /package/es/{iconfont.1781074420923.woff → iconfont.1781229243647.woff} +0 -0
- /package/es/{iconfont.1781074420923.woff2 → iconfont.1781229243647.woff2} +0 -0
- /package/lib/{iconfont.1781074420923.ttf → iconfont.1781229243647.ttf} +0 -0
- /package/lib/{iconfont.1781074420923.woff → iconfont.1781229243647.woff} +0 -0
- /package/lib/{iconfont.1781074420923.woff2 → iconfont.1781229243647.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -3314,7 +3314,7 @@ function getDefaultConfig(val1, def1) {
|
|
|
3314
3314
|
/* unused harmony import specifier */ var VxeUI;
|
|
3315
3315
|
|
|
3316
3316
|
|
|
3317
|
-
const version = "4.19.
|
|
3317
|
+
const version = "4.19.13";
|
|
3318
3318
|
core_.VxeUI.version = version;
|
|
3319
3319
|
core_.VxeUI.tableVersion = version;
|
|
3320
3320
|
core_.VxeUI.setConfig({
|
|
@@ -3843,239 +3843,6 @@ var es_iterator_map = __webpack_require__(1701);
|
|
|
3843
3843
|
var es_iterator_reduce = __webpack_require__(8237);
|
|
3844
3844
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.some.js
|
|
3845
3845
|
var es_iterator_some = __webpack_require__(3579);
|
|
3846
|
-
;// ./packages/ui/src/log.ts
|
|
3847
|
-
|
|
3848
|
-
const {
|
|
3849
|
-
log: log_log
|
|
3850
|
-
} = core_.VxeUI;
|
|
3851
|
-
const log_version = `table v${"4.19.11"}`;
|
|
3852
|
-
const warnLog = log_log.create('warn', log_version);
|
|
3853
|
-
const errLog = log_log.create('error', log_version);
|
|
3854
|
-
;// ./packages/table/src/columnInfo.ts
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
const {
|
|
3861
|
-
getI18n: columnInfo_getI18n,
|
|
3862
|
-
formats: columnInfo_formats,
|
|
3863
|
-
renderer: columnInfo_renderer
|
|
3864
|
-
} = core_.VxeUI;
|
|
3865
|
-
class ColumnInfo {
|
|
3866
|
-
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
3867
|
-
constructor($xeTable, _vm, {
|
|
3868
|
-
renderHeader,
|
|
3869
|
-
renderCell,
|
|
3870
|
-
renderFooter,
|
|
3871
|
-
renderData
|
|
3872
|
-
} = {}) {
|
|
3873
|
-
const tableProps = $xeTable.props;
|
|
3874
|
-
const $xeGrid = $xeTable.xeGrid;
|
|
3875
|
-
const $xeGantt = $xeTable.xeGantt;
|
|
3876
|
-
const $xeGGWrapper = $xeGrid || $xeGantt;
|
|
3877
|
-
const {
|
|
3878
|
-
field,
|
|
3879
|
-
editRender,
|
|
3880
|
-
filterRender
|
|
3881
|
-
} = _vm;
|
|
3882
|
-
const colId = _vm.colId || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId('col_');
|
|
3883
|
-
const formatter = _vm.formatter;
|
|
3884
|
-
const visible = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(_vm.visible) ? _vm.visible : true;
|
|
3885
|
-
const flCompConf = isEnableConf(filterRender) ? columnInfo_renderer.get(filterRender.name) : null;
|
|
3886
|
-
const ctFilterOptions = flCompConf ? flCompConf.createTableFilterOptions : null;
|
|
3887
|
-
const filters = toFilters(_vm.filters, colId);
|
|
3888
|
-
const types = ['seq', 'checkbox', 'radio', 'expand', 'html'];
|
|
3889
|
-
if (_vm.type && types.indexOf(_vm.type) === -1) {
|
|
3890
|
-
warnLog('vxe.error.errProp', [`type=${_vm.type}`, types.join(', ')]);
|
|
3891
|
-
}
|
|
3892
|
-
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(_vm.cellRender) || _vm.cellRender && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isObject(_vm.cellRender)) {
|
|
3893
|
-
warnLog('vxe.error.errProp', [`column.cell-render=${_vm.cellRender}`, 'column.cell-render={}']);
|
|
3894
|
-
}
|
|
3895
|
-
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(_vm.editRender) || _vm.editRender && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isObject(_vm.editRender)) {
|
|
3896
|
-
warnLog('vxe.error.errProp', [`column.edit-render=${_vm.editRender}`, 'column.edit-render={}']);
|
|
3897
|
-
}
|
|
3898
|
-
if (_vm.type === 'expand') {
|
|
3899
|
-
const {
|
|
3900
|
-
treeConfig
|
|
3901
|
-
} = tableProps;
|
|
3902
|
-
const {
|
|
3903
|
-
computeTreeOpts
|
|
3904
|
-
} = $xeTable.getComputeMaps();
|
|
3905
|
-
const treeOpts = computeTreeOpts.value;
|
|
3906
|
-
if (treeConfig && (treeOpts.showLine || treeOpts.line)) {
|
|
3907
|
-
errLog('vxe.error.errConflicts', ['tree-config.showLine', 'column.type=expand']);
|
|
3908
|
-
}
|
|
3909
|
-
}
|
|
3910
|
-
if (formatter) {
|
|
3911
|
-
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(formatter)) {
|
|
3912
|
-
const gFormatOpts = columnInfo_formats.get(formatter) || (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default())[formatter];
|
|
3913
|
-
if (!gFormatOpts || !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(gFormatOpts.tableCellFormatMethod || gFormatOpts.cellFormatMethod)) {
|
|
3914
|
-
errLog('vxe.error.notFormats', [formatter]);
|
|
3915
|
-
}
|
|
3916
|
-
} else if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(formatter)) {
|
|
3917
|
-
const gFormatOpts = columnInfo_formats.get(formatter[0]) || (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default())[formatter[0]];
|
|
3918
|
-
if (!gFormatOpts || !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(gFormatOpts.tableCellFormatMethod || gFormatOpts.cellFormatMethod)) {
|
|
3919
|
-
errLog('vxe.error.notFormats', [formatter[0]]);
|
|
3920
|
-
}
|
|
3921
|
-
}
|
|
3922
|
-
}
|
|
3923
|
-
if (_vm.aggFunc) {
|
|
3924
|
-
if (!$xeTable.handlePivotTableAggData && _vm.aggFunc !== true) {
|
|
3925
|
-
errLog('vxe.error.errProp', [`column.agg-func=${_vm.aggFunc}`, 'column.agg-func=true']);
|
|
3926
|
-
}
|
|
3927
|
-
}
|
|
3928
|
-
if (field && editRender) {
|
|
3929
|
-
if (editRender.startField && `${editRender.startField}`.indexOf(field) >= 0) {
|
|
3930
|
-
errLog('vxe.error.modelConflicts', [`field=${field}`, `edit-render.startField=${editRender.startField}`]);
|
|
3931
|
-
}
|
|
3932
|
-
if (editRender.endField && `${editRender.endField}`.indexOf(field) >= 0) {
|
|
3933
|
-
errLog('vxe.error.modelConflicts', [`field=${field}`, `edit-render.endField=${editRender.endField}`]);
|
|
3934
|
-
}
|
|
3935
|
-
}
|
|
3936
|
-
Object.assign(this, {
|
|
3937
|
-
// 基本属性
|
|
3938
|
-
type: _vm.type,
|
|
3939
|
-
property: _vm.field,
|
|
3940
|
-
field: field,
|
|
3941
|
-
title: _vm.title,
|
|
3942
|
-
width: _vm.width,
|
|
3943
|
-
minWidth: _vm.minWidth,
|
|
3944
|
-
maxWidth: _vm.maxWidth,
|
|
3945
|
-
resizable: _vm.resizable,
|
|
3946
|
-
fixed: _vm.fixed,
|
|
3947
|
-
align: _vm.align,
|
|
3948
|
-
headerAlign: _vm.headerAlign,
|
|
3949
|
-
footerAlign: _vm.footerAlign,
|
|
3950
|
-
showOverflow: _vm.showOverflow,
|
|
3951
|
-
showHeaderOverflow: _vm.showHeaderOverflow,
|
|
3952
|
-
showFooterOverflow: _vm.showFooterOverflow,
|
|
3953
|
-
className: _vm.className,
|
|
3954
|
-
headerClassName: _vm.headerClassName,
|
|
3955
|
-
footerClassName: _vm.footerClassName,
|
|
3956
|
-
formatter: formatter,
|
|
3957
|
-
headerFormatter: _vm.headerFormatter,
|
|
3958
|
-
footerFormatter: _vm.footerFormatter,
|
|
3959
|
-
padding: _vm.padding,
|
|
3960
|
-
verticalAlign: _vm.verticalAlign,
|
|
3961
|
-
sortable: _vm.sortable,
|
|
3962
|
-
sortBy: _vm.sortBy,
|
|
3963
|
-
sortType: _vm.sortType,
|
|
3964
|
-
filters: filters,
|
|
3965
|
-
filterMultiple: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(_vm.filterMultiple) ? _vm.filterMultiple : true,
|
|
3966
|
-
filterMethod: _vm.filterMethod,
|
|
3967
|
-
filterResetMethod: _vm.filterResetMethod,
|
|
3968
|
-
filterRecoverMethod: _vm.filterRecoverMethod,
|
|
3969
|
-
filterRender: filterRender,
|
|
3970
|
-
floatingFilters: _vm.floatingFilters,
|
|
3971
|
-
rules: _vm.rules,
|
|
3972
|
-
rowGroupNode: _vm.rowGroupNode,
|
|
3973
|
-
treeNode: _vm.treeNode,
|
|
3974
|
-
dragSort: _vm.dragSort,
|
|
3975
|
-
rowResize: _vm.rowResize,
|
|
3976
|
-
cellType: _vm.cellType,
|
|
3977
|
-
cellRender: _vm.cellRender,
|
|
3978
|
-
editRender: editRender,
|
|
3979
|
-
contentRender: _vm.contentRender,
|
|
3980
|
-
headerExportMethod: _vm.headerExportMethod,
|
|
3981
|
-
exportMethod: _vm.exportMethod,
|
|
3982
|
-
footerExportMethod: _vm.footerExportMethod,
|
|
3983
|
-
titleHelp: _vm.titleHelp,
|
|
3984
|
-
titlePrefix: _vm.titlePrefix,
|
|
3985
|
-
titleSuffix: _vm.titleSuffix,
|
|
3986
|
-
aggFunc: _vm.aggFunc,
|
|
3987
|
-
copyMethod: _vm.copyMethod,
|
|
3988
|
-
cutMethod: _vm.cutMethod,
|
|
3989
|
-
pasteMethod: _vm.pasteMethod,
|
|
3990
|
-
// 自定义参数
|
|
3991
|
-
params: _vm.params,
|
|
3992
|
-
// 渲染属性
|
|
3993
|
-
id: colId,
|
|
3994
|
-
parentId: null,
|
|
3995
|
-
visible,
|
|
3996
|
-
// 内部属性(一旦被使用,将导致不可升级版本)
|
|
3997
|
-
defaultParentId: null,
|
|
3998
|
-
halfVisible: false,
|
|
3999
|
-
defaultVisible: visible,
|
|
4000
|
-
defaultFixed: _vm.fixed,
|
|
4001
|
-
defaultAggGroup: _vm.aggGroup,
|
|
4002
|
-
defaultAggFunc: _vm.aggFunc,
|
|
4003
|
-
checked: false,
|
|
4004
|
-
halfChecked: false,
|
|
4005
|
-
disabled: false,
|
|
4006
|
-
// 分组层级
|
|
4007
|
-
level: 1,
|
|
4008
|
-
// 跨行
|
|
4009
|
-
rowSpan: 1,
|
|
4010
|
-
// 跨列
|
|
4011
|
-
colSpan: 1,
|
|
4012
|
-
// 数据排序
|
|
4013
|
-
order: null,
|
|
4014
|
-
sortTime: 0,
|
|
4015
|
-
// 列排序
|
|
4016
|
-
sortNumber: 0,
|
|
4017
|
-
renderSortNumber: 0,
|
|
4018
|
-
renderAggFn: '',
|
|
4019
|
-
renderAggDigits: null,
|
|
4020
|
-
renderAggFormat: null,
|
|
4021
|
-
renderFixed: '',
|
|
4022
|
-
renderVisible: false,
|
|
4023
|
-
renderWidth: 0,
|
|
4024
|
-
renderHeight: 0,
|
|
4025
|
-
renderResizeWidth: 0,
|
|
4026
|
-
renderAutoWidth: 0,
|
|
4027
|
-
resizeWidth: 0,
|
|
4028
|
-
renderLeft: 0,
|
|
4029
|
-
renderArgs: [],
|
|
4030
|
-
model: {},
|
|
4031
|
-
renderHeader: renderHeader || _vm.renderHeader,
|
|
4032
|
-
renderCell: renderCell || _vm.renderCell,
|
|
4033
|
-
renderFooter: renderFooter || _vm.renderFooter,
|
|
4034
|
-
renderData: renderData,
|
|
4035
|
-
// 单元格插槽,只对 grid 有效
|
|
4036
|
-
slots: _vm.slots
|
|
4037
|
-
});
|
|
4038
|
-
if (ctFilterOptions && (!filters || !filters.length)) {
|
|
4039
|
-
this.filters = toFilters(ctFilterOptions({
|
|
4040
|
-
$table: $xeTable,
|
|
4041
|
-
column: this
|
|
4042
|
-
}), colId);
|
|
4043
|
-
}
|
|
4044
|
-
if ($xeGGWrapper) {
|
|
4045
|
-
const {
|
|
4046
|
-
computeProxyOpts
|
|
4047
|
-
} = $xeGGWrapper.getComputeMaps();
|
|
4048
|
-
const proxyOpts = computeProxyOpts.value;
|
|
4049
|
-
if (proxyOpts.beforeColumn) {
|
|
4050
|
-
proxyOpts.beforeColumn({
|
|
4051
|
-
$table: $xeTable,
|
|
4052
|
-
$grid: $xeGrid,
|
|
4053
|
-
$gantt: $xeGantt,
|
|
4054
|
-
column: this
|
|
4055
|
-
});
|
|
4056
|
-
}
|
|
4057
|
-
}
|
|
4058
|
-
}
|
|
4059
|
-
getTitle() {
|
|
4060
|
-
return getFuncText(this.title || (this.type === 'seq' ? columnInfo_getI18n('vxe.table.seqTitle') : ''));
|
|
4061
|
-
}
|
|
4062
|
-
getKey() {
|
|
4063
|
-
const {
|
|
4064
|
-
type
|
|
4065
|
-
} = this;
|
|
4066
|
-
return this.field || (type ? `type=${type}` : null);
|
|
4067
|
-
}
|
|
4068
|
-
update(name, value) {
|
|
4069
|
-
// 不支持直接修改的属性
|
|
4070
|
-
if (name !== 'filters') {
|
|
4071
|
-
if (name === 'field') {
|
|
4072
|
-
// 兼容旧属性
|
|
4073
|
-
this.property = value;
|
|
4074
|
-
}
|
|
4075
|
-
this[name] = value;
|
|
4076
|
-
}
|
|
4077
|
-
}
|
|
4078
|
-
}
|
|
4079
3846
|
;// ./packages/ui/src/dom.ts
|
|
4080
3847
|
|
|
4081
3848
|
|
|
@@ -4329,6 +4096,247 @@ function wheelScrollTopTo(diffNum, cb) {
|
|
|
4329
4096
|
wtaFrame = null;
|
|
4330
4097
|
});
|
|
4331
4098
|
}
|
|
4099
|
+
;// ./packages/ui/src/log.ts
|
|
4100
|
+
|
|
4101
|
+
const {
|
|
4102
|
+
log: log_log
|
|
4103
|
+
} = core_.VxeUI;
|
|
4104
|
+
const log_version = `table v${"4.19.13"}`;
|
|
4105
|
+
const warnLog = log_log.create('warn', log_version);
|
|
4106
|
+
const errLog = log_log.create('error', log_version);
|
|
4107
|
+
;// ./packages/table/src/columnInfo.ts
|
|
4108
|
+
|
|
4109
|
+
|
|
4110
|
+
|
|
4111
|
+
|
|
4112
|
+
|
|
4113
|
+
|
|
4114
|
+
const {
|
|
4115
|
+
getI18n: columnInfo_getI18n,
|
|
4116
|
+
formats: columnInfo_formats,
|
|
4117
|
+
renderer: columnInfo_renderer
|
|
4118
|
+
} = core_.VxeUI;
|
|
4119
|
+
class ColumnInfo {
|
|
4120
|
+
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
4121
|
+
constructor($xeTable, colConfs, {
|
|
4122
|
+
renderHeader,
|
|
4123
|
+
renderCell,
|
|
4124
|
+
renderFooter,
|
|
4125
|
+
renderData
|
|
4126
|
+
} = {}) {
|
|
4127
|
+
const tableProps = $xeTable.props;
|
|
4128
|
+
const $xeGrid = $xeTable.xeGrid;
|
|
4129
|
+
const $xeGantt = $xeTable.xeGantt;
|
|
4130
|
+
const $xeGGWrapper = $xeGrid || $xeGantt;
|
|
4131
|
+
const {
|
|
4132
|
+
type,
|
|
4133
|
+
field,
|
|
4134
|
+
width,
|
|
4135
|
+
visible,
|
|
4136
|
+
aggFunc,
|
|
4137
|
+
formatter,
|
|
4138
|
+
filterMultiple,
|
|
4139
|
+
cellRender,
|
|
4140
|
+
editRender,
|
|
4141
|
+
filterRender
|
|
4142
|
+
} = colConfs;
|
|
4143
|
+
const colId = colConfs.colId || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId('col_');
|
|
4144
|
+
const defaultVisible = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(visible) ? visible : true;
|
|
4145
|
+
const defaultRenderWidth = width && isPx(width) && width !== 'auto' ? Math.max(0, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(width)) : 0;
|
|
4146
|
+
const flCompConf = filterRender && isEnableConf(filterRender) ? columnInfo_renderer.get(filterRender.name) : null;
|
|
4147
|
+
const ctFilterOptions = flCompConf ? flCompConf.createTableFilterOptions : null;
|
|
4148
|
+
const filters = toFilters(colConfs.filters, colId);
|
|
4149
|
+
const types = ['seq', 'checkbox', 'radio', 'expand', 'html'];
|
|
4150
|
+
if (type && types.indexOf(type) === -1) {
|
|
4151
|
+
warnLog('vxe.error.errProp', [`type=${type}`, types.join(', ')]);
|
|
4152
|
+
}
|
|
4153
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(cellRender) || cellRender && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isObject(cellRender)) {
|
|
4154
|
+
warnLog('vxe.error.errProp', [`column.cell-render=${cellRender}`, 'column.cell-render={}']);
|
|
4155
|
+
}
|
|
4156
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(editRender) || editRender && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isObject(editRender)) {
|
|
4157
|
+
warnLog('vxe.error.errProp', [`column.edit-render=${editRender}`, 'column.edit-render={}']);
|
|
4158
|
+
}
|
|
4159
|
+
if (type === 'expand') {
|
|
4160
|
+
const {
|
|
4161
|
+
treeConfig
|
|
4162
|
+
} = tableProps;
|
|
4163
|
+
const {
|
|
4164
|
+
computeTreeOpts
|
|
4165
|
+
} = $xeTable.getComputeMaps();
|
|
4166
|
+
const treeOpts = computeTreeOpts.value;
|
|
4167
|
+
if (treeConfig && (treeOpts.showLine || treeOpts.line)) {
|
|
4168
|
+
errLog('vxe.error.errConflicts', ['tree-config.showLine', 'column.type=expand']);
|
|
4169
|
+
}
|
|
4170
|
+
}
|
|
4171
|
+
if (formatter) {
|
|
4172
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(formatter)) {
|
|
4173
|
+
const gFormatOpts = columnInfo_formats.get(formatter) || (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default())[formatter];
|
|
4174
|
+
if (!gFormatOpts || !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(gFormatOpts.tableCellFormatMethod || gFormatOpts.cellFormatMethod)) {
|
|
4175
|
+
errLog('vxe.error.notFormats', [formatter]);
|
|
4176
|
+
}
|
|
4177
|
+
} else if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(formatter)) {
|
|
4178
|
+
const gFormatOpts = columnInfo_formats.get(formatter[0]) || (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default())[formatter[0]];
|
|
4179
|
+
if (!gFormatOpts || !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(gFormatOpts.tableCellFormatMethod || gFormatOpts.cellFormatMethod)) {
|
|
4180
|
+
errLog('vxe.error.notFormats', [formatter[0]]);
|
|
4181
|
+
}
|
|
4182
|
+
}
|
|
4183
|
+
}
|
|
4184
|
+
if (aggFunc) {
|
|
4185
|
+
if (!$xeTable.handlePivotTableAggData && aggFunc !== true) {
|
|
4186
|
+
errLog('vxe.error.errProp', [`column.agg-func=${aggFunc}`, 'column.agg-func=true']);
|
|
4187
|
+
}
|
|
4188
|
+
}
|
|
4189
|
+
if (field && editRender) {
|
|
4190
|
+
if (editRender.startField && `${editRender.startField}`.indexOf(field) >= 0) {
|
|
4191
|
+
errLog('vxe.error.modelConflicts', [`field=${field}`, `edit-render.startField=${editRender.startField}`]);
|
|
4192
|
+
}
|
|
4193
|
+
if (editRender.endField && `${editRender.endField}`.indexOf(field) >= 0) {
|
|
4194
|
+
errLog('vxe.error.modelConflicts', [`field=${field}`, `edit-render.endField=${editRender.endField}`]);
|
|
4195
|
+
}
|
|
4196
|
+
}
|
|
4197
|
+
Object.assign(this, {
|
|
4198
|
+
// 基本属性
|
|
4199
|
+
type: colConfs.type,
|
|
4200
|
+
property: colConfs.field,
|
|
4201
|
+
field: field,
|
|
4202
|
+
title: colConfs.title,
|
|
4203
|
+
width: colConfs.width,
|
|
4204
|
+
minWidth: colConfs.minWidth,
|
|
4205
|
+
maxWidth: colConfs.maxWidth,
|
|
4206
|
+
resizable: colConfs.resizable,
|
|
4207
|
+
fixed: colConfs.fixed,
|
|
4208
|
+
align: colConfs.align,
|
|
4209
|
+
headerAlign: colConfs.headerAlign,
|
|
4210
|
+
footerAlign: colConfs.footerAlign,
|
|
4211
|
+
showOverflow: colConfs.showOverflow,
|
|
4212
|
+
showHeaderOverflow: colConfs.showHeaderOverflow,
|
|
4213
|
+
showFooterOverflow: colConfs.showFooterOverflow,
|
|
4214
|
+
className: colConfs.className,
|
|
4215
|
+
headerClassName: colConfs.headerClassName,
|
|
4216
|
+
footerClassName: colConfs.footerClassName,
|
|
4217
|
+
formatter: formatter,
|
|
4218
|
+
headerFormatter: colConfs.headerFormatter,
|
|
4219
|
+
footerFormatter: colConfs.footerFormatter,
|
|
4220
|
+
padding: colConfs.padding,
|
|
4221
|
+
verticalAlign: colConfs.verticalAlign,
|
|
4222
|
+
sortable: colConfs.sortable,
|
|
4223
|
+
sortBy: colConfs.sortBy,
|
|
4224
|
+
sortType: colConfs.sortType,
|
|
4225
|
+
filters: filters,
|
|
4226
|
+
filterMultiple: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(filterMultiple) ? filterMultiple : true,
|
|
4227
|
+
filterMethod: colConfs.filterMethod,
|
|
4228
|
+
filterResetMethod: colConfs.filterResetMethod,
|
|
4229
|
+
filterRecoverMethod: colConfs.filterRecoverMethod,
|
|
4230
|
+
filterRender: filterRender,
|
|
4231
|
+
floatingFilters: colConfs.floatingFilters,
|
|
4232
|
+
rules: colConfs.rules,
|
|
4233
|
+
rowGroupNode: colConfs.rowGroupNode,
|
|
4234
|
+
treeNode: colConfs.treeNode,
|
|
4235
|
+
dragSort: colConfs.dragSort,
|
|
4236
|
+
rowResize: colConfs.rowResize,
|
|
4237
|
+
cellType: colConfs.cellType,
|
|
4238
|
+
cellRender: cellRender,
|
|
4239
|
+
editRender: editRender,
|
|
4240
|
+
contentRender: colConfs.contentRender,
|
|
4241
|
+
headerExportMethod: colConfs.headerExportMethod,
|
|
4242
|
+
exportMethod: colConfs.exportMethod,
|
|
4243
|
+
footerExportMethod: colConfs.footerExportMethod,
|
|
4244
|
+
titleHelp: colConfs.titleHelp,
|
|
4245
|
+
titlePrefix: colConfs.titlePrefix,
|
|
4246
|
+
titleSuffix: colConfs.titleSuffix,
|
|
4247
|
+
aggFunc: colConfs.aggFunc,
|
|
4248
|
+
copyMethod: colConfs.copyMethod,
|
|
4249
|
+
cutMethod: colConfs.cutMethod,
|
|
4250
|
+
pasteMethod: colConfs.pasteMethod,
|
|
4251
|
+
// 自定义参数
|
|
4252
|
+
params: colConfs.params,
|
|
4253
|
+
// 渲染属性
|
|
4254
|
+
id: colId,
|
|
4255
|
+
parentId: null,
|
|
4256
|
+
visible: defaultVisible,
|
|
4257
|
+
// 内部属性(一旦被使用,将导致不可升级版本)
|
|
4258
|
+
defaultParentId: null,
|
|
4259
|
+
halfVisible: false,
|
|
4260
|
+
defaultVisible: defaultVisible,
|
|
4261
|
+
defaultFixed: colConfs.fixed,
|
|
4262
|
+
defaultAggFunc: colConfs.aggFunc,
|
|
4263
|
+
checked: false,
|
|
4264
|
+
halfChecked: false,
|
|
4265
|
+
disabled: false,
|
|
4266
|
+
// 分组层级
|
|
4267
|
+
level: 1,
|
|
4268
|
+
// 跨行
|
|
4269
|
+
rowSpan: 1,
|
|
4270
|
+
// 跨列
|
|
4271
|
+
colSpan: 1,
|
|
4272
|
+
// 数据排序
|
|
4273
|
+
order: null,
|
|
4274
|
+
sortTime: 0,
|
|
4275
|
+
// 列排序
|
|
4276
|
+
sortNumber: 0,
|
|
4277
|
+
renderSortNumber: 0,
|
|
4278
|
+
renderAggFn: '',
|
|
4279
|
+
renderAggDigits: null,
|
|
4280
|
+
renderAggFormat: null,
|
|
4281
|
+
renderFixed: '',
|
|
4282
|
+
renderVisible: false,
|
|
4283
|
+
renderWidth: defaultRenderWidth,
|
|
4284
|
+
renderHeight: 0,
|
|
4285
|
+
renderResizeWidth: 0,
|
|
4286
|
+
renderAutoWidth: 0,
|
|
4287
|
+
resizeWidth: 0,
|
|
4288
|
+
renderLeft: 0,
|
|
4289
|
+
renderArgs: [],
|
|
4290
|
+
model: {},
|
|
4291
|
+
renderHeader: renderHeader || colConfs.renderHeader,
|
|
4292
|
+
renderCell: renderCell || colConfs.renderCell,
|
|
4293
|
+
renderFooter: renderFooter || colConfs.renderFooter,
|
|
4294
|
+
renderData: renderData,
|
|
4295
|
+
// 单元格插槽,只对 grid 有效
|
|
4296
|
+
slots: colConfs.slots
|
|
4297
|
+
});
|
|
4298
|
+
if (ctFilterOptions && (!filters || !filters.length)) {
|
|
4299
|
+
this.filters = toFilters(ctFilterOptions({
|
|
4300
|
+
$table: $xeTable,
|
|
4301
|
+
column: this
|
|
4302
|
+
}), colId);
|
|
4303
|
+
}
|
|
4304
|
+
if ($xeGGWrapper) {
|
|
4305
|
+
const {
|
|
4306
|
+
computeProxyOpts
|
|
4307
|
+
} = $xeGGWrapper.getComputeMaps();
|
|
4308
|
+
const proxyOpts = computeProxyOpts.value;
|
|
4309
|
+
if (proxyOpts.beforeColumn) {
|
|
4310
|
+
proxyOpts.beforeColumn({
|
|
4311
|
+
$table: $xeTable,
|
|
4312
|
+
$grid: $xeGrid,
|
|
4313
|
+
$gantt: $xeGantt,
|
|
4314
|
+
column: this
|
|
4315
|
+
});
|
|
4316
|
+
}
|
|
4317
|
+
}
|
|
4318
|
+
}
|
|
4319
|
+
getTitle() {
|
|
4320
|
+
return getFuncText(this.title || (this.type === 'seq' ? columnInfo_getI18n('vxe.table.seqTitle') : ''));
|
|
4321
|
+
}
|
|
4322
|
+
getKey() {
|
|
4323
|
+
const {
|
|
4324
|
+
type,
|
|
4325
|
+
field
|
|
4326
|
+
} = this;
|
|
4327
|
+
return field || (type ? `type=${type}` : null);
|
|
4328
|
+
}
|
|
4329
|
+
update(name, value) {
|
|
4330
|
+
// 不支持直接修改的属性
|
|
4331
|
+
if (name !== 'filters') {
|
|
4332
|
+
if (name === 'field') {
|
|
4333
|
+
// 兼容旧属性
|
|
4334
|
+
this.property = value;
|
|
4335
|
+
}
|
|
4336
|
+
this[name] = value;
|
|
4337
|
+
}
|
|
4338
|
+
}
|
|
4339
|
+
}
|
|
4332
4340
|
;// ./packages/table/src/util.ts
|
|
4333
4341
|
|
|
4334
4342
|
|
|
@@ -6765,10 +6773,12 @@ const Cell = {
|
|
|
6765
6773
|
isLazyLoading = !!rowExpandLazyLoadedMaps[rowid];
|
|
6766
6774
|
}
|
|
6767
6775
|
}
|
|
6768
|
-
return renderCellBaseVNs(params, [showIcon && (!visibleMethod || visibleMethod(params)) ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('
|
|
6776
|
+
return renderCellBaseVNs(params, [showIcon && (!visibleMethod || visibleMethod(params)) ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
6769
6777
|
class: ['vxe-table--expanded', {
|
|
6770
6778
|
'is--active': isActive
|
|
6771
|
-
}]
|
|
6779
|
+
}]
|
|
6780
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
6781
|
+
class: 'vxe-table--expand-btn',
|
|
6772
6782
|
onMousedown(evnt) {
|
|
6773
6783
|
evnt.stopPropagation();
|
|
6774
6784
|
},
|
|
@@ -6776,8 +6786,8 @@ const Cell = {
|
|
|
6776
6786
|
$table.triggerRowExpandEvent(evnt, params);
|
|
6777
6787
|
}
|
|
6778
6788
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
|
|
6779
|
-
class:
|
|
6780
|
-
})]) : renderEmptyElement($table), defaultSlot || labelField ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('
|
|
6789
|
+
class: isLazyLoading ? iconLoaded || cell_getIcon().TABLE_EXPAND_LOADED : isActive ? iconOpen || cell_getIcon().TABLE_EXPAND_OPEN : iconClose || cell_getIcon().TABLE_EXPAND_CLOSE
|
|
6790
|
+
})])]) : renderEmptyElement($table), defaultSlot || labelField ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
6781
6791
|
class: 'vxe-table--expand-label'
|
|
6782
6792
|
}, defaultSlot ? $table.callSlot(defaultSlot, params) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, labelField)) : renderEmptyElement($table)]);
|
|
6783
6793
|
},
|
|
@@ -12295,12 +12305,12 @@ const {
|
|
|
12295
12305
|
const menuOpts = computeMenuOpts.value;
|
|
12296
12306
|
const {
|
|
12297
12307
|
transfer,
|
|
12298
|
-
destroyOnClose
|
|
12308
|
+
destroyOnClose,
|
|
12309
|
+
className
|
|
12299
12310
|
} = menuOpts;
|
|
12300
12311
|
const {
|
|
12301
12312
|
visible,
|
|
12302
|
-
list
|
|
12303
|
-
className
|
|
12313
|
+
list
|
|
12304
12314
|
} = ctxMenuStore;
|
|
12305
12315
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(external_commonjs_vue_commonjs2_vue_root_Vue_.Teleport, {
|
|
12306
12316
|
to: 'body',
|
|
@@ -12313,7 +12323,7 @@ const {
|
|
|
12313
12323
|
style: ctxMenuStore.style
|
|
12314
12324
|
}, (destroyOnClose ? visible : true) ? list.map((options, gIndex) => {
|
|
12315
12325
|
return options.every(item => item.visible === false) ? menu_panel_renderEmptyElement($xeTable) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('ul', {
|
|
12316
|
-
class: 'vxe-context-menu
|
|
12326
|
+
class: 'vxe-table--context-menu-group-wrapper',
|
|
12317
12327
|
key: gIndex
|
|
12318
12328
|
}, options.map((item, index) => {
|
|
12319
12329
|
const {
|
|
@@ -12327,7 +12337,7 @@ const {
|
|
|
12327
12337
|
const suffixIcon = suffixOpts.icon || item.suffixIcon;
|
|
12328
12338
|
const menuContent = getFuncText(item.name);
|
|
12329
12339
|
return item.visible === false ? menu_panel_renderEmptyElement($xeTable) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('li', {
|
|
12330
|
-
class: [item.className, {
|
|
12340
|
+
class: ['vxe-table--context-menu--option', item.className, {
|
|
12331
12341
|
'link--loading': loading,
|
|
12332
12342
|
'link--disabled': item.disabled,
|
|
12333
12343
|
'link--active': item === ctxMenuStore.selected
|
|
@@ -12357,11 +12367,11 @@ const {
|
|
|
12357
12367
|
class: ['vxe-context-menu--link-suffix', suffixOpts.className || '']
|
|
12358
12368
|
}, [suffixIcon && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(suffixIcon) ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {}, getSlotVNs(suffixIcon({}))) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
|
|
12359
12369
|
class: suffixIcon || (hasChildMenus ? menu_panel_getIcon().TABLE_MENU_OPTIONS : '')
|
|
12360
|
-
}), suffixOpts.content ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', `${suffixOpts.content}`) : menu_panel_renderEmptyElement($xeTable)])]), hasChildMenus &&
|
|
12370
|
+
}), suffixOpts.content ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', `${suffixOpts.content}`) : menu_panel_renderEmptyElement($xeTable)])]), hasChildMenus && children ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('ul', {
|
|
12361
12371
|
class: ['vxe-table--context-menu-clild-wrapper', {
|
|
12362
12372
|
'is--show': item === ctxMenuStore.selected && ctxMenuStore.showChild
|
|
12363
12373
|
}]
|
|
12364
|
-
},
|
|
12374
|
+
}, children.map((child, cIndex) => {
|
|
12365
12375
|
const {
|
|
12366
12376
|
loading: childLoading
|
|
12367
12377
|
} = child;
|
|
@@ -12371,7 +12381,7 @@ const {
|
|
|
12371
12381
|
const childSuffixIcon = childSuffixOpts.icon || child.suffixIcon;
|
|
12372
12382
|
const childMenuContent = getFuncText(child.name);
|
|
12373
12383
|
return child.visible === false ? null : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('li', {
|
|
12374
|
-
class: [child.className, {
|
|
12384
|
+
class: ['vxe-table--context-menu--option', child.className, {
|
|
12375
12385
|
'link--loading': childLoading,
|
|
12376
12386
|
'link--disabled': child.disabled,
|
|
12377
12387
|
'link--active': child === ctxMenuStore.selectChild
|
|
@@ -20790,7 +20800,7 @@ if(props.spanMethod){warnLog('vxe.error.scrollErrProp',['span-method']);}if(prop
|
|
|
20790
20800
|
// 如果列被设置为固定,则清除合并状态
|
|
20791
20801
|
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();handleUpdateAggValues();if(isReset){updateColumnOffsetLeft();return $xeTable.updateFooter().then(()=>{return $xeTable.recalculate();}).then(()=>{$xeTable.updateCellAreas();return $xeTable.recalculate();});}return $xeTable.updateFooter();};const initColumnHierarchy=()=>{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]){errLog('vxe.error.colRepet',['field',field]);}fullColFieldData[field]=rest;}fullColIdData[colid]=rest;});internalData.fullColumnIdData=fullColIdData;internalData.fullColumnFieldData=fullColFieldData;};const buildColumnInfo=()=>{const{scrollXLoad,scrollYLoad,expandColumn}=reactData;const expandOpts=computeExpandOpts.value;cacheColumnMap();parseColumns(true).then(()=>{if(reactData.scrollXLoad){loadScrollXData();}});$xeTable.clearHeaderFormatterCache();$xeTable.clearMergeCells();$xeTable.clearMergeFooterItems();$xeTable.handleTableData(true);$xeTable.handleAggregateSummaryData();if((scrollXLoad||scrollYLoad)&&expandColumn&&expandOpts.mode!=='fixed'){warnLog('vxe.error.scrollErrProp',['column.type=expand']);}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{if($xeToolbar){$xeToolbar.syncUpdate({collectColumn:internalData.collectColumn,$table:$xeTable});}if($xeTable.handleUpdateCustomColumn){$xeTable.handleUpdateCustomColumn();}const columnOpts=computeColumnOpts.value;if(props.showCustomHeader&&reactData.isGroup&&(columnOpts.resizable||props.resizable)){warnLog('vxe.error.notConflictProp',['show-custom-header & colgroup','column-config.resizable=false']);}reactData.isColLoading=false;return handleLazyRecalculate(false,true,true);});};const handleInitColumn=collectColumn=>{internalData.collectColumn=collectColumn;const tFullColumn=getColumnList(collectColumn);internalData.tableFullColumn=tFullColumn;reactData.updateColFlag++;reactData.isColLoading=true;initColumnHierarchy();return Promise.resolve(restoreCustomStorage()).then(()=>{return buildColumnInfo();});};const updateScrollXStatus=fullColumn=>{const virtualXOpts=computeVirtualXOpts.value;const allCols=fullColumn||internalData.tableFullColumn;// 如果gt为0,则总是启用
|
|
20792
20802
|
const scrollXLoad=!!virtualXOpts.enabled&&virtualXOpts.gt>-1&&(virtualXOpts.gt===0||virtualXOpts.gt<allCols.length);reactData.scrollXLoad=scrollXLoad;return scrollXLoad;};const syncGanttScrollYStatus=()=>{const $xeGanttView=internalData.xeGanttView;if($xeGanttView&&$xeGanttView.handleUpdateSYStatus){$xeGanttView.handleUpdateSYStatus(reactData.scrollYLoad);}};const updateScrollYStatus=fullData=>{const{treeConfig}=props;const virtualYOpts=computeVirtualYOpts.value;const treeOpts=computeTreeOpts.value;const{transform}=treeOpts;const allList=fullData||internalData.tableFullData;// 如果gt为0,则总是启用
|
|
20793
|
-
|
|
20803
|
+
let scrollYLoad=!!virtualYOpts.enabled&&virtualYOpts.gt>-1&&(virtualYOpts.gt===0||virtualYOpts.gt<allList.length);if(scrollYLoad&&treeConfig&&!transform){errLog('vxe.error.notSupportProp',['[table] virtual-y-config.enabled=true','tree-config.transform=false','tree-config.transform=true']);scrollYLoad=false;}reactData.scrollYLoad=scrollYLoad;syncGanttScrollYStatus();return scrollYLoad;};/**
|
|
20794
20804
|
* 展开与收起树节点
|
|
20795
20805
|
* @param rows
|
|
20796
20806
|
* @param expanded
|
|
@@ -21268,7 +21278,7 @@ internalData.mergeHeaderRowMaps={};internalData.mergeHeaderColMaps={};internalDa
|
|
|
21268
21278
|
* 更新数据行的 Map
|
|
21269
21279
|
*/cacheRowMap(isReset){const{treeConfig}=props;const{isRowGroupStatus}=reactData;const{currKeyField,fullAllDataRowIdData,tableFullData,tableFullTreeData,tableFullGroupData,treeExpandedMaps,rowExpandedMaps,selectCheckboxMaps}=internalData;const fullAllDataRowIdMaps=isReset?{}:{...fullAllDataRowIdData};// 存在已删除数据
|
|
21270
21280
|
const fullDataRowIdMaps={};const idMaps={};const{handleUpdateRowId}=createHandleUpdateRowId($xeTable);const handleRowCache=(row,index,items,currIndex,parentRow,rowid,level,seq)=>{let rowRest=fullAllDataRowIdMaps[rowid];if(idMaps[rowid]){errLog('vxe.error.repeatKey',[currKeyField,rowid]);}if(!rowRest){rowRest={row,rowid,seq,index:-1,_index:-1,$index:-1,treeIndex:index,_tIndex:-1,items,parent:parentRow,level,height:0,resizeHeight:0,oTop:0,expandHeight:0};fullDataRowIdMaps[rowid]=rowRest;fullAllDataRowIdMaps[rowid]=rowRest;}rowRest.treeLoaded=false;rowRest.expandLoaded=false;rowRest.row=row;rowRest.items=items;rowRest.parent=parentRow;rowRest.level=level;rowRest.index=currIndex;rowRest.treeIndex=index;// 更新缓存
|
|
21271
|
-
if(selectCheckboxMaps[rowid]){selectCheckboxMaps[rowid]=row;}if(rowExpandedMaps[rowid]){rowExpandedMaps[rowid]=row;}idMaps[rowid]=true;fullDataRowIdMaps[rowid]=rowRest;fullAllDataRowIdMaps[rowid]=rowRest;};if(treeConfig){const treeOpts=computeTreeOpts.value;const{lazy}=treeOpts;const childrenField=treeOpts.children||treeOpts.childrenField;const hasChildField=treeOpts.hasChild||treeOpts.hasChildField;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullTreeData,(row,index,items,path,parentRow,nodes)=>{const rowid=handleUpdateRowId(row);if(
|
|
21281
|
+
if(selectCheckboxMaps[rowid]){selectCheckboxMaps[rowid]=row;}if(rowExpandedMaps[rowid]){rowExpandedMaps[rowid]=row;}idMaps[rowid]=true;fullDataRowIdMaps[rowid]=rowRest;fullAllDataRowIdMaps[rowid]=rowRest;};if(treeConfig){const treeOpts=computeTreeOpts.value;const{lazy}=treeOpts;const childrenField=treeOpts.children||treeOpts.childrenField;const hasChildField=treeOpts.hasChild||treeOpts.hasChildField;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullTreeData,(row,index,items,path,parentRow,nodes)=>{const rowid=handleUpdateRowId(row);if(lazy){if(row[hasChildField]&&row[childrenField]===undefined){row[childrenField]=null;}if(treeExpandedMaps[rowid]){if(!row[childrenField]||!row[childrenField].length){delete treeExpandedMaps[rowid];}}}handleRowCache(row,index,items,parentRow?-1:index,parentRow,rowid,nodes.length-1,toTreePathSeq(path));},{children:childrenField});}else if(isRowGroupStatus){const aggregateOpts=computeAggregateOpts.value;const{mapChildrenField}=aggregateOpts;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullGroupData,(row,index,items,path,parentRow,nodes)=>{const rowid=handleUpdateRowId(row);handleRowCache(row,index,items,parentRow?-1:index,parentRow,rowid,nodes.length-1,toTreePathSeq(path));},{children:mapChildrenField});}else{tableFullData.forEach((row,index,items)=>{handleRowCache(row,index,items,index,null,handleUpdateRowId(row),0,index+1);});}internalData.fullDataRowIdData=fullDataRowIdMaps;internalData.fullAllDataRowIdData=fullAllDataRowIdMaps;reactData.treeExpandedFlag++;},cacheSourceMap(fullData){const{treeConfig}=props;const treeOpts=computeTreeOpts.value;const sourceData=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(fullData,true);const{handleUpdateRowId}=createHandleUpdateRowId($xeTable);const sourceRowIdData={};const handleSourceRow=row=>{const rowid=handleUpdateRowId(row);sourceRowIdData[rowid]=row;};// 源数据缓存
|
|
21272
21282
|
if(treeConfig){const childrenField=treeOpts.children||treeOpts.childrenField;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(sourceData,handleSourceRow,{children:treeOpts.transform?treeOpts.mapChildrenField:childrenField});}else{sourceData.forEach(handleSourceRow);}internalData.sourceDataRowIdData=sourceRowIdData;internalData.tableSourceData=sourceData;},/**
|
|
21273
21283
|
* 指定列宽的列进行拆分
|
|
21274
21284
|
*/analyColumnWidth(){const{tableFullColumn}=internalData;const columnOpts=computeColumnOpts.value;const{width:defaultWidth,minWidth:defaultMinWidth}=columnOpts;const resizeList=[];const pxList=[];const pxMinList=[];const autoMinList=[];const scaleList=[];const scaleMinList=[];const autoList=[];const remainList=[];tableFullColumn.forEach(column=>{if(defaultWidth&&!column.width){column.width=defaultWidth;}if(defaultMinWidth&&!column.minWidth){column.minWidth=defaultMinWidth;}if(column.visible){if(column.resizeWidth){resizeList.push(column);}else if(column.width==='auto'){autoList.push(column);}else if(isPx(column.width)){pxList.push(column);}else if(isScale(column.width)){scaleList.push(column);}else if(isPx(column.minWidth)){pxMinList.push(column);}else if(column.minWidth==='auto'){autoMinList.push(column);}else if(isScale(column.minWidth)){scaleMinList.push(column);}else{remainList.push(column);}}});Object.assign(reactData.columnStore,{resizeList,pxList,pxMinList,autoMinList,scaleList,scaleMinList,autoList,remainList});},handleColResizeMousedownEvent(evnt,fixedType,params){const isLeftBtn=evnt.button===0;if(!isLeftBtn){return;}evnt.stopPropagation();evnt.preventDefault();const{column}=params;const{columnStore,overflowX,scrollbarHeight}=reactData;const{visibleColumn}=internalData;const{leftList,rightList}=columnStore;const resizableOpts=computeResizableOpts.value;const osbHeight=overflowX?scrollbarHeight:0;const tableEl=refElem.value;const leftContainerElem=refLeftContainer.value;const rightContainerElem=refRightContainer.value;const resizeBarElem=refColResizeBar.value;if(!resizeBarElem){return;}const isLeftFixed=fixedType==='left';const isRightFixed=fixedType==='right';const resizeTipElem=resizeBarElem.firstElementChild;const scrollbarXToTop=computeScrollbarXToTop.value;const{clientX:dragClientX}=evnt;const dragBtnElem=evnt.target;let cell=dragBtnElem.parentElement;let resizeColumn=column;const isDragGroupCol=column.children&&column.children.length;if(isDragGroupCol){resizeColumn=getLastChildColumn(column);if(isDragGroupCol){const trEl=cell?cell.parentElement:null;const theadEl=trEl?trEl.parentElement:null;cell=theadEl?theadEl.querySelector(`.vxe-header--column[colid="${resizeColumn.id}"]`):null;}}if(!cell){return;}const cellParams=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().assign(params,{cell,$table:$xeTable});let dragLeft=0;const tableRect=tableEl.getBoundingClientRect();const rightContainerRect=rightContainerElem?rightContainerElem.getBoundingClientRect():null;const cellRect=cell.getBoundingClientRect();const dragBtnRect=dragBtnElem.getBoundingClientRect();const dragBtnWidth=dragBtnElem.clientWidth;const dragBtnOffsetWidth=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().floor(dragBtnWidth/2);const dragPosLeft=dragBtnRect.x-tableRect.x+dragBtnOffsetWidth;const minInterval=getColReMinWidth(cellParams)-dragBtnOffsetWidth;// 列之间的最小间距
|
|
@@ -21520,7 +21530,7 @@ if(props.aggregateConfig&&props.rowGroupConfig){warnLog('vxe.error.notSupportPro
|
|
|
21520
21530
|
// warnLog('vxe.error.delProp', ['scroll-x', 'virtual-x-config'])
|
|
21521
21531
|
// }
|
|
21522
21532
|
// 检查导入导出类型,如果自定义导入导出方法,则不校验类型
|
|
21523
|
-
if(importConfig&&importOpts.types&&!importOpts.importMethod&&!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includeArrays(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(importOpts._typeMaps),importOpts.types)){warnLog('vxe.error.errProp',[`export-config.types=${importOpts.types.join(',')}`,importOpts.types.filter(type=>external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includes(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(importOpts._typeMaps),type)).join(',')||external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(importOpts._typeMaps).join(',')]);}if(exportConfig&&exportOpts.types&&!exportOpts.exportMethod&&!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includeArrays(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(exportOpts._typeMaps),exportOpts.types)){warnLog('vxe.error.errProp',[`export-config.types=${exportOpts.types.join(',')}`,exportOpts.types.filter(type=>external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includes(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(exportOpts._typeMaps),type)).join(',')||external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(exportOpts._typeMaps).join(',')]);}if(exportConfig&&external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(exportOpts.isAllExpand)){warnLog('vxe.error.delProp',['isAllExpand','isTreeAllExpanded']);}if(!props.id){if((props.customConfig?isEnableConf(customOpts):customOpts.enabled)&&customOpts.storage){errLog('vxe.error.reqProp',['id']);}}if(props.treeConfig&&checkboxOpts.range){errLog('vxe.error.noTree',['checkbox-config.range']);}if(rowOpts.height&&!props.showOverflow){warnLog('vxe.error.notProp',['table.show-overflow']);}if(!$xeTable.triggerCelllAreaMnEvent){if(props.areaConfig){warnLog('vxe.error.notProp',['area-config']);}if(props.clipConfig){warnLog('vxe.error.notProp',['clip-config']);}if(props.fnrConfig){warnLog('vxe.error.notProp',['fnr-config']);}if(mouseOpts.area){errLog('vxe.error.notProp',['mouse-config.area']);return;}if(mouseOpts.area&&areaOpts.selectCellByHeader&&columnOpts.drag&&columnDragOpts.trigger==='cell'){errLog('vxe.error.notSupportProp',['area-config.selectCellByHeader & column-config.drag','column-drag-config.trigger=cell','column-drag-config.trigger=default | area-config.selectCellByHeader=false']);}}if(!$xeTable.handlePivotTableAggData){if(customOpts.allowGroup){errLog('vxe.error.notProp',['custom-config.allowGroup']);return;}if(customOpts.allowValues){errLog('vxe.error.notProp',['custom-config.allowValues']);return;}}if(treeConfig&&rowOpts.drag&&!treeOpts.transform){errLog('vxe.error.notSupportProp',['row-config.drag','tree-config.transform=false','tree-config.transform=true']);}if(treeConfig&&rowDragOpts.isCrossTableDrag&&!rowDragOpts.isCrossDrag){errLog('vxe.error.reqSupportProp',['tree-config & row-drag-config.isCrossTableDrag','row-drag-config.isCrossDrag']);}if(props.dragConfig){warnLog('vxe.error.delProp',['drag-config','row-drag-config']);}if(props.rowGroupConfig){warnLog('vxe.error.delProp',['row-group-config','aggregate-config']);}if(aggregateOpts.countFields){warnLog('vxe.error.delProp',['row-group-config.countFields','column.agg-func']);}if(aggregateOpts.aggregateMethod){warnLog('vxe.error.delProp',['row-group-config.aggregateMethod','aggregate-config.calcValuesMethod']);}if(aggregateOpts.countMethod){warnLog('vxe.error.delProp',['aggregate-config.countMethod','aggregate-config.calcValuesMethod']);}if(props.treeConfig&&treeOpts.children){warnLog('vxe.error.delProp',['tree-config.children','tree-config.childrenField']);}if(props.treeConfig&&treeOpts.line){warnLog('vxe.error.delProp',['tree-config.line','tree-config.showLine']);}if(mouseOpts.area&&mouseOpts.selected){warnLog('vxe.error.errConflicts',['mouse-config.area','mouse-config.selected']);}if(mouseOpts.area&&props.treeConfig&&!treeOpts.transform){errLog('vxe.error.notSupportProp',['mouse-config.area','tree-config.transform=false','tree-config.transform=true']);}if(props.editConfig&&editOpts.activeMethod){warnLog('vxe.error.delProp',['edit-config.activeMethod','edit-config.beforeEditMethod']);}if(props.treeConfig&&checkboxOpts.isShiftKey){errLog('vxe.error.
|
|
21533
|
+
if(importConfig&&importOpts.types&&!importOpts.importMethod&&!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includeArrays(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(importOpts._typeMaps),importOpts.types)){warnLog('vxe.error.errProp',[`export-config.types=${importOpts.types.join(',')}`,importOpts.types.filter(type=>external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includes(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(importOpts._typeMaps),type)).join(',')||external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(importOpts._typeMaps).join(',')]);}if(exportConfig&&exportOpts.types&&!exportOpts.exportMethod&&!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includeArrays(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(exportOpts._typeMaps),exportOpts.types)){warnLog('vxe.error.errProp',[`export-config.types=${exportOpts.types.join(',')}`,exportOpts.types.filter(type=>external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includes(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(exportOpts._typeMaps),type)).join(',')||external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(exportOpts._typeMaps).join(',')]);}if(exportConfig&&external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(exportOpts.isAllExpand)){warnLog('vxe.error.delProp',['isAllExpand','isTreeAllExpanded']);}if(!props.id){if((props.customConfig?isEnableConf(customOpts):customOpts.enabled)&&customOpts.storage){errLog('vxe.error.reqProp',['id']);}}if(props.treeConfig&&checkboxOpts.range){errLog('vxe.error.noTree',['checkbox-config.range']);}if(rowOpts.height&&!props.showOverflow){warnLog('vxe.error.notProp',['table.show-overflow']);}if(!$xeTable.triggerCelllAreaMnEvent){if(props.areaConfig){warnLog('vxe.error.notProp',['area-config']);}if(props.clipConfig){warnLog('vxe.error.notProp',['clip-config']);}if(props.fnrConfig){warnLog('vxe.error.notProp',['fnr-config']);}if(mouseOpts.area){errLog('vxe.error.notProp',['mouse-config.area']);return;}if(mouseOpts.area&&areaOpts.selectCellByHeader&&columnOpts.drag&&columnDragOpts.trigger==='cell'){errLog('vxe.error.notSupportProp',['area-config.selectCellByHeader & column-config.drag','column-drag-config.trigger=cell','column-drag-config.trigger=default | area-config.selectCellByHeader=false']);}}if(!$xeTable.handlePivotTableAggData){if(customOpts.allowGroup){errLog('vxe.error.notProp',['custom-config.allowGroup']);return;}if(customOpts.allowValues){errLog('vxe.error.notProp',['custom-config.allowValues']);return;}}if(treeConfig&&rowOpts.drag&&!treeOpts.transform){errLog('vxe.error.notSupportProp',['row-config.drag','tree-config.transform=false','tree-config.transform=true']);}if(treeConfig&&rowDragOpts.isCrossTableDrag&&!rowDragOpts.isCrossDrag){errLog('vxe.error.reqSupportProp',['tree-config & row-drag-config.isCrossTableDrag','row-drag-config.isCrossDrag']);}if(props.dragConfig){warnLog('vxe.error.delProp',['drag-config','row-drag-config']);}if(props.rowGroupConfig){warnLog('vxe.error.delProp',['row-group-config','aggregate-config']);}if(aggregateOpts.countFields){warnLog('vxe.error.delProp',['row-group-config.countFields','column.agg-func']);}if(aggregateOpts.aggregateMethod){warnLog('vxe.error.delProp',['row-group-config.aggregateMethod','aggregate-config.calcValuesMethod']);}if(aggregateOpts.countMethod){warnLog('vxe.error.delProp',['aggregate-config.countMethod','aggregate-config.calcValuesMethod']);}if(props.treeConfig&&treeOpts.children){warnLog('vxe.error.delProp',['tree-config.children','tree-config.childrenField']);}if(props.treeConfig&&treeOpts.line){warnLog('vxe.error.delProp',['tree-config.line','tree-config.showLine']);}if(mouseOpts.area&&mouseOpts.selected){warnLog('vxe.error.errConflicts',['mouse-config.area','mouse-config.selected']);}if(mouseOpts.area&&props.treeConfig&&!treeOpts.transform){errLog('vxe.error.notSupportProp',['mouse-config.area','tree-config.transform=false','tree-config.transform=true']);}if(props.editConfig&&editOpts.activeMethod){warnLog('vxe.error.delProp',['edit-config.activeMethod','edit-config.beforeEditMethod']);}if(props.treeConfig&&checkboxOpts.isShiftKey){errLog('vxe.error.reqSupportProp',['tree-config','checkbox-config.isShiftKey=false']);}if(checkboxOpts.halfField){warnLog('vxe.error.delProp',['checkbox-config.halfField','checkbox-config.indeterminateField']);}if(props.editConfig&&isEnableConf(editOpts)&&props.editRules&&(minHeight===0||minHeight==='0')){warnLog('vxe.error.reqSupportProp',['edit-config & edit-rules','min-height']);}if(treeConfig){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(['rowField','parentField','childrenField','hasChildField','mapChildrenField'],key=>{const val=treeOpts[key];if(val&&val.indexOf('.')>-1){errLog('vxe.error.errProp',[`${key}=${val}`,`${key}=${val.split('.')[0]}`]);}});}if(rowOpts.currentMethod){warnLog('vxe.error.delProp',['row-config.currentMethod','current-row-config.beforeSelectMethod']);}if(columnOpts.currentMethod){warnLog('vxe.error.delProp',['row-config.currentMethod','current-column-config.beforeSelectMethod']);}// if ((rowOpts.isCurrent || highlightCurrentRow) && props.keyboardConfig && keyboardOpts.isArrow && !XEUtils.isBoolean(currentRowOpts.isFollowSelected)) {
|
|
21524
21534
|
// warnLog('vxe.error.notConflictProp', ['row-config.isCurrent & keyboard-config.isArrow', 'current-row-config.isFollowSelected'])
|
|
21525
21535
|
// }
|
|
21526
21536
|
// if ((columnOpts.isCurrent || highlightCurrentColumn) && props.keyboardConfig && keyboardOpts.isArrow && !XEUtils.isBoolean(currentColumnOpts.isFollowSelected)) {
|