Skip to content

Commit

Permalink
fix(datatable): format table
Browse files Browse the repository at this point in the history
  • Loading branch information
sangeethababu9223 committed Mar 27, 2024
1 parent 20e4269 commit ea4880e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import { html } from 'lit';
import { boolean, select, text } from '@storybook/addon-knobs';
import Settings16 from '@carbon/web-components/es/icons/settings/16';
import { prefix } from '../../../globals/settings';
import { TABLE_SIZE } from '../table';
import '../index';
Expand Down Expand Up @@ -105,7 +106,30 @@ export const WithRadioSelection = () => {
<cds-table-header-description slot="description"
>With selection</cds-table-header-description
>
<cds-table-toolbar slot="toolbar">
<cds-table-toolbar-content>
<cds-table-toolbar-search
placeholder="Filter table"></cds-table-toolbar-search>
<cds-overflow-menu toolbar-action>
${Settings16({
slot: 'icon',
class: `${prefix}--overflow-menu__icon`,
})}
<cds-overflow-menu-body>
<cds-overflow-menu-item @click=${() => alert('Alert 1')}>
Action 1
</cds-overflow-menu-item>
<cds-overflow-menu-item @click=${() => alert('Alert 2')}>
Action 2
</cds-overflow-menu-item>
<cds-overflow-menu-item @click=${() => alert('Alert 3')}>
Action 3
</cds-overflow-menu-item>
</cds-overflow-menu-body>
</cds-overflow-menu>
<cds-button>Primary button</cds-button>
</cds-table-toolbar-content>
</cds-table-toolbar>
<cds-table-head>
<cds-table-header-row>
<cds-table-header-cell>Name</cds-table-header-cell>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -669,9 +669,9 @@ class CDSTable extends HostListenerMixin(LitElement) {

if (changedProperties.has('isSelectable')) {
if (this.isSelectable || this.hasAttribute('radio')) {
if(this.hasAttribute('radio')){
this._tableHeaderRow.setAttribute('hide-checkbox','');
}else{
if (this.hasAttribute('radio')) {
this._tableHeaderRow.setAttribute('hide-checkbox', '');
} else {
this._tableHeaderRow.setAttribute('selection-name', 'header');
}
this._tableHeaderRow.setAttribute('selection-name', 'header');
Expand Down

0 comments on commit ea4880e

Please sign in to comment.