@true-engineering/true-react-common-ui-kit 1.12.1 → 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 (265) hide show
  1. package/LICENSE +201 -201
  2. package/dist/components/DateInput/DateInput.d.ts +8 -8
  3. package/dist/components/DateInput/DateInput.styles.d.ts +2 -2
  4. package/dist/components/DateInput/constants.d.ts +2 -0
  5. package/dist/components/DateInput/index.d.ts +1 -0
  6. package/dist/components/DatePicker/DatePicker.d.ts +16 -24
  7. package/dist/components/DatePicker/DatePicker.styles.d.ts +12 -24
  8. package/dist/components/DatePicker/DatePickerHeader/DatePickerHeader.d.ts +3 -9
  9. package/dist/components/DatePicker/DatePickerHeader/index.d.ts +1 -0
  10. package/dist/components/DatePicker/constants.d.ts +1 -0
  11. package/dist/components/DatePicker/helpers.d.ts +3 -0
  12. package/dist/components/DatePicker/index.d.ts +1 -2
  13. package/dist/components/DatePicker/types.d.ts +4 -0
  14. package/dist/components/FiltersPane/FilterWithDates/FilterWithDates.d.ts +1 -1
  15. package/dist/components/Flag/augment.d.ts +1 -1
  16. package/dist/components/Icon/complexIcons/augment.d.ts +1 -1
  17. package/dist/helpers/utils.d.ts +2 -1
  18. package/dist/style.css +125 -50
  19. package/dist/true-react-common-ui-kit.js +389 -425
  20. package/dist/true-react-common-ui-kit.js.map +1 -1
  21. package/dist/true-react-common-ui-kit.umd.cjs +389 -425
  22. package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
  23. package/dist/types.d.ts +1 -1
  24. package/dist/vite-env.d.ts +1 -1
  25. package/package.json +91 -91
  26. package/src/components/AccountInfo/AccountInfo.stories.tsx +35 -35
  27. package/src/components/AccountInfo/AccountInfo.styles.ts +55 -55
  28. package/src/components/AccountInfo/AccountInfo.tsx +106 -106
  29. package/src/components/AccountInfo/index.ts +2 -2
  30. package/src/components/AddButton/AddButton.stories.tsx +21 -21
  31. package/src/components/AddButton/AddButton.styles.ts +34 -34
  32. package/src/components/AddButton/AddButton.tsx +49 -49
  33. package/src/components/AddButton/index.ts +2 -2
  34. package/src/components/Button/Button.stories.tsx +61 -61
  35. package/src/components/Button/Button.styles.ts +196 -196
  36. package/src/components/Button/Button.tsx +207 -207
  37. package/src/components/Button/index.ts +2 -2
  38. package/src/components/Checkbox/Checkbox.stories.tsx +35 -35
  39. package/src/components/Checkbox/Checkbox.styles.ts +62 -62
  40. package/src/components/Checkbox/Checkbox.tsx +106 -106
  41. package/src/components/Checkbox/index.ts +2 -2
  42. package/src/components/CloseButton/CloseButton.styles.ts +34 -34
  43. package/src/components/CloseButton/CloseButton.tsx +37 -37
  44. package/src/components/CloseButton/index.ts +2 -2
  45. package/src/components/Colors/Colors.stories.tsx +7 -7
  46. package/src/components/Colors/Colors.styles.ts +38 -38
  47. package/src/components/Colors/Colors.tsx +34 -34
  48. package/src/components/Colors/index.ts +2 -2
  49. package/src/components/CssBaseline/CssBaseline.styles.ts +15 -15
  50. package/src/components/CssBaseline/CssBaseline.tsx +17 -17
  51. package/src/components/CssBaseline/index.ts +2 -2
  52. package/src/components/DateInput/DateInput.stories.tsx +67 -63
  53. package/src/components/DateInput/DateInput.styles.ts +14 -14
  54. package/src/components/DateInput/DateInput.tsx +101 -60
  55. package/src/components/DateInput/constants.ts +2 -0
  56. package/src/components/DateInput/index.ts +3 -2
  57. package/src/components/DatePicker/DatePicker.stories.tsx +90 -96
  58. package/src/components/DatePicker/DatePicker.styles.ts +44 -54
  59. package/src/components/DatePicker/DatePicker.tsx +354 -358
  60. package/src/components/DatePicker/DatePickerHeader/DatePickerHeader.styles.ts +84 -84
  61. package/src/components/DatePicker/DatePickerHeader/DatePickerHeader.tsx +80 -94
  62. package/src/components/DatePicker/DatePickerHeader/index.ts +2 -1
  63. package/src/components/DatePicker/constants.ts +1 -0
  64. package/src/components/DatePicker/helpers.ts +24 -0
  65. package/src/components/DatePicker/index.ts +3 -4
  66. package/src/components/DatePicker/types.ts +40 -0
  67. package/src/components/Description/Description.stories.tsx +29 -29
  68. package/src/components/Description/Description.styles.ts +31 -31
  69. package/src/components/Description/Description.tsx +69 -69
  70. package/src/components/Description/index.ts +2 -2
  71. package/src/components/FiltersPane/FilterInterval/FilterInterval.styles.ts +64 -64
  72. package/src/components/FiltersPane/FilterInterval/FilterInterval.tsx +162 -162
  73. package/src/components/FiltersPane/FilterInterval/index.ts +1 -1
  74. package/src/components/FiltersPane/FilterMultiSelect/FilterMultiSelect.tsx +14 -14
  75. package/src/components/FiltersPane/FilterMultiSelect/index.ts +1 -1
  76. package/src/components/FiltersPane/FilterSelect/FilterSelect.styles.ts +144 -144
  77. package/src/components/FiltersPane/FilterSelect/FilterSelect.tsx +397 -397
  78. package/src/components/FiltersPane/FilterSelect/index.ts +1 -1
  79. package/src/components/FiltersPane/FilterSelect/locales.ts +37 -37
  80. package/src/components/FiltersPane/FilterValueView/FilterValueView.styles.tsx +15 -15
  81. package/src/components/FiltersPane/FilterValueView/FilterValueView.tsx +186 -186
  82. package/src/components/FiltersPane/FilterValueView/index.tsx +1 -1
  83. package/src/components/FiltersPane/FilterWithDates/FilterWithDates.styles.ts +60 -60
  84. package/src/components/FiltersPane/FilterWithDates/FilterWithDates.tsx +210 -222
  85. package/src/components/FiltersPane/FilterWithDates/index.ts +1 -1
  86. package/src/components/FiltersPane/FilterWithPeriod/FilterWithPeriod.styles.ts +17 -17
  87. package/src/components/FiltersPane/FilterWithPeriod/FilterWithPeriod.tsx +231 -231
  88. package/src/components/FiltersPane/FilterWithPeriod/index.ts +1 -1
  89. package/src/components/FiltersPane/FilterWrapper/FilterWrapper.styles.ts +110 -110
  90. package/src/components/FiltersPane/FilterWrapper/FilterWrapper.tsx +360 -360
  91. package/src/components/FiltersPane/FilterWrapper/index.ts +1 -1
  92. package/src/components/FiltersPane/FiltersPane.stories.tsx +308 -308
  93. package/src/components/FiltersPane/FiltersPane.styles.ts +71 -71
  94. package/src/components/FiltersPane/FiltersPane.tsx +193 -193
  95. package/src/components/FiltersPane/FiltersPaneSearch/FiltersPaneSearch.styles.ts +109 -109
  96. package/src/components/FiltersPane/FiltersPaneSearch/FiltersPaneSearch.tsx +175 -175
  97. package/src/components/FiltersPane/FiltersPaneSearch/index.ts +1 -1
  98. package/src/components/FiltersPane/index.ts +20 -20
  99. package/src/components/FiltersPane/locales.ts +107 -107
  100. package/src/components/FiltersPane/types.ts +126 -126
  101. package/src/components/Flag/Flag.stories.tsx +29 -29
  102. package/src/components/Flag/Flag.styles.ts +18 -18
  103. package/src/components/Flag/Flag.tsx +28 -28
  104. package/src/components/Flag/augment.d.ts +1 -1
  105. package/src/components/Flag/index.ts +2 -2
  106. package/src/components/FlexibleTable/FlexibleTable.stories.tsx +86 -86
  107. package/src/components/FlexibleTable/FlexibleTable.styles.ts +131 -131
  108. package/src/components/FlexibleTable/FlexibleTable.tsx +243 -243
  109. package/src/components/FlexibleTable/TableRow.tsx +171 -171
  110. package/src/components/FlexibleTable/TableValue.tsx +81 -81
  111. package/src/components/FlexibleTable/fixture-test.ts +254 -254
  112. package/src/components/FlexibleTable/index.ts +3 -3
  113. package/src/components/FlexibleTable/types.ts +58 -58
  114. package/src/components/Icon/ComplexIconBoilerplate.tsx +17 -17
  115. package/src/components/Icon/Icon.stories.tsx +88 -88
  116. package/src/components/Icon/Icon.styles.ts +10 -10
  117. package/src/components/Icon/Icon.tsx +34 -34
  118. package/src/components/Icon/IconBoilerplate.tsx +42 -42
  119. package/src/components/Icon/complexIcons/augment.d.ts +1 -1
  120. package/src/components/Icon/complexIcons/avatarGreen.svg +57 -57
  121. package/src/components/Icon/complexIcons/icons.ts +7 -7
  122. package/src/components/Icon/complexIcons/index.ts +1 -1
  123. package/src/components/Icon/icons/icons.ts +838 -838
  124. package/src/components/Icon/icons/index.ts +1 -1
  125. package/src/components/Icon/index.ts +4 -4
  126. package/src/components/IncrementInput/ChangeButton.tsx +34 -34
  127. package/src/components/IncrementInput/IncrementInput.stories.tsx +34 -34
  128. package/src/components/IncrementInput/IncrementInput.styles.ts +77 -77
  129. package/src/components/IncrementInput/IncrementInput.tsx +95 -95
  130. package/src/components/IncrementInput/index.ts +2 -2
  131. package/src/components/Input/Input.stories.tsx +92 -92
  132. package/src/components/Input/Input.styles.ts +307 -307
  133. package/src/components/Input/Input.tsx +321 -321
  134. package/src/components/Input/index.ts +2 -2
  135. package/src/components/List/List.stories.tsx +62 -62
  136. package/src/components/List/List.styles.ts +52 -52
  137. package/src/components/List/List.tsx +82 -82
  138. package/src/components/List/index.ts +2 -2
  139. package/src/components/Modal/Modal.stories.tsx +113 -113
  140. package/src/components/Modal/Modal.styles.ts +308 -308
  141. package/src/components/Modal/Modal.tsx +210 -210
  142. package/src/components/Modal/index.ts +2 -2
  143. package/src/components/MoreMenu/MoreMenu.stories.tsx +46 -46
  144. package/src/components/MoreMenu/MoreMenu.styles.ts +70 -70
  145. package/src/components/MoreMenu/MoreMenu.tsx +102 -102
  146. package/src/components/MoreMenu/index.ts +2 -2
  147. package/src/components/MultiSelect/MultiSelect.stories.tsx +46 -46
  148. package/src/components/MultiSelect/MultiSelect.styles.ts +55 -55
  149. package/src/components/MultiSelect/MultiSelect.tsx +98 -98
  150. package/src/components/MultiSelect/MultiSelectInput/MultiSelectInput.styles.ts +73 -73
  151. package/src/components/MultiSelect/MultiSelectInput/MultiSelectInput.tsx +62 -62
  152. package/src/components/MultiSelect/MultiSelectInput/index.ts +1 -1
  153. package/src/components/MultiSelect/index.ts +3 -3
  154. package/src/components/MultiSelectList/MultiSelectList.styles.ts +125 -125
  155. package/src/components/MultiSelectList/MultiSelectList.tsx +519 -519
  156. package/src/components/MultiSelectList/index.ts +2 -2
  157. package/src/components/MultiSelectList/locales.ts +37 -37
  158. package/src/components/Notification/Notification.stories.tsx +51 -51
  159. package/src/components/Notification/Notification.styles.ts +50 -50
  160. package/src/components/Notification/Notification.tsx +84 -84
  161. package/src/components/Notification/index.ts +2 -2
  162. package/src/components/NumberInput/NumberInput.stories.tsx +36 -36
  163. package/src/components/NumberInput/NumberInput.tsx +154 -154
  164. package/src/components/NumberInput/helpers.ts +87 -87
  165. package/src/components/NumberInput/index.ts +1 -1
  166. package/src/components/PhoneInput/PhoneInput.stories.tsx +71 -71
  167. package/src/components/PhoneInput/PhoneInput.styles.ts +84 -84
  168. package/src/components/PhoneInput/PhoneInput.tsx +223 -223
  169. package/src/components/PhoneInput/PhoneInputCountryList/PhoneInputCountryList.stories.tsx +21 -21
  170. package/src/components/PhoneInput/PhoneInputCountryList/PhoneInputCountryList.styles.ts +100 -100
  171. package/src/components/PhoneInput/PhoneInputCountryList/PhoneInputCountryList.tsx +171 -171
  172. package/src/components/PhoneInput/PhoneInputCountryList/index.ts +2 -2
  173. package/src/components/PhoneInput/index.ts +6 -6
  174. package/src/components/PhoneInput/phone-info.ts +2167 -2167
  175. package/src/components/PhoneInput/types.ts +16 -16
  176. package/src/components/RadioButton/RadioButton.stories.tsx +46 -46
  177. package/src/components/RadioButton/RadioButton.styles.ts +37 -37
  178. package/src/components/RadioButton/RadioButton.tsx +56 -56
  179. package/src/components/RadioButton/index.ts +2 -2
  180. package/src/components/ScrollIntoViewIfNeeded/ScrollIntoViewIfNeeded.ts +66 -66
  181. package/src/components/ScrollIntoViewIfNeeded/index.ts +1 -1
  182. package/src/components/SearchInput/SearchInput.stories.tsx +24 -24
  183. package/src/components/SearchInput/SearchInput.styles.ts +50 -50
  184. package/src/components/SearchInput/SearchInput.tsx +63 -63
  185. package/src/components/SearchInput/index.ts +2 -2
  186. package/src/components/Select/MultiSelect.stories.tsx +263 -263
  187. package/src/components/Select/Select.stories.tsx +258 -258
  188. package/src/components/Select/Select.styles.ts +96 -96
  189. package/src/components/Select/Select.tsx +630 -630
  190. package/src/components/Select/SelectList/SelectList.styles.ts +72 -72
  191. package/src/components/Select/SelectList/SelectList.tsx +165 -165
  192. package/src/components/Select/SelectList/index.ts +1 -1
  193. package/src/components/Select/SelectListItem/SelectListItem.styles.ts +14 -14
  194. package/src/components/Select/SelectListItem/SelectListItem.tsx +73 -73
  195. package/src/components/Select/constants.ts +2 -2
  196. package/src/components/Select/helpers.ts +29 -29
  197. package/src/components/Select/index.ts +4 -4
  198. package/src/components/Select/types.ts +1 -1
  199. package/src/components/SmartInput/SmartInput.stories.tsx +63 -63
  200. package/src/components/SmartInput/SmartInput.tsx +180 -180
  201. package/src/components/SmartInput/helpers.ts +85 -85
  202. package/src/components/SmartInput/index.ts +1 -1
  203. package/src/components/Switch/Switch.stories.tsx +40 -40
  204. package/src/components/Switch/Switch.styles.ts +75 -75
  205. package/src/components/Switch/Switch.tsx +89 -89
  206. package/src/components/Switch/index.ts +2 -2
  207. package/src/components/TextArea/TextArea.stories.tsx +35 -35
  208. package/src/components/TextArea/TextArea.styles.ts +153 -153
  209. package/src/components/TextArea/TextArea.tsx +178 -178
  210. package/src/components/TextArea/index.ts +2 -2
  211. package/src/components/TextWithInfo/TextWithInfo.stories.tsx +53 -53
  212. package/src/components/TextWithInfo/TextWithInfo.styles.ts +60 -60
  213. package/src/components/TextWithInfo/TextWithInfo.tsx +67 -67
  214. package/src/components/TextWithInfo/index.ts +2 -2
  215. package/src/components/TextWithTooltip/TextWithTooltip.stories.tsx +58 -58
  216. package/src/components/TextWithTooltip/TextWithTooltip.styles.ts +19 -19
  217. package/src/components/TextWithTooltip/TextWithTooltip.tsx +163 -163
  218. package/src/components/TextWithTooltip/index.ts +2 -2
  219. package/src/components/ThemedPreloader/ThemedPreloader.stories.tsx +41 -41
  220. package/src/components/ThemedPreloader/ThemedPreloader.styles.ts +21 -21
  221. package/src/components/ThemedPreloader/ThemedPreloader.tsx +56 -56
  222. package/src/components/ThemedPreloader/components/DefaultPreloader/DefaultPreloader.tsx +34 -34
  223. package/src/components/ThemedPreloader/components/DefaultPreloader/index.ts +1 -1
  224. package/src/components/ThemedPreloader/components/DotsPreloader/DotsPreloader.styles.ts +54 -54
  225. package/src/components/ThemedPreloader/components/DotsPreloader/DotsPreloader.tsx +18 -18
  226. package/src/components/ThemedPreloader/components/DotsPreloader/index.ts +2 -2
  227. package/src/components/ThemedPreloader/components/SvgPreloader/SvgPreloader.styles.ts +11 -11
  228. package/src/components/ThemedPreloader/components/SvgPreloader/SvgPreloader.tsx +32 -32
  229. package/src/components/ThemedPreloader/components/SvgPreloader/index.ts +2 -2
  230. package/src/components/ThemedPreloader/components/index.ts +2 -2
  231. package/src/components/ThemedPreloader/index.ts +2 -2
  232. package/src/components/Toaster/Toaster.stories.tsx +34 -34
  233. package/src/components/Toaster/Toaster.styles.ts +59 -59
  234. package/src/components/Toaster/Toaster.tsx +113 -113
  235. package/src/components/Toaster/index.ts +2 -2
  236. package/src/components/Tooltip/Tooltip.stories.tsx +21 -21
  237. package/src/components/Tooltip/Tooltip.styles.ts +45 -45
  238. package/src/components/Tooltip/Tooltip.tsx +40 -40
  239. package/src/components/Tooltip/index.ts +3 -3
  240. package/src/components/Tooltip/types.ts +1 -1
  241. package/src/components/index.ts +36 -36
  242. package/src/helpers/colors.ts +2 -2
  243. package/src/helpers/dateHelpers/date-helpers.ts +9 -9
  244. package/src/helpers/index.ts +4 -4
  245. package/src/helpers/phone.ts +106 -106
  246. package/src/helpers/popper-helpers.ts +17 -17
  247. package/src/helpers/snippets.tsx +5 -5
  248. package/src/helpers/utils.ts +261 -250
  249. package/src/hooks/index.ts +6 -6
  250. package/src/hooks/use-did-mount-effect.ts +21 -21
  251. package/src/hooks/use-dropdown.ts +85 -85
  252. package/src/hooks/use-is-mounted.ts +15 -15
  253. package/src/hooks/use-on-click-outside.ts +92 -92
  254. package/src/hooks/use-theme.ts +36 -36
  255. package/src/hooks/use-tweak-styles.ts +14 -14
  256. package/src/index.ts +6 -6
  257. package/src/theme.ts +155 -155
  258. package/src/types.ts +105 -106
  259. package/src/vite-env.d.ts +1 -1
  260. package/dist/components/DatePicker/DatePickerInput/DatePickerInput.d.ts +0 -11
  261. package/dist/components/DatePicker/DatePickerInput/DatePickerInput.styles.d.ts +0 -20
  262. package/dist/components/DatePicker/DatePickerInput/index.d.ts +0 -1
  263. package/src/components/DatePicker/DatePickerInput/DatePickerInput.styles.ts +0 -25
  264. package/src/components/DatePicker/DatePickerInput/DatePickerInput.tsx +0 -31
  265. 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",
