feat(division): add form dialog for creating new division

- Implement dialog form with validation schema for division creation
- Add combobox component for parent division selection
- Include form submission handling with reset and error states
- a11y
This commit is contained in:
Khafid Prayoga
2025-09-02 14:48:43 +07:00
parent 132068fcde
commit 664849e15b
6 changed files with 198 additions and 107 deletions
@@ -8,6 +8,7 @@ interface Item {
}
const props = defineProps<{
id: string
modelValue?: string
items: Item[]
placeholder?: string
@@ -61,6 +62,7 @@ function onSelect(item: Item) {
<Popover v-model:open="open">
<PopoverTrigger as-child>
<Button
:id="props.id"
variant="outline" role="combobox" :aria-expanded="open" :class="cn(
'w-full justify-between border-black bg-white hover:bg-gray-50 text-sm font-normal',
!modelValue && 'text-muted-foreground',
@@ -64,7 +64,9 @@ function clearSearch() {
<div v-if="props.prep.refSearchNav" class="ml-3 text-lg text-gray-900 relative">
<div class="relative">
<Input
id="search-table"
v-model="searchModel"
name="search-table"
type="text"
class="w-full rounded-md border bg-white px-4 py-2 text-gray-900 sm:text-sm"
:class="[