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/index.d.ts
CHANGED
|
@@ -155,7 +155,7 @@ declare const InputSelectDropdown: React.ForwardRefExoticComponent<InputSelectDr
|
|
|
155
155
|
|
|
156
156
|
declare const InputTextAreaMobile: React.ForwardRefExoticComponent<Pick<any, string | number | symbol> & React.RefAttributes<unknown>>;
|
|
157
157
|
|
|
158
|
-
declare const InputWithController: React.ForwardRefExoticComponent<InputWithControllerProps & React.RefAttributes<HTMLInputElement>>;
|
|
158
|
+
declare const InputWithController: React.ForwardRefExoticComponent<InputWithControllerProps & React.RefAttributes<HTMLInputElement | null>>;
|
|
159
159
|
|
|
160
160
|
declare const InputWithDatePicker: React.ForwardRefExoticComponent<Pick<{
|
|
161
161
|
title?: string | undefined;
|
package/index.js
CHANGED
|
@@ -456,31 +456,6 @@ var InputWithMask = forwardRef(function (_a, ref) {
|
|
|
456
456
|
} }));
|
|
457
457
|
});
|
|
458
458
|
|
|
459
|
-
function setRef(ref, value) {
|
|
460
|
-
if (typeof ref === "function") {
|
|
461
|
-
ref(value);
|
|
462
|
-
}
|
|
463
|
-
else if (ref) {
|
|
464
|
-
ref.current = value;
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
function useForkRef() {
|
|
468
|
-
var refs = [];
|
|
469
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
470
|
-
refs[_i] = arguments[_i];
|
|
471
|
-
}
|
|
472
|
-
return React.useMemo(function () {
|
|
473
|
-
if (refs.every(function (ref) { return ref == null; })) {
|
|
474
|
-
return null;
|
|
475
|
-
}
|
|
476
|
-
return function (instance) {
|
|
477
|
-
refs.forEach(function (ref) {
|
|
478
|
-
setRef(ref, instance);
|
|
479
|
-
});
|
|
480
|
-
};
|
|
481
|
-
}, refs);
|
|
482
|
-
}
|
|
483
|
-
|
|
484
459
|
var InputWithController = forwardRef(function (_a, ref) {
|
|
485
460
|
var form = _a.form, name = _a.name, error = _a.error, value = _a.value, inputProps = __rest(_a, ["form", "name", "error", "value"]);
|
|
486
461
|
var handleChange = function (e, field) {
|
|
@@ -489,10 +464,6 @@ var InputWithController = forwardRef(function (_a, ref) {
|
|
|
489
464
|
inputProps.onChange(e);
|
|
490
465
|
}
|
|
491
466
|
};
|
|
492
|
-
var forwardedRef = function (elem, field) {
|
|
493
|
-
useForkRef(ref);
|
|
494
|
-
field.ref(elem);
|
|
495
|
-
};
|
|
496
467
|
var getError = function (fieldState) {
|
|
497
468
|
var _a;
|
|
498
469
|
return typeof error !== "undefined" && String(error).length > 0
|
|
@@ -503,7 +474,7 @@ var InputWithController = forwardRef(function (_a, ref) {
|
|
|
503
474
|
var field = _a.field, fieldState = _a.fieldState;
|
|
504
475
|
return (jsx(InputWithAdornments, __assign({ message: getError(fieldState) }, field, inputProps, { onChange: function (e) {
|
|
505
476
|
return handleChange(e, field);
|
|
506
|
-
}, value: typeof value !== "undefined" ? value : field.value || "",
|
|
477
|
+
}, value: typeof value !== "undefined" ? value : field.value || "", inputRef: ref })));
|
|
507
478
|
} }));
|
|
508
479
|
});
|
|
509
480
|
|