@@ -6098,7 +6103,7 @@
6098
6103
  ];
6099
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
  }, [
@@ -6145,7 +6150,7 @@
6145
6150
  ]
6146
6151
  }));
6147
6152
  });
6148
- var styles$C = {
6153
+ var styles$B = {
6149
6154
  root: {
6150
6155
  cursor: "pointer",
6151
6156
  display: "flex",
@@ -6313,7 +6318,7 @@
6313
6318
  }
6314
6319
  function Checkbox(param) {
6315
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;
6316
- var classes = useTheme("Checkbox", styles$C, tweakStyles, {
6321
+ var classes = useTheme("Checkbox", styles$B, tweakStyles, {
6317
6322
  size,
6318
6323
  alignItems,
6319
6324
  textMargin
@@ -6361,7 +6366,7 @@
6361
6366
  ]
6362
6367
  }));
6363
6368
  }
6364
- var styles$B = {
6369
+ var styles$A = {
6365
6370
  root: {
6366
6371
  width: 40,
6367
6372
  height: 40,
@@ -6440,7 +6445,7 @@
6440
6445
  }
6441
6446
  var CloseButton = function(param) {
6442
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;
6443
- var classes = useTheme("CloseButton", styles$B, tweakStyles).classes;
6448
+ var classes = useTheme("CloseButton", styles$A, tweakStyles).classes;
6444
6449
  return /* @__PURE__ */ jsx("button", _object_spread_props$t(_object_spread$C({
6445
6450
  type: "button",
6446
6451
  className: classes.root,
@@ -6452,7 +6457,7 @@
6452
6457
  })
6453
6458
  }));
6454
6459
  };
6455
- var styles$A = {
6460
+ var styles$z = {
6456
6461
  root: {
6457
6462
  display: "flex",
6458
6463
  flexWrap: "wrap"
@@ -6545,7 +6550,7 @@
6545
6550
  return _array_like_to_array$l(o, minLen);
6546
6551
  }
6547
6552
  var Colors = function() {
6548
- var classes = useTheme("Colors", styles$A).classes;
6553
+ var classes = useTheme("Colors", styles$z).classes;
6549
6554
  var theme = React.useContext(ThemeContext).theme;
6550
6555
  var _theme_colors = theme.colors, colors2 = _theme_colors === void 0 ? {} : _theme_colors;
6551
6556
  return /* @__PURE__ */ jsx("div", {
@@ -6575,7 +6580,7 @@
6575
6580
  })
6576
6581
  });
6577
6582
  };
6578
- var styles$z = {
6583
+ var styles$y = {
6579
6584
  "@global html, body": {
6580
6585
  fontFamily: "Arial, sans-serif",
6581
6586
  color: colors.FONT_MAIN,
@@ -6614,14 +6619,14 @@
6614
6619
  }
6615
6620
  var CssBaseline = function(param) {
6616
6621
  var data = param.data, tweakStyles = param.tweakStyles;
6617
- var classes = useTheme("CssBaseline", styles$z, tweakStyles).classes;
6622
+ var classes = useTheme("CssBaseline", styles$y, tweakStyles).classes;
6618
6623
  return /* @__PURE__ */ jsx("div", _object_spread$B({
6619
6624
  className: classes.root
6620
6625
  }, addDataAttributes(data)));
6621
6626
  };
6622
6627
  var PADDING_X$1 = 12;
6623
6628
  var AUTOSIZE_MAX_WIDTH = 480;
6624
- var styles$y = {
6629
+ var styles$x = {
6625
6630
  root: {
6626
6631
  width: "100%",
6627
6632
  boxSizing: "border-box",
@@ -7144,7 +7149,7 @@
7144
7149
  var DEFAULT_SIZE = 6;
7145
7150
  var Input = /* @__PURE__ */ React.forwardRef(function(param, ref) {
7146
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;
7147
- 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;
7148
7153
  var _useState = _sliced_to_array$k(React.useState(false), 2), isFocused = _useState[0], setFocused = _useState[1];
7149
7154
  var inputRef = React.useRef(null);
7150
7155
  var handleChange = function(event) {
@@ -7285,12 +7290,14 @@
7285
7290
  ]
7286
7291
  });
7287
7292
  });
7288
- 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 = {
7289
7296
  root: {
7290
- cursor: "pointer",
7291
- position: "relative",
7292
7297
  width: "100%",
7293
- height: "100%"
7298
+ height: "100%",
7299
+ cursor: "pointer",
7300
+ position: "relative"
7294
7301
  },
7295
7302
  tweakInput: {}
7296
7303
  };
@@ -7378,71 +7385,57 @@
7378
7385
  }
7379
7386
  return target;
7380
7387
  }
7381
- var DateInput = function(_param) {
7382
- 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, [
7383
- "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, [
7384
7390
  "date",
7385
7391
  "startDate",
7386
7392
  "endDate",
7393
+ "mask",
7394
+ "className",
7395
+ "placeholder",
7387
7396
  "data",
7388
- "onChange",
7389
- "tweakStyles"
7397
+ "isRange",
7398
+ "tweakStyles",
7399
+ "onClick",
7400
+ "onChange"
7390
7401
  ]);
7391
- var _useTheme = useTheme("DateInput", styles$x, tweakStyles), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
7392
- var mainProps = isRange ? {
7393
- value: "".concat(startDate).concat(endDate),
7394
- onChange: function(v) {
7395
- return onChange(v !== "__.__.____ - __.__.____" ? v : "");
7396
- },
7397
- mask: "99.99.9999 - 99.99.9999"
7398
- } : {
7399
- value: date,
7400
- onChange: function(v) {
7401
- return onChange(v !== "__.__.____" ? v : "");
7402
- },
7403
- mask: "99.99.9999"
7404
- };
7402
+ var _useTheme = useTheme("DateInput", styles$w, tweakStyles), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
7405
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
+ };
7406
7423
  return /* @__PURE__ */ jsx("div", _object_spread_props$r(_object_spread$z({
7407
- className: classes.root
7424
+ className: clsx(classes.root, className),
7425
+ onClick
7408
7426
  }, addDataAttributes(data)), {
7409
- children: /* @__PURE__ */ jsx(Input, _object_spread_props$r(_object_spread$z({}, mainProps, props), {
7410
- 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
7411
7435
  }))
7412
7436
  }));
7413
- };
7414
- const reactDatepicker = "";
7415
- var styles$w = {
7416
- customInput: {
7417
- width: "100%",
7418
- height: "100%"
7419
- },
7420
- s: {
7421
- width: 184,
7422
- height: "100%"
7423
- },
7424
- m: {
7425
- width: 300,
7426
- height: "100%"
7427
- },
7428
- full: {
7429
- width: "100%",
7430
- height: "100%"
7431
- }
7432
- };
7433
- var DatePickerInput = /* @__PURE__ */ React.forwardRef(function(param, ref) {
7434
- var onClick = param.onClick, children = param.children, _param_size = param.size, size = _param_size === void 0 ? "full" : _param_size, className = param.className;
7435
- var classes = useTheme("DatePickerInput", styles$w).classes;
7436
- return /* @__PURE__ */ jsx("div", {
7437
- className: clsx(classes.customInput, className),
7438
- children: /* @__PURE__ */ jsx("div", {
7439
- className: classes[size],
7440
- onClick,
7441
- ref,
7442
- children
7443
- })
7444
- });
7445
7437
  });
7438
+ const reactDatepicker = "";
7446
7439
  function _assert_this_initialized(self2) {
7447
7440
  if (self2 === void 0) {
7448
7441
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
@@ -9007,20 +9000,13 @@
9007
9000
  }
9008
9001
  };
9009
9002
  var DatePickerHeader = function(param) {
9010
- 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;
9011
9004
  var _useTheme = useTheme("DatePickerHeader", styles$s), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
9012
9005
  var years = React.useMemo(function() {
9013
9006
  return Array.from(Array(41)).map(function(_, i) {
9014
9007
  return dateFns.getYear(new Date()) - 30 + i;
9015
9008
  });
9016
9009
  }, []);
9017
- var getMonthNumber = React.useCallback(function(month) {
9018
- return months.findIndex(function(m) {
9019
- return m === month;
9020
- });
9021
- }, [
9022
- months
9023
- ]);
9024
9010
  return /* @__PURE__ */ jsxs("div", {
9025
9011
  className: classes.header,
9026
9012
  children: [
@@ -9036,11 +9022,11 @@
9036
9022
  children: /* @__PURE__ */ jsx(Select, {
9037
9023
  value: months[dateFns.getMonth(date)],
9038
9024
  options: months,
9039
- onChange: function(value) {
9040
- return changeMonth(getMonthNumber(value));
9041
- },
9025
+ dropdownIcon: "chevron-down-small",
9042
9026
  tweakStyles: componentStyles.tweakSelect,
9043
- dropdownIcon: "chevron-down-small"
9027
+ onChange: function(value) {
9028
+ return changeMonth(months.indexOf(value));
9029
+ }
9044
9030
  })
9045
9031
  })
9046
9032
  ]
@@ -9057,11 +9043,11 @@
9057
9043
  children: /* @__PURE__ */ jsx(Select, {
9058
9044
  value: dateFns.getYear(date),
9059
9045
  options: years,
9060
- onChange: function(value) {
9061
- changeYear(value);
9062
- },
9046
+ dropdownIcon: "chevron-down-small",
9063
9047
  tweakStyles: componentStyles.tweakSelect,
9064
- dropdownIcon: "chevron-down-small"
9048
+ onChange: function(value) {
9049
+ return changeYear(value);
9050
+ }
9065
9051
  })
9066
9052
  })
9067
9053
  ]
