cherry-pick: pub components from feat/laporan-tindakan-185

This commit is contained in:
Khafid Prayoga
2025-12-08 11:01:44 +07:00
parent 5e3d0d7911
commit a5ec824f4d
19 changed files with 434 additions and 85 deletions

No files matched your search

@@ -4,7 +4,7 @@ import { type Item } from './index'
const props = defineProps<{
id?: string
modelValue?: string
modelValue?: string | number
items: Item[]
placeholder?: string
searchPlaceholder?: string
@@ -16,8 +16,8 @@ const props = defineProps<{
const model = defineModel()
const emit = defineEmits<{
'update:modelValue': [value: string]
'update:searchText': [value: string]
'update:modelValue': [value: string | number]
'update:searchText': [value: string | number]
}>()
const open = ref(false)
+4 -4
View File
@@ -1,5 +1,5 @@
export interface Item {
value: string
value: string | number
label: string
code?: string
priority?: number
@@ -7,12 +7,12 @@ export interface Item {
export function recStrToItem(input: Record<string, string>): Item[] {
const items: Item[] = []
let idx = 0;
let idx = 0
for (const key in input) {
if (input.hasOwnProperty(key)) {
items.push({
value: key || ('unknown-' + idx),
label: input[key] || ('unknown-' + idx),
value: key || 'unknown-' + idx,
label: input[key] || 'unknown-' + idx,
})
}
idx++