kui-complex 0.0.50 → 0.0.52

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/CalendarStandardContainer/cjs/index.js +1 -1
  2. package/CalendarStandardContainer/cjs/index.js.map +1 -1
  3. package/CalendarStandardContainer/index.js +1 -1
  4. package/CalendarStandardContainer/index.js.map +1 -1
  5. package/DesktopInputWithMonthPicker/cjs/index.js +6 -9
  6. package/DesktopInputWithMonthPicker/cjs/index.js.map +1 -1
  7. package/DesktopInputWithMonthPicker/cjs/package.json +1 -2
  8. package/DesktopInputWithMonthPicker/index.js +7 -9
  9. package/DesktopInputWithMonthPicker/index.js.map +1 -1
  10. package/DesktopInputWithMonthPicker/package.json +1 -2
  11. package/InputForDatepicker/cjs/index.js +5 -8
  12. package/InputForDatepicker/cjs/index.js.map +1 -1
  13. package/InputForDatepicker/cjs/package.json +1 -2
  14. package/InputForDatepicker/index.js +6 -8
  15. package/InputForDatepicker/index.js.map +1 -1
  16. package/InputForDatepicker/package.json +1 -2
  17. package/InputPhoneWithForm/cjs/index.js +53 -17
  18. package/InputPhoneWithForm/cjs/index.js.map +1 -1
  19. package/InputPhoneWithForm/index.js +33 -16
  20. package/InputPhoneWithForm/index.js.map +1 -1
  21. package/InputWithDatePicker/cjs/index.js +76 -42
  22. package/InputWithDatePicker/cjs/index.js.map +1 -1
  23. package/InputWithDatePicker/cjs/package.json +1 -2
  24. package/InputWithDatePicker/index.js +35 -18
  25. package/InputWithDatePicker/index.js.map +1 -1
  26. package/InputWithDatePicker/package.json +1 -2
  27. package/InputWithMask/cjs/index.js +1 -9
  28. package/InputWithMask/cjs/index.js.map +1 -1
  29. package/InputWithMask/index.js +1 -9
  30. package/InputWithMask/index.js.map +1 -1
  31. package/InputWithMonthPicker/cjs/index.js +7 -10
  32. package/InputWithMonthPicker/cjs/index.js.map +1 -1
  33. package/InputWithMonthPicker/cjs/package.json +1 -2
  34. package/InputWithMonthPicker/index.js +8 -10
  35. package/InputWithMonthPicker/index.js.map +1 -1
  36. package/InputWithMonthPicker/package.json +1 -2
  37. package/MobileInputWithMonthPicker/cjs/index.js +6 -9
  38. package/MobileInputWithMonthPicker/cjs/index.js.map +1 -1
  39. package/MobileInputWithMonthPicker/cjs/package.json +1 -2
  40. package/MobileInputWithMonthPicker/index.js +7 -9
  41. package/MobileInputWithMonthPicker/index.js.map +1 -1
  42. package/MobileInputWithMonthPicker/package.json +1 -2
  43. package/TestForm/cjs/index.js +82 -83
  44. package/TestForm/cjs/index.js.map +1 -1
  45. package/TestForm/cjs/package.json +0 -1
  46. package/TestForm/index.js +44 -44
  47. package/TestForm/index.js.map +1 -1
  48. package/TestForm/package.json +0 -1
  49. package/cjs/index.js +42 -44
  50. package/cjs/index.js.map +1 -1
  51. package/index.js +43 -44
  52. package/index.js.map +1 -1
  53. package/package.json +1 -1
package/index.js CHANGED
@@ -6,14 +6,13 @@ import { css, Global } from '@emotion/react';
6
6
  import * as React from 'react';
7
7
  import { forwardRef, useEffect, useRef, useState } from 'react';
8
8
  import { jsx, jsxs as jsxs$1, Fragment as Fragment$1 } from 'react/jsx-runtime';
