@v-c/table 1.0.4 → 1.0.6
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/dist/Table.js +250 -247
- package/dist/VirtualTable/BodyGrid.js +1 -1
- package/package.json +2 -2
package/dist/Table.js
CHANGED
|
@@ -25,7 +25,7 @@ import { getDOM } from "@v-c/util/dist/Dom/findDOMNode";
|
|
|
25
25
|
import { getTargetScrollBarSize } from "@v-c/util/dist/getScrollBarSize";
|
|
26
26
|
import isEqual from "@v-c/util/dist/isEqual";
|
|
27
27
|
import pickAttrs from "@v-c/util/dist/pickAttrs";
|
|
28
|
-
import { filterEmpty } from "@v-c/util/dist/props-util";
|
|
28
|
+
import { filterEmpty, getAttrStyleAndClass } from "@v-c/util/dist/props-util";
|
|
29
29
|
//#region src/Table.tsx
|
|
30
30
|
/**
|
|
31
31
|
* Feature:
|
|
@@ -306,7 +306,6 @@ var ImmutableTable = /* @__PURE__ */ defineComponent((props, { attrs, slots, exp
|
|
|
306
306
|
if (typeof emptyText === "function") return emptyText();
|
|
307
307
|
return emptyText;
|
|
308
308
|
});
|
|
309
|
-
const dataProps = pickAttrs(attrs, { data: true });
|
|
310
309
|
const ariaProps = pickAttrs(attrs, { aria: true });
|
|
311
310
|
const fixedInfoList = useFixedInfo(flattenColumns, mergedStickyOffsets);
|
|
312
311
|
const tableContext = reactive({});
|
|
@@ -362,6 +361,7 @@ var ImmutableTable = /* @__PURE__ */ defineComponent((props, { attrs, slots, exp
|
|
|
362
361
|
return () => {
|
|
363
362
|
let _slot, _slot2;
|
|
364
363
|
slotChildren.value = slots.default?.();
|
|
364
|
+
const { className: attrClassName, style: attrStyle, restAttrs } = getAttrStyleAndClass(attrs);
|
|
365
365
|
const renderFixedHeaderTable = (fixedHolderPassProps) => {
|
|
366
366
|
return createVNode(Fragment, null, [createVNode(Header, fixedHolderPassProps, null), fixFooter.value === "top" && createVNode(Footer, fixedHolderPassProps, { default: () => [summaryNode.value] })]);
|
|
367
367
|
};
|
|
@@ -484,11 +484,11 @@ var ImmutableTable = /* @__PURE__ */ defineComponent((props, { attrs, slots, exp
|
|
|
484
484
|
[`${mergedPrefixCls.value}-scroll-horizontal`]: horizonScroll.value,
|
|
485
485
|
[`${mergedPrefixCls.value}-has-fix-start`]: flattenColumns.value[0]?.fixed,
|
|
486
486
|
[`${mergedPrefixCls.value}-has-fix-end`]: flattenColumns.value[flattenColumns.value.length - 1]?.fixed === "end"
|
|
487
|
-
}),
|
|
488
|
-
"style": tableStyle,
|
|
487
|
+
}, attrClassName),
|
|
488
|
+
"style": [tableStyle, attrStyle],
|
|
489
489
|
"id": props.id,
|
|
490
490
|
"ref": fullTableRef
|
|
491
|
-
},
|
|
491
|
+
}, restAttrs), [
|
|
492
492
|
props.title && createVNode(Panel, {
|
|
493
493
|
"className": clsx(`${mergedPrefixCls.value}-title`, props.classNames?.title),
|
|
494
494
|
"style": props.styles?.title
|
|
@@ -506,248 +506,251 @@ var ImmutableTable = /* @__PURE__ */ defineComponent((props, { attrs, slots, exp
|
|
|
506
506
|
if (horizonScroll.value) return createVNode(ResizeObserver, { "onResize": ({ offsetWidth }) => onFullTableResize(offsetWidth) }, _isSlot(fullTable) ? fullTable : { default: () => [fullTable] });
|
|
507
507
|
return fullTable;
|
|
508
508
|
};
|
|
509
|
-
}, {
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
}
|
|
509
|
+
}, {
|
|
510
|
+
props: /* @__PURE__ */ mergeDefaults({
|
|
511
|
+
prefixCls: {
|
|
512
|
+
type: String,
|
|
513
|
+
required: false,
|
|
514
|
+
default: void 0
|
|
515
|
+
},
|
|
516
|
+
className: {
|
|
517
|
+
type: String,
|
|
518
|
+
required: false,
|
|
519
|
+
default: void 0
|
|
520
|
+
},
|
|
521
|
+
style: {
|
|
522
|
+
type: Object,
|
|
523
|
+
required: false,
|
|
524
|
+
default: void 0
|
|
525
|
+
},
|
|
526
|
+
classNames: {
|
|
527
|
+
type: Object,
|
|
528
|
+
required: false,
|
|
529
|
+
default: void 0
|
|
530
|
+
},
|
|
531
|
+
styles: {
|
|
532
|
+
type: Object,
|
|
533
|
+
required: false,
|
|
534
|
+
default: void 0
|
|
535
|
+
},
|
|
536
|
+
data: {
|
|
537
|
+
type: Array,
|
|
538
|
+
required: false,
|
|
539
|
+
default: void 0
|
|
540
|
+
},
|
|
541
|
+
columns: {
|
|
542
|
+
type: Array,
|
|
543
|
+
required: false,
|
|
544
|
+
default: void 0
|
|
545
|
+
},
|
|
546
|
+
rowKey: {
|
|
547
|
+
type: [String, Function],
|
|
548
|
+
required: false,
|
|
549
|
+
default: void 0
|
|
550
|
+
},
|
|
551
|
+
tableLayout: {
|
|
552
|
+
type: String,
|
|
553
|
+
required: false,
|
|
554
|
+
default: void 0
|
|
555
|
+
},
|
|
556
|
+
scroll: {
|
|
557
|
+
type: Object,
|
|
558
|
+
required: false,
|
|
559
|
+
default: void 0
|
|
560
|
+
},
|
|
561
|
+
expandable: {
|
|
562
|
+
type: Object,
|
|
563
|
+
required: false,
|
|
564
|
+
default: void 0
|
|
565
|
+
},
|
|
566
|
+
indentSize: {
|
|
567
|
+
type: Number,
|
|
568
|
+
required: false,
|
|
569
|
+
default: void 0
|
|
570
|
+
},
|
|
571
|
+
rowClassName: {
|
|
572
|
+
type: [String, Function],
|
|
573
|
+
required: false,
|
|
574
|
+
default: void 0
|
|
575
|
+
},
|
|
576
|
+
title: {
|
|
577
|
+
type: Function,
|
|
578
|
+
required: false,
|
|
579
|
+
default: void 0
|
|
580
|
+
},
|
|
581
|
+
footer: {
|
|
582
|
+
type: Function,
|
|
583
|
+
required: false,
|
|
584
|
+
default: void 0
|
|
585
|
+
},
|
|
586
|
+
summary: {
|
|
587
|
+
type: Function,
|
|
588
|
+
required: false,
|
|
589
|
+
default: void 0
|
|
590
|
+
},
|
|
591
|
+
headerCell: {
|
|
592
|
+
type: Function,
|
|
593
|
+
required: false,
|
|
594
|
+
default: void 0
|
|
595
|
+
},
|
|
596
|
+
bodyCell: {
|
|
597
|
+
type: Function,
|
|
598
|
+
required: false,
|
|
599
|
+
default: void 0
|
|
600
|
+
},
|
|
601
|
+
caption: {
|
|
602
|
+
required: false,
|
|
603
|
+
default: void 0
|
|
604
|
+
},
|
|
605
|
+
id: {
|
|
606
|
+
type: String,
|
|
607
|
+
required: false,
|
|
608
|
+
default: void 0
|
|
609
|
+
},
|
|
610
|
+
showHeader: {
|
|
611
|
+
type: Boolean,
|
|
612
|
+
required: false,
|
|
613
|
+
default: void 0
|
|
614
|
+
},
|
|
615
|
+
components: {
|
|
616
|
+
type: Object,
|
|
617
|
+
required: false,
|
|
618
|
+
default: void 0
|
|
619
|
+
},
|
|
620
|
+
onRow: {
|
|
621
|
+
type: Function,
|
|
622
|
+
required: false,
|
|
623
|
+
default: void 0
|
|
624
|
+
},
|
|
625
|
+
onHeaderRow: {
|
|
626
|
+
type: Function,
|
|
627
|
+
required: false,
|
|
628
|
+
default: void 0
|
|
629
|
+
},
|
|
630
|
+
emptyText: {
|
|
631
|
+
type: Function,
|
|
632
|
+
required: false,
|
|
633
|
+
skipCheck: true,
|
|
634
|
+
default: void 0
|
|
635
|
+
},
|
|
636
|
+
direction: {
|
|
637
|
+
type: String,
|
|
638
|
+
required: false,
|
|
639
|
+
default: void 0
|
|
640
|
+
},
|
|
641
|
+
sticky: {
|
|
642
|
+
type: [Boolean, Object],
|
|
643
|
+
required: false,
|
|
644
|
+
default: void 0
|
|
645
|
+
},
|
|
646
|
+
rowHoverable: {
|
|
647
|
+
type: Boolean,
|
|
648
|
+
required: false,
|
|
649
|
+
default: void 0
|
|
650
|
+
},
|
|
651
|
+
onScroll: {
|
|
652
|
+
type: Function,
|
|
653
|
+
required: false,
|
|
654
|
+
default: void 0
|
|
655
|
+
},
|
|
656
|
+
internalHooks: {
|
|
657
|
+
type: String,
|
|
658
|
+
required: false,
|
|
659
|
+
default: void 0
|
|
660
|
+
},
|
|
661
|
+
transformColumns: {
|
|
662
|
+
type: Function,
|
|
663
|
+
required: false,
|
|
664
|
+
default: void 0
|
|
665
|
+
},
|
|
666
|
+
tailor: {
|
|
667
|
+
type: Boolean,
|
|
668
|
+
required: false,
|
|
669
|
+
default: void 0
|
|
670
|
+
},
|
|
671
|
+
getContainerWidth: {
|
|
672
|
+
type: Function,
|
|
673
|
+
required: false,
|
|
674
|
+
default: void 0
|
|
675
|
+
},
|
|
676
|
+
internalRefs: {
|
|
677
|
+
type: Object,
|
|
678
|
+
required: false,
|
|
679
|
+
default: void 0
|
|
680
|
+
},
|
|
681
|
+
measureRowRender: {
|
|
682
|
+
type: Function,
|
|
683
|
+
required: false,
|
|
684
|
+
default: void 0
|
|
685
|
+
},
|
|
686
|
+
getPopupContainer: {
|
|
687
|
+
type: Function,
|
|
688
|
+
required: false,
|
|
689
|
+
default: void 0
|
|
690
|
+
},
|
|
691
|
+
"onUpdate:expandedRowKeys": {
|
|
692
|
+
type: Function,
|
|
693
|
+
required: false,
|
|
694
|
+
default: void 0
|
|
695
|
+
},
|
|
696
|
+
expandedRowKeys: {
|
|
697
|
+
type: Array,
|
|
698
|
+
required: false,
|
|
699
|
+
default: void 0
|
|
700
|
+
},
|
|
701
|
+
defaultExpandedRowKeys: {
|
|
702
|
+
type: Array,
|
|
703
|
+
required: false,
|
|
704
|
+
default: void 0
|
|
705
|
+
},
|
|
706
|
+
expandedRowRender: {
|
|
707
|
+
type: Function,
|
|
708
|
+
required: false,
|
|
709
|
+
default: void 0
|
|
710
|
+
},
|
|
711
|
+
expandRowByClick: {
|
|
712
|
+
type: Boolean,
|
|
713
|
+
required: false,
|
|
714
|
+
default: void 0
|
|
715
|
+
},
|
|
716
|
+
expandIcon: {
|
|
717
|
+
type: Function,
|
|
718
|
+
required: false,
|
|
719
|
+
default: void 0
|
|
720
|
+
},
|
|
721
|
+
onExpand: {
|
|
722
|
+
type: Function,
|
|
723
|
+
required: false,
|
|
724
|
+
default: void 0
|
|
725
|
+
},
|
|
726
|
+
onExpandedRowsChange: {
|
|
727
|
+
type: Function,
|
|
728
|
+
required: false,
|
|
729
|
+
default: void 0
|
|
730
|
+
},
|
|
731
|
+
defaultExpandAllRows: {
|
|
732
|
+
type: Boolean,
|
|
733
|
+
required: false,
|
|
734
|
+
default: void 0
|
|
735
|
+
},
|
|
736
|
+
expandIconColumnIndex: {
|
|
737
|
+
type: Number,
|
|
738
|
+
required: false,
|
|
739
|
+
default: void 0
|
|
740
|
+
},
|
|
741
|
+
expandedRowClassName: {
|
|
742
|
+
type: Function,
|
|
743
|
+
required: false,
|
|
744
|
+
default: void 0
|
|
745
|
+
},
|
|
746
|
+
childrenColumnName: {
|
|
747
|
+
type: String,
|
|
748
|
+
required: false,
|
|
749
|
+
default: void 0
|
|
750
|
+
}
|
|
751
|
+
}, defaults),
|
|
752
|
+
inheritAttrs: false
|
|
753
|
+
});
|
|
751
754
|
ImmutableTable.EXPAND_COLUMN = EXPAND_COLUMN;
|
|
752
755
|
ImmutableTable.INTERNAL_HOOKS = INTERNAL_HOOKS;
|
|
753
756
|
ImmutableTable.Column = Column;
|
|
@@ -109,7 +109,7 @@ var BodyGrid = /* @__PURE__ */ defineComponent({
|
|
|
109
109
|
scrollTo: (config) => {
|
|
110
110
|
if (!listRef.value) return;
|
|
111
111
|
const { align, offset, ...restConfig } = config || {};
|
|
112
|
-
const virtualAlign = ALIGN_MAP[align] ?? (offset ? "top" : "auto");
|
|
112
|
+
const virtualAlign = (align ? ALIGN_MAP[align] : void 0) ?? (offset ? "top" : "auto");
|
|
113
113
|
listRef.value.scrollTo({
|
|
114
114
|
...restConfig,
|
|
115
115
|
offset,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@v-c/table",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.6",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@v-c/resize-observer": "^1.0.8",
|
|
24
24
|
"@v-c/util": "^1.0.19",
|
|
25
|
-
"@v-c/virtual-list": "^1.0.
|
|
25
|
+
"@v-c/virtual-list": "^1.0.7"
|
|
26
26
|
},
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"access": "public"
|