vxe-table 4.21.4 → 4.21.6
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/README.md +23 -16
- package/dist/all.esm.js +274 -88
- 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/filter/hook.js +67 -56
- package/es/table/module/keyboard/hook.js +3 -4
- package/es/table/src/body.js +3 -3
- package/es/table/src/footer.js +3 -3
- package/es/table/src/header.js +6 -6
- package/es/table/src/table.js +24 -11
- package/es/table/src/util.js +6 -5
- package/es/table/style.css +1 -1
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/dom.js +162 -0
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +1 -1
- 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 +272 -96
- 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/filter/hook.js +65 -58
- package/lib/table/module/filter/hook.min.js +1 -1
- package/lib/table/module/keyboard/hook.js +3 -5
- package/lib/table/module/keyboard/hook.min.js +1 -1
- package/lib/table/src/body.js +5 -4
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/footer.js +5 -4
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +10 -8
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/table.js +11 -9
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +6 -5
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +1 -1
- 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/dom.js +167 -0
- package/lib/ui/src/dom.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 +1 -1
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/table/module/custom/hook.ts +1 -1
- package/packages/table/module/filter/hook.ts +67 -53
- package/packages/table/module/keyboard/hook.ts +3 -4
- package/packages/table/src/body.ts +3 -3
- package/packages/table/src/footer.ts +3 -3
- package/packages/table/src/header.ts +6 -6
- package/packages/table/src/table.ts +24 -11
- package/packages/table/src/util.ts +9 -6
- package/packages/ui/src/dom.ts +176 -0
- package/styles/components/table-module/filter.scss +1 -1
- package/styles/theme/base.scss +2 -0
- package/styles/theme/dark.scss +4 -4
- package/styles/theme/light.scss +4 -4
- package/styles/variable.scss +4 -4
- /package/es/{iconfont.1788399047071.ttf → iconfont.1788695187811.ttf} +0 -0
- /package/es/{iconfont.1788399047071.woff → iconfont.1788695187811.woff} +0 -0
- /package/es/{iconfont.1788399047071.woff2 → iconfont.1788695187811.woff2} +0 -0
- /package/lib/{iconfont.1788399047071.ttf → iconfont.1788695187811.ttf} +0 -0
- /package/lib/{iconfont.1788399047071.woff → iconfont.1788695187811.woff} +0 -0
- /package/lib/{iconfont.1788399047071.woff2 → iconfont.1788695187811.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -3313,7 +3313,7 @@ function getDefaultConfig(val1, def1) {
|
|
|
3313
3313
|
/* unused harmony import specifier */ var VxeUI;
|
|
3314
3314
|
|
|
3315
3315
|
|
|
3316
|
-
const version = "4.21.
|
|
3316
|
+
const version = "4.21.6";
|
|
3317
3317
|
core_.VxeUI.version = version;
|
|
3318
3318
|
core_.VxeUI.tableVersion = version;
|
|
3319
3319
|
core_.VxeUI.setConfig({
|
|
@@ -4058,6 +4058,18 @@ function hasEventInputTarget(target) {
|
|
|
4058
4058
|
const tagName = target ? target.tagName : '';
|
|
4059
4059
|
return tagName && ['input', 'textarea'].includes(tagName.toLowerCase());
|
|
4060
4060
|
}
|
|
4061
|
+
/**
|
|
4062
|
+
* 判断是否由内部可复用控件触发,输入框带有 vxe-reusekeep-control
|
|
4063
|
+
*/
|
|
4064
|
+
function hasReusekeepControl(elem) {
|
|
4065
|
+
if (elem) {
|
|
4066
|
+
return hasClass(elem, 'vxe-reusekeep-control');
|
|
4067
|
+
}
|
|
4068
|
+
return false;
|
|
4069
|
+
}
|
|
4070
|
+
function hasAxternalInputTarget(target) {
|
|
4071
|
+
return hasEventInputTarget(target) ? !hasReusekeepControl(target) : false;
|
|
4072
|
+
}
|
|
4061
4073
|
const scrollIntoViewIfNeeded = 'scrollIntoViewIfNeeded';
|
|
4062
4074
|
const scrollIntoView = 'scrollIntoView';
|
|
4063
4075
|
function scrollToView(elem) {
|
|
@@ -4119,6 +4131,158 @@ function wheelScrollTopTo(diffNum, cb) {
|
|
|
4119
4131
|
wtaFrame = null;
|
|
4120
4132
|
});
|
|
4121
4133
|
}
|
|
4134
|
+
/**
|
|
4135
|
+
* 通用定位计算
|
|
4136
|
+
*/
|
|
4137
|
+
function updatePanelPlacement(targetElem, panelElem, options) {
|
|
4138
|
+
const {
|
|
4139
|
+
defaultTop,
|
|
4140
|
+
defaultLeft,
|
|
4141
|
+
placement,
|
|
4142
|
+
defaultPlacement,
|
|
4143
|
+
teleportTo,
|
|
4144
|
+
marginSize,
|
|
4145
|
+
isMinWidth
|
|
4146
|
+
} = Object.assign({
|
|
4147
|
+
teleportTo: false,
|
|
4148
|
+
marginSize: 18,
|
|
4149
|
+
isMinWidth: true
|
|
4150
|
+
}, options);
|
|
4151
|
+
let panelPlacement = 'bottom';
|
|
4152
|
+
let top = '';
|
|
4153
|
+
let bottom = '';
|
|
4154
|
+
let left = 0;
|
|
4155
|
+
let minWidth = '';
|
|
4156
|
+
let arrowLeft = '';
|
|
4157
|
+
const stys = {};
|
|
4158
|
+
if (panelElem && targetElem) {
|
|
4159
|
+
const bodyEl = document.body;
|
|
4160
|
+
const parentWrapperEl = getPopupWrapperElement(panelElem);
|
|
4161
|
+
if (parentWrapperEl) {
|
|
4162
|
+
const targetWidth = targetElem.offsetWidth;
|
|
4163
|
+
const targetHeight = targetElem.offsetHeight;
|
|
4164
|
+
const panelWidth = panelElem.offsetWidth;
|
|
4165
|
+
const panelHeight = panelElem.offsetHeight;
|
|
4166
|
+
const parentWrapperRect = parentWrapperEl.getBoundingClientRect();
|
|
4167
|
+
const panelRect = panelElem.getBoundingClientRect();
|
|
4168
|
+
const targetRect = targetElem.getBoundingClientRect();
|
|
4169
|
+
const visibleHeight = bodyEl.clientHeight;
|
|
4170
|
+
const visibleWidth = bodyEl.clientWidth;
|
|
4171
|
+
const offsetLeft = parentWrapperRect.left;
|
|
4172
|
+
const offsetTop = parentWrapperRect.top;
|
|
4173
|
+
const targetLeft = targetRect.left;
|
|
4174
|
+
const targetTop = targetRect.top;
|
|
4175
|
+
minWidth = targetElem.offsetWidth;
|
|
4176
|
+
if (teleportTo) {
|
|
4177
|
+
left = defaultLeft || targetLeft - (panelWidth - targetWidth) / 2;
|
|
4178
|
+
top = defaultTop || targetTop + targetHeight;
|
|
4179
|
+
if (placement === 'top') {
|
|
4180
|
+
panelPlacement = 'top';
|
|
4181
|
+
top = targetTop - panelHeight;
|
|
4182
|
+
} else if (!placement) {
|
|
4183
|
+
if (defaultPlacement === 'top') {
|
|
4184
|
+
panelPlacement = 'top';
|
|
4185
|
+
if (!defaultTop) {
|
|
4186
|
+
top = targetTop - panelHeight;
|
|
4187
|
+
}
|
|
4188
|
+
// 如果上面不够放,则向下
|
|
4189
|
+
if (top < marginSize) {
|
|
4190
|
+
panelPlacement = 'bottom';
|
|
4191
|
+
top = targetTop + targetHeight;
|
|
4192
|
+
}
|
|
4193
|
+
// 如果下面不够放,则向上(优先)
|
|
4194
|
+
if (top + panelHeight + marginSize > visibleHeight) {
|
|
4195
|
+
panelPlacement = 'top';
|
|
4196
|
+
top = targetTop - panelHeight;
|
|
4197
|
+
}
|
|
4198
|
+
} else {
|
|
4199
|
+
// 如果下面不够放,则向上
|
|
4200
|
+
if (top + panelHeight + marginSize > visibleHeight) {
|
|
4201
|
+
panelPlacement = 'top';
|
|
4202
|
+
top = targetTop - panelHeight;
|
|
4203
|
+
}
|
|
4204
|
+
// 如果上面不够放,则向下(优先)
|
|
4205
|
+
if (top < marginSize) {
|
|
4206
|
+
panelPlacement = 'bottom';
|
|
4207
|
+
top = targetTop + targetHeight;
|
|
4208
|
+
}
|
|
4209
|
+
}
|
|
4210
|
+
}
|
|
4211
|
+
// 如果溢出右边
|
|
4212
|
+
if (left + panelWidth + marginSize > visibleWidth) {
|
|
4213
|
+
left -= left + panelWidth + marginSize - visibleWidth;
|
|
4214
|
+
}
|
|
4215
|
+
// 如果溢出左边
|
|
4216
|
+
if (left < marginSize) {
|
|
4217
|
+
left = marginSize;
|
|
4218
|
+
}
|
|
4219
|
+
// 偏移
|
|
4220
|
+
top -= offsetTop;
|
|
4221
|
+
left -= offsetLeft;
|
|
4222
|
+
} else {
|
|
4223
|
+
if (placement === 'top') {
|
|
4224
|
+
panelPlacement = 'top';
|
|
4225
|
+
bottom = targetHeight;
|
|
4226
|
+
} else if (!placement) {
|
|
4227
|
+
// 如果下面不够放,则向上
|
|
4228
|
+
top = targetHeight;
|
|
4229
|
+
if (targetTop + targetHeight + panelHeight + marginSize > visibleHeight) {
|
|
4230
|
+
// 如果上面不够放,则向下(优先)
|
|
4231
|
+
if (targetTop - targetHeight - panelHeight > marginSize) {
|
|
4232
|
+
panelPlacement = 'top';
|
|
4233
|
+
top = '';
|
|
4234
|
+
bottom = targetHeight;
|
|
4235
|
+
}
|
|
4236
|
+
}
|
|
4237
|
+
}
|
|
4238
|
+
// 是否超出右侧
|
|
4239
|
+
if (panelRect.left + panelRect.width + marginSize > visibleWidth) {
|
|
4240
|
+
left = -(panelRect.left + panelRect.width + marginSize - visibleWidth);
|
|
4241
|
+
}
|
|
4242
|
+
}
|
|
4243
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(top)) {
|
|
4244
|
+
stys.top = toCssUnit(top);
|
|
4245
|
+
}
|
|
4246
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(bottom)) {
|
|
4247
|
+
stys.bottom = toCssUnit(bottom);
|
|
4248
|
+
}
|
|
4249
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(left)) {
|
|
4250
|
+
stys.left = toCssUnit(left);
|
|
4251
|
+
}
|
|
4252
|
+
if (isMinWidth && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(minWidth)) {
|
|
4253
|
+
stys.minWidth = toCssUnit(minWidth);
|
|
4254
|
+
}
|
|
4255
|
+
// 箭头
|
|
4256
|
+
if (left === targetLeft) {
|
|
4257
|
+
if (targetWidth <= panelWidth) {
|
|
4258
|
+
arrowLeft = targetWidth / 2;
|
|
4259
|
+
}
|
|
4260
|
+
} else if (left < targetLeft) {
|
|
4261
|
+
if (left + panelWidth > targetLeft + targetWidth) {
|
|
4262
|
+
arrowLeft = targetLeft - left + targetWidth / 2;
|
|
4263
|
+
} else {
|
|
4264
|
+
arrowLeft = targetLeft - left + (panelWidth - (targetLeft - left)) / 2;
|
|
4265
|
+
}
|
|
4266
|
+
}
|
|
4267
|
+
}
|
|
4268
|
+
}
|
|
4269
|
+
return {
|
|
4270
|
+
top: top || 0,
|
|
4271
|
+
bottom: bottom || 0,
|
|
4272
|
+
left: left || 0,
|
|
4273
|
+
arrowLeft: arrowLeft || 0,
|
|
4274
|
+
style: stys,
|
|
4275
|
+
placement: panelPlacement
|
|
4276
|
+
};
|
|
4277
|
+
}
|
|
4278
|
+
function getPopupWrapperElement(panelElem) {
|
|
4279
|
+
if (!panelElem) {
|
|
4280
|
+
return null;
|
|
4281
|
+
}
|
|
4282
|
+
const bodyEl = document.body;
|
|
4283
|
+
const parentEl = panelElem.parentElement;
|
|
4284
|
+
return (parentEl === bodyEl ? document.documentElement : parentEl) || null;
|
|
4285
|
+
}
|
|
4122
4286
|
function getPopupContainer(appendTo) {
|
|
4123
4287
|
const selectElem = appendTo && XEUtils.isFunction(appendTo) ? appendTo({}) : appendTo;
|
|
4124
4288
|
return selectElem || 'body';
|
|
@@ -4135,7 +4299,7 @@ function getPopupAppendElement(appendTo) {
|
|
|
4135
4299
|
const {
|
|
4136
4300
|
log: log_log
|
|
4137
4301
|
} = core_.VxeUI;
|
|
4138
|
-
const tableVersion = `table v${"4.21.
|
|
4302
|
+
const tableVersion = `table v${"4.21.6"}`;
|
|
4139
4303
|
function createComponentLog(name) {
|
|
4140
4304
|
const uiVersion = core_.VxeUI.uiVersion ? `ui v${core_.VxeUI.uiVersion}` : '';
|
|
4141
4305
|
const ganttVersion = core_.VxeUI.ganttVersion ? `gantt v${core_.VxeUI.ganttVersion}` : '';
|
|
@@ -4449,6 +4613,10 @@ function createInternalData() {
|
|
|
4449
4613
|
customMaxHeight: 0,
|
|
4450
4614
|
// 当前 hover 行
|
|
4451
4615
|
hoverRow: null,
|
|
4616
|
+
hoverCol: null,
|
|
4617
|
+
// 当前行
|
|
4618
|
+
currentRow: null,
|
|
4619
|
+
currentCol: null,
|
|
4452
4620
|
// 最后滚动位置
|
|
4453
4621
|
lastScrollLeft: 0,
|
|
4454
4622
|
lastScrollTop: 0,
|
|
@@ -4496,8 +4664,6 @@ function createInternalData() {
|
|
|
4496
4664
|
fullColumnFieldData: {},
|
|
4497
4665
|
fullCellHeightMaps: {},
|
|
4498
4666
|
fullCellStoreMaps: {},
|
|
4499
|
-
// 当前行
|
|
4500
|
-
currentRow: null,
|
|
4501
4667
|
// 合并表头单元格的数据
|
|
4502
4668
|
mergeHeaderList: [],
|
|
4503
4669
|
mergeHeaderMaps: {},
|
|
@@ -4597,8 +4763,6 @@ function createReactData() {
|
|
|
4597
4763
|
isAllSelected: false,
|
|
4598
4764
|
// 复选框属性,有选中且非全选状态
|
|
4599
4765
|
isIndeterminate: false,
|
|
4600
|
-
// 单选框属性,选中列
|
|
4601
|
-
currentColumn: null,
|
|
4602
4766
|
// 单选框属性,选中行
|
|
4603
4767
|
selectRadioRow: null,
|
|
4604
4768
|
// 表尾合计数据
|
|
@@ -4807,7 +4971,8 @@ function createReactData() {
|
|
|
4807
4971
|
dragTipText: '',
|
|
4808
4972
|
isDragResize: false,
|
|
4809
4973
|
isRowLoading: false,
|
|
4810
|
-
isColLoading: false
|
|
4974
|
+
isColLoading: false,
|
|
4975
|
+
currColFlag: 1
|
|
4811
4976
|
};
|
|
4812
4977
|
}
|
|
4813
4978
|
const maxKey = '__max';
|
|
@@ -8084,7 +8249,6 @@ const renderType = 'body';
|
|
|
8084
8249
|
dragRow,
|
|
8085
8250
|
overflowX,
|
|
8086
8251
|
overflowY,
|
|
8087
|
-
currentColumn,
|
|
8088
8252
|
scrollXLoad,
|
|
8089
8253
|
scrollYLoad,
|
|
8090
8254
|
mergeBodyFlag,
|
|
@@ -8093,7 +8257,8 @@ const renderType = 'body';
|
|
|
8093
8257
|
resizeWidthFlag,
|
|
8094
8258
|
editStore,
|
|
8095
8259
|
isAllOverflow,
|
|
8096
|
-
validErrorMaps
|
|
8260
|
+
validErrorMaps,
|
|
8261
|
+
currColFlag
|
|
8097
8262
|
} = tableReactData;
|
|
8098
8263
|
const {
|
|
8099
8264
|
fullAllDataRowIdData,
|
|
@@ -8104,7 +8269,8 @@ const renderType = 'body';
|
|
|
8104
8269
|
mergeBodyList,
|
|
8105
8270
|
scrollXStore,
|
|
8106
8271
|
scrollYStore,
|
|
8107
|
-
keepUpdateFieldMaps
|
|
8272
|
+
keepUpdateFieldMaps,
|
|
8273
|
+
currentCol
|
|
8108
8274
|
} = tableInternalData;
|
|
8109
8275
|
const cellOpts = computeCellOpts.value;
|
|
8110
8276
|
const validOpts = computeValidOpts.value;
|
|
@@ -8474,7 +8640,7 @@ const renderType = 'body';
|
|
|
8474
8640
|
'col--active': editConfig && isEdit && actived.row === row && (actived.column === column || editOpts.mode === 'row'),
|
|
8475
8641
|
'col--valid-error': !!errorValidItem,
|
|
8476
8642
|
'show--valid-bg': errorValidItem && validOpts.showErrorBackground,
|
|
8477
|
-
'col--current':
|
|
8643
|
+
'col--current': currColFlag && currentCol === column
|
|
8478
8644
|
}, getPropClass(compCellClassName, cellParams), getPropClass(className, cellParams), getPropClass(allCellClassName, cellParams)],
|
|
8479
8645
|
key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || rowOpts.useKey || columnOpts.drag ? colid : $columnIndex,
|
|
8480
8646
|
...tdAttrs,
|
|
@@ -9050,19 +9216,20 @@ const header_renderType = 'header';
|
|
|
9050
9216
|
mouseConfig
|
|
9051
9217
|
} = tableProps;
|
|
9052
9218
|
const {
|
|
9053
|
-
currentColumn,
|
|
9054
9219
|
dragCol,
|
|
9055
9220
|
scrollXLoad,
|
|
9056
9221
|
scrollYLoad,
|
|
9057
9222
|
overflowX,
|
|
9058
9223
|
mergeHeadFlag,
|
|
9059
|
-
tableColumn
|
|
9224
|
+
tableColumn,
|
|
9225
|
+
currColFlag
|
|
9060
9226
|
} = tableReactData;
|
|
9061
9227
|
const {
|
|
9062
9228
|
fullColumnIdData,
|
|
9063
9229
|
scrollXStore,
|
|
9064
9230
|
mergeHeaderList,
|
|
9065
|
-
mergeHeaderCellMaps
|
|
9231
|
+
mergeHeaderCellMaps,
|
|
9232
|
+
currentCol
|
|
9066
9233
|
} = tableInternalData;
|
|
9067
9234
|
const virtualXOpts = computeVirtualXOpts.value;
|
|
9068
9235
|
const columnOpts = computeColumnOpts.value;
|
|
@@ -9230,7 +9397,7 @@ const header_renderType = 'header';
|
|
|
9230
9397
|
'is--filter-active': hasFilter,
|
|
9231
9398
|
'is--drag-active': columnOpts.drag && !column.fixed && !isDisabledDrag && (isCrossDrag || isPeerDrag || !column.parentId),
|
|
9232
9399
|
'is--drag-disabled': columnOpts.drag && isDisabledDrag,
|
|
9233
|
-
'col--current':
|
|
9400
|
+
'col--current': currColFlag && currentCol === column
|
|
9234
9401
|
}, headerClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerClassName) ? headerClassName(cellParams) : headerClassName : '', headerCellClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerCellClassName) ? headerCellClassName(cellParams) : headerCellClassName : ''],
|
|
9235
9402
|
style: headerCellStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerCellStyle) ? headerCellStyle(cellParams) : headerCellStyle : null,
|
|
9236
9403
|
...thAttrs,
|
|
@@ -9269,11 +9436,12 @@ const header_renderType = 'header';
|
|
|
9269
9436
|
align: allAlign
|
|
9270
9437
|
} = tableProps;
|
|
9271
9438
|
const {
|
|
9272
|
-
|
|
9273
|
-
|
|
9439
|
+
overflowX,
|
|
9440
|
+
currColFlag
|
|
9274
9441
|
} = tableReactData;
|
|
9275
9442
|
const {
|
|
9276
|
-
fullColumnIdData
|
|
9443
|
+
fullColumnIdData,
|
|
9444
|
+
currentCol
|
|
9277
9445
|
} = tableInternalData;
|
|
9278
9446
|
const headerTooltipOpts = computeHeaderTooltipOpts.value;
|
|
9279
9447
|
const cellOpts = computeCellOpts.value;
|
|
@@ -9356,7 +9524,7 @@ const header_renderType = 'header';
|
|
|
9356
9524
|
'fixed--width': !isAutoCellWidth,
|
|
9357
9525
|
'is--padding': isPadding,
|
|
9358
9526
|
'is--sortable': column.sortable,
|
|
9359
|
-
'col--current':
|
|
9527
|
+
'col--current': currColFlag && currentCol === column
|
|
9360
9528
|
}],
|
|
9361
9529
|
key: colid,
|
|
9362
9530
|
...thAttrs
|
|
@@ -9654,14 +9822,15 @@ const footer_renderType = 'footer';
|
|
|
9654
9822
|
scrollXLoad,
|
|
9655
9823
|
scrollYLoad,
|
|
9656
9824
|
overflowX,
|
|
9657
|
-
|
|
9658
|
-
|
|
9825
|
+
mergeFootFlag,
|
|
9826
|
+
currColFlag
|
|
9659
9827
|
} = tableReactData;
|
|
9660
9828
|
const {
|
|
9661
9829
|
fullColumnIdData,
|
|
9662
9830
|
mergeFooterList,
|
|
9663
9831
|
mergeFooterCellMaps,
|
|
9664
|
-
scrollXStore
|
|
9832
|
+
scrollXStore,
|
|
9833
|
+
currentCol
|
|
9665
9834
|
} = tableInternalData;
|
|
9666
9835
|
const virtualXOpts = computeVirtualXOpts.value;
|
|
9667
9836
|
const footerTooltipOpts = computeFooterTooltipOpts.value;
|
|
@@ -9814,7 +9983,7 @@ const footer_renderType = 'footer';
|
|
|
9814
9983
|
'is--pg-left': isCellPaddingLeft,
|
|
9815
9984
|
'is--pg-right': isCellPaddingRight,
|
|
9816
9985
|
'col--ellipsis': hasEllipsis,
|
|
9817
|
-
'col--current':
|
|
9986
|
+
'col--current': currColFlag && currentCol === column
|
|
9818
9987
|
}, getPropClass(footerClassName, cellParams), getPropClass(footerCellClassName, cellParams)],
|
|
9819
9988
|
...attrs,
|
|
9820
9989
|
style: footerCellStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(footerCellStyle) ? footerCellStyle(cellParams) : footerCellStyle : null,
|
|
@@ -12886,24 +13055,16 @@ hook_hooks.add('tableFilterModule', {
|
|
|
12886
13055
|
column,
|
|
12887
13056
|
targetEl
|
|
12888
13057
|
} = filterStore;
|
|
12889
|
-
if (!column
|
|
13058
|
+
if (!column) {
|
|
12890
13059
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
12891
13060
|
}
|
|
12892
13061
|
const tableEl = refElem.value;
|
|
12893
|
-
const {
|
|
12894
|
-
scrollTop,
|
|
12895
|
-
scrollLeft,
|
|
12896
|
-
visibleHeight,
|
|
12897
|
-
visibleWidth
|
|
12898
|
-
} = getDomNode();
|
|
12899
13062
|
const filterOpts = computeFilterOpts.value;
|
|
12900
13063
|
const {
|
|
12901
13064
|
maxHeight: customMaxHeight,
|
|
12902
13065
|
transfer,
|
|
12903
13066
|
zIndex
|
|
12904
13067
|
} = filterOpts;
|
|
12905
|
-
const currEl = targetEl;
|
|
12906
|
-
const tableRect = tableEl.getBoundingClientRect();
|
|
12907
13068
|
const filterRender = column ? column.filterRender : null;
|
|
12908
13069
|
const compConf = filterRender && isEnableConf(filterRender) ? hook_renderer.get(filterRender.name) : null;
|
|
12909
13070
|
const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
|
|
@@ -12915,63 +13076,79 @@ hook_hooks.add('tableFilterModule', {
|
|
|
12915
13076
|
if (!filterWrapperElem) {
|
|
12916
13077
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
12917
13078
|
}
|
|
12918
|
-
const btnRect = currEl.getBoundingClientRect();
|
|
12919
13079
|
const filterHeadElem = filterWrapperElem.querySelector('.vxe-table--filter-header');
|
|
12920
13080
|
const filterFootElem = filterWrapperElem.querySelector('.vxe-table--filter-footer');
|
|
12921
|
-
const filterWidth = filterWrapperElem.offsetWidth;
|
|
12922
|
-
const centerWidth = currEl ? filterWidth / 2 : (filterWidth - column.renderWidth) / 2;
|
|
12923
|
-
let left = 0;
|
|
12924
|
-
let top = 0;
|
|
12925
|
-
let maxHeight = 0;
|
|
12926
13081
|
/**
|
|
12927
13082
|
* 是否显示筛选按钮图标
|
|
12928
13083
|
* 如果不存在图标,则相对单元格居中显示
|
|
12929
13084
|
*/
|
|
12930
|
-
|
|
12931
|
-
|
|
12932
|
-
|
|
12933
|
-
|
|
12934
|
-
|
|
12935
|
-
|
|
12936
|
-
|
|
12937
|
-
|
|
13085
|
+
const handleStyle = () => {
|
|
13086
|
+
let currEl = targetEl;
|
|
13087
|
+
if (!targetEl) {
|
|
13088
|
+
const headerWrapperElem = getRefElem(elemStore[`${column.fixed || 'main'}-header-wrapper`] || elemStore['main-header-wrapper']);
|
|
13089
|
+
const colEl = headerWrapperElem ? headerWrapperElem.querySelector(`.vxe-header--column.${column.id}`) : null;
|
|
13090
|
+
if (colEl) {
|
|
13091
|
+
currEl = colEl;
|
|
13092
|
+
}
|
|
12938
13093
|
}
|
|
12939
|
-
|
|
12940
|
-
|
|
12941
|
-
|
|
12942
|
-
|
|
12943
|
-
|
|
12944
|
-
|
|
12945
|
-
|
|
12946
|
-
|
|
12947
|
-
}
|
|
12948
|
-
if (
|
|
12949
|
-
const
|
|
12950
|
-
|
|
12951
|
-
|
|
12952
|
-
|
|
13094
|
+
if (!currEl) {
|
|
13095
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
13096
|
+
}
|
|
13097
|
+
const btnRect = currEl.getBoundingClientRect();
|
|
13098
|
+
const tableRect = tableEl.getBoundingClientRect();
|
|
13099
|
+
let left = 0;
|
|
13100
|
+
let top = 0;
|
|
13101
|
+
let maxHeight = 0;
|
|
13102
|
+
let panelStyle = {};
|
|
13103
|
+
if (transfer) {
|
|
13104
|
+
const ppObj = updatePanelPlacement(currEl, filterWrapperElem, {
|
|
13105
|
+
defaultPlacement: 'bottom',
|
|
13106
|
+
isMinWidth: false,
|
|
13107
|
+
teleportTo: transfer
|
|
13108
|
+
});
|
|
13109
|
+
panelStyle = ppObj.style;
|
|
13110
|
+
} else {
|
|
13111
|
+
const filterWidth = filterWrapperElem.offsetWidth;
|
|
13112
|
+
const centerWidth = targetEl ? filterWidth / 2 : (filterWidth - column.renderWidth) / 2;
|
|
13113
|
+
left = btnRect.left - tableRect.left - centerWidth;
|
|
13114
|
+
top = btnRect.top - tableRect.top + currEl.clientHeight;
|
|
13115
|
+
maxHeight = Math.max(40, tableEl.clientHeight - top - (filterHeadElem ? filterHeadElem.clientHeight : 0) - (filterFootElem ? filterFootElem.clientHeight : 0) - 14);
|
|
13116
|
+
if (left < 1) {
|
|
13117
|
+
left = 1;
|
|
13118
|
+
} else if (left > tableEl.clientWidth - filterWidth - 1) {
|
|
13119
|
+
left = tableEl.clientWidth - filterWidth - 1;
|
|
12953
13120
|
}
|
|
13121
|
+
if ($xeGGWrapper) {
|
|
13122
|
+
const wrapperEl = $xeGGWrapper.getRefMaps().refElem.value;
|
|
13123
|
+
if (wrapperEl) {
|
|
13124
|
+
const wrapperRect = wrapperEl.getBoundingClientRect();
|
|
13125
|
+
top += tableRect.top - wrapperRect.top;
|
|
13126
|
+
}
|
|
13127
|
+
}
|
|
13128
|
+
panelStyle = {
|
|
13129
|
+
top: toCssUnit(top),
|
|
13130
|
+
left: toCssUnit(left)
|
|
13131
|
+
};
|
|
12954
13132
|
}
|
|
12955
|
-
|
|
12956
|
-
|
|
12957
|
-
top: toCssUnit(top),
|
|
12958
|
-
left: toCssUnit(left)
|
|
12959
|
-
};
|
|
12960
|
-
if (zIndex) {
|
|
12961
|
-
fStys.zIndex = zIndex;
|
|
12962
|
-
}
|
|
12963
|
-
filterStore.style = fStys;
|
|
12964
|
-
// 筛选面板是自适应表格高度
|
|
12965
|
-
if (compConf ? !compConf.tableFilterAutoHeight : false) {
|
|
12966
|
-
maxHeight = 0;
|
|
12967
|
-
} else {
|
|
12968
|
-
if (customMaxHeight) {
|
|
12969
|
-
maxHeight = customMaxHeight > maxHeight ? maxHeight : customMaxHeight;
|
|
13133
|
+
if (zIndex) {
|
|
13134
|
+
panelStyle.zIndex = zIndex;
|
|
12970
13135
|
}
|
|
12971
|
-
|
|
12972
|
-
|
|
12973
|
-
|
|
12974
|
-
|
|
13136
|
+
filterStore.style = panelStyle;
|
|
13137
|
+
// 筛选面板是自适应表格高度
|
|
13138
|
+
if (compConf ? !compConf.tableFilterAutoHeight : false) {
|
|
13139
|
+
maxHeight = 0;
|
|
13140
|
+
} else {
|
|
13141
|
+
if (customMaxHeight) {
|
|
13142
|
+
maxHeight = customMaxHeight > maxHeight ? maxHeight : customMaxHeight;
|
|
13143
|
+
}
|
|
13144
|
+
}
|
|
13145
|
+
// 判断面板不能大于表格高度
|
|
13146
|
+
filterStore.maxHeight = maxHeight;
|
|
13147
|
+
};
|
|
13148
|
+
handleStyle();
|
|
13149
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
|
|
13150
|
+
handleStyle();
|
|
13151
|
+
});
|
|
12975
13152
|
};
|
|
12976
13153
|
const filterPrivateMethods = {
|
|
12977
13154
|
checkFilterOptions() {
|
|
@@ -12995,15 +13172,14 @@ hook_hooks.add('tableFilterModule', {
|
|
|
12995
13172
|
if (filterStore.column === column && filterStore.visible) {
|
|
12996
13173
|
filterStore.visible = false;
|
|
12997
13174
|
} else {
|
|
12998
|
-
const currEl = btnEl || colEl;
|
|
12999
13175
|
$xeTable.handleFilterOptions(column);
|
|
13000
13176
|
internalData._currFilterParams = params;
|
|
13001
|
-
filterStore.targetEl =
|
|
13177
|
+
filterStore.targetEl = btnEl;
|
|
13002
13178
|
filterStore.style = null;
|
|
13003
13179
|
filterStore.visible = true;
|
|
13004
13180
|
initStore.filter = true;
|
|
13005
13181
|
}
|
|
13006
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
13182
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
|
|
13007
13183
|
updatePopupStyle();
|
|
13008
13184
|
});
|
|
13009
13185
|
$xeTable.dispatchEvent('filter-visible', {
|
|
@@ -18150,14 +18326,12 @@ keyboard_hook_hooks.add('tableKeyboardModule', {
|
|
|
18150
18326
|
// 处理当前列方向键移动
|
|
18151
18327
|
moveCurrentColumn(isLeftArrow, isRightArrow, evnt) {
|
|
18152
18328
|
const {
|
|
18153
|
-
|
|
18154
|
-
} = reactData;
|
|
18155
|
-
const {
|
|
18329
|
+
currentCol,
|
|
18156
18330
|
visibleColumn
|
|
18157
18331
|
} = internalData;
|
|
18158
18332
|
let targetCol = null;
|
|
18159
|
-
if (
|
|
18160
|
-
const _columnIndex = $xeTable.getVTColumnIndex(
|
|
18333
|
+
if (currentCol) {
|
|
18334
|
+
const _columnIndex = $xeTable.getVTColumnIndex(currentCol);
|
|
18161
18335
|
if (isLeftArrow && _columnIndex > 0) {
|
|
18162
18336
|
targetCol = visibleColumn[_columnIndex - 1];
|
|
18163
18337
|
} else if (isRightArrow && _columnIndex < visibleColumn.length - 1) {
|
|
@@ -21685,7 +21859,7 @@ if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_defau
|
|
|
21685
21859
|
return Object.assign({},globalScrollX,scrollX);}if(globalVirtualXConfig){return Object.assign({},globalVirtualXConfig,virtualXConfig);}// 已废弃,保留兼容
|
|
21686
21860
|
return Object.assign({},globalScrollX,scrollX);});const computeVirtualYOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{virtualYConfig,scrollY}=props;const globalVirtualYConfig=table_getConfig().table.virtualYConfig;const globalScrollY=table_getConfig().table.scrollY;if(virtualYConfig){return Object.assign({},globalVirtualYConfig,virtualYConfig);}if(scrollY){// 已废弃,保留兼容
|
|
21687
21861
|
return Object.assign({},globalScrollY,scrollY);}if(globalVirtualYConfig){return Object.assign({},globalVirtualYConfig,virtualYConfig);}// 已废弃,保留兼容
|
|
21688
|
-
return Object.assign({},globalScrollY,scrollY);});const computeScrollbarOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.scrollbarConfig,props.scrollbarConfig);});const computeScrollbarXOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const scrollbarOpts=computeScrollbarOpts.value;return Object.assign({},scrollbarOpts.x,props.scrollbarConfig?.x||{});});const computeScrollbarYOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const scrollbarOpts=computeScrollbarOpts.value;return Object.assign({},scrollbarOpts.y,props.scrollbarConfig?.y||{});});const computeScrollbarXToTop=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const scrollbarXOpts=computeScrollbarXOpts.value;return scrollbarXOpts.position==='top';});const computeScrollbarYToLeft=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const scrollbarYOpts=computeScrollbarYOpts.value;return scrollbarYOpts.position==='left';});const computeScrollYThreshold=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const virtualYOpts=computeVirtualYOpts.value;const{threshold}=virtualYOpts;if(threshold){return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(threshold);}return 0;});const computeRowHeightMaps=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return reactData.rowHeightStore;});const computeDefaultRowHeight=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const vSize=computeSize.value;const rowHeightMaps=computeRowHeightMaps.value;return rowHeightMaps[vSize||'default']||18;});const computeColumnOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.columnConfig,props.columnConfig);});const computeCurrentColumnOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.currentColumnConfig,props.currentColumnConfig);});const computeCellOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const cellOpts=Object.assign({},table_getConfig().table.cellConfig,props.cellConfig);if(cellOpts.height){cellOpts.height=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellOpts.height);}return cellOpts;});const computeHeaderCellOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const headerCellOpts=Object.assign({},table_getConfig().table.headerCellConfig,props.headerCellConfig);const defaultRowHeight=computeDefaultRowHeight.value;const cellOpts=computeCellOpts.value;let headCellHeight=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getCalcHeight(headerCellOpts.height||cellOpts.height));if($xeGantt){const{computeTaskViewScales}=$xeGantt.getComputeMaps();const taskViewScales=computeTaskViewScales.value;if(taskViewScales&&taskViewScales.length>2){const ganttMinHeadCellHeight=defaultRowHeight/2*taskViewScales.length;headCellHeight=Math.max(ganttMinHeadCellHeight,headCellHeight);}}headerCellOpts.height=headCellHeight;return headerCellOpts;});const computeFooterCellOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const footerCellOpts=Object.assign({},table_getConfig().table.footerCellConfig,props.footerCellConfig);const cellOpts=computeCellOpts.value;footerCellOpts.height=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getCalcHeight(footerCellOpts.height||cellOpts.height));return footerCellOpts;});const computeRowOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.rowConfig,props.rowConfig);});const computeAggregateOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.aggregateConfig||table_getConfig().table.rowGroupConfig,props.aggregateConfig||props.rowGroupConfig);});const computeRowGroupOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return computeAggregateOpts.value;});const computeAggregateMode=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const aggregateOpts=computeAggregateOpts.value;return aggregateOpts.mode;});const computeAggregateAccuracyOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.aggregateAccuracyConfig,props.aggregateAccuracyConfig);});const computeCurrentRowOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.currentRowConfig,props.currentRowConfig);});const computeRowDragOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.rowDragConfig,props.rowDragConfig);});const computeColumnDragOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.columnDragConfig,props.columnDragConfig);});const computeResizeOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.resizeConfig,props.resizeConfig);});const computeResizableOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.resizableConfig,props.resizableConfig);});const computeSeqOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({startIndex:0},table_getConfig().table.seqConfig,props.seqConfig);});const computeRadioOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.radioConfig,props.radioConfig);});const computeCheckboxOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.checkboxConfig,props.checkboxConfig);});const computeTooltipOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().tooltip,table_getConfig().table.tooltipConfig,props.tooltipConfig);});const computeHeaderTooltipOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().tooltip,table_getConfig().table.headerTooltipConfig,props.headerTooltipConfig);});const computeFooterTooltipOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().tooltip,table_getConfig().table.footerTooltipConfig,props.footerTooltipConfig);});const computeTableTipConfig=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{tooltipStore}=reactData;const tooltipOpts=computeTooltipOpts.value;return Object.assign({},tooltipOpts,tooltipStore.currOpts);});const computeValidTipConfig=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const tooltipOpts=computeTooltipOpts.value;return Object.assign({},tooltipOpts);});const computeEditOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.editConfig,props.editConfig);});const computeEditDirtyOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.editDirtyConfig,props.editDirtyConfig);});const computeSortOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({orders:['asc','desc',null]},table_getConfig().table.sortConfig,props.sortConfig);});const computeFilterOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.filterConfig,props.filterConfig);});const computeFloatingFilterOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.floatingFilterConfig,props.floatingFilterConfig);});const computeMouseOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.mouseConfig,props.mouseConfig);});const computeAreaOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.areaConfig,props.areaConfig);});const computeKeyboardOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.keyboardConfig,props.keyboardConfig);});const computeClipOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.clipConfig,props.clipConfig);});const computeUndoRedoHistoryOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.undoRedoHistoryConfig,props.undoRedoHistoryConfig);});const computeFNROpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const fnrOpts=computeFnrOpts.value;return fnrOpts;});const computeFnrOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.fnrConfig,props.fnrConfig);});const computeMenuOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.menuConfig,props.menuConfig);});const computeLeftFixedWidth=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{columnStore}=reactData;const{leftList}=columnStore;let leftWidth=0;for(let i=0;i<leftList.length;i++){const column=leftList[i];leftWidth+=column.renderWidth;}return leftWidth;});const computeRightFixedWidth=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{columnStore}=reactData;const{rightList}=columnStore;let leftWidth=0;for(let i=0;i<rightList.length;i++){const column=rightList[i];leftWidth+=column.renderWidth;}return leftWidth;});// 合并列是否超越冻结列
|
|
21862
|
+
return Object.assign({},globalScrollY,scrollY);});const computeScrollbarOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.scrollbarConfig,props.scrollbarConfig);});const computeScrollbarXOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const scrollbarOpts=computeScrollbarOpts.value;return Object.assign({},scrollbarOpts.x,props.scrollbarConfig?.x||{});});const computeScrollbarYOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const scrollbarOpts=computeScrollbarOpts.value;return Object.assign({},scrollbarOpts.y,props.scrollbarConfig?.y||{});});const computeScrollbarXToTop=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const scrollbarXOpts=computeScrollbarXOpts.value;return scrollbarXOpts.position==='top';});const computeScrollbarYToLeft=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const scrollbarYOpts=computeScrollbarYOpts.value;return scrollbarYOpts.position==='left';});const computeScrollYThreshold=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const virtualYOpts=computeVirtualYOpts.value;const{threshold}=virtualYOpts;if(threshold){return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(threshold);}return 0;});const computeRowHeightMaps=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return reactData.rowHeightStore;});const computeDefaultRowHeight=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const vSize=computeSize.value;const rowHeightMaps=computeRowHeightMaps.value;return rowHeightMaps[vSize||'default']||18;});const computeColumnOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.columnConfig,props.columnConfig);});const computeCurrentColumnOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.currentColumnConfig,props.currentColumnConfig);});const computeCellOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const cellOpts=Object.assign({},table_getConfig().table.cellConfig,props.cellConfig);if(cellOpts.height){cellOpts.height=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellOpts.height);}return cellOpts;});const computeHeaderCellOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const headerCellOpts=Object.assign({},table_getConfig().table.headerCellConfig,props.headerCellConfig);const defaultRowHeight=computeDefaultRowHeight.value;const cellOpts=computeCellOpts.value;let headCellHeight=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getCalcHeight(headerCellOpts.height||cellOpts.height));if($xeGantt){const{computeTaskViewScales}=$xeGantt.getComputeMaps();const taskViewScales=computeTaskViewScales.value;if(taskViewScales&&taskViewScales.length>2){const ganttMinHeadCellHeight=defaultRowHeight/2*taskViewScales.length;headCellHeight=Math.max(ganttMinHeadCellHeight,headCellHeight);}}headerCellOpts.height=headCellHeight;return headerCellOpts;});const computeFooterCellOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const footerCellOpts=Object.assign({},table_getConfig().table.footerCellConfig,props.footerCellConfig);const cellOpts=computeCellOpts.value;footerCellOpts.height=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getCalcHeight(footerCellOpts.height||cellOpts.height));return footerCellOpts;});const computeRowOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.rowConfig,props.rowConfig);});const computeAggregateOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.aggregateConfig||table_getConfig().table.rowGroupConfig,props.aggregateConfig||props.rowGroupConfig);});const computeRowGroupOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return computeAggregateOpts.value;});const computeAggregateMode=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const aggregateOpts=computeAggregateOpts.value;return aggregateOpts.mode;});const computeAggregateAccuracyOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.aggregateAccuracyConfig,props.aggregateAccuracyConfig);});const computeCurrentRowOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.currentRowConfig,props.currentRowConfig);});const computeRowDragOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.rowDragConfig,props.rowDragConfig);});const computeColumnDragOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.columnDragConfig,props.columnDragConfig);});const computeResizeOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.resizeConfig,props.resizeConfig);});const computeResizableOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.resizableConfig,props.resizableConfig);});const computeSeqOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({startIndex:0},table_getConfig().table.seqConfig,props.seqConfig);});const computeRadioOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.radioConfig,props.radioConfig);});const computeCheckboxOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.checkboxConfig,props.checkboxConfig);});const computeTooltipOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().tooltip,table_getConfig().table.tooltipConfig,props.tooltipConfig);});const computeHeaderTooltipOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const tooltipOpts=computeTooltipOpts.value;return Object.assign({},table_getConfig().tooltip,{enterable:tooltipOpts.enterable,defaultPlacement:tooltipOpts.defaultPlacement},table_getConfig().table.headerTooltipConfig,props.headerTooltipConfig);});const computeFooterTooltipOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const tooltipOpts=computeTooltipOpts.value;return Object.assign({},table_getConfig().tooltip,{enterable:tooltipOpts.enterable,defaultPlacement:tooltipOpts.defaultPlacement},table_getConfig().table.footerTooltipConfig,props.footerTooltipConfig);});const computeTableTipConfig=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{tooltipStore}=reactData;const tooltipOpts=computeTooltipOpts.value;return Object.assign({},tooltipOpts,tooltipStore.currOpts);});const computeValidTipConfig=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const tooltipOpts=computeTooltipOpts.value;return Object.assign({},tooltipOpts);});const computeEditOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.editConfig,props.editConfig);});const computeEditDirtyOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.editDirtyConfig,props.editDirtyConfig);});const computeSortOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({orders:['asc','desc',null]},table_getConfig().table.sortConfig,props.sortConfig);});const computeFilterOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.filterConfig,props.filterConfig);});const computeFloatingFilterOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.floatingFilterConfig,props.floatingFilterConfig);});const computeMouseOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.mouseConfig,props.mouseConfig);});const computeAreaOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.areaConfig,props.areaConfig);});const computeKeyboardOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.keyboardConfig,props.keyboardConfig);});const computeClipOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.clipConfig,props.clipConfig);});const computeUndoRedoHistoryOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.undoRedoHistoryConfig,props.undoRedoHistoryConfig);});const computeFNROpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const fnrOpts=computeFnrOpts.value;return fnrOpts;});const computeFnrOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.fnrConfig,props.fnrConfig);});const computeMenuOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.menuConfig,props.menuConfig);});const computeLeftFixedWidth=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{columnStore}=reactData;const{leftList}=columnStore;let leftWidth=0;for(let i=0;i<leftList.length;i++){const column=leftList[i];leftWidth+=column.renderWidth;}return leftWidth;});const computeRightFixedWidth=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{columnStore}=reactData;const{rightList}=columnStore;let leftWidth=0;for(let i=0;i<rightList.length;i++){const column=rightList[i];leftWidth+=column.renderWidth;}return leftWidth;});// 合并列是否超越冻结列
|
|
21689
21863
|
const computeBodyMergeCoverFixed=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{columnStore,mergeBodyFlag}=reactData;const{mergeBodyList,visibleColumn}=internalData;const{leftList,rightList}=columnStore;const rscIndex=visibleColumn.length-rightList.length;if(mergeBodyFlag&&(leftList.length||rightList.length)){const lecIndex=leftList.length;for(let i=0;i<mergeBodyList.length;i++){const{col,colspan}=mergeBodyList[i];if(col<lecIndex&&col+colspan>lecIndex){return true;}else if(col<rscIndex&&col+colspan>rscIndex){return true;}}}return false;});const computeIsHeaderRenderOptimize=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{spanMethod,footerSpanMethod,showHeaderOverflow:allColumnHeaderOverflow}=props;const{isGroup,scrollXLoad}=reactData;let isOptimizeMode=false;if(isGroup){// 分组表头
|
|
21690
21864
|
}else{// 如果是使用优化模式
|
|
21691
21865
|
if(scrollXLoad&&allColumnHeaderOverflow){if(spanMethod||footerSpanMethod){// 如果不支持优化模式
|
|
@@ -22151,12 +22325,14 @@ internalData.currentRow=row;if(rowOpts.isCurrent||props.highlightCurrentRow){if(
|
|
|
22151
22325
|
* 用于当前行,获取当前行的数据
|
|
22152
22326
|
*/getCurrentRecord(isFull){const{fullDataRowIdData,afterFullRowMaps,currentRow}=internalData;const rowOpts=computeRowOpts.value;if(rowOpts.isCurrent||props.highlightCurrentRow){const rowid=getRowid($xeTable,currentRow);if(isFull){if(fullDataRowIdData[rowid]){return currentRow;}}else{if(afterFullRowMaps[rowid]){return currentRow;}}}return null;},/**
|
|
22153
22327
|
* 用于单选行,获取当已选中的数据
|
|
22154
|
-
*/getRadioRecord(isFull){const{fullDataRowIdData,afterFullRowMaps}=internalData;const{selectRadioRow}=reactData;if(selectRadioRow){const rowid=getRowid($xeTable,selectRadioRow);if(isFull){if(fullDataRowIdData[rowid]){return selectRadioRow;}}else{if(afterFullRowMaps[rowid]){return selectRadioRow;}}}return null;},getCurrentColumn(){const columnOpts=computeColumnOpts.value;return columnOpts.isCurrent||props.highlightCurrentColumn?
|
|
22328
|
+
*/getRadioRecord(isFull){const{fullDataRowIdData,afterFullRowMaps}=internalData;const{selectRadioRow}=reactData;if(selectRadioRow){const rowid=getRowid($xeTable,selectRadioRow);if(isFull){if(fullDataRowIdData[rowid]){return selectRadioRow;}}else{if(afterFullRowMaps[rowid]){return selectRadioRow;}}}return null;},getCurrentColumn(){const columnOpts=computeColumnOpts.value;return columnOpts.isCurrent||props.highlightCurrentColumn?internalData.currentCol:null;},/**
|
|
22155
22329
|
* 用于当前列,设置某列行为高亮状态
|
|
22156
|
-
*/setCurrentColumn(fieldOrColumn){const{mouseConfig}=props;const mouseOpts=computeMouseOpts.value;const isMouseSelected=mouseConfig&&mouseOpts.selected;const column=handleFieldOrColumn($xeTable,fieldOrColumn);if(column){$xeTable.clearCurrentColumn();
|
|
22330
|
+
*/setCurrentColumn(fieldOrColumn){const{mouseConfig}=props;const mouseOpts=computeMouseOpts.value;const isMouseSelected=mouseConfig&&mouseOpts.selected;const column=handleFieldOrColumn($xeTable,fieldOrColumn);if(column){$xeTable.clearCurrentColumn();internalData.currentCol=column;reactData.currColFlag++;// 刷新当前列状态
|
|
22331
|
+
}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{// 更新状选中态
|
|
22157
22332
|
if(isMouseSelected){$xeTable.addCellSelectedClass();}});},/**
|
|
22158
22333
|
* 用于当前列,手动清空当前高亮的状态
|
|
22159
|
-
*/clearCurrentColumn(){
|
|
22334
|
+
*/clearCurrentColumn(){internalData.currentCol=null;reactData.currColFlag++;// 刷新当前列状态
|
|
22335
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},setPendingRow(rows,status){const{handleGetRowId}=createHandleGetRowId($xeTable);const{pendingRowMaps}=internalData;if(rows&&!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows)){rows=[rows];}if(status){rows.forEach(row=>{const rowid=handleGetRowId(row);if(rowid&&!pendingRowMaps[rowid]){pendingRowMaps[rowid]=row;}});}else{rows.forEach(row=>{const rowid=handleGetRowId(row);if(rowid&&pendingRowMaps[rowid]){delete pendingRowMaps[rowid];}});}reactData.pendingRowFlag++;return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},togglePendingRow(rows){const{handleGetRowId}=createHandleGetRowId($xeTable);const{pendingRowMaps}=internalData;if(rows&&!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows)){rows=[rows];}rows.forEach(row=>{const rowid=handleGetRowId(row);if(rowid){if(pendingRowMaps[rowid]){delete pendingRowMaps[rowid];}else{pendingRowMaps[rowid]=row;}}});reactData.pendingRowFlag++;return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},hasPendingByRow(row){return $xeTable.isPendingByRow(row);},isPendingByRow(row){const{pendingRowMaps}=internalData;const rowid=getRowid($xeTable,row);return!!pendingRowMaps[rowid];},getPendingRecords(){const{fullAllDataRowIdData,pendingRowMaps}=internalData;const insertRecords=[];external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(pendingRowMaps,(row,rowid)=>{if(fullAllDataRowIdData[rowid]){insertRecords.push(row);}});return insertRecords;},clearPendingRow(){internalData.pendingRowMaps={};reactData.pendingRowFlag++;return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},sort(sortConfs,sortOrder){const sortOpts=computeSortOpts.value;const{multiple,remote,orders}=sortOpts;if(sortConfs){if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(sortConfs)){sortConfs=[{field:sortConfs,order:sortOrder}];}}if(!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(sortConfs)){sortConfs=[sortConfs];}if(sortConfs.length){if(!multiple){clearAllSort();}(multiple?sortConfs:[sortConfs[0]]).forEach((confs,index)=>{let{field,order}=confs;let column=field;if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(field)){column=$xeTable.getColumnByField(field);}if(column&&column.sortable){if(orders&&orders.indexOf(order)===-1){order=getNextSortOrder(column);}if(column.order!==order){column.order=order;}column.sortTime=Date.now()+index;}});// 如果是服务端排序,则跳过本地排序处理
|
|
22160
22336
|
if(!remote){$xeTable.handleTableData(true);}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{updateRowOffsetTop();$xeTable.updateCellAreas();return updateStyle();});}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},setSort(sortConfs,isUpdate){return handleSortEvent(null,sortConfs,isUpdate);},setSortByEvent(evnt,sortConfs){return handleSortEvent(evnt,sortConfs,true);},/**
|
|
22161
22337
|
* 清空指定列的排序条件
|
|
22162
22338
|
* 如果为空则清空所有列的排序条件
|
|
@@ -22308,7 +22484,7 @@ if($xeTable.closeMenu){if(ctxMenuStore.visible&&tableMenu&&!getEventTargetNode(e
|
|
|
22308
22484
|
if(!isActivated&&editRules&&validOpts.autoClear){reactData.validErrorMaps={};}// 最后激活的表格
|
|
22309
22485
|
internalData.isActivated=isActivated;}};/**
|
|
22310
22486
|
* 窗口失焦事件处理
|
|
22311
|
-
*/const handleGlobalBlurEvent=()=>{$xeTable.closeFilter();if($xeTable.closeMenu){$xeTable.closeMenu();}};const reUpdateCustomStyleEvent=evnt=>{const{customStore}=reactData;const customOpts=computeCustomOpts.value;const{popupOptions}=customOpts;const{transfer}=popupOptions||{};if(transfer&&customStore.visible){const tableCustom=refTableCustom.value;if(tableCustom&&$xeTable.handleCustomStyle&&!checkTargetElement(evnt.target,[tableCustom.getRefMaps().refElem.value],evnt.currentTarget)){$xeTable.handleCustomStyle().then(()=>{$xeTable.handleCustomStyle();});}}};const handleGlobalScrollEvent=evnt=>{const{filterStore}=reactData;
|
|
22487
|
+
*/const handleGlobalBlurEvent=()=>{$xeTable.closeFilter();if($xeTable.closeMenu){$xeTable.closeMenu();}};const reUpdateCustomStyleEvent=evnt=>{const{customStore}=reactData;const customOpts=computeCustomOpts.value;const{popupOptions}=customOpts;const{transfer}=popupOptions||{};if(transfer&&customStore.visible){const tableCustom=refTableCustom.value;if(tableCustom&&$xeTable.handleCustomStyle&&!checkTargetElement(evnt.target,[tableCustom.getRefMaps().refElem.value],evnt.currentTarget)){$xeTable.handleCustomStyle().then(()=>{$xeTable.handleCustomStyle();});}}};const handleGlobalScrollEvent=evnt=>{const{filterStore}=reactData;if(filterStore.visible){$xeTable.handleFilterStyle();}reUpdateCustomStyleEvent(evnt);};/**
|
|
22312
22488
|
* 全局滚动事件
|
|
22313
22489
|
*/const handleGlobalMousewheelEvent=()=>{$xeTable.closeTooltip();if($xeTable.closeMenu){$xeTable.closeMenu();}};/**
|
|
22314
22490
|
* 表格键盘事件
|
|
@@ -22343,7 +22519,7 @@ if(!beforeEditMethod||beforeEditMethod(params)){if(delMethod){delMethod(params);
|
|
|
22343
22519
|
$xeTable.updateFooter();dispatchEvent('cell-delete-value',params,evnt);}}}else if(hasBackspaceKey&&keyboardConfig&&keyboardOpts.isBack&&isEnableConf(editConfig)&&(selectRow||selectColumn)){if(!isEditStatus){const{backMethod}=keyboardOpts;// 如果是删除键
|
|
22344
22520
|
if(keyboardOpts.isDel&&isEnableConf(editConfig)&&(selectRow||selectColumn)){const params={row:selectRow,rowIndex:$xeTable.getRowIndex(selectRow),$rowIndex:$xeTable.getVMRowIndex(selectRow),_rowIndex:$xeTable.getVTRowIndex(selectRow),column:selectColumn,columnIndex:$xeTable.getColumnIndex(selectColumn),$columnIndex:$xeTable.getVMColumnIndex(selectColumn),_columnIndex:$xeTable.getVTColumnIndex(selectColumn),$table:$xeTable,$grid:$xeGrid,$gantt:$xeGantt};// 是否被禁用
|
|
22345
22521
|
if(!beforeEditMethod||beforeEditMethod(params)){if(backMethod){backMethod(params);}else{$xeTable.handleEdit(params,evnt,{isClear:true});}dispatchEvent('cell-backspace-value',params,evnt);}}}}else if(hasBackspaceKey&&keyboardConfig&&treeConfig&&keyboardOpts.isBack&&(rowOpts.isCurrent||highlightCurrentRow)&¤tRow){// 如果树形表格回退键关闭当前行返回父节点
|
|
22346
|
-
const{parent:parentRow}=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(internalData.afterTreeFullData,item=>item===currentRow,{children:childrenField});if(parentRow){evnt.preventDefault();const params={row:parentRow,rowIndex:$xeTable.getRowIndex(parentRow),$rowIndex:$xeTable.getVMRowIndex(parentRow),$table:$xeTable,$grid:$xeGrid,$gantt:$xeGantt};$xeTable.setTreeExpand(parentRow,false).then(()=>$xeTable.scrollToRow(parentRow)).then(()=>$xeTable.triggerCurrentRowEvent(evnt,params));}}else if(keyboardConfig&&keyboardOpts.isUndoRedo&&isControlKey&&(isZ||isY)&&!
|
|
22522
|
+
const{parent:parentRow}=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(internalData.afterTreeFullData,item=>item===currentRow,{children:childrenField});if(parentRow){evnt.preventDefault();const params={row:parentRow,rowIndex:$xeTable.getRowIndex(parentRow),$rowIndex:$xeTable.getVMRowIndex(parentRow),$table:$xeTable,$grid:$xeGrid,$gantt:$xeGantt};$xeTable.setTreeExpand(parentRow,false).then(()=>$xeTable.scrollToRow(parentRow)).then(()=>$xeTable.triggerCurrentRowEvent(evnt,params));}}else if(keyboardConfig&&keyboardOpts.isUndoRedo&&isControlKey&&(isZ||isY)&&!hasAxternalInputTarget(evnt.target)){if(evnt.target){if(isY||hasShiftKey&&isZ){// 恢复被撤销的操作:Ctrl + Y 或 Ctrl + Shift + Z
|
|
22347
22523
|
evnt.preventDefault();$xeTable.handleRedoStackEvent(evnt);}else if(isZ){// 撤销上一步操作:Ctrl + Z
|
|
22348
22524
|
evnt.preventDefault();$xeTable.handleUndoStackEvent(evnt);}}}else if(keyboardConfig&&isEnableConf(editConfig)&&keyboardOpts.isEdit&&!isControlKey&&(isSpacebar||isProcess||evnt.key==='Process'||keyCode>=48&&keyCode<=57||keyCode>=65&&keyCode<=90||keyCode>=96&&keyCode<=111||keyCode>=186&&keyCode<=192||keyCode>=219&&keyCode<=222)){const{editMode,editMethod}=keyboardOpts;// 启用编辑后,空格键功能将失效
|
|
22349
22525
|
// if (isSpacebar) {
|
|
@@ -22351,7 +22527,7 @@ evnt.preventDefault();$xeTable.handleUndoStackEvent(evnt);}}}else if(keyboardCon
|
|
|
22351
22527
|
// }
|
|
22352
22528
|
// 如果是按下非功能键之外允许直接编辑
|
|
22353
22529
|
if(selectColumn&&selectRow&&isEnableConf(selectColumn.editRender)){const beforeEditMethod=editOpts.beforeEditMethod||editOpts.activeMethod;const params={row:selectRow,rowIndex:$xeTable.getRowIndex(selectRow),$rowIndex:$xeTable.getVMRowIndex(selectRow),_rowIndex:$xeTable.getVTRowIndex(selectRow),column:selectColumn,columnIndex:$xeTable.getColumnIndex(selectColumn),$columnIndex:$xeTable.getVMColumnIndex(selectColumn),_columnIndex:$xeTable.getVTColumnIndex(selectColumn),$table:$xeTable,$grid:$xeGrid,$gantt:$xeGantt};if(!beforeEditMethod||beforeEditMethod(params)){if(editMethod){editMethod(params);}else{let isClearValue=false;// 追加方式与覆盖式
|
|
22354
|
-
if(editMode!=='insert'){isClearValue=true;}$xeTable.handleEdit(params,evnt,{isClear:isClearValue});}}}}dispatchEvent('keydown',{},evnt);});}};const handleGlobalPasteEvent=evnt=>{const{keyboardConfig,mouseConfig}=props;const{editStore,filterStore}=reactData;const{isActivated}=internalData;const mouseOpts=computeMouseOpts.value;const keyboardOpts=computeKeyboardOpts.value;const{actived}=editStore;if(isActivated&&!filterStore.visible){if(!(actived.row||actived.column)){if(keyboardConfig&&keyboardOpts.isClip&&mouseConfig&&mouseOpts.area&&$xeTable.handlePeClAreaEvent){$xeTable.handlePeClAreaEvent(evnt);}}dispatchEvent('paste',{},evnt);}};const handleGlobalCopyEvent=evnt=>{const{keyboardConfig,mouseConfig}=props;const{editStore,filterStore}=reactData;const{isActivated}=internalData;const mouseOpts=computeMouseOpts.value;const keyboardOpts=computeKeyboardOpts.value;const{actived}=editStore;if(isActivated&&!filterStore.visible){if(!(actived.row||actived.column)){if(keyboardConfig&&keyboardOpts.isClip&&mouseConfig&&mouseOpts.area&&$xeTable.handleCyClAreaEvent){$xeTable.handleCyClAreaEvent(evnt);}}dispatchEvent('copy',{},evnt);}};const handleGlobalCutEvent=evnt=>{const{keyboardConfig,mouseConfig}=props;const{editStore,filterStore}=reactData;const{isActivated}=internalData;const mouseOpts=computeMouseOpts.value;const keyboardOpts=computeKeyboardOpts.value;const{actived}=editStore;if(isActivated&&!filterStore.visible){if(!(actived.row||actived.column)){if(keyboardConfig&&keyboardOpts.isClip&&mouseConfig&&mouseOpts.area&&$xeTable.handleCutCellAreaEvent){$xeTable.handleCutCellAreaEvent(evnt);}}dispatchEvent('cut',{},evnt);}};const handleGlobalResizeEvent=()=>{if($xeTable.closeMenu){$xeTable.closeMenu();}const el=refElem.value;if(!el||!el.clientWidth){return;}if(internalData.rsePending){return;}handleResizeEvent();};const handleTargetEnterEvent=isClear=>{const $tooltip=refTooltip.value;clearTimeout(internalData.tooltipTimeout);if(isClear){$xeTable.closeTooltip();}else{if($tooltip&&$tooltip.setActived){$tooltip.setActived(true);}}};const clearCrossTableDragStatus=()=>{crossTableDragRowObj=null;crossTableDragRowInfo.row=null;};const clearDragStatus=()=>{const{dragRow,dragCol}=reactData;if(dragRow||dragCol){clearColDropOrigin();clearRowDropOrigin();hideDropTip();clearCrossTableDragStatus();reactData.dragRow=null;reactData.dragCol=null;}};const handleRowDragEndClearStatus=()=>{clearRowDragData();clearCrossTableDragStatus();handleRecalculateStyle(false,true,true);};const handleColDragEndClearStatus=()=>{clearColDragData();clearCrossTableDragStatus();handleRecalculateStyle(true,true,true);};const clearRowDropOrigin=()=>{const el=refElem.value;if(el){const clss='row--drag-origin';external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`.${clss}`),elem=>{elem.draggable=false;removeClass(elem,clss);});}};const updateRowDropOrigin=row=>{const el=refElem.value;if(el){const clss='row--drag-origin';const rowid=getRowid($xeTable,row);external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`[rowid="${rowid}"]`),elem=>{addClass(elem,clss);});}};const updateRowDropTipContent=tdEl=>{const{dragConfig}=props;const{dragRow}=reactData;const rowDragOpts=computeRowDragOpts.value;const{tooltipMethod}=rowDragOpts;const rTooltipMethod=tooltipMethod||(dragConfig?dragConfig.rowTooltipMethod:null);let tipContent='';if(rTooltipMethod){const rtParams={$table:$xeTable,row:dragRow};tipContent=`${rTooltipMethod(rtParams)||''}`;}else{tipContent=table_getI18n('vxe.table.dragTip',[tdEl.textContent||'']);}reactData.dragTipText=tipContent;};const updateColDropOrigin=column=>{const el=refElem.value;if(el){const colQuerys=[];external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree([column],item=>{colQuerys.push(`[colid="${item.id}"]`);});const clss='col--drag-origin';external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(colQuerys.join(',')),elem=>{addClass(elem,clss);});}};const clearColDropOrigin=()=>{const el=refElem.value;if(el){const clss='col--drag-origin';external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`.${clss}`),elem=>{elem.draggable=false;removeClass(elem,clss);});}};const updateColDropTipContent=tdEl=>{const{dragCol}=reactData;const columnDragOpts=computeColumnDragOpts.value;const{tooltipMethod}=columnDragOpts;let tipContent='';if(tooltipMethod){const dtParams={$table:$xeTable,column:dragCol};tipContent=`${tooltipMethod(dtParams)||''}`;}else{tipContent=table_getI18n('vxe.table.dragTip',[tdEl.textContent||'']);}reactData.dragTipText=tipContent;};const showDropTip=(evnt,trEl,thEl,showLine,dragPos)=>{let wrapperEl=refElem.value;if($xeGantt&&trEl){const{refGanttContainerElem}=$xeGantt.getRefMaps();const ganttContainerElem=refGanttContainerElem.value;if(ganttContainerElem){wrapperEl=ganttContainerElem;}}if(!wrapperEl){return;}const{overflowX,scrollbarWidth,overflowY,scrollbarHeight}=reactData;const{prevDragToChild}=internalData;const wrapperRect=wrapperEl.getBoundingClientRect();const osbWidth=overflowY?scrollbarWidth:0;const osbHeight=overflowX?scrollbarHeight:0;const tableWrapperWidth=wrapperEl.clientWidth;const tableWrapperHeight=wrapperEl.clientHeight;if(trEl){const rdLineEl=refDragRowLineElem.value;if(rdLineEl){if(showLine){const scrollbarYToLeft=computeScrollbarYToLeft.value;const trRect=trEl.getBoundingClientRect();let trHeight=trEl.clientHeight;const offsetTop=Math.max(1,trRect.y-wrapperRect.y);if(offsetTop+trHeight>tableWrapperHeight-osbHeight){trHeight=tableWrapperHeight-offsetTop-osbHeight;}rdLineEl.style.display='block';rdLineEl.style.left=`${scrollbarYToLeft?osbWidth:0}px`;rdLineEl.style.top=`${offsetTop}px`;rdLineEl.style.height=`${trHeight}px`;rdLineEl.style.width=`${tableWrapperWidth-osbWidth}px`;rdLineEl.setAttribute('drag-pos',dragPos);rdLineEl.setAttribute('drag-to-child',prevDragToChild?'y':'n');}else{rdLineEl.style.display='';}}}else if(thEl){const cdLineEl=refDragColLineElem.value;if(cdLineEl){if(showLine){const scrollbarXToTop=computeScrollbarXToTop.value;const leftContainerElem=refLeftContainer.value;const leftContainerWidth=leftContainerElem?leftContainerElem.clientWidth:0;const rightContainerElem=refRightContainer.value;const rightContainerWidth=rightContainerElem?rightContainerElem.clientWidth:0;const thRect=thEl.getBoundingClientRect();let thWidth=thEl.clientWidth;const offsetTop=Math.max(0,thRect.y-wrapperRect.y);const startX=leftContainerWidth;let offsetLeft=thRect.x-wrapperRect.x;if(offsetLeft<startX){thWidth-=startX-offsetLeft;offsetLeft=startX;}const endX=tableWrapperWidth-rightContainerWidth-(rightContainerWidth?0:osbWidth);if(offsetLeft+thWidth>endX){thWidth=endX-offsetLeft;}cdLineEl.style.display='block';cdLineEl.style.top=`${offsetTop}px`;cdLineEl.style.left=`${offsetLeft}px`;cdLineEl.style.width=`${thWidth}px`;if(prevDragToChild){cdLineEl.style.height=`${thRect.height}px`;}else{cdLineEl.style.height=`${tableWrapperHeight-offsetTop-(scrollbarXToTop?0:osbHeight)}px`;}cdLineEl.setAttribute('drag-pos',dragPos);cdLineEl.setAttribute('drag-to-child',prevDragToChild?'y':'n');}else{cdLineEl.style.display='';}}}const rdTipEl=refDragTipElem.value;if(rdTipEl){rdTipEl.style.display='block';rdTipEl.style.top=`${Math.min(wrapperEl.clientHeight-wrapperEl.scrollTop-rdTipEl.clientHeight,evnt.clientY-wrapperRect.y)}px`;rdTipEl.style.left=`${Math.min(wrapperEl.clientWidth-wrapperEl.scrollLeft-rdTipEl.clientWidth-16,evnt.clientX-wrapperRect.x)}px`;rdTipEl.setAttribute('drag-status',showLine?prevDragToChild?'sub':'normal':'disabled');}};const hideDropTip=()=>{const rdTipEl=refDragTipElem.value;const rdLineEl=refDragRowLineElem.value;const cdLineEl=refDragColLineElem.value;if(rdTipEl){rdTipEl.style.display='';}if(rdLineEl){rdLineEl.style.display='';}if(cdLineEl){cdLineEl.style.display='';}};const clearRowDragData=()=>{let wrapperEl=refElem.value;const dtClss=['.vxe-body--row'];if($xeGantt){const{refGanttContainerElem}=$xeGantt.getRefMaps();const ganttContainerElem=refGanttContainerElem.value;if(ganttContainerElem){wrapperEl=ganttContainerElem;}dtClss.push('.vxe-gantt-view--body-row','.vxe-gantt-view--chart-row');}hideDropTip();clearRowDropOrigin();clearRowAnimate(wrapperEl,dtClss);internalData.prevDragToChild=false;reactData.dragRow=null;reactData.dragCol=null;};const clearColDragData=()=>{const el=refElem.value;hideDropTip();clearColDropOrigin();clearColAnimate(el,['.vxe-table--column']);internalData.prevDragToChild=false;reactData.dragRow=null;reactData.dragCol=null;};/**
|
|
22530
|
+
if(editMode!=='insert'){isClearValue=true;}$xeTable.handleEdit(params,evnt,{isClear:isClearValue});}}}}dispatchEvent('keydown',{},evnt);});}};const handleGlobalPasteEvent=evnt=>{const{keyboardConfig,mouseConfig}=props;const{editStore,filterStore}=reactData;const{isActivated}=internalData;const mouseOpts=computeMouseOpts.value;const keyboardOpts=computeKeyboardOpts.value;const{actived}=editStore;if(isActivated&&!filterStore.visible){if(!(actived.row||actived.column)){if(keyboardConfig&&keyboardOpts.isClip&&mouseConfig&&mouseOpts.area&&$xeTable.handlePeClAreaEvent){$xeTable.handlePeClAreaEvent(evnt);}}dispatchEvent('paste',{},evnt);}};const handleGlobalCopyEvent=evnt=>{const{keyboardConfig,mouseConfig}=props;const{editStore,filterStore}=reactData;const{isActivated}=internalData;const mouseOpts=computeMouseOpts.value;const keyboardOpts=computeKeyboardOpts.value;const{actived}=editStore;if(isActivated&&!filterStore.visible){if(!(actived.row||actived.column)){if(keyboardConfig&&keyboardOpts.isClip&&mouseConfig&&mouseOpts.area&&$xeTable.handleCyClAreaEvent){$xeTable.handleCyClAreaEvent(evnt);}}dispatchEvent('copy',{},evnt);}};const handleGlobalCutEvent=evnt=>{const{keyboardConfig,mouseConfig}=props;const{editStore,filterStore}=reactData;const{isActivated}=internalData;const mouseOpts=computeMouseOpts.value;const keyboardOpts=computeKeyboardOpts.value;const{actived}=editStore;if(isActivated&&!filterStore.visible){if(!(actived.row||actived.column)){if(keyboardConfig&&keyboardOpts.isClip&&mouseConfig&&mouseOpts.area&&$xeTable.handleCutCellAreaEvent){$xeTable.handleCutCellAreaEvent(evnt);}}dispatchEvent('cut',{},evnt);}};const handleGlobalResizeEvent=()=>{const{filterStore}=reactData;if(filterStore.visible){$xeTable.handleFilterStyle();}if($xeTable.closeMenu){$xeTable.closeMenu();}const el=refElem.value;if(!el||!el.clientWidth){return;}if(internalData.rsePending){return;}handleResizeEvent();};const handleTargetEnterEvent=isClear=>{const $tooltip=refTooltip.value;clearTimeout(internalData.tooltipTimeout);if(isClear){$xeTable.closeTooltip();}else{if($tooltip&&$tooltip.setActived){$tooltip.setActived(true);}}};const clearCrossTableDragStatus=()=>{crossTableDragRowObj=null;crossTableDragRowInfo.row=null;};const clearDragStatus=()=>{const{dragRow,dragCol}=reactData;if(dragRow||dragCol){clearColDropOrigin();clearRowDropOrigin();hideDropTip();clearCrossTableDragStatus();reactData.dragRow=null;reactData.dragCol=null;}};const handleRowDragEndClearStatus=()=>{clearRowDragData();clearCrossTableDragStatus();handleRecalculateStyle(false,true,true);};const handleColDragEndClearStatus=()=>{clearColDragData();clearCrossTableDragStatus();handleRecalculateStyle(true,true,true);};const clearRowDropOrigin=()=>{const el=refElem.value;if(el){const clss='row--drag-origin';external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`.${clss}`),elem=>{elem.draggable=false;removeClass(elem,clss);});}};const updateRowDropOrigin=row=>{const el=refElem.value;if(el){const clss='row--drag-origin';const rowid=getRowid($xeTable,row);external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`[rowid="${rowid}"]`),elem=>{addClass(elem,clss);});}};const updateRowDropTipContent=tdEl=>{const{dragConfig}=props;const{dragRow}=reactData;const rowDragOpts=computeRowDragOpts.value;const{tooltipMethod}=rowDragOpts;const rTooltipMethod=tooltipMethod||(dragConfig?dragConfig.rowTooltipMethod:null);let tipContent='';if(rTooltipMethod){const rtParams={$table:$xeTable,row:dragRow};tipContent=`${rTooltipMethod(rtParams)||''}`;}else{tipContent=table_getI18n('vxe.table.dragTip',[tdEl.textContent||'']);}reactData.dragTipText=tipContent;};const updateColDropOrigin=column=>{const el=refElem.value;if(el){const colQuerys=[];external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree([column],item=>{colQuerys.push(`[colid="${item.id}"]`);});const clss='col--drag-origin';external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(colQuerys.join(',')),elem=>{addClass(elem,clss);});}};const clearColDropOrigin=()=>{const el=refElem.value;if(el){const clss='col--drag-origin';external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`.${clss}`),elem=>{elem.draggable=false;removeClass(elem,clss);});}};const updateColDropTipContent=tdEl=>{const{dragCol}=reactData;const columnDragOpts=computeColumnDragOpts.value;const{tooltipMethod}=columnDragOpts;let tipContent='';if(tooltipMethod){const dtParams={$table:$xeTable,column:dragCol};tipContent=`${tooltipMethod(dtParams)||''}`;}else{tipContent=table_getI18n('vxe.table.dragTip',[tdEl.textContent||'']);}reactData.dragTipText=tipContent;};const showDropTip=(evnt,trEl,thEl,showLine,dragPos)=>{let wrapperEl=refElem.value;if($xeGantt&&trEl){const{refGanttContainerElem}=$xeGantt.getRefMaps();const ganttContainerElem=refGanttContainerElem.value;if(ganttContainerElem){wrapperEl=ganttContainerElem;}}if(!wrapperEl){return;}const{overflowX,scrollbarWidth,overflowY,scrollbarHeight}=reactData;const{prevDragToChild}=internalData;const wrapperRect=wrapperEl.getBoundingClientRect();const osbWidth=overflowY?scrollbarWidth:0;const osbHeight=overflowX?scrollbarHeight:0;const tableWrapperWidth=wrapperEl.clientWidth;const tableWrapperHeight=wrapperEl.clientHeight;if(trEl){const rdLineEl=refDragRowLineElem.value;if(rdLineEl){if(showLine){const scrollbarYToLeft=computeScrollbarYToLeft.value;const trRect=trEl.getBoundingClientRect();let trHeight=trEl.clientHeight;const offsetTop=Math.max(1,trRect.y-wrapperRect.y);if(offsetTop+trHeight>tableWrapperHeight-osbHeight){trHeight=tableWrapperHeight-offsetTop-osbHeight;}rdLineEl.style.display='block';rdLineEl.style.left=`${scrollbarYToLeft?osbWidth:0}px`;rdLineEl.style.top=`${offsetTop}px`;rdLineEl.style.height=`${trHeight}px`;rdLineEl.style.width=`${tableWrapperWidth-osbWidth}px`;rdLineEl.setAttribute('drag-pos',dragPos);rdLineEl.setAttribute('drag-to-child',prevDragToChild?'y':'n');}else{rdLineEl.style.display='';}}}else if(thEl){const cdLineEl=refDragColLineElem.value;if(cdLineEl){if(showLine){const scrollbarXToTop=computeScrollbarXToTop.value;const leftContainerElem=refLeftContainer.value;const leftContainerWidth=leftContainerElem?leftContainerElem.clientWidth:0;const rightContainerElem=refRightContainer.value;const rightContainerWidth=rightContainerElem?rightContainerElem.clientWidth:0;const thRect=thEl.getBoundingClientRect();let thWidth=thEl.clientWidth;const offsetTop=Math.max(0,thRect.y-wrapperRect.y);const startX=leftContainerWidth;let offsetLeft=thRect.x-wrapperRect.x;if(offsetLeft<startX){thWidth-=startX-offsetLeft;offsetLeft=startX;}const endX=tableWrapperWidth-rightContainerWidth-(rightContainerWidth?0:osbWidth);if(offsetLeft+thWidth>endX){thWidth=endX-offsetLeft;}cdLineEl.style.display='block';cdLineEl.style.top=`${offsetTop}px`;cdLineEl.style.left=`${offsetLeft}px`;cdLineEl.style.width=`${thWidth}px`;if(prevDragToChild){cdLineEl.style.height=`${thRect.height}px`;}else{cdLineEl.style.height=`${tableWrapperHeight-offsetTop-(scrollbarXToTop?0:osbHeight)}px`;}cdLineEl.setAttribute('drag-pos',dragPos);cdLineEl.setAttribute('drag-to-child',prevDragToChild?'y':'n');}else{cdLineEl.style.display='';}}}const rdTipEl=refDragTipElem.value;if(rdTipEl){rdTipEl.style.display='block';rdTipEl.style.top=`${Math.min(wrapperEl.clientHeight-wrapperEl.scrollTop-rdTipEl.clientHeight,evnt.clientY-wrapperRect.y)}px`;rdTipEl.style.left=`${Math.min(wrapperEl.clientWidth-wrapperEl.scrollLeft-rdTipEl.clientWidth-16,evnt.clientX-wrapperRect.x)}px`;rdTipEl.setAttribute('drag-status',showLine?prevDragToChild?'sub':'normal':'disabled');}};const hideDropTip=()=>{const rdTipEl=refDragTipElem.value;const rdLineEl=refDragRowLineElem.value;const cdLineEl=refDragColLineElem.value;if(rdTipEl){rdTipEl.style.display='';}if(rdLineEl){rdLineEl.style.display='';}if(cdLineEl){cdLineEl.style.display='';}};const clearRowDragData=()=>{let wrapperEl=refElem.value;const dtClss=['.vxe-body--row'];if($xeGantt){const{refGanttContainerElem}=$xeGantt.getRefMaps();const ganttContainerElem=refGanttContainerElem.value;if(ganttContainerElem){wrapperEl=ganttContainerElem;}dtClss.push('.vxe-gantt-view--body-row','.vxe-gantt-view--chart-row');}hideDropTip();clearRowDropOrigin();clearRowAnimate(wrapperEl,dtClss);internalData.prevDragToChild=false;reactData.dragRow=null;reactData.dragCol=null;};const clearColDragData=()=>{const el=refElem.value;hideDropTip();clearColDropOrigin();clearColAnimate(el,['.vxe-table--column']);internalData.prevDragToChild=false;reactData.dragRow=null;reactData.dragCol=null;};/**
|
|
22355
22531
|
* 处理显示 tooltip
|
|
22356
22532
|
* @param {Event} evnt 事件
|
|
22357
22533
|
* @param {Row} row 行对象
|
|
@@ -22476,7 +22652,7 @@ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default(
|
|
|
22476
22652
|
* 多选,选中所有事件
|
|
22477
22653
|
*/triggerCheckAllEvent(evnt,value){const checkboxOpts=computeCheckboxOpts.value;const{trigger}=checkboxOpts;if(trigger==='manual'){return;}if(evnt){evnt.stopPropagation();}handleCheckAllEvent(evnt,value);},/**
|
|
22478
22654
|
* 单选,行选中事件
|
|
22479
|
-
*/triggerRadioRowEvent(evnt,params){const{selectRadioRow:oldValue}=reactData;const{row}=params;const radioOpts=computeRadioOpts.value;const{trigger,strict,checkMethod}=radioOpts;if(trigger==='manual'){return;}evnt.stopPropagation();if(!checkMethod||checkMethod({$table:$xeTable,row})){let newValue=row;let isChange=oldValue!==newValue;if(strict){handleCheckedRadioRow(newValue,false);}else{if(oldValue===newValue){newValue=null;}isChange=oldValue!==newValue;if(isChange&&newValue){handleCheckedRadioRow(newValue,false);}else{newValue=null;$xeTable.clearRadioRow();}}if(isChange){dispatchEvent('radio-change',{oldValue,newValue,selected:!!newValue,...params},evnt);}}},triggerCurrentColumnEvent(evnt,params){const{
|
|
22655
|
+
*/triggerRadioRowEvent(evnt,params){const{selectRadioRow:oldValue}=reactData;const{row}=params;const radioOpts=computeRadioOpts.value;const{trigger,strict,checkMethod}=radioOpts;if(trigger==='manual'){return;}evnt.stopPropagation();if(!checkMethod||checkMethod({$table:$xeTable,row})){let newValue=row;let isChange=oldValue!==newValue;if(strict){handleCheckedRadioRow(newValue,false);}else{if(oldValue===newValue){newValue=null;}isChange=oldValue!==newValue;if(isChange&&newValue){handleCheckedRadioRow(newValue,false);}else{newValue=null;$xeTable.clearRadioRow();}}if(isChange){dispatchEvent('radio-change',{oldValue,newValue,selected:!!newValue,...params},evnt);}}},triggerCurrentColumnEvent(evnt,params){const{currentCol:oldValue}=internalData;const columnOpts=computeColumnOpts.value;const currentColumnOpts=computeCurrentColumnOpts.value;const beforeRowMethod=currentColumnOpts.beforeSelectMethod||columnOpts.currentMethod;let newValue=params.column;const{trigger,strict}=currentColumnOpts;if(trigger==='manual'){return;}let isChange=oldValue!==newValue;if(!beforeRowMethod||beforeRowMethod({column:newValue,$table:$xeTable})){if(strict){$xeTable.setCurrentColumn(newValue);}else{if(oldValue===newValue){newValue=null;}isChange=oldValue!==newValue;if(isChange&&newValue){$xeTable.setCurrentColumn(newValue);}else{newValue=null;$xeTable.clearCurrentColumn();}}if(isChange){dispatchEvent('current-column-change',{oldValue,newValue,selected:!!newValue,...params},evnt);}}else{dispatchEvent('current-column-disabled',params,evnt);}},triggerCurrentRowEvent(evnt,params){const{currentRow:oldValue}=internalData;const rowOpts=computeRowOpts.value;const currentRowOpts=computeCurrentRowOpts.value;const beforeRowMethod=currentRowOpts.beforeSelectMethod||rowOpts.currentMethod;let{row:newValue}=params;const{trigger,strict}=currentRowOpts;if(trigger==='manual'){return;}let isChange=oldValue!==newValue;if(!beforeRowMethod||beforeRowMethod({row:newValue,$table:$xeTable})){if(strict){$xeTable.setCurrentRow(newValue);}else{if(oldValue===newValue){newValue=null;}isChange=oldValue!==newValue;if(isChange&&newValue){$xeTable.setCurrentRow(newValue);}else{newValue=null;$xeTable.clearCurrentRow();}}if(isChange){dispatchEvent('current-row-change',{oldValue,newValue,selected:!!newValue,...params},evnt);// 已废弃
|
|
22480
22656
|
dispatchEvent('current-change',{oldValue,newValue,...params},evnt);}}else{dispatchEvent('current-row-disabled',params,evnt);}},/**
|
|
22481
22657
|
* 展开行事件
|
|
22482
22658
|
*/triggerRowExpandEvent(evnt,params){const{expandColumn}=reactData;const{rowExpandLazyLoadedMaps}=internalData;const expandOpts=computeExpandOpts.value;const{row}=params;const{lazy,trigger}=expandOpts;if(trigger==='manual'){return;}evnt.stopPropagation();const rowid=getRowid($xeTable,row);if(!lazy||!rowExpandLazyLoadedMaps[rowid]){const expanded=!$xeTable.isRowExpandByRow(row);const columnIndex=expandColumn?$xeTable.getColumnIndex(expandColumn):-1;const $columnIndex=expandColumn?$xeTable.getVMColumnIndex(expandColumn):-1;$xeTable.setRowExpand(row,expanded);dispatchEvent('toggle-row-expand',{expanded,column:expandColumn,columnIndex,$columnIndex,row,rowIndex:$xeTable.getRowIndex(row),$rowIndex:$xeTable.getVMRowIndex(row)},evnt);}},/**
|
|
@@ -22561,7 +22737,7 @@ if(bodyScrollElem&&bodyTableElem&&bodyScrollElem.scrollTop+clientHeight>=maxYHei
|
|
|
22561
22737
|
* 处理固定列的显示状态
|
|
22562
22738
|
*/checkScrolling(){const{elemStore}=internalData;const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);const leftContainerElem=refLeftContainer.value;const rightContainerElem=refRightContainer.value;const xHandleEl=refScrollXHandleElem.value;const bodtTargetEl=xHandleEl||bodyScrollElem;if(bodtTargetEl){if(leftContainerElem){if(bodtTargetEl.scrollLeft>0){addClass(leftContainerElem,'scrolling--middle');}else{removeClass(leftContainerElem,'scrolling--middle');}}if(rightContainerElem){if(bodtTargetEl.clientWidth<bodtTargetEl.scrollWidth-Math.ceil(bodtTargetEl.scrollLeft)){addClass(rightContainerElem,'scrolling--middle');}else{removeClass(rightContainerElem,'scrolling--middle');}}}},handleUpdateAggData(){return loadTableData(internalData.tableSynchData,false,true);},handlePushStack(){const keyboardOpts=computeKeyboardOpts.value;if(!keyboardOpts.isUndoRedo){return;}const{stackHistoryStore}=internalData;const stackObj=getSnapshotStackData();stackHistoryStore.undoStacks.push(stackObj);stackHistoryStore.redoStacks=[];truncateStackHistory();},handleUndoStackEvent(evnt){const{stackHistoryStore}=internalData;const{undoStacks,redoStacks}=stackHistoryStore;if(undoStacks.length){const stackObj=getSnapshotStackData();redoStacks.push(stackObj);handleUpdateSnapshotStackData(undoStacks.pop());if(evnt){dispatchEvent('undo',{},evnt);}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(()=>{return{status:true};});}return Promise.resolve({status:false});},handleRedoStackEvent(evnt){const{stackHistoryStore}=internalData;const{undoStacks,redoStacks}=stackHistoryStore;if(redoStacks.length){const stackObj=getSnapshotStackData();undoStacks.push(stackObj);handleUpdateSnapshotStackData(redoStacks.pop());if(evnt){dispatchEvent('redo',{},evnt);}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(()=>{return{status:true};});}return Promise.resolve({status:false});},handleClearStack(){const{stackHistoryStore}=internalData;stackHistoryStore.undoStacks=[];stackHistoryStore.redoStacks=[];return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},updateZindex(){if(props.zIndex){internalData.tZindex=props.zIndex;}else if(internalData.tZindex<getLastZIndex()){internalData.tZindex=nextZIndex();}},handleCheckedCheckboxRow,/**
|
|
22563
22739
|
* 行 hover 事件
|
|
22564
|
-
*/triggerHoverEvent(evnt,{row}){$xeTable.setHoverRow(row);},setHoverRow(row){const $xeGanttView=internalData.xeGanttView;const rowid=getRowid($xeTable,row);const el=refElem.value
|
|
22740
|
+
*/triggerHoverEvent(evnt,{row}){$xeTable.setHoverRow(row);},setHoverRow(row){const $xeGanttView=internalData.xeGanttView;$xeTable.clearHoverRow();const rowid=getRowid($xeTable,row);const el=refElem.value;if(el){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`.vxe-body--row[rowid="${rowid}"]`),elem=>addClass(elem,'row--hover'));}internalData.hoverRow=row;if($xeGanttView&&$xeGanttView.handleUpdateHoverRow){$xeGanttView.handleUpdateHoverRow(row);}},clearHoverRow(){const $xeGanttView=internalData.xeGanttView;const el=refElem.value;if(el){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll('.vxe-body--row.row--hover'),elem=>removeClass(elem,'row--hover'));}internalData.hoverRow=null;if($xeGanttView&&$xeGanttView.handleUpdateHoverRow){$xeGanttView.handleUpdateHoverRow();}},/**
|
|
22565
22741
|
* 已废弃,被 getCellElement 替换
|
|
22566
22742
|
* @deprecated
|
|
22567
22743
|
*/getCell(row,column){return $xeTable.getCellElement(row,column);},findRowIndexOf(list,row){return row?external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(list,item=>$xeTable.eqRow(item,row)):-1;},eqRow(row1,row2){if(row1&&row2){if(row1===row2){return true;}return getRowid($xeTable,row1)===getRowid($xeTable,row2);}return false;},handleConnectGanttView($ganttView){if($ganttView&&$ganttView.connectUpdate){$ganttView.connectUpdate({$table:$xeTable});internalData.xeGanttView=$ganttView;}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();}};// 检测对应模块是否安装
|