From 0d3cfbec47530c4229bfada265534ffd693742dd Mon Sep 17 00:00:00 2001 From: Khafid Prayoga Date: Mon, 8 Dec 2025 11:14:51 +0700 Subject: [PATCH] wip: adjust form - adjust rencana edukasi - hide code on select items --- .../app/assessment-education/entry-form.vue | 73 ++++++++++--------- .../field/base-select.vue | 21 +++++- .../field/base-textarea.vue | 36 --------- .../app/assessment-education/field/index.ts | 1 - 4 files changed, 56 insertions(+), 75 deletions(-) delete mode 100644 app/components/app/assessment-education/field/base-textarea.vue diff --git a/app/components/app/assessment-education/entry-form.vue b/app/components/app/assessment-education/entry-form.vue index 1183ebb5..66f6dedd 100644 --- a/app/components/app/assessment-education/entry-form.vue +++ b/app/components/app/assessment-education/entry-form.vue @@ -3,10 +3,11 @@ import { toTypedSchema } from '@vee-validate/zod' import { FieldArray } from 'vee-validate' import { Form } from '~/components/pub/ui/form' +// componenets import * as DE from '~/components/pub/my-ui/doc-entry' import Separator from '~/components/pub/ui/separator/Separator.vue' - -import { BaseSelect, BaseTextarea, CheckboxGeneral, CheckboxSpecial } from './field' +import { BaseSelect, CheckboxGeneral, CheckboxSpecial } from './field' +import { ButtonAction, TextAreaInput } from '~/components/pub/my-ui/form' // constant import { @@ -154,53 +155,53 @@ defineExpose({ > -
+ +
- - + - + + + + +
- + />
diff --git a/app/components/app/assessment-education/field/base-select.vue b/app/components/app/assessment-education/field/base-select.vue index 14c3ebc5..965f0c08 100644 --- a/app/components/app/assessment-education/field/base-select.vue +++ b/app/components/app/assessment-education/field/base-select.vue @@ -18,7 +18,24 @@ const props = defineProps<{ const { placeholder = 'Pilih', class: containerClass, selectClass, fieldGroupClass, labelClass } = props -const religionOptions = mapToComboboxOptList(props.items) +const opts = computed(() => { + const data = mapToComboboxOptList(props.items) + // hide code on select options + const filtered = data + .filter((item) => item.code) + .reduce( + (acc, item) => { + acc.push({ + label: item.label as string, + value: item.value as string, + }) + return acc + }, + [] as Array<{ label: string; value: string }>, + ) + + return filtered +})