kui-complex 0.0.60 → 0.0.61
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/cjs/index.js +7 -2
- package/ButtonSelect/cjs/index.js.map +1 -1
- package/ButtonSelect/index.js +7 -2
- package/ButtonSelect/index.js.map +1 -1
- package/CalendarHeaderWithSelect/cjs/index.js +7 -2
- package/CalendarHeaderWithSelect/cjs/index.js.map +1 -1
- package/CalendarHeaderWithSelect/index.js +7 -2
- package/CalendarHeaderWithSelect/index.js.map +1 -1
- package/InputDropdown/cjs/index.js +7 -2
- package/InputDropdown/cjs/index.js.map +1 -1
- package/InputDropdown/index.js +7 -2
- package/InputDropdown/index.js.map +1 -1
- package/InputPassword/cjs/index.js +4 -10
- package/InputPassword/cjs/index.js.map +1 -1
- package/InputPassword/index.js +4 -10
- package/InputPassword/index.js.map +1 -1
- package/InputSelect/cjs/index.js +7 -2
- package/InputSelect/cjs/index.js.map +1 -1
- package/InputSelect/index.js +7 -2
- package/InputSelect/index.js.map +1 -1
- package/InputSelectDropdown/cjs/index.js +7 -2
- package/InputSelectDropdown/cjs/index.js.map +1 -1
- package/InputSelectDropdown/index.js +7 -2
- package/InputSelectDropdown/index.js.map +1 -1
- package/InputTextAreaMobile/cjs/index.js +4 -10
- package/InputTextAreaMobile/cjs/index.js.map +1 -1
- package/InputTextAreaMobile/index.js +4 -10
- package/InputTextAreaMobile/index.js.map +1 -1
- package/InputWithController/cjs/index.js +4 -10
- package/InputWithController/cjs/index.js.map +1 -1
- package/InputWithController/index.js +4 -10
- package/InputWithController/index.js.map +1 -1
- package/InputWithDatePicker/cjs/index.js +7 -2
- package/InputWithDatePicker/cjs/index.js.map +1 -1
- package/InputWithDatePicker/index.js +7 -2
- package/InputWithDatePicker/index.js.map +1 -1
- package/SelectMonth/cjs/index.js +7 -2
- package/SelectMonth/cjs/index.js.map +1 -1
- package/SelectMonth/index.js +7 -2
- package/SelectMonth/index.js.map +1 -1
- package/SelectYear/cjs/index.js +7 -2
- package/SelectYear/cjs/index.js.map +1 -1
- package/SelectYear/index.js +7 -2
- package/SelectYear/index.js.map +1 -1
- package/TestForm/cjs/index.js +11 -12
- package/TestForm/cjs/index.js.map +1 -1
- package/TestForm/index.js +11 -12
- package/TestForm/index.js.map +1 -1
- package/cjs/index.js +11 -12
- package/cjs/index.js.map +1 -1
- package/index.js +11 -12
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -152,11 +152,14 @@ var InputDropdown = forwardRef(function (props, ref) {
|
|
|
152
152
|
};
|
|
153
153
|
});
|
|
154
154
|
useEffect(function () {
|
|
155
|
-
var _a;
|
|
155
|
+
var _a, _b;
|
|
156
156
|
if (buttonRef === null || buttonRef === void 0 ? void 0 : buttonRef.current) {
|
|
157
|
+
var inputMessage = (_a = buttonRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(".KUI-InputMessage");
|
|
157
158
|
if (isOpen) {
|
|
158
159
|
buttonRef.current.style.zIndex = "4";
|
|
159
|
-
|
|
160
|
+
if (inputMessage)
|
|
161
|
+
inputMessage.style.opacity = "0";
|
|
162
|
+
var scrollContainer = (_b = dropdownRef.current) === null || _b === void 0 ? void 0 : _b.children[0].children[0];
|
|
160
163
|
if (scrollContainer) {
|
|
161
164
|
var hasScroll = scrollContainer.scrollHeight > scrollContainer.clientHeight;
|
|
162
165
|
setIsScrollable(hasScroll);
|
|
@@ -164,6 +167,8 @@ var InputDropdown = forwardRef(function (props, ref) {
|
|
|
164
167
|
}
|
|
165
168
|
else {
|
|
166
169
|
buttonRef.current.style.zIndex = "1";
|
|
170
|
+
if (inputMessage)
|
|
171
|
+
inputMessage.style.opacity = "1";
|
|
167
172
|
}
|
|
168
173
|
}
|
|
169
174
|
}, [isOpen]);
|
|
@@ -472,7 +477,9 @@ var InputWithMask = forwardRef(function (_a, ref) {
|
|
|
472
477
|
var InputWithController = forwardRef(function (_a, ref) {
|
|
473
478
|
var form = _a.form, name = _a.name, error = _a.error, value = _a.value, type = _a.type, inputProps = __rest(_a, ["form", "name", "error", "value", "type"]);
|
|
474
479
|
var handleChange = function (e, field) {
|
|
475
|
-
|
|
480
|
+
var _a;
|
|
481
|
+
var newValue = type === "number" && !((_a = e.target.value) === null || _a === void 0 ? void 0 : _a.length) ? null : e.target.value;
|
|
482
|
+
field.onChange(__assign(__assign({}, e), { target: __assign(__assign({}, e.target), { value: newValue }) }));
|
|
476
483
|
if (inputProps.onChange) {
|
|
477
484
|
inputProps.onChange(e);
|
|
478
485
|
}
|
|
@@ -483,19 +490,11 @@ var InputWithController = forwardRef(function (_a, ref) {
|
|
|
483
490
|
? error
|
|
484
491
|
: (_a = fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
|
|
485
492
|
};
|
|
486
|
-
var getValue = function (field) {
|
|
487
|
-
if (typeof value === "undefined") {
|
|
488
|
-
if (typeof field.value !== "undefined")
|
|
489
|
-
return field.value;
|
|
490
|
-
return type === "number" ? null : "";
|
|
491
|
-
}
|
|
492
|
-
return value;
|
|
493
|
-
};
|
|
494
493
|
return (jsx(Controller, { control: form === null || form === void 0 ? void 0 : form.control, name: name, render: function (_a) {
|
|
495
494
|
var field = _a.field, fieldState = _a.fieldState;
|
|
496
495
|
return (jsx(InputWithAdornments, __assign({ message: getError(fieldState) }, field, inputProps, { onChange: function (e) {
|
|
497
496
|
return handleChange(e, field);
|
|
498
|
-
}, type: type, value:
|
|
497
|
+
}, type: type, value: value !== null && value !== void 0 ? value : field.value, inputRef: ref })));
|
|
499
498
|
} }));
|
|
500
499
|
});
|
|
501
500
|
|