@salutejs/plasma-new-hope 0.335.0-canary.2194.17367251959.0 → 0.335.0-canary.2196.17400757003.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 (230) hide show
  1. package/cjs/components/Autocomplete/Autocomplete.js +4 -1
  2. package/cjs/components/Autocomplete/Autocomplete.js.map +1 -1
  3. package/cjs/components/Autocomplete/FloatingPopover.js +5 -4
  4. package/cjs/components/Autocomplete/FloatingPopover.js.map +1 -1
  5. package/cjs/components/Calendar/Calendar.tokens.js +1 -0
  6. package/cjs/components/Calendar/Calendar.tokens.js.map +1 -1
  7. package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.js +3 -3
  8. package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.js.map +1 -1
  9. package/cjs/components/Combobox/ComboboxNew/Combobox.js +15 -30
  10. package/cjs/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
  11. package/cjs/components/Combobox/ComboboxNew/utils/getTextValue.js +24 -0
  12. package/cjs/components/Combobox/ComboboxNew/utils/getTextValue.js.map +1 -0
  13. package/cjs/components/DatePicker/DatePicker.tokens.js +1 -0
  14. package/cjs/components/DatePicker/DatePicker.tokens.js.map +1 -1
  15. package/cjs/components/DatePicker/DatePickerBase.styles.js +1 -1
  16. package/cjs/components/DatePicker/DatePickerBase.styles.js.map +1 -1
  17. package/cjs/components/DatePicker/{DatePickerBase.styles_10sa0ht.css → DatePickerBase.styles_1fnt3hc.css} +1 -1
  18. package/cjs/components/DatePicker/RangeDate/RangeDate.css +4 -4
  19. package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.css +2 -2
  20. package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles.js +1 -1
  21. package/{es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles_1n0dbxm.css → cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles_160e4y4.css} +2 -2
  22. package/cjs/components/DatePicker/SingleDate/SingleDate.css +2 -2
  23. package/cjs/components/Popup/Popup.js +8 -67
  24. package/cjs/components/Popup/Popup.js.map +1 -1
  25. package/cjs/components/Popup/ui/Draggable/Draggable.js +33 -0
  26. package/cjs/components/Popup/ui/Draggable/Draggable.js.map +1 -0
  27. package/cjs/components/Popup/ui/Resizable/Resizable.js +79 -0
  28. package/cjs/components/Popup/ui/Resizable/Resizable.js.map +1 -0
  29. package/cjs/components/Slider/ui/Handler/Handler.js +3 -3
  30. package/cjs/components/Slider/ui/Handler/Handler.js.map +1 -1
  31. package/cjs/components/Tooltip/Tooltip.js +22 -45
  32. package/cjs/components/Tooltip/Tooltip.js.map +1 -1
  33. package/cjs/components/Tooltip/hooks/useDelayedTooltip.js +49 -0
  34. package/cjs/components/Tooltip/hooks/useDelayedTooltip.js.map +1 -0
  35. package/cjs/components/Tree/Tree.css +6 -6
  36. package/cjs/components/Tree/Tree.js +9 -2
  37. package/cjs/components/Tree/Tree.js.map +1 -1
  38. package/cjs/components/Tree/Tree.styles.js +1 -1
  39. package/cjs/components/Tree/Tree.styles.js.map +1 -1
  40. package/cjs/components/Tree/Tree.styles_6sla5y.css +7 -0
  41. package/cjs/components/Tree/Tree.tokens.js +2 -1
  42. package/cjs/components/Tree/Tree.tokens.js.map +1 -1
  43. package/cjs/index.css +10 -10
  44. package/emotion/cjs/components/Autocomplete/Autocomplete.js +3 -1
  45. package/emotion/cjs/components/Autocomplete/FloatingPopover.js +31 -4
  46. package/emotion/cjs/components/Calendar/Calendar.tokens.js +1 -0
  47. package/emotion/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.js +3 -3
  48. package/emotion/cjs/components/Combobox/ComboboxNew/Combobox.js +26 -44
  49. package/emotion/cjs/components/Combobox/ComboboxNew/utils/getTextValue.js +25 -0
  50. package/emotion/cjs/components/Combobox/ComboboxNew/utils/index.js +4 -0
  51. package/emotion/cjs/components/DatePicker/DatePicker.tokens.js +1 -0
  52. package/emotion/cjs/components/DatePicker/DatePickerBase.styles.js +5 -5
  53. package/emotion/cjs/components/Popup/Popup.js +7 -69
  54. package/emotion/cjs/components/Popup/ui/Draggable/Draggable.js +75 -0
  55. package/emotion/cjs/components/Popup/ui/Resizable/Resizable.js +114 -0
  56. package/emotion/cjs/components/Popup/ui/index.js +20 -0
  57. package/emotion/cjs/components/Tooltip/Tooltip.js +19 -41
  58. package/emotion/cjs/components/Tooltip/hooks/index.js +11 -0
  59. package/emotion/cjs/components/Tooltip/hooks/useDelayedTooltip.js +93 -0
  60. package/emotion/cjs/components/Tree/Tree.js +7 -2
  61. package/emotion/cjs/components/Tree/Tree.styles.js +13 -13
  62. package/emotion/cjs/components/Tree/Tree.tokens.js +2 -1
  63. package/emotion/cjs/examples/components/Calendar/CalendarBase.config.js +5 -5
  64. package/emotion/cjs/examples/components/Calendar/CalendarDouble.config.js +5 -5
  65. package/emotion/cjs/examples/components/Chip/Chip.config.js +13 -14
  66. package/emotion/cjs/examples/components/Combobox/Combobox.js +15 -0
  67. package/emotion/cjs/examples/components/DatePicker/DatePicker.config.js +7 -7
  68. package/emotion/es/components/Autocomplete/Autocomplete.js +3 -1
  69. package/emotion/es/components/Autocomplete/FloatingPopover.js +31 -4
  70. package/emotion/es/components/Calendar/Calendar.tokens.js +1 -0
  71. package/emotion/es/components/Calendar/ui/CalendarHeader/CalendarHeader.js +4 -4
  72. package/emotion/es/components/Combobox/ComboboxNew/Combobox.js +12 -30
  73. package/emotion/es/components/Combobox/ComboboxNew/utils/getTextValue.js +16 -0
  74. package/emotion/es/components/Combobox/ComboboxNew/utils/index.js +1 -0
  75. package/emotion/es/components/DatePicker/DatePicker.tokens.js +1 -0
  76. package/emotion/es/components/DatePicker/DatePickerBase.styles.js +5 -5
  77. package/emotion/es/components/Popup/Popup.js +6 -63
  78. package/emotion/es/components/Popup/ui/Draggable/Draggable.js +19 -0
  79. package/emotion/es/components/Popup/ui/Resizable/Resizable.js +63 -0
  80. package/emotion/es/components/Popup/ui/index.js +2 -0
  81. package/emotion/es/components/Tooltip/Tooltip.js +20 -42
  82. package/emotion/es/components/Tooltip/hooks/index.js +1 -0
  83. package/emotion/es/components/Tooltip/hooks/useDelayedTooltip.js +83 -0
  84. package/emotion/es/components/Tree/Tree.js +7 -2
  85. package/emotion/es/components/Tree/Tree.styles.js +13 -13
  86. package/emotion/es/components/Tree/Tree.tokens.js +2 -1
  87. package/emotion/es/examples/components/Calendar/CalendarBase.config.js +5 -5
  88. package/emotion/es/examples/components/Calendar/CalendarDouble.config.js +5 -5
  89. package/emotion/es/examples/components/Chip/Chip.config.js +13 -14
  90. package/emotion/es/examples/components/Combobox/Combobox.js +7 -0
  91. package/emotion/es/examples/components/DatePicker/DatePicker.config.js +7 -7
  92. package/es/components/Autocomplete/Autocomplete.js +4 -1
  93. package/es/components/Autocomplete/Autocomplete.js.map +1 -1
  94. package/es/components/Autocomplete/FloatingPopover.js +6 -5
  95. package/es/components/Autocomplete/FloatingPopover.js.map +1 -1
  96. package/es/components/Calendar/Calendar.tokens.js +1 -0
  97. package/es/components/Calendar/Calendar.tokens.js.map +1 -1
  98. package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.js +4 -4
  99. package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.js.map +1 -1
  100. package/es/components/Combobox/ComboboxNew/Combobox.js +15 -30
  101. package/es/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
  102. package/es/components/Combobox/ComboboxNew/utils/getTextValue.js +20 -0
  103. package/es/components/Combobox/ComboboxNew/utils/getTextValue.js.map +1 -0
  104. package/es/components/DatePicker/DatePicker.tokens.js +1 -0
  105. package/es/components/DatePicker/DatePicker.tokens.js.map +1 -1
  106. package/es/components/DatePicker/DatePickerBase.styles.js +1 -1
  107. package/es/components/DatePicker/DatePickerBase.styles.js.map +1 -1
  108. package/es/components/DatePicker/{DatePickerBase.styles_10sa0ht.css → DatePickerBase.styles_1fnt3hc.css} +1 -1
  109. package/es/components/DatePicker/RangeDate/RangeDate.css +4 -4
  110. package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.css +2 -2
  111. package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles.js +1 -1
  112. package/{cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles_1n0dbxm.css → es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles_160e4y4.css} +2 -2
  113. package/es/components/DatePicker/SingleDate/SingleDate.css +2 -2
  114. package/es/components/Popup/Popup.js +7 -65
  115. package/es/components/Popup/Popup.js.map +1 -1
  116. package/es/components/Popup/ui/Draggable/Draggable.js +24 -0
  117. package/es/components/Popup/ui/Draggable/Draggable.js.map +1 -0
  118. package/es/components/Popup/ui/Resizable/Resizable.js +71 -0
  119. package/es/components/Popup/ui/Resizable/Resizable.js.map +1 -0
  120. package/es/components/Slider/ui/Handler/Handler.js +2 -2
  121. package/es/components/Slider/ui/Handler/Handler.js.map +1 -1
  122. package/es/components/Tooltip/Tooltip.js +23 -46
  123. package/es/components/Tooltip/Tooltip.js.map +1 -1
  124. package/es/components/Tooltip/hooks/useDelayedTooltip.js +45 -0
  125. package/es/components/Tooltip/hooks/useDelayedTooltip.js.map +1 -0
  126. package/es/components/Tree/Tree.css +6 -6
  127. package/es/components/Tree/Tree.js +9 -2
  128. package/es/components/Tree/Tree.js.map +1 -1
  129. package/es/components/Tree/Tree.styles.js +1 -1
  130. package/es/components/Tree/Tree.styles.js.map +1 -1
  131. package/es/components/Tree/Tree.styles_6sla5y.css +7 -0
  132. package/es/components/Tree/Tree.tokens.js +2 -1
  133. package/es/components/Tree/Tree.tokens.js.map +1 -1
  134. package/es/index.css +10 -10
  135. package/package.json +4 -4
  136. package/styled-components/cjs/components/Autocomplete/Autocomplete.js +3 -1
  137. package/styled-components/cjs/components/Autocomplete/FloatingPopover.js +31 -4
  138. package/styled-components/cjs/components/Calendar/Calendar.tokens.js +1 -0
  139. package/styled-components/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.js +3 -3
  140. package/styled-components/cjs/components/Combobox/ComboboxNew/Combobox.js +26 -44
  141. package/styled-components/cjs/components/Combobox/ComboboxNew/utils/getTextValue.js +25 -0
  142. package/styled-components/cjs/components/Combobox/ComboboxNew/utils/index.js +4 -0
  143. package/styled-components/cjs/components/DatePicker/DatePicker.tokens.js +1 -0
  144. package/styled-components/cjs/components/DatePicker/DatePickerBase.styles.js +3 -3
  145. package/styled-components/cjs/components/Popup/Popup.js +7 -69
  146. package/styled-components/cjs/components/Popup/ui/Draggable/Draggable.js +75 -0
  147. package/styled-components/cjs/components/Popup/ui/Resizable/Resizable.js +114 -0
  148. package/styled-components/cjs/components/Popup/ui/index.js +20 -0
  149. package/styled-components/cjs/components/Tooltip/Tooltip.js +18 -40
  150. package/styled-components/cjs/components/Tooltip/hooks/index.js +11 -0
  151. package/styled-components/cjs/components/Tooltip/hooks/useDelayedTooltip.js +93 -0
  152. package/styled-components/cjs/components/Tree/Tree.js +7 -2
  153. package/styled-components/cjs/components/Tree/Tree.styles.js +13 -10
  154. package/styled-components/cjs/components/Tree/Tree.tokens.js +2 -1
  155. package/styled-components/cjs/examples/components/Calendar/CalendarBase.config.js +8 -4
  156. package/styled-components/cjs/examples/components/Calendar/CalendarDouble.config.js +8 -4
  157. package/styled-components/cjs/examples/components/Chip/Chip.config.js +0 -21
  158. package/styled-components/cjs/examples/components/Combobox/Combobox.js +15 -0
  159. package/styled-components/cjs/examples/components/DatePicker/DatePicker.config.js +8 -4
  160. package/styled-components/es/components/Autocomplete/Autocomplete.js +3 -1
  161. package/styled-components/es/components/Autocomplete/FloatingPopover.js +31 -4
  162. package/styled-components/es/components/Calendar/Calendar.tokens.js +1 -0
  163. package/styled-components/es/components/Calendar/ui/CalendarHeader/CalendarHeader.js +4 -4
  164. package/styled-components/es/components/Combobox/ComboboxNew/Combobox.js +12 -30
  165. package/styled-components/es/components/Combobox/ComboboxNew/utils/getTextValue.js +16 -0
  166. package/styled-components/es/components/Combobox/ComboboxNew/utils/index.js +1 -0
  167. package/styled-components/es/components/DatePicker/DatePicker.tokens.js +1 -0
  168. package/styled-components/es/components/DatePicker/DatePickerBase.styles.js +3 -3
  169. package/styled-components/es/components/Popup/Popup.js +6 -63
  170. package/styled-components/es/components/Popup/ui/Draggable/Draggable.js +19 -0
  171. package/styled-components/es/components/Popup/ui/Resizable/Resizable.js +63 -0
  172. package/styled-components/es/components/Popup/ui/index.js +2 -0
  173. package/styled-components/es/components/Tooltip/Tooltip.js +19 -41
  174. package/styled-components/es/components/Tooltip/hooks/index.js +1 -0
  175. package/styled-components/es/components/Tooltip/hooks/useDelayedTooltip.js +83 -0
  176. package/styled-components/es/components/Tree/Tree.js +7 -2
  177. package/styled-components/es/components/Tree/Tree.styles.js +13 -10
  178. package/styled-components/es/components/Tree/Tree.tokens.js +2 -1
  179. package/styled-components/es/examples/components/Calendar/CalendarBase.config.js +8 -4
  180. package/styled-components/es/examples/components/Calendar/CalendarDouble.config.js +8 -4
  181. package/styled-components/es/examples/components/Chip/Chip.config.js +0 -21
  182. package/styled-components/es/examples/components/Combobox/Combobox.js +0 -7
  183. package/styled-components/es/examples/components/DatePicker/DatePicker.config.js +8 -4
  184. package/types/components/Autocomplete/Autocomplete.d.ts.map +1 -1
  185. package/types/components/Autocomplete/Autocomplete.types.d.ts +6 -0
  186. package/types/components/Autocomplete/Autocomplete.types.d.ts.map +1 -1
  187. package/types/components/Calendar/Calendar.tokens.d.ts +1 -0
  188. package/types/components/Calendar/Calendar.tokens.d.ts.map +1 -1
  189. package/types/components/Combobox/ComboboxNew/Combobox.d.ts.map +1 -1
  190. package/types/components/Combobox/ComboboxNew/Combobox.types.d.ts +1 -1
  191. package/types/components/Combobox/ComboboxNew/Combobox.types.d.ts.map +1 -1
  192. package/types/components/Combobox/ComboboxNew/utils/getTextValue.d.ts +4 -0
  193. package/types/components/Combobox/ComboboxNew/utils/getTextValue.d.ts.map +1 -0
  194. package/types/components/Combobox/ComboboxNew/utils/index.d.ts +1 -0
  195. package/types/components/Combobox/ComboboxNew/utils/index.d.ts.map +1 -1
  196. package/types/components/DatePicker/DatePicker.tokens.d.ts +1 -0
  197. package/types/components/DatePicker/DatePicker.tokens.d.ts.map +1 -1
  198. package/types/components/DatePicker/DatePickerBase.styles.d.ts.map +1 -1
  199. package/types/components/Popup/Popup.d.ts.map +1 -1
  200. package/types/components/Popup/ui/Draggable/Draggable.d.ts +6 -0
  201. package/types/components/Popup/ui/Draggable/Draggable.d.ts.map +1 -0
  202. package/types/components/Popup/ui/Resizable/Resizable.d.ts +7 -0
  203. package/types/components/Popup/ui/Resizable/Resizable.d.ts.map +1 -0
  204. package/types/components/Popup/ui/index.d.ts +3 -0
  205. package/types/components/Popup/ui/index.d.ts.map +1 -0
  206. package/types/components/Tooltip/Tooltip.d.ts.map +1 -1
  207. package/types/components/Tooltip/Tooltip.types.d.ts +31 -20
  208. package/types/components/Tooltip/Tooltip.types.d.ts.map +1 -1
  209. package/types/components/Tooltip/hooks/index.d.ts +2 -0
  210. package/types/components/Tooltip/hooks/index.d.ts.map +1 -0
  211. package/types/components/Tooltip/hooks/useDelayedTooltip.d.ts +7 -0
  212. package/types/components/Tooltip/hooks/useDelayedTooltip.d.ts.map +1 -0
  213. package/types/components/Tree/Tree.d.ts.map +1 -1
  214. package/types/components/Tree/Tree.styles.d.ts.map +1 -1
  215. package/types/components/Tree/Tree.tokens.d.ts +1 -0
  216. package/types/components/Tree/Tree.tokens.d.ts.map +1 -1
  217. package/types/components/Tree/Tree.types.d.ts +11 -4
  218. package/types/components/Tree/Tree.types.d.ts.map +1 -1
  219. package/types/examples/components/Autocomplete/Autocomplete.d.ts +8 -0
  220. package/types/examples/components/Autocomplete/Autocomplete.d.ts.map +1 -1
  221. package/types/examples/components/Calendar/CalendarBase.config.d.ts.map +1 -1
  222. package/types/examples/components/Calendar/CalendarDouble.config.d.ts.map +1 -1
  223. package/types/examples/components/Chip/Chip.config.d.ts +0 -1
  224. package/types/examples/components/Chip/Chip.config.d.ts.map +1 -1
  225. package/types/examples/components/Chip/Chip.d.ts +0 -1
  226. package/types/examples/components/Chip/Chip.d.ts.map +1 -1
  227. package/types/examples/components/Combobox/Combobox.d.ts.map +1 -1
  228. package/types/examples/components/DatePicker/DatePicker.config.d.ts.map +1 -1
  229. package/cjs/components/Tree/Tree.styles_1w91oy6.css +0 -7
  230. package/es/components/Tree/Tree.styles_1w91oy6.css +0 -7
