use-mask-input 3.10.3 → 3.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,5 @@
1
1
  import { ChangeEvent, FocusEvent, RefCallback } from "react";
2
-
3
- //#region ../../node_modules/.pnpm/react-hook-form@7.75.0_react@19.2.7/node_modules/react-hook-form/dist/types/path/common.d.ts
2
+ //#region ../../node_modules/.pnpm/react-hook-form@7.82.0_react@19.2.7/node_modules/react-hook-form/dist/types/path/common.d.ts
4
3
  /**
5
4
  * Type to query whether an array type T is a tuple type.
6
5
  * @typeParam T - type which may be an array or tuple
@@ -25,7 +24,7 @@ type ArrayKey = number;
25
24
  */
26
25
  type TupleKeys<T extends ReadonlyArray<any>> = Exclude<keyof T, keyof any[]>;
27
26
  //#endregion
28
- //#region ../../node_modules/.pnpm/react-hook-form@7.75.0_react@19.2.7/node_modules/react-hook-form/dist/types/path/eager.d.ts
27
+ //#region ../../node_modules/.pnpm/react-hook-form@7.82.0_react@19.2.7/node_modules/react-hook-form/dist/types/path/eager.d.ts
29
28
  /**
30
29
  * Helper function to break apart T1 and check if any are equal to T2
31
30
  *
@@ -46,7 +45,7 @@ type PathImpl<K extends string | number, V, TraversedTypes> = V extends Primitiv
46
45
  *
47
46
  * See {@link Path}
48
47
  */
49
- type PathInternal<T, TraversedTypes = T> = T extends ReadonlyArray<infer V> ? IsTuple<T> extends true ? { [K in TupleKeys<T>]-?: PathImpl<K & string, T[K], TraversedTypes> }[TupleKeys<T>] : PathImpl<ArrayKey, V, TraversedTypes> : { [K in keyof T]-?: PathImpl<K & string, T[K], TraversedTypes> }[keyof T];
48
+ type PathInternal<T, TraversedTypes = T> = T extends ReadonlyArray<infer V> ? IsTuple<T> extends true ? { [K in TupleKeys<T>]-?: PathImpl<K & string, T[K], TraversedTypes>; }[TupleKeys<T>] : PathImpl<ArrayKey, V, TraversedTypes> : { [K in keyof T]-?: PathImpl<K & string, T[K], TraversedTypes>; }[keyof T];
50
49
  /**
51
50
  * Type which eagerly collects all paths through a type
52
51
  * @typeParam T - type which should be introspected
@@ -74,7 +73,7 @@ type ArrayPathImpl<K extends string | number, V, TraversedTypes> = V extends Pri
74
73
  *
75
74
  * See {@link ArrayPath}
76
75
  */
77
- type ArrayPathInternal<T, TraversedTypes = T> = T extends ReadonlyArray<infer V> ? IsTuple<T> extends true ? { [K in TupleKeys<T>]-?: ArrayPathImpl<K & string, T[K], TraversedTypes> }[TupleKeys<T>] : ArrayPathImpl<ArrayKey, V, TraversedTypes> : { [K in keyof T]-?: ArrayPathImpl<K & string, T[K], TraversedTypes> }[keyof T];
76
+ type ArrayPathInternal<T, TraversedTypes = T> = T extends ReadonlyArray<infer V> ? IsTuple<T> extends true ? { [K in TupleKeys<T>]-?: ArrayPathImpl<K & string, T[K], TraversedTypes>; }[TupleKeys<T>] : ArrayPathImpl<ArrayKey, V, TraversedTypes> : { [K in keyof T]-?: ArrayPathImpl<K & string, T[K], TraversedTypes>; }[keyof T];
78
77
  /**
79
78
  * Type which eagerly collects all paths through a type which point to an array
80
79
  * type.
@@ -102,7 +101,7 @@ type PathValueImpl<T, P extends string> = T extends any ? P extends `${infer K}.
102
101
  */
103
102
  type FieldPathValue<TFieldValues extends FieldValues, TFieldPath extends FieldPath<TFieldValues>> = PathValue<TFieldValues, TFieldPath>;
104
103
  //#endregion
