@alfalab/core-components-calendar-input 9.0.11 → 9.1.0

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 (178) hide show
  1. package/Component.desktop.d.ts +4 -0
  2. package/Component.desktop.js +4 -0
  3. package/Component.mobile.d.ts +4 -0
  4. package/Component.mobile.js +4 -0
  5. package/Component.responsive.d.ts +4 -0
  6. package/Component.responsive.js +4 -0
  7. package/components/calendar-input/Component.d.ts +2 -2
  8. package/components/calendar-input/Component.js +9 -3
  9. package/components/calendar-input/index.css +11 -11
  10. package/cssm/Component.desktop.d.ts +4 -0
  11. package/cssm/Component.desktop.js +4 -0
  12. package/cssm/Component.mobile.d.ts +4 -0
  13. package/cssm/Component.mobile.js +4 -0
  14. package/cssm/Component.responsive.d.ts +4 -0
  15. package/cssm/Component.responsive.js +4 -0
  16. package/cssm/components/calendar-input/Component.d.ts +2 -2
  17. package/cssm/components/calendar-input/Component.js +8 -2
  18. package/cssm/desktop/index.d.ts +2 -0
  19. package/cssm/{desktop.js → desktop/index.js} +4 -4
  20. package/cssm/mobile/index.d.ts +2 -0
  21. package/cssm/{mobile.js → mobile/index.js} +4 -4
  22. package/cssm/shared/index.d.ts +1 -0
  23. package/cssm/{shared.js → shared/index.js} +1 -1
  24. package/desktop/index.d.ts +2 -0
  25. package/{desktop.js → desktop/index.js} +3 -3
  26. package/desktop/package.json +3 -0
  27. package/esm/Component.desktop.d.ts +4 -0
  28. package/esm/Component.desktop.js +4 -0
  29. package/esm/Component.mobile.d.ts +4 -0
  30. package/esm/Component.mobile.js +4 -0
  31. package/esm/Component.responsive.d.ts +4 -0
  32. package/esm/Component.responsive.js +4 -0
  33. package/esm/components/calendar-input/Component.d.ts +2 -2
  34. package/esm/components/calendar-input/Component.js +9 -3
  35. package/esm/components/calendar-input/index.css +11 -11
  36. package/esm/desktop/index.d.ts +2 -0
  37. package/esm/{desktop.js → desktop/index.js} +3 -3
  38. package/esm/mobile/index.d.ts +2 -0
  39. package/esm/{mobile.js → mobile/index.js} +3 -3
  40. package/esm/shared/index.d.ts +1 -0
  41. package/esm/{shared.js → shared/index.js} +1 -1
  42. package/mobile/index.d.ts +2 -0
  43. package/{mobile.js → mobile/index.js} +3 -3
  44. package/mobile/package.json +3 -0
  45. package/modern/Component.desktop.d.ts +4 -0
  46. package/modern/Component.desktop.js +4 -0
  47. package/modern/Component.mobile.d.ts +4 -0
  48. package/modern/Component.mobile.js +4 -0
  49. package/modern/Component.responsive.d.ts +4 -0
  50. package/modern/Component.responsive.js +4 -0
  51. package/modern/components/calendar-input/Component.d.ts +2 -2
  52. package/modern/components/calendar-input/Component.js +7 -3
  53. package/modern/components/calendar-input/index.css +11 -11
  54. package/modern/desktop/index.d.ts +2 -0
  55. package/modern/{desktop.js → desktop/index.js} +3 -3
  56. package/modern/mobile/index.d.ts +2 -0
  57. package/modern/{mobile.js → mobile/index.js} +3 -3
  58. package/modern/shared/index.d.ts +1 -0
  59. package/modern/{shared.js → shared/index.js} +1 -1
  60. package/package.json +3 -27
  61. package/shared/index.d.ts +1 -0
  62. package/{shared.js → shared/index.js} +1 -1
  63. package/shared/package.json +3 -0
  64. package/src/Component.desktop.tsx +4 -0
  65. package/src/Component.mobile.tsx +4 -0
  66. package/src/Component.responsive.tsx +4 -0
  67. package/src/components/calendar-input/Component.tsx +6 -1
  68. package/src/desktop/index.ts +1 -0
  69. package/src/desktop/package.json +3 -0
  70. package/src/mobile/index.ts +1 -0
  71. package/src/mobile/package.json +3 -0
  72. package/src/shared/index.ts +1 -0
  73. package/src/shared/package.json +3 -0
  74. package/Component-63dec22f.d.ts +0 -184
  75. package/Component-72308007.d.ts +0 -6
  76. package/Component-b5b4c59f.d.ts +0 -388
  77. package/Component-ebda875c.d.ts +0 -35
  78. package/Component.desktop-2e2b2125.d.ts +0 -6
  79. package/Component.desktop-b5b4c59f.d.ts +0 -198
  80. package/Component.mobile-755fbaa3.d.ts +0 -6
  81. package/Component.responsive-2e2b2125.d.ts +0 -66
  82. package/cssm/Component-5684a67d.d.ts +0 -23
  83. package/cssm/Component-63dec22f.d.ts +0 -24
  84. package/cssm/Component-72308007.d.ts +0 -186
  85. package/cssm/Component-e2b6c730.d.ts +0 -76
  86. package/cssm/Component.desktop-2e2b2125.d.ts +0 -6
  87. package/cssm/Component.desktop-b5b4c59f.d.ts +0 -138
  88. package/cssm/Component.mobile-755fbaa3.d.ts +0 -6
  89. package/cssm/Component.responsive-755fbaa3.d.ts +0 -66
  90. package/cssm/desktop-63dec22f.d.ts +0 -2
  91. package/cssm/desktop-b5b4c59f.d.ts +0 -2
  92. package/cssm/desktop.d.ts +0 -2
  93. package/cssm/index-72308007.d.ts +0 -59
  94. package/cssm/index-9211a437.d.ts +0 -2
  95. package/cssm/index-ebda875c.d.ts +0 -2
  96. package/cssm/index-f034f741.d.ts +0 -2
  97. package/cssm/mobile-c219f8ca.d.ts +0 -367
  98. package/cssm/mobile.d.ts +0 -2
  99. package/cssm/shared-71d94e2b.d.ts +0 -35
  100. package/cssm/shared.d.ts +0 -1
  101. package/cssm/types-1b036d4b.d.ts +0 -13
  102. package/cssm/types-1c79e231.d.ts +0 -113
  103. package/cssm/typings-5684a67d.d.ts +0 -23
  104. package/cssm/typings-9211a437.d.ts +0 -95
  105. package/cssm/useCalendar-5684a67d.d.ts +0 -97
  106. package/cssm/useSkeleton-1b036d4b.d.ts +0 -40
  107. package/cssm/utils-5684a67d.d.ts +0 -88
  108. package/cssm/utils-e0a54580.d.ts +0 -8
  109. package/desktop-63dec22f.d.ts +0 -2
  110. package/desktop.d.ts +0 -2
  111. package/esm/Component-63dec22f.d.ts +0 -184
  112. package/esm/Component-72308007.d.ts +0 -6
  113. package/esm/Component-b5b4c59f.d.ts +0 -388
  114. package/esm/Component-ebda875c.d.ts +0 -35
  115. package/esm/Component.desktop-2e2b2125.d.ts +0 -6
  116. package/esm/Component.desktop-b5b4c59f.d.ts +0 -198
  117. package/esm/Component.mobile-755fbaa3.d.ts +0 -6
  118. package/esm/Component.responsive-2e2b2125.d.ts +0 -66
  119. package/esm/desktop-63dec22f.d.ts +0 -2
  120. package/esm/desktop.d.ts +0 -2
  121. package/esm/index-72308007.d.ts +0 -59
  122. package/esm/index-9211a437.d.ts +0 -2
  123. package/esm/index-ebda875c.d.ts +0 -2
  124. package/esm/index-f034f741.d.ts +0 -83
  125. package/esm/mobile-c219f8ca.d.ts +0 -1
  126. package/esm/mobile.d.ts +0 -2
  127. package/esm/shared-848397c5.d.ts +0 -35
  128. package/esm/shared.d.ts +0 -1
  129. package/esm/types-1b036d4b.d.ts +0 -13
  130. package/esm/types-1c79e231.d.ts +0 -113
  131. package/esm/typings-5684a67d.d.ts +0 -23
  132. package/esm/typings-9211a437.d.ts +0 -95
  133. package/esm/useCalendar-5684a67d.d.ts +0 -97
  134. package/esm/useSkeleton-1b036d4b.d.ts +0 -40
  135. package/esm/utils-5684a67d.d.ts +0 -88
  136. package/index-72308007.d.ts +0 -59
  137. package/index-9211a437.d.ts +0 -2
  138. package/index-ebda875c.d.ts +0 -2
  139. package/index-f034f741.d.ts +0 -83
  140. package/mobile-c219f8ca.d.ts +0 -1
  141. package/mobile.d.ts +0 -2
  142. package/modern/Component-63dec22f.d.ts +0 -184
  143. package/modern/Component-72308007.d.ts +0 -6
  144. package/modern/Component-b5b4c59f.d.ts +0 -388
  145. package/modern/Component-ebda875c.d.ts +0 -35
  146. package/modern/Component.desktop-2e2b2125.d.ts +0 -6
  147. package/modern/Component.desktop-b5b4c59f.d.ts +0 -205
  148. package/modern/Component.mobile-755fbaa3.d.ts +0 -6
  149. package/modern/Component.responsive-2e2b2125.d.ts +0 -66
  150. package/modern/desktop-63dec22f.d.ts +0 -2
  151. package/modern/desktop.d.ts +0 -2
  152. package/modern/index-72308007.d.ts +0 -59
  153. package/modern/index-9211a437.d.ts +0 -2
  154. package/modern/index-ebda875c.d.ts +0 -2
  155. package/modern/index-f034f741.d.ts +0 -80
  156. package/modern/mobile-c219f8ca.d.ts +0 -1
  157. package/modern/mobile.d.ts +0 -2
  158. package/modern/shared-f034f741.d.ts +0 -35
  159. package/modern/shared.d.ts +0 -1
  160. package/modern/types-1b036d4b.d.ts +0 -13
  161. package/modern/types-1c79e231.d.ts +0 -113
  162. package/modern/typings-5684a67d.d.ts +0 -23
  163. package/modern/typings-9211a437.d.ts +0 -95
  164. package/modern/useCalendar-5684a67d.d.ts +0 -97
  165. package/modern/useSkeleton-1b036d4b.d.ts +0 -40
  166. package/modern/utils-5684a67d.d.ts +0 -88
  167. package/shared-848397c5.d.ts +0 -35
  168. package/shared.d.ts +0 -1
  169. package/src/desktop.ts +0 -1
  170. package/src/mobile.ts +0 -1
  171. package/src/shared.ts +0 -1
  172. package/types-1b036d4b.d.ts +0 -13
  173. package/types-1c79e231.d.ts +0 -113
  174. package/typings-5684a67d.d.ts +0 -23
  175. package/typings-9211a437.d.ts +0 -95
  176. package/useCalendar-5684a67d.d.ts +0 -97
  177. package/useSkeleton-1b036d4b.d.ts +0 -40
  178. package/utils-5684a67d.d.ts +0 -88
