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:
@@ -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({});
|
||||
|
||||
Reference in New Issue
Block a user