mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-02-01 20:57:57 +01:00
@@ -25,6 +25,9 @@ const table = {
|
|||||||
font: '',
|
font: '',
|
||||||
size: 'text-sm'
|
size: 'text-sm'
|
||||||
},
|
},
|
||||||
|
checkbox: {
|
||||||
|
padding: 'ps-4'
|
||||||
|
},
|
||||||
loadingState: {
|
loadingState: {
|
||||||
wrapper: 'flex flex-col items-center justify-center flex-1 px-6 py-14 sm:px-14',
|
wrapper: 'flex flex-col items-center justify-center flex-1 px-6 py-14 sm:px-14',
|
||||||
label: 'text-sm text-center text-gray-900 dark:text-white',
|
label: 'text-sm text-center text-gray-900 dark:text-white',
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<table :class="[ui.base, ui.divide]">
|
<table :class="[ui.base, ui.divide]">
|
||||||
<thead :class="ui.thead">
|
<thead :class="ui.thead">
|
||||||
<tr :class="ui.tr.base">
|
<tr :class="ui.tr.base">
|
||||||
<th v-if="modelValue" scope="col" class="ps-4">
|
<th v-if="modelValue" scope="col" :class="ui.checkbox.padding">
|
||||||
<UCheckbox :checked="indeterminate || selected.length === rows.length" :indeterminate="indeterminate" aria-label="Select all" @change="onChange" />
|
<UCheckbox :checked="indeterminate || selected.length === rows.length" :indeterminate="indeterminate" aria-label="Select all" @change="onChange" />
|
||||||
</th>
|
</th>
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
|
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<tr v-for="(row, index) in rows" :key="index" :class="[ui.tr.base, isSelected(row) && ui.tr.selected, $attrs.onSelect && ui.tr.active]" @click="() => onSelect(row)">
|
<tr v-for="(row, index) in rows" :key="index" :class="[ui.tr.base, isSelected(row) && ui.tr.selected, $attrs.onSelect && ui.tr.active]" @click="() => onSelect(row)">
|
||||||
<td v-if="modelValue" class="ps-4">
|
<td v-if="modelValue" :class="ui.checkbox.padding">
|
||||||
<UCheckbox v-model="selected" :value="row" aria-label="Select row" @click.stop />
|
<UCheckbox v-model="selected" :value="row" aria-label="Select row" @click.stop />
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user