@@ -2,5 +2,9 @@
2
2
  import React from 'react';
3
3
  import { CalendarInputProps } from "./components/calendar-input/Component";
4
4
  type CalendarInputDesktopProps = Omit<CalendarInputProps, 'view'>;
5
+ /**
6
+ * @deprecated
7
+ * use UniversalDateInput instead
8
+ */
5
9
  declare const CalendarInputDesktop: React.ForwardRefExoticComponent<CalendarInputDesktopProps & React.RefAttributes<HTMLInputElement>>;
6
10
  export { CalendarInputDesktopProps, CalendarInputDesktop };
@@ -21,6 +21,10 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
21
21
 
22
22
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
23
23
 
24
+ /**
25
+ * @deprecated
26
+ * use UniversalDateInput instead
27
+ */
24
28
  var CalendarInputDesktop = React.forwardRef(function (props, ref) { return React__default.default.createElement(components_calendarInput_Component.CalendarInput, tslib.__assign({ Calendar: desktop.CalendarDesktop }, props, { ref: ref })); });
25
29
 
26
30
  exports.CalendarInputDesktop = CalendarInputDesktop;
@@ -2,5 +2,9 @@
2
2
  import React from 'react';
3
3
  import { CalendarInputProps } from "./components/calendar-input/Component";
