@sima-land/ui-nucleons 44.2.10 → 45.0.0-alpha.1

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 (378) hide show
  1. package/_internal/custom-scrollbar/index.d.ts +13 -7
  2. package/_internal/custom-scrollbar/index.js +29 -15
  3. package/_internal/dropdown-loading/index.d.ts +3 -3
  4. package/_internal/dropdown-loading/index.js +4 -2
  5. package/_internal/page-scroll-lock/adapters/body-scroll-lock.d.ts +39 -0
  6. package/_internal/page-scroll-lock/adapters/body-scroll-lock.js +62 -0
  7. package/_internal/page-scroll-lock/adapters/ui-nucleons.d.ts +25 -0
  8. package/_internal/page-scroll-lock/adapters/ui-nucleons.js +103 -0
  9. package/_internal/page-scroll-lock/context.d.ts +13 -0
  10. package/_internal/page-scroll-lock/context.js +54 -0
  11. package/_internal/page-scroll-lock/hook.d.ts +12 -0
  12. package/_internal/page-scroll-lock/hook.js +26 -0
  13. package/_internal/page-scroll-lock/index.d.ts +4 -0
  14. package/_internal/page-scroll-lock/index.js +9 -0
  15. package/_internal/page-scroll-lock/types.d.ts +22 -0
  16. package/_internal/readme.md +2 -0
  17. package/_internal/utils/dropdown.d.ts +1 -0
  18. package/_internal/utils/dropdown.js +1 -0
  19. package/alert/alert.module.scss +1 -24
  20. package/alert/index.d.ts +11 -17
  21. package/alert/index.js +33 -16
  22. package/arrow-button/arrow-button.module.scss +2 -0
  23. package/arrow-button/index.d.ts +2 -2
  24. package/autocomplete/autocomplete.d.ts +8 -0
  25. package/autocomplete/autocomplete.js +190 -0
  26. package/autocomplete/autocomplete.module.scss +2 -15
  27. package/autocomplete/index.d.ts +2 -27
  28. package/autocomplete/index.js +2 -126
  29. package/autocomplete/types.d.ts +19 -0
  30. package/autocomplete/types.js +2 -0
  31. package/autocomplete-deprecated/autocomplete.module.scss +20 -0
  32. package/autocomplete-deprecated/index.d.ts +28 -0
  33. package/autocomplete-deprecated/index.js +130 -0
  34. package/avatar/index.d.ts +2 -2
  35. package/avatar/user.d.ts +1 -1
  36. package/base-input/base-input.d.ts +11 -0
  37. package/base-input/base-input.js +96 -0
  38. package/base-input/base-input.module.scss +3 -3
  39. package/base-input/index.d.ts +2 -23
  40. package/base-input/index.js +2 -76
  41. package/base-input/types.d.ts +31 -0
  42. package/base-input/types.js +2 -0
  43. package/base-input/utils.d.ts +6 -0
  44. package/base-input/utils.js +14 -0
  45. package/base-input-deprecated/base-input.module.scss +66 -0
  46. package/base-input-deprecated/index.d.ts +24 -0
  47. package/base-input-deprecated/index.js +80 -0
  48. package/bordered-layout/index.d.ts +1 -0
  49. package/bordered-layout/index.js +1 -0
  50. package/bottom-bar/bottom-bar-util.scss +20 -0
  51. package/bottom-bar/bottom-bar.d.ts +12 -0
  52. package/bottom-bar/bottom-bar.js +47 -0
  53. package/bottom-bar/bottom-bar.module.scss +14 -0
  54. package/bottom-bar/index.d.ts +2 -21
  55. package/bottom-bar/index.js +5 -44
  56. package/bottom-bar/types.d.ts +10 -0
  57. package/bottom-bar/types.js +2 -0
  58. package/box/index.d.ts +1 -1
  59. package/breakpoints.scss +34 -3
  60. package/button/button.module.scss +70 -53
  61. package/button/index.d.ts +26 -41
  62. package/button/index.js +22 -46
  63. package/card/index.d.ts +2 -1
  64. package/card/index.js +23 -6
  65. package/card/slots.d.ts +17 -3
  66. package/card/slots.js +15 -13
  67. package/carousel/draggable.d.ts +7 -3
  68. package/carousel/draggable.js +10 -3
  69. package/carousel/helpers/draggable-event.d.ts +5 -2
  70. package/carousel/helpers/draggable-event.js +5 -0
  71. package/carousel/index.d.ts +1 -1
  72. package/carousel/index.js +24 -24
  73. package/checkbox/checkbox.module.scss +1 -0
  74. package/checkbox/index.d.ts +3 -3
  75. package/checkbox-field/index.d.ts +3 -0
  76. package/checkbox-field/index.js +3 -0
  77. package/clean-buttons/clean-buttons-util.scss +15 -0
  78. package/clean-buttons/clean-buttons.module.scss +5 -3
  79. package/clean-buttons/index.d.ts +16 -7
  80. package/clean-buttons/index.js +17 -14
  81. package/clean-buttons/types.d.ts +1 -1
  82. package/clean-buttons/utils.d.ts +5 -1
  83. package/clean-buttons/utils.js +4 -0
  84. package/{colors.d.ts → colors/index.d.ts} +2 -2
  85. package/{colors.js → colors/index.js} +2 -1
  86. package/colors.scss +2 -0
  87. package/dot-nav/index.d.ts +1 -1
  88. package/dropdown/index.d.ts +1 -0
  89. package/dropdown/utils.d.ts +19 -0
  90. package/dropdown/utils.js +47 -0
  91. package/dropdown-item/dropdown-item.module.scss +80 -15
  92. package/dropdown-item/index.d.ts +20 -9
  93. package/dropdown-item/index.js +12 -9
  94. package/dropdown-item/types.d.ts +3 -0
  95. package/dropdown-item/types.js +2 -0
  96. package/dropdown-item/utils.d.ts +45 -0
  97. package/dropdown-item/utils.js +89 -0
  98. package/expandable/utils.js +3 -3
  99. package/field-block/field-block.module.scss +155 -0
  100. package/field-block/index.d.ts +63 -0
  101. package/field-block/index.js +43 -0
  102. package/field-grid/index.d.ts +5 -4
  103. package/field-grid/index.js +1 -0
  104. package/helpers/bounds-of.d.ts +5 -1
  105. package/helpers/bounds-of.js +5 -0
  106. package/helpers/center-of.d.ts +4 -1
  107. package/helpers/center-of.js +8 -1
  108. package/helpers/create-container.d.ts +5 -2
  109. package/helpers/create-container.js +7 -2
  110. package/helpers/define-slots.d.ts +3 -3
  111. package/helpers/define-slots.js +5 -3
  112. package/helpers/events.d.ts +16 -8
  113. package/helpers/events.js +41 -15
  114. package/helpers/find-child-element.d.ts +12 -9
  115. package/helpers/find-child-element.js +9 -5
  116. package/helpers/find-offset-parent.d.ts +1 -2
  117. package/helpers/find-offset-parent.js +2 -2
  118. package/helpers/find-sibling-index.d.ts +11 -8
  119. package/helpers/find-sibling-index.js +8 -3
  120. package/helpers/fit-element-height.d.ts +5 -5
  121. package/helpers/fit-element-height.js +9 -7
  122. package/helpers/format-date.d.ts +11 -11
  123. package/helpers/format-date.js +15 -13
  124. package/helpers/format-number.d.ts +1 -1
  125. package/helpers/format-number.js +2 -2
  126. package/helpers/get-date-interval-data.d.ts +4 -1
  127. package/helpers/get-date-interval-data.js +7 -2
  128. package/helpers/get-declination.d.ts +5 -1
  129. package/helpers/get-declination.js +5 -0
  130. package/helpers/get-fraction-depth.d.ts +1 -1
  131. package/helpers/get-fraction-depth.js +2 -2
  132. package/helpers/get-no-index.d.ts +2 -2
  133. package/helpers/get-no-index.js +4 -3
  134. package/helpers/get-relative-pos.d.ts +4 -1
  135. package/helpers/get-relative-pos.js +7 -2
  136. package/helpers/get-scroll-parent.d.ts +1 -2
  137. package/helpers/get-scroll-parent.js +5 -5
  138. package/helpers/is-browser.d.ts +4 -1
  139. package/helpers/is-browser.js +8 -1
  140. package/helpers/is-fully-scrolled.d.ts +3 -3
  141. package/helpers/is-fully-scrolled.js +2 -2
  142. package/helpers/is-touch-device.d.ts +1 -1
  143. package/helpers/is-touch-device.js +4 -5
  144. package/helpers/layer.d.ts +1 -1
  145. package/helpers/layer.js +2 -2
  146. package/helpers/max-index-of.d.ts +4 -1
  147. package/helpers/max-index-of.js +7 -2
  148. package/helpers/media-query-list.d.ts +1 -1
  149. package/helpers/media-query-list.js +2 -2
  150. package/helpers/on.d.ts +4 -1
  151. package/helpers/on.js +7 -2
  152. package/helpers/point.d.ts +4 -1
  153. package/helpers/point.js +8 -1
  154. package/helpers/rename.d.ts +3 -1
  155. package/helpers/rename.js +1 -0
  156. package/helpers/scroll-to-child.d.ts +1 -1
  157. package/helpers/scroll-to-child.js +3 -2
  158. package/helpers/styles.d.ts +8 -2
  159. package/helpers/styles.js +18 -4
  160. package/helpers/with-prevent.d.ts +9 -6
  161. package/helpers/with-prevent.js +16 -9
  162. package/hint/hint-view.d.ts +26 -0
  163. package/hint/hint-view.js +43 -0
  164. package/hint/hint-view.module.scss +32 -0
  165. package/hint/hint.d.ts +14 -0
  166. package/hint/hint.js +41 -0
  167. package/hint/index.d.ts +5 -8
  168. package/hint/index.js +13 -48
  169. package/hint/utils.d.ts +61 -0
  170. package/hint/utils.js +161 -0
  171. package/hint-deprecated/index.d.ts +11 -0
  172. package/hint-deprecated/index.js +53 -0
  173. package/hooks/breakpoint/index.d.ts +7 -4
  174. package/hooks/breakpoint/index.js +21 -13
  175. package/hooks/breakpoint/types.d.ts +3 -4
  176. package/hooks/breakpoint/utils.d.ts +2 -1
  177. package/hooks/breakpoint/utils.js +2 -1
  178. package/hooks/index.d.ts +8 -8
  179. package/hooks/index.js +27 -19
  180. package/hooks/intersection/test-utils.d.ts +1 -1
  181. package/hooks/intersection/test-utils.js +2 -1
  182. package/hooks/styles.d.ts +6 -0
  183. package/hooks/styles.js +26 -0
  184. package/info-text/index.d.ts +23 -0
  185. package/info-text/index.js +60 -0
  186. package/info-text/info-text.module.scss +28 -0
  187. package/input/index.d.ts +32 -0
  188. package/input/index.js +96 -0
  189. package/input/input.module.scss +20 -0
  190. package/input/utils.d.ts +36 -0
  191. package/input/utils.js +71 -0
  192. package/layout/index.d.ts +6 -11
  193. package/layout/index.js +6 -60
  194. package/layout/layout.d.ts +10 -0
  195. package/layout/layout.js +32 -0
  196. package/layout/layout.module.scss +33 -26
  197. package/layout/legacy.d.ts +15 -0
  198. package/layout/legacy.js +68 -0
  199. package/layout/legacy.module.scss +49 -0
  200. package/layout/types.d.ts +6 -0
  201. package/layout/types.js +2 -0
  202. package/link/index.d.ts +4 -1
  203. package/link/index.js +2 -2
  204. package/link/link-util.scss +37 -0
  205. package/link/link.module.scss +19 -12
  206. package/loading-overlay/index.d.ts +1 -0
  207. package/loading-overlay/index.js +1 -0
  208. package/masked-field/index.d.ts +1 -0
  209. package/masked-field/index.js +1 -0
  210. package/masked-input/hook.d.ts +8 -0
  211. package/masked-input/hook.js +72 -0
  212. package/masked-input/index.d.ts +5 -0
  213. package/masked-input/index.js +7 -0
  214. package/masked-input/masked-input.d.ts +8 -0
  215. package/masked-input/masked-input.js +73 -0
  216. package/masked-input/types.d.ts +51 -0
  217. package/masked-input/types.js +2 -0
  218. package/masked-input/utils.d.ts +15 -0
  219. package/masked-input/utils.js +49 -0
  220. package/modal/index.d.ts +10 -12
  221. package/modal/index.js +27 -64
  222. package/modal/modal.module.scss +98 -55
  223. package/modal/slots.d.ts +13 -10
  224. package/modal/slots.js +30 -28
  225. package/modal/utils.d.ts +8 -10
  226. package/modal/utils.js +2 -26
  227. package/modal-overlay/index.d.ts +13 -0
  228. package/modal-overlay/index.js +60 -0
  229. package/modal-overlay/modal-overlay-util.scss +1 -0
  230. package/modal-overlay/modal-overlay.module.scss +14 -0
  231. package/modal-overlay/utils.d.ts +14 -0
  232. package/modal-overlay/utils.js +32 -0
  233. package/package.json +49 -41
  234. package/pagination/utils.d.ts +2 -2
  235. package/panel/index.d.ts +27 -13
  236. package/panel/index.js +43 -9
  237. package/panel/panel.module.scss +49 -8
  238. package/phone-input/index.d.ts +4 -28
  239. package/phone-input/index.js +2 -121
  240. package/phone-input/phone-input.d.ts +8 -0
  241. package/phone-input/phone-input.js +133 -0
  242. package/phone-input/phone-input.module.scss +8 -32
  243. package/phone-input/presets.d.ts +21 -22
  244. package/phone-input/presets.js +1 -2
  245. package/phone-input/types.d.ts +6 -0
  246. package/phone-input/types.js +2 -0
  247. package/phone-input/utils.d.ts +30 -1
  248. package/phone-input/utils.js +52 -3
  249. package/phone-input-deprecated/index.d.ts +29 -0
  250. package/phone-input-deprecated/index.js +124 -0
  251. package/phone-input-deprecated/phone-input.module.scss +41 -0
  252. package/plate/index.d.ts +3 -3
  253. package/plate/index.js +2 -2
  254. package/plate/plate.module.scss +3 -0
  255. package/popup/index.d.ts +5 -0
  256. package/popup/index.js +12 -0
  257. package/popup/popup-view.d.ts +14 -0
  258. package/popup/popup-view.js +35 -0
  259. package/popup/popup-view.module.scss +40 -0
  260. package/popup/popup.d.ts +17 -0
  261. package/popup/popup.js +73 -0
  262. package/popup/utils.d.ts +38 -0
  263. package/popup/utils.js +83 -0
  264. package/price/index.d.ts +1 -1
  265. package/price/index.js +3 -3
  266. package/price/utils.d.ts +5 -5
  267. package/price/utils.js +33 -23
  268. package/radio-button/index.d.ts +10 -0
  269. package/radio-button/index.js +33 -0
  270. package/radio-button/radio-button.module.scss +46 -0
  271. package/rating/index.d.ts +2 -1
  272. package/rating/types.d.ts +1 -1
  273. package/readme.md +56 -65
  274. package/screen/index.d.ts +4 -2
  275. package/screen/index.js +34 -3
  276. package/screen/screen.module.scss +0 -2
  277. package/screen/slots.d.ts +2 -8
  278. package/screen/slots.js +8 -9
  279. package/screen/utils.d.ts +2 -1
  280. package/select/index.d.ts +2 -33
  281. package/select/index.js +3 -109
  282. package/select/parts/block.d.ts +8 -0
  283. package/select/parts/block.js +70 -0
  284. package/select/parts/block.module.scss +7 -0
  285. package/select/parts/button.d.ts +8 -0
  286. package/select/parts/button.js +69 -0
  287. package/select/parts/menu.d.ts +8 -0
  288. package/select/parts/menu.js +105 -0
  289. package/select/parts/menu.module.scss +4 -0
  290. package/select/select.d.ts +14 -0
  291. package/select/select.js +145 -0
  292. package/select/types.d.ts +55 -0
  293. package/select/types.js +2 -0
  294. package/select/utils.d.ts +3 -0
  295. package/select/utils.js +13 -0
  296. package/select-deprecated/index.d.ts +34 -0
  297. package/select-deprecated/index.js +112 -0
  298. package/shadows.scss +18 -0
  299. package/side-page/index.d.ts +11 -26
  300. package/side-page/index.js +21 -26
  301. package/side-page/side-page.module.scss +35 -29
  302. package/side-page/slots.d.ts +12 -20
  303. package/side-page/slots.js +16 -28
  304. package/spinner/index.d.ts +18 -6
  305. package/spinner/index.js +25 -12
  306. package/spinner/spinner.module.scss +8 -0
  307. package/stepper/index.d.ts +18 -10
  308. package/stepper/index.js +17 -8
  309. package/stepper/stepper.module.scss +14 -15
  310. package/styling/fonts.d.ts +3 -3
  311. package/switcher-row/index.d.ts +42 -0
  312. package/switcher-row/index.js +59 -0
  313. package/switcher-row/switcher-row.module.scss +59 -0
  314. package/text/index.d.ts +1 -1
  315. package/text-button/index.d.ts +42 -0
  316. package/text-button/index.js +46 -0
  317. package/text-button/text-button.module.scss +96 -0
  318. package/text-field/index.d.ts +7 -6
  319. package/text-field/index.js +3 -2
  320. package/textarea/index.d.ts +21 -0
  321. package/textarea/index.js +85 -0
  322. package/textarea/textarea.module.scss +15 -0
  323. package/toggle/index.d.ts +3 -3
  324. package/toggle/toggle.module.scss +17 -8
  325. package/tooltip/index.d.ts +1 -0
  326. package/tooltip/index.js +1 -0
  327. package/top-bar/index.d.ts +3 -40
  328. package/top-bar/index.js +4 -60
  329. package/top-bar/top-bar-util.scss +29 -0
  330. package/top-bar/top-bar.d.ts +9 -0
  331. package/top-bar/top-bar.js +101 -0
  332. package/top-bar/top-bar.module.scss +129 -67
  333. package/top-bar/types.d.ts +31 -0
  334. package/top-bar/types.js +2 -0
  335. package/top-bar/utils.d.ts +14 -0
  336. package/top-bar/utils.js +56 -0
  337. package/touch-slider/index.d.ts +1 -0
  338. package/touch-slider/index.js +3 -2
  339. package/types.d.ts +18 -0
  340. package/types.js +2 -0
  341. package/unknown-content/index.d.ts +3 -3
  342. package/unknown-content/index.js +3 -3
  343. package/unknown-content/unknown-content.module.scss +16 -12
  344. package/upload-area/index.d.ts +2 -0
  345. package/upload-area/index.js +5 -0
  346. package/upload-area/types.d.ts +32 -0
  347. package/upload-area/types.js +2 -0
  348. package/upload-area/upload-area-util.scss +17 -0
  349. package/upload-area/upload-area.d.ts +8 -0
  350. package/upload-area/upload-area.js +105 -0
  351. package/upload-area/upload-area.module.scss +78 -0
  352. package/upload-area/utils.d.ts +17 -0
  353. package/upload-area/utils.js +48 -0
  354. package/utils.scss +74 -1
  355. package/with-hint/index.d.ts +3 -2
  356. package/with-hint/index.js +1 -0
  357. package/with-hint/positioning-hint.d.ts +1 -1
  358. package/with-hint/positioning-hint.js +2 -2
  359. package/with-tooltip/index.d.ts +2 -1
  360. package/with-tooltip/index.js +1 -0
  361. package/with-tooltip/utils.d.ts +2 -2
  362. package/_internal/body-scroll.d.ts +0 -23
  363. package/_internal/body-scroll.js +0 -41
  364. package/_internal/checkbox/index.d.ts +0 -5
  365. package/constants.d.ts +0 -6
  366. package/constants.js +0 -9
  367. package/nav-bar/index.d.ts +0 -46
  368. package/nav-bar/index.js +0 -76
  369. package/nav-bar/nav-bar.module.scss +0 -95
  370. package/upload/area.d.ts +0 -25
  371. package/upload/area.js +0 -65
  372. package/upload/area.module.scss +0 -44
  373. package/upload/utils.d.ts +0 -29
  374. package/upload/utils.js +0 -45
  375. /package/_internal/{checkbox/index.js → page-scroll-lock/types.js} +0 -0
  376. /package/{hint → hint-deprecated}/hint.module.scss +0 -0
  377. /package/{select → select-deprecated}/select.module.scss +0 -0
  378. /package/{upload → upload-area}/upload.svg +0 -0