@@ -9070,19 +9056,19 @@
9070
9056
  className: classes.buttons,
9071
9057
  children: [
9072
9058
  /* @__PURE__ */ jsx("button", {
9073
- onClick: decreaseMonth,
9074
- disabled: isPrevMonthButtonDisabled,
9075
- className: classes.btn,
9076
9059
  type: "button",
9060
+ className: classes.btn,
9061
+ disabled: prevMonthButtonDisabled,
9062
+ onClick: decreaseMonth,
9077
9063
  children: /* @__PURE__ */ jsx(Icon, {
9078
9064
  type: "chevron-left"
9079
9065
  })
9080
9066
  }),
9081
9067
  /* @__PURE__ */ jsx("button", {
9082
- onClick: increaseMonth,
9083
- disabled: isNextMonthButtonDisabled,
9084
- className: classes.btn,
9085
9068
  type: "button",
9069
+ className: classes.btn,
9070
+ disabled: nextMonthButtonDisabled,
9071
+ onClick: increaseMonth,
9086
9072
  children: /* @__PURE__ */ jsx(Icon, {
9087
9073
  type: "chevron-right"
9088
9074
  })
@@ -9092,43 +9078,38 @@
9092
9078
  ]
9093
9079
  });
9094
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";
9095
9096
  var styles$r = {
9096
9097
  root: {
9097
9098
  width: "100%",
9098
9099
  height: "100%"
9099
9100
  },
9100
- day: {
9101
- width: 36,
9102
- height: 36,
9103
- lineHeight: "normal",
9104
- boxSizing: "border-box",
9105
- paddingTop: 10,
9106
- fontSize: 16
9107
- },
9108
- datepicker: {
9109
- display: "flex",
9110
- padding: [
9111
- 4,
9112
- 8,
9113
- 20,
9114
- 8
9115
- ],
9116
- width: 320,
9117
- boxSizing: "border-box"
9118
- },
9119
- btnText: {
9120
- marginLeft: "auto"
9121
- },
9101
+ day: {},
9102
+ datepicker: {},
9122
9103
  popper: {
9123
9104
  zIndex: 10,
9124
- marginLeft: function(param) {
9125
- var leftPosition = param.leftPosition;
9126
- return leftPosition;
9127
- },
9128
9105
  marginTop: function(param) {
9129
9106
  var topPosition = param.topPosition;
9130
9107
  return topPosition;
9131
9108
  },
9109
+ marginLeft: function(param) {
9110
+ var leftPosition = param.leftPosition;
9111
+ return leftPosition;
9112
+ },
9132
9113
  '&[data-placement^="bottom"]': {
9133
9114
  paddingTop: 6
9134
9115
  },
@@ -9141,7 +9122,8 @@
9141
9122
  '&[data-placement^="right"]': {
9142
9123
  paddingLeft: 6
9143
9124
  }
9144
- }
9125
+ },
9126
+ tweakDateInput: {}
9145
9127
  };
