Skip to content

Commit

Permalink
1,464th Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Shyam-Chen committed May 16, 2024
1 parent 3d7fb17 commit f7597b5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -343,11 +343,11 @@ const flux = reactive({
<div class="w-full bg-white dark:bg-slate-800 shadow-md rounded">
<XTable :columns="flux.colspanCols" :rows="flux.colspanRows">
<template #spanable>
<tr>
<td colspan="2" class="px-6 py-3">Sum:</td>
<td class="px-6 py-3">108</td>
<td></td>
</tr>
<XTable.Row>
<XTable.Cell colspan="2">Sum:</XTable.Cell>
<XTable.Cell>108</XTable.Cell>
<XTable.Cell />
</XTable.Row>
</template>
</XTable>
</div>
Expand Down
6 changes: 3 additions & 3 deletions ui/src/components/table/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -305,15 +305,15 @@ watchEffect(
<template v-if="typeof col.sortable === 'boolean' ? col.sortable : true">
<div
v-if="flux.sortField === col.key && flux.sortDirection === 'desc'"
class="i-ph-sort-descending-bold size-5"
class="i-tabler-sort-descending size-5"
></div>

<div
v-else-if="flux.sortField === col.key && flux.sortDirection === 'asc'"
class="i-ph-sort-ascending-bold size-5"
class="i-tabler-sort-ascending size-5"
></div>

<div v-else class="i-flowbite-sort-outline size-5"></div>
<div v-else class="i-tabler-arrows-sort size-5"></div>
</template>
</div>
</Column>
Expand Down
6 changes: 3 additions & 3 deletions ui/src/utilities/static-table/staticTable.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import chunk from 'lodash/chunk';
import sortBy from 'lodash/sortBy';
import orderBy from 'lodash/orderBy';

export default <T extends Record<string, any>>(
rows: T[],
Expand All @@ -10,11 +10,11 @@ export default <T extends Record<string, any>>(
let arr = [...rows];

if (control.field && control.direction === 'asc') {
arr = sortBy(arr, (item) => item[control.field]);
arr = orderBy(arr, control.field, 'asc');
}

if (control.field && control.direction === 'desc') {
arr = sortBy(arr, (item) => item[control.field]).reverse();
arr = orderBy(arr, control.field, 'desc');
}

const chunked = chunk(arr, control.rows);
Expand Down

0 comments on commit f7597b5

Please sign in to comment.