@widergy/energy-ui 2.10.1 → 3.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 (288) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/components/EnergyThemeProvider/index.js +12 -34
  3. package/dist/components/Loading/constants.js +1 -1
  4. package/dist/components/Loading/index.js +12 -10
  5. package/dist/components/Loading/theme.js +6 -3
  6. package/dist/components/UTAlert/AlertHandler.js +74 -99
  7. package/dist/components/UTAlert/index.js +64 -85
  8. package/dist/components/UTAlert/theme.js +34 -32
  9. package/dist/components/UTAttachment/components/Preview/index.js +7 -7
  10. package/dist/components/UTAttachment/constants.js +6 -6
  11. package/dist/components/UTAttachment/index.js +167 -257
  12. package/dist/components/UTAttachment/layout.js +25 -25
  13. package/dist/components/UTAttachment/theme.js +6 -3
  14. package/dist/components/UTAttachment/utils.js +44 -117
  15. package/dist/components/UTAutocomplete/components/ListBox/index.js +12 -19
  16. package/dist/components/UTAutocomplete/components/ListBox/utils.js +11 -12
  17. package/dist/components/UTAutocomplete/constants.js +11 -11
  18. package/dist/components/UTAutocomplete/index.js +53 -92
  19. package/dist/components/UTAutocomplete/theme.js +9 -5
  20. package/dist/components/UTAvatar/constants.js +1 -1
  21. package/dist/components/UTAvatar/index.js +17 -15
  22. package/dist/components/UTBarChart/components/Bars/components/Bar/components/Rect/index.js +21 -20
  23. package/dist/components/UTBarChart/components/Bars/components/Bar/constants.js +2 -1
  24. package/dist/components/UTBarChart/components/Bars/components/Bar/index.js +20 -20
  25. package/dist/components/UTBarChart/components/Bars/constants.js +3 -3
  26. package/dist/components/UTBarChart/components/Bars/index.js +69 -78
  27. package/dist/components/UTBarChart/components/Legend/constants.js +14 -17
  28. package/dist/components/UTBarChart/components/Legend/index.js +74 -91
  29. package/dist/components/UTBarChart/components/Legend/utils.js +2 -5
  30. package/dist/components/UTBarChart/components/Levels/index.js +15 -12
  31. package/dist/components/UTBarChart/components/Levels/utils.js +26 -27
  32. package/dist/components/UTBarChart/components/LinearPlot/constants.js +2 -2
  33. package/dist/components/UTBarChart/components/LinearPlot/index.js +24 -18
  34. package/dist/components/UTBarChart/components/LinearPlot/utils.js +39 -39
  35. package/dist/components/UTBarChart/components/Pagination/constants.js +1 -1
  36. package/dist/components/UTBarChart/components/Pagination/index.js +19 -22
  37. package/dist/components/UTBarChart/components/XAxis/components/AxisElement/index.js +20 -30
  38. package/dist/components/UTBarChart/components/XAxis/components/Decoration/constants.js +2 -2
  39. package/dist/components/UTBarChart/components/XAxis/components/Decoration/index.js +19 -17
  40. package/dist/components/UTBarChart/components/XAxis/constants.js +1 -1
  41. package/dist/components/UTBarChart/components/XAxis/index.js +53 -63
  42. package/dist/components/UTBarChart/components/YAxis/AxisElement/index.js +11 -9
  43. package/dist/components/UTBarChart/components/YAxis/constants.js +1 -1
  44. package/dist/components/UTBarChart/components/YAxis/index.js +29 -35
  45. package/dist/components/UTBarChart/components/YAxis/utils.js +6 -6
  46. package/dist/components/UTBarChart/constants.js +4 -4
  47. package/dist/components/UTBarChart/hooks/use-dynamic-margins.js +22 -38
  48. package/dist/components/UTBarChart/index.js +151 -164
  49. package/dist/components/UTBarChart/theme.js +6 -3
  50. package/dist/components/UTBarChart/types.js +9 -9
  51. package/dist/components/UTBarChart/utils.js +118 -111
  52. package/dist/components/UTBreadcrumbs/constants.js +22 -24
  53. package/dist/components/UTBreadcrumbs/index.js +75 -99
  54. package/dist/components/UTBreadcrumbs/styles.module.scss +1 -0
  55. package/dist/components/UTBreadcrumbs/theme.js +6 -3
  56. package/dist/components/UTButton/constants.js +11 -11
  57. package/dist/components/UTButton/index.js +27 -29
  58. package/dist/components/UTButton/theme.js +26 -24
  59. package/dist/components/UTCBUInput/index.js +35 -38
  60. package/dist/components/UTCBUInput/theme.js +6 -3
  61. package/dist/components/UTCaptcha/index.js +18 -43
  62. package/dist/components/UTCard/components/UTCardFooter/index.js +14 -14
  63. package/dist/components/UTCard/index.js +89 -123
  64. package/dist/components/UTCard/theme.js +13 -13
  65. package/dist/components/UTCard/types.js +1 -1
  66. package/dist/components/UTCarousel/components/Button/index.js +12 -11
  67. package/dist/components/UTCarousel/components/Legend/index.js +12 -13
  68. package/dist/components/UTCarousel/components/Slider/component/Slide/index.js +15 -14
  69. package/dist/components/UTCarousel/components/Slider/constants.js +5 -5
  70. package/dist/components/UTCarousel/components/Slider/index.js +213 -281
  71. package/dist/components/UTCarousel/components/Slider/layout.js +66 -92
  72. package/dist/components/UTCarousel/index.js +13 -13
  73. package/dist/components/UTCarousel/theme.js +6 -3
  74. package/dist/components/UTCheckList/constants.js +1 -1
  75. package/dist/components/UTCheckList/index.js +71 -91
  76. package/dist/components/UTCheckList/theme.js +34 -32
  77. package/dist/components/UTCheckbox/constants.js +2 -4
  78. package/dist/components/UTCheckbox/index.js +32 -43
  79. package/dist/components/UTCheckbox/theme.js +37 -35
  80. package/dist/components/UTConsumptionBar/components/ConsumptionBarIndicator/index.js +8 -7
  81. package/dist/components/UTConsumptionBar/constants.js +3 -3
  82. package/dist/components/UTConsumptionBar/index.js +52 -78
  83. package/dist/components/UTCuit/index.js +114 -137
  84. package/dist/components/UTCuit/theme.js +52 -53
  85. package/dist/components/UTDatePicker/components/Day/constants.js +1 -1
  86. package/dist/components/UTDatePicker/components/Day/index.js +11 -10
  87. package/dist/components/UTDatePicker/constants.js +21 -22
  88. package/dist/components/UTDatePicker/index.js +60 -102
  89. package/dist/components/UTDatePicker/theme.js +8 -4
  90. package/dist/components/UTDatePicker/types.js +1 -1
  91. package/dist/components/UTDatePicker/utils.js +4 -6
  92. package/dist/components/UTDialog/constants.js +2 -2
  93. package/dist/components/UTDialog/index.js +37 -35
  94. package/dist/components/UTDialog/theme.js +6 -3
  95. package/dist/components/UTDialog/types.js +1 -1
  96. package/dist/components/UTDotMenu/index.js +40 -61
  97. package/dist/components/UTEmojiPicker/constants.js +14 -18
  98. package/dist/components/UTEmojiPicker/index.js +46 -64
  99. package/dist/components/UTEmojiPicker/styles.module.scss +1 -1
  100. package/dist/components/UTEmojiPicker/theme.js +6 -3
  101. package/dist/components/UTEmojiPicker/utils.js +24 -52
  102. package/dist/components/UTExternalLink/constants.js +2 -2
  103. package/dist/components/UTExternalLink/index.js +17 -13
  104. package/dist/components/UTExternalLink/theme.js +11 -7
  105. package/dist/components/UTFileInput/constants.js +2 -2
  106. package/dist/components/UTFileInput/index.js +6 -29
  107. package/dist/components/UTFileInput/layout.js +72 -96
  108. package/dist/components/UTIconButton/index.js +48 -70
  109. package/dist/components/UTIconButton/theme.js +6 -3
  110. package/dist/components/UTImageRadio/components/ImageRadioCard/index.js +52 -56
  111. package/dist/components/UTImageRadio/constants.js +3 -3
  112. package/dist/components/UTImageRadio/index.js +38 -45
  113. package/dist/components/UTImageRadio/theme.js +13 -13
  114. package/dist/components/UTImageRadio/types.js +1 -1
  115. package/dist/components/UTImageRadio/utils.js +4 -6
  116. package/dist/components/UTLabel/constants.js +13 -11
  117. package/dist/components/UTLabel/index.js +17 -18
  118. package/dist/components/UTLabel/theme.js +19 -16
  119. package/dist/components/UTList/index.js +14 -16
  120. package/dist/components/UTLoading/index.js +14 -13
  121. package/dist/components/UTMap/components/GoogleMaps/constants.js +9 -10
  122. package/dist/components/UTMap/components/GoogleMaps/index.js +62 -89
  123. package/dist/components/UTMap/constants.js +6 -6
  124. package/dist/components/UTMap/index.js +162 -196
  125. package/dist/components/UTMap/types.js +3 -3
  126. package/dist/components/UTMap/utils.js +35 -46
  127. package/dist/components/UTMap/withGoogleMapScript.js +11 -15
  128. package/dist/components/UTMenu/index.js +51 -67
  129. package/dist/components/UTMenu/styles.module.scss +5 -5
  130. package/dist/components/UTMenu/theme.js +8 -4
  131. package/dist/components/UTMenu/utils.js +10 -12
  132. package/dist/components/UTModal/constants.js +13 -17
  133. package/dist/components/UTModal/index.js +25 -28
  134. package/dist/components/UTModal/styles.module.scss +1 -1
  135. package/dist/components/UTModal/theme.js +6 -3
  136. package/dist/components/UTPagination/components/PageSizeSelector/index.js +10 -8
  137. package/dist/components/UTPagination/components/PageSizeSelector/utils.js +9 -14
  138. package/dist/components/UTPagination/components/Pagination/components/NavigationButton/index.js +11 -10
  139. package/dist/components/UTPagination/components/Pagination/index.js +31 -45
  140. package/dist/components/UTPagination/components/Pagination/utils.js +10 -15
  141. package/dist/components/UTPagination/constants.js +3 -3
  142. package/dist/components/UTPagination/index.js +15 -15
  143. package/dist/components/UTPagination/theme.js +6 -3
  144. package/dist/components/UTPanel/index.js +37 -42
  145. package/dist/components/UTPasswordField/components/PasswordValidations/components/Error/index.js +12 -8
  146. package/dist/components/UTPasswordField/components/PasswordValidations/components/Validation/index.js +21 -17
  147. package/dist/components/UTPasswordField/components/PasswordValidations/index.js +62 -48
  148. package/dist/components/UTPasswordField/components/PasswordWarning/index.js +24 -24
  149. package/dist/components/UTPasswordField/index.js +25 -21
  150. package/dist/components/UTPasswordField/theme.js +6 -3
  151. package/dist/components/UTPhoneInput/constants.js +3 -3
  152. package/dist/components/UTPhoneInput/index.js +185 -209
  153. package/dist/components/UTPhoneInput/theme.js +79 -77
  154. package/dist/components/UTPieChart/components/ArrowLabel/constants.js +4 -4
  155. package/dist/components/UTPieChart/components/ArrowLabel/index.js +23 -21
  156. package/dist/components/UTPieChart/components/Legend/contants.js +3 -3
  157. package/dist/components/UTPieChart/components/Legend/index.js +26 -22
  158. package/dist/components/UTPieChart/constants.js +13 -13
  159. package/dist/components/UTPieChart/hooks/use-animated-value/index.js +14 -31
  160. package/dist/components/UTPieChart/index.js +72 -74
  161. package/dist/components/UTPieChart/theme.js +6 -3
  162. package/dist/components/UTPieChart/utils.js +6 -3
  163. package/dist/components/UTProgressBar/constants.js +2 -2
  164. package/dist/components/UTProgressBar/index.js +14 -15
  165. package/dist/components/UTProgressBar/theme.js +6 -3
  166. package/dist/components/UTProgressBar/types.js +1 -1
  167. package/dist/components/UTRadioGroup/index.js +55 -81
  168. package/dist/components/UTRadioGroup/theme.js +54 -52
  169. package/dist/components/UTRating/components/Circle/index.js +40 -54
  170. package/dist/components/UTRating/components/Faces/assets/mood-confuzed.svg +3 -0
  171. package/dist/components/UTRating/components/Faces/assets/mood-empty.svg +3 -0
  172. package/dist/components/UTRating/components/Faces/assets/mood-happy.svg +3 -0
  173. package/dist/components/UTRating/components/Faces/assets/mood-sad.svg +3 -0
  174. package/dist/components/UTRating/components/Faces/assets/mood-smile.svg +3 -0
  175. package/dist/components/UTRating/components/Faces/constants.js +80 -0
  176. package/dist/components/UTRating/components/Faces/index.js +76 -0
  177. package/dist/components/UTRating/components/Faces/styles.module.scss +78 -0
  178. package/dist/components/UTRating/components/Star/index.js +35 -38
  179. package/dist/components/UTRating/constants.js +5 -4
  180. package/dist/components/UTRating/index.js +35 -46
  181. package/dist/components/UTRating/styles.module.scss +1 -0
  182. package/dist/components/UTRating/theme.js +52 -3
  183. package/dist/components/UTRipple/Ripple.js +21 -37
  184. package/dist/components/UTRipple/index.js +17 -35
  185. package/dist/components/UTSelect/components/Option/index.js +12 -11
  186. package/dist/components/UTSelect/constants.js +4 -4
  187. package/dist/components/UTSelect/index.js +62 -83
  188. package/dist/components/UTSelect/theme.js +9 -5
  189. package/dist/components/UTSelect/utils.js +5 -14
  190. package/dist/components/UTSidebar/components/ListOption/index.js +33 -47
  191. package/dist/components/UTSidebar/components/LogosContainer/components/DynamicIcon/index.js +7 -6
  192. package/dist/components/UTSidebar/components/LogosContainer/index.js +13 -12
  193. package/dist/components/UTSidebar/components/Option/constants.js +1 -1
  194. package/dist/components/UTSidebar/components/Option/index.js +27 -30
  195. package/dist/components/UTSidebar/components/Toggler/index.js +10 -9
  196. package/dist/components/UTSidebar/index.js +41 -51
  197. package/dist/components/UTSidebar/theme.js +6 -3
  198. package/dist/components/UTSidebar/types.js +5 -5
  199. package/dist/components/UTSkeleton/index.js +9 -34
  200. package/dist/components/UTStatus/constants.js +4 -4
  201. package/dist/components/UTStatus/index.js +15 -13
  202. package/dist/components/UTStatus/theme.js +75 -59
  203. package/dist/components/UTSwitch/constants.js +3 -3
  204. package/dist/components/UTSwitch/index.js +41 -55
  205. package/dist/components/UTSwitch/theme.js +6 -3
  206. package/dist/components/UTTable/components/ActionIcons/constants.js +1 -1
  207. package/dist/components/UTTable/components/ActionIcons/index.js +46 -83
  208. package/dist/components/UTTable/components/Cell/components/ActionButton/index.js +9 -10
  209. package/dist/components/UTTable/components/Cell/index.js +17 -21
  210. package/dist/components/UTTable/components/HeaderCell/constants.js +1 -1
  211. package/dist/components/UTTable/components/HeaderCell/index.js +22 -28
  212. package/dist/components/UTTable/components/HeaderCell/utils.js +5 -4
  213. package/dist/components/UTTable/components/PrimaryAction/index.js +11 -9
  214. package/dist/components/UTTable/components/ResponsiveCell/index.js +18 -18
  215. package/dist/components/UTTable/components/Status/index.js +17 -17
  216. package/dist/components/UTTable/components/TableFooter/components/PageSizeSelector/index.js +9 -7
  217. package/dist/components/UTTable/components/TableFooter/components/PageSizeSelector/utils.js +9 -14
  218. package/dist/components/UTTable/components/TableFooter/components/Pagination/components/NavigationButton/index.js +11 -10
  219. package/dist/components/UTTable/components/TableFooter/components/Pagination/index.js +22 -36
  220. package/dist/components/UTTable/components/TableFooter/components/Pagination/utils.js +10 -15
  221. package/dist/components/UTTable/components/TableFooter/constants.js +1 -1
  222. package/dist/components/UTTable/components/TableFooter/index.js +14 -13
  223. package/dist/components/UTTable/components/TableHeader/index.js +10 -10
  224. package/dist/components/UTTable/components/TableRow/constants.js +2 -4
  225. package/dist/components/UTTable/components/TableRow/index.js +79 -93
  226. package/dist/components/UTTable/constants.js +26 -24
  227. package/dist/components/UTTable/hook.js +13 -27
  228. package/dist/components/UTTable/index.js +125 -213
  229. package/dist/components/UTTable/theme.js +19 -18
  230. package/dist/components/UTTable/types.js +4 -4
  231. package/dist/components/UTTable/utils.js +80 -75
  232. package/dist/components/UTTabs/components/TooltipTab/index.js +19 -28
  233. package/dist/components/UTTabs/constants.js +4 -4
  234. package/dist/components/UTTabs/index.js +56 -84
  235. package/dist/components/UTTabs/theme.js +6 -3
  236. package/dist/components/UTTabs/utils.js +3 -2
  237. package/dist/components/UTTextArea/constants.js +2 -4
  238. package/dist/components/UTTextArea/index.js +22 -21
  239. package/dist/components/UTTextArea/theme.js +6 -3
  240. package/dist/components/UTTextInput/constants.js +1 -1
  241. package/dist/components/UTTextInput/index.js +138 -165
  242. package/dist/components/UTTextInput/theme.js +9 -5
  243. package/dist/components/UTThirdPartyCookieChecker/index.js +16 -19
  244. package/dist/components/UTToggle/components/ToggleOption/index.js +15 -15
  245. package/dist/components/UTToggle/index.js +24 -24
  246. package/dist/components/UTToggle/theme.js +6 -3
  247. package/dist/components/UTTooltip/index.js +22 -28
  248. package/dist/components/UTTooltip/theme.js +6 -3
  249. package/dist/components/UTTopbar/components/Notifications/index.js +10 -12
  250. package/dist/components/UTTopbar/components/UserMenu/index.js +18 -17
  251. package/dist/components/UTTopbar/components/UserMenu/styles.module.scss +1 -1
  252. package/dist/components/UTTopbar/index.js +27 -29
  253. package/dist/components/UTTopbar/theme.js +6 -3
  254. package/dist/components/UTTopbar/types.js +4 -4
  255. package/dist/components/UTTouchableWithoutFeedback/index.js +15 -27
  256. package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/constants.js +2 -2
  257. package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/index.js +33 -29
  258. package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/utils.js +6 -5
  259. package/dist/components/UTVirtualizedList/components/VirtualizedData/constants.js +6 -6
  260. package/dist/components/UTVirtualizedList/components/VirtualizedData/hooks/use-ledger.js +7 -16
  261. package/dist/components/UTVirtualizedList/components/VirtualizedData/hooks/use-virtualized-data.js +22 -45
  262. package/dist/components/UTVirtualizedList/components/VirtualizedData/index.js +30 -32
  263. package/dist/components/UTVirtualizedList/components/VirtualizedData/utils.js +89 -94
  264. package/dist/components/UTVirtualizedList/constants.js +4 -4
  265. package/dist/components/UTVirtualizedList/index.js +25 -36
  266. package/dist/components/UTWorkflowContainer/components/ActionButton/index.js +14 -17
  267. package/dist/components/UTWorkflowContainer/constants.js +3 -3
  268. package/dist/components/UTWorkflowContainer/hooks/use-previous.js +5 -4
  269. package/dist/components/UTWorkflowContainer/index.js +31 -49
  270. package/dist/components/UTWorkflowContainer/theme.js +62 -54
  271. package/dist/components/UTWorkflowContainer/types.js +1 -1
  272. package/dist/components/WithLoading/index.js +9 -13
  273. package/dist/components/WithTheme/index.js +9 -15
  274. package/dist/components/WithTheme/layout.js +21 -26
  275. package/dist/components/WithTouch/index.js +11 -17
  276. package/dist/constants/UTTable.js +1 -1
  277. package/dist/index.js +58 -58
  278. package/dist/theme.js +8 -4
  279. package/dist/types/commonTypes.js +2 -2
  280. package/dist/types/consumptionTypes.js +2 -2
  281. package/dist/types/formTypes.js +3 -3
  282. package/dist/types/tableTypes.js +1 -1
  283. package/dist/utils/classesUtils.js +7 -13
  284. package/dist/utils/componentUtils.js +8 -10
  285. package/dist/utils/helperFunctions.js +6 -5
  286. package/dist/utils/shadowUtils.js +15 -12
  287. package/dist/utils/useScreenSize.js +1 -1
  288. package/package.json +29 -70
