Skip to content

Commit 9753f2a

Browse files
committed
fix: Update ColumnValueInput and ColumnValueInputWrapper for improved layout and responsiveness; clean up ResourceListTable rendering
1 parent 927ec9a commit 9753f2a

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

adminforth/spa/src/components/ColumnValueInput.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<Select
1717
v-else-if="column.foreignResource"
1818
ref="input"
19-
class="w-full"
19+
class="w-full min-w-24"
2020
:options="columnOptions[column.name] || []"
2121
teleportToBody
2222
:placeholder = "columnOptions[column.name]?.length ?$t('Select...'): $t('There are no options available')"
@@ -27,7 +27,7 @@
2727
<Select
2828
v-else-if="column.enum"
2929
ref="input"
30-
class="w-full"
30+
class="w-full min-w-24"
3131
:options="column.enum"
3232
teleportToBody
3333
:modelValue="value"
@@ -37,7 +37,7 @@
3737
<Select
3838
v-else-if="(type || column.type) === 'boolean'"
3939
ref="input"
40-
class="w-full"
40+
class="w-full min-w-24"
4141
:options="getBooleanOptions(column)"
4242
teleportToBody
4343
:modelValue="value"

adminforth/spa/src/components/ColumnValueInputWrapper.vue

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,18 @@
2121
@delete="setCurrentValue(column.name, currentValues[column.name].filter((_, index) => index !== arrayItemIndex))"
2222
/>
2323
</div>
24-
<button
25-
v-if="!column.editReadonly"
26-
type="button"
24+
<div class="flex items-center">
25+
<button
26+
v-if="!column.editReadonly"
27+
type="button"
2728
@click="addArrayItem"
2829
class="flex items-center py-1 px-3 me-2 text-sm font-medium rounded-default text-gray-900 focus:outline-none bg-white rounded border border-gray-300 hover:bg-gray-100 hover:text-lightPrimary focus:z-10 focus:ring-4 focus:ring-gray-100 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700"
2930
:class="{'mt-2': currentValues[column.name].length}"
3031
>
3132
<IconPlusOutline class="w-4 h-4 me-2"/>
32-
{{ $t('Add') }}
33-
</button>
33+
{{ $t('Add') }}
34+
</button>
35+
</div>
3436
</template>
3537
<ColumnValueInput
3638
v-else

adminforth/spa/src/components/ResourceListTable.vue

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
<table v-else class=" w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400 rounded-default">
1515

1616
<tbody>
17-
1817
<!-- table header -->
1918
<tr class="t-header sticky z-10 top-0 text-xs bg-lightListTableHeading dark:bg-darkListTableHeading dark:text-gray-400">
2019
<td scope="col" class="p-4">
@@ -60,10 +59,8 @@
6059
{{ $t('Actions') }}
6160
</td>
6261
</tr>
63-
<tr v-for="c in tableBodyStartInjection" :key="c.id">
64-
<td :colspan="resource?.columns.length + 2">
65-
<component :is="getCustomComponent(c)" :meta="c.meta" :resource="resource" :adminUser="coreStore.adminUser" />
66-
</td>
62+
<tr v-for="c in tableBodyStartInjection" :key="c.id" class="align-top">
63+
<component :is="getCustomComponent(c)" :meta="c.meta" :resource="resource" :adminUser="coreStore.adminUser" />
6764
</tr>
6865
<!-- table header end -->
6966
<SkeleteLoader

0 commit comments

Comments
 (0)