@tomino/dynamic-form-semantic-ui
Version:
Semantic UI form renderer based on dynamic form generation
50 lines (49 loc) • 1.69 kB
TypeScript
import * as React from 'react';
import { SearchResultData, SearchProps } from 'semantic-ui-react';
import { FormComponentProps, BoundProp } from '@tomino/dynamic-form';
import { ContextType } from '../context';
declare type DropdownOption = {
title: string;
titles: string[];
description?: string;
image?: string;
price?: string;
value: string;
};
declare type State = {
isLoading: boolean;
value: string;
options: DropdownOption[];
};
export declare type SearchComponentProps = {
searchName: string;
renderTemplate: string;
search: string;
single: number;
limit: number;
value: BoundProp;
};
export declare const SearchComponent: React.FC<FormComponentProps<SearchComponentProps>>;
export declare class SearchWithContext extends React.Component<FormComponentProps<SearchComponentProps> & {
context: ContextType;
}, State> {
static contextType: React.Context<ContextType>;
state: {
isLoading: boolean;
options: any[];
value: string;
};
componentDidMount(): Promise<void>;
resetComponent: () => void;
handleResultSelect: (_event: React.MouseEvent<HTMLDivElement, MouseEvent>, { result }: SearchResultData) => boolean;
handleSearchChange: (_event: React.MouseEvent<HTMLElement, MouseEvent>, { value }: SearchProps) => void;
createTitles(options: DropdownOption[]): void;
resultRenderer: (option: any) => JSX.Element;
getResults: (value: string) => any[];
render(): string | JSX.Element;
}
export declare const SearchView: {
Component: React.FunctionComponent<FormComponentProps<SearchComponentProps, any, any>>;
toString: () => string;
};
export {};