9146
9128
  function _array_like_to_array$i(arr, len) {
9147
9129
  if (len == null || len > arr.length)
@@ -9285,8 +9267,8 @@
9285
9267
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
9286
9268
  return _array_like_to_array$i(o, minLen);
9287
9269
  }
9288
- var _ReactDatepicker_default;
9289
- 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;
9290
9272
  var PopperContainer = function(param) {
9291
9273
  var children = param.children;
9292
9274
  return /* @__PURE__ */ jsx(reactOverlays.Portal, {
@@ -9294,257 +9276,240 @@
9294
9276
  children
9295
9277
  });
9296
9278
  };
9297
- var DEFAULT_DATE_FORMAT$2 = "dd.MM.yyyy";
9298
- var DatePicker = function(_param) {
9299
- 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, [
9300
9281
  "data",
9301
- "tweakStyles",
9302
9282
  "selectedDate",
9303
9283
  "minDate",
9304
9284
  "maxDate",
9305
9285
  "endDate",
9306
9286
  "startDate",
9307
- "size",
9308
- "isRange",
9309
9287
  "locale",
9310
9288
  "months",
9311
- "calendarStartDay",
9312
- "leftPosition",
9313
9289
  "topPosition",
9314
- "isInline",
9315
- "isNeedClearSelectedDate",
9290
+ "leftPosition",
9291
+ "calendarStartDay",
9316
9292
  "dateFormat",
9317
9293
  "monthsShown",
9318
9294
  "placeholder",
9319
- "shouldGiveValueOnType",
9295
+ "isRange",
9296
+ "isInline",
9297
+ "isDisabled",
9298
+ "isClearable",
9299
+ "focusSelectedMonth",
9320
9300
  "disabledKeyboardNavigation",
9321
9301
  "shouldRenderPopperInBody",
9322
- "popperModifiers",
9302
+ "allowSameDay",
9303
+ "shouldCloseOnSelect",
9323
9304
  "showPreviousMonths",
9305
+ "preventOpenOnFocus",
9306
+ "popperModifiers",
9324
9307
  "popperPlacement",
9308
+ "todayButton",
9309
+ "calendarContainer",
9310
+ "dayClassName",
9311
+ "customInput",
9312
+ "customInputRef",
9313
+ "renderCustomHeader",
9314
+ "filterDate",
9315
+ "onYearChange",
9316
+ "onMonthChange",
9317
+ "onCalendarOpen",
9318
+ "onCalendarClose",
9325
9319
  "onChangeDate",
9326
9320
  "onChangeRange",
9327
- "customHeader",
9328
- "filterDate"
9321
+ "onBlur",
9322
+ "onFocus",
9323
+ "onKeyDown",
9324
+ "tweakStyles"
9329
9325
  ]);
