43 lines
1.5 KiB
TypeScript
43 lines
1.5 KiB
TypeScript
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
import { Props as Props$1 } from 'react-select';
|
|
|
|
type ICustomTimezone = {
|
|
[key: string]: string;
|
|
};
|
|
type ILabelStyle = "original" | "altName" | "abbrev" | "offsetHidden";
|
|
type IDisplayValue = "GMT" | "UTC";
|
|
type ITimezoneOption = {
|
|
value: string;
|
|
label: string;
|
|
abbrev?: string;
|
|
altName?: string;
|
|
offset?: number;
|
|
searchTerms?: string;
|
|
};
|
|
type ITimezone = ITimezoneOption | string;
|
|
type TimezoneSelectOptions = {
|
|
labelStyle?: ILabelStyle;
|
|
displayValue?: IDisplayValue;
|
|
timezones?: ICustomTimezone;
|
|
currentDatetime?: Date | string;
|
|
};
|
|
type Props = Omit<Props$1<ITimezone>, "onChange"> & TimezoneSelectOptions & {
|
|
value: ITimezone;
|
|
onChange?: (timezone: ITimezoneOption) => void;
|
|
};
|
|
|
|
declare const allTimezones: ICustomTimezone;
|
|
|
|
declare function useTimezoneSelect({ timezones, labelStyle, displayValue, currentDatetime, }: TimezoneSelectOptions): {
|
|
parseTimezone: (zone: ITimezone) => ITimezoneOption;
|
|
options: ITimezoneOption[];
|
|
filterOption: (option: {
|
|
label: string;
|
|
value: string;
|
|
data: ITimezone;
|
|
}, inputValue: string) => boolean;
|
|
};
|
|
declare const TimezoneSelect: ({ value, onBlur, onChange, labelStyle, displayValue, timezones, currentDatetime, ...props }: Props) => react_jsx_runtime.JSX.Element;
|
|
|
|
export { type ILabelStyle, type ITimezone, type ITimezoneOption, type Props, type TimezoneSelectOptions, allTimezones, TimezoneSelect as default, useTimezoneSelect };
|