Use 'high-low' nomenclature for sorting on numeric columns in header cells
This commit is contained in:
parent
d4b9531b95
commit
e239d1e559
|
@ -37,6 +37,8 @@
|
||||||
$: sortedBy = column.name === $sort.column
|
$: sortedBy = column.name === $sort.column
|
||||||
$: canMoveLeft = orderable && idx > 0
|
$: canMoveLeft = orderable && idx > 0
|
||||||
$: canMoveRight = orderable && idx < $renderedColumns.length - 1
|
$: canMoveRight = orderable && idx < $renderedColumns.length - 1
|
||||||
|
$: ascendingLabel = column.schema?.type === "number" ? "low-high" : "A-Z"
|
||||||
|
$: descendingLabel = column.schema?.type === "number" ? "high-low" : "Z-A"
|
||||||
|
|
||||||
const editColumn = () => {
|
const editColumn = () => {
|
||||||
dispatch("edit-column", column.schema)
|
dispatch("edit-column", column.schema)
|
||||||
|
@ -179,14 +181,14 @@
|
||||||
on:click={sortAscending}
|
on:click={sortAscending}
|
||||||
disabled={column.name === $sort.column && $sort.order === "ascending"}
|
disabled={column.name === $sort.column && $sort.order === "ascending"}
|
||||||
>
|
>
|
||||||
Sort A-Z
|
Sort {ascendingLabel}
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
icon="SortOrderDown"
|
icon="SortOrderDown"
|
||||||
on:click={sortDescending}
|
on:click={sortDescending}
|
||||||
disabled={column.name === $sort.column && $sort.order === "descending"}
|
disabled={column.name === $sort.column && $sort.order === "descending"}
|
||||||
>
|
>
|
||||||
Sort Z-A
|
Sort {descendingLabel}
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem disabled={!canMoveLeft} icon="ChevronLeft" on:click={moveLeft}>
|
<MenuItem disabled={!canMoveLeft} icon="ChevronLeft" on:click={moveLeft}>
|
||||||
Move left
|
Move left
|
||||||
|
|
Loading…
Reference in New Issue