@laerdal/life-react-components 1.3.2-dev.7 → 1.4.1-dev.1.full
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/DualFunctionButton.js +4 -0
- package/dist/esm/Button/DualFunctionButton.js.map +1 -1
- package/dist/esm/Dropdown/DropdownContent.js +6 -6
- package/dist/esm/Dropdown/DropdownContent.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 +22 -6
- package/dist/esm/Table/Table.js.map +1 -1
- package/dist/esm/Table/TableBody.js +14 -24
- package/dist/esm/Table/TableBody.js.map +1 -1
- package/dist/esm/Table/TableFooter.js +13 -12
- package/dist/esm/Table/TableFooter.js.map +1 -1
- package/dist/esm/Table/TableHeaders.js +8 -19
- package/dist/esm/Table/TableHeaders.js.map +1 -1
- package/dist/esm/Table/TableStyles.js +226 -180
- package/dist/esm/Table/TableStyles.js.map +1 -1
- package/dist/esm/Table/__tests__/Table.test.js +162 -0
- package/dist/esm/Table/__tests__/Table.test.js.map +1 -1
- package/dist/js/Button/DualFunctionButton.js +4 -0
- package/dist/js/Button/DualFunctionButton.js.map +1 -1
- package/dist/js/Dropdown/DropdownContent.js +8 -8
- package/dist/js/Dropdown/DropdownContent.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 +32 -11
- package/dist/js/Table/Table.js.map +1 -1
- package/dist/js/Table/TableBody.js +16 -25
- package/dist/js/Table/TableBody.js.map +1 -1
- package/dist/js/Table/TableFooter.d.ts +2 -0
- package/dist/js/Table/TableFooter.js +19 -12
- package/dist/js/Table/TableFooter.js.map +1 -1
- package/dist/js/Table/TableHeaders.js +9 -19
- package/dist/js/Table/TableHeaders.js.map +1 -1
- package/dist/js/Table/TableStyles.d.ts +19 -0
- package/dist/js/Table/TableStyles.js +79 -3
- package/dist/js/Table/TableStyles.js.map +1 -1
- package/dist/js/Table/TableTypes.d.ts +4 -1
- package/dist/js/Table/__tests__/Table.test.js +164 -0
- package/dist/js/Table/__tests__/Table.test.js.map +1 -1
- package/dist/umd/Button/DualFunctionButton.js +4 -0
- package/dist/umd/Button/DualFunctionButton.js.map +1 -1
- package/dist/umd/Dropdown/DropdownContent.js +6 -6
- package/dist/umd/Dropdown/DropdownContent.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 +21 -5
- package/dist/umd/Table/Table.js.map +1 -1
- package/dist/umd/Table/TableBody.js +17 -28
- package/dist/umd/Table/TableBody.js.map +1 -1
- package/dist/umd/Table/TableFooter.js +15 -16
- package/dist/umd/Table/TableFooter.js.map +1 -1
- package/dist/umd/Table/TableHeaders.js +11 -23
- package/dist/umd/Table/TableHeaders.js.map +1 -1
- package/dist/umd/Table/TableStyles.js +226 -180
- package/dist/umd/Table/TableStyles.js.map +1 -1
- package/dist/umd/Table/__tests__/Table.test.js +164 -4
- package/dist/umd/Table/__tests__/Table.test.js.map +1 -1
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@ import styled from 'styled-components';
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { COLORS } from '../styles';
|
|
10
|
-
import { ComponentLStyling, ComponentSStyling, ComponentTextStyle, ComponentXSStyling } from '../styles/typography';
|
|
10
|
+
import { ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentTextStyle, ComponentXSStyling } from '../styles/typography';
|
|
11
11
|
import { Z_INDEXES } from '../styles/z-indexes';
|
|
12
12
|
/**
|
|
13
13
|
* Table styles
|
|
@@ -15,194 +15,240 @@ import { Z_INDEXES } from '../styles/z-indexes';
|
|
|
15
15
|
|
|
16
16
|
export const TableWrapper = styled.div`
|
|
17
17
|
position: relative;
|
|
18
|
+
`;
|
|
19
|
+
export const StyledTable = styled.table`
|
|
20
|
+
background: transparent;
|
|
21
|
+
width: 100%;
|
|
22
|
+
table-layout: fixed;
|
|
23
|
+
`;
|
|
24
|
+
export const StyledTableHeader = styled.thead`
|
|
25
|
+
`;
|
|
26
|
+
export const StyledTableHeaderTitle = styled.tr`
|
|
27
|
+
`;
|
|
28
|
+
export const StyledTableHeaderTitleContent = styled.div`
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
justify-content: space-between;
|
|
32
|
+
width: 100%;
|
|
33
|
+
box-sizing: border-box;
|
|
34
|
+
min-height: 56px;
|
|
35
|
+
border-bottom: 1px solid ${COLORS.neutral_200};
|
|
36
|
+
border-top: 2px solid ${COLORS.neutral_200};
|
|
37
|
+
padding: 0 16px;
|
|
38
|
+
|
|
39
|
+
${ComponentLStyling(ComponentTextStyle.Bold, COLORS.black)}
|
|
40
|
+
.title-menu {
|
|
41
|
+
margin-right: -16px;
|
|
42
|
+
}
|
|
43
|
+
`;
|
|
44
|
+
export const StyledTableHeaderColumns = styled.tr`
|
|
45
|
+
`;
|
|
46
|
+
export const StyledTableHeaderColumnContent = styled.div`
|
|
47
|
+
box-sizing: border-box;
|
|
48
|
+
min-height: 56px;
|
|
49
|
+
padding: 0 16px;
|
|
50
|
+
height: 100%;
|
|
51
|
+
display: flex;
|
|
52
|
+
align-items: center;
|
|
53
|
+
justify-content: space-between;
|
|
54
|
+
border-top: 1px solid ${COLORS.neutral_200};
|
|
55
|
+
border-bottom: 1px solid ${COLORS.neutral_200};
|
|
56
|
+
`;
|
|
57
|
+
export const StyledTableHeaderColumn = styled.th`
|
|
58
|
+
${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}
|
|
59
|
+
position: relative;
|
|
18
60
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
background: transparent;
|
|
22
|
-
width: 100%;
|
|
23
|
-
|
|
24
|
-
.table-header {
|
|
25
|
-
.table-header-title .title-content {
|
|
26
|
-
display: flex;
|
|
27
|
-
align-items: center;
|
|
28
|
-
justify-content: space-between;
|
|
29
|
-
width: 100%;
|
|
30
|
-
box-sizing: border-box;
|
|
31
|
-
min-height: 56px;
|
|
32
|
-
border-bottom: 1px solid ${COLORS.neutral_200};
|
|
33
|
-
border-top: 2px solid ${COLORS.neutral_200};
|
|
34
|
-
padding: 0 16px;
|
|
35
|
-
|
|
36
|
-
${ComponentLStyling(ComponentTextStyle.Bold, COLORS.black)}
|
|
37
|
-
.title-menu {
|
|
38
|
-
margin-right: -16px;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.table-header-columns {
|
|
43
|
-
|
|
44
|
-
.table-header-column {
|
|
45
|
-
${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}
|
|
46
|
-
position: relative;
|
|
47
|
-
|
|
48
|
-
background-color: ${COLORS.white};
|
|
49
|
-
|
|
50
|
-
//fixes header heights no idea why
|
|
51
|
-
height: 1px;
|
|
52
|
-
|
|
53
|
-
.header-content {
|
|
54
|
-
box-sizing: border-box;
|
|
55
|
-
min-height: 56px;
|
|
56
|
-
padding: 0 16px;
|
|
57
|
-
height: 100%;
|
|
58
|
-
display: flex;
|
|
59
|
-
align-items: center;
|
|
60
|
-
justify-content: space-between;
|
|
61
|
-
border-top: 1px solid ${COLORS.neutral_200};
|
|
62
|
-
border-bottom: 1px solid ${COLORS.neutral_200};
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
&.sortable {
|
|
66
|
-
cursor: pointer;
|
|
67
|
-
|
|
68
|
-
&:hover {
|
|
69
|
-
background-color: ${COLORS.primary_20};
|
|
70
|
-
color: ${COLORS.primary_700};
|
|
71
|
-
z-index: ${Z_INDEXES.hover};
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
&:active {
|
|
75
|
-
background-color: ${COLORS.primary_100};
|
|
76
|
-
color: ${COLORS.primary_800};
|
|
77
|
-
box-shadow: none !important;
|
|
78
|
-
z-index: ${Z_INDEXES.active};
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
&:focus {
|
|
82
|
-
outline: none;
|
|
83
|
-
box-shadow: 0 4px 12px ${COLORS.focus_25}, 0 0 8px ${COLORS.focus};
|
|
84
|
-
z-index: ${Z_INDEXES.focus};
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
&.sortable .header-content > svg {
|
|
89
|
-
opacity: 0;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
&.sortable.sorted .header-content > svg {
|
|
93
|
-
opacity: 1;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
61
|
+
background-color: ${COLORS.white};
|
|
98
62
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
position: relative;
|
|
102
|
-
|
|
103
|
-
outline: none;
|
|
104
|
-
|
|
105
|
-
.table-cell {
|
|
106
|
-
.table-cell-content {
|
|
107
|
-
min-height: 48px;
|
|
108
|
-
|
|
109
|
-
padding: 0 16px;
|
|
110
|
-
${ComponentSStyling(ComponentTextStyle.Regular, null)}
|
|
111
|
-
|
|
112
|
-
display: flex;
|
|
113
|
-
align-items: center;
|
|
114
|
-
gap: 8px;
|
|
115
|
-
|
|
116
|
-
&.truncate-text,
|
|
117
|
-
&.truncate-text span {
|
|
118
|
-
overflow: hidden;
|
|
119
|
-
text-overflow: ellipsis;
|
|
120
|
-
white-space: nowrap;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
&.left {
|
|
124
|
-
justify-content: left;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
&.right {
|
|
128
|
-
justify-content: right;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
&.center {
|
|
132
|
-
justify-content: center;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.table-cell-icon,
|
|
137
|
-
.table-cell-icon svg {
|
|
138
|
-
color: ${COLORS.neutral_700};
|
|
139
|
-
width: 24px;
|
|
140
|
-
height: 24px;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.table-row:nth-child(odd) {
|
|
146
|
-
background-color: ${COLORS.neutral_100};
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.table-row:nth-child(even) {
|
|
150
|
-
background-color: ${COLORS.white};
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
.table-row {
|
|
154
|
-
cursor: pointer;
|
|
155
|
-
|
|
156
|
-
&:hover {
|
|
157
|
-
background-color: ${COLORS.primary_200};
|
|
158
|
-
z-index: ${Z_INDEXES.hover};
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
&:active {
|
|
162
|
-
box-shadow: none !important;
|
|
163
|
-
z-index: ${Z_INDEXES.active};
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
&:focus {
|
|
167
|
-
background-color: ${COLORS.primary_200};
|
|
168
|
-
box-shadow: 0px 4px 12px rgba(46, 127, 161, 0.25), 0px 0px 8px #2E7FA1;
|
|
169
|
-
z-index: ${Z_INDEXES.focus};
|
|
170
|
-
outline: none;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
63
|
+
//fixes header heights no idea why
|
|
64
|
+
height: 1px;
|
|
173
65
|
|
|
66
|
+
&.sortable {
|
|
67
|
+
cursor: pointer;
|
|
68
|
+
|
|
69
|
+
&:hover {
|
|
70
|
+
background-color: ${COLORS.primary_20};
|
|
71
|
+
color: ${COLORS.primary_700};
|
|
72
|
+
z-index: ${Z_INDEXES.hover};
|
|
174
73
|
}
|
|
175
74
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
min-height: 56px;
|
|
182
|
-
|
|
183
|
-
display: flex;
|
|
184
|
-
align-items: center;
|
|
185
|
-
justify-content: right;
|
|
186
|
-
|
|
187
|
-
.current-page-info {
|
|
188
|
-
padding: 0 16px;
|
|
189
|
-
${ComponentXSStyling(ComponentTextStyle.Regular, COLORS.black)}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
.controls {
|
|
193
|
-
display: flex;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
75
|
+
&:active {
|
|
76
|
+
background-color: ${COLORS.primary_100};
|
|
77
|
+
color: ${COLORS.primary_800};
|
|
78
|
+
box-shadow: none !important;
|
|
79
|
+
z-index: ${Z_INDEXES.active};
|
|
196
80
|
}
|
|
197
81
|
|
|
82
|
+
&:focus {
|
|
83
|
+
outline: none;
|
|
84
|
+
box-shadow: 0 4px 12px ${COLORS.focus_25}, 0 0 8px ${COLORS.focus};
|
|
85
|
+
z-index: ${Z_INDEXES.focus};
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&.sortable ${StyledTableHeaderColumnContent} > svg {
|
|
90
|
+
opacity: 0;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&.sortable.sorted ${StyledTableHeaderColumnContent} > svg {
|
|
94
|
+
opacity: 1;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&.sorted {
|
|
98
|
+
background-color: ${COLORS.neutral_20};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
`;
|
|
102
|
+
export const StyledTableBodyRow = styled.tr`
|
|
103
|
+
cursor: pointer;
|
|
104
|
+
position: relative;
|
|
105
|
+
outline: none;
|
|
106
|
+
|
|
107
|
+
&:hover {
|
|
108
|
+
background-color: ${COLORS.primary_200};
|
|
109
|
+
z-index: ${Z_INDEXES.hover};
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&:focus {
|
|
113
|
+
background-color: ${COLORS.primary_200};
|
|
114
|
+
box-shadow: 0px 4px 12px rgba(46, 127, 161, 0.25), 0px 0px 8px #2E7FA1;
|
|
115
|
+
z-index: ${Z_INDEXES.focus};
|
|
116
|
+
outline: none;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
&:active {
|
|
120
|
+
box-shadow: none;
|
|
121
|
+
z-index: ${Z_INDEXES.active};
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
`;
|
|
125
|
+
export const StyledTableBody = styled.tbody`
|
|
126
|
+
${StyledTableBodyRow}:nth-child(odd):not(:hover):not(:focus):not(:active) {
|
|
127
|
+
background-color: ${COLORS.neutral_100};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
${StyledTableBodyRow}:nth-child(even):not(:hover):not(:focus):not(:active) {
|
|
131
|
+
background-color: ${COLORS.neutral_20};
|
|
132
|
+
}
|
|
133
|
+
`;
|
|
134
|
+
export const StyledTableCell = styled.td``;
|
|
135
|
+
export const StyledTableCellContent = styled.div`
|
|
136
|
+
min-height: 48px;
|
|
137
|
+
|
|
138
|
+
padding: 0 16px;
|
|
139
|
+
${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}
|
|
140
|
+
|
|
141
|
+
display: flex;
|
|
142
|
+
align-items: center;
|
|
143
|
+
justify-content: left;
|
|
144
|
+
gap: 8px;
|
|
145
|
+
|
|
146
|
+
&.truncate-text,
|
|
147
|
+
&.truncate-text span {
|
|
148
|
+
overflow: hidden;
|
|
149
|
+
text-overflow: ellipsis;
|
|
150
|
+
white-space: nowrap;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
&.left {
|
|
154
|
+
justify-content: left;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
&.right {
|
|
158
|
+
justify-content: right;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
&.center {
|
|
162
|
+
justify-content: center;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
a:first-letter,
|
|
166
|
+
span:first-letter {
|
|
167
|
+
text-transform: uppercase;
|
|
168
|
+
}
|
|
169
|
+
`;
|
|
170
|
+
export const StyledTableCellIcon = styled.div`
|
|
171
|
+
color: ${COLORS.neutral_700};
|
|
172
|
+
width: 24px;
|
|
173
|
+
height: 24px;
|
|
174
|
+
|
|
175
|
+
svg {
|
|
176
|
+
color: ${COLORS.neutral_700};
|
|
177
|
+
width: 24px;
|
|
178
|
+
height: 24px;
|
|
179
|
+
}
|
|
180
|
+
`;
|
|
181
|
+
export const StyledTableCellText = styled.span`
|
|
182
|
+
padding: 12px 0;
|
|
183
|
+
`;
|
|
184
|
+
export const StyledTableFooter = styled.tfoot`
|
|
185
|
+
`;
|
|
186
|
+
export const StyledTableFooterContent = styled.div`
|
|
187
|
+
border-top: 2px solid ${COLORS.neutral_200};
|
|
188
|
+
border-bottom: 1px solid ${COLORS.neutral_200};
|
|
189
|
+
box-sizing: border-box;
|
|
190
|
+
min-height: 56px;
|
|
191
|
+
|
|
192
|
+
display: flex;
|
|
193
|
+
align-items: center;
|
|
194
|
+
justify-content: right;
|
|
195
|
+
|
|
196
|
+
`;
|
|
197
|
+
export const StyledTableFooterCurrentInfo = styled.span`
|
|
198
|
+
padding: 0 16px;
|
|
199
|
+
${ComponentXSStyling(ComponentTextStyle.Regular, COLORS.black)}
|
|
200
|
+
`;
|
|
201
|
+
export const StyledTableFooterControls = styled.div`
|
|
202
|
+
display: flex;
|
|
203
|
+
`;
|
|
204
|
+
export const StyledTableSpinner = styled.div`
|
|
205
|
+
height: 100%;
|
|
206
|
+
width: 100%;
|
|
207
|
+
position: absolute;
|
|
208
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
209
|
+
top: 0;
|
|
210
|
+
`;
|
|
211
|
+
export const StyledTableFooterCollapseButton = styled.button`
|
|
212
|
+
position: relative;
|
|
213
|
+
border-bottom: 1px solid ${COLORS.neutral_200};
|
|
214
|
+
border-top: 1px solid ${COLORS.neutral_200};
|
|
215
|
+
border-left: none;
|
|
216
|
+
border-right: none;
|
|
217
|
+
box-sizing: border-box;
|
|
218
|
+
min-height: 48px;
|
|
219
|
+
display: flex;
|
|
220
|
+
width: 100%;
|
|
221
|
+
align-items: center;
|
|
222
|
+
justify-content: center;
|
|
223
|
+
gap: 4px;
|
|
224
|
+
background: ${COLORS.white};
|
|
225
|
+
|
|
226
|
+
cursor: pointer;
|
|
227
|
+
|
|
228
|
+
${ComponentMStyling(ComponentTextStyle.Bold, COLORS.neutral_800)}
|
|
229
|
+
&:focus {
|
|
230
|
+
outline: none;
|
|
231
|
+
z-index: ${Z_INDEXES.focus};
|
|
232
|
+
color: ${COLORS.neutral_600};
|
|
233
|
+
box-shadow: 0px 4px 12px rgba(46, 127, 161, 0.25), 0px 0px 8px #2E7FA1;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
&:hover {
|
|
237
|
+
z-index: ${Z_INDEXES.hover};
|
|
238
|
+
background: ${COLORS.primary_20};
|
|
239
|
+
color: ${COLORS.primary_700};
|
|
198
240
|
}
|
|
199
241
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
top: 0;
|
|
242
|
+
&:active {
|
|
243
|
+
box-shadow: none;
|
|
244
|
+
z-index: ${Z_INDEXES.active};
|
|
245
|
+
background: ${COLORS.primary_100};
|
|
246
|
+
color: ${COLORS.primary_800};
|
|
206
247
|
}
|
|
248
|
+
|
|
249
|
+
&:disabled {
|
|
250
|
+
display: none;
|
|
251
|
+
}
|
|
252
|
+
|
|
207
253
|
`;
|
|
208
254
|
//# sourceMappingURL=TableStyles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/Table/TableStyles.ts"],"names":["styled","COLORS","ComponentLStyling","ComponentSStyling","ComponentTextStyle","ComponentXSStyling","Z_INDEXES","TableWrapper","div","neutral_200","Bold","black","neutral_600","white","primary_20","primary_700","hover","primary_100","primary_800","active","focus_25","focus","Regular","neutral_700","neutral_100","primary_200"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,MAAP,MAAmB,mBAAnB;AAEA;AACA;AACA;;AACA,SAAQC,MAAR,QAAqB,WAArB;AACA,SACEC,iBADF,EAGEC,iBAHF,EAIEC,kBAJF,EAKEC,kBALF,QAMO,sBANP;AAOA,SAAQC,SAAR,QAAwB,qBAAxB;AAEA;AACA;AACA;;AAEA,OAAO,MAAMC,YAAY,GAAGP,MAAM,CAACQ,GAAI;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmCP,MAAM,CAACQ,WAAY;AACtD,gCAAgCR,MAAM,CAACQ,WAAY;AACnD;AACA;AACA,UAAUP,iBAAiB,CAACE,kBAAkB,CAACM,IAApB,EAA0BT,MAAM,CAACU,KAAjC,CAAwC;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAYR,iBAAiB,CAACC,kBAAkB,CAACM,IAApB,EAA0BT,MAAM,CAACW,WAAjC,CAA8C;AAC3E;AACA;AACA,8BAA8BX,MAAM,CAACY,KAAM;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoCZ,MAAM,CAACQ,WAAY;AACvD,uCAAuCR,MAAM,CAACQ,WAAY;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkCR,MAAM,CAACa,UAAW;AACpD,uBAAuBb,MAAM,CAACc,WAAY;AAC1C,yBAAyBT,SAAS,CAACU,KAAM;AACzC;AACA;AACA;AACA,kCAAkCf,MAAM,CAACgB,WAAY;AACrD,uBAAuBhB,MAAM,CAACiB,WAAY;AAC1C;AACA,yBAAyBZ,SAAS,CAACa,MAAO;AAC1C;AACA;AACA;AACA;AACA,uCAAuClB,MAAM,CAACmB,QAAS,aAAYnB,MAAM,CAACoB,KAAM;AAChF,yBAAyBf,SAAS,CAACe,KAAM;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAclB,iBAAiB,CAACC,kBAAkB,CAACkB,OAApB,EAA6B,IAA7B,CAAmC;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqBrB,MAAM,CAACsB,WAAY;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4BtB,MAAM,CAACuB,WAAY;AAC/C;AACA;AACA;AACA,4BAA4BvB,MAAM,CAACY,KAAM;AACzC;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8BZ,MAAM,CAACwB,WAAY;AACjD,qBAAqBnB,SAAS,CAACU,KAAM;AACrC;AACA;AACA;AACA;AACA,qBAAqBV,SAAS,CAACa,MAAO;AACtC;AACA;AACA;AACA,8BAA8BlB,MAAM,CAACwB,WAAY;AACjD;AACA,qBAAqBnB,SAAS,CAACe,KAAM;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgCpB,MAAM,CAACQ,WAAY;AACnD,mCAAmCR,MAAM,CAACQ,WAAY;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAYJ,kBAAkB,CAACD,kBAAkB,CAACkB,OAApB,EAA6BrB,MAAM,CAACU,KAApC,CAA2C;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CA/LO","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 .table {\n\n background: transparent;\n width: 100%;\n\n .table-header {\n .table-header-title .title-content {\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\n .table-header-columns {\n\n .table-header-column {\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 .header-content {\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\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 .header-content > svg {\n opacity: 0;\n }\n\n &.sortable.sorted .header-content > svg {\n opacity: 1;\n }\n }\n }\n }\n\n .table-body {\n .table-row {\n position: relative;\n\n outline: none;\n\n .table-cell {\n .table-cell-content {\n min-height: 48px;\n\n padding: 0 16px;\n ${ComponentSStyling(ComponentTextStyle.Regular, null)}\n\n display: flex;\n align-items: center;\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\n .table-cell-icon,\n .table-cell-icon svg {\n color: ${COLORS.neutral_700};\n width: 24px;\n height: 24px;\n }\n }\n }\n\n .table-row:nth-child(odd) {\n background-color: ${COLORS.neutral_100};\n }\n\n .table-row:nth-child(even) {\n background-color: ${COLORS.white};\n }\n\n .table-row {\n cursor: pointer;\n\n &:hover {\n background-color: ${COLORS.primary_200};\n z-index: ${Z_INDEXES.hover};\n }\n\n &:active {\n box-shadow: none !important;\n z-index: ${Z_INDEXES.active};\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\n }\n\n .table-footer {\n .footer-content {\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 .current-page-info {\n padding: 0 16px;\n ${ComponentXSStyling(ComponentTextStyle.Regular, COLORS.black)}\n }\n\n .controls {\n display: flex;\n }\n }\n }\n\n }\n\n .table-spinner {\n height: 100%;\n width: 100%;\n position: absolute;\n background-color: rgba(0, 0, 0, 0.5);\n top: 0;\n }\n`;\n"],"file":"TableStyles.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/Table/TableStyles.ts"],"names":["styled","COLORS","ComponentLStyling","ComponentMStyling","ComponentSStyling","ComponentTextStyle","ComponentXSStyling","Z_INDEXES","TableWrapper","div","StyledTable","table","StyledTableHeader","thead","StyledTableHeaderTitle","tr","StyledTableHeaderTitleContent","neutral_200","Bold","black","StyledTableHeaderColumns","StyledTableHeaderColumnContent","StyledTableHeaderColumn","th","neutral_600","white","primary_20","primary_700","hover","primary_100","primary_800","active","focus_25","focus","neutral_20","StyledTableBodyRow","primary_200","StyledTableBody","tbody","neutral_100","StyledTableCell","td","StyledTableCellContent","Regular","StyledTableCellIcon","neutral_700","StyledTableCellText","span","StyledTableFooter","tfoot","StyledTableFooterContent","StyledTableFooterCurrentInfo","StyledTableFooterControls","StyledTableSpinner","StyledTableFooterCollapseButton","button","neutral_800"],"mappings":"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","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"}
|
|
@@ -18,6 +18,8 @@ import 'jest-styled-components';
|
|
|
18
18
|
* Import custom types.
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
+
import { StyledTableBodyRow, StyledTableFooterCollapseButton } from '../TableStyles';
|
|
22
|
+
import { act } from 'react-dom/test-utils';
|
|
21
23
|
describe('<Table />', () => {
|
|
22
24
|
it('Renders the Table', () => {
|
|
23
25
|
const columns = [{
|
|
@@ -296,5 +298,165 @@ describe('<Table />', () => {
|
|
|
296
298
|
}));
|
|
297
299
|
expect(getByTestId('TestTableFooterRow')).toBeDefined();
|
|
298
300
|
});
|
|
301
|
+
describe('Table Accordion tests', () => {
|
|
302
|
+
it('Should render collapse button when configured as accordion', () => {
|
|
303
|
+
const columns = [{
|
|
304
|
+
key: 'column1',
|
|
305
|
+
name: 'Column 1'
|
|
306
|
+
}, {
|
|
307
|
+
key: 'column2',
|
|
308
|
+
name: 'Column 2'
|
|
309
|
+
}];
|
|
310
|
+
const rows = [{
|
|
311
|
+
column1: 'Test content',
|
|
312
|
+
column2: 'Test content 2'
|
|
313
|
+
}, {
|
|
314
|
+
column1: 'Test content',
|
|
315
|
+
column2: 'Test content 2'
|
|
316
|
+
}, {
|
|
317
|
+
column1: 'Test content',
|
|
318
|
+
column2: 'Test content 2'
|
|
319
|
+
}, {
|
|
320
|
+
column1: 'Test content',
|
|
321
|
+
column2: 'Test content 2'
|
|
322
|
+
}];
|
|
323
|
+
const wrapper = render( /*#__PURE__*/React.createElement(Table, {
|
|
324
|
+
rows: rows,
|
|
325
|
+
columns: columns,
|
|
326
|
+
accordion: true,
|
|
327
|
+
collapsedRows: 3
|
|
328
|
+
}));
|
|
329
|
+
expect(wrapper.container.querySelectorAll(`${StyledTableFooterCollapseButton}`)).toHaveLength(1);
|
|
330
|
+
});
|
|
331
|
+
it('Should not render all items when collapsed', () => {
|
|
332
|
+
const columns = [{
|
|
333
|
+
key: 'column1',
|
|
334
|
+
name: 'Column 1'
|
|
335
|
+
}, {
|
|
336
|
+
key: 'column2',
|
|
337
|
+
name: 'Column 2'
|
|
338
|
+
}];
|
|
339
|
+
const rows = [{
|
|
340
|
+
column1: 'Test content',
|
|
341
|
+
column2: 'Test content 2'
|
|
342
|
+
}, {
|
|
343
|
+
column1: 'Test content',
|
|
344
|
+
column2: 'Test content 2'
|
|
345
|
+
}, {
|
|
346
|
+
column1: 'Test content',
|
|
347
|
+
column2: 'Test content 2'
|
|
348
|
+
}, {
|
|
349
|
+
column1: 'Test content',
|
|
350
|
+
column2: 'Test content 2'
|
|
351
|
+
}];
|
|
352
|
+
const wrapper = render( /*#__PURE__*/React.createElement(Table, {
|
|
353
|
+
rows: rows,
|
|
354
|
+
columns: columns,
|
|
355
|
+
accordion: true,
|
|
356
|
+
collapsedRows: 3
|
|
357
|
+
}));
|
|
358
|
+
expect(wrapper.container.querySelectorAll(`${StyledTableBodyRow}`)).toHaveLength(3);
|
|
359
|
+
});
|
|
360
|
+
it('Should render all items when not collapsed', () => {
|
|
361
|
+
const columns = [{
|
|
362
|
+
key: 'column1',
|
|
363
|
+
name: 'Column 1'
|
|
364
|
+
}, {
|
|
365
|
+
key: 'column2',
|
|
366
|
+
name: 'Column 2'
|
|
367
|
+
}];
|
|
368
|
+
const rows = [{
|
|
369
|
+
column1: 'Test content',
|
|
370
|
+
column2: 'Test content 2'
|
|
371
|
+
}, {
|
|
372
|
+
column1: 'Test content',
|
|
373
|
+
column2: 'Test content 2'
|
|
374
|
+
}, {
|
|
375
|
+
column1: 'Test content',
|
|
376
|
+
column2: 'Test content 2'
|
|
377
|
+
}, {
|
|
378
|
+
column1: 'Test content',
|
|
379
|
+
column2: 'Test content 2'
|
|
380
|
+
}];
|
|
381
|
+
const wrapper = render( /*#__PURE__*/React.createElement(Table, {
|
|
382
|
+
rows: rows,
|
|
383
|
+
columns: columns,
|
|
384
|
+
accordion: true,
|
|
385
|
+
collapsedRows: 3,
|
|
386
|
+
collapsed: false
|
|
387
|
+
}));
|
|
388
|
+
expect(wrapper.container.querySelectorAll(`${StyledTableBodyRow}`)).toHaveLength(4);
|
|
389
|
+
});
|
|
390
|
+
it('Should expand when show more button is clicked', () => {
|
|
391
|
+
const columns = [{
|
|
392
|
+
key: 'column1',
|
|
393
|
+
name: 'Column 1'
|
|
394
|
+
}, {
|
|
395
|
+
key: 'column2',
|
|
396
|
+
name: 'Column 2'
|
|
397
|
+
}];
|
|
398
|
+
const rows = [{
|
|
399
|
+
column1: 'Test content',
|
|
400
|
+
column2: 'Test content 2'
|
|
401
|
+
}, {
|
|
402
|
+
column1: 'Test content',
|
|
403
|
+
column2: 'Test content 2'
|
|
404
|
+
}, {
|
|
405
|
+
column1: 'Test content',
|
|
406
|
+
column2: 'Test content 2'
|
|
407
|
+
}, {
|
|
408
|
+
column1: 'Test content',
|
|
409
|
+
column2: 'Test content 2'
|
|
410
|
+
}];
|
|
411
|
+
const wrapper = render( /*#__PURE__*/React.createElement(Table, {
|
|
412
|
+
rows: rows,
|
|
413
|
+
columns: columns,
|
|
414
|
+
accordion: true,
|
|
415
|
+
collapsedRows: 3,
|
|
416
|
+
collapsed: true
|
|
417
|
+
}));
|
|
418
|
+
expect(wrapper.container.querySelectorAll(`${StyledTableBodyRow}`)).toHaveLength(3);
|
|
419
|
+
act(() => {
|
|
420
|
+
let button = wrapper.container.querySelectorAll(`${StyledTableFooterCollapseButton}`)[0];
|
|
421
|
+
button.click();
|
|
422
|
+
});
|
|
423
|
+
expect(wrapper.container.querySelectorAll(`${StyledTableBodyRow}`)).toHaveLength(4);
|
|
424
|
+
});
|
|
425
|
+
it('Should collapse when show less button is clicked', () => {
|
|
426
|
+
const columns = [{
|
|
427
|
+
key: 'column1',
|
|
428
|
+
name: 'Column 1'
|
|
429
|
+
}, {
|
|
430
|
+
key: 'column2',
|
|
431
|
+
name: 'Column 2'
|
|
432
|
+
}];
|
|
433
|
+
const rows = [{
|
|
434
|
+
column1: 'Test content',
|
|
435
|
+
column2: 'Test content 2'
|
|
436
|
+
}, {
|
|
437
|
+
column1: 'Test content',
|
|
438
|
+
column2: 'Test content 2'
|
|
439
|
+
}, {
|
|
440
|
+
column1: 'Test content',
|
|
441
|
+
column2: 'Test content 2'
|
|
442
|
+
}, {
|
|
443
|
+
column1: 'Test content',
|
|
444
|
+
column2: 'Test content 2'
|
|
445
|
+
}];
|
|
446
|
+
const wrapper = render( /*#__PURE__*/React.createElement(Table, {
|
|
447
|
+
rows: rows,
|
|
448
|
+
columns: columns,
|
|
449
|
+
accordion: true,
|
|
450
|
+
collapsedRows: 3,
|
|
451
|
+
collapsed: false
|
|
452
|
+
}));
|
|
453
|
+
expect(wrapper.container.querySelectorAll(`${StyledTableBodyRow}`)).toHaveLength(4);
|
|
454
|
+
act(() => {
|
|
455
|
+
let button = wrapper.container.querySelectorAll(`${StyledTableFooterCollapseButton}`)[0];
|
|
456
|
+
button.click();
|
|
457
|
+
});
|
|
458
|
+
expect(wrapper.container.querySelectorAll(`${StyledTableBodyRow}`)).toHaveLength(3);
|
|
459
|
+
});
|
|
460
|
+
});
|
|
299
461
|
});
|
|
300
462
|
//# sourceMappingURL=Table.test.js.map
|