@true-engineering/true-react-common-ui-kit 1.12.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (266) hide show
  1. package/LICENSE +201 -201
  2. package/dist/components/Button/Button.d.ts +2 -2
  3. package/dist/components/DateInput/DateInput.d.ts +8 -8
  4. package/dist/components/DateInput/DateInput.styles.d.ts +2 -2
  5. package/dist/components/DateInput/constants.d.ts +2 -0
  6. package/dist/components/DateInput/index.d.ts +1 -0
  7. package/dist/components/DatePicker/DatePicker.d.ts +16 -24
  8. package/dist/components/DatePicker/DatePicker.styles.d.ts +12 -24
  9. package/dist/components/DatePicker/DatePickerHeader/DatePickerHeader.d.ts +3 -9
  10. package/dist/components/DatePicker/DatePickerHeader/index.d.ts +1 -0
  11. package/dist/components/DatePicker/constants.d.ts +1 -0
  12. package/dist/components/DatePicker/helpers.d.ts +3 -0
  13. package/dist/components/DatePicker/index.d.ts +1 -2
  14. package/dist/components/DatePicker/types.d.ts +4 -0
  15. package/dist/components/FiltersPane/FilterWithDates/FilterWithDates.d.ts +1 -1
  16. package/dist/components/Flag/augment.d.ts +1 -1
  17. package/dist/components/Icon/complexIcons/augment.d.ts +1 -1
  18. package/dist/helpers/utils.d.ts +2 -1
  19. package/dist/style.css +125 -50
  20. package/dist/true-react-common-ui-kit.js +392 -427
  21. package/dist/true-react-common-ui-kit.js.map +1 -1
  22. package/dist/true-react-common-ui-kit.umd.cjs +392 -427
  23. package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
  24. package/dist/types.d.ts +1 -1
  25. package/dist/vite-env.d.ts +1 -1
  26. package/package.json +91 -91
  27. package/src/components/AccountInfo/AccountInfo.stories.tsx +35 -35
  28. package/src/components/AccountInfo/AccountInfo.styles.ts +55 -55
  29. package/src/components/AccountInfo/AccountInfo.tsx +106 -106
  30. package/src/components/AccountInfo/index.ts +2 -2
  31. package/src/components/AddButton/AddButton.stories.tsx +21 -21
  32. package/src/components/AddButton/AddButton.styles.ts +34 -34
  33. package/src/components/AddButton/AddButton.tsx +49 -49
  34. package/src/components/AddButton/index.ts +2 -2
  35. package/src/components/Button/Button.stories.tsx +61 -61
  36. package/src/components/Button/Button.styles.ts +196 -196
  37. package/src/components/Button/Button.tsx +207 -207
  38. package/src/components/Button/index.ts +2 -2
  39. package/src/components/Checkbox/Checkbox.stories.tsx +35 -35
  40. package/src/components/Checkbox/Checkbox.styles.ts +62 -62
  41. package/src/components/Checkbox/Checkbox.tsx +106 -106
  42. package/src/components/Checkbox/index.ts +2 -2
  43. package/src/components/CloseButton/CloseButton.styles.ts +34 -34
  44. package/src/components/CloseButton/CloseButton.tsx +37 -37
  45. package/src/components/CloseButton/index.ts +2 -2
  46. package/src/components/Colors/Colors.stories.tsx +7 -7
  47. package/src/components/Colors/Colors.styles.ts +38 -38
  48. package/src/components/Colors/Colors.tsx +34 -34
  49. package/src/components/Colors/index.ts +2 -2
  50. package/src/components/CssBaseline/CssBaseline.styles.ts +15 -15
  51. package/src/components/CssBaseline/CssBaseline.tsx +17 -17
  52. package/src/components/CssBaseline/index.ts +2 -2
  53. package/src/components/DateInput/DateInput.stories.tsx +67 -63
  54. package/src/components/DateInput/DateInput.styles.ts +14 -14
  55. package/src/components/DateInput/DateInput.tsx +101 -60
  56. package/src/components/DateInput/constants.ts +2 -0
  57. package/src/components/DateInput/index.ts +3 -2
  58. package/src/components/DatePicker/DatePicker.stories.tsx +90 -96
  59. package/src/components/DatePicker/DatePicker.styles.ts +44 -54
  60. package/src/components/DatePicker/DatePicker.tsx +354 -358
  61. package/src/components/DatePicker/DatePickerHeader/DatePickerHeader.styles.ts +84 -84
  62. package/src/components/DatePicker/DatePickerHeader/DatePickerHeader.tsx +80 -94
  63. package/src/components/DatePicker/DatePickerHeader/index.ts +2 -1
  64. package/src/components/DatePicker/constants.ts +1 -0
  65. package/src/components/DatePicker/helpers.ts +24 -0
  66. package/src/components/DatePicker/index.ts +3 -4
  67. package/src/components/DatePicker/types.ts +40 -0
  68. package/src/components/Description/Description.stories.tsx +29 -29
  69. package/src/components/Description/Description.styles.ts +31 -31
  70. package/src/components/Description/Description.tsx +69 -69
  71. package/src/components/Description/index.ts +2 -2
  72. package/src/components/FiltersPane/FilterInterval/FilterInterval.styles.ts +64 -64
  73. package/src/components/FiltersPane/FilterInterval/FilterInterval.tsx +162 -162
  74. package/src/components/FiltersPane/FilterInterval/index.ts +1 -1
  75. package/src/components/FiltersPane/FilterMultiSelect/FilterMultiSelect.tsx +14 -14
  76. package/src/components/FiltersPane/FilterMultiSelect/index.ts +1 -1
  77. package/src/components/FiltersPane/FilterSelect/FilterSelect.styles.ts +144 -144
  78. package/src/components/FiltersPane/FilterSelect/FilterSelect.tsx +397 -397
  79. package/src/components/FiltersPane/FilterSelect/index.ts +1 -1
  80. package/src/components/FiltersPane/FilterSelect/locales.ts +37 -37
  81. package/src/components/FiltersPane/FilterValueView/FilterValueView.styles.tsx +15 -15
  82. package/src/components/FiltersPane/FilterValueView/FilterValueView.tsx +186 -186
  83. package/src/components/FiltersPane/FilterValueView/index.tsx +1 -1
  84. package/src/components/FiltersPane/FilterWithDates/FilterWithDates.styles.ts +60 -60
  85. package/src/components/FiltersPane/FilterWithDates/FilterWithDates.tsx +210 -222
  86. package/src/components/FiltersPane/FilterWithDates/index.ts +1 -1
  87. package/src/components/FiltersPane/FilterWithPeriod/FilterWithPeriod.styles.ts +17 -17
  88. package/src/components/FiltersPane/FilterWithPeriod/FilterWithPeriod.tsx +231 -231
  89. package/src/components/FiltersPane/FilterWithPeriod/index.ts +1 -1
  90. package/src/components/FiltersPane/FilterWrapper/FilterWrapper.styles.ts +110 -110
  91. package/src/components/FiltersPane/FilterWrapper/FilterWrapper.tsx +360 -360
  92. package/src/components/FiltersPane/FilterWrapper/index.ts +1 -1
  93. package/src/components/FiltersPane/FiltersPane.stories.tsx +308 -308
  94. package/src/components/FiltersPane/FiltersPane.styles.ts +71 -71
  95. package/src/components/FiltersPane/FiltersPane.tsx +193 -193
  96. package/src/components/FiltersPane/FiltersPaneSearch/FiltersPaneSearch.styles.ts +109 -109
  97. package/src/components/FiltersPane/FiltersPaneSearch/FiltersPaneSearch.tsx +175 -175
  98. package/src/components/FiltersPane/FiltersPaneSearch/index.ts +1 -1
  99. package/src/components/FiltersPane/index.ts +20 -20
  100. package/src/components/FiltersPane/locales.ts +107 -107
  101. package/src/components/FiltersPane/types.ts +126 -126
  102. package/src/components/Flag/Flag.stories.tsx +29 -29
  103. package/src/components/Flag/Flag.styles.ts +18 -18
  104. package/src/components/Flag/Flag.tsx +28 -28
  105. package/src/components/Flag/augment.d.ts +1 -1
  106. package/src/components/Flag/index.ts +2 -2
  107. package/src/components/FlexibleTable/FlexibleTable.stories.tsx +86 -86
  108. package/src/components/FlexibleTable/FlexibleTable.styles.ts +131 -131
  109. package/src/components/FlexibleTable/FlexibleTable.tsx +243 -243
  110. package/src/components/FlexibleTable/TableRow.tsx +171 -171
  111. package/src/components/FlexibleTable/TableValue.tsx +81 -81
  112. package/src/components/FlexibleTable/fixture-test.ts +254 -254
  113. package/src/components/FlexibleTable/index.ts +3 -3
  114. package/src/components/FlexibleTable/types.ts +58 -58
  115. package/src/components/Icon/ComplexIconBoilerplate.tsx +17 -17
  116. package/src/components/Icon/Icon.stories.tsx +88 -88
  117. package/src/components/Icon/Icon.styles.ts +10 -10
  118. package/src/components/Icon/Icon.tsx +34 -34
  119. package/src/components/Icon/IconBoilerplate.tsx +42 -42
  120. package/src/components/Icon/complexIcons/augment.d.ts +1 -1
  121. package/src/components/Icon/complexIcons/avatarGreen.svg +57 -57
  122. package/src/components/Icon/complexIcons/icons.ts +7 -7
  123. package/src/components/Icon/complexIcons/index.ts +1 -1
  124. package/src/components/Icon/icons/icons.ts +838 -838
  125. package/src/components/Icon/icons/index.ts +1 -1
  126. package/src/components/Icon/index.ts +4 -4
  127. package/src/components/IncrementInput/ChangeButton.tsx +34 -34
  128. package/src/components/IncrementInput/IncrementInput.stories.tsx +34 -34
  129. package/src/components/IncrementInput/IncrementInput.styles.ts +77 -77
  130. package/src/components/IncrementInput/IncrementInput.tsx +95 -95
  131. package/src/components/IncrementInput/index.ts +2 -2
  132. package/src/components/Input/Input.stories.tsx +92 -92
  133. package/src/components/Input/Input.styles.ts +307 -307
  134. package/src/components/Input/Input.tsx +321 -321
  135. package/src/components/Input/index.ts +2 -2
  136. package/src/components/List/List.stories.tsx +62 -62
  137. package/src/components/List/List.styles.ts +52 -52
  138. package/src/components/List/List.tsx +82 -82
  139. package/src/components/List/index.ts +2 -2
  140. package/src/components/Modal/Modal.stories.tsx +113 -113
  141. package/src/components/Modal/Modal.styles.ts +308 -308
  142. package/src/components/Modal/Modal.tsx +210 -210
  143. package/src/components/Modal/index.ts +2 -2
  144. package/src/components/MoreMenu/MoreMenu.stories.tsx +46 -46
  145. package/src/components/MoreMenu/MoreMenu.styles.ts +70 -70
  146. package/src/components/MoreMenu/MoreMenu.tsx +102 -102
  147. package/src/components/MoreMenu/index.ts +2 -2
  148. package/src/components/MultiSelect/MultiSelect.stories.tsx +46 -46
  149. package/src/components/MultiSelect/MultiSelect.styles.ts +55 -55
  150. package/src/components/MultiSelect/MultiSelect.tsx +98 -98
  151. package/src/components/MultiSelect/MultiSelectInput/MultiSelectInput.styles.ts +73 -73
  152. package/src/components/MultiSelect/MultiSelectInput/MultiSelectInput.tsx +62 -62
  153. package/src/components/MultiSelect/MultiSelectInput/index.ts +1 -1
  154. package/src/components/MultiSelect/index.ts +3 -3
  155. package/src/components/MultiSelectList/MultiSelectList.styles.ts +125 -125
  156. package/src/components/MultiSelectList/MultiSelectList.tsx +519 -519
  157. package/src/components/MultiSelectList/index.ts +2 -2
  158. package/src/components/MultiSelectList/locales.ts +37 -37
  159. package/src/components/Notification/Notification.stories.tsx +51 -51
  160. package/src/components/Notification/Notification.styles.ts +50 -50
  161. package/src/components/Notification/Notification.tsx +84 -84
  162. package/src/components/Notification/index.ts +2 -2
  163. package/src/components/NumberInput/NumberInput.stories.tsx +36 -36
  164. package/src/components/NumberInput/NumberInput.tsx +154 -154
  165. package/src/components/NumberInput/helpers.ts +87 -87
  166. package/src/components/NumberInput/index.ts +1 -1
  167. package/src/components/PhoneInput/PhoneInput.stories.tsx +71 -71
  168. package/src/components/PhoneInput/PhoneInput.styles.ts +84 -84
  169. package/src/components/PhoneInput/PhoneInput.tsx +223 -223
  170. package/src/components/PhoneInput/PhoneInputCountryList/PhoneInputCountryList.stories.tsx +21 -21
  171. package/src/components/PhoneInput/PhoneInputCountryList/PhoneInputCountryList.styles.ts +100 -100
  172. package/src/components/PhoneInput/PhoneInputCountryList/PhoneInputCountryList.tsx +171 -171
  173. package/src/components/PhoneInput/PhoneInputCountryList/index.ts +2 -2
  174. package/src/components/PhoneInput/index.ts +6 -6
  175. package/src/components/PhoneInput/phone-info.ts +2167 -2167
  176. package/src/components/PhoneInput/types.ts +16 -16
  177. package/src/components/RadioButton/RadioButton.stories.tsx +46 -46
  178. package/src/components/RadioButton/RadioButton.styles.ts +37 -37
  179. package/src/components/RadioButton/RadioButton.tsx +56 -56
  180. package/src/components/RadioButton/index.ts +2 -2
  181. package/src/components/ScrollIntoViewIfNeeded/ScrollIntoViewIfNeeded.ts +66 -66
  182. package/src/components/ScrollIntoViewIfNeeded/index.ts +1 -1
  183. package/src/components/SearchInput/SearchInput.stories.tsx +24 -24
  184. package/src/components/SearchInput/SearchInput.styles.ts +50 -50
  185. package/src/components/SearchInput/SearchInput.tsx +63 -63
  186. package/src/components/SearchInput/index.ts +2 -2
  187. package/src/components/Select/MultiSelect.stories.tsx +263 -263
  188. package/src/components/Select/Select.stories.tsx +258 -258
  189. package/src/components/Select/Select.styles.ts +96 -96
  190. package/src/components/Select/Select.tsx +630 -630
  191. package/src/components/Select/SelectList/SelectList.styles.ts +72 -72
  192. package/src/components/Select/SelectList/SelectList.tsx +165 -165
  193. package/src/components/Select/SelectList/index.ts +1 -1
  194. package/src/components/Select/SelectListItem/SelectListItem.styles.ts +14 -14
  195. package/src/components/Select/SelectListItem/SelectListItem.tsx +73 -73
  196. package/src/components/Select/constants.ts +2 -2
  197. package/src/components/Select/helpers.ts +29 -29
  198. package/src/components/Select/index.ts +4 -4
  199. package/src/components/Select/types.ts +1 -1
  200. package/src/components/SmartInput/SmartInput.stories.tsx +63 -63
  201. package/src/components/SmartInput/SmartInput.tsx +180 -180
  202. package/src/components/SmartInput/helpers.ts +85 -85
  203. package/src/components/SmartInput/index.ts +1 -1
  204. package/src/components/Switch/Switch.stories.tsx +40 -40
  205. package/src/components/Switch/Switch.styles.ts +75 -75
  206. package/src/components/Switch/Switch.tsx +89 -89
  207. package/src/components/Switch/index.ts +2 -2
  208. package/src/components/TextArea/TextArea.stories.tsx +35 -35
  209. package/src/components/TextArea/TextArea.styles.ts +153 -153
  210. package/src/components/TextArea/TextArea.tsx +178 -178
  211. package/src/components/TextArea/index.ts +2 -2
  212. package/src/components/TextWithInfo/TextWithInfo.stories.tsx +53 -53
  213. package/src/components/TextWithInfo/TextWithInfo.styles.ts +60 -60
  214. package/src/components/TextWithInfo/TextWithInfo.tsx +67 -67
  215. package/src/components/TextWithInfo/index.ts +2 -2
  216. package/src/components/TextWithTooltip/TextWithTooltip.stories.tsx +58 -58
  217. package/src/components/TextWithTooltip/TextWithTooltip.styles.ts +19 -19
  218. package/src/components/TextWithTooltip/TextWithTooltip.tsx +163 -163
  219. package/src/components/TextWithTooltip/index.ts +2 -2
  220. package/src/components/ThemedPreloader/ThemedPreloader.stories.tsx +41 -41
  221. package/src/components/ThemedPreloader/ThemedPreloader.styles.ts +21 -21
  222. package/src/components/ThemedPreloader/ThemedPreloader.tsx +56 -56
  223. package/src/components/ThemedPreloader/components/DefaultPreloader/DefaultPreloader.tsx +34 -34
  224. package/src/components/ThemedPreloader/components/DefaultPreloader/index.ts +1 -1
  225. package/src/components/ThemedPreloader/components/DotsPreloader/DotsPreloader.styles.ts +54 -54
  226. package/src/components/ThemedPreloader/components/DotsPreloader/DotsPreloader.tsx +18 -18
  227. package/src/components/ThemedPreloader/components/DotsPreloader/index.ts +2 -2
  228. package/src/components/ThemedPreloader/components/SvgPreloader/SvgPreloader.styles.ts +11 -11
  229. package/src/components/ThemedPreloader/components/SvgPreloader/SvgPreloader.tsx +32 -32
  230. package/src/components/ThemedPreloader/components/SvgPreloader/index.ts +2 -2
  231. package/src/components/ThemedPreloader/components/index.ts +2 -2
  232. package/src/components/ThemedPreloader/index.ts +2 -2
  233. package/src/components/Toaster/Toaster.stories.tsx +34 -34
  234. package/src/components/Toaster/Toaster.styles.ts +59 -59
  235. package/src/components/Toaster/Toaster.tsx +113 -113
  236. package/src/components/Toaster/index.ts +2 -2
  237. package/src/components/Tooltip/Tooltip.stories.tsx +21 -21
  238. package/src/components/Tooltip/Tooltip.styles.ts +45 -45
  239. package/src/components/Tooltip/Tooltip.tsx +40 -40
  240. package/src/components/Tooltip/index.ts +3 -3
  241. package/src/components/Tooltip/types.ts +1 -1
  242. package/src/components/index.ts +36 -36
  243. package/src/helpers/colors.ts +2 -2
  244. package/src/helpers/dateHelpers/date-helpers.ts +9 -9
  245. package/src/helpers/index.ts +4 -4
  246. package/src/helpers/phone.ts +106 -106
  247. package/src/helpers/popper-helpers.ts +17 -17
  248. package/src/helpers/snippets.tsx +5 -5
  249. package/src/helpers/utils.ts +261 -250
  250. package/src/hooks/index.ts +6 -6
  251. package/src/hooks/use-did-mount-effect.ts +21 -21
  252. package/src/hooks/use-dropdown.ts +85 -85
  253. package/src/hooks/use-is-mounted.ts +15 -15
  254. package/src/hooks/use-on-click-outside.ts +92 -92
  255. package/src/hooks/use-theme.ts +36 -36
  256. package/src/hooks/use-tweak-styles.ts +14 -14
  257. package/src/index.ts +6 -6
  258. package/src/theme.ts +155 -155
  259. package/src/types.ts +105 -106
  260. package/src/vite-env.d.ts +1 -1
  261. package/dist/components/DatePicker/DatePickerInput/DatePickerInput.d.ts +0 -11
  262. package/dist/components/DatePicker/DatePickerInput/DatePickerInput.styles.d.ts +0 -20
  263. package/dist/components/DatePicker/DatePickerInput/index.d.ts +0 -1
  264. package/src/components/DatePicker/DatePickerInput/DatePickerInput.styles.ts +0 -25
  265. package/src/components/DatePicker/DatePickerInput/DatePickerInput.tsx +0 -31
  266. package/src/components/DatePicker/DatePickerInput/index.ts +0 -1
