Skip to content

Commit b3b585e

Browse files
committed
fix: Allow render arrays as table cell content
1 parent 701726a commit b3b585e

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

packages/components/bolt-table/src/table.twig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
]
5151
%}
5252
<th {{ cell_attributes.addClass(cell_classes) }} scope="col">
53-
{% if cell is iterable %}
53+
{% if cell.content %}
5454
{{ cell.content }}
5555
{% else %}
5656
{{ cell }}
@@ -75,7 +75,7 @@
7575
%}
7676
{% if cell is not empty %}
7777
<th {{ cell_attributes.addClass(cell_classes) }} scope="row">
78-
{% if cell is iterable %}
78+
{% if cell.content %}
7979
{{ cell.content }}
8080
{% else %}
8181
{{ cell }}
@@ -109,7 +109,7 @@
109109
{% for cell in side_headers.cells %}
110110
{% if loop.last %}
111111
<th class="{{ "#{base_class}__cell #{base_class}__cell--header" }}">
112-
{% if cell is iterable %}
112+
{% if cell.content %}
113113
{{ cell.content }}
114114
{% else %}
115115
{{ cell }}
@@ -126,7 +126,7 @@
126126
]
127127
%}
128128
<td {{ cell_attributes.addClass(cell_classes) }}>
129-
{% if cell is iterable %}
129+
{% if cell.content %}
130130
{{ cell.content }}
131131
{% else %}
132132
{{ cell }}

packages/components/bolt-table/table.schema.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ properties:
1515
type: object
1616
properties:
1717
cells:
18-
description: Each item represents a cell in the top header.
18+
description: Each item represents a cell in the top header. Accepts either a renderable item (shorthand) or an item with 'content' and 'attributes' keys.
1919
type: array
2020
items:
2121
type: any
@@ -28,7 +28,7 @@ properties:
2828
type: object
2929
properties:
3030
cells:
31-
description: Each item represents a cell in the side header.
31+
description: Each item represents a cell in the side header. Accepts either a renderable item (shorthand) or an item with 'content' and 'attributes' keys
3232
type: array
3333
items:
3434
type: any
@@ -42,7 +42,7 @@ properties:
4242
description: Generates an array of rows, each can contain an array of `cells`.
4343
properties:
4444
cells:
45-
description: Each item represents a cell in a row.
45+
description: Each item represents a cell in a row. Accepts either a renderable item (shorthand) or an item with 'content' and 'attributes' keys
4646
type: array
4747
items:
4848
type: any
@@ -56,7 +56,7 @@ properties:
5656
description: Generates a table footer, can contain an array of `cells`.
5757
properties:
5858
cells:
59-
description: Each item represents a cell in the footer.
59+
description: Each item represents a cell in the footer. Accepts either a renderable item (shorthand) or an item with 'content' and 'attributes' keys
6060
type: array
6161
items:
6262
type: any

0 commit comments

Comments
 (0)