react-imask
Advanced tools
Comparing version 6.6.0 to 6.6.1-alpha.0
import React from 'react'; | ||
declare const IMaskInput: React.ForwardRefExoticComponent<(Omit<import("./mixin").ReactElementProps<import("./mixin").ReactElement> & { | ||
import IMask from 'imask'; | ||
import { IMaskInputProps, ReactElementProps } from './mixin'; | ||
declare const IMaskInput: React.ForwardRefExoticComponent<(Omit<ReactElementProps<HTMLInputElement> & { | ||
mask: DateConstructor; | ||
} & Partial<Pick<import("imask").default.Masked<DateConstructor>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & Partial<Pick<import("imask").default.MaskedPattern<DateConstructor>, "blocks" | "definitions" | "placeholderChar" | "displayChar" | "lazy">> & Partial<Pick<import("imask").default.MaskedDate, "parse" | "format" | "pattern" | "min" | "max" | "autofix">> & import("./mixin").ReactMaskProps<import("imask").default.AnyMaskedOptions, false, string, import("./mixin").ReactElement>, "ref"> | Omit<import("./mixin").ReactElementProps<import("./mixin").ReactElement> & { | ||
} & Partial<Pick<IMask.Masked<DateConstructor>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & Partial<Pick<IMask.MaskedPattern<DateConstructor>, "blocks" | "definitions" | "placeholderChar" | "displayChar" | "lazy">> & Partial<Pick<IMask.MaskedDate, "parse" | "format" | "pattern" | "min" | "max" | "autofix">> & import("./mixin").ReactMaskProps<IMask.AnyMaskedOptions, boolean | "typed", unknown, HTMLInputElement> & { | ||
ref?: React.Ref<React.ComponentType<IMaskInputProps<IMask.AnyMaskedOptions, boolean | "typed", unknown, HTMLInputElement, ReactElementProps<HTMLInputElement>>>>; | ||
}, "ref"> | Omit<ReactElementProps<HTMLInputElement> & { | ||
mask: NumberConstructor; | ||
} & Partial<Pick<import("imask").default.Masked<NumberConstructor>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & Partial<Pick<import("imask").default.MaskedNumber, "min" | "max" | "radix" | "thousandsSeparator" | "mapToRadix" | "scale" | "signed" | "normalizeZeros" | "padFractionalZeros">> & import("./mixin").ReactMaskProps<import("imask").default.AnyMaskedOptions, false, string, import("./mixin").ReactElement>, "ref"> | Omit<import("./mixin").ReactElementProps<import("./mixin").ReactElement> & { | ||
} & Partial<Pick<IMask.Masked<NumberConstructor>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & Partial<Pick<IMask.MaskedNumber, "min" | "max" | "radix" | "thousandsSeparator" | "mapToRadix" | "scale" | "signed" | "normalizeZeros" | "padFractionalZeros">> & import("./mixin").ReactMaskProps<IMask.AnyMaskedOptions, boolean | "typed", unknown, HTMLInputElement> & { | ||
ref?: React.Ref<React.ComponentType<IMaskInputProps<IMask.AnyMaskedOptions, boolean | "typed", unknown, HTMLInputElement, ReactElementProps<HTMLInputElement>>>>; | ||
}, "ref"> | Omit<ReactElementProps<HTMLInputElement> & { | ||
mask: string; | ||
} & Partial<Pick<import("imask").default.Masked<string>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & Partial<Pick<import("imask").default.MaskedPattern<string>, "blocks" | "definitions" | "placeholderChar" | "displayChar" | "lazy">> & import("./mixin").ReactMaskProps<import("imask").default.AnyMaskedOptions, false, string, import("./mixin").ReactElement>, "ref"> | Omit<import("./mixin").ReactElementProps<import("./mixin").ReactElement> & { | ||
mask: string; | ||
} & Partial<Pick<import("imask").default.Masked<string>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & Partial<Pick<import("imask").default.MaskedPattern<string>, "blocks" | "definitions" | "placeholderChar" | "displayChar" | "lazy">> & Partial<Pick<import("imask").default.MaskedRange, "autofix" | "maxLength" | "from" | "to">> & import("./mixin").ReactMaskProps<import("imask").default.AnyMaskedOptions, false, string, import("./mixin").ReactElement>, "ref"> | Omit<import("./mixin").ReactElementProps<import("./mixin").ReactElement> & { | ||
mask: import("imask").default.AnyMaskedOptionsArray; | ||
} & Partial<Pick<import("imask").default.Masked<import("imask").default.AnyMaskedOptionsArray>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & import("./mixin").ReactMaskProps<import("imask").default.AnyMaskedOptions, false, string, import("./mixin").ReactElement>, "ref"> | Omit<import("./mixin").ReactElementProps<import("./mixin").ReactElement> & { | ||
mask: import("imask").default.AnyMaskedOptionsArray; | ||
} & Partial<Pick<import("imask").default.Masked<import("imask").default.AnyMaskedOptionsArray>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & Partial<Pick<import("imask").default.MaskedDynamic, "dispatch">> & import("./mixin").ReactMaskProps<import("imask").default.AnyMaskedOptions, false, string, import("./mixin").ReactElement>, "ref"> | Omit<import("./mixin").ReactElementProps<import("./mixin").ReactElement> & { | ||
} & Partial<Pick<IMask.Masked<string>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & Partial<Pick<IMask.MaskedPattern<string>, "blocks" | "definitions" | "placeholderChar" | "displayChar" | "lazy">> & import("./mixin").ReactMaskProps<IMask.AnyMaskedOptions, boolean | "typed", unknown, HTMLInputElement> & { | ||
ref?: React.Ref<React.ComponentType<IMaskInputProps<IMask.AnyMaskedOptions, boolean | "typed", unknown, HTMLInputElement, ReactElementProps<HTMLInputElement>>>>; | ||
}, "ref"> | Omit<ReactElementProps<HTMLInputElement> & { | ||
mask: IMask.AnyMaskedOptionsArray; | ||
} & Partial<Pick<IMask.Masked<IMask.AnyMaskedOptionsArray>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & Partial<Pick<IMask.MaskedDynamic, "dispatch">> & import("./mixin").ReactMaskProps<IMask.AnyMaskedOptions, boolean | "typed", unknown, HTMLInputElement> & { | ||
ref?: React.Ref<React.ComponentType<IMaskInputProps<IMask.AnyMaskedOptions, boolean | "typed", unknown, HTMLInputElement, ReactElementProps<HTMLInputElement>>>>; | ||
}, "ref"> | Omit<ReactElementProps<HTMLInputElement> & { | ||
mask: RegExp; | ||
} & Partial<Pick<import("imask").default.Masked<RegExp>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & import("./mixin").ReactMaskProps<import("imask").default.AnyMaskedOptions, false, string, import("./mixin").ReactElement>, "ref"> | Omit<import("./mixin").ReactElementProps<import("./mixin").ReactElement> & { | ||
} & Partial<Pick<IMask.Masked<RegExp>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & import("./mixin").ReactMaskProps<IMask.AnyMaskedOptions, boolean | "typed", unknown, HTMLInputElement> & { | ||
ref?: React.Ref<React.ComponentType<IMaskInputProps<IMask.AnyMaskedOptions, boolean | "typed", unknown, HTMLInputElement, ReactElementProps<HTMLInputElement>>>>; | ||
}, "ref"> | Omit<ReactElementProps<HTMLInputElement> & { | ||
mask: Function; | ||
} & Partial<Pick<import("imask").default.Masked<Function>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & import("./mixin").ReactMaskProps<import("imask").default.AnyMaskedOptions, false, string, import("./mixin").ReactElement>, "ref"> | Omit<import("./mixin").ReactElementProps<import("./mixin").ReactElement> & { | ||
mask: import("imask").default.AnyMaskedOptionsMasked; | ||
} & Partial<Pick<import("imask").default.Masked<import("imask").default.AnyMaskedOptionsMasked>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & import("./mixin").ReactMaskProps<import("imask").default.AnyMaskedOptions, false, string, import("./mixin").ReactElement>, "ref"> | Omit<import("./mixin").ReactElementProps<import("./mixin").ReactElement> & { | ||
mask: import("imask").default.MaskedFunction; | ||
} & Partial<Pick<import("imask").default.Masked<import("imask").default.MaskedFunction>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & import("./mixin").ReactMaskProps<import("imask").default.AnyMaskedOptions, false, string, import("./mixin").ReactElement>, "ref"> | Omit<import("./mixin").ReactElementProps<import("./mixin").ReactElement> & { | ||
mask: import("imask").default.MaskedRegExp; | ||
} & Partial<Pick<import("imask").default.Masked<import("imask").default.MaskedRegExp>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & import("./mixin").ReactMaskProps<import("imask").default.AnyMaskedOptions, false, string, import("./mixin").ReactElement>, "ref"> | Omit<import("./mixin").ReactElementProps<import("./mixin").ReactElement> & { | ||
mask: import("imask").default.MaskedEnum; | ||
} & Partial<Pick<import("imask").default.Masked<import("imask").default.MaskedEnum>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & import("./mixin").ReactMaskProps<import("imask").default.AnyMaskedOptions, false, string, import("./mixin").ReactElement>, "ref"> | Omit<import("./mixin").ReactElementProps<import("./mixin").ReactElement> & { | ||
mask: import("imask").default.MaskedRange; | ||
} & Partial<Pick<import("imask").default.Masked<import("imask").default.MaskedRange>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & import("./mixin").ReactMaskProps<import("imask").default.AnyMaskedOptions, false, string, import("./mixin").ReactElement>, "ref"> | Omit<import("./mixin").ReactElementProps<import("./mixin").ReactElement> & { | ||
mask: typeof import("imask").default.Masked; | ||
} & Partial<Pick<import("imask").default.Masked<typeof import("imask").default.Masked>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & import("./mixin").ReactMaskProps<import("imask").default.AnyMaskedOptions, false, string, import("./mixin").ReactElement>, "ref">) & React.RefAttributes<React.ComponentType<import("./mixin").IMaskInputProps<import("imask").default.AnyMaskedOptions, false, string, import("./mixin").ReactElement, import("./mixin").ReactElementProps<import("./mixin").ReactElement>>>>>; | ||
} & Partial<Pick<IMask.Masked<Function>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & import("./mixin").ReactMaskProps<IMask.AnyMaskedOptions, boolean | "typed", unknown, HTMLInputElement> & { | ||
ref?: React.Ref<React.ComponentType<IMaskInputProps<IMask.AnyMaskedOptions, boolean | "typed", unknown, HTMLInputElement, ReactElementProps<HTMLInputElement>>>>; | ||
}, "ref"> | Omit<ReactElementProps<HTMLInputElement> & Record<string, any> & import("./mixin").ReactMaskProps<IMask.AnyMaskedOptions, boolean | "typed", unknown, HTMLInputElement> & { | ||
ref?: React.Ref<React.ComponentType<IMaskInputProps<IMask.AnyMaskedOptions, boolean | "typed", unknown, HTMLInputElement, ReactElementProps<HTMLInputElement>>>>; | ||
}, "ref">) & React.RefAttributes<unknown>>; | ||
export default IMaskInput; |
@@ -17,4 +17,4 @@ import React from 'react'; | ||
}>; | ||
export type IMaskMixinProps<Opts extends IMask.AnyMaskedOptions = IMask.AnyMaskedOptions, Unmask extends ('typed' | boolean) = false, Value = Unmask extends 'typed' ? IMask.InputMask<Opts>['typedValue'] : Unmask extends Falsy ? IMask.InputMask<Opts>['value'] : IMask.InputMask<Opts>['unmaskedValue'], MaskElement extends ReactElement = ReactElement> = Opts & ReactMaskProps<Opts, Unmask, Value, MaskElement>; | ||
export type IMaskMixinProps<Opts extends IMask.AnyMaskedOptions = IMask.AnyMaskedOptions, Unmask extends ('typed' | boolean) = false, Value = Unmask extends 'typed' ? IMask.InputMask<Opts>['typedValue'] : Unmask extends Falsy ? IMask.InputMask<Opts>['value'] : IMask.InputMask<Opts>['unmaskedValue'], MaskElement extends ReactElement = ReactElement> = IMask.DeduceMaskedOptions<Opts> & ReactMaskProps<Opts, Unmask, Value, MaskElement>; | ||
export type IMaskInputProps<Opts extends IMask.AnyMaskedOptions = IMask.AnyMaskedOptions, Unmask extends ('typed' | boolean) = false, Value = Unmask extends 'typed' ? IMask.InputMask<Opts>['typedValue'] : Unmask extends Falsy ? IMask.InputMask<Opts>['value'] : IMask.InputMask<Opts>['unmaskedValue'], MaskElement extends ReactElement = ReactElement, MaskElementProps = ReactElementProps<MaskElement>> = MaskElementProps & IMaskMixinProps<Opts, Unmask, Value, MaskElement>; | ||
export default function IMaskMixin<Opts extends IMask.AnyMaskedOptions = IMask.AnyMaskedOptions, Unmask extends ('typed' | boolean) = false, Value = Unmask extends 'typed' ? IMask.InputMask<Opts>['typedValue'] : Unmask extends Falsy ? IMask.InputMask<Opts>['value'] : IMask.InputMask<Opts>['unmaskedValue'], MaskElement extends ReactElement = ReactElement, MaskElementProps = ReactElementProps<MaskElement>>(ComposedComponent: ReactMixinComponent<MaskElement, MaskElementProps>): React.ForwardRefExoticComponent<React.PropsWithoutRef<IMaskInputProps<Opts, Unmask, Value, MaskElement, MaskElementProps>> & React.RefAttributes<React.ComponentType<IMaskInputProps<Opts, Unmask, Value, MaskElement, MaskElementProps>>>>; |
@@ -133,2 +133,4 @@ (function (global, factory) { | ||
}); | ||
// TODO type actually should be IMask.DeduceMasked<Opts> | ||
return cloneProps; | ||
@@ -173,3 +175,3 @@ } | ||
const _excluded$1 = ["inputRef"]; | ||
const IMaskInput = IMaskMixin(_ref => { | ||
const IMaskInputClass = IMaskMixin(_ref => { | ||
let { | ||
@@ -183,2 +185,8 @@ inputRef | ||
}); | ||
const IMaskInputFn = (props, ref) => | ||
// TODO type | ||
React__default["default"].createElement(IMaskInputClass, Object.assign({}, props, { | ||
ref | ||
})); | ||
const IMaskInput = React__default["default"].forwardRef(IMaskInputFn); | ||
@@ -185,0 +193,0 @@ const _excluded = ["value"], |
import React from 'react'; | ||
declare const IMaskInput: React.ForwardRefExoticComponent<(Omit<import("./mixin").ReactElementProps<import("./mixin").ReactElement> & { | ||
import IMask from 'imask'; | ||
import { IMaskInputProps, ReactElementProps } from './mixin'; | ||
declare const IMaskInput: React.ForwardRefExoticComponent<(Omit<ReactElementProps<HTMLInputElement> & { | ||
mask: DateConstructor; | ||
} & Partial<Pick<import("imask").default.Masked<DateConstructor>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & Partial<Pick<import("imask").default.MaskedPattern<DateConstructor>, "blocks" | "definitions" | "placeholderChar" | "displayChar" | "lazy">> & Partial<Pick<import("imask").default.MaskedDate, "parse" | "format" | "pattern" | "min" | "max" | "autofix">> & import("./mixin").ReactMaskProps<import("imask").default.AnyMaskedOptions, false, string, import("./mixin").ReactElement>, "ref"> | Omit<import("./mixin").ReactElementProps<import("./mixin").ReactElement> & { | ||
} & Partial<Pick<IMask.Masked<DateConstructor>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & Partial<Pick<IMask.MaskedPattern<DateConstructor>, "blocks" | "definitions" | "placeholderChar" | "displayChar" | "lazy">> & Partial<Pick<IMask.MaskedDate, "parse" | "format" | "pattern" | "min" | "max" | "autofix">> & import("./mixin").ReactMaskProps<IMask.AnyMaskedOptions, boolean | "typed", unknown, HTMLInputElement> & { | ||
ref?: React.Ref<React.ComponentType<IMaskInputProps<IMask.AnyMaskedOptions, boolean | "typed", unknown, HTMLInputElement, ReactElementProps<HTMLInputElement>>>>; | ||
}, "ref"> | Omit<ReactElementProps<HTMLInputElement> & { | ||
mask: NumberConstructor; | ||
} & Partial<Pick<import("imask").default.Masked<NumberConstructor>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & Partial<Pick<import("imask").default.MaskedNumber, "min" | "max" | "radix" | "thousandsSeparator" | "mapToRadix" | "scale" | "signed" | "normalizeZeros" | "padFractionalZeros">> & import("./mixin").ReactMaskProps<import("imask").default.AnyMaskedOptions, false, string, import("./mixin").ReactElement>, "ref"> | Omit<import("./mixin").ReactElementProps<import("./mixin").ReactElement> & { | ||
} & Partial<Pick<IMask.Masked<NumberConstructor>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & Partial<Pick<IMask.MaskedNumber, "min" | "max" | "radix" | "thousandsSeparator" | "mapToRadix" | "scale" | "signed" | "normalizeZeros" | "padFractionalZeros">> & import("./mixin").ReactMaskProps<IMask.AnyMaskedOptions, boolean | "typed", unknown, HTMLInputElement> & { | ||
ref?: React.Ref<React.ComponentType<IMaskInputProps<IMask.AnyMaskedOptions, boolean | "typed", unknown, HTMLInputElement, ReactElementProps<HTMLInputElement>>>>; | ||
}, "ref"> | Omit<ReactElementProps<HTMLInputElement> & { | ||
mask: string; | ||
} & Partial<Pick<import("imask").default.Masked<string>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & Partial<Pick<import("imask").default.MaskedPattern<string>, "blocks" | "definitions" | "placeholderChar" | "displayChar" | "lazy">> & import("./mixin").ReactMaskProps<import("imask").default.AnyMaskedOptions, false, string, import("./mixin").ReactElement>, "ref"> | Omit<import("./mixin").ReactElementProps<import("./mixin").ReactElement> & { | ||
mask: string; | ||
} & Partial<Pick<import("imask").default.Masked<string>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & Partial<Pick<import("imask").default.MaskedPattern<string>, "blocks" | "definitions" | "placeholderChar" | "displayChar" | "lazy">> & Partial<Pick<import("imask").default.MaskedRange, "autofix" | "maxLength" | "from" | "to">> & import("./mixin").ReactMaskProps<import("imask").default.AnyMaskedOptions, false, string, import("./mixin").ReactElement>, "ref"> | Omit<import("./mixin").ReactElementProps<import("./mixin").ReactElement> & { | ||
mask: import("imask").default.AnyMaskedOptionsArray; | ||
} & Partial<Pick<import("imask").default.Masked<import("imask").default.AnyMaskedOptionsArray>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & import("./mixin").ReactMaskProps<import("imask").default.AnyMaskedOptions, false, string, import("./mixin").ReactElement>, "ref"> | Omit<import("./mixin").ReactElementProps<import("./mixin").ReactElement> & { | ||
mask: import("imask").default.AnyMaskedOptionsArray; | ||
} & Partial<Pick<import("imask").default.Masked<import("imask").default.AnyMaskedOptionsArray>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & Partial<Pick<import("imask").default.MaskedDynamic, "dispatch">> & import("./mixin").ReactMaskProps<import("imask").default.AnyMaskedOptions, false, string, import("./mixin").ReactElement>, "ref"> | Omit<import("./mixin").ReactElementProps<import("./mixin").ReactElement> & { | ||
} & Partial<Pick<IMask.Masked<string>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & Partial<Pick<IMask.MaskedPattern<string>, "blocks" | "definitions" | "placeholderChar" | "displayChar" | "lazy">> & import("./mixin").ReactMaskProps<IMask.AnyMaskedOptions, boolean | "typed", unknown, HTMLInputElement> & { | ||
ref?: React.Ref<React.ComponentType<IMaskInputProps<IMask.AnyMaskedOptions, boolean | "typed", unknown, HTMLInputElement, ReactElementProps<HTMLInputElement>>>>; | ||
}, "ref"> | Omit<ReactElementProps<HTMLInputElement> & { | ||
mask: IMask.AnyMaskedOptionsArray; | ||
} & Partial<Pick<IMask.Masked<IMask.AnyMaskedOptionsArray>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & Partial<Pick<IMask.MaskedDynamic, "dispatch">> & import("./mixin").ReactMaskProps<IMask.AnyMaskedOptions, boolean | "typed", unknown, HTMLInputElement> & { | ||
ref?: React.Ref<React.ComponentType<IMaskInputProps<IMask.AnyMaskedOptions, boolean | "typed", unknown, HTMLInputElement, ReactElementProps<HTMLInputElement>>>>; | ||
}, "ref"> | Omit<ReactElementProps<HTMLInputElement> & { | ||
mask: RegExp; | ||
} & Partial<Pick<import("imask").default.Masked<RegExp>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & import("./mixin").ReactMaskProps<import("imask").default.AnyMaskedOptions, false, string, import("./mixin").ReactElement>, "ref"> | Omit<import("./mixin").ReactElementProps<import("./mixin").ReactElement> & { | ||
} & Partial<Pick<IMask.Masked<RegExp>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & import("./mixin").ReactMaskProps<IMask.AnyMaskedOptions, boolean | "typed", unknown, HTMLInputElement> & { | ||
ref?: React.Ref<React.ComponentType<IMaskInputProps<IMask.AnyMaskedOptions, boolean | "typed", unknown, HTMLInputElement, ReactElementProps<HTMLInputElement>>>>; | ||
}, "ref"> | Omit<ReactElementProps<HTMLInputElement> & { | ||
mask: Function; | ||
} & Partial<Pick<import("imask").default.Masked<Function>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & import("./mixin").ReactMaskProps<import("imask").default.AnyMaskedOptions, false, string, import("./mixin").ReactElement>, "ref"> | Omit<import("./mixin").ReactElementProps<import("./mixin").ReactElement> & { | ||
mask: import("imask").default.AnyMaskedOptionsMasked; | ||
} & Partial<Pick<import("imask").default.Masked<import("imask").default.AnyMaskedOptionsMasked>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & import("./mixin").ReactMaskProps<import("imask").default.AnyMaskedOptions, false, string, import("./mixin").ReactElement>, "ref"> | Omit<import("./mixin").ReactElementProps<import("./mixin").ReactElement> & { | ||
mask: import("imask").default.MaskedFunction; | ||
} & Partial<Pick<import("imask").default.Masked<import("imask").default.MaskedFunction>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & import("./mixin").ReactMaskProps<import("imask").default.AnyMaskedOptions, false, string, import("./mixin").ReactElement>, "ref"> | Omit<import("./mixin").ReactElementProps<import("./mixin").ReactElement> & { | ||
mask: import("imask").default.MaskedRegExp; | ||
} & Partial<Pick<import("imask").default.Masked<import("imask").default.MaskedRegExp>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & import("./mixin").ReactMaskProps<import("imask").default.AnyMaskedOptions, false, string, import("./mixin").ReactElement>, "ref"> | Omit<import("./mixin").ReactElementProps<import("./mixin").ReactElement> & { | ||
mask: import("imask").default.MaskedEnum; | ||
} & Partial<Pick<import("imask").default.Masked<import("imask").default.MaskedEnum>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & import("./mixin").ReactMaskProps<import("imask").default.AnyMaskedOptions, false, string, import("./mixin").ReactElement>, "ref"> | Omit<import("./mixin").ReactElementProps<import("./mixin").ReactElement> & { | ||
mask: import("imask").default.MaskedRange; | ||
} & Partial<Pick<import("imask").default.Masked<import("imask").default.MaskedRange>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & import("./mixin").ReactMaskProps<import("imask").default.AnyMaskedOptions, false, string, import("./mixin").ReactElement>, "ref"> | Omit<import("./mixin").ReactElementProps<import("./mixin").ReactElement> & { | ||
mask: typeof import("imask").default.Masked; | ||
} & Partial<Pick<import("imask").default.Masked<typeof import("imask").default.Masked>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & import("./mixin").ReactMaskProps<import("imask").default.AnyMaskedOptions, false, string, import("./mixin").ReactElement>, "ref">) & React.RefAttributes<React.ComponentType<import("./mixin").IMaskInputProps<import("imask").default.AnyMaskedOptions, false, string, import("./mixin").ReactElement, import("./mixin").ReactElementProps<import("./mixin").ReactElement>>>>>; | ||
} & Partial<Pick<IMask.Masked<Function>, "parent" | "prepare" | "validate" | "commit" | "overwrite" | "eager" | "skipInvalid">> & import("./mixin").ReactMaskProps<IMask.AnyMaskedOptions, boolean | "typed", unknown, HTMLInputElement> & { | ||
ref?: React.Ref<React.ComponentType<IMaskInputProps<IMask.AnyMaskedOptions, boolean | "typed", unknown, HTMLInputElement, ReactElementProps<HTMLInputElement>>>>; | ||
}, "ref"> | Omit<ReactElementProps<HTMLInputElement> & Record<string, any> & import("./mixin").ReactMaskProps<IMask.AnyMaskedOptions, boolean | "typed", unknown, HTMLInputElement> & { | ||
ref?: React.Ref<React.ComponentType<IMaskInputProps<IMask.AnyMaskedOptions, boolean | "typed", unknown, HTMLInputElement, ReactElementProps<HTMLInputElement>>>>; | ||
}, "ref">) & React.RefAttributes<unknown>>; | ||
export default IMaskInput; |
@@ -8,3 +8,3 @@ import { _ as _objectWithoutPropertiesLoose } from './_rollupPluginBabelHelpers-2cac7098.js'; | ||
const _excluded = ["inputRef"]; | ||
const IMaskInput = IMaskMixin(_ref => { | ||
const IMaskInputClass = IMaskMixin(_ref => { | ||
let { | ||
@@ -18,3 +18,9 @@ inputRef | ||
}); | ||
const IMaskInputFn = (props, ref) => | ||
// TODO type | ||
React.createElement(IMaskInputClass, Object.assign({}, props, { | ||
ref | ||
})); | ||
const IMaskInput = React.forwardRef(IMaskInputFn); | ||
export { IMaskInput as default }; |
@@ -17,4 +17,4 @@ import React from 'react'; | ||
}>; | ||
export type IMaskMixinProps<Opts extends IMask.AnyMaskedOptions = IMask.AnyMaskedOptions, Unmask extends ('typed' | boolean) = false, Value = Unmask extends 'typed' ? IMask.InputMask<Opts>['typedValue'] : Unmask extends Falsy ? IMask.InputMask<Opts>['value'] : IMask.InputMask<Opts>['unmaskedValue'], MaskElement extends ReactElement = ReactElement> = Opts & ReactMaskProps<Opts, Unmask, Value, MaskElement>; | ||
export type IMaskMixinProps<Opts extends IMask.AnyMaskedOptions = IMask.AnyMaskedOptions, Unmask extends ('typed' | boolean) = false, Value = Unmask extends 'typed' ? IMask.InputMask<Opts>['typedValue'] : Unmask extends Falsy ? IMask.InputMask<Opts>['value'] : IMask.InputMask<Opts>['unmaskedValue'], MaskElement extends ReactElement = ReactElement> = IMask.DeduceMaskedOptions<Opts> & ReactMaskProps<Opts, Unmask, Value, MaskElement>; | ||
export type IMaskInputProps<Opts extends IMask.AnyMaskedOptions = IMask.AnyMaskedOptions, Unmask extends ('typed' | boolean) = false, Value = Unmask extends 'typed' ? IMask.InputMask<Opts>['typedValue'] : Unmask extends Falsy ? IMask.InputMask<Opts>['value'] : IMask.InputMask<Opts>['unmaskedValue'], MaskElement extends ReactElement = ReactElement, MaskElementProps = ReactElementProps<MaskElement>> = MaskElementProps & IMaskMixinProps<Opts, Unmask, Value, MaskElement>; | ||
export default function IMaskMixin<Opts extends IMask.AnyMaskedOptions = IMask.AnyMaskedOptions, Unmask extends ('typed' | boolean) = false, Value = Unmask extends 'typed' ? IMask.InputMask<Opts>['typedValue'] : Unmask extends Falsy ? IMask.InputMask<Opts>['value'] : IMask.InputMask<Opts>['unmaskedValue'], MaskElement extends ReactElement = ReactElement, MaskElementProps = ReactElementProps<MaskElement>>(ComposedComponent: ReactMixinComponent<MaskElement, MaskElementProps>): React.ForwardRefExoticComponent<React.PropsWithoutRef<IMaskInputProps<Opts, Unmask, Value, MaskElement, MaskElementProps>> & React.RefAttributes<React.ComponentType<IMaskInputProps<Opts, Unmask, Value, MaskElement, MaskElementProps>>>>; |
@@ -110,2 +110,4 @@ import { a as _objectDestructuringEmpty } from './_rollupPluginBabelHelpers-2cac7098.js'; | ||
}); | ||
// TODO type actually should be IMask.DeduceMasked<Opts> | ||
return cloneProps; | ||
@@ -112,0 +114,0 @@ } |
{ | ||
"name": "react-imask", | ||
"version": "6.6.0", | ||
"version": "6.6.1-alpha.0", | ||
"license": "MIT", | ||
@@ -23,3 +23,3 @@ "author": "Alexey Kryazhev", | ||
"dependencies": { | ||
"imask": "^6.6.0", | ||
"imask": "^6.6.1-alpha.0", | ||
"prop-types": "^15.8.1" | ||
@@ -33,3 +33,3 @@ }, | ||
}, | ||
"gitHead": "4835b9e70b47a18b5aac3e4ccc183a9f786664c0", | ||
"gitHead": "4c63158f048d22238642280775db049ed0f70444", | ||
"devDependencies": { | ||
@@ -36,0 +36,0 @@ "@types/react": "^18.0.20", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
74445
743
1
Updatedimask@^6.6.1-alpha.0