vxe-table 4.12.0-beta.2 → 4.12.0-beta.20
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/grid/src/grid.js +61 -44
- package/es/locale/lang/ar-EG.js +7 -1
- package/es/locale/lang/de-DE.js +7 -1
- package/es/locale/lang/en-US.js +7 -1
- package/es/locale/lang/es-ES.js +7 -1
- package/es/locale/lang/fr-FR.js +7 -1
- package/es/locale/lang/hu-HU.js +7 -1
- package/es/locale/lang/hy-AM.js +7 -1
- package/es/locale/lang/id-ID.js +7 -1
- package/es/locale/lang/it-IT.js +7 -1
- package/es/locale/lang/ja-JP.js +7 -1
- package/es/locale/lang/ko-KR.js +7 -1
- package/es/locale/lang/nb-NO.js +7 -1
- package/es/locale/lang/pt-BR.js +7 -1
- package/es/locale/lang/ru-RU.js +7 -1
- package/es/locale/lang/th-TH.js +7 -1
- package/es/locale/lang/ug-CN.js +7 -1
- package/es/locale/lang/uk-UA.js +7 -1
- package/es/locale/lang/vi-VN.js +7 -1
- package/es/locale/lang/zh-CHT.js +7 -1
- package/es/locale/lang/zh-CN.js +7 -1
- package/es/style.css +1 -1
- package/es/table/module/filter/panel.js +12 -2
- package/es/table/module/keyboard/hook.js +47 -4
- package/es/table/render/index.js +91 -60
- package/es/table/src/body.js +12 -7
- package/es/table/src/cell.js +10 -9
- package/es/table/src/footer.js +9 -4
- package/es/table/src/header.js +2 -2
- package/es/table/src/props.js +4 -0
- package/es/table/src/table.js +366 -182
- package/es/table/src/util.js +58 -3
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/helper/vetur/attributes.json +1 -1
- package/helper/vetur/tags.json +1 -1
- package/lib/grid/src/grid.js +58 -48
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +1245 -12123
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +7 -1
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/de-DE.js +7 -1
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/en-US.js +7 -1
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +7 -1
- package/lib/locale/lang/es-ES.js +7 -1
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +7 -1
- package/lib/locale/lang/fr-FR.js +7 -1
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/hu-HU.js +7 -1
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +7 -1
- package/lib/locale/lang/hy-AM.js +7 -1
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/id-ID.js +7 -1
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/it-IT.js +7 -1
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/ja-JP.js +7 -1
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +7 -1
- package/lib/locale/lang/ko-KR.js +7 -1
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +7 -1
- package/lib/locale/lang/nb-NO.js +7 -1
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/pt-BR.js +7 -1
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +7 -1
- package/lib/locale/lang/ru-RU.js +7 -1
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +7 -1
- package/lib/locale/lang/th-TH.js +7 -1
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/ug-CN.js +7 -1
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/uk-UA.js +7 -1
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +7 -1
- package/lib/locale/lang/vi-VN.js +7 -1
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +7 -1
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CN.js +7 -1
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +7 -1
- package/lib/style.css +1 -1
- package/lib/table/module/filter/panel.js +8 -2
- package/lib/table/module/filter/panel.min.js +1 -1
- package/lib/table/module/keyboard/hook.js +51 -4
- package/lib/table/module/keyboard/hook.min.js +1 -1
- package/lib/table/render/index.js +100 -65
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/body.js +11 -6
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +15 -8
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/footer.js +9 -3
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +2 -1
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/props.js +4 -0
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +402 -188
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +65 -6
- package/lib/table/src/util.min.js +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +2 -2
- package/packages/grid/src/grid.ts +65 -50
- package/packages/locale/lang/ar-EG.ts +7 -1
- package/packages/locale/lang/de-DE.ts +7 -1
- package/packages/locale/lang/en-US.ts +7 -1
- package/packages/locale/lang/es-ES.ts +7 -1
- package/packages/locale/lang/fr-FR.ts +7 -1
- package/packages/locale/lang/hu-HU.ts +7 -1
- package/packages/locale/lang/hy-AM.ts +7 -1
- package/packages/locale/lang/id-ID.ts +7 -1
- package/packages/locale/lang/it-IT.ts +7 -1
- package/packages/locale/lang/ja-JP.ts +7 -1
- package/packages/locale/lang/ko-KR.ts +7 -1
- package/packages/locale/lang/nb-NO.ts +7 -1
- package/packages/locale/lang/pt-BR.ts +7 -1
- package/packages/locale/lang/ru-RU.ts +7 -1
- package/packages/locale/lang/th-TH.ts +7 -1
- package/packages/locale/lang/ug-CN.ts +7 -1
- package/packages/locale/lang/uk-UA.ts +7 -1
- package/packages/locale/lang/vi-VN.ts +7 -1
- package/packages/locale/lang/zh-CHT.ts +7 -1
- package/packages/locale/lang/zh-CN.ts +7 -1
- package/packages/table/module/filter/panel.ts +12 -2
- package/packages/table/module/keyboard/hook.ts +47 -6
- package/packages/table/render/index.ts +90 -59
- package/packages/table/src/body.ts +11 -6
- package/packages/table/src/cell.ts +10 -9
- package/packages/table/src/footer.ts +9 -4
- package/packages/table/src/header.ts +2 -2
- package/packages/table/src/props.ts +4 -0
- package/packages/table/src/table.ts +373 -183
- package/packages/table/src/util.ts +66 -3
- /package/es/{iconfont.1741080000843.ttf → iconfont.1742353689933.ttf} +0 -0
- /package/es/{iconfont.1741080000843.woff → iconfont.1742353689933.woff} +0 -0
- /package/es/{iconfont.1741080000843.woff2 → iconfont.1742353689933.woff2} +0 -0
- /package/lib/{iconfont.1741080000843.ttf → iconfont.1742353689933.ttf} +0 -0
- /package/lib/{iconfont.1741080000843.woff → iconfont.1742353689933.woff} +0 -0
- /package/lib/{iconfont.1741080000843.woff2 → iconfont.1742353689933.woff2} +0 -0
|
@@ -28,7 +28,7 @@ hooks.add('tableKeyboardModule', {
|
|
|
28
28
|
setupTable($xeTable) {
|
|
29
29
|
const { props, reactData, internalData } = $xeTable;
|
|
30
30
|
const { refElem } = $xeTable.getRefMaps();
|
|
31
|
-
const { computeEditOpts, computeCheckboxOpts, computeMouseOpts, computeTreeOpts, computeRowOpts, computeCellOpts, computeDefaultRowHeight } = $xeTable.getComputeMaps();
|
|
31
|
+
const { computeEditOpts, computeCheckboxOpts, computeMouseOpts, computeTreeOpts, computeRowOpts, computeColumnOpts, computeCellOpts, computeDefaultRowHeight, computeCurrentRowOpts, computeCurrentColumnOpts } = $xeTable.getComputeMaps();
|
|
32
32
|
function getCheckboxRangeRows(evnt, params, targetTrElem, trRect, offsetClientTop, moveRange) {
|
|
33
33
|
const { showOverflow } = props;
|
|
34
34
|
const { fullAllDataRowIdData, isResizeCellHeight } = internalData;
|
|
@@ -287,6 +287,10 @@ hooks.add('tableKeyboardModule', {
|
|
|
287
287
|
const { editConfig } = props;
|
|
288
288
|
const { afterFullData, visibleColumn } = internalData;
|
|
289
289
|
const editOpts = computeEditOpts.value;
|
|
290
|
+
const rowOpts = computeRowOpts.value;
|
|
291
|
+
const currentRowOpts = computeCurrentRowOpts.value;
|
|
292
|
+
const columnOpts = computeColumnOpts.value;
|
|
293
|
+
const currentColumnOpts = computeCurrentColumnOpts.value;
|
|
290
294
|
let targetRow;
|
|
291
295
|
let targetRowIndex;
|
|
292
296
|
let targetColumnIndex;
|
|
@@ -333,6 +337,12 @@ hooks.add('tableKeyboardModule', {
|
|
|
333
337
|
params.columnIndex = targetColumnIndex;
|
|
334
338
|
params.column = targetColumn;
|
|
335
339
|
params.cell = $xeTable.getCellElement(params.row, params.column);
|
|
340
|
+
if (rowOpts.isCurrent && currentRowOpts.isFollowSelected) {
|
|
341
|
+
$xeTable.triggerCurrentRowEvent(evnt, params);
|
|
342
|
+
}
|
|
343
|
+
if (columnOpts.isCurrent && currentColumnOpts.isFollowSelected) {
|
|
344
|
+
$xeTable.triggerCurrentColumnEvent(evnt, params);
|
|
345
|
+
}
|
|
336
346
|
if (editConfig) {
|
|
337
347
|
if (editOpts.trigger === 'click' || editOpts.trigger === 'dblclick') {
|
|
338
348
|
if (editOpts.mode === 'row') {
|
|
@@ -340,13 +350,17 @@ hooks.add('tableKeyboardModule', {
|
|
|
340
350
|
}
|
|
341
351
|
else {
|
|
342
352
|
$xeTable.scrollToRow(params.row, params.column)
|
|
343
|
-
.then(() =>
|
|
353
|
+
.then(() => {
|
|
354
|
+
$xeTable.handleSelected(params, evnt);
|
|
355
|
+
});
|
|
344
356
|
}
|
|
345
357
|
}
|
|
346
358
|
}
|
|
347
359
|
else {
|
|
348
360
|
$xeTable.scrollToRow(params.row, params.column)
|
|
349
|
-
.then(() =>
|
|
361
|
+
.then(() => {
|
|
362
|
+
$xeTable.handleSelected(params, evnt);
|
|
363
|
+
});
|
|
350
364
|
}
|
|
351
365
|
}
|
|
352
366
|
},
|
|
@@ -358,7 +372,6 @@ hooks.add('tableKeyboardModule', {
|
|
|
358
372
|
const treeOpts = computeTreeOpts.value;
|
|
359
373
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
360
374
|
let targetRow;
|
|
361
|
-
evnt.preventDefault();
|
|
362
375
|
if (currentRow) {
|
|
363
376
|
if (treeConfig) {
|
|
364
377
|
const { index, items } = XEUtils.findTree(afterFullData, item => item === currentRow, { children: childrenField });
|
|
@@ -383,6 +396,7 @@ hooks.add('tableKeyboardModule', {
|
|
|
383
396
|
targetRow = afterFullData[0];
|
|
384
397
|
}
|
|
385
398
|
if (targetRow) {
|
|
399
|
+
evnt.preventDefault();
|
|
386
400
|
const params = {
|
|
387
401
|
$table: $xeTable,
|
|
388
402
|
row: targetRow,
|
|
@@ -393,6 +407,35 @@ hooks.add('tableKeyboardModule', {
|
|
|
393
407
|
.then(() => $xeTable.triggerCurrentRowEvent(evnt, params));
|
|
394
408
|
}
|
|
395
409
|
},
|
|
410
|
+
// 处理当前列方向键移动
|
|
411
|
+
moveCurrentColumn(isLeftArrow, isRightArrow, evnt) {
|
|
412
|
+
const { currentColumn } = reactData;
|
|
413
|
+
const { visibleColumn } = internalData;
|
|
414
|
+
let targetCol = null;
|
|
415
|
+
if (currentColumn) {
|
|
416
|
+
const _columnIndex = $xeTable.getVTColumnIndex(currentColumn);
|
|
417
|
+
if (isLeftArrow && _columnIndex > 0) {
|
|
418
|
+
targetCol = visibleColumn[_columnIndex - 1];
|
|
419
|
+
}
|
|
420
|
+
else if (isRightArrow && _columnIndex < visibleColumn.length - 1) {
|
|
421
|
+
targetCol = visibleColumn[_columnIndex + 1];
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
else {
|
|
425
|
+
targetCol = visibleColumn[0];
|
|
426
|
+
}
|
|
427
|
+
if (targetCol) {
|
|
428
|
+
evnt.preventDefault();
|
|
429
|
+
const params = {
|
|
430
|
+
$table: $xeTable,
|
|
431
|
+
column: targetCol,
|
|
432
|
+
columnIndex: $xeTable.getColumnIndex(targetCol),
|
|
433
|
+
$columnIndex: $xeTable.getVMColumnIndex(targetCol)
|
|
434
|
+
};
|
|
435
|
+
$xeTable.scrollToColumn(targetCol)
|
|
436
|
+
.then(() => $xeTable.triggerCurrentColumnEvent(evnt, params));
|
|
437
|
+
}
|
|
438
|
+
},
|
|
396
439
|
// 处理可编辑方向键移动
|
|
397
440
|
moveSelected(args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt) {
|
|
398
441
|
const { afterFullData, visibleColumn } = internalData;
|
package/es/table/render/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { getCellValue, setCellValue } from '../../table/src/util';
|
|
|
5
5
|
import { getFuncText, formatText, isEmptyValue } from '../../ui/src/utils';
|
|
6
6
|
import { getOnName, getModelEvent, getChangeEvent } from '../../ui/src/vn';
|
|
7
7
|
import { errLog } from '../../ui/src/log';
|
|
8
|
-
const { getConfig, renderer, getI18n } = VxeUI;
|
|
8
|
+
const { getConfig, renderer, getI18n, getComponent } = VxeUI;
|
|
9
9
|
const componentDefaultModelProp = 'modelValue';
|
|
10
10
|
const defaultCompProps = {};
|
|
11
11
|
function handleDefaultValue(value, defaultVal, initVal) {
|
|
@@ -29,7 +29,7 @@ function getOldComponentName(name) {
|
|
|
29
29
|
return `vxe-${name.replace('$', '')}`;
|
|
30
30
|
}
|
|
31
31
|
function getDefaultComponent({ name }) {
|
|
32
|
-
return
|
|
32
|
+
return getComponent(name);
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* 已废弃
|
|
@@ -335,7 +335,7 @@ function oldEditRender(renderOpts, params) {
|
|
|
335
335
|
*/
|
|
336
336
|
function oldButtonEditRender(renderOpts, params) {
|
|
337
337
|
return [
|
|
338
|
-
h(
|
|
338
|
+
h(getComponent('vxe-button'), Object.assign(Object.assign({}, getCellEditProps(renderOpts, params, null)), getComponentOns(renderOpts, params)))
|
|
339
339
|
];
|
|
340
340
|
}
|
|
341
341
|
/**
|
|
@@ -500,6 +500,63 @@ function handleExportTreeSelectMethod(params) {
|
|
|
500
500
|
const { row, column, options } = params;
|
|
501
501
|
return options.original ? getCellValue(row, column) : getTreeSelectCellValue(column.editRender || column.cellRender, params);
|
|
502
502
|
}
|
|
503
|
+
function handleNumberCell(renderOpts, params) {
|
|
504
|
+
const { props = {}, showNegativeStatus } = renderOpts;
|
|
505
|
+
const { row, column } = params;
|
|
506
|
+
const { type } = props;
|
|
507
|
+
let cellValue = XEUtils.get(row, column.field);
|
|
508
|
+
let isNegative = false;
|
|
509
|
+
if (!isEmptyValue(cellValue)) {
|
|
510
|
+
const numberInputConfig = getConfig().numberInput || {};
|
|
511
|
+
if (type === 'float') {
|
|
512
|
+
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
|
|
513
|
+
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 1);
|
|
514
|
+
cellValue = XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits);
|
|
515
|
+
if (!autoFill) {
|
|
516
|
+
cellValue = XEUtils.toNumber(cellValue);
|
|
517
|
+
}
|
|
518
|
+
if (showNegativeStatus) {
|
|
519
|
+
if (cellValue < 0) {
|
|
520
|
+
isNegative = true;
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
else if (type === 'amount') {
|
|
525
|
+
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
|
|
526
|
+
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 2);
|
|
527
|
+
const showCurrency = handleDefaultValue(props.showCurrency, numberInputConfig.showCurrency, false);
|
|
528
|
+
cellValue = XEUtils.toNumber(cellValue);
|
|
529
|
+
if (showNegativeStatus) {
|
|
530
|
+
if (cellValue < 0) {
|
|
531
|
+
isNegative = true;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
cellValue = XEUtils.commafy(cellValue, { digits });
|
|
535
|
+
if (!autoFill) {
|
|
536
|
+
const [iStr, dStr] = cellValue.split('.');
|
|
537
|
+
if (dStr) {
|
|
538
|
+
const dRest = dStr.replace(/0+$/, '');
|
|
539
|
+
cellValue = dRest ? [iStr, '.', dRest].join('') : iStr;
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
if (showCurrency) {
|
|
543
|
+
cellValue = `${props.currencySymbol || numberInputConfig.currencySymbol || getI18n('vxe.numberInput.currencySymbol') || ''}${cellValue}`;
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
else {
|
|
547
|
+
if (showNegativeStatus) {
|
|
548
|
+
if (XEUtils.toNumber(cellValue) < 0) {
|
|
549
|
+
isNegative = true;
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
return getCellLabelVNs(renderOpts, params, cellValue, isNegative
|
|
555
|
+
? {
|
|
556
|
+
class: 'is--negative'
|
|
557
|
+
}
|
|
558
|
+
: {});
|
|
559
|
+
}
|
|
503
560
|
/**
|
|
504
561
|
* 表格 - 渲染器
|
|
505
562
|
*/
|
|
@@ -559,66 +616,19 @@ renderer.mixin({
|
|
|
559
616
|
renderTableFilter: defaultFilterRender,
|
|
560
617
|
tableFilterDefaultMethod: handleInputFilterMethod
|
|
561
618
|
},
|
|
619
|
+
FormatNumberInput: {
|
|
620
|
+
renderTableDefault: handleNumberCell,
|
|
621
|
+
tableFilterDefaultMethod: handleInputFilterMethod,
|
|
622
|
+
tableExportMethod(params) {
|
|
623
|
+
const { row, column } = params;
|
|
624
|
+
const cellValue = XEUtils.get(row, column.field);
|
|
625
|
+
return cellValue;
|
|
626
|
+
}
|
|
627
|
+
},
|
|
562
628
|
VxeNumberInput: {
|
|
563
629
|
tableAutoFocus: 'input',
|
|
564
630
|
renderTableEdit: defaultEditRender,
|
|
565
|
-
renderTableCell
|
|
566
|
-
const { props = {}, showNegativeStatus } = renderOpts;
|
|
567
|
-
const { row, column } = params;
|
|
568
|
-
const { type } = props;
|
|
569
|
-
let cellValue = XEUtils.get(row, column.field);
|
|
570
|
-
let isNegative = false;
|
|
571
|
-
if (!isEmptyValue(cellValue)) {
|
|
572
|
-
const numberInputConfig = getConfig().numberInput || {};
|
|
573
|
-
if (type === 'float') {
|
|
574
|
-
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
|
|
575
|
-
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 1);
|
|
576
|
-
cellValue = XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits);
|
|
577
|
-
if (!autoFill) {
|
|
578
|
-
cellValue = XEUtils.toNumber(cellValue);
|
|
579
|
-
}
|
|
580
|
-
if (showNegativeStatus) {
|
|
581
|
-
if (cellValue < 0) {
|
|
582
|
-
isNegative = true;
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
|
-
}
|
|
586
|
-
else if (type === 'amount') {
|
|
587
|
-
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
|
|
588
|
-
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 2);
|
|
589
|
-
const showCurrency = handleDefaultValue(props.showCurrency, numberInputConfig.showCurrency, false);
|
|
590
|
-
cellValue = XEUtils.toNumber(cellValue);
|
|
591
|
-
if (showNegativeStatus) {
|
|
592
|
-
if (cellValue < 0) {
|
|
593
|
-
isNegative = true;
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
cellValue = XEUtils.commafy(cellValue, { digits });
|
|
597
|
-
if (!autoFill) {
|
|
598
|
-
const [iStr, dStr] = cellValue.split('.');
|
|
599
|
-
if (dStr) {
|
|
600
|
-
const dRest = dStr.replace(/0+$/, '');
|
|
601
|
-
cellValue = dRest ? [iStr, '.', dRest].join('') : iStr;
|
|
602
|
-
}
|
|
603
|
-
}
|
|
604
|
-
if (showCurrency) {
|
|
605
|
-
cellValue = `${props.currencySymbol || numberInputConfig.currencySymbol || getI18n('vxe.numberInput.currencySymbol') || ''}${cellValue}`;
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
else {
|
|
609
|
-
if (showNegativeStatus) {
|
|
610
|
-
if (XEUtils.toNumber(cellValue) < 0) {
|
|
611
|
-
isNegative = true;
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
|
-
return getCellLabelVNs(renderOpts, params, cellValue, isNegative
|
|
617
|
-
? {
|
|
618
|
-
class: 'is--negative'
|
|
619
|
-
}
|
|
620
|
-
: {});
|
|
621
|
-
},
|
|
631
|
+
renderTableCell: handleNumberCell,
|
|
622
632
|
renderTableFooter(renderOpts, params) {
|
|
623
633
|
const { props = {} } = renderOpts;
|
|
624
634
|
const { row, column, _columnIndex } = params;
|
|
@@ -721,11 +731,22 @@ renderer.mixin({
|
|
|
721
731
|
tableFilterDefaultMethod: handleFilterMethod,
|
|
722
732
|
tableExportMethod: handleExportSelectMethod
|
|
723
733
|
},
|
|
734
|
+
/**
|
|
735
|
+
* 已废弃,被 FormatSelect 替换
|
|
736
|
+
* @deprecated
|
|
737
|
+
*/
|
|
724
738
|
formatOption: {
|
|
725
739
|
renderTableDefault(renderOpts, params) {
|
|
726
740
|
return getCellLabelVNs(renderOpts, params, getSelectCellValue(renderOpts, params));
|
|
727
741
|
}
|
|
728
742
|
},
|
|
743
|
+
FormatSelect: {
|
|
744
|
+
renderTableDefault(renderOpts, params) {
|
|
745
|
+
return getCellLabelVNs(renderOpts, params, getSelectCellValue(renderOpts, params));
|
|
746
|
+
},
|
|
747
|
+
tableFilterDefaultMethod: handleFilterMethod,
|
|
748
|
+
tableExportMethod: handleExportSelectMethod
|
|
749
|
+
},
|
|
729
750
|
VxeTreeSelect: {
|
|
730
751
|
tableAutoFocus: 'input',
|
|
731
752
|
renderTableEdit: defaultTableOrTreeSelectEditRender,
|
|
@@ -734,11 +755,21 @@ renderer.mixin({
|
|
|
734
755
|
},
|
|
735
756
|
tableExportMethod: handleExportTreeSelectMethod
|
|
736
757
|
},
|
|
758
|
+
/**
|
|
759
|
+
* 已废弃,被 FormatTreeSelect 替换
|
|
760
|
+
* @deprecated
|
|
761
|
+
*/
|
|
737
762
|
formatTree: {
|
|
738
763
|
renderTableDefault(renderOpts, params) {
|
|
739
764
|
return getCellLabelVNs(renderOpts, params, getTreeSelectCellValue(renderOpts, params));
|
|
740
765
|
}
|
|
741
766
|
},
|
|
767
|
+
FormatTreeSelect: {
|
|
768
|
+
renderTableDefault(renderOpts, params) {
|
|
769
|
+
return getCellLabelVNs(renderOpts, params, getTreeSelectCellValue(renderOpts, params));
|
|
770
|
+
},
|
|
771
|
+
tableExportMethod: handleExportTreeSelectMethod
|
|
772
|
+
},
|
|
742
773
|
VxeTableSelect: {
|
|
743
774
|
tableAutoFocus: 'input',
|
|
744
775
|
renderTableEdit: defaultTableOrTreeSelectEditRender,
|
package/es/table/src/body.js
CHANGED
|
@@ -205,6 +205,7 @@ export default defineComponent({
|
|
|
205
205
|
tdOns.onDblclick = (evnt) => {
|
|
206
206
|
$xeTable.triggerCellDblclickEvent(evnt, cellParams);
|
|
207
207
|
};
|
|
208
|
+
let isMergeCell = false;
|
|
208
209
|
// 合并行或列
|
|
209
210
|
if (mergeList.length) {
|
|
210
211
|
const spanRest = mergeBodyMethod(mergeList, _rowIndex, _columnIndex);
|
|
@@ -214,9 +215,11 @@ export default defineComponent({
|
|
|
214
215
|
return null;
|
|
215
216
|
}
|
|
216
217
|
if (rowspan > 1) {
|
|
218
|
+
isMergeCell = true;
|
|
217
219
|
tdAttrs.rowspan = rowspan;
|
|
218
220
|
}
|
|
219
221
|
if (colspan > 1) {
|
|
222
|
+
isMergeCell = true;
|
|
220
223
|
tdAttrs.colspan = colspan;
|
|
221
224
|
}
|
|
222
225
|
}
|
|
@@ -249,12 +252,14 @@ export default defineComponent({
|
|
|
249
252
|
const isLastColumn = $columnIndex === columns.length - 1;
|
|
250
253
|
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
|
|
251
254
|
let isVNPreEmptyStatus = false;
|
|
252
|
-
if (!
|
|
253
|
-
if (
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
255
|
+
if (!isMergeCell) {
|
|
256
|
+
if (!dragRow || getRowid($xeTable, dragRow) !== rowid) {
|
|
257
|
+
if (scrollYLoad && (_rowIndex < scrollYStore.visibleStartIndex - scrollYStore.preloadSize || _rowIndex > scrollYStore.visibleEndIndex + scrollYStore.preloadSize)) {
|
|
258
|
+
isVNPreEmptyStatus = true;
|
|
259
|
+
}
|
|
260
|
+
else if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
261
|
+
isVNPreEmptyStatus = true;
|
|
262
|
+
}
|
|
258
263
|
}
|
|
259
264
|
}
|
|
260
265
|
const tcStyle = {};
|
|
@@ -584,7 +589,7 @@ export default defineComponent({
|
|
|
584
589
|
isOptimizeMode = true;
|
|
585
590
|
}
|
|
586
591
|
}
|
|
587
|
-
if (fixedType || !overflowX) {
|
|
592
|
+
if (!isColLoading && (fixedType || !overflowX)) {
|
|
588
593
|
renderColumnList = visibleColumn;
|
|
589
594
|
}
|
|
590
595
|
if (fixedType) {
|
package/es/table/src/cell.js
CHANGED
|
@@ -548,7 +548,8 @@ export const Cell = {
|
|
|
548
548
|
const headerSlot = slots ? slots.header : null;
|
|
549
549
|
const titleSlot = slots ? slots.title : null;
|
|
550
550
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
551
|
-
const headerTitle =
|
|
551
|
+
const { checkStrictly, showHeader, headerTitle } = checkboxOpts;
|
|
552
|
+
const colTitle = column.getTitle();
|
|
552
553
|
const ons = {};
|
|
553
554
|
if (!isHidden) {
|
|
554
555
|
ons.onClick = (evnt) => {
|
|
@@ -561,11 +562,11 @@ export const Cell = {
|
|
|
561
562
|
if (headerSlot) {
|
|
562
563
|
return renderHeaderCellBaseVNs(params, renderTitleContent(checkboxParams, $table.callSlot(headerSlot, checkboxParams)));
|
|
563
564
|
}
|
|
564
|
-
if (
|
|
565
|
+
if (checkStrictly ? !showHeader : showHeader === false) {
|
|
565
566
|
return renderHeaderCellBaseVNs(params, renderTitleContent(checkboxParams, [
|
|
566
567
|
h('span', {
|
|
567
568
|
class: 'vxe-checkbox--label'
|
|
568
|
-
}, titleSlot ? $table.callSlot(titleSlot, checkboxParams) :
|
|
569
|
+
}, titleSlot ? $table.callSlot(titleSlot, checkboxParams) : colTitle)
|
|
569
570
|
]));
|
|
570
571
|
}
|
|
571
572
|
return renderHeaderCellBaseVNs(params, renderTitleContent(checkboxParams, [
|
|
@@ -573,15 +574,15 @@ export const Cell = {
|
|
|
573
574
|
'is--checked': isAllCheckboxSelected,
|
|
574
575
|
'is--disabled': isAllCheckboxDisabled,
|
|
575
576
|
'is--indeterminate': isAllCheckboxIndeterminate
|
|
576
|
-
}], title: getI18n('vxe.table.allTitle') }, ons), [
|
|
577
|
+
}], title: XEUtils.eqNull(headerTitle) ? getI18n('vxe.table.allTitle') : `${headerTitle || ''}` }, ons), [
|
|
577
578
|
h('span', {
|
|
578
579
|
class: ['vxe-checkbox--icon', isAllCheckboxIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllCheckboxSelected ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
|
|
579
580
|
})
|
|
580
|
-
].concat(titleSlot ||
|
|
581
|
+
].concat(titleSlot || colTitle
|
|
581
582
|
? [
|
|
582
583
|
h('span', {
|
|
583
584
|
class: 'vxe-checkbox--label'
|
|
584
|
-
}, titleSlot ? $table.callSlot(titleSlot, checkboxParams) :
|
|
585
|
+
}, titleSlot ? $table.callSlot(titleSlot, checkboxParams) : colTitle)
|
|
585
586
|
]
|
|
586
587
|
: []))
|
|
587
588
|
]));
|
|
@@ -809,7 +810,7 @@ export const Cell = {
|
|
|
809
810
|
const { $table, column } = params;
|
|
810
811
|
const { computeSortOpts } = $table.getComputeMaps();
|
|
811
812
|
const sortOpts = computeSortOpts.value;
|
|
812
|
-
const { showIcon, allowBtn, iconLayout, iconAsc, iconDesc, iconVisibleMethod } = sortOpts;
|
|
813
|
+
const { showIcon, allowBtn, ascTitle, descTitle, iconLayout, iconAsc, iconDesc, iconVisibleMethod } = sortOpts;
|
|
813
814
|
const { order } = column;
|
|
814
815
|
if (showIcon && (!iconVisibleMethod || iconVisibleMethod(params))) {
|
|
815
816
|
return [
|
|
@@ -820,7 +821,7 @@ export const Cell = {
|
|
|
820
821
|
class: ['vxe-sort--asc-btn', iconAsc || getIcon().TABLE_SORT_ASC, {
|
|
821
822
|
'sort--active': order === 'asc'
|
|
822
823
|
}],
|
|
823
|
-
title: getI18n('vxe.table.sortAsc')
|
|
824
|
+
title: XEUtils.eqNull(ascTitle) ? getI18n('vxe.table.sortAsc') : `${ascTitle || ''}`,
|
|
824
825
|
onClick: allowBtn
|
|
825
826
|
? (evnt) => {
|
|
826
827
|
evnt.stopPropagation();
|
|
@@ -832,7 +833,7 @@ export const Cell = {
|
|
|
832
833
|
class: ['vxe-sort--desc-btn', iconDesc || getIcon().TABLE_SORT_DESC, {
|
|
833
834
|
'sort--active': order === 'desc'
|
|
834
835
|
}],
|
|
835
|
-
title: getI18n('vxe.table.sortDesc')
|
|
836
|
+
title: XEUtils.eqNull(descTitle) ? getI18n('vxe.table.sortDesc') : `${descTitle || ''}`,
|
|
836
837
|
onClick: allowBtn
|
|
837
838
|
? (evnt) => {
|
|
838
839
|
evnt.stopPropagation();
|
package/es/table/src/footer.js
CHANGED
|
@@ -126,6 +126,7 @@ export default defineComponent({
|
|
|
126
126
|
tfOns.onDblclick = (evnt) => {
|
|
127
127
|
$xeTable.dispatchEvent('footer-cell-dblclick', Object.assign({ cell: evnt.currentTarget }, cellParams), evnt);
|
|
128
128
|
};
|
|
129
|
+
let isMergeCell = false;
|
|
129
130
|
// 合并行或列
|
|
130
131
|
if (mergeFooterList.length) {
|
|
131
132
|
const spanRest = mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex);
|
|
@@ -135,9 +136,11 @@ export default defineComponent({
|
|
|
135
136
|
return null;
|
|
136
137
|
}
|
|
137
138
|
if (rowspan > 1) {
|
|
139
|
+
isMergeCell = true;
|
|
138
140
|
attrs.rowspan = rowspan;
|
|
139
141
|
}
|
|
140
142
|
if (colspan > 1) {
|
|
143
|
+
isMergeCell = true;
|
|
141
144
|
attrs.colspan = colspan;
|
|
142
145
|
}
|
|
143
146
|
}
|
|
@@ -158,8 +161,10 @@ export default defineComponent({
|
|
|
158
161
|
const isLastColumn = $columnIndex === tableColumn.length - 1;
|
|
159
162
|
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
|
|
160
163
|
let isVNPreEmptyStatus = false;
|
|
161
|
-
if (
|
|
162
|
-
|
|
164
|
+
if (!isMergeCell) {
|
|
165
|
+
if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
166
|
+
isVNPreEmptyStatus = true;
|
|
167
|
+
}
|
|
163
168
|
}
|
|
164
169
|
const tcStyle = {};
|
|
165
170
|
if (hasEllipsis) {
|
|
@@ -245,7 +250,7 @@ export default defineComponent({
|
|
|
245
250
|
const { fixedType, fixedColumn, tableColumn } = props;
|
|
246
251
|
const { spanMethod, footerSpanMethod, showFooterOverflow: allColumnFooterOverflow } = tableProps;
|
|
247
252
|
const { visibleColumn, fullColumnIdData } = tableInternalData;
|
|
248
|
-
const { isGroup, overflowX, scrollXLoad, scrollYLoad, dragCol } = tableReactData;
|
|
253
|
+
const { isGroup, isColLoading, overflowX, scrollXLoad, scrollYLoad, dragCol } = tableReactData;
|
|
249
254
|
let renderColumnList = tableColumn;
|
|
250
255
|
let isOptimizeMode = false;
|
|
251
256
|
// 如果是使用优化模式
|
|
@@ -257,7 +262,7 @@ export default defineComponent({
|
|
|
257
262
|
isOptimizeMode = true;
|
|
258
263
|
}
|
|
259
264
|
}
|
|
260
|
-
if (fixedType || !overflowX) {
|
|
265
|
+
if (!isColLoading && (fixedType || !overflowX)) {
|
|
261
266
|
renderColumnList = visibleColumn;
|
|
262
267
|
}
|
|
263
268
|
if (fixedType) {
|
package/es/table/src/header.js
CHANGED
|
@@ -199,7 +199,7 @@ export default defineComponent({
|
|
|
199
199
|
const renderVN = () => {
|
|
200
200
|
const { fixedType, fixedColumn, tableColumn } = props;
|
|
201
201
|
const { mouseConfig, showHeaderOverflow: allColumnHeaderOverflow, spanMethod, footerSpanMethod } = tableProps;
|
|
202
|
-
const { isGroup, overflowX, scrollXLoad, scrollYLoad, dragCol } = tableReactData;
|
|
202
|
+
const { isGroup, isColLoading, overflowX, scrollXLoad, scrollYLoad, dragCol } = tableReactData;
|
|
203
203
|
const { visibleColumn, fullColumnIdData } = tableInternalData;
|
|
204
204
|
const mouseOpts = computeMouseOpts.value;
|
|
205
205
|
let renderHeaderList = headerColumn.value;
|
|
@@ -218,7 +218,7 @@ export default defineComponent({
|
|
|
218
218
|
isOptimizeMode = true;
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
|
-
if (fixedType || !overflowX) {
|
|
221
|
+
if (!isColLoading && (fixedType || !overflowX)) {
|
|
222
222
|
renderColumnList = visibleColumn;
|
|
223
223
|
}
|
|
224
224
|
if (fixedType) {
|
package/es/table/src/props.js
CHANGED
|
@@ -182,6 +182,8 @@ export default {
|
|
|
182
182
|
resizeConfig: Object,
|
|
183
183
|
// 列配置信息
|
|
184
184
|
columnConfig: Object,
|
|
185
|
+
// 当前列配置信息
|
|
186
|
+
currentColumnConfig: Object,
|
|
185
187
|
// 单元格配置信息
|
|
186
188
|
cellConfig: Object,
|
|
187
189
|
// 表头单元格配置信息
|
|
@@ -190,6 +192,8 @@ export default {
|
|
|
190
192
|
footerCellConfig: Object,
|
|
191
193
|
// 行配置信息
|
|
192
194
|
rowConfig: Object,
|
|
195
|
+
// 当前行配置信息
|
|
196
|
+
currentRowConfig: Object,
|
|
193
197
|
// 已废弃,被 rowDragConfig 替换
|
|
194
198
|
dragConfig: Object,
|
|
195
199
|
// 行拖拽排序配置项
|