@laerdal/life-react-components 1.3.2-dev.6.full → 1.4.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/dist/esm/Button/Iconbutton.js +0 -1
- package/dist/esm/Button/Iconbutton.js.map +1 -1
- package/dist/esm/Dropdown/DropdownButton.js +5 -2
- package/dist/esm/Dropdown/DropdownButton.js.map +1 -1
- package/dist/esm/Dropdown/DropdownFilter.js.map +1 -1
- package/dist/esm/HyperLink/HyperLink.js +2 -1
- package/dist/esm/HyperLink/HyperLink.js.map +1 -1
- package/dist/esm/InputFields/Checkbox.js +23 -13
- package/dist/esm/InputFields/Checkbox.js.map +1 -1
- package/dist/esm/Modals/ModalDialog.js +7 -4
- package/dist/esm/Modals/ModalDialog.js.map +1 -1
- package/dist/esm/Modals/ModalNote.js +1 -1
- package/dist/esm/Modals/ModalNote.js.map +1 -1
- package/dist/esm/Table/Table.js +131 -181
- package/dist/esm/Table/Table.js.map +1 -1
- package/dist/esm/Table/TableBody.js +135 -0
- package/dist/esm/Table/TableBody.js.map +1 -0
- package/dist/esm/Table/TableFooter.js +68 -0
- package/dist/esm/Table/TableFooter.js.map +1 -0
- package/dist/esm/Table/TableHeaders.js +55 -0
- package/dist/esm/Table/TableHeaders.js.map +1 -0
- package/dist/esm/Table/TableStyles.js +181 -110
- package/dist/esm/Table/TableStyles.js.map +1 -1
- package/dist/esm/Table/__tests__/Table.test.js +162 -21
- package/dist/esm/Table/__tests__/Table.test.js.map +1 -1
- package/dist/js/Button/Iconbutton.d.ts +2 -2
- package/dist/js/Button/Iconbutton.js +0 -1
- package/dist/js/Button/Iconbutton.js.map +1 -1
- package/dist/js/Dropdown/DropdownButton.d.ts +1 -1
- package/dist/js/Dropdown/DropdownButton.js +5 -2
- package/dist/js/Dropdown/DropdownButton.js.map +1 -1
- package/dist/js/Dropdown/DropdownButtonTypes.d.ts +1 -0
- package/dist/js/Dropdown/DropdownFilter.d.ts +1 -1
- package/dist/js/Dropdown/DropdownFilter.js.map +1 -1
- package/dist/js/HyperLink/HyperLink.d.ts +1 -1
- package/dist/js/HyperLink/HyperLink.js +2 -2
- package/dist/js/HyperLink/HyperLink.js.map +1 -1
- package/dist/js/InputFields/Checkbox.d.ts +3 -2
- package/dist/js/InputFields/Checkbox.js +13 -11
- package/dist/js/InputFields/Checkbox.js.map +1 -1
- package/dist/js/Modals/ModalDialog.d.ts +2 -1
- package/dist/js/Modals/ModalDialog.js +7 -4
- package/dist/js/Modals/ModalDialog.js.map +1 -1
- package/dist/js/Modals/ModalNote.d.ts +1 -1
- package/dist/js/Modals/ModalNote.js +1 -1
- package/dist/js/Modals/ModalNote.js.map +1 -1
- package/dist/js/Table/Table.js +166 -209
- package/dist/js/Table/Table.js.map +1 -1
- package/dist/js/Table/TableBody.d.ts +9 -0
- package/dist/js/Table/TableBody.js +167 -0
- package/dist/js/Table/TableBody.js.map +1 -0
- package/dist/js/Table/TableFooter.d.ts +15 -0
- package/dist/js/Table/TableFooter.js +95 -0
- package/dist/js/Table/TableFooter.js.map +1 -0
- package/dist/js/Table/TableHeaders.d.ts +9 -0
- package/dist/js/Table/TableHeaders.js +77 -0
- package/dist/js/Table/TableHeaders.js.map +1 -0
- package/dist/js/Table/TableStyles.d.ts +19 -7
- package/dist/js/Table/TableStyles.js +66 -16
- package/dist/js/Table/TableStyles.js.map +1 -1
- package/dist/js/Table/TableTypes.d.ts +26 -16
- package/dist/js/Table/__tests__/Table.test.js +172 -30
- package/dist/js/Table/__tests__/Table.test.js.map +1 -1
- package/dist/umd/Button/Iconbutton.js +0 -1
- package/dist/umd/Button/Iconbutton.js.map +1 -1
- package/dist/umd/Dropdown/DropdownButton.js +5 -2
- package/dist/umd/Dropdown/DropdownButton.js.map +1 -1
- package/dist/umd/Dropdown/DropdownFilter.js.map +1 -1
- package/dist/umd/HyperLink/HyperLink.js +2 -1
- package/dist/umd/HyperLink/HyperLink.js.map +1 -1
- package/dist/umd/InputFields/Checkbox.js +23 -13
- package/dist/umd/InputFields/Checkbox.js.map +1 -1
- package/dist/umd/Modals/ModalDialog.js +7 -4
- package/dist/umd/Modals/ModalDialog.js.map +1 -1
- package/dist/umd/Modals/ModalNote.js +1 -1
- package/dist/umd/Modals/ModalNote.js.map +1 -1
- package/dist/umd/Table/Table.js +157 -188
- package/dist/umd/Table/Table.js.map +1 -1
- package/dist/umd/Table/TableBody.js +270 -0
- package/dist/umd/Table/TableBody.js.map +1 -0
- package/dist/umd/Table/TableFooter.js +89 -0
- package/dist/umd/Table/TableFooter.js.map +1 -0
- package/dist/umd/Table/TableHeaders.js +91 -0
- package/dist/umd/Table/TableHeaders.js.map +1 -0
- package/dist/umd/Table/TableStyles.js +185 -115
- package/dist/umd/Table/TableStyles.js.map +1 -1
- package/dist/umd/Table/__tests__/Table.test.js +164 -25
- package/dist/umd/Table/__tests__/Table.test.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
2
|
if (typeof define === "function" && define.amd) {
|
|
3
|
-
define(["exports", "styled-components", "../styles", "../styles/typography"], factory);
|
|
3
|
+
define(["exports", "styled-components", "../styles", "../styles/typography", "../styles/z-indexes"], factory);
|
|
4
4
|
} else if (typeof exports !== "undefined") {
|
|
5
|
-
factory(exports, require("styled-components"), require("../styles"), require("../styles/typography"));
|
|
5
|
+
factory(exports, require("styled-components"), require("../styles"), require("../styles/typography"), require("../styles/z-indexes"));
|
|
6
6
|
} else {
|
|
7
7
|
var mod = {
|
|
8
8
|
exports: {}
|
|
9
9
|
};
|
|
10
|
-
factory(mod.exports, global.styledComponents, global.styles, global.typography);
|
|
10
|
+
factory(mod.exports, global.styledComponents, global.styles, global.typography, global.zIndexes);
|
|
11
11
|
global.undefined = mod.exports;
|
|
12
12
|
}
|
|
13
|
-
})(this, function (exports, _styledComponents, _styles, _typography) {
|
|
13
|
+
})(this, function (exports, _styledComponents, _styles, _typography, _zIndexes) {
|
|
14
14
|
"use strict";
|
|
15
15
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", {
|
|
17
17
|
value: true
|
|
18
18
|
});
|
|
19
|
-
exports.
|
|
19
|
+
exports.StyledTableFooterCollapseButton = exports.StyledTableSpinner = exports.StyledTableFooterControls = exports.StyledTableFooterCurrentInfo = exports.StyledTableFooterContent = exports.StyledTableFooter = exports.StyledTableCellText = exports.StyledTableCellIcon = exports.StyledTableCellContent = exports.StyledTableCell = exports.StyledTableBody = exports.StyledTableBodyRow = exports.StyledTableHeaderColumn = exports.StyledTableHeaderColumnContent = exports.StyledTableHeaderColumns = exports.StyledTableHeaderTitleContent = exports.StyledTableHeaderTitle = exports.StyledTableHeader = exports.StyledTable = exports.TableWrapper = undefined;
|
|
20
20
|
|
|
21
21
|
var _styledComponents2 = _interopRequireDefault(_styledComponents);
|
|
22
22
|
|
|
@@ -40,170 +40,240 @@
|
|
|
40
40
|
const TableWrapper = exports.TableWrapper = _styledComponents2.default.div`
|
|
41
41
|
position: relative;
|
|
42
42
|
`;
|
|
43
|
-
const
|
|
44
|
-
height: 100%;
|
|
45
|
-
width: 100%;
|
|
46
|
-
position: absolute;
|
|
47
|
-
background-color: rgba(0, 0, 0, 0.5);
|
|
48
|
-
top: 0;
|
|
49
|
-
`;
|
|
50
|
-
const TableContainer = exports.TableContainer = _styledComponents2.default.table`
|
|
43
|
+
const StyledTable = exports.StyledTable = _styledComponents2.default.table`
|
|
51
44
|
background: transparent;
|
|
52
45
|
width: 100%;
|
|
53
|
-
|
|
54
|
-
|
|
46
|
+
table-layout: fixed;
|
|
47
|
+
`;
|
|
48
|
+
const StyledTableHeader = exports.StyledTableHeader = _styledComponents2.default.thead`
|
|
49
|
+
`;
|
|
50
|
+
const StyledTableHeaderTitle = exports.StyledTableHeaderTitle = _styledComponents2.default.tr`
|
|
55
51
|
`;
|
|
56
|
-
const
|
|
57
|
-
|
|
52
|
+
const StyledTableHeaderTitleContent = exports.StyledTableHeaderTitleContent = _styledComponents2.default.div`
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
justify-content: space-between;
|
|
56
|
+
width: 100%;
|
|
57
|
+
box-sizing: border-box;
|
|
58
|
+
min-height: 56px;
|
|
58
59
|
border-bottom: 1px solid ${_styles.COLORS.neutral_200};
|
|
60
|
+
border-top: 2px solid ${_styles.COLORS.neutral_200};
|
|
61
|
+
padding: 0 16px;
|
|
59
62
|
|
|
60
|
-
${(0, _typography.ComponentLStyling)(_typography.ComponentTextStyle.Bold, _styles.COLORS.
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
div {
|
|
64
|
-
display: flex;
|
|
65
|
-
justify-content: space-between;
|
|
66
|
-
align-items: center;
|
|
67
|
-
|
|
68
|
-
svg {
|
|
69
|
-
cursor: pointer;
|
|
70
|
-
}
|
|
63
|
+
${(0, _typography.ComponentLStyling)(_typography.ComponentTextStyle.Bold, _styles.COLORS.black)}
|
|
64
|
+
.title-menu {
|
|
65
|
+
margin-right: -16px;
|
|
71
66
|
}
|
|
72
67
|
`;
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
68
|
+
const StyledTableHeaderColumns = exports.StyledTableHeaderColumns = _styledComponents2.default.tr`
|
|
69
|
+
`;
|
|
70
|
+
const StyledTableHeaderColumnContent = exports.StyledTableHeaderColumnContent = _styledComponents2.default.div`
|
|
71
|
+
box-sizing: border-box;
|
|
72
|
+
min-height: 56px;
|
|
73
|
+
padding: 0 16px;
|
|
74
|
+
height: 100%;
|
|
75
|
+
display: flex;
|
|
76
|
+
align-items: center;
|
|
77
|
+
justify-content: space-between;
|
|
78
|
+
border-top: 1px solid ${_styles.COLORS.neutral_200};
|
|
79
|
+
border-bottom: 1px solid ${_styles.COLORS.neutral_200};
|
|
80
|
+
`;
|
|
81
|
+
const StyledTableHeaderColumn = exports.StyledTableHeaderColumn = _styledComponents2.default.th`
|
|
77
82
|
${(0, _typography.ComponentSStyling)(_typography.ComponentTextStyle.Bold, _styles.COLORS.neutral_600)}
|
|
78
|
-
|
|
79
|
-
text-align: left;
|
|
80
|
-
|
|
81
|
-
&.justify-center {
|
|
82
|
-
text-align: center;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
&.justify-left {
|
|
86
|
-
text-align: left;
|
|
87
|
-
}
|
|
83
|
+
position: relative;
|
|
88
84
|
|
|
89
|
-
|
|
90
|
-
text-align: right;
|
|
91
|
-
}
|
|
85
|
+
background-color: ${_styles.COLORS.white};
|
|
92
86
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
87
|
+
//fixes header heights no idea why
|
|
88
|
+
height: 1px;
|
|
96
89
|
|
|
97
90
|
&.sortable {
|
|
98
91
|
cursor: pointer;
|
|
99
92
|
|
|
100
|
-
|
|
101
|
-
|
|
93
|
+
&:hover {
|
|
94
|
+
background-color: ${_styles.COLORS.primary_20};
|
|
95
|
+
color: ${_styles.COLORS.primary_700};
|
|
96
|
+
z-index: ${_zIndexes.Z_INDEXES.hover};
|
|
102
97
|
}
|
|
103
98
|
|
|
104
|
-
&:
|
|
105
|
-
background: ${_styles.COLORS.
|
|
99
|
+
&:active {
|
|
100
|
+
background-color: ${_styles.COLORS.primary_100};
|
|
101
|
+
color: ${_styles.COLORS.primary_800};
|
|
102
|
+
box-shadow: none !important;
|
|
103
|
+
z-index: ${_zIndexes.Z_INDEXES.active};
|
|
106
104
|
}
|
|
107
105
|
|
|
108
106
|
&:focus {
|
|
109
|
-
|
|
107
|
+
outline: none;
|
|
108
|
+
box-shadow: 0 4px 12px ${_styles.COLORS.focus_25}, 0 0 8px ${_styles.COLORS.focus};
|
|
109
|
+
z-index: ${_zIndexes.Z_INDEXES.focus};
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
|
-
`;
|
|
113
|
-
const TableDataRow = exports.TableDataRow = _styledComponents2.default.tr`
|
|
114
|
-
background-color: ${_styles.COLORS.neutral_100};
|
|
115
112
|
|
|
116
|
-
|
|
113
|
+
&.sortable ${StyledTableHeaderColumnContent} > svg {
|
|
114
|
+
opacity: 0;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&.sortable.sorted ${StyledTableHeaderColumnContent} > svg {
|
|
118
|
+
opacity: 1;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
&.sorted {
|
|
117
122
|
background-color: ${_styles.COLORS.neutral_20};
|
|
118
123
|
}
|
|
119
124
|
|
|
125
|
+
`;
|
|
126
|
+
const StyledTableBodyRow = exports.StyledTableBodyRow = _styledComponents2.default.tr`
|
|
127
|
+
cursor: pointer;
|
|
128
|
+
position: relative;
|
|
129
|
+
outline: none;
|
|
130
|
+
|
|
120
131
|
&:hover {
|
|
121
|
-
cursor: pointer;
|
|
122
132
|
background-color: ${_styles.COLORS.primary_200};
|
|
133
|
+
z-index: ${_zIndexes.Z_INDEXES.hover};
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
&:focus {
|
|
137
|
+
background-color: ${_styles.COLORS.primary_200};
|
|
138
|
+
box-shadow: 0px 4px 12px rgba(46, 127, 161, 0.25), 0px 0px 8px #2E7FA1;
|
|
139
|
+
z-index: ${_zIndexes.Z_INDEXES.focus};
|
|
140
|
+
outline: none;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
&:active {
|
|
144
|
+
box-shadow: none;
|
|
145
|
+
z-index: ${_zIndexes.Z_INDEXES.active};
|
|
123
146
|
}
|
|
124
147
|
|
|
125
|
-
|
|
126
|
-
|
|
148
|
+
`;
|
|
149
|
+
const StyledTableBody = exports.StyledTableBody = _styledComponents2.default.tbody`
|
|
150
|
+
${StyledTableBodyRow}:nth-child(odd):not(:hover):not(:focus):not(:active) {
|
|
127
151
|
background-color: ${_styles.COLORS.neutral_100};
|
|
128
152
|
}
|
|
153
|
+
|
|
154
|
+
${StyledTableBodyRow}:nth-child(even):not(:hover):not(:focus):not(:active) {
|
|
155
|
+
background-color: ${_styles.COLORS.neutral_20};
|
|
156
|
+
}
|
|
129
157
|
`;
|
|
130
|
-
const
|
|
131
|
-
|
|
158
|
+
const StyledTableCell = exports.StyledTableCell = _styledComponents2.default.td``;
|
|
159
|
+
const StyledTableCellContent = exports.StyledTableCellContent = _styledComponents2.default.div`
|
|
160
|
+
min-height: 48px;
|
|
132
161
|
|
|
162
|
+
padding: 0 16px;
|
|
133
163
|
${(0, _typography.ComponentSStyling)(_typography.ComponentTextStyle.Regular, _styles.COLORS.black)}
|
|
134
|
-
padding: 15px 16px;
|
|
135
|
-
border: none;
|
|
136
164
|
|
|
137
|
-
|
|
165
|
+
display: flex;
|
|
166
|
+
align-items: center;
|
|
167
|
+
justify-content: left;
|
|
168
|
+
gap: 8px;
|
|
169
|
+
|
|
170
|
+
&.truncate-text,
|
|
171
|
+
&.truncate-text span {
|
|
138
172
|
overflow: hidden;
|
|
139
173
|
text-overflow: ellipsis;
|
|
140
174
|
white-space: nowrap;
|
|
141
175
|
}
|
|
142
176
|
|
|
143
|
-
&.
|
|
144
|
-
|
|
177
|
+
&.left {
|
|
178
|
+
justify-content: left;
|
|
145
179
|
}
|
|
146
180
|
|
|
147
|
-
&.
|
|
148
|
-
|
|
181
|
+
&.right {
|
|
182
|
+
justify-content: right;
|
|
149
183
|
}
|
|
150
184
|
|
|
151
|
-
&.
|
|
152
|
-
|
|
185
|
+
&.center {
|
|
186
|
+
justify-content: center;
|
|
153
187
|
}
|
|
154
188
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
text-
|
|
158
|
-
|
|
159
|
-
&:hover {
|
|
160
|
-
color: ${_styles.COLORS.primary_700};
|
|
161
|
-
text-decoration: underline;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
&:focus {
|
|
165
|
-
text-decoration: underline;
|
|
166
|
-
outline: none;
|
|
167
|
-
box-shadow: 0px 4px 12px ${_styles.COLORS.focus_25}, 0px 0px 8px ${_styles.COLORS.focus} !important;
|
|
168
|
-
color: ${_styles.COLORS.primary_700};
|
|
169
|
-
}
|
|
189
|
+
a:first-letter,
|
|
190
|
+
span:first-letter {
|
|
191
|
+
text-transform: uppercase;
|
|
170
192
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
193
|
+
`;
|
|
194
|
+
const StyledTableCellIcon = exports.StyledTableCellIcon = _styledComponents2.default.div`
|
|
195
|
+
color: ${_styles.COLORS.neutral_700};
|
|
196
|
+
width: 24px;
|
|
197
|
+
height: 24px;
|
|
198
|
+
|
|
199
|
+
svg {
|
|
200
|
+
color: ${_styles.COLORS.neutral_700};
|
|
201
|
+
width: 24px;
|
|
202
|
+
height: 24px;
|
|
174
203
|
}
|
|
175
204
|
`;
|
|
176
|
-
const
|
|
205
|
+
const StyledTableCellText = exports.StyledTableCellText = _styledComponents2.default.span`
|
|
206
|
+
padding: 12px 0;
|
|
207
|
+
`;
|
|
208
|
+
const StyledTableFooter = exports.StyledTableFooter = _styledComponents2.default.tfoot`
|
|
209
|
+
`;
|
|
210
|
+
const StyledTableFooterContent = exports.StyledTableFooterContent = _styledComponents2.default.div`
|
|
211
|
+
border-top: 2px solid ${_styles.COLORS.neutral_200};
|
|
212
|
+
border-bottom: 1px solid ${_styles.COLORS.neutral_200};
|
|
213
|
+
box-sizing: border-box;
|
|
214
|
+
min-height: 56px;
|
|
215
|
+
|
|
216
|
+
display: flex;
|
|
217
|
+
align-items: center;
|
|
218
|
+
justify-content: right;
|
|
219
|
+
|
|
220
|
+
`;
|
|
221
|
+
const StyledTableFooterCurrentInfo = exports.StyledTableFooterCurrentInfo = _styledComponents2.default.span`
|
|
222
|
+
padding: 0 16px;
|
|
223
|
+
${(0, _typography.ComponentXSStyling)(_typography.ComponentTextStyle.Regular, _styles.COLORS.black)}
|
|
224
|
+
`;
|
|
225
|
+
const StyledTableFooterControls = exports.StyledTableFooterControls = _styledComponents2.default.div`
|
|
226
|
+
display: flex;
|
|
227
|
+
`;
|
|
228
|
+
const StyledTableSpinner = exports.StyledTableSpinner = _styledComponents2.default.div`
|
|
229
|
+
height: 100%;
|
|
230
|
+
width: 100%;
|
|
231
|
+
position: absolute;
|
|
232
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
233
|
+
top: 0;
|
|
234
|
+
`;
|
|
235
|
+
const StyledTableFooterCollapseButton = exports.StyledTableFooterCollapseButton = _styledComponents2.default.button`
|
|
236
|
+
position: relative;
|
|
237
|
+
border-bottom: 1px solid ${_styles.COLORS.neutral_200};
|
|
177
238
|
border-top: 1px solid ${_styles.COLORS.neutral_200};
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
239
|
+
border-left: none;
|
|
240
|
+
border-right: none;
|
|
241
|
+
box-sizing: border-box;
|
|
242
|
+
min-height: 48px;
|
|
243
|
+
display: flex;
|
|
244
|
+
width: 100%;
|
|
245
|
+
align-items: center;
|
|
246
|
+
justify-content: center;
|
|
247
|
+
gap: 4px;
|
|
248
|
+
background: ${_styles.COLORS.white};
|
|
249
|
+
|
|
250
|
+
cursor: pointer;
|
|
251
|
+
|
|
252
|
+
${(0, _typography.ComponentMStyling)(_typography.ComponentTextStyle.Bold, _styles.COLORS.neutral_800)}
|
|
253
|
+
&:focus {
|
|
254
|
+
outline: none;
|
|
255
|
+
z-index: ${_zIndexes.Z_INDEXES.focus};
|
|
256
|
+
color: ${_styles.COLORS.neutral_600};
|
|
257
|
+
box-shadow: 0px 4px 12px rgba(46, 127, 161, 0.25), 0px 0px 8px #2E7FA1;
|
|
258
|
+
}
|
|
192
259
|
|
|
193
|
-
|
|
194
|
-
|
|
260
|
+
&:hover {
|
|
261
|
+
z-index: ${_zIndexes.Z_INDEXES.hover};
|
|
262
|
+
background: ${_styles.COLORS.primary_20};
|
|
263
|
+
color: ${_styles.COLORS.primary_700};
|
|
264
|
+
}
|
|
195
265
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
}
|
|
266
|
+
&:active {
|
|
267
|
+
box-shadow: none;
|
|
268
|
+
z-index: ${_zIndexes.Z_INDEXES.active};
|
|
269
|
+
background: ${_styles.COLORS.primary_100};
|
|
270
|
+
color: ${_styles.COLORS.primary_800};
|
|
271
|
+
}
|
|
201
272
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
justify-content: space-between;
|
|
205
|
-
}
|
|
273
|
+
&:disabled {
|
|
274
|
+
display: none;
|
|
206
275
|
}
|
|
276
|
+
|
|
207
277
|
`;
|
|
208
278
|
});
|
|
209
279
|
//# sourceMappingURL=TableStyles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/Table/TableStyles.ts"],"names":["TableWrapper","styled","div","TableLoadingIndicator","TableContainer","table","COLORS","neutral_200","TableHeaderRowCol","th","neutral_20","ComponentLStyling","ComponentTextStyle","TableColumnHeaderCol","white","neutral_300","ComponentSStyling","primary_20","primary_100","TableDataRow","tr","neutral_100","primary_200","TableDataCol","td","primary_600","primary_700","focus_25","focus","TableFooterCol","ComponentXSStyling"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AAEO,QAAMA,YAAY,WAAZA,YAAY,GAAGC,2BAAOC,GAAI;AACvC;AADO,CAAA;AAIA,QAAMC,qBAAqB,WAArBA,qBAAqB,GAAGF,2BAAOC,GAAI;AAChD;AACA;AACA;AACA;AACA;AALO,CAAA;AAQA,QAAME,cAAc,WAAdA,cAAc,GAAGH,2BAAOI,KAAM;AAC3C;AACA;AACA,0BAA0BC,eAAOC,WAAY;AAC7C,6BAA6BD,eAAOC,WAAY;AAJzC,CAAA;AAOA,QAAMC,iBAAiB,WAAjBA,iBAAiB,GAAGP,2BAAOQ,EAAG;AAC3C,sBAAsBH,eAAOI,UAAW;AACxC,6BAA6BJ,eAAOC,WAAY;AAChD;AACA,IAAII,mCAAkBC,+BAAD,IAAjBD,E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CAAA;AA+CA,QAAMG,cAAc,WAAdA,cAAc,GAAG5B,2BAAOuB,EAAG;AACxC,0BAA0BlB,eAAOC,WAAY;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQuB,oCAAmBlB,+BAAD,OAAlBkB,EAA+CxB,eAA7B,KAAlBwB,CAA6D;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQd,mCAAkBJ,+BAAD,OAAjBI,EAA8CV,eAA7B,KAAjBU,CAA4D;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA9BO,CAAA","sourcesContent":["/**\n * Import third-party libraries.\n */\nimport styled from 'styled-components';\n\n/**\n * Import custom style properties.\n */\nimport { COLORS } from '../styles';\nimport { ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentTextStyle, ComponentXSStyling } from '../styles/typography';\n\n/**\n * Table styles\n */\n\nexport const TableWrapper = styled.div`\n position: relative;\n`;\n\nexport const TableLoadingIndicator = styled.div`\n height: 100%;\n width: 100%;\n position: absolute;\n background-color: rgba(0, 0, 0, 0.5);\n top: 0;\n`;\n\nexport const TableContainer = styled.table`\n background: transparent;\n width: 100%;\n border-top: 2px solid ${COLORS.neutral_200};\n border-bottom: 2px solid ${COLORS.neutral_200};\n`;\n\nexport const TableHeaderRowCol = styled.th`\n background-color: ${COLORS.neutral_20};\n border-bottom: 1px solid ${COLORS.neutral_200};\n\n ${ComponentLStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n padding: 16px 19px 16px 16px;\n\n div {\n display: flex;\n justify-content: space-between;\n align-items: center;\n\n svg {\n cursor: pointer;\n }\n }\n`;\n\nexport const TableColumnHeaderCol = styled.th`\n background-color: ${COLORS.white};\n border-top: 1px solid ${COLORS.neutral_300};\n\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n padding: 18px 16px;\n text-align: left;\n\n &.justify-center {\n text-align: center;\n }\n\n &.justify-left {\n text-align: left;\n }\n\n &.justify-right {\n text-align: right;\n }\n\n &.no-border {\n border: none;\n }\n\n &.sortable {\n cursor: pointer;\n\n > svg {\n float: right;\n }\n\n &:hover {\n background: ${COLORS.primary_20};\n }\n\n &:focus {\n background: ${COLORS.primary_100};\n }\n }\n`;\n\nexport const TableDataRow = styled.tr`\n background-color: ${COLORS.neutral_100};\n\n &:nth-child(2n) {\n background-color: ${COLORS.neutral_20};\n }\n\n &:hover {\n cursor: pointer;\n background-color: ${COLORS.primary_200};\n }\n\n &.no-rows:hover {\n cursor: default;\n background-color: ${COLORS.neutral_100};\n }\n`;\n\nexport const TableDataCol = styled.td`\n background: transparent;\n\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}\n padding: 15px 16px;\n border: none;\n\n &.truncate-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n &.justify-center {\n text-align: center;\n }\n\n &.justify-left {\n text-align: left;\n }\n\n &.justify-right {\n text-align: right;\n }\n\n button {\n color: ${COLORS.primary_600};\n text-decoration: none;\n\n &:hover {\n color: ${COLORS.primary_700};\n text-decoration: underline;\n }\n\n &:focus {\n text-decoration: underline;\n outline: none;\n box-shadow: 0px 4px 12px ${COLORS.focus_25}, 0px 0px 8px ${COLORS.focus} !important;\n color: ${COLORS.primary_700};\n }\n }\n\n &.center {\n text-align: center;\n }\n`;\n\nexport const TableFooterCol = styled.td`\n border-top: 1px solid ${COLORS.neutral_200};\n padding: 3.5px 20px 3.5px 16px;\n\n > div {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n\n > div > div:first-of-type {\n ${ComponentXSStyling(ComponentTextStyle.Regular, COLORS.black)}\n display: block;\n padding-top: 11px;\n padding-left: 2px;\n padding-right: 30px;\n }\n\n span {\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}\n\n &.current-page-info {\n margin-right: 34px;\n margin-left: 39px;\n }\n }\n\n .controls {\n display: flex;\n justify-content: space-between;\n }\n }\n`;\n"],"file":"TableStyles.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/Table/TableStyles.ts"],"names":["TableWrapper","styled","div","StyledTable","table","StyledTableHeader","thead","StyledTableHeaderTitle","tr","StyledTableHeaderTitleContent","COLORS","neutral_200","ComponentLStyling","ComponentTextStyle","StyledTableHeaderColumns","StyledTableHeaderColumnContent","StyledTableHeaderColumn","th","ComponentSStyling","white","primary_20","primary_700","Z_INDEXES","hover","primary_100","primary_800","active","focus_25","focus","neutral_20","StyledTableBodyRow","primary_200","StyledTableBody","tbody","neutral_100","StyledTableCell","td","StyledTableCellContent","StyledTableCellIcon","neutral_700","StyledTableCellText","span","StyledTableFooter","tfoot","StyledTableFooterContent","StyledTableFooterCurrentInfo","ComponentXSStyling","StyledTableFooterControls","StyledTableSpinner","StyledTableFooterCollapseButton","button","ComponentMStyling","neutral_600"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;;AAGA;AACA;AACA;;AAWA;AACA;AACA;AAEO,QAAMA,YAAY,WAAZA,YAAY,GAAGC,2BAAOC,GAAI;AACvC;AADO,CAAA;AAKA,QAAMC,WAAW,WAAXA,WAAW,GAAGF,2BAAOG,KAAM;AACxC;AACA;AACA;AAHO,CAAA;AAMA,QAAMC,iBAAiB,WAAjBA,iBAAiB,GAAGJ,2BAAOK,KAAM;AAAvC,CAAA;AAGA,QAAMC,sBAAsB,WAAtBA,sBAAsB,GAAGN,2BAAOO,EAAG;AAAzC,CAAA;AAGA,QAAMC,6BAA6B,WAA7BA,6BAA6B,GAAGR,2BAAOC,GAAI;AACxD;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6BQ,eAAOC,WAAY;AAChD,0BAA0BD,eAAOC,WAAY;AAC7C;AACA;AACA,IAAIC,mCAAkBC,+BAAD,IAAjBD,EAA2CF,eAA1B,KAAjBE,CAAyD;AAC7D;AACA;AACA;AAdO,CAAA;AAiBA,QAAME,wBAAwB,WAAxBA,wBAAwB,GAAGb,2BAAOO,EAAG;AAA3C,C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C,2BAAOC,GAAI;AAC7C;AACA;AACA;AACA;AACA;AALO,CAAA;AAQA,QAAM+C,+BAA+B,WAA/BA,+BAA+B,GAAGhD,2BAAOiD,MAAO;AAC7D;AACA,6BAA6BxC,eAAOC,WAAY;AAChD,0BAA0BD,eAAOC,WAAY;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgBD,eAAOS,KAAM;AAC7B;AACA;AACA;AACA,IAAIgC,mCAAkBtC,+BAAD,IAAjBsC,EAA2CzC,eAA1B,WAAjByC,CAA+D;AACnE;AACA;AACA,eAAe7B,oBAAUM,KAAM;AAC/B,aAAalB,eAAO0C,WAAY;AAChC;AACA;AACA;AACA;AACA,eAAe9B,oBAAUC,KAAM;AAC/B,kBAAkBb,eAAOU,UAAW;AACpC,aAAaV,eAAOW,WAAY;AAChC;AACA;AACA;AACA;AACA,eAAeC,oBAAUI,MAAO;AAChC,kBAAkBhB,eAAOc,WAAY;AACrC,aAAad,eAAOe,WAAY;AAChC;AACA;AACA;AACA;AACA;AACA;AAzCO,CAAA","sourcesContent":["/**\n * Import third-party libraries.\n */\nimport styled from 'styled-components';\n\n/**\n * Import custom style properties.\n */\nimport {COLORS} from '../styles';\nimport {\n ComponentLStyling,\n ComponentMStyling,\n ComponentSStyling,\n ComponentTextStyle,\n ComponentXSStyling\n} from '../styles/typography';\nimport {Z_INDEXES} from '../styles/z-indexes';\n\n/**\n * Table styles\n */\n\nexport const TableWrapper = styled.div`\n position: relative;\n`;\n\n\nexport const StyledTable = styled.table`\n background: transparent;\n width: 100%;\n table-layout: fixed;\n`;\n\nexport const StyledTableHeader = styled.thead`\n`;\n\nexport const StyledTableHeaderTitle = styled.tr`\n`;\n\nexport const StyledTableHeaderTitleContent = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n box-sizing: border-box;\n min-height: 56px;\n border-bottom: 1px solid ${COLORS.neutral_200};\n border-top: 2px solid ${COLORS.neutral_200};\n padding: 0 16px;\n\n ${ComponentLStyling(ComponentTextStyle.Bold, COLORS.black)}\n .title-menu {\n margin-right: -16px;\n }\n`;\n\nexport const StyledTableHeaderColumns = styled.tr`\n`;\n\nexport const StyledTableHeaderColumnContent = styled.div`\n box-sizing: border-box;\n min-height: 56px;\n padding: 0 16px;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n border-top: 1px solid ${COLORS.neutral_200};\n border-bottom: 1px solid ${COLORS.neutral_200};\n`;\n\nexport const StyledTableHeaderColumn = styled.th`\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n position: relative;\n\n background-color: ${COLORS.white};\n\n //fixes header heights no idea why\n height: 1px;\n\n &.sortable {\n cursor: pointer;\n\n &:hover {\n background-color: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n z-index: ${Z_INDEXES.hover};\n }\n\n &:active {\n background-color: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n box-shadow: none !important;\n z-index: ${Z_INDEXES.active};\n }\n\n &:focus {\n outline: none;\n box-shadow: 0 4px 12px ${COLORS.focus_25}, 0 0 8px ${COLORS.focus};\n z-index: ${Z_INDEXES.focus};\n }\n }\n\n &.sortable ${StyledTableHeaderColumnContent} > svg {\n opacity: 0;\n }\n\n &.sortable.sorted ${StyledTableHeaderColumnContent} > svg {\n opacity: 1;\n }\n\n &.sorted {\n background-color: ${COLORS.neutral_20};\n }\n\n`;\n\nexport const StyledTableBodyRow = styled.tr`\n cursor: pointer;\n position: relative;\n outline: none;\n\n &:hover {\n background-color: ${COLORS.primary_200};\n z-index: ${Z_INDEXES.hover};\n }\n\n &:focus {\n background-color: ${COLORS.primary_200};\n box-shadow: 0px 4px 12px rgba(46, 127, 161, 0.25), 0px 0px 8px #2E7FA1;\n z-index: ${Z_INDEXES.focus};\n outline: none;\n }\n\n &:active {\n box-shadow: none;\n z-index: ${Z_INDEXES.active};\n }\n\n`;\n\nexport const StyledTableBody = styled.tbody`\n ${StyledTableBodyRow}:nth-child(odd):not(:hover):not(:focus):not(:active) {\n background-color: ${COLORS.neutral_100};\n }\n\n ${StyledTableBodyRow}:nth-child(even):not(:hover):not(:focus):not(:active) {\n background-color: ${COLORS.neutral_20};\n }\n`;\n\n\nexport const StyledTableCell = styled.td``;\n\nexport const StyledTableCellContent = styled.div`\n min-height: 48px;\n\n padding: 0 16px;\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}\n\n display: flex;\n align-items: center;\n justify-content: left;\n gap: 8px;\n\n &.truncate-text,\n &.truncate-text span {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n &.left {\n justify-content: left;\n }\n\n &.right {\n justify-content: right;\n }\n\n &.center {\n justify-content: center;\n }\n\n a:first-letter,\n span:first-letter {\n text-transform: uppercase;\n }\n`;\n\nexport const StyledTableCellIcon = styled.div`\n color: ${COLORS.neutral_700};\n width: 24px;\n height: 24px;\n\n svg {\n color: ${COLORS.neutral_700};\n width: 24px;\n height: 24px;\n }\n`;\n\nexport const StyledTableCellText = styled.span`\n padding: 12px 0;\n`;\n\n\nexport const StyledTableFooter = styled.tfoot`\n`;\n\nexport const StyledTableFooterContent = styled.div`\n border-top: 2px solid ${COLORS.neutral_200};\n border-bottom: 1px solid ${COLORS.neutral_200};\n box-sizing: border-box;\n min-height: 56px;\n\n display: flex;\n align-items: center;\n justify-content: right;\n\n`;\n\nexport const StyledTableFooterCurrentInfo = styled.span`\n padding: 0 16px;\n ${ComponentXSStyling(ComponentTextStyle.Regular, COLORS.black)}\n`;\n\nexport const StyledTableFooterControls = styled.div`\n display: flex;\n`;\n\nexport const StyledTableSpinner = styled.div`\n height: 100%;\n width: 100%;\n position: absolute;\n background-color: rgba(0, 0, 0, 0.5);\n top: 0;\n`;\n\nexport const StyledTableFooterCollapseButton = styled.button`\n position: relative;\n border-bottom: 1px solid ${COLORS.neutral_200};\n border-top: 1px solid ${COLORS.neutral_200};\n border-left: none;\n border-right: none;\n box-sizing: border-box;\n min-height: 48px;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: center;\n gap: 4px;\n background: ${COLORS.white};\n\n cursor: pointer;\n\n ${ComponentMStyling(ComponentTextStyle.Bold, COLORS.neutral_800)}\n &:focus {\n outline: none;\n z-index: ${Z_INDEXES.focus};\n color: ${COLORS.neutral_600};\n box-shadow: 0px 4px 12px rgba(46, 127, 161, 0.25), 0px 0px 8px #2E7FA1;\n }\n\n &:hover {\n z-index: ${Z_INDEXES.hover};\n background: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n }\n\n &:active {\n box-shadow: none;\n z-index: ${Z_INDEXES.active};\n background: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n }\n\n &:disabled {\n display: none;\n }\n\n`;\n"],"file":"TableStyles.js"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
2
|
if (typeof define === "function" && define.amd) {
|
|
3
|
-
define(["react", "@testing-library/react", "../index", "jest-styled-components"], factory);
|
|
3
|
+
define(["react", "@testing-library/react", "../index", "../TableStyles", "react-dom/test-utils", "jest-styled-components"], factory);
|
|
4
4
|
} else if (typeof exports !== "undefined") {
|
|
5
|
-
factory(require("react"), require("@testing-library/react"), require("../index"), require("jest-styled-components"));
|
|
5
|
+
factory(require("react"), require("@testing-library/react"), require("../index"), require("../TableStyles"), require("react-dom/test-utils"), require("jest-styled-components"));
|
|
6
6
|
} else {
|
|
7
7
|
var mod = {
|
|
8
8
|
exports: {}
|
|
9
9
|
};
|
|
10
|
-
factory(global.react, global.react, global.index, global.jestStyledComponents);
|
|
10
|
+
factory(global.react, global.react, global.index, global.TableStyles, global.testUtils, global.jestStyledComponents);
|
|
11
11
|
global.undefined = mod.exports;
|
|
12
12
|
}
|
|
13
|
-
})(this, function (_react, _react3, _index) {
|
|
13
|
+
})(this, function (_react, _react3, _index, _TableStyles, _testUtils) {
|
|
14
14
|
"use strict";
|
|
15
15
|
|
|
16
16
|
var _react2 = _interopRequireDefault(_react);
|
|
@@ -230,27 +230,6 @@
|
|
|
230
230
|
expect(getByTestId('TestTableColumnHeaderRow').children[0].classList.contains('no-border')).toBe(false);
|
|
231
231
|
expect(getByTestId('TestTableColumnHeaderRow').children[1].classList.contains('no-border')).toBe(false);
|
|
232
232
|
});
|
|
233
|
-
it('Should render columns with no-border class in the column header row, in case title is not passed', () => {
|
|
234
|
-
const columns = [{
|
|
235
|
-
key: 'column1',
|
|
236
|
-
name: 'Column 1'
|
|
237
|
-
}, {
|
|
238
|
-
key: 'column2',
|
|
239
|
-
name: 'Column 2'
|
|
240
|
-
}];
|
|
241
|
-
const rows = [{
|
|
242
|
-
column1: 'Test content',
|
|
243
|
-
column2: 'Test content 2'
|
|
244
|
-
}];
|
|
245
|
-
const {
|
|
246
|
-
getByTestId
|
|
247
|
-
} = (0, _react3.render)( /*#__PURE__*/_react2.default.createElement(_index.Table, {
|
|
248
|
-
rows: rows,
|
|
249
|
-
columns: columns
|
|
250
|
-
}));
|
|
251
|
-
expect(getByTestId('TestTableColumnHeaderRow').children[0].classList.contains('no-border')).toBe(true);
|
|
252
|
-
expect(getByTestId('TestTableColumnHeaderRow').children[1].classList.contains('no-border')).toBe(true);
|
|
253
|
-
});
|
|
254
233
|
});
|
|
255
234
|
describe('Table Body Row tests', () => {
|
|
256
235
|
it('Should not render "No Data" row in case there are rows', () => {
|
|
@@ -335,6 +314,166 @@
|
|
|
335
314
|
}));
|
|
336
315
|
expect(getByTestId('TestTableFooterRow')).toBeDefined();
|
|
337
316
|
});
|
|
317
|
+
describe('Table Accordion tests', () => {
|
|
318
|
+
it('Should render collapse button when configured as accordion', () => {
|
|
319
|
+
const columns = [{
|
|
320
|
+
key: 'column1',
|
|
321
|
+
name: 'Column 1'
|
|
322
|
+
}, {
|
|
323
|
+
key: 'column2',
|
|
324
|
+
name: 'Column 2'
|
|
325
|
+
}];
|
|
326
|
+
const rows = [{
|
|
327
|
+
column1: 'Test content',
|
|
328
|
+
column2: 'Test content 2'
|
|
329
|
+
}, {
|
|
330
|
+
column1: 'Test content',
|
|
331
|
+
column2: 'Test content 2'
|
|
332
|
+
}, {
|
|
333
|
+
column1: 'Test content',
|
|
334
|
+
column2: 'Test content 2'
|
|
335
|
+
}, {
|
|
336
|
+
column1: 'Test content',
|
|
337
|
+
column2: 'Test content 2'
|
|
338
|
+
}];
|
|
339
|
+
const wrapper = (0, _react3.render)( /*#__PURE__*/_react2.default.createElement(_index.Table, {
|
|
340
|
+
rows: rows,
|
|
341
|
+
columns: columns,
|
|
342
|
+
accordion: true,
|
|
343
|
+
collapsedRows: 3
|
|
344
|
+
}));
|
|
345
|
+
expect(wrapper.container.querySelectorAll(`${_TableStyles.StyledTableFooterCollapseButton}`)).toHaveLength(1);
|
|
346
|
+
});
|
|
347
|
+
it('Should not render all items when collapsed', () => {
|
|
348
|
+
const columns = [{
|
|
349
|
+
key: 'column1',
|
|
350
|
+
name: 'Column 1'
|
|
351
|
+
}, {
|
|
352
|
+
key: 'column2',
|
|
353
|
+
name: 'Column 2'
|
|
354
|
+
}];
|
|
355
|
+
const rows = [{
|
|
356
|
+
column1: 'Test content',
|
|
357
|
+
column2: 'Test content 2'
|
|
358
|
+
}, {
|
|
359
|
+
column1: 'Test content',
|
|
360
|
+
column2: 'Test content 2'
|
|
361
|
+
}, {
|
|
362
|
+
column1: 'Test content',
|
|
363
|
+
column2: 'Test content 2'
|
|
364
|
+
}, {
|
|
365
|
+
column1: 'Test content',
|
|
366
|
+
column2: 'Test content 2'
|
|
367
|
+
}];
|
|
368
|
+
const wrapper = (0, _react3.render)( /*#__PURE__*/_react2.default.createElement(_index.Table, {
|
|
369
|
+
rows: rows,
|
|
370
|
+
columns: columns,
|
|
371
|
+
accordion: true,
|
|
372
|
+
collapsedRows: 3
|
|
373
|
+
}));
|
|
374
|
+
expect(wrapper.container.querySelectorAll(`${_TableStyles.StyledTableBodyRow}`)).toHaveLength(3);
|
|
375
|
+
});
|
|
376
|
+
it('Should render all items when not collapsed', () => {
|
|
377
|
+
const columns = [{
|
|
378
|
+
key: 'column1',
|
|
379
|
+
name: 'Column 1'
|
|
380
|
+
}, {
|
|
381
|
+
key: 'column2',
|
|
382
|
+
name: 'Column 2'
|
|
383
|
+
}];
|
|
384
|
+
const rows = [{
|
|
385
|
+
column1: 'Test content',
|
|
386
|
+
column2: 'Test content 2'
|
|
387
|
+
}, {
|
|
388
|
+
column1: 'Test content',
|
|
389
|
+
column2: 'Test content 2'
|
|
390
|
+
}, {
|
|
391
|
+
column1: 'Test content',
|
|
392
|
+
column2: 'Test content 2'
|
|
393
|
+
}, {
|
|
394
|
+
column1: 'Test content',
|
|
395
|
+
column2: 'Test content 2'
|
|
396
|
+
}];
|
|
397
|
+
const wrapper = (0, _react3.render)( /*#__PURE__*/_react2.default.createElement(_index.Table, {
|
|
398
|
+
rows: rows,
|
|
399
|
+
columns: columns,
|
|
400
|
+
accordion: true,
|
|
401
|
+
collapsedRows: 3,
|
|
402
|
+
collapsed: false
|
|
403
|
+
}));
|
|
404
|
+
expect(wrapper.container.querySelectorAll(`${_TableStyles.StyledTableBodyRow}`)).toHaveLength(4);
|
|
405
|
+
});
|
|
406
|
+
it('Should expand when show more button is clicked', () => {
|
|
407
|
+
const columns = [{
|
|
408
|
+
key: 'column1',
|
|
409
|
+
name: 'Column 1'
|
|
410
|
+
}, {
|
|
411
|
+
key: 'column2',
|
|
412
|
+
name: 'Column 2'
|
|
413
|
+
}];
|
|
414
|
+
const rows = [{
|
|
415
|
+
column1: 'Test content',
|
|
416
|
+
column2: 'Test content 2'
|
|
417
|
+
}, {
|
|
418
|
+
column1: 'Test content',
|
|
419
|
+
column2: 'Test content 2'
|
|
420
|
+
}, {
|
|
421
|
+
column1: 'Test content',
|
|
422
|
+
column2: 'Test content 2'
|
|
423
|
+
}, {
|
|
424
|
+
column1: 'Test content',
|
|
425
|
+
column2: 'Test content 2'
|
|
426
|
+
}];
|
|
427
|
+
const wrapper = (0, _react3.render)( /*#__PURE__*/_react2.default.createElement(_index.Table, {
|
|
428
|
+
rows: rows,
|
|
429
|
+
columns: columns,
|
|
430
|
+
accordion: true,
|
|
431
|
+
collapsedRows: 3,
|
|
432
|
+
collapsed: true
|
|
433
|
+
}));
|
|
434
|
+
expect(wrapper.container.querySelectorAll(`${_TableStyles.StyledTableBodyRow}`)).toHaveLength(3);
|
|
435
|
+
(0, _testUtils.act)(() => {
|
|
436
|
+
let button = wrapper.container.querySelectorAll(`${_TableStyles.StyledTableFooterCollapseButton}`)[0];
|
|
437
|
+
button.click();
|
|
438
|
+
});
|
|
439
|
+
expect(wrapper.container.querySelectorAll(`${_TableStyles.StyledTableBodyRow}`)).toHaveLength(4);
|
|
440
|
+
});
|
|
441
|
+
it('Should collapse when show less button is clicked', () => {
|
|
442
|
+
const columns = [{
|
|
443
|
+
key: 'column1',
|
|
444
|
+
name: 'Column 1'
|
|
445
|
+
}, {
|
|
446
|
+
key: 'column2',
|
|
447
|
+
name: 'Column 2'
|
|
448
|
+
}];
|
|
449
|
+
const rows = [{
|
|
450
|
+
column1: 'Test content',
|
|
451
|
+
column2: 'Test content 2'
|
|
452
|
+
}, {
|
|
453
|
+
column1: 'Test content',
|
|
454
|
+
column2: 'Test content 2'
|
|
455
|
+
}, {
|
|
456
|
+
column1: 'Test content',
|
|
457
|
+
column2: 'Test content 2'
|
|
458
|
+
}, {
|
|
459
|
+
column1: 'Test content',
|
|
460
|
+
column2: 'Test content 2'
|
|
461
|
+
}];
|
|
462
|
+
const wrapper = (0, _react3.render)( /*#__PURE__*/_react2.default.createElement(_index.Table, {
|
|
463
|
+
rows: rows,
|
|
464
|
+
columns: columns,
|
|
465
|
+
accordion: true,
|
|
466
|
+
collapsedRows: 3,
|
|
467
|
+
collapsed: false
|
|
468
|
+
}));
|
|
469
|
+
expect(wrapper.container.querySelectorAll(`${_TableStyles.StyledTableBodyRow}`)).toHaveLength(4);
|
|
470
|
+
(0, _testUtils.act)(() => {
|
|
471
|
+
let button = wrapper.container.querySelectorAll(`${_TableStyles.StyledTableFooterCollapseButton}`)[0];
|
|
472
|
+
button.click();
|
|
473
|
+
});
|
|
474
|
+
expect(wrapper.container.querySelectorAll(`${_TableStyles.StyledTableBodyRow}`)).toHaveLength(3);
|
|
475
|
+
});
|
|
476
|
+
});
|
|
338
477
|
});
|
|
339
478
|
});
|
|
340
479
|
//# sourceMappingURL=Table.test.js.map
|