9330
- var classes = useTheme("DatePicker", styles$r, tweakStyles, {
9326
+ var _useTheme = useTheme("DatePicker", styles$r, tweakStyles, {
9331
9327
  leftPosition,
9332
9328
  topPosition
9333
- }).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;
9334
9339
  var _useState = _sliced_to_array$i(React.useState(false), 2), isOpen = _useState[0], setIsOpen = _useState[1];
9335
- var _useState1 = _sliced_to_array$i(React.useState(selectedDate), 2), date = _useState1[0], setDate = _useState1[1];
9336
- var _useState2 = _sliced_to_array$i(React.useState(selectedDate ? dateFns.format(selectedDate, dateFormat) : ""), 2), dateValue = _useState2[0], setDateValue = _useState2[1];
9337
- 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];
9338
9343
  var _useState4 = _sliced_to_array$i(React.useState(endDate), 2), end2 = _useState4[0], setEnd = _useState4[1];
9339
- var _useState5 = _sliced_to_array$i(React.useState(startDate ? dateFns.format(startDate, dateFormat) : ""), 2), startDateValue = _useState5[0], setStartDateValue = _useState5[1];
9340
- var _useState6 = _sliced_to_array$i(React.useState(endDate ? dateFns.format(endDate, dateFormat) : ""), 2), endDateValue = _useState6[0], setEndDateValue = _useState6[1];
9341
- var isDateValid = function(value) {
9342
- 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);
9343
9361
  };
