vxe-table 3.7.10 → 3.8.0-beta.0
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/all.js +16 -28
- package/lib/all.min.js +1 -1
- package/lib/button/src/button.js +49 -46
- package/lib/button/src/button.min.js +1 -1
- package/lib/button/src/group.js +60 -0
- package/lib/button/src/group.min.js +1 -0
- package/lib/button-group/index.d.ts +4 -0
- package/lib/button-group/index.js +16 -0
- package/lib/button-group/index.min.js +1 -0
- package/lib/checkbox/src/group.js +25 -3
- package/lib/checkbox/src/group.min.js +1 -1
- package/lib/export/src/mixin.js +1 -1
- package/lib/export/src/mixin.min.js +1 -1
- package/lib/footer/index.js +1 -1
- package/lib/footer/index.min.js +1 -1
- package/lib/header/index.js +1 -1
- package/lib/header/index.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 +11711 -11330
- package/lib/index.umd.min.js +1 -1
- package/lib/radio/src/group.js +24 -2
- package/lib/radio/src/group.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/{header → table}/src/header.js +2 -3
- package/lib/table/src/header.min.js +1 -0
- package/lib/table/src/table.js +3 -5
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +70 -0
- package/lib/table/src/util.min.js +1 -1
- package/lib/tools/log.js +1 -1
- package/lib/tools/log.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/lib/v-x-e-table/src/conf.js +6 -0
- package/lib/v-x-e-table/src/conf.min.js +1 -1
- package/lib/v-x-e-table/src/renderer.js +306 -37
- package/lib/v-x-e-table/src/renderer.min.js +1 -1
- package/package.json +1 -1
- package/packages/all.js +5 -6
- package/packages/button/src/button.js +23 -7
- package/packages/button/src/group.js +35 -0
- package/packages/button-group/index.d.ts +4 -0
- package/packages/button-group/index.js +9 -0
- package/packages/checkbox/src/group.js +22 -3
- package/packages/export/src/mixin.js +1 -0
- package/packages/footer/index.js +1 -1
- package/packages/header/index.js +1 -1
- package/packages/radio/src/group.js +21 -2
- package/packages/{header → table}/src/header.js +2 -3
- package/packages/table/src/table.js +3 -5
- package/packages/table/src/util.js +63 -0
- package/packages/v-x-e-table/src/conf.js +6 -0
- package/packages/v-x-e-table/src/renderer.js +266 -25
- package/styles/all.scss +1 -0
- package/styles/button-group.scss +1 -0
- package/types/all.d.ts +1 -0
- package/types/button-group.d.ts +9 -0
- package/lib/header/src/header.min.js +0 -1
- package/lib/header/src/util.js +0 -75
- package/lib/header/src/util.min.js +0 -1
- package/lib/header/style/index.js +0 -1
- package/lib/header/style/style.css +0 -25
- package/lib/header/style/style.min.css +0 -0
- package/packages/header/src/util.js +0 -62
- /package/lib/{footer → button-group}/style/index.js +0 -0
- /package/lib/{footer → button-group}/style/style.css +0 -0
- /package/lib/{footer → button-group}/style/style.min.css +0 -0
- /package/lib/icon/style/{iconfont.1712806346882.ttf → iconfont.1713080139463.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1712806346882.woff → iconfont.1713080139463.woff} +0 -0
- /package/lib/icon/style/{iconfont.1712806346882.woff2 → iconfont.1713080139463.woff2} +0 -0
- /package/lib/{iconfont.1712806346882.ttf → iconfont.1713080139463.ttf} +0 -0
- /package/lib/{iconfont.1712806346882.woff → iconfont.1713080139463.woff} +0 -0
- /package/lib/{iconfont.1712806346882.woff2 → iconfont.1713080139463.woff2} +0 -0
- /package/lib/{footer → table}/src/footer.js +0 -0
- /package/lib/{footer → table}/src/footer.min.js +0 -0
- /package/packages/{footer → table}/src/footer.js +0 -0
|
@@ -15,6 +15,8 @@ function getChangeEvent (renderOpts) {
|
|
|
15
15
|
switch (renderOpts.name) {
|
|
16
16
|
case 'input':
|
|
17
17
|
case 'textarea':
|
|
18
|
+
case 'VxeInput':
|
|
19
|
+
case 'VxeTextarea':
|
|
18
20
|
case '$input':
|
|
19
21
|
case '$textarea':
|
|
20
22
|
return 'input'
|
|
@@ -36,6 +38,14 @@ function getLabelFormatDate (value, props) {
|
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
function getDefaultComponentName ({ name }) {
|
|
41
|
+
return name
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* 已废弃
|
|
46
|
+
* @deprecated
|
|
47
|
+
*/
|
|
48
|
+
function getOldComponentName ({ name }) {
|
|
39
49
|
return `vxe-${name.replace('$', '')}`
|
|
40
50
|
}
|
|
41
51
|
|
|
@@ -54,7 +64,7 @@ function getNativeAttrs ({ name, attrs }) {
|
|
|
54
64
|
function getInputImmediateModel (renderOpts) {
|
|
55
65
|
const { name, immediate, props } = renderOpts
|
|
56
66
|
if (!immediate) {
|
|
57
|
-
if (name === '$input') {
|
|
67
|
+
if (name === 'VxeInput' || name === '$input') {
|
|
58
68
|
const { type } = props || {}
|
|
59
69
|
return !(!type || type === 'text' || type === 'number' || type === 'integer' || type === 'float')
|
|
60
70
|
}
|
|
@@ -133,7 +143,7 @@ function getOns (renderOpts, params, inputFunc, changeFunc) {
|
|
|
133
143
|
if (inputFunc) {
|
|
134
144
|
ons[modelEvent] = function (targetEvnt) {
|
|
135
145
|
// 对输入框进行优化
|
|
136
|
-
inputFunc(
|
|
146
|
+
inputFunc(['VxeInput', 'VxeTextarea', '$input', '$textarea'].includes(name) ? targetEvnt.value : targetEvnt)
|
|
137
147
|
if (events && events[modelEvent]) {
|
|
138
148
|
events[modelEvent](params, targetEvnt)
|
|
139
149
|
}
|
|
@@ -168,7 +178,7 @@ function getEditOns (renderOpts, params) {
|
|
|
168
178
|
}
|
|
169
179
|
}, (eventParams) => {
|
|
170
180
|
// 处理 change 事件相关逻辑
|
|
171
|
-
if (!isImmediate && (
|
|
181
|
+
if (!isImmediate && (['VxeInput', 'VxeTextarea', '$input', '$textarea'].includes(name))) {
|
|
172
182
|
$table.updateStatus(params, eventParams.value)
|
|
173
183
|
} else {
|
|
174
184
|
$table.updateStatus(params)
|
|
@@ -257,6 +267,16 @@ function nativeEditRender (h, renderOpts, params) {
|
|
|
257
267
|
]
|
|
258
268
|
}
|
|
259
269
|
|
|
270
|
+
function defaultCellRender (h, renderOpts, params) {
|
|
271
|
+
return [
|
|
272
|
+
h(getDefaultComponentName(renderOpts), {
|
|
273
|
+
props: getCellEditProps(renderOpts, params),
|
|
274
|
+
on: getOns(renderOpts, params),
|
|
275
|
+
nativeOn: getNativeOns(renderOpts, params)
|
|
276
|
+
})
|
|
277
|
+
]
|
|
278
|
+
}
|
|
279
|
+
|
|
260
280
|
function defaultEditRender (h, renderOpts, params) {
|
|
261
281
|
const { row, column } = params
|
|
262
282
|
const cellValue = UtilTools.getCellValue(row, column)
|
|
@@ -269,7 +289,27 @@ function defaultEditRender (h, renderOpts, params) {
|
|
|
269
289
|
]
|
|
270
290
|
}
|
|
271
291
|
|
|
272
|
-
|
|
292
|
+
/**
|
|
293
|
+
* 已废弃
|
|
294
|
+
* @deprecated
|
|
295
|
+
*/
|
|
296
|
+
function oldEditRender (h, renderOpts, params) {
|
|
297
|
+
const { row, column } = params
|
|
298
|
+
const cellValue = UtilTools.getCellValue(row, column)
|
|
299
|
+
return [
|
|
300
|
+
h(getOldComponentName(renderOpts), {
|
|
301
|
+
props: getCellEditProps(renderOpts, params, cellValue),
|
|
302
|
+
on: getEditOns(renderOpts, params),
|
|
303
|
+
nativeOn: getNativeOns(renderOpts, params)
|
|
304
|
+
})
|
|
305
|
+
]
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* 已废弃
|
|
310
|
+
* @deprecated
|
|
311
|
+
*/
|
|
312
|
+
function oldButtonEditRender (h, renderOpts, params) {
|
|
273
313
|
return [
|
|
274
314
|
h('vxe-button', {
|
|
275
315
|
props: getCellEditProps(renderOpts, params),
|
|
@@ -279,8 +319,12 @@ function defaultButtonEditRender (h, renderOpts, params) {
|
|
|
279
319
|
]
|
|
280
320
|
}
|
|
281
321
|
|
|
282
|
-
|
|
283
|
-
|
|
322
|
+
/**
|
|
323
|
+
* 已废弃
|
|
324
|
+
* @deprecated
|
|
325
|
+
*/
|
|
326
|
+
function oldButtonsEditRender (h, renderOpts, params) {
|
|
327
|
+
return renderOpts.children.map(childRenderOpts => oldButtonEditRender(h, childRenderOpts, params)[0])
|
|
284
328
|
}
|
|
285
329
|
|
|
286
330
|
function renderNativeOptgroups (h, renderOpts, params, renderOptionsMethods) {
|
|
@@ -351,6 +395,22 @@ function defaultFilterRender (h, renderOpts, params) {
|
|
|
351
395
|
})
|
|
352
396
|
}
|
|
353
397
|
|
|
398
|
+
/**
|
|
399
|
+
* 已废弃
|
|
400
|
+
* @deprecated
|
|
401
|
+
*/
|
|
402
|
+
function oldFilterRender (h, renderOpts, params) {
|
|
403
|
+
const { column } = params
|
|
404
|
+
return column.filters.map((option, oIndex) => {
|
|
405
|
+
const optionValue = option.data
|
|
406
|
+
return h(getOldComponentName(renderOpts), {
|
|
407
|
+
key: oIndex,
|
|
408
|
+
props: getFilterProps(renderOpts, renderOpts, optionValue),
|
|
409
|
+
on: getFilterOns(renderOpts, params, option)
|
|
410
|
+
})
|
|
411
|
+
})
|
|
412
|
+
}
|
|
413
|
+
|
|
354
414
|
function handleFilterMethod ({ option, row, column }) {
|
|
355
415
|
const { data } = option
|
|
356
416
|
const cellValue = XEUtils.get(row, column.property)
|
|
@@ -381,6 +441,22 @@ function defaultSelectEditRender (h, renderOpts, params) {
|
|
|
381
441
|
]
|
|
382
442
|
}
|
|
383
443
|
|
|
444
|
+
/**
|
|
445
|
+
* 已废弃
|
|
446
|
+
* @deprecated
|
|
447
|
+
*/
|
|
448
|
+
function oldSelectEditRender (h, renderOpts, params) {
|
|
449
|
+
const { row, column } = params
|
|
450
|
+
const { options, optionProps, optionGroups, optionGroupProps } = renderOpts
|
|
451
|
+
const cellValue = UtilTools.getCellValue(row, column)
|
|
452
|
+
return [
|
|
453
|
+
h(getOldComponentName(renderOpts), {
|
|
454
|
+
props: getCellEditProps(renderOpts, params, cellValue, { options, optionProps, optionGroups, optionGroupProps }),
|
|
455
|
+
on: getEditOns(renderOpts, params)
|
|
456
|
+
})
|
|
457
|
+
]
|
|
458
|
+
}
|
|
459
|
+
|
|
384
460
|
function getSelectCellValue (renderOpts, { row, column }) {
|
|
385
461
|
const { props = {}, options, optionGroups, optionProps = {}, optionGroupProps = {} } = renderOpts
|
|
386
462
|
const cellValue = XEUtils.get(row, column.property)
|
|
@@ -440,7 +516,27 @@ function defaultItemRender (h, renderOpts, params) {
|
|
|
440
516
|
]
|
|
441
517
|
}
|
|
442
518
|
|
|
443
|
-
|
|
519
|
+
/**
|
|
520
|
+
* 已废弃
|
|
521
|
+
* @deprecated
|
|
522
|
+
*/
|
|
523
|
+
function oldItemRender (h, renderOpts, params) {
|
|
524
|
+
const { data, property } = params
|
|
525
|
+
const itemValue = XEUtils.get(data, property)
|
|
526
|
+
return [
|
|
527
|
+
h(getOldComponentName(renderOpts), {
|
|
528
|
+
props: getItemProps(renderOpts, params, itemValue),
|
|
529
|
+
on: getItemOns(renderOpts, params),
|
|
530
|
+
nativeOn: getNativeOns(renderOpts, params)
|
|
531
|
+
})
|
|
532
|
+
]
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* 已废弃
|
|
537
|
+
* @deprecated
|
|
538
|
+
*/
|
|
539
|
+
function oldButtonItemRender (h, renderOpts, params) {
|
|
444
540
|
return [
|
|
445
541
|
h('vxe-button', {
|
|
446
542
|
props: getItemProps(renderOpts, params),
|
|
@@ -450,8 +546,12 @@ function defaultButtonItemRender (h, renderOpts, params) {
|
|
|
450
546
|
]
|
|
451
547
|
}
|
|
452
548
|
|
|
453
|
-
|
|
454
|
-
|
|
549
|
+
/**
|
|
550
|
+
* 已废弃
|
|
551
|
+
* @deprecated
|
|
552
|
+
*/
|
|
553
|
+
function oldButtonsItemRender (h, renderOpts, params) {
|
|
554
|
+
return renderOpts.children.map(childRenderOpts => oldButtonItemRender(h, childRenderOpts, params)[0])
|
|
455
555
|
}
|
|
456
556
|
|
|
457
557
|
/**
|
|
@@ -488,14 +588,43 @@ function handleExportSelectMethod (params) {
|
|
|
488
588
|
* 渲染表单-项中
|
|
489
589
|
* 单选框和复选框
|
|
490
590
|
*/
|
|
491
|
-
function
|
|
591
|
+
function defaultFormItemRender (h, renderOpts, params) {
|
|
592
|
+
const { data, property } = params
|
|
593
|
+
const itemValue = XEUtils.get(data, property)
|
|
594
|
+
return [
|
|
595
|
+
h(getDefaultComponentName(renderOpts), {
|
|
596
|
+
props: getItemProps(renderOpts, params, itemValue),
|
|
597
|
+
on: getItemOns(renderOpts, params),
|
|
598
|
+
nativeOn: getNativeOns(renderOpts, params)
|
|
599
|
+
})
|
|
600
|
+
]
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
function formItemRadioAndCheckboxRender (h, renderOpts, params) {
|
|
604
|
+
const { options, optionProps = {} } = renderOpts
|
|
605
|
+
const { data, property } = params
|
|
606
|
+
const itemValue = XEUtils.get(data, property)
|
|
607
|
+
return [
|
|
608
|
+
h(getDefaultComponentName(renderOpts), {
|
|
609
|
+
props: { options, optionProps, ...getItemProps(renderOpts, params, itemValue) },
|
|
610
|
+
on: getItemOns(renderOpts, params),
|
|
611
|
+
nativeOn: getNativeOns(renderOpts, params)
|
|
612
|
+
})
|
|
613
|
+
]
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
/**
|
|
617
|
+
* 已废弃
|
|
618
|
+
* @deprecated
|
|
619
|
+
*/
|
|
620
|
+
function oldFormItemRadioAndCheckboxRender (h, renderOpts, params) {
|
|
492
621
|
const { options, optionProps = {} } = renderOpts
|
|
493
622
|
const { data, property } = params
|
|
494
623
|
const labelProp = optionProps.label || 'label'
|
|
495
624
|
const valueProp = optionProps.value || 'value'
|
|
496
625
|
const disabledProp = optionProps.disabled || 'disabled'
|
|
497
626
|
const itemValue = XEUtils.get(data, property)
|
|
498
|
-
const name =
|
|
627
|
+
const name = getOldComponentName(renderOpts)
|
|
499
628
|
// 如果是分组
|
|
500
629
|
if (options) {
|
|
501
630
|
return [
|
|
@@ -572,7 +701,7 @@ const renderMap = {
|
|
|
572
701
|
},
|
|
573
702
|
cellExportMethod: handleExportSelectMethod
|
|
574
703
|
},
|
|
575
|
-
|
|
704
|
+
VxeInput: {
|
|
576
705
|
autofocus: '.vxe-input--inner',
|
|
577
706
|
renderEdit: defaultEditRender,
|
|
578
707
|
renderCell (h, renderOpts, params) {
|
|
@@ -600,19 +729,30 @@ const renderMap = {
|
|
|
600
729
|
defaultFilterMethod: handleFilterMethod,
|
|
601
730
|
renderItemContent: defaultItemRender
|
|
602
731
|
},
|
|
603
|
-
|
|
732
|
+
VxeTextarea: {
|
|
604
733
|
autofocus: '.vxe-textarea--inner',
|
|
605
734
|
renderItemContent: defaultItemRender
|
|
606
735
|
},
|
|
607
|
-
|
|
608
|
-
renderDefault:
|
|
609
|
-
renderItemContent:
|
|
736
|
+
VxeButton: {
|
|
737
|
+
renderDefault: defaultCellRender,
|
|
738
|
+
renderItemContent: defaultFormItemRender
|
|
610
739
|
},
|
|
611
|
-
|
|
612
|
-
renderDefault:
|
|
613
|
-
renderItemContent
|
|
740
|
+
VxeButtonGroup: {
|
|
741
|
+
renderDefault: defaultCellRender,
|
|
742
|
+
renderItemContent (h, renderOpts, params) {
|
|
743
|
+
const { options } = renderOpts
|
|
744
|
+
const { data, property } = params
|
|
745
|
+
const itemValue = XEUtils.get(data, property)
|
|
746
|
+
return [
|
|
747
|
+
h(getDefaultComponentName(renderOpts), {
|
|
748
|
+
props: { options, ...getItemProps(renderOpts, params, itemValue) },
|
|
749
|
+
on: getItemOns(renderOpts, params),
|
|
750
|
+
nativeOn: getNativeOns(renderOpts, params)
|
|
751
|
+
})
|
|
752
|
+
]
|
|
753
|
+
}
|
|
614
754
|
},
|
|
615
|
-
|
|
755
|
+
VxeSelect: {
|
|
616
756
|
autofocus: '.vxe-input--inner',
|
|
617
757
|
renderEdit: defaultSelectEditRender,
|
|
618
758
|
renderDefault: defaultSelectEditRender,
|
|
@@ -648,20 +788,121 @@ const renderMap = {
|
|
|
648
788
|
},
|
|
649
789
|
cellExportMethod: handleExportSelectMethod
|
|
650
790
|
},
|
|
651
|
-
|
|
791
|
+
VxeRadio: {
|
|
652
792
|
autofocus: '.vxe-radio--input',
|
|
653
|
-
renderItemContent:
|
|
793
|
+
renderItemContent: defaultFormItemRender
|
|
654
794
|
},
|
|
655
|
-
|
|
795
|
+
VxeRadioGroup: {
|
|
796
|
+
autofocus: '.vxe-radio--input',
|
|
797
|
+
renderItemContent: formItemRadioAndCheckboxRender
|
|
798
|
+
},
|
|
799
|
+
VxeCheckbox: {
|
|
656
800
|
autofocus: '.vxe-checkbox--input',
|
|
657
|
-
renderItemContent:
|
|
801
|
+
renderItemContent: defaultFormItemRender
|
|
658
802
|
},
|
|
659
|
-
|
|
803
|
+
VxeCheckboxGroup: {
|
|
804
|
+
autofocus: '.vxe-checkbox--input',
|
|
805
|
+
renderItemContent: formItemRadioAndCheckboxRender
|
|
806
|
+
},
|
|
807
|
+
VxeSwitch: {
|
|
660
808
|
autofocus: '.vxe-switch--button',
|
|
661
809
|
renderEdit: defaultEditRender,
|
|
662
810
|
renderDefault: defaultEditRender,
|
|
663
811
|
renderItemContent: defaultItemRender
|
|
812
|
+
},
|
|
813
|
+
|
|
814
|
+
// 以下已废弃
|
|
815
|
+
$input: {
|
|
816
|
+
autofocus: '.vxe-input--inner',
|
|
817
|
+
renderEdit: oldEditRender,
|
|
818
|
+
renderCell (h, renderOpts, params) {
|
|
819
|
+
const { props = {} } = renderOpts
|
|
820
|
+
const { row, column } = params
|
|
821
|
+
const digits = props.digits || GlobalConfig.input.digits
|
|
822
|
+
let cellValue = XEUtils.get(row, column.property)
|
|
823
|
+
if (cellValue) {
|
|
824
|
+
switch (props.type) {
|
|
825
|
+
case 'date':
|
|
826
|
+
case 'week':
|
|
827
|
+
case 'month':
|
|
828
|
+
case 'year':
|
|
829
|
+
cellValue = getLabelFormatDate(cellValue, props)
|
|
830
|
+
break
|
|
831
|
+
case 'float':
|
|
832
|
+
cellValue = XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits)
|
|
833
|
+
break
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
return getCellLabelVNs(h, renderOpts, params, cellValue)
|
|
837
|
+
},
|
|
838
|
+
renderDefault: oldEditRender,
|
|
839
|
+
renderFilter: oldFilterRender,
|
|
840
|
+
defaultFilterMethod: handleFilterMethod,
|
|
841
|
+
renderItemContent: oldItemRender
|
|
842
|
+
},
|
|
843
|
+
$textarea: {
|
|
844
|
+
autofocus: '.vxe-textarea--inner',
|
|
845
|
+
renderItemContent: oldItemRender
|
|
846
|
+
},
|
|
847
|
+
$button: {
|
|
848
|
+
renderDefault: oldButtonEditRender,
|
|
849
|
+
renderItemContent: oldButtonItemRender
|
|
850
|
+
},
|
|
851
|
+
$buttons: {
|
|
852
|
+
renderDefault: oldButtonsEditRender,
|
|
853
|
+
renderItemContent: oldButtonsItemRender
|
|
854
|
+
},
|
|
855
|
+
$select: {
|
|
856
|
+
autofocus: '.vxe-input--inner',
|
|
857
|
+
renderEdit: oldSelectEditRender,
|
|
858
|
+
renderDefault: oldSelectEditRender,
|
|
859
|
+
renderCell (h, renderOpts, params) {
|
|
860
|
+
return getCellLabelVNs(h, renderOpts, params, getSelectCellValue(renderOpts, params))
|
|
861
|
+
},
|
|
862
|
+
renderFilter (h, renderOpts, params) {
|
|
863
|
+
const { column } = params
|
|
864
|
+
const { options, optionProps, optionGroups, optionGroupProps } = renderOpts
|
|
865
|
+
const nativeOn = getNativeOns(renderOpts, params)
|
|
866
|
+
return column.filters.map((option, oIndex) => {
|
|
867
|
+
const optionValue = option.data
|
|
868
|
+
return h(getOldComponentName(renderOpts), {
|
|
869
|
+
key: oIndex,
|
|
870
|
+
props: getFilterProps(renderOpts, params, optionValue, { options, optionProps, optionGroups, optionGroupProps }),
|
|
871
|
+
on: getFilterOns(renderOpts, params, option),
|
|
872
|
+
nativeOn
|
|
873
|
+
})
|
|
874
|
+
})
|
|
875
|
+
},
|
|
876
|
+
defaultFilterMethod: handleFilterMethod,
|
|
877
|
+
renderItemContent (h, renderOpts, params) {
|
|
878
|
+
const { data, property } = params
|
|
879
|
+
const { options, optionProps, optionGroups, optionGroupProps } = renderOpts
|
|
880
|
+
const itemValue = XEUtils.get(data, property)
|
|
881
|
+
return [
|
|
882
|
+
h(getOldComponentName(renderOpts), {
|
|
883
|
+
props: getItemProps(renderOpts, params, itemValue, { options, optionProps, optionGroups, optionGroupProps }),
|
|
884
|
+
on: getItemOns(renderOpts, params),
|
|
885
|
+
nativeOn: getNativeOns(renderOpts, params)
|
|
886
|
+
})
|
|
887
|
+
]
|
|
888
|
+
},
|
|
889
|
+
cellExportMethod: handleExportSelectMethod
|
|
890
|
+
},
|
|
891
|
+
$radio: {
|
|
892
|
+
autofocus: '.vxe-radio--input',
|
|
893
|
+
renderItemContent: oldFormItemRadioAndCheckboxRender
|
|
894
|
+
},
|
|
895
|
+
$checkbox: {
|
|
896
|
+
autofocus: '.vxe-checkbox--input',
|
|
897
|
+
renderItemContent: oldFormItemRadioAndCheckboxRender
|
|
898
|
+
},
|
|
899
|
+
$switch: {
|
|
900
|
+
autofocus: '.vxe-switch--button',
|
|
901
|
+
renderEdit: oldEditRender,
|
|
902
|
+
renderDefault: oldEditRender,
|
|
903
|
+
renderItemContent: oldItemRender
|
|
664
904
|
}
|
|
905
|
+
// 以上已废弃
|
|
665
906
|
}
|
|
666
907
|
|
|
667
908
|
/**
|
package/styles/all.scss
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/**Variable**/
|
package/types/all.d.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_utils=_interopRequireDefault(require("../../tools/utils")),_dom=_interopRequireDefault(require("../../tools/dom")),_util=require("./util"),_util2=require("../../table/src/util");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function ownKeys(t,e){var r,l=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),l.push.apply(l,r)),l}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach(function(e){_defineProperty(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var cellType="header",_default={name:"VxeTableHeader",props:{tableData:Array,tableColumn:Array,tableGroupColumn:Array,fixedColumn:Array,size:String,fixedType:String},data:function(){return{headerColumn:[]}},watch:{tableColumn:function(){this.uploadColumn()}},created:function(){this.uploadColumn()},mounted:function(){var e=this.$parent,t=this.$el,r=this.$refs,l=this.fixedType,e=e.elemStore,l="".concat(l||"main","-header-");e["".concat(l,"wrapper")]=t,e["".concat(l,"table")]=r.table,e["".concat(l,"colgroup")]=r.colgroup,e["".concat(l,"list")]=r.thead,e["".concat(l,"xSpace")]=r.xSpace,e["".concat(l,"repair")]=r.repair},destroyed:function(){var e=this.$parent,t=this.fixedType,e=e.elemStore,t="".concat(t||"main","-header-");e["".concat(t,"wrapper")]=null,e["".concat(t,"table")]=null,e["".concat(t,"colgroup")]=null,e["".concat(t,"list")]=null,e["".concat(t,"xSpace")]=null,e["".concat(t,"repair")]=null},render:function(x){var g=this,e=this._e,_=this.$parent,v=this.fixedType,t=this.headerColumn,r=this.tableColumn,l=this.fixedColumn,C=_.$listeners,n=_.tId,o=_.isGroup,i=_.visibleColumn,w=_.resizable,P=_.border,O=_.columnKey,a=_.headerRowClassName,S=_.headerCellClassName,s=_.headerRowStyle,$=_.headerCellStyle,z=_.showHeaderOverflow,j=_.headerAlign,T=_.align,D=_.highlightCurrentColumn,M=_.currentColumn,R=_.scrollXLoad,W=_.overflowX,c=_.scrollbarWidth,k=_.sortOpts,q=_.mouseConfig,I=_.columnOpts;return o?r=i:t=[r=v&&(R||z)?l:r],x("div",{class:["vxe-table--header-wrapper",v?"fixed-".concat(v,"--wrapper"):"body--wrapper"],attrs:{xid:n}},[v?e():x("div",{class:"vxe-body--x-space",ref:"xSpace"}),x("table",{class:"vxe-table--header",attrs:{xid:n,cellspacing:0,cellpadding:0,border:0},ref:"table"},[x("colgroup",{ref:"colgroup"},r.map(function(e,t){return x("col",{attrs:{name:e.id},key:t})}).concat(c?[x("col",{attrs:{name:"col_gutter"}})]:[])),x("thead",{ref:"thead"},t.map(function(b,y){return x("tr",{class:["vxe-header--row",a?_xeUtils.default.isFunction(a)?a({$table:_,$rowIndex:y,fixed:v,type:cellType}):a:""],style:s?_xeUtils.default.isFunction(s)?s({$table:_,$rowIndex:y,fixed:v,type:cellType}):s:null},b.map(function(e,t){var r=e.type,l=e.showHeaderOverflow,n=e.headerAlign,o=e.align,i=e.headerClassName,a=e.children&&e.children.length,s=v?e.fixed!==v&&!a:e.fixed&&W,l=_xeUtils.default.isUndefined(l)||_xeUtils.default.isNull(l)?z:l,n=n||o||j||T,o="ellipsis"===l,c="title"===l,l=!0===l||"tooltip"===l,u=c||l||o,d={},f=e.filters&&e.filters.some(function(e){return e.checked}),p=_.getColumnIndex(e),h=_.getVTColumnIndex(e),m={$table:_,$grid:_.xegrid,$rowIndex:y,column:e,columnIndex:p,$columnIndex:t,_columnIndex:h,fixed:v,type:cellType,isHidden:s,hasFilter:f};return R&&!u&&(o=u=!0),(I.isCurrent||D||C["header-cell-click"]||"cell"===k.trigger)&&(d.click=function(e){return _.triggerHeaderCellClickEvent(e,m)}),C["header-cell-dblclick"]&&(d.dblclick=function(e){return _.triggerHeaderCellDblclickEvent(e,m)}),q&&(d.mousedown=function(e){return _.triggerHeaderCellMousedownEvent(e,m)}),x("th",{class:["vxe-header--column",e.id,(_defineProperty(p={},"col--".concat(n),n),_defineProperty(p,"col--".concat(r),r),_defineProperty(p,"col--last",t===b.length-1),_defineProperty(p,"col--fixed",e.fixed),_defineProperty(p,"col--group",a),_defineProperty(p,"col--ellipsis",u),_defineProperty(p,"fixed--hidden",s),_defineProperty(p,"is--sortable",e.sortable),_defineProperty(p,"col--filter",!!e.filters),_defineProperty(p,"is--filter-active",f),_defineProperty(p,"col--current",M===e),p),_utils.default.getClass(i,m),_utils.default.getClass(S,m)],attrs:{colid:e.id,colspan:1<e.colSpan?e.colSpan:null,rowspan:1<e.rowSpan?e.rowSpan:null},style:$?_xeUtils.default.isFunction($)?$(m):$:null,on:d,key:O||I.useKey||a?e.id:t},[x("div",{class:["vxe-cell",{"c--title":c,"c--tooltip":l,"c--ellipsis":o}]},e.renderHeader(x,m)),s||a||!(_xeUtils.default.isBoolean(e.resizable)?e.resizable:I.resizable||w)?null:x("div",{class:["vxe-resizable",{"is--line":!P||"none"===P}],on:{mousedown:function(e){return g.resizeMousedown(e,m)}}})])}).concat(c?[x("th",{class:"vxe-header--gutter col--gutter"})]:[]))}))]),x("div",{class:"vxe-table--header-border-line",ref:"repair"})])},methods:{uploadColumn:function(){var e=this.$parent;this.headerColumn=e.isGroup?(0,_util.convertToRows)(this.tableGroupColumn):[]},resizeMousedown:function(e,r){var l=r.column,n=this.$parent,t=this.$el,o=this.fixedType,i=n.$refs,a=i.tableBody,s=i.leftContainer,c=i.rightContainer,u=i.resizeBar,i=e.target,d=e.clientX,f=r.cell=i.parentNode,p=0,h=a.$el,a=_dom.default.getOffsetPos(i,t),t=i.clientWidth,i=Math.floor(t/2),m=(0,_util2.getColReMinWidth)(r)-i,b=a.left-f.clientWidth+t+m,y=a.left+i,x=document.onmousemove,g=document.onmouseup,_="left"===o,v="right"===o,C=0;if(_||v){for(var w=_?"nextElementSibling":"previousElementSibling",P=f[w];P&&!_dom.default.hasClass(P,"fixed--hidden");)_dom.default.hasClass(P,"col--group")||(C+=P.offsetWidth),P=P[w];v&&c&&(y=c.offsetLeft+C)}function O(e){e.stopPropagation(),e.preventDefault();var e=e.clientX-d,e=y+e,t=o?0:h.scrollLeft;_?e=Math.min(e,(c?c.offsetLeft:h.clientWidth)-C-m):v?(b=(s?s.clientWidth:0)+C+m,e=Math.min(e,y+f.clientWidth-m)):b=Math.max(h.scrollLeft,b),p=Math.max(e,b),u.style.left="".concat(p-t,"px")}n._isResize=!0,_dom.default.addClass(n.$el,"drag--resize"),u.style.display="block",document.onmousemove=O,document.onmouseup=function(e){document.onmousemove=x,document.onmouseup=g;var t=l.renderWidth+(v?y-p:p-y);l.resizeWidth=t,u.style.display="none",n._isResize=!1,n._lastResizeTime=Date.now(),n.analyColumnWidth(),n.recalculate(!0).then(function(){n.saveCustomResizable(),n.updateCellAreas(),n.emitEvent("resizable-change",_objectSpread(_objectSpread({},r),{},{resizeWidth:t}),e)}),_dom.default.removeClass(n.$el,"drag--resize")},O(e),n.closeMenu()}}};exports.default=_default;
|
package/lib/header/src/util.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.convertToRows = void 0;
|
|
7
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
11
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
12
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
13
|
-
var getAllColumns = function getAllColumns(columns, parentColumn) {
|
|
14
|
-
var result = [];
|
|
15
|
-
columns.forEach(function (column) {
|
|
16
|
-
column.parentId = parentColumn ? parentColumn.id : null;
|
|
17
|
-
if (column.visible) {
|
|
18
|
-
if (column.children && column.children.length && column.children.some(function (column) {
|
|
19
|
-
return column.visible;
|
|
20
|
-
})) {
|
|
21
|
-
result.push(column);
|
|
22
|
-
result.push.apply(result, _toConsumableArray(getAllColumns(column.children, column)));
|
|
23
|
-
} else {
|
|
24
|
-
result.push(column);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
return result;
|
|
29
|
-
};
|
|
30
|
-
var convertToRows = function convertToRows(originColumns) {
|
|
31
|
-
var maxLevel = 1;
|
|
32
|
-
var traverse = function traverse(column, parent) {
|
|
33
|
-
if (parent) {
|
|
34
|
-
column.level = parent.level + 1;
|
|
35
|
-
if (maxLevel < column.level) {
|
|
36
|
-
maxLevel = column.level;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
if (column.children && column.children.length && column.children.some(function (column) {
|
|
40
|
-
return column.visible;
|
|
41
|
-
})) {
|
|
42
|
-
var colSpan = 0;
|
|
43
|
-
column.children.forEach(function (subColumn) {
|
|
44
|
-
if (subColumn.visible) {
|
|
45
|
-
traverse(subColumn, column);
|
|
46
|
-
colSpan += subColumn.colSpan;
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
column.colSpan = colSpan;
|
|
50
|
-
} else {
|
|
51
|
-
column.colSpan = 1;
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
originColumns.forEach(function (column) {
|
|
55
|
-
column.level = 1;
|
|
56
|
-
traverse(column);
|
|
57
|
-
});
|
|
58
|
-
var rows = [];
|
|
59
|
-
for (var i = 0; i < maxLevel; i++) {
|
|
60
|
-
rows.push([]);
|
|
61
|
-
}
|
|
62
|
-
var allColumns = getAllColumns(originColumns);
|
|
63
|
-
allColumns.forEach(function (column) {
|
|
64
|
-
if (column.children && column.children.length && column.children.some(function (column) {
|
|
65
|
-
return column.visible;
|
|
66
|
-
})) {
|
|
67
|
-
column.rowSpan = 1;
|
|
68
|
-
} else {
|
|
69
|
-
column.rowSpan = maxLevel - column.level + 1;
|
|
70
|
-
}
|
|
71
|
-
rows[column.level - 1].push(column);
|
|
72
|
-
});
|
|
73
|
-
return rows;
|
|
74
|
-
};
|
|
75
|
-
exports.convertToRows = convertToRows;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(r,e){var n;if(r)return"string"==typeof r?_arrayLikeToArray(r,e):"Map"===(n="Object"===(n=Object.prototype.toString.call(r).slice(8,-1))&&r.constructor?r.constructor.name:n)||"Set"===n?Array.from(r):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(r,e):void 0}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r)}function _arrayLikeToArray(r,e){(null==e||e>r.length)&&(e=r.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=r[n];return o}Object.defineProperty(exports,"__esModule",{value:!0}),exports.convertToRows=void 0;var getAllColumns=function e(r,n){var o=[];return r.forEach(function(r){r.parentId=n?n.id:null,r.visible&&(r.children&&r.children.length&&r.children.some(function(r){return r.visible})?(o.push(r),o.push.apply(o,_toConsumableArray(e(r.children,r)))):o.push(r))}),o},convertToRows=function(r){for(var t=1,e=function e(n,r){var o;r&&(n.level=r.level+1,t<n.level)&&(t=n.level),n.children&&n.children.length&&n.children.some(function(r){return r.visible})?(o=0,n.children.forEach(function(r){r.visible&&(e(r,n),o+=r.colSpan)}),n.colSpan=o):n.colSpan=1},n=(r.forEach(function(r){r.level=1,e(r)}),[]),o=0;o<t;o++)n.push([]);return getAllColumns(r).forEach(function(r){r.children&&r.children.length&&r.children.some(function(r){return r.visible})?r.rowSpan=1:r.rowSpan=t-r.level+1,n[r.level-1].push(r)}),n};exports.convertToRows=convertToRows;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require('./style.css')
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/*font*/
|
|
2
|
-
/*size*/
|
|
3
|
-
/*icon*/
|
|
4
|
-
/*color*/
|
|
5
|
-
/*input/radio/checkbox*/
|
|
6
|
-
/*popup*/
|
|
7
|
-
/*table*/
|
|
8
|
-
/*filter*/
|
|
9
|
-
/*menu*/
|
|
10
|
-
/*loading*/
|
|
11
|
-
/*validate*/
|
|
12
|
-
/*grid*/
|
|
13
|
-
/*toolbar*/
|
|
14
|
-
/*tooltip*/
|
|
15
|
-
/*pager*/
|
|
16
|
-
/*modal*/
|
|
17
|
-
/*checkbox*/
|
|
18
|
-
/*radio*/
|
|
19
|
-
/*button*/
|
|
20
|
-
/*input*/
|
|
21
|
-
/*textarea*/
|
|
22
|
-
/*form*/
|
|
23
|
-
/*select*/
|
|
24
|
-
/*switch*/
|
|
25
|
-
/*pulldown*/
|
|
File without changes
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
const getAllColumns = (columns, parentColumn) => {
|
|
2
|
-
const result = []
|
|
3
|
-
columns.forEach((column) => {
|
|
4
|
-
column.parentId = parentColumn ? parentColumn.id : null
|
|
5
|
-
if (column.visible) {
|
|
6
|
-
if (column.children && column.children.length && column.children.some(column => column.visible)) {
|
|
7
|
-
result.push(column)
|
|
8
|
-
result.push(...getAllColumns(column.children, column))
|
|
9
|
-
} else {
|
|
10
|
-
result.push(column)
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
})
|
|
14
|
-
return result
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const convertToRows = (originColumns) => {
|
|
18
|
-
let maxLevel = 1
|
|
19
|
-
const traverse = (column, parent) => {
|
|
20
|
-
if (parent) {
|
|
21
|
-
column.level = parent.level + 1
|
|
22
|
-
if (maxLevel < column.level) {
|
|
23
|
-
maxLevel = column.level
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
if (column.children && column.children.length && column.children.some(column => column.visible)) {
|
|
27
|
-
let colSpan = 0
|
|
28
|
-
column.children.forEach((subColumn) => {
|
|
29
|
-
if (subColumn.visible) {
|
|
30
|
-
traverse(subColumn, column)
|
|
31
|
-
colSpan += subColumn.colSpan
|
|
32
|
-
}
|
|
33
|
-
})
|
|
34
|
-
column.colSpan = colSpan
|
|
35
|
-
} else {
|
|
36
|
-
column.colSpan = 1
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
originColumns.forEach((column) => {
|
|
41
|
-
column.level = 1
|
|
42
|
-
traverse(column)
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
const rows = []
|
|
46
|
-
for (let i = 0; i < maxLevel; i++) {
|
|
47
|
-
rows.push([])
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const allColumns = getAllColumns(originColumns)
|
|
51
|
-
|
|
52
|
-
allColumns.forEach((column) => {
|
|
53
|
-
if (column.children && column.children.length && column.children.some(column => column.visible)) {
|
|
54
|
-
column.rowSpan = 1
|
|
55
|
-
} else {
|
|
56
|
-
column.rowSpan = maxLevel - column.level + 1
|
|
57
|
-
}
|
|
58
|
-
rows[column.level - 1].push(column)
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
return rows
|
|
62
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|