@semcore/data-table 16.4.3 → 16.4.4-prerelease.1
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 +9 -9
|
@@ -21,38 +21,38 @@ import { isFocusInside, hasFocusableIn } from '@semcore/core/lib/utils/use/useFo
|
|
|
21
21
|
import { NoData } from '@semcore/widget-empty';
|
|
22
22
|
import * as React from 'react';
|
|
23
23
|
/*!__reshadow-styles__:"./dataTable.shadow.css"*/
|
|
24
|
-
var style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".
|
|
24
|
+
var style = (/*__reshadow_css_start__*/_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_"),
|
|
25
25
|
/*__reshadow_css_end__*/
|
|
26
26
|
{
|
|
27
|
-
"__SDataTable": "
|
|
28
|
-
"_isDataEmpty": "
|
|
29
|
-
"_gridTemplateColumns": "
|
|
30
|
-
"--gridTemplateColumns": "--
|
|
31
|
-
"_gridTemplateAreas": "
|
|
32
|
-
"--gridTemplateAreas": "--
|
|
33
|
-
"_gridTemplateRows": "
|
|
34
|
-
"--gridTemplateRows": "--
|
|
27
|
+
"__SDataTable": "___SDataTable_z1jx4_gg_",
|
|
28
|
+
"_isDataEmpty": "__isDataEmpty_z1jx4_gg_",
|
|
29
|
+
"_gridTemplateColumns": "__gridTemplateColumns_z1jx4_gg_",
|
|
30
|
+
"--gridTemplateColumns": "--gridTemplateColumns_z1jx4",
|
|
31
|
+
"_gridTemplateAreas": "__gridTemplateAreas_z1jx4_gg_",
|
|
32
|
+
"--gridTemplateAreas": "--gridTemplateAreas_z1jx4",
|
|
33
|
+
"_gridTemplateRows": "__gridTemplateRows_z1jx4_gg_",
|
|
34
|
+
"--gridTemplateRows": "--gridTemplateRows_z1jx4"
|
|
35
35
|
});
|
|
36
36
|
/*!__reshadow-styles__:"../../style/scroll-shadows.shadow.css"*/
|
|
37
|
-
var scrollStyles = (/*__reshadow_css_start__*/_sstyled2.insert(/*__inner_css_start__*/".
|
|
37
|
+
var scrollStyles = (/*__reshadow_css_start__*/_sstyled2.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_"),
|
|
38
38
|
/*__reshadow_css_end__*/
|
|
39
39
|
{
|
|
40
|
-
"__SScrollArea": "
|
|
41
|
-
"__SContainer": "
|
|
42
|
-
"_scrollDirection_both": "
|
|
43
|
-
"_loading": "
|
|
44
|
-
"_scrollDirection_horizontal": "
|
|
45
|
-
"_scrollDirection_vertical": "
|
|
46
|
-
"_headerHeight": "
|
|
47
|
-
"--headerHeight": "--
|
|
48
|
-
"_leftScrollPadding": "
|
|
49
|
-
"--leftScrollPadding": "--
|
|
50
|
-
"_rightScrollPadding": "
|
|
51
|
-
"--rightScrollPadding": "--
|
|
52
|
-
"__SShadowVertical": "
|
|
53
|
-
"__SShadowHorizontal": "
|
|
54
|
-
"_leftOffset": "
|
|
55
|
-
"_rightOffset": "
|
|
40
|
+
"__SScrollArea": "___SScrollArea_ntjfu_gg_",
|
|
41
|
+
"__SContainer": "___SContainer_ntjfu_gg_",
|
|
42
|
+
"_scrollDirection_both": "_scrollDirection_both_ntjfu_gg_",
|
|
43
|
+
"_loading": "__loading_ntjfu_gg_",
|
|
44
|
+
"_scrollDirection_horizontal": "_scrollDirection_horizontal_ntjfu_gg_",
|
|
45
|
+
"_scrollDirection_vertical": "_scrollDirection_vertical_ntjfu_gg_",
|
|
46
|
+
"_headerHeight": "__headerHeight_ntjfu_gg_",
|
|
47
|
+
"--headerHeight": "--headerHeight_ntjfu",
|
|
48
|
+
"_leftScrollPadding": "__leftScrollPadding_ntjfu_gg_",
|
|
49
|
+
"--leftScrollPadding": "--leftScrollPadding_ntjfu",
|
|
50
|
+
"_rightScrollPadding": "__rightScrollPadding_ntjfu_gg_",
|
|
51
|
+
"--rightScrollPadding": "--rightScrollPadding_ntjfu",
|
|
52
|
+
"__SShadowVertical": "___SShadowVertical_ntjfu_gg_",
|
|
53
|
+
"__SShadowHorizontal": "___SShadowHorizontal_ntjfu_gg_",
|
|
54
|
+
"_leftOffset": "__leftOffset_ntjfu_gg_",
|
|
55
|
+
"_rightOffset": "__rightOffset_ntjfu_gg_"
|
|
56
56
|
});
|
|
57
57
|
import { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';
|
|
58
58
|
import { Body } from '../Body/Body';
|
|
@@ -433,11 +433,13 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
433
433
|
});
|
|
434
434
|
_this.changeFocusCell(-1, cellIndex === -1 ? 0 : cellIndex, 'up');
|
|
435
435
|
});
|
|
436
|
-
_defineProperty(_this, "handleContainerResizeEnd", function () {
|
|
436
|
+
_defineProperty(_this, "handleContainerResizeEnd", function (entries, observer) {
|
|
437
|
+
var _this$asProps$onResiz, _this$asProps3;
|
|
437
438
|
if (_this.containerResizeEndTimeoutId) {
|
|
438
439
|
clearTimeout(_this.containerResizeEndTimeoutId);
|
|
439
440
|
}
|
|
440
441
|
_this.containerResizeEndTimeoutId = setTimeout(_this.calculateVerticalShadow, 0);
|
|
442
|
+
(_this$asProps$onResiz = (_this$asProps3 = _this.asProps).onResize) === null || _this$asProps$onResiz === void 0 || _this$asProps$onResiz.call(_this$asProps3, entries, observer);
|
|
441
443
|
});
|
|
442
444
|
_defineProperty(_this, "getScrollOffsetValue", function () {
|
|
443
445
|
if (!_this.headerRef.current) {
|
|
@@ -518,9 +520,9 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
518
520
|
key: "componentDidMount",
|
|
519
521
|
value: function componentDidMount() {
|
|
520
522
|
var _this2 = this;
|
|
521
|
-
var _this$
|
|
522
|
-
headerProps = _this$
|
|
523
|
-
loading = _this$
|
|
523
|
+
var _this$asProps4 = this.asProps,
|
|
524
|
+
headerProps = _this$asProps4.headerProps,
|
|
525
|
+
loading = _this$asProps4.loading;
|
|
524
526
|
if (headerProps !== null && headerProps !== void 0 && headerProps.sticky && !headerProps.h || loading || this.hasFixedColumn) {
|
|
525
527
|
requestAnimationFrame(function () {
|
|
526
528
|
_this2.forceUpdate();
|
|
@@ -534,10 +536,12 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
534
536
|
}, {
|
|
535
537
|
key: "componentDidUpdate",
|
|
536
538
|
value: function componentDidUpdate(prevProps) {
|
|
537
|
-
var
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
539
|
+
var _this3 = this;
|
|
540
|
+
var _this$asProps5 = this.asProps,
|
|
541
|
+
data = _this$asProps5.data,
|
|
542
|
+
selectedRows = _this$asProps5.selectedRows,
|
|
543
|
+
columns = _this$asProps5.columns,
|
|
544
|
+
loading = _this$asProps5.loading;
|
|
541
545
|
if (prevProps.columns !== columns) {
|
|
542
546
|
var cols = this.calculateColumnsFromConfig();
|
|
543
547
|
this.columns = cols[0];
|
|
@@ -550,12 +554,30 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
550
554
|
}
|
|
551
555
|
}
|
|
552
556
|
if (prevProps.selectedRows !== selectedRows && selectedRows !== undefined) {
|
|
553
|
-
|
|
557
|
+
var selectedRowsSet = new Set(selectedRows);
|
|
558
|
+
var allChecked = [];
|
|
559
|
+
var allUnchecked = [];
|
|
560
|
+
this.flatRows.forEach(function (row) {
|
|
561
|
+
if (selectedRowsSet.has(row[UNIQ_ROW_KEY])) {
|
|
562
|
+
allChecked.push(row[UNIQ_ROW_KEY]);
|
|
563
|
+
} else {
|
|
564
|
+
allUnchecked.push(row[UNIQ_ROW_KEY]);
|
|
565
|
+
}
|
|
566
|
+
});
|
|
567
|
+
if (allChecked.length === data.length) {
|
|
554
568
|
this.setSelectAllMessage(true);
|
|
555
|
-
} else if (
|
|
569
|
+
} else if (allUnchecked.length === data.length) {
|
|
556
570
|
this.setSelectAllMessage(false);
|
|
557
571
|
}
|
|
558
572
|
}
|
|
573
|
+
if (prevProps.loading !== loading) {
|
|
574
|
+
setTimeout(function () {
|
|
575
|
+
if (document.activeElement === document.body || _this3.tableContainerRef.current && hasParent(document.activeElement, _this3.tableContainerRef.current)) {
|
|
576
|
+
var _this3$tableRef$curre;
|
|
577
|
+
(_this3$tableRef$curre = _this3.tableRef.current) === null || _this3$tableRef$curre === void 0 || _this3$tableRef$curre.focus();
|
|
578
|
+
}
|
|
579
|
+
}, 0);
|
|
580
|
+
}
|
|
559
581
|
}
|
|
560
582
|
}, {
|
|
561
583
|
key: "componentWillUnmount",
|
|
@@ -569,9 +591,9 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
569
591
|
}, {
|
|
570
592
|
key: "totalRows",
|
|
571
593
|
get: function get() {
|
|
572
|
-
var _this$
|
|
573
|
-
totalRows = _this$
|
|
574
|
-
expandedRows = _this$
|
|
594
|
+
var _this$asProps6 = this.asProps,
|
|
595
|
+
totalRows = _this$asProps6.totalRows,
|
|
596
|
+
expandedRows = _this$asProps6.expandedRows;
|
|
575
597
|
var flatRows = this.getFlatRows();
|
|
576
598
|
var expandedRowsCount = Array.from(expandedRows !== null && expandedRows !== void 0 ? expandedRows : []).reduce(function (acc, rowKey) {
|
|
577
599
|
var dtRow = flatRows.find(function (el) {
|
|
@@ -603,11 +625,11 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
603
625
|
}, {
|
|
604
626
|
key: "scrollDirection",
|
|
605
627
|
get: function get() {
|
|
606
|
-
var _this$
|
|
607
|
-
w = _this$
|
|
608
|
-
wMax = _this$
|
|
609
|
-
h = _this$
|
|
610
|
-
hMax = _this$
|
|
628
|
+
var _this$asProps7 = this.asProps,
|
|
629
|
+
w = _this$asProps7.w,
|
|
630
|
+
wMax = _this$asProps7.wMax,
|
|
631
|
+
h = _this$asProps7.h,
|
|
632
|
+
hMax = _this$asProps7.hMax;
|
|
611
633
|
var scrollDirection = undefined;
|
|
612
634
|
var hasWidthSettings = Boolean(w) || Boolean(wMax);
|
|
613
635
|
var hasHeightSettings = Boolean(h) && h !== 'fit-content' || Boolean(hMax);
|
|
@@ -628,19 +650,19 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
628
650
|
}, {
|
|
629
651
|
key: "getHeadProps",
|
|
630
652
|
value: function getHeadProps() {
|
|
631
|
-
var
|
|
632
|
-
var _this$
|
|
633
|
-
use = _this$
|
|
634
|
-
compact = _this$
|
|
635
|
-
sort = _this$
|
|
636
|
-
onSortChange = _this$
|
|
637
|
-
getI18nText = _this$
|
|
638
|
-
uid = _this$
|
|
639
|
-
headerProps = _this$
|
|
640
|
-
onSelectedRowsChange = _this$
|
|
641
|
-
selectedRows = _this$
|
|
642
|
-
sideIndents = _this$
|
|
643
|
-
variant = _this$
|
|
653
|
+
var _this4 = this;
|
|
654
|
+
var _this$asProps8 = this.asProps,
|
|
655
|
+
use = _this$asProps8.use,
|
|
656
|
+
compact = _this$asProps8.compact,
|
|
657
|
+
sort = _this$asProps8.sort,
|
|
658
|
+
onSortChange = _this$asProps8.onSortChange,
|
|
659
|
+
getI18nText = _this$asProps8.getI18nText,
|
|
660
|
+
uid = _this$asProps8.uid,
|
|
661
|
+
headerProps = _this$asProps8.headerProps,
|
|
662
|
+
onSelectedRowsChange = _this$asProps8.onSelectedRowsChange,
|
|
663
|
+
selectedRows = _this$asProps8.selectedRows,
|
|
664
|
+
sideIndents = _this$asProps8.sideIndents,
|
|
665
|
+
variant = _this$asProps8.variant;
|
|
644
666
|
var _this$gridSettings = this.gridSettings,
|
|
645
667
|
gridTemplateColumns = _this$gridSettings.gridTemplateColumns,
|
|
646
668
|
gridTemplateAreas = _this$gridSettings.gridTemplateAreas;
|
|
@@ -665,7 +687,7 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
665
687
|
selectedRows: selectedRows,
|
|
666
688
|
flatRows: this.getFlatRows(),
|
|
667
689
|
onChangeSelectAll: function onChangeSelectAll(value, e) {
|
|
668
|
-
var mappedFlatRows =
|
|
690
|
+
var mappedFlatRows = _this4.getFlatRows().map(function (r) {
|
|
669
691
|
return r[UNIQ_ROW_KEY];
|
|
670
692
|
});
|
|
671
693
|
var selectedRowsSet = new Set(selectedRows);
|
|
@@ -686,28 +708,28 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
686
708
|
}, {
|
|
687
709
|
key: "getBodyProps",
|
|
688
710
|
value: function getBodyProps() {
|
|
689
|
-
var _this$
|
|
690
|
-
use = _this$
|
|
691
|
-
compact = _this$
|
|
692
|
-
loading = _this$
|
|
693
|
-
getI18nText = _this$
|
|
694
|
-
expandedRows = _this$
|
|
695
|
-
virtualScroll = _this$
|
|
696
|
-
uid = _this$
|
|
697
|
-
rowProps = _this$
|
|
698
|
-
renderCell = _this$
|
|
699
|
-
headerProps = _this$
|
|
700
|
-
renderEmptyData = _this$
|
|
701
|
-
sideIndents = _this$
|
|
702
|
-
selectedRows = _this$
|
|
703
|
-
accordionDuration = _this$
|
|
704
|
-
accordionMode = _this$
|
|
705
|
-
rawData = _this$
|
|
706
|
-
renderCellOverlay = _this$
|
|
707
|
-
limit = _this$
|
|
708
|
-
variant = _this$
|
|
709
|
-
totalRows = _this$
|
|
710
|
-
accordionAnimationRows = _this$
|
|
711
|
+
var _this$asProps9 = this.asProps,
|
|
712
|
+
use = _this$asProps9.use,
|
|
713
|
+
compact = _this$asProps9.compact,
|
|
714
|
+
loading = _this$asProps9.loading,
|
|
715
|
+
getI18nText = _this$asProps9.getI18nText,
|
|
716
|
+
expandedRows = _this$asProps9.expandedRows,
|
|
717
|
+
virtualScroll = _this$asProps9.virtualScroll,
|
|
718
|
+
uid = _this$asProps9.uid,
|
|
719
|
+
rowProps = _this$asProps9.rowProps,
|
|
720
|
+
renderCell = _this$asProps9.renderCell,
|
|
721
|
+
headerProps = _this$asProps9.headerProps,
|
|
722
|
+
renderEmptyData = _this$asProps9.renderEmptyData,
|
|
723
|
+
sideIndents = _this$asProps9.sideIndents,
|
|
724
|
+
selectedRows = _this$asProps9.selectedRows,
|
|
725
|
+
accordionDuration = _this$asProps9.accordionDuration,
|
|
726
|
+
accordionMode = _this$asProps9.accordionMode,
|
|
727
|
+
rawData = _this$asProps9.data,
|
|
728
|
+
renderCellOverlay = _this$asProps9.renderCellOverlay,
|
|
729
|
+
limit = _this$asProps9.limit,
|
|
730
|
+
variant = _this$asProps9.variant,
|
|
731
|
+
totalRows = _this$asProps9.totalRows,
|
|
732
|
+
accordionAnimationRows = _this$asProps9.accordionAnimationRows;
|
|
711
733
|
var _this$gridSettings2 = this.gridSettings,
|
|
712
734
|
gridTemplateColumns = _this$gridSettings2.gridTemplateColumns,
|
|
713
735
|
gridTemplateAreas = _this$gridSettings2.gridTemplateAreas;
|
|
@@ -787,20 +809,20 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
787
809
|
var _ref = this.asProps,
|
|
788
810
|
_ref2;
|
|
789
811
|
var SDataTable = Box;
|
|
790
|
-
var _this$
|
|
791
|
-
Children = _this$
|
|
792
|
-
styles = _this$
|
|
793
|
-
w = _this$
|
|
794
|
-
wMax = _this$
|
|
795
|
-
wMin = _this$
|
|
796
|
-
h = _this$
|
|
797
|
-
hMax = _this$
|
|
798
|
-
hMin = _this$
|
|
799
|
-
virtualScroll = _this$
|
|
800
|
-
children = _this$
|
|
801
|
-
headerProps = _this$
|
|
802
|
-
loading = _this$
|
|
803
|
-
selectedRows = _this$
|
|
812
|
+
var _this$asProps0 = this.asProps,
|
|
813
|
+
Children = _this$asProps0.Children,
|
|
814
|
+
styles = _this$asProps0.styles,
|
|
815
|
+
w = _this$asProps0.w,
|
|
816
|
+
wMax = _this$asProps0.wMax,
|
|
817
|
+
wMin = _this$asProps0.wMin,
|
|
818
|
+
h = _this$asProps0.h,
|
|
819
|
+
hMax = _this$asProps0.hMax,
|
|
820
|
+
hMin = _this$asProps0.hMin,
|
|
821
|
+
virtualScroll = _this$asProps0.virtualScroll,
|
|
822
|
+
children = _this$asProps0.children,
|
|
823
|
+
headerProps = _this$asProps0.headerProps,
|
|
824
|
+
loading = _this$asProps0.loading,
|
|
825
|
+
selectedRows = _this$asProps0.selectedRows;
|
|
804
826
|
var _this$getScrollOffset = this.getScrollOffsetValue(),
|
|
805
827
|
_this$getScrollOffset2 = _slicedToArray(_this$getScrollOffset, 2),
|
|
806
828
|
offsetLeftSum = _this$getScrollOffset2[0],
|
|
@@ -887,7 +909,7 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
887
909
|
}, {
|
|
888
910
|
key: "calculateColumnsFromConfig",
|
|
889
911
|
value: function calculateColumnsFromConfig() {
|
|
890
|
-
var
|
|
912
|
+
var _this5 = this;
|
|
891
913
|
var _this$props = this.props,
|
|
892
914
|
columns = _this$props.columns,
|
|
893
915
|
data = _this$props.data,
|
|
@@ -923,7 +945,7 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
923
945
|
parent: parent
|
|
924
946
|
});
|
|
925
947
|
if (column.fixed) {
|
|
926
|
-
|
|
948
|
+
_this5.hasFixedColumn = true;
|
|
927
949
|
}
|
|
928
950
|
return column;
|
|
929
951
|
};
|
|
@@ -947,7 +969,7 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
947
969
|
columns.forEach(function (child, i) {
|
|
948
970
|
if (childIsColumn(child)) {
|
|
949
971
|
var col = makeColumn(child);
|
|
950
|
-
col.gridArea = "1 / ".concat(gridColumnIndex, " / ").concat(
|
|
972
|
+
col.gridArea = "1 / ".concat(gridColumnIndex, " / ").concat(_this5.hasGroups ? '3' : '2', " / ").concat(gridColumnIndex + 1);
|
|
951
973
|
gridColumnIndex++;
|
|
952
974
|
calculatedColumns.push(col);
|
|
953
975
|
treeColumns.push(col);
|
|
@@ -958,14 +980,14 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
958
980
|
var Group = makeColumn(child);
|
|
959
981
|
var childCount = child.columns.length;
|
|
960
982
|
var initGridColumn = gridColumnIndex;
|
|
961
|
-
var groupedRow =
|
|
983
|
+
var groupedRow = _this5.hasGroups ? 2 : 1;
|
|
962
984
|
Group.columns = [];
|
|
963
985
|
Group.children = child.children;
|
|
964
986
|
child.columns.forEach(function (child, j) {
|
|
965
987
|
var _Group$columns;
|
|
966
988
|
var isFirst = j === 0;
|
|
967
989
|
var isLast = j === childCount - 1;
|
|
968
|
-
var col = makeColumn(child, Group, isFirst, isLast,
|
|
990
|
+
var col = makeColumn(child, Group, isFirst, isLast, _this5.hasGroups);
|
|
969
991
|
if (i === 0 && j === 0 && data.some(function (d) {
|
|
970
992
|
return d[ACCORDION];
|
|
971
993
|
})) {
|
|
@@ -983,7 +1005,7 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
983
1005
|
(_Group$columns = Group.columns) === null || _Group$columns === void 0 || _Group$columns.push(col);
|
|
984
1006
|
});
|
|
985
1007
|
treeColumns.push(Group);
|
|
986
|
-
|
|
1008
|
+
_this5.gridAreaGroupMap.set(groupIndex, "1 / ".concat(initGridColumn, " / 2 / ").concat(gridColumnIndex));
|
|
987
1009
|
groupIndex++;
|
|
988
1010
|
}
|
|
989
1011
|
});
|
|
@@ -1012,7 +1034,7 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
1012
1034
|
}, {
|
|
1013
1035
|
key: "getRows",
|
|
1014
1036
|
value: function getRows() {
|
|
1015
|
-
var
|
|
1037
|
+
var _this6 = this;
|
|
1016
1038
|
var columns = this.columns;
|
|
1017
1039
|
// @ts-ignore
|
|
1018
1040
|
var _this$props2 = this.props,
|
|
@@ -1038,7 +1060,7 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
1038
1060
|
var _ref5 = _slicedToArray(_ref4, 2),
|
|
1039
1061
|
key = _ref5[0],
|
|
1040
1062
|
value = _ref5[1];
|
|
1041
|
-
var columnsToRow = key.split(
|
|
1063
|
+
var columnsToRow = key.split(_this6.columnsSplitter);
|
|
1042
1064
|
if (columnsToRow.length === 1) {
|
|
1043
1065
|
acc[key] = value !== null && value !== void 0 ? value : '';
|
|
1044
1066
|
columns["delete"](key);
|