4
4
  type CalendarInputMobileProps = Omit<CalendarInputProps, 'view'>;
5
+ /**
6
+ * @deprecated
7
+ * use UniversalDateInput instead
8
+ */
5
9
  declare const CalendarInputMobile: React.ForwardRefExoticComponent<CalendarInputMobileProps & React.RefAttributes<HTMLInputElement>>;
6
10
  export { CalendarInputMobileProps, CalendarInputMobile };
@@ -21,6 +21,10 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
21
21
 
22
22
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
23
23
 
24
+ /**
25
+ * @deprecated
26
+ * use UniversalDateInput instead
27
+ */
24
28
  var CalendarInputMobile = React.forwardRef(function (props, ref) { return React__default.default.createElement(components_calendarInput_Component.CalendarInput, tslib.__assign({ Calendar: mobile.CalendarMobile, view: 'mobile' }, props, { ref: ref })); });
25
29
 
26
30
  exports.CalendarInputMobile = CalendarInputMobile;
@@ -9,6 +9,10 @@ type CalendarInputResponsiveProps = Omit<CalendarInputProps, 'view'> & {
9
9
  breakpoint?: number;
10
10
  };
11
11
  type CalendarInputMedia = 'desktop' | 'mobile';
12
+ /**
13
+ * @deprecated
14
+ * use UniversalDateInput instead
15
+ */
12
16
  declare const CalendarInputResponsive: React.ForwardRefExoticComponent<Omit<CalendarInputProps, "view"> & {
13
17
  /**
14
18
  * Контрольная точка, с нее начинается desktop версия
@@ -25,6 +25,10 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
25
25
 
26
26
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
27
27
 
28
+ /**
29
+ * @deprecated
30
+ * use UniversalDateInput instead
31
+ */
28
32
  var CalendarInputResponsive = React.forwardRef(function (_a, ref) {
29
33
  var _b = _a.breakpoint, breakpoint = _b === void 0 ? 1024 : _b, restProps = tslib.__rest(_a, ["breakpoint"]);
30
34
  var view = hooks.useMedia([
@@ -1,8 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import React from 'react';
3
3
  import { ChangeEvent, ElementType, MouseEvent } from "react";
4
- import { CalendarDesktopProps } from "../../desktop-63dec22f";
5
- import { CalendarMobileProps } from "../../mobile-c219f8ca";
4
+ import { CalendarDesktopProps } from "@alfalab/core-components-calendar/desktop";
5
+ import { CalendarMobileProps } from "@alfalab/core-components-calendar/mobile";
6
6
  import { DateInputProps } from "@alfalab/core-components-date-input";
7
7
  import { PopoverProps } from "@alfalab/core-components-popover";
8
8
  type CalendarInputProps = Omit<DateInputProps, 'onChange' | 'mobileMode'> & {
@@ -21,7 +21,7 @@ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
21
21
  var mergeRefs__default = /*#__PURE__*/_interopDefaultCompat(mergeRefs);
22
22
  var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
23
23
 
24
- var styles = {"component":"calendar-input__component_4iygi","block":"calendar-input__block_4iygi","calendarContainer":"calendar-input__calendarContainer_4iygi","calendarResponsive":"calendar-input__calendarResponsive_4iygi","calendarIcon":"calendar-input__calendarIcon_4iygi","nativeInput":"calendar-input__nativeInput_4iygi"};
24
+ var styles = {"component":"calendar-input__component_a1sh2","block":"calendar-input__block_a1sh2","calendarContainer":"calendar-input__calendarContainer_a1sh2","calendarResponsive":"calendar-input__calendarResponsive_a1sh2","calendarIcon":"calendar-input__calendarIcon_a1sh2","nativeInput":"calendar-input__nativeInput_a1sh2"};
25
25
  require('./index.css')
26
26
 
27
27
  var CalendarInput = React.forwardRef(function (_a, ref) {
@@ -76,7 +76,10 @@ var CalendarInput = React.forwardRef(function (_a, ref) {
76
76
  closeCalendar();
77
77
  }
78
78
  };
79
- var handleClick = function () {
79
+ var handleClick = function (event) {
80
+ var _a;
81
+ if (!((_a = inputWrapperRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target)))
82
+ return;
80
83
  if (!open)
81
84
  openCalendar();
82
85
  if (view === 'desktop' && inputRef.current) {
@@ -84,7 +87,10 @@ var CalendarInput = React.forwardRef(function (_a, ref) {
84
87
  }
85
88
  };
86
89
  var handleFocus = function (event) {
90
+ var _a;
87
91
  if (view === 'desktop') {
92
+ if (!((_a = inputWrapperRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target)))
93
+ return;
88
94
  openCalendar();
89
95
  if (!open && event.target.tagName !== 'INPUT' && calendarRef.current) {
90
96
  calendarRef.current.focus();
@@ -154,7 +160,7 @@ var CalendarInput = React.forwardRef(function (_a, ref) {
154
160
  React__default.default.createElement("div", { className: cn__default.default(styles.component, className, (_b = {},
155
161
  _b[styles.block] = block,
156
162
  _b)), tabIndex: -1, onKeyDown: inputDisabled ? undefined : handleKeyDown, onClick: inputDisabled ? undefined : handleClick, onFocus: inputDisabled ? undefined : handleFocus, onBlur: handleBlur, "data-test-id": dataTestId },
157
- React__default.default.createElement(coreComponentsDateInput.DateInput, tslib.__assign({}, restProps, { ref: mergeRefs__default.default([inputRef, ref]), wrapperRef: mergeRefs__default.default([wrapperRef, inputWrapperRef]), value: inputValue, defaultValue: defaultValue, disabled: disabled, inputClassName: inputClassName, readOnly: readOnly, mobileMode: mobileMode === 'native' ? 'native' : 'input', error: error, disableUserInput: disableUserInput, rightAddons: React__default.default.createElement(React__default.default.Fragment, null,
163
+ React__default.default.createElement(coreComponentsDateInput.DateInput, tslib.__assign({ autoComplete: 'off' }, restProps, { ref: mergeRefs__default.default([inputRef, ref]), wrapperRef: mergeRefs__default.default([wrapperRef, inputWrapperRef]), value: inputValue, defaultValue: defaultValue, disabled: disabled, inputClassName: inputClassName, readOnly: readOnly, mobileMode: mobileMode === 'native' ? 'native' : 'input', error: error, disableUserInput: disableUserInput, rightAddons: React__default.default.createElement(React__default.default.Fragment, null,
158
164
  rightAddons,
159
165
  shouldRenderPopover && (React__default.default.createElement(CalendarMIcon.CalendarMIcon, { className: styles.calendarIcon }))), rightAddonsProps: { onMouseDown: function (e) { return e.preventDefault(); } }, onKeyDown: handleInputKeyDown, onChange: handleInputChange, block: true })),
160
166
  shouldRenderStatic && renderCalendar(),
@@ -1,4 +1,4 @@
1
- /* hash: ibx81 */
1
+ /* hash: 1yp9v */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-border-secondary: #e9e9eb;
@@ -43,31 +43,31 @@
43
43
  } :root {
44
44
  --calendar-input-icon-color: var(--color-light-graphic-primary);
45
45
  --calendar-input-popover-border-radius: var(--border-radius-m);
46
- } .calendar-input__component_4iygi {
46
+ } .calendar-input__component_a1sh2 {
47
47
  display: inline-block;
48
48
  outline: none;
49
49
  position: relative;
50
- } .calendar-input__block_4iygi {
50
+ } .calendar-input__block_a1sh2 {
51
51
  width: 100%;
52
- } .calendar-input__calendarContainer_4iygi {
52
+ } .calendar-input__calendarContainer_a1sh2 {
53
53
  display: inline-block;
54
54
  box-sizing: border-box;
55
55
  border-radius: var(--calendar-input-popover-border-radius);
56
56
  border: 1px solid var(--color-light-border-secondary)
57
- } @media (max-width: 374px) { .calendar-input__calendarContainer_4iygi {
57
+ } @media (max-width: 374px) { .calendar-input__calendarContainer_a1sh2 {
58
58
  width: 100%;
59
59
  min-width: 288px
60
60
  }
61
- } .calendar-input__calendarResponsive_4iygi {
61
+ } .calendar-input__calendarResponsive_a1sh2 {
62
62
  width: var(--calendar-width);
63
- } .calendar-input__calendarIcon_4iygi {
63
+ } .calendar-input__calendarIcon_a1sh2 {
64
64
  width: 24px;
65
65
  height: 24px;
66
66
  display: block;
67
67
  color: var(--calendar-input-icon-color)
68
- } .calendar-input__calendarIcon_4iygi:not(:only-child) {
68
+ } .calendar-input__calendarIcon_a1sh2:not(:only-child) {
69
69
  margin-right: var(--gap-2xs);
70
- } .calendar-input__nativeInput_4iygi {
70
+ } .calendar-input__nativeInput_a1sh2 {
71
71
  opacity: 0;
72
72
  position: absolute;
73
73
  top: 0;
@@ -76,8 +76,8 @@
76
76
  height: 100%;
77
77
  appearance: none;
78
78
  z-index: 1
79
- } .calendar-input__nativeInput_4iygi::-webkit-calendar-picker-indicator {
79
+ } .calendar-input__nativeInput_a1sh2::-webkit-calendar-picker-indicator {
80
80
  display: none;
81
- } .calendar-input__nativeInput_4iygi::-webkit-inner-spin-button {
81
+ } .calendar-input__nativeInput_a1sh2::-webkit-inner-spin-button {
82
82
  display: none;
83
83
  }
@@ -2,5 +2,9 @@
2
2
  import React from 'react';
3
3
  import { CalendarInputProps } from "./components/calendar-input/Component";
4
4
  type CalendarInputDesktopProps = Omit<CalendarInputProps, 'view'>;
5
+ /**
6
+ * @deprecated
7
+ * use UniversalDateInput instead
8
+ */
5
9
  declare const CalendarInputDesktop: React.ForwardRefExoticComponent<CalendarInputDesktopProps & React.RefAttributes<HTMLInputElement>>;
6
10
  export { CalendarInputDesktopProps, CalendarInputDesktop };
@@ -22,6 +22,10 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
22
22
 
23
23
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
24
24
 
25
+ /**
26
+ * @deprecated
27
+ * use UniversalDateInput instead
28
+ */
25
29
  var CalendarInputDesktop = React.forwardRef(function (props, ref) { return React__default.default.createElement(components_calendarInput_Component.CalendarInput, tslib.__assign({ Calendar: desktop.CalendarDesktop }, props, { ref: ref })); });
26
30
 
27
31
  exports.CalendarInputDesktop = CalendarInputDesktop;
@@ -2,5 +2,9 @@
2
2
  import React from 'react';
3
3
  import { CalendarInputProps } from "./components/calendar-input/Component";
4
4
  type CalendarInputMobileProps = Omit<CalendarInputProps, 'view'>;
5
+ /**
6
+ * @deprecated
7
+ * use UniversalDateInput instead
8
+ */
5
9
  declare const CalendarInputMobile: React.ForwardRefExoticComponent<CalendarInputMobileProps & React.RefAttributes<HTMLInputElement>>;
6
10
  export { CalendarInputMobileProps, CalendarInputMobile };
@@ -22,6 +22,10 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
22
22
 
23
23
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
24
24
 
25
+ /**
26
+ * @deprecated
27
+ * use UniversalDateInput instead
28
+ */
25
29
  var CalendarInputMobile = React.forwardRef(function (props, ref) { return React__default.default.createElement(components_calendarInput_Component.CalendarInput, tslib.__assign({ Calendar: mobile.CalendarMobile, view: 'mobile' }, props, { ref: ref })); });
26
30
 
27
31
  exports.CalendarInputMobile = CalendarInputMobile;
@@ -9,6 +9,10 @@ type CalendarInputResponsiveProps = Omit<CalendarInputProps, 'view'> & {
9
9
  breakpoint?: number;
10
10
  };
11
11
  type CalendarInputMedia = 'desktop' | 'mobile';
12
+ /**
13
+ * @deprecated
14
+ * use UniversalDateInput instead
15
+ */
12
16
  declare const CalendarInputResponsive: React.ForwardRefExoticComponent<Omit<CalendarInputProps, "view"> & {
13
17
  /**
14
18
  * Контрольная точка, с нее начинается desktop версия
@@ -26,6 +26,10 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
26
26
 
27
27
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
28
28
 
29
+ /**
30
+ * @deprecated
31
+ * use UniversalDateInput instead
32
+ */
29
33
  var CalendarInputResponsive = React.forwardRef(function (_a, ref) {
30
34
  var _b = _a.breakpoint, breakpoint = _b === void 0 ? 1024 : _b, restProps = tslib.__rest(_a, ["breakpoint"]);
31
35
  var view = hooks.useMedia([
@@ -1,8 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import React from 'react';
3
3
  import { ChangeEvent, ElementType, MouseEvent } from "react";
4
- import { CalendarDesktopProps } from "../../desktop-b5b4c59f";
5
- import { CalendarMobileProps } from "../../mobile-c219f8ca";
4
+ import { CalendarDesktopProps } from "@alfalab/core-components-calendar/desktop";
5
+ import { CalendarMobileProps } from "@alfalab/core-components-calendar/mobile";
6
6
  import { DateInputProps } from "@alfalab/core-components-date-input";
7
7
  import { PopoverProps } from "@alfalab/core-components-popover";
8
8
  type CalendarInputProps = Omit<DateInputProps, 'onChange' | 'mobileMode'> & {
@@ -75,7 +75,10 @@ var CalendarInput = React.forwardRef(function (_a, ref) {
75
75
  closeCalendar();
76
76
  }
77
77
  };
78
- var handleClick = function () {
78
+ var handleClick = function (event) {
79
+ var _a;
80
+ if (!((_a = inputWrapperRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target)))
81
+ return;
79
82
  if (!open)
80
83
  openCalendar();
81
84
  if (view === 'desktop' && inputRef.current) {
@@ -83,7 +86,10 @@ var CalendarInput = React.forwardRef(function (_a, ref) {
83
86
  }
84
87
  };
85
88
  var handleFocus = function (event) {
89
+ var _a;
86
90
  if (view === 'desktop') {
91
+ if (!((_a = inputWrapperRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target)))
92
+ return;
87
93
  openCalendar();
88
94
  if (!open && event.target.tagName !== 'INPUT' && calendarRef.current) {
89
95
  calendarRef.current.focus();
@@ -153,7 +159,7 @@ var CalendarInput = React.forwardRef(function (_a, ref) {
153
159
  React__default.default.createElement("div", { className: cn__default.default(styles__default.default.component, className, (_b = {},
154
160
  _b[styles__default.default.block] = block,
155
161
  _b)), tabIndex: -1, onKeyDown: inputDisabled ? undefined : handleKeyDown, onClick: inputDisabled ? undefined : handleClick, onFocus: inputDisabled ? undefined : handleFocus, onBlur: handleBlur, "data-test-id": dataTestId },
156
- React__default.default.createElement(coreComponentsDateInput.DateInput, tslib.__assign({}, restProps, { ref: mergeRefs__default.default([inputRef, ref]), wrapperRef: mergeRefs__default.default([wrapperRef, inputWrapperRef]), value: inputValue, defaultValue: defaultValue, disabled: disabled, inputClassName: inputClassName, readOnly: readOnly, mobileMode: mobileMode === 'native' ? 'native' : 'input', error: error, disableUserInput: disableUserInput, rightAddons: React__default.default.createElement(React__default.default.Fragment, null,
162
+ React__default.default.createElement(coreComponentsDateInput.DateInput, tslib.__assign({ autoComplete: 'off' }, restProps, { ref: mergeRefs__default.default([inputRef, ref]), wrapperRef: mergeRefs__default.default([wrapperRef, inputWrapperRef]), value: inputValue, defaultValue: defaultValue, disabled: disabled, inputClassName: inputClassName, readOnly: readOnly, mobileMode: mobileMode === 'native' ? 'native' : 'input', error: error, disableUserInput: disableUserInput, rightAddons: React__default.default.createElement(React__default.default.Fragment, null,
157
163
  rightAddons,
158
164
  shouldRenderPopover && (React__default.default.createElement(CalendarMIcon.CalendarMIcon, { className: styles__default.default.calendarIcon }))), rightAddonsProps: { onMouseDown: function (e) { return e.preventDefault(); } }, onKeyDown: handleInputKeyDown, onChange: handleInputChange, block: true })),
159
165
  shouldRenderStatic && renderCalendar(),
@@ -0,0 +1,2 @@
1
+ export * from "../Component.desktop";
2
+ export {};
@@ -2,22 +2,22 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var Component_desktop = require('./Component.desktop.js');
5
+ var Component_desktop = require('../Component.desktop.js');
6
6
  require('tslib');
7
7
  require('react');
8
8
  require('@alfalab/core-components-calendar/cssm/desktop');
9
- require('./components/calendar-input/Component.js');
9
+ require('../components/calendar-input/Component.js');
10
10
  require('react-merge-refs');
11
11
  require('classnames');
12
12
  require('@alfalab/core-components-calendar/cssm/shared');
13
13
  require('@alfalab/core-components-date-input/cssm');
14
14
  require('@alfalab/core-components-popover/cssm');
15
15
  require('@alfalab/icons-glyph/CalendarMIcon');
16
- require('./utils.js');
16
+ require('../utils.js');
17
17
  require('date-fns/format');
18
18
  require('date-fns/isSameDay');
19
19
  require('date-fns/parse');
20
- require('./components/calendar-input/index.module.css');
20
+ require('../components/calendar-input/index.module.css');
21
21
 
22
22
 
23
23
 
@@ -0,0 +1,2 @@
1
+ export * from "../Component.mobile";
2
+ export {};
@@ -2,22 +2,22 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var Component_mobile = require('./Component.mobile.js');
5
+ var Component_mobile = require('../Component.mobile.js');
6
6
  require('tslib');
7
7
  require('react');
8
8
  require('@alfalab/core-components-calendar/cssm/mobile');
9
- require('./components/calendar-input/Component.js');
9
+ require('../components/calendar-input/Component.js');
10
10
  require('react-merge-refs');
11
11
  require('classnames');
12
12
  require('@alfalab/core-components-calendar/cssm/shared');
13
13
  require('@alfalab/core-components-date-input/cssm');
14
14
  require('@alfalab/core-components-popover/cssm');
15
15
  require('@alfalab/icons-glyph/CalendarMIcon');
16
- require('./utils.js');
16
+ require('../utils.js');
17
17
  require('date-fns/format');
18
18
  require('date-fns/isSameDay');
19
19
  require('date-fns/parse');
20
- require('./components/calendar-input/index.module.css');
20
+ require('../components/calendar-input/index.module.css');
21
21
 
22
22
 
23
23
 
@@ -0,0 +1 @@
1
+ export * from "../utils";
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var utils = require('./utils.js');
5
+ var utils = require('../utils.js');
6
6
  require('date-fns/format');
7
7
  require('date-fns/isSameDay');
8
8
  require('date-fns/parse');
@@ -0,0 +1,2 @@
1
+ export * from "../Component.desktop";
2
+ export {};
@@ -2,18 +2,18 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var Component_desktop = require('./Component.desktop.js');
5
+ var Component_desktop = require('../Component.desktop.js');
6
6
  require('tslib');
7
7
  require('react');
8
8
  require('@alfalab/core-components-calendar/desktop');
9
- require('./components/calendar-input/Component.js');
9
+ require('../components/calendar-input/Component.js');
10
10
  require('react-merge-refs');
11
11
  require('classnames');
12
12
  require('@alfalab/core-components-calendar/shared');
13
13
  require('@alfalab/core-components-date-input');
14
14
  require('@alfalab/core-components-popover');
15
15
  require('@alfalab/icons-glyph/CalendarMIcon');
16
- require('./utils.js');
16
+ require('../utils.js');
17
17
  require('date-fns/format');
18
18
  require('date-fns/isSameDay');
19
19
  require('date-fns/parse');
@@ -0,0 +1,3 @@
1
+ {
2
+ "module": "../esm/desktop/index.js"
3
+ }
@@ -2,5 +2,9 @@
2
2
  import React from 'react';
3
3
  import { CalendarInputProps } from "./components/calendar-input/Component";
4
4
  type CalendarInputDesktopProps = Omit<CalendarInputProps, 'view'>;
5
+ /**
6
+ * @deprecated
7
+ * use UniversalDateInput instead
8
+ */
5
9
  declare const CalendarInputDesktop: React.ForwardRefExoticComponent<CalendarInputDesktopProps & React.RefAttributes<HTMLInputElement>>;
6
10
  export { CalendarInputDesktopProps, CalendarInputDesktop };
@@ -13,6 +13,10 @@ import 'date-fns/format';
13
13
  import 'date-fns/isSameDay';
14
14
  import 'date-fns/parse';
15
15
 
16
+ /**
17
+ * @deprecated
18
+ * use UniversalDateInput instead
19
+ */
16
20
  var CalendarInputDesktop = forwardRef(function (props, ref) { return React.createElement(CalendarInput, __assign({ Calendar: CalendarDesktop }, props, { ref: ref })); });
17
21
 
18
22
  export { CalendarInputDesktop };
@@ -2,5 +2,9 @@
2
2
  import React from 'react';
3
3
  import { CalendarInputProps } from "./components/calendar-input/Component";
4
4
  type CalendarInputMobileProps = Omit<CalendarInputProps, 'view'>;
5
+ /**
6
+ * @deprecated
7
+ * use UniversalDateInput instead
8
+ */
5
9
  declare const CalendarInputMobile: React.ForwardRefExoticComponent<CalendarInputMobileProps & React.RefAttributes<HTMLInputElement>>;
6
10
  export { CalendarInputMobileProps, CalendarInputMobile };
@@ -13,6 +13,10 @@ import 'date-fns/format';
13
13
  import 'date-fns/isSameDay';
14
14
  import 'date-fns/parse';
15
15
 
16
+ /**
17
+ * @deprecated
18
+ * use UniversalDateInput instead
19
+ */
16
20
  var CalendarInputMobile = forwardRef(function (props, ref) { return React.createElement(CalendarInput, __assign({ Calendar: CalendarMobile, view: 'mobile' }, props, { ref: ref })); });
17
21
 
18
22
  export { CalendarInputMobile };
@@ -9,6 +9,10 @@ type CalendarInputResponsiveProps = Omit<CalendarInputProps, 'view'> & {
9
9
  breakpoint?: number;
10
10
  };
11
11
  type CalendarInputMedia = 'desktop' | 'mobile';
12
+ /**
13
+ * @deprecated
14
+ * use UniversalDateInput instead
15
+ */
12
16
  declare const CalendarInputResponsive: React.ForwardRefExoticComponent<Omit<CalendarInputProps, "view"> & {
13
17
  /**
14
18
  * Контрольная точка, с нее начинается desktop версия
@@ -17,6 +17,10 @@ import 'date-fns/isSameDay';
17
17
  import 'date-fns/parse';
18
18
  import '@alfalab/core-components-calendar/esm/mobile';
19
19
 
20
+ /**
21
+ * @deprecated
22
+ * use UniversalDateInput instead
23
+ */
20
24
  var CalendarInputResponsive = forwardRef(function (_a, ref) {
21
25
  var _b = _a.breakpoint, breakpoint = _b === void 0 ? 1024 : _b, restProps = __rest(_a, ["breakpoint"]);
22
26
  var view = useMedia([
@@ -1,8 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import React from 'react';
3
3
  import { ChangeEvent, ElementType, MouseEvent } from "react";
4
- import { CalendarDesktopProps } from "../../desktop-63dec22f";
5
- import { CalendarMobileProps } from "../../mobile-c219f8ca";
4
+ import { CalendarDesktopProps } from "@alfalab/core-components-calendar/desktop";
5
+ import { CalendarMobileProps } from "@alfalab/core-components-calendar/mobile";
6
6
  import { DateInputProps } from "@alfalab/core-components-date-input";
7
7
  import { PopoverProps } from "@alfalab/core-components-popover";
8
8
  type CalendarInputProps = Omit<DateInputProps, 'onChange' | 'mobileMode'> & {
@@ -11,7 +11,7 @@ import 'date-fns/format';
11
11
  import 'date-fns/isSameDay';
12
12
  import 'date-fns/parse';
13
13
 
14
- var styles = {"component":"calendar-input__component_4iygi","block":"calendar-input__block_4iygi","calendarContainer":"calendar-input__calendarContainer_4iygi","calendarResponsive":"calendar-input__calendarResponsive_4iygi","calendarIcon":"calendar-input__calendarIcon_4iygi","nativeInput":"calendar-input__nativeInput_4iygi"};
14
+ var styles = {"component":"calendar-input__component_a1sh2","block":"calendar-input__block_a1sh2","calendarContainer":"calendar-input__calendarContainer_a1sh2","calendarResponsive":"calendar-input__calendarResponsive_a1sh2","calendarIcon":"calendar-input__calendarIcon_a1sh2","nativeInput":"calendar-input__nativeInput_a1sh2"};
15
15
  require('./index.css')
16
16
 
17
17
  var CalendarInput = forwardRef(function (_a, ref) {
@@ -66,7 +66,10 @@ var CalendarInput = forwardRef(function (_a, ref) {
66
66
  closeCalendar();
67
67
  }
68
68
  };
69
- var handleClick = function () {
69
+ var handleClick = function (event) {
70
+ var _a;
71
+ if (!((_a = inputWrapperRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target)))
72
+ return;
70
73
  if (!open)
71
74
  openCalendar();
72
75
  if (view === 'desktop' && inputRef.current) {
@@ -74,7 +77,10 @@ var CalendarInput = forwardRef(function (_a, ref) {
74
77
  }
75
78
  };
76
79
  var handleFocus = function (event) {
80
+ var _a;
77
81
  if (view === 'desktop') {
82
+ if (!((_a = inputWrapperRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target)))
83
+ return;
78
84
  openCalendar();
79
85
  if (!open && event.target.tagName !== 'INPUT' && calendarRef.current) {
80
86
  calendarRef.current.focus();
@@ -144,7 +150,7 @@ var CalendarInput = forwardRef(function (_a, ref) {
144
150
  React.createElement("div", { className: cn(styles.component, className, (_b = {},
145
151
  _b[styles.block] = block,
146
152
  _b)), tabIndex: -1, onKeyDown: inputDisabled ? undefined : handleKeyDown, onClick: inputDisabled ? undefined : handleClick, onFocus: inputDisabled ? undefined : handleFocus, onBlur: handleBlur, "data-test-id": dataTestId },
147
- React.createElement(DateInput, __assign({}, restProps, { ref: mergeRefs([inputRef, ref]), wrapperRef: mergeRefs([wrapperRef, inputWrapperRef]), value: inputValue, defaultValue: defaultValue, disabled: disabled, inputClassName: inputClassName, readOnly: readOnly, mobileMode: mobileMode === 'native' ? 'native' : 'input', error: error, disableUserInput: disableUserInput, rightAddons: React.createElement(React.Fragment, null,
153
+ React.createElement(DateInput, __assign({ autoComplete: 'off' }, restProps, { ref: mergeRefs([inputRef, ref]), wrapperRef: mergeRefs([wrapperRef, inputWrapperRef]), value: inputValue, defaultValue: defaultValue, disabled: disabled, inputClassName: inputClassName, readOnly: readOnly, mobileMode: mobileMode === 'native' ? 'native' : 'input', error: error, disableUserInput: disableUserInput, rightAddons: React.createElement(React.Fragment, null,
148
154
  rightAddons,
149
155
  shouldRenderPopover && (React.createElement(CalendarMIcon, { className: styles.calendarIcon }))), rightAddonsProps: { onMouseDown: function (e) { return e.preventDefault(); } }, onKeyDown: handleInputKeyDown, onChange: handleInputChange, block: true })),
150
156
  shouldRenderStatic && renderCalendar(),
@@ -1,4 +1,4 @@
1
- /* hash: ibx81 */
1
+ /* hash: 1yp9v */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-border-secondary: #e9e9eb;
@@ -43,31 +43,31 @@
43
43
  } :root {
44
44
  --calendar-input-icon-color: var(--color-light-graphic-primary);
45
45
  --calendar-input-popover-border-radius: var(--border-radius-m);
46
- } .calendar-input__component_4iygi {
46
+ } .calendar-input__component_a1sh2 {
47
47
  display: inline-block;
48
48
  outline: none;
49
49
  position: relative;
50
- } .calendar-input__block_4iygi {
50
+ } .calendar-input__block_a1sh2 {
51
51
  width: 100%;
52
- } .calendar-input__calendarContainer_4iygi {
52
+ } .calendar-input__calendarContainer_a1sh2 {
53
53
  display: inline-block;
54
54
  box-sizing: border-box;
55
55
  border-radius: var(--calendar-input-popover-border-radius);
56
56
  border: 1px solid var(--color-light-border-secondary)
57
- } @media (max-width: 374px) { .calendar-input__calendarContainer_4iygi {
57
+ } @media (max-width: 374px) { .calendar-input__calendarContainer_a1sh2 {
58
58
  width: 100%;
59
59
  min-width: 288px
60
60
  }
61
- } .calendar-input__calendarResponsive_4iygi {
61
+ } .calendar-input__calendarResponsive_a1sh2 {
62
62
  width: var(--calendar-width);
63
- } .calendar-input__calendarIcon_4iygi {
63
+ } .calendar-input__calendarIcon_a1sh2 {
64
64
  width: 24px;
65
65
  height: 24px;
66
66
  display: block;
67
67
  color: var(--calendar-input-icon-color)
68
- } .calendar-input__calendarIcon_4iygi:not(:only-child) {
68
+ } .calendar-input__calendarIcon_a1sh2:not(:only-child) {
69
69
  margin-right: var(--gap-2xs);
70
- } .calendar-input__nativeInput_4iygi {
70
+ } .calendar-input__nativeInput_a1sh2 {
71
71
  opacity: 0;
72
72
  position: absolute;
73
73
  top: 0;
@@ -76,8 +76,8 @@
76
76
  height: 100%;
77
77
  appearance: none;
78
78
  z-index: 1
79
- } .calendar-input__nativeInput_4iygi::-webkit-calendar-picker-indicator {
79
+ } .calendar-input__nativeInput_a1sh2::-webkit-calendar-picker-indicator {
80
80
  display: none;
81
- } .calendar-input__nativeInput_4iygi::-webkit-inner-spin-button {
81
+ } .calendar-input__nativeInput_a1sh2::-webkit-inner-spin-button {
82
82
  display: none;
83
83
  }
@@ -0,0 +1,2 @@
1
+ export * from "../Component.desktop";
2
+ export {};
@@ -1,15 +1,15 @@
1
- export { CalendarInputDesktop } from './Component.desktop.js';
1
+ export { CalendarInputDesktop } from '../Component.desktop.js';
2
2
  import 'tslib';
3
3
  import 'react';
4
4
  import '@alfalab/core-components-calendar/esm/desktop';
5
- import './components/calendar-input/Component.js';
5
+ import '../components/calendar-input/Component.js';
6
6
  import 'react-merge-refs';
7
7
  import 'classnames';
8
8
  import '@alfalab/core-components-calendar/esm/shared';
9
9
  import '@alfalab/core-components-date-input/esm';
10
10
  import '@alfalab/core-components-popover/esm';
11
11
  import '@alfalab/icons-glyph/CalendarMIcon';
12
- import './utils.js';
12
+ import '../utils.js';
13
13
  import 'date-fns/format';
14
14
  import 'date-fns/isSameDay';
15
15
  import 'date-fns/parse';
@@ -0,0 +1,2 @@
1
+ export * from "../Component.mobile";
2
+ export {};