From d6b288404f390851ef21787f34f487bfe409d80b Mon Sep 17 00:00:00 2001 From: Khafid Prayoga Date: Fri, 29 Aug 2025 10:42:07 +0700 Subject: [PATCH] feat(division): add division management pages and form validation - Create new division list and add pages - Implement form validation using zod and error handling - Add useFormErrors composable for form error management - Update division entry form with validation support - Add error styling in main.css --- app/assets/css/main.css | 10 ++ app/components/app/divison/entry-form.vue | 41 ++++--- app/components/flow/division/entry.vue | 76 +++++++++++- app/composables/README-useFormErrors.md | 73 +++++++++++ app/composables/useFormErrors.ts | 115 ++++++++++++++++++ app/pages/(features)/org-src/division/add.vue | 41 +++++++ .../(features)/org-src/division/index.vue | 41 +++++++ 7 files changed, 375 insertions(+), 22 deletions(-) create mode 100644 app/composables/README-useFormErrors.md create mode 100644 app/composables/useFormErrors.ts create mode 100644 app/pages/(features)/org-src/division/add.vue create mode 100644 app/pages/(features)/org-src/division/index.vue diff --git a/app/assets/css/main.css b/app/assets/css/main.css index 1c7eaef2..4c488385 100644 --- a/app/assets/css/main.css +++ b/app/assets/css/main.css @@ -327,4 +327,14 @@ body { .rounded-sm { border-radius: var(--radius-sm); } + +/* Form Error Styling */ +.field-error-info { + @apply text-xs ml-1; + color: hsl(var(--destructive)); + /* font-size: 0.875rem; */ + margin-top: 0.25rem; + line-height: 1.25; +} + /* .rounded-md { border-radius: var */ diff --git a/app/components/app/divison/entry-form.vue b/app/components/app/divison/entry-form.vue index c1b955b5..4057cc53 100644 --- a/app/components/app/divison/entry-form.vue +++ b/app/components/app/divison/entry-form.vue @@ -1,26 +1,33 @@