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
|
@@ -265,55 +265,87 @@ function getDefaultCellLabel (params: VxeTableDefines.CellRenderBodyParams) {
|
|
|
265
265
|
return formatText($table.getCellLabel(row, column), 1)
|
|
266
266
|
}
|
|
267
267
|
|
|
268
|
+
function renderCellHandle (h: CreateElement, params: VxeTableDefines.CellRenderBodyParams & {
|
|
269
|
+
$table: VxeTableConstructor & VxeTablePrivateMethods;
|
|
270
|
+
}) {
|
|
271
|
+
const { column, $table } = params
|
|
272
|
+
const tableProps = $table
|
|
273
|
+
const { editConfig } = tableProps
|
|
274
|
+
const { type, treeNode, editRender } = column
|
|
275
|
+
const checkboxOpts = $table.computeCheckboxOpts
|
|
276
|
+
const editOpts = $table.computeEditOpts
|
|
277
|
+
switch (type) {
|
|
278
|
+
case 'seq':
|
|
279
|
+
return treeNode ? Cell.renderTreeIndexCell(h, params) : Cell.renderSeqCell(h, params)
|
|
280
|
+
case 'radio':
|
|
281
|
+
return treeNode ? Cell.renderTreeRadioCell(h, params) : Cell.renderRadioCell(h, params)
|
|
282
|
+
case 'checkbox':
|
|
283
|
+
return checkboxOpts.checkField ? (treeNode ? Cell.renderTreeSelectionCellByProp(h, params) : Cell.renderCheckboxCellByProp(h, params)) : (treeNode ? Cell.renderTreeSelectionCell(h, params) : Cell.renderCheckboxCell(h, params))
|
|
284
|
+
case 'expand':
|
|
285
|
+
return Cell.renderExpandCell(h, params)
|
|
286
|
+
case 'html':
|
|
287
|
+
return treeNode ? Cell.renderTreeHTMLCell(h, params) : Cell.renderHTMLCell(h, params)
|
|
288
|
+
}
|
|
289
|
+
if (editConfig && editRender) {
|
|
290
|
+
return editOpts.mode === 'cell' ? (treeNode ? Cell.renderTreeCellEdit(h, params) : Cell.renderCellEdit(h, params)) : (treeNode ? Cell.renderTreeRowEdit(h, params) : Cell.renderRowEdit(h, params))
|
|
291
|
+
}
|
|
292
|
+
return treeNode ? Cell.renderTreeCell(h, params) : Cell.renderDefaultCell(h, params)
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
function renderHeaderHandle (h: CreateElement, params: VxeTableDefines.CellRenderHeaderParams & {
|
|
296
|
+
$table: VxeTableConstructor & VxeTablePrivateMethods;
|
|
297
|
+
}) {
|
|
298
|
+
const { column, $table } = params
|
|
299
|
+
const tableProps = $table
|
|
300
|
+
const { editConfig } = tableProps
|
|
301
|
+
const { type, filters, sortable, editRender } = column
|
|
302
|
+
switch (type) {
|
|
303
|
+
case 'seq':
|
|
304
|
+
return Cell.renderSeqHeader(h, params)
|
|
305
|
+
case 'radio':
|
|
306
|
+
return Cell.renderRadioHeader(h, params)
|
|
307
|
+
case 'checkbox':
|
|
308
|
+
return Cell.renderCheckboxHeader(h, params)
|
|
309
|
+
case 'html':
|
|
310
|
+
if (filters && sortable) {
|
|
311
|
+
return Cell.renderSortAndFilterHeader(h, params)
|
|
312
|
+
} else if (sortable) {
|
|
313
|
+
return Cell.renderSortHeader(h, params)
|
|
314
|
+
} else if (filters) {
|
|
315
|
+
return Cell.renderFilterHeader(h, params)
|
|
316
|
+
}
|
|
317
|
+
break
|
|
318
|
+
}
|
|
319
|
+
if (editConfig && editRender) {
|
|
320
|
+
return Cell.renderEditHeader(h, params)
|
|
321
|
+
} else if (filters && sortable) {
|
|
322
|
+
return Cell.renderSortAndFilterHeader(h, params)
|
|
323
|
+
} else if (sortable) {
|
|
324
|
+
return Cell.renderSortHeader(h, params)
|
|
325
|
+
} else if (filters) {
|
|
326
|
+
return Cell.renderFilterHeader(h, params)
|
|
327
|
+
}
|
|
328
|
+
return Cell.renderDefaultHeader(h, params)
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
function renderFooterHandle (h: CreateElement, params: VxeTableDefines.CellRenderFooterParams & {
|
|
332
|
+
$table: VxeTableConstructor & VxeTablePrivateMethods;
|
|
333
|
+
}) {
|
|
334
|
+
return Cell.renderDefaultFooter(h, params)
|
|
335
|
+
}
|
|
336
|
+
|
|
268
337
|
export const Cell = {
|
|
269
338
|
createColumn ($xetable: any, _vm: any) {
|
|
270
|
-
const { type
|
|
271
|
-
const
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
case 'seq':
|
|
279
|
-
renMaps.renderHeader = this.renderSeqHeader
|
|
280
|
-
renMaps.renderCell = treeNode ? this.renderTreeIndexCell : this.renderSeqCell
|
|
281
|
-
break
|
|
282
|
-
case 'radio':
|
|
283
|
-
renMaps.renderHeader = this.renderRadioHeader
|
|
284
|
-
renMaps.renderCell = treeNode ? this.renderTreeRadioCell : this.renderRadioCell
|
|
285
|
-
break
|
|
286
|
-
case 'checkbox':
|
|
287
|
-
renMaps.renderHeader = this.renderCheckboxHeader
|
|
288
|
-
renMaps.renderCell = checkboxOpts.checkField ? (treeNode ? this.renderTreeSelectionCellByProp : this.renderCheckboxCellByProp) : (treeNode ? this.renderTreeSelectionCell : this.renderCheckboxCell)
|
|
289
|
-
break
|
|
290
|
-
case 'expand':
|
|
291
|
-
renMaps.renderCell = this.renderExpandCell
|
|
292
|
-
renMaps.renderData = this.renderExpandData
|
|
293
|
-
break
|
|
294
|
-
case 'html':
|
|
295
|
-
renMaps.renderCell = treeNode ? this.renderTreeHTMLCell : this.renderHTMLCell
|
|
296
|
-
if (filters && (sortable || remoteSort)) {
|
|
297
|
-
renMaps.renderHeader = this.renderSortAndFilterHeader
|
|
298
|
-
} else if (sortable || remoteSort) {
|
|
299
|
-
renMaps.renderHeader = this.renderSortHeader
|
|
300
|
-
} else if (filters) {
|
|
301
|
-
renMaps.renderHeader = this.renderFilterHeader
|
|
302
|
-
}
|
|
303
|
-
break
|
|
304
|
-
default:
|
|
305
|
-
if (editConfig && editRender) {
|
|
306
|
-
renMaps.renderHeader = this.renderEditHeader
|
|
307
|
-
renMaps.renderCell = editOpts.mode === 'cell' ? (treeNode ? this.renderTreeCellEdit : this.renderCellEdit) : (treeNode ? this.renderTreeRowEdit : this.renderRowEdit)
|
|
308
|
-
} else if (filters && (sortable || remoteSort)) {
|
|
309
|
-
renMaps.renderHeader = this.renderSortAndFilterHeader
|
|
310
|
-
} else if (sortable || remoteSort) {
|
|
311
|
-
renMaps.renderHeader = this.renderSortHeader
|
|
312
|
-
} else if (filters) {
|
|
313
|
-
renMaps.renderHeader = this.renderFilterHeader
|
|
314
|
-
}
|
|
339
|
+
const { type } = _vm
|
|
340
|
+
const renConfs: any = {
|
|
341
|
+
renderHeader: renderHeaderHandle,
|
|
342
|
+
renderCell: renderCellHandle,
|
|
343
|
+
renderFooter: renderFooterHandle
|
|
344
|
+
}
|
|
345
|
+
if (type === 'expand') {
|
|
346
|
+
renConfs.renderData = Cell.renderExpandData
|
|
315
347
|
}
|
|
316
|
-
return createColumn($xetable, _vm,
|
|
348
|
+
return createColumn($xetable, _vm, renConfs)
|
|
317
349
|
},
|
|
318
350
|
/**
|
|
319
351
|
* 列头标题
|
|
@@ -5,9 +5,9 @@ import { getClass } from '../../ui/src/utils'
|
|
|
5
5
|
import { getOffsetPos, hasClass, addClass, removeClass } from '../../ui/src/dom'
|
|
6
6
|
import { convertHeaderColumnToRows, getColReMinWidth } from './util'
|
|
7
7
|
|
|
8
|
-
import type { VxeTableDefines } from '../../../types'
|
|
8
|
+
import type { VxeTableDefines, VxeTableConstructor, VxeTablePrivateMethods } from '../../../types'
|
|
9
9
|
|
|
10
|
-
const { renderer, renderEmptyElement } = VxeUI
|
|
10
|
+
const { getI18n, renderer, renderEmptyElement } = VxeUI
|
|
11
11
|
|
|
12
12
|
const cellType = 'header'
|
|
13
13
|
|
|
@@ -109,7 +109,8 @@ const renderRows = (h: CreateElement, _vm: any, cols: VxeTableDefines.ColumnInfo
|
|
|
109
109
|
'is--line': !border || border === 'none'
|
|
110
110
|
}],
|
|
111
111
|
on: {
|
|
112
|
-
mousedown: (evnt:
|
|
112
|
+
mousedown: (evnt: MouseEvent) => _vm.resizeMousedownEvent(evnt, params),
|
|
113
|
+
dblclick: (evnt: MouseEvent) => $xeTable.handleResizeDblclickEvent(evnt, params)
|
|
113
114
|
}
|
|
114
115
|
})
|
|
115
116
|
: null
|
|
@@ -339,7 +340,7 @@ export default {
|
|
|
339
340
|
const { $parent: $xetable } = this
|
|
340
341
|
this.headerColumn = $xetable.isGroup ? convertHeaderColumnToRows(this.tableGroupColumn) : []
|
|
341
342
|
},
|
|
342
|
-
|
|
343
|
+
resizeMousedownEvent (evnt: MouseEvent, params: VxeTableDefines.CellRenderHeaderParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
|
|
343
344
|
const $xeTable = this.$parent
|
|
344
345
|
const tableInternalData = $xeTable
|
|
345
346
|
|
|
@@ -351,15 +352,17 @@ export default {
|
|
|
351
352
|
const resizeBarElem = $xetable.$refs.resizeBar as HTMLDivElement
|
|
352
353
|
const resizeTipElem = $xetable.$refs.refCellResizeTip as HTMLDivElement
|
|
353
354
|
const wrapperElem = this.$el as HTMLDivElement
|
|
354
|
-
const {
|
|
355
|
-
const
|
|
355
|
+
const { clientX: dragClientX } = evnt
|
|
356
|
+
const dragBtnElem = evnt.target as HTMLDivElement
|
|
357
|
+
const cell = dragBtnElem.parentNode as HTMLTableCellElement
|
|
358
|
+
const cellParams = Object.assign(params, { cell })
|
|
356
359
|
const resizableOpts = $xeTable.computeResizableOpts
|
|
357
360
|
let dragLeft = 0
|
|
358
361
|
const tableBodyElem = tableBody.$el
|
|
359
362
|
const pos = getOffsetPos(dragBtnElem, tableEl)
|
|
360
363
|
const dragBtnWidth = dragBtnElem.clientWidth
|
|
361
364
|
const dragBtnOffsetWidth = Math.floor(dragBtnWidth / 2)
|
|
362
|
-
const minInterval = getColReMinWidth(
|
|
365
|
+
const minInterval = getColReMinWidth(cellParams) - dragBtnOffsetWidth // 列之间的最小间距
|
|
363
366
|
let dragMinLeft = pos.left - cell.clientWidth + dragBtnWidth + minInterval
|
|
364
367
|
let dragPosLeft = pos.left + dragBtnOffsetWidth
|
|
365
368
|
const domMousemove = document.onmousemove
|
|
@@ -371,14 +374,14 @@ export default {
|
|
|
371
374
|
let fixedOffsetWidth = 0
|
|
372
375
|
if (isLeftFixed || isRightFixed) {
|
|
373
376
|
const siblingProp = isLeftFixed ? 'nextElementSibling' : 'previousElementSibling'
|
|
374
|
-
let tempCellElem = cell[siblingProp]
|
|
377
|
+
let tempCellElem = cell[siblingProp] as HTMLTableCellElement
|
|
375
378
|
while (tempCellElem) {
|
|
376
379
|
if (hasClass(tempCellElem, 'fixed--hidden')) {
|
|
377
380
|
break
|
|
378
381
|
} else if (!hasClass(tempCellElem, 'col--group')) {
|
|
379
382
|
fixedOffsetWidth += tempCellElem.offsetWidth
|
|
380
383
|
}
|
|
381
|
-
tempCellElem = tempCellElem[siblingProp]
|
|
384
|
+
tempCellElem = tempCellElem[siblingProp] as HTMLTableCellElement
|
|
382
385
|
}
|
|
383
386
|
if (isRightFixed && rightContainer) {
|
|
384
387
|
dragPosLeft = rightContainer.offsetLeft + fixedOffsetWidth
|
|
@@ -420,7 +423,7 @@ export default {
|
|
|
420
423
|
}
|
|
421
424
|
resizeTipElem.style.left = `${resizeTipLeft}px`
|
|
422
425
|
resizeTipElem.style.top = `${Math.min(tableEl.clientHeight - resizeTipHeight, Math.max(0, evnt.clientY - wrapperRect.y - resizeTipHeight / 2))}px`
|
|
423
|
-
resizeTipElem.textContent =
|
|
426
|
+
resizeTipElem.textContent = getI18n('vxe.table.resizeColTip', [column.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft)])
|
|
424
427
|
}
|
|
425
428
|
}
|
|
426
429
|
|