@semcore/data-table 16.4.3 → 16.4.4-prerelease.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/CHANGELOG.md +8 -0
- package/lib/cjs/components/AccordionRows/AccordionRows.js +55 -53
- package/lib/cjs/components/AccordionRows/AccordionRows.js.map +1 -1
- package/lib/cjs/components/Body/Body.js +51 -51
- package/lib/cjs/components/Body/Cell.js +70 -53
- package/lib/cjs/components/Body/Cell.js.map +1 -1
- package/lib/cjs/components/Body/LimitOverlay.js +51 -51
- package/lib/cjs/components/Body/Row.js +56 -60
- package/lib/cjs/components/Body/Row.js.map +1 -1
- package/lib/cjs/components/DataTable/DataTable.js +124 -102
- package/lib/cjs/components/DataTable/DataTable.js.map +1 -1
- package/lib/cjs/components/DataTable/DataTable.types.js.map +1 -1
- package/lib/cjs/components/Head/Column.js +55 -36
- package/lib/cjs/components/Head/Column.js.map +1 -1
- package/lib/cjs/components/Head/Group.js +36 -36
- package/lib/cjs/components/Head/Head.js +36 -36
- package/lib/es6/components/AccordionRows/AccordionRows.js +55 -53
- package/lib/es6/components/AccordionRows/AccordionRows.js.map +1 -1
- package/lib/es6/components/Body/Body.js +51 -51
- package/lib/es6/components/Body/Cell.js +70 -53
- package/lib/es6/components/Body/Cell.js.map +1 -1
- package/lib/es6/components/Body/LimitOverlay.js +51 -51
- package/lib/es6/components/Body/Row.js +56 -60
- package/lib/es6/components/Body/Row.js.map +1 -1
- package/lib/es6/components/DataTable/DataTable.js +124 -102
- package/lib/es6/components/DataTable/DataTable.js.map +1 -1
- package/lib/es6/components/DataTable/DataTable.types.js.map +1 -1
- package/lib/es6/components/Head/Column.js +55 -36
- package/lib/es6/components/Head/Column.js.map +1 -1
- package/lib/es6/components/Head/Group.js +36 -36
- package/lib/es6/components/Head/Head.js +36 -36
- package/lib/esm/components/AccordionRows/AccordionRows.mjs +55 -54
- package/lib/esm/components/Body/Body.mjs +52 -52
- package/lib/esm/components/Body/Cell.mjs +70 -54
- package/lib/esm/components/Body/LimitOverlay.mjs +52 -52
- package/lib/esm/components/Body/Row.mjs +56 -61
- package/lib/esm/components/DataTable/DataTable.mjs +69 -48
- package/lib/esm/components/Head/Column.mjs +56 -37
- package/lib/esm/components/Head/Group.mjs +37 -37
- package/lib/esm/components/Head/Head.mjs +37 -37
- package/lib/types/components/AccordionRows/AccordionRows.d.ts +2 -0
- package/lib/types/components/DataTable/DataTable.types.d.ts +4 -0
- package/package.json +11 -11
|
@@ -30,38 +30,38 @@ var _Body = require("../Body/Body");
|
|
|
30
30
|
var _MergedCells = require("../Body/MergedCells");
|
|
31
31
|
var _Head = require("../Head/Head");
|
|
32
32
|
/*!__reshadow-styles__:"./dataTable.shadow.css"*/
|
|
33
|
-
var style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".
|
|
33
|
+
var style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SDataTable_z1jx4_gg_{display:grid;align-items:start;min-width:-moz-fit-content;min-width:fit-content;grid-auto-rows:min-content}.___SDataTable_z1jx4_gg_.__isDataEmpty_z1jx4_gg_{display:block;align-items:initial;min-width:initial}.___SDataTable_z1jx4_gg_.__gridTemplateColumns_z1jx4_gg_{grid-template-columns:var(--gridTemplateColumns_z1jx4)}.___SDataTable_z1jx4_gg_.__gridTemplateAreas_z1jx4_gg_{grid-template-areas:var(--gridTemplateAreas_z1jx4)}.___SDataTable_z1jx4_gg_.__gridTemplateRows_z1jx4_gg_{grid-template-rows:var(--gridTemplateRows_z1jx4)}", /*__inner_css_end__*/"z1jx4_gg_"),
|
|
34
34
|
/*__reshadow_css_end__*/
|
|
35
35
|
{
|
|
36
|
-
"__SDataTable": "
|
|
37
|
-
"_isDataEmpty": "
|
|
38
|
-
"_gridTemplateColumns": "
|
|
39
|
-
"--gridTemplateColumns": "--
|
|
40
|
-
"_gridTemplateAreas": "
|
|
41
|
-
"--gridTemplateAreas": "--
|
|
42
|
-
"_gridTemplateRows": "
|
|
43
|
-
"--gridTemplateRows": "--
|
|
36
|
+
"__SDataTable": "___SDataTable_z1jx4_gg_",
|
|
37
|
+
"_isDataEmpty": "__isDataEmpty_z1jx4_gg_",
|
|
38
|
+
"_gridTemplateColumns": "__gridTemplateColumns_z1jx4_gg_",
|
|
39
|
+
"--gridTemplateColumns": "--gridTemplateColumns_z1jx4",
|
|
40
|
+
"_gridTemplateAreas": "__gridTemplateAreas_z1jx4_gg_",
|
|
41
|
+
"--gridTemplateAreas": "--gridTemplateAreas_z1jx4",
|
|
42
|
+
"_gridTemplateRows": "__gridTemplateRows_z1jx4_gg_",
|
|
43
|
+
"--gridTemplateRows": "--gridTemplateRows_z1jx4"
|
|
44
44
|
});
|
|
45
45
|
/*!__reshadow-styles__:"../../style/scroll-shadows.shadow.css"*/
|
|
46
|
-
var scrollStyles = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".
|
|
46
|
+
var scrollStyles = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SScrollArea_ntjfu_gg_{width:-moz-fit-content;width:fit-content}.___SScrollArea_ntjfu_gg_ .___SContainer_ntjfu_gg_{overflow:visible;overflow:initial}.___SScrollArea_ntjfu_gg_ .___SContainer_ntjfu_gg_._scrollDirection_both_ntjfu_gg_{overflow:auto}.___SScrollArea_ntjfu_gg_ .___SContainer_ntjfu_gg_._scrollDirection_both_ntjfu_gg_.__loading_ntjfu_gg_,.___SScrollArea_ntjfu_gg_ .___SContainer_ntjfu_gg_._scrollDirection_horizontal_ntjfu_gg_.__loading_ntjfu_gg_,.___SScrollArea_ntjfu_gg_ .___SContainer_ntjfu_gg_._scrollDirection_vertical_ntjfu_gg_.__loading_ntjfu_gg_{overflow:hidden}.___SScrollArea_ntjfu_gg_ .___SContainer_ntjfu_gg_._scrollDirection_horizontal_ntjfu_gg_{overflow-x:auto;overflow-y:initial}.___SScrollArea_ntjfu_gg_ .___SContainer_ntjfu_gg_._scrollDirection_vertical_ntjfu_gg_{overflow-x:initial;overflow-y:auto}.___SScrollArea_ntjfu_gg_ .___SContainer_ntjfu_gg_.__headerHeight_ntjfu_gg_{scroll-padding-top:var(--headerHeight_ntjfu)}.___SScrollArea_ntjfu_gg_ .___SContainer_ntjfu_gg_.__leftScrollPadding_ntjfu_gg_{scroll-padding-left:var(--leftScrollPadding_ntjfu)}.___SScrollArea_ntjfu_gg_ .___SContainer_ntjfu_gg_.__rightScrollPadding_ntjfu_gg_{scroll-padding-right:var(--rightScrollPadding_ntjfu)}.___SScrollArea_ntjfu_gg_ .___SShadowHorizontal_ntjfu_gg_::before,.___SScrollArea_ntjfu_gg_ .___SShadowHorizontal_ntjfu_gg_:after,.___SScrollArea_ntjfu_gg_ .___SShadowVertical_ntjfu_gg_::after{z-index:20}.___SScrollArea_ntjfu_gg_ .___SShadowHorizontal_ntjfu_gg_.__leftOffset_ntjfu_gg_::before,.___SScrollArea_ntjfu_gg_ .___SShadowHorizontal_ntjfu_gg_.__rightOffset_ntjfu_gg_::after,.___SScrollArea_ntjfu_gg_ .___SShadowVertical_ntjfu_gg_::before{display:none}", /*__inner_css_end__*/"ntjfu_gg_"),
|
|
47
47
|
/*__reshadow_css_end__*/
|
|
48
48
|
{
|
|
49
|
-
"__SScrollArea": "
|
|
50
|
-
"__SContainer": "
|
|
51
|
-
"_scrollDirection_both": "
|
|
52
|
-
"_loading": "
|
|
53
|
-
"_scrollDirection_horizontal": "
|
|
54
|
-
"_scrollDirection_vertical": "
|
|
55
|
-
"_headerHeight": "
|
|
56
|
-
"--headerHeight": "--
|
|
57
|
-
"_leftScrollPadding": "
|
|
58
|
-
"--leftScrollPadding": "--
|
|
59
|
-
"_rightScrollPadding": "
|
|
60
|
-
"--rightScrollPadding": "--
|
|
61
|
-
"__SShadowVertical": "
|
|
62
|
-
"__SShadowHorizontal": "
|
|
63
|
-
"_leftOffset": "
|
|
64
|
-
"_rightOffset": "
|
|
49
|
+
"__SScrollArea": "___SScrollArea_ntjfu_gg_",
|
|
50
|
+
"__SContainer": "___SContainer_ntjfu_gg_",
|
|
51
|
+
"_scrollDirection_both": "_scrollDirection_both_ntjfu_gg_",
|
|
52
|
+
"_loading": "__loading_ntjfu_gg_",
|
|
53
|
+
"_scrollDirection_horizontal": "_scrollDirection_horizontal_ntjfu_gg_",
|
|
54
|
+
"_scrollDirection_vertical": "_scrollDirection_vertical_ntjfu_gg_",
|
|
55
|
+
"_headerHeight": "__headerHeight_ntjfu_gg_",
|
|
56
|
+
"--headerHeight": "--headerHeight_ntjfu",
|
|
57
|
+
"_leftScrollPadding": "__leftScrollPadding_ntjfu_gg_",
|
|
58
|
+
"--leftScrollPadding": "--leftScrollPadding_ntjfu",
|
|
59
|
+
"_rightScrollPadding": "__rightScrollPadding_ntjfu_gg_",
|
|
60
|
+
"--rightScrollPadding": "--rightScrollPadding_ntjfu",
|
|
61
|
+
"__SShadowVertical": "___SShadowVertical_ntjfu_gg_",
|
|
62
|
+
"__SShadowHorizontal": "___SShadowHorizontal_ntjfu_gg_",
|
|
63
|
+
"_leftOffset": "__leftOffset_ntjfu_gg_",
|
|
64
|
+
"_rightOffset": "__rightOffset_ntjfu_gg_"
|
|
65
65
|
});
|
|
66
66
|
var ACCORDION = exports.ACCORDION = Symbol('accordion');
|
|
67
67
|
var ROW_GROUP = exports.ROW_GROUP = Symbol('ROW_GROUP');
|
|
@@ -438,11 +438,13 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
438
438
|
});
|
|
439
439
|
_this.changeFocusCell(-1, cellIndex === -1 ? 0 : cellIndex, 'up');
|
|
440
440
|
});
|
|
441
|
-
(0, _defineProperty2["default"])(_this, "handleContainerResizeEnd", function () {
|
|
441
|
+
(0, _defineProperty2["default"])(_this, "handleContainerResizeEnd", function (entries, observer) {
|
|
442
|
+
var _this$asProps$onResiz, _this$asProps3;
|
|
442
443
|
if (_this.containerResizeEndTimeoutId) {
|
|
443
444
|
clearTimeout(_this.containerResizeEndTimeoutId);
|
|
444
445
|
}
|
|
445
446
|
_this.containerResizeEndTimeoutId = setTimeout(_this.calculateVerticalShadow, 0);
|
|
447
|
+
(_this$asProps$onResiz = (_this$asProps3 = _this.asProps).onResize) === null || _this$asProps$onResiz === void 0 || _this$asProps$onResiz.call(_this$asProps3, entries, observer);
|
|
446
448
|
});
|
|
447
449
|
(0, _defineProperty2["default"])(_this, "getScrollOffsetValue", function () {
|
|
448
450
|
if (!_this.headerRef.current) {
|
|
@@ -523,9 +525,9 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
523
525
|
key: "componentDidMount",
|
|
524
526
|
value: function componentDidMount() {
|
|
525
527
|
var _this2 = this;
|
|
526
|
-
var _this$
|
|
527
|
-
headerProps = _this$
|
|
528
|
-
loading = _this$
|
|
528
|
+
var _this$asProps4 = this.asProps,
|
|
529
|
+
headerProps = _this$asProps4.headerProps,
|
|
530
|
+
loading = _this$asProps4.loading;
|
|
529
531
|
if (headerProps !== null && headerProps !== void 0 && headerProps.sticky && !headerProps.h || loading || this.hasFixedColumn) {
|
|
530
532
|
requestAnimationFrame(function () {
|
|
531
533
|
_this2.forceUpdate();
|
|
@@ -539,10 +541,12 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
539
541
|
}, {
|
|
540
542
|
key: "componentDidUpdate",
|
|
541
543
|
value: function componentDidUpdate(prevProps) {
|
|
542
|
-
var
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
544
|
+
var _this3 = this;
|
|
545
|
+
var _this$asProps5 = this.asProps,
|
|
546
|
+
data = _this$asProps5.data,
|
|
547
|
+
selectedRows = _this$asProps5.selectedRows,
|
|
548
|
+
columns = _this$asProps5.columns,
|
|
549
|
+
loading = _this$asProps5.loading;
|
|
546
550
|
if (prevProps.columns !== columns) {
|
|
547
551
|
var cols = this.calculateColumnsFromConfig();
|
|
548
552
|
this.columns = cols[0];
|
|
@@ -555,12 +559,30 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
555
559
|
}
|
|
556
560
|
}
|
|
557
561
|
if (prevProps.selectedRows !== selectedRows && selectedRows !== undefined) {
|
|
558
|
-
|
|
562
|
+
var selectedRowsSet = new Set(selectedRows);
|
|
563
|
+
var allChecked = [];
|
|
564
|
+
var allUnchecked = [];
|
|
565
|
+
this.flatRows.forEach(function (row) {
|
|
566
|
+
if (selectedRowsSet.has(row[UNIQ_ROW_KEY])) {
|
|
567
|
+
allChecked.push(row[UNIQ_ROW_KEY]);
|
|
568
|
+
} else {
|
|
569
|
+
allUnchecked.push(row[UNIQ_ROW_KEY]);
|
|
570
|
+
}
|
|
571
|
+
});
|
|
572
|
+
if (allChecked.length === data.length) {
|
|
559
573
|
this.setSelectAllMessage(true);
|
|
560
|
-
} else if (
|
|
574
|
+
} else if (allUnchecked.length === data.length) {
|
|
561
575
|
this.setSelectAllMessage(false);
|
|
562
576
|
}
|
|
563
577
|
}
|
|
578
|
+
if (prevProps.loading !== loading) {
|
|
579
|
+
setTimeout(function () {
|
|
580
|
+
if (document.activeElement === document.body || _this3.tableContainerRef.current && (0, _hasParent.hasParent)(document.activeElement, _this3.tableContainerRef.current)) {
|
|
581
|
+
var _this3$tableRef$curre;
|
|
582
|
+
(_this3$tableRef$curre = _this3.tableRef.current) === null || _this3$tableRef$curre === void 0 || _this3$tableRef$curre.focus();
|
|
583
|
+
}
|
|
584
|
+
}, 0);
|
|
585
|
+
}
|
|
564
586
|
}
|
|
565
587
|
}, {
|
|
566
588
|
key: "componentWillUnmount",
|
|
@@ -574,9 +596,9 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
574
596
|
}, {
|
|
575
597
|
key: "totalRows",
|
|
576
598
|
get: function get() {
|
|
577
|
-
var _this$
|
|
578
|
-
totalRows = _this$
|
|
579
|
-
expandedRows = _this$
|
|
599
|
+
var _this$asProps6 = this.asProps,
|
|
600
|
+
totalRows = _this$asProps6.totalRows,
|
|
601
|
+
expandedRows = _this$asProps6.expandedRows;
|
|
580
602
|
var flatRows = this.getFlatRows();
|
|
581
603
|
var expandedRowsCount = Array.from(expandedRows !== null && expandedRows !== void 0 ? expandedRows : []).reduce(function (acc, rowKey) {
|
|
582
604
|
var dtRow = flatRows.find(function (el) {
|
|
@@ -608,11 +630,11 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
608
630
|
}, {
|
|
609
631
|
key: "scrollDirection",
|
|
610
632
|
get: function get() {
|
|
611
|
-
var _this$
|
|
612
|
-
w = _this$
|
|
613
|
-
wMax = _this$
|
|
614
|
-
h = _this$
|
|
615
|
-
hMax = _this$
|
|
633
|
+
var _this$asProps7 = this.asProps,
|
|
634
|
+
w = _this$asProps7.w,
|
|
635
|
+
wMax = _this$asProps7.wMax,
|
|
636
|
+
h = _this$asProps7.h,
|
|
637
|
+
hMax = _this$asProps7.hMax;
|
|
616
638
|
var scrollDirection = undefined;
|
|
617
639
|
var hasWidthSettings = Boolean(w) || Boolean(wMax);
|
|
618
640
|
var hasHeightSettings = Boolean(h) && h !== 'fit-content' || Boolean(hMax);
|
|
@@ -633,19 +655,19 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
633
655
|
}, {
|
|
634
656
|
key: "getHeadProps",
|
|
635
657
|
value: function getHeadProps() {
|
|
636
|
-
var
|
|
637
|
-
var _this$
|
|
638
|
-
use = _this$
|
|
639
|
-
compact = _this$
|
|
640
|
-
sort = _this$
|
|
641
|
-
onSortChange = _this$
|
|
642
|
-
getI18nText = _this$
|
|
643
|
-
uid = _this$
|
|
644
|
-
headerProps = _this$
|
|
645
|
-
onSelectedRowsChange = _this$
|
|
646
|
-
selectedRows = _this$
|
|
647
|
-
sideIndents = _this$
|
|
648
|
-
variant = _this$
|
|
658
|
+
var _this4 = this;
|
|
659
|
+
var _this$asProps8 = this.asProps,
|
|
660
|
+
use = _this$asProps8.use,
|
|
661
|
+
compact = _this$asProps8.compact,
|
|
662
|
+
sort = _this$asProps8.sort,
|
|
663
|
+
onSortChange = _this$asProps8.onSortChange,
|
|
664
|
+
getI18nText = _this$asProps8.getI18nText,
|
|
665
|
+
uid = _this$asProps8.uid,
|
|
666
|
+
headerProps = _this$asProps8.headerProps,
|
|
667
|
+
onSelectedRowsChange = _this$asProps8.onSelectedRowsChange,
|
|
668
|
+
selectedRows = _this$asProps8.selectedRows,
|
|
669
|
+
sideIndents = _this$asProps8.sideIndents,
|
|
670
|
+
variant = _this$asProps8.variant;
|
|
649
671
|
var _this$gridSettings = this.gridSettings,
|
|
650
672
|
gridTemplateColumns = _this$gridSettings.gridTemplateColumns,
|
|
651
673
|
gridTemplateAreas = _this$gridSettings.gridTemplateAreas;
|
|
@@ -670,7 +692,7 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
670
692
|
selectedRows: selectedRows,
|
|
671
693
|
flatRows: this.getFlatRows(),
|
|
672
694
|
onChangeSelectAll: function onChangeSelectAll(value, e) {
|
|
673
|
-
var mappedFlatRows =
|
|
695
|
+
var mappedFlatRows = _this4.getFlatRows().map(function (r) {
|
|
674
696
|
return r[UNIQ_ROW_KEY];
|
|
675
697
|
});
|
|
676
698
|
var selectedRowsSet = new Set(selectedRows);
|
|
@@ -691,28 +713,28 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
691
713
|
}, {
|
|
692
714
|
key: "getBodyProps",
|
|
693
715
|
value: function getBodyProps() {
|
|
694
|
-
var _this$
|
|
695
|
-
use = _this$
|
|
696
|
-
compact = _this$
|
|
697
|
-
loading = _this$
|
|
698
|
-
getI18nText = _this$
|
|
699
|
-
expandedRows = _this$
|
|
700
|
-
virtualScroll = _this$
|
|
701
|
-
uid = _this$
|
|
702
|
-
rowProps = _this$
|
|
703
|
-
renderCell = _this$
|
|
704
|
-
headerProps = _this$
|
|
705
|
-
renderEmptyData = _this$
|
|
706
|
-
sideIndents = _this$
|
|
707
|
-
selectedRows = _this$
|
|
708
|
-
accordionDuration = _this$
|
|
709
|
-
accordionMode = _this$
|
|
710
|
-
rawData = _this$
|
|
711
|
-
renderCellOverlay = _this$
|
|
712
|
-
limit = _this$
|
|
713
|
-
variant = _this$
|
|
714
|
-
totalRows = _this$
|
|
715
|
-
accordionAnimationRows = _this$
|
|
716
|
+
var _this$asProps9 = this.asProps,
|
|
717
|
+
use = _this$asProps9.use,
|
|
718
|
+
compact = _this$asProps9.compact,
|
|
719
|
+
loading = _this$asProps9.loading,
|
|
720
|
+
getI18nText = _this$asProps9.getI18nText,
|
|
721
|
+
expandedRows = _this$asProps9.expandedRows,
|
|
722
|
+
virtualScroll = _this$asProps9.virtualScroll,
|
|
723
|
+
uid = _this$asProps9.uid,
|
|
724
|
+
rowProps = _this$asProps9.rowProps,
|
|
725
|
+
renderCell = _this$asProps9.renderCell,
|
|
726
|
+
headerProps = _this$asProps9.headerProps,
|
|
727
|
+
renderEmptyData = _this$asProps9.renderEmptyData,
|
|
728
|
+
sideIndents = _this$asProps9.sideIndents,
|
|
729
|
+
selectedRows = _this$asProps9.selectedRows,
|
|
730
|
+
accordionDuration = _this$asProps9.accordionDuration,
|
|
731
|
+
accordionMode = _this$asProps9.accordionMode,
|
|
732
|
+
rawData = _this$asProps9.data,
|
|
733
|
+
renderCellOverlay = _this$asProps9.renderCellOverlay,
|
|
734
|
+
limit = _this$asProps9.limit,
|
|
735
|
+
variant = _this$asProps9.variant,
|
|
736
|
+
totalRows = _this$asProps9.totalRows,
|
|
737
|
+
accordionAnimationRows = _this$asProps9.accordionAnimationRows;
|
|
716
738
|
var _this$gridSettings2 = this.gridSettings,
|
|
717
739
|
gridTemplateColumns = _this$gridSettings2.gridTemplateColumns,
|
|
718
740
|
gridTemplateAreas = _this$gridSettings2.gridTemplateAreas;
|
|
@@ -792,20 +814,20 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
792
814
|
var _ref = this.asProps,
|
|
793
815
|
_ref2;
|
|
794
816
|
var SDataTable = _baseComponents.Box;
|
|
795
|
-
var _this$
|
|
796
|
-
Children = _this$
|
|
797
|
-
styles = _this$
|
|
798
|
-
w = _this$
|
|
799
|
-
wMax = _this$
|
|
800
|
-
wMin = _this$
|
|
801
|
-
h = _this$
|
|
802
|
-
hMax = _this$
|
|
803
|
-
hMin = _this$
|
|
804
|
-
virtualScroll = _this$
|
|
805
|
-
children = _this$
|
|
806
|
-
headerProps = _this$
|
|
807
|
-
loading = _this$
|
|
808
|
-
selectedRows = _this$
|
|
817
|
+
var _this$asProps0 = this.asProps,
|
|
818
|
+
Children = _this$asProps0.Children,
|
|
819
|
+
styles = _this$asProps0.styles,
|
|
820
|
+
w = _this$asProps0.w,
|
|
821
|
+
wMax = _this$asProps0.wMax,
|
|
822
|
+
wMin = _this$asProps0.wMin,
|
|
823
|
+
h = _this$asProps0.h,
|
|
824
|
+
hMax = _this$asProps0.hMax,
|
|
825
|
+
hMin = _this$asProps0.hMin,
|
|
826
|
+
virtualScroll = _this$asProps0.virtualScroll,
|
|
827
|
+
children = _this$asProps0.children,
|
|
828
|
+
headerProps = _this$asProps0.headerProps,
|
|
829
|
+
loading = _this$asProps0.loading,
|
|
830
|
+
selectedRows = _this$asProps0.selectedRows;
|
|
809
831
|
var _this$getScrollOffset = this.getScrollOffsetValue(),
|
|
810
832
|
_this$getScrollOffset2 = (0, _slicedToArray2["default"])(_this$getScrollOffset, 2),
|
|
811
833
|
offsetLeftSum = _this$getScrollOffset2[0],
|
|
@@ -892,7 +914,7 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
892
914
|
}, {
|
|
893
915
|
key: "calculateColumnsFromConfig",
|
|
894
916
|
value: function calculateColumnsFromConfig() {
|
|
895
|
-
var
|
|
917
|
+
var _this5 = this;
|
|
896
918
|
var _this$props = this.props,
|
|
897
919
|
columns = _this$props.columns,
|
|
898
920
|
data = _this$props.data,
|
|
@@ -928,7 +950,7 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
928
950
|
parent: parent
|
|
929
951
|
});
|
|
930
952
|
if (column.fixed) {
|
|
931
|
-
|
|
953
|
+
_this5.hasFixedColumn = true;
|
|
932
954
|
}
|
|
933
955
|
return column;
|
|
934
956
|
};
|
|
@@ -952,7 +974,7 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
952
974
|
columns.forEach(function (child, i) {
|
|
953
975
|
if (childIsColumn(child)) {
|
|
954
976
|
var col = makeColumn(child);
|
|
955
|
-
col.gridArea = "1 / ".concat(gridColumnIndex, " / ").concat(
|
|
977
|
+
col.gridArea = "1 / ".concat(gridColumnIndex, " / ").concat(_this5.hasGroups ? '3' : '2', " / ").concat(gridColumnIndex + 1);
|
|
956
978
|
gridColumnIndex++;
|
|
957
979
|
calculatedColumns.push(col);
|
|
958
980
|
treeColumns.push(col);
|
|
@@ -963,14 +985,14 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
963
985
|
var Group = makeColumn(child);
|
|
964
986
|
var childCount = child.columns.length;
|
|
965
987
|
var initGridColumn = gridColumnIndex;
|
|
966
|
-
var groupedRow =
|
|
988
|
+
var groupedRow = _this5.hasGroups ? 2 : 1;
|
|
967
989
|
Group.columns = [];
|
|
968
990
|
Group.children = child.children;
|
|
969
991
|
child.columns.forEach(function (child, j) {
|
|
970
992
|
var _Group$columns;
|
|
971
993
|
var isFirst = j === 0;
|
|
972
994
|
var isLast = j === childCount - 1;
|
|
973
|
-
var col = makeColumn(child, Group, isFirst, isLast,
|
|
995
|
+
var col = makeColumn(child, Group, isFirst, isLast, _this5.hasGroups);
|
|
974
996
|
if (i === 0 && j === 0 && data.some(function (d) {
|
|
975
997
|
return d[ACCORDION];
|
|
976
998
|
})) {
|
|
@@ -988,7 +1010,7 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
988
1010
|
(_Group$columns = Group.columns) === null || _Group$columns === void 0 || _Group$columns.push(col);
|
|
989
1011
|
});
|
|
990
1012
|
treeColumns.push(Group);
|
|
991
|
-
|
|
1013
|
+
_this5.gridAreaGroupMap.set(groupIndex, "1 / ".concat(initGridColumn, " / 2 / ").concat(gridColumnIndex));
|
|
992
1014
|
groupIndex++;
|
|
993
1015
|
}
|
|
994
1016
|
});
|
|
@@ -1017,7 +1039,7 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
1017
1039
|
}, {
|
|
1018
1040
|
key: "getRows",
|
|
1019
1041
|
value: function getRows() {
|
|
1020
|
-
var
|
|
1042
|
+
var _this6 = this;
|
|
1021
1043
|
var columns = this.columns;
|
|
1022
1044
|
// @ts-ignore
|
|
1023
1045
|
var _this$props2 = this.props,
|
|
@@ -1043,7 +1065,7 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
1043
1065
|
var _ref5 = (0, _slicedToArray2["default"])(_ref4, 2),
|
|
1044
1066
|
key = _ref5[0],
|
|
1045
1067
|
value = _ref5[1];
|
|
1046
|
-
var columnsToRow = key.split(
|
|
1068
|
+
var columnsToRow = key.split(_this6.columnsSplitter);
|
|
1047
1069
|
if (columnsToRow.length === 1) {
|
|
1048
1070
|
acc[key] = value !== null && value !== void 0 ? value : '';
|
|
1049
1071
|
columns["delete"](key);
|