vxe-table 3.12.1-beta.2 → 3.12.1-beta.4
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 +2 -1
- package/es/locale/lang/de-DE.js +2 -1
- package/es/locale/lang/en-US.js +2 -1
- package/es/locale/lang/es-ES.js +2 -1
- package/es/locale/lang/fr-FR.js +2 -1
- package/es/locale/lang/hu-HU.js +2 -1
- package/es/locale/lang/hy-AM.js +2 -1
- package/es/locale/lang/it-IT.js +2 -1
- package/es/locale/lang/ja-JP.js +2 -1
- package/es/locale/lang/ko-KR.js +2 -1
- package/es/locale/lang/nb-NO.js +2 -1
- package/es/locale/lang/pt-BR.js +2 -1
- package/es/locale/lang/ru-RU.js +2 -1
- package/es/locale/lang/th-TH.js +2 -1
- package/es/locale/lang/ug-CN.js +2 -1
- package/es/locale/lang/uk-UA.js +2 -1
- package/es/locale/lang/vi-VN.js +2 -1
- package/es/locale/lang/zh-CHT.js +2 -1
- package/es/locale/lang/zh-CN.js +2 -1
- package/es/style.css +1 -1
- package/es/table/module/edit/mixin.js +5 -5
- package/es/table/src/body.js +4 -3
- package/es/table/src/cell.js +73 -50
- package/es/table/src/header.js +10 -7
- package/es/table/src/methods.js +503 -450
- package/es/table/src/table.js +2 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +704 -597
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +2 -1
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/de-DE.js +2 -1
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/en-US.js +2 -1
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +2 -1
- package/lib/locale/lang/es-ES.js +2 -1
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +2 -1
- package/lib/locale/lang/fr-FR.js +2 -1
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/hu-HU.js +2 -1
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +2 -1
- package/lib/locale/lang/hy-AM.js +2 -1
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/it-IT.js +2 -1
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/ja-JP.js +2 -1
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +2 -1
- package/lib/locale/lang/ko-KR.js +2 -1
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +2 -1
- package/lib/locale/lang/nb-NO.js +2 -1
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/pt-BR.js +2 -1
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +2 -1
- package/lib/locale/lang/ru-RU.js +2 -1
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +2 -1
- package/lib/locale/lang/th-TH.js +2 -1
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/ug-CN.js +2 -1
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/uk-UA.js +2 -1
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +2 -1
- package/lib/locale/lang/vi-VN.js +2 -1
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +2 -1
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +2 -1
- package/lib/locale/lang/zh-CN.js +2 -1
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +2 -1
- package/lib/style.css +1 -1
- package/lib/table/module/edit/mixin.js +10 -5
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/src/body.js +4 -2
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +87 -54
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/header.js +11 -6
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +585 -526
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +2 -1
- package/lib/table/src/table.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/locale/lang/ar-EG.ts +2 -1
- package/packages/locale/lang/de-DE.ts +2 -1
- package/packages/locale/lang/en-US.ts +2 -1
- package/packages/locale/lang/es-ES.ts +2 -1
- package/packages/locale/lang/fr-FR.ts +2 -1
- package/packages/locale/lang/hu-HU.ts +2 -1
- package/packages/locale/lang/hy-AM.ts +2 -1
- package/packages/locale/lang/it-IT.ts +2 -1
- package/packages/locale/lang/ja-JP.ts +2 -1
- package/packages/locale/lang/ko-KR.ts +2 -1
- package/packages/locale/lang/nb-NO.ts +2 -1
- package/packages/locale/lang/pt-BR.ts +2 -1
- package/packages/locale/lang/ru-RU.ts +2 -1
- package/packages/locale/lang/th-TH.ts +2 -1
- package/packages/locale/lang/ug-CN.ts +2 -1
- package/packages/locale/lang/uk-UA.ts +2 -1
- package/packages/locale/lang/vi-VN.ts +2 -1
- package/packages/locale/lang/zh-CHT.ts +2 -1
- package/packages/locale/lang/zh-CN.ts +2 -1
- package/packages/table/module/edit/mixin.ts +5 -5
- package/packages/table/src/body.ts +4 -2
- package/packages/table/src/cell.ts +78 -46
- package/packages/table/src/header.ts +13 -10
- package/packages/table/src/methods.ts +523 -459
- package/packages/table/src/table.ts +3 -1
- /package/es/{iconfont.1735881990049.ttf → iconfont.1735908447074.ttf} +0 -0
- /package/es/{iconfont.1735881990049.woff → iconfont.1735908447074.woff} +0 -0
- /package/es/{iconfont.1735881990049.woff2 → iconfont.1735908447074.woff2} +0 -0
- /package/lib/{iconfont.1735881990049.ttf → iconfont.1735908447074.ttf} +0 -0
- /package/lib/{iconfont.1735881990049.woff → iconfont.1735908447074.woff} +0 -0
- /package/lib/{iconfont.1735881990049.woff2 → iconfont.1735908447074.woff2} +0 -0
package/es/table/src/cell.js
CHANGED
|
@@ -242,60 +242,83 @@ function getDefaultCellLabel(params) {
|
|
|
242
242
|
const { $table, row, column } = params;
|
|
243
243
|
return formatText($table.getCellLabel(row, column), 1);
|
|
244
244
|
}
|
|
245
|
+
function renderCellHandle(h, params) {
|
|
246
|
+
const { column, $table } = params;
|
|
247
|
+
const tableProps = $table;
|
|
248
|
+
const { editConfig } = tableProps;
|
|
249
|
+
const { type, treeNode, editRender } = column;
|
|
250
|
+
const checkboxOpts = $table.computeCheckboxOpts;
|
|
251
|
+
const editOpts = $table.computeEditOpts;
|
|
252
|
+
switch (type) {
|
|
253
|
+
case 'seq':
|
|
254
|
+
return treeNode ? Cell.renderTreeIndexCell(h, params) : Cell.renderSeqCell(h, params);
|
|
255
|
+
case 'radio':
|
|
256
|
+
return treeNode ? Cell.renderTreeRadioCell(h, params) : Cell.renderRadioCell(h, params);
|
|
257
|
+
case 'checkbox':
|
|
258
|
+
return checkboxOpts.checkField ? (treeNode ? Cell.renderTreeSelectionCellByProp(h, params) : Cell.renderCheckboxCellByProp(h, params)) : (treeNode ? Cell.renderTreeSelectionCell(h, params) : Cell.renderCheckboxCell(h, params));
|
|
259
|
+
case 'expand':
|
|
260
|
+
return Cell.renderExpandCell(h, params);
|
|
261
|
+
case 'html':
|
|
262
|
+
return treeNode ? Cell.renderTreeHTMLCell(h, params) : Cell.renderHTMLCell(h, params);
|
|
263
|
+
}
|
|
264
|
+
if (editConfig && editRender) {
|
|
265
|
+
return editOpts.mode === 'cell' ? (treeNode ? Cell.renderTreeCellEdit(h, params) : Cell.renderCellEdit(h, params)) : (treeNode ? Cell.renderTreeRowEdit(h, params) : Cell.renderRowEdit(h, params));
|
|
266
|
+
}
|
|
267
|
+
return treeNode ? Cell.renderTreeCell(h, params) : Cell.renderDefaultCell(h, params);
|
|
268
|
+
}
|
|
269
|
+
function renderHeaderHandle(h, params) {
|
|
270
|
+
const { column, $table } = params;
|
|
271
|
+
const tableProps = $table;
|
|
272
|
+
const { editConfig } = tableProps;
|
|
273
|
+
const { type, filters, sortable, editRender } = column;
|
|
274
|
+
switch (type) {
|
|
275
|
+
case 'seq':
|
|
276
|
+
return Cell.renderSeqHeader(h, params);
|
|
277
|
+
case 'radio':
|
|
278
|
+
return Cell.renderRadioHeader(h, params);
|
|
279
|
+
case 'checkbox':
|
|
280
|
+
return Cell.renderCheckboxHeader(h, params);
|
|
281
|
+
case 'html':
|
|
282
|
+
if (filters && sortable) {
|
|
283
|
+
return Cell.renderSortAndFilterHeader(h, params);
|
|
284
|
+
}
|
|
285
|
+
else if (sortable) {
|
|
286
|
+
return Cell.renderSortHeader(h, params);
|
|
287
|
+
}
|
|
288
|
+
else if (filters) {
|
|
289
|
+
return Cell.renderFilterHeader(h, params);
|
|
290
|
+
}
|
|
291
|
+
break;
|
|
292
|
+
}
|
|
293
|
+
if (editConfig && editRender) {
|
|
294
|
+
return Cell.renderEditHeader(h, params);
|
|
295
|
+
}
|
|
296
|
+
else if (filters && sortable) {
|
|
297
|
+
return Cell.renderSortAndFilterHeader(h, params);
|
|
298
|
+
}
|
|
299
|
+
else if (sortable) {
|
|
300
|
+
return Cell.renderSortHeader(h, params);
|
|
301
|
+
}
|
|
302
|
+
else if (filters) {
|
|
303
|
+
return Cell.renderFilterHeader(h, params);
|
|
304
|
+
}
|
|
305
|
+
return Cell.renderDefaultHeader(h, params);
|
|
306
|
+
}
|
|
307
|
+
function renderFooterHandle(h, params) {
|
|
308
|
+
return Cell.renderDefaultFooter(h, params);
|
|
309
|
+
}
|
|
245
310
|
export const Cell = {
|
|
246
311
|
createColumn($xetable, _vm) {
|
|
247
|
-
const { type
|
|
248
|
-
const
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
renderFooter: this.renderDefaultFooter
|
|
312
|
+
const { type } = _vm;
|
|
313
|
+
const renConfs = {
|
|
314
|
+
renderHeader: renderHeaderHandle,
|
|
315
|
+
renderCell: renderCellHandle,
|
|
316
|
+
renderFooter: renderFooterHandle
|
|
253
317
|
};
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
renMaps.renderHeader = this.renderSeqHeader;
|
|
257
|
-
renMaps.renderCell = treeNode ? this.renderTreeIndexCell : this.renderSeqCell;
|
|
258
|
-
break;
|
|
259
|
-
case 'radio':
|
|
260
|
-
renMaps.renderHeader = this.renderRadioHeader;
|
|
261
|
-
renMaps.renderCell = treeNode ? this.renderTreeRadioCell : this.renderRadioCell;
|
|
262
|
-
break;
|
|
263
|
-
case 'checkbox':
|
|
264
|
-
renMaps.renderHeader = this.renderCheckboxHeader;
|
|
265
|
-
renMaps.renderCell = checkboxOpts.checkField ? (treeNode ? this.renderTreeSelectionCellByProp : this.renderCheckboxCellByProp) : (treeNode ? this.renderTreeSelectionCell : this.renderCheckboxCell);
|
|
266
|
-
break;
|
|
267
|
-
case 'expand':
|
|
268
|
-
renMaps.renderCell = this.renderExpandCell;
|
|
269
|
-
renMaps.renderData = this.renderExpandData;
|
|
270
|
-
break;
|
|
271
|
-
case 'html':
|
|
272
|
-
renMaps.renderCell = treeNode ? this.renderTreeHTMLCell : this.renderHTMLCell;
|
|
273
|
-
if (filters && (sortable || remoteSort)) {
|
|
274
|
-
renMaps.renderHeader = this.renderSortAndFilterHeader;
|
|
275
|
-
}
|
|
276
|
-
else if (sortable || remoteSort) {
|
|
277
|
-
renMaps.renderHeader = this.renderSortHeader;
|
|
278
|
-
}
|
|
279
|
-
else if (filters) {
|
|
280
|
-
renMaps.renderHeader = this.renderFilterHeader;
|
|
281
|
-
}
|
|
282
|
-
break;
|
|
283
|
-
default:
|
|
284
|
-
if (editConfig && editRender) {
|
|
285
|
-
renMaps.renderHeader = this.renderEditHeader;
|
|
286
|
-
renMaps.renderCell = editOpts.mode === 'cell' ? (treeNode ? this.renderTreeCellEdit : this.renderCellEdit) : (treeNode ? this.renderTreeRowEdit : this.renderRowEdit);
|
|
287
|
-
}
|
|
288
|
-
else if (filters && (sortable || remoteSort)) {
|
|
289
|
-
renMaps.renderHeader = this.renderSortAndFilterHeader;
|
|
290
|
-
}
|
|
291
|
-
else if (sortable || remoteSort) {
|
|
292
|
-
renMaps.renderHeader = this.renderSortHeader;
|
|
293
|
-
}
|
|
294
|
-
else if (filters) {
|
|
295
|
-
renMaps.renderHeader = this.renderFilterHeader;
|
|
296
|
-
}
|
|
318
|
+
if (type === 'expand') {
|
|
319
|
+
renConfs.renderData = Cell.renderExpandData;
|
|
297
320
|
}
|
|
298
|
-
return createColumn($xetable, _vm,
|
|
321
|
+
return createColumn($xetable, _vm, renConfs);
|
|
299
322
|
},
|
|
300
323
|
/**
|
|
301
324
|
* 列头标题
|
package/es/table/src/header.js
CHANGED
|
@@ -3,7 +3,7 @@ import { VxeUI } from '../../ui';
|
|
|
3
3
|
import { getClass } from '../../ui/src/utils';
|
|
4
4
|
import { getOffsetPos, hasClass, addClass, removeClass } from '../../ui/src/dom';
|
|
5
5
|
import { convertHeaderColumnToRows, getColReMinWidth } from './util';
|
|
6
|
-
const { renderer, renderEmptyElement } = VxeUI;
|
|
6
|
+
const { getI18n, renderer, renderEmptyElement } = VxeUI;
|
|
7
7
|
const cellType = 'header';
|
|
8
8
|
const renderRows = (h, _vm, cols, $rowIndex) => {
|
|
9
9
|
const $xeTable = _vm.$parent;
|
|
@@ -100,7 +100,8 @@ const renderRows = (h, _vm, cols, $rowIndex) => {
|
|
|
100
100
|
'is--line': !border || border === 'none'
|
|
101
101
|
}],
|
|
102
102
|
on: {
|
|
103
|
-
mousedown: (evnt) => _vm.
|
|
103
|
+
mousedown: (evnt) => _vm.resizeMousedownEvent(evnt, params),
|
|
104
|
+
dblclick: (evnt) => $xeTable.handleResizeDblclickEvent(evnt, params)
|
|
104
105
|
}
|
|
105
106
|
})
|
|
106
107
|
: null
|
|
@@ -321,7 +322,7 @@ export default {
|
|
|
321
322
|
const { $parent: $xetable } = this;
|
|
322
323
|
this.headerColumn = $xetable.isGroup ? convertHeaderColumnToRows(this.tableGroupColumn) : [];
|
|
323
324
|
},
|
|
324
|
-
|
|
325
|
+
resizeMousedownEvent(evnt, params) {
|
|
325
326
|
const $xeTable = this.$parent;
|
|
326
327
|
const tableInternalData = $xeTable;
|
|
327
328
|
const { column } = params;
|
|
@@ -332,15 +333,17 @@ export default {
|
|
|
332
333
|
const resizeBarElem = $xetable.$refs.resizeBar;
|
|
333
334
|
const resizeTipElem = $xetable.$refs.refCellResizeTip;
|
|
334
335
|
const wrapperElem = this.$el;
|
|
335
|
-
const {
|
|
336
|
-
const
|
|
336
|
+
const { clientX: dragClientX } = evnt;
|
|
337
|
+
const dragBtnElem = evnt.target;
|
|
338
|
+
const cell = dragBtnElem.parentNode;
|
|
339
|
+
const cellParams = Object.assign(params, { cell });
|
|
337
340
|
const resizableOpts = $xeTable.computeResizableOpts;
|
|
338
341
|
let dragLeft = 0;
|
|
339
342
|
const tableBodyElem = tableBody.$el;
|
|
340
343
|
const pos = getOffsetPos(dragBtnElem, tableEl);
|
|
341
344
|
const dragBtnWidth = dragBtnElem.clientWidth;
|
|
342
345
|
const dragBtnOffsetWidth = Math.floor(dragBtnWidth / 2);
|
|
343
|
-
const minInterval = getColReMinWidth(
|
|
346
|
+
const minInterval = getColReMinWidth(cellParams) - dragBtnOffsetWidth; // 列之间的最小间距
|
|
344
347
|
let dragMinLeft = pos.left - cell.clientWidth + dragBtnWidth + minInterval;
|
|
345
348
|
let dragPosLeft = pos.left + dragBtnOffsetWidth;
|
|
346
349
|
const domMousemove = document.onmousemove;
|
|
@@ -403,7 +406,7 @@ export default {
|
|
|
403
406
|
}
|
|
404
407
|
resizeTipElem.style.left = `${resizeTipLeft}px`;
|
|
405
408
|
resizeTipElem.style.top = `${Math.min(tableEl.clientHeight - resizeTipHeight, Math.max(0, evnt.clientY - wrapperRect.y - resizeTipHeight / 2))}px`;
|
|
406
|
-
resizeTipElem.textContent =
|
|
409
|
+
resizeTipElem.textContent = getI18n('vxe.table.resizeColTip', [column.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft)]);
|
|
407
410
|
}
|
|
408
411
|
};
|
|
409
412
|
$xetable._isResize = true;
|