kui-complex 0.0.59 → 0.0.60
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/ButtonSelect/index.d.ts +1 -1
- package/InputPassword/cjs/index.js +10 -3
- package/InputPassword/cjs/index.js.map +1 -1
- package/InputPassword/index.js +10 -3
- package/InputPassword/index.js.map +1 -1
- package/InputPhoneWithForm/index.d.ts +1 -1
- package/InputSelect/index.d.ts +1 -1
- package/InputTextAreaMobile/cjs/index.js +10 -3
- package/InputTextAreaMobile/cjs/index.js.map +1 -1
- package/InputTextAreaMobile/index.js +10 -3
- package/InputTextAreaMobile/index.js.map +1 -1
- package/InputWithController/cjs/index.js +10 -3
- package/InputWithController/cjs/index.js.map +1 -1
- package/InputWithController/index.js +10 -3
- package/InputWithController/index.js.map +1 -1
- package/InputWithDatePicker/index.d.ts +1 -1
- package/SelectMonth/index.d.ts +1 -1
- package/SelectYear/index.d.ts +1 -1
- package/TestForm/cjs/index.js +10 -3
- package/TestForm/cjs/index.js.map +1 -1
- package/TestForm/index.js +10 -3
- package/TestForm/index.js.map +1 -1
- package/cjs/index.js +10 -3
- package/cjs/index.js.map +1 -1
- package/index.d.ts +6 -6
- package/index.js +10 -3
- package/index.js.map +1 -1
- package/package.json +1 -1
package/cjs/index.js
CHANGED
|
@@ -502,7 +502,7 @@ var InputWithMask = React.forwardRef(function (_a, ref) {
|
|
|
502
502
|
});
|
|
503
503
|
|
|
504
504
|
var InputWithController = React.forwardRef(function (_a, ref) {
|
|
505
|
-
var form = _a.form, name = _a.name, error = _a.error, value = _a.value, inputProps = __rest(_a, ["form", "name", "error", "value"]);
|
|
505
|
+
var form = _a.form, name = _a.name, error = _a.error, value = _a.value, type = _a.type, inputProps = __rest(_a, ["form", "name", "error", "value", "type"]);
|
|
506
506
|
var handleChange = function (e, field) {
|
|
507
507
|
field.onChange(e);
|
|
508
508
|
if (inputProps.onChange) {
|
|
@@ -515,12 +515,19 @@ var InputWithController = React.forwardRef(function (_a, ref) {
|
|
|
515
515
|
? error
|
|
516
516
|
: (_a = fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
|
|
517
517
|
};
|
|
518
|
+
var getValue = function (field) {
|
|
519
|
+
if (typeof value === "undefined") {
|
|
520
|
+
if (typeof field.value !== "undefined")
|
|
521
|
+
return field.value;
|
|
522
|
+
return type === "number" ? null : "";
|
|
523
|
+
}
|
|
524
|
+
return value;
|
|
525
|
+
};
|
|
518
526
|
return (jsxRuntime.jsx(reactHookForm.Controller, { control: form === null || form === void 0 ? void 0 : form.control, name: name, render: function (_a) {
|
|
519
|
-
var _b;
|
|
520
527
|
var field = _a.field, fieldState = _a.fieldState;
|
|
521
528
|
return (jsxRuntime.jsx(kuiBasic.InputWithAdornments, __assign({ message: getError(fieldState) }, field, inputProps, { onChange: function (e) {
|
|
522
529
|
return handleChange(e, field);
|
|
523
|
-
},
|
|
530
|
+
}, type: type, value: getValue(field), inputRef: ref })));
|
|
524
531
|
} }));
|
|
525
532
|
});
|
|
526
533
|
|