use-mask-input 3.11.0 → 3.12.0
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.
- package/CHANGELOG.md +55 -0
- package/README.md +102 -1
- package/dist/antd.cjs +1 -1
- package/dist/antd.cjs.map +1 -1
- package/dist/antd.d.cts +1 -2
- package/dist/antd.d.mts +1 -2
- package/dist/antd.mjs +1 -1
- package/dist/antd.mjs.map +1 -1
- package/dist/core-BopfTGvA.cjs +2 -0
- package/dist/{withMask-BkTzstzt.cjs.map → core-BopfTGvA.cjs.map} +1 -1
- package/dist/core-CNGYEIpO.mjs +2 -0
- package/dist/{withMask-C-wAMt0W.mjs.map → core-CNGYEIpO.mjs.map} +1 -1
- package/dist/{index-Do9euvWK.d.cts → index-CqBLkcNO.d.cts} +393 -385
- package/dist/{index-Do9euvWK.d.mts → index-CqBLkcNO.d.mts} +393 -385
- package/dist/index-DAfluDSv.d.cts +25 -0
- package/dist/index-DGAwRzYx.d.mts +25 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -24
- package/dist/index.d.mts +2 -24
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/vue.cjs +2 -0
- package/dist/vue.cjs.map +1 -0
- package/dist/vue.d.cts +92 -0
- package/dist/vue.d.mts +92 -0
- package/dist/vue.mjs +2 -0
- package/dist/vue.mjs.map +1 -0
- package/dist/withMask--iSmiRbB.cjs +2 -0
- package/dist/withMask--iSmiRbB.cjs.map +1 -0
- package/dist/withMask-DOmJHTJ4.mjs +2 -0
- package/dist/withMask-DOmJHTJ4.mjs.map +1 -0
- package/package.json +56 -12
- package/src/@types/inputmask.d.ts +6 -0
- package/src/api/useHookFormMask.ts +20 -5
- package/src/api/withMask.ts +2 -0
- package/src/core/maskEngine.ts +56 -27
- package/src/types/index.ts +6 -26
- package/src/types/mask.ts +37 -0
- package/src/vue/applyMask.ts +99 -0
- package/src/vue/directive.ts +59 -0
- package/src/vue/index.ts +13 -0
- package/src/vue/resolveVueElement.ts +34 -0
- package/src/vue/types.ts +35 -0
- package/src/vue/useMaskInput.ts +56 -0
- package/dist/withMask-BkTzstzt.cjs +0 -2
- package/dist/withMask-C-wAMt0W.mjs +0 -2
|
@@ -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.
|
|
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
|
|
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
|
|
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.
|
|
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
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
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
|
-
|
|
262
|
-
|
|
263
|
-
|
|
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
|
-
|
|
268
|
-
|
|
269
|
-
|
|
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
|
-
|
|
274
|
-
|
|
275
|
-
|
|
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
|
-
|
|
280
|
-
|
|
281
|
-
|
|
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
|
-
|
|
286
|
-
|
|
287
|
-
|
|
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
|
-
|
|
292
|
-
|
|
290
|
+
* The mask to use.
|
|
291
|
+
*/
|
|
293
292
|
mask?: string | string[] | ((opts: Options$1) => string | string[]) | undefined;
|
|
294
293
|
/**
|
|
295
|
-
|
|
296
|
-
|
|
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
|
-
|
|
301
|
-
|
|
299
|
+
* Execute a function when the mask is completed.
|
|
300
|
+
*/
|
|
302
301
|
oncomplete?: (() => void) | undefined;
|
|
303
302
|
/**
|
|
304
|
-
|
|
305
|
-
|
|
303
|
+
* Execute a function when the mask is cleared.
|
|
304
|
+
*/
|
|
306
305
|
onincomplete?: (() => void) | undefined;
|
|
307
306
|
/**
|
|
308
|
-
|
|
309
|
-
|
|
307
|
+
* Execute a function when the mask is cleared.
|
|
308
|
+
*/
|
|
310
309
|
oncleared?: (() => void) | undefined;
|
|
311
310
|
/**
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
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
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
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
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
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
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
333
|
+
* Remove the mask before submitting the form.
|
|
334
|
+
*
|
|
335
|
+
* @default false
|
|
336
|
+
*/
|
|
338
337
|
removeMaskOnSubmit?: boolean | undefined;
|
|
339
338
|
/**
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
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
|
-
|
|
347
|
-
|
|
348
|
-
|
|
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
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
351
|
+
* Show selected caret when `insertMode = false`.
|
|
352
|
+
*
|
|
353
|
+
* @default true
|
|
354
|
+
*/
|
|
356
355
|
insertModeVisual?: boolean | undefined;
|
|
357
356
|
/**
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
357
|
+
* Clear the incomplete input on blur.
|
|
358
|
+
*
|
|
359
|
+
* @default false
|
|
360
|
+
*/
|
|
362
361
|
clearIncomplete?: boolean | undefined;
|
|
363
362
|
/**
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
363
|
+
* The alias to use.
|
|
364
|
+
*
|
|
365
|
+
* @default null
|
|
366
|
+
*/
|
|
368
367
|
alias?: string | undefined;
|
|
369
368
|
/**
|
|
370
|
-
|
|
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
|
-
|
|
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
|
-
|
|
382
|
-
|
|
383
|
-
|
|
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
|
-
|
|
388
|
-
|
|
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
|
-
|
|
393
|
-
|
|
394
|
-
|
|
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
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
397
|
+
* Shows the mask when the input gets focus.
|
|
398
|
+
*
|
|
399
|
+
* @default true
|
|
400
|
+
*/
|
|
402
401
|
showMaskOnFocus?: boolean | undefined;
|
|
403
402
|
/**
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
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
|
-
|
|
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
|
-
|
|
415
|
-
|
|
416
|
-
|
|
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
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
419
|
+
* Numeric input direction. Keeps the caret at the end.
|
|
420
|
+
*
|
|
421
|
+
* @default false
|
|
422
|
+
*/
|
|
424
423
|
numericInput?: boolean | undefined;
|
|
425
424
|
/**
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
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
|
-
|
|
436
|
-
|
|
437
|
-
|
|
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
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
440
|
+
* Define the radixpoint (decimal separator)
|
|
441
|
+
*
|
|
442
|
+
* @default ""
|
|
443
|
+
*/
|
|
445
444
|
radixPoint?: string | undefined;
|
|
446
445
|
/**
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
446
|
+
* Define the groupseparator.
|
|
447
|
+
*
|
|
448
|
+
* @default ""
|
|
449
|
+
*/
|
|
451
450
|
groupSeparator?: string | undefined;
|
|
452
451
|
/**
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
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
|
-
|
|
465
|
-
|
|
466
|
-
|
|
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
|
-
|
|
471
|
-
|
|
472
|
-
|
|
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
|
-
|
|
477
|
-
|
|
478
|
-
|
|
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
|
-
|
|
483
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
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
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
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
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
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
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
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
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
528
|
+
* Disable value property patching
|
|
529
|
+
*
|
|
530
|
+
* @default false
|
|
531
|
+
*/
|
|
533
532
|
noValuePatching?: boolean | undefined;
|
|
534
533
|
/**
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
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
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
548
|
+
* Apply casing at the mask-level.
|
|
549
|
+
*
|
|
550
|
+
* @default undefined
|
|
551
|
+
*/
|
|
553
552
|
casing?: Casing | undefined;
|
|
554
553
|
/**
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
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
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
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
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
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
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
579
|
+
* Use the default defined definitions from the prototype.
|
|
580
|
+
*
|
|
581
|
+
* @default true
|
|
582
|
+
*/
|
|
584
583
|
usePrototypeDefinitions?: boolean | undefined;
|
|
585
584
|
/**
|
|
586
|
-
|
|
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
|
-
|
|
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
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
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
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
605
|
+
* Specify wheter the digits are optional.
|
|
606
|
+
*
|
|
607
|
+
* @default true
|
|
608
|
+
*/
|
|
610
609
|
digitsOptional?: boolean | undefined;
|
|
611
610
|
/**
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
611
|
+
* Enforces the decimal part when leaving the input field.
|
|
612
|
+
*
|
|
613
|
+
* @default false
|
|
614
|
+
*/
|
|
616
615
|
enforceDigitsOnBlur?: boolean | undefined;
|
|
617
616
|
/**
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
617
|
+
* Allow to enter -.
|
|
618
|
+
*
|
|
619
|
+
* @default true
|
|
620
|
+
*/
|
|
622
621
|
allowMinus?: boolean | undefined;
|
|
623
622
|
/**
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
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
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
632
|
+
* Define a prefix.
|
|
633
|
+
*
|
|
634
|
+
* @default ""
|
|
635
|
+
*/
|
|
637
636
|
prefix?: string | undefined;
|
|
638
637
|
/**
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
638
|
+
* Define a suffix.
|
|
639
|
+
*
|
|
640
|
+
* @default ""
|
|
641
|
+
*/
|
|
643
642
|
suffix?: string | undefined;
|
|
644
643
|
/**
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
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
|
-
|
|
652
|
-
|
|
653
|
-
|
|
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
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
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
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
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
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
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
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
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
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
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
|
-
|
|
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
|
-
|
|
738
|
-
|
|
736
|
+
* Visual format when the input looses focus
|
|
737
|
+
*/
|
|
739
738
|
displayFormat?: string | undefined;
|
|
740
739
|
/**
|
|
741
|
-
|
|
742
|
-
|
|
740
|
+
* Add new definitions to this inputmask.
|
|
741
|
+
*/
|
|
743
742
|
definitions?: Record<string, Definition> | undefined;
|
|
744
743
|
/**
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
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,64 +758,73 @@ interface Definition {
|
|
|
759
758
|
}
|
|
760
759
|
interface InsertPosition {
|
|
761
760
|
/**
|
|
762
|
-
|
|
763
|
-
|
|
761
|
+
* Position to insert.
|
|
762
|
+
*/
|
|
764
763
|
pos: number;
|
|
765
764
|
/**
|
|
766
|
-
|
|
767
|
-
|
|
765
|
+
* Character to insert.
|
|
766
|
+
*/
|
|
768
767
|
c: string;
|
|
769
768
|
/**
|
|
770
|
-
|
|
771
|
-
|
|
769
|
+
* @default true
|
|
770
|
+
*/
|
|
772
771
|
fromIsValid?: boolean | undefined;
|
|
773
772
|
/**
|
|
774
|
-
|
|
775
|
-
|
|
773
|
+
* @default true
|
|
774
|
+
*/
|
|
776
775
|
strict?: boolean | undefined;
|
|
777
776
|
}
|
|
778
777
|
interface CommandObject {
|
|
779
778
|
/**
|
|
780
|
-
|
|
781
|
-
|
|
779
|
+
* Position to insert.
|
|
780
|
+
*/
|
|
782
781
|
pos?: number | undefined;
|
|
783
782
|
/**
|
|
784
|
-
|
|
785
|
-
|
|
783
|
+
* Character to insert.
|
|
784
|
+
*/
|
|
786
785
|
c?: string | undefined;
|
|
787
786
|
/**
|
|
788
|
-
|
|
789
|
-
|
|
787
|
+
* Position of the caret.
|
|
788
|
+
*/
|
|
790
789
|
caret?: number | undefined;
|
|
791
790
|
/**
|
|
792
|
-
|
|
793
|
-
|
|
791
|
+
* Position(s) to remove.
|
|
792
|
+
*/
|
|
794
793
|
remove?: number | number[] | undefined;
|
|
795
794
|
/**
|
|
796
|
-
|
|
797
|
-
|
|
795
|
+
* Position(s) to add.
|
|
796
|
+
*/
|
|
798
797
|
insert?: InsertPosition | InsertPosition[] | undefined;
|
|
799
798
|
/**
|
|
800
|
-
|
|
801
|
-
|
|
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
|
-
|
|
809
|
-
|
|
807
|
+
* Rewrite the maskPos within the isvalid function.
|
|
808
|
+
*/
|
|
810
809
|
rewritePosition?: number | undefined;
|
|
811
810
|
}
|
|
812
811
|
//#endregion
|
|
813
|
-
//#region src/types/
|
|
812
|
+
//#region src/types/mask.d.ts
|
|
813
|
+
/**
|
|
814
|
+
* Framework-agnostic mask types.
|
|
815
|
+
*
|
|
816
|
+
* Split out of `./index.ts` so the Vue entry can import them without dragging
|
|
817
|
+
* in that module's `react` and `react-hook-form` type imports. `./index.ts`
|
|
818
|
+
* re-exports everything here, so the React-facing surface is unchanged.
|
|
819
|
+
*/
|
|
814
820
|
type Mask = 'datetime' | 'email' | 'numeric' | 'currency' | 'decimal' | 'integer' | 'percentage' | 'url' | 'ip' | 'mac' | 'ssn' | 'brl-currency' | 'cpf' | 'cnpj' | 'br-bank-account' | 'br-bank-agency' | (string & {}) | (string[] & {}) | null;
|
|
815
821
|
type Options = Options$1;
|
|
816
822
|
type Input = HTMLInputElement | HTMLTextAreaElement | HTMLElement;
|
|
817
823
|
interface UnmaskedValueApi {
|
|
818
824
|
unmaskedValue: () => string;
|
|
819
825
|
}
|
|
826
|
+
//#endregion
|
|
827
|
+
//#region src/types/index.d.ts
|
|
820
828
|
type UseMaskInputReturn = RefCallback<HTMLElement | null> & UnmaskedValueApi;
|
|
821
829
|
interface UseHookFormMaskReturn<T extends FieldValues> extends UseFormRegisterReturn<Path<T>>, UnmaskedValueApi {
|
|
822
830
|
ref: RefCallback<HTMLElement | null>;
|
|
@@ -835,5 +843,5 @@ type UseTanStackFormMaskReturn<T extends TanStackFormInputProps = TanStackFormIn
|
|
|
835
843
|
prevRef: RefCallback<HTMLElement | null> | undefined;
|
|
836
844
|
} & UnmaskedValueApi;
|
|
837
845
|
//#endregion
|
|
838
|
-
export {
|
|
839
|
-
//# sourceMappingURL=index-
|
|
846
|
+
export { Input as a, UnmaskedValueApi as c, UseFormRegister as d, UseFormRegisterReturn as f, UseTanStackFormMaskReturn as i, RegisterOptions as l, UseHookFormMaskReturn as n, Mask as o, Path as p, UseMaskInputReturn as r, Options as s, TanStackFormInputProps as t, FieldValues as u };
|
|
847
|
+
//# sourceMappingURL=index-CqBLkcNO.d.cts.map
|