Skip to content

Commit 719eb77

Browse files
ci: apply automated fixes
1 parent aa049aa commit 719eb77

File tree

1 file changed

+40
-22
lines changed

1 file changed

+40
-22
lines changed

examples/vue/grouping/src/App.vue

Lines changed: 40 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
<script setup lang="ts">
2-
import
3-
{
4-
FlexRender,
5-
getCoreRowModel,
6-
getExpandedRowModel,
7-
getGroupedRowModel,
8-
useVueTable,
9-
type ColumnDef,
10-
type GroupingState,
11-
type ExpandedState,
12-
} from '@tanstack/vue-table'
2+
import {
3+
FlexRender,
4+
getCoreRowModel,
5+
getExpandedRowModel,
6+
getGroupedRowModel,
7+
useVueTable,
8+
type ColumnDef,
9+
type GroupingState,
10+
type ExpandedState,
11+
} from '@tanstack/vue-table'
1312
import { ref } from 'vue'
1413
1514
// Define task type
@@ -77,14 +76,14 @@ const columns: ColumnDef<Task>[] = [
7776
accessorKey: 'status',
7877
header: 'Status',
7978
enableGrouping: true,
80-
accessorFn: (row) => row.status.name,
79+
accessorFn: row => row.status.name,
8180
cell: ({ row }) => row.original.status.name,
8281
},
8382
{
8483
accessorKey: 'priority',
8584
header: 'Priority',
8685
enableGrouping: true,
87-
accessorFn: (row) => row.priority.name,
86+
accessorFn: row => row.priority.name,
8887
cell: ({ row }) => row.original.priority.name,
8988
},
9089
{
@@ -118,13 +117,17 @@ const table = useVueTable({
118117
return expanded.value
119118
},
120119
},
121-
onGroupingChange: (updaterOrValue) => {
120+
onGroupingChange: updaterOrValue => {
122121
grouping.value =
123-
typeof updaterOrValue === 'function' ? updaterOrValue(grouping.value) : updaterOrValue
122+
typeof updaterOrValue === 'function'
123+
? updaterOrValue(grouping.value)
124+
: updaterOrValue
124125
},
125-
onExpandedChange: (updaterOrValue) => {
126+
onExpandedChange: updaterOrValue => {
126127
expanded.value =
127-
typeof updaterOrValue === 'function' ? updaterOrValue(expanded.value) : updaterOrValue
128+
typeof updaterOrValue === 'function'
129+
? updaterOrValue(expanded.value)
130+
: updaterOrValue
128131
},
129132
})
130133
@@ -174,7 +177,11 @@ const clearGrouping = (): void => {
174177
Group by Priority
175178
</button>
176179

177-
<button v-if="grouping.length > 0" @click="clearGrouping" class="clear-button">
180+
<button
181+
v-if="grouping.length > 0"
182+
@click="clearGrouping"
183+
class="clear-button"
184+
>
178185
Clear Grouping
179186
</button>
180187
</div>
@@ -184,7 +191,10 @@ const clearGrouping = (): void => {
184191
<table class="data-table">
185192
<thead>
186193
<tr>
187-
<th v-for="header in table.getHeaderGroups()[0].headers" :key="header.id">
194+
<th
195+
v-for="header in table.getHeaderGroups()[0].headers"
196+
:key="header.id"
197+
>
188198
{{ header.column.columnDef.header }}
189199
</th>
190200
</tr>
@@ -198,7 +208,10 @@ const clearGrouping = (): void => {
198208
<td v-for="cell in row.getVisibleCells()" :key="cell.id">
199209
<!-- Grouped cell -->
200210
<div v-if="cell.getIsGrouped()" class="grouped-cell">
201-
<button class="expand-button" @click="toggleRowExpanded(row.id)">
211+
<button
212+
class="expand-button"
213+
@click="toggleRowExpanded(row.id)"
214+
>
202215
<span v-if="expanded[row.id]" class="icon">👇</span>
203216
<span v-else class="icon">👉</span>
204217
<span class="group-value">{{ cell.getValue() }}</span>
@@ -216,14 +229,19 @@ const clearGrouping = (): void => {
216229

217230
<!-- Regular cell -->
218231
<div v-else>
219-
<FlexRender :render="cell.column.columnDef.cell" :props="cell.getContext()" />
232+
<FlexRender
233+
:render="cell.column.columnDef.cell"
234+
:props="cell.getContext()"
235+
/>
220236
</div>
221237
</td>
222238
</tr>
223239

224240
<!-- Empty state -->
225241
<tr v-if="table.getRowModel().rows.length === 0">
226-
<td :colspan="columns.length" class="empty-table">No tasks found.</td>
242+
<td :colspan="columns.length" class="empty-table">
243+
No tasks found.
244+
</td>
227245
</tr>
228246
</tbody>
229247
</table>

0 commit comments

Comments
 (0)