@bitrix24/b24ui-nuxt
Version:
Bitrix24 UI-Kit for developing web applications REST API for NUXT & VUE
88 lines (87 loc) • 3.6 kB
TypeScript
import type { AppConfig } from '@nuxt/schema';
import type { UseFuseOptions } from '@vueuse/integrations/useFuse';
import theme from '#build/b24ui/dashboard-search';
import type { ButtonProps, InputProps, ModalProps, CommandPaletteProps, CommandPaletteSlots, CommandPaletteGroup, CommandPaletteItem, IconComponent, LinkPropsKeys } from '../types';
import type { ComponentConfig } from '../types/tv';
type DashboardSearch = ComponentConfig<typeof theme, AppConfig, 'dashboardSearch'>;
/**
* @memo not use loadingIcon
*/
export interface DashboardSearchProps<T extends CommandPaletteItem = CommandPaletteItem> extends Pick<ModalProps, 'title' | 'description' | 'overlay' | 'transition' | 'content' | 'dismissible' | 'fullscreen' | 'modal' | 'portal'> {
/**
* The icon displayed in the input.
* @defaultValue icons.search
* @IconComponent
*/
icon?: IconComponent;
/**
* The placeholder text for the input.
* @defaultValue t('commandPalette.placeholder')
*/
placeholder?: InputProps['placeholder'];
/**
* Automatically focus the input when component is mounted.
* @defaultValue true
*/
autofocus?: boolean;
/** When `true`, the loading icon will be displayed. */
loading?: boolean;
/**
* Display a close button in the input (useful when inside a Modal for example).
* `{ size: 'sm', color: 'air-tertiary-no-accent' }`{lang="ts-type"}
* @emits 'update:open'
* @defaultValue true
*/
close?: boolean | Omit<ButtonProps, LinkPropsKeys>;
/**
* The icon displayed in the close button.
* @defaultValue icons.close
* @IconComponent
*/
closeIcon?: IconComponent;
/**
* Keyboard shortcut to open the search (used by [`defineShortcuts`](https://bitrix24.github.io/b24ui/docs/composables/define-shortcuts/))
* @defaultValue 'meta_k'
*/
shortcut?: string;
groups?: CommandPaletteGroup<T>[];
/**
* Options for [useFuse](https://vueuse.org/integrations/useFuse) passed to the [CommandPalette](https://bitrix24.github.io/b24ui/docs/components/command-palette/).
* @defaultValue {}
*/
fuse?: UseFuseOptions<T>;
/**
* When `true`, the theme command will be added to the groups.
* @defaultValue true
*/
colorMode?: boolean;
class?: any;
b24ui?: DashboardSearch['slots'] & CommandPaletteProps<CommandPaletteGroup<CommandPaletteItem>, CommandPaletteItem>['b24ui'];
}
export type DashboardSearchSlots = CommandPaletteSlots<CommandPaletteGroup<CommandPaletteItem>, CommandPaletteItem> & {
content(props: {
close: () => void;
}): any;
};
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<DashboardSearchProps<CommandPaletteItem> & {
open?: boolean;
searchTerm?: string;
}, {
commandPaletteRef: Readonly<import("vue").ShallowRef<any>>;
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
"update:open": (value: boolean) => any;
"update:searchTerm": (value: string) => any;
}, string, import("vue").PublicProps, Readonly<DashboardSearchProps<CommandPaletteItem> & {
open?: boolean;
searchTerm?: string;
}> & Readonly<{
"onUpdate:open"?: ((value: boolean) => any) | undefined;
"onUpdate:searchTerm"?: ((value: string) => any) | undefined;
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, DashboardSearchSlots>;
declare const _default: typeof __VLS_export;
export default _default;
type __VLS_WithSlots<T, S> = T & {
new (): {
$slots: S;
};
};