@@ -11,7 +11,7 @@ import { StyledTextField } from './ui/TextField/TextField.styles.js';
11
11
  import { VirtualList } from './ui/VirtualList/VirtualList.js';
12
12
  import { SuggestionItem } from './ui/SuggestionItem/SuggestionItem.js';
13
13
 
14
- var _excluded = ["value", "defaultValue", "onChange", "suggestions", "view", "size", "labelPlacement", "keepPlaceholder", "disabled", "readOnly", "label", "leftHelper", "contentLeft", "contentRight", "textBefore", "textAfter", "onScroll", "listMaxHeight", "listWidth", "portal", "zIndex", "filter", "onSuggestionSelect", "threshold", "renderList", "renderListEnd", "renderItem", "onSearch", "hintText", "hintView", "hintSize", "beforeList", "afterList", "virtual", "_offset"];
14
+ var _excluded = ["value", "defaultValue", "onChange", "suggestions", "view", "size", "labelPlacement", "keepPlaceholder", "disabled", "readOnly", "label", "leftHelper", "contentLeft", "contentRight", "textBefore", "textAfter", "onScroll", "listMaxHeight", "listWidth", "portal", "zIndex", "filter", "onSuggestionSelect", "threshold", "renderList", "renderListEnd", "renderItem", "onSearch", "hintText", "hintView", "hintSize", "beforeList", "afterList", "virtual", "flip", "_offset"];
15
15
 
