Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .changeset/mean-paws-travel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@hashicorp/design-system-components": patch
---

<!-- START components/table/advanced-table -->
`AdvancedTable::Tr` - Updated `@isSelected` argument type from `false` to `boolean`
<!-- END -->

<!-- START components/table/table -->
`Table::Tr` - Updated `@isSelected` argument type from `false` to `boolean`
<!-- END -->
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export interface BaseHdsAdvancedTableTrSignature {
selectableColumnKey?: HdsAdvancedTableSignature['Args']['selectableColumnKey'];
isLastRow?: boolean;
isSelectable?: boolean;
isSelected?: false;
isSelected?: boolean;
isParentRow?: boolean;
selectionAriaLabelSuffix?: string;
selectionKey?: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/hds/table/tr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface BaseHdsTableTrSignature {
Args: {
selectableColumnKey?: HdsTableSignature['Args']['selectableColumnKey'];
isSelectable?: boolean;
isSelected?: false;
isSelected?: boolean;
selectionAriaLabelSuffix?: string;
selectionKey?: string;
selectionScope?: HdsTableScope;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ module('Integration | Component | hds/advanced-table/tr', function (hooks) {
const checkboxSelector =
'#data-test-advanced-table-tr > .hds-advanced-table__th--is-selectable input.hds-advanced-table__checkbox';

test('it should not render a checkbox if `@isSelectable` is not set', async function (assert) {
await render(
hbs`<Hds::AdvancedTable::Tr id="data-test-advanced-table-tr" />`,
);
assert.dom(checkboxSelector).doesNotExist();
});

test('it should render a checkbox if `@isSelectable` is `true`', async function (assert) {
await render(
hbs`<Hds::AdvancedTable::Tr
Expand Down
5 changes: 5 additions & 0 deletions showcase/tests/integration/components/hds/table/tr-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ module('Integration | Component | hds/table/tr', function (hooks) {
const checkboxSelector =
'#data-test-table-tr > .hds-table__th--is-selectable input.hds-table__checkbox';

test('it should not render a checkbox if `@isSelectable` is not set', async function (assert) {
await render(hbs`<Hds::Table::Tr id="data-test-table-tr" />`);
assert.dom(checkboxSelector).doesNotExist();
});

test('it should render a checkbox if `@isSelectable` is `true`', async function (assert) {
await render(
hbs`<Hds::Table::Tr id="data-test-table-tr" @isSelectable={{true}} />`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ This component can contain `Hds::AdvancedTable::Th` or `Hds::AdvancedTable::Td`
<C.Property @name="isSelected" @type="boolean" @default="false">
Sets the initial selection state for the row (used in conjunction with setting `isSelectable` on the Advanced Table).
</C.Property>
<C.Property @name="selectionKey" @type="string | number">
<C.Property @name="selectionKey" @type="string">
Required value to associate an unique identifier to each table row (used in conjunction with setting `isSelectable` on the Advanced Table and returned in the `onSelectionChange` callback arguments). It’s required if `isSelectable={{true}}`.
</C.Property>
<C.Property @name="selectionAriaLabelSuffix" @type="string">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ This component can contain `Hds::Table::Th`, `Hds::Table::ThSort`, or `Hds::Tabl
<C.Property @name="isSelected" @type="boolean" @default="false">
Sets the initial selection state for the row (used in conjunction with setting `isSelectable` on the `Table`).
</C.Property>
<C.Property @name="selectionKey" @type="string | number">
<C.Property @name="selectionKey" @type="string">
Required value to associate an unique identifier to each table row (used in conjunction with setting `isSelectable` on the `Table` and returned in the `onSelectionChange` callback arguments). It’s required if `isSelectable={{true}}`.
</C.Property>
<C.Property @name="selectionAriaLabelSuffix" @type="string">
Expand Down