9
- import { Caption, theme, Button, Container, Grid, InputWithAdornments, Heading, IconButton, InputWithMask as InputWithMask$1, LinearProgress, Divider, Modal, Switch as Switch$1, InputWithCountryDropdown } from 'kui-basic';
9
+ import { Caption, theme, Button, Container, Grid, InputWithAdornments, Heading, InputWithMask as InputWithMask$1, IconButton, LinearProgress, Divider, Modal, Switch as Switch$1, InputWithCountryDropdown } from 'kui-basic';
10
10
  import { useNavigate } from 'react-router-dom';
11
11
  import { DateTime } from 'luxon';
12
12
  import { HalfArrowIcon, PrevArrowIcon, NextArrowIcon, CalendarIcon, ArrowBackIcon, ArrowNextIcon, ClosedEyeIcon, OpenEyeIcon, CheckIcon } from 'kui-icon';
13
13
  import _ from 'lodash';
14
14
  import DatePicker from 'react-datepicker';
15
15
  import { Controller, useController } from 'react-hook-form';
16
- import InputMask from 'react-input-mask';
17
16
  import { scroller, Events, Link, animateScroll, Element } from 'react-scroll';
18
17
  import ru from 'date-fns/locale/ru';
19
18
  import { useLocation } from 'react-router';
@@ -326,7 +325,7 @@ var CalendarStandardContainer = forwardRef(function (_a, ref) {
326
325
  _a.arrowProps; _a.showPopperArrow; var props = __rest(_a, ["arrowProps", "showPopperArrow"]);
327
326
  return jsx(DatePickerContainer, __assign({ ref: ref }, props));
328
327
  });