@@ -17,14 +17,13 @@ var NavigateBeforeIcon = function NavigateBeforeIcon(props) {
17
17
  return /*#__PURE__*/_react.default.createElement("svg", props, /*#__PURE__*/_react.default.createElement("path", {
18
18
  fillRule: "evenodd",
19
19
  clipRule: "evenodd",
20
- d: "M13.362 17a.996.996 0 0 1-.719-.305l-3.863-4a1 1 0 0 1 .013-1.402l4-4a.999.999 0 1 1 1.414 1.414l-3.305 3.305 3.18 3.293a1 1 0 0 1-.72 1.695z",
20
+ d: "M13.362 17a.996.996 0 0 1-.719-.305l-3.863-4a1 1 0 0 1 .013-1.402l4-4a.999.999 0 1 1 1.414 1.414l-3.305 3.305 3.18 3.293a1 1 0 0 1-.72 1.695Z",
21
21
  fill: "#091E42"
22
22
  }));
23
23
  };
24
24
  NavigateBeforeIcon.defaultProps = {
25
25
  width: "24",
26
26
  height: "24",
27
- viewBox: "0 0 24 24",
28
27
  fill: "none",
29
28
  xmlns: "http://www.w3.org/2000/svg"
30
29
  };
@@ -32,54 +31,53 @@ var NavigateNextIcon = function NavigateNextIcon(props) {
32
31
  return /*#__PURE__*/_react.default.createElement("svg", props, /*#__PURE__*/_react.default.createElement("path", {
33
32
  fillRule: "evenodd",
34
33
  clipRule: "evenodd",
35
- d: "M10.5 17a.999.999 0 0 1-.707-1.707l3.305-3.305-3.18-3.293a1 1 0 0 1 1.439-1.39l3.862 4a1 1 0 0 1-.012 1.402l-4 4A.997.997 0 0 1 10.5 17z",
34
+ d: "M10.5 17a.999.999 0 0 1-.707-1.707l3.305-3.305-3.18-3.293a1 1 0 0 1 1.439-1.39l3.862 4a1 1 0 0 1-.012 1.402l-4 4A.997.997 0 0 1 10.5 17Z",
36
35
  fill: "#091E42"
37
36
  }));
38
37
  };
