diff --git a/app/components/pub/my-ui/content-header/content-header.vue b/app/components/pub/my-ui/content-header/content-header.vue new file mode 100644 index 00000000..0d3eae73 --- /dev/null +++ b/app/components/pub/my-ui/content-header/content-header.vue @@ -0,0 +1,132 @@ + + + + + + + + {{ title }} + + + + + + + + + + + + + + + + + Minimal {{ quickSearchNav.minLength || 3 }} karakter untuk mencari + + + + + + + + {{ addNav.label }} + + + + + + + + {{ filterNav.label }} + + + + + + + + {{ printNav.label }} + + + + + diff --git a/app/components/pub/my-ui/content-header/index.ts b/app/components/pub/my-ui/content-header/index.ts new file mode 100644 index 00000000..8648959d --- /dev/null +++ b/app/components/pub/my-ui/content-header/index.ts @@ -0,0 +1,57 @@ +export type ComponentWithProps = { component: Component, props: Record } + +export interface ButtonNav { + variant?: 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link' + classVal?: string + classValExt?: string + icon?: string + label: string + onClick?: () => void +} + +// can type directly +export interface QuickSearchNav { + modelValue?: string + placeholder?: string + inputClass?: string + inputPlaceHolder?: string + minLength?: number + btnClass?: string + btnIcon?: string + btnLabel?: string + showValidationFeedback?: boolean + debounceDuration?: number + searchParams: object + onSubmit?: (searchParams: object) => void + onClear: () => void +} + +// callback on event +export interface RefSearchNav { + modelValue?: string + placeholder?: string + inputClass?: string + inputPlaceHolder?: string + btnClass?: string + btnIcon?: string + onInput: (val: string) => void + onClick: () => void + onClear: () => void +} + +export interface RefExportNav { + onExportPdf?: () => void + onExportCsv?: () => void + onExportExcel?: () => void +} + +export interface ContentHeader { + title?: string + icon?: string + components?: ComponentWithProps[] + quickSearchNav?: QuickSearchNav + refSearchNav?: RefSearchNav // either ref or quick + filterNav?: ButtonNav + addNav?: ButtonNav + printNav?: ButtonNav +}