jclib-ui 1.1.13 → 1.1.14
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/dist/jclib-ui.es.js +775 -12
- package/dist/jclib-ui.es.js.map +1 -1
- package/dist/jclib-ui.umd.js +35 -35
- package/dist/jclib-ui.umd.js.map +1 -1
- package/dist/src/lib/index.d.ts +1 -0
- package/dist/src/lib/reactInputMask/children-wrapper.d.ts +8 -0
- package/dist/src/lib/reactInputMask/constants.d.ts +6 -0
- package/dist/src/lib/reactInputMask/hooks.d.ts +24 -0
- package/dist/src/lib/reactInputMask/index.d.ts +39 -0
- package/dist/src/lib/reactInputMask/utils/defer.d.ts +2 -0
- package/dist/src/lib/reactInputMask/utils/helpers.d.ts +7 -0
- package/dist/src/lib/reactInputMask/utils/input.d.ts +7 -0
- package/dist/src/lib/reactInputMask/utils/mask.d.ts +35 -0
- package/dist/src/lib/reactInputMask/utils/parse-mask.d.ts +10 -0
- package/dist/src/lib/reactInputMask/validate-props.d.ts +3 -0
- package/package.json +1 -1
package/dist/src/lib/index.d.ts
CHANGED
|
@@ -40,6 +40,7 @@ export { default as InputPassword } from './InputPass/InputPass';
|
|
|
40
40
|
export { default as InputBox } from './inputs/InputBox';
|
|
41
41
|
export { InputCheckBox } from './inputs/InputCheckBox';
|
|
42
42
|
export { InputOff } from './inputOff/inputOff';
|
|
43
|
+
export { default as InputMask } from './reactInputMask';
|
|
43
44
|
export * from './inputs/inputs';
|
|
44
45
|
export { default as LabelHint } from './labelHint/LabelHint';
|
|
45
46
|
export { default as Loading } from './loading/Loading';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export default class InputMaskChildrenWrapper extends React.Component<any, any, any> {
|
|
3
|
+
constructor(props: any);
|
|
4
|
+
constructor(props: any, context: any);
|
|
5
|
+
render(): React.DetailedReactHTMLElement<{
|
|
6
|
+
readonly [x: string]: any;
|
|
7
|
+
}, HTMLElement>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export function useInputElement(inputRef: any): () => any;
|
|
2
|
+
export function useInputState(initialValue: any, isMasked: any): {
|
|
3
|
+
inputRef: import('react').MutableRefObject<undefined>;
|
|
4
|
+
getInputState: () => {
|
|
5
|
+
value: any;
|
|
6
|
+
selection: {
|
|
7
|
+
start: any;
|
|
8
|
+
end: any;
|
|
9
|
+
length: number;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
getLastInputState: () => {
|
|
13
|
+
value: any;
|
|
14
|
+
selection: {
|
|
15
|
+
start: any;
|
|
16
|
+
end: any;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
setInputState: ({ value, selection }: {
|
|
20
|
+
value: any;
|
|
21
|
+
selection: any;
|
|
22
|
+
}) => void;
|
|
23
|
+
};
|
|
24
|
+
export function usePrevious(value: any): undefined;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
|
|
3
|
+
export interface InputMaskSelection {
|
|
4
|
+
start: number | null
|
|
5
|
+
end: number | null
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface InputMaskState {
|
|
9
|
+
value: string
|
|
10
|
+
selection: InputMaskSelection | null
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface BeforeMaskedStateChangeStates {
|
|
14
|
+
previousState?: InputMaskState
|
|
15
|
+
currentState?: InputMaskState
|
|
16
|
+
nextState: InputMaskState
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface InputMaskProps
|
|
20
|
+
extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'children'> {
|
|
21
|
+
/** `9` dígito, `a` letra, `*` letra ou dígito; `\` escapa um caractere. Array aceita strings (fixas) e RegExp. */
|
|
22
|
+
mask?: string | Array<string | RegExp> | null
|
|
23
|
+
/** Um caractere (repetido nas posições editáveis) ou string do mesmo tamanho da máscara. `null` oculta o placeholder. */
|
|
24
|
+
maskPlaceholder?: string | null
|
|
25
|
+
/** Mantém a máscara visível mesmo sem foco e com valor vazio. */
|
|
26
|
+
alwaysShowMask?: boolean
|
|
27
|
+
/** Permite alterar o próximo estado (valor/seleção) antes de ser aplicado. */
|
|
28
|
+
beforeMaskedStateChange?: (
|
|
29
|
+
states: BeforeMaskedStateChangeStates
|
|
30
|
+
) => InputMaskState
|
|
31
|
+
/** Elemento de input customizado; `value`, `onChange`, `onFocus`, `onBlur`, `onMouseDown`, `disabled` e `readOnly` devem ir no InputMask. */
|
|
32
|
+
children?: React.ReactElement
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
declare const InputMask: React.ForwardRefExoticComponent<
|
|
36
|
+
InputMaskProps & React.RefAttributes<HTMLInputElement>
|
|
37
|
+
>
|
|
38
|
+
|
|
39
|
+
export default InputMask
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export function getElementDocument(element: any): any;
|
|
2
|
+
export function getElementWindow(element: any): any;
|
|
3
|
+
export function isDOMElement(element: any): boolean;
|
|
4
|
+
export function isFunction(value: any): boolean;
|
|
5
|
+
export function findLastIndex(array: any, predicate: any): number;
|
|
6
|
+
export function repeat(string: any, n?: number): string;
|
|
7
|
+
export function toString(value: any): string;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export default class MaskUtils {
|
|
2
|
+
constructor(options: any);
|
|
3
|
+
maskOptions: {
|
|
4
|
+
maskPlaceholder: any;
|
|
5
|
+
prefix: string;
|
|
6
|
+
mask: any;
|
|
7
|
+
lastEditablePosition: number;
|
|
8
|
+
permanents: any[];
|
|
9
|
+
};
|
|
10
|
+
isCharacterAllowedAtPosition: (character: any, position: any) => boolean;
|
|
11
|
+
isCharacterFillingPosition: (character: any, position: any) => boolean;
|
|
12
|
+
isPositionEditable: (position: any) => boolean;
|
|
13
|
+
isValueEmpty: (value: any) => any;
|
|
14
|
+
isValueFilled: (value: any) => boolean;
|
|
15
|
+
getDefaultSelectionForValue: (value: any) => {
|
|
16
|
+
start: any;
|
|
17
|
+
end: any;
|
|
18
|
+
};
|
|
19
|
+
getFilledLength: (value: any) => number;
|
|
20
|
+
getStringFillingLengthAtPosition: (string: any, position: any) => number;
|
|
21
|
+
getLeftEditablePosition: (position: any) => any;
|
|
22
|
+
getRightEditablePosition: (position: any) => any;
|
|
23
|
+
formatValue: (value: any) => any;
|
|
24
|
+
clearRange: (value: any, start: any, len: any) => any;
|
|
25
|
+
insertCharacterAtPosition: (value: any, character: any, position: any) => any;
|
|
26
|
+
insertStringAtPosition: (value: any, string: any, position: any) => any;
|
|
27
|
+
processChange: (currentState: any, previousState: any) => {
|
|
28
|
+
value: any;
|
|
29
|
+
enteredString: string;
|
|
30
|
+
selection: {
|
|
31
|
+
start: number;
|
|
32
|
+
end: number;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
}
|