@laerdal/life-react-components 1.3.2-dev.9 → 1.4.1-dev.3
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/Accordion/ContentAccordion.js +102 -81
- package/dist/esm/Accordion/ContentAccordion.js.map +1 -1
- package/dist/esm/Accordion/__tests__/ContetnAccordion.test.js +27 -27
- package/dist/esm/Accordion/__tests__/ContetnAccordion.test.js.map +1 -1
- package/dist/esm/Button/DualFunctionButton.js +4 -0
- package/dist/esm/Button/DualFunctionButton.js.map +1 -1
- 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/DropdownContent.js +6 -6
- package/dist/esm/Dropdown/DropdownContent.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 +14 -5
- 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/Accordion/ContentAccordion.d.ts +0 -9
- package/dist/js/Accordion/ContentAccordion.js +21 -42
- package/dist/js/Accordion/ContentAccordion.js.map +1 -1
- package/dist/js/Accordion/__tests__/ContetnAccordion.test.js +27 -33
- package/dist/js/Accordion/__tests__/ContetnAccordion.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/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/DropdownContent.js +8 -8
- package/dist/js/Dropdown/DropdownContent.js.map +1 -1
- 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 +14 -5
- 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/Accordion/ContentAccordion.js +103 -82
- package/dist/umd/Accordion/ContentAccordion.js.map +1 -1
- package/dist/umd/Accordion/__tests__/ContetnAccordion.test.js +26 -26
- package/dist/umd/Accordion/__tests__/ContetnAccordion.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/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/DropdownContent.js +6 -6
- package/dist/umd/Dropdown/DropdownContent.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 +14 -5
- 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
|
@@ -7,7 +7,8 @@ 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
|
+
import { Z_INDEXES } from '../styles/z-indexes';
|
|
11
12
|
/**
|
|
12
13
|
* Table styles
|
|
13
14
|
*/
|
|
@@ -15,169 +16,239 @@ import { ComponentLStyling, ComponentSStyling, ComponentTextStyle, ComponentXSSt
|
|
|
15
16
|
export const TableWrapper = styled.div`
|
|
16
17
|
position: relative;
|
|
17
18
|
`;
|
|
18
|
-
export const
|
|
19
|
-
height: 100%;
|
|
20
|
-
width: 100%;
|
|
21
|
-
position: absolute;
|
|
22
|
-
background-color: rgba(0, 0, 0, 0.5);
|
|
23
|
-
top: 0;
|
|
24
|
-
`;
|
|
25
|
-
export const TableContainer = styled.table`
|
|
19
|
+
export const StyledTable = styled.table`
|
|
26
20
|
background: transparent;
|
|
27
21
|
width: 100%;
|
|
28
|
-
|
|
29
|
-
|
|
22
|
+
table-layout: fixed;
|
|
23
|
+
`;
|
|
24
|
+
export const StyledTableHeader = styled.thead`
|
|
25
|
+
`;
|
|
26
|
+
export const StyledTableHeaderTitle = styled.tr`
|
|
30
27
|
`;
|
|
31
|
-
export const
|
|
32
|
-
|
|
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;
|
|
33
35
|
border-bottom: 1px solid ${COLORS.neutral_200};
|
|
36
|
+
border-top: 2px solid ${COLORS.neutral_200};
|
|
37
|
+
padding: 0 16px;
|
|
34
38
|
|
|
35
|
-
${ComponentLStyling(ComponentTextStyle.Bold, COLORS.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
div {
|
|
39
|
-
display: flex;
|
|
40
|
-
justify-content: space-between;
|
|
41
|
-
align-items: center;
|
|
42
|
-
|
|
43
|
-
svg {
|
|
44
|
-
cursor: pointer;
|
|
45
|
-
}
|
|
39
|
+
${ComponentLStyling(ComponentTextStyle.Bold, COLORS.black)}
|
|
40
|
+
.title-menu {
|
|
41
|
+
margin-right: -16px;
|
|
46
42
|
}
|
|
47
43
|
`;
|
|
48
|
-
export const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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`
|
|
52
58
|
${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}
|
|
53
|
-
|
|
54
|
-
text-align: left;
|
|
55
|
-
|
|
56
|
-
&.justify-center {
|
|
57
|
-
text-align: center;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
&.justify-left {
|
|
61
|
-
text-align: left;
|
|
62
|
-
}
|
|
59
|
+
position: relative;
|
|
63
60
|
|
|
64
|
-
|
|
65
|
-
text-align: right;
|
|
66
|
-
}
|
|
61
|
+
background-color: ${COLORS.white};
|
|
67
62
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
63
|
+
//fixes header heights no idea why
|
|
64
|
+
height: 1px;
|
|
71
65
|
|
|
72
66
|
&.sortable {
|
|
73
67
|
cursor: pointer;
|
|
74
68
|
|
|
75
|
-
|
|
76
|
-
|
|
69
|
+
&:hover {
|
|
70
|
+
background-color: ${COLORS.primary_20};
|
|
71
|
+
color: ${COLORS.primary_700};
|
|
72
|
+
z-index: ${Z_INDEXES.hover};
|
|
77
73
|
}
|
|
78
74
|
|
|
79
|
-
&:
|
|
80
|
-
background: ${COLORS.
|
|
75
|
+
&:active {
|
|
76
|
+
background-color: ${COLORS.primary_100};
|
|
77
|
+
color: ${COLORS.primary_800};
|
|
78
|
+
box-shadow: none !important;
|
|
79
|
+
z-index: ${Z_INDEXES.active};
|
|
81
80
|
}
|
|
82
81
|
|
|
83
82
|
&:focus {
|
|
84
|
-
|
|
83
|
+
outline: none;
|
|
84
|
+
box-shadow: 0 4px 12px ${COLORS.focus_25}, 0 0 8px ${COLORS.focus};
|
|
85
|
+
z-index: ${Z_INDEXES.focus};
|
|
85
86
|
}
|
|
86
87
|
}
|
|
87
|
-
`;
|
|
88
|
-
export const TableDataRow = styled.tr`
|
|
89
|
-
background-color: ${COLORS.neutral_100};
|
|
90
88
|
|
|
91
|
-
|
|
89
|
+
&.sortable ${StyledTableHeaderColumnContent} > svg {
|
|
90
|
+
opacity: 0;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&.sortable.sorted ${StyledTableHeaderColumnContent} > svg {
|
|
94
|
+
opacity: 1;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&.sorted {
|
|
92
98
|
background-color: ${COLORS.neutral_20};
|
|
93
99
|
}
|
|
94
100
|
|
|
101
|
+
`;
|
|
102
|
+
export const StyledTableBodyRow = styled.tr`
|
|
103
|
+
cursor: pointer;
|
|
104
|
+
position: relative;
|
|
105
|
+
outline: none;
|
|
106
|
+
|
|
95
107
|
&:hover {
|
|
96
|
-
cursor: pointer;
|
|
97
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};
|
|
98
122
|
}
|
|
99
123
|
|
|
100
|
-
|
|
101
|
-
|
|
124
|
+
`;
|
|
125
|
+
export const StyledTableBody = styled.tbody`
|
|
126
|
+
${StyledTableBodyRow}:nth-child(odd):not(:hover):not(:focus):not(:active) {
|
|
102
127
|
background-color: ${COLORS.neutral_100};
|
|
103
128
|
}
|
|
129
|
+
|
|
130
|
+
${StyledTableBodyRow}:nth-child(even):not(:hover):not(:focus):not(:active) {
|
|
131
|
+
background-color: ${COLORS.neutral_20};
|
|
132
|
+
}
|
|
104
133
|
`;
|
|
105
|
-
export const
|
|
106
|
-
|
|
134
|
+
export const StyledTableCell = styled.td``;
|
|
135
|
+
export const StyledTableCellContent = styled.div`
|
|
136
|
+
min-height: 48px;
|
|
107
137
|
|
|
138
|
+
padding: 0 16px;
|
|
108
139
|
${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}
|
|
109
|
-
padding: 15px 16px;
|
|
110
|
-
border: none;
|
|
111
140
|
|
|
112
|
-
|
|
141
|
+
display: flex;
|
|
142
|
+
align-items: center;
|
|
143
|
+
justify-content: left;
|
|
144
|
+
gap: 8px;
|
|
145
|
+
|
|
146
|
+
&.truncate-text,
|
|
147
|
+
&.truncate-text span {
|
|
113
148
|
overflow: hidden;
|
|
114
149
|
text-overflow: ellipsis;
|
|
115
150
|
white-space: nowrap;
|
|
116
151
|
}
|
|
117
152
|
|
|
118
|
-
&.
|
|
119
|
-
|
|
153
|
+
&.left {
|
|
154
|
+
justify-content: left;
|
|
120
155
|
}
|
|
121
156
|
|
|
122
|
-
&.
|
|
123
|
-
|
|
157
|
+
&.right {
|
|
158
|
+
justify-content: right;
|
|
124
159
|
}
|
|
125
160
|
|
|
126
|
-
&.
|
|
127
|
-
|
|
161
|
+
&.center {
|
|
162
|
+
justify-content: center;
|
|
128
163
|
}
|
|
129
164
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
text-
|
|
133
|
-
|
|
134
|
-
&:hover {
|
|
135
|
-
color: ${COLORS.primary_700};
|
|
136
|
-
text-decoration: underline;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
&:focus {
|
|
140
|
-
text-decoration: underline;
|
|
141
|
-
outline: none;
|
|
142
|
-
box-shadow: 0px 4px 12px ${COLORS.focus_25}, 0px 0px 8px ${COLORS.focus} !important;
|
|
143
|
-
color: ${COLORS.primary_700};
|
|
144
|
-
}
|
|
165
|
+
a:first-letter,
|
|
166
|
+
span:first-letter {
|
|
167
|
+
text-transform: uppercase;
|
|
145
168
|
}
|
|
169
|
+
`;
|
|
170
|
+
export const StyledTableCellIcon = styled.div`
|
|
171
|
+
color: ${COLORS.neutral_700};
|
|
172
|
+
width: 24px;
|
|
173
|
+
height: 24px;
|
|
146
174
|
|
|
147
|
-
|
|
148
|
-
|
|
175
|
+
svg {
|
|
176
|
+
color: ${COLORS.neutral_700};
|
|
177
|
+
width: 24px;
|
|
178
|
+
height: 24px;
|
|
149
179
|
}
|
|
150
180
|
`;
|
|
151
|
-
export const
|
|
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};
|
|
152
214
|
border-top: 1px solid ${COLORS.neutral_200};
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
padding-top: 11px;
|
|
164
|
-
padding-left: 2px;
|
|
165
|
-
padding-right: 30px;
|
|
166
|
-
}
|
|
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};
|
|
167
225
|
|
|
168
|
-
|
|
169
|
-
${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}
|
|
226
|
+
cursor: pointer;
|
|
170
227
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
}
|
|
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
|
+
}
|
|
176
235
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
}
|
|
236
|
+
&:hover {
|
|
237
|
+
z-index: ${Z_INDEXES.hover};
|
|
238
|
+
background: ${COLORS.primary_20};
|
|
239
|
+
color: ${COLORS.primary_700};
|
|
181
240
|
}
|
|
241
|
+
|
|
242
|
+
&:active {
|
|
243
|
+
box-shadow: none;
|
|
244
|
+
z-index: ${Z_INDEXES.active};
|
|
245
|
+
background: ${COLORS.primary_100};
|
|
246
|
+
color: ${COLORS.primary_800};
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
&:disabled {
|
|
250
|
+
display: none;
|
|
251
|
+
}
|
|
252
|
+
|
|
182
253
|
`;
|
|
183
254
|
//# sourceMappingURL=TableStyles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/Table/TableStyles.ts"],"names":["styled","COLORS","ComponentLStyling","ComponentSStyling","ComponentTextStyle","ComponentXSStyling","TableWrapper","div","TableLoadingIndicator","TableContainer","table","neutral_200","TableHeaderRowCol","th","neutral_20","Bold","neutral_600","TableColumnHeaderCol","white","neutral_300","primary_20","primary_100","TableDataRow","tr","neutral_100","primary_200","TableDataCol","td","Regular","black","primary_600","primary_700","focus_25","focus","TableFooterCol"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,MAAP,MAAmB,mBAAnB;AAEA;AACA;AACA;;AACA,SAASC,MAAT,QAAuB,WAAvB;AACA,SAASC,iBAAT,EAA+CC,iBAA/C,EAAkEC,kBAAlE,EAAsFC,kBAAtF,QAAgH,sBAAhH;AAEA;AACA;AACA;;AAEA,OAAO,MAAMC,YAAY,GAAGN,MAAM,CAACO,GAAI;AACvC;AACA,CAFO;AAIP,OAAO,MAAMC,qBAAqB,GAAGR,MAAM,CAACO,GAAI;AAChD;AACA;AACA;AACA;AACA;AACA,CANO;AAQP,OAAO,MAAME,cAAc,GAAGT,MAAM,CAACU,KAAM;AAC3C;AACA;AACA,0BAA0BT,MAAM,CAACU,WAAY;AAC7C,6BAA6BV,MAAM,CAACU,WAAY;AAChD,CALO;AAOP,OAAO,MAAMC,iBAAiB,GAAGZ,MAAM,CAACa,EAAG;AAC3C,sBAAsBZ,MAAM,CAACa,UAAW;AACxC,6BAA6Bb,MAAM,CAACU,WAAY;AAChD;AACA,IAAIT,iBAAiB,CAACE,kBAAkB,CAACW,IAApB,EAA0Bd,MAAM,CAACe,WAAjC,CAA8C;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAhBO;AAkBP,OAAO,MAAMC,oBAAoB,GAAGjB,MAAM,CAACa,EAAG;AAC9C,sBAAsBZ,MAAM,CAACiB,KAAM;AACnC,0BAA0BjB,MAAM,CAACkB,WAAY;AAC7C;AACA,IAAIhB,iBAAiB,CAACC,kBAAkB,CAACW,IAApB,EAA0Bd,MAAM,CAACe,WAAjC,CAA8C;AACnE;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,oBAAoBf,MAAM,CAACmB,UAAW;AACtC;AACA;AACA;AACA,oBAAoBnB,MAAM,CAACoB,WAAY;AACvC;AACA;AACA,CAvCO;AAyCP,OAAO,MAAMC,YAAY,GAAGtB,MAAM,CAACuB,EAAG;AACtC,sBAAsBtB,MAAM,CAACuB,WAAY;AACzC;AACA;AACA,wBAAwBvB,MAAM,CAACa,UAAW;AAC1C;AACA;AACA;AACA;AACA,wBAAwBb,MAAM,CAACwB,WAAY;AAC3C;AACA;AACA;AACA;AACA,wBAAwBxB,MAAM,CAACuB,WAAY;AAC3C;AACA,CAhBO;AAkBP,OAAO,MAAME,YAAY,GAAG1B,MAAM,CAAC2B,EAAG;AACtC;AACA;AACA,IAAIxB,iBAAiB,CAACC,kBAAkB,CAACwB,OAApB,EAA6B3B,MAAM,CAAC4B,KAApC,CAA2C;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa5B,MAAM,CAAC6B,WAAY;AAChC;AACA;AACA;AACA,eAAe7B,MAAM,CAAC8B,WAAY;AAClC;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC9B,MAAM,CAAC+B,QAAS,iBAAgB/B,MAAM,CAACgC,KAAM;AAC9E,eAAehC,MAAM,CAAC8B,WAAY;AAClC;AACA;AACA;AACA;AACA;AACA;AACA,CA7CO;AA+CP,OAAO,MAAMG,cAAc,GAAGlC,MAAM,CAAC2B,EAAG;AACxC,0BAA0B1B,MAAM,CAACU,WAAY;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQN,kBAAkB,CAACD,kBAAkB,CAACwB,OAApB,EAA6B3B,MAAM,CAAC4B,KAApC,CAA2C;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ1B,iBAAiB,CAACC,kBAAkB,CAACwB,OAApB,EAA6B3B,MAAM,CAAC4B,KAApC,CAA2C;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CA/BO","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":["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 = [{
|
|
@@ -212,27 +214,6 @@ describe('<Table />', () => {
|
|
|
212
214
|
expect(getByTestId('TestTableColumnHeaderRow').children[0].classList.contains('no-border')).toBe(false);
|
|
213
215
|
expect(getByTestId('TestTableColumnHeaderRow').children[1].classList.contains('no-border')).toBe(false);
|
|
214
216
|
});
|
|
215
|
-
it('Should render columns with no-border class in the column header row, in case title is not passed', () => {
|
|
216
|
-
const columns = [{
|
|
217
|
-
key: 'column1',
|
|
218
|
-
name: 'Column 1'
|
|
219
|
-
}, {
|
|
220
|
-
key: 'column2',
|
|
221
|
-
name: 'Column 2'
|
|
222
|
-
}];
|
|
223
|
-
const rows = [{
|
|
224
|
-
column1: 'Test content',
|
|
225
|
-
column2: 'Test content 2'
|
|
226
|
-
}];
|
|
227
|
-
const {
|
|
228
|
-
getByTestId
|
|
229
|
-
} = render( /*#__PURE__*/React.createElement(Table, {
|
|
230
|
-
rows: rows,
|
|
231
|
-
columns: columns
|
|
232
|
-
}));
|
|
233
|
-
expect(getByTestId('TestTableColumnHeaderRow').children[0].classList.contains('no-border')).toBe(true);
|
|
234
|
-
expect(getByTestId('TestTableColumnHeaderRow').children[1].classList.contains('no-border')).toBe(true);
|
|
235
|
-
});
|
|
236
217
|
});
|
|
237
218
|
describe('Table Body Row tests', () => {
|
|
238
219
|
it('Should not render "No Data" row in case there are rows', () => {
|
|
@@ -317,5 +298,165 @@ describe('<Table />', () => {
|
|
|
317
298
|
}));
|
|
318
299
|
expect(getByTestId('TestTableFooterRow')).toBeDefined();
|
|
319
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
|
+
});
|
|
320
461
|
});
|
|
321
462
|
//# sourceMappingURL=Table.test.js.map
|