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.
- package/CalendarStandardContainer/cjs/index.js +1 -1
- package/CalendarStandardContainer/cjs/index.js.map +1 -1
- package/CalendarStandardContainer/index.js +1 -1
- package/CalendarStandardContainer/index.js.map +1 -1
- package/DesktopInputWithMonthPicker/cjs/index.js +6 -9
- package/DesktopInputWithMonthPicker/cjs/index.js.map +1 -1
- package/DesktopInputWithMonthPicker/cjs/package.json +1 -2
- package/DesktopInputWithMonthPicker/index.js +7 -9
- package/DesktopInputWithMonthPicker/index.js.map +1 -1
- package/DesktopInputWithMonthPicker/package.json +1 -2
- package/InputForDatepicker/cjs/index.js +5 -8
- package/InputForDatepicker/cjs/index.js.map +1 -1
- package/InputForDatepicker/cjs/package.json +1 -2
- package/InputForDatepicker/index.js +6 -8
- package/InputForDatepicker/index.js.map +1 -1
- package/InputForDatepicker/package.json +1 -2
- package/InputPhoneWithForm/cjs/index.js +53 -17
- package/InputPhoneWithForm/cjs/index.js.map +1 -1
- package/InputPhoneWithForm/index.js +33 -16
- package/InputPhoneWithForm/index.js.map +1 -1
- package/InputWithDatePicker/cjs/index.js +76 -42
- package/InputWithDatePicker/cjs/index.js.map +1 -1
- package/InputWithDatePicker/cjs/package.json +1 -2
- package/InputWithDatePicker/index.js +35 -18
- package/InputWithDatePicker/index.js.map +1 -1
- package/InputWithDatePicker/package.json +1 -2
- package/InputWithMask/cjs/index.js +1 -9
- package/InputWithMask/cjs/index.js.map +1 -1
- package/InputWithMask/index.js +1 -9
- package/InputWithMask/index.js.map +1 -1
- package/InputWithMonthPicker/cjs/index.js +7 -10
- package/InputWithMonthPicker/cjs/index.js.map +1 -1
- package/InputWithMonthPicker/cjs/package.json +1 -2
- package/InputWithMonthPicker/index.js +8 -10
- package/InputWithMonthPicker/index.js.map +1 -1
- package/InputWithMonthPicker/package.json +1 -2
- package/MobileInputWithMonthPicker/cjs/index.js +6 -9
- package/MobileInputWithMonthPicker/cjs/index.js.map +1 -1
- package/MobileInputWithMonthPicker/cjs/package.json +1 -2
- package/MobileInputWithMonthPicker/index.js +7 -9
- package/MobileInputWithMonthPicker/index.js.map +1 -1
- package/MobileInputWithMonthPicker/package.json +1 -2
- package/TestForm/cjs/index.js +82 -83
- package/TestForm/cjs/index.js.map +1 -1
- package/TestForm/cjs/package.json +0 -1
- package/TestForm/index.js +44 -44
- package/TestForm/index.js.map +1 -1
- package/TestForm/package.json +0 -1
- package/cjs/index.js +42 -44
- package/cjs/index.js.map +1 -1
- package/index.js +43 -44
- package/index.js.map +1 -1
- package/package.json +1 -1
package/cjs/index.js
CHANGED
|
@@ -16,7 +16,6 @@ var kuiIcon = require('kui-icon');
|
|
|
16
16
|
var _ = require('lodash');
|
|
17
17
|
var DatePicker = require('react-datepicker');
|
|
18
18
|
var reactHookForm = require('react-hook-form');
|
|
19
|
-
var InputMask = require('react-input-mask');
|
|
20
19
|
var reactScroll = require('react-scroll');
|
|
21
20
|
var ru = require('date-fns/locale/ru');
|
|
22
21
|
var reactRouter = require('react-router');
|
|
@@ -48,7 +47,6 @@ var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
|
48
47
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
49
48
|
var ___default = /*#__PURE__*/_interopDefaultLegacy(_);
|
|
50
49
|
var DatePicker__default = /*#__PURE__*/_interopDefaultLegacy(DatePicker);
|
|
51
|
-
var InputMask__default = /*#__PURE__*/_interopDefaultLegacy(InputMask);
|
|
52
50
|
var ru__default = /*#__PURE__*/_interopDefaultLegacy(ru);
|
|
53
51
|
var Swiper__default = /*#__PURE__*/_interopDefaultLegacy(Swiper);
|
|
54
52
|
var ReactDOM__namespace = /*#__PURE__*/_interopNamespace(ReactDOM);
|
|
@@ -359,7 +357,7 @@ var CalendarStandardContainer = React.forwardRef(function (_a, ref) {
|
|
|
359
357
|
_a.arrowProps; _a.showPopperArrow; var props = __rest(_a, ["arrowProps", "showPopperArrow"]);
|
|
360
358
|
return jsxRuntime.jsx(DatePickerContainer, __assign({ ref: ref }, props));
|
|
361
359
|
});
|
|
362
|
-
var DatePickerContainer = styled__default["default"].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"])), kuiBasic.theme.palette.grey.fiftyP, kuiBasic.theme.palette.background.light3, kuiBasic.theme.palette.background.light3, kuiBasic.theme.palette.brand.main, kuiBasic.theme.palette.brand.main, kuiBasic.theme.palette.grey.fifteenB, kuiBasic.theme.palette.red.seventy, kuiBasic.theme.palette.grey.zero);
|
|
360
|
+
var DatePickerContainer = styled__default["default"].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"])), kuiBasic.theme.palette.grey.fiftyP, kuiBasic.theme.palette.background.light3, kuiBasic.theme.palette.background.light3, kuiBasic.theme.palette.brand.main, kuiBasic.theme.palette.brand.light, kuiBasic.theme.palette.brand.main, kuiBasic.theme.palette.brand.main, kuiBasic.theme.palette.grey.fifteenB, kuiBasic.theme.palette.red.seventy, kuiBasic.theme.palette.grey.zero);
|
|
363
361
|
var templateObject_1$m;
|
|
364
362
|
|
|
365
363
|
var CalendarStandardHeader = React.forwardRef(function (_a, ref) {
|
|
@@ -372,19 +370,18 @@ var StyledHeading = styled__default["default"](kuiBasic.Heading)(templateObject_
|
|
|
372
370
|
var CircleButtonStyled = styled__default["default"](kuiBasic.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"])));
|
|
373
371
|
var templateObject_1$l, templateObject_2$a, templateObject_3$4;
|
|
374
372
|
|
|
375
|
-
var InputForDatepicker = React.forwardRef(function (
|
|
376
|
-
var onClick =
|
|
377
|
-
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"]);
|
|
373
|
+
var InputForDatepicker = React.forwardRef(function (props, ref) {
|
|
374
|
+
var onClick = props.onClick, disabled = props.disabled, handleClick = props.handleClick, startIcon = props.startIcon, other = __rest(props, ["onClick", "disabled", "handleClick", "startIcon"]);
|
|
378
375
|
var handleIconClick = function () {
|
|
379
|
-
if (
|
|
380
|
-
|
|
376
|
+
if (handleClick) {
|
|
377
|
+
handleClick();
|
|
381
378
|
}
|
|
382
379
|
else {
|
|
383
380
|
onClick();
|
|
384
381
|
}
|
|
385
382
|
};
|
|
386
383
|
var Icon = function () { return (jsxRuntime.jsx(IconWrapper, __assign({ disabled: disabled, onClick: handleIconClick }, { children: startIcon || jsxRuntime.jsx(kuiIcon.CalendarIcon, { width: 19, height: 21 }) }))); };
|
|
387
|
-
return (jsxRuntime.jsx(
|
|
384
|
+
return (jsxRuntime.jsx(kuiBasic.InputWithMask, __assign({ disabled: disabled, endIcon: !startIcon && jsxRuntime.jsx(Icon, {}), startIcon: startIcon && jsxRuntime.jsx(Icon, {}) }, other, { ref: ref })));
|
|
388
385
|
});
|
|
389
386
|
var IconWrapper = styled__default["default"].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"])));
|
|
390
387
|
var templateObject_1$k;
|
|
@@ -409,7 +406,7 @@ var DesktopInputWithMonthPicker = React.forwardRef(function (_a, ref) {
|
|
|
409
406
|
return (jsxRuntime.jsx(Wrapper$4, __assign({ ref: ref }, { children: jsxRuntime.jsx(reactHookForm.Controller, { name: name, control: form.control, render: function (_a) {
|
|
410
407
|
var _b;
|
|
411
408
|
var field = _a.field, fieldState = _a.fieldState;
|
|
412
|
-
return (jsxRuntime.jsx(DatePicker__default["default"], __assign({ selected: field.value, onChange: field.onChange, disabled: disabled, customInput: jsxRuntime.jsx(InputForDatepicker, __assign({ mask: "
|
|
409
|
+
return (jsxRuntime.jsx(DatePicker__default["default"], __assign({ selected: field.value, onChange: field.onChange, disabled: disabled, customInput: jsxRuntime.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 (jsxRuntime.jsx(MonthPickerHeader, __assign({}, props))); } }, datePickerProps)));
|
|
413
410
|
} }) })));
|
|
414
411
|
});
|
|
415
412
|
var Wrapper$4 = styled__default["default"].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"])));
|
|
@@ -467,14 +464,6 @@ var InputWithMask = React.forwardRef(function (_a, ref) {
|
|
|
467
464
|
inputProps.onChange(e);
|
|
468
465
|
}
|
|
469
466
|
};
|
|
470
|
-
var forwardedRef = function (elem, field) {
|
|
471
|
-
if (ref) {
|
|
472
|
-
// eslint-disable-next-line no-param-reassign
|
|
473
|
-
// @ts-ignore
|
|
474
|
-
ref.current = elem;
|
|
475
|
-
}
|
|
476
|
-
field.ref(elem);
|
|
477
|
-
};
|
|
478
467
|
var getError = function (fieldState) {
|
|
479
468
|
var _a;
|
|
480
469
|
return typeof error !== "undefined" && String(error).length > 0
|
|
@@ -485,7 +474,7 @@ var InputWithMask = React.forwardRef(function (_a, ref) {
|
|
|
485
474
|
var field = _a.field, fieldState = _a.fieldState;
|
|
486
475
|
return (jsxRuntime.jsx(kuiBasic.InputWithMask, __assign({ message: getError(fieldState) }, field, inputProps, { onChange: function (e) {
|
|
487
476
|
return handleChange(e, field);
|
|
488
|
-
},
|
|
477
|
+
}, inputRef: ref })));
|
|
489
478
|
} }));
|
|
490
479
|
});
|
|
491
480
|
|
|
@@ -620,6 +609,31 @@ var ButtonWrapper = styled__default["default"].div(templateObject_2$5 || (templa
|
|
|
620
609
|
var ButtonStyled = styled__default["default"](kuiBasic.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"])));
|
|
621
610
|
var templateObject_1$b, templateObject_2$5, templateObject_3$2;
|
|
622
611
|
|
|
612
|
+
function setRef(ref, value) {
|
|
613
|
+
if (typeof ref === "function") {
|
|
614
|
+
ref(value);
|
|
615
|
+
}
|
|
616
|
+
else if (ref) {
|
|
617
|
+
ref.current = value;
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
function useForkRef() {
|
|
621
|
+
var refs = [];
|
|
622
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
623
|
+
refs[_i] = arguments[_i];
|
|
624
|
+
}
|
|
625
|
+
return React__namespace.useMemo(function () {
|
|
626
|
+
if (refs.every(function (ref) { return ref == null; })) {
|
|
627
|
+
return null;
|
|
628
|
+
}
|
|
629
|
+
return function (instance) {
|
|
630
|
+
refs.forEach(function (ref) {
|
|
631
|
+
setRef(ref, instance);
|
|
632
|
+
});
|
|
633
|
+
};
|
|
634
|
+
}, refs);
|
|
635
|
+
}
|
|
636
|
+
|
|
623
637
|
var generateYearRange = function (offsetFromCurrent, maxYearCount) {
|
|
624
638
|
if (!offsetFromCurrent || !maxYearCount)
|
|
625
639
|
return [];
|
|
@@ -687,15 +701,8 @@ var InputWithDatePicker = React.forwardRef(function (_a, ref) {
|
|
|
687
701
|
var handleDateChange = function (newDate) {
|
|
688
702
|
setDate(newDate);
|
|
689
703
|
};
|
|
690
|
-
var forwardedRef =
|
|
691
|
-
|
|
692
|
-
// eslint-disable-next-line no-param-reassign
|
|
693
|
-
// @ts-ignore
|
|
694
|
-
ref.current = elem;
|
|
695
|
-
}
|
|
696
|
-
field.ref(elem);
|
|
697
|
-
};
|
|
698
|
-
return (jsxRuntime$1.jsxs(jsxRuntime$1.Fragment, { children: [jsxRuntime$1.jsx(InputForDatepicker, __assign({ mask: "99.99.9999", name: name, handleCLick: handleModalOpen, value: formattedValue || value, onChange: handleChange, disabled: disabled, message: error, ref: forwardedRef }, props)), jsxRuntime$1.jsxs(StyledModal, __assign({ title: title, description: description, isOpen: isModalOpen, handleClose: handleModalClose, alignTitle: alignTitle }, { children: [jsxRuntime$1.jsx(ContentWrapper$1, { children: jsxRuntime$1.jsx(DatePicker__default["default"], __assign({ inline: true, selected: date || formattedDate, onChange: handleDateChange, calendarContainer: StyledCalendarStandardContainer, renderCustomHeader: function (headProps) { return (jsxRuntime$1.jsx(CalendarHeaderWithSelect, __assign({ yearOptions: yearList, max: max, min: min }, headProps))); }, renderDayContents: function (day) { return (jsxRuntime$1.jsx(DayContent, { children: day })); }, maxDate: max === null || max === void 0 ? void 0 : max.toJSDate(), minDate: min === null || min === void 0 ? void 0 : min.toJSDate() }, datePickerProps)) }), jsxRuntime$1.jsx(ModalFooter, { fullWidth: true, disabled: !formattedDate && !date, onClick: acceptWithDateSelected, label: footerLabel })] }))] }));
|
|
704
|
+
var forwardedRef = useForkRef(ref, field.ref);
|
|
705
|
+
return (jsxRuntime$1.jsxs(jsxRuntime$1.Fragment, { children: [jsxRuntime$1.jsx(InputForDatepicker, __assign({ mask: "00.00.0000", name: name, handleClick: handleModalOpen, value: formattedValue || value, onChange: handleChange, disabled: disabled, message: error, ref: forwardedRef }, props)), jsxRuntime$1.jsxs(StyledModal, __assign({ title: title, description: description, isOpen: isModalOpen, handleClose: handleModalClose, alignTitle: alignTitle }, { children: [jsxRuntime$1.jsx(ContentWrapper$1, { children: jsxRuntime$1.jsx(DatePicker__default["default"], __assign({ inline: true, selected: date || formattedDate, onChange: handleDateChange, calendarContainer: StyledCalendarStandardContainer, renderCustomHeader: function (headProps) { return (jsxRuntime$1.jsx(CalendarHeaderWithSelect, __assign({ yearOptions: yearList, max: max, min: min }, headProps))); }, renderDayContents: function (day) { return (jsxRuntime$1.jsx(DayContent, { children: day })); }, maxDate: max === null || max === void 0 ? void 0 : max.toJSDate(), minDate: min === null || min === void 0 ? void 0 : min.toJSDate() }, datePickerProps)) }), jsxRuntime$1.jsx(ModalFooter, { fullWidth: true, disabled: !formattedDate && !date, onClick: acceptWithDateSelected, label: footerLabel })] }))] }));
|
|
699
706
|
});
|
|
700
707
|
InputWithDatePicker.defaultProps = {
|
|
701
708
|
title: "Дата рождения",
|
|
@@ -772,7 +779,7 @@ var MobileInputWithMonthPicker = React.forwardRef(function (_a, ref) {
|
|
|
772
779
|
field === null || field === void 0 ? void 0 : field.onChange({ target: { value: date, name: name }, type: "change" });
|
|
773
780
|
handleModalClose();
|
|
774
781
|
};
|
|
775
|
-
return (jsxRuntime.jsxs(Wrapper$1, __assign({ ref: ref }, { children: [jsxRuntime.jsx(InputForDatepicker, __assign({ mask: "
|
|
782
|
+
return (jsxRuntime.jsxs(Wrapper$1, __assign({ ref: ref }, { children: [jsxRuntime.jsx(InputForDatepicker, __assign({ mask: "00.0000", name: name, handleCLick: handleModalOpen, value: value, onChange: handleChange, disabled: disabled, message: error, isLabelShrink: Boolean(field.value) }, props)), jsxRuntime.jsxs(kuiBasic.Modal, __assign({ title: title, isOpen: isModalOpen, handleClose: handleModalClose }, { children: [jsxRuntime.jsx(ContentWrapper, { children: jsxRuntime.jsx(DatePicker__default["default"], __assign({ inline: true, showMonthYearPicker: true, dateFormat: "MM.yyyy", selected: date, onChange: function (newDate) { return setDate(newDate); }, locale: ruCustom, calendarContainer: MonthPickerContainer, renderCustomHeader: function (headProps) { return (jsxRuntime.jsx(MonthPickerHeader, __assign({}, headProps))); } }, datePickerProps)) }), jsxRuntime.jsx(ModalFooter, { fullWidth: true, disabled: !date, onClick: acceptWithDateSelected, label: "\u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044C" })] }))] })));
|
|
776
783
|
});
|
|
777
784
|
var Wrapper$1 = styled__default["default"].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"])));
|
|
778
785
|
var ContentWrapper = styled__default["default"].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"])));
|
|
@@ -878,29 +885,20 @@ var InputPhoneWithForm = React.forwardRef(function (props, ref) {
|
|
|
878
885
|
};
|
|
879
886
|
var handleChange = function (e) {
|
|
880
887
|
phoneRegister.field.onChange(e);
|
|
881
|
-
if (other.onChange) {
|
|
882
|
-
other.onChange(e);
|
|
883
|
-
}
|
|
884
|
-
};
|
|
885
|
-
var forwardedRef = function (elem) {
|
|
886
|
-
if (ref) {
|
|
887
|
-
// eslint-disable-next-line no-param-reassign
|
|
888
|
-
// @ts-ignore
|
|
889
|
-
ref.current = elem;
|
|
890
|
-
}
|
|
891
|
-
phoneRegister.field.ref(elem);
|
|
892
|
-
};
|
|
893
|
-
React.useEffect(function () {
|
|
894
888
|
if (!codeRegister.field.value) {
|
|
895
889
|
codeRegister.field.onChange({
|
|
896
890
|
target: { value: "7", name: "".concat(name, ".phoneCode") },
|
|
897
891
|
type: "change",
|
|
898
892
|
});
|
|
899
893
|
}
|
|
900
|
-
|
|
894
|
+
if (other.onChange) {
|
|
895
|
+
other.onChange(e);
|
|
896
|
+
}
|
|
897
|
+
};
|
|
898
|
+
var forwardedRef = useForkRef(ref, phoneRegister.field.ref);
|
|
901
899
|
return (jsxRuntime.jsx(kuiBasic.InputWithCountryDropdown, __assign({ message: errorMessage,
|
|
902
900
|
// @ts-ignore
|
|
903
|
-
hiddenInputProps: __assign(__assign(
|
|
901
|
+
hiddenInputProps: __assign(__assign({}, codeRegister.field), hiddenInputProps), onSelectCountry: handleCountryChange }, phoneRegister.field, other, { onChange: handleChange, ref: forwardedRef, autoComplete: "false" })));
|
|
904
902
|
});
|
|
905
903
|
InputPhoneWithForm.defaultProps = {
|
|
906
904
|
name: "phone",
|