9344
- var parseStringToDate = function(value) {
9345
- 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));
9346
9364
  };
9347
- var handleDateChange = React.useCallback(function(newDate) {
9348
- if (onChangeDate) {
9349
- if (!newDate) {
9350
- onChangeDate(null, newDate);
9351
- }
9352
- if (newDate && isDateValid(newDate)) {
9353
- onChangeDate(parseStringToDate(newDate));
9354
- }
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);
9355
9372
  }
9356
- setDateValue(newDate);
9357
- }, [
9358
- onChangeDate
9359
- ]);
9360
- var handleRangeChange = React.useCallback(function(newDate) {
9361
- if (!newDate && onChangeRange) {
9362
- onChangeRange(null);
9363
- setStartDateValue("");
9364
- setEndDateValue("");
9365
- }
9366
- var newStartDate = newDate.slice(0, 10);
9367
- var newEndDate = newDate.slice(13);
9368
- setStartDateValue(newStartDate);
9369
- setEndDateValue(newEndDate);
9370
- if (newStartDate && isDateValid(newStartDate)) {
9371
- setStart(parseStringToDate(newStartDate));
9372
- }
9373
- if (newEndDate && isDateValid(newEndDate)) {
9374
- setEnd(parseStringToDate(newEndDate));
9375
- }
9376
- if (newStartDate && newEndDate && isDateValid(newStartDate) && isDateValid(newEndDate) && onChangeRange) {
9377
- onChangeRange([
9378
- parseStringToDate(newStartDate),
9379
- 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
9380
9429
  ]);
9430
+ setDateRangeValues(start2, end2);
9431
+ } else {
9432
+ setDateValue(formatDate(selectedDate));
9381
9433
  }
9382
- }, [
9383
- onChangeRange
9384
- ]);
9385
- React.useEffect(function() {
9386
- setDateValue("");
9387
- }, [
9388
- isNeedClearSelectedDate
9389
- ]);
9434
+ onCalendarClose === null || onCalendarClose === void 0 ? void 0 : onCalendarClose();
9435
+ };
9390
9436
  React.useEffect(function() {
9391
- setDate(selectedDate);
9392
- setStart(startDate);
9393
- setEnd(endDate);
9394
- setStartDateValue(startDate ? dateFns.format(startDate, dateFormat) : "");
9395
- setEndDateValue(endDate ? dateFns.format(endDate, dateFormat) : "");
9396
- setDateValue(selectedDate ? dateFns.format(selectedDate, dateFormat) : "");
9437
+ setDateValue(formatDate(selectedDate));
9438
+ setDateRangeValues(startDate, endDate);
9397
9439
  }, [
9398
9440
  selectedDate,
9399
9441
  startDate,
9400
9442
  endDate
9401
9443
  ]);
