@nuralyui/timepicker
Version:
NuralyUI TimePicker - A comprehensive time selection component with clock interface, multiple formats, and validation
161 lines • 3.25 kB
TypeScript
/**
* @license
* Copyright 2023 Nuraly, Laabidi Aymen
* SPDX-License-Identifier: MIT
*/
/**
* Time format types - supports 12-hour and 24-hour formats
*/
export declare enum TimeFormat {
TwentyFourHour = "24h",
TwelveHour = "12h"
}
/**
* Time picker display modes
*/
export declare enum TimePickerMode {
Hours = "hours",
Minutes = "minutes",
Seconds = "seconds"
}
/**
* Time picker sizes
*/
export declare enum TimePickerSize {
Small = "small",
Medium = "medium",
Large = "large"
}
/**
* Time picker variants
*/
export declare enum TimePickerVariant {
Default = "default",
Outlined = "outlined",
Filled = "filled"
}
/**
* Time picker states for validation
*/
export declare enum TimePickerState {
Default = "default",
Error = "error",
Warning = "warning",
Success = "success"
}
/**
* Time picker placement options for dropdown
*/
export declare enum TimePickerPlacement {
Bottom = "bottom",
Top = "top",
Auto = "auto"
}
/**
* Time selection step increments
*/
export declare enum TimeStep {
One = 1,
Five = 5,
Ten = 10,
Fifteen = 15,
Thirty = 30
}
/**
* Time period for 12-hour format
*/
export declare enum TimePeriod {
AM = "AM",
PM = "PM"
}
/**
* Time structure interface
*/
export interface TimeValue {
hours: number;
minutes: number;
seconds: number;
period?: TimePeriod;
}
/**
* Time picker option for dropdowns
*/
export interface TimePickerOption {
value: string;
label: string;
disabled?: boolean;
}
/**
* Time validation constraints
*/
export interface TimeConstraints {
minTime?: string;
maxTime?: string;
disabledTimes?: string[];
enabledTimes?: string[];
}
/**
* Time picker configuration
*/
export interface TimePickerConfig {
format: TimeFormat;
showSeconds: boolean;
step: {
hours: TimeStep;
minutes: TimeStep;
seconds: TimeStep;
};
use12HourClock: boolean;
minuteInterval: number;
secondInterval: number;
}
/**
* Time picker event details
*/
export interface TimeChangeEventDetail {
value: string;
timeValue: TimeValue;
formattedValue: string;
}
/**
* Default time formats
*/
export declare const DEFAULT_TIME_FORMATS: {
readonly "24h": "HH:mm";
readonly "12h": "hh:mm A";
};
/**
* Default time format with seconds
*/
export declare const DEFAULT_TIME_FORMATS_WITH_SECONDS: {
readonly "24h": "HH:mm:ss";
readonly "12h": "hh:mm:ss A";
};
/**
* Time picker constants
*/
export declare const TIME_PICKER_CONSTANTS: {
readonly HOURS_24: 24;
readonly HOURS_12: 12;
readonly MINUTES: 60;
readonly SECONDS: 60;
readonly DEFAULT_STEP: 1;
readonly DEFAULT_MINUTE_INTERVAL: 1;
readonly DEFAULT_SECOND_INTERVAL: 1;
};
/**
* Time picker events
*/
export declare const TIME_PICKER_EVENTS: {
readonly TIME_CHANGE: "nr-time-change";
readonly FOCUS: "nr-focus";
readonly BLUR: "nr-blur";
readonly CLOCK_OPEN: "nr-clock-open";
readonly CLOCK_CLOSE: "nr-clock-close";
readonly VALIDATION: "nr-validation";
};
/**
* Empty time value
*/
export declare const EMPTY_TIME_VALUE: TimeValue;
//# sourceMappingURL=timepicker.types.d.ts.map