kui-complex 0.0.58 → 0.0.60

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 -6
  2. package/ButtonSelect/cjs/index.js.map +1 -1
  3. package/ButtonSelect/index.d.ts +1 -1
  4. package/ButtonSelect/index.js +7 -6
  5. package/ButtonSelect/index.js.map +1 -1
  6. package/CalendarHeaderWithSelect/cjs/index.js +7 -6
  7. package/CalendarHeaderWithSelect/cjs/index.js.map +1 -1
  8. package/CalendarHeaderWithSelect/index.js +7 -6
  9. package/CalendarHeaderWithSelect/index.js.map +1 -1
  10. package/InputDropdown/cjs/index.js +7 -6
  11. package/InputDropdown/cjs/index.js.map +1 -1
  12. package/InputDropdown/index.js +7 -6
  13. package/InputDropdown/index.js.map +1 -1
  14. package/InputPassword/cjs/index.js +10 -3
  15. package/InputPassword/cjs/index.js.map +1 -1
  16. package/InputPassword/index.js +10 -3
  17. package/InputPassword/index.js.map +1 -1
  18. package/InputPhoneWithForm/index.d.ts +1 -1
  19. package/InputSelect/cjs/index.js +7 -6
  20. package/InputSelect/cjs/index.js.map +1 -1
  21. package/InputSelect/index.d.ts +1 -1
  22. package/InputSelect/index.js +7 -6
  23. package/InputSelect/index.js.map +1 -1
  24. package/InputSelectDropdown/cjs/index.js +7 -6
  25. package/InputSelectDropdown/cjs/index.js.map +1 -1
  26. package/InputSelectDropdown/index.js +7 -6
  27. package/InputSelectDropdown/index.js.map +1 -1
  28. package/InputTextAreaMobile/cjs/index.js +10 -3
  29. package/InputTextAreaMobile/cjs/index.js.map +1 -1
  30. package/InputTextAreaMobile/index.js +10 -3
  31. package/InputTextAreaMobile/index.js.map +1 -1
  32. package/InputWithController/cjs/index.js +10 -3
  33. package/InputWithController/cjs/index.js.map +1 -1
  34. package/InputWithController/index.js +10 -3
  35. package/InputWithController/index.js.map +1 -1
  36. package/InputWithDatePicker/cjs/index.js +7 -6
  37. package/InputWithDatePicker/cjs/index.js.map +1 -1
  38. package/InputWithDatePicker/index.d.ts +1 -1
  39. package/InputWithDatePicker/index.js +7 -6
  40. package/InputWithDatePicker/index.js.map +1 -1
  41. package/SelectMonth/cjs/index.js +7 -6
  42. package/SelectMonth/cjs/index.js.map +1 -1
  43. package/SelectMonth/index.d.ts +1 -1
  44. package/SelectMonth/index.js +7 -6
  45. package/SelectMonth/index.js.map +1 -1
  46. package/SelectYear/cjs/index.js +7 -6
  47. package/SelectYear/cjs/index.js.map +1 -1
  48. package/SelectYear/index.d.ts +1 -1
  49. package/SelectYear/index.js +7 -6
  50. package/SelectYear/index.js.map +1 -1
  51. package/TestForm/cjs/index.js +17 -9
  52. package/TestForm/cjs/index.js.map +1 -1
  53. package/TestForm/index.js +17 -9
  54. package/TestForm/index.js.map +1 -1
  55. package/cjs/index.js +19 -11
  56. package/cjs/index.js.map +1 -1
  57. package/index.d.ts +6 -6
  58. package/index.js +19 -11
  59. package/index.js.map +1 -1
  60. package/package.json +1 -1
package/TestForm/index.js CHANGED
@@ -58,7 +58,7 @@ 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
63
  field.onChange(e);
64
64
  if (inputProps.onChange) {
@@ -71,12 +71,19 @@ var InputWithController = forwardRef(function (_a, ref) {
71
71
  ? error
72
72
  : (_a = fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
73
73
  };
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
+ };
74
82
  return (jsx(Controller, { control: form === null || form === void 0 ? void 0 : form.control, name: name, render: function (_a) {
75
- var _b;
76
83
  var field = _a.field, fieldState = _a.fieldState;
77
84
  return (jsx(InputWithAdornments, __assign({ message: getError(fieldState) }, field, inputProps, { onChange: function (e) {
78
85
  return handleChange(e, field);
79
- }, value: typeof value !== "undefined" ? value : (_b = field.value) !== null && _b !== void 0 ? _b : "", inputRef: ref })));
86
+ }, type: type, value: getValue(field), inputRef: ref })));
80
87
  } }));
