| import { ColumnsRenderProps } from '@bole-core/components'; | 
| import { MaybeRef } from 'vue'; | 
|   | 
| export type UsePortraitTableColumnsItem<TData extends object = object> = ColumnsRenderProps & { | 
|   label?: string; | 
|   key?: keyof TData; | 
| }; | 
|   | 
| export type UsePortraitTableOptions<TData extends object> = { | 
|   data: Ref<TData>; | 
|   columns?: UsePortraitTableColumnsItem<TData>[]; | 
| }; | 
|   | 
| export function usePortraitTable<TData extends object>(options: UsePortraitTableOptions<TData>) { | 
|   const portraitTableProps = computed( | 
|     () => | 
|       ({ | 
|         data: options.data.value, | 
|         columns: options.columns ?? [], | 
|       } as any) | 
|   ); | 
|   | 
|   return { | 
|     portraitTableProps, | 
|   }; | 
| } | 
|   | 
| type UsePortraitTableWithAttachmentOptions< | 
|   TData extends object, | 
|   TAnnexItem extends object = object | 
| > = UsePortraitTableOptions<TData> & { | 
|   annexList: Ref<TAnnexItem[]>; | 
|   columnsRenderProps?: { [key in keyof TAnnexItem]?: ColumnsRenderProps }; | 
| }; | 
|   | 
| export function usePortraitTableWithAttachment< | 
|   TData extends object, | 
|   TAnnexItem extends object = object | 
| >(options: UsePortraitTableWithAttachmentOptions<TData, TAnnexItem>) { | 
|   const { annexList, columnsRenderProps } = options; | 
|   const { portraitTableProps } = usePortraitTable(options); | 
|   | 
|   const portraitTableWithAttachmentProps = computed(() => ({ | 
|     annexList: annexList.value, | 
|     portraitTableProps: portraitTableProps.value, | 
|     columnsRenderProps, | 
|   })); | 
|   | 
|   return { portraitTableWithAttachmentProps }; | 
| } |