@semcore/data-table 16.0.0-prerelease.15 → 16.0.0-prerelease.17
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 +6 -0
- package/lib/cjs/components/Body/Body.js +114 -100
- package/lib/cjs/components/Body/Body.js.map +1 -1
- package/lib/cjs/components/Body/Body.types.js.map +1 -1
- package/lib/cjs/components/Body/Cell.js +67 -30
- package/lib/cjs/components/Body/Cell.js.map +1 -1
- package/lib/cjs/components/Body/Cell.types.js.map +1 -1
- package/lib/cjs/components/Body/MergedCells.js +9 -5
- package/lib/cjs/components/Body/MergedCells.js.map +1 -1
- package/lib/cjs/components/Body/Row.js +72 -113
- package/lib/cjs/components/Body/Row.js.map +1 -1
- package/lib/cjs/components/Body/Row.types.js +2 -0
- package/lib/cjs/components/Body/Row.types.js.map +1 -1
- package/lib/cjs/components/Body/style.shadow.css +75 -36
- package/lib/cjs/components/DataTable/DataTable.js +146 -97
- package/lib/cjs/components/DataTable/DataTable.js.map +1 -1
- package/lib/cjs/components/DataTable/DataTable.types.js +2 -0
- package/lib/cjs/components/DataTable/DataTable.types.js.map +1 -1
- package/lib/cjs/components/Head/Column.js +54 -33
- package/lib/cjs/components/Head/Column.js.map +1 -1
- package/lib/cjs/components/Head/Column.types.js.map +1 -1
- package/lib/cjs/components/Head/Group.js +24 -33
- package/lib/cjs/components/Head/Group.js.map +1 -1
- package/lib/cjs/components/Head/Group.type.js.map +1 -1
- package/lib/cjs/components/Head/Head.js +23 -28
- package/lib/cjs/components/Head/Head.js.map +1 -1
- package/lib/cjs/components/Head/Head.types.js.map +1 -1
- package/lib/cjs/components/Head/style.shadow.css +16 -14
- package/lib/cjs/index.js +7 -19
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/style/scroll-shadows.shadow.css +13 -6
- package/lib/es6/components/Body/Body.js +114 -100
- package/lib/es6/components/Body/Body.js.map +1 -1
- package/lib/es6/components/Body/Body.types.js.map +1 -1
- package/lib/es6/components/Body/Cell.js +67 -30
- package/lib/es6/components/Body/Cell.js.map +1 -1
- package/lib/es6/components/Body/Cell.types.js.map +1 -1
- package/lib/es6/components/Body/MergedCells.js +9 -5
- package/lib/es6/components/Body/MergedCells.js.map +1 -1
- package/lib/es6/components/Body/Row.js +72 -113
- package/lib/es6/components/Body/Row.js.map +1 -1
- package/lib/es6/components/Body/Row.types.js +1 -1
- package/lib/es6/components/Body/Row.types.js.map +1 -1
- package/lib/es6/components/Body/style.shadow.css +75 -36
- package/lib/es6/components/DataTable/DataTable.js +143 -95
- package/lib/es6/components/DataTable/DataTable.js.map +1 -1
- package/lib/es6/components/DataTable/DataTable.types.js +6 -1
- package/lib/es6/components/DataTable/DataTable.types.js.map +1 -1
- package/lib/es6/components/Head/Column.js +52 -31
- package/lib/es6/components/Head/Column.js.map +1 -1
- package/lib/es6/components/Head/Column.types.js.map +1 -1
- package/lib/es6/components/Head/Group.js +24 -33
- package/lib/es6/components/Head/Group.js.map +1 -1
- package/lib/es6/components/Head/Group.type.js.map +1 -1
- package/lib/es6/components/Head/Head.js +24 -29
- package/lib/es6/components/Head/Head.js.map +1 -1
- package/lib/es6/components/Head/Head.types.js.map +1 -1
- package/lib/es6/components/Head/style.shadow.css +16 -14
- package/lib/es6/index.js +5 -4
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/style/scroll-shadows.shadow.css +13 -6
- package/lib/esm/components/Body/Body.mjs +110 -98
- package/lib/esm/components/Body/Cell.mjs +64 -31
- package/lib/esm/components/Body/MergedCells.mjs +9 -5
- package/lib/esm/components/Body/Row.mjs +67 -109
- package/lib/esm/components/DataTable/DataTable.mjs +125 -46
- package/lib/esm/components/Head/Column.mjs +52 -32
- package/lib/esm/components/Head/Group.mjs +25 -34
- package/lib/esm/components/Head/Head.mjs +25 -30
- package/lib/esm/index.mjs +5 -6
- package/lib/esm/utils.mjs +0 -9
- package/lib/types/components/Body/Body.types.d.ts +13 -8
- package/lib/types/components/Body/Cell.types.d.ts +6 -6
- package/lib/types/components/Body/MergedCells.d.ts +8 -3
- package/lib/types/components/Body/Row.types.d.ts +19 -10
- package/lib/types/components/DataTable/DataTable.d.ts +3 -3
- package/lib/types/components/DataTable/DataTable.types.d.ts +23 -9
- package/lib/types/components/Head/Column.d.ts +6 -3
- package/lib/types/components/Head/Column.types.d.ts +5 -4
- package/lib/types/components/Head/Group.d.ts +0 -1
- package/lib/types/components/Head/Group.type.d.ts +4 -1
- package/lib/types/components/Head/Head.d.ts +6 -3
- package/lib/types/components/Head/Head.types.d.ts +8 -4
- package/lib/types/index.d.ts +10 -4
- package/package.json +7 -6
- package/lib/cjs/Body.js +0 -476
- package/lib/cjs/Body.js.map +0 -1
- package/lib/cjs/DataTable.js +0 -622
- package/lib/cjs/DataTable.js.map +0 -1
- package/lib/cjs/Head.js +0 -399
- package/lib/cjs/Head.js.map +0 -1
- package/lib/cjs/style/data-table.shadow.css +0 -394
- package/lib/cjs/types.js +0 -4
- package/lib/cjs/types.js.map +0 -1
- package/lib/es6/Body.js +0 -469
- package/lib/es6/Body.js.map +0 -1
- package/lib/es6/DataTable.js +0 -614
- package/lib/es6/DataTable.js.map +0 -1
- package/lib/es6/Head.js +0 -391
- package/lib/es6/Head.js.map +0 -1
- package/lib/es6/style/data-table.shadow.css +0 -394
- package/lib/es6/types.js +0 -2
- package/lib/es6/types.js.map +0 -1
- package/lib/esm/Body.mjs +0 -428
- package/lib/esm/DataTable.mjs +0 -582
- package/lib/esm/Head.mjs +0 -369
- package/lib/types/Body.d.ts +0 -61
- package/lib/types/DataTable.d.ts +0 -205
- package/lib/types/Head.d.ts +0 -45
- package/lib/types/types.d.ts +0 -73
|
@@ -1,15 +1,25 @@
|
|
|
1
|
-
SBody, SRow {
|
|
1
|
+
SBody, SRow, SRowGroup {
|
|
2
2
|
display: contents;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
-
SBody[compact]
|
|
6
|
-
|
|
5
|
+
SBody[compact] {
|
|
6
|
+
SCell {
|
|
7
|
+
padding: var(--intergalactic-spacing-3x, 12px) var(--intergalactic-spacing-2x, 8px);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
SCell[data-aria-level] {
|
|
11
|
+
padding-left: calc(var(--intergalactic-spacing-2x, 8px) + (var(--intergalactic-spacing-5x, 20px) * (var(--data-aria-level) - 1)));
|
|
12
|
+
}
|
|
7
13
|
}
|
|
8
14
|
|
|
9
15
|
SRow[gridArea], SCell[gridArea], SCollapseRow[gridArea] {
|
|
10
16
|
grid-area: var(--gridArea);
|
|
11
17
|
}
|
|
12
18
|
|
|
19
|
+
SCollapseRow SCell {
|
|
20
|
+
display: block;
|
|
21
|
+
}
|
|
22
|
+
|
|
13
23
|
/* DEFAULT THEME */
|
|
14
24
|
SRow[active] > SCell:not([theme]) {
|
|
15
25
|
/* The color is hardcoded because need hex(in figma rgba) */
|
|
@@ -17,10 +27,65 @@ SRow[active] > SCell:not([theme]) {
|
|
|
17
27
|
background-color: var(--intergalactic-table-td-cell-active, #e6e7ed);
|
|
18
28
|
}
|
|
19
29
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
30
|
+
/* we need a media query here because of the postcssHoverMediaFeature plugin. it doesn't handle this type of selectors correctly */
|
|
31
|
+
@media (hover: hover) {
|
|
32
|
+
SRow:hover > SCell:not([theme]),
|
|
33
|
+
SRowGroup:has(SCell[data-grouped-by='rowgroup']:hover) > SRow > SCell:not([theme]),
|
|
34
|
+
SRowGroup:has(SCell:hover) > SRow > SCell[data-grouped-by='rowgroup']:not([theme]) {
|
|
35
|
+
background-color: var(--intergalactic-table-td-cell-hover, #f0f0f4);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* MUTED THEME */
|
|
39
|
+
SRow:hover > SCell[theme='muted'],
|
|
40
|
+
SRow[theme='muted']:hover > SCell:not([theme]),
|
|
41
|
+
SRowGroup:has(SCell[data-grouped-by='rowgroup']:hover) > SRow > SCell[theme='muted'],
|
|
42
|
+
SRowGroup:has(SCell[data-grouped-by='rowgroup']:hover) > SRow[theme='muted'] > SCell:not([theme]),
|
|
43
|
+
SRowGroup:has(SCell:hover) > SRow > SCell[data-grouped-by='rowgroup'][theme='muted'],
|
|
44
|
+
SRowGroup:has(SCell:hover) > SRow[theme='muted'] > SCell[data-grouped-by='rowgroup']:not([theme]) {
|
|
45
|
+
/* The color is hardcoded because need hex(in figma rgba) */
|
|
46
|
+
/* disable-tokens-validator */
|
|
47
|
+
background-color: var(--intergalactic-table-td-cell-hover, #f0f0f4);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* INFO THEME */
|
|
51
|
+
SRow:hover > SCell[theme='info'],
|
|
52
|
+
SRow[theme='info']:hover > SCell:not([theme]),
|
|
53
|
+
SRowGroup:has(SCell[data-grouped-by='rowgroup']:hover) > SRow > SCell[theme='info'],
|
|
54
|
+
SRowGroup:has(SCell[data-grouped-by='rowgroup']:hover) > SRow[theme='info'] > SCell:not([theme]),
|
|
55
|
+
SRowGroup:has(SCell:hover) > SRow > SCell[data-grouped-by='rowgroup'][theme='info'],
|
|
56
|
+
SRowGroup:has(SCell:hover) > SRow[theme='info'] > SCell[data-grouped-by='rowgroup']:not([theme]) {
|
|
57
|
+
background-color: var(--intergalactic-table-td-cell-selected-hover, #c4e5fe);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* SUCCESS THEME */
|
|
61
|
+
SRow:hover > SCell[theme='success'],
|
|
62
|
+
SRow[theme='success']:hover > SCell:not([theme]),
|
|
63
|
+
SRowGroup:has(SCell[data-grouped-by='rowgroup']:hover) > SRow > SCell[theme='success'],
|
|
64
|
+
SRowGroup:has(SCell[data-grouped-by='rowgroup']:hover) > SRow[theme='success'] > SCell:not([theme]),
|
|
65
|
+
SRowGroup:has(SCell:hover) > SRow > SCell[data-grouped-by='rowgroup'][theme='success'],
|
|
66
|
+
SRowGroup:has(SCell:hover) > SRow[theme='success'] > SCell[data-grouped-by='rowgroup']:not([theme]) {
|
|
67
|
+
background-color: var(--intergalactic-table-td-cell-new-hover, #9ef2c9);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* WARNING THEME */
|
|
71
|
+
SRow:hover > SCell[theme='warning'],
|
|
72
|
+
SRow[theme='warning']:hover > SCell:not([theme]),
|
|
73
|
+
SRowGroup:has(SCell[data-grouped-by='rowgroup']:hover) > SRow > SCell[theme='warning'],
|
|
74
|
+
SRowGroup:has(SCell[data-grouped-by='rowgroup']:hover) > SRow[theme='warning'] > SCell:not([theme]),
|
|
75
|
+
SRowGroup:has(SCell:hover) > SRow > SCell[data-grouped-by='rowgroup'][theme='warning'],
|
|
76
|
+
SRowGroup:has(SCell:hover) > SRow[theme='warning'] > SCell[data-grouped-by='rowgroup']:not([theme]) {
|
|
77
|
+
background-color: var(--intergalactic-table-td-cell-warning-hover, #ffdca2);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* DANGER THEME */
|
|
81
|
+
SRow:hover > SCell[theme='danger'],
|
|
82
|
+
SRow[theme='danger']:hover > SCell:not([theme]),
|
|
83
|
+
SRowGroup:has(SCell[data-grouped-by='rowgroup']:hover) > SRow > SCell[theme='danger'],
|
|
84
|
+
SRowGroup:has(SCell[data-grouped-by='rowgroup']:hover) > SRow[theme='danger'] > SCell:not([theme]),
|
|
85
|
+
SRowGroup:has(SCell:hover) > SRow > SCell[data-grouped-by='rowgroup'][theme='danger'],
|
|
86
|
+
SRowGroup:has(SCell:hover) > SRow[theme='danger'] > SCell[data-grouped-by='rowgroup']:not([theme]) {
|
|
87
|
+
background-color: var(--intergalactic-table-td-cell-critical-hover, #ffd7df);
|
|
88
|
+
}
|
|
24
89
|
}
|
|
25
90
|
|
|
26
91
|
/* MUTED THEME */
|
|
@@ -34,13 +99,6 @@ SRow[theme='muted'][active] > SCell:not([theme]) {
|
|
|
34
99
|
background-color: var(--intergalactic-table-td-cell-active, #e6e7ed);
|
|
35
100
|
}
|
|
36
101
|
|
|
37
|
-
SRow:hover > SCell[theme='muted'],
|
|
38
|
-
SRow[theme='muted']:hover > SCell:not([theme]) {
|
|
39
|
-
/* The color is hardcoded because need hex(in figma rgba) */
|
|
40
|
-
/* disable-tokens-validator */
|
|
41
|
-
background-color: var(--intergalactic-table-td-cell-hover, #f0f0f4);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
102
|
/* INFO THEME */
|
|
45
103
|
SRow[theme='info'] SCell:not([theme]) {
|
|
46
104
|
background-color: var(--intergalactic-table-td-cell-selected, #e9f7ff);
|
|
@@ -50,11 +108,6 @@ SRow[theme='info'][active] > SCell:not([theme]) {
|
|
|
50
108
|
background-color: var(--intergalactic-table-td-cell-selected-active, #c4e5fe);
|
|
51
109
|
}
|
|
52
110
|
|
|
53
|
-
SRow:hover > SCell[theme='info'],
|
|
54
|
-
SRow[theme='info']:hover > SCell:not([theme]) {
|
|
55
|
-
background-color: var(--intergalactic-table-td-cell-selected-hover, #c4e5fe);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
111
|
/* SUCCESS THEME */
|
|
59
112
|
SRow[theme='success'] SCell:not([theme]) {
|
|
60
113
|
background-color: var(--intergalactic-table-td-cell-new, #dbfee8);
|
|
@@ -64,11 +117,6 @@ SRow[theme='success'][active] > SCell:not([theme]) {
|
|
|
64
117
|
background-color: var(--intergalactic-table-td-cell-new-active, #9ef2c9);
|
|
65
118
|
}
|
|
66
119
|
|
|
67
|
-
SRow:hover > SCell[theme='success'],
|
|
68
|
-
SRow[theme='success']:hover > SCell:not([theme]) {
|
|
69
|
-
background-color: var(--intergalactic-table-td-cell-new-hover, #9ef2c9);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
120
|
/* WARNING THEME */
|
|
73
121
|
SRow[theme='warning'] SCell:not([theme]) {
|
|
74
122
|
background-color: var(--intergalactic-table-td-cell-warning, #fff3d9);
|
|
@@ -78,11 +126,6 @@ SRow[theme='warning'][active] > SCell:not([theme]) {
|
|
|
78
126
|
background-color: var(--intergalactic-table-td-cell-warning-active, #ffdca2);
|
|
79
127
|
}
|
|
80
128
|
|
|
81
|
-
SRow:hover > SCell[theme='warning'],
|
|
82
|
-
SRow[theme='warning']:hover > SCell:not([theme]) {
|
|
83
|
-
background-color: var(--intergalactic-table-td-cell-warning-hover, #ffdca2);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
129
|
/* DANGER THEME */
|
|
87
130
|
SRow[theme='danger'] SCell:not([theme]) {
|
|
88
131
|
background-color: var(--intergalactic-table-td-cell-critical, #fff0f7);
|
|
@@ -92,11 +135,6 @@ SRow[theme='danger'][active] > SCell:not([theme]) {
|
|
|
92
135
|
background-color: var(--intergalactic-table-td-cell-critical-active, #ffd7df);
|
|
93
136
|
}
|
|
94
137
|
|
|
95
|
-
SRow:hover > SCell[theme='danger'],
|
|
96
|
-
SRow[theme='danger']:hover > SCell:not([theme]) {
|
|
97
|
-
background-color: var(--intergalactic-table-td-cell-critical-hover, #ffd7df);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
138
|
SCell {
|
|
101
139
|
display: flex;
|
|
102
140
|
height: 100%;
|
|
@@ -113,6 +151,7 @@ SCell {
|
|
|
113
151
|
outline: none;
|
|
114
152
|
|
|
115
153
|
SAccordionToggle {
|
|
154
|
+
margin-right: var(--intergalactic-spacing-3x, 12px);
|
|
116
155
|
transition: transform calc(var(--intergalactic-duration-accordion, 200) * 1ms) ease-out;
|
|
117
156
|
|
|
118
157
|
&[expanded] {
|
|
@@ -127,7 +166,7 @@ SCell[use='primary'] {
|
|
|
127
166
|
background-color: var(--intergalactic-bg-primary-neutral, #ffffff);
|
|
128
167
|
|
|
129
168
|
&[data-aria-level] {
|
|
130
|
-
padding-left: calc(var(--intergalactic-spacing-3x, 12px) + (var(--intergalactic-spacing-5x, 20px) * (var(--data-aria-level) - 1)));
|
|
169
|
+
padding-left: calc(var(--intergalactic-spacing-3x, 12px) + ((var(--intergalactic-spacing-5x, 20px) + var(--intergalactic-spacing-2x, 8px)) * (var(--data-aria-level) - 1)));
|
|
131
170
|
}
|
|
132
171
|
}
|
|
133
172
|
|
|
@@ -137,7 +176,7 @@ SCell[use='secondary'] {
|
|
|
137
176
|
background-color: var(--intergalactic-bg-primary-neutral, #ffffff);
|
|
138
177
|
|
|
139
178
|
&[data-aria-level] {
|
|
140
|
-
padding-left: calc(var(--intergalactic-spacing-2x, 8px) + (var(--intergalactic-spacing-5x, 20px) * (var(--data-aria-level) - 1)));
|
|
179
|
+
padding-left: calc(var(--intergalactic-spacing-2x, 8px) + ((var(--intergalactic-spacing-5x, 20px) + var(--intergalactic-spacing-2x, 8px)) * (var(--data-aria-level) - 1)));
|
|
141
180
|
}
|
|
142
181
|
}
|
|
143
182
|
|
|
@@ -5,9 +5,10 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.DataTable = exports.ACCORDION = void 0;
|
|
8
|
+
exports.ROW_GROUP = exports.DataTable = exports.ACCORDION = void 0;
|
|
9
9
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
12
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
12
13
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
14
|
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
@@ -20,15 +21,14 @@ var _baseComponents = require("@semcore/base-components");
|
|
|
20
21
|
var _Head = require("../Head/Head");
|
|
21
22
|
var _Body = require("../Body/Body");
|
|
22
23
|
var _useFocusLock = require("@semcore/core/lib/utils/use/useFocusLock");
|
|
23
|
-
var _syncScroll = _interopRequireDefault(require("@semcore/core/lib/utils/syncScroll"));
|
|
24
24
|
var _utils = require("../../utils");
|
|
25
25
|
var _findComponent = _interopRequireDefault(require("@semcore/core/lib/utils/findComponent"));
|
|
26
26
|
var _intergalacticDynamicLocales = require("../../translations/__intergalactic-dynamic-locales");
|
|
27
27
|
var _i18nEnhance = _interopRequireDefault(require("@semcore/core/lib/utils/enhances/i18nEnhance"));
|
|
28
28
|
var _uniqueID = _interopRequireDefault(require("@semcore/core/lib/utils/uniqueID"));
|
|
29
|
-
var _index = require("../../index");
|
|
30
29
|
var _MergedCells = require("../Body/MergedCells");
|
|
31
30
|
var _ref8 = require("@semcore/core/lib/utils/ref");
|
|
31
|
+
var _hasParent = require("@semcore/core/lib/utils/hasParent");
|
|
32
32
|
/*__reshadow-styles__:"./dataTable.shadow.css"*/
|
|
33
33
|
var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".___SDataTable_1yoby_gg_{display:grid;position:relative;align-items:start;min-width:-moz-fit-content;min-width:fit-content}.___SDataTable_1yoby_gg_.__gridTemplateColumns_1yoby_gg_{grid-template-columns:var(--gridTemplateColumns_1yoby)}.___SDataTable_1yoby_gg_.__gridTemplateAreas_1yoby_gg_{grid-template-areas:var(--gridTemplateAreas_1yoby)}" /*__inner_css_end__*/, "1yoby_gg_") /*__reshadow_css_end__*/, {
|
|
34
34
|
"__SDataTable": "___SDataTable_1yoby_gg_",
|
|
@@ -38,13 +38,16 @@ var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_star
|
|
|
38
38
|
"--gridTemplateAreas": "--gridTemplateAreas_1yoby"
|
|
39
39
|
});
|
|
40
40
|
/*__reshadow-styles__:"../../style/scroll-shadows.shadow.css"*/
|
|
41
|
-
var scrollStyles = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".
|
|
42
|
-
"__SScrollArea": "
|
|
43
|
-
"
|
|
44
|
-
"
|
|
41
|
+
var scrollStyles = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".___SScrollArea_14dz4_gg_{width:-moz-fit-content;width:fit-content}.___SScrollArea_14dz4_gg_ .___SShadowVertical_14dz4_gg_:before{display:none}.___SScrollArea_14dz4_gg_ .___SShadowHorizontal_14dz4_gg_:after,.___SScrollArea_14dz4_gg_ .___SShadowHorizontal_14dz4_gg_:before,.___SScrollArea_14dz4_gg_ .___SShadowVertical_14dz4_gg_:after{z-index:2}" /*__inner_css_end__*/, "14dz4_gg_") /*__reshadow_css_end__*/, {
|
|
42
|
+
"__SScrollArea": "___SScrollArea_14dz4_gg_",
|
|
43
|
+
"__SShadowVertical": "___SShadowVertical_14dz4_gg_",
|
|
44
|
+
"__SShadowHorizontal": "___SShadowHorizontal_14dz4_gg_"
|
|
45
45
|
});
|
|
46
46
|
var ACCORDION = Symbol('accordion');
|
|
47
47
|
exports.ACCORDION = ACCORDION;
|
|
48
|
+
var ROW_GROUP = Symbol('ROW_GROUP');
|
|
49
|
+
exports.ROW_GROUP = ROW_GROUP;
|
|
50
|
+
var SCROLL_BAR_HEIGHT = 12;
|
|
48
51
|
var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
49
52
|
(0, _inherits2["default"])(DataTableRoot, _Component);
|
|
50
53
|
var _super = (0, _createSuper2["default"])(DataTableRoot);
|
|
@@ -58,8 +61,7 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
58
61
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "tableContainerRef", /*#__PURE__*/React.createRef());
|
|
59
62
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "tableRef", /*#__PURE__*/React.createRef());
|
|
60
63
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "headerRef", /*#__PURE__*/React.createRef());
|
|
61
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "
|
|
62
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "scrollHeadRef", void 0);
|
|
64
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "spinnerRef", /*#__PURE__*/React.createRef());
|
|
63
65
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "gridAreaGroupMap", new Map());
|
|
64
66
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getRow", function (index) {
|
|
65
67
|
var _this$tableRef$curren;
|
|
@@ -72,6 +74,16 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
72
74
|
});
|
|
73
75
|
return hasFocusable;
|
|
74
76
|
});
|
|
77
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onExpandRow", function (expandedRowIndex) {
|
|
78
|
+
var expandedRows = _this.asProps.expandedRows;
|
|
79
|
+
if (expandedRows !== null && expandedRows !== void 0 && expandedRows.includes(expandedRowIndex)) {
|
|
80
|
+
_this.handlers.expandedRows(expandedRows.filter(function (row) {
|
|
81
|
+
return row !== expandedRowIndex;
|
|
82
|
+
}));
|
|
83
|
+
} else {
|
|
84
|
+
_this.handlers.expandedRows([].concat((0, _toConsumableArray2["default"])(expandedRows), [expandedRowIndex]));
|
|
85
|
+
}
|
|
86
|
+
});
|
|
75
87
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "changeFocusCell", function (rowIndex, colIndex, direction) {
|
|
76
88
|
var _this$tableRef$curren2, _this$tableRef$curren3;
|
|
77
89
|
var hasFocusable = _this.hasFocusableInHeader();
|
|
@@ -174,7 +186,11 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
174
186
|
}
|
|
175
187
|
});
|
|
176
188
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleFocus", function (e) {
|
|
177
|
-
if (
|
|
189
|
+
if (_this.asProps.loading) {
|
|
190
|
+
var _this$spinnerRef$curr;
|
|
191
|
+
(_this$spinnerRef$curr = _this.spinnerRef.current) === null || _this$spinnerRef$curr === void 0 ? void 0 : _this$spinnerRef$curr.focus();
|
|
192
|
+
e.currentTarget.setAttribute('tabIndex', '-1');
|
|
193
|
+
} else if ((!e.relatedTarget || !(0, _useFocusLock.isFocusInside)(e.currentTarget, e.relatedTarget)) && _core.lastInteraction.isKeyboard()) {
|
|
178
194
|
var _row;
|
|
179
195
|
if (_this.focusedCell[0] === -1 && _this.focusedCell[1] === -1) {
|
|
180
196
|
_this.initFocusableCell();
|
|
@@ -187,7 +203,13 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
187
203
|
}
|
|
188
204
|
var cell = (_row = row) === null || _row === void 0 ? void 0 : _row.querySelectorAll('[role=gridcell], [role=columnheader]').item(_this.focusedCell[1]);
|
|
189
205
|
cell === null || cell === void 0 ? void 0 : cell.removeAttribute('inert');
|
|
190
|
-
cell instanceof HTMLElement
|
|
206
|
+
if (cell instanceof HTMLElement) {
|
|
207
|
+
if ((0, _hasParent.hasParent)(e.target, cell)) {
|
|
208
|
+
e.target.focus();
|
|
209
|
+
} else {
|
|
210
|
+
cell.focus();
|
|
211
|
+
}
|
|
212
|
+
}
|
|
191
213
|
e.currentTarget.setAttribute('tabIndex', '-1');
|
|
192
214
|
}
|
|
193
215
|
});
|
|
@@ -202,14 +224,17 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
202
224
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleMouseMove", function () {
|
|
203
225
|
_this.setInert(false);
|
|
204
226
|
});
|
|
205
|
-
var createRef = (0, _syncScroll["default"])();
|
|
206
|
-
// first create body ref for master scroll
|
|
207
|
-
_this.scrollBodyRef = createRef('body');
|
|
208
|
-
_this.scrollHeadRef = createRef('head');
|
|
209
227
|
_this.columns = _this.calculateColumns();
|
|
210
228
|
return _this;
|
|
211
229
|
}
|
|
212
230
|
(0, _createClass2["default"])(DataTableRoot, [{
|
|
231
|
+
key: "uncontrolledProps",
|
|
232
|
+
value: function uncontrolledProps() {
|
|
233
|
+
return {
|
|
234
|
+
expandedRows: []
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
}, {
|
|
213
238
|
key: "componentDidMount",
|
|
214
239
|
value: function componentDidMount() {
|
|
215
240
|
this.forceUpdate();
|
|
@@ -217,8 +242,21 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
217
242
|
}, {
|
|
218
243
|
key: "totalRows",
|
|
219
244
|
get: function get() {
|
|
220
|
-
var
|
|
221
|
-
|
|
245
|
+
var _this2 = this;
|
|
246
|
+
var _this$asProps = this.asProps,
|
|
247
|
+
totalRows = _this$asProps.totalRows,
|
|
248
|
+
expandedRows = _this$asProps.expandedRows;
|
|
249
|
+
var expandedRowsCount = expandedRows === null || expandedRows === void 0 ? void 0 : expandedRows.reduce(function (acc, rowIndex) {
|
|
250
|
+
var dtRow = _this2.calculateRows().flat()[rowIndex];
|
|
251
|
+
var expandedRows = dtRow[ACCORDION];
|
|
252
|
+
if (Array.isArray(expandedRows)) {
|
|
253
|
+
acc = acc + expandedRows.length;
|
|
254
|
+
} else {
|
|
255
|
+
acc = acc + 1;
|
|
256
|
+
}
|
|
257
|
+
return acc;
|
|
258
|
+
}, 0);
|
|
259
|
+
return (totalRows !== null && totalRows !== void 0 ? totalRows : this.calculateRows().length) + expandedRowsCount;
|
|
222
260
|
}
|
|
223
261
|
}, {
|
|
224
262
|
key: "gridSettings",
|
|
@@ -237,13 +275,13 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
237
275
|
}, {
|
|
238
276
|
key: "getHeadProps",
|
|
239
277
|
value: function getHeadProps() {
|
|
240
|
-
var _this$
|
|
241
|
-
use = _this$
|
|
242
|
-
compact = _this$
|
|
243
|
-
sort = _this$
|
|
244
|
-
onSortChange = _this$
|
|
245
|
-
getI18nText = _this$
|
|
246
|
-
uid = _this$
|
|
278
|
+
var _this$asProps2 = this.asProps,
|
|
279
|
+
use = _this$asProps2.use,
|
|
280
|
+
compact = _this$asProps2.compact,
|
|
281
|
+
sort = _this$asProps2.sort,
|
|
282
|
+
onSortChange = _this$asProps2.onSortChange,
|
|
283
|
+
getI18nText = _this$asProps2.getI18nText,
|
|
284
|
+
uid = _this$asProps2.uid;
|
|
247
285
|
var _this$gridSettings = this.gridSettings,
|
|
248
286
|
gridTemplateColumns = _this$gridSettings.gridTemplateColumns,
|
|
249
287
|
gridTemplateAreas = _this$gridSettings.gridTemplateAreas;
|
|
@@ -266,11 +304,12 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
266
304
|
key: "getBodyProps",
|
|
267
305
|
value: function getBodyProps() {
|
|
268
306
|
var _header$children;
|
|
269
|
-
var _this$
|
|
270
|
-
use = _this$
|
|
271
|
-
compact = _this$
|
|
272
|
-
loading = _this$
|
|
273
|
-
getI18nText = _this$
|
|
307
|
+
var _this$asProps3 = this.asProps,
|
|
308
|
+
use = _this$asProps3.use,
|
|
309
|
+
compact = _this$asProps3.compact,
|
|
310
|
+
loading = _this$asProps3.loading,
|
|
311
|
+
getI18nText = _this$asProps3.getI18nText,
|
|
312
|
+
expandedRows = _this$asProps3.expandedRows;
|
|
274
313
|
var rows = this.calculateRows();
|
|
275
314
|
var _this$gridSettings2 = this.gridSettings,
|
|
276
315
|
gridTemplateColumns = _this$gridSettings2.gridTemplateColumns,
|
|
@@ -286,17 +325,17 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
286
325
|
return {
|
|
287
326
|
columns: this.columns,
|
|
288
327
|
rows: rows,
|
|
328
|
+
flatRows: rows.flat(),
|
|
289
329
|
use: use,
|
|
290
|
-
scrollRef: this.scrollBodyRef,
|
|
291
|
-
headerRows: this.columns.some(function (column) {
|
|
292
|
-
return Boolean(column.parent);
|
|
293
|
-
}) ? 2 : 1,
|
|
294
330
|
compact: Boolean(compact),
|
|
295
331
|
gridTemplateColumns: gridTemplateColumns,
|
|
296
332
|
gridTemplateAreas: gridTemplateAreas,
|
|
297
333
|
loading: loading,
|
|
298
334
|
headerHeight: headerHeight,
|
|
299
|
-
getI18nText: getI18nText
|
|
335
|
+
getI18nText: getI18nText,
|
|
336
|
+
expandedRows: expandedRows,
|
|
337
|
+
onExpandRow: this.onExpandRow,
|
|
338
|
+
spinnerRef: this.spinnerRef
|
|
300
339
|
};
|
|
301
340
|
}
|
|
302
341
|
}, {
|
|
@@ -318,16 +357,15 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
318
357
|
var _ref = this.asProps,
|
|
319
358
|
_ref2;
|
|
320
359
|
var SDataTable = _baseComponents.Box;
|
|
321
|
-
var _this$
|
|
322
|
-
Children = _this$
|
|
323
|
-
styles = _this$
|
|
324
|
-
w = _this$
|
|
325
|
-
wMax = _this$
|
|
326
|
-
wMin = _this$
|
|
327
|
-
h = _this$
|
|
328
|
-
hMax = _this$
|
|
329
|
-
hMin = _this$
|
|
330
|
-
loading = _this$asProps3.loading;
|
|
360
|
+
var _this$asProps4 = this.asProps,
|
|
361
|
+
Children = _this$asProps4.Children,
|
|
362
|
+
styles = _this$asProps4.styles,
|
|
363
|
+
w = _this$asProps4.w,
|
|
364
|
+
wMax = _this$asProps4.wMax,
|
|
365
|
+
wMin = _this$asProps4.wMin,
|
|
366
|
+
h = _this$asProps4.h,
|
|
367
|
+
hMax = _this$asProps4.hMax,
|
|
368
|
+
hMin = _this$asProps4.hMin;
|
|
331
369
|
var _getScrollOffsetValue = (0, _utils.getScrollOffsetValue)(this.columns),
|
|
332
370
|
_getScrollOffsetValue2 = (0, _slicedToArray2["default"])(_getScrollOffsetValue, 2),
|
|
333
371
|
offsetLeftSum = _getScrollOffsetValue2[0],
|
|
@@ -336,13 +374,14 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
336
374
|
gridTemplateColumns = _this$gridSettings3.gridTemplateColumns,
|
|
337
375
|
gridTemplateAreas = _this$gridSettings3.gridTemplateAreas;
|
|
338
376
|
var Head = (0, _findComponent["default"])(Children, ['DataTable.Head']);
|
|
339
|
-
var
|
|
377
|
+
var topOffset = Head !== null && Head !== void 0 && Head.props.sticky || Head !== null && Head !== void 0 && Head.props.withScrollBar ? this.getTopScrollOffset() : undefined;
|
|
340
378
|
var width = w !== null && w !== void 0 ? w : this.columns.some(function (c) {
|
|
341
379
|
return c.gridColumnWidth === 'auto' || c.gridColumnWidth === '1fr';
|
|
342
380
|
}) ? '100%' : undefined;
|
|
343
381
|
return _ref2 = (0, _core.sstyled)(styles), /*#__PURE__*/React.createElement(_baseComponents.ScrollArea, _ref2.cn("ScrollArea", {
|
|
344
382
|
"leftOffset": offsetLeftSum,
|
|
345
383
|
"rightOffset": offsetRightSum,
|
|
384
|
+
"topOffset": topOffset,
|
|
346
385
|
"w": width,
|
|
347
386
|
"wMax": wMax,
|
|
348
387
|
"wMin": wMin,
|
|
@@ -374,16 +413,22 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
374
413
|
"use:h": undefined,
|
|
375
414
|
"use:hMax": undefined,
|
|
376
415
|
"use:hMin": undefined
|
|
377
|
-
}, _ref))),
|
|
378
|
-
orientation: "horizontal"
|
|
416
|
+
}, _ref))), /*#__PURE__*/React.createElement(Children, _ref2.cn("Children", {})))), (Head === null || Head === void 0 ? void 0 : Head.props.withScrollBar) && topOffset && /*#__PURE__*/React.createElement(_baseComponents.ScrollArea.Bar, {
|
|
417
|
+
orientation: "horizontal",
|
|
418
|
+
top: topOffset - SCROLL_BAR_HEIGHT,
|
|
419
|
+
zIndex: 3
|
|
420
|
+
}), /*#__PURE__*/React.createElement(_baseComponents.ScrollArea.Bar, {
|
|
421
|
+
orientation: "horizontal",
|
|
422
|
+
zIndex: 2
|
|
379
423
|
}), /*#__PURE__*/React.createElement(_baseComponents.ScrollArea.Bar, {
|
|
380
|
-
orientation: "vertical"
|
|
424
|
+
orientation: "vertical",
|
|
425
|
+
zIndex: 2
|
|
381
426
|
}));
|
|
382
427
|
}
|
|
383
428
|
}, {
|
|
384
429
|
key: "calculateColumns",
|
|
385
430
|
value: function calculateColumns() {
|
|
386
|
-
var
|
|
431
|
+
var _this3 = this;
|
|
387
432
|
var _this$props = this.props,
|
|
388
433
|
children = _this$props.children,
|
|
389
434
|
data = _this$props.data;
|
|
@@ -421,27 +466,23 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
421
466
|
alignContent: columnElement.props.alignContent,
|
|
422
467
|
justifyContent: columnElement.props.justifyContent
|
|
423
468
|
};
|
|
424
|
-
|
|
425
|
-
// this.gridAreaColumnMap.set(
|
|
426
|
-
// columnIndex,
|
|
427
|
-
// `1 / ${gridColumnIndex} / ${hasGroup ? '3' : '2'} / ${gridColumnIndex + 1}`,
|
|
428
|
-
// );
|
|
429
|
-
// columnIndex++;
|
|
430
|
-
// gridColumnIndex++;
|
|
431
|
-
|
|
432
469
|
return column;
|
|
433
|
-
// columns.push(column);
|
|
434
470
|
};
|
|
435
|
-
|
|
471
|
+
var childIsColumn = function childIsColumn(child) {
|
|
472
|
+
return child.type === _Head.Head.Column;
|
|
473
|
+
};
|
|
474
|
+
var childIsGroup = function childIsGroup(child) {
|
|
475
|
+
return child.type === _Head.Head.Group;
|
|
476
|
+
};
|
|
436
477
|
React.Children.forEach(HeadComponent.props.children, function (child, i) {
|
|
437
478
|
if (! /*#__PURE__*/React.isValidElement(child)) return;
|
|
438
|
-
if (child
|
|
479
|
+
if (childIsColumn(child)) {
|
|
439
480
|
var col = makeColumn(child);
|
|
440
481
|
col.gridArea = "1 / ".concat(gridColumnIndex, " / ").concat(hasGroup ? '3' : '2', " / ").concat(gridColumnIndex + 1);
|
|
441
482
|
columnIndex++;
|
|
442
483
|
gridColumnIndex++;
|
|
443
484
|
columns.push(col);
|
|
444
|
-
} else if (child
|
|
485
|
+
} else if (childIsGroup(child)) {
|
|
445
486
|
var Group = child;
|
|
446
487
|
var childCount = React.Children.count(child.props.children);
|
|
447
488
|
var initGridColumn = gridColumnIndex;
|
|
@@ -464,78 +505,69 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
464
505
|
columns.push(_col);
|
|
465
506
|
}
|
|
466
507
|
});
|
|
467
|
-
|
|
508
|
+
_this3.gridAreaGroupMap.set(groupIndex, "1 / ".concat(initGridColumn, " / 2 / ").concat(gridColumnIndex));
|
|
468
509
|
groupIndex++;
|
|
469
510
|
}
|
|
470
511
|
});
|
|
471
512
|
return columns.filter(Boolean);
|
|
472
|
-
|
|
473
|
-
// return Columns.map((c) => {
|
|
474
|
-
// const column = {
|
|
475
|
-
// name: c.props.name,
|
|
476
|
-
// ref: (node: HTMLElement | null) => {
|
|
477
|
-
// if (node) {
|
|
478
|
-
// const calculatedWidth = node.getBoundingClientRect().width;
|
|
479
|
-
// column.calculatedWidth = calculatedWidth;
|
|
480
|
-
// }
|
|
481
|
-
//
|
|
482
|
-
// return { current: node };
|
|
483
|
-
// },
|
|
484
|
-
// gridColumnWidth: calculateGridTemplateColumn(c),
|
|
485
|
-
// fixed: c.props.fixed,
|
|
486
|
-
// calculatedWidth: 0,
|
|
487
|
-
// };
|
|
488
|
-
//
|
|
489
|
-
// return column;
|
|
490
|
-
// });
|
|
491
|
-
|
|
492
|
-
// return columns;
|
|
493
513
|
}
|
|
494
514
|
}, {
|
|
495
515
|
key: "calculateRows",
|
|
496
516
|
value: function calculateRows() {
|
|
497
|
-
var
|
|
517
|
+
var _this4 = this;
|
|
498
518
|
var data = this.asProps.data;
|
|
499
519
|
var rows = [];
|
|
500
520
|
var rowIndex = 0;
|
|
501
|
-
var
|
|
521
|
+
var makeDtRow = function makeDtRow(row) {
|
|
502
522
|
var dtRow = Object.entries(row).reduce(function (acc, _ref4) {
|
|
503
523
|
var _ref5 = (0, _slicedToArray2["default"])(_ref4, 2),
|
|
504
524
|
key = _ref5[0],
|
|
505
525
|
value = _ref5[1];
|
|
506
|
-
var columnsToRow = key.split(
|
|
526
|
+
var columnsToRow = key.split(_this4.columnsSplitter);
|
|
507
527
|
if (columnsToRow.length === 1) {
|
|
508
|
-
acc[key] = value;
|
|
528
|
+
acc[key] = value !== null && value !== void 0 ? value : '';
|
|
509
529
|
} else {
|
|
510
|
-
acc[columnsToRow[0]] = new _MergedCells.MergedColumnsCell(value,
|
|
530
|
+
acc[columnsToRow[0]] = new _MergedCells.MergedColumnsCell(value, {
|
|
531
|
+
dataKey: key,
|
|
532
|
+
size: columnsToRow.length
|
|
533
|
+
});
|
|
511
534
|
}
|
|
512
535
|
if (row[ACCORDION]) {
|
|
513
536
|
acc[ACCORDION] = row[ACCORDION];
|
|
514
537
|
}
|
|
515
538
|
return acc;
|
|
516
539
|
}, {});
|
|
517
|
-
|
|
518
|
-
rowIndex++;
|
|
540
|
+
return dtRow;
|
|
519
541
|
};
|
|
520
|
-
data.forEach(function (row
|
|
521
|
-
var groupedRows = row[
|
|
542
|
+
data.forEach(function (row) {
|
|
543
|
+
var groupedRows = row[ROW_GROUP];
|
|
544
|
+
var fromRow = rowIndex + 2; // 1 - for header, 1 - because start not from 0, but from 1
|
|
545
|
+
|
|
522
546
|
if (groupedRows) {
|
|
547
|
+
var toRow = fromRow + groupedRows.length;
|
|
548
|
+
var innerRows = [];
|
|
523
549
|
groupedRows.forEach(function (childRow, index) {
|
|
550
|
+
var dtRow;
|
|
524
551
|
if (index === 0) {
|
|
525
552
|
var rowData = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, childRow), Object.entries(row).reduce(function (acc, _ref6) {
|
|
526
553
|
var _ref7 = (0, _slicedToArray2["default"])(_ref6, 2),
|
|
527
554
|
key = _ref7[0],
|
|
528
555
|
value = _ref7[1];
|
|
529
|
-
acc[key] = new _MergedCells.MergedRowsCell(value,
|
|
556
|
+
acc[key] = new _MergedCells.MergedRowsCell(value, [fromRow, toRow]);
|
|
530
557
|
return acc;
|
|
531
558
|
}, {}));
|
|
532
|
-
|
|
559
|
+
dtRow = makeDtRow(rowData);
|
|
533
560
|
} else {
|
|
534
|
-
|
|
561
|
+
dtRow = makeDtRow(childRow);
|
|
535
562
|
}
|
|
563
|
+
innerRows.push(dtRow);
|
|
564
|
+
rowIndex++;
|
|
536
565
|
});
|
|
566
|
+
rows.push(innerRows);
|
|
537
567
|
} else {
|
|
538
|
-
|
|
568
|
+
var dtRow = makeDtRow(row);
|
|
569
|
+
rows.push(dtRow);
|
|
570
|
+
rowIndex++;
|
|
539
571
|
}
|
|
540
572
|
});
|
|
541
573
|
return rows;
|
|
@@ -546,6 +578,22 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
546
578
|
var _c$props$gtcWidth;
|
|
547
579
|
return (_c$props$gtcWidth = c.props.gtcWidth) !== null && _c$props$gtcWidth !== void 0 ? _c$props$gtcWidth : this.props.defaultGridTemplateColumnWidth;
|
|
548
580
|
}
|
|
581
|
+
}, {
|
|
582
|
+
key: "getTopScrollOffset",
|
|
583
|
+
value: function getTopScrollOffset() {
|
|
584
|
+
var _this$headerRef$curre;
|
|
585
|
+
var header = (_this$headerRef$curre = this.headerRef.current) === null || _this$headerRef$curre === void 0 ? void 0 : _this$headerRef$curre.children;
|
|
586
|
+
var height = 0;
|
|
587
|
+
for (var i = 0; i < ((_header$length = header === null || header === void 0 ? void 0 : header.length) !== null && _header$length !== void 0 ? _header$length : 0); i++) {
|
|
588
|
+
var _header$length, _header$item;
|
|
589
|
+
var columnHeight = header === null || header === void 0 ? void 0 : (_header$item = header.item(i)) === null || _header$item === void 0 ? void 0 : _header$item.getBoundingClientRect().height;
|
|
590
|
+
if (columnHeight) {
|
|
591
|
+
height = columnHeight;
|
|
592
|
+
break;
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
return height;
|
|
596
|
+
}
|
|
549
597
|
}]);
|
|
550
598
|
return DataTableRoot;
|
|
551
599
|
}(_core.Component);
|
|
@@ -555,7 +603,8 @@ var DataTableRoot = /*#__PURE__*/function (_Component) {
|
|
|
555
603
|
(0, _defineProperty2["default"])(DataTableRoot, "defaultProps", {
|
|
556
604
|
use: 'primary',
|
|
557
605
|
defaultGridTemplateColumnWidth: 'auto',
|
|
558
|
-
h: 'auto'
|
|
606
|
+
h: 'auto',
|
|
607
|
+
defaultExpandedRows: []
|
|
559
608
|
});
|
|
560
609
|
var DataTable = (0, _core.createComponent)(DataTableRoot, {
|
|
561
610
|
Head: _Head.Head,
|