39
38
  NavigateNextIcon.defaultProps = {
40
39
  width: "24",
41
40
  height: "24",
42
- viewBox: "0 0 24 24",
43
41
  fill: "none",
44
42
  xmlns: "http://www.w3.org/2000/svg"
45
43
  };
46
44
  var NavigateHeaderBeforeIcon = function NavigateHeaderBeforeIcon(props) {
47
45
  return /*#__PURE__*/_react.default.createElement("svg", props, /*#__PURE__*/_react.default.createElement("path", {
48
46
  fill: "#FFF",
49
- d: "M5.232.36a1 1 0 0 1 1.536 1.28L2.292 7.01l4.315 5.363a1 1 0 0 1-1.558 1.254l-4.828-6A1 1 0 0 1 .232 6.36zm7 0a1 1 0 0 1 1.537 1.28L9.293 7.011l4.315 5.362a1 1 0 0 1-1.56 1.254l-4.828-6a1 1 0 0 1 .012-1.267z",
47
+ d: "M5.232.36a1 1 0 0 1 1.536 1.28L2.292 7.01l4.315 5.363a1 1 0 0 1-1.558 1.254l-4.828-6A1 1 0 0 1 .232 6.36Zm7 0a1 1 0 0 1 1.537 1.28L9.293 7.011l4.315 5.362a1 1 0 0 1-1.56 1.254l-4.828-6a1 1 0 0 1 .012-1.267Z",
50
48
  fillRule: "evenodd"
51
49
  }));
52
50
  };
