Skip to content

Commit 9b4ec48

Browse files
authored
React-Data-Table: Add WhiteSpace no-wrap to ActionCells (#34)
1 parent 94d0a8a commit 9b4ec48

3 files changed

Lines changed: 25 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- the style 'white-space:no-wrap' to default 'ActionCell' to have icons on the same line
13+
1014
## [2.3.1] - 2023-03-07
1115

1216
### Changed:

src/lib/DataTable/Actions/ActionsCell.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ interface ActionsCellProps<T, TRouteName> {
1414
const ActionsCell = <T, TRouteName>({ actions, collapsed, setCollapsed, keyValue, record }: ActionsCellProps<T, TRouteName>) => (
1515
<>
1616
{actions && (
17-
<th scope="row" className={actions.className} style={actions.style}>
17+
<th scope="row" className={actions.className} style={{ whiteSpace: "nowrap", ...actions.style }}>
1818
{actions.collapse && (
1919
<FontAwesomeIcon
2020
icon={collapsed ? faPlus : faMinus}

test/DataTable/__snapshots__/DataTable.test.tsx.snap

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ exports[`DataTable renders dynamic correctly 1`] = `
116116
<tr>
117117
<th
118118
scope="row"
119+
style="white-space: nowrap;"
119120
>
120121
<i
121122
class="fa undefined"
@@ -139,6 +140,7 @@ exports[`DataTable renders dynamic correctly 1`] = `
139140
<tr>
140141
<th
141142
scope="row"
143+
style="white-space: nowrap;"
142144
>
143145
<i
144146
class="fa undefined"
@@ -162,6 +164,7 @@ exports[`DataTable renders dynamic correctly 1`] = `
162164
<tr>
163165
<th
164166
scope="row"
167+
style="white-space: nowrap;"
165168
>
166169
<i
167170
class="fa undefined"
@@ -185,6 +188,7 @@ exports[`DataTable renders dynamic correctly 1`] = `
185188
<tr>
186189
<th
187190
scope="row"
191+
style="white-space: nowrap;"
188192
>
189193
<i
190194
class="fa undefined"
@@ -208,6 +212,7 @@ exports[`DataTable renders dynamic correctly 1`] = `
208212
<tr>
209213
<th
210214
scope="row"
215+
style="white-space: nowrap;"
211216
>
212217
<i
213218
class="fa undefined"
@@ -231,6 +236,7 @@ exports[`DataTable renders dynamic correctly 1`] = `
231236
<tr>
232237
<th
233238
scope="row"
239+
style="white-space: nowrap;"
234240
>
235241
<i
236242
class="fa undefined"
@@ -254,6 +260,7 @@ exports[`DataTable renders dynamic correctly 1`] = `
254260
<tr>
255261
<th
256262
scope="row"
263+
style="white-space: nowrap;"
257264
>
258265
<i
259266
class="fa undefined"
@@ -277,6 +284,7 @@ exports[`DataTable renders dynamic correctly 1`] = `
277284
<tr>
278285
<th
279286
scope="row"
287+
style="white-space: nowrap;"
280288
>
281289
<i
282290
class="fa undefined"
@@ -300,6 +308,7 @@ exports[`DataTable renders dynamic correctly 1`] = `
300308
<tr>
301309
<th
302310
scope="row"
311+
style="white-space: nowrap;"
303312
>
304313
<i
305314
class="fa undefined"
@@ -323,6 +332,7 @@ exports[`DataTable renders dynamic correctly 1`] = `
323332
<tr>
324333
<th
325334
scope="row"
335+
style="white-space: nowrap;"
326336
>
327337
<i
328338
class="fa undefined"
@@ -346,6 +356,7 @@ exports[`DataTable renders dynamic correctly 1`] = `
346356
<tr>
347357
<th
348358
scope="row"
359+
style="white-space: nowrap;"
349360
>
350361
<i
351362
class="fa undefined"
@@ -369,6 +380,7 @@ exports[`DataTable renders dynamic correctly 1`] = `
369380
<tr>
370381
<th
371382
scope="row"
383+
style="white-space: nowrap;"
372384
>
373385
<i
374386
class="fa undefined"
@@ -392,6 +404,7 @@ exports[`DataTable renders dynamic correctly 1`] = `
392404
<tr>
393405
<th
394406
scope="row"
407+
style="white-space: nowrap;"
395408
>
396409
<i
397410
class="fa undefined"
@@ -415,6 +428,7 @@ exports[`DataTable renders dynamic correctly 1`] = `
415428
<tr>
416429
<th
417430
scope="row"
431+
style="white-space: nowrap;"
418432
>
419433
<i
420434
class="fa undefined"
@@ -438,6 +452,7 @@ exports[`DataTable renders dynamic correctly 1`] = `
438452
<tr>
439453
<th
440454
scope="row"
455+
style="white-space: nowrap;"
441456
>
442457
<i
443458
class="fa undefined"
@@ -461,6 +476,7 @@ exports[`DataTable renders dynamic correctly 1`] = `
461476
<tr>
462477
<th
463478
scope="row"
479+
style="white-space: nowrap;"
464480
>
465481
<i
466482
class="fa undefined"
@@ -484,6 +500,7 @@ exports[`DataTable renders dynamic correctly 1`] = `
484500
<tr>
485501
<th
486502
scope="row"
503+
style="white-space: nowrap;"
487504
>
488505
<i
489506
class="fa undefined"
@@ -507,6 +524,7 @@ exports[`DataTable renders dynamic correctly 1`] = `
507524
<tr>
508525
<th
509526
scope="row"
527+
style="white-space: nowrap;"
510528
>
511529
<i
512530
class="fa undefined"
@@ -530,6 +548,7 @@ exports[`DataTable renders dynamic correctly 1`] = `
530548
<tr>
531549
<th
532550
scope="row"
551+
style="white-space: nowrap;"
533552
>
534553
<i
535554
class="fa undefined"
@@ -553,6 +572,7 @@ exports[`DataTable renders dynamic correctly 1`] = `
553572
<tr>
554573
<th
555574
scope="row"
575+
style="white-space: nowrap;"
556576
>
557577
<i
558578
class="fa undefined"

0 commit comments

Comments
 (0)