UNPKG

@bitrix24/b24ui-nuxt

Version:

Bitrix24 UI-Kit for developing web applications REST API for NUXT & VUE

86 lines (85 loc) 3.15 kB
import type { AppConfig } from '@nuxt/schema'; import theme from '#build/b24ui/description-list'; import type { AvatarProps, ButtonProps, IconComponent } from '../types'; import type { DynamicSlots, ComponentConfig } from '../types/utils'; type DescriptionList = ComponentConfig<typeof theme, AppConfig, 'descriptionList'>; export interface DescriptionListItem { label?: string; /** * Display an icon on the left side. * @IconComponent */ icon?: IconComponent; avatar?: AvatarProps; slot?: string; description?: string; /** * The orientation between the content and the actions. * @defaultValue 'vertical' */ orientation?: DescriptionList['variants']['orientation']; /** * Display a list of actions: * - under the description when orientation is `vertical` * - next to the description when orientation is `horizontal` * `{ size: 'xs' }`{lang="ts"} */ actions?: ButtonProps[]; class?: any; b24ui?: Pick<DescriptionList['slots'], 'labelWrapper' | 'icon' | 'avatar' | 'label' | 'descriptionWrapper' | 'description' | 'actions'>; [key: string]: any; } export interface DescriptionListProps<T extends DescriptionListItem = DescriptionListItem> { legend?: string; text?: string; /** * The key used to get the label from the item. * @defaultValue 'label' */ labelKey?: string; /** * The key used to get the description from the item. * @defaultValue 'description' */ descriptionKey?: string; items?: T[]; /** * @defaultValue 'md' */ size?: DescriptionList['variants']['size']; class?: any; b24ui?: DescriptionList['slots']; } type SlotProps<T extends DescriptionListItem> = (props: { item: T; index: number; }) => any; export type DescriptionListSlots<T extends DescriptionListItem = DescriptionListItem> = { 'legend'(props?: {}): any; 'text'(props?: {}): any; 'leading': SlotProps<T>; 'label': SlotProps<T>; 'description': SlotProps<T>; 'actions': SlotProps<T>; 'content-top': SlotProps<T>; 'content': SlotProps<T>; 'content-bottom': SlotProps<T>; 'footer'(props?: { b24ui: any; }): any; } & DynamicSlots<T, undefined, { index: number; }>; declare const _default: <T extends DescriptionListItem>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> & DescriptionListProps<T> & {}> & import("vue").PublicProps; expose(exposed: import("vue").ShallowUnwrapRef<{}>): void; attrs: any; slots: DescriptionListSlots<T>; emit: {}; }>) => import("vue").VNode & { __ctx?: Awaited<typeof __VLS_setup>; }; export default _default; type __VLS_PrettifyLocal<T> = { [K in keyof T as K]: T[K]; } & {};