1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 00:03:56 +00:00

[SM-552] make string sort in TableDataSource case insensitive (#4889)

* make string sort case insensitive

* use localeCompare
This commit is contained in:
Will Martin
2023-03-01 14:41:56 -05:00
committed by GitHub
parent ce6c975dd9
commit bb36184256
2 changed files with 35 additions and 3 deletions

View File

@@ -168,3 +168,31 @@ const FilterableTemplate: Story = (args) => ({
});
export const Filterable = FilterableTemplate.bind({});
const data4 = new TableDataSource<{ name: string }>();
data4.data = [...Array(5).keys()].map((i) => ({
name: i % 2 == 0 ? `name-${i}`.toUpperCase() : `name-${i}`.toLowerCase(),
}));
const VariableCaseTemplate: Story = (args) => ({
props: {
dataSource: data4,
},
template: `
<bit-table [dataSource]="dataSource">
<ng-container header>
<tr>
<th bitCell bitSortable="name" default>Name</th>
</tr>
</ng-container>
<ng-template body let-rows$>
<tr bitRow *ngFor="let r of rows$ | async">
<td bitCell>{{ r.name }}</td>
</tr>
</ng-template>
</bit-table>
`,
});
export const VariableCase = VariableCaseTemplate.bind({});