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.
Files changed (53) hide show
  1. package/ButtonSelect/cjs/index.js +7 -2
  2. package/ButtonSelect/cjs/index.js.map +1 -1
  3. package/ButtonSelect/index.js +7 -2
  4. package/ButtonSelect/index.js.map +1 -1
  5. package/CalendarHeaderWithSelect/cjs/index.js +7 -2
  6. package/CalendarHeaderWithSelect/cjs/index.js.map +1 -1
  7. package/CalendarHeaderWithSelect/index.js +7 -2
  8. package/CalendarHeaderWithSelect/index.js.map +1 -1
  9. package/InputDropdown/cjs/index.js +7 -2
  10. package/InputDropdown/cjs/index.js.map +1 -1
  11. package/InputDropdown/index.js +7 -2
  12. package/InputDropdown/index.js.map +1 -1
  13. package/InputPassword/cjs/index.js +4 -10
  14. package/InputPassword/cjs/index.js.map +1 -1
  15. package/InputPassword/index.js +4 -10
  16. package/InputPassword/index.js.map +1 -1
  17. package/InputSelect/cjs/index.js +7 -2
  18. package/InputSelect/cjs/index.js.map +1 -1
  19. package/InputSelect/index.js +7 -2
  20. package/InputSelect/index.js.map +1 -1
  21. package/InputSelectDropdown/cjs/index.js +7 -2
  22. package/InputSelectDropdown/cjs/index.js.map +1 -1
  23. package/InputSelectDropdown/index.js +7 -2
  24. package/InputSelectDropdown/index.js.map +1 -1
  25. package/InputTextAreaMobile/cjs/index.js +4 -10
  26. package/InputTextAreaMobile/cjs/index.js.map +1 -1
  27. package/InputTextAreaMobile/index.js +4 -10
  28. package/InputTextAreaMobile/index.js.map +1 -1
  29. package/InputWithController/cjs/index.js +4 -10
  30. package/InputWithController/cjs/index.js.map +1 -1
  31. package/InputWithController/index.js +4 -10
  32. package/InputWithController/index.js.map +1 -1
  33. package/InputWithDatePicker/cjs/index.js +7 -2
  34. package/InputWithDatePicker/cjs/index.js.map +1 -1
  35. package/InputWithDatePicker/index.js +7 -2
  36. package/InputWithDatePicker/index.js.map +1 -1
  37. package/SelectMonth/cjs/index.js +7 -2
  38. package/SelectMonth/cjs/index.js.map +1 -1
  39. package/SelectMonth/index.js +7 -2
  40. package/SelectMonth/index.js.map +1 -1
  41. package/SelectYear/cjs/index.js +7 -2
  42. package/SelectYear/cjs/index.js.map +1 -1
  43. package/SelectYear/index.js +7 -2
  44. package/SelectYear/index.js.map +1 -1
  45. package/TestForm/cjs/index.js +11 -12
  46. package/TestForm/cjs/index.js.map +1 -1
  47. package/TestForm/index.js +11 -12
  48. package/TestForm/index.js.map +1 -1
  49. package/cjs/index.js +11 -12
  50. package/cjs/index.js.map +1 -1
  51. package/index.js +11 -12
  52. package/index.js.map +1 -1
  53. 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
- var scrollContainer = (_a = dropdownRef.current) === null || _a === void 0 ? void 0 : _a.children[0].children[0];
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
- field.onChange(e);
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: getValue(field), inputRef: ref })));
497
+ }, type: type, value: value !== null && value !== void 0 ? value : field.value, inputRef: ref })));
499
498
  } }));
500
499
  });
501
500