UNPKG

catreact

Version:

Catavolt Core React Components

108 lines (107 loc) 4.44 kB
/** * Created by rburson on 7/25/16. */ import * as React from 'react'; import { CvEditorBaseProps, CvEditorBaseState, CvEditorPaneCallback, CvResultCallback, CvNavigationResult } from './catreact-core'; import { EntityRecDef } from 'catavolt-sdk'; export declare type CvSearchValueOperator = 'Equal' | 'Not Equal' | 'Greater Than' | 'Less Than' | 'Contains' | 'Starts With' | 'Ends With'; export declare type CvSortDirection = 'ASC' | 'DSC'; export declare const FILTER_VALUE_SUFFIX: string; export declare const FILTER_OPERATOR_SUFFIX: string; export declare const SORT_DIRECTION_SUFFIX: string; export declare const SORT_SEQUENCE_SUFFIX: string; export interface CvSearchPaneState extends CvEditorBaseState { } export interface CvSearchPaneProps extends CvEditorBaseProps { } /** * Allows for setting search values on underlying editor model */ export interface CvSearchPaneCallback extends CvEditorPaneCallback { /** * Reset all search values to 'null'. */ clear(): void; /** * Reset all filter related values to 'null', leaving 'sort' values intact. */ clearSearchValues(): void; /** * Reset all sort related values to 'null', leaving 'search/filter' values intact. */ clearSortValues(): void; /** * Get the current search value (if previously set) for this property name. * @param propName */ getSearchValue(propName: any): string; /** * Get the current search value's operation (if previously set) for this property name. * @param propName */ getSearchValueOperation(propName: any): string; /** * Get the current search value's sort direction (if previously set) for this property name. * @param propName */ getSortValueDirection(propName: any): string; /** * Get the current search value's sort priority (if previously set) for this property name. * @param propName */ getSortValuePriority(propName: any): string; /** * Get whether or not the current search value's sort direction is ascending for this property name. */ isAscending(propName: any): boolean; /** * Get whether or not the current search value's sort direction is descending for this property name. */ isDescending(propName: any): boolean; /** * After a submission, the search model is returned in 'read' mode. To search again, this should be called * prior to making any param changes. * @param resultCallback */ reopenSearch(resultCallback?: CvResultCallback<EntityRecDef>): void; /** * Sort the search by the specified property in the ascending direction with priority (defaults to 0, meaning primary sort field). * @param propName * @param sortFieldPriority */ setAscending(propName: string, sortFieldPriority: number): void; /** * Sort the search by the specified property in the descending direction with priority (defaults to 0, meaning primary sort field). * @param propName * @param sortFieldPriority */ setDescending(propName: string, sortFieldPriority: number): void; /** Set the 'value' of the search operation for a property(i.e. The 'thing' to be searched on this property). This is the value to run against the accompanying operator * @param propName * @param searchValue */ setSearchValue(propName: string, searchValue: string): any; /** * Set the value of the 'operation' to perform on this property. The valid values are defined by {@link CvSearchValueOperator} * @param propName * @param operator */ setSearchValueOperation(propName: string, operator: CvSearchValueOperator): any; /** * Sort the search by the specified property. Set the sort direction {@link CvSortDirection} and priority (defaults to 0, meaning primary sort field). * @param propName * @param sortDirection * @param sortFieldPriority */ setSortValue(propName: string, sortDirection: CvSortDirection, sortFieldPriority: number): any; /** * Submit the search. If successful, returns search editor model in 'read' mode. The search will be applied when the backing list is refreshed. * @param resultCallback */ submitSearch(resultCallback?: CvResultCallback<CvNavigationResult>): any; } /** * Render a Search Model */ export declare var CvSearchPane: React.ClassicComponentClass<CvSearchPaneProps>;