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.
@@ -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,6 @@
1
+ export const CONTROLLED_PROPS: string[];
2
+ export const defaultFormatChars: {
3
+ "9": RegExp;
4
+ a: RegExp;
5
+ "*": RegExp;
6
+ };
@@ -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,2 @@
1
+ export function defer(fn: any): number;
2
+ export function cancelDefer(deferId: any): void;
@@ -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,7 @@
1
+ export function setInputSelection(input: any, start: any, end: any): void;
2
+ export function getInputSelection(input: any): {
3
+ start: any;
4
+ end: any;
5
+ length: number;
6
+ };
7
+ export function isInputFocused(input: any): boolean;
@@ -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
+ }
@@ -0,0 +1,10 @@
1
+ export default function _default({ mask, maskPlaceholder }: {
2
+ mask: any;
3
+ maskPlaceholder: any;
4
+ }): {
5
+ maskPlaceholder: any;
6
+ prefix: string;
7
+ mask: any;
8
+ lastEditablePosition: number;
9
+ permanents: any[];
10
+ };
@@ -0,0 +1,3 @@
1
+ export function validateMaxLength(props: any): void;
2
+ export function validateMaskPlaceholder(props: any): void;
3
+ export function validateChildren(props: any, inputElement: any): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jclib-ui",
3
- "version": "1.1.13",
3
+ "version": "1.1.14",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "dependencies": {