@consta/uikit 3.6.0 → 3.9.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 (456) hide show
  1. package/Attach/package.json +1 -1
  2. package/Attachment/package.json +1 -1
  3. package/Avatar/package.json +1 -1
  4. package/Badge/package.json +1 -1
  5. package/BasicSelectDeprecated/package.json +1 -1
  6. package/Breadcrumbs/package.json +1 -1
  7. package/Button/package.json +1 -1
  8. package/CHANGELOG.md +49 -41
  9. package/Calendar/package.json +1 -1
  10. package/Card/package.json +1 -1
  11. package/Checkbox/package.json +1 -1
  12. package/CheckboxGroup/package.json +1 -1
  13. package/ChoiceGroup/package.json +1 -1
  14. package/Collapse/package.json +1 -1
  15. package/CollapseGroup/package.json +1 -1
  16. package/Combobox/package.json +1 -1
  17. package/ComboboxDeprecated/package.json +1 -1
  18. package/ContextMenu/package.json +1 -1
  19. package/DatePickerCanary/es.js +1 -0
  20. package/DatePickerCanary/index.d.ts +1 -0
  21. package/DatePickerCanary/index.js +4 -0
  22. package/DatePickerCanary/package.json +9 -0
  23. package/DateTimeCanary/package.json +1 -1
  24. package/DragNDropField/package.json +1 -1
  25. package/EventInterceptor/package.json +1 -1
  26. package/FieldCaption/package.json +1 -1
  27. package/FieldLabel/package.json +1 -1
  28. package/File/package.json +1 -1
  29. package/FileField/package.json +1 -1
  30. package/FileIcon/package.json +1 -1
  31. package/FileIconAvi/package.json +1 -1
  32. package/FileIconBmp/package.json +1 -1
  33. package/FileIconCsv/package.json +1 -1
  34. package/FileIconDoc/package.json +1 -1
  35. package/FileIconExe/package.json +1 -1
  36. package/FileIconGif/package.json +1 -1
  37. package/FileIconJpg/package.json +1 -1
  38. package/FileIconJson/package.json +1 -1
  39. package/FileIconLoading/package.json +1 -1
  40. package/FileIconMov/package.json +1 -1
  41. package/FileIconMp3/package.json +1 -1
  42. package/FileIconMp4/package.json +1 -1
  43. package/FileIconPdf/package.json +1 -1
  44. package/FileIconPng/package.json +1 -1
  45. package/FileIconPtt/package.json +1 -1
  46. package/FileIconRar/package.json +1 -1
  47. package/FileIconRtf/package.json +1 -1
  48. package/FileIconTiff/package.json +1 -1
  49. package/FileIconTxt/package.json +1 -1
  50. package/FileIconUndefined/package.json +1 -1
  51. package/FileIconWav/package.json +1 -1
  52. package/FileIconXls/package.json +1 -1
  53. package/FileIconZip/package.json +1 -1
  54. package/Grid/package.json +1 -1
  55. package/Header/package.json +1 -1
  56. package/Icon/package.json +1 -1
  57. package/IconAdd/package.json +1 -1
  58. package/IconAddToComparison/package.json +1 -1
  59. package/IconAlert/package.json +1 -1
  60. package/IconAlignBlocksLeft/package.json +1 -1
  61. package/IconAlignBlocksRight/package.json +1 -1
  62. package/IconAlignCenter/package.json +1 -1
  63. package/IconAlignJustify/package.json +1 -1
  64. package/IconAlignLeft/package.json +1 -1
  65. package/IconAlignRight/package.json +1 -1
  66. package/IconAllDone/package.json +1 -1
  67. package/IconArrowDown/package.json +1 -1
  68. package/IconArrowLeft/package.json +1 -1
  69. package/IconArrowRight/package.json +1 -1
  70. package/IconArrowUp/package.json +1 -1
  71. package/IconArtBrush/package.json +1 -1
  72. package/IconAttach/package.json +1 -1
  73. package/IconBackward/package.json +1 -1
  74. package/IconBag/package.json +1 -1
  75. package/IconBarrier/package.json +1 -1
  76. package/IconBento/package.json +1 -1
  77. package/IconBold/package.json +1 -1
  78. package/IconBook/package.json +1 -1
  79. package/IconBookmarkFilled/package.json +1 -1
  80. package/IconBookmarkStroked/package.json +1 -1
  81. package/IconCalculator/package.json +1 -1
  82. package/IconCalendar/package.json +1 -1
  83. package/IconCamera/package.json +1 -1
  84. package/IconCancel/package.json +1 -1
  85. package/IconCards/package.json +1 -1
  86. package/IconChat/package.json +1 -1
  87. package/IconCheck/package.json +1 -1
  88. package/IconClose/package.json +1 -1
  89. package/IconCollapse/package.json +1 -1
  90. package/IconColorFill/package.json +1 -1
  91. package/IconColorText/package.json +1 -1
  92. package/IconColumns/package.json +1 -1
  93. package/IconComment/package.json +1 -1
  94. package/IconConnection/package.json +1 -1
  95. package/IconCopy/package.json +1 -1
  96. package/IconCrown/package.json +1 -1
  97. package/IconCursorMouse/package.json +1 -1
  98. package/IconDataNull/package.json +1 -1
  99. package/IconDiamond/package.json +1 -1
  100. package/IconDinosaur/package.json +1 -1
  101. package/IconDisconnection/package.json +1 -1
  102. package/IconDocAdd/package.json +1 -1
  103. package/IconDocBlank/package.json +1 -1
  104. package/IconDocDelete/package.json +1 -1
  105. package/IconDocExport/package.json +1 -1
  106. package/IconDocFilled/package.json +1 -1
  107. package/IconDown/package.json +1 -1
  108. package/IconDownload/package.json +1 -1
  109. package/IconDrag/package.json +1 -1
  110. package/IconDraggable/package.json +1 -1
  111. package/IconDrillingRig/package.json +1 -1
  112. package/IconDrop/package.json +1 -1
  113. package/IconEdit/package.json +1 -1
  114. package/IconExit/package.json +1 -1
  115. package/IconExpand/package.json +1 -1
  116. package/IconEye/package.json +1 -1
  117. package/IconEyeClose/package.json +1 -1
  118. package/IconFavorite/package.json +1 -1
  119. package/IconFilter/package.json +1 -1
  120. package/IconFitToDefault/package.json +1 -1
  121. package/IconFlagFilled/package.json +1 -1
  122. package/IconFlagStroked/package.json +1 -1
  123. package/IconFolders/package.json +1 -1
  124. package/IconForward/package.json +1 -1
  125. package/IconFunnel/package.json +1 -1
  126. package/IconGas/package.json +1 -1
  127. package/IconGeo/package.json +1 -1
  128. package/IconGrouping/package.json +1 -1
  129. package/IconHamburger/package.json +1 -1
  130. package/IconHand/package.json +1 -1
  131. package/IconHealth/package.json +1 -1
  132. package/IconInComparison/package.json +1 -1
  133. package/IconInfo/package.json +1 -1
  134. package/IconIntroduction/package.json +1 -1
  135. package/IconIpad/package.json +1 -1
  136. package/IconItalic/package.json +1 -1
  137. package/IconKebab/package.json +1 -1
  138. package/IconLaptop/package.json +1 -1
  139. package/IconLayers/package.json +1 -1
  140. package/IconLeaf/package.json +1 -1
  141. package/IconLightningBolt/package.json +1 -1
  142. package/IconLineAndBarChart/package.json +1 -1
  143. package/IconLink/package.json +1 -1
  144. package/IconList/package.json +1 -1
  145. package/IconListNumbered/package.json +1 -1
  146. package/IconLock/package.json +1 -1
  147. package/IconLogicalElement/package.json +1 -1
  148. package/IconMBU/package.json +1 -1
  149. package/IconMGRP/package.json +1 -1
  150. package/IconMLSP/package.json +1 -1
  151. package/IconMMP/package.json +1 -1
  152. package/IconMail/package.json +1 -1
  153. package/IconMap/package.json +1 -1
  154. package/IconMaxHeight/package.json +1 -1
  155. package/IconMaxWidth/package.json +1 -1
  156. package/IconMeatball/package.json +1 -1
  157. package/IconMic/package.json +1 -1
  158. package/IconMolecules/package.json +1 -1
  159. package/IconMoon/package.json +1 -1
  160. package/IconNodeEnd/package.json +1 -1
  161. package/IconNodeStart/package.json +1 -1
  162. package/IconNodeStep/package.json +1 -1
  163. package/IconNodes/package.json +1 -1
  164. package/IconOpenInNew/package.json +1 -1
  165. package/IconPanelBottom/package.json +1 -1
  166. package/IconPanelLeft/package.json +1 -1
  167. package/IconPanelRight/package.json +1 -1
  168. package/IconPanelTop/package.json +1 -1
  169. package/IconPaste/package.json +1 -1
  170. package/IconPause/package.json +1 -1
  171. package/IconPhone/package.json +1 -1
  172. package/IconPhoto/package.json +1 -1
  173. package/IconPlay/package.json +1 -1
  174. package/IconPressure/package.json +1 -1
  175. package/IconProcessing/package.json +1 -1
  176. package/IconQuestion/package.json +1 -1
  177. package/IconQuote/package.json +1 -1
  178. package/IconRUO/package.json +1 -1
  179. package/IconRUS/package.json +1 -1
  180. package/IconRecord/package.json +1 -1
  181. package/IconRemove/package.json +1 -1
  182. package/IconRemoveFromComparison/package.json +1 -1
  183. package/IconReply/package.json +1 -1
  184. package/IconResize/package.json +1 -1
  185. package/IconRestart/package.json +1 -1
  186. package/IconRevert/package.json +1 -1
  187. package/IconRing/package.json +1 -1
  188. package/IconRouble/package.json +1 -1
  189. package/IconRuler/package.json +1 -1
  190. package/IconScreen/package.json +1 -1
  191. package/IconSearch/package.json +1 -1
  192. package/IconSelect/package.json +1 -1
  193. package/IconSelectOpen/package.json +1 -1
  194. package/IconSettings/package.json +1 -1
  195. package/IconShape/package.json +1 -1
  196. package/IconShuffle/package.json +1 -1
  197. package/IconSmile/package.json +1 -1
  198. package/IconSortDown/package.json +1 -1
  199. package/IconSortDownCenter/package.json +1 -1
  200. package/IconSortUp/package.json +1 -1
  201. package/IconSortUpCenter/package.json +1 -1
  202. package/IconStop/package.json +1 -1
  203. package/IconStorage/package.json +1 -1
  204. package/IconStrikethrough/package.json +1 -1
  205. package/IconSun/package.json +1 -1
  206. package/IconTable/package.json +1 -1
  207. package/IconTarget/package.json +1 -1
  208. package/IconTeam/package.json +1 -1
  209. package/IconTest/package.json +1 -1
  210. package/IconThumbUp/package.json +1 -1
  211. package/IconTie/package.json +1 -1
  212. package/IconTop/package.json +1 -1
  213. package/IconTrash/package.json +1 -1
  214. package/IconType/package.json +1 -1
  215. package/IconUnderline/package.json +1 -1
  216. package/IconUnlock/package.json +1 -1
  217. package/IconUnsort/package.json +1 -1
  218. package/IconUnsortCenter/package.json +1 -1
  219. package/IconUpload/package.json +1 -1
  220. package/IconUser/package.json +1 -1
  221. package/IconVZD/package.json +1 -1
  222. package/IconVideo/package.json +1 -1
  223. package/IconWarning/package.json +1 -1
  224. package/IconWatch/package.json +1 -1
  225. package/IconWideScreen/package.json +1 -1
  226. package/IconWorld/package.json +1 -1
  227. package/Informer/package.json +1 -1
  228. package/LayoutCanary/package.json +1 -1
  229. package/Loader/package.json +1 -1
  230. package/MixCard/package.json +1 -1
  231. package/MixFocus/package.json +1 -1
  232. package/MixVisuallyHidden/package.json +1 -1
  233. package/Modal/package.json +1 -1
  234. package/MultiComboboxDeprecated/package.json +1 -1
  235. package/Pagination/package.json +1 -1
  236. package/Popover/package.json +1 -1
  237. package/PortalWithTheme/package.json +1 -1
  238. package/ProgressSpin/package.json +1 -1
  239. package/ProgressStepBarCanary/es.js +1 -0
  240. package/ProgressStepBarCanary/index.d.ts +1 -0
  241. package/ProgressStepBarCanary/index.js +4 -0
  242. package/ProgressStepBarCanary/package.json +9 -0
  243. package/Radio/package.json +1 -1
  244. package/RadioGroup/package.json +1 -1
  245. package/Responses/package.json +1 -1
  246. package/Responses403/package.json +1 -1
  247. package/Responses404/package.json +1 -1
  248. package/Responses500/package.json +1 -1
  249. package/Responses503/package.json +1 -1
  250. package/ResponsesConnectionError/package.json +1 -1
  251. package/ResponsesDeleted/package.json +1 -1
  252. package/ResponsesEmptyBox/package.json +1 -1
  253. package/ResponsesEmptyPockets/package.json +1 -1
  254. package/ResponsesImage/package.json +1 -1
  255. package/ResponsesImage403/package.json +1 -1
  256. package/ResponsesImage404/package.json +1 -1
  257. package/ResponsesImage500/package.json +1 -1
  258. package/ResponsesImage503/package.json +1 -1
  259. package/ResponsesImageConnectionError/package.json +1 -1
  260. package/ResponsesImageDeleted/package.json +1 -1
  261. package/ResponsesImageEmptyBox/package.json +1 -1
  262. package/ResponsesImageEmptyPockets/package.json +1 -1
  263. package/ResponsesImageNothingFound/package.json +1 -1
  264. package/ResponsesImageSuccess/package.json +1 -1
  265. package/ResponsesNothingFound/package.json +1 -1
  266. package/ResponsesSuccess/package.json +1 -1
  267. package/Select/package.json +1 -1
  268. package/Sidebar/package.json +1 -1
  269. package/Skeleton/package.json +1 -1
  270. package/SnackBar/package.json +1 -1
  271. package/Steps/package.json +1 -1
  272. package/Switch/package.json +1 -1
  273. package/SwitchGroup/package.json +1 -1
  274. package/Table/package.json +1 -1
  275. package/Tabs/package.json +1 -1
  276. package/Tag/package.json +1 -1
  277. package/TagBase/package.json +1 -1
  278. package/Text/package.json +1 -1
  279. package/TextField/package.json +1 -1
  280. package/Theme/package.json +1 -1
  281. package/ThemeToggler/package.json +1 -1
  282. package/Timer/package.json +1 -1
  283. package/Tooltip/package.json +1 -1
  284. package/User/package.json +1 -1
  285. package/UserSelect/package.json +1 -1
  286. package/UserSelectDeprecated/package.json +1 -1
  287. package/__internal__/cjs-src/components/Calendar/CalendarDay/CalendarDay.d.ts +1 -1
  288. package/__internal__/cjs-src/components/Combobox/Combobox.js +4 -4
  289. package/__internal__/cjs-src/components/Combobox/helpers.d.ts +2 -0
  290. package/__internal__/cjs-src/components/DatePickerCanary/DatePickerCanary.d.ts +3 -0
  291. package/__internal__/cjs-src/components/DatePickerCanary/DatePickerCanary.js +20 -0
  292. package/__internal__/cjs-src/components/DatePickerCanary/DatePickerDropdown/DatePickerDropdown.css +68 -0
  293. package/__internal__/cjs-src/components/DatePickerCanary/DatePickerDropdown/DatePickerDropdown.d.ts +26 -0
  294. package/__internal__/cjs-src/components/DatePickerCanary/DatePickerDropdown/DatePickerDropdown.js +22 -0
  295. package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDate/DatePickerFieldTypeDate.d.ts +36 -0
  296. package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDate/DatePickerFieldTypeDate.js +144 -0
  297. package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDate/helpers.d.ts +43 -0
  298. package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDate/helpers.js +16 -0
  299. package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDateRange/DatePickerFieldTypeDateRange.css +11 -0
  300. package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDateRange/DatePickerFieldTypeDateRange.d.ts +58 -0
  301. package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDateRange/DatePickerFieldTypeDateRange.js +96 -0
  302. package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDateRange/helpers.d.ts +31 -0
  303. package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDateRange/helpers.js +35 -0
  304. package/__internal__/cjs-src/components/DatePickerCanary/DatePickerTypeDate/DatePickerTypeDate.d.ts +2 -0
  305. package/__internal__/cjs-src/components/DatePickerCanary/DatePickerTypeDate/DatePickerTypeDate.js +60 -0
  306. package/__internal__/cjs-src/components/DatePickerCanary/DatePickerTypeDateRange/DatePickerTypeDateRange.d.ts +2 -0
  307. package/__internal__/cjs-src/components/DatePickerCanary/DatePickerTypeDateRange/DatePickerTypeDateRange.js +126 -0
  308. package/__internal__/cjs-src/components/DatePickerCanary/helpers.d.ts +185 -0
  309. package/__internal__/cjs-src/components/DatePickerCanary/helpers.js +28 -0
  310. package/__internal__/cjs-src/components/DateTimeCanary/DateTimeItem/DateTimeItem.d.ts +1 -1
  311. package/__internal__/cjs-src/components/DateTimeCanary/DateTimeTypeDate/DateTimeTypeDate.js +4 -4
  312. package/__internal__/cjs-src/components/DateTimeCanary/helpers/getDaysOfMonth.js +1 -1
  313. package/__internal__/cjs-src/components/DateTimeCanary/helpers/getMonthsOfYear.js +1 -1
  314. package/__internal__/cjs-src/components/DateTimeCanary/helpers/getYearsOfDecade.js +1 -1
  315. package/__internal__/cjs-src/components/DateTimeCanary/helpers/isDateInRange.d.ts +1 -1
  316. package/__internal__/cjs-src/components/DateTimeCanary/helpers/isDateInRange.js +7 -2
  317. package/__internal__/cjs-src/components/EventInterceptor/eventInterceptorMap.d.ts +41 -1
  318. package/__internal__/cjs-src/components/EventInterceptor/propsHandlers/useTextFieldEventsHandler.d.ts +41 -1
  319. package/__internal__/cjs-src/components/FieldLabel/FieldLabel.css +4 -0
  320. package/__internal__/cjs-src/components/FieldLabel/FieldLabel.d.ts +2 -0
  321. package/__internal__/cjs-src/components/FieldLabel/FieldLabel.js +5 -2
  322. package/__internal__/cjs-src/components/Header/Login/HeaderLogin.d.ts +1 -1
  323. package/__internal__/cjs-src/components/Modal/Modal.css +5 -0
  324. package/__internal__/cjs-src/components/Modal/Modal.js +1 -1
  325. package/__internal__/cjs-src/components/ProgressSpin/ProgressSpin.d.ts +1 -1
  326. package/__internal__/cjs-src/components/ProgressSpin/ProgressSpin.js +14 -4
  327. package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBar.css +25 -0
  328. package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBarCanary.d.ts +3 -0
  329. package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBarCanary.js +59 -0
  330. package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBarItem/ProgressStepBarItem.css +170 -0
  331. package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBarItem/ProgressStepBarItem.d.ts +3 -0
  332. package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBarItem/ProgressStepBarItem.js +69 -0
  333. package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBarLine/ProgressStepBarLine.css +54 -0
  334. package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBarLine/ProgressStepBarLine.d.ts +11 -0
  335. package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBarLine/ProgressStepBarLine.js +45 -0
  336. package/__internal__/cjs-src/components/ProgressStepBarCanary/helpers.d.ts +121 -0
  337. package/__internal__/cjs-src/components/ProgressStepBarCanary/helpers.js +51 -0
  338. package/__internal__/cjs-src/components/Select/Select.js +4 -4
  339. package/__internal__/cjs-src/components/Select/helpers.d.ts +2 -0
  340. package/__internal__/cjs-src/components/SelectComponents/SelectContainer/SelectContainer.d.ts +3 -1
  341. package/__internal__/cjs-src/components/SelectComponents/SelectContainer/SelectContainer.js +2 -2
  342. package/__internal__/cjs-src/components/SelectComponents/SelectDropdown/SelectDropdown.d.ts +1 -0
  343. package/__internal__/cjs-src/components/SelectComponents/SelectDropdown/SelectDropdown.js +2 -2
  344. package/__internal__/cjs-src/components/Table/Header/TableHeader.js +8 -1
  345. package/__internal__/cjs-src/components/Table/Table.d.ts +5 -1
  346. package/__internal__/cjs-src/components/Table/TextFilter/TableTextFilter.js +2 -1
  347. package/__internal__/cjs-src/components/Table/helpers.d.ts +2 -0
  348. package/__internal__/cjs-src/components/TextField/TextField.css +85 -0
  349. package/__internal__/cjs-src/components/TextField/TextField.js +45 -9
  350. package/__internal__/cjs-src/components/TextField/helpers.d.ts +11 -4
  351. package/__internal__/cjs-src/components/Timer/Timer.css +18 -1
  352. package/__internal__/cjs-src/components/Timer/Timer.d.ts +2 -2
  353. package/__internal__/cjs-src/components/Timer/Timer.js +2 -2
  354. package/__internal__/cjs-src/components/UserSelect/UserSelect.js +4 -4
  355. package/__internal__/cjs-src/components/UserSelect/helpers.d.ts +2 -0
  356. package/__internal__/cjs-src/hooks/useSelect/useSelect.d.ts +1 -0
  357. package/__internal__/cjs-src/hooks/useSelect/useSelect.js +13 -1
  358. package/__internal__/cjs-src/icons/Icon/Icon.css +4 -0
  359. package/__internal__/cjs-src/icons/Icon/Icon.d.ts +1 -1
  360. package/__internal__/cjs-src/utils/date/index.d.ts +5 -0
  361. package/__internal__/cjs-src/utils/date/index.js +9 -0
  362. package/__internal__/src/components/Calendar/CalendarDay/CalendarDay.d.ts +1 -1
  363. package/__internal__/src/components/Combobox/Combobox.js +4 -4
  364. package/__internal__/src/components/Combobox/helpers.d.ts +2 -0
  365. package/__internal__/src/components/DatePickerCanary/DatePickerCanary.d.ts +3 -0
  366. package/__internal__/src/components/DatePickerCanary/DatePickerCanary.js +17 -0
  367. package/__internal__/src/components/DatePickerCanary/DatePickerDropdown/DatePickerDropdown.css +68 -0
  368. package/__internal__/src/components/DatePickerCanary/DatePickerDropdown/DatePickerDropdown.d.ts +26 -0
  369. package/__internal__/src/components/DatePickerCanary/DatePickerDropdown/DatePickerDropdown.js +19 -0
  370. package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDate/DatePickerFieldTypeDate.d.ts +36 -0
  371. package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDate/DatePickerFieldTypeDate.js +141 -0
  372. package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDate/helpers.d.ts +43 -0
  373. package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDate/helpers.js +13 -0
  374. package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDateRange/DatePickerFieldTypeDateRange.css +11 -0
  375. package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDateRange/DatePickerFieldTypeDateRange.d.ts +58 -0
  376. package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDateRange/DatePickerFieldTypeDateRange.js +93 -0
  377. package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDateRange/helpers.d.ts +31 -0
  378. package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDateRange/helpers.js +32 -0
  379. package/__internal__/src/components/DatePickerCanary/DatePickerTypeDate/DatePickerTypeDate.d.ts +2 -0
  380. package/__internal__/src/components/DatePickerCanary/DatePickerTypeDate/DatePickerTypeDate.js +57 -0
  381. package/__internal__/src/components/DatePickerCanary/DatePickerTypeDateRange/DatePickerTypeDateRange.d.ts +2 -0
  382. package/__internal__/src/components/DatePickerCanary/DatePickerTypeDateRange/DatePickerTypeDateRange.js +123 -0
  383. package/__internal__/src/components/DatePickerCanary/helpers.d.ts +185 -0
  384. package/__internal__/src/components/DatePickerCanary/helpers.js +25 -0
  385. package/__internal__/src/components/DateTimeCanary/DateTimeItem/DateTimeItem.d.ts +1 -1
  386. package/__internal__/src/components/DateTimeCanary/DateTimeTypeDate/DateTimeTypeDate.js +4 -4
  387. package/__internal__/src/components/DateTimeCanary/helpers/getDaysOfMonth.js +1 -1
  388. package/__internal__/src/components/DateTimeCanary/helpers/getMonthsOfYear.js +1 -1
  389. package/__internal__/src/components/DateTimeCanary/helpers/getYearsOfDecade.js +1 -1
  390. package/__internal__/src/components/DateTimeCanary/helpers/isDateInRange.d.ts +1 -1
  391. package/__internal__/src/components/DateTimeCanary/helpers/isDateInRange.js +7 -2
  392. package/__internal__/src/components/EventInterceptor/eventInterceptorMap.d.ts +41 -1
  393. package/__internal__/src/components/EventInterceptor/propsHandlers/useTextFieldEventsHandler.d.ts +41 -1
  394. package/__internal__/src/components/FieldLabel/FieldLabel.css +4 -0
  395. package/__internal__/src/components/FieldLabel/FieldLabel.d.ts +2 -0
  396. package/__internal__/src/components/FieldLabel/FieldLabel.js +5 -2
  397. package/__internal__/src/components/Header/Login/HeaderLogin.d.ts +1 -1
  398. package/__internal__/src/components/Modal/Modal.css +5 -0
  399. package/__internal__/src/components/Modal/Modal.js +1 -1
  400. package/__internal__/src/components/ProgressSpin/ProgressSpin.d.ts +1 -1
  401. package/__internal__/src/components/ProgressSpin/ProgressSpin.js +14 -4
  402. package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBar.css +25 -0
  403. package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarCanary.d.ts +3 -0
  404. package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarCanary.js +56 -0
  405. package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarItem/ProgressStepBarItem.css +170 -0
  406. package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarItem/ProgressStepBarItem.d.ts +3 -0
  407. package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarItem/ProgressStepBarItem.js +66 -0
  408. package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarLine/ProgressStepBarLine.css +54 -0
  409. package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarLine/ProgressStepBarLine.d.ts +11 -0
  410. package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarLine/ProgressStepBarLine.js +42 -0
  411. package/__internal__/src/components/ProgressStepBarCanary/helpers.d.ts +121 -0
  412. package/__internal__/src/components/ProgressStepBarCanary/helpers.js +47 -0
  413. package/__internal__/src/components/Select/Select.js +4 -4
  414. package/__internal__/src/components/Select/helpers.d.ts +2 -0
  415. package/__internal__/src/components/SelectComponents/SelectContainer/SelectContainer.d.ts +3 -1
  416. package/__internal__/src/components/SelectComponents/SelectContainer/SelectContainer.js +2 -2
  417. package/__internal__/src/components/SelectComponents/SelectDropdown/SelectDropdown.d.ts +1 -0
  418. package/__internal__/src/components/SelectComponents/SelectDropdown/SelectDropdown.js +2 -2
  419. package/__internal__/src/components/Table/Header/TableHeader.js +8 -1
  420. package/__internal__/src/components/Table/Table.d.ts +5 -1
  421. package/__internal__/src/components/Table/TextFilter/TableTextFilter.js +2 -1
  422. package/__internal__/src/components/Table/helpers.d.ts +2 -0
  423. package/__internal__/src/components/TextField/TextField.css +85 -0
  424. package/__internal__/src/components/TextField/TextField.js +45 -9
  425. package/__internal__/src/components/TextField/helpers.d.ts +11 -4
  426. package/__internal__/src/components/Timer/Timer.css +18 -1
  427. package/__internal__/src/components/Timer/Timer.d.ts +2 -2
  428. package/__internal__/src/components/Timer/Timer.js +2 -2
  429. package/__internal__/src/components/UserSelect/UserSelect.js +4 -4
  430. package/__internal__/src/components/UserSelect/helpers.d.ts +2 -0
  431. package/__internal__/src/hooks/useSelect/useSelect.d.ts +1 -0
  432. package/__internal__/src/hooks/useSelect/useSelect.js +13 -1
  433. package/__internal__/src/icons/Icon/Icon.css +4 -0
  434. package/__internal__/src/icons/Icon/Icon.d.ts +1 -1
  435. package/__internal__/src/utils/date/index.d.ts +5 -0
  436. package/__internal__/src/utils/date/index.js +8 -0
  437. package/createIcon/package.json +1 -1
  438. package/createResponsesImage/package.json +1 -1
  439. package/package.json +4 -1
  440. package/useChoiceGroup/package.json +1 -1
  441. package/useChoiceGroupIndexed/package.json +1 -1
  442. package/useClickOutside/package.json +1 -1
  443. package/useComponentSize/package.json +1 -1
  444. package/useDebounce/package.json +1 -1
  445. package/useFlag/package.json +1 -1
  446. package/useForkRef/package.json +1 -1
  447. package/useGlobalKeys/package.json +1 -1
  448. package/useKeys/package.json +1 -1
  449. package/useMutableRef/package.json +1 -1
  450. package/usePrevious/package.json +1 -1
  451. package/useResizeObserved/package.json +1 -1
  452. package/useScrollPosition/package.json +1 -1
  453. package/useSelect/package.json +1 -1
  454. package/useThemeVars/package.json +1 -1
  455. package/useTimer/package.json +1 -1
  456. package/withTooltip/package.json +1 -1
