vxe-table 3.22.2 → 3.22.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/ar-EG.js +7 -0
- package/es/locale/lang/de-DE.js +7 -0
- package/es/locale/lang/en-US.js +7 -0
- package/es/locale/lang/es-ES.js +7 -0
- package/es/locale/lang/fr-FR.js +7 -0
- package/es/locale/lang/hu-HU.js +7 -0
- package/es/locale/lang/hy-AM.js +7 -0
- package/es/locale/lang/id-ID.js +7 -0
- package/es/locale/lang/it-IT.js +7 -0
- package/es/locale/lang/ja-JP.js +7 -0
- package/es/locale/lang/ko-KR.js +7 -0
- package/es/locale/lang/ms-MY.js +7 -0
- package/es/locale/lang/nb-NO.js +7 -0
- package/es/locale/lang/pt-BR.js +7 -0
- package/es/locale/lang/ru-RU.js +7 -0
- package/es/locale/lang/th-TH.js +7 -0
- package/es/locale/lang/ug-CN.js +7 -0
- package/es/locale/lang/uk-UA.js +7 -0
- package/es/locale/lang/uz-UZ.js +7 -0
- package/es/locale/lang/vi-VN.js +7 -0
- package/es/locale/lang/zh-CHT.js +7 -0
- package/es/locale/lang/zh-CN.js +7 -0
- package/es/style.css +1 -1
- package/es/table/module/export/export-panel.js +384 -335
- package/es/table/module/export/mixin.js +106 -28
- package/es/table/module/export/util.js +1 -1
- package/es/table/src/body.js +1 -1
- package/es/table/src/footer.js +1 -1
- package/es/table/src/header.js +4 -2
- package/es/table/src/table.js +24 -24
- package/es/table/src/util.js +1 -0
- package/es/ui/index.js +2 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +202 -79
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +7 -0
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/ar-EG.umd.js +7 -0
- package/lib/locale/lang/de-DE.js +7 -0
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/de-DE.umd.js +7 -0
- package/lib/locale/lang/en-US.js +7 -0
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +7 -0
- package/lib/locale/lang/es-ES.js +7 -0
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +7 -0
- package/lib/locale/lang/fr-FR.js +7 -0
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/fr-FR.umd.js +7 -0
- package/lib/locale/lang/hu-HU.js +7 -0
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +7 -0
- package/lib/locale/lang/hy-AM.js +7 -0
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/hy-AM.umd.js +7 -0
- package/lib/locale/lang/id-ID.js +7 -0
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/id-ID.umd.js +7 -0
- package/lib/locale/lang/it-IT.js +7 -0
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/it-IT.umd.js +7 -0
- package/lib/locale/lang/ja-JP.js +7 -0
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +7 -0
- package/lib/locale/lang/ko-KR.js +7 -0
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +7 -0
- package/lib/locale/lang/ms-MY.js +7 -0
- package/lib/locale/lang/ms-MY.min.js +1 -1
- package/lib/locale/lang/ms-MY.umd.js +7 -0
- package/lib/locale/lang/nb-NO.js +7 -0
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/nb-NO.umd.js +7 -0
- package/lib/locale/lang/pt-BR.js +7 -0
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +7 -0
- package/lib/locale/lang/ru-RU.js +7 -0
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +7 -0
- package/lib/locale/lang/th-TH.js +7 -0
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/th-TH.umd.js +7 -0
- package/lib/locale/lang/ug-CN.js +7 -0
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/ug-CN.umd.js +7 -0
- package/lib/locale/lang/uk-UA.js +7 -0
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +7 -0
- package/lib/locale/lang/uz-UZ.js +7 -0
- package/lib/locale/lang/uz-UZ.min.js +1 -1
- package/lib/locale/lang/uz-UZ.umd.js +7 -0
- package/lib/locale/lang/vi-VN.js +7 -0
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/vi-VN.umd.js +7 -0
- package/lib/locale/lang/zh-CHT.js +7 -0
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +7 -0
- package/lib/locale/lang/zh-CN.js +7 -0
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +7 -0
- package/lib/style.css +1 -1
- package/lib/table/module/export/export-panel.js +50 -22
- package/lib/table/module/export/export-panel.min.js +1 -1
- package/lib/table/module/export/mixin.js +106 -28
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/module/export/util.js +1 -1
- package/lib/table/module/export/util.min.js +1 -1
- package/lib/table/src/body.js +1 -1
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/footer.js +1 -1
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +4 -2
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/table.js +28 -22
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +1 -0
- package/lib/table/src/util.min.js +1 -1
- package/lib/ui/index.js +2 -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/locale/lang/ar-EG.ts +7 -0
- package/packages/locale/lang/de-DE.ts +7 -0
- package/packages/locale/lang/en-US.ts +7 -0
- package/packages/locale/lang/es-ES.ts +7 -0
- package/packages/locale/lang/fr-FR.ts +7 -0
- package/packages/locale/lang/hu-HU.ts +7 -0
- package/packages/locale/lang/hy-AM.ts +7 -0
- package/packages/locale/lang/id-ID.ts +7 -0
- package/packages/locale/lang/it-IT.ts +7 -0
- package/packages/locale/lang/ja-JP.ts +7 -0
- package/packages/locale/lang/ko-KR.ts +7 -0
- package/packages/locale/lang/ms-MY.ts +7 -0
- package/packages/locale/lang/nb-NO.ts +7 -0
- package/packages/locale/lang/pt-BR.ts +7 -0
- package/packages/locale/lang/ru-RU.ts +7 -0
- package/packages/locale/lang/th-TH.ts +7 -0
- package/packages/locale/lang/ug-CN.ts +7 -0
- package/packages/locale/lang/uk-UA.ts +7 -0
- package/packages/locale/lang/uz-UZ.ts +7 -0
- package/packages/locale/lang/vi-VN.ts +7 -0
- package/packages/locale/lang/zh-CHT.ts +7 -0
- package/packages/locale/lang/zh-CN.ts +7 -0
- package/packages/table/module/export/export-panel.ts +383 -333
- package/packages/table/module/export/mixin.ts +130 -46
- package/packages/table/module/export/util.ts +1 -1
- package/packages/table/src/body.ts +1 -1
- package/packages/table/src/footer.ts +1 -1
- package/packages/table/src/header.ts +4 -2
- package/packages/table/src/table.ts +24 -24
- package/packages/table/src/util.ts +1 -0
- package/packages/ui/index.ts +1 -0
- /package/es/{iconfont.1784122379007.ttf → iconfont.1784251254538.ttf} +0 -0
- /package/es/{iconfont.1784122379007.woff → iconfont.1784251254538.woff} +0 -0
- /package/es/{iconfont.1784122379007.woff2 → iconfont.1784251254538.woff2} +0 -0
- /package/lib/{iconfont.1784122379007.ttf → iconfont.1784251254538.ttf} +0 -0
- /package/lib/{iconfont.1784122379007.woff → iconfont.1784251254538.woff} +0 -0
- /package/lib/{iconfont.1784122379007.woff2 → iconfont.1784251254538.woff2} +0 -0
|
@@ -2,7 +2,7 @@ import XEUtils from 'xe-utils';
|
|
|
2
2
|
import { VxeUI } from '../../../ui';
|
|
3
3
|
import { isColumnInfo, getCellValue, createHandleGetRowId } from '../../src/util';
|
|
4
4
|
import { parseFile, formatText, eqEmptyValue } from '../../../ui/src/utils';
|
|
5
|
-
import { hasClass } from '../../../ui/src/dom';
|
|
5
|
+
import { hasClass, toCssUnit } from '../../../ui/src/dom';
|
|
6
6
|
import { createHtmlPage, getExportBlobByContent } from './util';
|
|
7
7
|
import { createComponentLog } from '../../../ui/src/log';
|
|
8
8
|
const { warnLog, errLog } = createComponentLog('table');
|
|
@@ -473,6 +473,9 @@ function hasEllipsis($xeTable, column, property, allColumnOverflow) {
|
|
|
473
473
|
}
|
|
474
474
|
return isEllipsis;
|
|
475
475
|
}
|
|
476
|
+
function getCustomColKey(conf) {
|
|
477
|
+
return `${conf.field || ''}:${conf.type || ''}`;
|
|
478
|
+
}
|
|
476
479
|
function toHtml($xeTable, opts, columns, datas) {
|
|
477
480
|
const props = $xeTable;
|
|
478
481
|
const reactData = $xeTable;
|
|
@@ -481,17 +484,98 @@ function toHtml($xeTable, opts, columns, datas) {
|
|
|
481
484
|
const { isAllSelected, isIndeterminate } = reactData;
|
|
482
485
|
const { mergeBodyCellMaps, mergeFooterCellMaps } = internalData;
|
|
483
486
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
484
|
-
const { print: isPrint, isHeader, isFooter, isColgroup, isMerge, colgroups, original } = opts;
|
|
487
|
+
const { print: isPrint, widthMode, isHeader, isFooter, isColgroup, isMerge, colgroups, _columnConfs, original } = opts;
|
|
488
|
+
const isAutoWidth = widthMode === 'auto';
|
|
489
|
+
const isScaleWidth = widthMode === 'scale';
|
|
490
|
+
const isDefaultWidth = !isAutoWidth && !isScaleWidth;
|
|
491
|
+
const customWidthMaps = {};
|
|
492
|
+
if (_columnConfs) {
|
|
493
|
+
_columnConfs.forEach(conf => {
|
|
494
|
+
if (!isColumnInfo(conf)) {
|
|
495
|
+
if ((conf.field || conf.type) && conf.width) {
|
|
496
|
+
customWidthMaps[getCustomColKey(conf)] = conf.width;
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
});
|
|
500
|
+
}
|
|
501
|
+
// 计算宽度
|
|
502
|
+
const colWidthMaps = {};
|
|
503
|
+
const printWidthMaps = {};
|
|
504
|
+
if (isPrint) {
|
|
505
|
+
let tableWidth = 0;
|
|
506
|
+
columns.forEach(column => {
|
|
507
|
+
tableWidth += column.renderWidth;
|
|
508
|
+
});
|
|
509
|
+
if (colgroups) {
|
|
510
|
+
colgroups.forEach((cols) => {
|
|
511
|
+
cols.forEach((column) => {
|
|
512
|
+
if (!column.childNodes || !column.childNodes.length) {
|
|
513
|
+
return;
|
|
514
|
+
}
|
|
515
|
+
let childWidth = 0;
|
|
516
|
+
let countChild = 0;
|
|
517
|
+
XEUtils.eachTree([column], item => {
|
|
518
|
+
if (!item.childNodes || !column.childNodes.length) {
|
|
519
|
+
countChild++;
|
|
520
|
+
}
|
|
521
|
+
const ptWidth = printWidthMaps[item.id];
|
|
522
|
+
childWidth += ptWidth || 0;
|
|
523
|
+
}, { children: 'childNodes' });
|
|
524
|
+
const colWidth = childWidth - countChild;
|
|
525
|
+
colWidthMaps[column.id] = colWidth;
|
|
526
|
+
printWidthMaps[column.id] = XEUtils.floor(colWidth / tableWidth * 180, 2);
|
|
527
|
+
});
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
columns.forEach(column => {
|
|
531
|
+
const colWidth = column.renderWidth;
|
|
532
|
+
if (column.width) {
|
|
533
|
+
colWidthMaps[column.id] = colWidth;
|
|
534
|
+
}
|
|
535
|
+
printWidthMaps[column.id] = XEUtils.floor(colWidth / tableWidth * 180, 2);
|
|
536
|
+
});
|
|
537
|
+
}
|
|
538
|
+
const getHeaderWidthStyle = (column) => {
|
|
539
|
+
const cmColKey = getCustomColKey(column);
|
|
540
|
+
const cmWidthMaps = customWidthMaps[cmColKey];
|
|
541
|
+
if (cmWidthMaps) {
|
|
542
|
+
return 'width:' + toCssUnit(cmWidthMaps);
|
|
543
|
+
}
|
|
544
|
+
if (isAutoWidth) {
|
|
545
|
+
return '';
|
|
546
|
+
}
|
|
547
|
+
if (isScaleWidth) {
|
|
548
|
+
return printWidthMaps[column.id] ? ('width:' + printWidthMaps[column.id] + 'mm') : '';
|
|
549
|
+
}
|
|
550
|
+
return colWidthMaps[column.id] ? ('width:' + toCssUnit(colWidthMaps[column.id])) : '';
|
|
551
|
+
};
|
|
552
|
+
const getCellWidthStyle = (column) => {
|
|
553
|
+
const cmColKey = getCustomColKey(column);
|
|
554
|
+
const cmWidthMaps = customWidthMaps[cmColKey];
|
|
555
|
+
if (cmWidthMaps) {
|
|
556
|
+
return 'width:' + toCssUnit(cmWidthMaps);
|
|
557
|
+
}
|
|
558
|
+
if (isAutoWidth || isDefaultWidth) {
|
|
559
|
+
return '';
|
|
560
|
+
}
|
|
561
|
+
if (isScaleWidth) {
|
|
562
|
+
return printWidthMaps[column.id] ? ('width:' + printWidthMaps[column.id] + 'mm') : '';
|
|
563
|
+
}
|
|
564
|
+
return colWidthMaps[column.id] ? ('width:' + toCssUnit(colWidthMaps[column.id])) : '';
|
|
565
|
+
};
|
|
485
566
|
const allCls = 'check-all';
|
|
486
567
|
const clss = [
|
|
487
568
|
'vxe-table',
|
|
488
569
|
`border--${toTableBorder(border)}`,
|
|
489
570
|
isPrint ? 'is--print' : '',
|
|
571
|
+
isAutoWidth ? 'is--auto-width' : '',
|
|
572
|
+
isScaleWidth ? 'is--scale-width' : '',
|
|
573
|
+
isDefaultWidth ? 'is--default-width' : '',
|
|
490
574
|
isHeader ? 'is--header' : ''
|
|
491
575
|
].filter(cls => cls);
|
|
492
576
|
const tables = [
|
|
493
577
|
`<table class="${clss.join(' ')}" border="0" cellspacing="0" cellpadding="0">`,
|
|
494
|
-
`<colgroup>${columns.map(column => `<col style="
|
|
578
|
+
`<colgroup>${columns.map((column) => `<col style="${getHeaderWidthStyle(column)}">`).join('')}</colgroup>`
|
|
495
579
|
];
|
|
496
580
|
if (isHeader) {
|
|
497
581
|
tables.push('<thead>');
|
|
@@ -501,22 +585,13 @@ function toHtml($xeTable, opts, columns, datas) {
|
|
|
501
585
|
const headAlign = column.headerAlign || column.align || allHeaderAlign || allAlign;
|
|
502
586
|
const classNames = hasEllipsis($xeTable, column, 'showHeaderOverflow', allColumnHeaderOverflow) ? ['col--ellipsis'] : [];
|
|
503
587
|
const cellTitle = getHeaderTitle($xeTable, opts, column);
|
|
504
|
-
let childWidth = 0;
|
|
505
|
-
let countChild = 0;
|
|
506
|
-
XEUtils.eachTree([column], item => {
|
|
507
|
-
if (!item.childNodes || !column.childNodes.length) {
|
|
508
|
-
countChild++;
|
|
509
|
-
}
|
|
510
|
-
childWidth += item.renderWidth;
|
|
511
|
-
}, { children: 'childNodes' });
|
|
512
|
-
const cellWidth = childWidth - countChild;
|
|
513
588
|
if (headAlign) {
|
|
514
589
|
classNames.push(`col--${headAlign}`);
|
|
515
590
|
}
|
|
516
591
|
if (column.type === 'checkbox') {
|
|
517
|
-
return `<th class="${classNames.join(' ')}" colspan="${column._colSpan}" rowspan="${column._rowSpan}"><div
|
|
592
|
+
return `<th class="${classNames.join(' ')}" colspan="${column._colSpan}" rowspan="${column._rowSpan}"><div style="${getCellWidthStyle(column)}"><input type="checkbox" class="${allCls}" ${isAllSelected ? 'checked' : ''}><span>${cellTitle}</span></div></th>`;
|
|
518
593
|
}
|
|
519
|
-
return `<th class="${classNames.join(' ')}" colspan="${column._colSpan}" rowspan="${column._rowSpan}" title="${cellTitle}"><div
|
|
594
|
+
return `<th class="${classNames.join(' ')}" colspan="${column._colSpan}" rowspan="${column._rowSpan}" title="${cellTitle}"><div style="${getCellWidthStyle(column)}"><span>${formatText(cellTitle, true)}</span></div></th>`;
|
|
520
595
|
}).join('')}</tr>`);
|
|
521
596
|
});
|
|
522
597
|
}
|
|
@@ -529,9 +604,9 @@ function toHtml($xeTable, opts, columns, datas) {
|
|
|
529
604
|
classNames.push(`col--${headAlign}`);
|
|
530
605
|
}
|
|
531
606
|
if (column.type === 'checkbox') {
|
|
532
|
-
return `<th class="${classNames.join(' ')}"><div
|
|
607
|
+
return `<th class="${classNames.join(' ')}"><div style="${getCellWidthStyle(column)}"><input type="checkbox" class="${allCls}" ${isAllSelected ? 'checked' : ''}><span>${cellTitle}</span></div></th>`;
|
|
533
608
|
}
|
|
534
|
-
return `<th class="${classNames.join(' ')}" title="${cellTitle}"><div
|
|
609
|
+
return `<th class="${classNames.join(' ')}" title="${cellTitle}"><div style="${getCellWidthStyle(column)}"><span>${formatText(cellTitle, true)}</span></div></th>`;
|
|
535
610
|
}).join('')}</tr>`);
|
|
536
611
|
}
|
|
537
612
|
tables.push('</thead>');
|
|
@@ -554,20 +629,20 @@ function toHtml($xeTable, opts, columns, datas) {
|
|
|
554
629
|
}
|
|
555
630
|
classNames.push('vxe-table--tree-node');
|
|
556
631
|
if (column.type === 'radio') {
|
|
557
|
-
return `<td class="${classNames.join(' ')}" title="${cellValue}"><div
|
|
632
|
+
return `<td class="${classNames.join(' ')}" title="${cellValue}"><div style="${getCellWidthStyle(column)}"><div class="vxe-table--tree-node-wrapper" style="padding-left: ${item._level * treeOpts.indent}px"><div class="vxe-table--tree-icon-wrapper">${treeIcon}</div><div class="vxe-table--tree-cell"><input type="radio" name="radio_${id}" ${item._radioDisabled ? 'disabled ' : ''}${getBooleanValue(cellValue) ? 'checked' : ''}><span>${item._radioLabel}</span></div></div></div></td>`;
|
|
558
633
|
}
|
|
559
634
|
else if (column.type === 'checkbox') {
|
|
560
|
-
return `<td class="${classNames.join(' ')}" title="${cellValue}"><div
|
|
635
|
+
return `<td class="${classNames.join(' ')}" title="${cellValue}"><div style="${getCellWidthStyle(column)}"><div class="vxe-table--tree-node-wrapper" style="padding-left: ${item._level * treeOpts.indent}px"><div class="vxe-table--tree-icon-wrapper">${treeIcon}</div><div class="vxe-table--tree-cell"><input type="checkbox" ${item._checkboxDisabled ? 'disabled ' : ''}${getBooleanValue(cellValue) ? 'checked' : ''}><span>${item._checkboxLabel}</span></div></div></div></td>`;
|
|
561
636
|
}
|
|
562
|
-
return `<td class="${classNames.join(' ')}" title="${cellValue}"><div
|
|
637
|
+
return `<td class="${classNames.join(' ')}" title="${cellValue}"><div style="${getCellWidthStyle(column)}"><div class="vxe-table--tree-node-wrapper" style="padding-left: ${item._level * treeOpts.indent}px"><div class="vxe-table--tree-icon-wrapper">${treeIcon}</div><div class="vxe-table--tree-cell">${cellValue}</div></div></div></td>`;
|
|
563
638
|
}
|
|
564
639
|
if (column.type === 'radio') {
|
|
565
|
-
return `<td class="${classNames.join(' ')}"><div
|
|
640
|
+
return `<td class="${classNames.join(' ')}"><div style="${getCellWidthStyle(column)}"><input type="radio" name="radio_${id}" ${item._radioDisabled ? 'disabled ' : ''}${getBooleanValue(cellValue) ? 'checked' : ''}><span>${item._radioLabel}</span></div></td>`;
|
|
566
641
|
}
|
|
567
642
|
else if (column.type === 'checkbox') {
|
|
568
|
-
return `<td class="${classNames.join(' ')}"><div
|
|
643
|
+
return `<td class="${classNames.join(' ')}"><div style="${getCellWidthStyle(column)}"><input type="checkbox" ${item._checkboxDisabled ? 'disabled ' : ''}${getBooleanValue(cellValue) ? 'checked' : ''}><span>${item._checkboxLabel}</span></div></td>`;
|
|
569
644
|
}
|
|
570
|
-
return `<td class="${classNames.join(' ')}" title="${cellValue}"><div
|
|
645
|
+
return `<td class="${classNames.join(' ')}" title="${cellValue}"><div style="${getCellWidthStyle(column)}">${formatText(cellValue, true)}</div></td>`;
|
|
571
646
|
}).join('') + '</tr>');
|
|
572
647
|
});
|
|
573
648
|
}
|
|
@@ -601,12 +676,12 @@ function toHtml($xeTable, opts, columns, datas) {
|
|
|
601
676
|
classNames.push(`col--${cellAlign}`);
|
|
602
677
|
}
|
|
603
678
|
if (column.type === 'radio') {
|
|
604
|
-
return `<td class="${classNames.join(' ')}" rowspan="${rowSpan}" colspan="${colSpan}"><div
|
|
679
|
+
return `<td class="${classNames.join(' ')}" rowspan="${rowSpan}" colspan="${colSpan}"><div style="${getCellWidthStyle(column)}"><input type="radio" name="radio_${id}" ${item._radioDisabled ? 'disabled ' : ''}${getBooleanValue(cellValue) ? 'checked' : ''}><span>${item._radioLabel}</span></div></td>`;
|
|
605
680
|
}
|
|
606
681
|
else if (column.type === 'checkbox') {
|
|
607
|
-
return `<td class="${classNames.join(' ')}" rowspan="${rowSpan}" colspan="${colSpan}"><div
|
|
682
|
+
return `<td class="${classNames.join(' ')}" rowspan="${rowSpan}" colspan="${colSpan}"><div style="${getCellWidthStyle(column)}"><input type="checkbox" ${item._checkboxDisabled ? 'disabled ' : ''}${getBooleanValue(cellValue) ? 'checked' : ''}><span>${item._checkboxLabel}</span></div></td>`;
|
|
608
683
|
}
|
|
609
|
-
return `<td class="${classNames.join(' ')}" rowspan="${rowSpan}" colspan="${colSpan}" title="${cellValue}"><div
|
|
684
|
+
return `<td class="${classNames.join(' ')}" rowspan="${rowSpan}" colspan="${colSpan}" title="${cellValue}"><div style="${getCellWidthStyle(column)}">${formatText(cellValue, true)}</div></td>`;
|
|
610
685
|
}).join('') + '</tr>');
|
|
611
686
|
});
|
|
612
687
|
}
|
|
@@ -644,7 +719,7 @@ function toHtml($xeTable, opts, columns, datas) {
|
|
|
644
719
|
if (footAlign) {
|
|
645
720
|
classNames.push(`col--${footAlign}`);
|
|
646
721
|
}
|
|
647
|
-
return `<td class="${classNames.join(' ')}" rowspan="${rowSpan}" colspan="${colSpan}" title="${cellValue}"><div
|
|
722
|
+
return `<td class="${classNames.join(' ')}" rowspan="${rowSpan}" colspan="${colSpan}" title="${cellValue}"><div style="${getCellWidthStyle(column)}">${formatText(cellValue, true)}</div></td>`;
|
|
648
723
|
}).join('')}</tr>`);
|
|
649
724
|
});
|
|
650
725
|
tables.push('</tfoot>');
|
|
@@ -653,7 +728,7 @@ function toHtml($xeTable, opts, columns, datas) {
|
|
|
653
728
|
// 是否半选状态
|
|
654
729
|
const script = !isAllSelected && isIndeterminate ? `<script>(function(){var a=document.querySelector(".${allCls}");if(a){a.indeterminate=true}})()</script>` : '';
|
|
655
730
|
tables.push('</table>', script);
|
|
656
|
-
return
|
|
731
|
+
return isAutoWidth ? tables.join('') : createHtmlPage(opts, tables.join(''));
|
|
657
732
|
}
|
|
658
733
|
function toXML($xeTable, opts, columns, datas) {
|
|
659
734
|
const reactData = $xeTable;
|
|
@@ -1216,6 +1291,9 @@ function handleExportAndPrint($xeTable, options, isPrint) {
|
|
|
1216
1291
|
if (!typeList.some(item => item.value === type)) {
|
|
1217
1292
|
exportParams.type = typeList[0].value;
|
|
1218
1293
|
}
|
|
1294
|
+
if (!exportParams.widthMode) {
|
|
1295
|
+
exportParams.widthMode = '';
|
|
1296
|
+
}
|
|
1219
1297
|
initStore.export = true;
|
|
1220
1298
|
return $xeTable.$nextTick();
|
|
1221
1299
|
}
|
|
@@ -1355,7 +1433,7 @@ export default {
|
|
|
1355
1433
|
return isChecked;
|
|
1356
1434
|
}, { children: 'children', mapChildren: 'childNodes', original: true });
|
|
1357
1435
|
}
|
|
1358
|
-
const handleOptions = Object.assign({}, opts, { filename: '', sheetName: '' });
|
|
1436
|
+
const handleOptions = Object.assign({}, opts, { filename: '', sheetName: '', _columnConfs: columns });
|
|
1359
1437
|
// 如果设置源数据,则默认导出设置了字段的列
|
|
1360
1438
|
if (!isCustomCol && !columnFilterMethod) {
|
|
1361
1439
|
columnFilterMethod = ({ column }) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// 默认导出或打印的 HTML 样式
|
|
2
|
-
const defaultHtmlStyle = 'body{
|
|
2
|
+
const defaultHtmlStyle = 'body{padding:0;color:rgba(0,0,0,0.7);font-family:"Microsoft YaHei",微软雅黑,"MicrosoftJhengHei",华文细黑,STHeiti,MingLiu;}body *{-webkit-box-sizing:border-box;box-sizing:border-box;}.vxe-table{border-collapse:collapse;text-align:left;border-spacing:0;}.vxe-table.is--default-width,.vxe-table.is--auto-width{width:100%;}.vxe-table.is--scale-width{table-layout:fixed;}.vxe-table,.vxe-table th,.vxe-table td,.vxe-table td{word-break:break-all;border-color:#D0D0D0;border-style:solid;border-width:0;}.border--default,.border--full,.border--outer{border-top-width:1px;}.border--default,.border--full,.border--outer{border-left-width:1px}.border--outer,.border--default th,.border--default td,.border--full th,.border--full td,.border--outer th,.border--inner th,.border--inner td{border-bottom-width:1px;}.border--default,.border--outer,.border--full th,.border--full td{border-right-width:1px;}.border--default th,.border--full th,.border--outer th{background-color:#f8f8f9;}.vxe-table td>div,.vxe-table th>div{padding:0.5em 0.4em;}.col--center{text-align:center;}.col--right{text-align:right;}.vxe-table .col--ellipsis>div{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:break-all;}.vxe-table--tree-node{text-align:left;}.vxe-table--tree-node-wrapper{position:relative;}.vxe-table--tree-icon-wrapper{position:absolute;top:50%;width:1em;height:1em;text-align:center;-webkit-transform:translateY(-50%);transform:translateY(-50%);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;}.vxe-table--tree-unfold-icon,.vxe-table--tree-fold-icon{position:absolute;width:0;height:0;border-style:solid;border-width:0.5em;border-right-color:transparent;border-bottom-color:transparent;}.vxe-table--tree-unfold-icon{left:.3em;top:0;border-left-color:#939599;border-top-color:transparent;}.vxe-table--tree-fold-icon{left:0;top:.3em;border-left-color:transparent;border-top-color:#939599;}.vxe-table--tree-cell{display:block;padding-left:1.5em;}.vxe-table input[type="checkbox"]{margin:0;}.vxe-table input[type="checkbox"],.vxe-table input[type="radio"],.vxe-table input[type="checkbox"]+span,.vxe-table input[type="radio"]+span{vertical-align:middle;padding-left:0.4em}';
|
|
3
3
|
export function getExportBlobByContent(content, options) {
|
|
4
4
|
return new Blob([content], { type: `text/${options.type};charset=utf-8;` });
|
|
5
5
|
}
|
package/es/table/src/body.js
CHANGED
|
@@ -122,7 +122,7 @@ function renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowL
|
|
|
122
122
|
const cellOverflow = XEUtils.eqNull(showOverflow) ? allShowOverflow : showOverflow;
|
|
123
123
|
const showEllipsis = cellOverflow === 'ellipsis';
|
|
124
124
|
const showTitle = cellOverflow === 'title';
|
|
125
|
-
const showTooltip = cellOverflow === true
|
|
125
|
+
const showTooltip = cellOverflow === true ? tooltipOpts.mode === 'tooltip' : cellOverflow === 'tooltip';
|
|
126
126
|
const hasEllipsis = isAllOverflow || showTitle || showTooltip || showEllipsis;
|
|
127
127
|
const showResizable = (XEUtils.isBoolean(column.resizable) ? column.resizable : (columnOpts.resizable || allResizable));
|
|
128
128
|
const isCsHeight = !!customCellHeight;
|
package/es/table/src/footer.js
CHANGED
|
@@ -41,7 +41,7 @@ function renderRows(h, _vm, isOptimizeMode, tableColumn, footerTableData, row, $
|
|
|
41
41
|
const footAlign = footerAlign || (compConf ? compConf.tableFooterCellAlign : '') || allFooterAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign;
|
|
42
42
|
const showEllipsis = footOverflow === 'ellipsis';
|
|
43
43
|
const showTitle = footOverflow === 'title';
|
|
44
|
-
const showTooltip = footOverflow === true
|
|
44
|
+
const showTooltip = footOverflow === true ? footerTooltipOpts.mode === 'tooltip' : footOverflow === 'tooltip';
|
|
45
45
|
const hasEllipsis = showTitle || showTooltip || showEllipsis;
|
|
46
46
|
const showResizable = (XEUtils.isBoolean(column.resizable) ? column.resizable : (columnOpts.resizable || allResizable));
|
|
47
47
|
const attrs = { colid };
|
package/es/table/src/header.js
CHANGED
|
@@ -22,6 +22,7 @@ function renderRows(h, _vm, isGroup, isOptimizeMode, headerGroups, _rowIndex, co
|
|
|
22
22
|
const virtualXOpts = $xeTable.computeVirtualXOpts;
|
|
23
23
|
const columnOpts = $xeTable.computeColumnOpts;
|
|
24
24
|
const columnDragOpts = $xeTable.computeColumnDragOpts;
|
|
25
|
+
const headerTooltipOpts = $xeTable.computeHeaderTooltipOpts;
|
|
25
26
|
const cellOpts = $xeTable.computeCellOpts;
|
|
26
27
|
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
27
28
|
const headerCellOpts = $xeTable.computeHeaderCellOpts;
|
|
@@ -42,7 +43,7 @@ function renderRows(h, _vm, isGroup, isOptimizeMode, headerGroups, _rowIndex, co
|
|
|
42
43
|
const headAlign = headerAlign || (compConf ? compConf.tableHeaderCellAlign : '') || allHeaderAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign;
|
|
43
44
|
const showEllipsis = headOverflow === 'ellipsis';
|
|
44
45
|
const showTitle = headOverflow === 'title';
|
|
45
|
-
const showTooltip = headOverflow === true
|
|
46
|
+
const showTooltip = headOverflow === true ? headerTooltipOpts.mode === 'tooltip' : headOverflow === 'tooltip';
|
|
46
47
|
const hasEllipsis = showTitle || showTooltip || showEllipsis;
|
|
47
48
|
let hasFilter = false;
|
|
48
49
|
let firstFilterOption = null;
|
|
@@ -214,6 +215,7 @@ function renderFilterRows(h, _vm, isOptimizeMode, cols) {
|
|
|
214
215
|
const { showHeaderOverflow: allColumnHeaderOverflow, headerAlign: allHeaderAlign, align: allAlign } = tableProps;
|
|
215
216
|
const { currentColumn, overflowX } = tableReactData;
|
|
216
217
|
const { fullColumnIdData } = tableInternalData;
|
|
218
|
+
const headerTooltipOpts = $xeTable.computeHeaderTooltipOpts;
|
|
217
219
|
const cellOpts = $xeTable.computeCellOpts;
|
|
218
220
|
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
219
221
|
const headerCellOpts = $xeTable.computeHeaderCellOpts;
|
|
@@ -235,7 +237,7 @@ function renderFilterRows(h, _vm, isOptimizeMode, cols) {
|
|
|
235
237
|
const headAlign = headerAlign || (compConf ? compConf.tableHeaderCellAlign : '') || allHeaderAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign;
|
|
236
238
|
const showEllipsis = headOverflow === 'ellipsis';
|
|
237
239
|
const showTitle = headOverflow === 'title';
|
|
238
|
-
const showTooltip = headOverflow === true
|
|
240
|
+
const showTooltip = headOverflow === true ? headerTooltipOpts.mode === 'tooltip' : headOverflow === 'tooltip';
|
|
239
241
|
const hasEllipsis = showTitle || showTooltip || showEllipsis;
|
|
240
242
|
let hasFilter = false;
|
|
241
243
|
let firstFilterOption = null;
|
package/es/table/src/table.js
CHANGED
|
@@ -1913,35 +1913,35 @@ export default {
|
|
|
1913
1913
|
// 使用已安装的组件,如果未安装则不渲染
|
|
1914
1914
|
const VxeUILoadingComponent = VxeUI.getComponent('VxeLoading');
|
|
1915
1915
|
const VxeUITooltipComponent = VxeUI.getComponent('VxeTooltip');
|
|
1916
|
+
const { showOverflow, showHeaderOverflow, showFooterOverflow } = props;
|
|
1917
|
+
const tooltipOpts = $xeTable.computeTooltipOpts;
|
|
1918
|
+
const headerTooltipOpts = $xeTable.computeHeaderTooltipOpts;
|
|
1919
|
+
const footerTooltipOpts = $xeTable.computeFooterTooltipOpts;
|
|
1916
1920
|
if (props.loading) {
|
|
1917
1921
|
if (!VxeUILoadingComponent && !this.$scopedSlots.loading) {
|
|
1918
|
-
errLog('vxe.error.errProp', ['loading=true', 'loading=false | <template #loading>...</template>']);
|
|
1919
1922
|
errLog('vxe.error.reqComp', ['vxe-loading']);
|
|
1923
|
+
errLog('vxe.error.errProp', ['loading=true', 'loading=false | <template #loading>...</template>']);
|
|
1920
1924
|
}
|
|
1921
1925
|
}
|
|
1922
|
-
if (
|
|
1923
|
-
(
|
|
1924
|
-
(
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
if (props.showFooterOverflow === 'tooltip') {
|
|
1942
|
-
errLog('vxe.error.errProp', ['show-footer-overflow=tooltip', 'show-footer-overflow=title']);
|
|
1943
|
-
}
|
|
1944
|
-
errLog('vxe.error.reqComp', ['vxe-tooltip']);
|
|
1926
|
+
if (!VxeUITooltipComponent) {
|
|
1927
|
+
errLog('vxe.error.reqComp', ['vxe-tooltip']);
|
|
1928
|
+
if (showOverflow === 'tooltip') {
|
|
1929
|
+
errLog('vxe.error.errProp', ['show-overflow=' + showOverflow, 'show-overflow=false,title,ellipsis']);
|
|
1930
|
+
}
|
|
1931
|
+
if (showOverflow === true && tooltipOpts.mode === 'tooltip') {
|
|
1932
|
+
errLog('vxe.error.notSupportProp', ['show-overflow=' + showOverflow, 'tooltip-config.mode=tooltip', 'tooltip-config.mode=title,ellipsis']);
|
|
1933
|
+
}
|
|
1934
|
+
if (showHeaderOverflow === 'tooltip') {
|
|
1935
|
+
errLog('vxe.error.errProp', ['show-header-overflow=' + showHeaderOverflow, 'show-header-overflow=false,title,ellipsis']);
|
|
1936
|
+
}
|
|
1937
|
+
if (showHeaderOverflow === true && headerTooltipOpts.mode === 'tooltip') {
|
|
1938
|
+
errLog('vxe.error.notSupportProp', ['show-header-overflow=' + showHeaderOverflow, 'header-tooltip-config.mode=tooltip', 'header-tooltip-config.mode=title,ellipsis']);
|
|
1939
|
+
}
|
|
1940
|
+
if (showFooterOverflow === 'tooltip') {
|
|
1941
|
+
errLog('vxe.error.errProp', ['show-footer-overflow=' + showFooterOverflow, 'show-footer-overflow=false,title,ellipsis']);
|
|
1942
|
+
}
|
|
1943
|
+
if (showFooterOverflow === true && footerTooltipOpts.mode === 'tooltip') {
|
|
1944
|
+
errLog('vxe.error.notSupportProp', ['show-footer-overflow=' + showFooterOverflow, 'footer-tooltip-config.mode=tooltip', 'footer-tooltip-config.mode=title,ellipsis']);
|
|
1945
1945
|
}
|
|
1946
1946
|
}
|
|
1947
1947
|
if (this.autoResize) {
|
package/es/table/src/util.js
CHANGED
package/es/ui/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VxeUI } from '@vxe-ui/core';
|
|
2
2
|
import { getFuncText } from './src/utils';
|
|
3
|
-
export const version = "3.22.
|
|
3
|
+
export const version = "3.22.3";
|
|
4
4
|
VxeUI.version = version;
|
|
5
5
|
VxeUI.tableVersion = version;
|
|
6
6
|
VxeUI.setConfig({
|
|
@@ -67,6 +67,7 @@ VxeUI.setConfig({
|
|
|
67
67
|
strict: true
|
|
68
68
|
},
|
|
69
69
|
tooltipConfig: {
|
|
70
|
+
mode: 'tooltip',
|
|
70
71
|
enterable: true,
|
|
71
72
|
defaultPlacement: 'top'
|
|
72
73
|
},
|
package/es/ui/src/log.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VxeUI } from '@vxe-ui/core';
|
|
2
2
|
const { log } = VxeUI;
|
|
3
|
-
const tableVersion = `table v${"3.22.
|
|
3
|
+
const tableVersion = `table v${"3.22.3"}`;
|
|
4
4
|
export function createComponentLog(name) {
|
|
5
5
|
const uiVersion = VxeUI.uiVersion ? `ui v${VxeUI.uiVersion}` : '';
|
|
6
6
|
const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : '';
|