vxe-table 3.7.0-beta.3 → 3.7.0-beta.5
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/helper/vetur/attributes.json +26 -6
- package/helper/vetur/tags.json +5 -0
- package/lib/button/src/button.js +9 -3
- package/lib/button/src/button.min.js +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 +70 -52
- package/lib/index.umd.min.js +1 -1
- package/lib/pulldown/src/pulldown.js +11 -2
- package/lib/pulldown/src/pulldown.min.js +1 -1
- package/lib/select/src/select.js +5 -1
- package/lib/select/src/select.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/methods.js +44 -49
- package/lib/table/src/methods.min.js +1 -1
- package/lib/tools/log.js +1 -1
- package/lib/tools/log.min.js +1 -1
- package/lib/tooltip/src/tooltip.js +5 -1
- package/lib/tooltip/src/tooltip.min.js +1 -1
- package/lib/v-x-e-table/index.js +1 -1
- package/lib/v-x-e-table/index.min.js +1 -1
- package/package.json +1 -1
- package/packages/button/src/button.js +5 -4
- package/packages/pulldown/src/pulldown.js +6 -3
- package/packages/select/src/select.js +3 -2
- package/packages/table/src/methods.js +21 -23
- package/packages/tooltip/src/tooltip.js +3 -2
- /package/lib/icon/style/{iconfont.1689121415913.ttf → iconfont.1689384538396.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1689121415913.woff → iconfont.1689384538396.woff} +0 -0
- /package/lib/icon/style/{iconfont.1689121415913.woff2 → iconfont.1689384538396.woff2} +0 -0
- /package/lib/{iconfont.1689121415913.ttf → iconfont.1689384538396.ttf} +0 -0
- /package/lib/{iconfont.1689121415913.woff → iconfont.1689384538396.woff} +0 -0
- /package/lib/{iconfont.1689121415913.woff2 → iconfont.1689384538396.woff2} +0 -0
|
@@ -21,7 +21,8 @@ export default {
|
|
|
21
21
|
disabled: Boolean,
|
|
22
22
|
loading: Boolean,
|
|
23
23
|
destroyOnClose: Boolean,
|
|
24
|
-
className: String,
|
|
24
|
+
className: [String, Function],
|
|
25
|
+
popupClassName: [String, Function],
|
|
25
26
|
transfer: { type: Boolean, default: () => GlobalConfig.button.transfer }
|
|
26
27
|
},
|
|
27
28
|
data () {
|
|
@@ -58,10 +59,10 @@ export default {
|
|
|
58
59
|
GlobalEvent.off(this, 'mousewheel')
|
|
59
60
|
},
|
|
60
61
|
render (h) {
|
|
61
|
-
const { $scopedSlots, $listeners, className, inited, type, destroyOnClose, isFormBtn, status, btnType, vSize, name, disabled, loading, showPanel, animatVisible, panelPlacement } = this
|
|
62
|
+
const { $scopedSlots, $listeners, className, popupClassName, inited, type, destroyOnClose, isFormBtn, status, btnType, vSize, name, disabled, loading, showPanel, animatVisible, panelPlacement } = this
|
|
62
63
|
const downsSlot = $scopedSlots.dropdowns
|
|
63
64
|
return downsSlot ? h('div', {
|
|
64
|
-
class: ['vxe-button--dropdown', className, {
|
|
65
|
+
class: ['vxe-button--dropdown', className ? (XEUtils.isFunction(className) ? className({ $button: this }) : className) : '', {
|
|
65
66
|
[`size--${vSize}`]: vSize,
|
|
66
67
|
'is--active': showPanel
|
|
67
68
|
}]
|
|
@@ -92,7 +93,7 @@ export default {
|
|
|
92
93
|
])),
|
|
93
94
|
h('div', {
|
|
94
95
|
ref: 'panel',
|
|
95
|
-
class: ['vxe-button--dropdown-panel', {
|
|
96
|
+
class: ['vxe-button--dropdown-panel', popupClassName ? (XEUtils.isFunction(popupClassName) ? popupClassName({ $button: this }) : popupClassName) : '', {
|
|
96
97
|
[`size--${vSize}`]: vSize,
|
|
97
98
|
'animat--leave': animatVisible,
|
|
98
99
|
'animat--enter': showPanel
|
|
@@ -3,6 +3,7 @@ import vSize from '../../mixins/size'
|
|
|
3
3
|
import UtilTools from '../../tools/utils'
|
|
4
4
|
import DomTools from '../../tools/dom'
|
|
5
5
|
import { GlobalEvent } from '../../tools/event'
|
|
6
|
+
import XEUtils from 'xe-utils'
|
|
6
7
|
|
|
7
8
|
export default {
|
|
8
9
|
name: 'VxePulldown',
|
|
@@ -12,6 +13,8 @@ export default {
|
|
|
12
13
|
disabled: Boolean,
|
|
13
14
|
placement: String,
|
|
14
15
|
size: { type: String, default: () => GlobalConfig.size },
|
|
16
|
+
className: [String, Function],
|
|
17
|
+
popupClassName: [String, Function],
|
|
15
18
|
destroyOnClose: Boolean,
|
|
16
19
|
transfer: Boolean
|
|
17
20
|
},
|
|
@@ -53,11 +56,11 @@ export default {
|
|
|
53
56
|
GlobalEvent.off(this, 'blur')
|
|
54
57
|
},
|
|
55
58
|
render (h) {
|
|
56
|
-
const { $scopedSlots, inited, vSize, destroyOnClose, transfer, isActivated, disabled, animatVisible, visiblePanel, panelStyle, panelPlacement } = this
|
|
59
|
+
const { $scopedSlots, inited, className, popupClassName, vSize, destroyOnClose, transfer, isActivated, disabled, animatVisible, visiblePanel, panelStyle, panelPlacement } = this
|
|
57
60
|
const defaultSlot = $scopedSlots.default
|
|
58
61
|
const downSlot = $scopedSlots.dropdown
|
|
59
62
|
return h('div', {
|
|
60
|
-
class: ['vxe-pulldown', {
|
|
63
|
+
class: ['vxe-pulldown', className ? (XEUtils.isFunction(className) ? className({ $pulldown: this }) : className) : '', {
|
|
61
64
|
[`size--${vSize}`]: vSize,
|
|
62
65
|
'is--visivle': visiblePanel,
|
|
63
66
|
'is--disabled': disabled,
|
|
@@ -70,7 +73,7 @@ export default {
|
|
|
70
73
|
}, defaultSlot ? defaultSlot.call(this, { $pulldown: this }, h) : []),
|
|
71
74
|
h('div', {
|
|
72
75
|
ref: 'panel',
|
|
73
|
-
class: ['vxe-table--ignore-clear vxe-pulldown--panel', {
|
|
76
|
+
class: ['vxe-table--ignore-clear vxe-pulldown--panel', popupClassName ? (XEUtils.isFunction(popupClassName) ? popupClassName({ $pulldown: this }) : popupClassName) : '', {
|
|
74
77
|
[`size--${vSize}`]: vSize,
|
|
75
78
|
'is--transfer': transfer,
|
|
76
79
|
'animat--leave': animatVisible,
|
|
@@ -254,6 +254,7 @@ export default {
|
|
|
254
254
|
optionGroupProps: Object,
|
|
255
255
|
optionConfig: Object,
|
|
256
256
|
className: [String, Function],
|
|
257
|
+
popupClassName: [String, Function],
|
|
257
258
|
max: [String, Number],
|
|
258
259
|
size: { type: String, default: () => GlobalConfig.select.size || GlobalConfig.size },
|
|
259
260
|
filterable: Boolean,
|
|
@@ -408,7 +409,7 @@ export default {
|
|
|
408
409
|
GlobalEvent.off(this, 'blur')
|
|
409
410
|
},
|
|
410
411
|
render (h) {
|
|
411
|
-
const { _e, $scopedSlots, vSize, className, inited, isActivated, loading, disabled, visiblePanel, filterable } = this
|
|
412
|
+
const { _e, $scopedSlots, vSize, className, popupClassName, inited, isActivated, loading, disabled, visiblePanel, filterable } = this
|
|
412
413
|
const prefixSlot = $scopedSlots.prefix
|
|
413
414
|
return h('div', {
|
|
414
415
|
class: ['vxe-select', className ? (XEUtils.isFunction(className) ? className({ $select: this }) : className) : '', {
|
|
@@ -449,7 +450,7 @@ export default {
|
|
|
449
450
|
}),
|
|
450
451
|
h('div', {
|
|
451
452
|
ref: 'panel',
|
|
452
|
-
class: ['vxe-table--ignore-clear vxe-select--panel', {
|
|
453
|
+
class: ['vxe-table--ignore-clear vxe-select--panel', popupClassName ? (XEUtils.isFunction(popupClassName) ? popupClassName({ $select: this }) : popupClassName) : '', {
|
|
453
454
|
[`size--${vSize}`]: vSize,
|
|
454
455
|
'is--transfer': this.transfer,
|
|
455
456
|
'animat--leave': !loading && this.animatVisible,
|
|
@@ -414,7 +414,7 @@ const Methods = {
|
|
|
414
414
|
this.tableSynchData = datas
|
|
415
415
|
// 克隆原数据,用于显示编辑状态,与编辑值做对比
|
|
416
416
|
if (keepSource) {
|
|
417
|
-
this.
|
|
417
|
+
this.cacheSourceMap(fullData)
|
|
418
418
|
}
|
|
419
419
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
420
420
|
if (sYLoad) {
|
|
@@ -590,8 +590,8 @@ const Methods = {
|
|
|
590
590
|
* 牺牲数据组装的耗时,用来换取使用过程中的流畅
|
|
591
591
|
*/
|
|
592
592
|
cacheRowMap (source) {
|
|
593
|
-
const { treeConfig, treeOpts, tableFullData, fullDataRowMap, fullAllDataRowMap, tableFullTreeData
|
|
594
|
-
let { fullDataRowIdData, fullAllDataRowIdData
|
|
593
|
+
const { treeConfig, treeOpts, tableFullData, fullDataRowMap, fullAllDataRowMap, tableFullTreeData } = this
|
|
594
|
+
let { fullDataRowIdData, fullAllDataRowIdData } = this
|
|
595
595
|
const rowkey = getRowkey(this)
|
|
596
596
|
const isLazy = treeConfig && treeOpts.lazy
|
|
597
597
|
const handleCache = (row, index, items, path, parent, nodes) => {
|
|
@@ -618,14 +618,18 @@ const Methods = {
|
|
|
618
618
|
fullDataRowMap.clear()
|
|
619
619
|
}
|
|
620
620
|
fullAllDataRowIdData = this.fullAllDataRowIdData = {}
|
|
621
|
-
sourceDataRowIdData = this.sourceDataRowIdData = {}
|
|
622
621
|
fullAllDataRowMap.clear()
|
|
623
622
|
if (treeConfig) {
|
|
624
623
|
XEUtils.eachTree(tableFullTreeData, handleCache, treeOpts)
|
|
625
624
|
} else {
|
|
626
625
|
tableFullData.forEach(handleCache)
|
|
627
626
|
}
|
|
628
|
-
|
|
627
|
+
},
|
|
628
|
+
cacheSourceMap (fullData) {
|
|
629
|
+
let { treeConfig, treeOpts, sourceDataRowIdData } = this
|
|
630
|
+
const sourceData = XEUtils.clone(fullData, true)
|
|
631
|
+
const rowkey = getRowkey(this)
|
|
632
|
+
sourceDataRowIdData = this.sourceDataRowIdData = {}
|
|
629
633
|
const handleSourceRow = (row) => {
|
|
630
634
|
let rowid = getRowid(this, row)
|
|
631
635
|
if (eqEmptyValue(rowid)) {
|
|
@@ -639,10 +643,11 @@ const Methods = {
|
|
|
639
643
|
}
|
|
640
644
|
// 源数据缓存
|
|
641
645
|
if (treeConfig && !treeOpts.transform) {
|
|
642
|
-
XEUtils.eachTree(
|
|
646
|
+
XEUtils.eachTree(sourceData, handleSourceRow, treeOpts)
|
|
643
647
|
} else {
|
|
644
|
-
|
|
648
|
+
sourceData.forEach(handleSourceRow)
|
|
645
649
|
}
|
|
650
|
+
this.tableSourceData = sourceData
|
|
646
651
|
},
|
|
647
652
|
loadTreeChildren (row, childRecords) {
|
|
648
653
|
const { keepSource, tableSourceData, treeOpts, fullDataRowIdData, fullDataRowMap, fullAllDataRowMap, fullAllDataRowIdData } = this
|
|
@@ -1080,31 +1085,21 @@ const Methods = {
|
|
|
1080
1085
|
* @param {String} field 字段名
|
|
1081
1086
|
*/
|
|
1082
1087
|
isUpdateByRow (row, field) {
|
|
1083
|
-
const { tableFullColumn, keepSource,
|
|
1088
|
+
const { tableFullColumn, keepSource, sourceDataRowIdData, fullDataRowIdData } = this
|
|
1084
1089
|
if (keepSource) {
|
|
1085
|
-
let oRow, property
|
|
1086
1090
|
const rowid = getRowid(this, row)
|
|
1087
1091
|
// 新增的数据不需要检测
|
|
1088
1092
|
if (!fullDataRowIdData[rowid]) {
|
|
1089
1093
|
return false
|
|
1090
1094
|
}
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
const
|
|
1094
|
-
row = Object.assign({}, row, { [children]: null })
|
|
1095
|
-
if (matchObj) {
|
|
1096
|
-
oRow = Object.assign({}, matchObj.item, { [children]: null })
|
|
1097
|
-
}
|
|
1098
|
-
} else {
|
|
1099
|
-
const oRowIndex = fullDataRowIdData[rowid].index
|
|
1100
|
-
oRow = tableSourceData[oRowIndex]
|
|
1101
|
-
}
|
|
1102
|
-
if (oRow) {
|
|
1095
|
+
const oldRest = sourceDataRowIdData[rowid]
|
|
1096
|
+
if (oldRest) {
|
|
1097
|
+
const oRow = oldRest.row
|
|
1103
1098
|
if (arguments.length > 1) {
|
|
1104
1099
|
return !eqCellValue(oRow, row, field)
|
|
1105
1100
|
}
|
|
1106
1101
|
for (let index = 0, len = tableFullColumn.length; index < len; index++) {
|
|
1107
|
-
property = tableFullColumn[index].field
|
|
1102
|
+
const property = tableFullColumn[index].field
|
|
1108
1103
|
if (property && !eqCellValue(oRow, row, property)) {
|
|
1109
1104
|
return true
|
|
1110
1105
|
}
|
|
@@ -3807,7 +3802,10 @@ const Methods = {
|
|
|
3807
3802
|
if (!remote || (firstSortColumn && firstSortColumn.remoteSort)) {
|
|
3808
3803
|
this.handleTableData(true)
|
|
3809
3804
|
}
|
|
3810
|
-
return this.$nextTick().then(
|
|
3805
|
+
return this.$nextTick().then(() => {
|
|
3806
|
+
this.updateCellAreas()
|
|
3807
|
+
return this.updateStyle()
|
|
3808
|
+
})
|
|
3811
3809
|
}
|
|
3812
3810
|
return this.$nextTick()
|
|
3813
3811
|
},
|
|
@@ -75,6 +75,7 @@ export default {
|
|
|
75
75
|
content: { type: [String, Number], default: null },
|
|
76
76
|
useHTML: Boolean,
|
|
77
77
|
zIndex: [String, Number],
|
|
78
|
+
popupClassName: [String, Function],
|
|
78
79
|
isArrow: { type: Boolean, default: true },
|
|
79
80
|
enterable: Boolean,
|
|
80
81
|
enterDelay: { type: Number, default: () => GlobalConfig.tooltip.enterDelay },
|
|
@@ -159,7 +160,7 @@ export default {
|
|
|
159
160
|
}
|
|
160
161
|
},
|
|
161
162
|
render (h) {
|
|
162
|
-
const { $scopedSlots, vSize, theme, tipActive, isArrow, visible, tipStore, enterable } = this
|
|
163
|
+
const { $scopedSlots, vSize, popupClassName, theme, tipActive, isArrow, visible, tipStore, enterable } = this
|
|
163
164
|
let on
|
|
164
165
|
if (enterable) {
|
|
165
166
|
on = {
|
|
@@ -168,7 +169,7 @@ export default {
|
|
|
168
169
|
}
|
|
169
170
|
}
|
|
170
171
|
return h('div', {
|
|
171
|
-
class: ['vxe-table--tooltip-wrapper', `theme--${theme}`, {
|
|
172
|
+
class: ['vxe-table--tooltip-wrapper', `theme--${theme}`, popupClassName ? (XEUtils.isFunction(popupClassName) ? popupClassName({ $tooltip: this }) : popupClassName) : '', {
|
|
172
173
|
[`size--${vSize}`]: vSize,
|
|
173
174
|
[`placement--${tipStore.placement}`]: tipStore.placement,
|
|
174
175
|
'is--enterable': enterable,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|