16
16
  /**
17
17
  * Компонент Autocomplete. Поле ввода с подсказками в выпадающем списке.
@@ -58,6 +58,8 @@ var autocompleteRoot = function autocompleteRoot(Root) {
58
58
  afterList = _ref.afterList,
59
59
  _ref$virtual = _ref.virtual,
60
60
  virtual = _ref$virtual === void 0 ? false : _ref$virtual,
61
+ _ref$flip = _ref.flip,
62
+ flip = _ref$flip === void 0 ? false : _ref$flip,
61
63
  _offset = _ref._offset,
62
64
  rest = _objectWithoutProperties(_ref, _excluded);
63
65
  var _useReducer = useReducer(focusedReducer, null),
@@ -140,6 +142,7 @@ var autocompleteRoot = function autocompleteRoot(Root) {
140
142
  zIndex: zIndex,
141
143
  listWidth: listWidth,
142
144
  offset: _offset,
145
+ flip: flip,
143
146
  target: function target(referenceRef) {
144
147
  return /*#__PURE__*/React.createElement(StyledTextField, _extends({
145
148
  ref: ref,
@@ -1 +1 @@
1
- {"version":3,"file":"Autocomplete.js","sources":["../../../src/components/Autocomplete/Autocomplete.tsx"],"sourcesContent":["import React, { forwardRef, useState, useReducer, useRef } from 'react';\nimport { safeUseId } from 'src/utils';\nimport { useDidMountEffect, useOutsideClick } from 'src/hooks';\nimport { RootProps } from 'src/engines';\n\nimport { FloatingPopover } from './FloatingPopover';\nimport { focusedReducer } from './reducers/focusedReducer';\nimport { SuggestionItem, StyledTextField, VirtualList } from './ui';\nimport { Ul, InfiniteLoaderWrapper, base, StyledLeftHelper, ListWrapper } from './Autocomplete.styles';\nimport type { AutocompleteProps, SuggestionItemType } from './Autocomplete.types';\nimport { useKeyNavigation } from './hooks/useKeyboardNavigation';\n\n/**\n * Компонент Autocomplete. Поле ввода с подсказками в выпадающем списке.\n */\nexport const autocompleteRoot = (Root: RootProps<HTMLInputElement, Omit<AutocompleteProps, 'hintText'>>) =>\n forwardRef<HTMLInputElement, AutocompleteProps>(\n (\n {\n value: outerValue,\n defaultValue,\n onChange,\n suggestions,\n view,\n size,\n labelPlacement,\n keepPlaceholder,\n disabled,\n readOnly,\n label,\n leftHelper,\n contentLeft,\n contentRight,\n textBefore,\n textAfter,\n onScroll,\n listMaxHeight = '25rem',\n listWidth,\n portal,\n zIndex,\n filter,\n onSuggestionSelect,\n threshold = 2,\n renderList,\n renderListEnd,\n renderItem,\n onSearch,\n hintText,\n hintView = 'default',\n hintSize = 'm',\n beforeList,\n afterList,\n virtual = false,\n // @ts-ignore\n _offset,\n ...rest\n },\n ref,\n ) => {\n const [focused, dispatchFocused] = useReducer(focusedReducer, null);\n const [innerValue, setInnerValue] = useState<string>(defaultValue || '');\n const [isOpen, setIsOpen] = useState(false);\n\n const listId = safeUseId();\n const value = outerValue ?? innerValue;\n\n const helperTextId = safeUseId();\n const floatingPopoverRef = useRef<HTMLDivElement>(null);\n\n const targetRef = useOutsideClick<HTMLUListElement>(() => {\n setIsOpen(false);\n }, floatingPopoverRef);\n\n const handleFocus = () => {\n if (value.toString().length >= threshold) {\n setIsOpen(true);\n }\n };\n\n const handleItemClick = (e: SuggestionItemType) => {\n setInnerValue(e.label);\n\n if (onSuggestionSelect) {\n onSuggestionSelect(e);\n }\n\n setIsOpen(false);\n };\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const currentValue = e.target.value;\n\n setInnerValue(currentValue);\n\n if (onChange) {\n onChange(e);\n }\n\n if (currentValue.toString().length >= threshold) {\n setIsOpen(true);\n } else {\n setIsOpen(false);\n }\n };\n\n const defaultFilterCallback = ({ label }: { label: string }) => {\n return label.toLowerCase().includes(value.toString().toLowerCase());\n };\n\n const helperTextStopPropagation = (event: React.MouseEvent<HTMLDivElement>) => {\n event.stopPropagation();\n };\n\n const finalResults = suggestions?.filter(filter || defaultFilterCallback) || [];\n\n const { onKeyDown } = useKeyNavigation({\n isOpen,\n setIsOpen,\n focused,\n dispatchFocused,\n finalResults,\n handleItemClick,\n });\n\n useDidMountEffect(() => {\n dispatchFocused({ type: 'reset' });\n }, [value]);\n\n return (\n <Root\n view={view}\n size={size}\n labelPlacement={labelPlacement}\n disabled={disabled}\n readOnly={readOnly}\n hintView={hintView}\n hintSize={hintSize}\n >\n <FloatingPopover\n ref={floatingPopoverRef}\n opened={isOpen}\n portal={portal}\n zIndex={zIndex}\n listWidth={listWidth}\n offset={_offset}\n target={(referenceRef) => (\n <StyledTextField\n ref={ref}\n inputWrapperRef={referenceRef}\n value={value}\n onChange={handleChange}\n onSearch={focused === null ? onSearch : undefined}\n size={size}\n view={view}\n disabled={disabled}\n readOnly={readOnly}\n label={label}\n contentLeft={contentLeft}\n contentRight={contentRight}\n textBefore={textBefore}\n textAfter={textAfter}\n onFocus={handleFocus}\n onKeyDown={onKeyDown}\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-controls={listId}\n aria-expanded={isOpen}\n aria-activedescendant={`${listId}/${focused}`}\n aria-describedby={helperTextId}\n hintText={String(hintText || '')}\n labelPlacement={labelPlacement}\n keepPlaceholder={keepPlaceholder}\n leftHelper={\n leftHelper && (\n <StyledLeftHelper onClick={helperTextStopPropagation}>\n {leftHelper}\n </StyledLeftHelper>\n )\n }\n {...rest}\n />\n )}\n >\n {(renderList && renderList(finalResults)) ||\n (Boolean(finalResults.length) && (\n <Root\n view={view}\n size={size}\n labelPlacement={labelPlacement}\n disabled={disabled}\n readOnly={readOnly}\n >\n <ListWrapper>\n <Ul\n ref={targetRef}\n id={listId}\n role=\"listbox\"\n aria-label={label}\n onScroll={virtual ? undefined : onScroll}\n listMaxHeight={listMaxHeight}\n virtual={virtual}\n >\n {virtual ? (\n <VirtualList\n items={finalResults}\n onClick={handleItemClick}\n listId={listId}\n listMaxHeight={listMaxHeight}\n onScroll={onScroll}\n renderItem={renderItem}\n />\n ) : (\n <>\n {beforeList}\n\n {finalResults.map((suggestion, index) => (\n <SuggestionItem\n key={index}\n item={suggestion}\n onClick={handleItemClick}\n id={`${listId}/${index}`}\n focused={focused === index}\n renderItem={renderItem}\n />\n ))}\n\n {afterList}\n </>\n )}\n\n {renderListEnd && (\n <InfiniteLoaderWrapper>{renderListEnd()}</InfiniteLoaderWrapper>\n )}\n </Ul>\n </ListWrapper>\n </Root>\n ))}\n </FloatingPopover>\n </Root>\n );\n },\n );\n\nexport const autocompleteConfig = {\n name: 'Autocomplete',\n tag: 'div',\n layout: autocompleteRoot,\n base,\n defaults: {\n view: 'default',\n size: 'l',\n labelPlacement: 'outer',\n },\n variations: {\n view: {\n css: '',\n },\n },\n};\n"],"names":["autocompleteRoot","Root","forwardRef","_ref","ref","_StyledLeftHelper","outerValue","value","defaultValue","onChange","suggestions","view","size","labelPlacement","keepPlaceholder","disabled","readOnly","label","leftHelper","contentLeft","contentRight","textBefore","textAfter","onScroll","_ref$listMaxHeight","listMaxHeight","listWidth","portal","zIndex","filter","onSuggestionSelect","_ref$threshold","threshold","renderList","renderListEnd","renderItem","onSearch","hintText","_ref$hintView","hintView","_ref$hintSize","hintSize","beforeList","afterList","_ref$virtual","virtual","_offset","rest","_objectWithoutProperties","_excluded","_useReducer","useReducer","focusedReducer","_useReducer2","_slicedToArray","focused","dispatchFocused","_useState","useState","_useState2","innerValue","setInnerValue","_useState3","_useState4","isOpen","setIsOpen","listId","safeUseId","helperTextId","floatingPopoverRef","useRef","targetRef","useOutsideClick","handleFocus","toString","length","handleItemClick","e","handleChange","currentValue","target","defaultFilterCallback","_ref2","toLowerCase","includes","helperTextStopPropagation","event","stopPropagation","finalResults","_useKeyNavigation","useKeyNavigation","onKeyDown","useDidMountEffect","type","React","createElement","FloatingPopover","opened","offset","referenceRef","StyledTextField","_extends","inputWrapperRef","undefined","onFocus","role","concat","String","StyledLeftHelper","onClick","Boolean","ListWrapper","Ul","id","VirtualList","items","Fragment","map","suggestion","index","SuggestionItem","key","item","InfiniteLoaderWrapper","autocompleteConfig","name","tag","layout","base","defaults","variations","css"],"mappings":";;;;;;;;;;;;;;;AAYA;AACA;AACA;IACaA,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,IAAsE,EAAA;AAAA,EAAA,oBACnGC,UAAU,CACN,UAAAC,IAAA,EAwCIC,GAAG,EACF;AAAA,IAAA,IAAAC,iBAAA,CAAA;AAAA,IAAA,IAvCUC,UAAU,GAAAH,IAAA,CAAjBI,KAAK;MACLC,YAAY,GAAAL,IAAA,CAAZK,YAAY;MACZC,QAAQ,GAAAN,IAAA,CAARM,QAAQ;MACRC,WAAW,GAAAP,IAAA,CAAXO,WAAW;MACXC,IAAI,GAAAR,IAAA,CAAJQ,IAAI;MACJC,IAAI,GAAAT,IAAA,CAAJS,IAAI;MACJC,cAAc,GAA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E;AACRvH,IAAAA,IAAI,EAAE;AACFwH,MAAAA,GAAG,EAAE,EAAA;AACT,KAAA;AACJ,GAAA;AACJ;;;;"}
1
+ {"version":3,"file":"Autocomplete.js","sources":["../../../src/components/Autocomplete/Autocomplete.tsx"],"sourcesContent":["import React, { forwardRef, useState, useReducer, useRef } from 'react';\nimport { safeUseId } from 'src/utils';\nimport { useDidMountEffect, useOutsideClick } from 'src/hooks';\nimport { RootProps } from 'src/engines';\n\nimport { FloatingPopover } from './FloatingPopover';\nimport { focusedReducer } from './reducers/focusedReducer';\nimport { SuggestionItem, StyledTextField, VirtualList } from './ui';\nimport { Ul, InfiniteLoaderWrapper, base, StyledLeftHelper, ListWrapper } from './Autocomplete.styles';\nimport type { AutocompleteProps, SuggestionItemType } from './Autocomplete.types';\nimport { useKeyNavigation } from './hooks/useKeyboardNavigation';\n\n/**\n * Компонент Autocomplete. Поле ввода с подсказками в выпадающем списке.\n */\nexport const autocompleteRoot = (Root: RootProps<HTMLInputElement, Omit<AutocompleteProps, 'hintText'>>) =>\n forwardRef<HTMLInputElement, AutocompleteProps>(\n (\n {\n value: outerValue,\n defaultValue,\n onChange,\n suggestions,\n view,\n size,\n labelPlacement,\n keepPlaceholder,\n disabled,\n readOnly,\n label,\n leftHelper,\n contentLeft,\n contentRight,\n textBefore,\n textAfter,\n onScroll,\n listMaxHeight = '25rem',\n listWidth,\n portal,\n zIndex,\n filter,\n onSuggestionSelect,\n threshold = 2,\n renderList,\n renderListEnd,\n renderItem,\n onSearch,\n hintText,\n hintView = 'default',\n hintSize = 'm',\n beforeList,\n afterList,\n virtual = false,\n flip = false,\n // @ts-ignore\n _offset,\n ...rest\n },\n ref,\n ) => {\n const [focused, dispatchFocused] = useReducer(focusedReducer, null);\n const [innerValue, setInnerValue] = useState<string>(defaultValue || '');\n const [isOpen, setIsOpen] = useState(false);\n\n const listId = safeUseId();\n const value = outerValue ?? innerValue;\n\n const helperTextId = safeUseId();\n const floatingPopoverRef = useRef<HTMLDivElement>(null);\n\n const targetRef = useOutsideClick<HTMLUListElement>(() => {\n setIsOpen(false);\n }, floatingPopoverRef);\n\n const handleFocus = () => {\n if (value.toString().length >= threshold) {\n setIsOpen(true);\n }\n };\n\n const handleItemClick = (e: SuggestionItemType) => {\n setInnerValue(e.label);\n\n if (onSuggestionSelect) {\n onSuggestionSelect(e);\n }\n\n setIsOpen(false);\n };\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const currentValue = e.target.value;\n\n setInnerValue(currentValue);\n\n if (onChange) {\n onChange(e);\n }\n\n if (currentValue.toString().length >= threshold) {\n setIsOpen(true);\n } else {\n setIsOpen(false);\n }\n };\n\n const defaultFilterCallback = ({ label }: { label: string }) => {\n return label.toLowerCase().includes(value.toString().toLowerCase());\n };\n\n const helperTextStopPropagation = (event: React.MouseEvent<HTMLDivElement>) => {\n event.stopPropagation();\n };\n\n const finalResults = suggestions?.filter(filter || defaultFilterCallback) || [];\n\n const { onKeyDown } = useKeyNavigation({\n isOpen,\n setIsOpen,\n focused,\n dispatchFocused,\n finalResults,\n handleItemClick,\n });\n\n useDidMountEffect(() => {\n dispatchFocused({ type: 'reset' });\n }, [value]);\n\n return (\n <Root\n view={view}\n size={size}\n labelPlacement={labelPlacement}\n disabled={disabled}\n readOnly={readOnly}\n hintView={hintView}\n hintSize={hintSize}\n >\n <FloatingPopover\n ref={floatingPopoverRef}\n opened={isOpen}\n portal={portal}\n zIndex={zIndex}\n listWidth={listWidth}\n offset={_offset}\n flip={flip}\n target={(referenceRef) => (\n <StyledTextField\n ref={ref}\n inputWrapperRef={referenceRef}\n value={value}\n onChange={handleChange}\n onSearch={focused === null ? onSearch : undefined}\n size={size}\n view={view}\n disabled={disabled}\n readOnly={readOnly}\n label={label}\n contentLeft={contentLeft}\n contentRight={contentRight}\n textBefore={textBefore}\n textAfter={textAfter}\n onFocus={handleFocus}\n onKeyDown={onKeyDown}\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-controls={listId}\n aria-expanded={isOpen}\n aria-activedescendant={`${listId}/${focused}`}\n aria-describedby={helperTextId}\n hintText={String(hintText || '')}\n labelPlacement={labelPlacement}\n keepPlaceholder={keepPlaceholder}\n leftHelper={\n leftHelper && (\n <StyledLeftHelper onClick={helperTextStopPropagation}>\n {leftHelper}\n </StyledLeftHelper>\n )\n }\n {...rest}\n />\n )}\n >\n {(renderList && renderList(finalResults)) ||\n (Boolean(finalResults.length) && (\n <Root\n view={view}\n size={size}\n labelPlacement={labelPlacement}\n disabled={disabled}\n readOnly={readOnly}\n >\n <ListWrapper>\n <Ul\n ref={targetRef}\n id={listId}\n role=\"listbox\"\n aria-label={label}\n onScroll={virtual ? undefined : onScroll}\n listMaxHeight={listMaxHeight}\n virtual={virtual}\n >\n {virtual ? (\n <VirtualList\n items={finalResults}\n onClick={handleItemClick}\n listId={listId}\n listMaxHeight={listMaxHeight}\n onScroll={onScroll}\n renderItem={renderItem}\n />\n ) : (\n <>\n {beforeList}\n\n {finalResults.map((suggestion, index) => (\n <SuggestionItem\n key={index}\n item={suggestion}\n onClick={handleItemClick}\n id={`${listId}/${index}`}\n focused={focused === index}\n renderItem={renderItem}\n />\n ))}\n\n {afterList}\n </>\n )}\n\n {renderListEnd && (\n <InfiniteLoaderWrapper>{renderListEnd()}</InfiniteLoaderWrapper>\n )}\n </Ul>\n </ListWrapper>\n </Root>\n ))}\n </FloatingPopover>\n </Root>\n );\n },\n );\n\nexport const autocompleteConfig = {\n name: 'Autocomplete',\n tag: 'div',\n layout: autocompleteRoot,\n base,\n defaults: {\n view: 'default',\n size: 'l',\n labelPlacement: 'outer',\n },\n variations: {\n view: {\n css: '',\n },\n },\n};\n"],"names":["autocompleteRoot","Root","forwardRef","_ref","ref","_StyledLeftHelper","outerValue","value","defaultValue","onChange","suggestions","view","size","labelPlacement","keepPlaceholder","disabled","readOnly","label","leftHelper","contentLeft","contentRight","textBefore","textAfter","onScroll","_ref$listMaxHeight","listMaxHeight","listWidth","portal","zIndex","filter","onSuggestionSelect","_ref$threshold","threshold","renderList","renderListEnd","renderItem","onSearch","hintText","_ref$hintView","hintView","_ref$hintSize","hintSize","beforeList","afterList","_ref$virtual","virtual","_ref$flip","flip","_offset","rest","_objectWithoutProperties","_excluded","_useReducer","useReducer","focusedReducer","_useReducer2","_slicedToArray","focused","dispatchFocused","_useState","useState","_useState2","innerValue","setInnerValue","_useState3","_useState4","isOpen","setIsOpen","listId","safeUseId","helperTextId","floatingPopoverRef","useRef","targetRef","useOutsideClick","handleFocus","toString","length","handleItemClick","e","handleChange","currentValue","target","defaultFilterCallback","_ref2","toLowerCase","includes","helperTextStopPropagation","event","stopPropagation","finalResults","_useKeyNavigation","useKeyNavigation","onKeyDown","useDidMountEffect","type","React","createElement","FloatingPopover","opened","offset","referenceRef","StyledTextField","_extends","inputWrapperRef","undefined","onFocus","role","concat","String","StyledLeftHelper","onClick","Boolean","ListWrapper","Ul","id","VirtualList","items","Fragment","map","suggestion","index","SuggestionItem","key","item","InfiniteLoaderWrapper","autocompleteConfig","name","tag","layout","base","defaults","variations","css"],"mappings":";;;;;;;;;;;;;;;AAYA;AACA;AACA;IACaA,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,IAAsE,EAAA;AAAA,EAAA,oBACnGC,UAAU,CACN,UAAAC,IAAA,EAyCIC,GAAG,EACF;AAAA,IAAA,IAAAC,iBAAA,CAAA;AAAA,IAAA,IAxCUC,UAAU,GAAAH,IAAA,CAAjBI,KAAK;MACLC,YAAY,GAAAL,IAAA,CAAZK,YAAY;MACZC,QAAQ,GAAAN,IAAA,CAARM,QAAQ;MACRC,WAAW,GAAAP,IAAA,CAAXO,WAAW;MACXC,IAAI,GAAAR,IAAA,CAAJQ,IAAI;MACJC,IAAI,GAAAT,IAAA,CAAJS,IAAI;MACJC,cAAc,GAAAV,IAAA,CAAdU,cAAc;MACdC,eAAe,GAAAX,IAAA,CAAfW,eAAe;MACfC,QAAQ,GAAAZ,IAAA,CAARY,QAAQ;MACRC,QAAQ,GAA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GACnB;AACDuH,EAAAA,UAAU,EAAE;AACRzH,IAAAA,IAAI,EAAE;AACF0H,MAAAA,GAAG,EAAE,EAAA;AACT,KAAA;AACJ,GAAA;AACJ;;;;"}
@@ -1,4 +1,4 @@
1
- import { objectSpread2 as _objectSpread2 } from '../../_virtual/_rollupPluginBabelHelpers.js';
1
+ import { toConsumableArray as _toConsumableArray, objectSpread2 as _objectSpread2 } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
2
  import { useFloating, autoUpdate, offset, flip, shift, size, FloatingPortal } from '@floating-ui/react';
3
3
  import React, { forwardRef } from 'react';
4
4
  import { safeUseId } from '../../utils/react.js';
@@ -10,7 +10,8 @@ var FloatingPopover = /*#__PURE__*/forwardRef(function (_ref, ref) {
10
10
  portal = _ref.portal,
11
11
  zIndex = _ref.zIndex,
12
12
  listWidth = _ref.listWidth,
13
- offset$1 = _ref.offset;
13
+ offset$1 = _ref.offset,
14
+ flipFlag = _ref.flip;
14
15
  var _useFloating = useFloating({
15
16
  whileElementsMounted: function whileElementsMounted(referenceEl, floatingEl, update) {
16
17
  return autoUpdate(referenceEl, floatingEl, update, {
@@ -24,9 +25,9 @@ var FloatingPopover = /*#__PURE__*/forwardRef(function (_ref, ref) {
24
25
  middleware: [offset({
25
26
  mainAxis: (offset$1 === null || offset$1 === void 0 ? void 0 : offset$1[1]) || 0,
26
27
  alignmentAxis: (offset$1 === null || offset$1 === void 0 ? void 0 : offset$1[0]) || 0
27
- }), flip({
28
+ })].concat(_toConsumableArray(flipFlag ? [flip({
28
29
  fallbackAxisSideDirection: 'end'
29
- }), shift(), size({
30
+ })] : []), [shift(), size({
30
31
  apply: function apply(_ref2) {
31
32
  var rects = _ref2.rects,
32
33
  elements = _ref2.elements;
@@ -34,7 +35,7 @@ var FloatingPopover = /*#__PURE__*/forwardRef(function (_ref, ref) {
34
35
  width: listWidth || "".concat(rects.reference.width, "px")
35
36
  });
36
37
  }
37
- })]
38
+ })])
38
39
  }),
39
40
  refs = _useFloating.refs,
40
41
  floatingStyles = _useFloating.floatingStyles;
@@ -1 +1 @@
1
- {"version":3,"file":"FloatingPopover.js","sources":["../../../src/components/Autocomplete/FloatingPopover.tsx"],"sourcesContent":["import {\n flip,\n shift,\n size,\n useFloating,\n FloatingPortal,\n autoUpdate,\n offset as offsetMiddleware,\n} from '@floating-ui/react';\nimport React, { forwardRef } from 'react';\nimport { safeUseId } from 'src/utils';\n\nimport type { FloatingPopoverProps } from './Autocomplete.types';\n\nconst FloatingPopover = forwardRef<HTMLDivElement, FloatingPopoverProps>(\n ({ target, children, opened, portal, zIndex, listWidth, offset }, ref) => {\n const { refs, floatingStyles } = useFloating({\n whileElementsMounted(referenceEl, floatingEl, update) {\n return autoUpdate(referenceEl, floatingEl, update, {\n ancestorScroll: false,\n ancestorResize: false,\n layoutShift: false,\n });\n },\n placement: 'bottom-start',\n open: opened,\n middleware: [\n offsetMiddleware({\n mainAxis: offset?.[1] || 0,\n alignmentAxis: offset?.[0] || 0,\n }),\n flip({ fallbackAxisSideDirection: 'end' }),\n shift(),\n size({\n apply({ rects, elements }) {\n Object.assign(elements.floating.style, {\n width: listWidth || `${rects.reference.width}px`,\n });\n },\n }),\n ],\n });\n\n const wrappedId = safeUseId();\n\n // Проверка на target. Это может быть как ReactNode, так и функция, в которую пробрасывается ref.\n // Это нужно для более тонкой настройки reference-элемента, вокруг которого и будет позиционироваться выпадашка.\n // Пример: когда в Textfield под инпутом находится helperText (или еще что-либо),\n // но выпадающий список должен позиционироваться непосредственно возле самого инпута.\n const isTargetAsFunction = typeof target === 'function';\n\n return (\n <div ref={ref} id={wrappedId} style={{ position: 'relative' }}>\n <div ref={isTargetAsFunction ? undefined : refs.setReference}>\n {typeof target === 'function' ? target(refs.setReference as any) : target}\n </div>\n\n {opened && (\n // root - принимает ref контейнера портала.\n // id - если есть портал - не используется, если портала нет - подставляется 'wrappedId'.\n <FloatingPortal {...getFloatingPortalProps(portal, wrappedId)}>\n <div ref={refs.setFloating} style={{ ...floatingStyles, zIndex: zIndex || 1000 }}>\n {children}\n </div>\n </FloatingPortal>\n )}\n </div>\n );\n },\n);\n\ntype FloatingPortalReturnedProps = {\n root?: React.RefObject<HTMLElement>;\n id?: string;\n};\n\n// root - принимает ref контейнера портала.\n// id - если есть портал - не используется, если портала нет - подставляется 'wrappedId'.\nconst getFloatingPortalProps = (\n portal: FloatingPopoverProps['portal'],\n wrappedId: string,\n): FloatingPortalReturnedProps => {\n if (!portal) {\n return { id: wrappedId };\n }\n\n if (typeof portal === 'string') {\n return { id: portal };\n }\n\n return { root: portal };\n};\n\nexport { FloatingPopover };\n"],"names":["FloatingPopover","forwardRef","_ref","ref","target","children","opened","portal","zIndex","listWidth","offset","_useFloating","useFloating","whileElementsMounted","referenceEl","floatingEl","update","autoUpdate","ancestorScroll","ancestorResize","layoutShift","placement","open","middleware","offsetMiddleware","mainAxis","alignmentAxis","flip","fallbackAxisSideDirection","shift","size","apply","_ref2","rects","elements","Object","assign","floating","style","width","concat","reference","refs","floatingStyles","wrappedId","safeUseId","isTargetAsFunction","React","createElement","id","position","undefined","setReference","FloatingPortal","getFloatingPortalProps","setFloating","_objectSpread","root"],"mappings":";;;;;AAcMA,IAAAA,eAAe,gBAAGC,UAAU,CAC9B,UAAAC,IAAA,EAAkEC,GAAG,EAAK;AAAA,EAAA,IAAvEC,MAAM,GAAAF,IAAA,CAANE,MAAM;IAAEC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IAAEC,MAAM,GAAAJ,IAAA,CAANI,MAAM;IAAEC,MAAM,GAAAL,IAAA,CAANK,MAAM;IAAEC,MAAM,GAAAN,IAAA,CAANM,MAAM;IAAEC,SAAS,GAAAP,IAAA,CAATO,SAAS;IAAEC,QAAM,GAAAR,IAAA,CAANQ,MAAM,CAAA;EAC1D,IAAAC,YAAA,GAAiCC,WAAW,CAAC;AACzCC,MAAAA,oBAAoB,WAAAA,oBAACC,CAAAA,WAAW,EAAEC,UAAU,EAAEC,MAAM,EAAE;AAClD,QAAA,OA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A;AACzB,GAAA;EAEA,OAAO;AAAEkD,IAAAA,IAAI,EAAElD,MAAAA;GAAQ,CAAA;AAC3B,CAAC;;;;"}
1
+ {"version":3,"file":"FloatingPopover.js","sources":["../../../src/components/Autocomplete/FloatingPopover.tsx"],"sourcesContent":["import {\n flip,\n shift,\n size,\n useFloating,\n FloatingPortal,\n autoUpdate,\n offset as offsetMiddleware,\n} from '@floating-ui/react';\nimport React, { forwardRef } from 'react';\nimport { safeUseId } from 'src/utils';\n\nimport type { FloatingPopoverProps } from './Autocomplete.types';\n\nconst FloatingPopover = forwardRef<HTMLDivElement, FloatingPopoverProps>(\n ({ target, children, opened, portal, zIndex, listWidth, offset, flip: flipFlag }, ref) => {\n const { refs, floatingStyles } = useFloating({\n whileElementsMounted(referenceEl, floatingEl, update) {\n return autoUpdate(referenceEl, floatingEl, update, {\n ancestorScroll: false,\n ancestorResize: false,\n layoutShift: false,\n });\n },\n placement: 'bottom-start',\n open: opened,\n middleware: [\n offsetMiddleware({\n mainAxis: offset?.[1] || 0,\n alignmentAxis: offset?.[0] || 0,\n }),\n ...(flipFlag ? [flip({ fallbackAxisSideDirection: 'end' })] : []),\n shift(),\n size({\n apply({ rects, elements }) {\n Object.assign(elements.floating.style, {\n width: listWidth || `${rects.reference.width}px`,\n });\n },\n }),\n ],\n });\n\n const wrappedId = safeUseId();\n\n // Проверка на target. Это может быть как ReactNode, так и функция, в которую пробрасывается ref.\n // Это нужно для более тонкой настройки reference-элемента, вокруг которого и будет позиционироваться выпадашка.\n // Пример: когда в Textfield под инпутом находится helperText (или еще что-либо),\n // но выпадающий список должен позиционироваться непосредственно возле самого инпута.\n const isTargetAsFunction = typeof target === 'function';\n\n return (\n <div ref={ref} id={wrappedId} style={{ position: 'relative' }}>\n <div ref={isTargetAsFunction ? undefined : refs.setReference}>\n {typeof target === 'function' ? target(refs.setReference as any) : target}\n </div>\n\n {opened && (\n // root - принимает ref контейнера портала.\n // id - если есть портал - не используется, если портала нет - подставляется 'wrappedId'.\n <FloatingPortal {...getFloatingPortalProps(portal, wrappedId)}>\n <div ref={refs.setFloating} style={{ ...floatingStyles, zIndex: zIndex || 1000 }}>\n {children}\n </div>\n </FloatingPortal>\n )}\n </div>\n );\n },\n);\n\ntype FloatingPortalReturnedProps = {\n root?: React.RefObject<HTMLElement>;\n id?: string;\n};\n\n// root - принимает ref контейнера портала.\n// id - если есть портал - не используется, если портала нет - подставляется 'wrappedId'.\nconst getFloatingPortalProps = (\n portal: FloatingPopoverProps['portal'],\n wrappedId: string,\n): FloatingPortalReturnedProps => {\n if (!portal) {\n return { id: wrappedId };\n }\n\n if (typeof portal === 'string') {\n return { id: portal };\n }\n\n return { root: portal };\n};\n\nexport { FloatingPopover };\n"],"names":["FloatingPopover","forwardRef","_ref","ref","target","children","opened","portal","zIndex","listWidth","offset","flipFlag","flip","_useFloating","useFloating","whileElementsMounted","referenceEl","floatingEl","update","autoUpdate","ancestorScroll","ancestorResize","layoutShift","placement","open","middleware","offsetMiddleware","mainAxis","alignmentAxis","concat","_toConsumableArray","fallbackAxisSideDirection","shift","size","apply","_ref2","rects","elements","Object","assign","floating","style","width","reference","refs","floatingStyles","wrappedId","safeUseId","isTargetAsFunction","React","createElement","id","position","undefined","setReference","FloatingPortal","getFloatingPortalProps","setFloating","_objectSpread","root"],"mappings":";;;;;AAcMA,IAAAA,eAAe,gBAAGC,UAAU,CAC9B,UAAAC,IAAA,EAAkFC,GAAG,EAAK;AAAA,EAAA,IAAvFC,MAAM,GAAAF,IAAA,CAANE,MAAM;IAAEC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IAAEC,MAAM,GAAAJ,IAAA,CAANI,MAAM;IAAEC,MAAM,GAAAL,IAAA,CAANK,MAAM;IAAEC,MAAM,GAAAN,IAAA,CAANM,MAAM;IAAEC,SAAS,GAAAP,IAAA,CAATO,SAAS;IAAEC,QAAM,GAAAR,IAAA,CAANQ,MAAM;IAAQC,QAAQ,GAAAT,IAAA,CAAdU,IAAI,CAAA;EAChE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,IAAI,CAACvC,MAAM,EAAE;IACT,OAAO;AAAE4C,MAAAA,EAAE,EAAEL,SAAAA;KAAW,CAAA;AAC5B,GAAA;AAEA,EAAA,IAAI,OAAOvC,MAAM,KAAK,QAAQ,EAAE;IAC5B,OAAO;AAAE4C,MAAAA,EAAE,EAAE5C,MAAAA;KAAQ,CAAA;AACzB,GAAA;EAEA,OAAO;AAAEoD,IAAAA,IAAI,EAAEpD,MAAAA;GAAQ,CAAA;AAC3B,CAAC;;;;"}
@@ -76,6 +76,7 @@ var tokens = {
76
76
  calendarHeaderWrapperPadding: '--plasma-calendar-header-wrapper-padding',
77
77
  calendarHeaderArrowGap: '--plasma-calendar-arrow-container-gap',
78
78
  calendarHeaderArrowPadding: '--plasma-calendar-arrow-container-padding',
79
+ calendarArrowHeaderCustomSize: '--plasma-calendar-arrow-custom-size',
79
80
  calendarHeaderPadding: '--plasma-calendar-header-padding',
80
81
  calendarHeaderDateGap: '--plasma-calendar-header-date-gap',
81
82
  calendarHeaderFontFamily: '--plasma-calendar-header-font-family',
@@ -1 +1 @@
1
- {"version":3,"file":"Calendar.tokens.js","sources":["../../../src/components/Calendar/Calendar.tokens.ts"],"sourcesContent":["export const classes = {\n dayOfWeek: 'day-of-week',\n dayInCurrentMonth: 'day-in-current-month',\n disabled: 'item-disabled',\n disabledCurrent: 'item-disabled-current',\n sideInRange: 'item-side-in-range',\n inRange: 'item-in-range',\n sideLeft: 'item-side-left',\n sideRight: 'item-side-right',\n selectableItem: 'item-selectable',\n selectedItem: 'item-selected',\n currentItem: 'item-current',\n hoveredItem: 'item-hovered',\n doubleHeaderDate: 'double-header-date',\n doubleHeaderLastDateWrapper: 'double-header--last-date-wrapper',\n disabledPrevButton: 'disabled-prev-button',\n stretched: 'plasma-calendar-stretched',\n};\n\nexport const innerTokens = {\n dateStructureFontFamily: '--plasma-calendar-date-structure-font-family',\n dateStructureFontSize: '--plasma-calendar-date-structure-font-size',\n dateStructureFontStyle: '--plasma-calendar-date-structure-font-style',\n dateStructureFontWeight: '--plasma-calendar-date-structure-font-weight',\n dateStructureFontLetterSpacing: '--plasma-calendar-date-structure-font-letter-spacing',\n dateStructureFontLineHeight: '--plasma-calendar-date-structure-line-height',\n\n dateStructureSelectedFontWeight: '--plasma-calendar-date-structure-selected-font-weight',\n\n dateStructureBorderRadius: '--plasma-calendar-date-structure-border-radius',\n};\n\nexport const tokens = {\n calendarContainerWidth: '--plasma-calendar-container-width',\n calendarContainerHeight: '--plasma-calendar-container-height',\n calendarBorderWidth: '--plasma-calendar-border-width',\n calendarBorderColor: '--plasma-calendar-border-color',\n\n /* Токены размера сетки лет */\n calendarYearsPadding: '--plasma-calendar-years-padding',\n calendarYearItemBorderRadius: '--plasma-calendar-year-item-border-radius',\n\n calendarYearFontFamily: '--plasma-calendar-year-font-family',\n calendarYearFontSize: '--plasma-calendar-year-font-size',\n calendarYearFontStyle: '--plasma-calendar-year-font-style',\n calendarYearFontLetterSpacing: '--plasma-calendar-year-font-letter-spacing',\n calendarYearFontLineHeight: '--plasma-calendar-year-line-height',\n calendarYearFontWeight: '--plasma-calendar-year-font-weight',\n calendarYearSelectedFontWeight: '--plasma-calendar-year-selected-font-weight',\n\n /* Токены размера сетки дней */\n calendarQuartersPadding: '--plasma-calendar-quarters-padding',\n calendarQuarterItemBorderRadius: '--plasma-calendar-quarter-item-border-radius',\n\n calendarQuarterFontFamily: '--plasma-calendar-quarter-font-family',\n calendarQuarterFontSize: '--plasma-calendar-quarter-font-size',\n calendarQuarterFontStyle: '--plasma-calendar-quarter-font-style',\n calendarQuarterFontLetterSpacing: '--plasma-calendar-quarter-font-letter-spacing',\n calendarQuarterFontLineHeight: '--plasma-calendar-quarter-line-height',\n calendarQuarterFontWeight: '--plasma-calendar-quarter-font-weight',\n calendarQuarterSelectedFontWeight: '--plasma-calendar-quarter-selected-font-weight',\n\n /* Токены размера сетки месяцев */\n calendarMonthsPadding: '--plasma-calendar-months-padding',\n calendarMonthItemBorderRadius: '--plasma-calendar-month-item-border-radius',\n\n calendarMonthFontFamily: '--plasma-calendar-month-font-family',\n calendarMonthFontSize: '--plasma-calendar-month-font-size',\n calendarMonthFontStyle: '--plasma-calendar-month-font-style',\n calendarMonthFontLetterSpacing: '--plasma-calendar-month-font-letter-spacing',\n calendarMonthFontLineHeight: '--plasma-calendar-month-line-height',\n calendarMonthFontWeight: '--plasma-calendar-month-font-weight',\n calendarMonthSelectedFontWeight: '--plasma-calendar-month-selected-font-weight',\n\n /* Токены размера сетки дней */\n calendarDaysPadding: '--plasma-calendar-days-padding',\n calendarDayItemBorderRadius: '--plasma-calendar-day-item-border-radius',\n\n calendarDayFontFamily: '--plasma-calendar-day-font-family',\n calendarDayFontSize: '--plasma-calendar-day-font-size',\n calendarDayFontStyle: '--plasma-calendar-day-font-style',\n calendarDayFontLetterSpacing: '--plasma-calendar-day-font-letter-spacing',\n calendarDayFontLineHeight: '--plasma-calendar-day-line-height',\n calendarDayFontWeight: '--plasma-calendar-day-font-weight',\n calendarDaySelectedFontWeight: '--plasma-calendar-day-selected-font-weight',\n\n calendarDayOfWeekColor: '--plasma-calendar-day-of-the-week-color',\n\n /* Токены шапки календаря */\n calendarHeaderWrapperPadding: '--plasma-calendar-header-wrapper-padding',\n calendarHeaderArrowGap: '--plasma-calendar-arrow-container-gap',\n calendarHeaderArrowPadding: '--plasma-calendar-arrow-container-padding',\n\n calendarHeaderPadding: '--plasma-calendar-header-padding',\n calendarHeaderDateGap: '--plasma-calendar-header-date-gap',\n\n calendarHeaderFontFamily: '--plasma-calendar-header-font-family',\n calendarHeaderFontSize: '--plasma-calendar-header-font-size',\n calendarHeaderFontStyle: '--plasma-calendar-header-font-style',\n calendarHeaderFontLetterSpacing: '--plasma-calendar-header-font-letter-spacing',\n calendarHeaderFontLineHeight: '--plasma-calendar-header-line-height',\n calendarHeaderFontWeight: '--plasma-calendar-header-font-weight',\n calendarHeaderFontWeightBold: '--plasma-calendar-header-font-weight-bold',\n calendarHeaderArrowColor: '--plasma-calendar-header-arrow-color',\n\n /* Токены стрелок навигации календаря */\n iconButtonColor: '--plasma-calendar-icon-button-color',\n iconButtonBackgroundColor: '--plasma-calendar-icon-button-background',\n iconButtonColorHover: '--plasma-calendar-icon-button-color-hover',\n iconButtonBackgroundColorHover: '--plasma-calendar-icon-button-background-hover',\n iconButtonColorActive: '--plasma-calendar-icon-button-color-active',\n iconButtonBackgroundColorActive: '--plasma-calendar-icon-button-background-active',\n iconButtonHeight: '--plasma-calendar-icon-button-height',\n iconButtonWidth: '--plasma-calendar-icon-button-width',\n iconButtonPadding: '--plasma-calendar-icon-button-padding',\n iconButtonRadius: '--plasma-calendar-icon-button-radius',\n iconButtonFocusColor: '--plasma-calendar-icon-button-focus-color',\n\n calendarBackgroundColor: '--plasma-calendar-background',\n calendarSelectedItemBackground: '--plasma-calendar-selected-item-background',\n calendarSelectedItemColor: '--plasma-calendar-selected-item-color',\n calendarSelectableItemBackgroundHover: '--plasma-calendar-selectable-item-bg-hover',\n calendarCurrentItemBorderColor: '--plasma-calendar-current-item-border-color',\n calendarCurrentItemBorderWidth: '--plasma-calendar-current-item-border-width',\n calendarCurrentItemBackgroundHover: '--plasma-calendar-current-item-bg-hover',\n calendarCurrentItemColorHover: '--plasma-calendar-current-item-color-hover',\n calendarCurrentItemChildBackgroundHover: '--plasma-calendar-current-item-child-bg-hover',\n calendarActiveItemBackground: '--plasma-calendar-active-item-bg',\n calendarActiveItemColor: '--plasma-calendar-active-item-color',\n calendarHoveredItemBackground: '--plasma-calendar-hovered-item-bg',\n calendarHoveredItemColor: '--plasma-calendar-hovered-item-color',\n calendarSeparatorBackground: '--plasma-calendar-separator-background',\n calendarRangeBackground: '--plasma-calendar-range-background',\n calendarOutlineFocusColor: '--plasma-calendar-outline-focus-color',\n calendarContentPrimaryColor: '--plasma-calendar-content-primary-color',\n calendarContentPrimaryDisabledColor: '--plasma-calendar-content-primary-disabled-color',\n calendarContentSecondaryColor: '--plasma-calendar-content-secondary-color',\n calendarContentSecondaryDisabledColor: '--plasma-calendar-content-secondary-disabled-color',\n calendarDisabledOpacity: '--plasma-calendar-disabled-opacity',\n};\n"],"names":["classes","dayOfWeek","dayInCurrentMonth","disabled","disabledCurrent","sideInRange","inRange","sideLeft","sideRight","selectableItem","selectedItem","currentItem","hoveredItem","doubleHeaderDate","doubleHeaderLastDateWrapper","disabledPrevButton","stretched","innerTokens","dateStructureFontFamily","dateStructureFontSize","dateStructureFontStyle","dateStructureFontWeight","dateStructureFontLetterSpacing","dateStructureFontLineHeight","dateStructureSelectedFontWeight","dateStructureBorderRadius","tokens","calendarContainerWidth","calendarContainerHeight","calendarBorderWidth","calendarBorderColor","calendarYearsPadding","calendarYearItemBorderRadius","calendarYearFontFamily","calendarYearFontSize","calendarYearFontStyle","calendarYearFontLetterSpacing","calendarYearFontLineHeight","calendarYearFontWeight","calendarYearSelectedFontWeight","calendarQuartersPadding","calendarQuarterItemBorderRadius","calendarQuarterFontFamily","calendarQuarterFontSize","calendarQuarterFontStyle","calendarQuarterFontLetterSpacing","calendarQuarterFontLineHeight","calendarQuarterFontWeight","calendarQuarterSelectedFontWeight","calendarMonthsPadding","calendarMonthItemBorderRadius","calendarMonthFontFamily","calendarMonthFontSize","calendarMonthFontStyle","calendarMonthFontLetterSpacing","calendarMonthFontLineHeight","calendarMonthFontWeight","calendarMonthSelectedFontWeight","calendarDaysPadding","calendarDayItemBorderRadius","calendarDayFontFamily","calendarDayFontSize","calendarDayFontStyle","calendarDayFontLetterSpacing","calendarDayFontLineHeight","calendarDayFontWeight","calendarDaySelectedFontWeight","calendarDayOfWeekColor","calendarHeaderWrapperPadding","calendarHeaderArrowGap","calendarHeaderArrowPadding","calendarHeaderPadding","calendarHeaderDateGap","calendarHeaderFontFamily","calendarHeaderFontSize","calendarHeaderFontStyle","calendarHeaderFontLetterSpacing","calendarHeaderFontLineHeight","calendarHeaderFontWeight","calendarHeaderFontWeightBold","calendarHeaderArrowColor","iconButtonColor","iconButtonBackgroundColor","iconButtonColorHover","iconButtonBackgroundColorHover","iconButtonColorActive","iconButtonBackgroundColorActive","iconButtonHeight","iconButtonWidth","iconButtonPadding","iconButtonRadius","iconButtonFocusColor","calendarBackgroundColor","calendarSelectedItemBackground","calendarSelectedItemColor","calendarSelectableItemBackgroundHover","calendarCurrentItemBorderColor","calendarCurrentItemBorderWidth","calendarCurrentItemBackgroundHover","calendarCurrentItemColorHover","calendarCurrentItemChildBackgroundHover","calendarActiveItemBackground","calendarActiveItemColor","calendarHoveredItemBackground","calendarHoveredItemColor","calendarSeparatorBackground","calendarRangeBackground","calendarOutlineFocusColor","calendarContentPrimaryColor","calendarContentPrimaryDisabledColor","calendarContentSecondaryColor","calendarContentSecondaryDisabledColor","calendarDisabledOpacity"],"mappings":"AAAO,IAAMA,OAAO,GAAG;AACnBC,EAAAA,SAAS,EAAE,aAAa;AACxBC,EAAAA,iBAAiB,EAAE,sBAAsB;AACzCC,EAAAA,QAAQ,EAAE,eAAe;AACzBC,EAAAA,eAAe,EAAE,uBAAuB;AACxCC,EAAAA,WAAW,EAAE,oBAAoB;AACjCC,EAAAA,OAAO,EAAE,eAAe;AACxBC,EAAAA,QAAQ,EAAE,gBAAgB;AAC1BC,EAAAA,SAAS,EAAE,iBAAiB;AAC5BC,EAAAA,cAAc,EAAE,iBAAiB;AACjCC,EAAAA,YAAY,EAAE,eAAe;AAC7BC,EAAAA,WAAW,EAAE,cAAc;AAC3BC,EAAAA,WAAW,EAAE,cAAc;AAC3BC,EAAAA,gBAAgB,EAAE,oBAAoB;AACtCC,EAAAA,2BAA2B,EAAE,kCAAkC;AAC/DC,EAAAA,kBAAkB,EAAE,sBAAsB;AAC1CC,EAAAA,SAAS,EAAE,2BAAA;AACf,EAAC;AAEM,IAAMC,WAAW,GAAG;AACvBC,EAAAA,uBAAuB,EAAE,8CAA8C;AACvEC,EAAAA,qBAAqB,EAAE,4CAA4C;AACnEC,EAAAA,sBAAsB,EAAE,6CAA6C;AACrEC,EAAAA,uBAAuB,EAAE,8CAA8C;AACvEC,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A+B,EAAE,iDAAiD;AAClFC,EAAAA,gBAAgB,EAAE,sCAAsC;AACxDC,EAAAA,eAAe,EAAE,qCAAqC;AACtDC,EAAAA,iBAAiB,EAAE,uCAAuC;AAC1DC,EAAAA,gBAAgB,EAAE,sCAAsC;AACxDC,EAAAA,oBAAoB,EAAE,2CAA2C;AAEjEC,EAAAA,uBAAuB,EAAE,8BAA8B;AACvDC,EAAAA,8BAA8B,EAAE,4CAA4C;AAC5EC,EAAAA,yBAAyB,EAAE,uCAAuC;AAClEC,EAAAA,qCAAqC,EAAE,4CAA4C;AACnFC,EAAAA,8BAA8B,EAAE,6CAA6C;AAC7EC,EAAAA,8BAA8B,EAAE,6CAA6C;AAC7EC,EAAAA,kCAAkC,EAAE,yCAAyC;AAC7EC,EAAAA,6BAA6B,EAAE,4CAA4C;AAC3EC,EAAAA,uCAAuC,EAAE,+CAA+C;AACxFC,EAAAA,4BAA4B,EAAE,kCAAkC;AAChEC,EAAAA,uBAAuB,EAAE,qCAAqC;AAC9DC,EAAAA,6BAA6B,EAAE,mCAAmC;AAClEC,EAAAA,wBAAwB,EAAE,sCAAsC;AAChEC,EAAAA,2BAA2B,EAAE,wCAAwC;AACrEC,EAAAA,uBAAuB,EAAE,oCAAoC;AAC7DC,EAAAA,yBAAyB,EAAE,uCAAuC;AAClEC,EAAAA,2BAA2B,EAAE,yCAAyC;AACtEC,EAAAA,mCAAmC,EAAE,kDAAkD;AACvFC,EAAAA,6BAA6B,EAAE,2CAA2C;AAC1EC,EAAAA,qCAAqC,EAAE,oDAAoD;AAC3FC,EAAAA,uBAAuB,EAAE,oCAAA;AAC7B;;;;"}
1
+ {"version":3,"file":"Calendar.tokens.js","sources":["../../../src/components/Calendar/Calendar.tokens.ts"],"sourcesContent":["export const classes = {\n dayOfWeek: 'day-of-week',\n dayInCurrentMonth: 'day-in-current-month',\n disabled: 'item-disabled',\n disabledCurrent: 'item-disabled-current',\n sideInRange: 'item-side-in-range',\n inRange: 'item-in-range',\n sideLeft: 'item-side-left',\n sideRight: 'item-side-right',\n selectableItem: 'item-selectable',\n selectedItem: 'item-selected',\n currentItem: 'item-current',\n hoveredItem: 'item-hovered',\n doubleHeaderDate: 'double-header-date',\n doubleHeaderLastDateWrapper: 'double-header--last-date-wrapper',\n disabledPrevButton: 'disabled-prev-button',\n stretched: 'plasma-calendar-stretched',\n};\n\nexport const innerTokens = {\n dateStructureFontFamily: '--plasma-calendar-date-structure-font-family',\n dateStructureFontSize: '--plasma-calendar-date-structure-font-size',\n dateStructureFontStyle: '--plasma-calendar-date-structure-font-style',\n dateStructureFontWeight: '--plasma-calendar-date-structure-font-weight',\n dateStructureFontLetterSpacing: '--plasma-calendar-date-structure-font-letter-spacing',\n dateStructureFontLineHeight: '--plasma-calendar-date-structure-line-height',\n\n dateStructureSelectedFontWeight: '--plasma-calendar-date-structure-selected-font-weight',\n\n dateStructureBorderRadius: '--plasma-calendar-date-structure-border-radius',\n};\n\nexport const tokens = {\n calendarContainerWidth: '--plasma-calendar-container-width',\n calendarContainerHeight: '--plasma-calendar-container-height',\n calendarBorderWidth: '--plasma-calendar-border-width',\n calendarBorderColor: '--plasma-calendar-border-color',\n\n /* Токены размера сетки лет */\n calendarYearsPadding: '--plasma-calendar-years-padding',\n calendarYearItemBorderRadius: '--plasma-calendar-year-item-border-radius',\n\n calendarYearFontFamily: '--plasma-calendar-year-font-family',\n calendarYearFontSize: '--plasma-calendar-year-font-size',\n calendarYearFontStyle: '--plasma-calendar-year-font-style',\n calendarYearFontLetterSpacing: '--plasma-calendar-year-font-letter-spacing',\n calendarYearFontLineHeight: '--plasma-calendar-year-line-height',\n calendarYearFontWeight: '--plasma-calendar-year-font-weight',\n calendarYearSelectedFontWeight: '--plasma-calendar-year-selected-font-weight',\n\n /* Токены размера сетки дней */\n calendarQuartersPadding: '--plasma-calendar-quarters-padding',\n calendarQuarterItemBorderRadius: '--plasma-calendar-quarter-item-border-radius',\n\n calendarQuarterFontFamily: '--plasma-calendar-quarter-font-family',\n calendarQuarterFontSize: '--plasma-calendar-quarter-font-size',\n calendarQuarterFontStyle: '--plasma-calendar-quarter-font-style',\n calendarQuarterFontLetterSpacing: '--plasma-calendar-quarter-font-letter-spacing',\n calendarQuarterFontLineHeight: '--plasma-calendar-quarter-line-height',\n calendarQuarterFontWeight: '--plasma-calendar-quarter-font-weight',\n calendarQuarterSelectedFontWeight: '--plasma-calendar-quarter-selected-font-weight',\n\n /* Токены размера сетки месяцев */\n calendarMonthsPadding: '--plasma-calendar-months-padding',\n calendarMonthItemBorderRadius: '--plasma-calendar-month-item-border-radius',\n\n calendarMonthFontFamily: '--plasma-calendar-month-font-family',\n calendarMonthFontSize: '--plasma-calendar-month-font-size',\n calendarMonthFontStyle: '--plasma-calendar-month-font-style',\n calendarMonthFontLetterSpacing: '--plasma-calendar-month-font-letter-spacing',\n calendarMonthFontLineHeight: '--plasma-calendar-month-line-height',\n calendarMonthFontWeight: '--plasma-calendar-month-font-weight',\n calendarMonthSelectedFontWeight: '--plasma-calendar-month-selected-font-weight',\n\n /* Токены размера сетки дней */\n calendarDaysPadding: '--plasma-calendar-days-padding',\n calendarDayItemBorderRadius: '--plasma-calendar-day-item-border-radius',\n\n calendarDayFontFamily: '--plasma-calendar-day-font-family',\n calendarDayFontSize: '--plasma-calendar-day-font-size',\n calendarDayFontStyle: '--plasma-calendar-day-font-style',\n calendarDayFontLetterSpacing: '--plasma-calendar-day-font-letter-spacing',\n calendarDayFontLineHeight: '--plasma-calendar-day-line-height',\n calendarDayFontWeight: '--plasma-calendar-day-font-weight',\n calendarDaySelectedFontWeight: '--plasma-calendar-day-selected-font-weight',\n\n calendarDayOfWeekColor: '--plasma-calendar-day-of-the-week-color',\n\n /* Токены шапки календаря */\n calendarHeaderWrapperPadding: '--plasma-calendar-header-wrapper-padding',\n calendarHeaderArrowGap: '--plasma-calendar-arrow-container-gap',\n calendarHeaderArrowPadding: '--plasma-calendar-arrow-container-padding',\n calendarArrowHeaderCustomSize: '--plasma-calendar-arrow-custom-size',\n\n calendarHeaderPadding: '--plasma-calendar-header-padding',\n calendarHeaderDateGap: '--plasma-calendar-header-date-gap',\n\n calendarHeaderFontFamily: '--plasma-calendar-header-font-family',\n calendarHeaderFontSize: '--plasma-calendar-header-font-size',\n calendarHeaderFontStyle: '--plasma-calendar-header-font-style',\n calendarHeaderFontLetterSpacing: '--plasma-calendar-header-font-letter-spacing',\n calendarHeaderFontLineHeight: '--plasma-calendar-header-line-height',\n calendarHeaderFontWeight: '--plasma-calendar-header-font-weight',\n calendarHeaderFontWeightBold: '--plasma-calendar-header-font-weight-bold',\n calendarHeaderArrowColor: '--plasma-calendar-header-arrow-color',\n\n /* Токены стрелок навигации календаря */\n iconButtonColor: '--plasma-calendar-icon-button-color',\n iconButtonBackgroundColor: '--plasma-calendar-icon-button-background',\n iconButtonColorHover: '--plasma-calendar-icon-button-color-hover',\n iconButtonBackgroundColorHover: '--plasma-calendar-icon-button-background-hover',\n iconButtonColorActive: '--plasma-calendar-icon-button-color-active',\n iconButtonBackgroundColorActive: '--plasma-calendar-icon-button-background-active',\n iconButtonHeight: '--plasma-calendar-icon-button-height',\n iconButtonWidth: '--plasma-calendar-icon-button-width',\n iconButtonPadding: '--plasma-calendar-icon-button-padding',\n iconButtonRadius: '--plasma-calendar-icon-button-radius',\n iconButtonFocusColor: '--plasma-calendar-icon-button-focus-color',\n\n calendarBackgroundColor: '--plasma-calendar-background',\n calendarSelectedItemBackground: '--plasma-calendar-selected-item-background',\n calendarSelectedItemColor: '--plasma-calendar-selected-item-color',\n calendarSelectableItemBackgroundHover: '--plasma-calendar-selectable-item-bg-hover',\n calendarCurrentItemBorderColor: '--plasma-calendar-current-item-border-color',\n calendarCurrentItemBorderWidth: '--plasma-calendar-current-item-border-width',\n calendarCurrentItemBackgroundHover: '--plasma-calendar-current-item-bg-hover',\n calendarCurrentItemColorHover: '--plasma-calendar-current-item-color-hover',\n calendarCurrentItemChildBackgroundHover: '--plasma-calendar-current-item-child-bg-hover',\n calendarActiveItemBackground: '--plasma-calendar-active-item-bg',\n calendarActiveItemColor: '--plasma-calendar-active-item-color',\n calendarHoveredItemBackground: '--plasma-calendar-hovered-item-bg',\n calendarHoveredItemColor: '--plasma-calendar-hovered-item-color',\n calendarSeparatorBackground: '--plasma-calendar-separator-background',\n calendarRangeBackground: '--plasma-calendar-range-background',\n calendarOutlineFocusColor: '--plasma-calendar-outline-focus-color',\n calendarContentPrimaryColor: '--plasma-calendar-content-primary-color',\n calendarContentPrimaryDisabledColor: '--plasma-calendar-content-primary-disabled-color',\n calendarContentSecondaryColor: '--plasma-calendar-content-secondary-color',\n calendarContentSecondaryDisabledColor: '--plasma-calendar-content-secondary-disabled-color',\n calendarDisabledOpacity: '--plasma-calendar-disabled-opacity',\n};\n"],"names":["classes","dayOfWeek","dayInCurrentMonth","disabled","disabledCurrent","sideInRange","inRange","sideLeft","sideRight","selectableItem","selectedItem","currentItem","hoveredItem","doubleHeaderDate","doubleHeaderLastDateWrapper","disabledPrevButton","stretched","innerTokens","dateStructureFontFamily","dateStructureFontSize","dateStructureFontStyle","dateStructureFontWeight","dateStructureFontLetterSpacing","dateStructureFontLineHeight","dateStructureSelectedFontWeight","dateStructureBorderRadius","tokens","calendarContainerWidth","calendarContainerHeight","calendarBorderWidth","calendarBorderColor","calendarYearsPadding","calendarYearItemBorderRadius","calendarYearFontFamily","calendarYearFontSize","calendarYearFontStyle","calendarYearFontLetterSpacing","calendarYearFontLineHeight","calendarYearFontWeight","calendarYearSelectedFontWeight","calendarQuartersPadding","calendarQuarterItemBorderRadius","calendarQuarterFontFamily","calendarQuarterFontSize","calendarQuarterFontStyle","calendarQuarterFontLetterSpacing","calendarQuarterFontLineHeight","calendarQuarterFontWeight","calendarQuarterSelectedFontWeight","calendarMonthsPadding","calendarMonthItemBorderRadius","calendarMonthFontFamily","calendarMonthFontSize","calendarMonthFontStyle","calendarMonthFontLetterSpacing","calendarMonthFontLineHeight","calendarMonthFontWeight","calendarMonthSelectedFontWeight","calendarDaysPadding","calendarDayItemBorderRadius","calendarDayFontFamily","calendarDayFontSize","calendarDayFontStyle","calendarDayFontLetterSpacing","calendarDayFontLineHeight","calendarDayFontWeight","calendarDaySelectedFontWeight","calendarDayOfWeekColor","calendarHeaderWrapperPadding","calendarHeaderArrowGap","calendarHeaderArrowPadding","calendarArrowHeaderCustomSize","calendarHeaderPadding","calendarHeaderDateGap","calendarHeaderFontFamily","calendarHeaderFontSize","calendarHeaderFontStyle","calendarHeaderFontLetterSpacing","calendarHeaderFontLineHeight","calendarHeaderFontWeight","calendarHeaderFontWeightBold","calendarHeaderArrowColor","iconButtonColor","iconButtonBackgroundColor","iconButtonColorHover","iconButtonBackgroundColorHover","iconButtonColorActive","iconButtonBackgroundColorActive","iconButtonHeight","iconButtonWidth","iconButtonPadding","iconButtonRadius","iconButtonFocusColor","calendarBackgroundColor","calendarSelectedItemBackground","calendarSelectedItemColor","calendarSelectableItemBackgroundHover","calendarCurrentItemBorderColor","calendarCurrentItemBorderWidth","calendarCurrentItemBackgroundHover","calendarCurrentItemColorHover","calendarCurrentItemChildBackgroundHover","calendarActiveItemBackground","calendarActiveItemColor","calendarHoveredItemBackground","calendarHoveredItemColor","calendarSeparatorBackground","calendarRangeBackground","calendarOutlineFocusColor","calendarContentPrimaryColor","calendarContentPrimaryDisabledColor","calendarContentSecondaryColor","calendarContentSecondaryDisabledColor","calendarDisabledOpacity"],"mappings":"AAAO,IAAMA,OAAO,GAAG;AACnBC,EAAAA,SAAS,EAAE,aAAa;AACxBC,EAAAA,iBAAiB,EAAE,sBAAsB;AACzCC,EAAAA,QAAQ,EAAE,eAAe;AACzBC,EAAAA,eAAe,EAAE,uBAAuB;AACxCC,EAAAA,WAAW,EAAE,oBAAoB;AACjCC,EAAAA,OAAO,EAAE,eAAe;AACxBC,EAAAA,QAAQ,EAAE,gBAAgB;AAC1BC,EAAAA,SAAS,EAAE,iBAAiB;AAC5BC,EAAAA,cAAc,EAAE,iBAAiB;AACjCC,EAAAA,YAAY,EAAE,e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EAAAA,yBAAyB,EAAE,uCAAuC;AAClEC,EAAAA,2BAA2B,EAAE,yCAAyC;AACtEC,EAAAA,mCAAmC,EAAE,kDAAkD;AACvFC,EAAAA,6BAA6B,EAAE,2CAA2C;AAC1EC,EAAAA,qCAAqC,EAAE,oDAAoD;AAC3FC,EAAAA,uBAAuB,EAAE,oCAAA;AAC7B;;;;"}
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { CalendarState } from '../../store/types.js';
3
- import { classes } from '../../Calendar.tokens.js';
3
+ import { classes, tokens } from '../../Calendar.tokens.js';
4
4
  import { sizeMap } from '../../store/reducer.js';
5
5
  import { cx } from '../../../../utils/index.js';
6
6
  import { StyledCalendarHeader, StyledNavigation, StyledDoubleHeaderWrapper, StyledHeaderDouble, StyledHeader, StyledArrows, StyledHeaderDate, StyledHeaderArrow, StyledArrow } from './CalendarHeader.styles.js';
@@ -52,20 +52,20 @@ var CalendarHeader = function CalendarHeader(_ref) {
52
52
  if (type === CalendarState.Days) {
53
53
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StyledHeaderDate, null, MONTH_NAMES[locale][date.monthIndex]), /*#__PURE__*/React.createElement(StyledHeaderDate, null, date.year, /*#__PURE__*/React.createElement(StyledHeaderArrow, {
54
54
  color: "inherit",
55
- size: size === 'xs' ? 'xs' : 's'
55
+ sizeCustomProperty: tokens.calendarArrowHeaderCustomSize
56
56
  })));
57
57
  }
58
58
  if (type === CalendarState.Months || type === CalendarState.Quarters) {
59
59
  return /*#__PURE__*/React.createElement(StyledHeaderDate, null, date.year, /*#__PURE__*/React.createElement(StyledHeaderArrow, {
60
60
  color: "inherit",
61
- size: size === 'xs' ? 'xs' : 's'
61
+ sizeCustomProperty: tokens.calendarArrowHeaderCustomSize
62
62
  }));
63
63
  }
64
64
  if (type === CalendarState.Years) {
65
65
  var yearValue = secondPart ? startYear + 12 : startYear;
66
66
  return /*#__PURE__*/React.createElement(StyledHeaderDate, null, yearValue, "\u2014", yearValue + YEAR_RENDER_COUNT - 1, /*#__PURE__*/React.createElement(StyledHeaderArrow, {
67
67
  color: "inherit",
68
- size: size === 'xs' ? 'xs' : 's'
68
+ sizeCustomProperty: tokens.calendarArrowHeaderCustomSize
69
69
  }));
70
70
  }
71
71
  return '';
@@ -1 +1 @@
1
- {"version":3,"file":"CalendarHeader.js","sources":["../../../../../src/components/Calendar/ui/CalendarHeader/CalendarHeader.tsx"],"sourcesContent":["import React from 'react';\nimport type { MouseEvent } from 'react';\n\nimport { IconDisclosureLeft, IconDisclosureRight } from '../../../_Icon';\nimport { CalendarState } from '../../store/types';\nimport { getCalendarType, MONTH_NAMES, YEAR_RENDER_COUNT, I18N } from '../../utils';\nimport type { DateObject } from '../../Calendar.types';\nimport { classes } from '../../Calendar.tokens';\nimport { sizeMap } from '../../store/reducer';\nimport { cx } from '../../../../utils';\n\nimport type { CalendarHeaderProps } from './CalendarHeader.types';\nimport {\n StyledArrow,\n StyledArrows,\n StyledCalendarHeader,\n StyledDoubleHeaderWrapper,\n StyledHeader,\n StyledHeaderDate,\n StyledHeaderDouble,\n StyledNavigation,\n StyledHeaderArrow,\n} from './CalendarHeader.styles';\n\n/**\n * Компонент шапки календаря.\n */\nexport const CalendarHeader: React.FC<CalendarHeaderProps> = ({\n type = 'Days',\n startYear = 0,\n size,\n firstDate,\n secondDate,\n isDouble,\n onPrev,\n onNext,\n onUpdateCalendarState,\n locale,\n}) => {\n const handleCalendarState = () => {\n const newSize: [number, number] = isDouble ? sizeMap.Months.double : sizeMap.Months.single;\n\n if (type === CalendarState.Days) {\n onUpdateCalendarState?.(CalendarState.Months, newSize);\n }\n\n if (type === CalendarState.Months || type === CalendarState.Quarters) {\n onUpdateCalendarState?.(CalendarState.Years, newSize);\n }\n };\n\n const handlePrev = (event: MouseEvent<HTMLDivElement>) => {\n event.stopPropagation();\n\n if (startYear <= 0) {\n return;\n }\n onPrev();\n };\n\n const handleNext = (event: MouseEvent<HTMLDivElement>) => {\n event.stopPropagation();\n\n onNext();\n };\n\n const getHeaderContent = (date?: DateObject, secondPart?: boolean) => {\n if (!date) {\n return '';\n }\n\n if (type === CalendarState.Days) {\n return (\n <>\n <StyledHeaderDate>{MONTH_NAMES[locale][date.monthIndex]}</StyledHeaderDate>\n <StyledHeaderDate>\n {date.year}\n <StyledHeaderArrow color=\"inherit\" size={size === 'xs' ? 'xs' : 's'} />\n </StyledHeaderDate>\n </>\n );\n }\n\n if (type === CalendarState.Months || type === CalendarState.Quarters) {\n return (\n <StyledHeaderDate>\n {date.year}\n <StyledHeaderArrow color=\"inherit\" size={size === 'xs' ? 'xs' : 's'} />\n </StyledHeaderDate>\n );\n }\n\n if (type === CalendarState.Years) {\n const yearValue = secondPart ? startYear + 12 : startYear;\n\n return (\n <StyledHeaderDate>\n {yearValue}—{yearValue + YEAR_RENDER_COUNT - 1}\n <StyledHeaderArrow color=\"inherit\" size={size === 'xs' ? 'xs' : 's'} />\n </StyledHeaderDate>\n );\n }\n\n return '';\n };\n\n const currentCalendarType = getCalendarType(type, locale);\n\n const PreviousButton = () => (\n <StyledArrow\n className={cx(startYear <= 0 && classes.disabledPrevButton)}\n aria-label={`${I18N.previous[locale]} ${currentCalendarType}`}\n onClick={handlePrev}\n >\n <IconDisclosureLeft color=\"inherit\" size={size === 'xs' ? 'xs' : 's'} />\n </StyledArrow>\n );\n\n const NextButton = () => (\n <StyledArrow aria-label={`${I18N.next[locale]} ${currentCalendarType}`} onClick={handleNext}>\n <IconDisclosureRight color=\"inherit\" size={size === 'xs' ? 'xs' : 's'} />\n </StyledArrow>\n );\n\n return (\n <StyledCalendarHeader>\n {isDouble ? (\n <StyledNavigation>\n <StyledDoubleHeaderWrapper>\n <PreviousButton />\n <StyledHeaderDouble onClick={handleCalendarState} aria-live=\"polite\">\n {getHeaderContent(firstDate)}\n </StyledHeaderDouble>\n </StyledDoubleHeaderWrapper>\n <StyledDoubleHeaderWrapper className={classes.doubleHeaderLastDateWrapper}>\n <StyledHeaderDouble onClick={handleCalendarState} aria-live=\"polite\">\n {getHeaderContent(secondDate, true)}\n </StyledHeaderDouble>\n <NextButton />\n </StyledDoubleHeaderWrapper>\n </StyledNavigation>\n ) : (\n <>\n <StyledHeader\n type=\"button\"\n aria-live=\"polite\"\n id=\"id-grid-label\"\n onClick={handleCalendarState}\n tabIndex={0}\n >\n {getHeaderContent(firstDate)}\n </StyledHeader>\n <StyledArrows>\n <PreviousButton />\n <NextButton />\n </StyledArrows>\n </>\n )}\n </StyledCalendarHeader>\n );\n};\n"],"names":["CalendarHeader","_ref","_ref$type","type","_ref$startYear","startYear","size","firstDate","secondDate","isDouble","onPrev","onNext","onUpdateCalendarState","locale","handleCalendarState","newSize","sizeMap","Months","single","CalendarState","Days","Quarters","Years","handlePrev","event","stopPropagation","handleNext","getHeaderContent","date","secondPart","React","createElement","Fragment","StyledHeaderDate","MONTH_NAMES","monthIndex","year","StyledHeaderArrow","color","yearValue","YEAR_RENDER_COUNT","currentCalendarType","getCalendarType","PreviousButton","StyledArrow","className","cx","classes","disabledPrevButton","concat","I18N","previous","onClick","IconDisclosureLeft","NextButton","next","IconDisclosureRight","StyledCalendarHeader","StyledNavigation","StyledDoubleHeaderWrapper","StyledHeaderDouble","doubleHeaderLastDateWrapper","StyledHeader","id","tabIndex","StyledArrows"],"mappings":";;;;;;;;;;;AAwBA;AACA;AACA;IACaA,cAA6C,GAAG,SAAhDA,cAA6CA,CAAAC,IAAA,EAWpD;AAAA,EAAA,IAAAC,SAAA,GAAAD,IAAA,CAVFE,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAG,KAAA,CAAA,GAAA,MAAM,GAAAA,SAAA;IAAAE,cAAA,GAAAH,IAAA,CACbI,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,CAAC,GAAAA,cAAA;IACbE,IAAI,GAAAL,IAAA,CAAJK,IAAI;IACJC,SAAS,GAAAN,IAAA,CAATM,SAAS;IACTC,UAAU,GAAAP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AAoB;AAC7BkD,IAAAA,QAAQ,EAAE,CAAA;AAAE,GAAA,EAEXrC,gBAAgB,CAACpB,SAAS,CACjB,CAAC,eACfuB,KAAA,CAAAC,aAAA,CAACkC,YAAY,EAAA,IAAA,eACTnC,KAAA,CAAAC,aAAA,CAACY,cAAc,EAAA,IAAE,CAAC,eAClBb,KAAA,CAAAC,aAAA,CAACuB,UAAU,EAAA,IAAE,CACH,CAChB,CAEY,CAAC,CAAA;AAE/B;;;;"}
1
+ {"version":3,"file":"CalendarHeader.js","sources":["../../../../../src/components/Calendar/ui/CalendarHeader/CalendarHeader.tsx"],"sourcesContent":["import React from 'react';\nimport type { MouseEvent } from 'react';\n\nimport { IconDisclosureLeft, IconDisclosureRight } from '../../../_Icon';\nimport { CalendarState } from '../../store/types';\nimport { getCalendarType, MONTH_NAMES, YEAR_RENDER_COUNT, I18N } from '../../utils';\nimport type { DateObject } from '../../Calendar.types';\nimport { classes, tokens } from '../../Calendar.tokens';\nimport { sizeMap } from '../../store/reducer';\nimport { cx } from '../../../../utils';\n\nimport type { CalendarHeaderProps } from './CalendarHeader.types';\nimport {\n StyledArrow,\n StyledArrows,\n StyledCalendarHeader,\n StyledDoubleHeaderWrapper,\n StyledHeader,\n StyledHeaderDate,\n StyledHeaderDouble,\n StyledNavigation,\n StyledHeaderArrow,\n} from './CalendarHeader.styles';\n\n/**\n * Компонент шапки календаря.\n */\nexport const CalendarHeader: React.FC<CalendarHeaderProps> = ({\n type = 'Days',\n startYear = 0,\n size,\n firstDate,\n secondDate,\n isDouble,\n onPrev,\n onNext,\n onUpdateCalendarState,\n locale,\n}) => {\n const handleCalendarState = () => {\n const newSize: [number, number] = isDouble ? sizeMap.Months.double : sizeMap.Months.single;\n\n if (type === CalendarState.Days) {\n onUpdateCalendarState?.(CalendarState.Months, newSize);\n }\n\n if (type === CalendarState.Months || type === CalendarState.Quarters) {\n onUpdateCalendarState?.(CalendarState.Years, newSize);\n }\n };\n\n const handlePrev = (event: MouseEvent<HTMLDivElement>) => {\n event.stopPropagation();\n\n if (startYear <= 0) {\n return;\n }\n onPrev();\n };\n\n const handleNext = (event: MouseEvent<HTMLDivElement>) => {\n event.stopPropagation();\n\n onNext();\n };\n\n const getHeaderContent = (date?: DateObject, secondPart?: boolean) => {\n if (!date) {\n return '';\n }\n\n if (type === CalendarState.Days) {\n return (\n <>\n <StyledHeaderDate>{MONTH_NAMES[locale][date.monthIndex]}</StyledHeaderDate>\n <StyledHeaderDate>\n {date.year}\n <StyledHeaderArrow color=\"inherit\" sizeCustomProperty={tokens.calendarArrowHeaderCustomSize} />\n </StyledHeaderDate>\n </>\n );\n }\n\n if (type === CalendarState.Months || type === CalendarState.Quarters) {\n return (\n <StyledHeaderDate>\n {date.year}\n <StyledHeaderArrow color=\"inherit\" sizeCustomProperty={tokens.calendarArrowHeaderCustomSize} />\n </StyledHeaderDate>\n );\n }\n\n if (type === CalendarState.Years) {\n const yearValue = secondPart ? startYear + 12 : startYear;\n\n return (\n <StyledHeaderDate>\n {yearValue}—{yearValue + YEAR_RENDER_COUNT - 1}\n <StyledHeaderArrow color=\"inherit\" sizeCustomProperty={tokens.calendarArrowHeaderCustomSize} />\n </StyledHeaderDate>\n );\n }\n\n return '';\n };\n\n const currentCalendarType = getCalendarType(type, locale);\n\n const PreviousButton = () => (\n <StyledArrow\n className={cx(startYear <= 0 && classes.disabledPrevButton)}\n aria-label={`${I18N.previous[locale]} ${currentCalendarType}`}\n onClick={handlePrev}\n >\n <IconDisclosureLeft color=\"inherit\" size={size === 'xs' ? 'xs' : 's'} />\n </StyledArrow>\n );\n\n const NextButton = () => (\n <StyledArrow aria-label={`${I18N.next[locale]} ${currentCalendarType}`} onClick={handleNext}>\n <IconDisclosureRight color=\"inherit\" size={size === 'xs' ? 'xs' : 's'} />\n </StyledArrow>\n );\n\n return (\n <StyledCalendarHeader>\n {isDouble ? (\n <StyledNavigation>\n <StyledDoubleHeaderWrapper>\n <PreviousButton />\n <StyledHeaderDouble onClick={handleCalendarState} aria-live=\"polite\">\n {getHeaderContent(firstDate)}\n </StyledHeaderDouble>\n </StyledDoubleHeaderWrapper>\n <StyledDoubleHeaderWrapper className={classes.doubleHeaderLastDateWrapper}>\n <StyledHeaderDouble onClick={handleCalendarState} aria-live=\"polite\">\n {getHeaderContent(secondDate, true)}\n </StyledHeaderDouble>\n <NextButton />\n </StyledDoubleHeaderWrapper>\n </StyledNavigation>\n ) : (\n <>\n <StyledHeader\n type=\"button\"\n aria-live=\"polite\"\n id=\"id-grid-label\"\n onClick={handleCalendarState}\n tabIndex={0}\n >\n {getHeaderContent(firstDate)}\n </StyledHeader>\n <StyledArrows>\n <PreviousButton />\n <NextButton />\n </StyledArrows>\n </>\n )}\n </StyledCalendarHeader>\n );\n};\n"],"names":["CalendarHeader","_ref","_ref$type","type","_ref$startYear","startYear","size","firstDate","secondDate","isDouble","onPrev","onNext","onUpdateCalendarState","locale","handleCalendarState","newSize","sizeMap","Months","single","CalendarState","Days","Quarters","Years","handlePrev","event","stopPropagation","handleNext","getHeaderContent","date","secondPart","React","createElement","Fragment","StyledHeaderDate","MONTH_NAMES","monthIndex","year","StyledHeaderArrow","color","sizeCustomProperty","tokens","calendarArrowHeaderCustomSize","yearValue","YEAR_RENDER_COUNT","currentCalendarType","getCalendarType","PreviousButton","StyledArrow","className","cx","classes","disabledPrevButton","concat","I18N","previous","onClick","IconDisclosureLeft","NextButton","next","IconDisclosureRight","StyledCalendarHeader","StyledNavigation","StyledDoubleHeaderWrapper","StyledHeaderDouble","doubleHeaderLastDateWrapper","StyledHeader","id","tabIndex","StyledArrows"],"mappings":";;;;;;;;;;;AAwBA;AACA;AACA;IACaA,cAA6C,GAAG,SAAhDA,cAA6CA,CAAAC,IAAA,EAWpD;AAAA,EAAA,IAAAC,SAAA,GAAAD,IAAA,CAVFE,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAG,KAAA,CAAA,GAAA,MAAM,GAAAA,SAAA;IAAAE,cAAA,GAAAH,IAAA,CACbI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C,QAAQ;AACb,IAAA,WAAA,EAAU,QAAQ;AAClB+D,IAAAA,EAAE,EAAC,eAAe;AAClBX,IAAAA,OAAO,EAAEzC,mBAAoB;AAC7BqD,IAAAA,QAAQ,EAAE,CAAA;AAAE,GAAA,EAEXxC,gBAAgB,CAACpB,SAAS,CACjB,CAAC,eACfuB,KAAA,CAAAC,aAAA,CAACqC,YAAY,EAAA,IAAA,eACTtC,KAAA,CAAAC,aAAA,CAACe,cAAc,EAAA,IAAE,CAAC,eAClBhB,KAAA,CAAAC,aAAA,CAAC0B,UAAU,EAAA,IAAE,CACH,CAChB,CAEY,CAAC,CAAA;AAE/B;;;;"}
@@ -11,6 +11,7 @@ import { base as base$2 } from './variations/_size/base.js';
11
11
  import { SelectNative } from './ui/SelectNative/SelectNative.js';
12
12
  import { Context } from './Combobox.context.js';
13
13
  import { initialItemsTransform } from './utils/initialItemsTransform.js';
14
+ import { getTextValue } from './utils/getTextValue.js';
14
15
  import { safeUseId } from '../../../utils/react.js';
15
16
  import { filterItems } from './utils/filterItems.js';
16
17
  import { pathReducer } from './reducers/pathReducer.js';
@@ -20,6 +21,7 @@ import { isEmpty } from '../../../utils/isEmpty.js';
20
21
  import { updateDescendants } from './utils/updateDescendants.js';
21
22
  import { updateAncestors } from './utils/updateAncestors.js';
22
23
  import { updateSingleAncestors } from './utils/updateSingleAncestors.js';
24
+ import { useDidMountLayoutEffect } from '../../../hooks/useDidMountLayoutEffect.js';
23
25
  import { StyledTextField } from './ui/Target/Target.styles.js';
24
26
  import { sizeToIconSize } from '../../Select/utils/sizeToIconSize.js';
25
27
  import { getItemId } from './utils/getItemId.js';
@@ -36,7 +38,7 @@ var _excluded = ["name", "multiple", "value", "onChange", "defaultValue", "isTar
36
38
 
37
39
  var comboboxRoot = function comboboxRoot(Root) {
38
40
  return /*#__PURE__*/forwardRef(function (props, ref) {
39
- var _valueToItemMap$get, _getItemByFocused, _StyledLeftHelper;
41
+ var _getItemByFocused, _StyledLeftHelper;
40
42
  var name = props.name,
41
43
  multiple = props.multiple,
42
44
  outerValue = props.value,
@@ -98,7 +100,7 @@ var comboboxRoot = function comboboxRoot(Root) {
98
100
  valueToCheckedMap = _useMemo2[0],
99
101
  valueToItemMap = _useMemo2[1],
100
102
  labelToItemMap = _useMemo2[2];
101
- var _useState = useState(multiple || Array.isArray(outerValue) ? '' : ((_valueToItemMap$get = valueToItemMap.get(outerValue)) === null || _valueToItemMap$get === void 0 ? void 0 : _valueToItemMap$get.label) || (outerValue === null || outerValue === void 0 ? void 0 : outerValue.toString()) || ''),
103
+ var _useState = useState(getTextValue(multiple, outerValue, valueToItemMap, renderValue)),
102
104
  _useState2 = _slicedToArray(_useState, 2),
103
105
  textValue = _useState2[0],
104
106
  setTextValue = _useState2[1];
@@ -112,8 +114,7 @@ var comboboxRoot = function comboboxRoot(Root) {
112
114
  var inputForkRef = useForkRef(inputRef, ref);
113
115
  var treeId = safeUseId();
114
116
  var filteredItems = useMemo(function () {
115
- var _valueToItemMap$get2;
116
- return filterItems(transformedItems, textValue, ((_valueToItemMap$get2 = valueToItemMap.get(value)) === null || _valueToItemMap$get2 === void 0 ? void 0 : _valueToItemMap$get2.label) || value, filter);
117
+ return filterItems(transformedItems, textValue, getTextValue(multiple, value, valueToItemMap, renderValue), filter);
117
118
  }, [transformedItems, textValue, filter]);
118
119
  var _useMemo3 = useMemo(function () {
119
120
  return getPathMap(filteredItems);
@@ -156,19 +157,8 @@ var comboboxRoot = function comboboxRoot(Root) {
156
157
  onToggle(false);
157
158
  }
158
159
 
159
- // Проверяем, отличается ли значение в инпуте от выбранного value после закрытия дропдауна.
160
- // Если изменилось, то возвращаем label выбранного айтема.
161
- // Если нет выбранного элемента, то стираем значение инпута.
162
- if (textValue !== value) {
163
- if (isEmpty(value)) {
164
- setTextValue('');
165
- } else if (multiple) {
166
- setTextValue('');
167
- } else {
168
- var _valueToItemMap$get3;
169
- setTextValue(((_valueToItemMap$get3 = valueToItemMap.get(value)) === null || _valueToItemMap$get3 === void 0 ? void 0 : _valueToItemMap$get3.label) || value || '');
170
- }
171
- }
160
+ // Возвращаем актуальное значение поля ввода после закрытия выпадающего списка.
161
+ setTextValue(getTextValue(multiple, value, valueToItemMap, renderValue));
172
162
  }, floatingPopoverRef);
173
163
 
174
164
  // Эта функция срабатывает при изменении Combobox и
@@ -176,12 +166,12 @@ var comboboxRoot = function comboboxRoot(Root) {
176
166
  var onChange = function onChange(newValue, item) {
177
167
  // Условие для отправки изменений наружу
178
168
  if (props.onChange) {
179
- // Условие для отправки если комбобокс используется без формы.
169
+ // Условие для отправки, если комбобокс используется без формы.
180
170
  if (!props.name && (typeof newValue === 'string' || Array.isArray(newValue))) {
181
171
  props.onChange(newValue, item || null);
182
172
  }
183
173
 
184
- // Условие для отправки если комбобокс используется с формой.
174
+ // Условие для отправки, если комбобокс используется с формой.
185
175
  if (props.name && _typeof(newValue) === 'object' && !Array.isArray(newValue)) {
186
176
  props.onChange(newValue);
187
177
  }
@@ -233,9 +223,9 @@ var comboboxRoot = function comboboxRoot(Root) {
233
223
  if (renderValue && !isTargetAmount) {
234
224
  var resultValues = _toConsumableArray(value);
235
225
  value.forEach(function (_, index) {
236
- var _valueToItemMap$get4;
226
+ var _valueToItemMap$get;
237
227
  var stringValue = value[index];
238
- var label = (_valueToItemMap$get4 = valueToItemMap.get(stringValue)) === null || _valueToItemMap$get4 === void 0 ? void 0 : _valueToItemMap$get4.label;
228
+ var label = (_valueToItemMap$get = valueToItemMap.get(stringValue)) === null || _valueToItemMap$get === void 0 ? void 0 : _valueToItemMap$get.label;
239
229
  var labelAfterRenderValue = renderValue(label ? labelToItemMap.get(label) : {
240
230
  value: stringValue,
241
231
  label: stringValue.toString()
@@ -364,8 +354,8 @@ var comboboxRoot = function comboboxRoot(Root) {
364
354
  });
365
355
  };
366
356
  var valueToItemMapper = function valueToItemMapper(stringValue) {
367
- var _valueToItemMap$get5;
368
- return ((_valueToItemMap$get5 = valueToItemMap.get(stringValue)) === null || _valueToItemMap$get5 === void 0 ? void 0 : _valueToItemMap$get5.label) || stringValue.toString();
357
+ var _valueToItemMap$get2;
358
+ return ((_valueToItemMap$get2 = valueToItemMap.get(stringValue)) === null || _valueToItemMap$get2 === void 0 ? void 0 : _valueToItemMap$get2.label) || stringValue.toString();
369
359
  };
370
360
  return value.map(renderValueMapper || valueToItemMapper);
371
361
  }
@@ -425,10 +415,6 @@ var comboboxRoot = function comboboxRoot(Root) {
425
415
  }
426
416
  }
427
417
  setChecked(checkedCopy);
428
- if (!multiple && textValue === value && valueToItemMap.has(value)) {
429
- var _valueToItemMap$get6;
430
- setTextValue(((_valueToItemMap$get6 = valueToItemMap.get(value)) === null || _valueToItemMap$get6 === void 0 ? void 0 : _valueToItemMap$get6.label) || '');
431
- }
432
418
 
433
419
  // В deps мы кладем именно outerValue и internalValue, а не просто value.
434
420
  // Т.к. вначале нужно отфильтровать и провалидировать outerValue и результат положить в переменную.
@@ -436,9 +422,8 @@ var comboboxRoot = function comboboxRoot(Root) {
436
422
  }, [outerValue, internalValue, items]);
437
423
 
438
424
  // При изменении value нужно возвращать значение в инпуте к исходному.
439
- useLayoutEffect(function () {
440
- var _valueToItemMap$get7;
441
- setTextValue(multiple ? '' : ((_valueToItemMap$get7 = valueToItemMap.get(value)) === null || _valueToItemMap$get7 === void 0 ? void 0 : _valueToItemMap$get7.label) || (value === null || value === void 0 ? void 0 : value.toString()) || '');
425
+ useDidMountLayoutEffect(function () {
426
+ setTextValue(getTextValue(multiple, value, valueToItemMap, renderValue));
442
427
  }, [outerValue, internalValue]);
443
428
  useLayoutEffect(function () {
444
429
  if (defaultValue) {