vxe-table 3.4.12 → 3.4.14-beta.2
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.en.md +3 -1
- package/README.md +5 -3
- package/README.zh-TW.md +5 -3
- package/lib/edit/src/mixin.js +9 -1
- package/lib/edit/src/mixin.min.js +1 -1
- package/lib/export/src/mixin.js +15 -10
- package/lib/export/src/mixin.min.js +1 -1
- package/lib/export/style/style.css +2 -0
- package/lib/export/style/style.min.css +1 -1
- package/lib/filter/src/mixin.js +5 -1
- package/lib/filter/src/mixin.min.js +1 -1
- package/lib/filter/style/style.css +2 -0
- package/lib/filter/style/style.min.css +1 -1
- package/lib/footer/src/footer.js +11 -0
- package/lib/footer/src/footer.min.js +1 -1
- package/lib/form/src/form.js +6 -1
- package/lib/form/src/form.min.js +1 -1
- package/lib/grid/src/grid.js +4 -1
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/header/src/header.js +12 -0
- package/lib/header/src/header.min.js +1 -1
- package/lib/index.css +1 -1
- package/lib/index.umd.js +489 -337
- package/lib/index.umd.min.js +1 -1
- package/lib/input/src/date.js +54 -0
- package/lib/input/src/date.min.js +1 -0
- package/lib/input/src/input.js +12 -59
- package/lib/input/src/input.min.js +1 -1
- package/lib/input/src/number.js +23 -0
- package/lib/input/src/number.min.js +1 -0
- package/lib/modal/src/modal.js +1 -1
- package/lib/modal/src/modal.min.js +1 -1
- package/lib/pager/src/pager.js +15 -1
- package/lib/pager/src/pager.min.js +1 -1
- package/lib/pulldown/src/pulldown.js +13 -0
- package/lib/pulldown/src/pulldown.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/body.js +24 -5
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +5 -6
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/methods.js +344 -293
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/style/style.css +2 -0
- package/lib/table/style/style.min.css +1 -1
- package/lib/toolbar/style/style.css +2 -0
- package/lib/toolbar/style/style.min.css +1 -1
- package/lib/tools/src/utils.js +1 -0
- package/lib/tools/src/utils.min.js +1 -1
- package/lib/validator/src/mixin.js +2 -0
- package/lib/validator/src/mixin.min.js +1 -1
- package/package.json +4 -4
- package/packages/edit/src/mixin.js +1 -1
- package/packages/export/src/mixin.js +16 -9
- package/packages/filter/src/mixin.js +4 -1
- package/packages/footer/src/footer.js +10 -0
- package/packages/form/src/form.js +6 -4
- package/packages/grid/src/grid.js +2 -1
- package/packages/header/src/header.js +11 -0
- package/packages/input/src/date.js +38 -0
- package/packages/input/src/input.js +4 -46
- package/packages/input/src/number.js +12 -0
- package/packages/modal/src/modal.js +1 -1
- package/packages/pager/src/pager.js +15 -1
- package/packages/pulldown/src/pulldown.js +12 -0
- package/packages/table/src/body.js +41 -7
- package/packages/table/src/cell.js +4 -6
- package/packages/table/src/methods.js +49 -12
- package/packages/tools/src/utils.js +1 -0
- package/packages/validator/src/mixin.js +11 -1
- package/styles/base/checked.scss +5 -0
- package/styles/button.scss +4 -4
- package/styles/modal.scss +14 -13
- package/styles/table.scss +4 -4
- package/styles/variable.scss +8 -0
- package/types/all.d.ts +1 -0
- package/types/column.d.ts +7 -1
- package/types/form.d.ts +2 -1
- package/types/table.d.ts +6 -2
|
@@ -2,55 +2,13 @@ import XEUtils from 'xe-utils'
|
|
|
2
2
|
import GlobalConfig from '../../v-x-e-table/src/conf'
|
|
3
3
|
import vSize from '../../mixins/size'
|
|
4
4
|
import { UtilTools, DomTools, GlobalEvent } from '../../tools'
|
|
5
|
+
import { toStringTimeDate, getDateQuarter } from './date'
|
|
6
|
+
import { handleNumber, toFloatValueFixed } from './number'
|
|
5
7
|
|
|
6
8
|
const yearSize = 20
|
|
7
9
|
const monthSize = 20
|
|
8
10
|
const quarterSize = 8
|
|
9
11
|
|
|
10
|
-
function toStringTimeDate (str) {
|
|
11
|
-
if (str) {
|
|
12
|
-
const rest = new Date()
|
|
13
|
-
let h, m, s
|
|
14
|
-
if (XEUtils.isDate(str)) {
|
|
15
|
-
h = str.getHours()
|
|
16
|
-
m = str.getMinutes()
|
|
17
|
-
s = str.getSeconds()
|
|
18
|
-
} else {
|
|
19
|
-
str = XEUtils.toValueString(str)
|
|
20
|
-
const parses = str.match(/^(\d{1,2})(:(\d{1,2}))?(:(\d{1,2}))?/)
|
|
21
|
-
if (parses) {
|
|
22
|
-
h = parses[1]
|
|
23
|
-
m = parses[3]
|
|
24
|
-
s = parses[5]
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
rest.setHours(h || 0)
|
|
28
|
-
rest.setMinutes(m || 0)
|
|
29
|
-
rest.setSeconds(s || 0)
|
|
30
|
-
return rest
|
|
31
|
-
}
|
|
32
|
-
return new Date('')
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function getDateQuarter (date) {
|
|
36
|
-
const month = date.getMonth()
|
|
37
|
-
if (month < 3) {
|
|
38
|
-
return 1
|
|
39
|
-
} else if (month < 6) {
|
|
40
|
-
return 2
|
|
41
|
-
} else if (month < 9) {
|
|
42
|
-
return 3
|
|
43
|
-
}
|
|
44
|
-
return 4
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function toFloatValueFixed (inputValue, digitsValue) {
|
|
48
|
-
if (/^-/.test('' + inputValue)) {
|
|
49
|
-
return XEUtils.toFixed(XEUtils.ceil(inputValue, digitsValue), digitsValue)
|
|
50
|
-
}
|
|
51
|
-
return XEUtils.toFixed(XEUtils.floor(inputValue, digitsValue), digitsValue)
|
|
52
|
-
}
|
|
53
|
-
|
|
54
12
|
function getNumberValue (_vm, val) {
|
|
55
13
|
const { type, exponential, digitsValue, inpMaxlength } = _vm
|
|
56
14
|
const restVal = (type === 'float' ? toFloatValueFixed(val, digitsValue) : XEUtils.toValueString(val))
|
|
@@ -1304,7 +1262,7 @@ export default {
|
|
|
1304
1262
|
if (!inpReadonly) {
|
|
1305
1263
|
if (isNumType) {
|
|
1306
1264
|
if (inputValue) {
|
|
1307
|
-
let inpNumVal = type === 'integer' ? XEUtils.toInteger(inputValue) : XEUtils.toNumber(inputValue)
|
|
1265
|
+
let inpNumVal = type === 'integer' ? XEUtils.toInteger(handleNumber(inputValue)) : XEUtils.toNumber(handleNumber(inputValue))
|
|
1308
1266
|
if (!this.vaildMinNum(inpNumVal)) {
|
|
1309
1267
|
inpNumVal = min
|
|
1310
1268
|
} else if (!this.vaildMaxNum(inpNumVal)) {
|
|
@@ -1446,7 +1404,7 @@ export default {
|
|
|
1446
1404
|
},
|
|
1447
1405
|
numberChange (isPlus, evnt) {
|
|
1448
1406
|
const { min, max, type, inputValue, stepValue } = this
|
|
1449
|
-
const numValue = type === 'integer' ? XEUtils.toInteger(inputValue) : XEUtils.toNumber(inputValue)
|
|
1407
|
+
const numValue = type === 'integer' ? XEUtils.toInteger(handleNumber(inputValue)) : XEUtils.toNumber(handleNumber(inputValue))
|
|
1450
1408
|
const newValue = isPlus ? XEUtils.add(numValue, stepValue) : XEUtils.subtract(numValue, stepValue)
|
|
1451
1409
|
let restNum
|
|
1452
1410
|
if (!this.vaildMinNum(newValue)) {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import XEUtils from 'xe-utils'
|
|
2
|
+
|
|
3
|
+
export function handleNumber (val) {
|
|
4
|
+
return XEUtils.isString(val) ? val.replace(/,/g, '') : val
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function toFloatValueFixed (inputValue, digitsValue) {
|
|
8
|
+
if (/^-/.test('' + inputValue)) {
|
|
9
|
+
return XEUtils.toFixed(XEUtils.ceil(inputValue, digitsValue), digitsValue)
|
|
10
|
+
}
|
|
11
|
+
return XEUtils.toFixed(XEUtils.floor(inputValue, digitsValue), digitsValue)
|
|
12
|
+
}
|
|
@@ -459,7 +459,7 @@ export default {
|
|
|
459
459
|
maximize () {
|
|
460
460
|
return this.$nextTick().then(() => {
|
|
461
461
|
if (!this.zoomLocat) {
|
|
462
|
-
const marginSize = this.marginSize
|
|
462
|
+
const marginSize = Math.max(0, this.marginSize)
|
|
463
463
|
const modalBoxElem = this.getBox()
|
|
464
464
|
const { visibleHeight, visibleWidth } = DomTools.getDomNode()
|
|
465
465
|
this.zoomLocat = {
|
|
@@ -45,6 +45,11 @@ export default {
|
|
|
45
45
|
default: null
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
|
+
data () {
|
|
49
|
+
return {
|
|
50
|
+
inpCurrPage: this.currentPage
|
|
51
|
+
}
|
|
52
|
+
},
|
|
48
53
|
computed: {
|
|
49
54
|
isSizes () {
|
|
50
55
|
return this.layouts.some(name => name === 'Sizes')
|
|
@@ -75,6 +80,11 @@ export default {
|
|
|
75
80
|
})
|
|
76
81
|
}
|
|
77
82
|
},
|
|
83
|
+
watch: {
|
|
84
|
+
currentPage (value) {
|
|
85
|
+
this.inpCurrPage = value
|
|
86
|
+
}
|
|
87
|
+
},
|
|
78
88
|
render (h) {
|
|
79
89
|
const { $scopedSlots, $xegrid, vSize, align, className } = this
|
|
80
90
|
const childNodes = []
|
|
@@ -240,13 +250,14 @@ export default {
|
|
|
240
250
|
h('input', {
|
|
241
251
|
class: 'vxe-pager--goto',
|
|
242
252
|
domProps: {
|
|
243
|
-
value: this.
|
|
253
|
+
value: this.inpCurrPage
|
|
244
254
|
},
|
|
245
255
|
attrs: {
|
|
246
256
|
type: 'text',
|
|
247
257
|
autocomplete: 'off'
|
|
248
258
|
},
|
|
249
259
|
on: {
|
|
260
|
+
input: this.jumpInputEvent,
|
|
250
261
|
keydown: this.jumpKeydownEvent,
|
|
251
262
|
blur: this.triggerJumpEvent
|
|
252
263
|
}
|
|
@@ -373,6 +384,9 @@ export default {
|
|
|
373
384
|
this.$emit('page-change', { type: 'size', pageSize, currentPage: Math.min(this.currentPage, this.getPageCount(this.total, pageSize)) })
|
|
374
385
|
}
|
|
375
386
|
},
|
|
387
|
+
jumpInputEvent (evnt) {
|
|
388
|
+
this.inpCurrPage = evnt.target.value
|
|
389
|
+
},
|
|
376
390
|
jumpKeydownEvent (evnt) {
|
|
377
391
|
if (evnt.keyCode === 13) {
|
|
378
392
|
this.triggerJumpEvent(evnt)
|
|
@@ -6,6 +6,7 @@ export default {
|
|
|
6
6
|
name: 'VxePulldown',
|
|
7
7
|
mixins: [vSize],
|
|
8
8
|
props: {
|
|
9
|
+
value: Boolean,
|
|
9
10
|
disabled: Boolean,
|
|
10
11
|
placement: String,
|
|
11
12
|
size: { type: String, default: () => GlobalConfig.size },
|
|
@@ -24,6 +25,15 @@ export default {
|
|
|
24
25
|
isActivated: false
|
|
25
26
|
}
|
|
26
27
|
},
|
|
28
|
+
watch: {
|
|
29
|
+
value (value) {
|
|
30
|
+
if (value) {
|
|
31
|
+
this.showPanel()
|
|
32
|
+
} else {
|
|
33
|
+
this.hidePanel()
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
27
37
|
created () {
|
|
28
38
|
GlobalEvent.on(this, 'mousewheel', this.handleGlobalMousewheelEvent)
|
|
29
39
|
GlobalEvent.on(this, 'mousedown', this.handleGlobalMousedownEvent)
|
|
@@ -140,6 +150,7 @@ export default {
|
|
|
140
150
|
this.animatVisible = true
|
|
141
151
|
setTimeout(() => {
|
|
142
152
|
this.visiblePanel = true
|
|
153
|
+
this.$emit('update:input', true)
|
|
143
154
|
this.updatePlacement()
|
|
144
155
|
setTimeout(() => {
|
|
145
156
|
resolve(this.updatePlacement())
|
|
@@ -156,6 +167,7 @@ export default {
|
|
|
156
167
|
*/
|
|
157
168
|
hidePanel () {
|
|
158
169
|
this.visiblePanel = false
|
|
170
|
+
this.$emit('update:input', false)
|
|
159
171
|
return new Promise(resolve => {
|
|
160
172
|
if (this.animatVisible) {
|
|
161
173
|
this.hidePanelTimeout = setTimeout(() => {
|
|
@@ -455,6 +455,18 @@ export default {
|
|
|
455
455
|
this.$el._onscroll = null
|
|
456
456
|
this.$el.onscroll = null
|
|
457
457
|
},
|
|
458
|
+
destroyed () {
|
|
459
|
+
const { $parent: $xetable, fixedType } = this
|
|
460
|
+
const { elemStore } = $xetable
|
|
461
|
+
const prefix = `${fixedType || 'main'}-body-`
|
|
462
|
+
elemStore[`${prefix}wrapper`] = null
|
|
463
|
+
elemStore[`${prefix}table`] = null
|
|
464
|
+
elemStore[`${prefix}colgroup`] = null
|
|
465
|
+
elemStore[`${prefix}list`] = null
|
|
466
|
+
elemStore[`${prefix}xSpace`] = null
|
|
467
|
+
elemStore[`${prefix}ySpace`] = null
|
|
468
|
+
elemStore[`${prefix}emptyBlock`] = null
|
|
469
|
+
},
|
|
458
470
|
render (h) {
|
|
459
471
|
const { _e, $parent: $xetable, fixedColumn, fixedType } = this
|
|
460
472
|
let { $scopedSlots, tId, tableData, tableColumn, visibleColumn, showOverflow: allColumnOverflow, keyboardConfig, keyboardOpts, mergeList, spanMethod, scrollXLoad, scrollYLoad, isAllOverflow, emptyOpts, mouseConfig, mouseOpts, sYOpts } = $xetable
|
|
@@ -595,8 +607,8 @@ export default {
|
|
|
595
607
|
const rightElem = rightBody ? rightBody.$el : null
|
|
596
608
|
const bodyYElem = elemStore['main-body-ySpace']
|
|
597
609
|
const bodyXElem = elemStore['main-body-xSpace']
|
|
598
|
-
const bodyHeight = bodyYElem ? bodyYElem.clientHeight :
|
|
599
|
-
const bodyWidth = bodyXElem ? bodyXElem.clientWidth :
|
|
610
|
+
const bodyHeight = scrollYLoad && bodyYElem ? bodyYElem.clientHeight : bodyElem.clientHeight
|
|
611
|
+
const bodyWidth = scrollXLoad && bodyXElem ? bodyXElem.clientWidth : bodyElem.clientWidth
|
|
600
612
|
let scrollTop = scrollBodyElem.scrollTop
|
|
601
613
|
const scrollLeft = bodyElem.scrollLeft
|
|
602
614
|
const isRollX = scrollLeft !== lastScrollLeft
|
|
@@ -638,11 +650,22 @@ export default {
|
|
|
638
650
|
if (isRollX && validTip && validTip.visible) {
|
|
639
651
|
validTip.updatePlacement()
|
|
640
652
|
}
|
|
641
|
-
$xetable.emitEvent('scroll', {
|
|
653
|
+
$xetable.emitEvent('scroll', {
|
|
654
|
+
type: renderType,
|
|
655
|
+
fixed: fixedType,
|
|
656
|
+
scrollTop,
|
|
657
|
+
scrollLeft,
|
|
658
|
+
scrollHeight: bodyElem.scrollHeight,
|
|
659
|
+
scrollWidth: bodyElem.scrollWidth,
|
|
660
|
+
bodyHeight,
|
|
661
|
+
bodyWidth,
|
|
662
|
+
isX: isRollX,
|
|
663
|
+
isY: isRollY
|
|
664
|
+
}, evnt)
|
|
642
665
|
},
|
|
643
666
|
handleWheel (evnt, isTopWheel, deltaTop, isRollX, isRollY) {
|
|
644
667
|
const { $parent: $xetable } = this
|
|
645
|
-
const { $refs, elemStore } = $xetable
|
|
668
|
+
const { $refs, elemStore, scrollYLoad, scrollXLoad } = $xetable
|
|
646
669
|
const { tableBody, leftBody, rightBody } = $refs
|
|
647
670
|
const bodyElem = tableBody.$el
|
|
648
671
|
const leftElem = leftBody ? leftBody.$el : null
|
|
@@ -650,8 +673,8 @@ export default {
|
|
|
650
673
|
const remainSize = this.isPrevWheelTop === isTopWheel ? Math.max(0, this.wheelYSize - this.wheelYTotal) : 0
|
|
651
674
|
const bodyYElem = elemStore['main-body-ySpace']
|
|
652
675
|
const bodyXElem = elemStore['main-body-xSpace']
|
|
653
|
-
const bodyHeight = bodyYElem ? bodyYElem.clientHeight :
|
|
654
|
-
const bodyWidth = bodyXElem ? bodyXElem.clientWidth :
|
|
676
|
+
const bodyHeight = scrollYLoad && bodyYElem ? bodyYElem.clientHeight : bodyElem.clientHeight
|
|
677
|
+
const bodyWidth = scrollXLoad && bodyXElem ? bodyXElem.clientWidth : bodyElem.clientWidth
|
|
655
678
|
this.isPrevWheelTop = isTopWheel
|
|
656
679
|
this.wheelYSize = Math.abs(isTopWheel ? deltaTop - remainSize : deltaTop + remainSize)
|
|
657
680
|
this.wheelYInterval = 0
|
|
@@ -679,7 +702,18 @@ export default {
|
|
|
679
702
|
}
|
|
680
703
|
this.wheelYTotal = wheelYTotal
|
|
681
704
|
this.wheelYInterval = wheelYInterval
|
|
682
|
-
$xetable.emitEvent('scroll', {
|
|
705
|
+
$xetable.emitEvent('scroll', {
|
|
706
|
+
type: renderType,
|
|
707
|
+
fixed: fixedType,
|
|
708
|
+
scrollTop: bodyElem.scrollTop,
|
|
709
|
+
scrollLeft: bodyElem.scrollLeft,
|
|
710
|
+
scrollHeight: bodyElem.scrollHeight,
|
|
711
|
+
scrollWidth: bodyElem.scrollWidth,
|
|
712
|
+
bodyHeight,
|
|
713
|
+
bodyWidth,
|
|
714
|
+
isX: isRollX,
|
|
715
|
+
isY: isRollY
|
|
716
|
+
}, evnt)
|
|
683
717
|
}
|
|
684
718
|
}
|
|
685
719
|
handleSmooth()
|
|
@@ -352,25 +352,23 @@ export const Cell = {
|
|
|
352
352
|
*/
|
|
353
353
|
renderCheckboxHeader (h, params) {
|
|
354
354
|
const { $table, column, isHidden } = params
|
|
355
|
-
const { isIndeterminate: isAllCheckboxIndeterminate, isAllCheckboxDisabled } = $table
|
|
355
|
+
const { isAllSelected: isAllCheckboxSelected, isIndeterminate: isAllCheckboxIndeterminate, isAllCheckboxDisabled } = $table
|
|
356
356
|
const { slots } = column
|
|
357
357
|
const headerSlot = slots ? slots.header : null
|
|
358
358
|
const titleSlot = slots ? slots.title : null
|
|
359
359
|
const checkboxOpts = $table.checkboxOpts
|
|
360
360
|
const headerTitle = column.getTitle()
|
|
361
|
-
let isChecked = false
|
|
362
361
|
let on
|
|
363
362
|
if (!isHidden) {
|
|
364
|
-
isChecked = isAllCheckboxDisabled ? false : $table.isAllSelected
|
|
365
363
|
on = {
|
|
366
364
|
click (evnt) {
|
|
367
365
|
if (!isAllCheckboxDisabled) {
|
|
368
|
-
$table.triggerCheckAllEvent(evnt, !
|
|
366
|
+
$table.triggerCheckAllEvent(evnt, !isAllCheckboxSelected)
|
|
369
367
|
}
|
|
370
368
|
}
|
|
371
369
|
}
|
|
372
370
|
}
|
|
373
|
-
const checkboxParams = { ...params, checked:
|
|
371
|
+
const checkboxParams = { ...params, checked: isAllCheckboxSelected, disabled: isAllCheckboxDisabled, indeterminate: isAllCheckboxIndeterminate }
|
|
374
372
|
if (headerSlot) {
|
|
375
373
|
return renderTitleContent(h, checkboxParams, $table.callSlot(headerSlot, checkboxParams, h))
|
|
376
374
|
}
|
|
@@ -384,7 +382,7 @@ export const Cell = {
|
|
|
384
382
|
return renderTitleContent(h, checkboxParams, [
|
|
385
383
|
h('span', {
|
|
386
384
|
class: ['vxe-cell--checkbox', {
|
|
387
|
-
'is--checked':
|
|
385
|
+
'is--checked': isAllCheckboxSelected,
|
|
388
386
|
'is--disabled': isAllCheckboxDisabled,
|
|
389
387
|
'is--indeterminate': isAllCheckboxIndeterminate
|
|
390
388
|
}],
|
|
@@ -294,11 +294,23 @@ const Methods = {
|
|
|
294
294
|
})
|
|
295
295
|
},
|
|
296
296
|
/**
|
|
297
|
-
*
|
|
297
|
+
* 手动处理数据,用于手动排序与筛选
|
|
298
298
|
* 对于手动更改了排序、筛选...等条件后需要重新处理数据时可能会用到
|
|
299
299
|
*/
|
|
300
300
|
updateData () {
|
|
301
|
-
|
|
301
|
+
const { scrollXLoad, scrollYLoad } = this
|
|
302
|
+
return this.handleTableData(true).then(() => {
|
|
303
|
+
this.updateFooter()
|
|
304
|
+
if (scrollXLoad || scrollYLoad) {
|
|
305
|
+
if (scrollXLoad) {
|
|
306
|
+
this.updateScrollXSpace()
|
|
307
|
+
}
|
|
308
|
+
if (scrollYLoad) {
|
|
309
|
+
this.updateScrollYSpace()
|
|
310
|
+
}
|
|
311
|
+
return this.refreshScroll()
|
|
312
|
+
}
|
|
313
|
+
}).then(() => this.recalculate())
|
|
302
314
|
},
|
|
303
315
|
handleTableData (force) {
|
|
304
316
|
const { scrollYLoad, scrollYStore, fullDataRowIdData, afterFullData } = this
|
|
@@ -1139,7 +1151,7 @@ const Methods = {
|
|
|
1139
1151
|
const filterColumns = []
|
|
1140
1152
|
const orderColumns = []
|
|
1141
1153
|
tableFullColumn.forEach(column => {
|
|
1142
|
-
const { sortable, order, filters } = column
|
|
1154
|
+
const { property, sortable, order, filters } = column
|
|
1143
1155
|
if (!allRemoteFilter && filters && filters.length) {
|
|
1144
1156
|
const valueList = []
|
|
1145
1157
|
const itemList = []
|
|
@@ -1154,7 +1166,7 @@ const Methods = {
|
|
|
1154
1166
|
}
|
|
1155
1167
|
}
|
|
1156
1168
|
if (!allRemoteSort && sortable && order) {
|
|
1157
|
-
orderColumns.push({ column,
|
|
1169
|
+
orderColumns.push({ column, field: column.property, property, order })
|
|
1158
1170
|
}
|
|
1159
1171
|
})
|
|
1160
1172
|
if (filterColumns.length) {
|
|
@@ -2462,7 +2474,7 @@ const Methods = {
|
|
|
2462
2474
|
// }
|
|
2463
2475
|
// 如果是按下非功能键之外允许直接编辑
|
|
2464
2476
|
if (selected.column && selected.row && isEnableConf(selected.column.editRender)) {
|
|
2465
|
-
if (!editOpts.activeMethod || editOpts.activeMethod(selected.args)) {
|
|
2477
|
+
if (!editOpts.activeMethod || editOpts.activeMethod({ ...selected.args, $table: this })) {
|
|
2466
2478
|
if (editMethod) {
|
|
2467
2479
|
editMethod({
|
|
2468
2480
|
row: selected.row,
|
|
@@ -2964,14 +2976,28 @@ const Methods = {
|
|
|
2964
2976
|
const { afterFullData, selection, treeIndeterminates, checkboxOpts, treeConfig } = this
|
|
2965
2977
|
const { checkField, halfField, checkStrictly, checkMethod } = checkboxOpts
|
|
2966
2978
|
if (!checkStrictly) {
|
|
2979
|
+
const disableRows = []
|
|
2980
|
+
const checkRows = []
|
|
2981
|
+
let isAllResolve = false
|
|
2967
2982
|
let isAllSelected = false
|
|
2968
2983
|
let isIndeterminate = false
|
|
2969
2984
|
if (checkField) {
|
|
2970
|
-
|
|
2985
|
+
isAllResolve = afterFullData.every(
|
|
2971
2986
|
checkMethod
|
|
2972
|
-
? (row) =>
|
|
2987
|
+
? (row) => {
|
|
2988
|
+
if (!checkMethod({ row })) {
|
|
2989
|
+
disableRows.push(row)
|
|
2990
|
+
return true
|
|
2991
|
+
}
|
|
2992
|
+
if (XEUtils.get(row, checkField)) {
|
|
2993
|
+
checkRows.push(row)
|
|
2994
|
+
return true
|
|
2995
|
+
}
|
|
2996
|
+
return false
|
|
2997
|
+
}
|
|
2973
2998
|
: row => XEUtils.get(row, checkField)
|
|
2974
2999
|
)
|
|
3000
|
+
isAllSelected = isAllResolve && afterFullData.length !== disableRows.length
|
|
2975
3001
|
if (treeConfig) {
|
|
2976
3002
|
if (halfField) {
|
|
2977
3003
|
isIndeterminate = !isAllSelected && afterFullData.some(row => XEUtils.get(row, checkField) || XEUtils.get(row, halfField) || treeIndeterminates.indexOf(row) > -1)
|
|
@@ -2986,11 +3012,22 @@ const Methods = {
|
|
|
2986
3012
|
}
|
|
2987
3013
|
}
|
|
2988
3014
|
} else {
|
|
2989
|
-
|
|
3015
|
+
isAllResolve = afterFullData.every(
|
|
2990
3016
|
checkMethod
|
|
2991
|
-
? (row) =>
|
|
3017
|
+
? (row) => {
|
|
3018
|
+
if (!checkMethod({ row })) {
|
|
3019
|
+
disableRows.push(row)
|
|
3020
|
+
return true
|
|
3021
|
+
}
|
|
3022
|
+
if (selection.indexOf(row) > -1) {
|
|
3023
|
+
checkRows.push(row)
|
|
3024
|
+
return true
|
|
3025
|
+
}
|
|
3026
|
+
return false
|
|
3027
|
+
}
|
|
2992
3028
|
: row => selection.indexOf(row) > -1
|
|
2993
3029
|
)
|
|
3030
|
+
isAllSelected = isAllResolve && afterFullData.length !== disableRows.length
|
|
2994
3031
|
if (treeConfig) {
|
|
2995
3032
|
isIndeterminate = !isAllSelected && afterFullData.some(row => treeIndeterminates.indexOf(row) > -1 || selection.indexOf(row) > -1)
|
|
2996
3033
|
} else {
|
|
@@ -3586,9 +3623,9 @@ const Methods = {
|
|
|
3586
3623
|
getSortColumns () {
|
|
3587
3624
|
const sortList = []
|
|
3588
3625
|
this.tableFullColumn.forEach((column) => {
|
|
3589
|
-
const { order } = column
|
|
3626
|
+
const { property, order } = column
|
|
3590
3627
|
if ((column.sortable || column.remoteSort) && order) {
|
|
3591
|
-
sortList.push({ column,
|
|
3628
|
+
sortList.push({ column, field: column.property, property, order })
|
|
3592
3629
|
}
|
|
3593
3630
|
})
|
|
3594
3631
|
return sortList
|
|
@@ -4585,7 +4622,7 @@ const Methods = {
|
|
|
4585
4622
|
}
|
|
4586
4623
|
|
|
4587
4624
|
// Module methods
|
|
4588
|
-
const funcs = 'setFilter,openFilter,clearFilter,getCheckedFilters,closeMenu,setActiveCellArea,getActiveCellArea,getCellAreas,clearCellAreas,copyCellArea,cutCellArea,pasteCellArea,getCopyCellArea,clearCopyCellArea,setCellAreas,openFind,openReplace,getSelectedCell,clearSelected,insert,insertAt,remove,removeCheckboxRow,removeRadioRow,removeCurrentRow,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,clearActived,getActiveRecord,isActiveByRow,setActiveRow,setActiveCell,setSelectCell,clearValidate,fullValidate,validate,openExport,openPrint,exportData,openImport,importData,saveFile,readFile,importByFile,print'.split(',')
|
|
4625
|
+
const funcs = 'setFilter,openFilter,clearFilter,getCheckedFilters,closeMenu,setActiveCellArea,getActiveCellArea,getCellAreas,clearCellAreas,copyCellArea,cutCellArea,pasteCellArea,getCopyCellArea,clearCopyCellArea,setCellAreas,openFind,openReplace,closeFNR,getSelectedCell,clearSelected,insert,insertAt,remove,removeCheckboxRow,removeRadioRow,removeCurrentRow,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,clearActived,getActiveRecord,isActiveByRow,setActiveRow,setActiveCell,setSelectCell,clearValidate,fullValidate,validate,openExport,openPrint,exportData,openImport,importData,saveFile,readFile,importByFile,print'.split(',')
|
|
4589
4626
|
|
|
4590
4627
|
funcs.forEach(name => {
|
|
4591
4628
|
Methods[name] = function (...args) {
|
|
@@ -127,7 +127,16 @@ export default {
|
|
|
127
127
|
colVailds.push(
|
|
128
128
|
this.validCellRules('all', row, column)
|
|
129
129
|
.catch(({ rule, rules }) => {
|
|
130
|
-
const rest = {
|
|
130
|
+
const rest = {
|
|
131
|
+
rule,
|
|
132
|
+
rules,
|
|
133
|
+
rowIndex: this.getRowIndex(row),
|
|
134
|
+
row,
|
|
135
|
+
columnIndex: this.getColumnIndex(column),
|
|
136
|
+
column,
|
|
137
|
+
field: column.property,
|
|
138
|
+
$table: this
|
|
139
|
+
}
|
|
131
140
|
if (!validRest[column.property]) {
|
|
132
141
|
validRest[column.property] = []
|
|
133
142
|
}
|
|
@@ -250,6 +259,7 @@ export default {
|
|
|
250
259
|
rowIndex: this.getRowIndex(row),
|
|
251
260
|
column,
|
|
252
261
|
columnIndex: this.getColumnIndex(column),
|
|
262
|
+
field: column.property,
|
|
253
263
|
$table: this
|
|
254
264
|
})
|
|
255
265
|
if (customValid) {
|
package/styles/base/checked.scss
CHANGED
package/styles/button.scss
CHANGED
|
@@ -124,7 +124,7 @@ $btnThemeList: (
|
|
|
124
124
|
line-height: 1;
|
|
125
125
|
border: 1px solid $vxe-input-border-color;
|
|
126
126
|
&.is--round {
|
|
127
|
-
border-radius: $vxe-button-
|
|
127
|
+
border-radius: $vxe-button-round-border-radius-default;
|
|
128
128
|
}
|
|
129
129
|
&:not(.is--round) {
|
|
130
130
|
border-radius: $vxe-border-radius;
|
|
@@ -223,7 +223,7 @@ $btnThemeList: (
|
|
|
223
223
|
min-width: $vxe-button-height-medium;
|
|
224
224
|
}
|
|
225
225
|
&.is--round {
|
|
226
|
-
border-radius: $vxe-button-
|
|
226
|
+
border-radius: $vxe-button-round-border-radius-medium;
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
229
|
.vxe-button--loading-icon,
|
|
@@ -239,7 +239,7 @@ $btnThemeList: (
|
|
|
239
239
|
min-width: $vxe-button-height-small;
|
|
240
240
|
}
|
|
241
241
|
&.is--round {
|
|
242
|
-
border-radius: $vxe-button-
|
|
242
|
+
border-radius: $vxe-button-round-border-radius-small;
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
245
|
.vxe-button--loading-icon,
|
|
@@ -255,7 +255,7 @@ $btnThemeList: (
|
|
|
255
255
|
min-width: $vxe-button-height-mini;
|
|
256
256
|
}
|
|
257
257
|
&.is--round {
|
|
258
|
-
border-radius: $vxe-button-
|
|
258
|
+
border-radius: $vxe-button-round-border-radius-mini;
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
261
|
.vxe-button--loading-icon,
|
package/styles/modal.scss
CHANGED
|
@@ -294,7 +294,8 @@
|
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
296
|
.vxe-modal--resize {
|
|
297
|
-
$SpaceSize:
|
|
297
|
+
$SpaceSize: 8px;
|
|
298
|
+
$SpaceWidth: 5px;
|
|
298
299
|
.wl-resize,
|
|
299
300
|
.wr-resize,
|
|
300
301
|
.swst-resize,
|
|
@@ -308,32 +309,32 @@
|
|
|
308
309
|
}
|
|
309
310
|
.wl-resize,
|
|
310
311
|
.wr-resize {
|
|
311
|
-
width:
|
|
312
|
+
width: $SpaceSize;
|
|
312
313
|
height: 100%;
|
|
313
314
|
top: 0;
|
|
314
315
|
cursor: w-resize;
|
|
315
316
|
}
|
|
316
317
|
.wl-resize {
|
|
317
|
-
left:
|
|
318
|
+
left: -$SpaceWidth;
|
|
318
319
|
}
|
|
319
320
|
.wr-resize {
|
|
320
|
-
right:
|
|
321
|
+
right: -$SpaceWidth;
|
|
321
322
|
}
|
|
322
323
|
.swst-resize,
|
|
323
324
|
.sest-resize,
|
|
324
325
|
.swlb-resize,
|
|
325
326
|
.selb-resize {
|
|
326
|
-
width:
|
|
327
|
-
height:
|
|
327
|
+
width: $SpaceSize + 2;
|
|
328
|
+
height: $SpaceSize + 2;
|
|
328
329
|
z-index: 101;
|
|
329
330
|
}
|
|
330
331
|
.swst-resize,
|
|
331
332
|
.sest-resize {
|
|
332
|
-
top:
|
|
333
|
+
top: -$SpaceSize;
|
|
333
334
|
}
|
|
334
335
|
.swlb-resize,
|
|
335
336
|
.selb-resize {
|
|
336
|
-
bottom:
|
|
337
|
+
bottom: -$SpaceSize;
|
|
337
338
|
}
|
|
338
339
|
.sest-resize,
|
|
339
340
|
.swlb-resize {
|
|
@@ -345,24 +346,24 @@
|
|
|
345
346
|
}
|
|
346
347
|
.swst-resize,
|
|
347
348
|
.swlb-resize {
|
|
348
|
-
left:
|
|
349
|
+
left: -$SpaceSize;
|
|
349
350
|
}
|
|
350
351
|
.sest-resize,
|
|
351
352
|
.selb-resize {
|
|
352
|
-
right:
|
|
353
|
+
right: -$SpaceSize;
|
|
353
354
|
}
|
|
354
355
|
.st-resize,
|
|
355
356
|
.sb-resize {
|
|
356
357
|
width: 100%;
|
|
357
|
-
height:
|
|
358
|
+
height: $SpaceSize;
|
|
358
359
|
left: 0;
|
|
359
360
|
cursor: s-resize;
|
|
360
361
|
}
|
|
361
362
|
.st-resize {
|
|
362
|
-
top:
|
|
363
|
+
top: -$SpaceWidth;
|
|
363
364
|
}
|
|
364
365
|
.sb-resize {
|
|
365
|
-
bottom:
|
|
366
|
+
bottom: -$SpaceWidth;
|
|
366
367
|
}
|
|
367
368
|
}
|
|
368
369
|
}
|
package/styles/table.scss
CHANGED
|
@@ -474,7 +474,7 @@
|
|
|
474
474
|
line-height: $vxe-table-row-line-height;
|
|
475
475
|
text-align: left;
|
|
476
476
|
&:not(.col--ellipsis) {
|
|
477
|
-
padding:
|
|
477
|
+
padding: $vxe-table-column-padding-default;
|
|
478
478
|
}
|
|
479
479
|
&.col--current {
|
|
480
480
|
background-color: $vxe-table-column-current-background-color;
|
|
@@ -612,7 +612,7 @@
|
|
|
612
612
|
.vxe-body--column,
|
|
613
613
|
.vxe-footer--column {
|
|
614
614
|
&:not(.col--ellipsis) {
|
|
615
|
-
padding:
|
|
615
|
+
padding: $vxe-table-column-padding-medium;
|
|
616
616
|
}
|
|
617
617
|
}
|
|
618
618
|
.vxe-cell {
|
|
@@ -638,7 +638,7 @@
|
|
|
638
638
|
.vxe-body--column,
|
|
639
639
|
.vxe-footer--column {
|
|
640
640
|
&:not(.col--ellipsis) {
|
|
641
|
-
padding:
|
|
641
|
+
padding: $vxe-table-column-padding-small;
|
|
642
642
|
}
|
|
643
643
|
}
|
|
644
644
|
.vxe-cell {
|
|
@@ -664,7 +664,7 @@
|
|
|
664
664
|
.vxe-body--column,
|
|
665
665
|
.vxe-footer--column {
|
|
666
666
|
&:not(.col--ellipsis) {
|
|
667
|
-
padding:
|
|
667
|
+
padding: $vxe-table-column-padding-mini;
|
|
668
668
|
}
|
|
669
669
|
}
|
|
670
670
|
.vxe-cell {
|
package/styles/variable.scss
CHANGED
|
@@ -62,6 +62,10 @@ $vxe-table-row-hover-checkbox-checked-background-color: #ffebbc !default;
|
|
|
62
62
|
$vxe-table-row-current-background-color: #e6f7ff !default;
|
|
63
63
|
$vxe-table-row-hover-current-background-color: #d7effb !default;
|
|
64
64
|
|
|
65
|
+
$vxe-table-column-padding-default: 13px 0 !default;
|
|
66
|
+
$vxe-table-column-padding-medium: 11px 0 !default;
|
|
67
|
+
$vxe-table-column-padding-small: 9px 0 !default;
|
|
68
|
+
$vxe-table-column-padding-mini: 7px 0 !default;
|
|
65
69
|
$vxe-table-column-hover-background-color: #d7effb !default;
|
|
66
70
|
$vxe-table-column-current-background-color: #e6f7ff !default;
|
|
67
71
|
$vxe-table-column-icon-border-color: #c0c4cc !default;
|
|
@@ -175,6 +179,10 @@ $vxe-button-height-default: 34px !default;
|
|
|
175
179
|
$vxe-button-height-medium: 32px !default;
|
|
176
180
|
$vxe-button-height-small: 30px !default;
|
|
177
181
|
$vxe-button-height-mini: 28px !default;
|
|
182
|
+
$vxe-button-round-border-radius-default: 17px !default;
|
|
183
|
+
$vxe-button-round-border-radius-medium: 16px !default;
|
|
184
|
+
$vxe-button-round-border-radius-small: 15px !default;
|
|
185
|
+
$vxe-button-round-border-radius-mini: 14px !default;
|
|
178
186
|
|
|
179
187
|
/*input*/
|
|
180
188
|
$vxe-input-background-color: #fff !default;
|