@gpa-gemstone/common-pages
Version:
Common UI pages for GPA products
62 lines (61 loc) • 1.73 kB
TypeScript
import { IStartEnd, IStartDuration, IEndDuration, TimeUnit } from './TimeWindowUtils';
import { DateUnit } from './QuickSelects';
import { Gemstone } from '@gpa-gemstone/application-typings';
export interface ITimeWindow {
start: string;
end: string;
unit: TimeUnit;
duration: number;
}
export type ITimeFilter = IStartEnd | IStartDuration | IEndDuration;
export type DateTimeSetting = 'startWindow' | 'endWindow' | 'startEnd';
interface IProps {
/**
* Filter to be used in form
*/
filter: ITimeFilter;
/**
* Setter function to update filter
* @param start - Start Time
* @param end - End Time
* @param unit - Time Unit
* @param duration - Duration
* @returns
*/
setFilter: (start: string, end: string, unit: TimeUnit, duration: number) => void;
/**
* Flag to toggle QuickSelects UI
*/
showQuickSelect: boolean;
/**
* Type of TimeFilter to render
*/
dateTimeSetting: DateTimeSetting;
/**
* Time zone to use
*/
timeZone: string;
/**
* Format for date/time input
*/
format?: DateUnit;
/**
* Accuracy of the time input
*/
accuracy?: Gemstone.TSX.Types.Accuracy;
/**
* Flag to toggle usage of helper message
*/
showHelpMessage?: boolean;
/**
* Optional Flag to enable collapsing of TimeFilter
*/
enableCollapse?: boolean;
/**
* Optional setter to push collapse state to parent
*/
setCollapsed?: (collapsed: boolean) => void;
}
declare const TimeFilter: (props: IProps) => JSX.Element;
export declare function getTimeWindowFromFilter(flt: ITimeFilter, format?: string): ITimeWindow;
export default TimeFilter;