@@ -17,16 +17,18 @@ const ru_1 = __importDefault(require("date-fns/locale/ru"));
17
17
  * @param options.invalidPlaceholder Вернется в случае невалидности даты.
18
18
  * @return Функция для форматирования даты.
19
19
  */
20
- const createDateFormatter = ({ formatFrom = ['yyyy-MM-dd', 'dd.MM.yyyy'], formatTo = 'dd MMMM yyyy', invalidPlaceholder = '', } = {}) => (dateString) => {
21
- const date = (0, exports.parseMultiple)(dateString, formatFrom, new Date());
22
- let result = invalidPlaceholder;
23
- if ((0, isValid_1.default)(date)) {
24
- result = (0, format_1.default)(date, (0, lodash_1.isFunction)(formatTo) ? formatTo(new Date(date.getTime())) : formatTo, {
25
- locale: ru_1.default,
26
- });
27
- }
28
- return result;
29
- };
20
+ function createDateFormatter({ formatFrom = ['yyyy-MM-dd', 'dd.MM.yyyy'], formatTo = 'dd MMMM yyyy', invalidPlaceholder = '', } = {}) {
21
+ return (dateString) => {
22
+ const date = parseMultiple(dateString, formatFrom, new Date());
23
+ let result = invalidPlaceholder;
24
+ if ((0, isValid_1.default)(date)) {
25
+ result = (0, format_1.default)(date, (0, lodash_1.isFunction)(formatTo) ? formatTo(new Date(date.getTime())) : formatTo, {
26
+ locale: ru_1.default,
27
+ });
28
+ }
29
+ return result;
30
+ };
31
+ }
30
32
  exports.createDateFormatter = createDateFormatter;
