vxe-table 3.10.1 → 3.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/locale/lang/en-US.js +3 -2
- package/es/locale/lang/es-ES.js +3 -2
- package/es/locale/lang/hu-HU.js +3 -2
- package/es/locale/lang/ja-JP.js +3 -2
- package/es/locale/lang/ko-KR.js +3 -2
- package/es/locale/lang/pt-BR.js +3 -2
- package/es/locale/lang/ru-RU.js +3 -2
- package/es/locale/lang/uk-UA.js +3 -2
- package/es/locale/lang/vi-VN.js +3 -2
- package/es/locale/lang/zh-CHT.js +3 -2
- package/es/locale/lang/zh-CN.js +3 -2
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/edit/mixin.js +9 -4
- package/es/table/src/body.js +43 -24
- package/es/table/src/cell.js +65 -27
- package/es/table/src/column.js +3 -1
- package/es/table/src/columnInfo.js +1 -0
- package/es/table/src/methods.js +211 -14
- package/es/table/src/props.js +2 -0
- package/es/table/src/table.js +16 -1
- package/es/table/style.css +77 -2
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +4 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +77 -2
- package/es/vxe-table/style.min.css +1 -1
- package/helper/vetur/attributes.json +1 -1
- package/helper/vetur/tags.json +1 -1
- package/lib/index.umd.js +387 -78
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/en-US.js +3 -2
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +3 -2
- package/lib/locale/lang/es-ES.js +3 -2
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +3 -2
- package/lib/locale/lang/hu-HU.js +3 -2
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +3 -2
- package/lib/locale/lang/ja-JP.js +3 -2
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +3 -2
- package/lib/locale/lang/ko-KR.js +3 -2
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +3 -2
- package/lib/locale/lang/pt-BR.js +3 -2
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +3 -2
- package/lib/locale/lang/ru-RU.js +3 -2
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +3 -2
- package/lib/locale/lang/uk-UA.js +3 -2
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +3 -2
- package/lib/locale/lang/vi-VN.js +3 -2
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +3 -2
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +3 -2
- package/lib/locale/lang/zh-CN.js +3 -2
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +3 -2
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/edit/mixin.js +9 -4
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/src/body.js +41 -22
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +78 -27
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +3 -1
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +1 -0
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/methods.js +227 -14
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +2 -0
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +15 -2
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +77 -2
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +4 -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 +77 -2
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/locale/lang/en-US.ts +3 -2
- package/packages/locale/lang/es-ES.ts +3 -2
- package/packages/locale/lang/hu-HU.ts +3 -2
- package/packages/locale/lang/ja-JP.ts +3 -2
- package/packages/locale/lang/ko-KR.ts +3 -2
- package/packages/locale/lang/pt-BR.ts +3 -2
- package/packages/locale/lang/ru-RU.ts +3 -2
- package/packages/locale/lang/uk-UA.ts +3 -2
- package/packages/locale/lang/vi-VN.ts +3 -2
- package/packages/locale/lang/zh-CHT.ts +3 -2
- package/packages/locale/lang/zh-CN.ts +3 -2
- package/packages/table/module/custom/panel.ts +8 -8
- package/packages/table/module/edit/mixin.ts +10 -4
- package/packages/table/src/body.ts +43 -24
- package/packages/table/src/cell.ts +69 -27
- package/packages/table/src/column.ts +3 -1
- package/packages/table/src/columnInfo.ts +1 -0
- package/packages/table/src/methods.ts +227 -14
- package/packages/table/src/props.ts +2 -0
- package/packages/table/src/table.ts +16 -1
- package/packages/ui/index.ts +3 -0
- package/styles/components/table-module/custom.scss +14 -3
- package/styles/components/table.scss +80 -0
- /package/es/{iconfont.1730710763407.ttf → iconfont.1730898131844.ttf} +0 -0
- /package/es/{iconfont.1730710763407.woff → iconfont.1730898131844.woff} +0 -0
- /package/es/{iconfont.1730710763407.woff2 → iconfont.1730898131844.woff2} +0 -0
- /package/lib/{iconfont.1730710763407.ttf → iconfont.1730898131844.ttf} +0 -0
- /package/lib/{iconfont.1730710763407.woff → iconfont.1730898131844.woff} +0 -0
- /package/lib/{iconfont.1730710763407.woff2 → iconfont.1730898131844.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -2220,7 +2220,7 @@ function getClass(property, params) {
|
|
|
2220
2220
|
;// CONCATENATED MODULE: ./packages/ui/index.ts
|
|
2221
2221
|
|
|
2222
2222
|
|
|
2223
|
-
const version = "3.10.
|
|
2223
|
+
const version = "3.10.3";
|
|
2224
2224
|
core_.VxeUI.version = version;
|
|
2225
2225
|
core_.VxeUI.tableVersion = version;
|
|
2226
2226
|
core_.VxeUI.setConfig({
|
|
@@ -2257,6 +2257,9 @@ core_.VxeUI.setConfig({
|
|
|
2257
2257
|
// trigger: 'default'
|
|
2258
2258
|
strict: true
|
|
2259
2259
|
},
|
|
2260
|
+
dragConfig: {
|
|
2261
|
+
showRowIcon: true
|
|
2262
|
+
},
|
|
2260
2263
|
checkboxConfig: {
|
|
2261
2264
|
// trigger: 'default',
|
|
2262
2265
|
strict: true
|
|
@@ -2764,7 +2767,7 @@ function isNodeElement(elem) {
|
|
|
2764
2767
|
const {
|
|
2765
2768
|
log: log_log
|
|
2766
2769
|
} = core_.VxeUI;
|
|
2767
|
-
const log_version = `table v${"3.10.
|
|
2770
|
+
const log_version = `table v${"3.10.3"}`;
|
|
2768
2771
|
const warnLog = log_log.create('warn', log_version);
|
|
2769
2772
|
const errLog = log_log.create('error', log_version);
|
|
2770
2773
|
;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
|
|
@@ -2862,6 +2865,7 @@ class ColumnInfo {
|
|
|
2862
2865
|
filterRecoverMethod: _vm.filterRecoverMethod,
|
|
2863
2866
|
filterRender: _vm.filterRender,
|
|
2864
2867
|
treeNode: _vm.treeNode,
|
|
2868
|
+
dragSort: _vm.dragSort,
|
|
2865
2869
|
cellType: _vm.cellType,
|
|
2866
2870
|
cellRender: _vm.cellRender,
|
|
2867
2871
|
editRender: _vm.editRender,
|
|
@@ -3469,7 +3473,8 @@ const {
|
|
|
3469
3473
|
getI18n: cell_getI18n,
|
|
3470
3474
|
getIcon: cell_getIcon,
|
|
3471
3475
|
renderer: cell_renderer,
|
|
3472
|
-
formats: cell_formats
|
|
3476
|
+
formats: cell_formats,
|
|
3477
|
+
renderEmptyElement
|
|
3473
3478
|
} = core_.VxeUI;
|
|
3474
3479
|
function renderTitlePrefixIcon(h, params) {
|
|
3475
3480
|
const {
|
|
@@ -3507,6 +3512,56 @@ function renderTitleSuffixIcon(h, params) {
|
|
|
3507
3512
|
}
|
|
3508
3513
|
})] : [];
|
|
3509
3514
|
}
|
|
3515
|
+
function renderCellDragIcon(h, params) {
|
|
3516
|
+
const {
|
|
3517
|
+
$table
|
|
3518
|
+
} = params;
|
|
3519
|
+
const dragOpts = $table.computeDragOpts;
|
|
3520
|
+
const {
|
|
3521
|
+
rowDisabledMethod
|
|
3522
|
+
} = dragOpts;
|
|
3523
|
+
const isDisabled = rowDisabledMethod && rowDisabledMethod(params);
|
|
3524
|
+
return h('span', {
|
|
3525
|
+
key: 'dg',
|
|
3526
|
+
class: ['vxe-cell--drag-handle', {
|
|
3527
|
+
'is--disabled': isDisabled
|
|
3528
|
+
}],
|
|
3529
|
+
on: {
|
|
3530
|
+
mousedown(evnt) {
|
|
3531
|
+
if (!isDisabled) {
|
|
3532
|
+
$table.handleCellDragMousedownEvent(evnt, params);
|
|
3533
|
+
}
|
|
3534
|
+
},
|
|
3535
|
+
mouseup: $table.handleCellDragMouseupEvent
|
|
3536
|
+
}
|
|
3537
|
+
}, [h('i', {
|
|
3538
|
+
class: 'vxe-table-icon-drag-handle'
|
|
3539
|
+
})]);
|
|
3540
|
+
}
|
|
3541
|
+
function renderCellBaseVNs(h, params, content) {
|
|
3542
|
+
const {
|
|
3543
|
+
$table,
|
|
3544
|
+
column,
|
|
3545
|
+
row
|
|
3546
|
+
} = params;
|
|
3547
|
+
const {
|
|
3548
|
+
dragSort
|
|
3549
|
+
} = column;
|
|
3550
|
+
const vns = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(content) ? content : [content];
|
|
3551
|
+
const rowOpts = $table.computeRowOpts;
|
|
3552
|
+
const dragOpts = $table.computeDragOpts;
|
|
3553
|
+
const {
|
|
3554
|
+
showRowIcon,
|
|
3555
|
+
rowVisibleMethod
|
|
3556
|
+
} = dragOpts;
|
|
3557
|
+
if (dragSort && rowOpts.drag && showRowIcon && (!rowVisibleMethod || rowVisibleMethod({
|
|
3558
|
+
row,
|
|
3559
|
+
column
|
|
3560
|
+
}))) {
|
|
3561
|
+
vns.unshift(renderCellDragIcon(h, params));
|
|
3562
|
+
}
|
|
3563
|
+
return vns;
|
|
3564
|
+
}
|
|
3510
3565
|
function renderTitleContent(h, params, content) {
|
|
3511
3566
|
const {
|
|
3512
3567
|
$table,
|
|
@@ -3727,7 +3782,7 @@ const Cell = {
|
|
|
3727
3782
|
} = column;
|
|
3728
3783
|
const renderOpts = editRender || cellRender;
|
|
3729
3784
|
if (slots && slots.default) {
|
|
3730
|
-
return $table.callSlot(slots.default, params, h);
|
|
3785
|
+
return renderCellBaseVNs(h, params, $table.callSlot(slots.default, params, h));
|
|
3731
3786
|
}
|
|
3732
3787
|
if (renderOpts) {
|
|
3733
3788
|
const compConf = cell_renderer.get(renderOpts.name);
|
|
@@ -3735,20 +3790,20 @@ const Cell = {
|
|
|
3735
3790
|
const rtCell = compConf ? compConf.renderTableCell || compConf.renderCell : null;
|
|
3736
3791
|
const renderFn = editRender ? rtCell : rtDefault;
|
|
3737
3792
|
if (renderFn) {
|
|
3738
|
-
return getSlotVNs(renderFn.call($table, h, renderOpts, Object.assign({
|
|
3793
|
+
return renderCellBaseVNs(h, params, getSlotVNs(renderFn.call($table, h, renderOpts, Object.assign({
|
|
3739
3794
|
$type: editRender ? 'edit' : 'cell'
|
|
3740
|
-
}, params)));
|
|
3795
|
+
}, params))));
|
|
3741
3796
|
}
|
|
3742
3797
|
}
|
|
3743
3798
|
const cellValue = $table.getCellLabel(row, column);
|
|
3744
3799
|
const cellPlaceholder = editRender ? editRender.placeholder : '';
|
|
3745
|
-
return [h('span', {
|
|
3800
|
+
return renderCellBaseVNs(h, params, [h('span', {
|
|
3746
3801
|
class: 'vxe-cell--label'
|
|
3747
3802
|
}, [
|
|
3748
3803
|
// 如果设置占位符
|
|
3749
3804
|
editRender && eqEmptyValue(cellValue) ? h('span', {
|
|
3750
3805
|
class: 'vxe-cell--placeholder'
|
|
3751
|
-
}, formatText(getFuncText(cellPlaceholder), 1)) : h('span', formatText(cellValue, 1))])];
|
|
3806
|
+
}, formatText(getFuncText(cellPlaceholder), 1)) : h('span', formatText(cellValue, 1))])]);
|
|
3752
3807
|
},
|
|
3753
3808
|
renderTreeCell(h, params) {
|
|
3754
3809
|
return Cell.renderTreeIcon(h, params, Cell.renderDefaultCell.call(this, h, params));
|
|
@@ -3858,13 +3913,13 @@ const Cell = {
|
|
|
3858
3913
|
slots
|
|
3859
3914
|
} = column;
|
|
3860
3915
|
if (slots && slots.default) {
|
|
3861
|
-
return $table.callSlot(slots.default, params, h);
|
|
3916
|
+
return renderCellBaseVNs(h, params, $table.callSlot(slots.default, params, h));
|
|
3862
3917
|
}
|
|
3863
3918
|
const {
|
|
3864
3919
|
seq
|
|
3865
3920
|
} = params;
|
|
3866
3921
|
const seqMethod = seqOpts.seqMethod;
|
|
3867
|
-
return [formatText(seqMethod ? seqMethod(params) : treeConfig ? seq : (seqOpts.startIndex || 0) + seq, 1)];
|
|
3922
|
+
return renderCellBaseVNs(h, params, [h('span', `${formatText(seqMethod ? seqMethod(params) : treeConfig ? seq : (seqOpts.startIndex || 0) + seq, 1)}`)]);
|
|
3868
3923
|
},
|
|
3869
3924
|
renderTreeIndexCell(h, params) {
|
|
3870
3925
|
return Cell.renderTreeIcon(h, params, Cell.renderSeqCell(h, params));
|
|
@@ -3936,7 +3991,7 @@ const Cell = {
|
|
|
3936
3991
|
visible: isVisible
|
|
3937
3992
|
};
|
|
3938
3993
|
if (radioSlot) {
|
|
3939
|
-
return $table.callSlot(radioSlot, radioParams, h);
|
|
3994
|
+
return renderCellBaseVNs(h, params, $table.callSlot(radioSlot, radioParams, h));
|
|
3940
3995
|
}
|
|
3941
3996
|
const radioVNs = [];
|
|
3942
3997
|
if (isVisible) {
|
|
@@ -3949,13 +4004,13 @@ const Cell = {
|
|
|
3949
4004
|
class: 'vxe-radio--label'
|
|
3950
4005
|
}, defaultSlot ? $table.callSlot(defaultSlot, radioParams, h) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, labelField)));
|
|
3951
4006
|
}
|
|
3952
|
-
return [h('span', {
|
|
4007
|
+
return renderCellBaseVNs(h, params, [h('span', {
|
|
3953
4008
|
class: ['vxe-cell--radio', {
|
|
3954
4009
|
'is--checked': isChecked,
|
|
3955
4010
|
'is--disabled': isDisabled
|
|
3956
4011
|
}],
|
|
3957
4012
|
on
|
|
3958
|
-
}, radioVNs)];
|
|
4013
|
+
}, radioVNs)]);
|
|
3959
4014
|
},
|
|
3960
4015
|
renderTreeRadioCell(h, params) {
|
|
3961
4016
|
return Cell.renderTreeIcon(h, params, Cell.renderRadioCell(h, params));
|
|
@@ -4077,7 +4132,7 @@ const Cell = {
|
|
|
4077
4132
|
indeterminate
|
|
4078
4133
|
};
|
|
4079
4134
|
if (checkboxSlot) {
|
|
4080
|
-
return $table.callSlot(checkboxSlot, checkboxParams, h);
|
|
4135
|
+
return renderCellBaseVNs(h, params, $table.callSlot(checkboxSlot, checkboxParams, h));
|
|
4081
4136
|
}
|
|
4082
4137
|
const checkVNs = [];
|
|
4083
4138
|
if (isVisible) {
|
|
@@ -4090,7 +4145,7 @@ const Cell = {
|
|
|
4090
4145
|
class: 'vxe-checkbox--label'
|
|
4091
4146
|
}, defaultSlot ? $table.callSlot(defaultSlot, checkboxParams, h) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, labelField)));
|
|
4092
4147
|
}
|
|
4093
|
-
return [h('span', {
|
|
4148
|
+
return renderCellBaseVNs(h, params, [h('span', {
|
|
4094
4149
|
class: ['vxe-cell--checkbox', {
|
|
4095
4150
|
'is--checked': isChecked,
|
|
4096
4151
|
'is--disabled': isDisabled,
|
|
@@ -4098,7 +4153,7 @@ const Cell = {
|
|
|
4098
4153
|
'is--hidden': !isVisible
|
|
4099
4154
|
}],
|
|
4100
4155
|
on
|
|
4101
|
-
}, checkVNs)];
|
|
4156
|
+
}, checkVNs)]);
|
|
4102
4157
|
},
|
|
4103
4158
|
renderTreeSelectionCell(h, params) {
|
|
4104
4159
|
return Cell.renderTreeIcon(h, params, Cell.renderCheckboxCell(h, params));
|
|
@@ -4161,7 +4216,7 @@ const Cell = {
|
|
|
4161
4216
|
indeterminate: isIndeterminate
|
|
4162
4217
|
};
|
|
4163
4218
|
if (checkboxSlot) {
|
|
4164
|
-
return $table.callSlot(checkboxSlot, checkboxParams, h);
|
|
4219
|
+
return renderCellBaseVNs(h, params, $table.callSlot(checkboxSlot, checkboxParams, h));
|
|
4165
4220
|
}
|
|
4166
4221
|
const checkVNs = [];
|
|
4167
4222
|
if (isVisible) {
|
|
@@ -4174,7 +4229,7 @@ const Cell = {
|
|
|
4174
4229
|
class: 'vxe-checkbox--label'
|
|
4175
4230
|
}, defaultSlot ? $table.callSlot(defaultSlot, checkboxParams, h) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, labelField)));
|
|
4176
4231
|
}
|
|
4177
|
-
return [h('span', {
|
|
4232
|
+
return renderCellBaseVNs(h, params, [h('span', {
|
|
4178
4233
|
class: ['vxe-cell--checkbox', {
|
|
4179
4234
|
'is--checked': isChecked,
|
|
4180
4235
|
'is--disabled': isDisabled,
|
|
@@ -4182,7 +4237,7 @@ const Cell = {
|
|
|
4182
4237
|
'is--hidden': !isVisible
|
|
4183
4238
|
}],
|
|
4184
4239
|
on
|
|
4185
|
-
}, checkVNs)];
|
|
4240
|
+
}, checkVNs)]);
|
|
4186
4241
|
},
|
|
4187
4242
|
renderTreeSelectionCellByProp(h, params) {
|
|
4188
4243
|
return Cell.renderTreeIcon(h, params, Cell.renderCheckboxCellByProp(h, params));
|
|
@@ -4218,7 +4273,7 @@ const Cell = {
|
|
|
4218
4273
|
let isAceived = false;
|
|
4219
4274
|
let isLazyLoading = false;
|
|
4220
4275
|
if (slots && slots.icon) {
|
|
4221
|
-
return $table.callSlot(slots.icon, params, h);
|
|
4276
|
+
return renderCellBaseVNs(h, params, $table.callSlot(slots.icon, params, h));
|
|
4222
4277
|
}
|
|
4223
4278
|
if (!isHidden) {
|
|
4224
4279
|
const rowid = getRowid($table, row);
|
|
@@ -4227,7 +4282,7 @@ const Cell = {
|
|
|
4227
4282
|
isLazyLoading = !!rowExpandLazyLoadedMaps[rowid];
|
|
4228
4283
|
}
|
|
4229
4284
|
}
|
|
4230
|
-
return [showIcon && (!visibleMethod || visibleMethod(params)) ? h('span', {
|
|
4285
|
+
return renderCellBaseVNs(h, params, [showIcon && (!visibleMethod || visibleMethod(params)) ? h('span', {
|
|
4231
4286
|
class: ['vxe-table--expanded', {
|
|
4232
4287
|
'is--active': isAceived
|
|
4233
4288
|
}],
|
|
@@ -4238,9 +4293,9 @@ const Cell = {
|
|
|
4238
4293
|
}
|
|
4239
4294
|
}, [h('i', {
|
|
4240
4295
|
class: ['vxe-table--expand-btn', isLazyLoading ? iconLoaded || cell_getIcon().TABLE_EXPAND_LOADED : isAceived ? iconOpen || cell_getIcon().TABLE_EXPAND_OPEN : iconClose || cell_getIcon().TABLE_EXPAND_CLOSE]
|
|
4241
|
-
})]) :
|
|
4296
|
+
})]) : renderEmptyElement($table), defaultSlot || labelField ? h('span', {
|
|
4242
4297
|
class: 'vxe-table--expand-label'
|
|
4243
|
-
}, defaultSlot ? $table.callSlot(defaultSlot, params, h) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, labelField)) :
|
|
4298
|
+
}, defaultSlot ? $table.callSlot(defaultSlot, params, h) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, labelField)) : renderEmptyElement($table)]);
|
|
4244
4299
|
},
|
|
4245
4300
|
renderExpandData(h, params) {
|
|
4246
4301
|
const {
|
|
@@ -4275,14 +4330,14 @@ const Cell = {
|
|
|
4275
4330
|
slots
|
|
4276
4331
|
} = column;
|
|
4277
4332
|
if (slots && slots.default) {
|
|
4278
|
-
return $table.callSlot(slots.default, params, h);
|
|
4333
|
+
return renderCellBaseVNs(h, params, $table.callSlot(slots.default, params, h));
|
|
4279
4334
|
}
|
|
4280
|
-
return [h('span', {
|
|
4335
|
+
return renderCellBaseVNs(h, params, [h('span', {
|
|
4281
4336
|
class: 'vxe-cell--html',
|
|
4282
4337
|
domProps: {
|
|
4283
4338
|
innerHTML: getDefaultCellLabel(params)
|
|
4284
4339
|
}
|
|
4285
|
-
})];
|
|
4340
|
+
})]);
|
|
4286
4341
|
},
|
|
4287
4342
|
renderTreeHTMLCell(h, params) {
|
|
4288
4343
|
return Cell.renderTreeIcon(h, params, Cell.renderHTMLCell(h, params));
|
|
@@ -4471,12 +4526,12 @@ const Cell = {
|
|
|
4471
4526
|
return [];
|
|
4472
4527
|
}
|
|
4473
4528
|
if (slots && slots.default) {
|
|
4474
|
-
return $table.callSlot(slots.default, cellParams, h);
|
|
4529
|
+
return renderCellBaseVNs(h, params, $table.callSlot(slots.default, cellParams, h));
|
|
4475
4530
|
}
|
|
4476
4531
|
if (formatter) {
|
|
4477
|
-
return [h('span', {
|
|
4532
|
+
return renderCellBaseVNs(h, params, [h('span', {
|
|
4478
4533
|
class: 'vxe-cell--label'
|
|
4479
|
-
}, [getDefaultCellLabel(cellParams)])];
|
|
4534
|
+
}, [getDefaultCellLabel(cellParams)])]);
|
|
4480
4535
|
}
|
|
4481
4536
|
return Cell.renderDefaultCell.call(_vm, h, cellParams);
|
|
4482
4537
|
}
|
|
@@ -4569,8 +4624,10 @@ const props = {
|
|
|
4569
4624
|
filterRecoverMethod: Function,
|
|
4570
4625
|
// 筛选模板配置项
|
|
4571
4626
|
filterRender: Object,
|
|
4572
|
-
//
|
|
4627
|
+
// 设置为树节点
|
|
4573
4628
|
treeNode: Boolean,
|
|
4629
|
+
// 设置为拖拽排序
|
|
4630
|
+
dragSort: Boolean,
|
|
4574
4631
|
// 是否可视
|
|
4575
4632
|
visible: {
|
|
4576
4633
|
type: Boolean,
|
|
@@ -5077,6 +5134,51 @@ function getOrderField(_vm, column) {
|
|
|
5077
5134
|
return cellValue;
|
|
5078
5135
|
};
|
|
5079
5136
|
}
|
|
5137
|
+
function clearRowDropOrigin($xeTable) {
|
|
5138
|
+
const el = $xeTable.$el;
|
|
5139
|
+
if (el) {
|
|
5140
|
+
const clss = 'row--drag-origin';
|
|
5141
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`.${clss}`), elem => {
|
|
5142
|
+
elem.draggable = false;
|
|
5143
|
+
removeClass(elem, clss);
|
|
5144
|
+
});
|
|
5145
|
+
}
|
|
5146
|
+
}
|
|
5147
|
+
function clearRowDropTarget($xeTable) {
|
|
5148
|
+
const el = $xeTable.$el;
|
|
5149
|
+
if (el) {
|
|
5150
|
+
const clss = 'row--drag-active-target';
|
|
5151
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`.${clss}`), elem => {
|
|
5152
|
+
removeClass(elem, clss);
|
|
5153
|
+
});
|
|
5154
|
+
}
|
|
5155
|
+
}
|
|
5156
|
+
function showRowDropTip(evnt, $xeTable) {
|
|
5157
|
+
const rdTipEl = $xeTable.$refs.refRowDragTipElem;
|
|
5158
|
+
if (!rdTipEl) {
|
|
5159
|
+
return;
|
|
5160
|
+
}
|
|
5161
|
+
const el = $xeTable.$el;
|
|
5162
|
+
if (!el) {
|
|
5163
|
+
return;
|
|
5164
|
+
}
|
|
5165
|
+
if (rdTipEl) {
|
|
5166
|
+
const wrapperRect = el.getBoundingClientRect();
|
|
5167
|
+
rdTipEl.style.display = 'block';
|
|
5168
|
+
rdTipEl.style.top = `${Math.min(el.clientHeight - el.scrollTop - rdTipEl.clientHeight, evnt.clientY - wrapperRect.y)}px`;
|
|
5169
|
+
rdTipEl.style.left = `${Math.min(el.clientWidth - el.scrollLeft - rdTipEl.clientWidth - 16, evnt.clientX - wrapperRect.x)}px`;
|
|
5170
|
+
}
|
|
5171
|
+
}
|
|
5172
|
+
const hideRowDropTip = $xeTable => {
|
|
5173
|
+
const rdTipEl = $xeTable.$refs.refRowDragTipElem;
|
|
5174
|
+
if (rdTipEl) {
|
|
5175
|
+
rdTipEl.style.display = '';
|
|
5176
|
+
}
|
|
5177
|
+
};
|
|
5178
|
+
const updateRowDropTipContent = ($xeTable, tdEl) => {
|
|
5179
|
+
const reactData = $xeTable;
|
|
5180
|
+
reactData.dragTipText = tdEl.textContent || '';
|
|
5181
|
+
};
|
|
5080
5182
|
const Methods = {
|
|
5081
5183
|
callSlot(slotFunc, params, h, vNodes) {
|
|
5082
5184
|
if (slotFunc) {
|
|
@@ -10135,6 +10237,160 @@ const Methods = {
|
|
|
10135
10237
|
this.emitEvent('sort-change', params, evnt);
|
|
10136
10238
|
}
|
|
10137
10239
|
},
|
|
10240
|
+
handleRowDragDragstartEvent(evnt) {
|
|
10241
|
+
const img = new Image();
|
|
10242
|
+
if (evnt.dataTransfer) {
|
|
10243
|
+
evnt.dataTransfer.setDragImage(img, 0, 0);
|
|
10244
|
+
}
|
|
10245
|
+
},
|
|
10246
|
+
handleRowDragDragendEvent(evnt) {
|
|
10247
|
+
const $xeTable = this;
|
|
10248
|
+
const props = $xeTable;
|
|
10249
|
+
const reactData = $xeTable;
|
|
10250
|
+
const internalData = $xeTable;
|
|
10251
|
+
const {
|
|
10252
|
+
treeConfig
|
|
10253
|
+
} = props;
|
|
10254
|
+
const dragOpts = $xeTable.computeDragOpts;
|
|
10255
|
+
const {
|
|
10256
|
+
dragEndMethod
|
|
10257
|
+
} = dragOpts;
|
|
10258
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
10259
|
+
const {
|
|
10260
|
+
transform
|
|
10261
|
+
} = treeOpts;
|
|
10262
|
+
const {
|
|
10263
|
+
dragRow
|
|
10264
|
+
} = reactData;
|
|
10265
|
+
const {
|
|
10266
|
+
afterFullData,
|
|
10267
|
+
tableFullData,
|
|
10268
|
+
prevDragRow,
|
|
10269
|
+
prevDragPos
|
|
10270
|
+
} = internalData;
|
|
10271
|
+
if (prevDragRow && dragRow) {
|
|
10272
|
+
// 判断是否有拖动
|
|
10273
|
+
if (prevDragRow !== dragRow) {
|
|
10274
|
+
Promise.resolve(dragEndMethod ? dragEndMethod({
|
|
10275
|
+
oldRow: dragRow,
|
|
10276
|
+
newRow: prevDragRow
|
|
10277
|
+
}) : true).then(status => {
|
|
10278
|
+
if (!status) {
|
|
10279
|
+
return;
|
|
10280
|
+
}
|
|
10281
|
+
const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
|
|
10282
|
+
// 移出源位置
|
|
10283
|
+
const oafIndex = $xeTable.findRowIndexOf(afterFullData, dragRow);
|
|
10284
|
+
const otfIndex = $xeTable.findRowIndexOf(tableFullData, dragRow);
|
|
10285
|
+
afterFullData.splice(oafIndex, 1);
|
|
10286
|
+
tableFullData.splice(otfIndex, 1);
|
|
10287
|
+
// 插新位置
|
|
10288
|
+
const pafIndex = $xeTable.findRowIndexOf(afterFullData, prevDragRow);
|
|
10289
|
+
const ptfIndex = $xeTable.findRowIndexOf(tableFullData, prevDragRow);
|
|
10290
|
+
const nafIndex = pafIndex + dragOffsetIndex;
|
|
10291
|
+
const ntfIndex = ptfIndex + dragOffsetIndex;
|
|
10292
|
+
afterFullData.splice(nafIndex, 0, dragRow);
|
|
10293
|
+
tableFullData.splice(ntfIndex, 0, dragRow);
|
|
10294
|
+
reactData.isDragRowMove = true;
|
|
10295
|
+
$xeTable.cacheRowMap();
|
|
10296
|
+
$xeTable.updateScrollYStatus();
|
|
10297
|
+
$xeTable.handleTableData(treeConfig && transform);
|
|
10298
|
+
if (!(treeConfig && transform)) {
|
|
10299
|
+
$xeTable.updateAfterDataIndex();
|
|
10300
|
+
}
|
|
10301
|
+
$xeTable.updateFooter();
|
|
10302
|
+
$xeTable.checkSelectionStatus();
|
|
10303
|
+
if (reactData.scrollYLoad) {
|
|
10304
|
+
$xeTable.updateScrollYSpace();
|
|
10305
|
+
}
|
|
10306
|
+
$xeTable.$nextTick().then(() => {
|
|
10307
|
+
$xeTable.updateCellAreas();
|
|
10308
|
+
return $xeTable.recalculate();
|
|
10309
|
+
});
|
|
10310
|
+
$xeTable.dispatchEvent('row-dragend', {
|
|
10311
|
+
oldRow: dragRow,
|
|
10312
|
+
newRow: prevDragRow,
|
|
10313
|
+
_index: {
|
|
10314
|
+
newIndex: nafIndex,
|
|
10315
|
+
oldIndex: oafIndex
|
|
10316
|
+
}
|
|
10317
|
+
}, evnt);
|
|
10318
|
+
}).catch(() => {});
|
|
10319
|
+
}
|
|
10320
|
+
}
|
|
10321
|
+
hideRowDropTip($xeTable);
|
|
10322
|
+
clearRowDropOrigin($xeTable);
|
|
10323
|
+
clearRowDropTarget($xeTable);
|
|
10324
|
+
reactData.dragRow = null;
|
|
10325
|
+
setTimeout(() => {
|
|
10326
|
+
reactData.isDragRowMove = false;
|
|
10327
|
+
}, 500);
|
|
10328
|
+
},
|
|
10329
|
+
handleRowDragDragoverEvent(evnt) {
|
|
10330
|
+
const $xeTable = this;
|
|
10331
|
+
const internalData = $xeTable;
|
|
10332
|
+
const reactData = $xeTable;
|
|
10333
|
+
const trEl = evnt.currentTarget;
|
|
10334
|
+
const rowid = trEl.getAttribute('rowid');
|
|
10335
|
+
const row = $xeTable.getRowById(rowid);
|
|
10336
|
+
clearRowDropTarget($xeTable);
|
|
10337
|
+
if (row) {
|
|
10338
|
+
evnt.preventDefault();
|
|
10339
|
+
evnt.preventDefault();
|
|
10340
|
+
const {
|
|
10341
|
+
dragRow
|
|
10342
|
+
} = reactData;
|
|
10343
|
+
const offsetY = evnt.clientY - trEl.getBoundingClientRect().y;
|
|
10344
|
+
const dragPos = offsetY < trEl.clientHeight / 2 ? 'top' : 'bottom';
|
|
10345
|
+
addClass(trEl, 'row--drag-active-target');
|
|
10346
|
+
trEl.setAttribute('drag-pos', dragPos);
|
|
10347
|
+
internalData.prevDragRow = row;
|
|
10348
|
+
internalData.prevDragPos = dragPos;
|
|
10349
|
+
$xeTable.dispatchEvent('row-dragover', {
|
|
10350
|
+
oldRow: dragRow,
|
|
10351
|
+
targetRow: row,
|
|
10352
|
+
dragPos
|
|
10353
|
+
}, evnt);
|
|
10354
|
+
}
|
|
10355
|
+
showRowDropTip(evnt, $xeTable);
|
|
10356
|
+
},
|
|
10357
|
+
handleCellDragMousedownEvent(evnt, params) {
|
|
10358
|
+
const $xeTable = this;
|
|
10359
|
+
const reactData = $xeTable;
|
|
10360
|
+
evnt.stopPropagation();
|
|
10361
|
+
const dragOpts = $xeTable.computeDragOpts;
|
|
10362
|
+
const {
|
|
10363
|
+
dragStartMethod
|
|
10364
|
+
} = dragOpts;
|
|
10365
|
+
const {
|
|
10366
|
+
row
|
|
10367
|
+
} = params;
|
|
10368
|
+
const dragEl = evnt.currentTarget;
|
|
10369
|
+
const tdEl = dragEl.parentNode?.parentNode;
|
|
10370
|
+
const trEl = tdEl.parentNode;
|
|
10371
|
+
reactData.isDragRowMove = false;
|
|
10372
|
+
clearRowDropOrigin($xeTable);
|
|
10373
|
+
if (dragStartMethod && !dragStartMethod(params)) {
|
|
10374
|
+
trEl.draggable = false;
|
|
10375
|
+
reactData.dragRow = null;
|
|
10376
|
+
hideRowDropTip($xeTable);
|
|
10377
|
+
return;
|
|
10378
|
+
}
|
|
10379
|
+
reactData.dragRow = row;
|
|
10380
|
+
trEl.draggable = true;
|
|
10381
|
+
addClass(trEl, 'row--drag-origin');
|
|
10382
|
+
showRowDropTip(evnt, $xeTable);
|
|
10383
|
+
updateRowDropTipContent($xeTable, tdEl);
|
|
10384
|
+
$xeTable.dispatchEvent('row-dragstart', params, evnt);
|
|
10385
|
+
},
|
|
10386
|
+
handleCellDragMouseupEvent() {
|
|
10387
|
+
const $xeTable = this;
|
|
10388
|
+
const reactData = $xeTable;
|
|
10389
|
+
clearRowDropOrigin($xeTable);
|
|
10390
|
+
hideRowDropTip($xeTable);
|
|
10391
|
+
reactData.dragRow = null;
|
|
10392
|
+
reactData.isDragRowMove = false;
|
|
10393
|
+
},
|
|
10138
10394
|
setPendingRow(rows, status) {
|
|
10139
10395
|
const pendingMaps = {
|
|
10140
10396
|
...this.pendingRowMaps
|
|
@@ -11234,7 +11490,7 @@ const Methods = {
|
|
|
11234
11490
|
const bodyWidth = bodyElem ? bodyElem.clientWidth : 0;
|
|
11235
11491
|
const scrollHeight = bodyElem ? bodyElem.scrollHeight : 0;
|
|
11236
11492
|
const scrollWidth = bodyElem ? bodyElem.scrollWidth : 0;
|
|
11237
|
-
|
|
11493
|
+
const evntParams = {
|
|
11238
11494
|
bodyHeight,
|
|
11239
11495
|
bodyWidth,
|
|
11240
11496
|
scrollHeight,
|
|
@@ -11242,7 +11498,8 @@ const Methods = {
|
|
|
11242
11498
|
isX: isRollX,
|
|
11243
11499
|
isY: isRollY,
|
|
11244
11500
|
...params
|
|
11245
|
-
}
|
|
11501
|
+
};
|
|
11502
|
+
$xeTable.dispatchEvent('scroll', evntParams, evnt);
|
|
11246
11503
|
},
|
|
11247
11504
|
/**
|
|
11248
11505
|
* 纵向 Y 可视渲染事件处理
|
|
@@ -11270,15 +11527,23 @@ const Methods = {
|
|
|
11270
11527
|
leading: false,
|
|
11271
11528
|
trailing: true
|
|
11272
11529
|
}),
|
|
11273
|
-
|
|
11530
|
+
handleSyncScrollX(scrollLeft) {
|
|
11274
11531
|
const $xeTable = this;
|
|
11275
|
-
const wrapperEl = evnt.currentTarget;
|
|
11276
11532
|
const tableHeader = $xeTable.$refs.tableHeader;
|
|
11277
11533
|
const tableBody = $xeTable.$refs.tableBody;
|
|
11278
11534
|
const tableFooter = $xeTable.$refs.tableFooter;
|
|
11279
11535
|
const bodyElem = tableBody.$el;
|
|
11280
11536
|
const headerElem = tableHeader ? tableHeader.$el : null;
|
|
11281
11537
|
const footerElem = tableFooter ? tableFooter.$el : null;
|
|
11538
|
+
$xeTable.lastScrollLeft = scrollLeft;
|
|
11539
|
+
$xeTable.lastScrollTime = Date.now();
|
|
11540
|
+
setScrollLeft(bodyElem, scrollLeft);
|
|
11541
|
+
setScrollLeft(headerElem, scrollLeft);
|
|
11542
|
+
setScrollLeft(footerElem, scrollLeft);
|
|
11543
|
+
},
|
|
11544
|
+
scrollXEvent(evnt) {
|
|
11545
|
+
const $xeTable = this;
|
|
11546
|
+
const wrapperEl = evnt.currentTarget;
|
|
11282
11547
|
const {
|
|
11283
11548
|
scrollTop,
|
|
11284
11549
|
scrollLeft
|
|
@@ -11287,9 +11552,7 @@ const Methods = {
|
|
|
11287
11552
|
const isRollY = false;
|
|
11288
11553
|
$xeTable.lastScrollLeft = scrollLeft;
|
|
11289
11554
|
$xeTable.lastScrollTime = Date.now();
|
|
11290
|
-
|
|
11291
|
-
setScrollLeft(headerElem, scrollLeft);
|
|
11292
|
-
setScrollLeft(footerElem, scrollLeft);
|
|
11555
|
+
$xeTable.handleSyncScrollX(scrollLeft);
|
|
11293
11556
|
$xeTable.triggerScrollXEvent(evnt);
|
|
11294
11557
|
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, {
|
|
11295
11558
|
type: 'table',
|
|
@@ -11304,15 +11567,23 @@ const Methods = {
|
|
|
11304
11567
|
leading: false,
|
|
11305
11568
|
trailing: true
|
|
11306
11569
|
}),
|
|
11307
|
-
|
|
11570
|
+
handleSyncScrollY(scrollTop) {
|
|
11308
11571
|
const $xeTable = this;
|
|
11309
|
-
const wrapperEl = evnt.currentTarget;
|
|
11310
11572
|
const tableBody = $xeTable.$refs.tableBody;
|
|
11311
11573
|
const leftBody = $xeTable.$refs.leftBody;
|
|
11312
11574
|
const rightBody = $xeTable.$refs.rightBody;
|
|
11313
11575
|
const bodyElem = tableBody.$el;
|
|
11314
11576
|
const leftElem = leftBody ? leftBody.$el : null;
|
|
11315
11577
|
const rightElem = rightBody ? rightBody.$el : null;
|
|
11578
|
+
$xeTable.lastScrollTop = scrollTop;
|
|
11579
|
+
$xeTable.lastScrollTime = Date.now();
|
|
11580
|
+
setScrollTop(bodyElem, scrollTop);
|
|
11581
|
+
setScrollTop(leftElem, scrollTop);
|
|
11582
|
+
setScrollTop(rightElem, scrollTop);
|
|
11583
|
+
},
|
|
11584
|
+
scrollYEvent(evnt) {
|
|
11585
|
+
const $xeTable = this;
|
|
11586
|
+
const wrapperEl = evnt.currentTarget;
|
|
11316
11587
|
const {
|
|
11317
11588
|
scrollTop,
|
|
11318
11589
|
scrollLeft
|
|
@@ -11321,9 +11592,7 @@ const Methods = {
|
|
|
11321
11592
|
const isRollY = true;
|
|
11322
11593
|
$xeTable.lastScrollTop = scrollTop;
|
|
11323
11594
|
$xeTable.lastScrollTime = Date.now();
|
|
11324
|
-
|
|
11325
|
-
setScrollTop(leftElem, scrollTop);
|
|
11326
|
-
setScrollTop(rightElem, scrollTop);
|
|
11595
|
+
$xeTable.handleSyncScrollY(scrollTop);
|
|
11327
11596
|
$xeTable.triggerScrollYEvent(evnt);
|
|
11328
11597
|
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, {
|
|
11329
11598
|
type: 'table',
|
|
@@ -11438,7 +11707,7 @@ const Methods = {
|
|
|
11438
11707
|
},
|
|
11439
11708
|
updateScrollXData() {
|
|
11440
11709
|
// this.tableColumn = []
|
|
11441
|
-
this.$nextTick(() => {
|
|
11710
|
+
return this.$nextTick().then(() => {
|
|
11442
11711
|
this.handleTableColumn();
|
|
11443
11712
|
this.updateScrollXSpace();
|
|
11444
11713
|
});
|
|
@@ -11500,7 +11769,7 @@ const Methods = {
|
|
|
11500
11769
|
updateScrollYData() {
|
|
11501
11770
|
const $xeTable = this;
|
|
11502
11771
|
// this.tableData = []
|
|
11503
|
-
this.$nextTick(() => {
|
|
11772
|
+
return this.$nextTick().then(() => {
|
|
11504
11773
|
this.handleTableData();
|
|
11505
11774
|
calcCellHeight($xeTable);
|
|
11506
11775
|
this.updateScrollYSpace();
|
|
@@ -12299,7 +12568,7 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
|
|
|
12299
12568
|
'col--valid-error': !!errorValidItem,
|
|
12300
12569
|
'col--current': currentColumn === column
|
|
12301
12570
|
}, getClass(compCellClassName, params), getClass(className, params), getClass(allCellClassName, params)],
|
|
12302
|
-
key: columnKey || columnOpts.useKey ? column.id : $columnIndex,
|
|
12571
|
+
key: columnKey || columnOpts.useKey || rowOpts.useKey ? column.id : $columnIndex,
|
|
12303
12572
|
attrs,
|
|
12304
12573
|
style: Object.assign({
|
|
12305
12574
|
height: cellHeight
|
|
@@ -12307,7 +12576,7 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
|
|
|
12307
12576
|
on: tdOns
|
|
12308
12577
|
}, tdVNs);
|
|
12309
12578
|
}
|
|
12310
|
-
function renderRows(h, _vm, $
|
|
12579
|
+
function renderRows(h, _vm, $xeTable, fixedType, tableData, tableColumn) {
|
|
12311
12580
|
const {
|
|
12312
12581
|
stripe,
|
|
12313
12582
|
rowKey,
|
|
@@ -12331,39 +12600,51 @@ function renderRows(h, _vm, $xetable, fixedType, tableData, tableColumn) {
|
|
|
12331
12600
|
rowOpts,
|
|
12332
12601
|
pendingRowList,
|
|
12333
12602
|
pendingRowMaps
|
|
12334
|
-
} = $
|
|
12603
|
+
} = $xeTable;
|
|
12335
12604
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
12336
12605
|
const rows = [];
|
|
12337
12606
|
tableData.forEach((row, $rowIndex) => {
|
|
12338
12607
|
const trOn = {};
|
|
12339
12608
|
let rowIndex = $rowIndex;
|
|
12340
|
-
const _rowIndex = $
|
|
12609
|
+
const _rowIndex = $xeTable.getVTRowIndex(row);
|
|
12341
12610
|
// 确保任何情况下 rowIndex 都精准指向真实 data 索引
|
|
12342
|
-
rowIndex = $
|
|
12343
|
-
//
|
|
12611
|
+
rowIndex = $xeTable.getRowIndex(row);
|
|
12612
|
+
// 当前行事件
|
|
12344
12613
|
if (rowOpts.isHover || highlightHoverRow) {
|
|
12345
12614
|
trOn.mouseenter = evnt => {
|
|
12346
|
-
if (isVMScrollProcess($
|
|
12615
|
+
if (isVMScrollProcess($xeTable)) {
|
|
12347
12616
|
return;
|
|
12348
12617
|
}
|
|
12349
|
-
$
|
|
12618
|
+
$xeTable.triggerHoverEvent(evnt, {
|
|
12350
12619
|
row,
|
|
12351
12620
|
rowIndex
|
|
12352
12621
|
});
|
|
12353
12622
|
};
|
|
12354
12623
|
trOn.mouseleave = () => {
|
|
12355
|
-
if (isVMScrollProcess($
|
|
12624
|
+
if (isVMScrollProcess($xeTable)) {
|
|
12356
12625
|
return;
|
|
12357
12626
|
}
|
|
12358
|
-
$
|
|
12627
|
+
$xeTable.clearHoverRow();
|
|
12628
|
+
};
|
|
12629
|
+
}
|
|
12630
|
+
// 拖拽行事件
|
|
12631
|
+
if (rowOpts.drag) {
|
|
12632
|
+
trOn.dragstart = evnt => {
|
|
12633
|
+
$xeTable.handleRowDragDragstartEvent(evnt);
|
|
12634
|
+
};
|
|
12635
|
+
trOn.dragover = evnt => {
|
|
12636
|
+
$xeTable.handleRowDragDragoverEvent(evnt);
|
|
12637
|
+
};
|
|
12638
|
+
trOn.dragend = evnt => {
|
|
12639
|
+
$xeTable.handleRowDragDragendEvent(evnt);
|
|
12359
12640
|
};
|
|
12360
12641
|
}
|
|
12361
|
-
const rowid = getRowid($
|
|
12642
|
+
const rowid = getRowid($xeTable, row);
|
|
12362
12643
|
const rest = fullAllDataRowIdData[rowid];
|
|
12363
12644
|
const rowLevel = rest ? rest.level : 0;
|
|
12364
12645
|
const seq = rest ? rest.seq : -1;
|
|
12365
12646
|
const params = {
|
|
12366
|
-
$table: $
|
|
12647
|
+
$table: $xeTable,
|
|
12367
12648
|
seq,
|
|
12368
12649
|
rowid,
|
|
12369
12650
|
fixed: fixedType,
|
|
@@ -12381,7 +12662,7 @@ function renderRows(h, _vm, $xetable, fixedType, tableData, tableColumn) {
|
|
|
12381
12662
|
// 是否新增行
|
|
12382
12663
|
let isNewRow = false;
|
|
12383
12664
|
if (editConfig) {
|
|
12384
|
-
isNewRow = $
|
|
12665
|
+
isNewRow = $xeTable.isInsertByRow(row);
|
|
12385
12666
|
}
|
|
12386
12667
|
if (treeConfig && !scrollYLoad && !treeOpts.transform) {
|
|
12387
12668
|
rowChildren = row[childrenField];
|
|
@@ -12389,23 +12670,23 @@ function renderRows(h, _vm, $xetable, fixedType, tableData, tableColumn) {
|
|
|
12389
12670
|
}
|
|
12390
12671
|
rows.push(h('tr', {
|
|
12391
12672
|
class: ['vxe-body--row', treeConfig ? `row--level-${rowLevel}` : '', {
|
|
12392
|
-
'row--stripe': stripe && ($
|
|
12673
|
+
'row--stripe': stripe && ($xeTable.getVTRowIndex(row) + 1) % 2 === 0,
|
|
12393
12674
|
'is--new': isNewRow,
|
|
12394
12675
|
'is--expand-row': isExpandRow,
|
|
12395
12676
|
'is--expand-tree': isExpandTree,
|
|
12396
12677
|
'row--new': isNewRow && (editOpts.showStatus || editOpts.showInsertStatus),
|
|
12397
|
-
'row--radio': radioOpts.highlight && $
|
|
12398
|
-
'row--checked': checkboxOpts.highlight && $
|
|
12678
|
+
'row--radio': radioOpts.highlight && $xeTable.selectRadioRow === row,
|
|
12679
|
+
'row--checked': checkboxOpts.highlight && $xeTable.isCheckedByCheckboxRow(row),
|
|
12399
12680
|
'row--pending': pendingRowList.length && !!pendingRowMaps[rowid]
|
|
12400
12681
|
}, rowClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(rowClassName) ? rowClassName(params) : rowClassName : ''],
|
|
12401
12682
|
attrs: {
|
|
12402
12683
|
rowid
|
|
12403
12684
|
},
|
|
12404
12685
|
style: rowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(rowStyle) ? rowStyle(params) : rowStyle : null,
|
|
12405
|
-
key: rowKey || rowOpts.useKey || treeConfig ? rowid : $rowIndex,
|
|
12686
|
+
key: rowKey || rowOpts.useKey || rowOpts.drag || treeConfig ? rowid : $rowIndex,
|
|
12406
12687
|
on: trOn
|
|
12407
12688
|
}, tableColumn.map((column, $columnIndex) => {
|
|
12408
|
-
return renderColumn(h, _vm, $
|
|
12689
|
+
return renderColumn(h, _vm, $xeTable, seq, rowid, fixedType, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData);
|
|
12409
12690
|
})));
|
|
12410
12691
|
// 如果行被展开了
|
|
12411
12692
|
if (isExpandRow) {
|
|
@@ -12425,7 +12706,7 @@ function renderRows(h, _vm, $xetable, fixedType, tableData, tableColumn) {
|
|
|
12425
12706
|
} = expandColumn;
|
|
12426
12707
|
const hasEllipsis = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(showOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNull(showOverflow) ? allColumnOverflow : showOverflow;
|
|
12427
12708
|
const expandParams = {
|
|
12428
|
-
$table: $
|
|
12709
|
+
$table: $xeTable,
|
|
12429
12710
|
seq,
|
|
12430
12711
|
column: expandColumn,
|
|
12431
12712
|
fixed: fixedType,
|
|
@@ -12461,7 +12742,7 @@ function renderRows(h, _vm, $xetable, fixedType, tableData, tableColumn) {
|
|
|
12461
12742
|
}
|
|
12462
12743
|
// 如果是树形表格
|
|
12463
12744
|
if (isExpandTree) {
|
|
12464
|
-
rows.push(...renderRows(h, _vm, $
|
|
12745
|
+
rows.push(...renderRows(h, _vm, $xeTable, fixedType, rowChildren, tableColumn));
|
|
12465
12746
|
}
|
|
12466
12747
|
});
|
|
12467
12748
|
return rows;
|
|
@@ -12547,7 +12828,9 @@ function renderRows(h, _vm, $xetable, fixedType, tableData, tableColumn) {
|
|
|
12547
12828
|
emptyOpts,
|
|
12548
12829
|
mouseConfig,
|
|
12549
12830
|
mouseOpts,
|
|
12550
|
-
sYOpts
|
|
12831
|
+
sYOpts,
|
|
12832
|
+
rowOpts,
|
|
12833
|
+
isDragRowMove
|
|
12551
12834
|
} = $xetable;
|
|
12552
12835
|
// 如果是使用优化模式
|
|
12553
12836
|
if (fixedType) {
|
|
@@ -12628,7 +12911,12 @@ function renderRows(h, _vm, $xetable, fixedType, tableData, tableColumn) {
|
|
|
12628
12911
|
/**
|
|
12629
12912
|
* 内容
|
|
12630
12913
|
*/
|
|
12631
|
-
h('
|
|
12914
|
+
rowOpts.drag ? h('transition-group', {
|
|
12915
|
+
props: {
|
|
12916
|
+
tag: 'tbody',
|
|
12917
|
+
name: `vxe-body--row-list${isDragRowMove ? '' : '-disabled'}`
|
|
12918
|
+
}
|
|
12919
|
+
}, renderRows(h, this, $xetable, fixedType, tableData, tableColumn)) : h('tbody', {
|
|
12632
12920
|
ref: 'tbody'
|
|
12633
12921
|
}, renderRows(h, this, $xetable, fixedType, tableData, tableColumn))]), h('div', {
|
|
12634
12922
|
class: 'vxe-table--checkbox-range'
|
|
@@ -13779,6 +14067,8 @@ const {
|
|
|
13779
14067
|
cellConfig: Object,
|
|
13780
14068
|
// 行配置信息
|
|
13781
14069
|
rowConfig: Object,
|
|
14070
|
+
// 可拖拽配置项
|
|
14071
|
+
dragConfig: Object,
|
|
13782
14072
|
// 列调整配置项
|
|
13783
14073
|
resizableConfig: Object,
|
|
13784
14074
|
// 序号配置项
|
|
@@ -13856,7 +14146,7 @@ const {
|
|
|
13856
14146
|
const {
|
|
13857
14147
|
getI18n: panel_getI18n,
|
|
13858
14148
|
getIcon: panel_getIcon,
|
|
13859
|
-
renderEmptyElement
|
|
14149
|
+
renderEmptyElement: panel_renderEmptyElement
|
|
13860
14150
|
} = core_.VxeUI;
|
|
13861
14151
|
function updateDropHint(_vm, evnt) {
|
|
13862
14152
|
const {
|
|
@@ -14210,7 +14500,7 @@ const renderPopupPanel = (h, _vm) => {
|
|
|
14210
14500
|
column.renderResizeWidth = Math.max(0, Number(value));
|
|
14211
14501
|
}
|
|
14212
14502
|
}
|
|
14213
|
-
}) :
|
|
14503
|
+
}) : panel_renderEmptyElement($xeTableCustomPanel)]) : _e(), allowFixed ? h('td', {
|
|
14214
14504
|
class: 'vxe-table-custom-popup--column-item col--fixed'
|
|
14215
14505
|
}, [parent ? h('span', '-') : h('vxe-radio-group', {
|
|
14216
14506
|
props: {
|
|
@@ -14322,7 +14612,7 @@ const renderPopupPanel = (h, _vm) => {
|
|
|
14322
14612
|
});
|
|
14323
14613
|
}
|
|
14324
14614
|
}
|
|
14325
|
-
}) :
|
|
14615
|
+
}) : panel_renderEmptyElement($xeTableCustomPanel)]) : _e(), h('th', {}, panel_getI18n('vxe.custom.setting.colTitle')), allowResizable ? h('th', {}, panel_getI18n('vxe.custom.setting.colResizable')) : _e(), allowFixed ? h('th', {}, panel_getI18n(`vxe.custom.setting.${maxFixedSize ? 'colFixedMax' : 'colFixed'}`, [maxFixedSize])) : _e()])]), h('transition-group', {
|
|
14326
14616
|
class: 'vxe-table-custom--body',
|
|
14327
14617
|
props: {
|
|
14328
14618
|
tag: 'tbody',
|
|
@@ -14361,7 +14651,7 @@ const renderPopupPanel = (h, _vm) => {
|
|
|
14361
14651
|
})]);
|
|
14362
14652
|
}
|
|
14363
14653
|
}
|
|
14364
|
-
}) :
|
|
14654
|
+
}) : panel_renderEmptyElement($xeTableCustomPanel);
|
|
14365
14655
|
};
|
|
14366
14656
|
/* harmony default export */ var panel = ({
|
|
14367
14657
|
name: 'VxeTableCustomPanel',
|
|
@@ -17313,9 +17603,11 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
|
|
|
17313
17603
|
* 清除激活的编辑
|
|
17314
17604
|
*/
|
|
17315
17605
|
_clearEdit(evnt) {
|
|
17606
|
+
const $xeTable = this;
|
|
17607
|
+
const reactData = $xeTable;
|
|
17316
17608
|
const {
|
|
17317
17609
|
editStore
|
|
17318
|
-
} =
|
|
17610
|
+
} = reactData;
|
|
17319
17611
|
const {
|
|
17320
17612
|
actived,
|
|
17321
17613
|
focused
|
|
@@ -17324,6 +17616,7 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
|
|
|
17324
17616
|
row,
|
|
17325
17617
|
column
|
|
17326
17618
|
} = actived;
|
|
17619
|
+
const validOpts = $xeTable.validOpts;
|
|
17327
17620
|
if (row || column) {
|
|
17328
17621
|
this._syncActivedCell();
|
|
17329
17622
|
actived.args = null;
|
|
@@ -17341,9 +17634,11 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
|
|
|
17341
17634
|
}
|
|
17342
17635
|
focused.row = null;
|
|
17343
17636
|
focused.column = null;
|
|
17344
|
-
if (
|
|
17345
|
-
if (
|
|
17346
|
-
|
|
17637
|
+
if (validOpts.autoClear) {
|
|
17638
|
+
if (validOpts.msgMode !== 'full' || mixin_getConfig().cellVaildMode === 'obsolete') {
|
|
17639
|
+
if (this.clearValidate) {
|
|
17640
|
+
return this.clearValidate();
|
|
17641
|
+
}
|
|
17347
17642
|
}
|
|
17348
17643
|
}
|
|
17349
17644
|
return this.$nextTick();
|
|
@@ -20870,6 +21165,9 @@ function handleUupdateResize(_vm) {
|
|
|
20870
21165
|
isHeader: false,
|
|
20871
21166
|
isFooter: false
|
|
20872
21167
|
},
|
|
21168
|
+
isDragRowMove: false,
|
|
21169
|
+
dragRow: null,
|
|
21170
|
+
dragTipText: '',
|
|
20873
21171
|
_isLoading: false
|
|
20874
21172
|
};
|
|
20875
21173
|
},
|
|
@@ -20932,6 +21230,9 @@ function handleUupdateResize(_vm) {
|
|
|
20932
21230
|
computeRowOpts() {
|
|
20933
21231
|
return Object.assign({}, table_getConfig().table.rowConfig, this.rowConfig);
|
|
20934
21232
|
},
|
|
21233
|
+
computeDragOpts() {
|
|
21234
|
+
return Object.assign({}, table_getConfig().table.dragConfig, this.dragConfig);
|
|
21235
|
+
},
|
|
20935
21236
|
resizeOpts() {
|
|
20936
21237
|
return this.computeResizeOpts;
|
|
20937
21238
|
},
|
|
@@ -21850,9 +22151,16 @@ function handleUupdateResize(_vm) {
|
|
|
21850
22151
|
ctxMenuStore,
|
|
21851
22152
|
ctxMenuOpts
|
|
21852
22153
|
}
|
|
21853
|
-
}) : _e(),
|
|
22154
|
+
}) : _e(),
|
|
22155
|
+
/**
|
|
22156
|
+
* 拖拽提示
|
|
22157
|
+
*/
|
|
22158
|
+
rowOpts.drag ? h('div', {
|
|
22159
|
+
ref: 'refRowDragTipElem',
|
|
22160
|
+
class: 'vxe-table--row-drag-hint'
|
|
22161
|
+
}, table_getI18n('vxe.table.dragTip', [this.dragTipText])) : _e(), h('div', {}, [
|
|
21854
22162
|
/**
|
|
21855
|
-
*
|
|
22163
|
+
* 提示相关
|
|
21856
22164
|
*/
|
|
21857
22165
|
VxeUITooltipComponent ? h(VxeUITooltipComponent, {
|
|
21858
22166
|
key: 'ctp',
|
|
@@ -25286,7 +25594,8 @@ const Toolbar = VxeToolbar;
|
|
|
25286
25594
|
customClose: '关闭',
|
|
25287
25595
|
customCancel: '取消',
|
|
25288
25596
|
customRestore: '恢复默认',
|
|
25289
|
-
maxFixedCol: '最大冻结列的数量不能超过 {0} 个'
|
|
25597
|
+
maxFixedCol: '最大冻结列的数量不能超过 {0} 个',
|
|
25598
|
+
dragTip: '移动:{0}'
|
|
25290
25599
|
},
|
|
25291
25600
|
grid: {
|
|
25292
25601
|
selectOneRecord: '请至少选择一条记录!',
|
|
@@ -25337,7 +25646,7 @@ const Toolbar = VxeToolbar;
|
|
|
25337
25646
|
cstmCancel: '取消',
|
|
25338
25647
|
cstmConfirm: '确定',
|
|
25339
25648
|
cstmConfirmRestore: '请确认是否恢复成默认列配置?',
|
|
25340
|
-
cstmDragTarget: '
|
|
25649
|
+
cstmDragTarget: '移动:{0}',
|
|
25341
25650
|
setting: {
|
|
25342
25651
|
colSort: '排序',
|
|
25343
25652
|
sortHelpTip: '点击并拖动图标可以调整列的排序',
|