From a5ec824f4d0986154d29f652ffb60cee272f0950 Mon Sep 17 00:00:00 2001 From: Khafid Prayoga Date: Mon, 8 Dec 2025 11:01:44 +0700 Subject: [PATCH] cherry-pick: pub components from feat/laporan-tindakan-185 --- .../pub/my-ui/combobox/combobox.vue | 6 +- app/components/pub/my-ui/combobox/index.ts | 8 +- .../content-switcher/content-switcher.vue | 82 ++++++--- .../pub/my-ui/data/dropdown-action-d.vue | 66 +++++++ app/components/pub/my-ui/doc-entry/block.vue | 4 +- .../pub/my-ui/form/button-action.vue | 165 ++++++++++++++++++ app/components/pub/my-ui/form/file-field.vue | 3 - app/components/pub/my-ui/form/fragment.vue | 26 +++ app/components/pub/my-ui/form/index.ts | 11 ++ app/components/pub/my-ui/form/input-base.vue | 78 ++++++--- app/components/pub/my-ui/form/select.vue | 9 +- .../pub/my-ui/form/text-area-input.vue | 14 +- .../pub/my-ui/form/view/detail-row.vue | 10 +- app/components/pub/my-ui/menus/submenu.vue | 11 +- app/components/pub/my-ui/nav-footer/index.ts | 1 + .../pub/my-ui/pagination/pagination.vue | 2 +- app/components/pub/ui/form/array-message.vue | 20 +++ app/components/pub/ui/form/index.ts | 1 + app/components/pub/ui/input/Input.vue | 2 +- 19 files changed, 434 insertions(+), 85 deletions(-) create mode 100644 app/components/pub/my-ui/data/dropdown-action-d.vue create mode 100644 app/components/pub/my-ui/form/button-action.vue create mode 100644 app/components/pub/my-ui/form/fragment.vue create mode 100644 app/components/pub/my-ui/form/index.ts create mode 100644 app/components/pub/my-ui/nav-footer/index.ts create mode 100644 app/components/pub/ui/form/array-message.vue diff --git a/app/components/pub/my-ui/combobox/combobox.vue b/app/components/pub/my-ui/combobox/combobox.vue index ab625b01..5f0292e7 100644 --- a/app/components/pub/my-ui/combobox/combobox.vue +++ b/app/components/pub/my-ui/combobox/combobox.vue @@ -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) diff --git a/app/components/pub/my-ui/combobox/index.ts b/app/components/pub/my-ui/combobox/index.ts index e4864f7f..f3038de7 100644 --- a/app/components/pub/my-ui/combobox/index.ts +++ b/app/components/pub/my-ui/combobox/index.ts @@ -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): 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++ diff --git a/app/components/pub/my-ui/content-switcher/content-switcher.vue b/app/components/pub/my-ui/content-switcher/content-switcher.vue index 267d94c1..3b79f193 100644 --- a/app/components/pub/my-ui/content-switcher/content-switcher.vue +++ b/app/components/pub/my-ui/content-switcher/content-switcher.vue @@ -1,33 +1,40 @@