vxe-table 4.17.0-beta.7 → 4.17.0-beta.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/es/style.css +1 -1
- package/es/table/module/custom/panel.js +34 -32
- package/es/table/module/export/export-panel.js +22 -22
- package/es/table/module/export/import-panel.js +8 -8
- package/es/table/module/keyboard/hook.js +4 -26
- package/es/table/src/emits.js +2 -0
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/ui/src/utils.js +6 -5
- package/lib/index.umd.js +70 -88
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/custom/panel.js +26 -24
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/export/export-panel.js +19 -18
- package/lib/table/module/export/export-panel.min.js +1 -1
- package/lib/table/module/export/import-panel.js +8 -7
- package/lib/table/module/export/import-panel.min.js +1 -1
- package/lib/table/module/keyboard/hook.js +3 -28
- package/lib/table/module/keyboard/hook.min.js +1 -1
- package/lib/table/src/emits.js +1 -1
- package/lib/table/src/emits.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/lib/ui/src/utils.js +8 -5
- package/lib/ui/src/utils.min.js +1 -1
- package/package.json +1 -1
- package/packages/table/module/custom/panel.ts +34 -32
- package/packages/table/module/export/export-panel.ts +22 -22
- package/packages/table/module/export/import-panel.ts +8 -8
- package/packages/table/module/keyboard/hook.ts +4 -28
- package/packages/table/src/emits.ts +2 -0
- package/packages/ui/src/utils.ts +7 -5
- /package/es/{iconfont.1760436686233.ttf → iconfont.1760602279303.ttf} +0 -0
- /package/es/{iconfont.1760436686233.woff → iconfont.1760602279303.woff} +0 -0
- /package/es/{iconfont.1760436686233.woff2 → iconfont.1760602279303.woff2} +0 -0
- /package/lib/{iconfont.1760436686233.ttf → iconfont.1760602279303.ttf} +0 -0
- /package/lib/{iconfont.1760436686233.woff → iconfont.1760602279303.woff} +0 -0
- /package/lib/{iconfont.1760436686233.woff2 → iconfont.1760602279303.woff2} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h,
|
|
1
|
+
import { h, ref, Ref, computed, reactive, inject, nextTick } from 'vue'
|
|
2
2
|
import { defineVxeComponent } from '../../../ui/src/comp'
|
|
3
3
|
import { VxeUI } from '../../../ui'
|
|
4
4
|
import XEUtils from 'xe-utils'
|
|
@@ -7,7 +7,7 @@ import { errLog } from '../../../ui/src/log'
|
|
|
7
7
|
|
|
8
8
|
import type { VxeTablePrivateMethods, VxeTableConstructor, VxeTableMethods } from '../../../../types'
|
|
9
9
|
|
|
10
|
-
const { getI18n, getIcon } = VxeUI
|
|
10
|
+
const { getI18n, getIcon, renderEmptyElement } = VxeUI
|
|
11
11
|
|
|
12
12
|
export default defineVxeComponent({
|
|
13
13
|
name: 'VxeTableExportPanel',
|
|
@@ -260,7 +260,7 @@ export default defineVxeComponent({
|
|
|
260
260
|
? h('div', {
|
|
261
261
|
class: 'vxe-table-export--panel-top'
|
|
262
262
|
}, $xeTable.callSlot(topSlot, params))
|
|
263
|
-
:
|
|
263
|
+
: renderEmptyElement($xeTable),
|
|
264
264
|
h('div', {
|
|
265
265
|
class: 'vxe-table-export--panel-body'
|
|
266
266
|
}, defaultSlot
|
|
@@ -275,7 +275,7 @@ export default defineVxeComponent({
|
|
|
275
275
|
h('tbody', [
|
|
276
276
|
[
|
|
277
277
|
isPrint
|
|
278
|
-
?
|
|
278
|
+
? renderEmptyElement($xeTable)
|
|
279
279
|
: h('tr', [
|
|
280
280
|
h('td', getI18n('vxe.export.expName')),
|
|
281
281
|
h('td', [
|
|
@@ -290,11 +290,11 @@ export default defineVxeComponent({
|
|
|
290
290
|
defaultOptions.filename = value
|
|
291
291
|
}
|
|
292
292
|
})
|
|
293
|
-
:
|
|
293
|
+
: renderEmptyElement($xeTable)
|
|
294
294
|
])
|
|
295
295
|
]),
|
|
296
296
|
isPrint
|
|
297
|
-
?
|
|
297
|
+
? renderEmptyElement($xeTable)
|
|
298
298
|
: h('tr', [
|
|
299
299
|
h('td', getI18n('vxe.export.expType')),
|
|
300
300
|
h('td', [
|
|
@@ -306,7 +306,7 @@ export default defineVxeComponent({
|
|
|
306
306
|
defaultOptions.type = value
|
|
307
307
|
}
|
|
308
308
|
})
|
|
309
|
-
:
|
|
309
|
+
: renderEmptyElement($xeTable)
|
|
310
310
|
])
|
|
311
311
|
]),
|
|
312
312
|
isPrint || showSheet
|
|
@@ -324,10 +324,10 @@ export default defineVxeComponent({
|
|
|
324
324
|
defaultOptions.sheetName = value
|
|
325
325
|
}
|
|
326
326
|
})
|
|
327
|
-
:
|
|
327
|
+
: renderEmptyElement($xeTable)
|
|
328
328
|
])
|
|
329
329
|
])
|
|
330
|
-
:
|
|
330
|
+
: renderEmptyElement($xeTable),
|
|
331
331
|
h('tr', [
|
|
332
332
|
h('td', getI18n('vxe.export.expMode')),
|
|
333
333
|
h('td', [
|
|
@@ -344,7 +344,7 @@ export default defineVxeComponent({
|
|
|
344
344
|
defaultOptions.mode = value
|
|
345
345
|
}
|
|
346
346
|
})
|
|
347
|
-
:
|
|
347
|
+
: renderEmptyElement($xeTable)
|
|
348
348
|
])
|
|
349
349
|
]),
|
|
350
350
|
h('tr', [
|
|
@@ -400,7 +400,7 @@ export default defineVxeComponent({
|
|
|
400
400
|
defaultOptions.isHeader = value
|
|
401
401
|
}
|
|
402
402
|
})
|
|
403
|
-
:
|
|
403
|
+
: renderEmptyElement($xeTable),
|
|
404
404
|
VxeUICheckboxComponent
|
|
405
405
|
? h(VxeUICheckboxComponent, {
|
|
406
406
|
modelValue: isHeader ? defaultOptions.isTitle : false,
|
|
@@ -411,7 +411,7 @@ export default defineVxeComponent({
|
|
|
411
411
|
defaultOptions.isTitle = value
|
|
412
412
|
}
|
|
413
413
|
})
|
|
414
|
-
:
|
|
414
|
+
: renderEmptyElement($xeTable),
|
|
415
415
|
VxeUICheckboxComponent
|
|
416
416
|
? h(VxeUICheckboxComponent, {
|
|
417
417
|
modelValue: isHeader && hasColgroup && supportMerge ? defaultOptions.isColgroup : false,
|
|
@@ -422,7 +422,7 @@ export default defineVxeComponent({
|
|
|
422
422
|
defaultOptions.isColgroup = value
|
|
423
423
|
}
|
|
424
424
|
})
|
|
425
|
-
:
|
|
425
|
+
: renderEmptyElement($xeTable)
|
|
426
426
|
]),
|
|
427
427
|
h('div', {
|
|
428
428
|
class: 'vxe-table-export--panel-option-row'
|
|
@@ -437,7 +437,7 @@ export default defineVxeComponent({
|
|
|
437
437
|
defaultOptions.original = value
|
|
438
438
|
}
|
|
439
439
|
})
|
|
440
|
-
:
|
|
440
|
+
: renderEmptyElement($xeTable),
|
|
441
441
|
VxeUICheckboxComponent
|
|
442
442
|
? h(VxeUICheckboxComponent, {
|
|
443
443
|
modelValue: hasMerge && supportMerge && checkedAll ? defaultOptions.isMerge : false,
|
|
@@ -448,9 +448,9 @@ export default defineVxeComponent({
|
|
|
448
448
|
defaultOptions.isMerge = value
|
|
449
449
|
}
|
|
450
450
|
})
|
|
451
|
-
:
|
|
451
|
+
: renderEmptyElement($xeTable),
|
|
452
452
|
isPrint || !VxeUICheckboxComponent
|
|
453
|
-
?
|
|
453
|
+
? renderEmptyElement($xeTable)
|
|
454
454
|
: h(VxeUICheckboxComponent, {
|
|
455
455
|
modelValue: supportStyle ? defaultOptions.useStyle : false,
|
|
456
456
|
disabled: !supportStyle,
|
|
@@ -470,7 +470,7 @@ export default defineVxeComponent({
|
|
|
470
470
|
defaultOptions.isAllExpand = value
|
|
471
471
|
}
|
|
472
472
|
})
|
|
473
|
-
:
|
|
473
|
+
: renderEmptyElement($xeTable)
|
|
474
474
|
]),
|
|
475
475
|
h('div', {
|
|
476
476
|
class: 'vxe-table-export--panel-option-row'
|
|
@@ -485,7 +485,7 @@ export default defineVxeComponent({
|
|
|
485
485
|
defaultOptions.isFooter = value
|
|
486
486
|
}
|
|
487
487
|
})
|
|
488
|
-
:
|
|
488
|
+
: renderEmptyElement($xeTable)
|
|
489
489
|
])
|
|
490
490
|
])
|
|
491
491
|
])
|
|
@@ -497,7 +497,7 @@ export default defineVxeComponent({
|
|
|
497
497
|
? h('div', {
|
|
498
498
|
class: 'vxe-table-export--panel-bottom'
|
|
499
499
|
}, $xeTable.callSlot(bottomSlot, params))
|
|
500
|
-
:
|
|
500
|
+
: renderEmptyElement($xeTable)
|
|
501
501
|
])
|
|
502
502
|
},
|
|
503
503
|
footer () {
|
|
@@ -522,7 +522,7 @@ export default defineVxeComponent({
|
|
|
522
522
|
content: getI18n('vxe.export.expCancel'),
|
|
523
523
|
onClick: cancelEvent
|
|
524
524
|
})
|
|
525
|
-
:
|
|
525
|
+
: renderEmptyElement($xeTable),
|
|
526
526
|
VxeUIButtonComponent
|
|
527
527
|
? h(VxeUIButtonComponent, {
|
|
528
528
|
ref: xButtonConfirm,
|
|
@@ -530,12 +530,12 @@ export default defineVxeComponent({
|
|
|
530
530
|
content: getI18n(isPrint ? 'vxe.export.expPrint' : 'vxe.export.expConfirm'),
|
|
531
531
|
onClick: confirmEvent
|
|
532
532
|
})
|
|
533
|
-
:
|
|
533
|
+
: renderEmptyElement($xeTable)
|
|
534
534
|
])
|
|
535
535
|
])
|
|
536
536
|
}
|
|
537
537
|
})
|
|
538
|
-
:
|
|
538
|
+
: renderEmptyElement($xeTable)
|
|
539
539
|
}
|
|
540
540
|
|
|
541
541
|
nextTick(() => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h, ref, Ref, computed, inject, reactive, nextTick
|
|
1
|
+
import { h, ref, Ref, computed, inject, reactive, nextTick } from 'vue'
|
|
2
2
|
import { defineVxeComponent } from '../../../ui/src/comp'
|
|
3
3
|
import { VxeUI } from '../../../ui'
|
|
4
4
|
import XEUtils from 'xe-utils'
|
|
@@ -7,7 +7,7 @@ import { errLog } from '../../../ui/src/log'
|
|
|
7
7
|
|
|
8
8
|
import type { VxeTablePrivateMethods, VxeTableConstructor, VxeTableMethods } from '../../../../types'
|
|
9
9
|
|
|
10
|
-
const { getI18n, getIcon } = VxeUI
|
|
10
|
+
const { getI18n, getIcon, renderEmptyElement } = VxeUI
|
|
11
11
|
|
|
12
12
|
export default defineVxeComponent({
|
|
13
13
|
name: 'VxeTableImportPanel',
|
|
@@ -142,7 +142,7 @@ export default defineVxeComponent({
|
|
|
142
142
|
? h('div', {
|
|
143
143
|
class: 'vxe-table-export--panel-top'
|
|
144
144
|
}, $xeTable.callSlot(topSlot, params))
|
|
145
|
-
:
|
|
145
|
+
: renderEmptyElement($xeTable),
|
|
146
146
|
h('div', {
|
|
147
147
|
class: 'vxe-table-export--panel-body'
|
|
148
148
|
}, defaultSlot
|
|
@@ -191,7 +191,7 @@ export default defineVxeComponent({
|
|
|
191
191
|
defaultOptions.mode = value
|
|
192
192
|
}
|
|
193
193
|
})
|
|
194
|
-
:
|
|
194
|
+
: renderEmptyElement($xeTable)
|
|
195
195
|
])
|
|
196
196
|
])
|
|
197
197
|
])
|
|
@@ -202,7 +202,7 @@ export default defineVxeComponent({
|
|
|
202
202
|
? h('div', {
|
|
203
203
|
class: 'vxe-table-export--panel-bottom'
|
|
204
204
|
}, $xeTable.callSlot(bottomSlot, params))
|
|
205
|
-
:
|
|
205
|
+
: renderEmptyElement($xeTable)
|
|
206
206
|
])
|
|
207
207
|
},
|
|
208
208
|
footer () {
|
|
@@ -226,7 +226,7 @@ export default defineVxeComponent({
|
|
|
226
226
|
content: getI18n('vxe.import.impCancel'),
|
|
227
227
|
onClick: cancelEvent
|
|
228
228
|
})
|
|
229
|
-
:
|
|
229
|
+
: renderEmptyElement($xeTable),
|
|
230
230
|
VxeUIButtonComponent
|
|
231
231
|
? h(VxeUIButtonComponent, {
|
|
232
232
|
status: 'primary',
|
|
@@ -234,13 +234,13 @@ export default defineVxeComponent({
|
|
|
234
234
|
content: getI18n('vxe.import.impConfirm'),
|
|
235
235
|
onClick: importEvent
|
|
236
236
|
})
|
|
237
|
-
:
|
|
237
|
+
: renderEmptyElement($xeTable)
|
|
238
238
|
])
|
|
239
239
|
]
|
|
240
240
|
)
|
|
241
241
|
}
|
|
242
242
|
})
|
|
243
|
-
:
|
|
243
|
+
: renderEmptyElement($xeTable)
|
|
244
244
|
}
|
|
245
245
|
|
|
246
246
|
nextTick(() => {
|
|
@@ -1,36 +1,12 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils'
|
|
2
2
|
import { VxeUI } from '../../../ui'
|
|
3
3
|
import { getRefElem } from '../../src/util'
|
|
4
|
-
import {
|
|
4
|
+
import { getAbsolutePos, addClass, removeClass, hasControlKey } from '../../../ui/src/dom'
|
|
5
5
|
|
|
6
6
|
import type { TableKeyboardPrivateMethods, VxeTableDefines } from '../../../../types'
|
|
7
7
|
|
|
8
8
|
const { hooks } = VxeUI
|
|
9
9
|
|
|
10
|
-
const browseObj = XEUtils.browse()
|
|
11
|
-
|
|
12
|
-
function getTargetOffset (target: any, container: any) {
|
|
13
|
-
let offsetTop = 0
|
|
14
|
-
let offsetLeft = 0
|
|
15
|
-
const triggerCheckboxLabel = !browseObj.firefox && hasClass(target, 'vxe-checkbox--label')
|
|
16
|
-
if (triggerCheckboxLabel) {
|
|
17
|
-
const checkboxLabelStyle = getComputedStyle(target)
|
|
18
|
-
offsetTop -= XEUtils.toNumber(checkboxLabelStyle.paddingTop)
|
|
19
|
-
offsetLeft -= XEUtils.toNumber(checkboxLabelStyle.paddingLeft)
|
|
20
|
-
}
|
|
21
|
-
while (target && target !== container) {
|
|
22
|
-
offsetTop += target.offsetTop
|
|
23
|
-
offsetLeft += target.offsetLeft
|
|
24
|
-
target = target.offsetParent
|
|
25
|
-
if (triggerCheckboxLabel) {
|
|
26
|
-
const checkboxStyle = getComputedStyle(target)
|
|
27
|
-
offsetTop -= XEUtils.toNumber(checkboxStyle.paddingTop)
|
|
28
|
-
offsetLeft -= XEUtils.toNumber(checkboxStyle.paddingLeft)
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return { offsetTop, offsetLeft }
|
|
32
|
-
}
|
|
33
|
-
|
|
34
10
|
hooks.add('tableKeyboardModule', {
|
|
35
11
|
setupTable ($xeTable) {
|
|
36
12
|
const { props, reactData, internalData } = $xeTable
|
|
@@ -119,6 +95,7 @@ hooks.add('tableKeyboardModule', {
|
|
|
119
95
|
if (!bodyWrapperElem) {
|
|
120
96
|
return
|
|
121
97
|
}
|
|
98
|
+
const bodyRect = bodyWrapperElem.getBoundingClientRect()
|
|
122
99
|
const el = refElem.value
|
|
123
100
|
const disX = evnt.clientX
|
|
124
101
|
const disY = evnt.clientY
|
|
@@ -127,9 +104,8 @@ hooks.add('tableKeyboardModule', {
|
|
|
127
104
|
const selectRecords = $xeTable.getCheckboxRecords()
|
|
128
105
|
let lastRangeRows: any[] = []
|
|
129
106
|
const marginSize = 1
|
|
130
|
-
const
|
|
131
|
-
const
|
|
132
|
-
const startLeft = offsetRest.offsetLeft + evnt.offsetX
|
|
107
|
+
const startTop = evnt.clientY - bodyRect.y + bodyWrapperElem.scrollTop
|
|
108
|
+
const startLeft = evnt.clientX - bodyRect.x + bodyWrapperElem.scrollLeft
|
|
133
109
|
const startScrollTop = bodyWrapperElem.scrollTop
|
|
134
110
|
const rowHeight = trElem.offsetHeight
|
|
135
111
|
const trRect = trElem.getBoundingClientRect()
|
|
@@ -81,6 +81,7 @@ export const tableEmits: VxeTableEmits = [
|
|
|
81
81
|
'custom-visible-change',
|
|
82
82
|
'custom-visible-all',
|
|
83
83
|
'custom-fixed-change',
|
|
84
|
+
'custom-sort-change',
|
|
84
85
|
|
|
85
86
|
'change-fnr', // 废弃
|
|
86
87
|
|
|
@@ -106,6 +107,7 @@ export const tableEmits: VxeTableEmits = [
|
|
|
106
107
|
'cell-area-extension-start',
|
|
107
108
|
'cell-area-extension-drag',
|
|
108
109
|
'cell-area-extension-end',
|
|
110
|
+
'cell-area-extension-fill',
|
|
109
111
|
'cell-area-selection-all-start',
|
|
110
112
|
'cell-area-selection-all-end',
|
|
111
113
|
'cell-area-arrows-start',
|
package/packages/ui/src/utils.ts
CHANGED
|
@@ -2,6 +2,8 @@ import XEUtils from 'xe-utils'
|
|
|
2
2
|
import { VxeUI } from '@vxe-ui/core'
|
|
3
3
|
import DomZIndex from 'dom-zindex'
|
|
4
4
|
|
|
5
|
+
const { getConfig } = VxeUI
|
|
6
|
+
|
|
5
7
|
export function isEnableConf (conf: any): boolean {
|
|
6
8
|
return conf && conf.enabled !== false
|
|
7
9
|
}
|
|
@@ -31,15 +33,15 @@ export function hasChildrenList (item: any) {
|
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
export function getFuncText (content?: string | number | boolean | null, args?: any) {
|
|
34
|
-
if (content) {
|
|
35
|
-
|
|
36
|
-
return XEUtils.toValueString(translate ? translate('' + content, args) : content)
|
|
36
|
+
if (XEUtils.eqNull(content)) {
|
|
37
|
+
return ''
|
|
37
38
|
}
|
|
38
|
-
|
|
39
|
+
const translate = getConfig().translate
|
|
40
|
+
return `${translate ? translate('' + content, args) : content}`
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
export function formatText (value: any, placeholder?: any) {
|
|
42
|
-
return '' + (isEmptyValue(value) ? (placeholder ?
|
|
44
|
+
return '' + (isEmptyValue(value) ? (placeholder ? getConfig().emptyCell : '') : value)
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
/**
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|