@widergy/energy-ui 2.12.1 → 2.12.2

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 (277) hide show
  1. package/dist/components/EnergyThemeProvider/index.js +36 -13
  2. package/dist/components/Loading/constants.js +2 -1
  3. package/dist/components/Loading/index.js +12 -13
  4. package/dist/components/Loading/theme.js +2 -4
  5. package/dist/components/UTAlert/AlertHandler.js +101 -75
  6. package/dist/components/UTAlert/index.js +87 -65
  7. package/dist/components/UTAlert/theme.js +32 -32
  8. package/dist/components/UTAttachment/components/Preview/index.js +9 -8
  9. package/dist/components/UTAttachment/constants.js +13 -7
  10. package/dist/components/UTAttachment/index.js +250 -159
  11. package/dist/components/UTAttachment/layout.js +27 -26
  12. package/dist/components/UTAttachment/theme.js +2 -4
  13. package/dist/components/UTAttachment/utils.js +117 -34
  14. package/dist/components/UTAutocomplete/components/ListBox/index.js +21 -13
  15. package/dist/components/UTAutocomplete/components/ListBox/utils.js +11 -9
  16. package/dist/components/UTAutocomplete/constants.js +23 -12
  17. package/dist/components/UTAutocomplete/index.js +94 -54
  18. package/dist/components/UTAutocomplete/theme.js +4 -6
  19. package/dist/components/UTAvatar/constants.js +3 -2
  20. package/dist/components/UTAvatar/index.js +17 -18
  21. package/dist/components/UTBarChart/components/Bars/components/Bar/components/Rect/index.js +22 -22
  22. package/dist/components/UTBarChart/components/Bars/components/Bar/constants.js +1 -1
  23. package/dist/components/UTBarChart/components/Bars/components/Bar/index.js +22 -21
  24. package/dist/components/UTBarChart/components/Bars/constants.js +6 -3
  25. package/dist/components/UTBarChart/components/Bars/index.js +80 -70
  26. package/dist/components/UTBarChart/components/Legend/constants.js +18 -12
  27. package/dist/components/UTBarChart/components/Legend/index.js +93 -75
  28. package/dist/components/UTBarChart/components/Legend/utils.js +5 -1
  29. package/dist/components/UTBarChart/components/Levels/index.js +14 -16
  30. package/dist/components/UTBarChart/components/Levels/utils.js +27 -25
  31. package/dist/components/UTBarChart/components/LinearPlot/constants.js +5 -3
  32. package/dist/components/UTBarChart/components/LinearPlot/index.js +20 -25
  33. package/dist/components/UTBarChart/components/LinearPlot/utils.js +39 -37
  34. package/dist/components/UTBarChart/components/Pagination/constants.js +2 -1
  35. package/dist/components/UTBarChart/components/Pagination/index.js +24 -20
  36. package/dist/components/UTBarChart/components/XAxis/components/AxisElement/index.js +32 -21
  37. package/dist/components/UTBarChart/components/XAxis/components/Decoration/constants.js +4 -2
  38. package/dist/components/UTBarChart/components/XAxis/components/Decoration/index.js +19 -20
  39. package/dist/components/UTBarChart/components/XAxis/constants.js +2 -1
  40. package/dist/components/UTBarChart/components/XAxis/index.js +65 -54
  41. package/dist/components/UTBarChart/components/YAxis/AxisElement/index.js +11 -12
  42. package/dist/components/UTBarChart/components/YAxis/constants.js +2 -1
  43. package/dist/components/UTBarChart/components/YAxis/index.js +37 -30
  44. package/dist/components/UTBarChart/components/YAxis/utils.js +6 -4
  45. package/dist/components/UTBarChart/constants.js +8 -4
  46. package/dist/components/UTBarChart/hooks/use-dynamic-margins.js +40 -23
  47. package/dist/components/UTBarChart/index.js +166 -152
  48. package/dist/components/UTBarChart/theme.js +2 -4
  49. package/dist/components/UTBarChart/types.js +19 -10
  50. package/dist/components/UTBarChart/utils.js +111 -107
  51. package/dist/components/UTBreadcrumbs/constants.js +31 -23
  52. package/dist/components/UTBreadcrumbs/index.js +101 -76
  53. package/dist/components/UTBreadcrumbs/theme.js +2 -4
  54. package/dist/components/UTButton/constants.js +17 -11
  55. package/dist/components/UTButton/index.js +31 -28
  56. package/dist/components/UTButton/theme.js +23 -23
  57. package/dist/components/UTCBUInput/index.js +40 -36
  58. package/dist/components/UTCBUInput/theme.js +2 -4
  59. package/dist/components/UTCaptcha/index.js +45 -19
  60. package/dist/components/UTCard/components/UTCardFooter/index.js +16 -15
  61. package/dist/components/UTCard/index.js +120 -85
  62. package/dist/components/UTCard/theme.js +12 -11
  63. package/dist/components/UTCard/types.js +3 -2
  64. package/dist/components/UTCarousel/components/Button/index.js +13 -13
  65. package/dist/components/UTCarousel/components/Legend/index.js +15 -13
  66. package/dist/components/UTCarousel/components/Slider/component/Slide/index.js +16 -16
  67. package/dist/components/UTCarousel/components/Slider/constants.js +10 -5
  68. package/dist/components/UTCarousel/components/Slider/index.js +273 -204
  69. package/dist/components/UTCarousel/components/Slider/layout.js +94 -67
  70. package/dist/components/UTCarousel/index.js +15 -14
  71. package/dist/components/UTCarousel/theme.js +2 -4
  72. package/dist/components/UTCheckList/constants.js +2 -1
  73. package/dist/components/UTCheckList/index.js +93 -72
  74. package/dist/components/UTCheckList/theme.js +31 -31
  75. package/dist/components/UTCheckbox/constants.js +6 -3
  76. package/dist/components/UTCheckbox/index.js +44 -32
  77. package/dist/components/UTCheckbox/theme.js +35 -35
  78. package/dist/components/UTConsumptionBar/components/ConsumptionBarIndicator/index.js +9 -9
  79. package/dist/components/UTConsumptionBar/constants.js +6 -3
  80. package/dist/components/UTConsumptionBar/index.js +80 -53
  81. package/dist/components/UTCuit/index.js +133 -109
  82. package/dist/components/UTCuit/theme.js +53 -51
  83. package/dist/components/UTDatePicker/components/Day/constants.js +2 -1
  84. package/dist/components/UTDatePicker/components/Day/index.js +12 -12
  85. package/dist/components/UTDatePicker/constants.js +31 -20
  86. package/dist/components/UTDatePicker/index.js +102 -60
  87. package/dist/components/UTDatePicker/theme.js +3 -5
  88. package/dist/components/UTDatePicker/types.js +3 -2
  89. package/dist/components/UTDatePicker/utils.js +6 -2
  90. package/dist/components/UTDialog/constants.js +4 -2
  91. package/dist/components/UTDialog/index.js +37 -38
  92. package/dist/components/UTDialog/theme.js +2 -4
  93. package/dist/components/UTDialog/types.js +3 -2
  94. package/dist/components/UTDotMenu/index.js +61 -39
  95. package/dist/components/UTEmojiPicker/constants.js +11 -6
  96. package/dist/components/UTEmojiPicker/index.js +65 -45
  97. package/dist/components/UTEmojiPicker/theme.js +2 -4
  98. package/dist/components/UTEmojiPicker/utils.js +51 -21
  99. package/dist/components/UTExternalLink/constants.js +5 -3
  100. package/dist/components/UTExternalLink/index.js +15 -18
  101. package/dist/components/UTExternalLink/theme.js +6 -8
  102. package/dist/components/UTFileInput/constants.js +4 -2
  103. package/dist/components/UTFileInput/index.js +31 -7
  104. package/dist/components/UTFileInput/layout.js +97 -68
  105. package/dist/components/UTIconButton/index.js +72 -49
  106. package/dist/components/UTIconButton/theme.js +2 -4
  107. package/dist/components/UTImageRadio/components/ImageRadioCard/index.js +58 -53
  108. package/dist/components/UTImageRadio/constants.js +6 -3
  109. package/dist/components/UTImageRadio/index.js +47 -39
  110. package/dist/components/UTImageRadio/theme.js +12 -11
  111. package/dist/components/UTImageRadio/types.js +3 -2
  112. package/dist/components/UTImageRadio/utils.js +6 -2
  113. package/dist/components/UTLabel/constants.js +20 -14
  114. package/dist/components/UTLabel/index.js +20 -18
  115. package/dist/components/UTLabel/theme.js +15 -15
  116. package/dist/components/UTList/index.js +18 -15
  117. package/dist/components/UTLoading/index.js +15 -15
  118. package/dist/components/UTMap/components/GoogleMaps/constants.js +11 -8
  119. package/dist/components/UTMap/components/GoogleMaps/index.js +91 -63
  120. package/dist/components/UTMap/components/GoogleMaps/styles.js +3 -2
  121. package/dist/components/UTMap/constants.js +12 -6
  122. package/dist/components/UTMap/index.js +198 -163
  123. package/dist/components/UTMap/types.js +6 -4
  124. package/dist/components/UTMap/utils.js +46 -29
  125. package/dist/components/UTMap/withGoogleMapScript.js +22 -18
  126. package/dist/components/UTMenu/index.js +69 -52
  127. package/dist/components/UTMenu/theme.js +3 -5
  128. package/dist/components/UTMenu/utils.js +11 -5
  129. package/dist/components/UTModal/constants.js +13 -9
  130. package/dist/components/UTModal/index.js +30 -26
  131. package/dist/components/UTModal/theme.js +2 -4
  132. package/dist/components/UTPagination/components/PageSizeSelector/index.js +10 -11
  133. package/dist/components/UTPagination/components/PageSizeSelector/utils.js +13 -7
  134. package/dist/components/UTPagination/components/Pagination/components/NavigationButton/index.js +12 -12
  135. package/dist/components/UTPagination/components/Pagination/index.js +39 -28
  136. package/dist/components/UTPagination/components/Pagination/utils.js +14 -8
  137. package/dist/components/UTPagination/constants.js +6 -3
  138. package/dist/components/UTPagination/index.js +17 -16
  139. package/dist/components/UTPagination/theme.js +2 -4
  140. package/dist/components/UTPanel/index.js +44 -38
  141. package/dist/components/UTPasswordField/components/PasswordValidations/components/Error/index.js +10 -13
  142. package/dist/components/UTPasswordField/components/PasswordValidations/components/Validation/index.js +19 -22
  143. package/dist/components/UTPasswordField/components/PasswordValidations/index.js +50 -63
  144. package/dist/components/UTPasswordField/components/PasswordWarning/index.js +26 -25
  145. package/dist/components/UTPasswordField/index.js +23 -26
  146. package/dist/components/UTPasswordField/theme.js +2 -4
  147. package/dist/components/UTPhoneInput/constants.js +6 -3
  148. package/dist/components/UTPhoneInput/index.js +205 -180
  149. package/dist/components/UTPhoneInput/theme.js +77 -77
  150. package/dist/components/UTPieChart/components/ArrowLabel/constants.js +8 -4
  151. package/dist/components/UTPieChart/components/ArrowLabel/index.js +23 -24
  152. package/dist/components/UTPieChart/components/Legend/contants.js +6 -3
  153. package/dist/components/UTPieChart/components/Legend/index.js +24 -27
  154. package/dist/components/UTPieChart/constants.js +26 -13
  155. package/dist/components/UTPieChart/hooks/use-animated-value/index.js +33 -15
  156. package/dist/components/UTPieChart/index.js +76 -73
  157. package/dist/components/UTPieChart/theme.js +2 -4
  158. package/dist/components/UTPieChart/utils.js +2 -4
  159. package/dist/components/UTProgressBar/constants.js +4 -2
  160. package/dist/components/UTProgressBar/index.js +17 -15
  161. package/dist/components/UTProgressBar/theme.js +2 -4
  162. package/dist/components/UTProgressBar/types.js +3 -2
  163. package/dist/components/UTRadioGroup/index.js +83 -56
  164. package/dist/components/UTRadioGroup/theme.js +52 -52
  165. package/dist/components/UTRating/components/Circle/index.js +56 -41
  166. package/dist/components/UTRating/components/Faces/constants.js +4 -2
  167. package/dist/components/UTRating/components/Faces/index.js +36 -34
  168. package/dist/components/UTRating/components/Star/index.js +40 -36
  169. package/dist/components/UTRating/constants.js +8 -4
  170. package/dist/components/UTRating/index.js +46 -31
  171. package/dist/components/UTRating/theme.js +2 -4
  172. package/dist/components/UTRipple/Ripple.js +39 -22
  173. package/dist/components/UTRipple/index.js +37 -18
  174. package/dist/components/UTSelect/components/Option/index.js +13 -13
  175. package/dist/components/UTSelect/constants.js +8 -4
  176. package/dist/components/UTSelect/index.js +85 -63
  177. package/dist/components/UTSelect/stylesJS.js +3 -2
  178. package/dist/components/UTSelect/theme.js +4 -6
  179. package/dist/components/UTSelect/utils.js +13 -3
  180. package/dist/components/UTSidebar/components/ListOption/index.js +49 -34
  181. package/dist/components/UTSidebar/components/LogosContainer/components/DynamicIcon/index.js +8 -8
  182. package/dist/components/UTSidebar/components/LogosContainer/index.js +14 -14
  183. package/dist/components/UTSidebar/components/Option/constants.js +3 -2
  184. package/dist/components/UTSidebar/components/Option/index.js +32 -28
  185. package/dist/components/UTSidebar/components/Toggler/index.js +11 -11
  186. package/dist/components/UTSidebar/index.js +53 -42
  187. package/dist/components/UTSidebar/theme.js +2 -4
  188. package/dist/components/UTSidebar/types.js +10 -5
  189. package/dist/components/UTSkeleton/index.js +36 -10
  190. package/dist/components/UTStatus/constants.js +9 -5
  191. package/dist/components/UTStatus/index.js +15 -16
  192. package/dist/components/UTStatus/theme.js +49 -66
  193. package/dist/components/UTSwitch/constants.js +6 -3
  194. package/dist/components/UTSwitch/index.js +57 -42
  195. package/dist/components/UTSwitch/theme.js +2 -4
  196. package/dist/components/UTTable/components/ActionIcons/constants.js +2 -1
  197. package/dist/components/UTTable/components/ActionIcons/index.js +85 -47
  198. package/dist/components/UTTable/components/Cell/components/ActionButton/index.js +12 -10
  199. package/dist/components/UTTable/components/Cell/index.js +23 -18
  200. package/dist/components/UTTable/components/HeaderCell/constants.js +3 -2
  201. package/dist/components/UTTable/components/HeaderCell/index.js +30 -23
  202. package/dist/components/UTTable/components/HeaderCell/utils.js +3 -3
  203. package/dist/components/UTTable/components/PrimaryAction/index.js +11 -12
  204. package/dist/components/UTTable/components/ResponsiveCell/index.js +20 -19
  205. package/dist/components/UTTable/components/Status/index.js +19 -18
  206. package/dist/components/UTTable/components/TableFooter/components/PageSizeSelector/index.js +9 -10
  207. package/dist/components/UTTable/components/TableFooter/components/PageSizeSelector/utils.js +13 -7
  208. package/dist/components/UTTable/components/TableFooter/components/Pagination/components/NavigationButton/index.js +12 -12
  209. package/dist/components/UTTable/components/TableFooter/components/Pagination/index.js +32 -21
  210. package/dist/components/UTTable/components/TableFooter/components/Pagination/utils.js +14 -8
  211. package/dist/components/UTTable/components/TableFooter/constants.js +2 -1
  212. package/dist/components/UTTable/components/TableFooter/index.js +15 -15
  213. package/dist/components/UTTable/components/TableHeader/index.js +11 -11
  214. package/dist/components/UTTable/components/TableRow/constants.js +6 -3
  215. package/dist/components/UTTable/components/TableRow/index.js +94 -79
  216. package/dist/components/UTTable/constants.js +43 -26
  217. package/dist/components/UTTable/hook.js +26 -11
  218. package/dist/components/UTTable/index.js +223 -132
  219. package/dist/components/UTTable/theme.js +17 -17
  220. package/dist/components/UTTable/types.js +8 -4
  221. package/dist/components/UTTable/utils.js +74 -70
  222. package/dist/components/UTTabs/components/TooltipTab/index.js +30 -20
  223. package/dist/components/UTTabs/constants.js +8 -4
  224. package/dist/components/UTTabs/index.js +86 -57
  225. package/dist/components/UTTabs/theme.js +2 -4
  226. package/dist/components/UTTabs/utils.js +1 -1
  227. package/dist/components/UTTextArea/constants.js +6 -3
  228. package/dist/components/UTTextArea/index.js +23 -23
  229. package/dist/components/UTTextArea/theme.js +2 -4
  230. package/dist/components/UTTextInput/constants.js +3 -2
  231. package/dist/components/UTTextInput/index.js +165 -137
  232. package/dist/components/UTTextInput/theme.js +4 -6
  233. package/dist/components/UTThirdPartyCookieChecker/index.js +21 -17
  234. package/dist/components/UTToggle/components/ToggleOption/index.js +17 -16
  235. package/dist/components/UTToggle/index.js +26 -25
  236. package/dist/components/UTToggle/theme.js +2 -4
  237. package/dist/components/UTTooltip/index.js +30 -23
  238. package/dist/components/UTTooltip/theme.js +2 -4
  239. package/dist/components/UTTopbar/components/Notifications/index.js +14 -11
  240. package/dist/components/UTTopbar/components/UserMenu/index.js +15 -15
  241. package/dist/components/UTTopbar/index.js +31 -28
  242. package/dist/components/UTTopbar/theme.js +2 -4
  243. package/dist/components/UTTopbar/types.js +9 -5
  244. package/dist/components/UTTouchableWithoutFeedback/index.js +27 -14
  245. package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/constants.js +4 -2
  246. package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/index.js +31 -34
  247. package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/utils.js +4 -4
  248. package/dist/components/UTVirtualizedList/components/VirtualizedData/constants.js +12 -6
  249. package/dist/components/UTVirtualizedList/components/VirtualizedData/hooks/use-ledger.js +18 -8
  250. package/dist/components/UTVirtualizedList/components/VirtualizedData/hooks/use-virtualized-data.js +47 -23
  251. package/dist/components/UTVirtualizedList/components/VirtualizedData/index.js +34 -31
  252. package/dist/components/UTVirtualizedList/components/VirtualizedData/utils.js +93 -81
  253. package/dist/components/UTVirtualizedList/constants.js +8 -4
  254. package/dist/components/UTVirtualizedList/index.js +38 -26
  255. package/dist/components/UTWorkflowContainer/components/ActionButton/index.js +21 -17
  256. package/dist/components/UTWorkflowContainer/constants.js +6 -3
  257. package/dist/components/UTWorkflowContainer/hooks/use-previous.js +3 -3
  258. package/dist/components/UTWorkflowContainer/index.js +51 -32
  259. package/dist/components/UTWorkflowContainer/theme.js +53 -60
  260. package/dist/components/UTWorkflowContainer/types.js +3 -2
  261. package/dist/components/WithLoading/index.js +15 -10
  262. package/dist/components/WithTheme/index.js +17 -10
  263. package/dist/components/WithTheme/layout.js +28 -22
  264. package/dist/components/WithTouch/index.js +19 -12
  265. package/dist/constants/UTTable.js +3 -2
  266. package/dist/index.js +58 -58
  267. package/dist/theme.js +5 -6
  268. package/dist/types/commonTypes.js +5 -3
  269. package/dist/types/consumptionTypes.js +5 -3
  270. package/dist/types/formTypes.js +7 -4
  271. package/dist/types/tableTypes.js +3 -2
  272. package/dist/utils/classesUtils.js +13 -5
  273. package/dist/utils/componentUtils.js +13 -10
  274. package/dist/utils/helperFunctions.js +4 -4
  275. package/dist/utils/shadowUtils.js +11 -13
  276. package/dist/utils/useScreenSize.js +3 -2
  277. package/package.json +1 -1