9402
- var onTabConfirm = function(event) {
9403
- if (event.key === "9") {
9404
- setIsOpen(false);
9405
- }
9406
- };
9407
- React.useEffect(function() {
9408
- document.addEventListener("keydown", onTabConfirm);
9409
- return function() {
9410
- return document.removeEventListener("keydown", onTabConfirm);
9411
- };
9412
- }, []);
9413
- var handleBlur = function(e) {
9414
- if (inputProps.onBlur) {
9415
- inputProps.onBlur(e);
9416
- }
9417
- if (shouldGiveValueOnType && onChangeDate && !isDateValid(dateValue)) {
9418
- onChangeDate(null, dateValue);
9419
- return;
9420
- }
9421
- if (onChangeDate && date) {
9422
- if (!isDateValid(dateValue)) {
9423
- onChangeDate(null);
9424
- setDateValue("");
9425
- } else if (maxDate && dateFns.isAfter(date, maxDate)) {
9426
- onChangeDate(maxDate);
9427
- } else if (minDate && dateFns.isAfter(minDate, date)) {
9428
- onChangeDate(minDate);
9429
- }
9430
- }
9431
- };
9432
- var handleRangeBlur = function(e) {
9433
- if (inputProps.onBlur) {
9434
- inputProps.onBlur(e);
9435
- }
9436
- if (onChangeRange && start2 && end2) {
9437
- if (!isDateValid(startDateValue) && endDateValue) {
9438
- setStartDateValue(placeholder);
9439
- }
9440
- if (!isDateValid(endDateValue)) {
9441
- setEndDateValue("");
9442
- } else if (maxDate && dateFns.isAfter(start2, maxDate)) {
9443
- onChangeRange([
9444
- maxDate,
9445
- end2
9446
- ]);
9447
- } else if (minDate && dateFns.isAfter(minDate, end2)) {
9448
- onChangeRange([
9449
- start2,
9450
- start2
9451
- ]);
9452
- }
9453
- }
9454
- };
9455
- var datePickerProps = {
9456
- dateFormat,
9457
- calendarStartDay,
9458
- locale: locale2,
9459
- popperModifiers,
9460
- popperPlacement,
9461
- monthsShown,
9462
- showPreviousMonths,
9463
- disabledKeyboardNavigation,
9464
- inline: isInline,
9465
- disabled: inputProps.isDisabled,
9466
- showPopperArrow: false,
9467
- popperClassName: classes.popper,
9468
- calendarClassName: classes.datepicker,
9469
- popperContainer: shouldRenderPopperInBody ? PopperContainer : void 0,
9470
- selectsRange: isRange,
9471
- onChange: function() {
9472
- return null;
9473
- },
9474
- dayClassName: function() {
9475
- return classes.day;
9476
- },
9477
- filterDate
9478
- };
9479
- var dateInputProps = _object_spread_props$n(_object_spread$t({}, inputProps), {
9480
- tweakStyles,
9481
- iconType: inputProps.isClearable && dateValue !== "" ? void 0 : "calendar",
9482
- isRange,
9483
- // eslint-disable-next-line @typescript-eslint/no-empty-function
9484
- onChange: function() {
9485
- }
9486
- });
9487
- if (onChangeRange) {
9488
- datePickerProps = _object_spread_props$n(_object_spread$t({}, datePickerProps), {
9489
- startDate: start2,
9490
- endDate: end2,
9491
- selectsRange: true,
9492
- selected: startDate,
9493
- onChange: onChangeRange
9494
- });
9495
- dateInputProps = _object_spread_props$n(_object_spread$t({}, dateInputProps), {
9496
- startDate: startDateValue,
9497
- endDate: endDateValue,
9498
- onBlur: handleRangeBlur,
9499
- onChange: handleRangeChange
9500
- });
9501
- }
9502
- if (onChangeDate) {
9503
- datePickerProps = _object_spread_props$n(_object_spread$t({}, datePickerProps), {
9504
- selected: date,
9505
- onChange: function(newDate) {
9506
- return onChangeDate(newDate);
9507
- },
9508
- onCalendarOpen: function() {
9509
- return setIsOpen(true);
9510
- },
9511
- onCalendarClose: function() {
9512
- return setIsOpen(false);
9513
- },
9514
- minDate,
9515
- maxDate
9516
- });
9517
- dateInputProps = _object_spread_props$n(_object_spread$t({}, dateInputProps), {
9518
- date: dateValue,
9519
- isActive: isOpen,
9520
- onBlur: handleBlur,
9521
- onChange: handleDateChange
9522
- });
9523
- }
9524
9444
  return /* @__PURE__ */ jsx("div", _object_spread_props$n(_object_spread$t({
9525
9445
  className: classes.root
9526
9446
  }, addDataAttributes(data)), {
9527
- children: /* @__PURE__ */ jsx(Datepicker, _object_spread_props$n(_object_spread$t({}, datePickerProps), {
9528
- customInput: /* @__PURE__ */ jsx(DatePickerInput, {
9529
- size,
9530
- children: /* @__PURE__ */ jsx(DateInput, _object_spread$t({}, dateInputProps))
9531
- }),
9532
- renderCustomHeader: customHeader !== void 0 ? customHeader : function(param) {
9533
- var renderDate = param.date, changeYear = param.changeYear, changeMonth = param.changeMonth, decreaseMonth = param.decreaseMonth, increaseMonth = param.increaseMonth, prevMonthButtonDisabled = param.prevMonthButtonDisabled, nextMonthButtonDisabled = param.nextMonthButtonDisabled;
9534
- return /* @__PURE__ */ jsx(DatePickerHeader, {
9535
- date: renderDate,
9536
- changeMonth,
9537
- changeYear,
9538
- decreaseMonth,
9539
- increaseMonth,
9540
- isPrevMonthButtonDisabled: prevMonthButtonDisabled,
9541
- 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), {
9542
9478
  months
9543
- });
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
+ }
9544
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
9545
9510
  }))
9546
9511
  }));