81
88
  });
82
89
 
@@ -103,7 +110,7 @@ var InputDropdown = forwardRef(function (props, ref) {
103
110
  if (buttonRef === null || buttonRef === void 0 ? void 0 : buttonRef.current) {
104
111
  if (isOpen) {
105
112
  buttonRef.current.style.zIndex = "4";
106
- var scrollContainer = (_a = dropdownRef.current) === null || _a === void 0 ? void 0 : _a.children[0];
113
+ var scrollContainer = (_a = dropdownRef.current) === null || _a === void 0 ? void 0 : _a.children[0].children[0];
107
114
  if (scrollContainer) {
108
115
  var hasScroll = scrollContainer.scrollHeight > scrollContainer.clientHeight;
109
116
  setIsScrollable(hasScroll);
@@ -124,20 +131,21 @@ var InputDropdown = forwardRef(function (props, ref) {
124
131
  ref.current = elem;
125
132
  dropdownRef.current = elem;
126
133
  };
127
- return (jsxs(StyledDropdown$1, __assign({ "data-testid": "input_dropdown", container: true, ref: forwardedRef, isOpen: isOpen, isScrollable: isScrollable }, otherProps, { children: [jsx(ScrollingContainer, __assign({ isScrollable: isScrollable, className: "KUI-InputDropdown_scroll" }, { children: children })), endComponent] })));
134
+ return (jsxs(StyledDropdown$1, __assign({ "data-testid": "input_dropdown", container: true, ref: forwardedRef, isOpen: isOpen }, otherProps, { children: [jsx(StyledWrapper, __assign({ isScrollable: isScrollable }, { children: jsx(ScrollingContainer, __assign({ isScrollable: isScrollable, className: "KUI-InputDropdown_scroll" }, { children: children })) })), endComponent] })));
128
135
  });
129
- var StyledDropdown$1 = styled(Grid)(templateObject_1$d || (templateObject_1$d = __makeTemplateObject(["\n width: 100%;\n display: ", ";\n position: absolute;\n background: ", ";\n z-index: 3;\n top: 50px;\n box-shadow: 0px 26px 34px 0px #0000001a;\n border-radius: 0 0 8px 8px;\n user-select: none;\n padding: ", ";\n"], ["\n width: 100%;\n display: ", ";\n position: absolute;\n background: ", ";\n z-index: 3;\n top: 50px;\n box-shadow: 0px 26px 34px 0px #0000001a;\n border-radius: 0 0 8px 8px;\n user-select: none;\n padding: ", ";\n"])), function (_a) {
136
+ var StyledDropdown$1 = styled(Grid)(templateObject_1$d || (templateObject_1$d = __makeTemplateObject(["\n width: 100%;\n display: ", ";\n position: absolute;\n background: ", ";\n z-index: 3;\n top: 50px;\n box-shadow: 0px 26px 34px 0px #0000001a;\n border-radius: 0 0 8px 8px;\n user-select: none;\n"], ["\n width: 100%;\n display: ", ";\n position: absolute;\n background: ", ";\n z-index: 3;\n top: 50px;\n box-shadow: 0px 26px 34px 0px #0000001a;\n border-radius: 0 0 8px 8px;\n user-select: none;\n"])), function (_a) {
130
137
  var isOpen = _a.isOpen;
131
138
  return (isOpen ? "flex" : "none");
132
- }, theme.palette.grey.zero, function (_a) {
139
+ }, theme.palette.grey.zero);
140
+ var StyledWrapper = styled.div(templateObject_2$7 || (templateObject_2$7 = __makeTemplateObject(["\n width: 100%;\n box-sizing: border-box;\n padding: ", ";\n"], ["\n width: 100%;\n box-sizing: border-box;\n padding: ", ";\n"])), function (_a) {
133
141
  var isScrollable = _a.isScrollable;
134
142
  return isScrollable ? "14px 8px 8px 0" : "14px 0px 8px 0";
135
143
  });
136
- var ScrollingContainer = styled.div(templateObject_2$7 || (templateObject_2$7 = __makeTemplateObject(["\n width: 100%;\n max-height: 389px;\n z-index: 3;\n overflow: auto;\n -ms-overflow-style: none;\n overflow-y: scroll;\n overflow-x: hidden;\n user-select: none;\n ::-webkit-scrollbar {\n width: ", ";\n position: absolute;\n right: 8px;\n }\n ::-webkit-scrollbar-track,\n ::-webkit-scrollbar-thumb {\n border-radius: 4px;\n transition: all ease-out 0.3s;\n }\n\n ::-webkit-resizer,\n ::-webkit-scrollbar-button,\n ::-webkit-scrollbar-corner {\n display: none;\n }\n ::-webkit-scrollbar-track {\n background: ", ";\n }\n\n ::-webkit-scrollbar-thumb {\n background: ", ";\n }\n"], ["\n width: 100%;\n max-height: 389px;\n z-index: 3;\n overflow: auto;\n -ms-overflow-style: none;\n overflow-y: scroll;\n overflow-x: hidden;\n user-select: none;\n ::-webkit-scrollbar {\n width: ", ";\n position: absolute;\n right: 8px;\n }\n ::-webkit-scrollbar-track,\n ::-webkit-scrollbar-thumb {\n border-radius: 4px;\n transition: all ease-out 0.3s;\n }\n\n ::-webkit-resizer,\n ::-webkit-scrollbar-button,\n ::-webkit-scrollbar-corner {\n display: none;\n }\n ::-webkit-scrollbar-track {\n background: ", ";\n }\n\n ::-webkit-scrollbar-thumb {\n background: ", ";\n }\n"])), function (_a) {
144
+ var ScrollingContainer = styled.div(templateObject_3$4 || (templateObject_3$4 = __makeTemplateObject(["\n width: 100%;\n max-height: 389px;\n box-sizing: border-box;\n z-index: 3;\n overflow: auto;\n -ms-overflow-style: none;\n overflow-y: scroll;\n overflow-x: hidden;\n user-select: none;\n ::-webkit-scrollbar {\n width: ", ";\n position: absolute;\n right: 8px;\n }\n ::-webkit-scrollbar-track,\n ::-webkit-scrollbar-thumb {\n border-radius: 4px;\n transition: all ease-out 0.3s;\n }\n\n ::-webkit-resizer,\n ::-webkit-scrollbar-button,\n ::-webkit-scrollbar-corner {\n display: none;\n }\n ::-webkit-scrollbar-track {\n background: ", ";\n }\n\n ::-webkit-scrollbar-thumb {\n background: ", ";\n }\n"], ["\n width: 100%;\n max-height: 389px;\n box-sizing: border-box;\n z-index: 3;\n overflow: auto;\n -ms-overflow-style: none;\n overflow-y: scroll;\n overflow-x: hidden;\n user-select: none;\n ::-webkit-scrollbar {\n width: ", ";\n position: absolute;\n right: 8px;\n }\n ::-webkit-scrollbar-track,\n ::-webkit-scrollbar-thumb {\n border-radius: 4px;\n transition: all ease-out 0.3s;\n }\n\n ::-webkit-resizer,\n ::-webkit-scrollbar-button,\n ::-webkit-scrollbar-corner {\n display: none;\n }\n ::-webkit-scrollbar-track {\n background: ", ";\n }\n\n ::-webkit-scrollbar-thumb {\n background: ", ";\n }\n"])), function (_a) {
137
145
  var isScrollable = _a.isScrollable;
138
146
  return (isScrollable ? "4px" : "0px");
139
147
  }, theme.palette.grey.fifteenB, theme.palette.grey.thirty);
140
- var templateObject_1$d, templateObject_2$7;
148
+ var templateObject_1$d, templateObject_2$7, templateObject_3$4;
141
149
 
142
150
  var InputSelectDropdown = forwardRef(function (_a, ref) {
143
151
  var options = _a.options, inputRef = _a.inputRef, isOpenDropdown = _a.isOpenDropdown, handleCloseDropdown = _a.handleCloseDropdown, handleSelect = _a.handleSelect, selectedValue = _a.selectedValue;