@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
@@ -4,8 +4,8 @@ import clsx from "clsx";
4
4
  import hexToRgba from "hex-to-rgba";
5
5
  import { createUseStyles } from "react-jss";
6
6
  import InputMask from "react-input-mask";
7
- import ReactDatepicker from "react-datepicker";
8
- import { getYear, getMonth, format as format$1, isValid, parse, isAfter, isBefore, startOfMonth, endOfMonth, sub, startOfYear, endOfYear } from "date-fns";
7
+ import ReactDatePicker from "react-datepicker";
8
+ import { getYear, getMonth, format as format$1, parse, isSameDay, isValid, isAfter, isBefore, startOfMonth, endOfMonth, sub, startOfYear, endOfYear } from "date-fns";
9
9
  import { Portal } from "react-overlays";
10
10
  import scrollIntoViewIfNeeded from "scroll-into-view-if-needed";
11
11
  import { debounce as debounce$1 } from "ts-debounce";
@@ -1301,6 +1301,9 @@ var getNumberLength = function(n) {
1301
1301
  var isNotEmpty = function(val) {
1302
1302
  return typeof val === "string" ? val.trim() !== "" : val !== null && val !== void 0;
1303
1303
  };
1304
+ var isEmpty = function(val) {
1305
+ return val === null || val === void 0;
1306
+ };
1304
1307
  var isStringNotEmpty = function(value) {
1305
1308
  return (value !== null && value !== void 0 ? value : "").trim() !== "";
1306
1309
  };
@@ -1349,17 +1352,19 @@ var addClickHandler = function(cb) {
1349
1352
  tabIndex: -1
1350
1353
  };
1351
1354
  };
1352
- var createFilter = function(getter) {
1355
+ var createFilter = function(getter, compareFn) {
1353
1356
  return function(items, query) {
1354
1357
  return items.filter(function(item) {
1355
1358
  var possibleValues = getter(item).reduce(function(acc, cur) {
1356
1359
  return _to_consumable_array$7(acc).concat(_to_consumable_array$7(isStringNotEmpty(cur) ? [
1357
- cur === null || cur === void 0 ? void 0 : cur.toLowerCase()
1360
+ cur.toLowerCase()
1358
1361
  ] : []));
1359
1362
  }, []);
1360
1363
  var queryString = query.toLowerCase().trim();
1361
1364
  return possibleValues.some(function(v) {
1362
- return v === null || v === void 0 ? void 0 : v.includes(queryString);
1365
+ return (compareFn !== null && compareFn !== void 0 ? compareFn : function() {
1366
+ return v === null || v === void 0 ? void 0 : v.includes(queryString);
1367
+ })(v, queryString);
1363
1368
  });
1364
1369
  });
1365
1370
  };
@@ -4967,63 +4972,63 @@ var IconBoilerplate = function(param) {
4967
4972
  ]
4968
4973
  });
4969
4974
  };