@@ -1,5 +1,6 @@
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); }
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
@@ -7,6 +8,11 @@ exports.validateProps = exports.retrieveStyle = exports.getLabelTheme = exports.
7
8
  var _react = _interopRequireDefault(require("react"));
8
9
  var _constants = require("./constants");
9
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+ 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; }
12
+ 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; }
13
+ 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; }
14
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
15
+ 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); }
10
16
  var ErrorIcon = function ErrorIcon(props) {
11
17
  return /*#__PURE__*/_react.default.createElement("svg", props, /*#__PURE__*/_react.default.createElement("path", {
12
18
  fillRule: "evenodd",
@@ -82,62 +88,47 @@ WarningIcon.defaultProps = {
82
88
  fill: "none",
83
89
  xmlns: "http://www.w3.org/2000/svg"
84
90
  };
85
- const getBackgroundColor = _ref => {
86
- let {
87
- theme,
88
- type,
89
- variant
90
- } = _ref;
91
+ var getBackgroundColor = function getBackgroundColor(_ref) {
92
+ var theme = _ref.theme,
93
+ type = _ref.type,
94
+ variant = _ref.variant;
91
95
  return variant !== _constants.VARIANTS.unassigned ? theme.Palette[variant][type === _constants.TYPES.negative ? '04' : '01'] : type === _constants.TYPES.negative ? theme.Palette.gray['04'] : theme.Palette.light['04'];
92
96
  };
93
- const getIconFill = _ref2 => {
94
- let {
95
- theme,
96
- type,
97
- variant
98
- } = _ref2;
99
- return {
100
- [_constants.TYPES.default]: theme.Palette.dark['05'],
101
- [_constants.TYPES.light]: theme.Palette[variant !== _constants.VARIANTS.unassigned ? variant : 'gray']['05'],
102
- [_constants.TYPES.negative]: theme.Palette.light['01']
103
- }[type];
104
- };
105
- const defaultIconMapper = variant => ({
106
- [_constants.VARIANTS.error]: ErrorIcon,
107
- [_constants.VARIANTS.information]: InfoIcon,
108
- [_constants.VARIANTS.success]: SuccessIcon,
109
- [_constants.VARIANTS.unassigned]: UnassignedIcon,
110
- [_constants.VARIANTS.warning]: WarningIcon
111
- })[variant];
97
+ var getIconFill = function getIconFill(_ref2) {
98
+ var _TYPES$default$TYPES$;
99
+ var theme = _ref2.theme,
100
+ type = _ref2.type,
101
+ variant = _ref2.variant;
102
+ return (_TYPES$default$TYPES$ = {}, _defineProperty(_TYPES$default$TYPES$, _constants.TYPES.default, theme.Palette.dark['05']), _defineProperty(_TYPES$default$TYPES$, _constants.TYPES.light, theme.Palette[variant !== _constants.VARIANTS.unassigned ? variant : 'gray']['05']), _defineProperty(_TYPES$default$TYPES$, _constants.TYPES.negative, theme.Palette.light['01']), _TYPES$default$TYPES$)[type];
103
+ };
104
+ var defaultIconMapper = function defaultIconMapper(variant) {
105
+ var _VARIANTS$error$VARIA;
106
+ return (_VARIANTS$error$VARIA = {}, _defineProperty(_VARIANTS$error$VARIA, _constants.VARIANTS.error, ErrorIcon), _defineProperty(_VARIANTS$error$VARIA, _constants.VARIANTS.information, InfoIcon), _defineProperty(_VARIANTS$error$VARIA, _constants.VARIANTS.success, SuccessIcon), _defineProperty(_VARIANTS$error$VARIA, _constants.VARIANTS.unassigned, UnassignedIcon), _defineProperty(_VARIANTS$error$VARIA, _constants.VARIANTS.warning, WarningIcon), _VARIANTS$error$VARIA)[variant];
107
+ };
112
108
  exports.defaultIconMapper = defaultIconMapper;
113
- const validateProps = _ref3 => {
114
- let {
115
- type,
116
- variant
117
- } = _ref3;
109
+ var validateProps = function validateProps(_ref3) {
110
+ var type = _ref3.type,
111
+ variant = _ref3.variant;
118
112
  return {
119
113
  type: _constants.TYPES[type] || _constants.TYPES[_constants.DEFAULT_PROPS.type],
120
114
  variant: _constants.VARIANTS[variant] || _constants.VARIANTS[_constants.DEFAULT_PROPS.variant]
121
115
  };
122
116
  };
123
117
  exports.validateProps = validateProps;
124
- const retrieveStyle = _ref4 => {
125
- let {
126
- theme,
127
- type,
128
- uppercase,
129
- variant
130
- } = _ref4;
118
+ var retrieveStyle = function retrieveStyle(_ref4) {
119
+ var theme = _ref4.theme,
120
+ type = _ref4.type,
121
+ uppercase = _ref4.uppercase,
122
+ variant = _ref4.variant;
131
123
  return {
132
124
  root: {
133
125
  alignItems: 'center',
134
- backgroundColor: getBackgroundColor({
135
- theme,
136
- ...validateProps({
137
- type,
138
- variant
139
- })
140
- }),
126
+ backgroundColor: getBackgroundColor(_objectSpread({
127
+ theme: theme
128
+ }, validateProps({
129
+ type: type,
130
+ variant: variant
131
+ }))),
141
132
  borderRadius: '4px',
142
133
  display: 'flex',
143
134
  gridGap: '8px',
@@ -148,37 +139,29 @@ const retrieveStyle = _ref4 => {
148
139
  display: 'none'
149
140
  }
150
141
  },
151
- label: {
152
- ...(uppercase ? {
153
- textTransform: 'uppercase'
154
- } : {})
155
- },
142
+ label: _objectSpread({}, uppercase ? {
143
+ textTransform: 'uppercase'
144
+ } : {}),
156
145
  icon: {
157
146
  flexShrink: '0',
158
147
  height: '20px',
159
148
  width: '20px',
160
149
  '& path': {
161
- fill: getIconFill({
162
- theme,
163
- ...validateProps({
164
- type,
165
- variant
166
- })
167
- })
150
+ fill: getIconFill(_objectSpread({
151
+ theme: theme
152
+ }, validateProps({
153
+ type: type,
154
+ variant: variant
155
+ })))
168
156
  }
169
157
  }
170
158
  };
171
159
  };
172
160
  exports.retrieveStyle = retrieveStyle;
173
- const getLabelTheme = _ref5 => {
174
- let {
175
- type,
176
- variant
177
- } = _ref5;
178
- return {
179
- [_constants.TYPES.default]: 'dark',
180
- [_constants.TYPES.light]: variant !== _constants.VARIANTS.unassigned ? variant : 'gray',
181
- [_constants.TYPES.negative]: 'light'
182
- }[type];
161
+ var getLabelTheme = function getLabelTheme(_ref5) {
162
+ var _TYPES$default$TYPES$2;
163
+ var type = _ref5.type,
164
+ variant = _ref5.variant;
165
+ return (_TYPES$default$TYPES$2 = {}, _defineProperty(_TYPES$default$TYPES$2, _constants.TYPES.default, 'dark'), _defineProperty(_TYPES$default$TYPES$2, _constants.TYPES.light, variant !== _constants.VARIANTS.unassigned ? variant : 'gray'), _defineProperty(_TYPES$default$TYPES$2, _constants.TYPES.negative, 'light'), _TYPES$default$TYPES$2)[type];
183
166
  };
184
167
  exports.getLabelTheme = getLabelTheme;
@@ -4,9 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.TRUE = exports.STATES = exports.DEFAULT_SWITCH_ID = void 0;
7
- const STATES = exports.STATES = {
7
+ var STATES = {
8
8
  ON: 'SI',
9
9
  OFF: 'NO'
10
10
  };
11
- const DEFAULT_SWITCH_ID = exports.DEFAULT_SWITCH_ID = 'switch';
12
- const TRUE = exports.TRUE = 'true';
11
+ exports.STATES = STATES;
12
+ var DEFAULT_SWITCH_ID = 'switch';
13
+ exports.DEFAULT_SWITCH_ID = DEFAULT_SWITCH_ID;
14
+ var TRUE = 'true';
15
+ exports.TRUE = TRUE;
@@ -1,5 +1,6 @@
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); }
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
@@ -15,49 +16,62 @@ var _WithTheme = _interopRequireDefault(require("../WithTheme"));
15
16
  var _theme = require("./theme");
16
17
  var _constants = require("./constants.js");
17
18
  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 (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
- const UTSwitch = _ref => {
21
- let {
22
- classes: themeClasses = {},
23
- classNames,
24
- disabled,
25
- field = {},
26
- input = {},
27
- meta = {},
28
- showErrors
29
- } = _ref;
30
- const {
31
- value,
32
- onChange: onChange_
33
- } = input;
34
- const {
35
- key,
36
- field_options: fieldOptions,
37
- configuration = {}
38
- } = field;
39
- const {
40
- textOff: textOff_,
41
- textOn: textOn_,
42
- insideText = true,
43
- withText
44
- } = configuration;
45
- const switchId = key || _constants.DEFAULT_SWITCH_ID;
46
- const classes = (0, _react.useMemo)(() => (0, _classesUtils.mergeClasses)(themeClasses, classNames), [classNames]);
47
- const useFieldOptions = fieldOptions && !(0, _array.isEmpty)(fieldOptions);
48
- const [currentOption, switchedOption] = useFieldOptions ? [...fieldOptions].sort((_, _ref2) => {
49
- let {
50
- value: optionValue,
51
- name
52
- } = _ref2;
53
- return [optionValue, name === _constants.TRUE].includes(value) ? 1 : -1;
54
- }) : [];
55
- const onChange = useFieldOptions ? () => onChange_(switchedOption.value) : onChange_;
56
- (0, _react.useEffect)(() => {
19
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
20
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
22
+ 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."); }
23
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
24
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
25
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
26
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
27
+ 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); }
28
+ 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; }
29
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
30
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
31
+ var UTSwitch = function UTSwitch(_ref) {
32
+ var _ref$classes = _ref.classes,
33
+ themeClasses = _ref$classes === void 0 ? {} : _ref$classes,
34
+ classNames = _ref.classNames,
35
+ disabled = _ref.disabled,
36
+ _ref$field = _ref.field,
37
+ field = _ref$field === void 0 ? {} : _ref$field,
38
+ _ref$input = _ref.input,
39
+ input = _ref$input === void 0 ? {} : _ref$input,
40
+ _ref$meta = _ref.meta,
41
+ meta = _ref$meta === void 0 ? {} : _ref$meta,
42
+ showErrors = _ref.showErrors;
43
+ var value = input.value,
44
+ onChange_ = input.onChange;
45
+ var key = field.key,
46
+ fieldOptions = field.field_options,
47
+ _field$configuration = field.configuration,
48
+ configuration = _field$configuration === void 0 ? {} : _field$configuration;
49
+ var textOff_ = configuration.textOff,
50
+ textOn_ = configuration.textOn,
51
+ _configuration$inside = configuration.insideText,
52
+ insideText = _configuration$inside === void 0 ? true : _configuration$inside,
53
+ withText = configuration.withText;
54
+ var switchId = key || _constants.DEFAULT_SWITCH_ID;
55
+ var classes = (0, _react.useMemo)(function () {
56
+ return (0, _classesUtils.mergeClasses)(themeClasses, classNames);
57
+ }, [classNames]);
58
+ var useFieldOptions = fieldOptions && !(0, _array.isEmpty)(fieldOptions);
59
+ var _ref2 = useFieldOptions ? _toConsumableArray(fieldOptions).sort(function (_, _ref4) {
60
+ var optionValue = _ref4.value,
61
+ name = _ref4.name;
62
+ return [optionValue, name === _constants.TRUE].includes(value) ? 1 : -1;
63
+ }) : [],
64
+ _ref3 = _slicedToArray(_ref2, 2),
65
+ currentOption = _ref3[0],
66
+ switchedOption = _ref3[1];
67
+ var onChange = useFieldOptions ? function () {
68
+ return onChange_(switchedOption.value);
69
+ } : onChange_;
70
+ (0, _react.useEffect)(function () {
57
71
  if (useFieldOptions && value === false) onChange_(currentOption.value);
58
72
  }, [value]);
59
- const textOn = textOn_ || _constants.STATES.ON;
60
- const textOff = textOff_ || _constants.STATES.OFF;
73
+ var textOn = textOn_ || _constants.STATES.ON;
74
+ var textOff = textOff_ || _constants.STATES.OFF;
61
75
  return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
62
76
  className: classes.outerContainer
63
77
  }, withText && !insideText && textOff, /*#__PURE__*/_react.default.createElement("label", {
@@ -99,4 +113,5 @@ UTSwitch.propTypes = {
99
113
  meta: _formTypes.metaPropTypes,
100
114
  showErrors: _propTypes.bool
101
115
  };
102
- var _default = exports.default = (0, _WithTheme.default)(_theme.retrieveStyle)(UTSwitch);
116
+ var _default = (0, _WithTheme.default)(_theme.retrieveStyle)(UTSwitch);
117
+ exports.default = _default;
@@ -7,10 +7,8 @@ exports.retrieveStyle = void 0;
7
7
  var _seamlessImmutable = require("seamless-immutable");
8
8
  var _colorsModule = _interopRequireDefault(require("../../scss/variables/colors.module.scss"));
9
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
- const retrieveStyle = _ref => {
11
- let {
12
- theme
13
- } = _ref;
10
+ var retrieveStyle = function retrieveStyle(_ref) {
11
+ var theme = _ref.theme;
14
12
  return {
15
13
  outerContainer: {
16
14
  alignItems: (0, _seamlessImmutable.getIn)(theme, ['UTSwitch', 'outerContainer', 'alignItems'], 'center'),
@@ -4,4 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.DEAULT_LOADING_SIZE = void 0;
7
- const DEAULT_LOADING_SIZE = exports.DEAULT_LOADING_SIZE = 24;
7
+ var DEAULT_LOADING_SIZE = 24;
8
+ exports.DEAULT_LOADING_SIZE = DEAULT_LOADING_SIZE;
@@ -1,5 +1,6 @@
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); }
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
@@ -14,57 +15,91 @@ var _types = require("../../types");
14
15
  var _constants = require("./constants");
15
16
  var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
16
17
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
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 ActionIcons = _ref => {
20
- let {
21
- classes,
22
- column,
23
- rowData
24
- } = _ref;
25
- return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, column.actions.map(_ref2 => {
26
- let {
27
- key,
28
- Icon,
29
- tooltip,
30
- disabledTooltip,
31
- onClick,
32
- buttonClassName,
33
- iconClassName,
34
- disabledIconClassName,
35
- loadingClassName,
36
- loadingSize = _constants.DEAULT_LOADING_SIZE,
37
- isVisible = () => true,
38
- tooltipProps = {},
39
- isDisabled = () => false,
40
- isLoading = () => false,
41
- menuItems = [],
42
- withMenuDivider
43
- } = _ref2;
44
- const [menuAnchor, setMenuAnchor] = (0, _react.useState)();
45
- const [menuRowContextData, setMenuRowConextData] = (0, _react.useState)();
46
- const openMenu = event => setMenuAnchor(event.currentTarget);
47
- const closeMenu = () => setMenuAnchor();
48
- const handleActionClick = (event, eventRowData) => {
18
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
26
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
27
+ 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); }
28
+ 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; }
29
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
30
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
31
+ var ActionIcons = function ActionIcons(_ref) {
32
+ var classes = _ref.classes,
33
+ column = _ref.column,
34
+ rowData = _ref.rowData;
35
+ return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, column.actions.map(function (_ref2) {
36
+ var key = _ref2.key,
37
+ Icon = _ref2.Icon,
38
+ tooltip = _ref2.tooltip,
39
+ disabledTooltip = _ref2.disabledTooltip,
40
+ onClick = _ref2.onClick,
41
+ buttonClassName = _ref2.buttonClassName,
42
+ iconClassName = _ref2.iconClassName,
43
+ disabledIconClassName = _ref2.disabledIconClassName,
44
+ loadingClassName = _ref2.loadingClassName,
45
+ _ref2$loadingSize = _ref2.loadingSize,
46
+ loadingSize = _ref2$loadingSize === void 0 ? _constants.DEAULT_LOADING_SIZE : _ref2$loadingSize,
47
+ _ref2$isVisible = _ref2.isVisible,
48
+ isVisible = _ref2$isVisible === void 0 ? function () {
49
+ return true;
50
+ } : _ref2$isVisible,
51
+ _ref2$tooltipProps = _ref2.tooltipProps,
52
+ tooltipProps = _ref2$tooltipProps === void 0 ? {} : _ref2$tooltipProps,
53
+ _ref2$isDisabled = _ref2.isDisabled,
54
+ isDisabled = _ref2$isDisabled === void 0 ? function () {
55
+ return false;
56
+ } : _ref2$isDisabled,
57
+ _ref2$isLoading = _ref2.isLoading,
58
+ isLoading = _ref2$isLoading === void 0 ? function () {
59
+ return false;
60
+ } : _ref2$isLoading,
61
+ _ref2$menuItems = _ref2.menuItems,
62
+ menuItems = _ref2$menuItems === void 0 ? [] : _ref2$menuItems,
63
+ withMenuDivider = _ref2.withMenuDivider;
64
+ var _useState = (0, _react.useState)(),
65
+ _useState2 = _slicedToArray(_useState, 2),
66
+ menuAnchor = _useState2[0],
67
+ setMenuAnchor = _useState2[1];
68
+ var _useState3 = (0, _react.useState)(),
69
+ _useState4 = _slicedToArray(_useState3, 2),
70
+ menuRowContextData = _useState4[0],
71
+ setMenuRowConextData = _useState4[1];
72
+ var openMenu = function openMenu(event) {
73
+ return setMenuAnchor(event.currentTarget);
74
+ };
75
+ var closeMenu = function closeMenu() {
76
+ return setMenuAnchor();
77
+ };
78
+ var handleActionClick = function handleActionClick(event, eventRowData) {
49
79
  if ((0, _array.isEmpty)(menuItems)) onClick(eventRowData);else {
50
- setMenuRowConextData({
51
- ...eventRowData,
80
+ setMenuRowConextData(_objectSpread(_objectSpread({}, eventRowData), {}, {
52
81
  clickCallback: closeMenu
53
- });
82
+ }));
54
83
  openMenu(event);
55
84
  }
56
85
  };
57
- const visibleMenuItems = menuItems.filter(menuItem => !menuItem.isVisible || menuItem.isVisible(rowData)).map(menuItem => ({
58
- ...menuItem,
59
- disabled: menuItem.isDisabled && menuItem.isDisabled(rowData)
60
- }));
61
- const getDisabledTooltip = () => typeof disabledTooltip === 'function' ? disabledTooltip(rowData) : disabledTooltip;
62
- const tooltipContent = isDisabled(rowData) && disabledTooltip ? getDisabledTooltip() : tooltip;
63
- const tippyProps = {
64
- appendTo: () => document.body,
65
- interactive: false,
66
- ...tooltipProps
86
+ var visibleMenuItems = menuItems.filter(function (menuItem) {
87
+ return !menuItem.isVisible || menuItem.isVisible(rowData);
88
+ }).map(function (menuItem) {
89
+ return _objectSpread(_objectSpread({}, menuItem), {}, {
90
+ disabled: menuItem.isDisabled && menuItem.isDisabled(rowData)
91
+ });
92
+ });
93
+ var getDisabledTooltip = function getDisabledTooltip() {
94
+ return typeof disabledTooltip === 'function' ? disabledTooltip(rowData) : disabledTooltip;
67
95
  };
96
+ var tooltipContent = isDisabled(rowData) && disabledTooltip ? getDisabledTooltip() : tooltip;
97
+ var tippyProps = _objectSpread({
98
+ appendTo: function appendTo() {
99
+ return document.body;
100
+ },
101
+ interactive: false
102
+ }, tooltipProps);
68
103
  return isVisible(rowData) && /*#__PURE__*/_react.default.createElement(_UTTooltip.default, {
69
104
  key: key,
70
105
  content: tooltipContent,
@@ -72,7 +107,9 @@ const ActionIcons = _ref => {
72
107
  tippyProps: tippyProps
73
108
  }, /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement("div", {
74
109
  className: "".concat(_stylesModule.default.iconButton, " ").concat(classes.actionIconButton, " \n ").concat((isDisabled(rowData) || isLoading(rowData)) && _stylesModule.default.disabled, " ").concat(buttonClassName),
75
- onClick: event => handleActionClick(event, rowData),
110
+ onClick: function onClick(event) {
111
+ return handleActionClick(event, rowData);
112
+ },
76
113
  role: "button"
77
114
  }, isLoading(rowData) ? /*#__PURE__*/_react.default.createElement(_CircularProgress.default, {
78
115
  className: "".concat(classes.actionLoading, " ").concat(loadingClassName),
@@ -95,4 +132,5 @@ ActionIcons.propTypes = {
95
132
  column: _types.columnType,
96
133
  rowData: _propTypes.object
97
134
  };
98
- var _default = exports.default = /*#__PURE__*/(0, _react.memo)(ActionIcons);
135
+ var _default = /*#__PURE__*/(0, _react.memo)(ActionIcons);
136
+ exports.default = _default;
@@ -1,5 +1,6 @@
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); }
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
@@ -10,19 +11,19 @@ var _object = require("@widergy/web-utils/lib/object");
10
11
  var _UTButton = _interopRequireDefault(require("../../../../../UTButton"));
11
12
  var _types = require("../../../../types");
12
13
  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 (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 ActionButton = _ref => {
14
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
16
+ var ActionButton = function ActionButton(_ref) {
16
17
  var _column$actions;
17
- let {
18
- column,
19
- rowData
20
- } = _ref;
21
- const actionConfig = (_column$actions = column.actions) === null || _column$actions === void 0 ? void 0 : _column$actions[0];
18
+ var column = _ref.column,
19
+ rowData = _ref.rowData;
20
+ var actionConfig = (_column$actions = column.actions) === null || _column$actions === void 0 ? void 0 : _column$actions[0];
22
21
  return !(0, _object.objectIsEmpty)(actionConfig) && /*#__PURE__*/_react.default.createElement(_UTButton.default, {
23
22
  classNames: actionConfig.buttonClassNames,
24
23
  key: actionConfig.key,
25
- onClick: () => actionConfig.onClick(rowData),
24
+ onClick: function onClick() {
25
+ return actionConfig.onClick(rowData);
26
+ },
26
27
  variant: "text"
27
28
  }, actionConfig.text);
28
29
  };
@@ -30,4 +31,5 @@ ActionButton.propTypes = {
30
31
  column: _types.columnType,
31
32
  rowData: _propTypes.object
32
33
  };
33
- var _default = exports.default = /*#__PURE__*/(0, _react.memo)(ActionButton);
34
+ var _default = /*#__PURE__*/(0, _react.memo)(ActionButton);
35
+ exports.default = _default;
@@ -13,25 +13,29 @@ var _Status = _interopRequireDefault(require("../Status"));
13
13
  var _ActionButton = _interopRequireDefault(require("./components/ActionButton"));
14
14
  var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
15
15
  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 (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
- const Cell = _ref => {
19
- let {
20
- align = _constants.COLUMN_POSITION.LEFT,
21
- classes,
22
- column,
23
- columnSizes,
24
- defaultNullValue,
25
- rowData,
26
- style
27
- } = _ref;
28
- const cellAlignStyles = [_constants.CELL_TYPES.ACTION_ICONS, _constants.CELL_TYPES.ACTION_BUTTON].includes(column.type) ? _stylesModule.default.centerAlign : _stylesModule.default["".concat(align, "Align")];
16
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
18
+ 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); }
19
+ 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; }
20
+ 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; }
21
+ 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; }
22
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
23
+ 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); }
24
+ var Cell = function Cell(_ref) {
25
+ var _ref$align = _ref.align,
26
+ align = _ref$align === void 0 ? _constants.COLUMN_POSITION.LEFT : _ref$align,
27
+ classes = _ref.classes,
28
+ column = _ref.column,
29
+ columnSizes = _ref.columnSizes,
30
+ defaultNullValue = _ref.defaultNullValue,
31
+ rowData = _ref.rowData,
32
+ style = _ref.style;
33
+ var cellAlignStyles = [_constants.CELL_TYPES.ACTION_ICONS, _constants.CELL_TYPES.ACTION_BUTTON].includes(column.type) ? _stylesModule.default.centerAlign : _stylesModule.default["".concat(align, "Align")];
29
34
  return /*#__PURE__*/_react.default.createElement("div", {
30
35
  className: " ".concat(_stylesModule.default.rowElement, " ").concat(cellAlignStyles, " ").concat(classes.rowCell),
31
- style: {
32
- width: columnSizes[column.key],
33
- ...style
34
- }
36
+ style: _objectSpread({
37
+ width: columnSizes[column.key]
38
+ }, style)
35
39
  }, column.cellRenderer ? column.cellRenderer(rowData[column.key], rowData) : column.type === _constants.CELL_TYPES.ACTION_BUTTON ? /*#__PURE__*/_react.default.createElement(_ActionButton.default, {
36
40
  column: column,
37
41
  rowData: rowData
@@ -55,4 +59,5 @@ Cell.propTypes = {
55
59
  rowData: _propTypes.object,
56
60
  style: _propTypes.object
57
61
  };
58
- var _default = exports.default = /*#__PURE__*/(0, _react.memo)(Cell);
62
+ var _default = /*#__PURE__*/(0, _react.memo)(Cell);
63
+ exports.default = _default;
@@ -4,7 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.ORDER_DIRECTION = void 0;
7
- const ORDER_DIRECTION = exports.ORDER_DIRECTION = {
7
+ var ORDER_DIRECTION = {
8
8
  ASC: 'asc',
9
9
  DESC: 'desc'
10
- };
10
+ };
11
+ exports.ORDER_DIRECTION = ORDER_DIRECTION;