vxe-table 4.7.18-beta.0 → 4.7.18
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/colgroup/index.js +1 -0
- package/es/column/index.js +1 -0
- package/es/grid/index.js +1 -0
- package/es/grid/src/grid.js +12 -5
- package/es/table/index.js +1 -0
- package/es/table/module/custom/panel.js +179 -160
- package/es/table/module/export/export-panel.js +243 -212
- package/es/table/module/export/import-panel.js +96 -79
- package/es/table/src/table.js +28 -19
- package/es/toolbar/index.js +1 -0
- package/es/toolbar/src/toolbar.js +99 -81
- package/es/ui/index.js +2 -2
- package/es/ui/src/log.js +1 -1
- package/lib/colgroup/index.js +1 -0
- package/lib/colgroup/index.min.js +1 -1
- package/lib/column/index.js +1 -0
- package/lib/column/index.min.js +1 -1
- package/lib/grid/index.js +1 -0
- package/lib/grid/index.min.js +1 -1
- package/lib/grid/src/grid.js +22 -15
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +151 -114
- package/lib/index.umd.min.js +1 -1
- package/lib/table/index.js +1 -0
- package/lib/table/index.min.js +1 -1
- package/lib/table/module/custom/panel.js +17 -12
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/export/export-panel.js +24 -19
- package/lib/table/module/export/export-panel.min.js +1 -1
- package/lib/table/module/export/import-panel.js +17 -11
- package/lib/table/module/export/import-panel.min.js +1 -1
- package/lib/table/src/table.js +10 -7
- package/lib/table/src/table.min.js +1 -1
- package/lib/toolbar/index.js +1 -0
- package/lib/toolbar/index.min.js +1 -1
- package/lib/toolbar/src/toolbar.js +52 -46
- package/lib/toolbar/src/toolbar.min.js +1 -1
- package/lib/ui/index.js +2 -2
- 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/package.json +2 -2
- package/packages/colgroup/index.ts +2 -0
- package/packages/column/index.ts +2 -0
- package/packages/grid/index.ts +2 -0
- package/packages/grid/src/grid.ts +29 -21
- package/packages/table/index.ts +2 -0
- package/packages/table/module/custom/panel.ts +184 -160
- package/packages/table/module/export/export-panel.ts +244 -211
- package/packages/table/module/export/import-panel.ts +96 -78
- package/packages/table/src/table.ts +32 -22
- package/packages/toolbar/index.ts +2 -0
- package/packages/toolbar/src/toolbar.ts +111 -92
package/es/colgroup/index.js
CHANGED
package/es/column/index.js
CHANGED
package/es/grid/index.js
CHANGED
package/es/grid/src/grid.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, h, ref, computed, provide,
|
|
1
|
+
import { defineComponent, h, ref, computed, provide, reactive, onUnmounted, watch, nextTick, onMounted, createCommentVNode } from 'vue';
|
|
2
2
|
import XEUtils from 'xe-utils';
|
|
3
3
|
import { getLastZIndex, nextZIndex, isEnableConf } from '../../ui/src/utils';
|
|
4
4
|
import { getOffsetHeight, getPaddingTopBottomSize, getDomNode } from '../../ui/src/dom';
|
|
@@ -35,6 +35,9 @@ export default defineComponent({
|
|
|
35
35
|
var _a;
|
|
36
36
|
const { slots, emit } = context;
|
|
37
37
|
const xID = XEUtils.uniqueId();
|
|
38
|
+
// 使用已安装的组件,如果未安装则不渲染
|
|
39
|
+
const VxeUIFormComponent = VxeUI.getComponent('VxeForm');
|
|
40
|
+
const VxeUIPagerComponent = VxeUI.getComponent('VxePager');
|
|
38
41
|
const { computeSize } = useFns.useSize(props);
|
|
39
42
|
const reactData = reactive({
|
|
40
43
|
tableLoading: false,
|
|
@@ -383,9 +386,11 @@ export default defineComponent({
|
|
|
383
386
|
}
|
|
384
387
|
});
|
|
385
388
|
});
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
+
if (VxeUIFormComponent) {
|
|
390
|
+
slotVNs.push(h(VxeUIFormComponent, Object.assign(Object.assign({ ref: refForm }, Object.assign({}, formOpts, {
|
|
391
|
+
data: proxyConfig && isEnableConf(proxyOpts) && proxyOpts.form ? formData : formOpts.data
|
|
392
|
+
})), { onSubmit: submitFormEvent, onReset: resetFormEvent, onSubmitInvalid: submitInvalidEvent, onCollapse: collapseEvent }), formSlots));
|
|
393
|
+
}
|
|
389
394
|
}
|
|
390
395
|
}
|
|
391
396
|
return h('div', {
|
|
@@ -534,7 +539,9 @@ export default defineComponent({
|
|
|
534
539
|
pagerSlots.right = rightSlot;
|
|
535
540
|
}
|
|
536
541
|
}
|
|
537
|
-
|
|
542
|
+
if (VxeUIPagerComponent) {
|
|
543
|
+
slotVNs.push(h(VxeUIPagerComponent, Object.assign(Object.assign(Object.assign({ ref: refPager }, pagerOpts), (proxyConfig && isEnableConf(proxyOpts) ? reactData.tablePage : {})), { onPageChange: pageChangeEvent }), pagerSlots));
|
|
544
|
+
}
|
|
538
545
|
}
|
|
539
546
|
return h('div', {
|
|
540
547
|
ref: refPagerWrapper,
|
package/es/table/index.js
CHANGED
|
@@ -16,5 +16,6 @@ export const VxeTable = Object.assign({}, VxeTableComponent, {
|
|
|
16
16
|
if (VxeUI.dynamicApp) {
|
|
17
17
|
VxeUI.dynamicApp.component(VxeTableComponent.name, VxeTableComponent);
|
|
18
18
|
}
|
|
19
|
+
VxeUI.component(VxeTableComponent);
|
|
19
20
|
export const Table = VxeTable;
|
|
20
21
|
export default VxeTable;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, h, inject, ref,
|
|
1
|
+
import { defineComponent, h, inject, ref, TransitionGroup, createCommentVNode } from 'vue';
|
|
2
2
|
import { VxeUI } from '../../../ui';
|
|
3
3
|
import { formatText } from '../../../ui/src/utils';
|
|
4
4
|
import { addClass, removeClass } from '../../../ui/src/dom';
|
|
@@ -13,6 +13,11 @@ export default defineComponent({
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
setup(props) {
|
|
16
|
+
const VxeUIModalComponent = VxeUI.getComponent('VxeModal');
|
|
17
|
+
const VxeUIButtonComponent = VxeUI.getComponent('VxeButton');
|
|
18
|
+
const VxeUIInputComponent = VxeUI.getComponent('VxeInput');
|
|
19
|
+
const VxeUITooltipComponent = VxeUI.getComponent('VxeTooltip');
|
|
20
|
+
const VxeUIRadioGroupComponent = VxeUI.getComponent('VxeRadioGroup');
|
|
16
21
|
const $xeTable = inject('$xeTable', {});
|
|
17
22
|
const { reactData } = $xeTable;
|
|
18
23
|
const { computeCustomOpts, computeColumnOpts, computeIsMaxFixedColumn } = $xeTable.getComputeMaps();
|
|
@@ -531,14 +536,16 @@ export default defineComponent({
|
|
|
531
536
|
}, [
|
|
532
537
|
!isChecked || (column.children && column.children.length)
|
|
533
538
|
? h('span', '-')
|
|
534
|
-
:
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
539
|
+
: (VxeUIInputComponent
|
|
540
|
+
? h(VxeUIInputComponent, {
|
|
541
|
+
type: 'integer',
|
|
542
|
+
min: 40,
|
|
543
|
+
modelValue: column.renderResizeWidth,
|
|
544
|
+
'onUpdate:modelValue'(value) {
|
|
545
|
+
column.renderResizeWidth = Math.max(40, Number(value));
|
|
546
|
+
}
|
|
547
|
+
})
|
|
548
|
+
: createCommentVNode())
|
|
542
549
|
])
|
|
543
550
|
: createCommentVNode(),
|
|
544
551
|
allowFixed
|
|
@@ -547,22 +554,24 @@ export default defineComponent({
|
|
|
547
554
|
}, [
|
|
548
555
|
parent
|
|
549
556
|
? h('span', '-')
|
|
550
|
-
:
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
557
|
+
: (VxeUIRadioGroupComponent
|
|
558
|
+
? h(VxeUIRadioGroupComponent, {
|
|
559
|
+
modelValue: column.renderFixed || '',
|
|
560
|
+
type: 'button',
|
|
561
|
+
size: 'mini',
|
|
562
|
+
options: [
|
|
563
|
+
{ label: getI18n('vxe.custom.setting.fixedLeft'), value: 'left', disabled: isMaxFixedColumn },
|
|
564
|
+
{ label: getI18n('vxe.custom.setting.fixedUnset'), value: '' },
|
|
565
|
+
{ label: getI18n('vxe.custom.setting.fixedRight'), value: 'right', disabled: isMaxFixedColumn }
|
|
566
|
+
],
|
|
567
|
+
'onUpdate:modelValue'(value) {
|
|
568
|
+
column.renderFixed = value;
|
|
569
|
+
}
|
|
570
|
+
// onChange () {
|
|
571
|
+
// changePopupFixedOption(column)
|
|
572
|
+
// }
|
|
573
|
+
})
|
|
574
|
+
: createCommentVNode())
|
|
566
575
|
])
|
|
567
576
|
: createCommentVNode()
|
|
568
577
|
]));
|
|
@@ -570,151 +579,161 @@ export default defineComponent({
|
|
|
570
579
|
});
|
|
571
580
|
const isAllChecked = customStore.isAll;
|
|
572
581
|
const isAllIndeterminate = customStore.isIndeterminate;
|
|
573
|
-
return
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
h('div', {
|
|
598
|
-
class: 'vxe-table-custom-popup--table-wrapper'
|
|
582
|
+
return VxeUIModalComponent
|
|
583
|
+
? h(VxeUIModalComponent, {
|
|
584
|
+
key: 'popup',
|
|
585
|
+
className: ['vxe-table-custom-popup-wrapper', 'vxe-table--ignore-clear', modalOpts.className || ''].join(' '),
|
|
586
|
+
modelValue: customStore.visible,
|
|
587
|
+
title: modalOpts.title || getI18n('vxe.custom.cstmTitle'),
|
|
588
|
+
width: modalOpts.width || '50vw',
|
|
589
|
+
minWidth: modalOpts.minWidth || 700,
|
|
590
|
+
height: modalOpts.height || '50vh',
|
|
591
|
+
minHeight: modalOpts.minHeight || 400,
|
|
592
|
+
mask: true,
|
|
593
|
+
lockView: true,
|
|
594
|
+
showFooter: true,
|
|
595
|
+
resize: true,
|
|
596
|
+
escClosable: true,
|
|
597
|
+
destroyOnClose: true,
|
|
598
|
+
'onUpdate:modelValue'(value) {
|
|
599
|
+
customStore.visible = value;
|
|
600
|
+
}
|
|
601
|
+
}, {
|
|
602
|
+
default: () => {
|
|
603
|
+
return h('div', {
|
|
604
|
+
ref: bodyElemRef,
|
|
605
|
+
class: 'vxe-table-custom-popup--body'
|
|
599
606
|
}, [
|
|
600
|
-
h('
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
width: '80px'
|
|
606
|
-
}
|
|
607
|
-
})
|
|
608
|
-
: createCommentVNode(),
|
|
609
|
-
allowSort
|
|
610
|
-
? h('col', {
|
|
611
|
-
style: {
|
|
612
|
-
width: '80px'
|
|
613
|
-
}
|
|
614
|
-
})
|
|
615
|
-
: createCommentVNode(),
|
|
616
|
-
h('col', {
|
|
617
|
-
style: {
|
|
618
|
-
minWidth: '120px'
|
|
619
|
-
}
|
|
620
|
-
}),
|
|
621
|
-
allowResizable
|
|
622
|
-
? h('col', {
|
|
623
|
-
style: {
|
|
624
|
-
width: '140px'
|
|
625
|
-
}
|
|
626
|
-
})
|
|
627
|
-
: createCommentVNode(),
|
|
628
|
-
allowFixed
|
|
629
|
-
? h('col', {
|
|
630
|
-
style: {
|
|
631
|
-
width: '200px'
|
|
632
|
-
}
|
|
633
|
-
})
|
|
634
|
-
: createCommentVNode()
|
|
635
|
-
]),
|
|
636
|
-
h('thead', {}, [
|
|
637
|
-
h('tr', {}, [
|
|
607
|
+
h('div', {
|
|
608
|
+
class: 'vxe-table-custom-popup--table-wrapper'
|
|
609
|
+
}, [
|
|
610
|
+
h('table', {}, [
|
|
611
|
+
h('colgroup', {}, [
|
|
638
612
|
allowVisible
|
|
639
|
-
? h('
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
}],
|
|
645
|
-
title: getI18n('vxe.table.allTitle'),
|
|
646
|
-
onClick: allCustomEvent
|
|
647
|
-
}, [
|
|
648
|
-
h('span', {
|
|
649
|
-
class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
|
|
650
|
-
}),
|
|
651
|
-
h('span', {
|
|
652
|
-
class: 'vxe-checkbox--label'
|
|
653
|
-
}, getI18n('vxe.toolbar.customAll'))
|
|
654
|
-
])
|
|
655
|
-
])
|
|
613
|
+
? h('col', {
|
|
614
|
+
style: {
|
|
615
|
+
width: '80px'
|
|
616
|
+
}
|
|
617
|
+
})
|
|
656
618
|
: createCommentVNode(),
|
|
657
619
|
allowSort
|
|
658
|
-
? h('
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
enterable: true,
|
|
664
|
-
content: getI18n('vxe.custom.setting.sortHelpTip')
|
|
665
|
-
}, {
|
|
666
|
-
default: () => {
|
|
667
|
-
return h('i', {
|
|
668
|
-
class: 'vxe-table-custom-popup--table-sort-help-icon vxe-icon-question-circle-fill'
|
|
669
|
-
});
|
|
670
|
-
}
|
|
671
|
-
})
|
|
672
|
-
])
|
|
620
|
+
? h('col', {
|
|
621
|
+
style: {
|
|
622
|
+
width: '80px'
|
|
623
|
+
}
|
|
624
|
+
})
|
|
673
625
|
: createCommentVNode(),
|
|
674
|
-
h('
|
|
626
|
+
h('col', {
|
|
627
|
+
style: {
|
|
628
|
+
minWidth: '120px'
|
|
629
|
+
}
|
|
630
|
+
}),
|
|
675
631
|
allowResizable
|
|
676
|
-
? h('
|
|
632
|
+
? h('col', {
|
|
633
|
+
style: {
|
|
634
|
+
width: '140px'
|
|
635
|
+
}
|
|
636
|
+
})
|
|
677
637
|
: createCommentVNode(),
|
|
678
638
|
allowFixed
|
|
679
|
-
? h('
|
|
639
|
+
? h('col', {
|
|
640
|
+
style: {
|
|
641
|
+
width: '200px'
|
|
642
|
+
}
|
|
643
|
+
})
|
|
680
644
|
: createCommentVNode()
|
|
681
|
-
])
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
645
|
+
]),
|
|
646
|
+
h('thead', {}, [
|
|
647
|
+
h('tr', {}, [
|
|
648
|
+
allowVisible
|
|
649
|
+
? h('th', {}, [
|
|
650
|
+
h('div', {
|
|
651
|
+
class: ['vxe-table-custom--checkbox-option', {
|
|
652
|
+
'is--checked': isAllChecked,
|
|
653
|
+
'is--indeterminate': isAllIndeterminate
|
|
654
|
+
}],
|
|
655
|
+
title: getI18n('vxe.table.allTitle'),
|
|
656
|
+
onClick: allCustomEvent
|
|
657
|
+
}, [
|
|
658
|
+
h('span', {
|
|
659
|
+
class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
|
|
660
|
+
}),
|
|
661
|
+
h('span', {
|
|
662
|
+
class: 'vxe-checkbox--label'
|
|
663
|
+
}, getI18n('vxe.toolbar.customAll'))
|
|
664
|
+
])
|
|
665
|
+
])
|
|
666
|
+
: createCommentVNode(),
|
|
667
|
+
allowSort
|
|
668
|
+
? h('th', {}, [
|
|
669
|
+
h('span', {
|
|
670
|
+
class: 'vxe-table-custom-popup--table-sort-help-title'
|
|
671
|
+
}, getI18n('vxe.custom.setting.colSort')),
|
|
672
|
+
VxeUITooltipComponent
|
|
673
|
+
? h(VxeUITooltipComponent, {
|
|
674
|
+
enterable: true,
|
|
675
|
+
content: getI18n('vxe.custom.setting.sortHelpTip')
|
|
676
|
+
}, {
|
|
677
|
+
default: () => {
|
|
678
|
+
return h('i', {
|
|
679
|
+
class: 'vxe-table-custom-popup--table-sort-help-icon vxe-icon-question-circle-fill'
|
|
680
|
+
});
|
|
681
|
+
}
|
|
682
|
+
})
|
|
683
|
+
: createCommentVNode()
|
|
684
|
+
])
|
|
685
|
+
: createCommentVNode(),
|
|
686
|
+
h('th', {}, getI18n('vxe.custom.setting.colTitle')),
|
|
687
|
+
allowResizable
|
|
688
|
+
? h('th', {}, getI18n('vxe.custom.setting.colResizable'))
|
|
689
|
+
: createCommentVNode(),
|
|
690
|
+
allowFixed
|
|
691
|
+
? h('th', {}, getI18n('vxe.custom.setting.colFixed', [columnOpts.maxFixedSize || 0]))
|
|
692
|
+
: createCommentVNode()
|
|
693
|
+
])
|
|
694
|
+
]),
|
|
695
|
+
h(TransitionGroup, {
|
|
696
|
+
class: 'vxe-table-custom--body',
|
|
697
|
+
tag: 'tbody',
|
|
698
|
+
name: 'vxe-table-custom--list'
|
|
699
|
+
}, {
|
|
700
|
+
default: () => trVNs
|
|
701
|
+
})
|
|
702
|
+
])
|
|
703
|
+
]),
|
|
704
|
+
h('div', {
|
|
705
|
+
ref: dragHintElemRef,
|
|
706
|
+
class: 'vxe-table-custom-popup--drag-hint'
|
|
707
|
+
}, getI18n('vxe.custom.cstmDragTarget', [dragColumn.value ? dragColumn.value.getTitle() : '']))
|
|
708
|
+
]);
|
|
709
|
+
},
|
|
710
|
+
footer: () => {
|
|
711
|
+
return h('div', {
|
|
712
|
+
class: 'vxe-table-custom-popup--footer'
|
|
713
|
+
}, [
|
|
714
|
+
VxeUIButtonComponent
|
|
715
|
+
? h(VxeUIButtonComponent, {
|
|
716
|
+
content: customOpts.resetButtonText || getI18n('vxe.custom.cstmRestore'),
|
|
717
|
+
onClick: resetCustomEvent
|
|
689
718
|
})
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
onClick: cancelCustomEvent
|
|
709
|
-
}),
|
|
710
|
-
h(resolveComponent('vxe-button'), {
|
|
711
|
-
status: 'primary',
|
|
712
|
-
content: customOpts.confirmButtonText || getI18n('vxe.custom.cstmConfirm'),
|
|
713
|
-
onClick: confirmCustomEvent
|
|
714
|
-
})
|
|
715
|
-
]);
|
|
716
|
-
}
|
|
717
|
-
});
|
|
719
|
+
: createCommentVNode(),
|
|
720
|
+
VxeUIButtonComponent
|
|
721
|
+
? h(VxeUIButtonComponent, {
|
|
722
|
+
content: customOpts.resetButtonText || getI18n('vxe.custom.cstmCancel'),
|
|
723
|
+
onClick: cancelCustomEvent
|
|
724
|
+
})
|
|
725
|
+
: createCommentVNode(),
|
|
726
|
+
VxeUIButtonComponent
|
|
727
|
+
? h(VxeUIButtonComponent, {
|
|
728
|
+
status: 'primary',
|
|
729
|
+
content: customOpts.confirmButtonText || getI18n('vxe.custom.cstmConfirm'),
|
|
730
|
+
onClick: confirmCustomEvent
|
|
731
|
+
})
|
|
732
|
+
: createCommentVNode()
|
|
733
|
+
]);
|
|
734
|
+
}
|
|
735
|
+
})
|
|
736
|
+
: createCommentVNode();
|
|
718
737
|
};
|
|
719
738
|
const renderVN = () => {
|
|
720
739
|
const customOpts = computeCustomOpts.value;
|