329
- var DatePickerContainer = styled.div(templateObject_1$m || (templateObject_1$m = __makeTemplateObject(["\n padding: 0;\n border: none !important;\n border-radius: 0 !important;\n background: transparent !important;\n overflow: hidden;\n width: 100%;\n height: 100%;\n .react-datepicker__header {\n background-color: transparent !important;\n }\n .react-datepicker__month-container {\n width: 100%;\n height: 100%;\n }\n .react-datepicker__day-names {\n display: flex;\n justify-content: space-between;\n .react-datepicker__day-name {\n font-family: \"Inter\", sans-serif;\n font-weight: 600;\n font-size: 14px;\n color: ", ";\n text-transform: uppercase;\n margin: 0;\n width: 33px;\n line-height: normal;\n }\n }\n .react-datepicker__month {\n padding: 0;\n margin: 20px 0 0 !important;\n border: none;\n width: 100%;\n height: calc(100% - 85px);\n .react-datepicker__week {\n display: flex;\n justify-content: space-between;\n }\n }\n .react-datepicker__week {\n margin-bottom: 10px;\n &:last-of-type {\n margin-bottom: 0;\n }\n }\n .react-datepicker__day {\n width: 33px;\n height: 33px;\n user-select: none;\n border-radius: 50% !important;\n transition: background ease-out 0.3s;\n border: 1px solid transparent;\n margin: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n font-weight: 500;\n font-size: 16px;\n &:hover {\n background: ", ";\n }\n &:active {\n background: ", ";\n }\n }\n .react-datepicker__day--outside-month,\n .react-datepicker__day--disabled {\n color: #a6aebc;\n p {\n color: #a6aebc;\n }\n }\n .react-datepicker__day--keyboard-selected {\n background: transparent;\n color: inherit;\n }\n .react-datepicker__day--selected {\n background: white;\n border: 1px solid #e1e4e8;\n color: ", ";\n p {\n color: ", ";\n }\n }\n .react-datepicker__day--selected.warning_day {\n border-color: ", ";\n background-color: ", ";\n color: ", ";\n }\n @media (max-width: 600px) {\n .react-datepicker__day {\n max-width: 48px;\n max-height: 48px;\n width: calc((100vw - (18px * 7)) / 7);\n height: calc((100vw - (18px * 7)) / 7);\n }\n .react-datepicker__day-names {\n .react-datepicker__day-name {\n max-width: 48px;\n width: calc((100vw - (18px * 7)) / 7);\n }\n }\n }\n @media (max-width: 350px) {\n .react-datepicker__day {\n width: calc((100vw - (6px * 7)) / 7);\n height: calc((100vw - (6px * 7)) / 7);\n }\n .react-datepicker__day-names {\n .react-datepicker__day-name {\n width: calc((100vw - (6px * 7)) / 7);\n }\n }\n }\n"], ["\n padding: 0;\n border: none !important;\n border-radius: 0 !important;\n background: transparent !important;\n overflow: hidden;\n width: 100%;\n height: 100%;\n .react-datepicker__header {\n background-color: transparent !important;\n }\n .react-datepicker__month-container {\n width: 100%;\n height: 100%;\n }\n .react-datepicker__day-names {\n display: flex;\n justify-content: space-between;\n .react-datepicker__day-name {\n font-family: \"Inter\", sans-serif;\n font-weight: 600;\n font-size: 14px;\n color: ", ";\n text-transform: uppercase;\n margin: 0;\n width: 33px;\n line-height: normal;\n }\n }\n .react-datepicker__month {\n padding: 0;\n margin: 20px 0 0 !important;\n border: none;\n width: 100%;\n height: calc(100% - 85px);\n .react-datepicker__week {\n display: flex;\n justify-content: space-between;\n }\n }\n .react-datepicker__week {\n margin-bottom: 10px;\n &:last-of-type {\n margin-bottom: 0;\n }\n }\n .react-datepicker__day {\n width: 33px;\n height: 33px;\n user-select: none;\n border-radius: 50% !important;\n transition: background ease-out 0.3s;\n border: 1px solid transparent;\n margin: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n font-weight: 500;\n font-size: 16px;\n &:hover {\n background: ", ";\n }\n &:active {\n background: ", ";\n }\n }\n .react-datepicker__day--outside-month,\n .react-datepicker__day--disabled {\n color: #a6aebc;\n p {\n color: #a6aebc;\n }\n }\n .react-datepicker__day--keyboard-selected {\n background: transparent;\n color: inherit;\n }\n .react-datepicker__day--selected {\n background: white;\n border: 1px solid #e1e4e8;\n color: ", ";\n p {\n color: ", ";\n }\n }\n .react-datepicker__day--selected.warning_day {\n border-color: ", ";\n background-color: ", ";\n color: ", ";\n }\n @media (max-width: 600px) {\n .react-datepicker__day {\n max-width: 48px;\n max-height: 48px;\n width: calc((100vw - (18px * 7)) / 7);\n height: calc((100vw - (18px * 7)) / 7);\n }\n .react-datepicker__day-names {\n .react-datepicker__day-name {\n max-width: 48px;\n width: calc((100vw - (18px * 7)) / 7);\n }\n }\n }\n @media (max-width: 350px) {\n .react-datepicker__day {\n width: calc((100vw - (6px * 7)) / 7);\n height: calc((100vw - (6px * 7)) / 7);\n }\n .react-datepicker__day-names {\n .react-datepicker__day-name {\n width: calc((100vw - (6px * 7)) / 7);\n }\n }\n }\n"])), theme.palette.grey.fiftyP, theme.palette.background.light3, theme.palette.background.light3, theme.palette.brand.main, theme.palette.brand.main, theme.palette.grey.fifteenB, theme.palette.red.seventy, theme.palette.grey.zero);
328
+ var DatePickerContainer = styled.div(templateObject_1$m || (templateObject_1$m = __makeTemplateObject(["\n padding: 0;\n border: none !important;\n border-radius: 0 !important;\n background: transparent !important;\n overflow: hidden;\n width: 100%;\n height: 100%;\n .react-datepicker__header {\n background-color: transparent !important;\n }\n .react-datepicker__month-container {\n width: 100%;\n height: 100%;\n }\n .react-datepicker__day-names {\n display: flex;\n justify-content: space-between;\n .react-datepicker__day-name {\n font-family: \"Inter\", sans-serif;\n font-weight: 600;\n font-size: 14px;\n color: ", ";\n text-transform: uppercase;\n margin: 0;\n width: 33px;\n line-height: normal;\n }\n }\n .react-datepicker__month {\n padding: 0;\n margin: 20px 0 0 !important;\n border: none;\n width: 100%;\n height: calc(100% - 85px);\n .react-datepicker__week {\n display: flex;\n justify-content: space-between;\n }\n }\n .react-datepicker__week {\n margin-bottom: 10px;\n &:last-of-type {\n margin-bottom: 0;\n }\n }\n .react-datepicker__day {\n width: 33px;\n height: 33px;\n user-select: none;\n border-radius: 50% !important;\n transition: background ease-out 0.3s;\n border: 1px solid transparent;\n margin: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n font-weight: 500;\n font-size: 16px;\n &:hover {\n background: ", ";\n }\n &:active {\n background: ", ";\n }\n }\n .react-datepicker__day--outside-month,\n .react-datepicker__day--disabled {\n color: #a6aebc;\n p {\n color: #a6aebc;\n }\n }\n .react-datepicker__day--keyboard-selected {\n background: transparent;\n color: inherit;\n }\n .react-datepicker__day--today {\n color: ", ";\n background-color: ", ";\n }\n .react-datepicker__day--selected {\n background: white;\n border: 1px solid #e1e4e8;\n color: ", ";\n p {\n color: ", ";\n }\n }\n .react-datepicker__day--selected.warning_day {\n border-color: ", ";\n background-color: ", ";\n color: ", ";\n }\n @media (max-width: 600px) {\n .react-datepicker__day {\n max-width: 48px;\n max-height: 48px;\n width: calc((100vw - (18px * 7)) / 7);\n height: calc((100vw - (18px * 7)) / 7);\n }\n .react-datepicker__day-names {\n .react-datepicker__day-name {\n max-width: 48px;\n width: calc((100vw - (18px * 7)) / 7);\n }\n }\n }\n @media (max-width: 350px) {\n .react-datepicker__day {\n width: calc((100vw - (6px * 7)) / 7);\n height: calc((100vw - (6px * 7)) / 7);\n }\n .react-datepicker__day-names {\n .react-datepicker__day-name {\n width: calc((100vw - (6px * 7)) / 7);\n }\n }\n }\n"], ["\n padding: 0;\n border: none !important;\n border-radius: 0 !important;\n background: transparent !important;\n overflow: hidden;\n width: 100%;\n height: 100%;\n .react-datepicker__header {\n background-color: transparent !important;\n }\n .react-datepicker__month-container {\n width: 100%;\n height: 100%;\n }\n .react-datepicker__day-names {\n display: flex;\n justify-content: space-between;\n .react-datepicker__day-name {\n font-family: \"Inter\", sans-serif;\n font-weight: 600;\n font-size: 14px;\n color: ", ";\n text-transform: uppercase;\n margin: 0;\n width: 33px;\n line-height: normal;\n }\n }\n .react-datepicker__month {\n padding: 0;\n margin: 20px 0 0 !important;\n border: none;\n width: 100%;\n height: calc(100% - 85px);\n .react-datepicker__week {\n display: flex;\n justify-content: space-between;\n }\n }\n .react-datepicker__week {\n margin-bottom: 10px;\n &:last-of-type {\n margin-bottom: 0;\n }\n }\n .react-datepicker__day {\n width: 33px;\n height: 33px;\n user-select: none;\n border-radius: 50% !important;\n transition: background ease-out 0.3s;\n border: 1px solid transparent;\n margin: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n font-weight: 500;\n font-size: 16px;\n &:hover {\n background: ", ";\n }\n &:active {\n background: ", ";\n }\n }\n .react-datepicker__day--outside-month,\n .react-datepicker__day--disabled {\n color: #a6aebc;\n p {\n color: #a6aebc;\n }\n }\n .react-datepicker__day--keyboard-selected {\n background: transparent;\n color: inherit;\n }\n .react-datepicker__day--today {\n color: ", ";\n background-color: ", ";\n }\n .react-datepicker__day--selected {\n background: white;\n border: 1px solid #e1e4e8;\n color: ", ";\n p {\n color: ", ";\n }\n }\n .react-datepicker__day--selected.warning_day {\n border-color: ", ";\n background-color: ", ";\n color: ", ";\n }\n @media (max-width: 600px) {\n .react-datepicker__day {\n max-width: 48px;\n max-height: 48px;\n width: calc((100vw - (18px * 7)) / 7);\n height: calc((100vw - (18px * 7)) / 7);\n }\n .react-datepicker__day-names {\n .react-datepicker__day-name {\n max-width: 48px;\n width: calc((100vw - (18px * 7)) / 7);\n }\n }\n }\n @media (max-width: 350px) {\n .react-datepicker__day {\n width: calc((100vw - (6px * 7)) / 7);\n height: calc((100vw - (6px * 7)) / 7);\n }\n .react-datepicker__day-names {\n .react-datepicker__day-name {\n width: calc((100vw - (6px * 7)) / 7);\n }\n }\n }\n"])), theme.palette.grey.fiftyP, theme.palette.background.light3, theme.palette.background.light3, theme.palette.brand.main, theme.palette.brand.light, theme.palette.brand.main, theme.palette.brand.main, theme.palette.grey.fifteenB, theme.palette.red.seventy, theme.palette.grey.zero);
330
329
  var templateObject_1$m;
