Skip to content

Commit

Permalink
fix: add va icon alias for data table unsorted icon and sort-asc, sor…
Browse files Browse the repository at this point in the history
…t-desc
  • Loading branch information
m0ksem committed Apr 9, 2024
1 parent b7d4ab1 commit fff7c2c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
8 changes: 4 additions & 4 deletions packages/ui/src/components/va-data-table/hooks/useSortable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export type TSortableEmits = ((
args: string | DataTableSortingOrder | TSortedArgs,
) => void) & ((event: 'columnSorted', args: { columnName: string, value: DataTableSortingOrder, column: DataTableColumnInternal }) => void)

export type TSortIcon = 'va-arrow-up' | 'va-arrow-down' | 'unfold_more'
export type TSortIcon = 'va-sort-asc' | 'va-sort-desc' | 'va-unsorted'

export const useSortable = <Item extends DataTableRow>(
columns: Ref<DataTableColumnInternal[]>,
Expand Down Expand Up @@ -172,10 +172,10 @@ export const useSortable = <Item extends DataTableRow>(

const sortingOrderIconName = computed(() => {
return sortingOrderSync.value === 'asc'
? 'va-arrow-up'
? 'va-sort-asc'
: sortingOrderSync.value === 'desc'
? 'va-arrow-down'
: 'unfold_more'
? 'va-sort-desc'
: 'va-unsorted'
}) as ComputedRef<TSortIcon>

return {
Expand Down
13 changes: 12 additions & 1 deletion packages/ui/src/services/icon/presets/vuestic-aliases.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
import { IconConfiguration } from '../types'

export const VuesticIconAliases: IconConfiguration[] = [
{
name: 'va-unsorted',
to: 'swap_vert',
},
{
name: 'va-sort-asc',
to: 'va-arrow-up',
},
{
name: 'va-sort-desc',
to: 'va-arrow-down',
},
{
name: 'va-arrow-first',
to: 'mi-first_page',
Expand Down Expand Up @@ -65,5 +77,4 @@ export const VuesticIconAliases: IconConfiguration[] = [
name: 'va-minus',
to: 'remove',
},

]

0 comments on commit fff7c2c

Please sign in to comment.