Skip to content

Commit 7c41d88

Browse files
committed
fix: enhance InlineCreateForm with improved column styling and unmasked handling
1 parent 1b6dccb commit 7c41d88

File tree

2 files changed

+8316
-1346
lines changed

2 files changed

+8316
-1346
lines changed

custom/InlineCreateForm.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
<template>
22
<template v-if="isCreating">
33
<td class="px-4 py-2"></td>
4-
<td v-for="column in allVisibleColumns" :key="column.name" class="px-4 py-2">
4+
<td v-for="column in allVisibleColumns" :key="column.name" class="px-2 md:px-3 lg:px-6 py-2">
55
<div v-if="isEditableColumn(column)" class="flex gap-2">
66
<ColumnValueInputWrapper
77
ref="input"
8-
class=""
8+
class="min-w-24"
99
:source="'create'"
1010
:column="column"
1111
:currentValues="formData"
1212
:mode="'create'"
1313
:columnOptions="columnOptions"
1414
:unmasked="unmasked"
1515
:setCurrentValue="setCurrentValue"
16+
@update:unmasked="handleUnmasked"
1617
/>
18+
<div v-if="column.required?.create" ><IconExclamationCircleSolid class="w-4 h-4"/></div>
1719
</div>
1820
<div v-else></div>
1921
</td>
@@ -57,7 +59,6 @@
5759
import { IconCheckOutline, IconXOutline, IconPlusOutline, IconExclamationCircleSolid} from '@iconify-prerendered/vue-flowbite';
5860
import { computedAsync } from '@vueuse/core';
5961
import { useRouter } from 'vue-router';
60-
import { Tooltip } from '@/afcl';
6162
6263
const props = defineProps(['meta']);
6364
const emit = defineEmits(['update:records']);
@@ -75,6 +76,9 @@
7576
const visibleColumns = computed(() =>
7677
coreStore.resource.columns.filter(c => !c.backendOnly && c.showIn?.create !== false && !c.primaryKey)
7778
);
79+
function handleUnmasked(columnName) {
80+
unmasked.value[columnName] = !unmasked.value[columnName];
81+
}
7882
7983
const allVisibleColumns = computed(() => {
8084
const columnsMap = new Map();

0 commit comments

Comments
 (0)