kui-complex 0.0.59 → 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 (60) hide show
  1. package/ButtonSelect/cjs/index.js +7 -2
  2. package/ButtonSelect/cjs/index.js.map +1 -1
  3. package/ButtonSelect/index.d.ts +1 -1
  4. package/ButtonSelect/index.js +7 -2
  5. package/ButtonSelect/index.js.map +1 -1
  6. package/CalendarHeaderWithSelect/cjs/index.js +7 -2
  7. package/CalendarHeaderWithSelect/cjs/index.js.map +1 -1
  8. package/CalendarHeaderWithSelect/index.js +7 -2
  9. package/CalendarHeaderWithSelect/index.js.map +1 -1
  10. package/InputDropdown/cjs/index.js +7 -2
  11. package/InputDropdown/cjs/index.js.map +1 -1
  12. package/InputDropdown/index.js +7 -2
  13. package/InputDropdown/index.js.map +1 -1
  14. package/InputPassword/cjs/index.js +5 -4
  15. package/InputPassword/cjs/index.js.map +1 -1
  16. package/InputPassword/index.js +5 -4
  17. package/InputPassword/index.js.map +1 -1
  18. package/InputPhoneWithForm/index.d.ts +1 -1
  19. package/InputSelect/cjs/index.js +7 -2
  20. package/InputSelect/cjs/index.js.map +1 -1
  21. package/InputSelect/index.d.ts +1 -1
  22. package/InputSelect/index.js +7 -2
  23. package/InputSelect/index.js.map +1 -1
  24. package/InputSelectDropdown/cjs/index.js +7 -2
  25. package/InputSelectDropdown/cjs/index.js.map +1 -1
  26. package/InputSelectDropdown/index.js +7 -2
  27. package/InputSelectDropdown/index.js.map +1 -1
  28. package/InputTextAreaMobile/cjs/index.js +5 -4
  29. package/InputTextAreaMobile/cjs/index.js.map +1 -1
  30. package/InputTextAreaMobile/index.js +5 -4
  31. package/InputTextAreaMobile/index.js.map +1 -1
  32. package/InputWithController/cjs/index.js +5 -4
  33. package/InputWithController/cjs/index.js.map +1 -1
  34. package/InputWithController/index.js +5 -4
  35. package/InputWithController/index.js.map +1 -1
  36. package/InputWithDatePicker/cjs/index.js +7 -2
  37. package/InputWithDatePicker/cjs/index.js.map +1 -1
  38. package/InputWithDatePicker/index.d.ts +1 -1
  39. package/InputWithDatePicker/index.js +7 -2
  40. package/InputWithDatePicker/index.js.map +1 -1
  41. package/SelectMonth/cjs/index.js +7 -2
  42. package/SelectMonth/cjs/index.js.map +1 -1
  43. package/SelectMonth/index.d.ts +1 -1
  44. package/SelectMonth/index.js +7 -2
  45. package/SelectMonth/index.js.map +1 -1
  46. package/SelectYear/cjs/index.js +7 -2
  47. package/SelectYear/cjs/index.js.map +1 -1
  48. package/SelectYear/index.d.ts +1 -1
  49. package/SelectYear/index.js +7 -2
  50. package/SelectYear/index.js.map +1 -1
  51. package/TestForm/cjs/index.js +12 -6
  52. package/TestForm/cjs/index.js.map +1 -1
  53. package/TestForm/index.js +12 -6
  54. package/TestForm/index.js.map +1 -1
  55. package/cjs/index.js +12 -6
  56. package/cjs/index.js.map +1 -1
  57. package/index.d.ts +6 -6
  58. package/index.js +12 -6
  59. package/index.js.map +1 -1
  60. package/package.json +1 -1
package/TestForm/index.js CHANGED
@@ -58,9 +58,11 @@ function __makeTemplateObject(cooked, raw) {
58
58
  }
59
59
 
60
60
  var InputWithController = forwardRef(function (_a, ref) {
61
- var form = _a.form, name = _a.name, error = _a.error, value = _a.value, inputProps = __rest(_a, ["form", "name", "error", "value"]);
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
  }
@@ -72,11 +74,10 @@ var InputWithController = forwardRef(function (_a, ref) {
72
74
  : (_a = fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
73
75
  };
74
76
  return (jsx(Controller, { control: form === null || form === void 0 ? void 0 : form.control, name: name, render: function (_a) {
75
- var _b;
76
77
  var field = _a.field, fieldState = _a.fieldState;
77
78
  return (jsx(InputWithAdornments, __assign({ message: getError(fieldState) }, field, inputProps, { onChange: function (e) {
78
79
  return handleChange(e, field);
79
- }, value: typeof value !== "undefined" ? value : (_b = field.value) !== null && _b !== void 0 ? _b : "", inputRef: ref })));
80
+ }, type: type, value: value !== null && value !== void 0 ? value : field.value, inputRef: ref })));
80
81
  } }));
81
82
  });
82
83
 
@@ -99,11 +100,14 @@ var InputDropdown = forwardRef(function (props, ref) {
99
100
  };
100
101
  });
101
102
  useEffect(function () {
102
- var _a;
103
+ var _a, _b;
103
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");
104
106
  if (isOpen) {
105
107
  buttonRef.current.style.zIndex = "4";
106
- 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];
107
111
  if (scrollContainer) {
108
112
  var hasScroll = scrollContainer.scrollHeight > scrollContainer.clientHeight;
109
113
  setIsScrollable(hasScroll);
@@ -111,6 +115,8 @@ var InputDropdown = forwardRef(function (props, ref) {
111
115
  }
112
116
  else {
113
117
  buttonRef.current.style.zIndex = "1";
118
+ if (inputMessage)
119
+ inputMessage.style.opacity = "1";
114
120
  }
115
121
  }
116
122
  }, [isOpen]);