vxe-table 3.7.0-beta.9 → 3.7.1
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/README.md +4 -4
- package/helper/vetur/attributes.json +26 -2
- package/helper/vetur/tags.json +6 -0
- package/lib/button/style/style.css +2 -3
- package/lib/button/style/style.min.css +1 -1
- package/lib/edit/src/mixin.js +265 -214
- package/lib/edit/src/mixin.min.js +1 -1
- package/lib/export/src/mixin.js +11 -7
- package/lib/export/src/mixin.min.js +1 -1
- package/lib/form/src/form-config-item.js +5 -1
- package/lib/form/src/form-config-item.min.js +1 -1
- package/lib/form/src/form-item.js +9 -1
- package/lib/form/src/form-item.min.js +1 -1
- package/lib/form/src/form.js +4 -0
- package/lib/form/src/form.min.js +1 -1
- package/lib/form/style/style.css +12 -0
- package/lib/form/style/style.min.css +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.umd.js +1154 -717
- package/lib/index.umd.min.js +1 -1
- package/lib/input/src/input.js +24 -1
- package/lib/input/src/input.min.js +1 -1
- package/lib/input/style/style.css +21 -0
- package/lib/input/style/style.min.css +1 -1
- package/lib/keyboard/src/mixin.js +4 -1
- package/lib/keyboard/src/mixin.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/body.js +17 -14
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +38 -34
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/methods.js +641 -421
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +27 -19
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +4 -2
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +2 -2
- package/lib/table/style/style.min.css +1 -1
- package/lib/tools/log.js +1 -1
- package/lib/tools/log.min.js +1 -1
- package/lib/tools/utils.js +3 -5
- package/lib/tools/utils.min.js +1 -1
- package/lib/v-x-e-table/index.js +18 -13
- package/lib/v-x-e-table/index.min.js +1 -1
- package/lib/v-x-e-table/src/commands.js +7 -7
- package/lib/v-x-e-table/src/commands.min.js +1 -1
- package/lib/v-x-e-table/src/conf.js +2 -2
- package/lib/v-x-e-table/src/conf.min.js +1 -1
- package/lib/v-x-e-table/src/{setup.js → config.js} +3 -3
- package/lib/v-x-e-table/src/config.min.js +1 -0
- package/lib/v-x-e-table/src/formats.js +7 -7
- package/lib/v-x-e-table/src/formats.min.js +1 -1
- package/lib/v-x-e-table/src/menus.js +7 -7
- package/lib/v-x-e-table/src/menus.min.js +1 -1
- package/lib/v-x-e-table/src/renderer.js +4 -4
- package/lib/v-x-e-table/src/renderer.min.js +1 -1
- package/lib/validator/src/mixin.js +4 -1
- package/lib/validator/src/mixin.min.js +1 -1
- package/package.json +7 -8
- package/packages/edit/src/mixin.js +185 -142
- package/packages/export/src/mixin.js +9 -7
- package/packages/form/src/form-config-item.js +4 -2
- package/packages/form/src/form-item.js +8 -2
- package/packages/form/src/form.js +4 -0
- package/packages/input/src/input.js +24 -1
- package/packages/keyboard/src/mixin.js +2 -1
- package/packages/table/src/body.js +17 -14
- package/packages/table/src/cell.js +32 -23
- package/packages/table/src/methods.js +476 -230
- package/packages/table/src/table.js +25 -17
- package/packages/table/src/util.js +4 -2
- package/packages/tools/utils.js +3 -6
- package/packages/v-x-e-table/index.js +11 -5
- package/packages/v-x-e-table/src/commands.js +6 -6
- package/packages/v-x-e-table/src/conf.js +2 -2
- package/packages/v-x-e-table/src/{setup.js → config.js} +2 -2
- package/packages/v-x-e-table/src/formats.js +6 -6
- package/packages/v-x-e-table/src/menus.js +6 -6
- package/packages/v-x-e-table/src/renderer.js +4 -4
- package/packages/validator/src/mixin.js +2 -1
- package/styles/button.scss +5 -3
- package/styles/css-variable.scss +3 -3
- package/styles/form.scss +14 -0
- package/styles/input.scss +25 -0
- package/styles/table.scss +6 -2
- package/styles/textarea.scss +3 -3
- package/styles/variable.scss +3 -3
- package/types/form-item.d.ts +1 -0
- package/types/form.d.ts +1 -0
- package/types/table.d.ts +16 -1
- package/types/v-x-e-table/index.d.ts +22 -10
- package/lib/v-x-e-table/src/setup.min.js +0 -1
- /package/lib/icon/style/{iconfont.1690761747506.ttf → iconfont.1694852365070.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1690761747506.woff → iconfont.1694852365070.woff} +0 -0
- /package/lib/icon/style/{iconfont.1690761747506.woff2 → iconfont.1694852365070.woff2} +0 -0
- /package/lib/{iconfont.1690761747506.ttf → iconfont.1694852365070.ttf} +0 -0
- /package/lib/{iconfont.1690761747506.woff → iconfont.1694852365070.woff} +0 -0
- /package/lib/{iconfont.1690761747506.woff2 → iconfont.1694852365070.woff2} +0 -0
- /package/types/v-x-e-table/{setup.d.ts → config.d.ts} +0 -0
|
@@ -9,7 +9,7 @@ import { getSlotVNs } from '../../tools/vn'
|
|
|
9
9
|
const renderType = 'body'
|
|
10
10
|
|
|
11
11
|
// 滚动、拖动过程中不需要触发
|
|
12
|
-
function
|
|
12
|
+
function isVMScrollProcess ($xetable) {
|
|
13
13
|
return $xetable._isResize || ($xetable.lastScrollTime && Date.now() < $xetable.lastScrollTime + $xetable.delayHover)
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -122,7 +122,7 @@ function renderColumn (h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, r
|
|
|
122
122
|
// hover 进入事件
|
|
123
123
|
if (showTitle || showTooltip || showAllTip || bindMouseenter || tooltipConfig) {
|
|
124
124
|
tdOns.mouseenter = evnt => {
|
|
125
|
-
if (
|
|
125
|
+
if (isVMScrollProcess($xetable)) {
|
|
126
126
|
return
|
|
127
127
|
}
|
|
128
128
|
if (showTitle) {
|
|
@@ -139,7 +139,7 @@ function renderColumn (h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, r
|
|
|
139
139
|
// hover 退出事件
|
|
140
140
|
if (showTooltip || showAllTip || bindMouseleave || tooltipConfig) {
|
|
141
141
|
tdOns.mouseleave = evnt => {
|
|
142
|
-
if (
|
|
142
|
+
if (isVMScrollProcess($xetable)) {
|
|
143
143
|
return
|
|
144
144
|
}
|
|
145
145
|
if (showTooltip || showAllTip) {
|
|
@@ -302,9 +302,9 @@ function renderRows (h, _vm, $xetable, fixedType, tableData, tableColumn) {
|
|
|
302
302
|
treeOpts,
|
|
303
303
|
expandOpts,
|
|
304
304
|
editOpts,
|
|
305
|
-
|
|
305
|
+
treeExpandedMaps,
|
|
306
306
|
scrollYLoad,
|
|
307
|
-
|
|
307
|
+
rowExpandedMaps,
|
|
308
308
|
radioOpts,
|
|
309
309
|
checkboxOpts,
|
|
310
310
|
expandColumn,
|
|
@@ -312,6 +312,7 @@ function renderRows (h, _vm, $xetable, fixedType, tableData, tableColumn) {
|
|
|
312
312
|
fullAllDataRowIdData,
|
|
313
313
|
rowOpts
|
|
314
314
|
} = $xetable
|
|
315
|
+
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
315
316
|
const rows = []
|
|
316
317
|
tableData.forEach((row, $rowIndex) => {
|
|
317
318
|
const trOn = {}
|
|
@@ -322,13 +323,13 @@ function renderRows (h, _vm, $xetable, fixedType, tableData, tableColumn) {
|
|
|
322
323
|
// 事件绑定
|
|
323
324
|
if (rowOpts.isHover || highlightHoverRow) {
|
|
324
325
|
trOn.mouseenter = evnt => {
|
|
325
|
-
if (
|
|
326
|
+
if (isVMScrollProcess($xetable)) {
|
|
326
327
|
return
|
|
327
328
|
}
|
|
328
329
|
$xetable.triggerHoverEvent(evnt, { row, rowIndex })
|
|
329
330
|
}
|
|
330
331
|
trOn.mouseleave = () => {
|
|
331
|
-
if (
|
|
332
|
+
if (isVMScrollProcess($xetable)) {
|
|
332
333
|
return
|
|
333
334
|
}
|
|
334
335
|
$xetable.clearHoverRow()
|
|
@@ -340,7 +341,7 @@ function renderRows (h, _vm, $xetable, fixedType, tableData, tableColumn) {
|
|
|
340
341
|
const seq = rest ? rest.seq : -1
|
|
341
342
|
const params = { $table: $xetable, seq, rowid, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex }
|
|
342
343
|
// 行是否被展开
|
|
343
|
-
const isExpandRow = expandColumn &&
|
|
344
|
+
const isExpandRow = expandColumn && !!rowExpandedMaps[rowid]
|
|
344
345
|
// 树节点是否被展开
|
|
345
346
|
let isExpandTree = false
|
|
346
347
|
let rowChildren = []
|
|
@@ -349,9 +350,9 @@ function renderRows (h, _vm, $xetable, fixedType, tableData, tableColumn) {
|
|
|
349
350
|
if (editConfig) {
|
|
350
351
|
isNewRow = $xetable.isInsertByRow(row)
|
|
351
352
|
}
|
|
352
|
-
if (treeConfig && !scrollYLoad && !treeOpts.transform
|
|
353
|
-
rowChildren = row[
|
|
354
|
-
isExpandTree = rowChildren && rowChildren.length &&
|
|
353
|
+
if (treeConfig && !scrollYLoad && !treeOpts.transform) {
|
|
354
|
+
rowChildren = row[childrenField]
|
|
355
|
+
isExpandTree = rowChildren && rowChildren.length && !!treeExpandedMaps[rowid]
|
|
355
356
|
}
|
|
356
357
|
rows.push(
|
|
357
358
|
h('tr', {
|
|
@@ -364,7 +365,7 @@ function renderRows (h, _vm, $xetable, fixedType, tableData, tableColumn) {
|
|
|
364
365
|
'is--expand-row': isExpandRow,
|
|
365
366
|
'is--expand-tree': isExpandTree,
|
|
366
367
|
'row--new': isNewRow && (editOpts.showStatus || editOpts.showInsertStatus),
|
|
367
|
-
'row--radio': radioOpts.highlight && $xetable.
|
|
368
|
+
'row--radio': radioOpts.highlight && $xetable.selectRadioRow === row,
|
|
368
369
|
'row--checked': checkboxOpts.highlight && $xetable.isCheckedByCheckboxRow(row)
|
|
369
370
|
},
|
|
370
371
|
rowClassName ? (XEUtils.isFunction(rowClassName) ? rowClassName(params) : rowClassName) : ''
|
|
@@ -503,8 +504,10 @@ export default {
|
|
|
503
504
|
},
|
|
504
505
|
beforeDestroy () {
|
|
505
506
|
clearTimeout(this.wheelTime)
|
|
506
|
-
this.$el
|
|
507
|
-
|
|
507
|
+
if (this.$el) {
|
|
508
|
+
this.$el._onscroll = null
|
|
509
|
+
this.$el.onscroll = null
|
|
510
|
+
}
|
|
508
511
|
},
|
|
509
512
|
destroyed () {
|
|
510
513
|
const { $parent: $xetable, fixedType } = this
|
|
@@ -3,7 +3,7 @@ import GlobalConfig from '../../v-x-e-table/src/conf'
|
|
|
3
3
|
import VXETable from '../../v-x-e-table'
|
|
4
4
|
import DomTools from '../../tools/dom'
|
|
5
5
|
import UtilTools, { eqEmptyValue, isEnableConf, getFuncText } from '../../tools/utils'
|
|
6
|
-
import { getColumnConfig } from './util'
|
|
6
|
+
import { getRowid, getColumnConfig } from './util'
|
|
7
7
|
import { getSlotVNs } from '../../tools/vn'
|
|
8
8
|
|
|
9
9
|
function renderHelpIcon (h, params) {
|
|
@@ -204,11 +204,13 @@ export const Cell = {
|
|
|
204
204
|
*/
|
|
205
205
|
renderTreeIcon (h, params, cellVNodes) {
|
|
206
206
|
const { $table, isHidden } = params
|
|
207
|
-
const { treeOpts,
|
|
207
|
+
const { treeOpts, treeExpandedMaps, treeExpandLazyLoadedMaps } = $table
|
|
208
208
|
const { row, column, level } = params
|
|
209
209
|
const { slots } = column
|
|
210
|
-
const {
|
|
211
|
-
const
|
|
210
|
+
const { indent, lazy, trigger, iconLoaded, showIcon, iconOpen, iconClose } = treeOpts
|
|
211
|
+
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
212
|
+
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField
|
|
213
|
+
const rowChilds = row[childrenField]
|
|
212
214
|
let hasLazyChilds = false
|
|
213
215
|
let isAceived = false
|
|
214
216
|
let isLazyLoaded = false
|
|
@@ -217,10 +219,11 @@ export const Cell = {
|
|
|
217
219
|
return $table.callSlot(slots.icon, params, h, cellVNodes)
|
|
218
220
|
}
|
|
219
221
|
if (!isHidden) {
|
|
220
|
-
|
|
222
|
+
const rowid = getRowid($table, row)
|
|
223
|
+
isAceived = !!treeExpandedMaps[rowid]
|
|
221
224
|
if (lazy) {
|
|
222
|
-
isLazyLoaded =
|
|
223
|
-
hasLazyChilds = row[hasChildField
|
|
225
|
+
isLazyLoaded = !!treeExpandLazyLoadedMaps[rowid]
|
|
226
|
+
hasLazyChilds = row[hasChildField]
|
|
224
227
|
}
|
|
225
228
|
}
|
|
226
229
|
if (!trigger || trigger === 'default') {
|
|
@@ -294,13 +297,13 @@ export const Cell = {
|
|
|
294
297
|
},
|
|
295
298
|
renderRadioCell (h, params) {
|
|
296
299
|
const { $table, column, isHidden } = params
|
|
297
|
-
const { radioOpts,
|
|
300
|
+
const { radioOpts, selectRadioRow } = $table
|
|
298
301
|
const { slots } = column
|
|
299
302
|
const { labelField, checkMethod, visibleMethod } = radioOpts
|
|
300
303
|
const { row } = params
|
|
301
304
|
const defaultSlot = slots ? slots.default : null
|
|
302
305
|
const radioSlot = slots ? slots.radio : null
|
|
303
|
-
const isChecked = row ===
|
|
306
|
+
const isChecked = row === selectRadioRow
|
|
304
307
|
const isVisible = !visibleMethod || visibleMethod({ row })
|
|
305
308
|
let isDisabled = !!checkMethod
|
|
306
309
|
let on
|
|
@@ -407,7 +410,7 @@ export const Cell = {
|
|
|
407
410
|
},
|
|
408
411
|
renderCheckboxCell (h, params) {
|
|
409
412
|
const { $table, row, column, isHidden } = params
|
|
410
|
-
const { treeConfig,
|
|
413
|
+
const { treeConfig, treeIndeterminateMaps, selectCheckboxMaps } = $table
|
|
411
414
|
const { labelField, checkMethod, visibleMethod } = $table.checkboxOpts
|
|
412
415
|
const { slots } = column
|
|
413
416
|
const defaultSlot = slots ? slots.default : null
|
|
@@ -418,7 +421,8 @@ export const Cell = {
|
|
|
418
421
|
let isDisabled = !!checkMethod
|
|
419
422
|
let on
|
|
420
423
|
if (!isHidden) {
|
|
421
|
-
|
|
424
|
+
const rowid = getRowid($table, row)
|
|
425
|
+
isChecked = !!selectCheckboxMaps[rowid]
|
|
422
426
|
on = {
|
|
423
427
|
click (evnt) {
|
|
424
428
|
if (!isDisabled && isVisible) {
|
|
@@ -431,7 +435,7 @@ export const Cell = {
|
|
|
431
435
|
isDisabled = !checkMethod({ row })
|
|
432
436
|
}
|
|
433
437
|
if (treeConfig) {
|
|
434
|
-
indeterminate =
|
|
438
|
+
indeterminate = !!treeIndeterminateMaps[rowid]
|
|
435
439
|
}
|
|
436
440
|
}
|
|
437
441
|
const checkboxParams = { ...params, checked: isChecked, disabled: isDisabled, visible: isVisible, indeterminate }
|
|
@@ -469,17 +473,19 @@ export const Cell = {
|
|
|
469
473
|
},
|
|
470
474
|
renderCheckboxCellByProp (h, params) {
|
|
471
475
|
const { $table, row, column, isHidden } = params
|
|
472
|
-
const { treeConfig,
|
|
473
|
-
const { labelField, checkField,
|
|
476
|
+
const { treeConfig, treeIndeterminateMaps, checkboxOpts } = $table
|
|
477
|
+
const { labelField, checkField, checkMethod, visibleMethod } = checkboxOpts
|
|
478
|
+
const indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField
|
|
474
479
|
const { slots } = column
|
|
475
480
|
const defaultSlot = slots ? slots.default : null
|
|
476
481
|
const checkboxSlot = slots ? slots.checkbox : null
|
|
477
|
-
let
|
|
482
|
+
let isIndeterminate = false
|
|
478
483
|
let isChecked = false
|
|
479
484
|
const isVisible = !visibleMethod || visibleMethod({ row })
|
|
480
485
|
let isDisabled = !!checkMethod
|
|
481
486
|
let on
|
|
482
487
|
if (!isHidden) {
|
|
488
|
+
const rowid = getRowid($table, row)
|
|
483
489
|
isChecked = XEUtils.get(row, checkField)
|
|
484
490
|
on = {
|
|
485
491
|
click (evnt) {
|
|
@@ -493,10 +499,10 @@ export const Cell = {
|
|
|
493
499
|
isDisabled = !checkMethod({ row })
|
|
494
500
|
}
|
|
495
501
|
if (treeConfig) {
|
|
496
|
-
|
|
502
|
+
isIndeterminate = !!treeIndeterminateMaps[rowid]
|
|
497
503
|
}
|
|
498
504
|
}
|
|
499
|
-
const checkboxParams = { ...params, checked: isChecked, disabled: isDisabled, visible: isVisible, indeterminate }
|
|
505
|
+
const checkboxParams = { ...params, checked: isChecked, disabled: isDisabled, visible: isVisible, indeterminate: isIndeterminate }
|
|
500
506
|
if (checkboxSlot) {
|
|
501
507
|
return $table.callSlot(checkboxSlot, checkboxParams, h)
|
|
502
508
|
}
|
|
@@ -504,7 +510,7 @@ export const Cell = {
|
|
|
504
510
|
if (isVisible) {
|
|
505
511
|
checkVNs.push(
|
|
506
512
|
h('span', {
|
|
507
|
-
class: ['vxe-checkbox--icon',
|
|
513
|
+
class: ['vxe-checkbox--icon', isIndeterminate ? GlobalConfig.icon.TABLE_CHECKBOX_INDETERMINATE : (isChecked ? GlobalConfig.icon.TABLE_CHECKBOX_CHECKED : GlobalConfig.icon.TABLE_CHECKBOX_UNCHECKED)]
|
|
508
514
|
})
|
|
509
515
|
)
|
|
510
516
|
}
|
|
@@ -520,7 +526,7 @@ export const Cell = {
|
|
|
520
526
|
class: ['vxe-cell--checkbox', {
|
|
521
527
|
'is--checked': isChecked,
|
|
522
528
|
'is--disabled': isDisabled,
|
|
523
|
-
'is--indeterminate':
|
|
529
|
+
'is--indeterminate': indeterminateField && !isChecked ? row[indeterminateField] : isIndeterminate
|
|
524
530
|
}],
|
|
525
531
|
on
|
|
526
532
|
}, checkVNs)
|
|
@@ -535,7 +541,7 @@ export const Cell = {
|
|
|
535
541
|
*/
|
|
536
542
|
renderExpandCell (h, params) {
|
|
537
543
|
const { $table, isHidden, row, column } = params
|
|
538
|
-
const { expandOpts,
|
|
544
|
+
const { expandOpts, rowExpandedMaps, rowExpandLazyLoadedMaps } = $table
|
|
539
545
|
const { lazy, labelField, iconLoaded, showIcon, iconOpen, iconClose, visibleMethod } = expandOpts
|
|
540
546
|
const { slots } = column
|
|
541
547
|
const defaultSlot = slots ? slots.default : null
|
|
@@ -545,9 +551,10 @@ export const Cell = {
|
|
|
545
551
|
return $table.callSlot(slots.icon, params, h)
|
|
546
552
|
}
|
|
547
553
|
if (!isHidden) {
|
|
548
|
-
|
|
554
|
+
const rowid = getRowid($table, row)
|
|
555
|
+
isAceived = !!rowExpandedMaps[rowid]
|
|
549
556
|
if (lazy) {
|
|
550
|
-
isLazyLoaded =
|
|
557
|
+
isLazyLoaded = !!rowExpandLazyLoadedMaps[rowid]
|
|
551
558
|
}
|
|
552
559
|
}
|
|
553
560
|
return [
|
|
@@ -685,7 +692,9 @@ export const Cell = {
|
|
|
685
692
|
},
|
|
686
693
|
on: {
|
|
687
694
|
click (evnt) {
|
|
688
|
-
$table.triggerFilterEvent
|
|
695
|
+
if ($table.triggerFilterEvent) {
|
|
696
|
+
$table.triggerFilterEvent(evnt, params.column, params)
|
|
697
|
+
}
|
|
689
698
|
}
|
|
690
699
|
}
|
|
691
700
|
})
|