Feat Infra (#108)
* fix: adjustment some schemas * fix(room): fixing integrate unit of room * feat(warehouse): modify form and integration * feat(counter): modify form and integration * feat(screen): add list, form and integration * feat(screen): add page for public screen * fix: add on reset state at list * fix: solve list of relation * feat(chamber): integrate form to api chamber * feat(bed): integrate form to api bed * fix: add searching function on list service * fix: rewrite style for dropdown and tree select * fix: add sort params * fix: add sort params on division + medicine * feat(division-position): layouting form + list * fix: add sort params for getValueList * chore: modify side menu style * chore: fix ui dashboard * feat(division-position): add content list * feat(division-position): add temporary page * feat(division-position): modify content and entry form
This commit is contained in:
No files matched your search
@@ -20,7 +20,12 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
||||
<template>
|
||||
<ComboboxItem
|
||||
v-bind="forwarded"
|
||||
:class="cn('relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm font-normal outline-none hover:bg-accent data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>*]:text-sm [&>*]:font-normal', props.class)"
|
||||
:class="
|
||||
cn(
|
||||
'relative flex cursor-default select-none items-center rounded-sm bg-white px-2 py-1.5 text-sm font-normal text-black outline-none hover:bg-accent data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:bg-slate-800 dark:text-white dark:hover:bg-slate-700 [&>*]:text-sm [&>*]:font-normal',
|
||||
props.class,
|
||||
)
|
||||
"
|
||||
>
|
||||
<slot />
|
||||
</ComboboxItem>
|
||||
|
||||
@@ -20,11 +20,11 @@ function handleSelect(value: string) {
|
||||
<div class="leaf-node min-w-max">
|
||||
<CommandItem
|
||||
:value="item.value"
|
||||
class="flex items-center justify-between p-2 w-full text-sm font-normal hover:text-primary cursor-pointer rounded-md"
|
||||
class="flex items-center justify-between p-2 w-full text-sm font-normal hover:text-primary cursor-pointer rounded-md bg-white dark:bg-transparent"
|
||||
:class="{ 'pl-8': shouldAlign }"
|
||||
@select="() => handleSelect(item.value)"
|
||||
>
|
||||
<span class="text-sm font-normal text-gray-400">{{ item.label }}</span>
|
||||
<span class="text-sm font-normal text-gray-400 dark:text-gray-300">{{ item.label }}</span>
|
||||
<Check
|
||||
v-if="selectedValue === item.value"
|
||||
class="w-4 h-4 text-primary ml-2 flex-shrink-0"
|
||||
|
||||
@@ -52,19 +52,27 @@ watch(isOpen, async (newValue) => {
|
||||
|
||||
<template>
|
||||
<div class="tree-node min-w-max">
|
||||
<Collapsible v-model:open="isOpen" class="w-full">
|
||||
<Collapsible
|
||||
v-model:open="isOpen"
|
||||
class="w-full"
|
||||
>
|
||||
<!-- Node Header -->
|
||||
<div class="flex items-center justify-start w-full p-2 rounded-md hover:bg-accent gap-2">
|
||||
<div
|
||||
class="flex w-full items-center justify-start gap-2 rounded-md bg-white p-2 hover:bg-accent dark:bg-transparent dark:hover:bg-slate-700"
|
||||
>
|
||||
<!-- Chevron Toggle Button -->
|
||||
<CollapsibleTrigger as-child>
|
||||
<Button
|
||||
variant="ghost"
|
||||
class="h-4 w-4 p-0 flex items-center justify-center"
|
||||
class="flex h-4 w-4 items-center justify-center p-0"
|
||||
>
|
||||
<Loader2 v-if="isLoading" class="w-4 h-4 animate-spin text-muted-foreground" />
|
||||
<Loader2
|
||||
v-if="isLoading"
|
||||
class="h-4 w-4 animate-spin text-muted-foreground"
|
||||
/>
|
||||
<ChevronRight
|
||||
v-else
|
||||
class="w-4 h-4 transition-transform duration-200 ease-in-out text-muted-foreground"
|
||||
class="h-4 w-4 text-muted-foreground transition-transform duration-200 ease-in-out"
|
||||
:class="{
|
||||
'rotate-90': isChevronRotated,
|
||||
}"
|
||||
@@ -74,21 +82,24 @@ watch(isOpen, async (newValue) => {
|
||||
|
||||
<!-- Node Label -->
|
||||
<span
|
||||
class="text-sm font-normal cursor-pointer hover:text-primary flex-1 flex items-center justify-between"
|
||||
class="flex flex-1 cursor-pointer items-center justify-between text-sm font-normal text-black hover:text-primary dark:text-white"
|
||||
@click="handleLabelClick"
|
||||
>
|
||||
{{ item.label }}
|
||||
<!-- Check Icon untuk selected state -->
|
||||
<Check
|
||||
v-if="selectedValue === item.value"
|
||||
class="w-4 h-4 text-primary ml-2 flex-shrink-0"
|
||||
class="ml-2 h-4 w-4 flex-shrink-0 text-primary"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<!-- Children Container -->
|
||||
<CollapsibleContent class="pl-6">
|
||||
<div v-if="!hasChildren" class="text-sm text-muted-foreground p-2">
|
||||
<div
|
||||
v-if="!hasChildren"
|
||||
class="p-2 text-sm text-muted-foreground"
|
||||
>
|
||||
{{ isLoading ? 'Memuat...' : 'Tidak ada data' }}
|
||||
</div>
|
||||
<TreeView
|
||||
@@ -106,7 +117,7 @@ watch(isOpen, async (newValue) => {
|
||||
|
||||
<style scoped>
|
||||
.tree-node {
|
||||
@apply w-full;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* Animasi tambahan untuk smooth transition */
|
||||
|
||||
@@ -37,7 +37,7 @@ const filteredData = computed(() => {
|
||||
// recursive filter
|
||||
function filterTree(items: TreeItem[]): TreeItem[] {
|
||||
return items
|
||||
.map(item => {
|
||||
.map((item) => {
|
||||
const match = item.label.toLowerCase().includes(searchValue.value.toLowerCase())
|
||||
let children: TreeItem[] | undefined = undefined
|
||||
if (item.children) {
|
||||
@@ -57,22 +57,28 @@ const filteredData = computed(() => {
|
||||
<template>
|
||||
<Popover v-model:open="open">
|
||||
<PopoverTrigger as-child>
|
||||
<Button variant="outline" role="combobox" class="w-full justify-between bg-white border-1 border-gray-400">
|
||||
<Button
|
||||
variant="outline"
|
||||
role="combobox"
|
||||
class="w-full justify-between border border-slate-200 bg-white text-black dark:border-slate-700 dark:bg-slate-800 dark:text-white"
|
||||
>
|
||||
<span
|
||||
class="font-normal text-muted-foreground" :class="cn(
|
||||
'font-normal',
|
||||
!modelValue && 'text-muted-foreground',
|
||||
modelValue && 'text-black',
|
||||
)"
|
||||
class="font-normal text-muted-foreground"
|
||||
:class="cn('font-normal', !modelValue && 'text-muted-foreground', modelValue && 'text-black')"
|
||||
>
|
||||
{{ selectedLabel }}
|
||||
</span>
|
||||
<ChevronsUpDown class="w-4 h-4 ml-2 opacity-50 shrink-0" />
|
||||
<ChevronsUpDown class="ml-2 h-4 w-4 shrink-0 opacity-50" />
|
||||
</Button>
|
||||
</PopoverTrigger>
|
||||
<PopoverContent class="min-w-full max-w-[350px] p-0">
|
||||
<PopoverContent
|
||||
class="min-w-full max-w-[350px] border border-slate-200 bg-white p-0 text-black dark:border-slate-700 dark:bg-slate-800 dark:text-white"
|
||||
>
|
||||
<Command>
|
||||
<CommandInput placeholder="Cari item..." v-model="searchValue" />
|
||||
<CommandInput
|
||||
placeholder="Cari item..."
|
||||
v-model="searchValue"
|
||||
/>
|
||||
<CommandEmpty>Item tidak ditemukan.</CommandEmpty>
|
||||
<CommandList class="max-h-[300px] overflow-x-auto overflow-y-auto">
|
||||
<CommandGroup>
|
||||
|
||||
Reference in New Issue
Block a user