mithril-materialized
Version:
A materialize library for mithril.
52 lines (51 loc) • 2 kB
TypeScript
import { FactoryComponent } from 'mithril';
import { InputAttrs } from './input-options';
export interface TimepickerI18n {
cancel?: string;
clear?: string;
done?: string;
next?: string;
}
export interface TimeRangePickerAttrs extends Omit<InputAttrs<string>, 'defaultValue' | 'onchange'> {
/** Starting time value in HH:MM or HH:MM AM/PM format */
startValue?: string;
/** Ending time value in HH:MM or HH:MM AM/PM format */
endValue?: string;
/** Enable validation: end time must be after start time */
validateRange?: boolean;
/** Callback when time range changes */
onchange?: (startTime: string, endTime: string) => void;
/** i18n for time range picker */
i18n?: TimepickerI18n;
/** Use 12-hour format with AM/PM */
twelveHour?: boolean;
/** Display mode: 'analog' or 'digital' (default: 'digital') */
displayMode?: 'analog' | 'digital';
/** Step for minute increments (default 5) */
minuteStep?: number;
/** Step for hour increments (default 1) */
hourStep?: number;
/** Minimum selectable time in HH:MM or HH:MM AM/PM format */
minTime?: string;
/** Maximum selectable time in HH:MM or HH:MM AM/PM format */
maxTime?: string;
/** Show clear button */
showClearBtn?: boolean;
/** Dial radius for analog clock (default: 135) */
dialRadius?: number;
/** Outer radius for analog clock (default: 105) */
outerRadius?: number;
/** Inner radius for analog clock (default: 70) */
innerRadius?: number;
/** Tick radius for analog clock (default: 20) */
tickRadius?: number;
/** Round by 5 minutes for analog clock (default: false) */
roundBy5?: boolean;
/** Vibrate on value change for analog clock (default: true) */
vibrate?: boolean;
}
/**
* TimeRangePicker component for selecting time ranges
* Custom implementation with embedded digital clock picker
*/
export declare const TimeRangePicker: FactoryComponent<TimeRangePickerAttrs>;