@opencloud-eu/design-system
Version:
OpenCloud Design System is used to design OpenCloud UI components
119 lines (118 loc) • 3.64 kB
TypeScript
import { AppearanceType } from '../../helpers';
export interface Props {
/**
* @docs The name of the icon to be displayed in the search bar. Please refer to the `OcIcon` component to see how to use icon names.
*/
icon?: string;
/**
* @docs The placeholder text of the search bar input.
*/
placeholder?: string;
/**
* @docs The label of the search bar input.
*/
label: string;
/**
* @docs Determines if the search bar is small.
* @default false
*/
small?: boolean;
/**
* @docs The label of the search button.
* @default Search
*/
buttonLabel?: string;
/**
* @docs Determines if the search button is hidden.
* @default false
*/
buttonHidden?: boolean;
/**
* @docs Determines if the search bar should perform a search on each keyup event.
* @default false
*/
typeAhead?: boolean;
/**
* @docs Determines if the search query should be trimmed.
* @default true
*/
trimQuery?: boolean;
/**
* @docs Determines if the search bar is in a loading state.
* @default false
*/
loading?: boolean;
/**
* @docs Determines if the search bar acts as a local filter. If set to `true`, the `role` attribute will not be set.
* @default false
*/
isFilter?: boolean;
/**
* @docs The accessible label for the loading spinner.
*/
loadingAccessibleLabel?: string;
/**
* @docs Determines if the cancel button should be shown. This is mostly used in mobile views.
* @default false
*/
showCancelButton?: boolean;
/**
* @docs The appearance of the cancel button.
* @default raw
*/
cancelButtonAppearance?: AppearanceType;
/**
* @docs The handler for the cancel button.
*/
cancelHandler?: () => void;
}
export interface Emits {
/**
* @docs Emitted when the search button has been clicked.
*/
(e: 'advancedSearch', event: MouseEvent): void;
/**
* @docs Emitted when the user has typed.
*/
(e: 'keyup', event: KeyboardEvent): void;
/**
* @docs Emitted when the user has performed a search.
*/
(e: 'search', query: string): void;
}
export interface Slots {
/**
* @docs Can be used to add additional filter options inside the search input.
*/
locationFilter?: () => unknown;
}
type __VLS_Props = Props;
type __VLS_PublicProps = {
modelValue?: string;
} & __VLS_Props;
declare function __VLS_template(): {
attrs: Partial<{}>;
slots: Readonly<Slots> & Slots;
refs: {};
rootEl: HTMLDivElement;
};
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
"update:modelValue": (value: string) => any;
} & {
search: (query: string) => any;
keyup: (event: KeyboardEvent) => any;
advancedSearch: (event: MouseEvent) => any;
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
onSearch?: (query: string) => any;
onKeyup?: (event: KeyboardEvent) => any;
"onUpdate:modelValue"?: (value: string) => any;
onAdvancedSearch?: (event: MouseEvent) => any;
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
export default _default;
type __VLS_WithTemplateSlots<T, S> = T & {
new (): {
$slots: S;
};
};