kui-complex 0.0.49 → 0.0.50
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/InputPassword/cjs/index.js +8 -56
- package/InputPassword/cjs/index.js.map +1 -1
- package/InputPassword/index.js +1 -31
- package/InputPassword/index.js.map +1 -1
- package/InputTextAreaMobile/cjs/index.js +4 -52
- package/InputTextAreaMobile/cjs/index.js.map +1 -1
- package/InputTextAreaMobile/index.js +1 -31
- package/InputTextAreaMobile/index.js.map +1 -1
- package/InputWithController/cjs/index.js +3 -52
- package/InputWithController/cjs/index.js.map +1 -1
- package/InputWithController/index.d.ts +1 -1
- package/InputWithController/index.js +1 -31
- package/InputWithController/index.js.map +1 -1
- package/TestForm/cjs/index.js +42 -72
- package/TestForm/cjs/index.js.map +1 -1
- package/TestForm/index.js +1 -31
- package/TestForm/index.js.map +1 -1
- package/cjs/index.js +1 -30
- package/cjs/index.js.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +1 -30
- package/index.js.map +1 -1
- package/package.json +1 -1
package/cjs/index.js
CHANGED
|
@@ -489,31 +489,6 @@ var InputWithMask = React.forwardRef(function (_a, ref) {
|
|
|
489
489
|
} }));
|
|
490
490
|
});
|
|
491
491
|
|
|
492
|
-
function setRef(ref, value) {
|
|
493
|
-
if (typeof ref === "function") {
|
|
494
|
-
ref(value);
|
|
495
|
-
}
|
|
496
|
-
else if (ref) {
|
|
497
|
-
ref.current = value;
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
function useForkRef() {
|
|
501
|
-
var refs = [];
|
|
502
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
503
|
-
refs[_i] = arguments[_i];
|
|
504
|
-
}
|
|
505
|
-
return React__namespace.useMemo(function () {
|
|
506
|
-
if (refs.every(function (ref) { return ref == null; })) {
|
|
507
|
-
return null;
|
|
508
|
-
}
|
|
509
|
-
return function (instance) {
|
|
510
|
-
refs.forEach(function (ref) {
|
|
511
|
-
setRef(ref, instance);
|
|
512
|
-
});
|
|
513
|
-
};
|
|
514
|
-
}, refs);
|
|
515
|
-
}
|
|
516
|
-
|
|
517
492
|
var InputWithController = React.forwardRef(function (_a, ref) {
|
|
518
493
|
var form = _a.form, name = _a.name, error = _a.error, value = _a.value, inputProps = __rest(_a, ["form", "name", "error", "value"]);
|
|
519
494
|
var handleChange = function (e, field) {
|
|
@@ -522,10 +497,6 @@ var InputWithController = React.forwardRef(function (_a, ref) {
|
|
|
522
497
|
inputProps.onChange(e);
|
|
523
498
|
}
|
|
524
499
|
};
|
|
525
|
-
var forwardedRef = function (elem, field) {
|
|
526
|
-
useForkRef(ref);
|
|
527
|
-
field.ref(elem);
|
|
528
|
-
};
|
|
529
500
|
var getError = function (fieldState) {
|
|
530
501
|
var _a;
|
|
531
502
|
return typeof error !== "undefined" && String(error).length > 0
|
|
@@ -536,7 +507,7 @@ var InputWithController = React.forwardRef(function (_a, ref) {
|
|
|
536
507
|
var field = _a.field, fieldState = _a.fieldState;
|
|
537
508
|
return (jsxRuntime.jsx(kuiBasic.InputWithAdornments, __assign({ message: getError(fieldState) }, field, inputProps, { onChange: function (e) {
|
|
538
509
|
return handleChange(e, field);
|
|
539
|
-
}, value: typeof value !== "undefined" ? value : field.value || "",
|
|
510
|
+
}, value: typeof value !== "undefined" ? value : field.value || "", inputRef: ref })));
|
|
540
511
|
} }));
|
|
541
512
|
});
|
|
542
513
|
|