331
330
 
332
331
  var CalendarStandardHeader = forwardRef(function (_a, ref) {
@@ -339,19 +338,18 @@ var StyledHeading = styled(Heading)(templateObject_2$a || (templateObject_2$a =
339
338
  var CircleButtonStyled = styled(Button)(templateObject_3$4 || (templateObject_3$4 = __makeTemplateObject(["\n border-color: transparent !important;\n &:disabled {\n background-color: white !important;\n }\n"], ["\n border-color: transparent !important;\n &:disabled {\n background-color: white !important;\n }\n"])));
340
339
  var templateObject_1$l, templateObject_2$a, templateObject_3$4;
341
340
 
342
- var InputForDatepicker = forwardRef(function (_a, ref) {
343
- var onClick = _a.onClick, onBlur = _a.onBlur, onFocus = _a.onFocus, props = __rest(_a, ["onClick", "onBlur", "onFocus"]);
344
- var onChange = props.onChange, readOnly = props.readOnly, disabled = props.disabled, mask = props.mask, handleCLick = props.handleCLick, startIcon = props.startIcon, other = __rest(props, ["onChange", "readOnly", "disabled", "mask", "handleCLick", "startIcon"]);
341
+ var InputForDatepicker = forwardRef(function (props, ref) {
342
+ var onClick = props.onClick, disabled = props.disabled, handleClick = props.handleClick, startIcon = props.startIcon, other = __rest(props, ["onClick", "disabled", "handleClick", "startIcon"]);
345
343
  var handleIconClick = function () {
346
- if (handleCLick) {
347
- handleCLick();
344
+ if (handleClick) {
345
+ handleClick();
348
346
  }
349
347
  else {
350
348
  onClick();
351
349
  }
352
350
  };
353
351
  var Icon = function () { return (jsx(IconWrapper, __assign({ disabled: disabled, onClick: handleIconClick }, { children: startIcon || jsx(CalendarIcon, { width: 19, height: 21 }) }))); };
354
- return (jsx(InputMask, __assign({ mask: mask, onChange: onChange, value: props.value, maskPlaceholder: null, alwaysShowMask: false, disabled: disabled, readOnly: readOnly, onFocus: onFocus, onBlur: onBlur }, { children: function () { return (jsx(InputWithAdornments, __assign({ onChange: onChange, disabled: disabled, value: props.value, endIcon: !startIcon && jsx(Icon, {}), startIcon: startIcon && jsx(Icon, {}) }, other, { ref: ref }))); } })));
352
+ return (jsx(InputWithMask$1, __assign({ disabled: disabled, endIcon: !startIcon && jsx(Icon, {}), startIcon: startIcon && jsx(Icon, {}) }, other, { ref: ref })));
355
353
  });
356
354
  var IconWrapper = styled.div(templateObject_1$k || (templateObject_1$k = __makeTemplateObject(["\n display: flex;\n align-items: center;\n cursor: pointer;\n z-index: 1;\n"], ["\n display: flex;\n align-items: center;\n cursor: pointer;\n z-index: 1;\n"])));
357
355
  var templateObject_1$k;
@@ -376,7 +374,7 @@ var DesktopInputWithMonthPicker = forwardRef(function (_a, ref) {
376
374
  return (jsx(Wrapper$4, __assign({ ref: ref }, { children: jsx(Controller, { name: name, control: form.control, render: function (_a) {
377
375
  var _b;
378
376
  var field = _a.field, fieldState = _a.fieldState;
379
- return (jsx(DatePicker, __assign({ selected: field.value, onChange: field.onChange, disabled: disabled, customInput: jsx(InputForDatepicker, __assign({ mask: "99.9999", name: name, disabled: disabled, message: (_b = fieldState.error) === null || _b === void 0 ? void 0 : _b.message }, otherProps)), showMonthYearPicker: true, dateFormat: "MM.yyyy", popperPlacement: "bottom-end", calendarContainer: MonthPickerContainer, renderCustomHeader: function (props) { return (jsx(MonthPickerHeader, __assign({}, props))); } }, datePickerProps)));
377
+ return (jsx(DatePicker, __assign({ selected: field.value, onChange: field.onChange, disabled: disabled, customInput: jsx(InputForDatepicker, __assign({ mask: "00.0000", name: name, disabled: disabled, message: (_b = fieldState.error) === null || _b === void 0 ? void 0 : _b.message }, otherProps)), showMonthYearPicker: true, dateFormat: "MM.yyyy", popperPlacement: "bottom-end", calendarContainer: MonthPickerContainer, renderCustomHeader: function (props) { return (jsx(MonthPickerHeader, __assign({}, props))); } }, datePickerProps)));
380
378
  } }) })));
381
379
  });
382
380
  var Wrapper$4 = styled.div(templateObject_1$h || (templateObject_1$h = __makeTemplateObject(["\n @media (max-width: 600px) {\n display: none;\n }\n"], ["\n @media (max-width: 600px) {\n display: none;\n }\n"])));
@@ -434,14 +432,6 @@ var InputWithMask = forwardRef(function (_a, ref) {
434
432
  inputProps.onChange(e);
435
433
  }
436
434
  };
437
- var forwardedRef = function (elem, field) {
438
- if (ref) {
439
- // eslint-disable-next-line no-param-reassign
440
- // @ts-ignore
441
- ref.current = elem;
442
- }
443
- field.ref(elem);
444
- };
445
435
  var getError = function (fieldState) {
446
436
  var _a;
447
437
  return typeof error !== "undefined" && String(error).length > 0
@@ -452,7 +442,7 @@ var InputWithMask = forwardRef(function (_a, ref) {
452
442
  var field = _a.field, fieldState = _a.fieldState;
453
443
  return (jsx(InputWithMask$1, __assign({ message: getError(fieldState) }, field, inputProps, { onChange: function (e) {
454
444
  return handleChange(e, field);
455
- }, value: field.value || "", ref: function (e) { return forwardedRef(e, field); } })));
445
+ }, inputRef: ref })));
456
446
  } }));
457
447
  });
