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/cjs/index.js
CHANGED
|
@@ -184,11 +184,14 @@ var InputDropdown = React.forwardRef(function (props, ref) {
|
|
|
184
184
|
};
|
|
185
185
|
});
|
|
186
186
|
React.useEffect(function () {
|
|
187
|
-
var _a;
|
|
187
|
+
var _a, _b;
|
|
188
188
|
if (buttonRef === null || buttonRef === void 0 ? void 0 : buttonRef.current) {
|
|
189
|
+
var inputMessage = (_a = buttonRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(".KUI-InputMessage");
|
|
189
190
|
if (isOpen) {
|
|
190
191
|
buttonRef.current.style.zIndex = "4";
|
|
191
|
-
|
|
192
|
+
if (inputMessage)
|
|
193
|
+
inputMessage.style.opacity = "0";
|
|
194
|
+
var scrollContainer = (_b = dropdownRef.current) === null || _b === void 0 ? void 0 : _b.children[0].children[0];
|
|
192
195
|
if (scrollContainer) {
|
|
193
196
|
var hasScroll = scrollContainer.scrollHeight > scrollContainer.clientHeight;
|
|
194
197
|
setIsScrollable(hasScroll);
|
|
@@ -196,6 +199,8 @@ var InputDropdown = React.forwardRef(function (props, ref) {
|
|
|
196
199
|
}
|
|
197
200
|
else {
|
|
198
201
|
buttonRef.current.style.zIndex = "1";
|
|
202
|
+
if (inputMessage)
|
|
203
|
+
inputMessage.style.opacity = "1";
|
|
199
204
|
}
|
|
200
205
|
}
|
|
201
206
|
}, [isOpen]);
|
|
@@ -504,7 +509,9 @@ var InputWithMask = React.forwardRef(function (_a, ref) {
|
|
|
504
509
|
var InputWithController = React.forwardRef(function (_a, ref) {
|
|
505
510
|
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
511
|
var handleChange = function (e, field) {
|
|
507
|
-
|
|
512
|
+
var _a;
|
|
513
|
+
var newValue = type === "number" && !((_a = e.target.value) === null || _a === void 0 ? void 0 : _a.length) ? null : e.target.value;
|
|
514
|
+
field.onChange(__assign(__assign({}, e), { target: __assign(__assign({}, e.target), { value: newValue }) }));
|
|
508
515
|
if (inputProps.onChange) {
|
|
509
516
|
inputProps.onChange(e);
|
|
510
517
|
}
|
|
@@ -515,19 +522,11 @@ var InputWithController = React.forwardRef(function (_a, ref) {
|
|
|
515
522
|
? error
|
|
516
523
|
: (_a = fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
|
|
517
524
|
};
|
|
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
|
-
};
|
|
526
525
|
return (jsxRuntime.jsx(reactHookForm.Controller, { control: form === null || form === void 0 ? void 0 : form.control, name: name, render: function (_a) {
|
|
527
526
|
var field = _a.field, fieldState = _a.fieldState;
|
|
528
527
|
return (jsxRuntime.jsx(kuiBasic.InputWithAdornments, __assign({ message: getError(fieldState) }, field, inputProps, { onChange: function (e) {
|
|
529
528
|
return handleChange(e, field);
|
|
530
|
-
}, type: type, value:
|
|
529
|
+
}, type: type, value: value !== null && value !== void 0 ? value : field.value, inputRef: ref })));
|
|
531
530
|
} }));
|
|
532
531
|
});
|
|
533
532
|
|