53
51
  NavigateHeaderBeforeIcon.defaultProps = {
54
52
  width: "14",
55
53
  height: "14",
56
- viewBox: "0 0 14 14",
57
54
  xmlns: "http://www.w3.org/2000/svg"
58
55
  };
59
56
  var NavigateHeaderNextIcon = function NavigateHeaderNextIcon(props) {
60
57
  return /*#__PURE__*/_react.default.createElement("svg", props, /*#__PURE__*/_react.default.createElement("path", {
61
58
  fill: "#FFF",
62
- d: "M7.545.221a1 1 0 0 1 1.406.152l4.828 6a1 1 0 0 1-.01 1.267l-5 6a1 1 0 1 1-1.537-1.28l4.476-5.371-4.316-5.362A1 1 0 0 1 7.545.221zm-7 0a1 1 0 0 1 1.406.152l4.828 6a1 1 0 0 1-.01 1.267l-5 6a1 1 0 1 1-1.537-1.28l4.475-5.371L.392 1.627A1 1 0 0 1 .545.221z",
59
+ d: "M7.545.221a1 1 0 0 1 1.406.152l4.828 6a1 1 0 0 1-.01 1.267l-5 6a1 1 0 1 1-1.537-1.28l4.476-5.371-4.316-5.362A1 1 0 0 1 7.545.221Zm-7 0a1 1 0 0 1 1.406.152l4.828 6a1 1 0 0 1-.01 1.267l-5 6a1 1 0 1 1-1.537-1.28l4.475-5.371L.392 1.627A1 1 0 0 1 .545.221Z",
63
60
  fillRule: "evenodd"
64
61
  }));
65
62
  };