@@ -19,7 +19,7 @@ function ComboboxRender(props, ref) {
19
19
  var controlInnerRef = useRef(null);
20
20
  var helperInputFakeElement = useRef(null);
21
21
  var controlRef = useRef(null);
22
- var _a = withDefaultGetters(props), placeholder = _a.placeholder, onBlur = _a.onBlur, onFocus = _a.onFocus, items = _a.items, onChange = _a.onChange, value = _a.value, disabled = _a.disabled, ariaLabel = _a.ariaLabel, id = _a.id, _b = _a.dropdownRef, dropdownRef = _b === void 0 ? defaultDropdownRef : _b, _c = _a.form, form = _c === void 0 ? defaultPropForm : _c, _d = _a.view, view = _d === void 0 ? defaultPropView : _d, _e = _a.size, size = _e === void 0 ? defaultPropSize : _e, dropdownClassName = _a.dropdownClassName, name = _a.name, _f = _a.groups, groups = _f === void 0 ? [] : _f, getItemLabel = _a.getItemLabel, getItemKey = _a.getItemKey, getItemGroupKey = _a.getItemGroupKey, getItemDisabled = _a.getItemDisabled, getGroupKey = _a.getGroupKey, getGroupLabel = _a.getGroupLabel, renderItem = _a.renderItem, renderValueProp = _a.renderValue, onCreate = _a.onCreate, inputRefProp = _a.inputRef, _g = _a.labelForNotFound, labelForNotFound = _g === void 0 ? defaultlabelForNotFound : _g, _h = _a.labelForCreate, labelForCreate = _h === void 0 ? defaultlabelForCreate : _h, searchFunction = _a.searchFunction, _j = _a.multiple, multiple = _j === void 0 ? false : _j, restProps = __rest(_a, ["placeholder", "onBlur", "onFocus", "items", "onChange", "value", "disabled", "ariaLabel", "id", "dropdownRef", "form", "view", "size", "dropdownClassName", "name", "groups", "getItemLabel", "getItemKey", "getItemGroupKey", "getItemDisabled", "getGroupKey", "getGroupLabel", "renderItem", "renderValue", "onCreate", "inputRef", "labelForNotFound", "labelForCreate", "searchFunction", "multiple"]);
22
+ var _a = withDefaultGetters(props), placeholder = _a.placeholder, onBlur = _a.onBlur, onFocus = _a.onFocus, items = _a.items, onChange = _a.onChange, value = _a.value, disabled = _a.disabled, ariaLabel = _a.ariaLabel, id = _a.id, required = _a.required, _b = _a.dropdownRef, dropdownRef = _b === void 0 ? defaultDropdownRef : _b, _c = _a.form, form = _c === void 0 ? defaultPropForm : _c, _d = _a.view, view = _d === void 0 ? defaultPropView : _d, _e = _a.size, size = _e === void 0 ? defaultPropSize : _e, dropdownClassName = _a.dropdownClassName, name = _a.name, _f = _a.groups, groups = _f === void 0 ? [] : _f, getItemLabel = _a.getItemLabel, getItemKey = _a.getItemKey, getItemGroupKey = _a.getItemGroupKey, getItemDisabled = _a.getItemDisabled, getGroupKey = _a.getGroupKey, getGroupLabel = _a.getGroupLabel, renderItem = _a.renderItem, renderValueProp = _a.renderValue, onCreate = _a.onCreate, inputRefProp = _a.inputRef, _g = _a.labelForNotFound, labelForNotFound = _g === void 0 ? defaultlabelForNotFound : _g, _h = _a.labelForCreate, labelForCreate = _h === void 0 ? defaultlabelForCreate : _h, searchFunction = _a.searchFunction, _j = _a.multiple, multiple = _j === void 0 ? false : _j, restProps = __rest(_a, ["placeholder", "onBlur", "onFocus", "items", "onChange", "value", "disabled", "ariaLabel", "id", "required", "dropdownRef", "form", "view", "size", "dropdownClassName", "name", "groups", "getItemLabel", "getItemKey", "getItemGroupKey", "getItemDisabled", "getGroupKey", "getGroupLabel", "renderItem", "renderValue", "onCreate", "inputRef", "labelForNotFound", "labelForCreate", "searchFunction", "multiple"]);
23
23
  var _k = useSelect({
24
24
  items: items,
25
25
  groups: groups,
@@ -38,7 +38,7 @@ function ComboboxRender(props, ref) {
38
38
  onFocus: onFocus,
39
39
  onCreate: onCreate,
40
40
  searchFunction: searchFunction
41
- }), getKeyProps = _k.getKeyProps, getOptionProps = _k.getOptionProps, isOpen = _k.isOpen, visibleItems = _k.visibleItems, isFocused = _k.isFocused, handleInputFocus = _k.handleInputFocus, handleInputBlur = _k.handleInputBlur, handleToggleDropdown = _k.handleToggleDropdown, inputRef = _k.inputRef, handleInputClick = _k.handleInputClick, handleInputChange = _k.handleInputChange, searchValue = _k.searchValue, clearValue = _k.clearValue, getHandleRemoveValue = _k.getHandleRemoveValue;
41
+ }), getKeyProps = _k.getKeyProps, getOptionProps = _k.getOptionProps, isOpen = _k.isOpen, visibleItems = _k.visibleItems, isFocused = _k.isFocused, handleInputFocus = _k.handleInputFocus, handleInputBlur = _k.handleInputBlur, handleToggleDropdown = _k.handleToggleDropdown, inputRef = _k.inputRef, handleInputClick = _k.handleInputClick, handleInputChange = _k.handleInputChange, searchValue = _k.searchValue, clearValue = _k.clearValue, getHandleRemoveValue = _k.getHandleRemoveValue, notFound = _k.notFound;
42
42
  var dropdownForm = getSelectDropdownForm(form);
