generated from gravity-ui/package-example
-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
It should be a component for time selection.
Requirements:
- The component should be fully accessible.
- The component should not include an input.
- The date should not change when scrolling the token.
- There is no need to add endless scrolling in the first iteration.
Sources of inspiration:
- https://mui.com/x/react-date-pickers/digital-clock/
- https://mui.com/x/api/date-pickers/multi-section-digital-clock/
Interface:
import type {DateTime} from '@gravity-ui/date-utils';
export type TimeSelectionView = 'hours' | 'minutes' | 'seconds';
export interface TimeSelectionProps {
ampm?: boolean;
defaultFocusView?: TimeSelectionView;
defaultValue?: DateTime;
disabled?: boolean;
focusedView?: TimeSelectionView;
isTimeDisabled?: (value: DateTime, view: TimeSelectionView) => boolean;
onFocusViewUpdate?: (value: TimeSelectionView) => void;
onUpdate?: (value: DateTime) => void;
minValue?: DateTime;
maxValue?: DateTime;
readOnly?: boolean;
timeSteps?: Record<TimeSelectionView, number>;
timeZone?: string;
value?: DateTime;
views?: TimeSelectionView[];
}Metadata
Metadata
Assignees
Labels
No labels