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/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
- field.onChange(e);
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: getValue(field), inputRef: ref })));
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
- var scrollContainer = (_a = dropdownRef.current) === null || _a === void 0 ? void 0 : _a.children[0].children[0];
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]);