@widergy/energy-ui 2.10.1 → 2.12.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 (283) hide show
  1. package/dist/components/EnergyThemeProvider/index.js +12 -34
  2. package/dist/components/Loading/constants.js +1 -1
  3. package/dist/components/Loading/index.js +12 -10
  4. package/dist/components/Loading/theme.js +6 -3
  5. package/dist/components/UTAlert/AlertHandler.js +74 -99
  6. package/dist/components/UTAlert/index.js +64 -85
  7. package/dist/components/UTAlert/theme.js +34 -32
  8. package/dist/components/UTAttachment/components/Preview/index.js +7 -7
  9. package/dist/components/UTAttachment/constants.js +6 -6
  10. package/dist/components/UTAttachment/index.js +158 -248
  11. package/dist/components/UTAttachment/layout.js +25 -25
  12. package/dist/components/UTAttachment/theme.js +6 -3
  13. package/dist/components/UTAttachment/utils.js +44 -117
  14. package/dist/components/UTAutocomplete/components/ListBox/index.js +12 -19
  15. package/dist/components/UTAutocomplete/components/ListBox/utils.js +11 -12
  16. package/dist/components/UTAutocomplete/constants.js +11 -11
  17. package/dist/components/UTAutocomplete/index.js +53 -92
  18. package/dist/components/UTAutocomplete/theme.js +9 -5
  19. package/dist/components/UTAvatar/constants.js +1 -1
  20. package/dist/components/UTAvatar/index.js +17 -15
  21. package/dist/components/UTBarChart/components/Bars/components/Bar/components/Rect/index.js +21 -20
  22. package/dist/components/UTBarChart/components/Bars/components/Bar/constants.js +2 -1
  23. package/dist/components/UTBarChart/components/Bars/components/Bar/index.js +20 -20
  24. package/dist/components/UTBarChart/components/Bars/constants.js +3 -3
  25. package/dist/components/UTBarChart/components/Bars/index.js +69 -78
  26. package/dist/components/UTBarChart/components/Legend/constants.js +14 -17
  27. package/dist/components/UTBarChart/components/Legend/index.js +74 -91
  28. package/dist/components/UTBarChart/components/Legend/utils.js +2 -5
  29. package/dist/components/UTBarChart/components/Levels/index.js +15 -12
  30. package/dist/components/UTBarChart/components/Levels/utils.js +26 -27
  31. package/dist/components/UTBarChart/components/LinearPlot/constants.js +2 -2
  32. package/dist/components/UTBarChart/components/LinearPlot/index.js +24 -18
  33. package/dist/components/UTBarChart/components/LinearPlot/utils.js +39 -39
  34. package/dist/components/UTBarChart/components/Pagination/constants.js +1 -1
  35. package/dist/components/UTBarChart/components/Pagination/index.js +19 -22
  36. package/dist/components/UTBarChart/components/XAxis/components/AxisElement/index.js +20 -30
  37. package/dist/components/UTBarChart/components/XAxis/components/Decoration/constants.js +2 -2
  38. package/dist/components/UTBarChart/components/XAxis/components/Decoration/index.js +19 -17
  39. package/dist/components/UTBarChart/components/XAxis/constants.js +1 -1
  40. package/dist/components/UTBarChart/components/XAxis/index.js +53 -63
  41. package/dist/components/UTBarChart/components/YAxis/AxisElement/index.js +11 -9
  42. package/dist/components/UTBarChart/components/YAxis/constants.js +1 -1
  43. package/dist/components/UTBarChart/components/YAxis/index.js +29 -35
  44. package/dist/components/UTBarChart/components/YAxis/utils.js +6 -6
  45. package/dist/components/UTBarChart/constants.js +4 -4
  46. package/dist/components/UTBarChart/hooks/use-dynamic-margins.js +22 -38
  47. package/dist/components/UTBarChart/index.js +151 -164
  48. package/dist/components/UTBarChart/theme.js +6 -3
  49. package/dist/components/UTBarChart/types.js +9 -9
  50. package/dist/components/UTBarChart/utils.js +118 -111
  51. package/dist/components/UTBreadcrumbs/constants.js +22 -24
  52. package/dist/components/UTBreadcrumbs/index.js +75 -99
  53. package/dist/components/UTBreadcrumbs/theme.js +6 -3
  54. package/dist/components/UTButton/constants.js +11 -11
  55. package/dist/components/UTButton/index.js +27 -29
  56. package/dist/components/UTButton/theme.js +26 -24
  57. package/dist/components/UTCBUInput/index.js +35 -38
  58. package/dist/components/UTCBUInput/theme.js +6 -3
  59. package/dist/components/UTCaptcha/index.js +18 -43
  60. package/dist/components/UTCard/components/UTCardFooter/index.js +14 -14
  61. package/dist/components/UTCard/index.js +84 -118
  62. package/dist/components/UTCard/theme.js +13 -13
  63. package/dist/components/UTCard/types.js +1 -1
  64. package/dist/components/UTCarousel/components/Button/index.js +12 -11
  65. package/dist/components/UTCarousel/components/Legend/index.js +12 -13
  66. package/dist/components/UTCarousel/components/Slider/component/Slide/index.js +15 -14
  67. package/dist/components/UTCarousel/components/Slider/constants.js +5 -5
  68. package/dist/components/UTCarousel/components/Slider/index.js +203 -271
  69. package/dist/components/UTCarousel/components/Slider/layout.js +66 -92
  70. package/dist/components/UTCarousel/index.js +13 -13
  71. package/dist/components/UTCarousel/theme.js +6 -3
  72. package/dist/components/UTCheckList/constants.js +1 -1
  73. package/dist/components/UTCheckList/index.js +71 -91
  74. package/dist/components/UTCheckList/theme.js +34 -32
  75. package/dist/components/UTCheckbox/constants.js +2 -4
  76. package/dist/components/UTCheckbox/index.js +31 -42
  77. package/dist/components/UTCheckbox/theme.js +37 -35
  78. package/dist/components/UTConsumptionBar/components/ConsumptionBarIndicator/index.js +8 -7
  79. package/dist/components/UTConsumptionBar/constants.js +3 -3
  80. package/dist/components/UTConsumptionBar/index.js +52 -78
  81. package/dist/components/UTCuit/index.js +108 -131
  82. package/dist/components/UTCuit/theme.js +52 -53
  83. package/dist/components/UTDatePicker/components/Day/constants.js +1 -1
  84. package/dist/components/UTDatePicker/components/Day/index.js +11 -10
  85. package/dist/components/UTDatePicker/constants.js +21 -22
  86. package/dist/components/UTDatePicker/index.js +59 -100
  87. package/dist/components/UTDatePicker/theme.js +8 -4
  88. package/dist/components/UTDatePicker/types.js +1 -1
  89. package/dist/components/UTDatePicker/utils.js +4 -6
  90. package/dist/components/UTDialog/constants.js +2 -2
  91. package/dist/components/UTDialog/index.js +37 -35
  92. package/dist/components/UTDialog/theme.js +6 -3
  93. package/dist/components/UTDialog/types.js +1 -1
  94. package/dist/components/UTDotMenu/index.js +38 -59
  95. package/dist/components/UTEmojiPicker/constants.js +5 -5
  96. package/dist/components/UTEmojiPicker/index.js +44 -63
  97. package/dist/components/UTEmojiPicker/theme.js +6 -3
  98. package/dist/components/UTEmojiPicker/utils.js +24 -52
  99. package/dist/components/UTExternalLink/constants.js +2 -2
  100. package/dist/components/UTExternalLink/index.js +17 -13
  101. package/dist/components/UTExternalLink/theme.js +11 -7
  102. package/dist/components/UTFileInput/constants.js +2 -2
  103. package/dist/components/UTFileInput/index.js +6 -29
  104. package/dist/components/UTFileInput/layout.js +67 -95
  105. package/dist/components/UTIconButton/index.js +48 -70
  106. package/dist/components/UTIconButton/theme.js +6 -3
  107. package/dist/components/UTImageRadio/components/ImageRadioCard/index.js +52 -56
  108. package/dist/components/UTImageRadio/constants.js +3 -3
  109. package/dist/components/UTImageRadio/index.js +38 -45
  110. package/dist/components/UTImageRadio/theme.js +13 -13
  111. package/dist/components/UTImageRadio/types.js +1 -1
  112. package/dist/components/UTImageRadio/utils.js +4 -6
  113. package/dist/components/UTLabel/constants.js +13 -11
  114. package/dist/components/UTLabel/index.js +17 -18
  115. package/dist/components/UTLabel/theme.js +19 -16
  116. package/dist/components/UTList/index.js +14 -16
  117. package/dist/components/UTLoading/index.js +14 -13
  118. package/dist/components/UTMap/components/GoogleMaps/constants.js +9 -10
  119. package/dist/components/UTMap/components/GoogleMaps/index.js +62 -89
  120. package/dist/components/UTMap/constants.js +6 -6
  121. package/dist/components/UTMap/index.js +162 -196
  122. package/dist/components/UTMap/types.js +4 -3
  123. package/dist/components/UTMap/utils.js +35 -46
  124. package/dist/components/UTMap/withGoogleMapScript.js +18 -14
  125. package/dist/components/UTMenu/index.js +51 -67
  126. package/dist/components/UTMenu/theme.js +8 -4
  127. package/dist/components/UTMenu/utils.js +10 -12
  128. package/dist/components/UTModal/constants.js +9 -9
  129. package/dist/components/UTModal/index.js +25 -28
  130. package/dist/components/UTModal/theme.js +6 -3
  131. package/dist/components/UTPagination/components/PageSizeSelector/index.js +10 -8
  132. package/dist/components/UTPagination/components/PageSizeSelector/utils.js +9 -14
  133. package/dist/components/UTPagination/components/Pagination/components/NavigationButton/index.js +11 -10
  134. package/dist/components/UTPagination/components/Pagination/index.js +27 -37
  135. package/dist/components/UTPagination/components/Pagination/utils.js +10 -15
  136. package/dist/components/UTPagination/constants.js +3 -3
  137. package/dist/components/UTPagination/index.js +15 -15
  138. package/dist/components/UTPagination/theme.js +6 -3
  139. package/dist/components/UTPanel/index.js +37 -42
  140. package/dist/components/UTPasswordField/components/PasswordValidations/components/Error/index.js +12 -8
  141. package/dist/components/UTPasswordField/components/PasswordValidations/components/Validation/index.js +21 -17
  142. package/dist/components/UTPasswordField/components/PasswordValidations/index.js +62 -48
  143. package/dist/components/UTPasswordField/components/PasswordWarning/index.js +24 -24
  144. package/dist/components/UTPasswordField/index.js +25 -21
  145. package/dist/components/UTPasswordField/theme.js +6 -3
  146. package/dist/components/UTPhoneInput/constants.js +3 -3
  147. package/dist/components/UTPhoneInput/index.js +179 -203
  148. package/dist/components/UTPhoneInput/theme.js +79 -77
  149. package/dist/components/UTPieChart/components/ArrowLabel/constants.js +4 -4
  150. package/dist/components/UTPieChart/components/ArrowLabel/index.js +23 -21
  151. package/dist/components/UTPieChart/components/Legend/contants.js +3 -3
  152. package/dist/components/UTPieChart/components/Legend/index.js +26 -22
  153. package/dist/components/UTPieChart/constants.js +13 -13
  154. package/dist/components/UTPieChart/hooks/use-animated-value/index.js +14 -31
  155. package/dist/components/UTPieChart/index.js +72 -74
  156. package/dist/components/UTPieChart/theme.js +6 -3
  157. package/dist/components/UTPieChart/utils.js +6 -3
  158. package/dist/components/UTProgressBar/constants.js +2 -2
  159. package/dist/components/UTProgressBar/index.js +14 -15
  160. package/dist/components/UTProgressBar/theme.js +6 -3
  161. package/dist/components/UTProgressBar/types.js +1 -1
  162. package/dist/components/UTRadioGroup/index.js +55 -81
  163. package/dist/components/UTRadioGroup/theme.js +54 -52
  164. package/dist/components/UTRating/components/Circle/index.js +40 -54
  165. package/dist/components/UTRating/components/Faces/assets/mood-confuzed.svg +3 -0
  166. package/dist/components/UTRating/components/Faces/assets/mood-empty.svg +3 -0
  167. package/dist/components/UTRating/components/Faces/assets/mood-happy.svg +3 -0
  168. package/dist/components/UTRating/components/Faces/assets/mood-sad.svg +3 -0
  169. package/dist/components/UTRating/components/Faces/assets/mood-smile.svg +3 -0
  170. package/dist/components/UTRating/components/Faces/constants.js +85 -0
  171. package/dist/components/UTRating/components/Faces/index.js +76 -0
  172. package/dist/components/UTRating/components/Faces/styles.module.scss +78 -0
  173. package/dist/components/UTRating/components/Star/index.js +35 -38
  174. package/dist/components/UTRating/constants.js +5 -4
  175. package/dist/components/UTRating/index.js +35 -46
  176. package/dist/components/UTRating/styles.module.scss +1 -0
  177. package/dist/components/UTRating/theme.js +52 -3
  178. package/dist/components/UTRipple/Ripple.js +21 -37
  179. package/dist/components/UTRipple/index.js +17 -35
  180. package/dist/components/UTSelect/components/Option/index.js +12 -11
  181. package/dist/components/UTSelect/constants.js +4 -4
  182. package/dist/components/UTSelect/index.js +62 -83
  183. package/dist/components/UTSelect/theme.js +9 -5
  184. package/dist/components/UTSelect/utils.js +5 -14
  185. package/dist/components/UTSidebar/components/ListOption/index.js +33 -47
  186. package/dist/components/UTSidebar/components/LogosContainer/components/DynamicIcon/index.js +7 -6
  187. package/dist/components/UTSidebar/components/LogosContainer/index.js +13 -12
  188. package/dist/components/UTSidebar/components/Option/constants.js +1 -1
  189. package/dist/components/UTSidebar/components/Option/index.js +27 -30
  190. package/dist/components/UTSidebar/components/Toggler/index.js +10 -9
  191. package/dist/components/UTSidebar/index.js +41 -51
  192. package/dist/components/UTSidebar/theme.js +6 -3
  193. package/dist/components/UTSidebar/types.js +5 -5
  194. package/dist/components/UTSkeleton/index.js +9 -34
  195. package/dist/components/UTStatus/constants.js +4 -4
  196. package/dist/components/UTStatus/index.js +15 -13
  197. package/dist/components/UTStatus/theme.js +70 -49
  198. package/dist/components/UTSwitch/constants.js +3 -3
  199. package/dist/components/UTSwitch/index.js +41 -55
  200. package/dist/components/UTSwitch/theme.js +6 -3
  201. package/dist/components/UTTable/components/ActionIcons/constants.js +1 -1
  202. package/dist/components/UTTable/components/ActionIcons/index.js +46 -83
  203. package/dist/components/UTTable/components/Cell/components/ActionButton/index.js +9 -10
  204. package/dist/components/UTTable/components/Cell/index.js +17 -21
  205. package/dist/components/UTTable/components/HeaderCell/constants.js +1 -1
  206. package/dist/components/UTTable/components/HeaderCell/index.js +22 -28
  207. package/dist/components/UTTable/components/HeaderCell/utils.js +5 -4
  208. package/dist/components/UTTable/components/PrimaryAction/index.js +11 -9
  209. package/dist/components/UTTable/components/ResponsiveCell/index.js +18 -18
  210. package/dist/components/UTTable/components/Status/index.js +17 -17
  211. package/dist/components/UTTable/components/TableFooter/components/PageSizeSelector/index.js +9 -7
  212. package/dist/components/UTTable/components/TableFooter/components/PageSizeSelector/utils.js +9 -14
  213. package/dist/components/UTTable/components/TableFooter/components/Pagination/components/NavigationButton/index.js +11 -10
  214. package/dist/components/UTTable/components/TableFooter/components/Pagination/index.js +20 -30
  215. package/dist/components/UTTable/components/TableFooter/components/Pagination/utils.js +10 -15
  216. package/dist/components/UTTable/components/TableFooter/constants.js +1 -1
  217. package/dist/components/UTTable/components/TableFooter/index.js +14 -13
  218. package/dist/components/UTTable/components/TableHeader/index.js +10 -9
  219. package/dist/components/UTTable/components/TableRow/constants.js +2 -4
  220. package/dist/components/UTTable/components/TableRow/index.js +78 -92
  221. package/dist/components/UTTable/constants.js +26 -24
  222. package/dist/components/UTTable/hook.js +13 -27
  223. package/dist/components/UTTable/index.js +125 -213
  224. package/dist/components/UTTable/theme.js +19 -18
  225. package/dist/components/UTTable/types.js +4 -4
  226. package/dist/components/UTTable/utils.js +80 -75
  227. package/dist/components/UTTabs/components/TooltipTab/index.js +19 -28
  228. package/dist/components/UTTabs/constants.js +4 -4
  229. package/dist/components/UTTabs/index.js +56 -84
  230. package/dist/components/UTTabs/theme.js +6 -3
  231. package/dist/components/UTTabs/utils.js +3 -2
  232. package/dist/components/UTTextArea/constants.js +2 -4
  233. package/dist/components/UTTextArea/index.js +22 -21
  234. package/dist/components/UTTextArea/theme.js +6 -3
  235. package/dist/components/UTTextInput/constants.js +1 -1
  236. package/dist/components/UTTextInput/index.js +136 -163
  237. package/dist/components/UTTextInput/theme.js +9 -5
  238. package/dist/components/UTThirdPartyCookieChecker/index.js +16 -19
  239. package/dist/components/UTToggle/components/ToggleOption/index.js +15 -15
  240. package/dist/components/UTToggle/index.js +24 -24
  241. package/dist/components/UTToggle/theme.js +6 -3
  242. package/dist/components/UTTooltip/index.js +22 -28
  243. package/dist/components/UTTooltip/theme.js +6 -3
  244. package/dist/components/UTTopbar/components/Notifications/index.js +10 -12
  245. package/dist/components/UTTopbar/components/UserMenu/index.js +14 -13
  246. package/dist/components/UTTopbar/index.js +27 -29
  247. package/dist/components/UTTopbar/theme.js +6 -3
  248. package/dist/components/UTTopbar/types.js +4 -4
  249. package/dist/components/UTTouchableWithoutFeedback/index.js +13 -25
  250. package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/constants.js +2 -2
  251. package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/index.js +33 -29
  252. package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/utils.js +6 -5
  253. package/dist/components/UTVirtualizedList/components/VirtualizedData/constants.js +6 -6
  254. package/dist/components/UTVirtualizedList/components/VirtualizedData/hooks/use-ledger.js +7 -16
  255. package/dist/components/UTVirtualizedList/components/VirtualizedData/hooks/use-virtualized-data.js +22 -45
  256. package/dist/components/UTVirtualizedList/components/VirtualizedData/index.js +30 -32
  257. package/dist/components/UTVirtualizedList/components/VirtualizedData/utils.js +89 -94
  258. package/dist/components/UTVirtualizedList/constants.js +4 -4
  259. package/dist/components/UTVirtualizedList/index.js +25 -36
  260. package/dist/components/UTWorkflowContainer/components/ActionButton/index.js +14 -17
  261. package/dist/components/UTWorkflowContainer/constants.js +3 -3
  262. package/dist/components/UTWorkflowContainer/hooks/use-previous.js +5 -4
  263. package/dist/components/UTWorkflowContainer/index.js +31 -49
  264. package/dist/components/UTWorkflowContainer/theme.js +62 -54
  265. package/dist/components/UTWorkflowContainer/types.js +1 -1
  266. package/dist/components/WithLoading/index.js +9 -13
  267. package/dist/components/WithTheme/index.js +9 -15
  268. package/dist/components/WithTheme/layout.js +21 -26
  269. package/dist/components/WithTouch/index.js +11 -17
  270. package/dist/constants/UTTable.js +1 -1
  271. package/dist/index.js +58 -58
  272. package/dist/theme.js +8 -4
  273. package/dist/types/commonTypes.js +2 -2
  274. package/dist/types/consumptionTypes.js +2 -2
  275. package/dist/types/formTypes.js +3 -3
  276. package/dist/types/tableTypes.js +1 -1
  277. package/dist/utils/classesUtils.js +7 -13
  278. package/dist/utils/componentUtils.js +8 -10
  279. package/dist/utils/helperFunctions.js +6 -5
  280. package/dist/utils/shadowUtils.js +15 -12
  281. package/dist/utils/useScreenSize.js +1 -1
  282. package/package.json +2 -2
  283. package/CHANGELOG.md +0 -2234
