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/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
- var scrollContainer = (_a = dropdownRef.current) === null || _a === void 0 ? void 0 : _a.children[0].children[0];
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]);
@@ -502,9 +507,11 @@ var InputWithMask = React.forwardRef(function (_a, ref) {
502
507
  });
503
508
 
504
509
  var InputWithController = React.forwardRef(function (_a, ref) {
505
- var form = _a.form, name = _a.name, error = _a.error, value = _a.value, inputProps = __rest(_a, ["form", "name", "error", "value"]);
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
- field.onChange(e);
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
  }
@@ -516,11 +523,10 @@ var InputWithController = React.forwardRef(function (_a, ref) {
516
523
  : (_a = fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
517
524
  };
518
525
  return (jsxRuntime.jsx(reactHookForm.Controller, { control: form === null || form === void 0 ? void 0 : form.control, name: name, render: function (_a) {
519
- var _b;
520
526
  var field = _a.field, fieldState = _a.fieldState;
521
527
  return (jsxRuntime.jsx(kuiBasic.InputWithAdornments, __assign({ message: getError(fieldState) }, field, inputProps, { onChange: function (e) {
522
528
  return handleChange(e, field);
523
- }, value: typeof value !== "undefined" ? value : (_b = field.value) !== null && _b !== void 0 ? _b : "", inputRef: ref })));
529
+ }, type: type, value: value !== null && value !== void 0 ? value : field.value, inputRef: ref })));
524
530
  } }));
525
531
  });
526
532