4970
- const avatarGreen = ` <svg\r
4971
- width="100%"\r
4972
- height="100%"\r
4973
- viewBox="0 0 32 32"\r
4974
- fill="none"\r
4975
- xmlns="http://www.w3.org/2000/svg"\r
4976
- >\r
4977
- <circle opacity="0.5" cx="16" cy="16" r="16" fill="#DDE3ED" />\r
4978
- <mask\r
4979
- id="mask0_0_12744"\r
4980
- style="mask-type: 'alpha';"\r
4981
- maskUnits="userSpaceOnUse"\r
4982
- x="0"\r
4983
- y="0"\r
4984
- width="32"\r
4985
- height="32"\r
4986
- >\r
4987
- <circle cx="16" cy="16" r="16" fill="white" />\r
4988
- </mask>\r
4989
- <g mask="url(#mask0_0_12744)">\r
4990
- <circle cx="16" cy="29" r="13" fill="url(#paint0_linear_0_12744)" />\r
4991
- <mask\r
4992
- id="mask1_0_12744"\r
4993
- style="mask-type: 'alpha';"\r
4994
- maskUnits="userSpaceOnUse"\r
4995
- x="3"\r
4996
- y="16"\r
4997
- width="26"\r
4998
- height="26"\r
4999
- >\r
5000
- <circle cx="16" cy="29" r="13" fill="white" />\r
5001
- </mask>\r
5002
- <g mask="url(#mask1_0_12744)">\r
5003
- <ellipse\r
5004
- cx="16"\r
5005
- cy="17.5"\r
5006
- rx="6"\r
5007
- ry="7.5"\r
5008
- fill="#505F79"\r
5009
- fill-opacity="0.204983"\r
5010
- />\r
5011
- </g>\r
5012
- </g>\r
5013
- <ellipse cx="16" cy="13" rx="6" ry="7" fill="white" />\r
5014
- <defs>\r
5015
- <linearGradient\r
5016
- id="paint0_linear_0_12744"\r
5017
- x1="13.347"\r
5018
- y1="46.279"\r
5019
- x2="33.5318"\r
5020
- y2="30.8088"\r
5021
- gradientUnits="userSpaceOnUse"\r
5022
- >\r
5023
- <stop stop-color="#ABD229" />\r
5024
- <stop offset="1" stop-color="#9CD03F" />\r
5025
- </linearGradient>\r
5026
- </defs>\r
4975
+ const avatarGreen = ` <svg
4976
+ width="100%"
4977
+ height="100%"
4978
+ viewBox="0 0 32 32"
4979
+ fill="none"
4980
+ xmlns="http://www.w3.org/2000/svg"
4981
+ >
4982
+ <circle opacity="0.5" cx="16" cy="16" r="16" fill="#DDE3ED" />
4983
+ <mask
4984
+ id="mask0_0_12744"
4985
+ style="mask-type: 'alpha';"
4986
+ maskUnits="userSpaceOnUse"
4987
+ x="0"
4988
+ y="0"
4989
+ width="32"
4990
+ height="32"
4991
+ >
4992
+ <circle cx="16" cy="16" r="16" fill="white" />
4993
+ </mask>
4994
+ <g mask="url(#mask0_0_12744)">
4995
+ <circle cx="16" cy="29" r="13" fill="url(#paint0_linear_0_12744)" />
4996
+ <mask
4997
+ id="mask1_0_12744"
4998
+ style="mask-type: 'alpha';"
4999
+ maskUnits="userSpaceOnUse"
5000
+ x="3"
5001
+ y="16"
5002
+ width="26"
5003
+ height="26"
5004
+ >
5005
+ <circle cx="16" cy="29" r="13" fill="white" />
5006
+ </mask>
5007
+ <g mask="url(#mask1_0_12744)">
5008
+ <ellipse
5009
+ cx="16"
5010
+ cy="17.5"
5011
+ rx="6"
5012
+ ry="7.5"
5013
+ fill="#505F79"
5014
+ fill-opacity="0.204983"
5015
+ />
5016
+ </g>
5017
+ </g>
5018
+ <ellipse cx="16" cy="13" rx="6" ry="7" fill="white" />
5019
+ <defs>
5020
+ <linearGradient
5021
+ id="paint0_linear_0_12744"
5022
+ x1="13.347"
5023
+ y1="46.279"
5024
+ x2="33.5318"
5025
+ y2="30.8088"
5026
+ gradientUnits="userSpaceOnUse"
5027
+ >
5028
+ <stop stop-color="#ABD229" />
5029
+ <stop offset="1" stop-color="#9CD03F" />
5030
+ </linearGradient>
5031
+ </defs>
5027
5032
  </svg>`;
5028
5033
  var complexIcons = {
5029
5034
  avatar: avatarGreen
@@ -5069,7 +5074,7 @@ var ComplexIconBoilerplate = function(param) {
5069
5074
  }
5070
5075
  });
5071
5076
  };
5072
- var styles$K = {
5077
+ var styles$J = {
5073
5078
  root: {
5074
5079
  display: "flex",
5075
5080
  alignItems: "center"
@@ -5132,7 +5137,7 @@ var isComplexIcon = function(type) {
5132
5137
  };
5133
5138
  var Icon = function(param) {
5134
5139
  var type = param.type, data = param.data, tweakStyles = param.tweakStyles;
5135
- var classes = useTheme("Icon", styles$K, tweakStyles).classes;
5140
+ var classes = useTheme("Icon", styles$J, tweakStyles).classes;
5136
5141
  return /* @__PURE__ */ jsx("div", _object_spread_props$B(_object_spread$K({
5137
5142
  className: classes.root
5138
5143
  }, addDataAttributes(data)), {
@@ -5146,7 +5151,7 @@ var Icon = function(param) {
5146
5151
  var ITEM_HORIZONTAL_PADDING = 16;
5147
5152
  var ICON_SIZE = 20;
5148
5153
  var ICON_GAP = 12;
5149
- var styles$J = {
5154
+ var styles$I = {
5150
5155
  root: {
5151
5156
  minWidth: 180,
5152
5157
  backgroundColor: colors.CLASSIC_WHITE,
@@ -5243,7 +5248,7 @@ function _object_spread_props$A(target, source) {
5243
5248
  }
5244
5249
  var List = function(param) {
5245
5250
  var items = param.items, testId = param.testId, data = param.data, tweakStyles = param.tweakStyles, onClick = param.onClick;
5246
- var classes = useTheme("List", styles$J, tweakStyles).classes;
5251
+ var classes = useTheme("List", styles$I, tweakStyles).classes;
5247
5252
  var handleItemClick = function(item) {
5248
5253
  item.onClick();
5249
5254
  onClick === null || onClick === void 0 ? void 0 : onClick();
@@ -5340,7 +5345,7 @@ function _object_spread_props$z(target, source) {
5340
5345
  }
5341
5346
  return target;
5342
5347
  }
5343
- var styles$I = _object_spread_props$z(_object_spread$I({
5348
+ var styles$H = _object_spread_props$z(_object_spread$I({
5344
5349
  root: {
5345
5350
  display: "flex"
5346
5351
  },
@@ -5497,7 +5502,7 @@ function _unsupported_iterable_to_array$n(o, minLen) {
5497
5502
  var ANIMATION_TIMEOUT = 150;
5498
5503
  var AccountInfo = function(param) {
5499
5504
  var data = param.data, avatar = param.avatar, tweakStyles = param.tweakStyles, accountName = param.accountName, options = param.options;
5500
- var _useTheme = useTheme("AccountInfo", styles$I, tweakStyles, {
5505
+ var _useTheme = useTheme("AccountInfo", styles$H, tweakStyles, {
5501
5506
  timeout: ANIMATION_TIMEOUT
5502
5507
  }), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
5503
5508
  var nameRef = useRef(null);
@@ -5564,7 +5569,7 @@ var AccountInfo = function(param) {
5564
5569
  ]
5565
5570
  }));
5566
5571
  };
5567
- var styles$H = {
5572
+ var styles$G = {
5568
5573
  root: {
5569
5574
  display: "flex",
5570
5575
  alignItems: "center",
@@ -5644,7 +5649,7 @@ function _object_spread_props$x(target, source) {
5644
5649
  }
5645
5650
  var AddButton = function(param) {
5646
5651
  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;
5647
- var classes = useTheme("AddButton", styles$H, tweakStyles).classes;
5652
+ var classes = useTheme("AddButton", styles$G, tweakStyles).classes;
5648
5653
  return /* @__PURE__ */ jsxs("button", _object_spread_props$x(_object_spread$G({
5649
5654
  type,
5650
5655
  className: clsx(classes.root, isDisabled && classes.disabled, isFullWidth && classes.fullWidth),
@@ -5664,7 +5669,7 @@ var AddButton = function(param) {
5664
5669
  ]
5665
5670
  }));
5666
5671
  };
5667
- var styles$G = {
5672
+ var styles$F = {
5668
5673
  root: {
5669
5674
  display: "flex",
5670
5675
  gap: 4,
@@ -5709,7 +5714,7 @@ var styles$G = {
5709
5714
  };
5710
5715
  var DotsPreloader = function(param) {
5711
5716
  var tweakStyles = param.tweakStyles;
5712
- var classes = useTheme("DotsPreloader", styles$G, tweakStyles).classes;
5717
+ var classes = useTheme("DotsPreloader", styles$F, tweakStyles).classes;
5713
5718
  return /* @__PURE__ */ jsx("div", {
5714
5719
  className: classes.root,
5715
5720
  children: /* @__PURE__ */ jsx("span", {
@@ -5773,7 +5778,7 @@ var DefaultPreloader = function() {
5773
5778
  ]
5774
5779
  });
5775
5780
  };
5776
- var styles$F = {
5781
+ var styles$E = {
5777
5782
  root: {
5778
5783
  display: "flex",
5779
5784
  width: "100%",
@@ -5783,7 +5788,7 @@ var styles$F = {
5783
5788
  var SvgPreloader = function(param) {
5784
5789
  var _param_type = param.type, type = _param_type === void 0 ? "default" : _param_type, tweakStyles = param.tweakStyles;
5785
5790
  var _theme_preloaders;
5786
- var classes = useTheme("SvgPreloader", styles$F, tweakStyles).classes;
5791
+ var classes = useTheme("SvgPreloader", styles$E, tweakStyles).classes;
5787
5792
  var theme = useContext(ThemeContext).theme;
5788
5793
  var _theme_preloaders_type;
5789
5794
  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;
@@ -5795,7 +5800,7 @@ var SvgPreloader = function(param) {
5795
5800
  }
5796
5801
  }) : /* @__PURE__ */ jsx(PreloaderIcon, {});
5797
5802
  };
5798
- var styles$E = {
5803
+ var styles$D = {
5799
5804
  root: {
5800
5805
  display: "flex"
5801
5806
  },
@@ -5861,7 +5866,7 @@ function _object_spread_props$w(target, source) {
5861
5866
  }
5862
5867
  var ThemedPreloader = function(param) {
5863
5868
  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;
5864
- var _useTheme = useTheme("ThemedPreloader", styles$E, tweakStyles), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
5869
+ var _useTheme = useTheme("ThemedPreloader", styles$D, tweakStyles), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
5865
5870
  var preloaderComponentStyles = useTweakStyles(componentStyles, tweakStyles, "tweakPreloaderComponent");
5866
5871
  return /* @__PURE__ */ jsx("div", _object_spread_props$w(_object_spread$F({
5867
5872
  className: clsx(classes.root, classes[type], _define_property$H({}, classes.currentColor, useCurrentColor))
@@ -5874,7 +5879,7 @@ var ThemedPreloader = function(param) {
5874
5879
  })
5875
5880
  }));
5876
5881
  };
5877
- var styles$D = {
5882
+ var styles$C = {
5878
5883
  root: {
5879
5884
  display: "flex",
5880
5885
  justifyContent: "center",
@@ -6105,9 +6110,9 @@ var BUTTON_VIEWS = [
6105
6110
  "text",
6106
6111
  "custom"
6107
6112
  ];
6108
- var Button = function(param) {
6113
+ var Button = /* @__PURE__ */ forwardRef(function(param, ref) {
6109
6114
  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;
6110
- var _useTheme = useTheme("Button", styles$D, tweakStyles), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
6115
+ var _useTheme = useTheme("Button", styles$C, tweakStyles), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
6111
6116
  var tweakPreloaderStyles = useMemo(function() {
6112
6117
  return merge$1({}, size === "s" || size === "m" ? dotsPreloaderStyles : void 0, componentStyles.tweakPreloader, tweakStyles === null || tweakStyles === void 0 ? void 0 : tweakStyles.tweakPreloader);
6113
6118
  }, [
@@ -6119,6 +6124,7 @@ var Button = function(param) {
6119
6124
  var hasNoAction = isDisabled || isLoading;
6120
6125
  var _obj, _obj1;
6121
6126
  return /* @__PURE__ */ jsxs("button", _object_spread_props$v(_object_spread$E({
6127
+ ref,
6122
6128
  type,
6123
6129
  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)),
6124
6130
  tabIndex: shouldSkipTabNavigation ? -1 : void 0,
@@ -6152,8 +6158,8 @@ var Button = function(param) {
6152
6158
  })
6153
6159
  ]
6154
6160
  }));
6155
- };
6156
- var styles$C = {
6161
+ });
6162
+ var styles$B = {
6157
6163
  root: {
6158
6164
  cursor: "pointer",
6159
6165
  display: "flex",
@@ -6321,7 +6327,7 @@ function _unsupported_iterable_to_array$m(o, minLen) {
6321
6327
  }
6322
6328
  function Checkbox(param) {
6323
6329
  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;
6324
- var classes = useTheme("Checkbox", styles$C, tweakStyles, {
6330
+ var classes = useTheme("Checkbox", styles$B, tweakStyles, {
6325
6331
  size,
6326
6332
  alignItems,
6327
6333
  textMargin
@@ -6369,7 +6375,7 @@ function Checkbox(param) {
6369
6375
  ]
6370
6376
  }));
6371
6377
  }
6372
- var styles$B = {
6378
+ var styles$A = {
6373
6379
  root: {
6374
6380
  width: 40,
6375
6381
  height: 40,
@@ -6448,7 +6454,7 @@ function _object_spread_props$t(target, source) {
6448
6454
  }
6449
6455
  var CloseButton = function(param) {
6450
6456
  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;
6451
- var classes = useTheme("CloseButton", styles$B, tweakStyles).classes;
6457
+ var classes = useTheme("CloseButton", styles$A, tweakStyles).classes;
6452
6458
  return /* @__PURE__ */ jsx("button", _object_spread_props$t(_object_spread$C({
6453
6459
  type: "button",
6454
6460
  className: classes.root,
@@ -6460,7 +6466,7 @@ var CloseButton = function(param) {
6460
6466
  })
6461
6467
  }));
6462
6468
  };
6463
- var styles$A = {
6469
+ var styles$z = {
6464
6470
  root: {
6465
6471
  display: "flex",
6466
6472
  flexWrap: "wrap"
@@ -6553,7 +6559,7 @@ function _unsupported_iterable_to_array$l(o, minLen) {
6553
6559
  return _array_like_to_array$l(o, minLen);
6554
6560
  }
6555
6561
  var Colors = function() {
6556
- var classes = useTheme("Colors", styles$A).classes;
6562
+ var classes = useTheme("Colors", styles$z).classes;
6557
6563
  var theme = useContext(ThemeContext).theme;
6558
6564
  var _theme_colors = theme.colors, colors2 = _theme_colors === void 0 ? {} : _theme_colors;
6559
6565
  return /* @__PURE__ */ jsx("div", {
@@ -6583,7 +6589,7 @@ var Colors = function() {
6583
6589
  })
6584
6590
  });
6585
6591
  };
6586
- var styles$z = {
6592
+ var styles$y = {
6587
6593
  "@global html, body": {
6588
6594
  fontFamily: "Arial, sans-serif",
6589
6595
  color: colors.FONT_MAIN,
@@ -6622,14 +6628,14 @@ function _object_spread$B(target) {
6622
6628
  }
6623
6629
  var CssBaseline = function(param) {
6624
6630
  var data = param.data, tweakStyles = param.tweakStyles;
6625
- var classes = useTheme("CssBaseline", styles$z, tweakStyles).classes;
6631
+ var classes = useTheme("CssBaseline", styles$y, tweakStyles).classes;
6626
6632
  return /* @__PURE__ */ jsx("div", _object_spread$B({
6627
6633
  className: classes.root
6628
6634
  }, addDataAttributes(data)));
6629
6635
  };
6630
6636
  var PADDING_X$1 = 12;
6631
6637
  var AUTOSIZE_MAX_WIDTH = 480;
6632
- var styles$y = {
6638
+ var styles$x = {
6633
6639
  root: {
6634
6640
  width: "100%",
6635
6641
  boxSizing: "border-box",
@@ -7152,7 +7158,7 @@ var __generator$5 = globalThis && globalThis.__generator || function(thisArg, bo
7152
7158
  var DEFAULT_SIZE = 6;
7153
7159
  var Input = /* @__PURE__ */ forwardRef(function(param, ref) {
7154
7160
  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;
7155
- var _useTheme = useTheme("Input", styles$y, tweakStyles), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
7161
+ var _useTheme = useTheme("Input", styles$x, tweakStyles), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
7156
7162
  var _useState = _sliced_to_array$k(useState(false), 2), isFocused = _useState[0], setFocused = _useState[1];
7157
7163
  var inputRef = useRef(null);
7158
7164
  var handleChange = function(event) {
@@ -7293,12 +7299,14 @@ var Input = /* @__PURE__ */ forwardRef(function(param, ref) {
7293
7299
  ]
7294
7300
  });
7295
7301
  });
7296
- var styles$x = {
7302
+ var EMPTY_DATE_INPUT_VALUE = "__.__.____";
7303
+ var EMPTY_DATE_RANGE_INPUT_VALUE = "".concat(EMPTY_DATE_INPUT_VALUE, " - ").concat(EMPTY_DATE_INPUT_VALUE);
7304
+ var styles$w = {
7297
7305
  root: {
7298
- cursor: "pointer",
7299
- position: "relative",
7300
7306
  width: "100%",
7301
- height: "100%"
7307
+ height: "100%",
7308
+ cursor: "pointer",
7309
+ position: "relative"
7302
7310
  },
7303
7311
  tweakInput: {}
7304
7312
  };
@@ -7386,71 +7394,57 @@ function _object_without_properties_loose$8(source, excluded) {
7386
7394
  }
7387
7395
  return target;
7388
7396
  }
7389
- var DateInput = function(_param) {
7390
- 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, [
7391
- "isRange",
7397
+ var DateInput = /* @__PURE__ */ forwardRef(function(_param, ref) {
7398
+ 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, [
7392
7399
  "date",
7393
7400
  "startDate",
7394
7401
  "endDate",
7402
+ "mask",
7403
+ "className",
7404
+ "placeholder",
7395
7405
  "data",
7396
- "onChange",
7397
- "tweakStyles"
7406
+ "isRange",
7407
+ "tweakStyles",
7408
+ "onClick",
7409
+ "onChange"
7398
7410
  ]);
7399
- var _useTheme = useTheme("DateInput", styles$x, tweakStyles), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
7400
- var mainProps = isRange ? {
7401
- value: "".concat(startDate).concat(endDate),
7402
- onChange: function(v) {
7403
- return onChange(v !== "__.__.____ - __.__.____" ? v : "");
7404
- },
7405
- mask: "99.99.9999 - 99.99.9999"
7406
- } : {
7407
- value: date,
7408
- onChange: function(v) {
7409
- return onChange(v !== "__.__.____" ? v : "");
7410
- },
7411
- mask: "99.99.9999"
7412
- };
7411
+ var _useTheme = useTheme("DateInput", styles$w, tweakStyles), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
7413
7412
  var tweakInputStyles = useTweakStyles(componentStyles, tweakStyles, "tweakInput");
7413
+ var beforeMaskedStateChange = function(param) {
7414
+ var nextState = param.nextState;
7415
+ if (nextState.value === EMPTY_DATE_INPUT_VALUE || nextState.value === EMPTY_DATE_RANGE_INPUT_VALUE) {
7416
+ return {
7417
+ value: "",
7418
+ selection: {
7419
+ start: 0,
7420
+ end: 0
7421
+ }
7422
+ };
7423
+ }
7424
+ return nextState;
7425
+ };
7426
+ var handleChange = function(value, event) {
7427
+ if (event.type === "click") {
7428
+ event.target.value = "";
7429
+ }
7430
+ onChange === null || onChange === void 0 ? void 0 : onChange(event, value);
7431
+ };
7414
7432
  return /* @__PURE__ */ jsx("div", _object_spread_props$r(_object_spread$z({
7415
- className: classes.root
7433
+ className: clsx(classes.root, className),
7434
+ onClick
7416
7435
  }, addDataAttributes(data)), {
7417
- children: /* @__PURE__ */ jsx(Input, _object_spread_props$r(_object_spread$z({}, mainProps, props), {
7418
- tweakStyles: tweakInputStyles
7436
+ children: /* @__PURE__ */ jsx(Input, _object_spread_props$r(_object_spread$z({}, inputProps), {
7437
+ ref,
7438
+ value: isRange ? "".concat(startDate).concat(endDate) : date,
7439
+ mask: mask !== null && mask !== void 0 ? mask : isRange ? "99.99.9999 - 99.99.9999" : "99.99.9999",
7440
+ placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : isRange ? EMPTY_DATE_RANGE_INPUT_VALUE : EMPTY_DATE_INPUT_VALUE,
7441
+ tweakStyles: tweakInputStyles,
7442
+ onChange: handleChange,
7443
+ beforeMaskedStateChange
7419
7444
  }))
7420
7445
  }));
7421
- };
7422
- const reactDatepicker = "";
7423
- var styles$w = {
7424
- customInput: {
7425
- width: "100%",
7426
- height: "100%"
7427
- },
7428
- s: {
7429
- width: 184,
7430
- height: "100%"
7431
- },
7432
- m: {
7433
- width: 300,
7434
- height: "100%"
7435
- },
7436
- full: {
7437
- width: "100%",
7438
- height: "100%"
7439
- }
7440
- };
7441
- var DatePickerInput = /* @__PURE__ */ forwardRef(function(param, ref) {
7442
- var onClick = param.onClick, children = param.children, _param_size = param.size, size = _param_size === void 0 ? "full" : _param_size, className = param.className;
7443
- var classes = useTheme("DatePickerInput", styles$w).classes;
7444
- return /* @__PURE__ */ jsx("div", {
7445
- className: clsx(classes.customInput, className),
7446
- children: /* @__PURE__ */ jsx("div", {
7447
- className: classes[size],
7448
- onClick,
7449
- ref,
7450
- children
7451
- })
7452
- });
7453
7446
  });
7447
+ const reactDatepicker = "";
7454
7448
  function _assert_this_initialized(self2) {
7455
7449
  if (self2 === void 0) {
7456
7450
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
@@ -9015,20 +9009,13 @@ var styles$s = {
9015
9009
  }
9016
9010
  };
9017
9011
  var DatePickerHeader = function(param) {
9018
- 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;
9012
+ 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;
9019
9013
  var _useTheme = useTheme("DatePickerHeader", styles$s), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
9020
9014
  var years = useMemo(function() {
9021
9015
  return Array.from(Array(41)).map(function(_, i) {
9022
9016
  return getYear(new Date()) - 30 + i;
9023
9017
  });
9024
9018
  }, []);
9025
- var getMonthNumber = useCallback(function(month) {
9026
- return months.findIndex(function(m) {
9027
- return m === month;
9028
- });
9029
- }, [
9030
- months
9031
- ]);
9032
9019
  return /* @__PURE__ */ jsxs("div", {
9033
9020
  className: classes.header,
9034
9021
  children: [
@@ -9044,11 +9031,11 @@ var DatePickerHeader = function(param) {
9044
9031
  children: /* @__PURE__ */ jsx(Select, {
9045
9032
  value: months[getMonth(date)],
9046
9033
  options: months,
9047
- onChange: function(value) {
9048
- return changeMonth(getMonthNumber(value));
9049
- },
9034
+ dropdownIcon: "chevron-down-small",
9050
9035
  tweakStyles: componentStyles.tweakSelect,
9051
- dropdownIcon: "chevron-down-small"
9036
+ onChange: function(value) {
9037
+ return changeMonth(months.indexOf(value));
9038
+ }
9052
9039
  })
9053
9040
  })
9054
9041
  ]
@@ -9065,11 +9052,11 @@ var DatePickerHeader = function(param) {
9065
9052
  children: /* @__PURE__ */ jsx(Select, {
9066
9053
  value: getYear(date),
9067
9054
  options: years,
9068
- onChange: function(value) {
9069
- changeYear(value);
9070
- },
9055
+ dropdownIcon: "chevron-down-small",
9071
9056
  tweakStyles: componentStyles.tweakSelect,
9072
- dropdownIcon: "chevron-down-small"
9057
+ onChange: function(value) {
9058
+ return changeYear(value);
9059
+ }
9073
9060
  })
9074
9061
  })
9075
9062
  ]
@@ -9078,19 +9065,19 @@ var DatePickerHeader = function(param) {
9078
9065
  className: classes.buttons,
9079
9066
  children: [
9080
9067
  /* @__PURE__ */ jsx("button", {
9081
- onClick: decreaseMonth,
9082
- disabled: isPrevMonthButtonDisabled,
9083
- className: classes.btn,
9084
9068
  type: "button",
9069
+ className: classes.btn,
9070
+ disabled: prevMonthButtonDisabled,
9071
+ onClick: decreaseMonth,
9085
9072
  children: /* @__PURE__ */ jsx(Icon, {
9086
9073
  type: "chevron-left"
9087
9074
  })
9088
9075
  }),
9089
9076
  /* @__PURE__ */ jsx("button", {
9090
- onClick: increaseMonth,
9091
- disabled: isNextMonthButtonDisabled,
9092
- className: classes.btn,
9093
9077
  type: "button",
9078
+ className: classes.btn,
9079
+ disabled: nextMonthButtonDisabled,
9080
+ onClick: increaseMonth,
9094
9081
  children: /* @__PURE__ */ jsx(Icon, {
9095
9082
  type: "chevron-right"
9096
9083
  })
@@ -9100,43 +9087,38 @@ var DatePickerHeader = function(param) {
9100
9087
  ]
9101
9088
  });
9102
9089
  };
9090
+ var getDateFormatter = function(dateFormat) {
9091
+ return function(date) {
9092
+ return isNotEmpty(date) ? format$1(date, dateFormat) : "";
9093
+ };
9094
+ };
9095
+ var getDateValueParser = function(dateFormat) {
9096
+ return function(value) {
9097
+ var inputValue = value === EMPTY_DATE_INPUT_VALUE ? "" : value;
9098
+ return isStringNotEmpty(inputValue) ? parse(value, dateFormat, new Date()) : null;
9099
+ };
9100
+ };
9101
+ var areDatesEquals = function(date1, date2) {
9102
+ return isEmpty(date1) && isEmpty(date2) || isNotEmpty(date1) && isNotEmpty(date2) && isSameDay(date1, date2);
9103
+ };
9104
+ var DEFAULT_DATE_FORMAT$2 = "dd.MM.yyyy";
9103
9105
  var styles$r = {
9104
9106
  root: {
9105
9107
  width: "100%",
9106
9108
  height: "100%"
9107
9109
  },
9108
- day: {
9109
- width: 36,
9110
- height: 36,
9111
- lineHeight: "normal",
9112
- boxSizing: "border-box",
9113
- paddingTop: 10,
9114
- fontSize: 16
9115
- },
9116
- datepicker: {
9117
- display: "flex",
9118
- padding: [
9119
- 4,
9120
- 8,
9121
- 20,
9122
- 8
9123
- ],
9124
- width: 320,
9125
- boxSizing: "border-box"
9126
- },
9127
- btnText: {
9128
- marginLeft: "auto"
9129
- },
9110
+ day: {},
9111
+ datepicker: {},
9130
9112
  popper: {
9131
9113
  zIndex: 10,
9132
- marginLeft: function(param) {
9133
- var leftPosition = param.leftPosition;
9134
- return leftPosition;
9135
- },
9136
9114
  marginTop: function(param) {
9137
9115
  var topPosition = param.topPosition;
9138
9116
  return topPosition;
9139
9117
  },
9118
+ marginLeft: function(param) {
9119
+ var leftPosition = param.leftPosition;
9120
+ return leftPosition;
9121
+ },
9140
9122
  '&[data-placement^="bottom"]': {
9141
9123
  paddingTop: 6
9142
9124
  },
@@ -9149,7 +9131,8 @@ var styles$r = {
9149
9131
  '&[data-placement^="right"]': {
9150
9132
  paddingLeft: 6
9151
9133
  }
9152
- }
9134
+ },
9135
+ tweakDateInput: {}
9153
9136
  };
9154
9137
  function _array_like_to_array$i(arr, len) {
9155
9138
  if (len == null || len > arr.length)
@@ -9293,8 +9276,8 @@ function _unsupported_iterable_to_array$i(o, minLen) {
9293
9276
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
9294
9277
  return _array_like_to_array$i(o, minLen);
9295
9278
  }
9296
- var _ReactDatepicker_default;
9297
- var Datepicker = (_ReactDatepicker_default = ReactDatepicker.default) !== null && _ReactDatepicker_default !== void 0 ? _ReactDatepicker_default : ReactDatepicker;
9279
+ var _ReactDatePicker_default;
9280
+ var DatePickerComponent = (_ReactDatePicker_default = ReactDatePicker.default) !== null && _ReactDatePicker_default !== void 0 ? _ReactDatePicker_default : ReactDatePicker;
9298
9281
  var PopperContainer = function(param) {
9299
9282
  var children = param.children;
9300
9283
  return /* @__PURE__ */ jsx(Portal, {
@@ -9302,257 +9285,240 @@ var PopperContainer = function(param) {
9302
9285
  children
9303
9286
  });
9304
9287
  };
9305
- var DEFAULT_DATE_FORMAT$2 = "dd.MM.yyyy";
9306
- var DatePicker = function(_param) {
9307
- 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, [
9288
+ var DatePicker = /* @__PURE__ */ forwardRef(function(_param, ref) {
9289
+ 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, [
9308
9290
  "data",
9309
- "tweakStyles",
9310
9291
  "selectedDate",
9311
9292
  "minDate",
9312
9293
  "maxDate",
9313
9294
  "endDate",
9314
9295
  "startDate",
9315
- "size",
9316
- "isRange",
9317
9296
  "locale",
9318
9297
  "months",
9319
- "calendarStartDay",
9320
- "leftPosition",
9321
9298
  "topPosition",
9322
- "isInline",
9323
- "isNeedClearSelectedDate",
9299
+ "leftPosition",
9300
+ "calendarStartDay",
9324
9301
  "dateFormat",
9325
9302
  "monthsShown",
9326
9303
  "placeholder",
9327
- "shouldGiveValueOnType",
9304
+ "isRange",
9305
+ "isInline",
9306
+ "isDisabled",
9307
+ "isClearable",
9308
+ "focusSelectedMonth",
9328
9309
  "disabledKeyboardNavigation",
9329
9310
  "shouldRenderPopperInBody",
9330
- "popperModifiers",
9311
+ "allowSameDay",
9312
+ "shouldCloseOnSelect",
9331
9313
  "showPreviousMonths",
9314
+ "preventOpenOnFocus",
9315
+ "popperModifiers",
9332
9316
  "popperPlacement",
9317
+ "todayButton",
9318
+ "calendarContainer",
9319
+ "dayClassName",
9320
+ "customInput",
9321
+ "customInputRef",
9322
+ "renderCustomHeader",
9323
+ "filterDate",
9324
+ "onYearChange",
9325
+ "onMonthChange",
9326
+ "onCalendarOpen",
9327
+ "onCalendarClose",
9333
9328
  "onChangeDate",
9334
9329
  "onChangeRange",
9335
- "customHeader",
9336
- "filterDate"
9330
+ "onBlur",
9331
+ "onFocus",
9332
+ "onKeyDown",
9333
+ "tweakStyles"
9337
9334
  ]);
9338
- var classes = useTheme("DatePicker", styles$r, tweakStyles, {
9335
+ var _useTheme = useTheme("DatePicker", styles$r, tweakStyles, {
9339
9336
  leftPosition,
9340
9337
  topPosition
9341
- }).classes;
9338
+ }), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
9339
+ var tweakDateInputStyles = useTweakStyles(componentStyles, tweakStyles, "tweakDateInput");
9340
+ var _useMemo = useMemo(function() {
9341
+ return {
9342
+ formatDate: getDateFormatter(dateFormat),
9343
+ parseDateValue: getDateValueParser(dateFormat)
9344
+ };
9345
+ }, [
9346
+ dateFormat
9347
+ ]), formatDate = _useMemo.formatDate, parseDateValue = _useMemo.parseDateValue;
9342
9348
  var _useState = _sliced_to_array$i(useState(false), 2), isOpen = _useState[0], setIsOpen = _useState[1];
9343
- var _useState1 = _sliced_to_array$i(useState(selectedDate), 2), date = _useState1[0], setDate = _useState1[1];
9344
- var _useState2 = _sliced_to_array$i(useState(selectedDate ? format$1(selectedDate, dateFormat) : ""), 2), dateValue = _useState2[0], setDateValue = _useState2[1];
9345
- var _useState3 = _sliced_to_array$i(useState(startDate), 2), start2 = _useState3[0], setStart = _useState3[1];
9349
+ var _useState1 = _sliced_to_array$i(useState(formatDate(selectedDate)), 2), dateValue = _useState1[0], setDateValue = _useState1[1];
9350
+ var _useState2 = _sliced_to_array$i(useState(startDate), 2), start2 = _useState2[0], setStart = _useState2[1];
9351
+ var _useState3 = _sliced_to_array$i(useState(formatDate(startDate)), 2), startDateValue = _useState3[0], setStartDateValue = _useState3[1];
9346
9352
  var _useState4 = _sliced_to_array$i(useState(endDate), 2), end2 = _useState4[0], setEnd = _useState4[1];
9347
- var _useState5 = _sliced_to_array$i(useState(startDate ? format$1(startDate, dateFormat) : ""), 2), startDateValue = _useState5[0], setStartDateValue = _useState5[1];
9348
- var _useState6 = _sliced_to_array$i(useState(endDate ? format$1(endDate, dateFormat) : ""), 2), endDateValue = _useState6[0], setEndDateValue = _useState6[1];
9349
- var isDateValid = function(value) {
9350
- return isValid(parse(value, dateFormat, new Date()));
9353
+ var _useState5 = _sliced_to_array$i(useState(formatDate(endDate)), 2), endDateValue = _useState5[0], setEndDateValue = _useState5[1];
9354
+ var hasDateInputValue = isRange ? isStringNotEmpty(startDateValue) || isStringNotEmpty(endDateValue) : isStringNotEmpty(dateValue);
9355
+ var dateInputProps = _object_spread$t(_object_spread_props$n(_object_spread$t({}, inputProps), {
9356
+ isRange,
9357
+ isDisabled,
9358
+ isClearable,
9359
+ isActive: isOpen,
9360
+ iconType: isClearable && hasDateInputValue ? void 0 : "calendar",
9361
+ tweakStyles: tweakDateInputStyles
9362
+ }), isRange ? {
9363
+ startDate: startDateValue,
9364
+ endDate: endDateValue
9365
+ } : {
9366
+ date: dateValue
9367
+ });
9368
+ var handleChangeDate = function(value, event) {
9369
+ onChangeDate === null || onChangeDate === void 0 ? void 0 : onChangeDate(value, event);
9351
9370
  };
9352
- var parseStringToDate = function(value) {
9353
- return parse(value, dateFormat, new Date());
9371
+ var isDateInRange = function(date) {
9372
+ return (isEmpty(minDate) || isAfter(date, minDate)) && (isEmpty(maxDate) || isBefore(date, maxDate));
9354
9373
  };
9355
- var handleDateChange = useCallback(function(newDate) {
9356
- if (onChangeDate) {
9357
- if (!newDate) {
9358
- onChangeDate(null, newDate);
9359
- }
9360
- if (newDate && isDateValid(newDate)) {
9361
- onChangeDate(parseStringToDate(newDate));
9362
- }
9374
+ var handleChangeRange = function(value, event) {
9375
+ if (allowSameDay || !areDatesEquals(value === null || value === void 0 ? void 0 : value[0], startDate) || !areDatesEquals(value === null || value === void 0 ? void 0 : value[1], endDate)) {
9376
+ var _value_;
9377
+ setStart((_value_ = value === null || value === void 0 ? void 0 : value[0]) !== null && _value_ !== void 0 ? _value_ : null);
9378
+ var _value_1;
9379
+ setEnd((_value_1 = value === null || value === void 0 ? void 0 : value[1]) !== null && _value_1 !== void 0 ? _value_1 : null);
9380
+ onChangeRange === null || onChangeRange === void 0 ? void 0 : onChangeRange(value, event);
9363
9381
  }
9364
- setDateValue(newDate);
9365
- }, [
9366
- onChangeDate
9367
- ]);
9368
- var handleRangeChange = useCallback(function(newDate) {
9369
- if (!newDate && onChangeRange) {
9370
- onChangeRange(null);
9371
- setStartDateValue("");
9372
- setEndDateValue("");
9373
- }
9374
- var newStartDate = newDate.slice(0, 10);
9375
- var newEndDate = newDate.slice(13);
9376
- setStartDateValue(newStartDate);
9377
- setEndDateValue(newEndDate);
9378
- if (newStartDate && isDateValid(newStartDate)) {
9379
- setStart(parseStringToDate(newStartDate));
9380
- }
9381
- if (newEndDate && isDateValid(newEndDate)) {
9382
- setEnd(parseStringToDate(newEndDate));
9383
- }
9384
- if (newStartDate && newEndDate && isDateValid(newStartDate) && isDateValid(newEndDate) && onChangeRange) {
9385
- onChangeRange([
9386
- parseStringToDate(newStartDate),
9387
- parseStringToDate(newEndDate)
9382
+ };
9383
+ var handleChangeDateRangeInput = function(value) {
9384
+ var newStartDateValue = value.slice(0, 10);
9385
+ var newStart = parseDateValue(newStartDateValue);
9386
+ var newEndDateValue = value.slice(13);
9387
+ var newEnd = parseDateValue(newEndDateValue);
9388
+ if (isNotEmpty(newStart) && !isValid(newStart) || isNotEmpty(newStart) && !isDateInRange(newStart)) {
9389
+ newStart = start2;
9390
+ }
9391
+ if (isNotEmpty(newEnd) && !isValid(newEnd) || isNotEmpty(newEnd) && !isDateInRange(newEnd)) {
9392
+ newEnd = end2;
9393
+ }
9394
+ if (isEmpty(newStart) && isValid(newEnd) || // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
9395
+ isValid(newStart) && isValid(newEnd) && isAfter(newStart, newEnd)) {
9396
+ newStart = newEnd;
9397
+ newEnd = null;
9398
+ }
9399
+ setStartDateValue(newStartDateValue);
9400
+ setStart(newStart);
9401
+ setEndDateValue(newEndDateValue);
9402
+ setEnd(newEnd);
9403
+ };
9404
+ var handleDateInputBlur = function(event) {
9405
+ onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
9406
+ setDateValue(formatDate(selectedDate));
9407
+ };
9408
+ var setDateRangeValues = function() {
9409
+ var startValue = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null, endValue = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;
9410
+ var convertedStartDate = formatDate(startValue);
9411
+ var convertedEndDate = formatDate(endValue);
9412
+ if (convertedStartDate === "" && convertedEndDate !== "") {
9413
+ convertedStartDate = EMPTY_DATE_INPUT_VALUE;
9414
+ }
9415
+ setStart(startValue);
9416
+ setStartDateValue(convertedStartDate);
9417
+ setEnd(endValue);
9418
+ setEndDateValue(convertedEndDate);
9419
+ };
9420
+ var handleDateRangeInputBlur = function(event) {
9421
+ onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
9422
+ handleChangeRange([
9423
+ start2,
9424
+ end2
9425
+ ], event);
9426
+ setDateRangeValues(start2, end2);
9427
+ };
9428
+ var handleOpenCalendar = function() {
9429
+ setIsOpen(true);
9430
+ onCalendarOpen === null || onCalendarOpen === void 0 ? void 0 : onCalendarOpen();
9431
+ };
9432
+ var handleCloseCalendar = function() {
9433
+ setIsOpen(false);
9434
+ if (isRange) {
9435
+ handleChangeRange([
9436
+ start2,
9437
+ end2
9388
9438
  ]);
9439
+ setDateRangeValues(start2, end2);
9440
+ } else {
9441
+ setDateValue(formatDate(selectedDate));
9389
9442
  }
9390
- }, [
9391
- onChangeRange
9392
- ]);
9393
- useEffect(function() {
9394
- setDateValue("");
9395
- }, [
9396
- isNeedClearSelectedDate
9397
- ]);
9443
+ onCalendarClose === null || onCalendarClose === void 0 ? void 0 : onCalendarClose();
9444
+ };
9398
9445
  useEffect(function() {
9399
- setDate(selectedDate);
9400
- setStart(startDate);
9401
- setEnd(endDate);
9402
- setStartDateValue(startDate ? format$1(startDate, dateFormat) : "");
9403
- setEndDateValue(endDate ? format$1(endDate, dateFormat) : "");
9404
- setDateValue(selectedDate ? format$1(selectedDate, dateFormat) : "");
9446
+ setDateValue(formatDate(selectedDate));
9447
+ setDateRangeValues(startDate, endDate);
9405
9448
  }, [
9406
9449
  selectedDate,
9407
9450
  startDate,
9408
9451
  endDate
9409
9452
  ]);
9410
- var onTabConfirm = function(event) {
9411
- if (event.key === "9") {
9412
- setIsOpen(false);
9413
- }
9414
- };
9415
- useEffect(function() {
9416
- document.addEventListener("keydown", onTabConfirm);
9417
- return function() {
9418
- return document.removeEventListener("keydown", onTabConfirm);
9419
- };
9420
- }, []);
9421
- var handleBlur = function(e) {
9422
- if (inputProps.onBlur) {
9423
- inputProps.onBlur(e);
9424
- }
9425
- if (shouldGiveValueOnType && onChangeDate && !isDateValid(dateValue)) {
9426
- onChangeDate(null, dateValue);
9427
- return;
9428
- }
9429
- if (onChangeDate && date) {
9430
- if (!isDateValid(dateValue)) {
9431
- onChangeDate(null);
9432
- setDateValue("");
9433
- } else if (maxDate && isAfter(date, maxDate)) {
9434
- onChangeDate(maxDate);
9435
- } else if (minDate && isAfter(minDate, date)) {
9436
- onChangeDate(minDate);
9437
- }
9438
- }
9439
- };
9440
- var handleRangeBlur = function(e) {
9441
- if (inputProps.onBlur) {
9442
- inputProps.onBlur(e);
9443
- }
9444
- if (onChangeRange && start2 && end2) {
9445
- if (!isDateValid(startDateValue) && endDateValue) {
9446
- setStartDateValue(placeholder);
9447
- }
9448
- if (!isDateValid(endDateValue)) {
9449
- setEndDateValue("");
9450
- } else if (maxDate && isAfter(start2, maxDate)) {
9451
- onChangeRange([
9452
- maxDate,
9453
- end2
9454
- ]);
9455
- } else if (minDate && isAfter(minDate, end2)) {
9456
- onChangeRange([
9457
- start2,
9458
- start2
9459
- ]);
9460
- }
9461
- }
9462
- };
9463
- var datePickerProps = {
9464
- dateFormat,
9465
- calendarStartDay,
9466
- locale: locale2,
9467
- popperModifiers,
9468
- popperPlacement,
9469
- monthsShown,
9470
- showPreviousMonths,
9471
- disabledKeyboardNavigation,
9472
- inline: isInline,
9473
- disabled: inputProps.isDisabled,
9474
- showPopperArrow: false,
9475
- popperClassName: classes.popper,
9476
- calendarClassName: classes.datepicker,
9477
- popperContainer: shouldRenderPopperInBody ? PopperContainer : void 0,
9478
- selectsRange: isRange,
9479
- onChange: function() {
9480
- return null;
9481
- },
9482
- dayClassName: function() {
9483
- return classes.day;
9484
- },
9485
- filterDate
9486
- };
9487
- var dateInputProps = _object_spread_props$n(_object_spread$t({}, inputProps), {
9488
- tweakStyles,
9489
- iconType: inputProps.isClearable && dateValue !== "" ? void 0 : "calendar",
9490
- isRange,
9491
- // eslint-disable-next-line @typescript-eslint/no-empty-function
9492
- onChange: function() {
9493
- }
9494
- });
9495
- if (onChangeRange) {
9496
- datePickerProps = _object_spread_props$n(_object_spread$t({}, datePickerProps), {
9497
- startDate: start2,
9498
- endDate: end2,
9499
- selectsRange: true,
9500
- selected: startDate,
9501
- onChange: onChangeRange
9502
- });
9503
- dateInputProps = _object_spread_props$n(_object_spread$t({}, dateInputProps), {
9504
- startDate: startDateValue,
9505
- endDate: endDateValue,
9506
- onBlur: handleRangeBlur,
9507
- onChange: handleRangeChange
9508
- });
9509
- }
9510
- if (onChangeDate) {
9511
- datePickerProps = _object_spread_props$n(_object_spread$t({}, datePickerProps), {
9512
- selected: date,
9513
- onChange: function(newDate) {
9514
- return onChangeDate(newDate);
9515
- },
9516
- onCalendarOpen: function() {
9517
- return setIsOpen(true);
9518
- },
9519
- onCalendarClose: function() {
9520
- return setIsOpen(false);
9521
- },
9522
- minDate,
9523
- maxDate
9524
- });
9525
- dateInputProps = _object_spread_props$n(_object_spread$t({}, dateInputProps), {
9526
- date: dateValue,
9527
- isActive: isOpen,
9528
- onBlur: handleBlur,
9529
- onChange: handleDateChange
9530
- });
9531
- }
9532
9453
  return /* @__PURE__ */ jsx("div", _object_spread_props$n(_object_spread$t({
9533
9454
  className: classes.root
9534
9455
  }, addDataAttributes(data)), {
9535
- children: /* @__PURE__ */ jsx(Datepicker, _object_spread_props$n(_object_spread$t({}, datePickerProps), {
9536
- customInput: /* @__PURE__ */ jsx(DatePickerInput, {
9537
- size,
9538
- children: /* @__PURE__ */ jsx(DateInput, _object_spread$t({}, dateInputProps))
9539
- }),
9540
- renderCustomHeader: customHeader !== void 0 ? customHeader : function(param) {
9541
- var renderDate = param.date, changeYear = param.changeYear, changeMonth = param.changeMonth, decreaseMonth = param.decreaseMonth, increaseMonth = param.increaseMonth, prevMonthButtonDisabled = param.prevMonthButtonDisabled, nextMonthButtonDisabled = param.nextMonthButtonDisabled;
9542
- return /* @__PURE__ */ jsx(DatePickerHeader, {
9543
- date: renderDate,
9544
- changeMonth,
9545
- changeYear,
9546
- decreaseMonth,
9547
- increaseMonth,
9548
- isPrevMonthButtonDisabled: prevMonthButtonDisabled,
9549
- isNextMonthButtonDisabled: nextMonthButtonDisabled,
9456
+ children: /* @__PURE__ */ jsx(DatePickerComponent, _object_spread$t({
9457
+ ref,
9458
+ minDate,
9459
+ maxDate,
9460
+ locale: locale2,
9461
+ dateFormat,
9462
+ placeholderText: placeholder,
9463
+ calendarStartDay,
9464
+ inline: isInline,
9465
+ disabled: isDisabled,
9466
+ showPreviousMonths,
9467
+ focusSelectedMonth,
9468
+ monthsShown,
9469
+ allowSameDay,
9470
+ showPopperArrow: false,
9471
+ popperClassName: classes.popper,
9472
+ calendarClassName: classes.datepicker,
9473
+ dayClassName: function(v) {
9474
+ return clsx(classes.day, dayClassName === null || dayClassName === void 0 ? void 0 : dayClassName(v));
9475
+ },
9476
+ disabledKeyboardNavigation,
9477
+ popperContainer: shouldRenderPopperInBody ? PopperContainer : void 0,
9478
+ popperModifiers,
9479
+ popperPlacement,
9480
+ selectsRange: isRange,
9481
+ preventOpenOnFocus,
9482
+ shouldCloseOnSelect,
9483
+ customInputRef,
9484
+ customInput: /* @__PURE__ */ jsx(CustomInput, _object_spread$t({}, dateInputProps)),
9485
+ renderCustomHeader: renderCustomHeader !== null && renderCustomHeader !== void 0 ? renderCustomHeader : function(baseProps) {
9486
+ return /* @__PURE__ */ jsx(DatePickerHeader, _object_spread_props$n(_object_spread$t({}, baseProps), {
9550
9487
  months
9551
- });
9488
+ }));
9489
+ },
9490
+ todayButton,
9491
+ calendarContainer,
9492
+ filterDate,
9493
+ onYearChange,
9494
+ onMonthChange,
9495
+ onFocus,
9496
+ onKeyDown,
9497
+ onCalendarOpen: handleOpenCalendar,
9498
+ onCalendarClose: handleCloseCalendar,
9499
+ onChangeRaw: function(_, value) {
9500
+ if (value === void 0) {
9501
+ return;
9502
+ }
9503
+ if (isRange) {
9504
+ handleChangeDateRangeInput(value);
9505
+ } else {
9506
+ setDateValue(value);
9507
+ }
9552
9508
  }
9509
+ }, isRange ? {
9510
+ startDate: start2,
9511
+ endDate: end2,
9512
+ selected: start2,
9513
+ onBlur: handleDateRangeInputBlur,
9514
+ onChange: handleChangeRange
9515
+ } : {
9516
+ selected: selectedDate,
9517
+ onBlur: handleDateInputBlur,
9518
+ onChange: handleChangeDate
9553
9519
  }))
9554
9520
  }));
9555
- };
9521
+ });
9556
9522
  var styles$q = {
9557
9523
  root: {},
9558
9524
  button: {
@@ -13981,26 +13947,24 @@ var FilterWithDates = function(param) {
13981
13947
  localeKey,
13982
13948
  locale2
13983
13949
  ]);
13984
- var _useState2 = _sliced_to_array$c(useState(false), 2), isNeedClearSelectedDate = _useState2[0], setNeedClearSelectedDate = _useState2[1];
13985
13950
  var topPosition = !isClearable && onStartBtnSubmit === void 0 ? 28 : 60;
13986
13951
  var handleClear = function() {
13987
13952
  onEndBtnSubmit();
13988
- setNeedClearSelectedDate(!isNeedClearSelectedDate);
13989
13953
  };
13990
13954
  var ref = useRef(null);
13991
13955
  var isOpenCalendar = isOpenFrom || isOpenTo;
13992
13956
  var handleFromSelected = function(val) {
13993
- var _value_to2;
13957
+ var _value_to;
13994
13958
  onChange({
13995
13959
  from: val,
13996
- to: (_value_to2 = value === null || value === void 0 ? void 0 : value.to) !== null && _value_to2 !== void 0 ? _value_to2 : null
13960
+ to: (_value_to = value === null || value === void 0 ? void 0 : value.to) !== null && _value_to !== void 0 ? _value_to : null
13997
13961
  });
13998
13962
  setOpenFrom(false);
13999
13963
  };
14000
13964
  var handleToSelected = function(val) {
14001
- var _value_from2;
13965
+ var _value_from;
14002
13966
  onChange({
14003
- from: (_value_from2 = value === null || value === void 0 ? void 0 : value.from) !== null && _value_from2 !== void 0 ? _value_from2 : null,
13967
+ from: (_value_from = value === null || value === void 0 ? void 0 : value.from) !== null && _value_from !== void 0 ? _value_from : null,
14004
13968
  to: val
14005
13969
  });
14006
13970
  setOpenTo(false);
@@ -14012,10 +13976,10 @@ var FilterWithDates = function(param) {
14012
13976
  to: val
14013
13977
  });
14014
13978
  } else {
14015
- var _value_to2;
13979
+ var _value_to;
14016
13980
  onChange({
14017
13981
  from: val,
14018
- to: (_value_to2 = value === null || value === void 0 ? void 0 : value.to) !== null && _value_to2 !== void 0 ? _value_to2 : null
13982
+ to: (_value_to = value === null || value === void 0 ? void 0 : value.to) !== null && _value_to !== void 0 ? _value_to : null
14019
13983
  });
14020
13984
  }
14021
13985
  };
@@ -14026,16 +13990,16 @@ var FilterWithDates = function(param) {
14026
13990
  to: value.from
14027
13991
  });
14028
13992
  } else {
14029
- var _value_from2;
13993
+ var _value_from;
14030
13994
  onChange({
14031
- from: (_value_from2 = value === null || value === void 0 ? void 0 : value.from) !== null && _value_from2 !== void 0 ? _value_from2 : null,
13995
+ from: (_value_from = value === null || value === void 0 ? void 0 : value.from) !== null && _value_from !== void 0 ? _value_from : null,
14032
13996
  to: val
14033
13997
  });
14034
13998
  }
14035
13999
  };
14036
14000
  var tweakClearButtonStyles = useTweakStyles(componentStyles, tweakStyles, "tweakClearButton");
14037
14001
  var tweakBackButtonStyles = useTweakStyles(componentStyles, tweakStyles, "tweakBackButton");
14038
- var _value_from, _value_to, _ref;
14002
+ var _ref;
14039
14003
  return /* @__PURE__ */ jsxs("div", _object_spread_props$h(_object_spread$j({
14040
14004
  className: classes.root
14041
14005
  }, addDataAttributes(data)), {
@@ -14046,7 +14010,7 @@ var FilterWithDates = function(param) {
14046
14010
  /* @__PURE__ */ jsx("div", {
14047
14011
  className: classes.containerItem,
14048
14012
  children: /* @__PURE__ */ jsx(DatePicker, _object_spread$j({
14049
- selectedDate: (_value_from = value === null || value === void 0 ? void 0 : value.from) !== null && _value_from !== void 0 ? _value_from : null,
14013
+ selectedDate: value === null || value === void 0 ? void 0 : value.from,
14050
14014
  maxDate: value === null || value === void 0 ? void 0 : value.to,
14051
14015
  label: translates.from,
14052
14016
  months: translates.months,
@@ -14054,16 +14018,15 @@ var FilterWithDates = function(param) {
14054
14018
  onChangeDate: handleChangeFrom,
14055
14019
  leftPosition: -20,
14056
14020
  topPosition,
14057
- isNeedClearSelectedDate,
14058
14021
  border: "bottom",
14059
- testId: testId !== void 0 ? "".concat(testId, "-from") : void 0,
14022
+ testId: getTestId(testId, "from"),
14060
14023
  isClearable
14061
14024
  }, startPickerProps))
14062
14025
  }),
14063
14026
  /* @__PURE__ */ jsx("div", {
14064
14027
  className: classes.containerItem,
14065
14028
  children: /* @__PURE__ */ jsx(DatePicker, _object_spread$j({
14066
- selectedDate: (_value_to = value === null || value === void 0 ? void 0 : value.to) !== null && _value_to !== void 0 ? _value_to : null,
14029
+ selectedDate: value === null || value === void 0 ? void 0 : value.to,
14067
14030
  label: translates.to,
14068
14031
  months: translates.months,
14069
14032
  minDate: value === null || value === void 0 ? void 0 : value.from,
@@ -14071,9 +14034,8 @@ var FilterWithDates = function(param) {
14071
14034
  onChangeDate: handleChangeTo,
14072
14035
  topPosition,
14073
14036
  leftPosition: -170,
14074
- isNeedClearSelectedDate,
14075
14037
  border: "bottom",
14076
- testId: testId !== void 0 ? "".concat(testId, "-to") : void 0,
14038
+ testId: getTestId(testId, "to"),
14077
14039
  isClearable
14078
14040
  }, endPickerProps))
14079
14041
  })
@@ -14087,7 +14049,7 @@ var FilterWithDates = function(param) {
14087
14049
  onClick: handleClear,
14088
14050
  size: "s",
14089
14051
  view: "text",
14090
- testId: testId !== void 0 ? "".concat(testId, "-clear-button") : void 0,
14052
+ testId: getTestId(testId, "clear-button"),
14091
14053
  isFullWidth: true,
14092
14054
  tweakStyles: tweakClearButtonStyles,
14093
14055
  children: translates.clear
@@ -28057,6 +28019,8 @@ export {
28057
28019
  DateInput,
28058
28020
  DatePicker,
28059
28021
  Description,
28022
+ EMPTY_DATE_INPUT_VALUE,
28023
+ EMPTY_DATE_RANGE_INPUT_VALUE,
28060
28024
  FilterInterval,
28061
28025
  FilterLocales,
28062
28026
  FilterMultiSelect,
@@ -28121,6 +28085,7 @@ export {
28121
28085
  hasExactParent,
28122
28086
  isElementOffScreen,
28123
28087
  isElementOneOfParents,
28088
+ isEmpty,
28124
28089
  isInt,
28125
28090
  isNotEmpty,
28126
28091
  isSpaceChar,