vxe-table 3.5.9-beta.9 → 3.5.9
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/lib/button/src/button.js +5 -1
- package/lib/button/src/button.min.js +1 -1
- package/lib/edit/src/mixin.js +12 -8
- package/lib/edit/src/mixin.min.js +1 -1
- package/lib/filter/src/panel.js +2 -1
- package/lib/filter/src/panel.min.js +1 -1
- package/lib/form/src/form-config-item.js +9 -13
- package/lib/form/src/form-config-item.min.js +1 -1
- package/lib/form/src/form-gather.js +1 -3
- package/lib/form/src/form-gather.min.js +1 -1
- package/lib/form/src/form-item.js +12 -13
- package/lib/form/src/form-item.min.js +1 -1
- package/lib/form/src/form.js +6 -3
- package/lib/form/src/form.min.js +1 -1
- package/lib/form/src/util.js +41 -0
- package/lib/form/src/util.min.js +1 -1
- package/lib/grid/src/grid.js +3 -1
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/grid/style/style.css +1 -1
- package/lib/grid/style/style.min.css +1 -1
- package/lib/header/src/header.js +9 -2
- package/lib/header/src/header.min.js +1 -1
- package/lib/header/style/style.css +0 -100
- package/lib/header/style/style.min.css +0 -1
- package/lib/index.css +1 -1
- package/lib/index.umd.js +471 -387
- package/lib/index.umd.min.js +1 -1
- package/lib/modal/src/modal.js +9 -7
- package/lib/modal/src/modal.min.js +1 -1
- package/lib/modal/style/style.css +2 -2
- package/lib/modal/style/style.min.css +1 -1
- package/lib/pager/style/style.css +1 -1
- package/lib/pager/style/style.min.css +1 -1
- package/lib/select/src/select.js +3 -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/cell.js +14 -8
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/methods.js +24 -4
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/style/style.css +101 -0
- package/lib/table/style/style.min.css +1 -1
- package/lib/toolbar/style/style.css +1 -1
- package/lib/toolbar/style/style.min.css +1 -1
- package/lib/tools/log.js +1 -1
- package/lib/tools/log.min.js +1 -1
- package/lib/tools/vn.js +18 -0
- package/lib/tools/vn.min.js +1 -0
- package/lib/v-x-e-table/index.js +1 -1
- package/lib/v-x-e-table/index.min.js +1 -1
- package/lib/v-x-e-table/src/store.js +10 -5
- package/lib/v-x-e-table/src/store.min.js +1 -1
- package/lib/v-x-e-table/style/style.css +1 -1
- package/lib/v-x-e-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/button/src/button.js +7 -1
- package/packages/edit/src/mixin.js +10 -7
- package/packages/filter/src/panel.js +1 -1
- package/packages/form/src/form-config-item.js +8 -12
- package/packages/form/src/form-gather.js +1 -3
- package/packages/form/src/form-item.js +12 -14
- package/packages/form/src/form.js +6 -4
- package/packages/form/src/util.js +23 -0
- package/packages/grid/src/grid.js +2 -1
- package/packages/header/src/header.js +3 -2
- package/packages/modal/src/modal.js +5 -4
- package/packages/select/src/select.js +2 -1
- package/packages/table/src/cell.js +9 -5
- package/packages/table/src/methods.js +17 -4
- package/packages/tools/vn.js +8 -0
- package/packages/v-x-e-table/src/store.js +8 -4
- package/styles/header.scss +0 -134
- package/styles/table.scss +134 -0
- package/styles/variable.scss +1 -1
- package/types/column.d.ts +8 -8
- package/types/component.d.ts +3 -1
- package/types/v-x-e-table/renderer.d.ts +2 -1
|
@@ -2,8 +2,9 @@ import XEUtils from 'xe-utils'
|
|
|
2
2
|
import GlobalConfig from '../../v-x-e-table/src/conf'
|
|
3
3
|
import VXETable from '../../v-x-e-table'
|
|
4
4
|
import { isEnableConf, getFuncText } from '../../tools/utils'
|
|
5
|
-
import { createItem, destroyItem, assemItem } from './util'
|
|
5
|
+
import { createItem, destroyItem, assemItem, isActivetem } from './util'
|
|
6
6
|
import { renderTitle } from './render'
|
|
7
|
+
import { getSlotVNs } from '../../tools/vn'
|
|
7
8
|
|
|
8
9
|
const props = {
|
|
9
10
|
title: String,
|
|
@@ -41,15 +42,14 @@ Object.keys(props).forEach(name => {
|
|
|
41
42
|
})
|
|
42
43
|
|
|
43
44
|
const renderItem = (h, _vm, item, slots) => {
|
|
44
|
-
const { rules, data, collapseAll, validOpts, titleOverflow: allTitleOverflow } = _vm
|
|
45
|
-
const { title, folding, visible,
|
|
45
|
+
const { _e, rules, data, collapseAll, validOpts, titleOverflow: allTitleOverflow } = _vm
|
|
46
|
+
const { title, folding, visible, field, collapseNode, itemRender, showError, errRule, className, titleOverflow } = item
|
|
46
47
|
const compConf = isEnableConf(itemRender) ? VXETable.renderer.get(itemRender.name) : null
|
|
47
48
|
const itemClassName = compConf ? compConf.itemClassName : ''
|
|
48
49
|
const span = item.span || _vm.span
|
|
49
50
|
const align = item.align || _vm.align
|
|
50
51
|
const titleAlign = item.titleAlign || _vm.titleAlign
|
|
51
52
|
const titleWidth = item.titleWidth || _vm.titleWidth
|
|
52
|
-
let itemVisibleMethod = visibleMethod
|
|
53
53
|
const itemOverflow = (XEUtils.isUndefined(titleOverflow) || XEUtils.isNull(titleOverflow)) ? allTitleOverflow : titleOverflow
|
|
54
54
|
const showEllipsis = itemOverflow === 'ellipsis'
|
|
55
55
|
const showTitle = itemOverflow === 'title'
|
|
@@ -57,8 +57,8 @@ const renderItem = (h, _vm, item, slots) => {
|
|
|
57
57
|
const hasEllipsis = showTitle || showTooltip || showEllipsis
|
|
58
58
|
const params = { data, field, property: field, item, $form: _vm }
|
|
59
59
|
let isRequired
|
|
60
|
-
if (
|
|
61
|
-
|
|
60
|
+
if (visible === false) {
|
|
61
|
+
return _e()
|
|
62
62
|
}
|
|
63
63
|
if (rules) {
|
|
64
64
|
const itemRules = rules[field]
|
|
@@ -70,9 +70,9 @@ const renderItem = (h, _vm, item, slots) => {
|
|
|
70
70
|
if (slots && slots.default) {
|
|
71
71
|
contentVNs = _vm.callSlot(slots.default, params, h)
|
|
72
72
|
} else if (compConf && compConf.renderItemContent) {
|
|
73
|
-
contentVNs = compConf.renderItemContent.call(_vm, h, itemRender, params)
|
|
73
|
+
contentVNs = getSlotVNs(compConf.renderItemContent.call(_vm, h, itemRender, params))
|
|
74
74
|
} else if (compConf && compConf.renderItem) {
|
|
75
|
-
contentVNs = compConf.renderItem.call(_vm, h, itemRender, params)
|
|
75
|
+
contentVNs = getSlotVNs(compConf.renderItem.call(_vm, h, itemRender, params))
|
|
76
76
|
} else if (field) {
|
|
77
77
|
contentVNs = [`${XEUtils.get(data, field)}`]
|
|
78
78
|
}
|
|
@@ -88,12 +88,12 @@ const renderItem = (h, _vm, item, slots) => {
|
|
|
88
88
|
item.id,
|
|
89
89
|
span ? `vxe-col--${span} is--span` : '',
|
|
90
90
|
className ? (XEUtils.isFunction(className) ? className(params) : className) : '',
|
|
91
|
-
itemClassName ? (XEUtils.isFunction(itemClassName) ? itemClassName(params) :
|
|
91
|
+
itemClassName ? (XEUtils.isFunction(itemClassName) ? itemClassName(params) : itemClassName) : '',
|
|
92
92
|
{
|
|
93
93
|
'is--title': title,
|
|
94
94
|
'is--required': isRequired,
|
|
95
|
-
'is--hidden':
|
|
96
|
-
'is--active':
|
|
95
|
+
'is--hidden': folding && collapseAll,
|
|
96
|
+
'is--active': isActivetem(_vm, item),
|
|
97
97
|
'is--error': showError
|
|
98
98
|
}
|
|
99
99
|
]
|
|
@@ -156,9 +156,7 @@ export default {
|
|
|
156
156
|
provide () {
|
|
157
157
|
return {
|
|
158
158
|
$xeformitem: this,
|
|
159
|
-
$xeformiteminfo:
|
|
160
|
-
itemConfig: this.itemConfig
|
|
161
|
-
}
|
|
159
|
+
$xeformiteminfo: this
|
|
162
160
|
}
|
|
163
161
|
},
|
|
164
162
|
data () {
|
|
@@ -4,10 +4,11 @@ import vSize from '../../mixins/size'
|
|
|
4
4
|
import VXETable from '../../v-x-e-table'
|
|
5
5
|
import { isEnableConf, eqEmptyValue, getFuncText } from '../../tools/utils'
|
|
6
6
|
import DomTools, { browse } from '../../tools/dom'
|
|
7
|
-
import { createItem, handleFieldOrItem } from './util'
|
|
7
|
+
import { createItem, handleFieldOrItem, isHiddenItem, isActivetem } from './util'
|
|
8
8
|
import { errLog } from '../../tools/log'
|
|
9
9
|
import VxeFormConfigItem from './form-config-item'
|
|
10
10
|
import VxeLoading from '../../loading/index'
|
|
11
|
+
import { getSlotVNs } from '../../tools/vn'
|
|
11
12
|
|
|
12
13
|
class Rule {
|
|
13
14
|
constructor (rule) {
|
|
@@ -79,6 +80,7 @@ export default {
|
|
|
79
80
|
titleAsterisk: { type: Boolean, default: () => GlobalConfig.form.titleAsterisk },
|
|
80
81
|
titleOverflow: { type: [Boolean, String], default: null },
|
|
81
82
|
className: [String, Function],
|
|
83
|
+
readonly: Boolean,
|
|
82
84
|
items: Array,
|
|
83
85
|
rules: Object,
|
|
84
86
|
preventSubmit: { type: Boolean, default: () => GlobalConfig.form.preventSubmit },
|
|
@@ -193,7 +195,7 @@ export default {
|
|
|
193
195
|
slotFunc = $scopedSlots[slotFunc] || null
|
|
194
196
|
}
|
|
195
197
|
if (XEUtils.isFunction(slotFunc)) {
|
|
196
|
-
return slotFunc.call(this, params, h)
|
|
198
|
+
return getSlotVNs(slotFunc.call(this, params, h))
|
|
197
199
|
}
|
|
198
200
|
}
|
|
199
201
|
return []
|
|
@@ -357,7 +359,7 @@ export default {
|
|
|
357
359
|
if (data && formRules) {
|
|
358
360
|
itemList.forEach(item => {
|
|
359
361
|
const { field } = item
|
|
360
|
-
if (field) {
|
|
362
|
+
if (field && !isHiddenItem(this, item) && isActivetem(this, item)) {
|
|
361
363
|
itemValids.push(
|
|
362
364
|
this.validItemRules(type || 'all', field).then(() => {
|
|
363
365
|
item.errRule = null
|
|
@@ -506,7 +508,7 @@ export default {
|
|
|
506
508
|
},
|
|
507
509
|
triggerItemEvent (evnt, field, itemValue) {
|
|
508
510
|
if (field) {
|
|
509
|
-
return this.validItemRules(evnt ? evnt.type : 'all', field, itemValue)
|
|
511
|
+
return this.validItemRules(evnt ? (['blur'].includes(evnt.type) ? 'blur' : 'change') : 'all', field, itemValue)
|
|
510
512
|
.then(() => {
|
|
511
513
|
this.clearValidate(field)
|
|
512
514
|
})
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils'
|
|
2
2
|
import VXETable from '../../v-x-e-table'
|
|
3
3
|
import { warnLog } from '../../tools/log'
|
|
4
|
+
import { isEnableConf } from '../../tools/utils'
|
|
4
5
|
|
|
5
6
|
class ItemConfig {
|
|
6
7
|
constructor ($xeform, item) {
|
|
@@ -58,6 +59,28 @@ export const handleFieldOrItem = ($xeform, fieldOrItem) => {
|
|
|
58
59
|
return null
|
|
59
60
|
}
|
|
60
61
|
|
|
62
|
+
export function isHiddenItem ($xeform, formItem) {
|
|
63
|
+
const { collapseAll } = $xeform
|
|
64
|
+
const { folding, visible } = formItem
|
|
65
|
+
return visible === false || (folding && collapseAll)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function isActivetem ($xeform, formItem) {
|
|
69
|
+
let { visibleMethod, itemRender, visible, field } = formItem
|
|
70
|
+
if (visible === false) {
|
|
71
|
+
return visible
|
|
72
|
+
}
|
|
73
|
+
const compConf = isEnableConf(itemRender) ? VXETable.renderer.get(itemRender.name) : null
|
|
74
|
+
if (!visibleMethod && compConf && compConf.itemVisibleMethod) {
|
|
75
|
+
visibleMethod = compConf.itemVisibleMethod
|
|
76
|
+
}
|
|
77
|
+
if (!visibleMethod) {
|
|
78
|
+
return true
|
|
79
|
+
}
|
|
80
|
+
const { data } = $xeform
|
|
81
|
+
return visibleMethod({ data, field, property: field, item: formItem, $form: $xeform })
|
|
82
|
+
}
|
|
83
|
+
|
|
61
84
|
export function createItem ($xeform, _vm) {
|
|
62
85
|
return getItemConfig($xeform, _vm)
|
|
63
86
|
}
|
|
@@ -7,6 +7,7 @@ import UtilTools, { isEnableConf } from '../../tools/utils'
|
|
|
7
7
|
import DomTools, { getOffsetHeight, getPaddingTopBottomSize } from '../../tools/dom'
|
|
8
8
|
import { GlobalEvent } from '../../tools/event'
|
|
9
9
|
import { warnLog, errLog } from '../../tools/log'
|
|
10
|
+
import { getSlotVNs } from '../../tools/vn'
|
|
10
11
|
|
|
11
12
|
const methods = {}
|
|
12
13
|
const propKeys = Object.keys(Table.props)
|
|
@@ -372,7 +373,7 @@ export default {
|
|
|
372
373
|
slotFunc = $scopedSlots[slotFunc] || null
|
|
373
374
|
}
|
|
374
375
|
if (XEUtils.isFunction(slotFunc)) {
|
|
375
|
-
return slotFunc.call(this, params, h, vNodes)
|
|
376
|
+
return getSlotVNs(slotFunc.call(this, params, h, vNodes))
|
|
376
377
|
}
|
|
377
378
|
}
|
|
378
379
|
return []
|
|
@@ -272,7 +272,8 @@ export default {
|
|
|
272
272
|
document.onmouseup = function (evnt) {
|
|
273
273
|
document.onmousemove = domMousemove
|
|
274
274
|
document.onmouseup = domMouseup
|
|
275
|
-
|
|
275
|
+
const resizeWidth = column.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft)
|
|
276
|
+
column.resizeWidth = resizeWidth
|
|
276
277
|
resizeBarElem.style.display = 'none'
|
|
277
278
|
$xetable._isResize = false
|
|
278
279
|
$xetable._lastResizeTime = Date.now()
|
|
@@ -280,7 +281,7 @@ export default {
|
|
|
280
281
|
$xetable.recalculate(true).then(() => {
|
|
281
282
|
$xetable.saveCustomResizable()
|
|
282
283
|
$xetable.updateCellAreas()
|
|
283
|
-
$xetable.emitEvent('resizable-change', params, evnt)
|
|
284
|
+
$xetable.emitEvent('resizable-change', { ...params, resizeWidth }, evnt)
|
|
284
285
|
})
|
|
285
286
|
DomTools.removeClass($xetable.$el, 'drag--resize')
|
|
286
287
|
}
|
|
@@ -5,6 +5,7 @@ import UtilTools, { getFuncText } from '../../tools/utils'
|
|
|
5
5
|
import DomTools from '../../tools/dom'
|
|
6
6
|
import { GlobalEvent } from '../../tools/event'
|
|
7
7
|
import { errLog } from '../../tools/log'
|
|
8
|
+
import { getSlotVNs } from '../../tools/vn'
|
|
8
9
|
import VxeLoading from '../../loading/index'
|
|
9
10
|
|
|
10
11
|
export const allActivedModals = []
|
|
@@ -168,8 +169,8 @@ export default {
|
|
|
168
169
|
'is--ellipsis': !isMsg && showTitleOverflow
|
|
169
170
|
}],
|
|
170
171
|
on: headerOns
|
|
171
|
-
}, headerSlot ? (!inited || (destroyOnClose && !visible) ? [] : headerSlot.call(this, { $modal: this }, h)) : [
|
|
172
|
-
titleSlot ? titleSlot.call(this, { $modal: this }, h) : h('span', {
|
|
172
|
+
}, headerSlot ? (!inited || (destroyOnClose && !visible) ? [] : getSlotVNs(headerSlot.call(this, { $modal: this }, h))) : [
|
|
173
|
+
titleSlot ? getSlotVNs(titleSlot.call(this, { $modal: this }, h)) : h('span', {
|
|
173
174
|
class: 'vxe-modal--title'
|
|
174
175
|
}, title ? getFuncText(title) : GlobalConfig.i18n('vxe.alert.title')),
|
|
175
176
|
showZoom ? h('i', {
|
|
@@ -203,7 +204,7 @@ export default {
|
|
|
203
204
|
]) : null,
|
|
204
205
|
h('div', {
|
|
205
206
|
class: 'vxe-modal--content'
|
|
206
|
-
}, defaultSlot ? (!inited || (destroyOnClose && !visible) ? [] : defaultSlot.call(this, { $modal: this }, h)) : getFuncText(content)),
|
|
207
|
+
}, defaultSlot ? (!inited || (destroyOnClose && !visible) ? [] : getSlotVNs(defaultSlot.call(this, { $modal: this }, h))) : getFuncText(content)),
|
|
207
208
|
/**
|
|
208
209
|
* 加载中
|
|
209
210
|
*/
|
|
@@ -216,7 +217,7 @@ export default {
|
|
|
216
217
|
]),
|
|
217
218
|
showFooter ? h('div', {
|
|
218
219
|
class: 'vxe-modal--footer'
|
|
219
|
-
}, footerSlot ? (!inited || (destroyOnClose && !visible) ? [] : footerSlot.call(this, { $modal: this }, h)) : [
|
|
220
|
+
}, footerSlot ? (!inited || (destroyOnClose && !visible) ? [] : getSlotVNs(footerSlot.call(this, { $modal: this }, h))) : [
|
|
220
221
|
type === 'confirm' ? h('vxe-button', {
|
|
221
222
|
ref: 'cancelBtn',
|
|
222
223
|
on: {
|
|
@@ -5,6 +5,7 @@ import vSize from '../../mixins/size'
|
|
|
5
5
|
import UtilTools, { getFuncText } from '../../tools/utils'
|
|
6
6
|
import DomTools from '../../tools/dom'
|
|
7
7
|
import { GlobalEvent, hasEventKey, EVENT_KEYS } from '../../tools/event'
|
|
8
|
+
import { getSlotVNs } from '../../tools/vn'
|
|
8
9
|
|
|
9
10
|
function isOptionVisible (option) {
|
|
10
11
|
return option.visible !== false
|
|
@@ -474,7 +475,7 @@ export default {
|
|
|
474
475
|
slotFunc = $scopedSlots[slotFunc] || null
|
|
475
476
|
}
|
|
476
477
|
if (XEUtils.isFunction(slotFunc)) {
|
|
477
|
-
return slotFunc.call(this, params, h)
|
|
478
|
+
return getSlotVNs(slotFunc.call(this, params, h))
|
|
478
479
|
}
|
|
479
480
|
}
|
|
480
481
|
return []
|
|
@@ -4,6 +4,7 @@ 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
6
|
import { getColumnConfig } from './util'
|
|
7
|
+
import { getSlotVNs } from '../../tools/vn'
|
|
7
8
|
|
|
8
9
|
function renderHelpIcon (h, params) {
|
|
9
10
|
const { $table, column } = params
|
|
@@ -78,7 +79,7 @@ function getFooterContent (h, params) {
|
|
|
78
79
|
if (renderOpts) {
|
|
79
80
|
const compConf = VXETable.renderer.get(renderOpts.name)
|
|
80
81
|
if (compConf && compConf.renderFooter) {
|
|
81
|
-
return compConf.renderFooter.call($table, h, renderOpts, params)
|
|
82
|
+
return getSlotVNs(compConf.renderFooter.call($table, h, renderOpts, params))
|
|
82
83
|
}
|
|
83
84
|
}
|
|
84
85
|
return [UtilTools.formatText(items[_columnIndex], 1)]
|
|
@@ -152,7 +153,7 @@ export const Cell = {
|
|
|
152
153
|
if (renderOpts) {
|
|
153
154
|
const compConf = VXETable.renderer.get(renderOpts.name)
|
|
154
155
|
if (compConf && compConf.renderHeader) {
|
|
155
|
-
return renderTitleContent(h, params, compConf.renderHeader.call($table, h, renderOpts, params))
|
|
156
|
+
return getSlotVNs(renderTitleContent(h, params, compConf.renderHeader.call($table, h, renderOpts, params)))
|
|
156
157
|
}
|
|
157
158
|
}
|
|
158
159
|
return renderTitleContent(h, params, UtilTools.formatText(column.getTitle(), 1))
|
|
@@ -171,7 +172,7 @@ export const Cell = {
|
|
|
171
172
|
const funName = editRender ? 'renderCell' : 'renderDefault'
|
|
172
173
|
const compConf = VXETable.renderer.get(renderOpts.name)
|
|
173
174
|
if (compConf && compConf[funName]) {
|
|
174
|
-
return compConf[funName].call($table, h, renderOpts, Object.assign({ $type: editRender ? 'edit' : 'cell' }, params))
|
|
175
|
+
return getSlotVNs(compConf[funName].call($table, h, renderOpts, Object.assign({ $type: editRender ? 'edit' : 'cell' }, params)))
|
|
175
176
|
}
|
|
176
177
|
}
|
|
177
178
|
const cellValue = $table.getCellLabel(row, column)
|
|
@@ -592,7 +593,7 @@ export const Cell = {
|
|
|
592
593
|
if (contentRender) {
|
|
593
594
|
const compConf = VXETable.renderer.get(contentRender.name)
|
|
594
595
|
if (compConf && compConf.renderExpand) {
|
|
595
|
-
return compConf.renderExpand.call($table, h, contentRender, params)
|
|
596
|
+
return getSlotVNs(compConf.renderExpand.call($table, h, contentRender, params))
|
|
596
597
|
}
|
|
597
598
|
}
|
|
598
599
|
return []
|
|
@@ -756,7 +757,10 @@ export const Cell = {
|
|
|
756
757
|
if (slots && slots.edit) {
|
|
757
758
|
return $table.callSlot(slots.edit, params, h)
|
|
758
759
|
}
|
|
759
|
-
|
|
760
|
+
if (compConf && compConf.renderEdit) {
|
|
761
|
+
return getSlotVNs(compConf.renderEdit.call($table, h, editRender, Object.assign({ $type: 'edit' }, params)))
|
|
762
|
+
}
|
|
763
|
+
return []
|
|
760
764
|
}
|
|
761
765
|
if (slots && slots.default) {
|
|
762
766
|
return $table.callSlot(slots.default, params, h)
|
|
@@ -7,6 +7,7 @@ import UtilTools, { eqEmptyValue, isEnableConf, getFuncText } from '../../tools/
|
|
|
7
7
|
import DomTools, { browse, getPaddingTopBottomSize, setScrollTop, setScrollLeft } from '../../tools/dom'
|
|
8
8
|
import { formats } from '../../v-x-e-table/src/formats'
|
|
9
9
|
import { warnLog, errLog } from '../../tools/log'
|
|
10
|
+
import { getSlotVNs } from '../../tools/vn'
|
|
10
11
|
|
|
11
12
|
const { setCellValue, hasChildrenList, getColumnList } = UtilTools
|
|
12
13
|
const { calcHeight, hasClass, addClass, removeClass, getEventTargetNode, isNodeElement } = DomTools
|
|
@@ -245,7 +246,7 @@ const Methods = {
|
|
|
245
246
|
return $xegrid.callSlot(slotFunc, params, h, vNodes)
|
|
246
247
|
}
|
|
247
248
|
if (XEUtils.isFunction(slotFunc)) {
|
|
248
|
-
return slotFunc.call(this, params, h, vNodes)
|
|
249
|
+
return getSlotVNs(slotFunc.call(this, params, h, vNodes))
|
|
249
250
|
}
|
|
250
251
|
}
|
|
251
252
|
return []
|
|
@@ -2227,7 +2228,7 @@ const Methods = {
|
|
|
2227
2228
|
// 如果点击了当前表格之外
|
|
2228
2229
|
!getEventTargetNode(evnt, $el).flag
|
|
2229
2230
|
) {
|
|
2230
|
-
setTimeout(() => this.
|
|
2231
|
+
setTimeout(() => this.clearEdit(evnt))
|
|
2231
2232
|
}
|
|
2232
2233
|
})
|
|
2233
2234
|
}
|
|
@@ -2288,7 +2289,7 @@ const Methods = {
|
|
|
2288
2289
|
// 如果是激活编辑状态,则取消编辑
|
|
2289
2290
|
if (actived.row) {
|
|
2290
2291
|
const params = actived.args
|
|
2291
|
-
this.
|
|
2292
|
+
this.clearEdit(evnt)
|
|
2292
2293
|
// 如果配置了选中功能,则为选中状态
|
|
2293
2294
|
if (mouseConfig && mouseOpts.selected) {
|
|
2294
2295
|
this.$nextTick(() => this.handleSelected(params, evnt))
|
|
@@ -2377,7 +2378,7 @@ const Methods = {
|
|
|
2377
2378
|
// 如果是激活编辑状态,则取消编辑
|
|
2378
2379
|
if (actived.row) {
|
|
2379
2380
|
params = actived.args
|
|
2380
|
-
this.
|
|
2381
|
+
this.clearEdit(evnt)
|
|
2381
2382
|
// 如果配置了选中功能,则为选中状态
|
|
2382
2383
|
if (mouseConfig && mouseOpts.selected) {
|
|
2383
2384
|
this.$nextTick(() => this.handleSelected(params, evnt))
|
|
@@ -4645,6 +4646,18 @@ const Methods = {
|
|
|
4645
4646
|
}
|
|
4646
4647
|
return cellLabel
|
|
4647
4648
|
},
|
|
4649
|
+
findRowIndexOf (list, row) {
|
|
4650
|
+
return row ? XEUtils.findIndexOf(list, item => this.eqRow(item, row)) : -1
|
|
4651
|
+
},
|
|
4652
|
+
eqRow (row1, row2) {
|
|
4653
|
+
if (row1 && row2) {
|
|
4654
|
+
if (row1 === row2) {
|
|
4655
|
+
return true
|
|
4656
|
+
}
|
|
4657
|
+
return getRowid(this, row1) === getRowid(this, row2)
|
|
4658
|
+
}
|
|
4659
|
+
return false
|
|
4660
|
+
},
|
|
4648
4661
|
/*************************
|
|
4649
4662
|
* Publish methods
|
|
4650
4663
|
*************************/
|
|
@@ -19,13 +19,17 @@ class Store {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
add (name, render) {
|
|
22
|
+
const conf = this.store[name]
|
|
22
23
|
// 检测是否覆盖
|
|
23
24
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
const confKeys = XEUtils.keys(conf)
|
|
26
|
+
XEUtils.each(render, (item, key) => {
|
|
27
|
+
if (confKeys.includes(key)) {
|
|
28
|
+
warnLog('vxe.error.coverProp', [name, key])
|
|
29
|
+
}
|
|
30
|
+
})
|
|
27
31
|
}
|
|
28
|
-
this.store[name] = render
|
|
32
|
+
this.store[name] = conf ? XEUtils.merge(conf, render) : render
|
|
29
33
|
return Store
|
|
30
34
|
}
|
|
31
35
|
|
package/styles/header.scss
CHANGED
|
@@ -1,135 +1 @@
|
|
|
1
1
|
/**Variable**/
|
|
2
|
-
|
|
3
|
-
.vxe-table {
|
|
4
|
-
.vxe-table--header-wrapper {
|
|
5
|
-
color: $vxe-table-header-font-color;
|
|
6
|
-
.vxe-table--header-border-line {
|
|
7
|
-
position: absolute;
|
|
8
|
-
left: 0;
|
|
9
|
-
bottom: 0;
|
|
10
|
-
height: 0;
|
|
11
|
-
border-bottom: $vxe-table-border-width solid $vxe-table-border-color;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
/*排序*/
|
|
15
|
-
.vxe-cell--sort {
|
|
16
|
-
width: 1.5em;
|
|
17
|
-
height: 1.35em;
|
|
18
|
-
vertical-align: middle;
|
|
19
|
-
text-align: center;
|
|
20
|
-
display: inline-block;
|
|
21
|
-
position: relative;
|
|
22
|
-
}
|
|
23
|
-
.vxe-sort--asc-btn,
|
|
24
|
-
.vxe-sort--desc-btn {
|
|
25
|
-
position: absolute;
|
|
26
|
-
left: 0.35em;
|
|
27
|
-
color: $vxe-table-column-icon-border-color;
|
|
28
|
-
width: 1em;
|
|
29
|
-
text-align: center;
|
|
30
|
-
cursor: pointer;
|
|
31
|
-
&:hover {
|
|
32
|
-
color: $vxe-table-font-color;
|
|
33
|
-
}
|
|
34
|
-
&.sort--active {
|
|
35
|
-
color: $vxe-primary-color;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
.vxe-sort--asc-btn {
|
|
39
|
-
top: -0.15em;
|
|
40
|
-
}
|
|
41
|
-
.vxe-sort--desc-btn {
|
|
42
|
-
bottom: -0.15em;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.vxe-header--column {
|
|
47
|
-
position: relative;
|
|
48
|
-
font-weight: $vxe-table-header-font-weight;
|
|
49
|
-
// user-select: none;
|
|
50
|
-
&.col--ellipsis {
|
|
51
|
-
& > .vxe-cell {
|
|
52
|
-
display: flex;
|
|
53
|
-
align-items: center;
|
|
54
|
-
.vxe-cell--title {
|
|
55
|
-
overflow: hidden;
|
|
56
|
-
text-overflow: ellipsis;
|
|
57
|
-
white-space: nowrap;
|
|
58
|
-
}
|
|
59
|
-
& > i,
|
|
60
|
-
& > span {
|
|
61
|
-
&:not(.vxe-cell--title) {
|
|
62
|
-
flex-shrink: 0;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
.vxe-cell--required-icon {
|
|
68
|
-
display: inline-block;
|
|
69
|
-
color: $vxe-table-validate-error-color;
|
|
70
|
-
width: 0.8em;
|
|
71
|
-
height: 1em;
|
|
72
|
-
line-height: 1em;
|
|
73
|
-
font-family: $vxe-icon-font-family;
|
|
74
|
-
font-weight: normal;
|
|
75
|
-
position: relative;
|
|
76
|
-
&:before {
|
|
77
|
-
content: "*";
|
|
78
|
-
position: absolute;
|
|
79
|
-
left: 0;
|
|
80
|
-
top: 0.2em;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
// .vxe-cell--required-icon,
|
|
84
|
-
// .vxe-cell--edit-icon,
|
|
85
|
-
// .vxe-cell-help-icon,
|
|
86
|
-
// .vxe-cell--title {
|
|
87
|
-
// vertical-align: middle;
|
|
88
|
-
// }
|
|
89
|
-
.vxe-cell--required-icon {
|
|
90
|
-
margin-right: 0.1em;
|
|
91
|
-
}
|
|
92
|
-
.vxe-cell--edit-icon,
|
|
93
|
-
.vxe-cell-help-icon {
|
|
94
|
-
margin-right: 0.2em;
|
|
95
|
-
}
|
|
96
|
-
.vxe-cell-help-icon {
|
|
97
|
-
cursor: help;
|
|
98
|
-
}
|
|
99
|
-
.vxe-resizable {
|
|
100
|
-
position: absolute;
|
|
101
|
-
right: -7px;
|
|
102
|
-
bottom: 0;
|
|
103
|
-
width: 14px;
|
|
104
|
-
height: 100%;
|
|
105
|
-
text-align: center;
|
|
106
|
-
z-index: 1;
|
|
107
|
-
cursor: col-resize;
|
|
108
|
-
&.is--line {
|
|
109
|
-
&:before,
|
|
110
|
-
&:after {
|
|
111
|
-
content: "";
|
|
112
|
-
display: inline-block;
|
|
113
|
-
vertical-align: middle;
|
|
114
|
-
}
|
|
115
|
-
&:before {
|
|
116
|
-
width: 1px;
|
|
117
|
-
height: 50%;
|
|
118
|
-
background-color: $vxe-table-resizable-line-color;
|
|
119
|
-
}
|
|
120
|
-
&:after {
|
|
121
|
-
width: 0;
|
|
122
|
-
height: 100%;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.vxe-table--fixed-right-wrapper {
|
|
129
|
-
.vxe-header--column {
|
|
130
|
-
.vxe-resizable {
|
|
131
|
-
right: auto;
|
|
132
|
-
left: -7px;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
package/styles/table.scss
CHANGED
|
@@ -311,6 +311,140 @@
|
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
313
|
|
|
314
|
+
/*header*/
|
|
315
|
+
.vxe-table {
|
|
316
|
+
.vxe-table--header-wrapper {
|
|
317
|
+
color: $vxe-table-header-font-color;
|
|
318
|
+
.vxe-table--header-border-line {
|
|
319
|
+
position: absolute;
|
|
320
|
+
left: 0;
|
|
321
|
+
bottom: 0;
|
|
322
|
+
height: 0;
|
|
323
|
+
border-bottom: $vxe-table-border-width solid $vxe-table-border-color;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
/*排序*/
|
|
327
|
+
.vxe-cell--sort {
|
|
328
|
+
width: 1.5em;
|
|
329
|
+
height: 1.35em;
|
|
330
|
+
vertical-align: middle;
|
|
331
|
+
text-align: center;
|
|
332
|
+
display: inline-block;
|
|
333
|
+
position: relative;
|
|
334
|
+
}
|
|
335
|
+
.vxe-sort--asc-btn,
|
|
336
|
+
.vxe-sort--desc-btn {
|
|
337
|
+
position: absolute;
|
|
338
|
+
left: 0.35em;
|
|
339
|
+
color: $vxe-table-column-icon-border-color;
|
|
340
|
+
width: 1em;
|
|
341
|
+
text-align: center;
|
|
342
|
+
cursor: pointer;
|
|
343
|
+
&:hover {
|
|
344
|
+
color: $vxe-table-font-color;
|
|
345
|
+
}
|
|
346
|
+
&.sort--active {
|
|
347
|
+
color: $vxe-primary-color;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
.vxe-sort--asc-btn {
|
|
351
|
+
top: -0.15em;
|
|
352
|
+
}
|
|
353
|
+
.vxe-sort--desc-btn {
|
|
354
|
+
bottom: -0.15em;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.vxe-header--column {
|
|
359
|
+
position: relative;
|
|
360
|
+
font-weight: $vxe-table-header-font-weight;
|
|
361
|
+
// user-select: none;
|
|
362
|
+
&.col--ellipsis {
|
|
363
|
+
& > .vxe-cell {
|
|
364
|
+
display: flex;
|
|
365
|
+
align-items: center;
|
|
366
|
+
.vxe-cell--title {
|
|
367
|
+
overflow: hidden;
|
|
368
|
+
text-overflow: ellipsis;
|
|
369
|
+
white-space: nowrap;
|
|
370
|
+
}
|
|
371
|
+
& > i,
|
|
372
|
+
& > span {
|
|
373
|
+
&:not(.vxe-cell--title) {
|
|
374
|
+
flex-shrink: 0;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
.vxe-cell--required-icon {
|
|
380
|
+
display: inline-block;
|
|
381
|
+
color: $vxe-table-validate-error-color;
|
|
382
|
+
width: 0.8em;
|
|
383
|
+
height: 1em;
|
|
384
|
+
line-height: 1em;
|
|
385
|
+
font-family: $vxe-icon-font-family;
|
|
386
|
+
font-weight: normal;
|
|
387
|
+
position: relative;
|
|
388
|
+
&:before {
|
|
389
|
+
content: "*";
|
|
390
|
+
position: absolute;
|
|
391
|
+
left: 0;
|
|
392
|
+
top: 0.2em;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
// .vxe-cell--required-icon,
|
|
396
|
+
// .vxe-cell--edit-icon,
|
|
397
|
+
// .vxe-cell-help-icon,
|
|
398
|
+
// .vxe-cell--title {
|
|
399
|
+
// vertical-align: middle;
|
|
400
|
+
// }
|
|
401
|
+
.vxe-cell--required-icon {
|
|
402
|
+
margin-right: 0.1em;
|
|
403
|
+
}
|
|
404
|
+
.vxe-cell--edit-icon,
|
|
405
|
+
.vxe-cell-help-icon {
|
|
406
|
+
margin-right: 0.2em;
|
|
407
|
+
}
|
|
408
|
+
.vxe-cell-help-icon {
|
|
409
|
+
cursor: help;
|
|
410
|
+
}
|
|
411
|
+
.vxe-resizable {
|
|
412
|
+
position: absolute;
|
|
413
|
+
right: -7px;
|
|
414
|
+
bottom: 0;
|
|
415
|
+
width: 14px;
|
|
416
|
+
height: 100%;
|
|
417
|
+
text-align: center;
|
|
418
|
+
z-index: 1;
|
|
419
|
+
cursor: col-resize;
|
|
420
|
+
&.is--line {
|
|
421
|
+
&:before,
|
|
422
|
+
&:after {
|
|
423
|
+
content: "";
|
|
424
|
+
display: inline-block;
|
|
425
|
+
vertical-align: middle;
|
|
426
|
+
}
|
|
427
|
+
&:before {
|
|
428
|
+
width: 1px;
|
|
429
|
+
height: 50%;
|
|
430
|
+
background-color: $vxe-table-resizable-line-color;
|
|
431
|
+
}
|
|
432
|
+
&:after {
|
|
433
|
+
width: 0;
|
|
434
|
+
height: 100%;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
.vxe-table--fixed-right-wrapper {
|
|
440
|
+
.vxe-header--column {
|
|
441
|
+
.vxe-resizable {
|
|
442
|
+
right: auto;
|
|
443
|
+
left: -7px;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
|
|
314
448
|
/*table*/
|
|
315
449
|
.vxe-table--render-default {
|
|
316
450
|
position: relative;
|
package/styles/variable.scss
CHANGED
|
@@ -108,7 +108,7 @@ $vxe-table-menu-item-width: 178px !default;
|
|
|
108
108
|
$vxe-table-menu-background-color: #fff !default;
|
|
109
109
|
|
|
110
110
|
/*loading*/
|
|
111
|
-
$vxe-loading-background-color: rgba(0, 0, 0, 0.
|
|
111
|
+
$vxe-loading-background-color: rgba(0, 0, 0, 0.3) !default;
|
|
112
112
|
$vxe-loading-z-index: 999 !default;
|
|
113
113
|
|
|
114
114
|
/*validate*/
|