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/cjs/index.js CHANGED
@@ -118,7 +118,7 @@ var Wrapper$7 = styled__default["default"].div(templateObject_1$t || (templateOb
118
118
  var StyledImage = styled__default["default"].img(templateObject_2$g || (templateObject_2$g = __makeTemplateObject(["\n width: 100%;\n height: 100%;\n border-radius: 50%;\n object-fit: cover;\n"], ["\n width: 100%;\n height: 100%;\n border-radius: 50%;\n object-fit: cover;\n"])));
119
119
  var largeAvatarCSS = function (_a) {
120
120
  var avatarSize = _a.avatarSize;
121
- return avatarSize === "lg" && react.css(templateObject_3$6 || (templateObject_3$6 = __makeTemplateObject(["\n font-size: 32px;\n "], ["\n font-size: 32px;\n "])));
121
+ return avatarSize === "lg" && react.css(templateObject_3$7 || (templateObject_3$7 = __makeTemplateObject(["\n font-size: 32px;\n "], ["\n font-size: 32px;\n "])));
122
122
  };
123
123
  var StyledUndefinedAvatar = styled__default["default"](UndefinedAvatar, {
124
124
  shouldForwardProp: function (prop) { return prop !== "size"; },
@@ -127,7 +127,7 @@ var sizeStyles = {
127
127
  s: react.css(templateObject_5$1 || (templateObject_5$1 = __makeTemplateObject(["\n width: 40px;\n height: 40px;\n @media (max-width: 600px) {\n width: 32px;\n height: 32px;\n }\n "], ["\n width: 40px;\n height: 40px;\n @media (max-width: 600px) {\n width: 32px;\n height: 32px;\n }\n "]))),
128
128
  lg: react.css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n width: 80px;\n height: 80px;\n "], ["\n width: 80px;\n height: 80px;\n "]))),
129
129
  };
130
- var templateObject_1$t, templateObject_2$g, templateObject_3$6, templateObject_4$4, templateObject_5$1, templateObject_6;
130
+ var templateObject_1$t, templateObject_2$g, templateObject_3$7, templateObject_4$4, templateObject_5$1, templateObject_6;
131
131
 
132
132
  var ButtonTab = React.forwardRef(function (_a, ref) {
133
133
  var index = _a.index, onClick = _a.onClick, isActive = _a.isActive, label = _a.label;
@@ -188,7 +188,7 @@ var InputDropdown = React.forwardRef(function (props, ref) {
188
188
  if (buttonRef === null || buttonRef === void 0 ? void 0 : buttonRef.current) {
189
189
  if (isOpen) {
190
190
  buttonRef.current.style.zIndex = "4";
191
- var scrollContainer = (_a = dropdownRef.current) === null || _a === void 0 ? void 0 : _a.children[0];
191
+ var scrollContainer = (_a = dropdownRef.current) === null || _a === void 0 ? void 0 : _a.children[0].children[0];
192
192
  if (scrollContainer) {
193
193
  var hasScroll = scrollContainer.scrollHeight > scrollContainer.clientHeight;
194
194
  setIsScrollable(hasScroll);
@@ -209,20 +209,21 @@ var InputDropdown = React.forwardRef(function (props, ref) {
209
209
  ref.current = elem;
210
210
  dropdownRef.current = elem;
211
211
  };
212
- return (jsxRuntime.jsxs(StyledDropdown$1, __assign({ "data-testid": "input_dropdown", container: true, ref: forwardedRef, isOpen: isOpen, isScrollable: isScrollable }, otherProps, { children: [jsxRuntime.jsx(ScrollingContainer, __assign({ isScrollable: isScrollable, className: "KUI-InputDropdown_scroll" }, { children: children })), endComponent] })));
212
+ return (jsxRuntime.jsxs(StyledDropdown$1, __assign({ "data-testid": "input_dropdown", container: true, ref: forwardedRef, isOpen: isOpen }, otherProps, { children: [jsxRuntime.jsx(StyledWrapper$1, __assign({ isScrollable: isScrollable }, { children: jsxRuntime.jsx(ScrollingContainer, __assign({ isScrollable: isScrollable, className: "KUI-InputDropdown_scroll" }, { children: children })) })), endComponent] })));
213
213
  });
214
- var StyledDropdown$1 = styled__default["default"](kuiBasic.Grid)(templateObject_1$q || (templateObject_1$q = __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) {
214
+ var StyledDropdown$1 = styled__default["default"](kuiBasic.Grid)(templateObject_1$q || (templateObject_1$q = __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) {
215
215
  var isOpen = _a.isOpen;
216
216
  return (isOpen ? "flex" : "none");
217
- }, kuiBasic.theme.palette.grey.zero, function (_a) {
217
+ }, kuiBasic.theme.palette.grey.zero);
218
+ var StyledWrapper$1 = styled__default["default"].div(templateObject_2$d || (templateObject_2$d = __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) {
218
219
  var isScrollable = _a.isScrollable;
219
220
  return isScrollable ? "14px 8px 8px 0" : "14px 0px 8px 0";
220
221
  });
221
- var ScrollingContainer = styled__default["default"].div(templateObject_2$d || (templateObject_2$d = __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) {
222
+ var ScrollingContainer = styled__default["default"].div(templateObject_3$6 || (templateObject_3$6 = __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) {
222
223
  var isScrollable = _a.isScrollable;
223
224
  return (isScrollable ? "4px" : "0px");
224
225
  }, kuiBasic.theme.palette.grey.fifteenB, kuiBasic.theme.palette.grey.thirty);
225
- var templateObject_1$q, templateObject_2$d;
226
+ var templateObject_1$q, templateObject_2$d, templateObject_3$6;
226
227
 
227
228
  var InputSelectDropdown = React.forwardRef(function (_a, ref) {
228
229
  var options = _a.options, inputRef = _a.inputRef, isOpenDropdown = _a.isOpenDropdown, handleCloseDropdown = _a.handleCloseDropdown, handleSelect = _a.handleSelect, selectedValue = _a.selectedValue;
@@ -501,7 +502,7 @@ var InputWithMask = React.forwardRef(function (_a, ref) {
501
502
  });
502
503
 
503
504
  var InputWithController = React.forwardRef(function (_a, ref) {
504
- var form = _a.form, name = _a.name, error = _a.error, value = _a.value, inputProps = __rest(_a, ["form", "name", "error", "value"]);
505
+ var form = _a.form, name = _a.name, error = _a.error, value = _a.value, type = _a.type, inputProps = __rest(_a, ["form", "name", "error", "value", "type"]);
505
506
  var handleChange = function (e, field) {
506
507
  field.onChange(e);
507
508
  if (inputProps.onChange) {
@@ -514,12 +515,19 @@ var InputWithController = React.forwardRef(function (_a, ref) {
514
515
  ? error
515
516
  : (_a = fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
516
517
  };
518
+ var getValue = function (field) {
519
+ if (typeof value === "undefined") {
520
+ if (typeof field.value !== "undefined")
521
+ return field.value;
522
+ return type === "number" ? null : "";
523
+ }
524
+ return value;
525
+ };
517
526
  return (jsxRuntime.jsx(reactHookForm.Controller, { control: form === null || form === void 0 ? void 0 : form.control, name: name, render: function (_a) {
518
- var _b;
519
527
  var field = _a.field, fieldState = _a.fieldState;
520
528
  return (jsxRuntime.jsx(kuiBasic.InputWithAdornments, __assign({ message: getError(fieldState) }, field, inputProps, { onChange: function (e) {
521
529
  return handleChange(e, field);
522
- }, value: typeof value !== "undefined" ? value : (_b = field.value) !== null && _b !== void 0 ? _b : "", inputRef: ref })));
530
+ }, type: type, value: getValue(field), inputRef: ref })));
523
531
  } }));
524
532
  });
525
533