43
43
  var renderItemDefault = function (props) {
44
44
  var item = props.item, active = props.active, hovered = props.hovered, onClick = props.onClick, onMouseEnter = props.onMouseEnter;
@@ -66,7 +66,7 @@ function ComboboxRender(props, ref) {
66
66
  (!value || (Array.isArray(value) && value.length === 0)) && !searchValue && placeholder && (React.createElement("span", { className: cnSelect('Placeholder'), title: "placeholder" }, placeholder)),
67
67
  React.createElement("input", __assign({}, getKeyProps(), { type: "text", name: name, onFocus: handleInputFocus, onBlur: handleInputBlur, "aria-label": ariaLabel, onChange: handleInputChange, ref: inputRefForRender, className: cnSelect('Input', { size: size, hide: !multiple && !!value, multiple: multiple }), value: searchValue, style: { width: width } }))));
68
68
  };
69
- return (React.createElement(SelectContainer, __assign({ focused: isFocused, disabled: disabled, size: size, view: view, form: form, multiple: multiple, ref: ref }, restProps),
69
+ return (React.createElement(SelectContainer, __assign({ focused: isFocused, disabled: disabled, size: size, view: view, required: required, form: form, multiple: multiple, ref: ref }, restProps),
70
70
  React.createElement("div", { className: cnSelect('Control', { hasInput: true }), ref: controlRef, "aria-expanded": isOpen, "aria-haspopup": "listbox", id: id },
71
71
  React.createElement("div", { className: cnSelect('ControlInner'), onClick: handleInputClick, role: "button", ref: controlInnerRef, "aria-hidden": "true" },
72
72
  React.createElement("div", { className: cnSelect('ControlValueContainer') }, multiple ? (React.createElement("div", { className: cnSelect('ControlValue') }, renderControlValue())) : (renderControlValue()))),
@@ -76,7 +76,7 @@ function ComboboxRender(props, ref) {
76
76
  React.createElement("span", { className: cnSelect('Delimiter') }),
77
77
  React.createElement("button", { type: "button", className: cnSelect('IndicatorsDropdown'), tabIndex: -1, onClick: handleToggleDropdown },
78
78
  React.createElement(IconSelect, { size: "xs", className: cnSelect('DropdownIndicatorIcon') })))),
79
- React.createElement(SelectDropdown, { isOpen: isOpen, size: size, controlRef: controlRef, getOptionProps: getOptionProps, dropdownRef: dropdownRef, form: dropdownForm, className: dropdownClassName, renderItem: renderItem || renderItemDefault, getGroupLabel: getGroupLabel, visibleItems: visibleItems, labelForNotFound: labelForNotFound, labelForCreate: labelForCreate }),
79
+ React.createElement(SelectDropdown, { isOpen: isOpen, size: size, controlRef: controlRef, getOptionProps: getOptionProps, dropdownRef: dropdownRef, form: dropdownForm, className: dropdownClassName, renderItem: renderItem || renderItemDefault, getGroupLabel: getGroupLabel, visibleItems: visibleItems, labelForNotFound: labelForNotFound, labelForCreate: labelForCreate, notFound: notFound }),
80
80
  React.createElement("div", { className: cnSelect('HelperInputFakeElement'), ref: helperInputFakeElement }, searchValue)));
81
81
  }
82
82
  export var Combobox = forwardRef(ComboboxRender);
@@ -52,6 +52,7 @@ export declare type ComboboxProps<ITEM = DefaultItem, GROUP = DefaultGroup, MULT
52
52
  }) => void;
