From 71dfd6545c0ce58f39620d57e8786a3358d42d76 Mon Sep 17 00:00:00 2001 From: Khafid Prayoga Date: Thu, 28 Aug 2025 12:13:36 +0700 Subject: [PATCH 01/35] feat: add new components for unit, division and installation Add list and entry-form components for unit, division and installation modules --- app/components/app/divison/entry-form.vue | 57 +++++++++++++++++++ app/components/app/divison/list.vue | 54 ++++++++++++++++++ .../app/installation/entry-form.vue | 57 +++++++++++++++++++ app/components/app/installation/list.vue | 54 ++++++++++++++++++ app/components/app/unit/entry-form.vue | 57 +++++++++++++++++++ app/components/app/unit/list.vue | 54 ++++++++++++++++++ app/components/flow/division/list.vue | 54 ++++++++++++++++++ app/components/flow/installation/list.vue | 54 ++++++++++++++++++ app/components/flow/unit/list.vue | 54 ++++++++++++++++++ 9 files changed, 495 insertions(+) create mode 100644 app/components/app/divison/entry-form.vue create mode 100644 app/components/app/divison/list.vue create mode 100644 app/components/app/installation/entry-form.vue create mode 100644 app/components/app/installation/list.vue create mode 100644 app/components/app/unit/entry-form.vue create mode 100644 app/components/app/unit/list.vue create mode 100644 app/components/flow/division/list.vue create mode 100644 app/components/flow/installation/list.vue create mode 100644 app/components/flow/unit/list.vue diff --git a/app/components/app/divison/entry-form.vue b/app/components/app/divison/entry-form.vue new file mode 100644 index 00000000..179d5feb --- /dev/null +++ b/app/components/app/divison/entry-form.vue @@ -0,0 +1,57 @@ + + + + + diff --git a/app/components/app/divison/list.vue b/app/components/app/divison/list.vue new file mode 100644 index 00000000..d3a63407 --- /dev/null +++ b/app/components/app/divison/list.vue @@ -0,0 +1,54 @@ + + + + + diff --git a/app/components/app/installation/entry-form.vue b/app/components/app/installation/entry-form.vue new file mode 100644 index 00000000..60f45f85 --- /dev/null +++ b/app/components/app/installation/entry-form.vue @@ -0,0 +1,57 @@ + + + + + diff --git a/app/components/app/installation/list.vue b/app/components/app/installation/list.vue new file mode 100644 index 00000000..d3a63407 --- /dev/null +++ b/app/components/app/installation/list.vue @@ -0,0 +1,54 @@ + + + + + diff --git a/app/components/app/unit/entry-form.vue b/app/components/app/unit/entry-form.vue new file mode 100644 index 00000000..e13df315 --- /dev/null +++ b/app/components/app/unit/entry-form.vue @@ -0,0 +1,57 @@ + + + + + diff --git a/app/components/app/unit/list.vue b/app/components/app/unit/list.vue new file mode 100644 index 00000000..d3a63407 --- /dev/null +++ b/app/components/app/unit/list.vue @@ -0,0 +1,54 @@ + + + + + diff --git a/app/components/flow/division/list.vue b/app/components/flow/division/list.vue new file mode 100644 index 00000000..d3a63407 --- /dev/null +++ b/app/components/flow/division/list.vue @@ -0,0 +1,54 @@ + + + + + diff --git a/app/components/flow/installation/list.vue b/app/components/flow/installation/list.vue new file mode 100644 index 00000000..d3a63407 --- /dev/null +++ b/app/components/flow/installation/list.vue @@ -0,0 +1,54 @@ + + + + + diff --git a/app/components/flow/unit/list.vue b/app/components/flow/unit/list.vue new file mode 100644 index 00000000..d3a63407 --- /dev/null +++ b/app/components/flow/unit/list.vue @@ -0,0 +1,54 @@ + + + + + From 89710d976879c594711de728bbffa5160f69c67d Mon Sep 17 00:00:00 2001 From: Khafid Prayoga Date: Thu, 28 Aug 2025 15:24:14 +0700 Subject: [PATCH 02/35] feat(combobox): add reusable combobox component with search and selection Implement a combobox component with search functionality and item selection. The component supports displaying item labels with optional codes, maintains selected item state, and provides customizable placeholders. Items are sorted with selected items first followed by alphabetical order. --- .../pub/custom-ui/form/combobox.vue | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 app/components/pub/custom-ui/form/combobox.vue diff --git a/app/components/pub/custom-ui/form/combobox.vue b/app/components/pub/custom-ui/form/combobox.vue new file mode 100644 index 00000000..74da7025 --- /dev/null +++ b/app/components/pub/custom-ui/form/combobox.vue @@ -0,0 +1,100 @@ + + + From 2a74c0a2c7d6bb02f7ef85cf0a219fc5ee1d8713 Mon Sep 17 00:00:00 2001 From: Khafid Prayoga Date: Thu, 28 Aug 2025 15:29:48 +0700 Subject: [PATCH 03/35] feat(division): add entry form and view components for division management --- app/components/app/divison/entry-form.vue | 98 ++++++++++++----------- app/components/flow/division/entry.vue | 32 ++++++++ 2 files changed, 82 insertions(+), 48 deletions(-) create mode 100644 app/components/flow/division/entry.vue diff --git a/app/components/app/divison/entry-form.vue b/app/components/app/divison/entry-form.vue index 179d5feb..c1b955b5 100644 --- a/app/components/app/divison/entry-form.vue +++ b/app/components/app/divison/entry-form.vue @@ -1,57 +1,59 @@ - - diff --git a/app/components/flow/division/entry.vue b/app/components/flow/division/entry.vue new file mode 100644 index 00000000..a3bf5f4b --- /dev/null +++ b/app/components/flow/division/entry.vue @@ -0,0 +1,32 @@ + + + From d6b288404f390851ef21787f34f487bfe409d80b Mon Sep 17 00:00:00 2001 From: Khafid Prayoga Date: Fri, 29 Aug 2025 10:42:07 +0700 Subject: [PATCH 04/35] 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 @@ diff --git a/app/pages/(features)/org-src/unit/add.vue b/app/pages/(features)/org-src/unit/add.vue new file mode 100644 index 00000000..195f4b24 --- /dev/null +++ b/app/pages/(features)/org-src/unit/add.vue @@ -0,0 +1,41 @@ + + + diff --git a/app/pages/(features)/org-src/unit/index.vue b/app/pages/(features)/org-src/unit/index.vue new file mode 100644 index 00000000..40bd09be --- /dev/null +++ b/app/pages/(features)/org-src/unit/index.vue @@ -0,0 +1,41 @@ + + + diff --git a/app/types/error.ts b/app/types/error.ts index e1405b0d..78b4ed50 100644 --- a/app/types/error.ts +++ b/app/types/error.ts @@ -11,7 +11,7 @@ export interface XError { /** Nilai yang diberikan (untuk validasi) */ givenVal?: string /** Path field yang error (untuk form validation) */ - path?: (string | number)[] + path?: readonly (string | number)[] /** Properties tambahan lainnya */ [key: string]: any } From 529b8ef7df167a138b762fc5278a5b44140ffb15 Mon Sep 17 00:00:00 2001 From: Khafid Prayoga Date: Fri, 29 Aug 2025 16:33:20 +0700 Subject: [PATCH 07/35] feat(installation): add installation entry form and pages - Create new installation entry form component with validation - Add installation list and add pages with basic routing - Implement custom select component for encounter class selection - Update SelectTrigger styling for better icon positioning --- .../app/installation/entry-form.vue | 97 ++++++++++--------- app/components/flow/installation/entry.vue | 71 ++++++++++++++ app/components/pub/custom-ui/form/select.vue | 85 ++++++++++++++++ .../pub/ui/select/SelectTrigger.vue | 4 +- .../(features)/org-src/installation/add.vue | 41 ++++++++ .../(features)/org-src/installation/index.vue | 41 ++++++++ 6 files changed, 289 insertions(+), 50 deletions(-) create mode 100644 app/components/flow/installation/entry.vue create mode 100644 app/components/pub/custom-ui/form/select.vue create mode 100644 app/pages/(features)/org-src/installation/add.vue create mode 100644 app/pages/(features)/org-src/installation/index.vue diff --git a/app/components/app/installation/entry-form.vue b/app/components/app/installation/entry-form.vue index 60f45f85..d935a65c 100644 --- a/app/components/app/installation/entry-form.vue +++ b/app/components/app/installation/entry-form.vue @@ -1,57 +1,58 @@ - - diff --git a/app/components/flow/installation/entry.vue b/app/components/flow/installation/entry.vue new file mode 100644 index 00000000..94a4cd1f --- /dev/null +++ b/app/components/flow/installation/entry.vue @@ -0,0 +1,71 @@ + + + diff --git a/app/components/pub/custom-ui/form/select.vue b/app/components/pub/custom-ui/form/select.vue new file mode 100644 index 00000000..53911bb8 --- /dev/null +++ b/app/components/pub/custom-ui/form/select.vue @@ -0,0 +1,85 @@ + + + diff --git a/app/components/pub/ui/select/SelectTrigger.vue b/app/components/pub/ui/select/SelectTrigger.vue index 0252a444..3cc71097 100644 --- a/app/components/pub/ui/select/SelectTrigger.vue +++ b/app/components/pub/ui/select/SelectTrigger.vue @@ -21,13 +21,13 @@ const forwardedProps = useForwardProps(delegatedProps) v-bind="forwardedProps" :class=" cn( - 'border-input ring-offset-background placeholder:text-muted-foreground flex h-10 w-full rounded-md border border-gray-400 px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:cursor-not-allowed disabled:opacity-50', + 'border-input ring-offset-background placeholder:text-muted-foreground relative flex h-10 w-full rounded-md border border-gray-400 pl-3 pr-8 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:cursor-not-allowed disabled:opacity-50', props.class, ) " > - + diff --git a/app/pages/(features)/org-src/installation/add.vue b/app/pages/(features)/org-src/installation/add.vue new file mode 100644 index 00000000..30c3e886 --- /dev/null +++ b/app/pages/(features)/org-src/installation/add.vue @@ -0,0 +1,41 @@ + + + diff --git a/app/pages/(features)/org-src/installation/index.vue b/app/pages/(features)/org-src/installation/index.vue new file mode 100644 index 00000000..a88df5c7 --- /dev/null +++ b/app/pages/(features)/org-src/installation/index.vue @@ -0,0 +1,41 @@ + + + From b1b324e68839c767af60aba8702610035645a6d0 Mon Sep 17 00:00:00 2001 From: Khafid Prayoga Date: Mon, 1 Sep 2025 11:35:02 +0700 Subject: [PATCH 08/35] refactor(data-table): improve type safety and component rendering - Replace generic 'any' types with specific type imports for better type safety - Add optional chaining for funcComponent to prevent potential runtime errors - Update funcHtml and funcParsed to include rowIndex parameter in callbacks --- .../pub/base/data-table/data-table.vue | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/app/components/pub/base/data-table/data-table.vue b/app/components/pub/base/data-table/data-table.vue index 6524aaa8..8bc50758 100644 --- a/app/components/pub/base/data-table/data-table.vue +++ b/app/components/pub/base/data-table/data-table.vue @@ -1,16 +1,17 @@ - - diff --git a/app/components/flow/division/list.vue b/app/components/flow/division/list.vue index d3a63407..28f514b6 100644 --- a/app/components/flow/division/list.vue +++ b/app/components/flow/division/list.vue @@ -1,51 +1,166 @@ diff --git a/app/components/flow/division/schema.query.ts b/app/components/flow/division/schema.query.ts new file mode 100644 index 00000000..9b1a4606 --- /dev/null +++ b/app/components/flow/division/schema.query.ts @@ -0,0 +1,15 @@ +import * as z from 'zod' + +export const querySchema = z.object({ + q: z.union([z.literal(''), z.string().min(3)]).optional().catch(''), + page: z.coerce.number().int().min(1).default(1).catch(1), + pageSize: z.coerce.number().int().min(5).max(20).default(10).catch(10), +}) + +export const defaultQuery = { + q: '', + page: 1, + pageSize: 10, +} + +export type QueryParams = z.infer diff --git a/app/components/pub/custom-ui/data/types.ts b/app/components/pub/custom-ui/data/types.ts index c1dbe8d3..52f5753c 100644 --- a/app/components/pub/custom-ui/data/types.ts +++ b/app/components/pub/custom-ui/data/types.ts @@ -36,7 +36,7 @@ export interface Th { } export interface ButtonNav { - variant?: 'default' | 'destructive' | 'outline' | 'secondary' | 'negative' | 'ghost' | 'link' + variant?: 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link' classVal?: string classValExt?: string icon?: string @@ -56,6 +56,12 @@ export interface QuickSearchNav { } export interface RefSearchNav { + modelValue?: string + placeholder?: string + minLength?: number + debounceMs?: number + inputClass?: string + showValidationFeedback?: boolean onInput: (val: string) => void onClick: () => void onClear: () => void diff --git a/app/components/pub/custom-ui/nav-header/header.vue b/app/components/pub/custom-ui/nav-header/header.vue index 2f8ebb4e..8b81d3f3 100644 --- a/app/components/pub/custom-ui/nav-header/header.vue +++ b/app/components/pub/custom-ui/nav-header/header.vue @@ -1,18 +1,140 @@