66
63
  NavigateHeaderNextIcon.defaultProps = {
67
64
  width: "14",
68
65
  height: "14",
69
- viewBox: "0 0 14 14",
70
66
  xmlns: "http://www.w3.org/2000/svg"
71
67
  };
72
- var Pagination = function Pagination(_ref) {
73
- var classes = _ref.classes,
74
- colorThemes = _ref.colorThemes,
75
- currentPage = _ref.currentPage,
76
- onChangePage = _ref.onChangePage,
77
- rowsPerPage = _ref.rowsPerPage,
78
- totalRows = _ref.totalRows,
79
- isResponsive = _ref.isResponsive;
80
- var totalPages = rowsPerPage >= totalRows ? 1 : Math.ceil(totalRows / rowsPerPage);
81
- var pageList = (0, _utils.getPageNumbers)(totalPages, currentPage, isResponsive);
82
- var navigationButtonColorTheme = colorThemes.navigationButton || 'secondary';
68
+ const Pagination = _ref => {
69
+ let {
70
+ classes,
71
+ colorThemes,
72
+ currentPage,
73
+ onChangePage,
74
+ rowsPerPage,
75
+ totalRows,
76
+ isResponsive
77
+ } = _ref;
78
+ const totalPages = rowsPerPage >= totalRows ? 1 : Math.ceil(totalRows / rowsPerPage);
79
+ const pageList = (0, _utils.getPageNumbers)(totalPages, currentPage, isResponsive);
80
+ const navigationButtonColorTheme = colorThemes.navigationButton || 'secondary';
83
81
  return /*#__PURE__*/_react.default.createElement("div", {
84
82
  className: "".concat(_stylesModule.default.pagination, " ").concat(classes.pagination)
85
83
  }, totalPages > _constants.PAGINATION_LIMIT_DOUBLE_ARROWS && !isResponsive && /*#__PURE__*/_react.default.createElement(_NavigationButton.default, {
@@ -88,45 +86,33 @@ var Pagination = function Pagination(_ref) {
88
86
  Icon: NavigateHeaderBeforeIcon,
89
87
  label: "1",
90
88
  disabled: currentPage === 0,
91
- onClick: function onClick() {
92
- return onChangePage(0);
93
- }
89
+ onClick: () => onChangePage(0)
94
90
  }), /*#__PURE__*/_react.default.createElement(_NavigationButton.default, {
95
91
  colorTheme: navigationButtonColorTheme,
96
92
  Icon: NavigateBeforeIcon,
97
93
  disabled: currentPage === 0,
98
- onClick: function onClick() {
99
- return onChangePage(currentPage - 1);
100
- }
101
- }), pageList.map(function (page) {
102
- return /*#__PURE__*/_react.default.createElement(_UTButton.default, {
103
- key: "page_".concat(page),
104
- classNames: {
105
- childrenContainer: _stylesModule.default.pageButtonChildrenContainer,
106
- root: "".concat(_stylesModule.default.pageButton, " ").concat(currentPage === page && _stylesModule.default.pageButtondisabled)
107
- },
108
- colorTheme: colorThemes.pageButton || currentPage === page ? 'primary' : 'secondary',
109
- onClick: function onClick() {
110
- return onChangePage(page);
111
- },
112
- variant: currentPage === page ? 'semitransparent' : 'text'
113
- }, page + 1);
114
- }), /*#__PURE__*/_react.default.createElement(_NavigationButton.default, {
94
+ onClick: () => onChangePage(currentPage - 1)
95
+ }), pageList.map(page => /*#__PURE__*/_react.default.createElement(_UTButton.default, {
96
+ key: "page_".concat(page),
97
+ classNames: {
98
+ childrenContainer: _stylesModule.default.pageButtonChildrenContainer,
99
+ root: "".concat(_stylesModule.default.pageButton, " ").concat(currentPage === page && _stylesModule.default.pageButtondisabled)
100
+ },
101
+ colorTheme: colorThemes.pageButton || currentPage === page ? 'primary' : 'secondary',
102
+ onClick: () => onChangePage(page),
103
+ variant: currentPage === page ? 'semitransparent' : 'text'
104
+ }, page + 1)), /*#__PURE__*/_react.default.createElement(_NavigationButton.default, {
115
105
  colorTheme: navigationButtonColorTheme,
116
106
  Icon: NavigateNextIcon,
117
107
  disabled: currentPage === totalPages - 1,
118
- onClick: function onClick() {
119
- return onChangePage(currentPage + 1);
120
- }
108
+ onClick: () => onChangePage(currentPage + 1)
121
109
  }), totalPages > _constants.PAGINATION_LIMIT_DOUBLE_ARROWS && !isResponsive && /*#__PURE__*/_react.default.createElement(_NavigationButton.default, {
122
110
  className: _stylesModule.default.navigationLabel,
123
111
  colorTheme: navigationButtonColorTheme,
124
112
  Icon: NavigateHeaderNextIcon,
125
113
  label: totalPages,
126
114
  disabled: currentPage === totalPages - 1,
127
- onClick: function onClick() {
128
- return onChangePage(totalPages - 1);
129
- }
115
+ onClick: () => onChangePage(totalPages - 1)
130
116
  }));
131
117
  };
132
118
  Pagination.propTypes = {
@@ -5,19 +5,14 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.getPageNumbers = void 0;
7
7
  var _constants = require("../../constants");
8
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
9
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
10
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
11
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
12
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
13
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
14
- var getPageNumbers = exports.getPageNumbers = function getPageNumbers(totalPages, currentPage, isResponsive) {
8
+ const getPageNumbers = (totalPages, currentPage, isResponsive) => {
15
9
  if (isResponsive) return [currentPage];
16
- if (totalPages <= _constants.MAX_PAGINATION_ITEMS) return _toConsumableArray(Array(totalPages).keys());
17
- var paginationFactor = _constants.MAX_PAGINATION_ITEMS / 2;
18
- if (currentPage < Math.ceil(paginationFactor)) return _toConsumableArray(Array(_constants.MAX_PAGINATION_ITEMS).keys());
19
- if (totalPages - currentPage < paginationFactor) return _toConsumableArray(Array(totalPages).keys()).slice(totalPages - _constants.MAX_PAGINATION_ITEMS, totalPages);
20
- var floorFactor = Math.floor(paginationFactor);
21
- var ceilFactor = Math.ceil(paginationFactor);
22
- return _toConsumableArray(Array(currentPage + ceilFactor).keys()).slice(currentPage - floorFactor);
23
- };
10
+ if (totalPages <= _constants.MAX_PAGINATION_ITEMS) return [...Array(totalPages).keys()];
11
+ const paginationFactor = _constants.MAX_PAGINATION_ITEMS / 2;
12
+ if (currentPage < Math.ceil(paginationFactor)) return [...Array(_constants.MAX_PAGINATION_ITEMS).keys()];
13
+ if (totalPages - currentPage < paginationFactor) return [...Array(totalPages).keys()].slice(totalPages - _constants.MAX_PAGINATION_ITEMS, totalPages);
14
+ const floorFactor = Math.floor(paginationFactor);
15
+ const ceilFactor = Math.ceil(paginationFactor);
16
+ return [...Array(currentPage + ceilFactor).keys()].slice(currentPage - floorFactor);
17
+ };
18
+ exports.getPageNumbers = getPageNumbers;
@@ -4,6 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.PREPOSITION = exports.PAGINATION_LIMIT_DOUBLE_ARROWS = exports.MAX_PAGINATION_ITEMS = void 0;
7
- var PREPOSITION = exports.PREPOSITION = 'de';
8
- var PAGINATION_LIMIT_DOUBLE_ARROWS = exports.PAGINATION_LIMIT_DOUBLE_ARROWS = 10;
9
- var MAX_PAGINATION_ITEMS = exports.MAX_PAGINATION_ITEMS = 5;
7
+ const PREPOSITION = exports.PREPOSITION = 'de';
8
+ const PAGINATION_LIMIT_DOUBLE_ARROWS = exports.PAGINATION_LIMIT_DOUBLE_ARROWS = 10;
9
+ const MAX_PAGINATION_ITEMS = exports.MAX_PAGINATION_ITEMS = 5;
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
@@ -15,20 +14,21 @@ var _constants = require("./constants");
15
14
  var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
16
15
  var _theme = require("./theme");
17
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
19
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
20
- var UTPagination = function UTPagination(_ref) {
21
- var classes = _ref.classes,
22
- _ref$colorThemes = _ref.colorThemes,
23
- colorThemes = _ref$colorThemes === void 0 ? {} : _ref$colorThemes,
24
- isResponsive = _ref.isResponsive,
25
- onChangePage = _ref.onChangePage,
26
- onChangeRowPerPage = _ref.onChangeRowPerPage,
27
- page = _ref.page,
28
- rowsPerPage = _ref.rowsPerPage,
29
- rowsPerPageOptions = _ref.rowsPerPageOptions,
30
- totalRows = _ref.totalRows,
31
- totalRowsLabel = _ref.totalRowsLabel;
17
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
18
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
19
+ const UTPagination = _ref => {
20
+ let {
21
+ classes,
22
+ colorThemes = {},
23
+ isResponsive,
24
+ onChangePage,
25
+ onChangeRowPerPage,
26
+ page,
27
+ rowsPerPage,
28
+ rowsPerPageOptions,
29
+ totalRows,
30
+ totalRowsLabel
31
+ } = _ref;
32
32
  return /*#__PURE__*/_react.default.createElement("div", {
33
33
  className: "".concat(_stylesModule.default.paginationContainer, " ").concat(classes.paginationContainer)
34
34
  }, /*#__PURE__*/_react.default.createElement(_PageSizeSelector.default, {
@@ -6,9 +6,11 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.retrieveStyle = void 0;
7
7
  var _colorsModule = _interopRequireDefault(require("../../scss/variables/colors.module.scss"));
8
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
- var retrieveStyle = exports.retrieveStyle = function retrieveStyle(_ref) {
9
+ const retrieveStyle = _ref => {
10
10
  var _theme$UTPagination, _theme$UTPagination2, _theme$Fonts, _theme$UTPagination3, _theme$UTPagination4, _theme$UTPagination5, _theme$UTPagination6, _theme$UTPagination7, _theme$UTPagination8;
11
- var theme = _ref.theme;
11
+ let {
12
+ theme
13
+ } = _ref;
12
14
  return {
13
15
  paginationContainer: {
14
16
  marginTop: (theme === null || theme === void 0 || (_theme$UTPagination = theme.UTPagination) === null || _theme$UTPagination === void 0 || (_theme$UTPagination = _theme$UTPagination.paginationContainer) === null || _theme$UTPagination === void 0 ? void 0 : _theme$UTPagination.marginTop) || 32
@@ -32,4 +34,5 @@ var retrieveStyle = exports.retrieveStyle = function retrieveStyle(_ref) {
32
34
  gridGap: (theme === null || theme === void 0 || (_theme$UTPagination8 = theme.UTPagination) === null || _theme$UTPagination8 === void 0 || (_theme$UTPagination8 = _theme$UTPagination8.pagination) === null || _theme$UTPagination8 === void 0 ? void 0 : _theme$UTPagination8.gridGap) || '16px'
33
35
  }
34
36
  };
35
- };
37
+ };
38
+ exports.retrieveStyle = retrieveStyle;
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
@@ -15,40 +14,33 @@ var _UTButton = _interopRequireDefault(require("../UTButton"));
15
14
  var _UTLabel = _interopRequireDefault(require("../UTLabel"));
16
15
  var _commonTypes = require("../../types/commonTypes");
17
16
  var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
18
- var _excluded = ["title", "titleIcon", "titleContainer", "perfectScrollbar", "closeButton", "iconClose"];
19
17
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
20
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
21
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
22
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
23
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
24
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
25
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
26
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
27
- var UTPanel = function UTPanel(_ref) {
28
- var children = _ref.children,
29
- _ref$classes = _ref.classes,
30
- classes = _ref$classes === void 0 ? {} : _ref$classes,
31
- containerRef = _ref.containerRef,
32
- _ref$disableScrollbar = _ref.disableScrollbar,
33
- disableScrollbar = _ref$disableScrollbar === void 0 ? false : _ref$disableScrollbar,
34
- modalProps = _ref.modalProps,
35
- onClose = _ref.onClose,
36
- onEndReachedCallback = _ref.onEndReachedCallback,
37
- _ref$onOpen = _ref.onOpen,
38
- onOpen = _ref$onOpen === void 0 ? function () {} : _ref$onOpen,
39
- open = _ref.open,
40
- panelSide = _ref.panelSide,
41
- perfectScrollbarOptions = _ref.perfectScrollbarOptions,
42
- title = _ref.title,
43
- TitleComponent = _ref.TitleComponent,
44
- TitleIcon = _ref.TitleIcon;
45
- var titleClass = classes.title,
46
- titleIconClass = classes.titleIcon,
47
- titleContainerClass = classes.titleContainer,
48
- perfectScrollbarClass = classes.perfectScrollbar,
49
- closeButtonClass = classes.closeButton,
50
- iconCloseClass = classes.iconClose,
51
- drawerClasses = _objectWithoutProperties(classes, _excluded);
18
+ const UTPanel = _ref => {
19
+ let {
20
+ children,
21
+ classes = {},
22
+ containerRef,
23
+ disableScrollbar = false,
24
+ modalProps,
25
+ onClose,
26
+ onEndReachedCallback,
27
+ onOpen = () => {},
28
+ open,
29
+ panelSide,
30
+ perfectScrollbarOptions,
31
+ title,
32
+ TitleComponent,
33
+ TitleIcon
34
+ } = _ref;
35
+ const {
36
+ title: titleClass,
37
+ titleIcon: titleIconClass,
38
+ titleContainer: titleContainerClass,
39
+ perfectScrollbar: perfectScrollbarClass,
40
+ closeButton: closeButtonClass,
41
+ iconClose: iconCloseClass,
42
+ ...drawerClasses
43
+ } = classes;
52
44
  return /*#__PURE__*/_react.default.createElement(_SwipeableDrawer.default, {
53
45
  anchor: panelSide,
54
46
  open: open,
@@ -56,14 +48,16 @@ var UTPanel = function UTPanel(_ref) {
56
48
  onClose: onClose,
57
49
  disableSwipeToOpen: true,
58
50
  swipeAreaWidth: 0,
59
- ModalProps: _objectSpread({
51
+ ModalProps: {
60
52
  container: containerRef,
61
- keepMounted: !!containerRef
62
- }, modalProps),
63
- classes: _objectSpread(_objectSpread({}, drawerClasses), {}, {
53
+ keepMounted: !!containerRef,
54
+ ...modalProps
55
+ },
56
+ classes: {
57
+ ...drawerClasses,
64
58
  paper: "".concat(_stylesModule.default.paper, " ").concat(drawerClasses.paper),
65
59
  root: "".concat(containerRef && _stylesModule.default.root, " ").concat(drawerClasses.root)
66
- })
60
+ }
67
61
  }, /*#__PURE__*/_react.default.createElement("div", {
68
62
  className: "".concat(_stylesModule.default.titleContainer, " ").concat(titleContainerClass)
69
63
  }, TitleComponent || /*#__PURE__*/_react.default.createElement("div", {
@@ -84,9 +78,10 @@ var UTPanel = function UTPanel(_ref) {
84
78
  })), disableScrollbar ? children : /*#__PURE__*/_react.default.createElement(_reactPerfectScrollbar.default, {
85
79
  onYReachEnd: onEndReachedCallback,
86
80
  className: "".concat(_stylesModule.default.perfectScrollbar, " ").concat(perfectScrollbarClass),
87
- options: _objectSpread({
88
- suppressScrollX: true
89
- }, perfectScrollbarOptions)
81
+ options: {
82
+ suppressScrollX: true,
83
+ ...perfectScrollbarOptions
84
+ }
90
85
  }, children));
91
86
  };
92
87
  UTPanel.propTypes = {
@@ -10,14 +10,18 @@ var _propTypes = require("prop-types");
10
10
  var _UTLabel = _interopRequireDefault(require("../../../../../UTLabel"));
11
11
  var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
- var ErrorMessage = function ErrorMessage(_ref) {
14
- var assertion = _ref.assertion,
15
- ErrorIcon = _ref.ErrorIcon,
16
- classes = _ref.classes,
17
- error = _ref.error;
18
- var failedIconStyle = classes.failedIconStyle,
19
- iconStyle = classes.iconStyle;
20
- var Icon = ErrorIcon || _Info.default;
13
+ const ErrorMessage = _ref => {
14
+ let {
15
+ assertion,
16
+ ErrorIcon,
17
+ classes,
18
+ error
19
+ } = _ref;
20
+ const {
21
+ failedIconStyle,
22
+ iconStyle
23
+ } = classes;
24
+ const Icon = ErrorIcon || _Info.default;
21
25
  return !assertion && /*#__PURE__*/_react.default.createElement("div", {
22
26
  className: _stylesModule.default.container
23
27
  }, /*#__PURE__*/_react.default.createElement(Icon, {
@@ -12,23 +12,27 @@ var _propTypes = require("prop-types");
12
12
  var _UTLabel = _interopRequireDefault(require("../../../../../UTLabel"));
13
13
  var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
- var Validation = function Validation(_ref) {
16
- var assertion = _ref.assertion,
17
- classes = _ref.classes,
18
- disabled = _ref.disabled,
19
- NoValueIcon = _ref.NoValueIcon,
20
- requirement = _ref.requirement,
21
- shouldShowError = _ref.shouldShowError,
22
- ValidationFailedIcon = _ref.ValidationFailedIcon,
23
- ValidationPassedIcon = _ref.ValidationPassedIcon,
24
- value = _ref.value;
25
- var passedIconStyle = classes.passedIconStyle,
26
- failedIconStyle = classes.failedIconStyle,
27
- iconStyle = classes.iconStyle;
28
- var PassedIcon = ValidationPassedIcon || _CheckCircle.default;
29
- var FailedIcon = ValidationFailedIcon || _Cancel.default;
30
- var NoValue = NoValueIcon || _FiberManualRecord.default;
31
- var labelColor = !value && !shouldShowError ? 'gray' : assertion ? 'success' : 'error';
15
+ const Validation = _ref => {
16
+ let {
17
+ assertion,
18
+ classes,
19
+ disabled,
20
+ NoValueIcon,
21
+ requirement,
22
+ shouldShowError,
23
+ ValidationFailedIcon,
24
+ ValidationPassedIcon,
25
+ value
26
+ } = _ref;
27
+ const {
28
+ passedIconStyle,
29
+ failedIconStyle,
30
+ iconStyle
31
+ } = classes;
32
+ const PassedIcon = ValidationPassedIcon || _CheckCircle.default;
33
+ const FailedIcon = ValidationFailedIcon || _Cancel.default;
34
+ const NoValue = NoValueIcon || _FiberManualRecord.default;
35
+ const labelColor = !value && !shouldShowError ? 'gray' : assertion ? 'success' : 'error';
32
36
  return /*#__PURE__*/_react.default.createElement("div", {
33
37
  className: _stylesModule.default.container
34
38
  }, value || shouldShowError && !disabled ? assertion ? /*#__PURE__*/_react.default.createElement(PassedIcon, {
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
@@ -10,63 +9,76 @@ var _propTypes = require("prop-types");
10
9
  var _formTypes = require("../../../../types/formTypes");
11
10
  var _Validation = _interopRequireDefault(require("./components/Validation"));
12
11
  var _Error = _interopRequireDefault(require("./components/Error"));
13
- var _excluded = ["expression"];
14
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
16
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
17
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
18
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
19
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
20
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
21
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
22
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
23
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
24
- var PasswordValidations = function PasswordValidations(_ref) {
25
- var passwordValidations = _ref.passwordValidations,
26
- value = _ref.value,
27
- classes = _ref.classes,
28
- ValidationFailedIcon = _ref.ValidationFailedIcon,
29
- ValidationPassedIcon = _ref.ValidationPassedIcon,
30
- ErrorIcon = _ref.ErrorIcon,
31
- NoValueIcon = _ref.NoValueIcon,
32
- meta = _ref.meta,
33
- disabled = _ref.disabled,
34
- passwordValidationsWarning = _ref.passwordValidationsWarning;
35
- var validatedRegExps = passwordValidations.map(function (_ref2) {
36
- var expression = _ref2.expression,
37
- regex = _objectWithoutProperties(_ref2, _excluded);
38
- return _objectSpread({
39
- assertion: new RegExp(expression).test(value)
40
- }, regex);
13
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
14
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
15
+ const PasswordValidations = _ref => {
16
+ let {
17
+ passwordValidations,
18
+ value,
19
+ classes,
20
+ ValidationFailedIcon,
21
+ ValidationPassedIcon,
22
+ ErrorIcon,
23
+ NoValueIcon,
24
+ meta,
25
+ disabled,
26
+ passwordValidationsWarning
27
+ } = _ref;
28
+ const validatedRegExps = passwordValidations.map(_ref2 => {
29
+ let {
30
+ expression,
31
+ ...regex
32
+ } = _ref2;
33
+ return {
34
+ assertion: new RegExp(expression).test(value),
35
+ ...regex
36
+ };
41
37
  });
42
- var errorsContainerStyle = classes.errorsContainerStyle;
43
- var submitFailed = meta.submitFailed,
44
- metaError = meta.error;
45
- var validations = validatedRegExps.filter(function (_ref3) {
46
- var requirement = _ref3.requirement;
38
+ const {
39
+ errorsContainerStyle
40
+ } = classes;
41
+ const {
42
+ submitFailed,
43
+ error: metaError
44
+ } = meta;
45
+ const validations = validatedRegExps.filter(_ref3 => {
46
+ let {
47
+ requirement
48
+ } = _ref3;
47
49
  return requirement;
48
50
  });
49
- var errors = validatedRegExps.filter(function (_ref4) {
50
- var requirement = _ref4.requirement;
51
+ const errors = validatedRegExps.filter(_ref4 => {
52
+ let {
53
+ requirement
54
+ } = _ref4;
51
55
  return !requirement;
52
56
  });
53
- if (metaError && !passwordValidations.map(function (_ref5) {
54
- var error = _ref5.error;
57
+ if (metaError && !passwordValidations.map(_ref5 => {
58
+ let {
59
+ error
60
+ } = _ref5;
55
61
  return error;
56
62
  }).includes(metaError)) errors.push({
57
63
  error: metaError
58
64
  });
59
- var showErrors = errors.some(function (_ref6) {
60
- var assertion = _ref6.assertion,
61
- error = _ref6.error;
62
- return !assertion && !(passwordValidationsWarning !== null && passwordValidationsWarning !== void 0 && passwordValidationsWarning.some(function (_ref7) {
63
- var warningError = _ref7.error;
65
+ const showErrors = errors.some(_ref6 => {
66
+ let {
67
+ assertion,
68
+ error
69
+ } = _ref6;
70
+ return !assertion && !(passwordValidationsWarning !== null && passwordValidationsWarning !== void 0 && passwordValidationsWarning.some(_ref7 => {
71
+ let {
72
+ error: warningError
73
+ } = _ref7;
64
74
  return error === warningError;
65
75
  }));
66
76
  });
67
- return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, validations.map(function (_ref8) {
68
- var requirement = _ref8.requirement,
69
- assertion = _ref8.assertion;
77
+ return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, validations.map(_ref8 => {
78
+ let {
79
+ requirement,
80
+ assertion
81
+ } = _ref8;
70
82
  return /*#__PURE__*/_react.default.createElement(_Validation.default, {
71
83
  assertion: assertion,
72
84
  classes: classes,
@@ -81,9 +93,11 @@ var PasswordValidations = function PasswordValidations(_ref) {
81
93
  });
82
94
  }), submitFailed && showErrors && /*#__PURE__*/_react.default.createElement("div", {
83
95
  className: errorsContainerStyle
84
- }, errors.map(function (_ref9) {
85
- var error = _ref9.error,
86
- assertion = _ref9.assertion;
96
+ }, errors.map(_ref9 => {
97
+ let {
98
+ error,
99
+ assertion
100
+ } = _ref9;
87
101
  return /*#__PURE__*/_react.default.createElement(_Error.default, {
88
102
  ErrorIcon: ErrorIcon,
89
103
  classes: classes,