Skip to content

Commit

Permalink
feat(kit): MaskitoTimeOptions interface
Browse files Browse the repository at this point in the history
  • Loading branch information
demensky committed Jun 13, 2024
1 parent 733093d commit 7950b6d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion projects/kit/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export {maskitoDateOptionsGenerator} from './lib/masks/date';
export {maskitoDateRangeOptionsGenerator} from './lib/masks/date-range';
export {maskitoDateTimeOptionsGenerator} from './lib/masks/date-time';
export {maskitoNumberOptionsGenerator, maskitoParseNumber} from './lib/masks/number';
export {maskitoTimeOptionsGenerator} from './lib/masks/time';
export {MaskitoTimeOptions, maskitoTimeOptionsGenerator} from './lib/masks/time';
export {
maskitoAddOnFocusPlugin,
maskitoCaretGuard,
Expand Down
1 change: 1 addition & 0 deletions projects/kit/src/lib/masks/time/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export {maskitoTimeOptionsGenerator} from './time-mask';
export {MaskitoTimeOptions} from './time-options';
8 changes: 2 additions & 6 deletions projects/kit/src/lib/masks/time/time-mask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,14 @@ import {
createFullWidthToHalfWidthPreprocessor,
createZeroPlaceholdersPreprocessor,
} from '../../processors';
import type {MaskitoTimeMode, MaskitoTimeSegments} from '../../types';
import {createMaxValidationPreprocessor} from './processors';
import type {MaskitoTimeOptions} from './time-options';

export function maskitoTimeOptionsGenerator({
mode,
timeSegmentMaxValues = {},
step = 0,
}: {
mode: MaskitoTimeMode;
timeSegmentMaxValues?: Partial<MaskitoTimeSegments<number>>;
step?: number;
}): Required<MaskitoOptions> {
}: MaskitoTimeOptions): Required<MaskitoOptions> {
const enrichedTimeSegmentMaxValues = {
...DEFAULT_TIME_SEGMENT_MAX_VALUES,
...timeSegmentMaxValues,
Expand Down
7 changes: 7 additions & 0 deletions projects/kit/src/lib/masks/time/time-options.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type {MaskitoTimeMode, MaskitoTimeSegments} from '../../types';

export interface MaskitoTimeOptions {
readonly mode: MaskitoTimeMode;
readonly timeSegmentMaxValues?: Partial<MaskitoTimeSegments<number>>;
readonly step?: number;
}

0 comments on commit 7950b6d

Please sign in to comment.