9547
- };
9512
+ });
9548
9513
  var styles$q = {
9549
9514
  root: {},
9550
9515
  button: {
@@ -13973,26 +13938,24 @@
13973
13938
  localeKey,
13974
13939
  locale2
13975
13940
  ]);
13976
- var _useState2 = _sliced_to_array$c(React.useState(false), 2), isNeedClearSelectedDate = _useState2[0], setNeedClearSelectedDate = _useState2[1];
13977
13941
  var topPosition = !isClearable && onStartBtnSubmit === void 0 ? 28 : 60;
13978
13942
  var handleClear = function() {
13979
13943
  onEndBtnSubmit();
13980
- setNeedClearSelectedDate(!isNeedClearSelectedDate);
13981
13944
  };
13982
13945
  var ref = React.useRef(null);
13983
13946
  var isOpenCalendar = isOpenFrom || isOpenTo;
13984
13947
  var handleFromSelected = function(val) {
13985
- var _value_to2;
13948
+ var _value_to;
13986
13949
  onChange({
13987
13950
  from: val,
13988
- 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
13989
13952
  });
13990
13953
  setOpenFrom(false);
13991
13954
  };
13992
13955
  var handleToSelected = function(val) {
13993
- var _value_from2;
13956
+ var _value_from;
13994
13957
  onChange({
13995
- 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,
13996
13959
  to: val
13997
13960
  });
13998
13961
  setOpenTo(false);
@@ -14004,10 +13967,10 @@
14004
13967
  to: val
14005
13968
  });
14006
13969
  } else {
14007
- var _value_to2;
13970
+ var _value_to;
14008
13971
  onChange({
14009
13972
  from: val,
14010
- 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
14011
13974
  });
14012
13975
  }
14013
13976
  };
@@ -14018,16 +13981,16 @@
14018
13981
  to: value.from
14019
13982
  });
14020
13983
  } else {
14021
- var _value_from2;
13984
+ var _value_from;
14022
13985
  onChange({
14023
- 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,
14024
13987
  to: val
14025
13988
  });
14026
13989
  }
14027
13990
  };
14028
13991
  var tweakClearButtonStyles = useTweakStyles(componentStyles, tweakStyles, "tweakClearButton");
14029
13992
  var tweakBackButtonStyles = useTweakStyles(componentStyles, tweakStyles, "tweakBackButton");
14030
- var _value_from, _value_to, _ref;
13993
+ var _ref;
14031
13994
  return /* @__PURE__ */ jsxs("div", _object_spread_props$h(_object_spread$j({
14032
13995
  className: classes.root
14033
13996
  }, addDataAttributes(data)), {
@@ -14038,7 +14001,7 @@
14038
14001
  /* @__PURE__ */ jsx("div", {
14039
14002
  className: classes.containerItem,
14040
14003
  children: /* @__PURE__ */ jsx(DatePicker, _object_spread$j({
14041
- 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,
14042
14005
  maxDate: value === null || value === void 0 ? void 0 : value.to,
14043
14006
  label: translates.from,
14044
14007
  months: translates.months,
@@ -14046,16 +14009,15 @@
14046
14009
  onChangeDate: handleChangeFrom,
14047
14010
  leftPosition: -20,
14048
14011
  topPosition,
14049
- isNeedClearSelectedDate,
14050
14012
  border: "bottom",
14051
- testId: testId !== void 0 ? "".concat(testId, "-from") : void 0,
14013
+ testId: getTestId(testId, "from"),
14052
14014
  isClearable
14053
14015
  }, startPickerProps))
14054
14016
  }),
14055
14017
  /* @__PURE__ */ jsx("div", {
14056
14018
  className: classes.containerItem,
14057
14019
  children: /* @__PURE__ */ jsx(DatePicker, _object_spread$j({
14058
- 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,
14059
14021
  label: translates.to,
14060
14022
  months: translates.months,
14061
14023
  minDate: value === null || value === void 0 ? void 0 : value.from,
@@ -14063,9 +14025,8 @@
14063
14025
  onChangeDate: handleChangeTo,
14064
14026
  topPosition,
14065
14027
  leftPosition: -170,
14066
- isNeedClearSelectedDate,
14067
14028
  border: "bottom",
14068
- testId: testId !== void 0 ? "".concat(testId, "-to") : void 0,
14029
+ testId: getTestId(testId, "to"),
14069
14030
  isClearable
14070
14031
  }, endPickerProps))
14071
14032
  })
@@ -14079,7 +14040,7 @@
14079
14040
  onClick: handleClear,
14080
14041
  size: "s",
14081
14042
  view: "text",
14082
- testId: testId !== void 0 ? "".concat(testId, "-clear-button") : void 0,
14043
+ testId: getTestId(testId, "clear-button"),
14083
14044
  isFullWidth: true,
14084
14045
  tweakStyles: tweakClearButtonStyles,
14085
14046
  children: translates.clear
@@ -28048,6 +28009,8 @@
28048
28009
  exports2.DateInput = DateInput;
28049
28010
  exports2.DatePicker = DatePicker;
28050
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;
28051
28014
  exports2.FilterInterval = FilterInterval;
28052
28015
  exports2.FilterLocales = FilterLocales;
28053
28016
  exports2.FilterMultiSelect = FilterMultiSelect;
@@ -28112,6 +28075,7 @@
28112
28075
  exports2.hasExactParent = hasExactParent;
28113
28076
  exports2.isElementOffScreen = isElementOffScreen;
28114
28077
  exports2.isElementOneOfParents = isElementOneOfParents;
28078
+ exports2.isEmpty = isEmpty;
28115
28079
  exports2.isInt = isInt;
28116
28080
  exports2.isNotEmpty = isNotEmpty;
28117
28081
  exports2.isSpaceChar = isSpaceChar;