@@ -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,22 +9,23 @@ var _propTypes = require("prop-types");
10
9
  var _string = require("@widergy/web-utils/lib/string");
11
10
  var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
12
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
- 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); }
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
- var Status = function Status(_ref) {
16
- var definition = _ref.definition,
17
- label = _ref.label,
18
- value = _ref.value;
19
- var isBool = typeof value === 'boolean';
20
- var currentDefinition = (isBool || value) && definition.find(function (el) {
21
- return isBool ? el.value === value : el.value && (0, _string.stringCompare)(el.value, value);
22
- });
23
- var _ref2 = currentDefinition || {},
24
- className = _ref2.className,
25
- definitionLabel = _ref2.label,
26
- Icon = _ref2.Icon,
27
- iconClassName = _ref2.iconClassName,
28
- labelClassName = _ref2.labelClassName;
12
+ 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); }
13
+ 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; }
14
+ const Status = _ref => {
15
+ let {
16
+ definition,
17
+ label,
18
+ value
19
+ } = _ref;
20
+ const isBool = typeof value === 'boolean';
21
+ const currentDefinition = (isBool || value) && definition.find(el => isBool ? el.value === value : el.value && (0, _string.stringCompare)(el.value, value));
22
+ const {
23
+ className,
24
+ label: definitionLabel,
25
+ Icon,
26
+ iconClassName,
27
+ labelClassName
28
+ } = currentDefinition || {};
29
29
  return currentDefinition && /*#__PURE__*/_react.default.createElement("div", {
30
30
  className: "".concat(_stylesModule.default.statusContainer, " ").concat(className)
31
31
  }, Icon && /*#__PURE__*/_react.default.createElement(Icon, {
@@ -12,13 +12,15 @@ var _types = require("../../../../types");
12
12
  var _utils = require("./utils");
13
13
  var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
- var PageSizeSelector = function PageSizeSelector(_ref) {
16
- var classes = _ref.classes,
17
- options = _ref.options,
18
- rowsPerPage = _ref.rowsPerPage,
19
- onChangeRowPerPage = _ref.onChangeRowPerPage,
20
- label = _ref.label,
21
- totalRows = _ref.totalRows;
15
+ const PageSizeSelector = _ref => {
16
+ let {
17
+ classes,
18
+ options,
19
+ rowsPerPage,
20
+ onChangeRowPerPage,
21
+ label,
22
+ totalRows
23
+ } = _ref;
22
24
  return /*#__PURE__*/_react.default.createElement("div", {
23
25
  className: _stylesModule.default.pageSizeSelector
24
26
  }, /*#__PURE__*/_react.default.createElement("div", {
@@ -5,21 +5,16 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.getPageSizeOptions = void 0;
7
7
  var _array = require("@widergy/web-utils/lib/array");
8
- var getPrevOption = function getPrevOption(options, index) {
9
- return index === 0 ? 0 : options[index - 1];
10
- };
11
- var getPageSizeOptions = exports.getPageSizeOptions = function getPageSizeOptions(originalOptions, totalRows) {
12
- var filteredOptions = originalOptions.filter(function (_, index) {
13
- return getPrevOption(originalOptions, index) < totalRows;
14
- });
8
+ const getPrevOption = (options, index) => index === 0 ? 0 : options[index - 1];
9
+ const getPageSizeOptions = (originalOptions, totalRows) => {
10
+ const filteredOptions = originalOptions.filter((_, index) => getPrevOption(originalOptions, index) < totalRows);
15
11
  if ((0, _array.isEmpty)(filteredOptions)) return [{
16
12
  value: originalOptions[0],
17
13
  label: totalRows
18
14
  }];
19
- return filteredOptions.map(function (value) {
20
- return {
21
- value: value,
22
- label: Math.min(value, totalRows)
23
- };
24
- });
25
- };
15
+ return filteredOptions.map(value => ({
16
+ value,
17
+ label: Math.min(value, totalRows)
18
+ }));
19
+ };
20
+ exports.getPageSizeOptions = getPageSizeOptions;
@@ -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
  });
@@ -11,15 +10,17 @@ var _UTTouchableWithoutFeedback = _interopRequireDefault(require("../../../../..
11
10
  var _types = require("../../../../../../types");
12
11
  var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
13
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
- 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); }
15
- 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; }
16
- var NavigationButton = function NavigationButton(_ref) {
17
- var classes = _ref.classes,
18
- Icon = _ref.Icon,
19
- label = _ref.label,
20
- onClick = _ref.onClick,
21
- className = _ref.className,
22
- disabled = _ref.disabled;
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 NavigationButton = _ref => {
16
+ let {
17
+ classes,
18
+ Icon,
19
+ label,
20
+ onClick,
21
+ className,
22
+ disabled
23
+ } = _ref;
23
24
  return /*#__PURE__*/_react.default.createElement(_UTTouchableWithoutFeedback.default, {
24
25
  className: "\n ".concat(className, "\n ").concat(_stylesModule.default.navigationButton, "\n ").concat(classes.navigationButton, "\n ").concat(disabled && "".concat(_stylesModule.default.buttonDisabled, " ").concat(classes.navigationButtonDisabled), "\n "),
25
26
  onClick: onClick
@@ -65,15 +65,17 @@ NavigateHeaderNextIcon.defaultProps = {
65
65
  viewBox: "0 0 14 14",
66
66
  xmlns: "http://www.w3.org/2000/svg"
67
67
  };
68
- var Pagination = function Pagination(_ref) {
69
- var classes = _ref.classes,
70
- currentPage = _ref.currentPage,
71
- handlePageChange = _ref.handlePageChange,
72
- rowsPerPage = _ref.rowsPerPage,
73
- totalRows = _ref.totalRows,
74
- isResponsive = _ref.isResponsive;
75
- var totalPages = rowsPerPage >= totalRows ? 1 : Math.ceil(totalRows / rowsPerPage);
76
- var pageList = (0, _utils.getPageNumbers)(totalPages, currentPage, isResponsive);
68
+ const Pagination = _ref => {
69
+ let {
70
+ classes,
71
+ currentPage,
72
+ handlePageChange,
73
+ rowsPerPage,
74
+ totalRows,
75
+ isResponsive
76
+ } = _ref;
77
+ const totalPages = rowsPerPage >= totalRows ? 1 : Math.ceil(totalRows / rowsPerPage);
78
+ const pageList = (0, _utils.getPageNumbers)(totalPages, currentPage, isResponsive);
77
79
  return /*#__PURE__*/_react.default.createElement("div", {
78
80
  className: _stylesModule.default.pagination
79
81
  }, totalPages > _constants.PAGINATION_LIMIT_DOUBLE_ARROWS && !isResponsive && /*#__PURE__*/_react.default.createElement(_NavigationButton.default, {
@@ -82,42 +84,30 @@ var Pagination = function Pagination(_ref) {
82
84
  Icon: NavigateHeaderBeforeIcon,
83
85
  label: "1",
84
86
  disabled: currentPage === 0,
85
- onClick: function onClick() {
86
- return handlePageChange(0);
87
- }
87
+ onClick: () => handlePageChange(0)
88
88
  }), /*#__PURE__*/_react.default.createElement(_NavigationButton.default, {
89
89
  classes: classes,
90
90
  className: _stylesModule.default.firstArrow,
91
91
  Icon: NavigateBeforeIcon,
92
92
  disabled: currentPage === 0,
93
- onClick: function onClick() {
94
- return handlePageChange(currentPage - 1);
95
- }
96
- }), pageList.map(function (page) {
97
- return /*#__PURE__*/_react.default.createElement(_UTTouchableWithoutFeedback.default, {
98
- key: "page_".concat(page),
99
- className: "\n ".concat(_stylesModule.default.pageButton, "\n ").concat(classes.pageButton, "\n ").concat(currentPage === page && "".concat(_stylesModule.default.buttonDisabled, " ").concat(classes.pageButtonSelected), "\n "),
100
- onClick: function onClick() {
101
- return handlePageChange(page);
102
- }
103
- }, page + 1);
104
- }), /*#__PURE__*/_react.default.createElement(_NavigationButton.default, {
93
+ onClick: () => handlePageChange(currentPage - 1)
94
+ }), pageList.map(page => /*#__PURE__*/_react.default.createElement(_UTTouchableWithoutFeedback.default, {
95
+ key: "page_".concat(page),
96
+ className: "\n ".concat(_stylesModule.default.pageButton, "\n ").concat(classes.pageButton, "\n ").concat(currentPage === page && "".concat(_stylesModule.default.buttonDisabled, " ").concat(classes.pageButtonSelected), "\n "),
97
+ onClick: () => handlePageChange(page)
98
+ }, page + 1)), /*#__PURE__*/_react.default.createElement(_NavigationButton.default, {
105
99
  classes: classes,
106
100
  className: _stylesModule.default.lastArrow,
107
101
  Icon: NavigateNextIcon,
108
102
  disabled: currentPage === totalPages - 1,
109
- onClick: function onClick() {
110
- return handlePageChange(currentPage + 1);
111
- }
103
+ onClick: () => handlePageChange(currentPage + 1)
112
104
  }), totalPages > _constants.PAGINATION_LIMIT_DOUBLE_ARROWS && !isResponsive && /*#__PURE__*/_react.default.createElement(_NavigationButton.default, {
113
105
  classes: classes,
114
106
  className: _stylesModule.default.navigationLabel,
115
107
  Icon: NavigateHeaderNextIcon,
116
108
  label: totalPages,
117
109
  disabled: currentPage === totalPages - 1,
118
- onClick: function onClick() {
119
- return handlePageChange(totalPages - 1);
120
- }
110
+ onClick: () => handlePageChange(totalPages - 1)
121
111
  }));
122
112
  };
123
113
  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,4 +4,4 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.PREPOSITION = void 0;
7
- var PREPOSITION = exports.PREPOSITION = 'de';
7
+ const PREPOSITION = exports.PREPOSITION = 'de';
@@ -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
  });
@@ -13,18 +12,20 @@ var _Pagination = _interopRequireDefault(require("./components/Pagination"));
13
12
  var _constants = require("./constants");
14
13
  var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
15
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
- 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); }
17
- 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; }
18
- var TableFooter = function TableFooter(_ref) {
19
- var classes = _ref.classes,
20
- page = _ref.page,
21
- handlePageChange = _ref.handlePageChange,
22
- onChangeRowPerPage = _ref.onChangeRowPerPage,
23
- rowsPerPage = _ref.rowsPerPage,
24
- rowsPerPageOptions = _ref.rowsPerPageOptions,
25
- totalRows = _ref.totalRows,
26
- totalRowsLabel = _ref.totalRowsLabel,
27
- isResponsive = _ref.isResponsive;
15
+ 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); }
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
+ const TableFooter = _ref => {
18
+ let {
19
+ classes,
20
+ page,
21
+ handlePageChange,
22
+ onChangeRowPerPage,
23
+ rowsPerPage,
24
+ rowsPerPageOptions,
25
+ totalRows,
26
+ totalRowsLabel,
27
+ isResponsive
28
+ } = _ref;
28
29
  return /*#__PURE__*/_react.default.createElement("div", {
29
30
  className: _stylesModule.default.tableFooter
30
31
  }, /*#__PURE__*/_react.default.createElement(_PageSizeSelector.default, {
@@ -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
  });
@@ -12,8 +11,8 @@ var _UTLabel = _interopRequireDefault(require("../../../UTLabel"));
12
11
  var _types = require("../../types");
13
12
  var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
14
13
  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; }
14
+ 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); }
15
+ 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
16
  var RefreshIcon = function RefreshIcon(props) {
18
17
  return /*#__PURE__*/_react.default.createElement("svg", props, /*#__PURE__*/_react.default.createElement("path", {
19
18
  fill: "#FF6026",
@@ -27,12 +26,14 @@ RefreshIcon.defaultProps = {
27
26
  viewBox: "0 0 18 18",
28
27
  xmlns: "http://www.w3.org/2000/svg"
29
28
  };
30
- var TableHeader = function TableHeader(_ref) {
31
- var classes = _ref.classes,
32
- onReload = _ref.onReload,
33
- title = _ref.title,
34
- GeneralActions = _ref.GeneralActions,
35
- disabled = _ref.disabled;
29
+ const TableHeader = _ref => {
30
+ let {
31
+ classes,
32
+ onReload,
33
+ title,
34
+ GeneralActions,
35
+ disabled
36
+ } = _ref;
36
37
  return /*#__PURE__*/_react.default.createElement("div", {
37
38
  className: "".concat(_stylesModule.default.header, " ").concat(classes.headerContainer)
38
39
  }, /*#__PURE__*/_react.default.createElement("div", {
@@ -4,10 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.tippyProps = void 0;
7
- var tippyProps = exports.tippyProps = {
8
- appendTo: function appendTo() {
9
- return document.body;
10
- },
7
+ const tippyProps = exports.tippyProps = {
8
+ appendTo: () => document.body,
11
9
  interactive: false,
12
10
  maxWidth: 'none'
13
11
  };
@@ -18,50 +18,43 @@ var _types = require("../../types");
18
18
  var _constants2 = require("./constants");
19
19
  var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
20
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
- 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); }
22
- 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; }
23
- 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); }
21
+ 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); }
22
+ 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; }
24
23
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
25
- 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; }
26
- 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; }
27
- 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; }
28
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
29
- 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); }
30
- var TableRow = function TableRow(_ref) {
31
- var CellComponent = _ref.CellComponent,
32
- cellProps = _ref.cellProps,
33
- checkBoxOnChange = _ref.checkBoxOnChange,
34
- checkBoxSelected = _ref.checkBoxSelected,
35
- checkBoxClassName = _ref.checkBoxClassName,
36
- className = _ref.className,
37
- columnsDefinition = _ref.columnsDefinition,
38
- columnSizes = _ref.columnSizes,
39
- containerStyle = _ref.containerStyle,
40
- exclusiveSelection = _ref.exclusiveSelection,
41
- selectable = _ref.selectable,
42
- disableRowSelection = _ref.disableRowSelection,
43
- disabledRowSelectionTooltip = _ref.disabledRowSelectionTooltip,
44
- fixedRowsLeftClassName = _ref.fixedRowsLeftClassName,
45
- fixedRowsRightClassName = _ref.fixedRowsRightClassName,
46
- handleRowClick = _ref.handleRowClick,
47
- removeFixedRowsDivisors = _ref.removeFixedRowsDivisors,
48
- rowClassName = _ref.rowClassName,
49
- rowStyles = _ref.rowStyles,
50
- tableSize = _ref.tableSize,
51
- isResponsive = _ref.isResponsive,
52
- pageRows = _ref.pageRows;
53
- var _columnsDefinition$fi = columnsDefinition.fixedLeftColumns,
54
- fixedLeftColumns = _columnsDefinition$fi === void 0 ? [] : _columnsDefinition$fi,
55
- _columnsDefinition$fi2 = columnsDefinition.fixedRightColumns,
56
- fixedRightColumns = _columnsDefinition$fi2 === void 0 ? [] : _columnsDefinition$fi2,
57
- _columnsDefinition$se = columnsDefinition.secondaryColumns,
58
- secondaryColumns = _columnsDefinition$se === void 0 ? [] : _columnsDefinition$se,
59
- _columnsDefinition$pr = columnsDefinition.primaryActions,
60
- primaryActions = _columnsDefinition$pr === void 0 ? [] : _columnsDefinition$pr,
61
- _columnsDefinition$se2 = columnsDefinition.secondaryActions,
62
- secondaryActions = _columnsDefinition$se2 === void 0 ? [] : _columnsDefinition$se2;
63
- var SelectionComponent = exclusiveSelection ? _Radio.default : _Checkbox.default;
64
- var selectableCellStyles = isResponsive ? "".concat(_stylesModule.default.secondaryActionsContainer, "\n ").concat(cellProps.classes.responsiveCell, "\n ").concat(selectable || !(0, _array.isEmpty)(secondaryActions) ? cellProps.classes.responsiveRowTopBorder : _stylesModule.default.hidden) : "\n\t".concat(_stylesModule.default.fixedRowLeft, "\n\t").concat(fixedRowsLeftClassName, "\n\t").concat((removeFixedRowsDivisors || (0, _array.isEmpty)(fixedLeftColumns)) && _stylesModule.default.disableBorderRight, "\n\t").concat(!selectable && (0, _array.isEmpty)(fixedLeftColumns) && _stylesModule.default.cleanFixedColumns, "\n");
24
+ const TableRow = _ref => {
25
+ let {
26
+ CellComponent,
27
+ cellProps,
28
+ checkBoxOnChange,
29
+ checkBoxSelected,
30
+ checkBoxClassName,
31
+ className,
32
+ columnsDefinition,
33
+ columnSizes,
34
+ containerStyle,
35
+ exclusiveSelection,
36
+ selectable,
37
+ disableRowSelection,
38
+ disabledRowSelectionTooltip,
39
+ fixedRowsLeftClassName,
40
+ fixedRowsRightClassName,
41
+ handleRowClick,
42
+ removeFixedRowsDivisors,
43
+ rowClassName,
44
+ rowStyles,
45
+ tableSize,
46
+ isResponsive,
47
+ pageRows
48
+ } = _ref;
49
+ const {
50
+ fixedLeftColumns = [],
51
+ fixedRightColumns = [],
52
+ secondaryColumns = [],
53
+ primaryActions = [],
54
+ secondaryActions = []
55
+ } = columnsDefinition;
56
+ const SelectionComponent = exclusiveSelection ? _Radio.default : _Checkbox.default;
57
+ const selectableCellStyles = isResponsive ? "".concat(_stylesModule.default.secondaryActionsContainer, "\n ").concat(cellProps.classes.responsiveCell, "\n ").concat(selectable || !(0, _array.isEmpty)(secondaryActions) ? cellProps.classes.responsiveRowTopBorder : _stylesModule.default.hidden) : "\n\t".concat(_stylesModule.default.fixedRowLeft, "\n\t").concat(fixedRowsLeftClassName, "\n\t").concat((removeFixedRowsDivisors || (0, _array.isEmpty)(fixedLeftColumns)) && _stylesModule.default.disableBorderRight, "\n\t").concat(!selectable && (0, _array.isEmpty)(fixedLeftColumns) && _stylesModule.default.cleanFixedColumns, "\n");
65
58
  return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_UTTouchableWithoutFeedback.default, {
66
59
  onClick: handleRowClick,
67
60
  className: "\n ".concat(_stylesModule.default.row, "\n ").concat((!handleRowClick || isResponsive) && _stylesModule.default.noClick, "\n ").concat(isResponsive && cellProps.classes.responsiveRow, "\n ").concat(className, "\n "),
@@ -70,14 +63,16 @@ var TableRow = function TableRow(_ref) {
70
63
  className: _stylesModule.default.stickyRowBackground
71
64
  }, /*#__PURE__*/_react.default.createElement("div", {
72
65
  className: "".concat(_stylesModule.default.rowBackground, " ").concat(rowClassName),
73
- style: _objectSpread({
74
- width: tableSize
75
- }, rowStyles.rowBackground)
66
+ style: {
67
+ width: tableSize,
68
+ ...rowStyles.rowBackground
69
+ }
76
70
  })), /*#__PURE__*/_react.default.createElement("div", {
77
71
  className: selectableCellStyles,
78
- style: _objectSpread(_objectSpread({}, rowStyles.fixedRowsLeft), {}, {
72
+ style: {
73
+ ...rowStyles.fixedRowsLeft,
79
74
  width: isResponsive ? 'auto' : columnSizes.leftColumnsSize
80
- })
75
+ }
81
76
  }, selectable && /*#__PURE__*/_react.default.createElement("div", {
82
77
  className: "\n ".concat(_stylesModule.default.checkBoxCell, "\n ").concat(checkBoxSelected ? cellProps.classes.headerDecoratorSelected : cellProps.classes.headerDecoratorUnselected, "\n ").concat(checkBoxClassName, "\n ").concat(isResponsive && checkBoxSelected && cellProps.classes.selectedResponsiveCell, "\n "),
83
78
  style: rowStyles.selectCell
@@ -95,57 +90,48 @@ var TableRow = function TableRow(_ref) {
95
90
  checked: checkBoxSelected,
96
91
  onChange: checkBoxOnChange,
97
92
  disabled: disableRowSelection && disableRowSelection(cellProps.rowData, pageRows)
98
- })))), fixedLeftColumns.map(function (column) {
99
- return /*#__PURE__*/_react.default.createElement(CellComponent, _extends({
100
- key: "cell_".concat(column.key),
101
- column: column,
102
- columnSizes: columnSizes
103
- }, cellProps));
104
- }), !(0, _array.isEmpty)(secondaryActions) && /*#__PURE__*/_react.default.createElement("div", {
93
+ })))), fixedLeftColumns.map(column => /*#__PURE__*/_react.default.createElement(CellComponent, _extends({
94
+ key: "cell_".concat(column.key),
95
+ column: column,
96
+ columnSizes: columnSizes
97
+ }, cellProps))), !(0, _array.isEmpty)(secondaryActions) && /*#__PURE__*/_react.default.createElement("div", {
105
98
  className: _stylesModule.default.secondaryActions
106
- }, secondaryActions.map(function (action) {
107
- return /*#__PURE__*/_react.default.createElement(_ActionIcons.default, {
108
- column: action,
109
- key: "action_".concat(action.key),
110
- rowData: cellProps.rowData,
111
- classes: cellProps.classes
112
- });
113
- }))), !(0, _array.isEmpty)(secondaryColumns) && /*#__PURE__*/_react.default.createElement("div", {
99
+ }, secondaryActions.map(action => /*#__PURE__*/_react.default.createElement(_ActionIcons.default, {
100
+ column: action,
101
+ key: "action_".concat(action.key),
102
+ rowData: cellProps.rowData,
103
+ classes: cellProps.classes
104
+ })))), !(0, _array.isEmpty)(secondaryColumns) && /*#__PURE__*/_react.default.createElement("div", {
114
105
  className: "\n ".concat(_stylesModule.default.secondaryColumns, " \n ").concat(isResponsive && checkBoxSelected && cellProps.classes.selectedResponsiveCell, "\n ").concat(isResponsive && selectable && _stylesModule.default.hideTopBorder, "\n "),
115
106
  style: {
116
107
  width: isResponsive ? 'auto' : columnSizes.secondaryColumnsSize
117
108
  }
118
- }, secondaryColumns.map(function (column, index) {
119
- return /*#__PURE__*/_react.default.createElement(CellComponent, _extends({
120
- key: "cell_".concat(column.key),
121
- column: column,
122
- columnSizes: columnSizes
123
- }, cellProps, {
124
- rowStyles: rowStyles,
125
- showBottomBorder: index === secondaryColumns.length - 1 && (0, _array.isEmpty)(primaryActions)
126
- }));
127
- }), primaryActions.map(function (column, index) {
128
- return /*#__PURE__*/_react.default.createElement(_PrimaryAction.default, _extends({
129
- key: "cell_".concat(column.key),
130
- column: column
131
- }, cellProps, {
132
- rowStyles: rowStyles,
133
- showBottomRadius: index === primaryActions.length - 1,
134
- showBottomBorder: index === primaryActions.length - 1
135
- }));
136
- })), !isResponsive && /*#__PURE__*/_react.default.createElement("div", {
109
+ }, secondaryColumns.map((column, index) => /*#__PURE__*/_react.default.createElement(CellComponent, _extends({
110
+ key: "cell_".concat(column.key),
111
+ column: column,
112
+ columnSizes: columnSizes
113
+ }, cellProps, {
114
+ rowStyles: rowStyles,
115
+ showBottomBorder: index === secondaryColumns.length - 1 && (0, _array.isEmpty)(primaryActions)
116
+ }))), primaryActions.map((column, index) => /*#__PURE__*/_react.default.createElement(_PrimaryAction.default, _extends({
117
+ key: "cell_".concat(column.key),
118
+ column: column
119
+ }, cellProps, {
120
+ rowStyles: rowStyles,
121
+ showBottomRadius: index === primaryActions.length - 1,
122
+ showBottomBorder: index === primaryActions.length - 1
123
+ })))), !isResponsive && /*#__PURE__*/_react.default.createElement("div", {
137
124
  className: "\n ".concat(_stylesModule.default.fixedRowRight, "\n ").concat(fixedRowsRightClassName, "\n ").concat((removeFixedRowsDivisors || (0, _array.isEmpty)(fixedRightColumns)) && _stylesModule.default.disableBorderLeft, "\n ").concat((0, _array.isEmpty)(fixedRightColumns) && _stylesModule.default.cleanFixedColumns, "\n "),
138
- style: _objectSpread(_objectSpread({}, rowStyles.fixedRowsRight), {}, {
125
+ style: {
126
+ ...rowStyles.fixedRowsRight,
139
127
  width: columnSizes.rightColumnsSize
140
- })
141
- }, fixedRightColumns.map(function (column) {
142
- return /*#__PURE__*/_react.default.createElement(CellComponent, _extends({
143
- key: "cell_".concat(column.key),
144
- column: column,
145
- columnSizes: columnSizes,
146
- align: _constants.COLUMN_POSITION.RIGHT
147
- }, cellProps));
148
- }))));
128
+ }
129
+ }, fixedRightColumns.map(column => /*#__PURE__*/_react.default.createElement(CellComponent, _extends({
130
+ key: "cell_".concat(column.key),
131
+ column: column,
132
+ columnSizes: columnSizes,
133
+ align: _constants.COLUMN_POSITION.RIGHT
134
+ }, cellProps))))));
149
135
  };
150
136
  TableRow.propTypes = {
151
137
  CellComponent: _propTypes.elementType,