|
1 | 1 | import * as React from 'react';
|
2 |
| -import { addClass, classes, isNumber } from '../Globals'; |
| 2 | +import { addClass, classes } from '../Globals'; |
3 | 3 | import { timeToString, timePlaceholder, toLuxonDurationFormat } from '../Reflection';
|
4 | 4 | import { LineBaseController, useController } from '../Lines/LineBase';
|
5 | 5 | import { FormGroup } from '../Lines/FormGroup';
|
6 | 6 | import { FormControlReadonly } from '../Lines/FormControlReadonly';
|
7 | 7 | import { ValueBaseController, ValueBaseProps } from './ValueBase';
|
8 | 8 | import { Duration } from 'luxon';
|
| 9 | +import { isNumberKey } from './NumberLine'; |
9 | 10 |
|
10 | 11 | export interface TimeLineProps extends ValueBaseProps<TimeLineController> {
|
11 | 12 |
|
@@ -59,7 +60,7 @@ export const TimeLine = React.memo(React.forwardRef(function TimeLine(props: Tim
|
59 | 60 | id={inputId}
|
60 | 61 | value={s.ctx.value}
|
61 | 62 | onChange={handleOnChange}
|
62 |
| - validateKey={isDuration} |
| 63 | + validateKey={isDurationKey} |
63 | 64 | formControlClass={classes(s.ctx.formControlClass, c.mandatoryClass)}
|
64 | 65 | durationFormat={durationFormat}
|
65 | 66 | innerRef={c.setRefs} />
|
@@ -165,7 +166,7 @@ TimeTextBox.defaultProps = {
|
165 | 166 | durationFormat: "hh:mm:ss"
|
166 | 167 | };
|
167 | 168 |
|
168 |
| -export function isDuration(e: React.KeyboardEvent<any>): boolean { |
| 169 | +export function isDurationKey(e: React.KeyboardEvent<any>): boolean { |
169 | 170 | const c = e.keyCode;
|
170 |
| - return isNumber(e) || e.key == ":"; |
| 171 | + return isNumberKey(e) || e.key == ":"; |
171 | 172 | }
|
0 commit comments