@@ -1,6 +1,6 @@
1
1
  (function(global2, factory) {
2
- typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react"), require("react-transition-group"), require("clsx"), require("hex-to-rgba"), require("react-jss"), require("react-input-mask"), require("react-datepicker"), require("date-fns"), require("react-overlays"), require("scroll-into-view-if-needed"), require("ts-debounce"), require("country-flag-icons"), require("react-remove-scroll")) : typeof define === "function" && define.amd ? define(["exports", "react", "react-transition-group", "clsx", "hex-to-rgba", "react-jss", "react-input-mask", "react-datepicker", "date-fns", "react-overlays", "scroll-into-view-if-needed", "ts-debounce", "country-flag-icons", "react-remove-scroll"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.TrueReactKitUiKit = {}, global2.React, global2.reactTransitionGroup, global2.clsx, global2.hexToRgba, global2.reactJss, global2.InputMask, global2.ReactDatepicker, global2.dateFns, global2.reactOverlays, global2.scrollIntoViewIfNeeded, global2.tsDebounce, global2.countryFlagIcons, global2.reactRemoveScroll));
3
- })(this, function(exports2, React, reactTransitionGroup, clsx, hexToRgba, reactJss, InputMask, ReactDatepicker, dateFns, reactOverlays, scrollIntoViewIfNeeded, tsDebounce, countryFlagIcons, reactRemoveScroll) {
2
+ typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react"), require("react-transition-group"), require("clsx"), require("hex-to-rgba"), require("react-jss"), require("react-input-mask"), require("react-datepicker"), require("date-fns"), require("react-overlays"), require("scroll-into-view-if-needed"), require("ts-debounce"), require("country-flag-icons"), require("react-remove-scroll")) : typeof define === "function" && define.amd ? define(["exports", "react", "react-transition-group", "clsx", "hex-to-rgba", "react-jss", "react-input-mask", "react-datepicker", "date-fns", "react-overlays", "scroll-into-view-if-needed", "ts-debounce", "country-flag-icons", "react-remove-scroll"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.TrueReactKitUiKit = {}, global2.React, global2.reactTransitionGroup, global2.clsx, global2.hexToRgba, global2.reactJss, global2.InputMask, global2.ReactDatePicker, global2.dateFns, global2.reactOverlays, global2.scrollIntoViewIfNeeded, global2.tsDebounce, global2.countryFlagIcons, global2.reactRemoveScroll));
3
+ })(this, function(exports2, React, reactTransitionGroup, clsx, hexToRgba, reactJss, InputMask, ReactDatePicker, dateFns, reactOverlays, scrollIntoViewIfNeeded, tsDebounce, countryFlagIcons, reactRemoveScroll) {
4
4
  "use strict";
5
5
  var colors = {
6
6
  FONT_MAIN: "#222a37",
@@ -1292,6 +1292,9 @@
1292
1292
  var isNotEmpty = function(val) {
1293
1293
  return typeof val === "string" ? val.trim() !== "" : val !== null && val !== void 0;
1294
1294
  };
1295
+ var isEmpty = function(val) {
1296
+ return val === null || val === void 0;
1297
+ };
1295
1298
  var isStringNotEmpty = function(value) {
1296
1299
  return (value !== null && value !== void 0 ? value : "").trim() !== "";
1297
1300
  };
@@ -1340,17 +1343,19 @@
1340
1343
  tabIndex: -1
1341
1344
  };
1342
1345
  };
1343
- var createFilter = function(getter) {
1346
+ var createFilter = function(getter, compareFn) {
1344
1347
  return function(items, query) {
1345
1348
  return items.filter(function(item) {
1346
1349
  var possibleValues = getter(item).reduce(function(acc, cur) {
1347
1350
  return _to_consumable_array$7(acc).concat(_to_consumable_array$7(isStringNotEmpty(cur) ? [
1348
- cur === null || cur === void 0 ? void 0 : cur.toLowerCase()
1351
+ cur.toLowerCase()
1349
1352
  ] : []));
1350
1353
  }, []);
1351
1354
  var queryString = query.toLowerCase().trim();
1352
1355
  return possibleValues.some(function(v) {
1353
- return v === null || v === void 0 ? void 0 : v.includes(queryString);
1356
+ return (compareFn !== null && compareFn !== void 0 ? compareFn : function() {
1357
+ return v === null || v === void 0 ? void 0 : v.includes(queryString);
1358
+ })(v, queryString);
1354
1359
  });
1355
1360
  });
1356
1361
  };
@@ -4958,63 +4963,63 @@
4958
4963
  ]
4959
4964
  });