458
448
 
@@ -587,6 +577,31 @@ var ButtonWrapper = styled.div(templateObject_2$5 || (templateObject_2$5 = __mak
587
577
  var ButtonStyled = styled(Button)(templateObject_3$2 || (templateObject_3$2 = __makeTemplateObject(["\n @media (max-width: 600px) {\n width: 100%;\n }\n"], ["\n @media (max-width: 600px) {\n width: 100%;\n }\n"])));
588
578
  var templateObject_1$b, templateObject_2$5, templateObject_3$2;
589
579
 
580
+ function setRef(ref, value) {
581
+ if (typeof ref === "function") {
582
+ ref(value);
583
+ }
584
+ else if (ref) {
585
+ ref.current = value;
586
+ }
587
+ }
588
+ function useForkRef() {
589
+ var refs = [];
590
+ for (var _i = 0; _i < arguments.length; _i++) {
591
+ refs[_i] = arguments[_i];
592
+ }
593
+ return React.useMemo(function () {
594
+ if (refs.every(function (ref) { return ref == null; })) {
595
+ return null;
596
+ }
597
+ return function (instance) {
598
+ refs.forEach(function (ref) {
599
+ setRef(ref, instance);
600
+ });
601
+ };
602
+ }, refs);
603
+ }
604
+
590
605
  var generateYearRange = function (offsetFromCurrent, maxYearCount) {
591
606
  if (!offsetFromCurrent || !maxYearCount)
592
607
  return [];
@@ -654,15 +669,8 @@ var InputWithDatePicker = forwardRef(function (_a, ref) {
654
669
  var handleDateChange = function (newDate) {
655
670
  setDate(newDate);
656
671
  };
657
- var forwardedRef = function (elem) {
658
- if (ref) {
659
- // eslint-disable-next-line no-param-reassign
660
- // @ts-ignore
661
- ref.current = elem;
662
- }
663
- field.ref(elem);
664
- };
665
- return (jsxs(Fragment, { children: [jsx$1(InputForDatepicker, __assign({ mask: "99.99.9999", name: name, handleCLick: handleModalOpen, value: formattedValue || value, onChange: handleChange, disabled: disabled, message: error, ref: forwardedRef }, props)), jsxs(StyledModal, __assign({ title: title, description: description, isOpen: isModalOpen, handleClose: handleModalClose, alignTitle: alignTitle }, { children: [jsx$1(ContentWrapper$1, { children: jsx$1(DatePicker, __assign({ inline: true, selected: date || formattedDate, onChange: handleDateChange, calendarContainer: StyledCalendarStandardContainer, renderCustomHeader: function (headProps) { return (jsx$1(CalendarHeaderWithSelect, __assign({ yearOptions: yearList, max: max, min: min }, headProps))); }, renderDayContents: function (day) { return (jsx$1(DayContent, { children: day })); }, maxDate: max === null || max === void 0 ? void 0 : max.toJSDate(), minDate: min === null || min === void 0 ? void 0 : min.toJSDate() }, datePickerProps)) }), jsx$1(ModalFooter, { fullWidth: true, disabled: !formattedDate && !date, onClick: acceptWithDateSelected, label: footerLabel })] }))] }));
672
+ var forwardedRef = useForkRef(ref, field.ref);
673
+ return (jsxs(Fragment, { children: [jsx$1(InputForDatepicker, __assign({ mask: "00.00.0000", name: name, handleClick: handleModalOpen, value: formattedValue || value, onChange: handleChange, disabled: disabled, message: error, ref: forwardedRef }, props)), jsxs(StyledModal, __assign({ title: title, description: description, isOpen: isModalOpen, handleClose: handleModalClose, alignTitle: alignTitle }, { children: [jsx$1(ContentWrapper$1, { children: jsx$1(DatePicker, __assign({ inline: true, selected: date || formattedDate, onChange: handleDateChange, calendarContainer: StyledCalendarStandardContainer, renderCustomHeader: function (headProps) { return (jsx$1(CalendarHeaderWithSelect, __assign({ yearOptions: yearList, max: max, min: min }, headProps))); }, renderDayContents: function (day) { return (jsx$1(DayContent, { children: day })); }, maxDate: max === null || max === void 0 ? void 0 : max.toJSDate(), minDate: min === null || min === void 0 ? void 0 : min.toJSDate() }, datePickerProps)) }), jsx$1(ModalFooter, { fullWidth: true, disabled: !formattedDate && !date, onClick: acceptWithDateSelected, label: footerLabel })] }))] }));
666
674
  });
667
675
  InputWithDatePicker.defaultProps = {
668
676
  title: "Дата рождения",
@@ -739,7 +747,7 @@ var MobileInputWithMonthPicker = forwardRef(function (_a, ref) {
739
747
  field === null || field === void 0 ? void 0 : field.onChange({ target: { value: date, name: name }, type: "change" });
740
748
  handleModalClose();
741
749
  };
742
- return (jsxs$1(Wrapper$1, __assign({ ref: ref }, { children: [jsx(InputForDatepicker, __assign({ mask: "99.9999", name: name, handleCLick: handleModalOpen, value: value, onChange: handleChange, disabled: disabled, message: error, isLabelShrink: Boolean(field.value) }, props)), jsxs$1(Modal, __assign({ title: title, isOpen: isModalOpen, handleClose: handleModalClose }, { children: [jsx(ContentWrapper, { children: jsx(DatePicker, __assign({ inline: true, showMonthYearPicker: true, dateFormat: "MM.yyyy", selected: date, onChange: function (newDate) { return setDate(newDate); }, locale: ruCustom, calendarContainer: MonthPickerContainer, renderCustomHeader: function (headProps) { return (jsx(MonthPickerHeader, __assign({}, headProps))); } }, datePickerProps)) }), jsx(ModalFooter, { fullWidth: true, disabled: !date, onClick: acceptWithDateSelected, label: "\u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044C" })] }))] })));
750
+ return (jsxs$1(Wrapper$1, __assign({ ref: ref }, { children: [jsx(InputForDatepicker, __assign({ mask: "00.0000", name: name, handleCLick: handleModalOpen, value: value, onChange: handleChange, disabled: disabled, message: error, isLabelShrink: Boolean(field.value) }, props)), jsxs$1(Modal, __assign({ title: title, isOpen: isModalOpen, handleClose: handleModalClose }, { children: [jsx(ContentWrapper, { children: jsx(DatePicker, __assign({ inline: true, showMonthYearPicker: true, dateFormat: "MM.yyyy", selected: date, onChange: function (newDate) { return setDate(newDate); }, locale: ruCustom, calendarContainer: MonthPickerContainer, renderCustomHeader: function (headProps) { return (jsx(MonthPickerHeader, __assign({}, headProps))); } }, datePickerProps)) }), jsx(ModalFooter, { fullWidth: true, disabled: !date, onClick: acceptWithDateSelected, label: "\u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044C" })] }))] })));
743
751
  });
744
752
  var Wrapper$1 = styled.div(templateObject_1$9 || (templateObject_1$9 = __makeTemplateObject(["\n @media (min-width: 601px) {\n display: none;\n }\n"], ["\n @media (min-width: 601px) {\n display: none;\n }\n"])));
745
753
  var ContentWrapper = styled.div(templateObject_2$3 || (templateObject_2$3 = __makeTemplateObject(["\n @media (max-width: 600px) {\n padding: 16px 16px 8px;\n }\n"], ["\n @media (max-width: 600px) {\n padding: 16px 16px 8px;\n }\n"])));
@@ -845,29 +853,20 @@ var InputPhoneWithForm = forwardRef(function (props, ref) {
845
853
  };
846
854
  var handleChange = function (e) {
847
855
  phoneRegister.field.onChange(e);
848
- if (other.onChange) {
849
- other.onChange(e);
850
- }
851
- };
852
- var forwardedRef = function (elem) {
853
- if (ref) {
854
- // eslint-disable-next-line no-param-reassign
855
- // @ts-ignore
856
- ref.current = elem;
857
- }
858
- phoneRegister.field.ref(elem);
859
- };
860
- useEffect(function () {
861
856
  if (!codeRegister.field.value) {
862
857
  codeRegister.field.onChange({
863
858
  target: { value: "7", name: "".concat(name, ".phoneCode") },
864
859
  type: "change",
865
860
  });
866
861
  }
867
- }, []);
862
+ if (other.onChange) {
863
+ other.onChange(e);
864
+ }
865
+ };
866
+ var forwardedRef = useForkRef(ref, phoneRegister.field.ref);
868
867
  return (jsx(InputWithCountryDropdown, __assign({ message: errorMessage,
869
868
  // @ts-ignore
870
- hiddenInputProps: __assign(__assign(__assign({}, codeRegister.field), hiddenInputProps), { value: codeRegister.field.value || "7" }), onSelectCountry: handleCountryChange }, phoneRegister.field, other, { onChange: handleChange, ref: forwardedRef, autoComplete: "false" })));
869
+ hiddenInputProps: __assign(__assign({}, codeRegister.field), hiddenInputProps), onSelectCountry: handleCountryChange }, phoneRegister.field, other, { onChange: handleChange, ref: forwardedRef, autoComplete: "false" })));
871
870
  });
872
871
  InputPhoneWithForm.defaultProps = {
873
872
  name: "phone",