105
- //#region ../../node_modules/.pnpm/react-hook-form@7.75.0_react@19.2.7/node_modules/react-hook-form/dist/types/form.d.ts
104
+ //#region ../../node_modules/.pnpm/react-hook-form@7.82.0_react@19.2.7/node_modules/react-hook-form/dist/types/form.d.ts
106
105
  type ChangeHandler = (event: {
107
106
  target: any;
108
107
  type?: any;
@@ -130,7 +129,7 @@ type UseFormRegisterReturn<TFieldName extends InternalFieldName = InternalFieldN
130
129
  * @param name - the path name to the form field value, name is required and unique
131
130
  * @param options - register options include validation, disabled, unregister, value as and dependent validation
132
131
  *
133
- * @returns onChange, onBlur, name, ref, and native contribute attribute if browser validation is enabled.
132
+ * @returns onChange, onBlur, name, ref, and native HTML validation attributes if browser validation is enabled.
134
133
  *
135
134
  * @example
136
135
  * ```tsx
@@ -156,7 +155,7 @@ type UseFormRegisterReturn<TFieldName extends InternalFieldName = InternalFieldN
156
155
  */
157
156
  type UseFormRegister<TFieldValues extends FieldValues> = <TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>(name: TFieldName, options?: RegisterOptions<TFieldValues, TFieldName>) => UseFormRegisterReturn<TFieldName>;
158
157
  //#endregion
159
- //#region ../../node_modules/.pnpm/react-hook-form@7.75.0_react@19.2.7/node_modules/react-hook-form/dist/types/utils.d.ts
158
+ //#region ../../node_modules/.pnpm/react-hook-form@7.82.0_react@19.2.7/node_modules/react-hook-form/dist/types/utils.d.ts
160
159
  interface File extends Blob {
161
160
  readonly lastModified: number;
162
161
  readonly name: string;
@@ -194,14 +193,14 @@ type IsAny<T> = 0 extends 1 & T ? true : false;
194
193
  */
195
194
  type IsEqual<T1, T2> = T1 extends T2 ? (<G>() => G extends T1 ? 1 : 2) extends (<G>() => G extends T2 ? 1 : 2) ? true : false : false;
196
195
  //#endregion
197
- //#region ../../node_modules/.pnpm/react-hook-form@7.75.0_react@19.2.7/node_modules/react-hook-form/dist/types/fields.d.ts
196
+ //#region ../../node_modules/.pnpm/react-hook-form@7.82.0_react@19.2.7/node_modules/react-hook-form/dist/types/fields.d.ts
198
197
  type InternalFieldName = string;
199
198
  type FieldValues = Record<string, any>;
200
199
  //#endregion
201
- //#region ../../node_modules/.pnpm/react-hook-form@7.75.0_react@19.2.7/node_modules/react-hook-form/dist/types/errors.d.ts
200
+ //#region ../../node_modules/.pnpm/react-hook-form@7.82.0_react@19.2.7/node_modules/react-hook-form/dist/types/errors.d.ts
202
201
  type Message = string;
203
202
  //#endregion
204
- //#region ../../node_modules/.pnpm/react-hook-form@7.75.0_react@19.2.7/node_modules/react-hook-form/dist/types/validator.d.ts
203
+ //#region ../../node_modules/.pnpm/react-hook-form@7.82.0_react@19.2.7/node_modules/react-hook-form/dist/types/validator.d.ts
205
204
  type ValidationValue = boolean | number | string | RegExp;
206
205
  type ValidationRule<TValidationValue extends ValidationValue = ValidationValue> = TValidationValue | ValidationValueMessage<TValidationValue>;
207
206
  type ValidationValueMessage<TValidationValue extends ValidationValue = ValidationValue> = {
@@ -249,505 +248,505 @@ type Casing = 'upper' | 'lower' | 'title';
249
248
  type DefinitionValidator = (chrs: string, maskset: any, pos: number, strict: boolean, opts: Options$1) => boolean | CommandObject;
250
249
  interface Options$1 {
251
250
  /**
252
- * Change the mask placeholder. Instead of "_", you can change the unfilled
253
- * characters mask as you like, simply by adding the placeholder option.
254
- * For example, placeholder: " " will change the default autofill with empty
255
- * values.
256
- *
257
- * @default "_"
258
- */
251
+ * Change the mask placeholder. Instead of "_", you can change the unfilled
252
+ * characters mask as you like, simply by adding the placeholder option.
253
+ * For example, placeholder: " " will change the default autofill with empty
254
+ * values.
255
+ *
256
+ * @default "_"
257
+ */
259
258
  placeholder?: string | undefined;
260
259
  /**
261
- * Definition of the symbols used to indicate an optional part in the mask.
262
- *
263
- * @default { start: "[", end: "]" }
264
- */
260
+ * Definition of the symbols used to indicate an optional part in the mask.
261
+ *
262
+ * @default { start: "[", end: "]" }
263
+ */
265
264
  optionalmarker?: Range | undefined;
266
265
  /**
267
- * Definition of the symbols used to indicate a quantifier in the mask.
268
- *
269
- * @default { start: "{", end: "}" }
270
- */
266
+ * Definition of the symbols used to indicate a quantifier in the mask.
267
+ *
268
+ * @default { start: "{", end: "}" }
269
+ */
271
270
  quantifiermarker?: Range | undefined;
272
271
  /**
273
- * Definition of the symbols used to indicate a group in the mask.
274
- *
275
- * @default { start: "(", end: ")" }
276
- */
272
+ * Definition of the symbols used to indicate a group in the mask.
273
+ *
274
+ * @default { start: "(", end: ")" }
275
+ */
277
276
  groupmarker?: Range | undefined;
278
277
  /**
279
- * Definition of the symbols used to indicate an alternator part in the mask.
280
- *
281
- * @default "|"
282
- */
278
+ * Definition of the symbols used to indicate an alternator part in the mask.
279
+ *
280
+ * @default "|"
281
+ */
283
282
  alternatormarker?: string | undefined;
284
283
  /**
285
- * Definition of the symbols used to escape a part in the mask.
286
- *
287
- * @default "\\"
288
- */
284
+ * Definition of the symbols used to escape a part in the mask.
285
+ *
286
+ * @default "\\"
287
+ */
289
288
  escapeChar?: string | undefined;
290
289
  /**
291
- * The mask to use.
292
- */
290
+ * The mask to use.
291
+ */
293
292
  mask?: string | string[] | ((opts: Options$1) => string | string[]) | undefined;
294
293
  /**
295
- * Use a regular expression as a mask. When using shorthands be aware that you need to double escape or use
296
- * String.raw with a string literal.
297
- */
294
+ * Use a regular expression as a mask. When using shorthands be aware that you need to double escape or use
295
+ * String.raw with a string literal.
296
+ */
298
297
  regex?: string | undefined;
299
298
  /**
300
- * Execute a function when the mask is completed.
301
- */
299
+ * Execute a function when the mask is completed.
300
+ */
302
301
  oncomplete?: (() => void) | undefined;
303
302
  /**
304
- * Execute a function when the mask is cleared.
305
- */
303
+ * Execute a function when the mask is cleared.
304
+ */
306
305
  onincomplete?: (() => void) | undefined;
307
306
  /**
308
- * Execute a function when the mask is cleared.
309
- */
307
+ * Execute a function when the mask is cleared.
308
+ */
310
309
  oncleared?: (() => void) | undefined;
311
310
  /**
312
- * Mask repeat function. Repeat the mask definition x-times.
313
- * `*` ~ forever, otherwise specify an integer
314
- *
315
- * @default 0
316
- */
311
+ * Mask repeat function. Repeat the mask definition x-times.
312
+ * `*` ~ forever, otherwise specify an integer
313
+ *
314
+ * @default 0
315
+ */
317
316
  repeat?: number | string | undefined;
318
317
  /**
319
- * Toggle to allocate as much possible or the opposite. Non-greedy repeat function. With the non-greedy option
320
- * set to `false`, you can specify `*` as repeat. This makes an endless repeat.
321
- *
322
- * @default false
323
- */
318
+ * Toggle to allocate as much possible or the opposite. Non-greedy repeat function. With the non-greedy option
319
+ * set to `false`, you can specify `*` as repeat. This makes an endless repeat.
320
+ *
321
+ * @default false
322
+ */
324
323
  greedy?: boolean | undefined;
325
324
  /**
326
- * Automatically unmask the value when retrieved.
327
- *
328
- * When setting this option to true the plugin also expects the initial value from the server to be unmasked.
329
- *
330
- * @default false
331
- */
325
+ * Automatically unmask the value when retrieved.
326
+ *
327
+ * When setting this option to true the plugin also expects the initial value from the server to be unmasked.
328
+ *
329
+ * @default false
330
+ */
332
331
  autoUnmask?: boolean | undefined;
333
332
  /**
334
- * Remove the mask before submitting the form.
335
- *
336
- * @default false
337
- */
333
+ * Remove the mask before submitting the form.
334
+ *
335
+ * @default false
336
+ */
338
337
  removeMaskOnSubmit?: boolean | undefined;
339
338
  /**
340
- * Remove the empty mask on blur or when not empty remove the optional trailing part.
341
- *
342
- * @default true
343
- */
339
+ * Remove the empty mask on blur or when not empty remove the optional trailing part.
340
+ *
341
+ * @default true
342
+ */
344
343
  clearMaskOnLostFocus?: boolean | undefined;
345
344
  /**
346
- * Toggle to insert or overwrite input. This option can be altered by pressing the Insert key.
347
- *
348
- * @default true
349
- */
345
+ * Toggle to insert or overwrite input. This option can be altered by pressing the Insert key.
346
+ *
347
+ * @default true
348
+ */
350
349
  insertMode?: boolean | undefined;
351
350
  /**
352
- * Show selected caret when `insertMode = false`.
353
- *
354
- * @default true
355
- */
351
+ * Show selected caret when `insertMode = false`.
352
+ *
353
+ * @default true
354
+ */
356
355
  insertModeVisual?: boolean | undefined;
357
356
  /**
358
- * Clear the incomplete input on blur.
359
- *
360
- * @default false
361
- */
357
+ * Clear the incomplete input on blur.
358
+ *
359
+ * @default false
360
+ */
362
361
  clearIncomplete?: boolean | undefined;
363
362
  /**
364
- * The alias to use.
365
- *
366
- * @default null
367
- */
363
+ * The alias to use.
364
+ *
365
+ * @default null
366
+ */
368
367
  alias?: string | undefined;
369
368
  /**
370
- * Callback to implement autocomplete on certain keys for example.
371
- */
369
+ * Callback to implement autocomplete on certain keys for example.
370
+ */
372
371
  onKeyDown?: ((event: KeyboardEvent, buffer: string[], caretPos: {
373
372
  begin: number;
374
373
  end: number;
375
374
  }, opts: Options$1) => void) | undefined;
376
375
  /**
377
- * Executes before masking the initial value to allow preprocessing of the initial value.
378
- */
376
+ * Executes before masking the initial value to allow preprocessing of the initial value.
377
+ */
379
378
  onBeforeMask?: ((initialValue: string, opts: Options$1) => string) | undefined;
380
379
  /**
381
- * This callback allows for preprocessing the pasted value before actually handling the value for masking.
382
- * This can be useful for stripping away some characters before processing. You can also disable pasting
383
- * a value by returning false in the `onBeforePaste` call.
384
- */
380
+ * This callback allows for preprocessing the pasted value before actually handling the value for masking.
381
+ * This can be useful for stripping away some characters before processing. You can also disable pasting
382
+ * a value by returning false in the `onBeforePaste` call.
383
+ */
385
384
  onBeforePaste?: ((pastedValue: string, opts: Options$1) => string) | undefined;
386
385
  /**
387
- * Executes before writing to the masked element. Use this to do some extra processing of the input. This can
388
- * be useful when implementing an alias, ex. decimal alias, autofill the digits when leaving the inputfield.
389
- */
386
+ * Executes before writing to the masked element. Use this to do some extra processing of the input. This can
387
+ * be useful when implementing an alias, ex. decimal alias, autofill the digits when leaving the inputfield.
388
+ */
390
389
  onBeforeWrite?: ((event: KeyboardEvent, buffer: string[], caretPos: number, opts: Options$1) => CommandObject) | undefined;
391
390
  /**
392
- * Executes after unmasking to allow post-processing of the unmaskedvalue.
393
- *
394
- * @returns New unmasked value
395
- */
391
+ * Executes after unmasking to allow post-processing of the unmaskedvalue.
392
+ *
393
+ * @returns New unmasked value
394
+ */
396
395
  onUnMask?: ((maskedValue: string, unmaskedValue: string) => string) | undefined;
397
396
  /**
398
- * Shows the mask when the input gets focus.
399
- *
400
- * @default true
401
- */
397
+ * Shows the mask when the input gets focus.
398
+ *
399
+ * @default true
400
+ */
402
401
  showMaskOnFocus?: boolean | undefined;
403
402
  /**
404
- * Shows the mask when the input is hevered by the mouse cursor.
405
- *
406
- * @default true
407
- */
403
+ * Shows the mask when the input is hevered by the mouse cursor.
404
+ *
405
+ * @default true
406
+ */
408
407
  showMaskOnHover?: boolean | undefined;
409
408
  /**
410
- * Callback function is executed on every keyvalidation with the key, result as the parameter.
411
- */
409
+ * Callback function is executed on every keyvalidation with the key, result as the parameter.
410
+ */
412
411
  onKeyValidation?: ((key: number, result: boolean) => void) | undefined;
413
412
  /**
414
- * A character which can be used to skip an optional part of a mask.
415
- *
416
- * @default " "
417
- */
413
+ * A character which can be used to skip an optional part of a mask.
414
+ *
415
+ * @default " "
416
+ */
418
417
  skipOptionalPartCharacter?: string | undefined;
419
418
  /**
420
- * Numeric input direction. Keeps the caret at the end.
421
- *
422
- * @default false
423
- */
419
+ * Numeric input direction. Keeps the caret at the end.
420
+ *
421
+ * @default false
422
+ */
424
423
  numericInput?: boolean | undefined;
425
424
  /**
426
- * Align the input to the right
427
- *
428
- * By setting the rightAlign you can specify to right-align an inputmask. This is only applied in combination of
429
- * the `numericInput` option or the `dir-attribute`.
430
- *
431
- * @default true
432
- */
425
+ * Align the input to the right
426
+ *
427
+ * By setting the rightAlign you can specify to right-align an inputmask. This is only applied in combination of
428
+ * the `numericInput` option or the `dir-attribute`.
429
+ *
430
+ * @default true
431
+ */
433
432
  rightAlign?: boolean | undefined;
434
433
  /**
435
- * Make escape behave like undo. (ctrl-Z) Pressing escape reverts the value to the value before focus.
436
- *
437
- * @default true
438
- */
434
+ * Make escape behave like undo. (ctrl-Z) Pressing escape reverts the value to the value before focus.
435
+ *
436
+ * @default true
437
+ */
439
438
  undoOnEscape?: boolean | undefined;
440
439
  /**
441
- * Define the radixpoint (decimal separator)
442
- *
443
- * @default ""
444
- */
440
+ * Define the radixpoint (decimal separator)
441
+ *
442
+ * @default ""
443
+ */
445
444
  radixPoint?: string | undefined;
446
445
  /**
447
- * Define the groupseparator.
448
- *
449
- * @default ""
450
- */
446
+ * Define the groupseparator.
447
+ *
448
+ * @default ""
449
+ */
451
450
  groupSeparator?: string | undefined;
452
451
  /**
453
- * Use in combination with the alternator syntax Try to keep the mask static while typing. Decisions to alter the
454
- * mask will be postponed if possible.
455
- *
456
- * ex. $(selector).inputmask({ mask: ["+55-99-9999-9999", "+55-99-99999-9999", ], keepStatic: true });
457
- *
458
- * typing 1212345123 => should result in +55-12-1234-5123 type extra 4 => switch to +55-12-12345-1234
459
- *
460
- * When the option is not set, it will default to `false`, except for multiple masks it will default to `true`!
461
- */
452
+ * Use in combination with the alternator syntax Try to keep the mask static while typing. Decisions to alter the
453
+ * mask will be postponed if possible.
454
+ *
455
+ * ex. $(selector).inputmask({ mask: ["+55-99-9999-9999", "+55-99-99999-9999", ], keepStatic: true });
456
+ *
457
+ * typing 1212345123 => should result in +55-12-1234-5123 type extra 4 => switch to +55-12-12345-1234
458
+ *
459
+ * When the option is not set, it will default to `false`, except for multiple masks it will default to `true`!
460
+ */
462
461
  keepStatic?: boolean | null | undefined;
463
462
  /**
464
- * When enabled the caret position is set after the latest valid position on TAB.
465
- *
466
- * @default true
467
- */
463
+ * When enabled the caret position is set after the latest valid position on TAB.
464
+ *
465
+ * @default true
466
+ */
468
467
  positionCaretOnTab?: boolean | undefined;
469
468
  /**
470
- * Allows for tabbing through the different parts of the masked field.
471
- *
472
- * @default false
473
- */
469
+ * Allows for tabbing through the different parts of the masked field.
470
+ *
471
+ * @default false
472
+ */
474
473
  tabThrough?: boolean | undefined;
475
474
  /**
476
- * List with the supported input types
477
- *
478
- * @default ["text", "tel", "url", "password", "search"]
479
- */
475
+ * List with the supported input types
476
+ *
477
+ * @default ["text", "tel", "url", "password", "search"]
478
+ */
480
479
  supportsInputType?: string[] | undefined;
481
480
  /**
482
- * Specify keyCodes which should not be considered in the keypress event, otherwise the `preventDefault` will
483
- * stop their default behavior especially in FF.
484
- */
481
+ * Specify keyCodes which should not be considered in the keypress event, otherwise the `preventDefault` will
482
+ * stop their default behavior especially in FF.
483
+ */
485
484
  ignorables?: number[] | undefined;
486
485
  /**
487
- * With this call-in (hook) you can override the default implementation of the isComplete function.
488
- */
486
+ * With this call-in (hook) you can override the default implementation of the isComplete function.
487
+ */
489
488
  isComplete?: ((buffer: string[], opts: Options$1) => boolean) | undefined;
490
489
  /**
491
- * Hook to postValidate the result from `isValid`. Useful for validating the entry as a whole.
492
- */
490
+ * Hook to postValidate the result from `isValid`. Useful for validating the entry as a whole.
491
+ */
493
492
  postValidation?: ((buffer: string[], pos: number, char: string, currentResult: boolean, opts: Options$1, maskset: unknown, strict: boolean, fromCheckval: boolean) => boolean | CommandObject) | undefined;
494
493
  /**
495
- * Hook to preValidate the input. Useful for validating regardless of the definition.
496
- *
497
- * When returning `true`, the normal validation kicks in, otherwise, it is skipped.
498
- *
499
- * When returning a command object the actions are executed and further validation is stopped. If you want to
500
- * continue further validation, you need to add the `rewritePosition` action.
501
- */
494
+ * Hook to preValidate the input. Useful for validating regardless of the definition.
495
+ *
496
+ * When returning `true`, the normal validation kicks in, otherwise, it is skipped.
497
+ *
498
+ * When returning a command object the actions are executed and further validation is stopped. If you want to
499
+ * continue further validation, you need to add the `rewritePosition` action.
500
+ */
502
501
  preValidation?: ((buffer: string[], pos: number, char: string, isSelection: boolean, opts: Options$1, maskset: unknown, caretPos: {
503
502
  begin: number;
504
503
  end: number;
505
504
  }, strict: boolean) => boolean | CommandObject) | undefined;
506
505
  /**
507
- * The `staticDefinitionSymbol` option is used to indicate that the static entries in the mask can match a
508
- * certain definition. Especially useful with alternators so that static element in the mask can match
509
- * another alternation.
510
- *
511
- * @default undefined
512
- */
506
+ * The `staticDefinitionSymbol` option is used to indicate that the static entries in the mask can match a
507
+ * certain definition. Especially useful with alternators so that static element in the mask can match
508
+ * another alternation.
509
+ *
510
+ * @default undefined
511
+ */
513
512
  staticDefinitionSymbol?: string | undefined;
514
513
  /**
515
- * Just in time masking. With the `jitMasking` option you can enable jit masking. The mask will only be
516
- * visible for the user entered characters.
517
- *
518
- * @default false
519
- */
514
+ * Just in time masking. With the `jitMasking` option you can enable jit masking. The mask will only be
515
+ * visible for the user entered characters.
516
+ *
517
+ * @default false
518
+ */
520
519
  jitMasking?: boolean | undefined;
521
520
  /**
522
- * Return nothing from the input `value` property when the user hasn't entered anything. If this is false,
523
- * the mask might be returned.
524
- *
525
- * @default true
526
- */
521
+ * Return nothing from the input `value` property when the user hasn't entered anything. If this is false,
522
+ * the mask might be returned.
523
+ *
524
+ * @default true
525
+ */
527
526
  nullable?: boolean | undefined;
528
527
  /**
529
- * Disable value property patching
530
- *
531
- * @default false
532
- */
528
+ * Disable value property patching
529
+ *
530
+ * @default false
531
+ */
533
532
  noValuePatching?: boolean | undefined;
534
533
  /**
535
- * Positioning of the caret on click.
536
- *
537
- * Options:
538
- *
539
- * * `none`
540
- * * `lvp` - based on the last valid position (default)
541
- * * `radixFocus` - position caret to radixpoint on initial click
542
- * * `select` - select the whole input
543
- * * `ignore` - ignore the click and continue the mask
544
- *
545
- * @default "lvp"
546
- */
534
+ * Positioning of the caret on click.
535
+ *
536
+ * Options:
537
+ *
538
+ * * `none`
539
+ * * `lvp` - based on the last valid position (default)
540
+ * * `radixFocus` - position caret to radixpoint on initial click
541
+ * * `select` - select the whole input
542
+ * * `ignore` - ignore the click and continue the mask
543
+ *
544
+ * @default "lvp"
545
+ */
547
546
  positionCaretOnClick?: PositionCaretOnClick | undefined;
548
547
  /**
549
- * Apply casing at the mask-level.
550
- *
551
- * @default undefined
552
- */
548
+ * Apply casing at the mask-level.
549
+ *
550
+ * @default undefined
551
+ */
553
552
  casing?: Casing | undefined;
554
553
  /**
555
- * Specify the inputmode - already in place for when browsers start to support them
556
- * https://html.spec.whatwg.org/#input-modalities:-the-inputmode-attribute
557
- *
558
- * @default "verbatim"
559
- */
554
+ * Specify the inputmode - already in place for when browsers start to support them
555
+ * https://html.spec.whatwg.org/#input-modalities:-the-inputmode-attribute
556
+ *
557
+ * @default "verbatim"
558
+ */
560
559
  inputmode?: InputMode | undefined;
561
560
  /**
562
- * Specify to use the `data-inputmask` attributes or to ignore them.
563
- *
564
- * If you don't use data attributes you can disable the import by specifying `importDataAttributes: false`.
565
- *
566
- * @default true
567
- */
561
+ * Specify to use the `data-inputmask` attributes or to ignore them.
562
+ *
563
+ * If you don't use data attributes you can disable the import by specifying `importDataAttributes: false`.
564
+ *
565
+ * @default true
566
+ */
568
567
  importDataAttributes?: boolean | undefined;
569
568
  /**
570
- * Alter the behavior of the char shifting on entry or deletion.
571
- *
572
- * In some cases shifting the mask entries or deletion should be more restrictive.
573
- *
574
- * Ex. date masks. Shifting month to day makes no sense
575
- *
576
- * @default true
577
- */
569
+ * Alter the behavior of the char shifting on entry or deletion.
570
+ *
571
+ * In some cases shifting the mask entries or deletion should be more restrictive.
572
+ *
573
+ * Ex. date masks. Shifting month to day makes no sense
574
+ *
575
+ * @default true
576
+ */
578
577
  shiftPositions?: boolean | undefined;
579
578
  /**
580
- * Use the default defined definitions from the prototype.
581
- *
582
- * @default true
583
- */
579
+ * Use the default defined definitions from the prototype.
580
+ *
581
+ * @default true
582
+ */
584
583
  usePrototypeDefinitions?: boolean | undefined;
585
584
  /**
586
- * Minimum value. This needs to be in the same format as the `inputFormat` when used with the datetime alias.
587
- */
585
+ * Minimum value. This needs to be in the same format as the `inputFormat` when used with the datetime alias.
586
+ */
588
587
  min?: string | number | undefined;
589
588
  /**
590
- * Maximum value. This needs to be in the same format as the `inputFormat` when used with the datetime alias.
591
- */
589
+ * Maximum value. This needs to be in the same format as the `inputFormat` when used with the datetime alias.
590
+ */
592
591
  max?: string | number | undefined;
593
592
  /**
594
- * Number of fractionalDigits.
595
- *
596
- * Possible values:
597
- *
598
- * * A number describing the number of fractional digits.
599
- * * `*`
600
- * * Quantifier syntax like `2,4`. When the quantifier syntax is used, the `digitsOptional` option is ignored
601
- *
602
- * @default "*"
603
- */
593
+ * Number of fractionalDigits.
594
+ *
595
+ * Possible values:
596
+ *
597
+ * * A number describing the number of fractional digits.
598
+ * * `*`
599
+ * * Quantifier syntax like `2,4`. When the quantifier syntax is used, the `digitsOptional` option is ignored
600
+ *
601
+ * @default "*"
602
+ */
604
603
  digits?: string | number | undefined;
605
604
  /**
606
- * Specify wheter the digits are optional.
607
- *
608
- * @default true
609
- */
605
+ * Specify wheter the digits are optional.
606
+ *
607
+ * @default true
608
+ */
610
609
  digitsOptional?: boolean | undefined;
611
610
  /**
612
- * Enforces the decimal part when leaving the input field.
613
- *
614
- * @default false
615
- */
611
+ * Enforces the decimal part when leaving the input field.
612
+ *
613
+ * @default false
614
+ */
616
615
  enforceDigitsOnBlur?: boolean | undefined;
617
616
  /**
618
- * Allow to enter -.
619
- *
620
- * @default true
621
- */
617
+ * Allow to enter -.
618
+ *
619
+ * @default true
620
+ */
622
621
  allowMinus?: boolean | undefined;
623
622
  /**
624
- * Define your negationSymbol.
625
- *
626
- * @default { front: "-", back: "" }
627
- */
623
+ * Define your negationSymbol.
624
+ *
625
+ * @default { front: "-", back: "" }
626
+ */
628
627
  negationSymbol?: {
629
628
  front: string;
630
629
  back: string;
631
630
  } | undefined;
632
631
  /**
633
- * Define a prefix.
634
- *
635
- * @default ""
636
- */
632
+ * Define a prefix.
633
+ *
634
+ * @default ""
635
+ */
637
636
  prefix?: string | undefined;
638
637
  /**
639
- * Define a suffix.
640
- *
641
- * @default ""
642
- */
638
+ * Define a suffix.
639
+ *
640
+ * @default ""
641
+ */
643
642
  suffix?: string | undefined;
644
643
  /**
645
- * Set the maximum value when the user types a number which is greater that the value of max.
646
- *
647
- * @default false
648
- */
644
+ * Set the maximum value when the user types a number which is greater that the value of max.
645
+ *
646
+ * @default false
647
+ */
649
648
  SetMaxOnOverflow?: boolean | undefined;
650
649
  /**
651
- * Define the step the ctrl-up & ctrl-down must take.
652
- *
653
- * @default 1
654
- */
650
+ * Define the step the ctrl-up & ctrl-down must take.
651
+ *
652
+ * @default 1
653
+ */
655
654
  step?: number | undefined;
656
655
  /**
657
- * Make unmasking returning a number instead of a string.
658
- *
659
- * Be warned that using the unmaskAsNumber option together with jQuery.serialize will fail as serialize expects a string. (See issue #1288)
660
- *
661
- * @default false
662
- */
656
+ * Make unmasking returning a number instead of a string.
657
+ *
658
+ * Be warned that using the unmaskAsNumber option together with jQuery.serialize will fail as serialize expects a string. (See issue #1288)
659
+ *
660
+ * @default false
661
+ */
663
662
  unmaskAsNumber?: boolean | undefined;
664
663
  /**
665
- * Indicates whether the value passed for initialization is text or a number.
666
- *
667
- * * `text` - radixpoint should be the same as in the options
668
- * * `number` - radixpoint should be a . as the default for a number in js
669
- *
670
- * @default "text"
671
- */
664
+ * Indicates whether the value passed for initialization is text or a number.
665
+ *
666
+ * * `text` - radixpoint should be the same as in the options
667
+ * * `number` - radixpoint should be a . as the default for a number in js
668
+ *
669
+ * @default "text"
670
+ */
672
671
  inputType?: 'text' | 'number' | undefined;
673
672
  /**
674
- * Set the function for rounding the values when set.
675
- *
676
- * Other examples:
677
- * * `Math.floor`
678
- * * `fn(x) { // do your own rounding logic // return x; }`
679
- *
680
- * @default Math.round
681
- */
673
+ * Set the function for rounding the values when set.
674
+ *
675
+ * Other examples:
676
+ * * `Math.floor`
677
+ * * `fn(x) { // do your own rounding logic // return x; }`
678
+ *
679
+ * @default Math.round
680
+ */
682
681
  roundingFN?: ((input: number) => number) | undefined;
683
682
  /**
684
- * Define shortcuts. This will allow typing 1k => 1000, 2m => 2000000
685
- *
686
- * To disable just pass shortcuts: `null` as option
687
- *
688
- * @default {k: "000", m: "000000"}
689
- */
683
+ * Define shortcuts. This will allow typing 1k => 1000, 2m => 2000000
684
+ *
685
+ * To disable just pass shortcuts: `null` as option
686
+ *
687
+ * @default {k: "000", m: "000000"}
688
+ */
690
689
  shortcuts?: Record<string, string> | null | undefined;
691
690
  /**
692
- * Format used to input a date. This option is only effective for the datetime alias.
693
- *
694
- * Supported symbols
695
- *
696
- * * `d` - Day of the month as digits; no leading zero for single-digit days.
697
- * * `dd` - Day of the month as digits; leading zero for single-digit days.
698
- * * `ddd` - Day of the week as a three-letter abbreviation.
699
- * * `dddd` - Day of the week as its full name.
700
- * * `m` - Month as digits; no leading zero for single-digit months.
701
- * * `mm` - Month as digits; leading zero for single-digit months.
702
- * * `mmm` - Month as a three-letter abbreviation.
703
- * * `mmmm` - Month as its full name.
704
- * * `yy` - Year as last two digits; leading zero for years less than 10.
705
- * * `yyyy` - Year as 4 digits.
706
- * * `h` - Hours; no leading zero for single-digit hours (12-hour clock).
707
- * * `hh` - Hours; leading zero for single-digit hours (12-hour clock).
708
- * * `hx` - Hours; no limit; `x` = number of digits ~ use as h2, h3, ...
709
- * * `H` - Hours; no leading zero for single-digit hours (24-hour clock).
710
- * * `HH` - Hours; leading zero for single-digit hours (24-hour clock).
711
- * * `Hx` - Hours; no limit; `x` = number of digits ~ use as H2, H3, ...
712
- * * `M` - Minutes; no leading zero for single-digit minutes. Uppercase M unlike CF timeFormat's m to avoid
713
- * conflict with months.
714
- * * `MM` - Minutes; leading zero for single-digit minutes. Uppercase MM unlike CF timeFormat's mm to avoid
715
- * conflict with months.
716
- * * `s` - Seconds; no leading zero for single-digit seconds.
717
- * * `ss` - Seconds; leading zero for single-digit seconds.
718
- * * `l` - Milliseconds. 3 digits.
719
- * * `L` - Milliseconds. 2 digits.
720
- * * `t` - Lowercase, single-character time marker string: a or p.
721
- * * `tt` - Two-character time marker string: am or pm.
722
- * * `T` - Single-character time marker string: A or P.
723
- * * `TT` - Two-character time marker string: AM or PM.
724
- * * `Z` - US timezone abbreviation, e.g. EST or MDT. With non-US timezones or in the Opera browser, the
725
- * GMT/UTC offset is returned, e.g. GMT-0500
726
- * * `o` - GMT/UTC timezone offset, e.g. -0500 or +0230.
727
- * * `S` - The date's ordinal suffix (st, nd, rd, or th). Works well with d.
728
- *
729
- * @default "isoDateTime"
730
- */
691
+ * Format used to input a date. This option is only effective for the datetime alias.
692
+ *
693
+ * Supported symbols
694
+ *
695
+ * * `d` - Day of the month as digits; no leading zero for single-digit days.
696
+ * * `dd` - Day of the month as digits; leading zero for single-digit days.
697
+ * * `ddd` - Day of the week as a three-letter abbreviation.
698
+ * * `dddd` - Day of the week as its full name.
699
+ * * `m` - Month as digits; no leading zero for single-digit months.
700
+ * * `mm` - Month as digits; leading zero for single-digit months.
701
+ * * `mmm` - Month as a three-letter abbreviation.
702
+ * * `mmmm` - Month as its full name.
703
+ * * `yy` - Year as last two digits; leading zero for years less than 10.
704
+ * * `yyyy` - Year as 4 digits.
705
+ * * `h` - Hours; no leading zero for single-digit hours (12-hour clock).
706
+ * * `hh` - Hours; leading zero for single-digit hours (12-hour clock).
707
+ * * `hx` - Hours; no limit; `x` = number of digits ~ use as h2, h3, ...
708
+ * * `H` - Hours; no leading zero for single-digit hours (24-hour clock).
709
+ * * `HH` - Hours; leading zero for single-digit hours (24-hour clock).
710
+ * * `Hx` - Hours; no limit; `x` = number of digits ~ use as H2, H3, ...
711
+ * * `M` - Minutes; no leading zero for single-digit minutes. Uppercase M unlike CF timeFormat's m to avoid
712
+ * conflict with months.
713
+ * * `MM` - Minutes; leading zero for single-digit minutes. Uppercase MM unlike CF timeFormat's mm to avoid
714
+ * conflict with months.
715
+ * * `s` - Seconds; no leading zero for single-digit seconds.
716
+ * * `ss` - Seconds; leading zero for single-digit seconds.
717
+ * * `l` - Milliseconds. 3 digits.
718
+ * * `L` - Milliseconds. 2 digits.
719
+ * * `t` - Lowercase, single-character time marker string: a or p.
720
+ * * `tt` - Two-character time marker string: am or pm.
721
+ * * `T` - Single-character time marker string: A or P.
722
+ * * `TT` - Two-character time marker string: AM or PM.
723
+ * * `Z` - US timezone abbreviation, e.g. EST or MDT. With non-US timezones or in the Opera browser, the
724
+ * GMT/UTC offset is returned, e.g. GMT-0500
725
+ * * `o` - GMT/UTC timezone offset, e.g. -0500 or +0230.
726
+ * * `S` - The date's ordinal suffix (st, nd, rd, or th). Works well with d.
727
+ *
728
+ * @default "isoDateTime"
729
+ */
731
730
  inputFormat?: string | undefined;
732
731
  /**
733
- * Format of the unmasked value. This is only effective when used with the datetime alias.
734
- */
732
+ * Format of the unmasked value. This is only effective when used with the datetime alias.
733
+ */
735
734
  outputFormat?: string | undefined;
736
735
  /**
737
- * Visual format when the input looses focus
738
- */
736
+ * Visual format when the input looses focus
737
+ */
739
738
  displayFormat?: string | undefined;
740
739
  /**
741
- * Add new definitions to this inputmask.
742
- */
740
+ * Add new definitions to this inputmask.
741
+ */
743
742
  definitions?: Record<string, Definition> | undefined;
744
743
  /**
745
- * Enable/disable prefilling of the year.
746
- * Although you can just over type the proposed value without deleting, many seems to see a problem with the year prediction.
747
- * This options is to disable this feature.
748
- *
749
- * @default true
750
- */
744
+ * Enable/disable prefilling of the year.
745
+ * Although you can just over type the proposed value without deleting, many seems to see a problem with the year prediction.
746
+ * This options is to disable this feature.
747
+ *
748
+ * @default true
749
+ */
751
750
  prefillYear?: boolean | undefined;
752
751
  }
753
752
  interface Definition {
@@ -759,54 +758,54 @@ interface Definition {
759
758
  }
760
759
  interface InsertPosition {
761
760
  /**
762
- * Position to insert.
763
- */
761
+ * Position to insert.
762
+ */
764
763
  pos: number;
765
764
  /**
766
- * Character to insert.
767
- */
765
+ * Character to insert.
766
+ */
768
767
  c: string;
769
768
  /**
770
- * @default true
771
- */
769
+ * @default true
770
+ */
772
771
  fromIsValid?: boolean | undefined;
773
772
  /**
774
- * @default true
775
- */
773
+ * @default true
774
+ */
776
775
  strict?: boolean | undefined;
777
776
  }
778
777
  interface CommandObject {
779
778
  /**
780
- * Position to insert.
781
- */
779
+ * Position to insert.
780
+ */
782
781
  pos?: number | undefined;
783
782
  /**
784
- * Character to insert.
785
- */
783
+ * Character to insert.
784
+ */
786
785
  c?: string | undefined;
787
786
  /**
788
- * Position of the caret.
789
- */
787
+ * Position of the caret.
788
+ */
790
789
  caret?: number | undefined;
791
790
  /**
792
- * Position(s) to remove.
793
- */
791
+ * Position(s) to remove.
792
+ */
794
793
  remove?: number | number[] | undefined;
795
794
  /**
796
- * Position(s) to add.
797
- */
795
+ * Position(s) to add.
796
+ */
798
797
  insert?: InsertPosition | InsertPosition[] | undefined;
799
798
  /**
800
- * * `true` => refresh validPositions from the complete buffer .
801
- * * `{ start: , end: }` => refresh from start to end.
802
- */
799
+ * * `true` => refresh validPositions from the complete buffer .
800
+ * * `{ start: , end: }` => refresh from start to end.
801
+ */
803
802
  refreshFromBuffer?: true | {
804
803
  start: number;
805
804
  end: number;
806
805
  } | undefined;
807
806
  /**
808
- * Rewrite the maskPos within the isvalid function.
809
- */
807
+ * Rewrite the maskPos within the isvalid function.
808
+ */
810
809
  rewritePosition?: number | undefined;
811
810
  }
812
811
  //#endregion
@@ -836,4 +835,4 @@ type UseTanStackFormMaskReturn<T extends TanStackFormInputProps = TanStackFormIn
836
835
  } & UnmaskedValueApi;
837
836
  //#endregion
838
837
  export { UnmaskedValueApi as a, UseTanStackFormMaskReturn as c, UseFormRegister as d, UseFormRegisterReturn as f, TanStackFormInputProps as i, RegisterOptions as l, Mask as n, UseHookFormMaskReturn as o, Path as p, Options as r, UseMaskInputReturn as s, Input as t, FieldValues as u };
839
- //# sourceMappingURL=index-Do9euvWK.d.cts.map
838
+ //# sourceMappingURL=index-HfKPnOg0.d.cts.map