4960
4965
  };
4961
- const avatarGreen = ` <svg\r
4962
- width="100%"\r
4963
- height="100%"\r
4964
- viewBox="0 0 32 32"\r
4965
- fill="none"\r
4966
- xmlns="http://www.w3.org/2000/svg"\r
4967
- >\r
4968
- <circle opacity="0.5" cx="16" cy="16" r="16" fill="#DDE3ED" />\r
4969
- <mask\r
4970
- id="mask0_0_12744"\r
4971
- style="mask-type: 'alpha';"\r
4972
- maskUnits="userSpaceOnUse"\r
4973
- x="0"\r
4974
- y="0"\r
4975
- width="32"\r
4976
- height="32"\r
4977
- >\r
4978
- <circle cx="16" cy="16" r="16" fill="white" />\r
4979
- </mask>\r
4980
- <g mask="url(#mask0_0_12744)">\r
4981
- <circle cx="16" cy="29" r="13" fill="url(#paint0_linear_0_12744)" />\r
4982
- <mask\r
4983
- id="mask1_0_12744"\r
4984
- style="mask-type: 'alpha';"\r
4985
- maskUnits="userSpaceOnUse"\r
4986
- x="3"\r
4987
- y="16"\r
4988
- width="26"\r
4989
- height="26"\r
4990
- >\r
4991
- <circle cx="16" cy="29" r="13" fill="white" />\r
4992
- </mask>\r
4993
- <g mask="url(#mask1_0_12744)">\r
4994
- <ellipse\r
4995
- cx="16"\r
4996
- cy="17.5"\r
4997
- rx="6"\r
4998
- ry="7.5"\r
4999
- fill="#505F79"\r
5000
- fill-opacity="0.204983"\r
5001
- />\r
5002
- </g>\r
5003
- </g>\r
5004
- <ellipse cx="16" cy="13" rx="6" ry="7" fill="white" />\r
5005
- <defs>\r
5006
- <linearGradient\r
5007
- id="paint0_linear_0_12744"\r
5008
- x1="13.347"\r
5009
- y1="46.279"\r
5010
- x2="33.5318"\r
5011
- y2="30.8088"\r
5012
- gradientUnits="userSpaceOnUse"\r
5013
- >\r
5014
- <stop stop-color="#ABD229" />\r
5015
- <stop offset="1" stop-color="#9CD03F" />\r
5016
- </linearGradient>\r
5017
- </defs>\r
4966
+ const avatarGreen = ` <svg
4967
+ width="100%"
4968
+ height="100%"
4969
+ viewBox="0 0 32 32"
4970
+ fill="none"
4971
+ xmlns="http://www.w3.org/2000/svg"
4972
+ >
4973
+ <circle opacity="0.5" cx="16" cy="16" r="16" fill="#DDE3ED" />
4974
+ <mask
4975
+ id="mask0_0_12744"
4976
+ style="mask-type: 'alpha';"
4977
+ maskUnits="userSpaceOnUse"
4978
+ x="0"
4979
+ y="0"
4980
+ width="32"
4981
+ height="32"
4982
+ >
4983
+ <circle cx="16" cy="16" r="16" fill="white" />
4984
+ </mask>
4985
+ <g mask="url(#mask0_0_12744)">
4986
+ <circle cx="16" cy="29" r="13" fill="url(#paint0_linear_0_12744)" />
4987
+ <mask
4988
+ id="mask1_0_12744"
4989
+ style="mask-type: 'alpha';"
4990
+ maskUnits="userSpaceOnUse"
4991
+ x="3"
4992
+ y="16"
4993
+ width="26"
4994
+ height="26"
4995
+ >
4996
+ <circle cx="16" cy="29" r="13" fill="white" />
4997
+ </mask>
4998
+ <g mask="url(#mask1_0_12744)">
4999
+ <ellipse
5000
+ cx="16"
5001
+ cy="17.5"
5002
+ rx="6"
5003
+ ry="7.5"
5004
+ fill="#505F79"
5005
+ fill-opacity="0.204983"
5006
+ />
5007
+ </g>
5008
+ </g>
5009
+ <ellipse cx="16" cy="13" rx="6" ry="7" fill="white" />
5010
+ <defs>
5011
+ <linearGradient
5012
+ id="paint0_linear_0_12744"
5013
+ x1="13.347"
5014
+ y1="46.279"
5015
+ x2="33.5318"
5016
+ y2="30.8088"
5017
+ gradientUnits="userSpaceOnUse"
5018
+ >
5019
+ <stop stop-color="#ABD229" />
5020
+ <stop offset="1" stop-color="#9CD03F" />
5021
+ </linearGradient>
5022
+ </defs>
5018
5023
  </svg>`;
5019
5024
  var complexIcons = {
5020
5025
  avatar: avatarGreen
@@ -5060,7 +5065,7 @@
5060
5065
  }
5061
5066
  });
5062
5067
  };
5063
- var styles$K = {
5068
+ var styles$J = {
5064
5069
  root: {
5065
5070
  display: "flex",
5066
5071
  alignItems: "center"
@@ -5123,7 +5128,7 @@
5123
5128
  };
5124
5129
  var Icon = function(param) {
5125
5130
  var type = param.type, data = param.data, tweakStyles = param.tweakStyles;
5126
- var classes = useTheme("Icon", styles$K, tweakStyles).classes;
5131
+ var classes = useTheme("Icon", styles$J, tweakStyles).classes;
5127
5132
  return /* @__PURE__ */ jsx("div", _object_spread_props$B(_object_spread$K({
5128
5133
  className: classes.root
5129
5134
  }, addDataAttributes(data)), {
@@ -5137,7 +5142,7 @@
5137
5142
  var ITEM_HORIZONTAL_PADDING = 16;
5138
5143
  var ICON_SIZE = 20;
5139
5144
  var ICON_GAP = 12;
5140
- var styles$J = {
5145
+ var styles$I = {
5141
5146
  root: {
5142
5147
  minWidth: 180,
5143
5148
  backgroundColor: colors.CLASSIC_WHITE,
@@ -5234,7 +5239,7 @@
5234
5239
  }
5235
5240
  var List = function(param) {
5236
5241
  var items = param.items, testId = param.testId, data = param.data, tweakStyles = param.tweakStyles, onClick = param.onClick;
5237
- var classes = useTheme("List", styles$J, tweakStyles).classes;
5242
+ var classes = useTheme("List", styles$I, tweakStyles).classes;
5238
5243
  var handleItemClick = function(item) {
5239
5244
  item.onClick();
5240
5245
  onClick === null || onClick === void 0 ? void 0 : onClick();
@@ -5331,7 +5336,7 @@
5331
5336
  }
5332
5337
  return target;
5333
5338
  }
5334
- var styles$I = _object_spread_props$z(_object_spread$I({
5339
+ var styles$H = _object_spread_props$z(_object_spread$I({
5335
5340
  root: {
5336
5341
  display: "flex"
5337
5342
  },
@@ -5488,7 +5493,7 @@
5488
5493
  var ANIMATION_TIMEOUT = 150;
5489
5494
  var AccountInfo = function(param) {
5490
5495
  var data = param.data, avatar = param.avatar, tweakStyles = param.tweakStyles, accountName = param.accountName, options = param.options;
5491
- var _useTheme = useTheme("AccountInfo", styles$I, tweakStyles, {
5496
+ var _useTheme = useTheme("AccountInfo", styles$H, tweakStyles, {
5492
5497
  timeout: ANIMATION_TIMEOUT
5493
5498
  }), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
5494
5499
  var nameRef = React.useRef(null);
@@ -5555,7 +5560,7 @@
5555
5560
  ]
5556
5561
  }));
5557
5562
  };
5558
- var styles$H = {
5563
+ var styles$G = {
5559
5564
  root: {
5560
5565
  display: "flex",
5561
5566
  alignItems: "center",
@@ -5635,7 +5640,7 @@
5635
5640
  }
5636
5641
  var AddButton = function(param) {
5637
5642
  var text = param.text, _param_type = param.type, type = _param_type === void 0 ? "button" : _param_type, isDisabled = param.isDisabled, onClick = param.onClick, isFullWidth = param.isFullWidth, data = param.data, tweakStyles = param.tweakStyles;
5638
- var classes = useTheme("AddButton", styles$H, tweakStyles).classes;
5643
+ var classes = useTheme("AddButton", styles$G, tweakStyles).classes;
5639
5644
  return /* @__PURE__ */ jsxs("button", _object_spread_props$x(_object_spread$G({
5640
5645
  type,
5641
5646
  className: clsx(classes.root, isDisabled && classes.disabled, isFullWidth && classes.fullWidth),
@@ -5655,7 +5660,7 @@
5655
5660
  ]
5656
5661
  }));
5657
5662
  };
5658
- var styles$G = {
5663
+ var styles$F = {
5659
5664
  root: {
5660
5665
  display: "flex",
5661
5666
  gap: 4,
@@ -5700,7 +5705,7 @@
5700
5705
  };
5701
5706
  var DotsPreloader = function(param) {
5702
5707
  var tweakStyles = param.tweakStyles;
5703
- var classes = useTheme("DotsPreloader", styles$G, tweakStyles).classes;
5708
+ var classes = useTheme("DotsPreloader", styles$F, tweakStyles).classes;
5704
5709
  return /* @__PURE__ */ jsx("div", {
5705
5710
  className: classes.root,
5706
5711
  children: /* @__PURE__ */ jsx("span", {
@@ -5764,7 +5769,7 @@
5764
5769
  ]
5765
5770
  });
5766
5771
  };
5767
- var styles$F = {
5772
+ var styles$E = {
5768
5773
  root: {
5769
5774
  display: "flex",
5770
5775
  width: "100%",
@@ -5774,7 +5779,7 @@
5774
5779
  var SvgPreloader = function(param) {
5775
5780
  var _param_type = param.type, type = _param_type === void 0 ? "default" : _param_type, tweakStyles = param.tweakStyles;
5776
5781
  var _theme_preloaders;
5777
- var classes = useTheme("SvgPreloader", styles$F, tweakStyles).classes;
5782
+ var classes = useTheme("SvgPreloader", styles$E, tweakStyles).classes;
5778
5783
  var theme = React.useContext(ThemeContext).theme;
5779
5784
  var _theme_preloaders_type;
5780
5785
  var PreloaderIcon = (_theme_preloaders_type = (_theme_preloaders = theme.preloaders) === null || _theme_preloaders === void 0 ? void 0 : _theme_preloaders[type]) !== null && _theme_preloaders_type !== void 0 ? _theme_preloaders_type : DefaultPreloader;
@@ -5786,7 +5791,7 @@
5786
5791
  }
5787
5792
  }) : /* @__PURE__ */ jsx(PreloaderIcon, {});
5788
5793
  };
5789
- var styles$E = {
5794
+ var styles$D = {
5790
5795
  root: {
5791
5796
  display: "flex"
5792
5797
  },
@@ -5852,7 +5857,7 @@
5852
5857
  }
5853
5858
  var ThemedPreloader = function(param) {
5854
5859
  var _param_type = param.type, type = _param_type === void 0 ? "default" : _param_type, _param_useCurrentColor = param.useCurrentColor, useCurrentColor = _param_useCurrentColor === void 0 ? false : _param_useCurrentColor, data = param.data, tweakStyles = param.tweakStyles;
5855
- var _useTheme = useTheme("ThemedPreloader", styles$E, tweakStyles), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
5860
+ var _useTheme = useTheme("ThemedPreloader", styles$D, tweakStyles), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
5856
5861
  var preloaderComponentStyles = useTweakStyles(componentStyles, tweakStyles, "tweakPreloaderComponent");
5857
5862
  return /* @__PURE__ */ jsx("div", _object_spread_props$w(_object_spread$F({
5858
5863
  className: clsx(classes.root, classes[type], _define_property$H({}, classes.currentColor, useCurrentColor))
@@ -5865,7 +5870,7 @@
5865
5870
  })
5866
5871
  }));
5867
5872
  };
5868
- var styles$D = {
5873
+ var styles$C = {
5869
5874
  root: {
5870
5875
  display: "flex",
5871
5876
  justifyContent: "center",
@@ -6096,9 +6101,9 @@
6096
6101
  "text",
6097
6102
  "custom"
6098
6103
  ];
6099
- var Button = function(param) {
6104
+ var Button = /* @__PURE__ */ React.forwardRef(function(param, ref) {
6100
6105
  var _param_type = param.type, type = _param_type === void 0 ? "button" : _param_type, children = param.children, _param_size = param.size, size = _param_size === void 0 ? "l" : _param_size, _param_view = param.view, view = _param_view === void 0 ? "primary" : _param_view, _param_isFullWidth = param.isFullWidth, isFullWidth = _param_isFullWidth === void 0 ? false : _param_isFullWidth, _param_isInline = param.isInline, isInline = _param_isInline === void 0 ? false : _param_isInline, _param_isDisabled = param.isDisabled, isDisabled = _param_isDisabled === void 0 ? false : _param_isDisabled, _param_isActive = param.isActive, isActive = _param_isActive === void 0 ? false : _param_isActive, _param_isLoading = param.isLoading, isLoading = _param_isLoading === void 0 ? false : _param_isLoading, _param_shouldSkipTabNavigation = param.shouldSkipTabNavigation, shouldSkipTabNavigation = _param_shouldSkipTabNavigation === void 0 ? false : _param_shouldSkipTabNavigation, data = param.data, testId = param.testId, tweakStyles = param.tweakStyles, icon = param.icon, _param_iconPosition = param.iconPosition, iconPosition = _param_iconPosition === void 0 ? "left" : _param_iconPosition, _param_preloaderType = param.preloaderType, preloaderType = _param_preloaderType === void 0 ? "dots" : _param_preloaderType, onClick = param.onClick, onMouseDown = param.onMouseDown;
6101
- var _useTheme = useTheme("Button", styles$D, tweakStyles), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
6106
+ var _useTheme = useTheme("Button", styles$C, tweakStyles), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
6102
6107
  var tweakPreloaderStyles = React.useMemo(function() {
6103
6108
  return merge$1({}, size === "s" || size === "m" ? dotsPreloaderStyles : void 0, componentStyles.tweakPreloader, tweakStyles === null || tweakStyles === void 0 ? void 0 : tweakStyles.tweakPreloader);
6104
6109
  }, [
@@ -6110,6 +6115,7 @@
6110
6115
  var hasNoAction = isDisabled || isLoading;
6111
6116
  var _obj, _obj1;
6112
6117
  return /* @__PURE__ */ jsxs("button", _object_spread_props$v(_object_spread$E({
6118
+ ref,
6113
6119
  type,
6114
6120
  className: clsx(classes.root, classes[size], classes[view], (_obj = {}, _define_property$G(_obj, classes.disabled, isDisabled), _define_property$G(_obj, classes.fullWidth, isFullWidth), _define_property$G(_obj, classes.inline, isInline), _define_property$G(_obj, classes.active, isActive), _define_property$G(_obj, classes.loading, isLoading), _define_property$G(_obj, classes.onlyIcon, hasIcon && !hasChildren), _obj)),
6115
6121
  tabIndex: shouldSkipTabNavigation ? -1 : void 0,
@@ -6143,8 +6149,8 @@
6143
6149
  })
6144
6150
  ]
6145
6151
  }));
6146
- };
6147
- var styles$C = {
6152
+ });
6153
+ var styles$B = {
6148
6154
  root: {
6149
6155
  cursor: "pointer",
6150
6156
  display: "flex",
@@ -6312,7 +6318,7 @@
6312
6318
  }
6313
6319
  function Checkbox(param) {
6314
6320
  var children = param.children, isDisabled = param.isDisabled, isReadonly = param.isReadonly, _param_isChecked = param.isChecked, isChecked = _param_isChecked === void 0 ? false : _param_isChecked, value = param.value, _param_size = param.size, size = _param_size === void 0 ? 18 : _param_size, _param_alignItems = param.alignItems, alignItems = _param_alignItems === void 0 ? "center" : _param_alignItems, textMargin = param.textMargin, data = param.data, testId = param.testId, isSemiChecked = param.isSemiChecked, _param_labelPosition = param.labelPosition, labelPosition = _param_labelPosition === void 0 ? "right" : _param_labelPosition, tweakStyles = param.tweakStyles, onSelect = param.onSelect;
6315
- var classes = useTheme("Checkbox", styles$C, tweakStyles, {
6321
+ var classes = useTheme("Checkbox", styles$B, tweakStyles, {
6316
6322
  size,
6317
6323
  alignItems,
6318
6324
  textMargin
@@ -6360,7 +6366,7 @@
6360
6366
  ]
6361
6367
  }));
6362
6368
  }
6363
- var styles$B = {
6369
+ var styles$A = {
6364
6370
  root: {
6365
6371
  width: 40,
6366
6372
  height: 40,
@@ -6439,7 +6445,7 @@
6439
6445
  }
6440
6446
  var CloseButton = function(param) {
6441
6447
  var tweakStyles = param.tweakStyles, testId = param.testId, data = param.data, _param_iconType = param.iconType, iconType = _param_iconType === void 0 ? "close" : _param_iconType, onClose = param.onClose;
6442
- var classes = useTheme("CloseButton", styles$B, tweakStyles).classes;
6448
+ var classes = useTheme("CloseButton", styles$A, tweakStyles).classes;
6443
6449
  return /* @__PURE__ */ jsx("button", _object_spread_props$t(_object_spread$C({
6444
6450
  type: "button",
6445
6451
  className: classes.root,
@@ -6451,7 +6457,7 @@
6451
6457
  })
6452
6458
  }));
6453
6459
  };
6454
- var styles$A = {
6460
+ var styles$z = {
6455
6461
  root: {
6456
6462
  display: "flex",
6457
6463
  flexWrap: "wrap"
@@ -6544,7 +6550,7 @@
6544
6550
  return _array_like_to_array$l(o, minLen);
6545
6551
  }
6546
6552
  var Colors = function() {
6547
- var classes = useTheme("Colors", styles$A).classes;
6553
+ var classes = useTheme("Colors", styles$z).classes;
6548
6554
  var theme = React.useContext(ThemeContext).theme;
6549
6555
  var _theme_colors = theme.colors, colors2 = _theme_colors === void 0 ? {} : _theme_colors;
6550
6556
  return /* @__PURE__ */ jsx("div", {
@@ -6574,7 +6580,7 @@
6574
6580
  })
6575
6581
  });
6576
6582
  };
6577
- var styles$z = {
6583
+ var styles$y = {
6578
6584
  "@global html, body": {
6579
6585
  fontFamily: "Arial, sans-serif",
6580
6586
  color: colors.FONT_MAIN,
@@ -6613,14 +6619,14 @@
6613
6619
  }
6614
6620
  var CssBaseline = function(param) {
6615
6621
  var data = param.data, tweakStyles = param.tweakStyles;
6616
- var classes = useTheme("CssBaseline", styles$z, tweakStyles).classes;
6622
+ var classes = useTheme("CssBaseline", styles$y, tweakStyles).classes;
6617
6623
  return /* @__PURE__ */ jsx("div", _object_spread$B({
6618
6624
  className: classes.root
6619
6625
  }, addDataAttributes(data)));
6620
6626
  };
6621
6627
  var PADDING_X$1 = 12;
6622
6628
  var AUTOSIZE_MAX_WIDTH = 480;
6623
- var styles$y = {
6629
+ var styles$x = {
6624
6630
  root: {
6625
6631
  width: "100%",
6626
6632
  boxSizing: "border-box",
@@ -7143,7 +7149,7 @@
7143
7149
  var DEFAULT_SIZE = 6;
7144
7150
  var Input = /* @__PURE__ */ React.forwardRef(function(param, ref) {
7145
7151
  var _param_value = param.value, value = _param_value === void 0 ? "" : _param_value, label = param.label, placeholder = param.placeholder, _param_type = param.type, type = _param_type === void 0 ? "text" : _param_type, isDisabled = param.isDisabled, isReadonly = param.isReadonly, _param_hasFloatingLabel = param.hasFloatingLabel, hasFloatingLabel = _param_hasFloatingLabel === void 0 ? true : _param_hasFloatingLabel, _param_isInvalid = param.isInvalid, isInvalid = _param_isInvalid === void 0 ? false : _param_isInvalid, _param_isActive = param.isActive, isActive = _param_isActive === void 0 ? false : _param_isActive, _param_isClearable = param.isClearable, isClearable = _param_isClearable === void 0 ? false : _param_isClearable, infoMessage = param.infoMessage, errorMessage = param.errorMessage, _param_errorPosition = param.errorPosition, errorPosition = _param_errorPosition === void 0 ? "bottom" : _param_errorPosition, inlineStyle = param.inlineStyle, border = param.border, isRequired = param.isRequired, isLoading = param.isLoading, isAutoSizeable = param.isAutoSizeable, _param_defaultSize = param.defaultSize, defaultSize = _param_defaultSize === void 0 ? DEFAULT_SIZE : _param_defaultSize, iconType = param.iconType, name = param.name, hasRequiredLabel = param.hasRequiredLabel, data = param.data, tweakStyles = param.tweakStyles, maxLength = param.maxLength, shouldFocusOnMount = param.shouldFocusOnMount, units = param.units, testId = param.testId, tabIndex = param.tabIndex, onChange = param.onChange, onPaste = param.onPaste, onFocus = param.onFocus, onBlur = param.onBlur, onIconClick = param.onIconClick, onKeyDown = param.onKeyDown, mask = param.mask, maskPlaceholder = param.maskPlaceholder, alwaysShowMask = param.alwaysShowMask, beforeMaskedStateChange = param.beforeMaskedStateChange;
7146
- var _useTheme = useTheme("Input", styles$y, tweakStyles), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
7152
+ var _useTheme = useTheme("Input", styles$x, tweakStyles), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
7147
7153
  var _useState = _sliced_to_array$k(React.useState(false), 2), isFocused = _useState[0], setFocused = _useState[1];
7148
7154
  var inputRef = React.useRef(null);
7149
7155
  var handleChange = function(event) {
@@ -7284,12 +7290,14 @@
7284
7290
  ]
7285
7291
  });
7286
7292
  });
7287
- var styles$x = {
7293
+ var EMPTY_DATE_INPUT_VALUE = "__.__.____";
7294
+ var EMPTY_DATE_RANGE_INPUT_VALUE = "".concat(EMPTY_DATE_INPUT_VALUE, " - ").concat(EMPTY_DATE_INPUT_VALUE);
7295
+ var styles$w = {
7288
7296
  root: {
7289
- cursor: "pointer",
7290
- position: "relative",
7291
7297
  width: "100%",
7292
- height: "100%"
7298
+ height: "100%",
7299
+ cursor: "pointer",
7300
+ position: "relative"
7293
7301
  },
7294
7302
  tweakInput: {}
7295
7303
  };
@@ -7377,71 +7385,57 @@
7377
7385
  }
7378
7386
  return target;
7379
7387
  }
7380
- var DateInput = function(_param) {
7381
- var isRange = _param.isRange, date = _param.date, _param_startDate = _param.startDate, startDate = _param_startDate === void 0 ? "" : _param_startDate, _param_endDate = _param.endDate, endDate = _param_endDate === void 0 ? "" : _param_endDate, data = _param.data, onChange = _param.onChange, tweakStyles = _param.tweakStyles, props = _object_without_properties$8(_param, [
7382
- "isRange",
7388
+ var DateInput = /* @__PURE__ */ React.forwardRef(function(_param, ref) {
7389
+ var date = _param.date, _param_startDate = _param.startDate, startDate = _param_startDate === void 0 ? "" : _param_startDate, _param_endDate = _param.endDate, endDate = _param_endDate === void 0 ? "" : _param_endDate, mask = _param.mask, className = _param.className, placeholder = _param.placeholder, data = _param.data, isRange = _param.isRange, tweakStyles = _param.tweakStyles, onClick = _param.onClick, onChange = _param.onChange, inputProps = _object_without_properties$8(_param, [
7383
7390
  "date",
7384
7391
  "startDate",
7385
7392
  "endDate",
7393
+ "mask",
7394
+ "className",
7395
+ "placeholder",
7386
7396
  "data",
7387
- "onChange",
7388
- "tweakStyles"
7397
+ "isRange",
7398
+ "tweakStyles",
7399
+ "onClick",
7400
+ "onChange"
7389
7401
  ]);
7390
- var _useTheme = useTheme("DateInput", styles$x, tweakStyles), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
7391
- var mainProps = isRange ? {
7392
- value: "".concat(startDate).concat(endDate),
7393
- onChange: function(v) {
7394
- return onChange(v !== "__.__.____ - __.__.____" ? v : "");
7395
- },
7396
- mask: "99.99.9999 - 99.99.9999"
7397
- } : {
7398
- value: date,
7399
- onChange: function(v) {
7400
- return onChange(v !== "__.__.____" ? v : "");
7401
- },
7402
- mask: "99.99.9999"
7403
- };
7402
+ var _useTheme = useTheme("DateInput", styles$w, tweakStyles), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
7404
7403
  var tweakInputStyles = useTweakStyles(componentStyles, tweakStyles, "tweakInput");
7404
+ var beforeMaskedStateChange = function(param) {
7405
+ var nextState = param.nextState;
7406
+ if (nextState.value === EMPTY_DATE_INPUT_VALUE || nextState.value === EMPTY_DATE_RANGE_INPUT_VALUE) {
7407
+ return {
7408
+ value: "",
7409
+ selection: {
7410
+ start: 0,
7411
+ end: 0
7412
+ }
7413
+ };
7414
+ }
7415
+ return nextState;
7416
+ };
7417
+ var handleChange = function(value, event) {
7418
+ if (event.type === "click") {
7419
+ event.target.value = "";
7420
+ }
7421
+ onChange === null || onChange === void 0 ? void 0 : onChange(event, value);
7422
+ };
7405
7423
  return /* @__PURE__ */ jsx("div", _object_spread_props$r(_object_spread$z({
7406
- className: classes.root
7424
+ className: clsx(classes.root, className),
7425
+ onClick
7407
7426
  }, addDataAttributes(data)), {
7408
- children: /* @__PURE__ */ jsx(Input, _object_spread_props$r(_object_spread$z({}, mainProps, props), {
7409
- tweakStyles: tweakInputStyles
7427
+ children: /* @__PURE__ */ jsx(Input, _object_spread_props$r(_object_spread$z({}, inputProps), {
7428
+ ref,
7429
+ value: isRange ? "".concat(startDate).concat(endDate) : date,
7430
+ mask: mask !== null && mask !== void 0 ? mask : isRange ? "99.99.9999 - 99.99.9999" : "99.99.9999",
7431
+ placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : isRange ? EMPTY_DATE_RANGE_INPUT_VALUE : EMPTY_DATE_INPUT_VALUE,
7432
+ tweakStyles: tweakInputStyles,
7433
+ onChange: handleChange,
7434
+ beforeMaskedStateChange
7410
7435
  }))
7411
7436
  }));
7412
- };
7413
- const reactDatepicker = "";
7414
- var styles$w = {
7415
- customInput: {
7416
- width: "100%",
7417
- height: "100%"
7418
- },
7419
- s: {
7420
- width: 184,
7421
- height: "100%"
7422
- },
7423
- m: {
7424
- width: 300,
7425
- height: "100%"
7426
- },
7427
- full: {
7428
- width: "100%",
7429
- height: "100%"
7430
- }
7431
- };
7432
- var DatePickerInput = /* @__PURE__ */ React.forwardRef(function(param, ref) {
7433
- var onClick = param.onClick, children = param.children, _param_size = param.size, size = _param_size === void 0 ? "full" : _param_size, className = param.className;
7434
- var classes = useTheme("DatePickerInput", styles$w).classes;
7435
- return /* @__PURE__ */ jsx("div", {
7436
- className: clsx(classes.customInput, className),
7437
- children: /* @__PURE__ */ jsx("div", {
7438
- className: classes[size],
7439
- onClick,
7440
- ref,
7441
- children
7442
- })
7443
- });
7444
7437
  });
7438
+ const reactDatepicker = "";
7445
7439
  function _assert_this_initialized(self2) {
7446
7440
  if (self2 === void 0) {
7447
7441
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
@@ -9006,20 +9000,13 @@
9006
9000
  }
9007
9001
  };
9008
9002
  var DatePickerHeader = function(param) {
9009
- var date = param.date, changeYear = param.changeYear, changeMonth = param.changeMonth, decreaseMonth = param.decreaseMonth, increaseMonth = param.increaseMonth, isPrevMonthButtonDisabled = param.isPrevMonthButtonDisabled, isNextMonthButtonDisabled = param.isNextMonthButtonDisabled, months = param.months;
9003
+ var date = param.date, _param_months = param.months, months = _param_months === void 0 ? [] : _param_months, prevMonthButtonDisabled = param.prevMonthButtonDisabled, nextMonthButtonDisabled = param.nextMonthButtonDisabled, changeYear = param.changeYear, changeMonth = param.changeMonth, decreaseMonth = param.decreaseMonth, increaseMonth = param.increaseMonth;
9010
9004
  var _useTheme = useTheme("DatePickerHeader", styles$s), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
9011
9005
  var years = React.useMemo(function() {
9012
9006
  return Array.from(Array(41)).map(function(_, i) {
9013
9007
  return dateFns.getYear(new Date()) - 30 + i;
9014
9008
  });
9015
9009
  }, []);
9016
- var getMonthNumber = React.useCallback(function(month) {
9017
- return months.findIndex(function(m) {
9018
- return m === month;
9019
- });
9020
- }, [
9021
- months
9022
- ]);
9023
9010
  return /* @__PURE__ */ jsxs("div", {
9024
9011
  className: classes.header,
9025
9012
  children: [
@@ -9035,11 +9022,11 @@
9035
9022
  children: /* @__PURE__ */ jsx(Select, {
9036
9023
  value: months[dateFns.getMonth(date)],
9037
9024
  options: months,
9038
- onChange: function(value) {
9039
- return changeMonth(getMonthNumber(value));
9040
- },
9025
+ dropdownIcon: "chevron-down-small",
9041
9026
  tweakStyles: componentStyles.tweakSelect,
9042
- dropdownIcon: "chevron-down-small"
9027
+ onChange: function(value) {
9028
+ return changeMonth(months.indexOf(value));
9029
+ }
9043
9030
  })
9044
9031
  })
9045
9032
  ]
@@ -9056,11 +9043,11 @@
9056
9043
  children: /* @__PURE__ */ jsx(Select, {
9057
9044
  value: dateFns.getYear(date),
9058
9045
  options: years,
9059
- onChange: function(value) {
9060
- changeYear(value);
9061
- },
9046
+ dropdownIcon: "chevron-down-small",
9062
9047
  tweakStyles: componentStyles.tweakSelect,
9063
- dropdownIcon: "chevron-down-small"
9048
+ onChange: function(value) {
9049
+ return changeYear(value);
9050
+ }
9064
9051
  })
9065
9052
  })
9066
9053
  ]
@@ -9069,19 +9056,19 @@
9069
9056
  className: classes.buttons,
9070
9057
  children: [
9071
9058
  /* @__PURE__ */ jsx("button", {
9072
- onClick: decreaseMonth,
9073
- disabled: isPrevMonthButtonDisabled,
9074
- className: classes.btn,
9075
9059
  type: "button",
9060
+ className: classes.btn,
9061
+ disabled: prevMonthButtonDisabled,
9062
+ onClick: decreaseMonth,
9076
9063
  children: /* @__PURE__ */ jsx(Icon, {
9077
9064
  type: "chevron-left"
9078
9065
  })
9079
9066
  }),
9080
9067
  /* @__PURE__ */ jsx("button", {
9081
- onClick: increaseMonth,
9082
- disabled: isNextMonthButtonDisabled,
9083
- className: classes.btn,
9084
9068
  type: "button",
9069
+ className: classes.btn,
9070
+ disabled: nextMonthButtonDisabled,
9071
+ onClick: increaseMonth,
9085
9072
  children: /* @__PURE__ */ jsx(Icon, {
9086
9073
  type: "chevron-right"
9087
9074
  })
@@ -9091,43 +9078,38 @@
9091
9078
  ]
9092
9079
  });
9093
9080
  };
9081
+ var getDateFormatter = function(dateFormat) {
9082
+ return function(date) {
9083
+ return isNotEmpty(date) ? dateFns.format(date, dateFormat) : "";
9084
+ };
9085
+ };
9086
+ var getDateValueParser = function(dateFormat) {
9087
+ return function(value) {
9088
+ var inputValue = value === EMPTY_DATE_INPUT_VALUE ? "" : value;
9089
+ return isStringNotEmpty(inputValue) ? dateFns.parse(value, dateFormat, new Date()) : null;
9090
+ };
9091
+ };
9092
+ var areDatesEquals = function(date1, date2) {
9093
+ return isEmpty(date1) && isEmpty(date2) || isNotEmpty(date1) && isNotEmpty(date2) && dateFns.isSameDay(date1, date2);
9094
+ };
9095
+ var DEFAULT_DATE_FORMAT$2 = "dd.MM.yyyy";
9094
9096
  var styles$r = {
9095
9097
  root: {
9096
9098
  width: "100%",
9097
9099
  height: "100%"
9098
9100
  },
9099
- day: {
9100
- width: 36,
9101
- height: 36,
9102
- lineHeight: "normal",
9103
- boxSizing: "border-box",
9104
- paddingTop: 10,
9105
- fontSize: 16
9106
- },
9107
- datepicker: {
9108
- display: "flex",
9109
- padding: [
9110
- 4,
9111
- 8,
9112
- 20,
9113
- 8
9114
- ],
9115
- width: 320,
9116
- boxSizing: "border-box"
9117
- },
9118
- btnText: {
9119
- marginLeft: "auto"
9120
- },
9101
+ day: {},
9102
+ datepicker: {},
9121
9103
  popper: {
9122
9104
  zIndex: 10,
9123
- marginLeft: function(param) {
9124
- var leftPosition = param.leftPosition;
9125
- return leftPosition;
9126
- },
9127
9105
  marginTop: function(param) {
9128
9106
  var topPosition = param.topPosition;
9129
9107
  return topPosition;
9130
9108
  },
9109
+ marginLeft: function(param) {
9110
+ var leftPosition = param.leftPosition;
9111
+ return leftPosition;
9112
+ },
9131
9113
  '&[data-placement^="bottom"]': {
9132
9114
  paddingTop: 6
9133
9115
  },
@@ -9140,7 +9122,8 @@
9140
9122
  '&[data-placement^="right"]': {
9141
9123
  paddingLeft: 6
9142
9124
  }
9143
- }
9125
+ },
9126
+ tweakDateInput: {}
9144
9127
  };
9145
9128
  function _array_like_to_array$i(arr, len) {
9146
9129
  if (len == null || len > arr.length)
@@ -9284,8 +9267,8 @@
9284
9267
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
9285
9268
  return _array_like_to_array$i(o, minLen);
9286
9269
  }
9287
- var _ReactDatepicker_default;
9288
- var Datepicker = (_ReactDatepicker_default = ReactDatepicker.default) !== null && _ReactDatepicker_default !== void 0 ? _ReactDatepicker_default : ReactDatepicker;
9270
+ var _ReactDatePicker_default;
9271
+ var DatePickerComponent = (_ReactDatePicker_default = ReactDatePicker.default) !== null && _ReactDatePicker_default !== void 0 ? _ReactDatePicker_default : ReactDatePicker;
9289
9272
  var PopperContainer = function(param) {
9290
9273
  var children = param.children;
9291
9274
  return /* @__PURE__ */ jsx(reactOverlays.Portal, {
@@ -9293,257 +9276,240 @@
9293
9276
  children
9294
9277
  });
9295
9278
  };
9296
- var DEFAULT_DATE_FORMAT$2 = "dd.MM.yyyy";
9297
- var DatePicker = function(_param) {
9298
- var data = _param.data, tweakStyles = _param.tweakStyles, selectedDate = _param.selectedDate, minDate = _param.minDate, maxDate = _param.maxDate, endDate = _param.endDate, startDate = _param.startDate, size = _param.size, isRange = _param.isRange, locale2 = _param.locale, months = _param.months, _param_calendarStartDay = _param.calendarStartDay, calendarStartDay = _param_calendarStartDay === void 0 ? 1 : _param_calendarStartDay, _param_leftPosition = _param.leftPosition, leftPosition = _param_leftPosition === void 0 ? 0 : _param_leftPosition, _param_topPosition = _param.topPosition, topPosition = _param_topPosition === void 0 ? 0 : _param_topPosition, isInline = _param.isInline, isNeedClearSelectedDate = _param.isNeedClearSelectedDate, _param_dateFormat = _param.dateFormat, dateFormat = _param_dateFormat === void 0 ? DEFAULT_DATE_FORMAT$2 : _param_dateFormat, monthsShown = _param.monthsShown, _param_placeholder = _param.placeholder, placeholder = _param_placeholder === void 0 ? "__.__.____" : _param_placeholder, shouldGiveValueOnType = _param.shouldGiveValueOnType, disabledKeyboardNavigation = _param.disabledKeyboardNavigation, shouldRenderPopperInBody = _param.shouldRenderPopperInBody, popperModifiers = _param.popperModifiers, showPreviousMonths = _param.showPreviousMonths, popperPlacement = _param.popperPlacement, onChangeDate = _param.onChangeDate, onChangeRange = _param.onChangeRange, customHeader = _param.customHeader, filterDate = _param.filterDate, inputProps = _object_without_properties$4(_param, [
9279
+ var DatePicker = /* @__PURE__ */ React.forwardRef(function(_param, ref) {
9280
+ var data = _param.data, _param_selectedDate = _param.selectedDate, selectedDate = _param_selectedDate === void 0 ? null : _param_selectedDate, minDate = _param.minDate, maxDate = _param.maxDate, _param_endDate = _param.endDate, endDate = _param_endDate === void 0 ? null : _param_endDate, _param_startDate = _param.startDate, startDate = _param_startDate === void 0 ? null : _param_startDate, locale2 = _param.locale, months = _param.months, _param_topPosition = _param.topPosition, topPosition = _param_topPosition === void 0 ? 0 : _param_topPosition, _param_leftPosition = _param.leftPosition, leftPosition = _param_leftPosition === void 0 ? 0 : _param_leftPosition, _param_calendarStartDay = _param.calendarStartDay, calendarStartDay = _param_calendarStartDay === void 0 ? 1 : _param_calendarStartDay, _param_dateFormat = _param.dateFormat, dateFormat = _param_dateFormat === void 0 ? DEFAULT_DATE_FORMAT$2 : _param_dateFormat, monthsShown = _param.monthsShown, placeholder = _param.placeholder, isRange = _param.isRange, isInline = _param.isInline, isDisabled = _param.isDisabled, isClearable = _param.isClearable, focusSelectedMonth = _param.focusSelectedMonth, disabledKeyboardNavigation = _param.disabledKeyboardNavigation, shouldRenderPopperInBody = _param.shouldRenderPopperInBody, _param_allowSameDay = _param.allowSameDay, allowSameDay = _param_allowSameDay === void 0 ? false : _param_allowSameDay, shouldCloseOnSelect = _param.shouldCloseOnSelect, showPreviousMonths = _param.showPreviousMonths, preventOpenOnFocus = _param.preventOpenOnFocus, popperModifiers = _param.popperModifiers, popperPlacement = _param.popperPlacement, todayButton = _param.todayButton, calendarContainer = _param.calendarContainer, dayClassName = _param.dayClassName, tmp = _param.customInput, CustomInput = tmp === void 0 ? DateInput : tmp, customInputRef = _param.customInputRef, renderCustomHeader = _param.renderCustomHeader, filterDate = _param.filterDate, onYearChange = _param.onYearChange, onMonthChange = _param.onMonthChange, onCalendarOpen = _param.onCalendarOpen, onCalendarClose = _param.onCalendarClose, onChangeDate = _param.onChangeDate, onChangeRange = _param.onChangeRange, onBlur = _param.onBlur, onFocus = _param.onFocus, onKeyDown = _param.onKeyDown, tweakStyles = _param.tweakStyles, inputProps = _object_without_properties$4(_param, [
9299
9281
  "data",
9300
- "tweakStyles",
9301
9282
  "selectedDate",
9302
9283
  "minDate",
9303
9284
  "maxDate",
9304
9285
  "endDate",
9305
9286
  "startDate",
9306
- "size",
9307
- "isRange",
9308
9287
  "locale",
9309
9288
  "months",
9310
- "calendarStartDay",
9311
- "leftPosition",
9312
9289
  "topPosition",
9313
- "isInline",
9314
- "isNeedClearSelectedDate",
9290
+ "leftPosition",
9291
+ "calendarStartDay",
9315
9292
  "dateFormat",
9316
9293
  "monthsShown",
9317
9294
  "placeholder",
9318
- "shouldGiveValueOnType",
9295
+ "isRange",
9296
+ "isInline",
9297
+ "isDisabled",
9298
+ "isClearable",
9299
+ "focusSelectedMonth",
9319
9300
  "disabledKeyboardNavigation",
9320
9301
  "shouldRenderPopperInBody",
9321
- "popperModifiers",
9302
+ "allowSameDay",
9303
+ "shouldCloseOnSelect",
9322
9304
  "showPreviousMonths",
9305
+ "preventOpenOnFocus",
9306
+ "popperModifiers",
9323
9307
  "popperPlacement",
9308
+ "todayButton",
9309
+ "calendarContainer",
9310
+ "dayClassName",
9311
+ "customInput",
9312
+ "customInputRef",
9313
+ "renderCustomHeader",
9314
+ "filterDate",
9315
+ "onYearChange",
9316
+ "onMonthChange",
9317
+ "onCalendarOpen",
9318
+ "onCalendarClose",
9324
9319
  "onChangeDate",
9325
9320
  "onChangeRange",
9326
- "customHeader",
9327
- "filterDate"
9321
+ "onBlur",
9322
+ "onFocus",
9323
+ "onKeyDown",
9324
+ "tweakStyles"
9328
9325
  ]);
9329
- var classes = useTheme("DatePicker", styles$r, tweakStyles, {
9326
+ var _useTheme = useTheme("DatePicker", styles$r, tweakStyles, {
9330
9327
  leftPosition,
9331
9328
  topPosition
9332
- }).classes;
9329
+ }), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
9330
+ var tweakDateInputStyles = useTweakStyles(componentStyles, tweakStyles, "tweakDateInput");
9331
+ var _useMemo = React.useMemo(function() {
9332
+ return {
9333
+ formatDate: getDateFormatter(dateFormat),
9334
+ parseDateValue: getDateValueParser(dateFormat)
9335
+ };
9336
+ }, [
9337
+ dateFormat
9338
+ ]), formatDate = _useMemo.formatDate, parseDateValue = _useMemo.parseDateValue;
9333
9339
  var _useState = _sliced_to_array$i(React.useState(false), 2), isOpen = _useState[0], setIsOpen = _useState[1];
9334
- var _useState1 = _sliced_to_array$i(React.useState(selectedDate), 2), date = _useState1[0], setDate = _useState1[1];
9335
- var _useState2 = _sliced_to_array$i(React.useState(selectedDate ? dateFns.format(selectedDate, dateFormat) : ""), 2), dateValue = _useState2[0], setDateValue = _useState2[1];
9336
- var _useState3 = _sliced_to_array$i(React.useState(startDate), 2), start2 = _useState3[0], setStart = _useState3[1];
9340
+ var _useState1 = _sliced_to_array$i(React.useState(formatDate(selectedDate)), 2), dateValue = _useState1[0], setDateValue = _useState1[1];
9341
+ var _useState2 = _sliced_to_array$i(React.useState(startDate), 2), start2 = _useState2[0], setStart = _useState2[1];
9342
+ var _useState3 = _sliced_to_array$i(React.useState(formatDate(startDate)), 2), startDateValue = _useState3[0], setStartDateValue = _useState3[1];
9337
9343
  var _useState4 = _sliced_to_array$i(React.useState(endDate), 2), end2 = _useState4[0], setEnd = _useState4[1];
9338
- var _useState5 = _sliced_to_array$i(React.useState(startDate ? dateFns.format(startDate, dateFormat) : ""), 2), startDateValue = _useState5[0], setStartDateValue = _useState5[1];
9339
- var _useState6 = _sliced_to_array$i(React.useState(endDate ? dateFns.format(endDate, dateFormat) : ""), 2), endDateValue = _useState6[0], setEndDateValue = _useState6[1];
9340
- var isDateValid = function(value) {
9341
- return dateFns.isValid(dateFns.parse(value, dateFormat, new Date()));
9344
+ var _useState5 = _sliced_to_array$i(React.useState(formatDate(endDate)), 2), endDateValue = _useState5[0], setEndDateValue = _useState5[1];
9345
+ var hasDateInputValue = isRange ? isStringNotEmpty(startDateValue) || isStringNotEmpty(endDateValue) : isStringNotEmpty(dateValue);
9346
+ var dateInputProps = _object_spread$t(_object_spread_props$n(_object_spread$t({}, inputProps), {
9347
+ isRange,
9348
+ isDisabled,
9349
+ isClearable,
9350
+ isActive: isOpen,
9351
+ iconType: isClearable && hasDateInputValue ? void 0 : "calendar",
9352
+ tweakStyles: tweakDateInputStyles
9353
+ }), isRange ? {
9354
+ startDate: startDateValue,
9355
+ endDate: endDateValue
9356
+ } : {
9357
+ date: dateValue
9358
+ });
9359
+ var handleChangeDate = function(value, event) {
9360
+ onChangeDate === null || onChangeDate === void 0 ? void 0 : onChangeDate(value, event);
9342
9361
  };
9343
- var parseStringToDate = function(value) {
9344
- return dateFns.parse(value, dateFormat, new Date());
9362
+ var isDateInRange = function(date) {
9363
+ return (isEmpty(minDate) || dateFns.isAfter(date, minDate)) && (isEmpty(maxDate) || dateFns.isBefore(date, maxDate));
9345
9364
  };
9346
- var handleDateChange = React.useCallback(function(newDate) {
9347
- if (onChangeDate) {
9348
- if (!newDate) {
9349
- onChangeDate(null, newDate);
9350
- }
9351
- if (newDate && isDateValid(newDate)) {
9352
- onChangeDate(parseStringToDate(newDate));
9353
- }
9365
+ var handleChangeRange = function(value, event) {
9366
+ if (allowSameDay || !areDatesEquals(value === null || value === void 0 ? void 0 : value[0], startDate) || !areDatesEquals(value === null || value === void 0 ? void 0 : value[1], endDate)) {
9367
+ var _value_;
9368
+ setStart((_value_ = value === null || value === void 0 ? void 0 : value[0]) !== null && _value_ !== void 0 ? _value_ : null);
9369
+ var _value_1;
9370
+ setEnd((_value_1 = value === null || value === void 0 ? void 0 : value[1]) !== null && _value_1 !== void 0 ? _value_1 : null);
9371
+ onChangeRange === null || onChangeRange === void 0 ? void 0 : onChangeRange(value, event);
9354
9372
  }
9355
- setDateValue(newDate);
9356
- }, [
9357
- onChangeDate
9358
- ]);
9359
- var handleRangeChange = React.useCallback(function(newDate) {
9360
- if (!newDate && onChangeRange) {
9361
- onChangeRange(null);
9362
- setStartDateValue("");
9363
- setEndDateValue("");
9364
- }
9365
- var newStartDate = newDate.slice(0, 10);
9366
- var newEndDate = newDate.slice(13);
9367
- setStartDateValue(newStartDate);
9368
- setEndDateValue(newEndDate);
9369
- if (newStartDate && isDateValid(newStartDate)) {
9370
- setStart(parseStringToDate(newStartDate));
9371
- }
9372
- if (newEndDate && isDateValid(newEndDate)) {
9373
- setEnd(parseStringToDate(newEndDate));
9374
- }
9375
- if (newStartDate && newEndDate && isDateValid(newStartDate) && isDateValid(newEndDate) && onChangeRange) {
9376
- onChangeRange([
9377
- parseStringToDate(newStartDate),
9378
- parseStringToDate(newEndDate)
9373
+ };
9374
+ var handleChangeDateRangeInput = function(value) {
9375
+ var newStartDateValue = value.slice(0, 10);
9376
+ var newStart = parseDateValue(newStartDateValue);
9377
+ var newEndDateValue = value.slice(13);
9378
+ var newEnd = parseDateValue(newEndDateValue);
9379
+ if (isNotEmpty(newStart) && !dateFns.isValid(newStart) || isNotEmpty(newStart) && !isDateInRange(newStart)) {
9380
+ newStart = start2;
9381
+ }
9382
+ if (isNotEmpty(newEnd) && !dateFns.isValid(newEnd) || isNotEmpty(newEnd) && !isDateInRange(newEnd)) {
9383
+ newEnd = end2;
9384
+ }
9385
+ if (isEmpty(newStart) && dateFns.isValid(newEnd) || // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
9386
+ dateFns.isValid(newStart) && dateFns.isValid(newEnd) && dateFns.isAfter(newStart, newEnd)) {
9387
+ newStart = newEnd;
9388
+ newEnd = null;
9389
+ }
9390
+ setStartDateValue(newStartDateValue);
9391
+ setStart(newStart);
9392
+ setEndDateValue(newEndDateValue);
9393
+ setEnd(newEnd);
9394
+ };
9395
+ var handleDateInputBlur = function(event) {
9396
+ onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
9397
+ setDateValue(formatDate(selectedDate));
9398
+ };
9399
+ var setDateRangeValues = function() {
9400
+ var startValue = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null, endValue = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;
9401
+ var convertedStartDate = formatDate(startValue);
9402
+ var convertedEndDate = formatDate(endValue);
9403
+ if (convertedStartDate === "" && convertedEndDate !== "") {
9404
+ convertedStartDate = EMPTY_DATE_INPUT_VALUE;
9405
+ }
9406
+ setStart(startValue);
9407
+ setStartDateValue(convertedStartDate);
9408
+ setEnd(endValue);
9409
+ setEndDateValue(convertedEndDate);
9410
+ };
9411
+ var handleDateRangeInputBlur = function(event) {
9412
+ onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
9413
+ handleChangeRange([
9414
+ start2,
9415
+ end2
9416
+ ], event);
9417
+ setDateRangeValues(start2, end2);
9418
+ };
9419
+ var handleOpenCalendar = function() {
9420
+ setIsOpen(true);
9421
+ onCalendarOpen === null || onCalendarOpen === void 0 ? void 0 : onCalendarOpen();
9422
+ };
9423
+ var handleCloseCalendar = function() {
9424
+ setIsOpen(false);
9425
+ if (isRange) {
9426
+ handleChangeRange([
9427
+ start2,
9428
+ end2
9379
9429
  ]);
9430
+ setDateRangeValues(start2, end2);
9431
+ } else {
9432
+ setDateValue(formatDate(selectedDate));
9380
9433
  }
9381
- }, [
9382
- onChangeRange
9383
- ]);
9384
- React.useEffect(function() {
9385
- setDateValue("");
9386
- }, [
9387
- isNeedClearSelectedDate
9388
- ]);
9434
+ onCalendarClose === null || onCalendarClose === void 0 ? void 0 : onCalendarClose();
9435
+ };
9389
9436
  React.useEffect(function() {
9390
- setDate(selectedDate);
9391
- setStart(startDate);
9392
- setEnd(endDate);
9393
- setStartDateValue(startDate ? dateFns.format(startDate, dateFormat) : "");
9394
- setEndDateValue(endDate ? dateFns.format(endDate, dateFormat) : "");
9395
- setDateValue(selectedDate ? dateFns.format(selectedDate, dateFormat) : "");
9437
+ setDateValue(formatDate(selectedDate));
9438
+ setDateRangeValues(startDate, endDate);
9396
9439
  }, [
9397
9440
  selectedDate,
9398
9441
  startDate,
9399
9442
  endDate
9400
9443
  ]);
9401
- var onTabConfirm = function(event) {
9402
- if (event.key === "9") {
9403
- setIsOpen(false);
9404
- }
9405
- };
9406
- React.useEffect(function() {
9407
- document.addEventListener("keydown", onTabConfirm);
9408
- return function() {
9409
- return document.removeEventListener("keydown", onTabConfirm);
9410
- };
9411
- }, []);
9412
- var handleBlur = function(e) {
9413
- if (inputProps.onBlur) {
9414
- inputProps.onBlur(e);
9415
- }
9416
- if (shouldGiveValueOnType && onChangeDate && !isDateValid(dateValue)) {
9417
- onChangeDate(null, dateValue);
9418
- return;
9419
- }
9420
- if (onChangeDate && date) {
9421
- if (!isDateValid(dateValue)) {
9422
- onChangeDate(null);
9423
- setDateValue("");
9424
- } else if (maxDate && dateFns.isAfter(date, maxDate)) {
9425
- onChangeDate(maxDate);
9426
- } else if (minDate && dateFns.isAfter(minDate, date)) {
9427
- onChangeDate(minDate);
9428
- }
9429
- }
9430
- };
9431
- var handleRangeBlur = function(e) {
9432
- if (inputProps.onBlur) {
9433
- inputProps.onBlur(e);
9434
- }
9435
- if (onChangeRange && start2 && end2) {
9436
- if (!isDateValid(startDateValue) && endDateValue) {
9437
- setStartDateValue(placeholder);
9438
- }
9439
- if (!isDateValid(endDateValue)) {
9440
- setEndDateValue("");
9441
- } else if (maxDate && dateFns.isAfter(start2, maxDate)) {
9442
- onChangeRange([
9443
- maxDate,
9444
- end2
9445
- ]);
9446
- } else if (minDate && dateFns.isAfter(minDate, end2)) {
9447
- onChangeRange([
9448
- start2,
9449
- start2
9450
- ]);
9451
- }
9452
- }
9453
- };
9454
- var datePickerProps = {
9455
- dateFormat,
9456
- calendarStartDay,
9457
- locale: locale2,
9458
- popperModifiers,
9459
- popperPlacement,
9460
- monthsShown,
9461
- showPreviousMonths,
9462
- disabledKeyboardNavigation,
9463
- inline: isInline,
9464
- disabled: inputProps.isDisabled,
9465
- showPopperArrow: false,
9466
- popperClassName: classes.popper,
9467
- calendarClassName: classes.datepicker,
9468
- popperContainer: shouldRenderPopperInBody ? PopperContainer : void 0,
9469
- selectsRange: isRange,
9470
- onChange: function() {
9471
- return null;
9472
- },
9473
- dayClassName: function() {
9474
- return classes.day;
9475
- },
9476
- filterDate
9477
- };
9478
- var dateInputProps = _object_spread_props$n(_object_spread$t({}, inputProps), {
9479
- tweakStyles,
9480
- iconType: inputProps.isClearable && dateValue !== "" ? void 0 : "calendar",
9481
- isRange,
9482
- // eslint-disable-next-line @typescript-eslint/no-empty-function
9483
- onChange: function() {
9484
- }
9485
- });
9486
- if (onChangeRange) {
9487
- datePickerProps = _object_spread_props$n(_object_spread$t({}, datePickerProps), {
9488
- startDate: start2,
9489
- endDate: end2,
9490
- selectsRange: true,
9491
- selected: startDate,
9492
- onChange: onChangeRange
9493
- });
9494
- dateInputProps = _object_spread_props$n(_object_spread$t({}, dateInputProps), {
9495
- startDate: startDateValue,
9496
- endDate: endDateValue,
9497
- onBlur: handleRangeBlur,
9498
- onChange: handleRangeChange
9499
- });
9500
- }
9501
- if (onChangeDate) {
9502
- datePickerProps = _object_spread_props$n(_object_spread$t({}, datePickerProps), {
9503
- selected: date,
9504
- onChange: function(newDate) {
9505
- return onChangeDate(newDate);
9506
- },
9507
- onCalendarOpen: function() {
9508
- return setIsOpen(true);
9509
- },
9510
- onCalendarClose: function() {
9511
- return setIsOpen(false);
9512
- },
9513
- minDate,
9514
- maxDate
9515
- });
9516
- dateInputProps = _object_spread_props$n(_object_spread$t({}, dateInputProps), {
9517
- date: dateValue,
9518
- isActive: isOpen,
9519
- onBlur: handleBlur,
9520
- onChange: handleDateChange
9521
- });
9522
- }
9523
9444
  return /* @__PURE__ */ jsx("div", _object_spread_props$n(_object_spread$t({
9524
9445
  className: classes.root
9525
9446
  }, addDataAttributes(data)), {
9526
- children: /* @__PURE__ */ jsx(Datepicker, _object_spread_props$n(_object_spread$t({}, datePickerProps), {
9527
- customInput: /* @__PURE__ */ jsx(DatePickerInput, {
9528
- size,
9529
- children: /* @__PURE__ */ jsx(DateInput, _object_spread$t({}, dateInputProps))
9530
- }),
9531
- renderCustomHeader: customHeader !== void 0 ? customHeader : function(param) {
9532
- var renderDate = param.date, changeYear = param.changeYear, changeMonth = param.changeMonth, decreaseMonth = param.decreaseMonth, increaseMonth = param.increaseMonth, prevMonthButtonDisabled = param.prevMonthButtonDisabled, nextMonthButtonDisabled = param.nextMonthButtonDisabled;
9533
- return /* @__PURE__ */ jsx(DatePickerHeader, {
9534
- date: renderDate,
9535
- changeMonth,
9536
- changeYear,
9537
- decreaseMonth,
9538
- increaseMonth,
9539
- isPrevMonthButtonDisabled: prevMonthButtonDisabled,
9540
- isNextMonthButtonDisabled: nextMonthButtonDisabled,
9447
+ children: /* @__PURE__ */ jsx(DatePickerComponent, _object_spread$t({
9448
+ ref,
9449
+ minDate,
9450
+ maxDate,
9451
+ locale: locale2,
9452
+ dateFormat,
9453
+ placeholderText: placeholder,
9454
+ calendarStartDay,
9455
+ inline: isInline,
9456
+ disabled: isDisabled,
9457
+ showPreviousMonths,
9458
+ focusSelectedMonth,
9459
+ monthsShown,
9460
+ allowSameDay,
9461
+ showPopperArrow: false,
9462
+ popperClassName: classes.popper,
9463
+ calendarClassName: classes.datepicker,
9464
+ dayClassName: function(v) {
9465
+ return clsx(classes.day, dayClassName === null || dayClassName === void 0 ? void 0 : dayClassName(v));
9466
+ },
9467
+ disabledKeyboardNavigation,
9468
+ popperContainer: shouldRenderPopperInBody ? PopperContainer : void 0,
9469
+ popperModifiers,
9470
+ popperPlacement,
9471
+ selectsRange: isRange,
9472
+ preventOpenOnFocus,
9473
+ shouldCloseOnSelect,
9474
+ customInputRef,
9475
+ customInput: /* @__PURE__ */ jsx(CustomInput, _object_spread$t({}, dateInputProps)),
9476
+ renderCustomHeader: renderCustomHeader !== null && renderCustomHeader !== void 0 ? renderCustomHeader : function(baseProps) {
9477
+ return /* @__PURE__ */ jsx(DatePickerHeader, _object_spread_props$n(_object_spread$t({}, baseProps), {
9541
9478
  months
9542
- });
9479
+ }));
9480
+ },
9481
+ todayButton,
9482
+ calendarContainer,
9483
+ filterDate,
9484
+ onYearChange,
9485
+ onMonthChange,
9486
+ onFocus,
9487
+ onKeyDown,
9488
+ onCalendarOpen: handleOpenCalendar,
9489
+ onCalendarClose: handleCloseCalendar,
9490
+ onChangeRaw: function(_, value) {
9491
+ if (value === void 0) {
9492
+ return;
9493
+ }
9494
+ if (isRange) {
9495
+ handleChangeDateRangeInput(value);
9496
+ } else {
9497
+ setDateValue(value);
9498
+ }
9543
9499
  }
9500
+ }, isRange ? {
9501
+ startDate: start2,
9502
+ endDate: end2,
9503
+ selected: start2,
9504
+ onBlur: handleDateRangeInputBlur,
9505
+ onChange: handleChangeRange
9506
+ } : {
9507
+ selected: selectedDate,
9508
+ onBlur: handleDateInputBlur,
9509
+ onChange: handleChangeDate
9544
9510
  }))
9545
9511
  }));
9546
- };
9512
+ });
9547
9513
  var styles$q = {
9548
9514
  root: {},
9549
9515
  button: {
@@ -13972,26 +13938,24 @@
13972
13938
  localeKey,
13973
13939
  locale2
13974
13940
  ]);
13975
- var _useState2 = _sliced_to_array$c(React.useState(false), 2), isNeedClearSelectedDate = _useState2[0], setNeedClearSelectedDate = _useState2[1];
13976
13941
  var topPosition = !isClearable && onStartBtnSubmit === void 0 ? 28 : 60;
13977
13942
  var handleClear = function() {
13978
13943
  onEndBtnSubmit();
13979
- setNeedClearSelectedDate(!isNeedClearSelectedDate);
13980
13944
  };
13981
13945
  var ref = React.useRef(null);
13982
13946
  var isOpenCalendar = isOpenFrom || isOpenTo;
13983
13947
  var handleFromSelected = function(val) {
13984
- var _value_to2;
13948
+ var _value_to;
13985
13949
  onChange({
13986
13950
  from: val,
13987
- to: (_value_to2 = value === null || value === void 0 ? void 0 : value.to) !== null && _value_to2 !== void 0 ? _value_to2 : null
13951
+ to: (_value_to = value === null || value === void 0 ? void 0 : value.to) !== null && _value_to !== void 0 ? _value_to : null
13988
13952
  });
13989
13953
  setOpenFrom(false);
13990
13954
  };
13991
13955
  var handleToSelected = function(val) {
13992
- var _value_from2;
13956
+ var _value_from;
13993
13957
  onChange({
13994
- from: (_value_from2 = value === null || value === void 0 ? void 0 : value.from) !== null && _value_from2 !== void 0 ? _value_from2 : null,
13958
+ from: (_value_from = value === null || value === void 0 ? void 0 : value.from) !== null && _value_from !== void 0 ? _value_from : null,
13995
13959
  to: val
13996
13960
  });
13997
13961
  setOpenTo(false);
@@ -14003,10 +13967,10 @@
14003
13967
  to: val
14004
13968
  });
14005
13969
  } else {
14006
- var _value_to2;
13970
+ var _value_to;
14007
13971
  onChange({
14008
13972
  from: val,
14009
- to: (_value_to2 = value === null || value === void 0 ? void 0 : value.to) !== null && _value_to2 !== void 0 ? _value_to2 : null
13973
+ to: (_value_to = value === null || value === void 0 ? void 0 : value.to) !== null && _value_to !== void 0 ? _value_to : null
14010
13974
  });
14011
13975
  }
14012
13976
  };
@@ -14017,16 +13981,16 @@
14017
13981
  to: value.from
14018
13982
  });
14019
13983
  } else {
14020
- var _value_from2;
13984
+ var _value_from;
14021
13985
  onChange({
14022
- from: (_value_from2 = value === null || value === void 0 ? void 0 : value.from) !== null && _value_from2 !== void 0 ? _value_from2 : null,
13986
+ from: (_value_from = value === null || value === void 0 ? void 0 : value.from) !== null && _value_from !== void 0 ? _value_from : null,
14023
13987
  to: val
14024
13988
  });
14025
13989
  }
14026
13990
  };
14027
13991
  var tweakClearButtonStyles = useTweakStyles(componentStyles, tweakStyles, "tweakClearButton");
14028
13992
  var tweakBackButtonStyles = useTweakStyles(componentStyles, tweakStyles, "tweakBackButton");
14029
- var _value_from, _value_to, _ref;
13993
+ var _ref;
14030
13994
  return /* @__PURE__ */ jsxs("div", _object_spread_props$h(_object_spread$j({
14031
13995
  className: classes.root
14032
13996
  }, addDataAttributes(data)), {
@@ -14037,7 +14001,7 @@
14037
14001
  /* @__PURE__ */ jsx("div", {
14038
14002
  className: classes.containerItem,
14039
14003
  children: /* @__PURE__ */ jsx(DatePicker, _object_spread$j({
14040
- selectedDate: (_value_from = value === null || value === void 0 ? void 0 : value.from) !== null && _value_from !== void 0 ? _value_from : null,
14004
+ selectedDate: value === null || value === void 0 ? void 0 : value.from,
14041
14005
  maxDate: value === null || value === void 0 ? void 0 : value.to,
14042
14006
  label: translates.from,
14043
14007
  months: translates.months,
@@ -14045,16 +14009,15 @@
14045
14009
  onChangeDate: handleChangeFrom,
14046
14010
  leftPosition: -20,
14047
14011
  topPosition,
14048
- isNeedClearSelectedDate,
14049
14012
  border: "bottom",
14050
- testId: testId !== void 0 ? "".concat(testId, "-from") : void 0,
14013
+ testId: getTestId(testId, "from"),
14051
14014
  isClearable
14052
14015
  }, startPickerProps))
14053
14016
  }),
14054
14017
  /* @__PURE__ */ jsx("div", {
14055
14018
  className: classes.containerItem,
14056
14019
  children: /* @__PURE__ */ jsx(DatePicker, _object_spread$j({
14057
- selectedDate: (_value_to = value === null || value === void 0 ? void 0 : value.to) !== null && _value_to !== void 0 ? _value_to : null,
14020
+ selectedDate: value === null || value === void 0 ? void 0 : value.to,
14058
14021
  label: translates.to,
14059
14022
  months: translates.months,
14060
14023
  minDate: value === null || value === void 0 ? void 0 : value.from,
@@ -14062,9 +14025,8 @@
14062
14025
  onChangeDate: handleChangeTo,
14063
14026
  topPosition,
14064
14027
  leftPosition: -170,
14065
- isNeedClearSelectedDate,
14066
14028
  border: "bottom",
14067
- testId: testId !== void 0 ? "".concat(testId, "-to") : void 0,
14029
+ testId: getTestId(testId, "to"),
14068
14030
  isClearable
14069
14031
  }, endPickerProps))
14070
14032
  })
@@ -14078,7 +14040,7 @@
14078
14040
  onClick: handleClear,
14079
14041
  size: "s",
14080
14042
  view: "text",
14081
- testId: testId !== void 0 ? "".concat(testId, "-clear-button") : void 0,
14043
+ testId: getTestId(testId, "clear-button"),
14082
14044
  isFullWidth: true,
14083
14045
  tweakStyles: tweakClearButtonStyles,
14084
14046
  children: translates.clear
@@ -28047,6 +28009,8 @@
28047
28009
  exports2.DateInput = DateInput;
28048
28010
  exports2.DatePicker = DatePicker;
28049
28011
  exports2.Description = Description;
28012
+ exports2.EMPTY_DATE_INPUT_VALUE = EMPTY_DATE_INPUT_VALUE;
28013
+ exports2.EMPTY_DATE_RANGE_INPUT_VALUE = EMPTY_DATE_RANGE_INPUT_VALUE;
28050
28014
  exports2.FilterInterval = FilterInterval;
28051
28015
  exports2.FilterLocales = FilterLocales;
28052
28016
  exports2.FilterMultiSelect = FilterMultiSelect;
@@ -28111,6 +28075,7 @@
28111
28075
  exports2.hasExactParent = hasExactParent;
28112
28076
  exports2.isElementOffScreen = isElementOffScreen;
28113
28077
  exports2.isElementOneOfParents = isElementOneOfParents;
28078
+ exports2.isEmpty = isEmpty;
28114
28079
  exports2.isInt = isInt;
28115
28080
  exports2.isNotEmpty = isNotEmpty;
28116
28081
  exports2.isSpaceChar = isSpaceChar;