31
33
  /**
32
34
  * Работает аналогично "date-fns/parse", но позволяет передать множество форматов в виде массива.
@@ -36,7 +38,7 @@ exports.createDateFormatter = createDateFormatter;
36
38
  * @param options Опции "date-fns/parse".
37
39
  * @return Дата.
38
40
  */
39
- const parseMultiple = (dateString, formatString, referenceDate, options) => {
41
+ function parseMultiple(dateString, formatString, referenceDate, options) {
40
42
  let result;
41
43
  if (Array.isArray(formatString)) {
42
44
  for (let i = 0; i < formatString.length; i++) {
@@ -50,6 +52,6 @@ const parseMultiple = (dateString, formatString, referenceDate, options) => {
50
52
  result = (0, parse_1.default)(dateString, formatString, referenceDate, options);
51
53
  }
52
54
  return result;
53
- };
55
+ }
54
56
  exports.parseMultiple = parseMultiple;
55
- exports.formatDate = (0, exports.createDateFormatter)();
57
+ exports.formatDate = createDateFormatter();
@@ -4,4 +4,4 @@
4
4
  * @param separator Разделяющий символ для чисел больше 999.
5
5
  * @return Массив строк с целой и дробной отоформатированными частями числа.
6
6
  */
7
- export declare const formatNumber: (value: number | string, separator?: string | undefined) => string[];
7
+ export declare function formatNumber(value: number | string, separator?: string): string[];
@@ -7,7 +7,7 @@ exports.formatNumber = void 0;
7
7
  * @param separator Разделяющий символ для чисел больше 999.
8
8
  * @return Массив строк с целой и дробной отоформатированными частями числа.
9
9
  */
10
- const formatNumber = (value, separator) => {
10
+ function formatNumber(value, separator) {
11
11
  const pureSeparator = String(separator) === separator ? separator : ' ';
12
12
  const number = Number(value);
13
13
  let result = [];
@@ -25,5 +25,5 @@ const formatNumber = (value, separator) => {
25
25
  result[0] = separated.join(pureSeparator); // подменяем целую часть на целую разделённую
26
26
  }
27
27
  return result;
28
- };
28
+ }
29
29
  exports.formatNumber = formatNumber;
@@ -4,8 +4,11 @@
4
4
  * @param endDate Конечная дата.
5
5
  * @return Объект с данными сформированного интервала.
6
6
  */
7
- declare const getDateIntervalData: (startDate: string, endDate: string) => {
7
+ export declare function getDateIntervalData(startDate: string, endDate: string): {
8
8
  date: string | undefined;
9
9
  isInterval: boolean | undefined;
10
10
  };
11
+ /**
12
+ * @deprecated Следует использовать именованный экспорт. Экспорт по умолчанию будет удалён в будущем.
13
+ */
11
14
  export default getDateIntervalData;
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getDateIntervalData = void 0;
6
7
  const format_1 = __importDefault(require("date-fns/format"));
7
8
  const parse_1 = __importDefault(require("date-fns/parse"));
8
9
  const isEqual_1 = __importDefault(require("date-fns/isEqual"));
@@ -17,7 +18,7 @@ const formatOptions = { locale: ru_1.default };
17
18
  * @param endDate Конечная дата.
18
19
  * @return Объект с данными сформированного интервала.
19
20
  */
20
- const getDateIntervalData = (startDate, endDate) => {
21
+ function getDateIntervalData(startDate, endDate) {
21
22
  const start = (0, parse_1.default)(startDate, inputFormat, new Date());
22
23
  const end = (0, parse_1.default)(endDate, inputFormat, new Date());
23
24
  let date;
@@ -34,5 +35,9 @@ const getDateIntervalData = (startDate, endDate) => {
34
35
  isInterval = false;
35
36
  }
36
37
  return { date, isInterval };
37
- };
38
+ }
39
+ exports.getDateIntervalData = getDateIntervalData;
40
+ /**
41
+ * @deprecated Следует использовать именованный экспорт. Экспорт по умолчанию будет удалён в будущем.
42
+ */
38
43
  exports.default = getDateIntervalData;
@@ -4,4 +4,8 @@
4
4
  * @param titles Массив со склонениями слова. Например: ['отзыв', 'отзыва', 'отзывов'].
5
5
  * @return Слово в нужном склонении.
6
6
  */
7
- export default function getDeclination(number: number, titles: string[]): string;
7
+ export declare function getDeclination(number: number, titles: string[]): string;
8
+ /**
9
+ * @deprecated Следует использовать именованный экспорт. Экспорт по умолчанию будет удалён в будущем.
10
+ */
11
+ export default getDeclination;
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getDeclination = void 0;
3
4
  /**
4
5
  * Возвращает нужное склонение из переданного списка по переданному числу.
5
6
  * @param number Число, используемое для склонения.
@@ -14,4 +15,8 @@ function getDeclination(number, titles) {
14
15
  : cases[positiveNumber % 10 < 5 ? positiveNumber % 10 : 5];
15
16
  return titles[index];
16
17
  }
18
+ exports.getDeclination = getDeclination;
19
+ /**
20
+ * @deprecated Следует использовать именованный экспорт. Экспорт по умолчанию будет удалён в будущем.
21
+ */
17
22
  exports.default = getDeclination;
@@ -3,4 +3,4 @@
3
3
  * @param fraction Дробь.
4
4
  * @return Разрядность / Количество символов после точки.
5
5
  */
6
- export declare const getFractionDepth: (fraction?: number | null) => number;
6
+ export declare function getFractionDepth(fraction?: number | null): number;
@@ -6,8 +6,8 @@ exports.getFractionDepth = void 0;
6
6
  * @param fraction Дробь.
7
7
  * @return Разрядность / Количество символов после точки.
8
8
  */
9
- const getFractionDepth = (fraction = null) => {
9
+ function getFractionDepth(fraction = null) {
10
10
  const fractionString = Number(fraction).toString();
11
11
  return fractionString.includes('.') ? fractionString.length - fractionString.indexOf('.') - 1 : 0;
12
- };
12
+ }
13
13
  exports.getFractionDepth = getFractionDepth;
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Возвращает объект с исходной строкой в тэге <!--noindex--> для запрета отслеживания контента поисковиками.
3
- * @param str Исходная строка.
3
+ * @param content Исходная строка.
4
4
  * @return Объект, содержащий обернутую строку, для использования c атрибутом dangerouslySetInnerHTML.
5
5
  */
6
- export declare const getNoIndex: (str: any) => {
6
+ export declare function getNoIndex(content: unknown): {
7
7
  __html: string;
8
8
  } | undefined;
@@ -1,11 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getNoIndex = void 0;
4
- const lodash_1 = require("lodash");
5
4
  /**
6
5
  * Возвращает объект с исходной строкой в тэге <!--noindex--> для запрета отслеживания контента поисковиками.
7
- * @param str Исходная строка.
6
+ * @param content Исходная строка.
8
7
  * @return Объект, содержащий обернутую строку, для использования c атрибутом dangerouslySetInnerHTML.
9
8
  */
10
- const getNoIndex = (str) => str ? { __html: `<!--noindex-->${(0, lodash_1.toString)(str)}<!--/noindex-->` } : undefined;
9
+ function getNoIndex(content) {
10
+ return content ? { __html: `<!--noindex-->${String(content)}<!--/noindex-->` } : undefined;
11
+ }
11
12
  exports.getNoIndex = getNoIndex;
@@ -4,8 +4,11 @@
4
4
  * @param parent Элемент, относительно которого необходимо определить позицию.
5
5
  * @return Относительная позиция элемента.
6
6
  */
7
- declare const getRelativePos: (target: Element, parent?: HTMLElement | null) => {
7
+ export declare function getRelativePos(target: Element, parent?: HTMLElement | null): {
8
8
  x: number;
9
9
  y: number;
10
10
  };
11
+ /**
12
+ * @deprecated Следует использовать именованный экспорт. Экспорт по умолчанию будет удалён в будущем.
13
+ */
11
14
  export default getRelativePos;
@@ -1,17 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getRelativePos = void 0;
3
4
  /**
4
5
  * Определяет позицию элемента относительно другого заданного элемента.
5
6
  * @param target Элемент для определения позиции.
6
7
  * @param parent Элемент, относительно которого необходимо определить позицию.
7
8
  * @return Относительная позиция элемента.
8
9
  */
9
- const getRelativePos = (target, parent = target.parentElement) => {
10
+ function getRelativePos(target, parent = target.parentElement) {
10
11
  const targetBounds = target.getBoundingClientRect();
11
12
  const parentBounds = parent === null || parent === void 0 ? void 0 : parent.getBoundingClientRect();
12
13
  return {
13
14
  x: targetBounds.left - ((parentBounds === null || parentBounds === void 0 ? void 0 : parentBounds.left) || 0),
14
15
  y: targetBounds.top - ((parentBounds === null || parentBounds === void 0 ? void 0 : parentBounds.top) || 0),
15
16
  };
16
- };
17
+ }
18
+ exports.getRelativePos = getRelativePos;
19
+ /**
20
+ * @deprecated Следует использовать именованный экспорт. Экспорт по умолчанию будет удалён в будущем.
21
+ */
17
22
  exports.default = getRelativePos;
@@ -3,5 +3,4 @@
3
3
  * @param element Элемент.
4
4
  * @return Ближайший родительский элемент с возможностью прокрутки.
5
5
  */
6
- declare const getScrollParent: (element: Element | undefined | null) => HTMLElement;
7
- export { getScrollParent };
6
+ export declare function getScrollParent(element: Element | undefined | null): HTMLElement;
@@ -1,27 +1,27 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getScrollParent = void 0;
4
- // не надо использовать глобальный поиск здесь, чтобы regex не сохранял lastIndex
4
+ // ВАЖНО: не надо использовать глобальный поиск здесь, чтобы regex не сохранял lastIndex
5
5
  const regex = /(auto|scroll)/;
6
6
  /**
7
7
  * Определяет, имеет ли элемент возможность прокручиваться.
8
8
  * @param element Элемент.
9
9
  * @return Имеет ли элемент возможность прокручиваться.
10
10
  */
11
- const isScrollable = (element) => {
11
+ function isScrollable(element) {
12
12
  let result = false;
13
13
  if (element) {
14
14
  const styles = getComputedStyle(element);
15
15
  result = regex.test(styles.overflow + styles.overflowX + styles.overflowY);
16
16
  }
17
17
  return result;
18
- };
18
+ }
19
19
  /**
20
20
  * Возвращает ближайший родительский элемент с возможностью прокрутки.
21
21
  * @param element Элемент.
22
22
  * @return Ближайший родительский элемент с возможностью прокрутки.
23
23
  */
24
- const getScrollParent = (element) => {
24
+ function getScrollParent(element) {
25
25
  let result;
26
26
  if (!element || element === document.body) {
27
27
  // @todo прокрутка на body не работает с addEventListener, https://stackoverflow.com/a/43632204/13166471
@@ -34,5 +34,5 @@ const getScrollParent = (element) => {
34
34
  : getScrollParent(element.parentElement);
35
35
  }
36
36
  return result;
37
- };
37
+ }
38
38
  exports.getScrollParent = getScrollParent;
@@ -2,5 +2,8 @@
2
2
  * Проверка находимся в браузере или нет.
3
3
  * @return Если в браузере true, если нет false.
4
4
  */
5
- declare const isBrowser: () => boolean;
5
+ export declare function isBrowser(): boolean;
6
+ /**
7
+ * @deprecated Следует использовать именованный экспорт. Экспорт по умолчанию будет удалён в будущем.
8
+ */
6
9
  export default isBrowser;
@@ -1,8 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isBrowser = void 0;
3
4
  /**
4
5
  * Проверка находимся в браузере или нет.
5
6
  * @return Если в браузере true, если нет false.
6
7
  */
7
- const isBrowser = () => typeof window !== 'undefined';
8
+ function isBrowser() {
9
+ return typeof window !== 'undefined';
10
+ }
11
+ exports.isBrowser = isBrowser;
12
+ /**
13
+ * @deprecated Следует использовать именованный экспорт. Экспорт по умолчанию будет удалён в будущем.
14
+ */
8
15
  exports.default = isBrowser;
@@ -5,6 +5,6 @@
5
5
  * @param options.threshold Отступ от конца.
6
6
  * @return Прокручен ли переданный элемент до конца по вертикали.
7
7
  */
8
- export declare const isFullyScrolled: (element?: HTMLElement | undefined | null, { threshold }?: {
9
- threshold?: number | undefined;
10
- }) => boolean;
8
+ export declare function isFullyScrolled(element?: HTMLElement | undefined | null, { threshold }?: {
9
+ threshold?: number;
10
+ }): boolean;
@@ -8,7 +8,7 @@ exports.isFullyScrolled = void 0;
8
8
  * @param options.threshold Отступ от конца.
9
9
  * @return Прокручен ли переданный элемент до конца по вертикали.
10
10
  */
11
- const isFullyScrolled = (element, { threshold = 0 } = {}) => {
11
+ function isFullyScrolled(element, { threshold = 0 } = {}) {
12
12
  let result = false;
13
13
  if (element) {
14
14
  const { scrollTop, clientHeight, scrollHeight } = element;
@@ -16,5 +16,5 @@ const isFullyScrolled = (element, { threshold = 0 } = {}) => {
16
16
  result = bottom >= scrollHeight;
17
17
  }
18
18
  return result;
19
- };
19
+ }
20
20
  exports.isFullyScrolled = isFullyScrolled;
@@ -2,4 +2,4 @@
2
2
  * Проверяет поддержку touch событий.
3
3
  * @return True - если поддерживает, false - если нет.
4
4
  */
5
- export declare const isTouchDevice: () => boolean;
5
+ export declare function isTouchDevice(): boolean;
@@ -1,13 +1,12 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.isTouchDevice = void 0;
7
- const is_browser_1 = __importDefault(require("./is-browser"));
4
+ const is_browser_1 = require("./is-browser");
8
5
  /**
9
6
  * Проверяет поддержку touch событий.
10
7
  * @return True - если поддерживает, false - если нет.
11
8
  */
12
- const isTouchDevice = () => (0, is_browser_1.default)() && 'ontouchstart' in window;
9
+ function isTouchDevice() {
10
+ return (0, is_browser_1.isBrowser)() && 'ontouchstart' in window;
11
+ }
13
12
  exports.isTouchDevice = isTouchDevice;
@@ -7,4 +7,4 @@ export declare const LayerProvider: import("react").Provider<number>;
7
7
  * Хук, возвращающий индекс текущего "слоя".
8
8
  * @return Индекс.
9
9
  */
10
- export declare const useLayer: () => number;
10
+ export declare function useLayer(): number;
package/helpers/layer.js CHANGED
@@ -11,8 +11,8 @@ exports.LayerProvider = LayerContext.Provider;
11
11
  * Хук, возвращающий индекс текущего "слоя".
12
12
  * @return Индекс.
13
13
  */
14
- const useLayer = () => {
14
+ function useLayer() {
15
15
  const currentLayer = (0, react_1.useContext)(LayerContext);
16
16
  return currentLayer;
17
- };
17
+ }
18
18
  exports.useLayer = useLayer;
@@ -3,5 +3,8 @@
3
3
  * @param list Список.
4
4
  * @return Максимальный индекс.
5
5
  */
6
- declare const maxIndexOf: (list?: ArrayLike<any> | null | undefined) => number;
6
+ export declare function maxIndexOf(list?: ArrayLike<any> | null): number;
7
+ /**
8
+ * @deprecated Следует использовать именованный экспорт. Экспорт по умолчанию будет удалён в будущем.
9
+ */
7
10
  export default maxIndexOf;
@@ -1,15 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.maxIndexOf = void 0;
3
4
  /**
4
5
  * Возвращает максимальный индекс списка.
5
6
  * @param list Список.
6
7
  * @return Максимальный индекс.
7
8
  */
8
- const maxIndexOf = (list) => {
9
+ function maxIndexOf(list) {
9
10
  let maxIndex = -1;
10
11
  if (list) {
11
12
  maxIndex = list.length > 0 ? list.length - 1 : 0;
12
13
  }
13
14
  return maxIndex;
14
- };
15
+ }
16
+ exports.maxIndexOf = maxIndexOf;
17
+ /**
18
+ * @deprecated Следует использовать именованный экспорт. Экспорт по умолчанию будет удалён в будущем.
19
+ */
15
20
  exports.default = maxIndexOf;
@@ -4,6 +4,6 @@
4
4
  * @param fn Обработчик.
5
5
  * @return Интерфейс отписки.
6
6
  */
7
- export declare const subscribe: (mql: MediaQueryList, fn: (e: MediaQueryListEvent) => void) => {
7
+ export declare function subscribe(mql: MediaQueryList, fn: (e: MediaQueryListEvent) => void): {
8
8
  unsubscribe: () => void;
9
9
  };
@@ -7,7 +7,7 @@ exports.subscribe = void 0;
7
7
  * @param fn Обработчик.
8
8
  * @return Интерфейс отписки.
9
9
  */
10
- const subscribe = (mql, fn) => {
10
+ function subscribe(mql, fn) {
11
11
  if (mql.addEventListener) {
12
12
  mql.addEventListener('change', fn);
13
13
  }
@@ -24,5 +24,5 @@ const subscribe = (mql, fn) => {
24
24
  }
25
25
  },
26
26
  };
27
- };
27
+ }
28
28
  exports.subscribe = subscribe;
package/helpers/on.d.ts CHANGED
@@ -7,5 +7,8 @@ import React from 'react';
7
7
  * @param options Опции подписки.
8
8
  * @return Функция отписки.
9
9
  */
10
- declare const on: <T extends Event | React.SyntheticEvent<Element, Event>>(target: EventTarget, eventNames: string, callback: (e: T) => void, options?: boolean | EventListenerOptions | AddEventListenerOptions | undefined) => () => undefined;
10
+ export declare function on<T extends Event | React.SyntheticEvent>(target: EventTarget, eventNames: string, callback: (e: T) => void, options?: boolean | EventListenerOptions | AddEventListenerOptions | undefined): () => undefined;
11
+ /**
12
+ * @deprecated Следует использовать именованный экспорт. Экспорт по умолчанию будет удалён в будущем.
13
+ */
11
14
  export default on;
package/helpers/on.js CHANGED
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.on = void 0;
3
4
  /**
4
5
  * Выполняет подписку на событие целевого объекта.
5
6
  * @param target Целевой объект.
@@ -8,7 +9,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
8
9
  * @param options Опции подписки.
9
10
  * @return Функция отписки.
10
11
  */
11
- const on = (target, eventNames, callback, options) => {
12
+ function on(target, eventNames, callback, options) {
12
13
  const eventNamesList = eventNames.split(' ');
13
14
  // обернуто чтобы прокинуть T
14
15
  // eslint-disable-next-line require-jsdoc
@@ -19,5 +20,9 @@ const on = (target, eventNames, callback, options) => {
19
20
  return () => void eventNamesList.forEach(eventName => {
20
21
  target.removeEventListener(eventName, wrapped, options);
21
22
  });
22
- };
23
+ }
24
+ exports.on = on;
25
+ /**
26
+ * @deprecated Следует использовать именованный экспорт. Экспорт по умолчанию будет удалён в будущем.
27
+ */
23
28
  exports.default = on;
@@ -8,5 +8,8 @@ export interface IPoint {
8
8
  * @param y Координата по оси Y.
9
9
  * @return Объект представляющий точку.
10
10
  */
11
- declare const Point: (x?: number, y?: number) => IPoint;
11
+ export declare function Point(x?: number, y?: number): IPoint;
12
+ /**
13
+ * @deprecated Следует использовать именованный экспорт. Экспорт по умолчанию будет удалён в будущем.
14
+ */
12
15
  export default Point;
package/helpers/point.js CHANGED
@@ -1,10 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Point = void 0;
3
4
  /**
4
5
  * Возвращает объект представляющий точку в двухмерном пространстве.
5
6
  * @param x Координата по оси X.
6
7
  * @param y Координата по оси Y.
7
8
  * @return Объект представляющий точку.
8
9
  */
9
- const Point = (x = 0, y = 0) => ({ x, y });
10
+ function Point(x = 0, y = 0) {
11
+ return { x, y };
12
+ }
13
+ exports.Point = Point;
14
+ /**
15
+ * @deprecated Следует использовать именованный экспорт. Экспорт по умолчанию будет удалён в будущем.
16
+ */
10
17
  exports.default = Point;
@@ -1,7 +1,9 @@
1
1
  /// <reference types="lodash" />
2
- declare type ObjectKey = string | number | symbol;
2
+ /// <reference types="lodash" />
3
+ type ObjectKey = string | number | symbol;
3
4
  /**
4
5
  * Переименовывает свойство, возвращая новый объект.
6
+ * @deprecated Эта функция не относится напрямую к работе с UI и будет удалена в будущем.
5
7
  * @param fromKey Старый ключ.
6
8
  * @param toKey Новый ключ.
7
9
  * @param source Объект.
package/helpers/rename.js CHANGED
@@ -4,6 +4,7 @@ exports.rename = void 0;
4
4
  const fp_1 = require("lodash/fp");
5
5
  /**
6
6
  * Переименовывает свойство, возвращая новый объект.
7
+ * @deprecated Эта функция не относится напрямую к работе с UI и будет удалена в будущем.
7
8
  * @param fromKey Старый ключ.
8
9
  * @param toKey Новый ключ.
9
10
  * @param source Объект.
@@ -3,4 +3,4 @@
3
3
  * @param parent Родительский элемент.
4
4
  * @param child Дочерний элемент.
5
5
  */
6
- export declare const scrollToChild: (parent: HTMLElement, child: Element) => void;
6
+ export declare function scrollToChild(parent: HTMLElement, child: Element): void;
@@ -10,7 +10,7 @@ const bounds_of_1 = __importDefault(require("./bounds-of"));
10
10
  * @param parent Родительский элемент.
11
11
  * @param child Дочерний элемент.
12
12
  */
13
- const scrollToChild = (parent, child) => {
13
+ function scrollToChild(parent, child) {
14
14
  const [parentRect, childRect] = [parent, child].map(bounds_of_1.default);
15
15
  // ВАЖНО: не надо использовать offsetTop здесь, offsetParent может не соответствовать указанному родителю
16
16
  if (childRect.bottom > parentRect.bottom) {
@@ -19,5 +19,6 @@ const scrollToChild = (parent, child) => {
19
19
  else if (childRect.top < parentRect.top) {
20
20
  parent.scrollTop -= parentRect.top - childRect.top;
21
21
  }
22
- };
22
+ // @todo доделать для OverlayScrollbars?
23
+ }
23
24
  exports.scrollToChild = scrollToChild;
@@ -5,7 +5,7 @@
5
5
  * @param easing Функция плавности.
6
6
  * @return Значение CSS-свойства "transition".
7
7
  */
8
- export declare const getTransitionStyle: (duration?: number, property?: string, easing?: string) => string;
8
+ export declare function getTransitionStyle(duration?: number, property?: string, easing?: string): string;
9
9
  /**
10
10
  * Возвращает строку значения CSS-свойства с трансформацией смещения.
11
11
  *
@@ -16,4 +16,10 @@ export declare const getTransitionStyle: (duration?: number, property?: string,
16
16
  * @param z Смещение по оси z в пикселях.
17
17
  * @return Значение CSS-свойства с трансформацией смещения.
18
18
  */
19
- export declare const getTranslateStyle: (x?: number, y?: number, z?: number) => string;
19
+ export declare function getTranslateStyle(x?: number, y?: number, z?: number): string;
20
+ /**
21
+ * Устанавливает на переданный элемент css-переменную "--vh".
22
+ * Значение переменной является аналогом `1vh` с учетом особенностей viewport'а мобильный устройств.
23
+ * @param element Элемент на котором будет задана css-переменная.
24
+ */
25
+ export declare function setViewportHeightUnit(element: HTMLElement): void;
package/helpers/styles.js CHANGED
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getTranslateStyle = exports.getTransitionStyle = void 0;
4
- const lodash_1 = require("lodash");
3
+ exports.setViewportHeightUnit = exports.getTranslateStyle = exports.getTransitionStyle = void 0;
5
4
  /**
6
5
  * Возвращает строку значения CSS-свойства "transition".
7
6
  * @param duration Длительность перехода в миллисекундах.
@@ -9,7 +8,9 @@ const lodash_1 = require("lodash");
9
8
  * @param easing Функция плавности.
10
9
  * @return Значение CSS-свойства "transition".
11
10
  */
12
- const getTransitionStyle = (duration = 0, property = 'all', easing = 'ease-out') => `${property} ${(0, lodash_1.isNumber)(duration) ? duration : 0}ms ${easing}`;
11
+ function getTransitionStyle(duration = 0, property = 'all', easing = 'ease-out') {
12
+ return `${property} ${Number.isFinite(duration) ? duration : 0}ms ${easing}`;
13
+ }
13
14
  exports.getTransitionStyle = getTransitionStyle;
14
15
  /**
15
16
  * Возвращает строку значения CSS-свойства с трансформацией смещения.
@@ -21,5 +22,18 @@ exports.getTransitionStyle = getTransitionStyle;
21
22
  * @param z Смещение по оси z в пикселях.
22
23
  * @return Значение CSS-свойства с трансформацией смещения.
23
24
  */
24
- const getTranslateStyle = (x = 0, y = 0, z = 0) => `translate3d(${x}px, ${y}px, ${z}px)`;
25
+ function getTranslateStyle(x = 0, y = 0, z = 0) {
26
+ return `translate3d(${x}px, ${y}px, ${z}px)`;
27
+ }
25
28
  exports.getTranslateStyle = getTranslateStyle;
29
+ /**
30
+ * Устанавливает на переданный элемент css-переменную "--vh".
31
+ * Значение переменной является аналогом `1vh` с учетом особенностей viewport'а мобильный устройств.
32
+ * @param element Элемент на котором будет задана css-переменная.
33
+ */
34
+ function setViewportHeightUnit(element) {
35
+ const { visualViewport } = window;
36
+ const height = visualViewport ? visualViewport.height * visualViewport.scale : window.innerHeight;
37
+ element.style.setProperty('--vh', `${height / 100}px`);
38
+ }
39
+ exports.setViewportHeightUnit = setViewportHeightUnit;