@bitrix24/b24ui-nuxt
Version:
Bitrix24 UI-Kit for developing web applications REST API for NUXT & VUE
98 lines (97 loc) • 3.33 kB
text/typescript
import type { AppConfig } from '@nuxt/schema';
import theme from '#build/b24ui/description-list';
import type { AvatarProps, ButtonProps, IconComponent } from '../types';
import type { DynamicSlots } from '../types/utils';
import type { ComponentConfig } from '../types/tv';
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;
b24ui: DescriptionList['b24ui'];
}) => any;
export type DescriptionListSlots<T extends DescriptionListItem = DescriptionListItem> = {
'legend'(props?: {}): any;
'text'(props?: {}): any;
'leading': SlotProps<T>;
'label'(props: {
item: T;
index: number;
}): any;
'description'(props: {
item: T;
index: number;
}): any;
'actions': SlotProps<T>;
'content-top': SlotProps<T>;
'content': SlotProps<T>;
'content-bottom': SlotProps<T>;
'footer'(props?: {
b24ui: DescriptionList['b24ui'];
}): any;
} & DynamicSlots<T, undefined, {
index: number;
b24ui: DescriptionList['b24ui'];
}>;
declare const __VLS_export: <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<DescriptionListProps<T>> & import("vue").PublicProps & (typeof globalThis extends {
__VLS_PROPS_FALLBACK: infer P;
} ? P : {});
expose: (exposed: {}) => void;
attrs: any;
slots: DescriptionListSlots<T>;
emit: {};
}>) => import("vue").VNode & {
__ctx?: Awaited<typeof __VLS_setup>;
};
declare const _default: typeof __VLS_export;
export default _default;
type __VLS_PrettifyLocal<T> = {
[K in keyof T as K]: T[K];
} & {};