feat (patient): add edit page

This commit is contained in:
Abizrh
2025-08-08 20:38:16 +07:00
parent d9fb2cff0c
commit 376af79449
15 changed files with 193 additions and 2 deletions
+12
View File
@@ -0,0 +1,12 @@
<script setup lang="ts"></script>
<template>
<div class="flex justify-between">
<div>
<Button variant="outline" size="sm">
<Icon name="i-lucide-pencil" class="mr-1" />
Edit
</Button>
</div>
</div>
</template>
+39
View File
@@ -0,0 +1,39 @@
<script setup lang="ts">
import type { HeaderPrep, RefSearchNav } from '../types.ts'
const props = defineProps<{
prep: HeaderPrep
refSearchNav: RefSearchNav
}>()
function emitSearchNavClick() {
props.refSearchNav.onClick()
}
function onInput(event: Event) {
props.refSearchNav.onInput((event.target as HTMLInputElement).value)
}
</script>
<template>
<header>
<div class="flex items-center justify-between">
<div class="flex items-center">
<div class="ml-3 text-lg font-bold text-gray-900">
{{ prep.title }}
</div>
</div>
<div class="flex items-center">
<div class="ml-3 text-lg text-gray-900">
<Input
type="text"
placeholder="Search"
class="w-full rounded-md border border-gray-300 bg-white px-4 py-2 text-gray-900 sm:text-sm"
@click="emitSearchNavClick"
@input="onInput"
/>
</div>
</div>
</div>
</header>
</template>
+84
View File
@@ -0,0 +1,84 @@
import type { ComponentType } from '@unovis/ts'
export interface ListItemDto {
id: number
name: string
code: string
}
export interface RecComponent {
idx?: number
rec: object
props?: any
component: ComponentType
}
export interface Col {
span?: number
classVal?: string
style?: string
width?: number // specific for width
widthUnit?: string // specific for width
}
export interface Th {
label: string
colSpan?: number
rowSpan?: number
classVal?: string
childClassVal?: string
style?: string
childStyle?: string
hideOnSm?: boolean
}
export interface ButtonNav {
variant?: 'default' | 'destructive' | 'outline' | 'secondary' | 'negative' | 'ghost' | 'link'
classVal?: string
classValExt?: string
icon?: string
label: string
onClick?: () => void
}
export interface QuickSearchNav {
inputClass?: string
inputPlaceHolder?: string
btnClass?: string
btnIcon?: string
btnLabel?: string
mainField?: string
searchParams: object
onSubmit?: (searchParams: object) => void
}
export interface RefSearchNav {
onInput: (val: string) => void
onClick: () => void
onClear: () => void
}
// prepared header for relatively common usage
export interface HeaderPrep {
title?: string
icon?: string
refSearchNav?: RefSearchNav
quickSearchNav?: QuickSearchNav
filterNav?: ButtonNav
addNav?: ButtonNav
printNav?: ButtonNav
}
export interface KeyLabel {
key: string
label: string
}
export type FuncRecUnknown = (rec: unknown, idx: number) => unknown
export type FuncComponent = (rec: unknown, idx: number) => RecComponent
export type RecStrFuncUnknown = Record<string, FuncRecUnknown>
export type RecStrFuncComponent = Record<string, FuncComponent>
export interface KeyNames {
key: string
label: string
}