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/TestForm/index.js
CHANGED
|
@@ -60,7 +60,9 @@ function __makeTemplateObject(cooked, raw) {
|
|
|
60
60
|
var InputWithController = forwardRef(function (_a, ref) {
|
|
61
61
|
var form = _a.form, name = _a.name, error = _a.error, value = _a.value, type = _a.type, inputProps = __rest(_a, ["form", "name", "error", "value", "type"]);
|
|
62
62
|
var handleChange = function (e, field) {
|
|
63
|
-
|
|
63
|
+
var _a;
|
|
64
|
+
var newValue = type === "number" && !((_a = e.target.value) === null || _a === void 0 ? void 0 : _a.length) ? null : e.target.value;
|
|
65
|
+
field.onChange(__assign(__assign({}, e), { target: __assign(__assign({}, e.target), { value: newValue }) }));
|
|
64
66
|
if (inputProps.onChange) {
|
|
65
67
|
inputProps.onChange(e);
|
|
66
68
|
}
|
|
@@ -71,19 +73,11 @@ var InputWithController = forwardRef(function (_a, ref) {
|
|
|
71
73
|
? error
|
|
72
74
|
: (_a = fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
|
|
73
75
|
};
|
|
74
|
-
var getValue = function (field) {
|
|
75
|
-
if (typeof value === "undefined") {
|
|
76
|
-
if (typeof field.value !== "undefined")
|
|
77
|
-
return field.value;
|
|
78
|
-
return type === "number" ? null : "";
|
|
79
|
-
}
|
|
80
|
-
return value;
|
|
81
|
-
};
|
|
82
76
|
return (jsx(Controller, { control: form === null || form === void 0 ? void 0 : form.control, name: name, render: function (_a) {
|
|
83
77
|
var field = _a.field, fieldState = _a.fieldState;
|
|
84
78
|
return (jsx(InputWithAdornments, __assign({ message: getError(fieldState) }, field, inputProps, { onChange: function (e) {
|
|
85
79
|
return handleChange(e, field);
|
|
86
|
-
}, type: type, value:
|
|
80
|
+
}, type: type, value: value !== null && value !== void 0 ? value : field.value, inputRef: ref })));
|
|
87
81
|
} }));
|
|
88
82
|
});
|
|
89
83
|
|
|
@@ -106,11 +100,14 @@ var InputDropdown = forwardRef(function (props, ref) {
|
|
|
106
100
|
};
|
|
107
101
|
});
|
|
108
102
|
useEffect(function () {
|
|
109
|
-
var _a;
|
|
103
|
+
var _a, _b;
|
|
110
104
|
if (buttonRef === null || buttonRef === void 0 ? void 0 : buttonRef.current) {
|
|
105
|
+
var inputMessage = (_a = buttonRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(".KUI-InputMessage");
|
|
111
106
|
if (isOpen) {
|
|
112
107
|
buttonRef.current.style.zIndex = "4";
|
|
113
|
-
|
|
108
|
+
if (inputMessage)
|
|
109
|
+
inputMessage.style.opacity = "0";
|
|
110
|
+
var scrollContainer = (_b = dropdownRef.current) === null || _b === void 0 ? void 0 : _b.children[0].children[0];
|
|
114
111
|
if (scrollContainer) {
|
|
115
112
|
var hasScroll = scrollContainer.scrollHeight > scrollContainer.clientHeight;
|
|
116
113
|
setIsScrollable(hasScroll);
|
|
@@ -118,6 +115,8 @@ var InputDropdown = forwardRef(function (props, ref) {
|
|
|
118
115
|
}
|
|
119
116
|
else {
|
|
120
117
|
buttonRef.current.style.zIndex = "1";
|
|
118
|
+
if (inputMessage)
|
|
119
|
+
inputMessage.style.opacity = "1";
|
|
121
120
|
}
|
|
122
121
|
}
|
|
123
122
|
}, [isOpen]);
|