@ssplib/react-components 0.0.257 → 0.0.258
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,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare function Input({ type, numberMask, xs, sm, inputMinLength, inputMaxLength, defaultValue, md,
|
|
2
|
+
export declare function Input({ type, numberMask, xs, sm, inputMinLength, inputMaxLength, defaultValue, md, disabled, watchValue, ...props }: {
|
|
3
3
|
type: 'cnpj' | 'cpf' | 'input' | 'email' | 'cpf_cnpj' | 'phone' | 'input' | 'number' | 'rg' | 'password' | 'cep' | 'sei';
|
|
4
4
|
name: string;
|
|
5
5
|
watchValue?: string;
|
|
@@ -44,10 +44,11 @@ const react_1 = __importStar(require("react"));
|
|
|
44
44
|
const MaskInput_1 = __importDefault(require("./MaskInput"));
|
|
45
45
|
const form_1 = require("../../../context/form");
|
|
46
46
|
function Input(_a) {
|
|
47
|
-
var { type = 'input', numberMask = '000000000000000', xs = 12, sm, inputMinLength = 1, inputMaxLength = 255, defaultValue = '', md,
|
|
47
|
+
var { type = 'input', numberMask = '000000000000000', xs = 12, sm, inputMinLength = 1, inputMaxLength = 255, defaultValue = '', md, disabled = false, watchValue } = _a, props = __rest(_a, ["type", "numberMask", "xs", "sm", "inputMinLength", "inputMaxLength", "defaultValue", "md", "disabled", "watchValue"]);
|
|
48
48
|
const context = (0, react_1.useContext)(form_1.FormContext);
|
|
49
49
|
(0, react_1.useEffect)(() => {
|
|
50
|
-
|
|
50
|
+
if (!watchValue === undefined)
|
|
51
|
+
context.formSetValue(props.name, watchValue);
|
|
51
52
|
}, [watchValue]);
|
|
52
53
|
const chooseInput = () => {
|
|
53
54
|
const inputConfig = {
|