53
53
  inputRef?: React.RefObject<HTMLInputElement>;
54
54
  labelForNotFound?: string;
55
+ required?: boolean;
55
56
  labelForCreate?: string;
56
57
  searchFunction?: PropSearchFunction<ITEM>;
57
58
  multiple?: MULTIPLE;
@@ -115,6 +116,7 @@ export declare function withDefaultGetters<ITEM = DefaultItem, GROUP = DefaultGr
115
116
  }) => void) | undefined;
116
117
  inputRef?: React.RefObject<HTMLInputElement> | undefined;
117
118
  labelForNotFound?: string | undefined;
119
+ required?: boolean | undefined;
118
120
  labelForCreate?: string | undefined;
119
121
  searchFunction?: PropSearchFunction<ITEM> | undefined;
120
122
  multiple?: MULTIPLE | undefined;
@@ -0,0 +1,3 @@
1
+ import { DatePickerComponent } from './helpers';
2
+ export declare const DatePicker: DatePickerComponent;
3
+ export * from './helpers';
@@ -0,0 +1,17 @@
1
+ import { __assign } from "tslib";
2
+ import React, { forwardRef } from 'react';
3
+ import { maxDateDefault, minDateDefault } from '../../utils/date';
4
+ import { DatePickerTypeDate } from './DatePickerTypeDate/DatePickerTypeDate';
5
+ import { DatePickerTypeDateRange } from './DatePickerTypeDateRange/DatePickerTypeDateRange';
6
+ import { datePickerPropTypeDefault, isDateRangeParams, isNotDateRangeParams, } from './helpers';
7
+ export var DatePicker = forwardRef(function (props, ref) {
8
+ var propsWidthDefault = __assign(__assign({}, props), { type: props.type || datePickerPropTypeDefault, minDate: props.minDate || minDateDefault, maxDate: props.maxDate || maxDateDefault });
9
+ if (isNotDateRangeParams(propsWidthDefault)) {
10
+ return React.createElement(DatePickerTypeDate, __assign({}, propsWidthDefault, { ref: ref }));
11
+ }
12
+ if (isDateRangeParams(propsWidthDefault)) {
13
+ return React.createElement(DatePickerTypeDateRange, __assign({}, propsWidthDefault, { ref: ref }));
14
+ }
15
+ return null;
16
+ });
17
+ export * from './helpers';
@@ -0,0 +1,68 @@
1
+ .DatePickerDropdown {
2
+ --transition-spase: var(--space-2xs);
3
+ padding: var(--space-l);
4
+ background: var(--color-bg-default);
5
+ opacity: 0;
6
+ -webkit-box-shadow: var(--shadow-layer);
7
+ box-shadow: var(--shadow-layer);
8
+ -webkit-transform: translateY(var(--transition-spase));
9
+ transform: translateY(var(--transition-spase));
10
+ }
11
+
12
+ .DatePickerDropdown_form_default {
13
+ border-radius: var(--control-radius);
14
+ }
15
+
16
+ .DatePickerDropdown_form_brick {
17
+ border-radius: 0;
18
+ }
19
+
20
+ .DatePickerDropdown_form_round {
21
+ border-radius: var(--space-l);
22
+ }
23
+
24
+ .DatePickerDropdown_animate_appear,
25
+ .DatePickerDropdown_animate_appearActive,
26
+ .DatePickerDropdown_animate_appearDone,
27
+ .DatePickerDropdown_animate_enter,
28
+ .DatePickerDropdown_animate_enterActive,
29
+ .DatePickerDropdown_animate_enterDone,
30
+ .DatePickerDropdown_animate_exit,
31
+ .DatePickerDropdown_animate_exitActive,
32
+ .DatePickerDropdown_animate_exitDone {
33
+ -webkit-transition: 0.2s ease;
34
+ transition: 0.2s ease;
35
+ -webkit-transition-property: opacity, -webkit-transform;
36
+ transition-property: opacity, -webkit-transform;
37
+ transition-property: opacity, transform;
38
+ transition-property: opacity, transform, -webkit-transform;
39
+ }
40
+
41
+ .DatePickerDropdown_animate_appear,
42
+ .DatePickerDropdown_animate_enter {
43
+ opacity: 0;
44
+ -webkit-transform: translateY(var(--transition-spase));
45
+ transform: translateY(var(--transition-spase));
46
+ }
47
+
48
+ .DatePickerDropdown_animate_enterActive,
49
+ .DatePickerDropdown_animate_appearActive,
50
+ .DatePickerDropdown_animate_appearDone,
51
+ .DatePickerDropdown_animate_enterDone {
52
+ opacity: 1;
53
+ -webkit-transform: translateY(0);
54
+ transform: translateY(0);
55
+ }
56
+
57
+ .DatePickerDropdown_animate_exit {
58
+ opacity: 1;
59
+ -webkit-transform: translateY(0);
60
+ transform: translateY(0);
61
+ }
62
+
63
+ .DatePickerDropdown_animate_exitActive,
64
+ .DatePickerDropdown_animate_exitDone {
65
+ opacity: 0;
66
+ -webkit-transform: translateY(var(--transition-spase));
67
+ transform: translateY(var(--transition-spase));
68
+ }
@@ -0,0 +1,26 @@
1
+ import './DatePickerDropdown.css';
2
+ import React from 'react';
3
+ import { DateRange } from '../../../utils/types/Date';
4
+ import { PropsWithHTMLAttributesAndRef } from '../../../utils/types/PropsWithHTMLAttributes';
5
+ import { DateTimePropOnChange, DateTimePropType } from '../../DateTimeCanary/DateTimeCanary';
6
+ import { DatePickerPropDateTimeView, DatePickerPropDropdownForm } from '../helpers';
7
+ export declare type DatePickerDropdownPropOnChange = DateTimePropOnChange;
8
+ export declare type DatePickerDropdownProps = PropsWithHTMLAttributesAndRef<{
9
+ anchorRef: React.RefObject<HTMLElement>;
10
+ currentVisibleDate?: Date;
11
+ type?: DateTimePropType;
12
+ value?: Date | DateRange;
13
+ onChange?: DatePickerDropdownPropOnChange;
14
+ minDate?: Date;
15
+ maxDate?: Date;
16
+ events?: Date[];
17
+ view?: DatePickerPropDateTimeView;
18
+ locale?: Locale;
19
+ children?: never;
20
+ form?: DatePickerPropDropdownForm;
21
+ isOpen?: boolean;
22
+ onChangeCurrentVisibleDate?: (date: Date) => void;
23
+ }, HTMLDivElement>;
24
+ declare type DatePickerDropdownComponent = (props: DatePickerDropdownProps) => React.ReactElement | null;
25
+ export declare const DatePickerDropdown: DatePickerDropdownComponent;
26
+ export {};
@@ -0,0 +1,19 @@
1
+ import { __assign, __rest } from "tslib";
2
+ import './DatePickerDropdown.css';
3
+ import React, { forwardRef, useRef } from 'react';
4
+ import { CSSTransition } from 'react-transition-group';
5
+ import { useForkRef } from '../../../hooks/useForkRef/useForkRef';
6
+ import { cn } from '../../../utils/bem';
7
+ import { cnForCssTransition } from '../../../utils/cnForCssTransition';
8
+ import { DateTime, } from '../../DateTimeCanary/DateTimeCanary';
9
+ import { Popover } from '../../Popover/Popover';
10
+ import { datePickerPropDropdownFormDefault, } from '../helpers';
11
+ var cnDatePickerDropdown = cn('DatePickerDropdown');
12
+ var cnDatePickerDropdownCssTransition = cnForCssTransition(cnDatePickerDropdown);
13
+ export var DatePickerDropdown = forwardRef(function (props, ref) {
14
+ var _a = props.form, form = _a === void 0 ? datePickerPropDropdownFormDefault : _a, anchorRef = props.anchorRef, isOpen = props.isOpen, value = props.value, className = props.className, onChange = props.onChange, otherProps = __rest(props, ["form", "anchorRef", "isOpen", "value", "className", "onChange"]);
15
+ var rootRef = useRef(null);
16
+ return (React.createElement(CSSTransition, { "in": isOpen, unmountOnExit: true, appear: true, classNames: cnDatePickerDropdownCssTransition, timeout: 200, nodeRef: rootRef },
17
+ React.createElement(Popover, { ref: useForkRef([ref, rootRef]), anchorRef: anchorRef, className: cnDatePickerDropdown({ form: form }, [className]), direction: "downStartLeft", spareDirection: "downStartLeft", possibleDirections: ['downStartLeft', 'upStartLeft', 'downStartRight', 'upStartRight'] },
18
+ React.createElement(DateTime, __assign({}, otherProps, { onChange: onChange, type: "date", value: value || undefined })))));
19
+ });
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+ export declare const DatePickerFieldTypeDate: React.ForwardRefExoticComponent<{
3
+ className?: string | undefined;
4
+ value?: Date | null | undefined;
5
+ onChange?: ((props: {
6
+ e: Event;
7
+ value: Date | null;
8
+ }) => void) | undefined;
9
+ onError?: import("../helpers").DatePickerPropOnError | undefined;
10
+ id?: string | undefined;
11
+ name?: string | undefined;
12
+ disabled?: boolean | undefined;
13
+ size?: "xs" | "s" | "m" | "l" | undefined;
14
+ view?: "default" | "clear" | undefined;
15
+ form?: "default" | "round" | "brick" | "clearRound" | "roundClear" | "clearDefault" | "defaultClear" | "defaultBrick" | "brickDefault" | "brickClear" | "clearBrick" | "clearClear" | "brickRound" | "roundBrick" | undefined;
16
+ status?: "alert" | "success" | "warning" | undefined;
17
+ width?: "default" | "full" | undefined;
18
+ onFocus?: ((event: React.FocusEvent<HTMLElement>) => void) | undefined;
19
+ onBlur?: ((event: React.FocusEvent<HTMLElement>) => void) | undefined;
20
+ autoFocus?: boolean | undefined;
21
+ placeholder?: string | undefined;
22
+ leftSide?: string | React.FC<import("../../../utils/types/PropsWithHTMLAttributes").PropsWithHTMLAttributes<import("../../../icons/Icon/Icon").Props, HTMLSpanElement>> | undefined;
23
+ rightSide?: string | React.FC<import("../../../utils/types/PropsWithHTMLAttributes").PropsWithHTMLAttributes<import("../../../icons/Icon/Icon").Props, HTMLSpanElement>> | undefined;
24
+ readOnly?: boolean | undefined;
25
+ required?: boolean | undefined;
26
+ tabIndex?: number | undefined;
27
+ inputRef?: ((instance: HTMLInputElement | HTMLTextAreaElement | null) => void) | React.RefObject<HTMLInputElement | HTMLTextAreaElement> | null | undefined;
28
+ ariaLabel?: string | undefined;
29
+ iconSize?: "xs" | "s" | "m" | undefined;
30
+ children?: undefined;
31
+ format?: string | undefined;
32
+ separator?: string | undefined;
33
+ minDate?: Date | undefined;
34
+ maxDate?: Date | undefined;
35
+ focused?: boolean | undefined;
36
+ } & Pick<React.HTMLAttributes<HTMLDivElement>, "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "slot" | "spellCheck" | "style" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,141 @@
1
+ import { __assign, __read, __rest } from "tslib";
2
+ import React, { useCallback, useEffect, useRef, useState } from 'react';
3
+ import { format, isValid, isWithinInterval, parse } from 'date-fns';
4
+ import IMask from 'imask';
5
+ import { useForkRef } from '../../../hooks/useForkRef/useForkRef';
6
+ import { useMutableRef } from '../../../hooks/useMutableRef/useMutableRef';
7
+ import { leapYear, maxDateDefault, minDateDefault } from '../../../utils/date';
8
+ import { TextField } from '../../TextField/TextField';
9
+ import { datePickerErrorTypes, datePickerPropFormatDefault, datePickerPropPlaceholderDefault, datePickerPropSeparatorDefault, } from '../helpers';
10
+ import { getPartsDate } from './helpers';
11
+ export var DatePickerFieldTypeDate = React.forwardRef(function (props, ref) {
12
+ var _a = props.format, formatProp = _a === void 0 ? datePickerPropFormatDefault : _a, _b = props.separator, separator = _b === void 0 ? datePickerPropSeparatorDefault : _b, _c = props.placeholder, placeholder = _c === void 0 ? datePickerPropPlaceholderDefault : _c, onChange = props.onChange, onError = props.onError, _d = props.minDate, minDate = _d === void 0 ? minDateDefault : _d, _e = props.maxDate, maxDate = _e === void 0 ? maxDateDefault : _e, value = props.value, inputRefProp = props.inputRef, otherProps = __rest(props, ["format", "separator", "placeholder", "onChange", "onError", "minDate", "maxDate", "value", "inputRef"]);
13
+ var inputRef = useRef(null);
14
+ var imaskRef = useRef(null);
15
+ var onChangeRef = useMutableRef(onChange);
16
+ var _f = __read(useState(value && isValid(value) ? format(value, formatProp) : null), 2), stringValue = _f[0], setStringValue = _f[1];
17
+ var handleChange = useCallback(function (e, stringValue) {
18
+ setStringValue(stringValue);
19
+ var onChange = onChangeRef.current;
20
+ if (onChange) {
21
+ if (!stringValue) {
22
+ onChange({ e: e, value: null });
23
+ return;
24
+ }
25
+ var _a = __read(getPartsDate(stringValue, formatProp, separator), 3), dd = _a[0], MM = _a[1], yyyy = _a[2];
26
+ if (dd && MM && yyyy) {
27
+ var date = parse("" + dd + datePickerPropSeparatorDefault + MM + datePickerPropSeparatorDefault + yyyy, datePickerPropFormatDefault, new Date());
28
+ if (!isWithinInterval(date, { start: minDate, end: maxDate })) {
29
+ onError &&
30
+ onError({
31
+ type: datePickerErrorTypes[0],
32
+ stringValue: stringValue,
33
+ dd: dd,
34
+ MM: MM,
35
+ yyyy: yyyy,
36
+ date: date
37
+ });
38
+ onChange({ e: e, value: null });
39
+ return;
40
+ }
41
+ onChange({ e: e, value: date });
42
+ }
43
+ else {
44
+ onChange({ e: e, value: null });
45
+ }
46
+ }
47
+ }, [minDate === null || minDate === void 0 ? void 0 : minDate.getTime(), maxDate === null || maxDate === void 0 ? void 0 : maxDate.getTime(), formatProp, separator]);
48
+ // при изменении value, нужно обновить stringValue
49
+ useEffect(function () {
50
+ if (value && isValid(value)) {
51
+ setStringValue(format(value, formatProp));
52
+ }
53
+ else if ((stringValue === null || stringValue === void 0 ? void 0 : stringValue.length) === formatProp.length) {
54
+ // если количество введенных символов меньше чем в формате маски
55
+ // то не нужно мешать вводу с клавиатуры
56
+ // если дата была введена полностью и value пришел null,
57
+ // то можно считать что поле нуждается в очистке
58
+ setStringValue('');
59
+ }
60
+ }, [value === null || value === void 0 ? void 0 : value.getTime()]);
61
+ // задаем маску и сохраняем обьект маски в ref
62
+ // обнавляем при смене формата
63
+ useEffect(function () {
64
+ if (inputRef.current) {
65
+ imaskRef.current = IMask(inputRef.current, {
66
+ mask: Date,
67
+ pattern: formatProp,
68
+ blocks: {
69
+ yyyy: {
70
+ mask: IMask.MaskedRange,
71
+ from: 1,
72
+ to: 9999
73
+ },
74
+ MM: {
75
+ mask: IMask.MaskedRange,
76
+ from: 1,
77
+ to: 12
78
+ },
79
+ dd: {
80
+ mask: IMask.MaskedRange,
81
+ from: 1,
82
+ to: 31
83
+ }
84
+ },
85
+ lazy: true,
86
+ autofix: true,
87
+ format: function (date) { return format(date, formatProp); },
88
+ parse: function (string) { return parse(string, formatProp, new Date()); },
89
+ validate: function (string) {
90
+ var _a = __read(getPartsDate(string, formatProp, separator), 3), dd = _a[0], MM = _a[1], yyyy = _a[2];
91
+ if (dd &&
92
+ MM &&
93
+ !isValid(parse("" + dd + datePickerPropSeparatorDefault + MM + datePickerPropSeparatorDefault + leapYear, datePickerPropFormatDefault, new Date()))) {
94
+ onError &&
95
+ onError({
96
+ type: datePickerErrorTypes[1],
97
+ stringValue: string,
98
+ dd: dd,
99
+ MM: MM,
100
+ yyyy: yyyy
101
+ });
102
+ return false;
103
+ }
104
+ if (dd &&
105
+ MM &&
106
+ yyyy &&
107
+ !isValid(parse("" + dd + datePickerPropSeparatorDefault + MM + datePickerPropSeparatorDefault + yyyy, datePickerPropFormatDefault, new Date()))) {
108
+ onError &&
109
+ onError({
110
+ type: datePickerErrorTypes[1],
111
+ stringValue: string,
112
+ dd: dd,
113
+ MM: MM,
114
+ yyyy: yyyy
115
+ });
116
+ return false;
117
+ }
118
+ return true;
119
+ }
120
+ });
121
+ }
122
+ }, [formatProp, separator]);
123
+ // задаем нативный oninput, так как с маской по другому не будет работать
124
+ // обнавляем oninput при смене handleChange
125
+ useEffect(function () {
126
+ if (inputRef.current) {
127
+ inputRef.current.oninput = function (e) {
128
+ var _a;
129
+ handleChange(e, ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.value) || '');
130
+ };
131
+ }
132
+ }, [handleChange]);
133
+ // Нужно для синхранизации value c Imask,
134
+ // так как value мы можем задать через пропс без самого ввода,
135
+ // и Imask требует ручной синхронихации в этом случае
136
+ useEffect(function () {
137
+ var _a;
138
+ (_a = imaskRef.current) === null || _a === void 0 ? void 0 : _a.updateValue();
139
+ }, [stringValue]);
140
+ return (React.createElement(TextField, __assign({}, otherProps, { type: "text", ref: ref, inputRef: useForkRef([inputRef, inputRefProp]), value: stringValue, placeholder: placeholder })));
141
+ });
@@ -0,0 +1,43 @@
1
+ /// <reference types="react" />
2
+ import { IconProps, IconPropSize } from '../../../icons/Icon/Icon';
3
+ import { PropsWithHTMLAttributes } from '../../../utils/types/PropsWithHTMLAttributes';
4
+ import { TextFieldPropForm, TextFieldPropSize, TextFieldPropStatus, TextFieldPropView, TextFieldPropWidth } from '../../TextField/TextField';
5
+ import { DatePickerPropOnError } from '../helpers';
6
+ declare type DatePickerFieldTypeDatePropOnChange = (props: {
7
+ e: Event;
8
+ value: Date | null;
9
+ }) => void;
10
+ export declare type DatePickerFieldTypeDateProps = PropsWithHTMLAttributes<{
11
+ className?: string;
12
+ value?: Date | null;
13
+ onChange?: DatePickerFieldTypeDatePropOnChange;
14
+ onError?: DatePickerPropOnError;
15
+ id?: string;
16
+ name?: string;
17
+ disabled?: boolean;
18
+ size?: TextFieldPropSize;
19
+ view?: TextFieldPropView;
20
+ form?: TextFieldPropForm;
21
+ status?: TextFieldPropStatus;
22
+ width?: TextFieldPropWidth;
23
+ onFocus?: React.FocusEventHandler<HTMLElement>;
24
+ onBlur?: React.FocusEventHandler<HTMLElement>;
25
+ autoFocus?: boolean;
26
+ placeholder?: string;
27
+ leftSide?: string | React.FC<IconProps>;
28
+ rightSide?: string | React.FC<IconProps>;
29
+ readOnly?: boolean;
30
+ required?: boolean;
31
+ tabIndex?: number;
32
+ inputRef?: React.Ref<HTMLTextAreaElement | HTMLInputElement>;
33
+ ariaLabel?: string;
34
+ iconSize?: IconPropSize;
35
+ children?: never;
36
+ format?: string;
37
+ separator?: string;
38
+ minDate?: Date;
39
+ maxDate?: Date;
40
+ focused?: boolean;
41
+ }, HTMLDivElement>;
42
+ export declare const getPartsDate: (value: string, format: string, separator: string, markers?: string[]) => (string | undefined)[];
43
+ export {};
@@ -0,0 +1,13 @@
1
+ var getPartDate = function (formatArray, stringArray, marker) {
2
+ var index = formatArray.indexOf(marker);
3
+ if (index >= 0 && stringArray[index] && stringArray[index].length === marker.length) {
4
+ return stringArray[index];
5
+ }
6
+ return undefined;
7
+ };
8
+ export var getPartsDate = function (value, format, separator, markers) {
9
+ if (markers === void 0) { markers = ['dd', 'MM', 'yyyy']; }
10
+ var formatArray = format.split(separator);
11
+ var valueArray = value.split(separator);
12
+ return markers.map(function (marker) { return getPartDate(formatArray, valueArray, marker); });
13
+ };
@@ -0,0 +1,11 @@
1
+ .DatePickerFieldTypeDateRange {
2
+ display: -webkit-box;
3
+ display: -ms-flexbox;
4
+ display: flex;
5
+ }
6
+
7
+ .DatePickerFieldTypeDateRange-Field {
8
+ -webkit-box-flex: 1;
9
+ -ms-flex: 1;
10
+ flex: 1;
11
+ }
@@ -0,0 +1,58 @@
1
+ import './DatePickerFieldTypeDateRange.css';
2
+ import React from 'react';
3
+ export declare const DatePickerFieldTypeDateRange: React.ForwardRefExoticComponent<Pick<import("../../../utils/types/PropsWithHTMLAttributes").PropsWithHTMLAttributes<{
4
+ className?: string | undefined;
5
+ value?: Date | null | undefined;
6
+ onChange?: ((props: {
7
+ e: Event;
8
+ value: Date | null;
9
+ }) => void) | undefined;
10
+ onError?: import("../helpers").DatePickerPropOnError | undefined;
11
+ id?: string | undefined;
12
+ name?: string | undefined;
13
+ disabled?: boolean | undefined;
14
+ size?: "xs" | "s" | "m" | "l" | undefined;
15
+ view?: "default" | "clear" | undefined;
16
+ form?: "default" | "round" | "brick" | "clearRound" | "roundClear" | "clearDefault" | "defaultClear" | "defaultBrick" | "brickDefault" | "brickClear" | "clearBrick" | "clearClear" | "brickRound" | "roundBrick" | undefined;
17
+ status?: "alert" | "success" | "warning" | undefined;
18
+ width?: "default" | "full" | undefined;
19
+ onFocus?: ((event: React.FocusEvent<HTMLElement>) => void) | undefined;
20
+ onBlur?: ((event: React.FocusEvent<HTMLElement>) => void) | undefined;
21
+ autoFocus?: boolean | undefined;
22
+ placeholder?: string | undefined;
23
+ leftSide?: string | React.FC<import("../../../utils/types/PropsWithHTMLAttributes").PropsWithHTMLAttributes<import("../../../icons/Icon/Icon").Props, HTMLSpanElement>> | undefined;
24
+ rightSide?: string | React.FC<import("../../../utils/types/PropsWithHTMLAttributes").PropsWithHTMLAttributes<import("../../../icons/Icon/Icon").Props, HTMLSpanElement>> | undefined;
25
+ readOnly?: boolean | undefined;
26
+ required?: boolean | undefined;
27
+ tabIndex?: number | undefined;
28
+ inputRef?: ((instance: HTMLInputElement | HTMLTextAreaElement | null) => void) | React.RefObject<HTMLInputElement | HTMLTextAreaElement> | null | undefined;
29
+ ariaLabel?: string | undefined;
30
+ iconSize?: "xs" | "s" | "m" | undefined;
31
+ children?: undefined;
32
+ format?: string | undefined;
33
+ separator?: string | undefined;
34
+ minDate?: Date | undefined;
35
+ maxDate?: Date | undefined;
36
+ focused?: boolean | undefined;
37
+ }, HTMLDivElement>, "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "disabled" | "view" | "size" | "form" | "name" | "width" | "format" | "autoFocus" | "readOnly" | "required" | "status" | "focused" | "ariaLabel" | "iconSize" | "separator" | "minDate" | "maxDate"> & {
38
+ onChange?: ((props: {
39
+ e: Event;
40
+ value: import("../../../utils/types/Date").DateRange | null;
41
+ }) => void) | undefined;
42
+ value?: import("../../../utils/types/Date").DateRange | null | undefined;
43
+ startFieldInputRef?: ((instance: HTMLInputElement | null) => void) | React.RefObject<HTMLInputElement> | null | undefined;
44
+ endFieldInputRef?: ((instance: HTMLInputElement | null) => void) | React.RefObject<HTMLInputElement> | null | undefined;
45
+ startFieldLeftSide?: string | React.FC<import("../../../utils/types/PropsWithHTMLAttributes").PropsWithHTMLAttributes<import("../../../icons/Icon/Icon").Props, HTMLSpanElement>> | undefined;
46
+ startFieldRightSide?: string | React.FC<import("../../../utils/types/PropsWithHTMLAttributes").PropsWithHTMLAttributes<import("../../../icons/Icon/Icon").Props, HTMLSpanElement>> | undefined;
47
+ endFieldLeftSide?: string | React.FC<import("../../../utils/types/PropsWithHTMLAttributes").PropsWithHTMLAttributes<import("../../../icons/Icon/Icon").Props, HTMLSpanElement>> | undefined;
48
+ endFieldRightSide?: string | React.FC<import("../../../utils/types/PropsWithHTMLAttributes").PropsWithHTMLAttributes<import("../../../icons/Icon/Icon").Props, HTMLSpanElement>> | undefined;
49
+ startFieldRef?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
50
+ endFieldRef?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
51
+ startFieldOnFocus?: ((event: React.FocusEvent<HTMLElement>) => void) | undefined;
52
+ endFieldOnFocus?: ((event: React.FocusEvent<HTMLElement>) => void) | undefined;
53
+ startFieldOnBlur?: ((event: React.FocusEvent<HTMLElement>) => void) | undefined;
54
+ endFieldOnBlur?: ((event: React.FocusEvent<HTMLElement>) => void) | undefined;
55
+ startFocused?: boolean | undefined;
56
+ endFocused?: boolean | undefined;
57
+ id?: string | undefined;
58
+ } & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,93 @@
1
+ import { __assign, __read, __rest } from "tslib";
2
+ import './DatePickerFieldTypeDateRange.css';
3
+ import React, { forwardRef, useEffect, useRef, useState } from 'react';
4
+ import isBefore from 'date-fns/isBefore';
5
+ import isEqual from 'date-fns/isEqual';
6
+ import { cn } from '../../../utils/bem';
7
+ import { getSizeByMap } from '../../../utils/getSizeByMap';
8
+ import { DatePickerFieldTypeDate } from '../DatePickerFieldTypeDate/DatePickerFieldTypeDate';
9
+ import { datePickerErrorTypes } from '../helpers';
10
+ import { mapFormForEnd, mapFormForStart } from './helpers';
11
+ var cnDatePickerFieldTypeDateRange = cn('DatePickerFieldTypeDateRange');
12
+ export var DatePickerFieldTypeDateRange = forwardRef(function (props, ref) {
13
+ var _a, _b;
14
+ var className = props.className, _c = props.form, form = _c === void 0 ? 'default' : _c, startFieldInputRef = props.startFieldInputRef, startFieldLeftSide = props.startFieldLeftSide, startFieldRightSide = props.startFieldRightSide, endFieldInputRef = props.endFieldInputRef, endFieldLeftSide = props.endFieldLeftSide, endFieldRightSide = props.endFieldRightSide, _d = props.value, value = _d === void 0 ? [] : _d, onChange = props.onChange, onError = props.onError, name = props.name, disabled = props.disabled, size = props.size, view = props.view, status = props.status, autoFocus = props.autoFocus, placeholder = props.placeholder, readOnly = props.readOnly, required = props.required, tabIndex = props.tabIndex, ariaLabel = props.ariaLabel, iconSize = props.iconSize, format = props.format, separator = props.separator, minDate = props.minDate, maxDate = props.maxDate, startFieldOnBlur = props.startFieldOnBlur, startFieldOnFocus = props.startFieldOnFocus, endFieldOnBlur = props.endFieldOnBlur, endFieldOnFocus = props.endFieldOnFocus, startFieldRef = props.startFieldRef, endFieldRef = props.endFieldRef, startFocused = props.startFocused, endFocused = props.endFocused, otherProps = __rest(props, ["className", "form", "startFieldInputRef", "startFieldLeftSide", "startFieldRightSide", "endFieldInputRef", "endFieldLeftSide", "endFieldRightSide", "value", "onChange", "onError", "name", "disabled", "size", "view", "status", "autoFocus", "placeholder", "readOnly", "required", "tabIndex", "ariaLabel", "iconSize", "format", "separator", "minDate", "maxDate", "startFieldOnBlur", "startFieldOnFocus", "endFieldOnBlur", "endFieldOnFocus", "startFieldRef", "endFieldRef", "startFocused", "endFocused"]);
15
+ var commonProps = {
16
+ className: cnDatePickerFieldTypeDateRange('Field'),
17
+ disabled: disabled,
18
+ name: name,
19
+ onError: onError,
20
+ size: size,
21
+ view: view,
22
+ status: status,
23
+ autoFocus: autoFocus,
24
+ placeholder: placeholder,
25
+ readOnly: readOnly,
26
+ required: required,
27
+ tabIndex: tabIndex,
28
+ ariaLabel: ariaLabel,
29
+ iconSize: iconSize,
30
+ format: format,
31
+ separator: separator,
32
+ minDate: minDate,
33
+ maxDate: maxDate
34
+ };
35
+ var _e = __read(useState(value === null || value === void 0 ? void 0 : value[0]), 2), startDate = _e[0], setStartDate = _e[1];
36
+ var _f = __read(useState(value === null || value === void 0 ? void 0 : value[1]), 2), endDate = _f[0], setEndDate = _f[1];
37
+ var eventRef = useRef();
38
+ var handleChange = function (e, ownStartDate, ownEndDate) {
39
+ var start = ownStartDate || startDate;
40
+ var end = ownEndDate || endDate;
41
+ if (!onChange) {
42
+ return;
43
+ }
44
+ if (start && end) {
45
+ if (isBefore(start, end) || isEqual(start, end)) {
46
+ onChange({ e: e, value: [start, end] });
47
+ return;
48
+ }
49
+ onChange({ e: e, value: [start, undefined] });
50
+ onError && onError({ type: datePickerErrorTypes[2], date: [start, end] });
51
+ return;
52
+ }
53
+ if (start) {
54
+ onChange({ e: e, value: [start, undefined] });
55
+ return;
56
+ }
57
+ if (end) {
58
+ onChange({ e: e, value: [undefined, end] });
59
+ return;
60
+ }
61
+ onChange({ e: e, value: null });
62
+ };
63
+ var handleStartDateChange = function (props) {
64
+ var _a;
65
+ if (((_a = props.value) === null || _a === void 0 ? void 0 : _a.getTime()) === (startDate === null || startDate === void 0 ? void 0 : startDate.getTime())) {
66
+ return;
67
+ }
68
+ eventRef.current = props.e;
69
+ setStartDate(props.value);
70
+ };
71
+ var handleEndDateChange = function (props) {
72
+ var _a;
73
+ if (((_a = props.value) === null || _a === void 0 ? void 0 : _a.getTime()) === (endDate === null || endDate === void 0 ? void 0 : endDate.getTime())) {
74
+ return;
75
+ }
76
+ eventRef.current = props.e;
77
+ setEndDate(props.value);
78
+ };
79
+ useEffect(function () {
80
+ if (eventRef.current) {
81
+ handleChange(eventRef.current, startDate, endDate);
82
+ }
83
+ }, [eventRef.current]);
84
+ useEffect(function () {
85
+ setStartDate(value === null || value === void 0 ? void 0 : value[0]);
86
+ }, [(_a = value === null || value === void 0 ? void 0 : value[0]) === null || _a === void 0 ? void 0 : _a.getTime()]);
87
+ useEffect(function () {
88
+ setEndDate(value === null || value === void 0 ? void 0 : value[1]);
89
+ }, [(_b = value === null || value === void 0 ? void 0 : value[1]) === null || _b === void 0 ? void 0 : _b.getTime()]);
90
+ return (React.createElement("div", __assign({}, otherProps, { className: cnDatePickerFieldTypeDateRange(null, [className]), ref: ref }),
91
+ React.createElement(DatePickerFieldTypeDate, __assign({}, commonProps, { inputRef: startFieldInputRef, ref: startFieldRef, leftSide: startFieldLeftSide, rightSide: startFieldRightSide, form: getSizeByMap(mapFormForStart, form), value: startDate, onChange: handleStartDateChange, onFocus: startFieldOnFocus, onBlur: startFieldOnBlur, focused: startFocused })),
92
+ React.createElement(DatePickerFieldTypeDate, __assign({}, commonProps, { inputRef: endFieldInputRef, ref: endFieldRef, leftSide: endFieldLeftSide, rightSide: endFieldRightSide, form: getSizeByMap(mapFormForEnd, form), value: endDate, onChange: handleEndDateChange, onFocus: endFieldOnFocus, onBlur: endFieldOnBlur, focused: endFocused }))));
93
+ });