@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.
- package/dist/components/EnergyThemeProvider/index.js +36 -13
- package/dist/components/Loading/constants.js +2 -1
- package/dist/components/Loading/index.js +12 -13
- package/dist/components/Loading/theme.js +2 -4
- package/dist/components/UTAlert/AlertHandler.js +101 -75
- package/dist/components/UTAlert/index.js +87 -65
- package/dist/components/UTAlert/theme.js +32 -32
- package/dist/components/UTAttachment/components/Preview/index.js +9 -8
- package/dist/components/UTAttachment/constants.js +13 -7
- package/dist/components/UTAttachment/index.js +250 -159
- package/dist/components/UTAttachment/layout.js +27 -26
- package/dist/components/UTAttachment/theme.js +2 -4
- package/dist/components/UTAttachment/utils.js +117 -34
- package/dist/components/UTAutocomplete/components/ListBox/index.js +21 -13
- package/dist/components/UTAutocomplete/components/ListBox/utils.js +11 -9
- package/dist/components/UTAutocomplete/constants.js +23 -12
- package/dist/components/UTAutocomplete/index.js +94 -54
- package/dist/components/UTAutocomplete/theme.js +4 -6
- package/dist/components/UTAvatar/constants.js +3 -2
- package/dist/components/UTAvatar/index.js +17 -18
- package/dist/components/UTBarChart/components/Bars/components/Bar/components/Rect/index.js +22 -22
- package/dist/components/UTBarChart/components/Bars/components/Bar/constants.js +1 -1
- package/dist/components/UTBarChart/components/Bars/components/Bar/index.js +22 -21
- package/dist/components/UTBarChart/components/Bars/constants.js +6 -3
- package/dist/components/UTBarChart/components/Bars/index.js +80 -70
- package/dist/components/UTBarChart/components/Legend/constants.js +18 -12
- package/dist/components/UTBarChart/components/Legend/index.js +93 -75
- package/dist/components/UTBarChart/components/Legend/utils.js +5 -1
- package/dist/components/UTBarChart/components/Levels/index.js +14 -16
- package/dist/components/UTBarChart/components/Levels/utils.js +27 -25
- package/dist/components/UTBarChart/components/LinearPlot/constants.js +5 -3
- package/dist/components/UTBarChart/components/LinearPlot/index.js +20 -25
- package/dist/components/UTBarChart/components/LinearPlot/utils.js +39 -37
- package/dist/components/UTBarChart/components/Pagination/constants.js +2 -1
- package/dist/components/UTBarChart/components/Pagination/index.js +24 -20
- package/dist/components/UTBarChart/components/XAxis/components/AxisElement/index.js +32 -21
- package/dist/components/UTBarChart/components/XAxis/components/Decoration/constants.js +4 -2
- package/dist/components/UTBarChart/components/XAxis/components/Decoration/index.js +19 -20
- package/dist/components/UTBarChart/components/XAxis/constants.js +2 -1
- package/dist/components/UTBarChart/components/XAxis/index.js +65 -54
- package/dist/components/UTBarChart/components/YAxis/AxisElement/index.js +11 -12
- package/dist/components/UTBarChart/components/YAxis/constants.js +2 -1
- package/dist/components/UTBarChart/components/YAxis/index.js +37 -30
- package/dist/components/UTBarChart/components/YAxis/utils.js +6 -4
- package/dist/components/UTBarChart/constants.js +8 -4
- package/dist/components/UTBarChart/hooks/use-dynamic-margins.js +40 -23
- package/dist/components/UTBarChart/index.js +166 -152
- package/dist/components/UTBarChart/theme.js +2 -4
- package/dist/components/UTBarChart/types.js +19 -10
- package/dist/components/UTBarChart/utils.js +111 -107
- package/dist/components/UTBreadcrumbs/constants.js +31 -23
- package/dist/components/UTBreadcrumbs/index.js +101 -76
- package/dist/components/UTBreadcrumbs/theme.js +2 -4
- package/dist/components/UTButton/constants.js +17 -11
- package/dist/components/UTButton/index.js +31 -28
- package/dist/components/UTButton/theme.js +23 -23
- package/dist/components/UTCBUInput/index.js +40 -36
- package/dist/components/UTCBUInput/theme.js +2 -4
- package/dist/components/UTCaptcha/index.js +45 -19
- package/dist/components/UTCard/components/UTCardFooter/index.js +16 -15
- package/dist/components/UTCard/index.js +120 -85
- package/dist/components/UTCard/theme.js +12 -11
- package/dist/components/UTCard/types.js +3 -2
- package/dist/components/UTCarousel/components/Button/index.js +13 -13
- package/dist/components/UTCarousel/components/Legend/index.js +15 -13
- package/dist/components/UTCarousel/components/Slider/component/Slide/index.js +16 -16
- package/dist/components/UTCarousel/components/Slider/constants.js +10 -5
- package/dist/components/UTCarousel/components/Slider/index.js +273 -204
- package/dist/components/UTCarousel/components/Slider/layout.js +94 -67
- package/dist/components/UTCarousel/index.js +15 -14
- package/dist/components/UTCarousel/theme.js +2 -4
- package/dist/components/UTCheckList/constants.js +2 -1
- package/dist/components/UTCheckList/index.js +93 -72
- package/dist/components/UTCheckList/theme.js +31 -31
- package/dist/components/UTCheckbox/constants.js +6 -3
- package/dist/components/UTCheckbox/index.js +44 -32
- package/dist/components/UTCheckbox/theme.js +35 -35
- package/dist/components/UTConsumptionBar/components/ConsumptionBarIndicator/index.js +9 -9
- package/dist/components/UTConsumptionBar/constants.js +6 -3
- package/dist/components/UTConsumptionBar/index.js +80 -53
- package/dist/components/UTCuit/index.js +133 -109
- package/dist/components/UTCuit/theme.js +53 -51
- package/dist/components/UTDatePicker/components/Day/constants.js +2 -1
- package/dist/components/UTDatePicker/components/Day/index.js +12 -12
- package/dist/components/UTDatePicker/constants.js +31 -20
- package/dist/components/UTDatePicker/index.js +102 -60
- package/dist/components/UTDatePicker/theme.js +3 -5
- package/dist/components/UTDatePicker/types.js +3 -2
- package/dist/components/UTDatePicker/utils.js +6 -2
- package/dist/components/UTDialog/constants.js +4 -2
- package/dist/components/UTDialog/index.js +37 -38
- package/dist/components/UTDialog/theme.js +2 -4
- package/dist/components/UTDialog/types.js +3 -2
- package/dist/components/UTDotMenu/index.js +61 -39
- package/dist/components/UTEmojiPicker/constants.js +11 -6
- package/dist/components/UTEmojiPicker/index.js +65 -45
- package/dist/components/UTEmojiPicker/theme.js +2 -4
- package/dist/components/UTEmojiPicker/utils.js +51 -21
- package/dist/components/UTExternalLink/constants.js +5 -3
- package/dist/components/UTExternalLink/index.js +15 -18
- package/dist/components/UTExternalLink/theme.js +6 -8
- package/dist/components/UTFileInput/constants.js +4 -2
- package/dist/components/UTFileInput/index.js +31 -7
- package/dist/components/UTFileInput/layout.js +97 -68
- package/dist/components/UTIconButton/index.js +72 -49
- package/dist/components/UTIconButton/theme.js +2 -4
- package/dist/components/UTImageRadio/components/ImageRadioCard/index.js +58 -53
- package/dist/components/UTImageRadio/constants.js +6 -3
- package/dist/components/UTImageRadio/index.js +47 -39
- package/dist/components/UTImageRadio/theme.js +12 -11
- package/dist/components/UTImageRadio/types.js +3 -2
- package/dist/components/UTImageRadio/utils.js +6 -2
- package/dist/components/UTLabel/constants.js +20 -14
- package/dist/components/UTLabel/index.js +20 -18
- package/dist/components/UTLabel/theme.js +15 -15
- package/dist/components/UTList/index.js +18 -15
- package/dist/components/UTLoading/index.js +15 -15
- package/dist/components/UTMap/components/GoogleMaps/constants.js +11 -8
- package/dist/components/UTMap/components/GoogleMaps/index.js +91 -63
- package/dist/components/UTMap/components/GoogleMaps/styles.js +3 -2
- package/dist/components/UTMap/constants.js +12 -6
- package/dist/components/UTMap/index.js +198 -163
- package/dist/components/UTMap/types.js +6 -4
- package/dist/components/UTMap/utils.js +46 -29
- package/dist/components/UTMap/withGoogleMapScript.js +22 -18
- package/dist/components/UTMenu/index.js +69 -52
- package/dist/components/UTMenu/theme.js +3 -5
- package/dist/components/UTMenu/utils.js +11 -5
- package/dist/components/UTModal/constants.js +13 -9
- package/dist/components/UTModal/index.js +30 -26
- package/dist/components/UTModal/theme.js +2 -4
- package/dist/components/UTPagination/components/PageSizeSelector/index.js +10 -11
- package/dist/components/UTPagination/components/PageSizeSelector/utils.js +13 -7
- package/dist/components/UTPagination/components/Pagination/components/NavigationButton/index.js +12 -12
- package/dist/components/UTPagination/components/Pagination/index.js +39 -28
- package/dist/components/UTPagination/components/Pagination/utils.js +14 -8
- package/dist/components/UTPagination/constants.js +6 -3
- package/dist/components/UTPagination/index.js +17 -16
- package/dist/components/UTPagination/theme.js +2 -4
- package/dist/components/UTPanel/index.js +44 -38
- package/dist/components/UTPasswordField/components/PasswordValidations/components/Error/index.js +10 -13
- package/dist/components/UTPasswordField/components/PasswordValidations/components/Validation/index.js +19 -22
- package/dist/components/UTPasswordField/components/PasswordValidations/index.js +50 -63
- package/dist/components/UTPasswordField/components/PasswordWarning/index.js +26 -25
- package/dist/components/UTPasswordField/index.js +23 -26
- package/dist/components/UTPasswordField/theme.js +2 -4
- package/dist/components/UTPhoneInput/constants.js +6 -3
- package/dist/components/UTPhoneInput/index.js +205 -180
- package/dist/components/UTPhoneInput/theme.js +77 -77
- package/dist/components/UTPieChart/components/ArrowLabel/constants.js +8 -4
- package/dist/components/UTPieChart/components/ArrowLabel/index.js +23 -24
- package/dist/components/UTPieChart/components/Legend/contants.js +6 -3
- package/dist/components/UTPieChart/components/Legend/index.js +24 -27
- package/dist/components/UTPieChart/constants.js +26 -13
- package/dist/components/UTPieChart/hooks/use-animated-value/index.js +33 -15
- package/dist/components/UTPieChart/index.js +76 -73
- package/dist/components/UTPieChart/theme.js +2 -4
- package/dist/components/UTPieChart/utils.js +2 -4
- package/dist/components/UTProgressBar/constants.js +4 -2
- package/dist/components/UTProgressBar/index.js +17 -15
- package/dist/components/UTProgressBar/theme.js +2 -4
- package/dist/components/UTProgressBar/types.js +3 -2
- package/dist/components/UTRadioGroup/index.js +83 -56
- package/dist/components/UTRadioGroup/theme.js +52 -52
- package/dist/components/UTRating/components/Circle/index.js +56 -41
- package/dist/components/UTRating/components/Faces/constants.js +4 -2
- package/dist/components/UTRating/components/Faces/index.js +36 -34
- package/dist/components/UTRating/components/Star/index.js +40 -36
- package/dist/components/UTRating/constants.js +8 -4
- package/dist/components/UTRating/index.js +46 -31
- package/dist/components/UTRating/theme.js +2 -4
- package/dist/components/UTRipple/Ripple.js +39 -22
- package/dist/components/UTRipple/index.js +37 -18
- package/dist/components/UTSelect/components/Option/index.js +13 -13
- package/dist/components/UTSelect/constants.js +8 -4
- package/dist/components/UTSelect/index.js +85 -63
- package/dist/components/UTSelect/stylesJS.js +3 -2
- package/dist/components/UTSelect/theme.js +4 -6
- package/dist/components/UTSelect/utils.js +13 -3
- package/dist/components/UTSidebar/components/ListOption/index.js +49 -34
- package/dist/components/UTSidebar/components/LogosContainer/components/DynamicIcon/index.js +8 -8
- package/dist/components/UTSidebar/components/LogosContainer/index.js +14 -14
- package/dist/components/UTSidebar/components/Option/constants.js +3 -2
- package/dist/components/UTSidebar/components/Option/index.js +32 -28
- package/dist/components/UTSidebar/components/Toggler/index.js +11 -11
- package/dist/components/UTSidebar/index.js +53 -42
- package/dist/components/UTSidebar/theme.js +2 -4
- package/dist/components/UTSidebar/types.js +10 -5
- package/dist/components/UTSkeleton/index.js +36 -10
- package/dist/components/UTStatus/constants.js +9 -5
- package/dist/components/UTStatus/index.js +15 -16
- package/dist/components/UTStatus/theme.js +49 -66
- package/dist/components/UTSwitch/constants.js +6 -3
- package/dist/components/UTSwitch/index.js +57 -42
- package/dist/components/UTSwitch/theme.js +2 -4
- package/dist/components/UTTable/components/ActionIcons/constants.js +2 -1
- package/dist/components/UTTable/components/ActionIcons/index.js +85 -47
- package/dist/components/UTTable/components/Cell/components/ActionButton/index.js +12 -10
- package/dist/components/UTTable/components/Cell/index.js +23 -18
- package/dist/components/UTTable/components/HeaderCell/constants.js +3 -2
- package/dist/components/UTTable/components/HeaderCell/index.js +30 -23
- package/dist/components/UTTable/components/HeaderCell/utils.js +3 -3
- package/dist/components/UTTable/components/PrimaryAction/index.js +11 -12
- package/dist/components/UTTable/components/ResponsiveCell/index.js +20 -19
- package/dist/components/UTTable/components/Status/index.js +19 -18
- package/dist/components/UTTable/components/TableFooter/components/PageSizeSelector/index.js +9 -10
- package/dist/components/UTTable/components/TableFooter/components/PageSizeSelector/utils.js +13 -7
- package/dist/components/UTTable/components/TableFooter/components/Pagination/components/NavigationButton/index.js +12 -12
- package/dist/components/UTTable/components/TableFooter/components/Pagination/index.js +32 -21
- package/dist/components/UTTable/components/TableFooter/components/Pagination/utils.js +14 -8
- package/dist/components/UTTable/components/TableFooter/constants.js +2 -1
- package/dist/components/UTTable/components/TableFooter/index.js +15 -15
- package/dist/components/UTTable/components/TableHeader/index.js +11 -11
- package/dist/components/UTTable/components/TableRow/constants.js +6 -3
- package/dist/components/UTTable/components/TableRow/index.js +94 -79
- package/dist/components/UTTable/constants.js +43 -26
- package/dist/components/UTTable/hook.js +26 -11
- package/dist/components/UTTable/index.js +223 -132
- package/dist/components/UTTable/theme.js +17 -17
- package/dist/components/UTTable/types.js +8 -4
- package/dist/components/UTTable/utils.js +74 -70
- package/dist/components/UTTabs/components/TooltipTab/index.js +30 -20
- package/dist/components/UTTabs/constants.js +8 -4
- package/dist/components/UTTabs/index.js +86 -57
- package/dist/components/UTTabs/theme.js +2 -4
- package/dist/components/UTTabs/utils.js +1 -1
- package/dist/components/UTTextArea/constants.js +6 -3
- package/dist/components/UTTextArea/index.js +23 -23
- package/dist/components/UTTextArea/theme.js +2 -4
- package/dist/components/UTTextInput/constants.js +3 -2
- package/dist/components/UTTextInput/index.js +165 -137
- package/dist/components/UTTextInput/theme.js +4 -6
- package/dist/components/UTThirdPartyCookieChecker/index.js +21 -17
- package/dist/components/UTToggle/components/ToggleOption/index.js +17 -16
- package/dist/components/UTToggle/index.js +26 -25
- package/dist/components/UTToggle/theme.js +2 -4
- package/dist/components/UTTooltip/index.js +30 -23
- package/dist/components/UTTooltip/theme.js +2 -4
- package/dist/components/UTTopbar/components/Notifications/index.js +14 -11
- package/dist/components/UTTopbar/components/UserMenu/index.js +15 -15
- package/dist/components/UTTopbar/index.js +31 -28
- package/dist/components/UTTopbar/theme.js +2 -4
- package/dist/components/UTTopbar/types.js +9 -5
- package/dist/components/UTTouchableWithoutFeedback/index.js +27 -14
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/constants.js +4 -2
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/index.js +31 -34
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/utils.js +4 -4
- package/dist/components/UTVirtualizedList/components/VirtualizedData/constants.js +12 -6
- package/dist/components/UTVirtualizedList/components/VirtualizedData/hooks/use-ledger.js +18 -8
- package/dist/components/UTVirtualizedList/components/VirtualizedData/hooks/use-virtualized-data.js +47 -23
- package/dist/components/UTVirtualizedList/components/VirtualizedData/index.js +34 -31
- package/dist/components/UTVirtualizedList/components/VirtualizedData/utils.js +93 -81
- package/dist/components/UTVirtualizedList/constants.js +8 -4
- package/dist/components/UTVirtualizedList/index.js +38 -26
- package/dist/components/UTWorkflowContainer/components/ActionButton/index.js +21 -17
- package/dist/components/UTWorkflowContainer/constants.js +6 -3
- package/dist/components/UTWorkflowContainer/hooks/use-previous.js +3 -3
- package/dist/components/UTWorkflowContainer/index.js +51 -32
- package/dist/components/UTWorkflowContainer/theme.js +53 -60
- package/dist/components/UTWorkflowContainer/types.js +3 -2
- package/dist/components/WithLoading/index.js +15 -10
- package/dist/components/WithTheme/index.js +17 -10
- package/dist/components/WithTheme/layout.js +28 -22
- package/dist/components/WithTouch/index.js +19 -12
- package/dist/constants/UTTable.js +3 -2
- package/dist/index.js +58 -58
- package/dist/theme.js +5 -6
- package/dist/types/commonTypes.js +5 -3
- package/dist/types/consumptionTypes.js +5 -3
- package/dist/types/formTypes.js +7 -4
- package/dist/types/tableTypes.js +3 -2
- package/dist/utils/classesUtils.js +13 -5
- package/dist/utils/componentUtils.js +13 -10
- package/dist/utils/helperFunctions.js +4 -4
- package/dist/utils/shadowUtils.js +11 -13
- package/dist/utils/useScreenSize.js +3 -2
- 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
|
});
|
|
@@ -23,167 +24,252 @@ var _ResponsiveCell = _interopRequireDefault(require("./components/ResponsiveCel
|
|
|
23
24
|
var _TableRow = _interopRequireDefault(require("./components/TableRow"));
|
|
24
25
|
var _theme = require("./theme");
|
|
25
26
|
var _constants = require("./constants");
|
|
26
|
-
var
|
|
27
|
+
var _utils = require("./utils");
|
|
27
28
|
var _types = require("./types");
|
|
28
29
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
29
30
|
var _hook = require("./hook");
|
|
30
31
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
|
-
function _getRequireWildcardCache(
|
|
32
|
-
function _interopRequireWildcard(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
32
|
+
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); }
|
|
33
|
+
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; }
|
|
34
|
+
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; }
|
|
35
|
+
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; }
|
|
36
|
+
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; }
|
|
37
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
38
|
+
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); }
|
|
39
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
40
|
+
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."); }
|
|
41
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
42
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
43
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
44
|
+
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."); }
|
|
45
|
+
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); }
|
|
46
|
+
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; }
|
|
47
|
+
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; } }
|
|
48
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
49
|
+
var UTTable = function UTTable(_ref) {
|
|
50
|
+
var themeClasses = _ref.classes,
|
|
51
|
+
classNames = _ref.classNames,
|
|
52
|
+
clickableRowValidation = _ref.clickableRowValidation,
|
|
53
|
+
columns = _ref.columns,
|
|
54
|
+
_ref$data = _ref.data,
|
|
55
|
+
data = _ref$data === void 0 ? [] : _ref$data,
|
|
56
|
+
_ref$defaultNullValue = _ref.defaultNullValue,
|
|
57
|
+
defaultNullValue = _ref$defaultNullValue === void 0 ? '-' : _ref$defaultNullValue,
|
|
58
|
+
_ref$disableAutoOrder = _ref.disableAutoOrder,
|
|
59
|
+
disableAutoOrder = _ref$disableAutoOrder === void 0 ? false : _ref$disableAutoOrder,
|
|
60
|
+
disabledRowTooltip = _ref.disabledRowTooltip,
|
|
61
|
+
disabledSelectAllTooltip = _ref.disabledSelectAllTooltip,
|
|
62
|
+
_ref$disablePaginatio = _ref.disablePagination,
|
|
63
|
+
disablePagination = _ref$disablePaginatio === void 0 ? false : _ref$disablePaginatio,
|
|
64
|
+
disableReloadRows = _ref.disableReloadRows,
|
|
65
|
+
disableRowSelection = _ref.disableRowSelection,
|
|
66
|
+
disableSelectAll = _ref.disableSelectAll,
|
|
67
|
+
_ref$exclusiveSelecti = _ref.exclusiveSelection,
|
|
68
|
+
exclusiveSelection = _ref$exclusiveSelecti === void 0 ? false : _ref$exclusiveSelecti,
|
|
69
|
+
externalPage = _ref.externalPage,
|
|
70
|
+
externalRowsPerPage = _ref.externalRowsPerPage,
|
|
71
|
+
Filters = _ref.Filters,
|
|
72
|
+
fitColumnsWidth = _ref.fitColumnsWidth,
|
|
73
|
+
GeneralActions = _ref.GeneralActions,
|
|
74
|
+
_ref$getRowClassName = _ref.getRowClassName,
|
|
75
|
+
getRowClassName = _ref$getRowClassName === void 0 ? function () {
|
|
76
|
+
return '';
|
|
77
|
+
} : _ref$getRowClassName,
|
|
78
|
+
_ref$headerPadding = _ref.headerPadding,
|
|
79
|
+
headerPadding = _ref$headerPadding === void 0 ? _constants.ROW_PADDING_NAMES.MEDIUM : _ref$headerPadding,
|
|
80
|
+
initialOrder = _ref.initialOrder,
|
|
81
|
+
_ref$initialSelectedR = _ref.initialSelectedRows,
|
|
82
|
+
initialSelectedRows = _ref$initialSelectedR === void 0 ? [] : _ref$initialSelectedR,
|
|
83
|
+
_ref$integrationType = _ref.integrationType,
|
|
84
|
+
integrationType = _ref$integrationType === void 0 ? _UTTable.INTEGRATION_TYPES.INTERNAL : _ref$integrationType,
|
|
85
|
+
loading = _ref.loading,
|
|
86
|
+
_ref$noResultsLabel = _ref.noResultsLabel,
|
|
87
|
+
noResultsLabel = _ref$noResultsLabel === void 0 ? _constants.NO_RESULTS_LABEL : _ref$noResultsLabel,
|
|
88
|
+
onOrderChange = _ref.onOrderChange,
|
|
89
|
+
onPageChange = _ref.onPageChange,
|
|
90
|
+
onReloadRows = _ref.onReloadRows,
|
|
91
|
+
onRowClick = _ref.onRowClick,
|
|
92
|
+
onRowsPerPageChange = _ref.onRowsPerPageChange,
|
|
93
|
+
onSelectAllRows = _ref.onSelectAllRows,
|
|
94
|
+
onSelectRow = _ref.onSelectRow,
|
|
95
|
+
_ref$removeDefaultOrd = _ref.removeDefaultOrderIcon,
|
|
96
|
+
removeDefaultOrderIcon = _ref$removeDefaultOrd === void 0 ? false : _ref$removeDefaultOrd,
|
|
97
|
+
_ref$removeFixedRowsD = _ref.removeFixedRowsDivisors,
|
|
98
|
+
removeFixedRowsDivisors = _ref$removeFixedRowsD === void 0 ? false : _ref$removeFixedRowsD,
|
|
99
|
+
_ref$rowKey = _ref.rowKey,
|
|
100
|
+
rowKey = _ref$rowKey === void 0 ? _constants.ROW_KEY : _ref$rowKey,
|
|
101
|
+
_ref$rowPadding = _ref.rowPadding,
|
|
102
|
+
rowPadding = _ref$rowPadding === void 0 ? _constants.ROW_PADDING_NAMES.SMALL : _ref$rowPadding,
|
|
103
|
+
_ref$rowSpacing = _ref.rowSpacing,
|
|
104
|
+
rowSpacing = _ref$rowSpacing === void 0 ? _constants.ROW_SPACING_NAMES.NONE : _ref$rowSpacing,
|
|
105
|
+
_ref$rowsPerPageOptio = _ref.rowsPerPageOptions,
|
|
106
|
+
rowsPerPageOptions = _ref$rowsPerPageOptio === void 0 ? _constants.ROWS_PER_PAGE : _ref$rowsPerPageOptio,
|
|
107
|
+
selectable = _ref.selectable,
|
|
108
|
+
_ref$selectAllInCurre = _ref.selectAllInCurrentPageOnly,
|
|
109
|
+
selectAllInCurrentPageOnly = _ref$selectAllInCurre === void 0 ? false : _ref$selectAllInCurre,
|
|
110
|
+
stickyHeader = _ref.stickyHeader,
|
|
111
|
+
_ref$tabletBreakpoint = _ref.tabletBreakpoint,
|
|
112
|
+
tabletBreakpoint = _ref$tabletBreakpoint === void 0 ? _constants.DEFAULT_TABLET_BREAKPOINT : _ref$tabletBreakpoint,
|
|
113
|
+
tableTitle = _ref.tableTitle,
|
|
114
|
+
totalRows = _ref.totalRows,
|
|
115
|
+
totalRowsLabel = _ref.totalRowsLabel;
|
|
116
|
+
var initialValidRowsPerPageOption = (0, _utils.getInitialValidRowsPerPage)(externalRowsPerPage, rowsPerPageOptions, data);
|
|
117
|
+
var initialValidPage = (0, _utils.getInitialValidPage)(externalPage, initialValidRowsPerPageOption, data, integrationType);
|
|
118
|
+
var _useState = (0, _react.useState)(initialOrder || {}),
|
|
119
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
120
|
+
order = _useState2[0],
|
|
121
|
+
setOrder = _useState2[1];
|
|
122
|
+
var _useState3 = (0, _react.useState)([]),
|
|
123
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
124
|
+
rows = _useState4[0],
|
|
125
|
+
setRows = _useState4[1];
|
|
126
|
+
var _useState5 = (0, _react.useState)(false),
|
|
127
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
128
|
+
selectedAll = _useState6[0],
|
|
129
|
+
setSelectedAll = _useState6[1];
|
|
130
|
+
var _useState7 = (0, _react.useState)(initialValidRowsPerPageOption),
|
|
131
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
132
|
+
rowsPerPage = _useState8[0],
|
|
133
|
+
setRowsPerPage = _useState8[1];
|
|
134
|
+
var _useState9 = (0, _react.useState)(initialValidPage),
|
|
135
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
136
|
+
page = _useState10[0],
|
|
137
|
+
setPage = _useState10[1];
|
|
138
|
+
var _useResizeObserver = (0, _hook.useResizeObserver)(),
|
|
139
|
+
_useResizeObserver2 = _slicedToArray(_useResizeObserver, 2),
|
|
140
|
+
ref = _useResizeObserver2[0],
|
|
141
|
+
entry = _useResizeObserver2[1];
|
|
142
|
+
var _useState11 = (0, _react.useState)(selectable ? initialSelectedRows : []),
|
|
143
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
144
|
+
selectedRows = _useState12[0],
|
|
145
|
+
setSelectedRows = _useState12[1];
|
|
146
|
+
var _useState13 = (0, _react.useState)(!(0, _browser.isDesktop)(tabletBreakpoint)),
|
|
147
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
148
|
+
isResponsive = _useState14[0],
|
|
149
|
+
setIsResponsive = _useState14[1];
|
|
150
|
+
var scrollRef = (0, _react.useRef)();
|
|
151
|
+
var contentRef = (0, _react.useRef)();
|
|
152
|
+
var classes = (0, _react.useMemo)(function () {
|
|
153
|
+
return (0, _classesUtils.mergeClasses)(themeClasses, classNames);
|
|
154
|
+
}, [classNames]);
|
|
155
|
+
var handleResize = function handleResize() {
|
|
96
156
|
setIsResponsive(!(0, _browser.isDesktop)(tabletBreakpoint));
|
|
97
157
|
};
|
|
98
|
-
(0, _react.useEffect)(()
|
|
158
|
+
(0, _react.useEffect)(function () {
|
|
99
159
|
window.addEventListener(_browser.RESIZE_EVENT, handleResize);
|
|
100
|
-
return ()
|
|
160
|
+
return function () {
|
|
161
|
+
return window.removeEventListener(_browser.RESIZE_EVENT, handleResize);
|
|
162
|
+
};
|
|
101
163
|
}, []);
|
|
102
|
-
(0, _react.useEffect)(()
|
|
164
|
+
(0, _react.useEffect)(function () {
|
|
103
165
|
if (!selectAllInCurrentPageOnly) setSelectedAll(!(0, _array.isEmpty)(data) && initialSelectedRows.length === data.length);
|
|
104
166
|
setSelectedRows(selectable ? initialSelectedRows : []);
|
|
105
|
-
setRows((0,
|
|
167
|
+
setRows((0, _utils.orderRows)(data, order, data, columns));
|
|
106
168
|
if (externalRowsPerPage) setRowsPerPage(initialValidRowsPerPageOption);
|
|
107
|
-
|
|
169
|
+
var validPage = data.length / rowsPerPage > page || integrationType === _UTTable.INTEGRATION_TYPES.EXTERNAL;
|
|
108
170
|
if (!validPage) setPage(initialValidPage);
|
|
109
171
|
}, [data]);
|
|
110
|
-
|
|
111
|
-
|
|
172
|
+
var currentRows = (0, _react.useMemo)(function () {
|
|
173
|
+
return disablePagination || integrationType === _UTTable.INTEGRATION_TYPES.EXTERNAL ? rows : (0, _utils.getCurrentRows)(rows, page, rowsPerPage);
|
|
174
|
+
}, [page, rowsPerPage, rows]);
|
|
175
|
+
var handleOrder = function handleOrder(newOrder) {
|
|
112
176
|
setOrder(newOrder);
|
|
113
|
-
if (!disableAutoOrder && !(0, _array.isEmpty)(rows)) setRows((0,
|
|
177
|
+
if (!disableAutoOrder && !(0, _array.isEmpty)(rows)) setRows((0, _utils.orderRows)(rows, newOrder, data, columns));
|
|
114
178
|
if (onOrderChange) onOrderChange(newOrder);
|
|
115
179
|
};
|
|
116
|
-
|
|
180
|
+
var handlePageChange = function handlePageChange(newPage) {
|
|
117
181
|
setPage(newPage);
|
|
118
182
|
if (onPageChange) onPageChange(newPage);
|
|
119
183
|
};
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
return displayedRows.every(
|
|
184
|
+
var allDisplayedRowsAreSelected = function allDisplayedRowsAreSelected(newSelectedRows) {
|
|
185
|
+
var displayedRows = (0, _utils.getSelectableRowIds)(rows, rowKey, disableRowSelection);
|
|
186
|
+
return displayedRows.every(function (value) {
|
|
187
|
+
return newSelectedRows.includes(value);
|
|
188
|
+
});
|
|
123
189
|
};
|
|
124
|
-
|
|
190
|
+
var selectRow = function selectRow(row) {
|
|
125
191
|
if (!row[rowKey]) return null;
|
|
126
|
-
|
|
127
|
-
|
|
192
|
+
var pageRowsIds = (0, _utils.getSelectableRowIds)(currentRows, rowKey, disableRowSelection);
|
|
193
|
+
var newSelectedRows = [];
|
|
128
194
|
if (exclusiveSelection) {
|
|
129
195
|
newSelectedRows = [row[rowKey]];
|
|
130
196
|
} else {
|
|
131
|
-
|
|
132
|
-
if (rowKeyIndex === -1) newSelectedRows = [
|
|
133
|
-
|
|
134
|
-
|
|
197
|
+
var rowKeyIndex = selectedRows.indexOf(row[rowKey]);
|
|
198
|
+
if (rowKeyIndex === -1) newSelectedRows = [].concat(_toConsumableArray(selectedRows), [row[rowKey]]);else newSelectedRows = selectedRows.filter(function (el) {
|
|
199
|
+
return el !== row[rowKey];
|
|
200
|
+
});
|
|
201
|
+
var pageNewSelectedRows = newSelectedRows.filter(function (newSelectedRow) {
|
|
202
|
+
return pageRowsIds.includes(newSelectedRow);
|
|
203
|
+
});
|
|
204
|
+
var allSelected = selectAllInCurrentPageOnly ? pageNewSelectedRows.length === pageRowsIds.length : allDisplayedRowsAreSelected(newSelectedRows);
|
|
135
205
|
if (!allSelected && selectedAll) setSelectedAll(false);
|
|
136
206
|
if (allSelected && !selectedAll) setSelectedAll(true);
|
|
137
207
|
}
|
|
138
208
|
setSelectedRows(newSelectedRows);
|
|
139
209
|
if (onSelectRow) onSelectRow(row[rowKey], newSelectedRows);
|
|
140
210
|
};
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
211
|
+
var selectAllRows = function selectAllRows() {
|
|
212
|
+
var newSelectedAll = !selectedAll;
|
|
213
|
+
var pageRowsIds = (0, _utils.getSelectableRowIds)(currentRows, rowKey, disableRowSelection);
|
|
214
|
+
var newSelectedRows = selectAllInCurrentPageOnly ? newSelectedAll ? [].concat(_toConsumableArray(pageRowsIds), _toConsumableArray(selectedRows.filter(function (row) {
|
|
215
|
+
return !pageRowsIds.includes(row);
|
|
216
|
+
}))) : selectedRows.filter(function (row) {
|
|
217
|
+
return !pageRowsIds.includes(row);
|
|
218
|
+
}) : newSelectedAll ? (0, _utils.getSelectableRowIds)(rows, rowKey, disableRowSelection) : [];
|
|
145
219
|
setSelectedRows(newSelectedRows);
|
|
146
220
|
setSelectedAll(newSelectedAll);
|
|
147
221
|
if (onSelectAllRows) onSelectAllRows(selectAllInCurrentPageOnly ? newSelectedRows : newSelectedAll);
|
|
148
222
|
};
|
|
149
|
-
(0, _react.useEffect)(()
|
|
223
|
+
(0, _react.useEffect)(function () {
|
|
150
224
|
if (selectAllInCurrentPageOnly) {
|
|
151
|
-
|
|
152
|
-
setSelectedAll(!(0, _array.isEmpty)(pageRowsIds) && pageRowsIds.every(
|
|
225
|
+
var pageRowsIds = (0, _utils.getSelectableRowIds)(currentRows, rowKey, disableRowSelection);
|
|
226
|
+
setSelectedAll(!(0, _array.isEmpty)(pageRowsIds) && pageRowsIds.every(function (row) {
|
|
227
|
+
return selectedRows.includes(row);
|
|
228
|
+
}));
|
|
153
229
|
}
|
|
154
230
|
}, [page, rowsPerPage, rows, order, disableSelectAll]);
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
231
|
+
var columnsDefinition = (0, _react.useMemo)(function () {
|
|
232
|
+
return (0, _utils.getColumnDefinition)(columns, isResponsive);
|
|
233
|
+
}, [columns, isResponsive]);
|
|
234
|
+
var isFirstRow = (0, _react.useCallback)(function (index) {
|
|
235
|
+
return !index;
|
|
236
|
+
}, []);
|
|
237
|
+
var isLastRow = (0, _react.useCallback)(function (index) {
|
|
238
|
+
return index === currentRows.length - 1;
|
|
239
|
+
}, [currentRows]);
|
|
240
|
+
var onChangeRowPerPage = function onChangeRowPerPage(newRowsPerPage) {
|
|
159
241
|
setRowsPerPage(newRowsPerPage || rowsPerPageOptions[0]);
|
|
160
242
|
setPage(0);
|
|
161
243
|
if (onRowsPerPageChange) onRowsPerPageChange(newRowsPerPage || rowsPerPageOptions[0]);
|
|
162
244
|
};
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
245
|
+
var showPagination = !disablePagination && !loading && !(0, _array.isEmpty)(currentRows);
|
|
246
|
+
var rowStyles = (0, _react.useMemo)(function () {
|
|
247
|
+
return (0, _utils.createRowStyles)(rowPadding, rowSpacing, headerPadding, isResponsive);
|
|
248
|
+
}, [rowPadding, rowSpacing, headerPadding, isResponsive]);
|
|
249
|
+
var tableWidth = (0, _react.useMemo)(function () {
|
|
166
250
|
var _entry$target;
|
|
167
251
|
return (entry === null || entry === void 0 || (_entry$target = entry.target) === null || _entry$target === void 0 ? void 0 : _entry$target.clientWidth) || '100%';
|
|
168
252
|
}, [entry]);
|
|
169
|
-
|
|
170
|
-
setTimeout(()
|
|
253
|
+
var handleScrollbarSync = function handleScrollbarSync(ps) {
|
|
254
|
+
setTimeout(function () {
|
|
171
255
|
ps.update();
|
|
172
256
|
if (scrollRef.current) scrollRef.current.scrollLeft = 0;
|
|
173
257
|
}, 100);
|
|
174
258
|
};
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
259
|
+
var CellComponent = isResponsive ? _ResponsiveCell.default : _Cell.default;
|
|
260
|
+
var totalRowLabel = isResponsive ? '' : totalRowsLabel || (data.length === 1 ? _constants.TOTAL_ROW_LABEL : _constants.TOTAL_ROWS_LABEL);
|
|
261
|
+
var handleSinchronizeContent = function handleSinchronizeContent(event) {
|
|
178
262
|
var _event$target;
|
|
179
263
|
if (contentRef.current && stickyHeader) contentRef.current.scrollTo(event === null || event === void 0 || (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.scrollLeft, 0);
|
|
180
264
|
};
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
265
|
+
var columnSizes = (0, _react.useMemo)(function () {
|
|
266
|
+
return (0, _utils.getColumnsSizes)({
|
|
267
|
+
columns: columns,
|
|
268
|
+
fitColumnsWidth: fitColumnsWidth,
|
|
269
|
+
selectable: selectable
|
|
270
|
+
});
|
|
271
|
+
}, [columns, fitColumnsWidth, selectable]);
|
|
272
|
+
var Content = /*#__PURE__*/_react.default.createElement("div", {
|
|
187
273
|
ref: contentRef,
|
|
188
274
|
className: "".concat((0, _array.isEmpty)(currentRows) && _stylesModule.default.preventScrolling),
|
|
189
275
|
style: {
|
|
@@ -200,29 +286,32 @@ const UTTable = _ref => {
|
|
|
200
286
|
}
|
|
201
287
|
}, /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
202
288
|
className: classes.noResultsLabel
|
|
203
|
-
}, noResultsLabel)) : currentRows.map((row, index)
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
289
|
+
}, noResultsLabel)) : currentRows.map(function (row, index) {
|
|
290
|
+
var isSelected = selectedRows.includes(row[rowKey]);
|
|
291
|
+
var selectedClassNames = isSelected ? classes.selectedRow : rowSpacing === _constants.ROW_SPACING_NAMES.NONE && index < currentRows.length - 1 ? _stylesModule.default.unselectedSmallRow : undefined;
|
|
292
|
+
var isRowClickable = onRowClick && (!clickableRowValidation || clickableRowValidation(row));
|
|
293
|
+
var handleRowClick = isRowClickable ? function (event) {
|
|
294
|
+
return onRowClick(event, row);
|
|
295
|
+
} : undefined;
|
|
208
296
|
return /*#__PURE__*/_react.default.createElement(_TableRow.default, {
|
|
209
297
|
key: row[rowKey] && "row_".concat(row[rowKey]),
|
|
210
298
|
CellComponent: CellComponent,
|
|
211
299
|
cellProps: {
|
|
212
|
-
defaultNullValue,
|
|
213
|
-
classes,
|
|
300
|
+
defaultNullValue: defaultNullValue,
|
|
301
|
+
classes: classes,
|
|
214
302
|
style: rowStyles.cell,
|
|
215
303
|
rowData: row
|
|
216
304
|
},
|
|
217
|
-
checkBoxOnChange: ()
|
|
305
|
+
checkBoxOnChange: function checkBoxOnChange() {
|
|
306
|
+
return selectRow(row);
|
|
307
|
+
},
|
|
218
308
|
checkBoxSelected: isSelected,
|
|
219
309
|
className: "".concat(_stylesModule.default.responsiveRow, " ").concat(isRowClickable && classes.rowContainerClickable, " ").concat(getRowClassName(row)),
|
|
220
310
|
columnsDefinition: columnsDefinition,
|
|
221
311
|
columnSizes: columnSizes,
|
|
222
|
-
containerStyle: {
|
|
223
|
-
...rowStyles.rowContainer,
|
|
312
|
+
containerStyle: _objectSpread(_objectSpread({}, rowStyles.rowContainer), {}, {
|
|
224
313
|
minWidth: tableWidth
|
|
225
|
-
},
|
|
314
|
+
}),
|
|
226
315
|
isResponsive: isResponsive,
|
|
227
316
|
exclusiveSelection: exclusiveSelection,
|
|
228
317
|
fixedRowsLeftClassName: "".concat(classes.fixedRowLeft, " ").concat(selectedClassNames, " ").concat(isFirstRow(index) && classes.firstFixedRowLeft, " ").concat(isLastRow(index) && classes.lastFixedRowLeft),
|
|
@@ -240,14 +329,14 @@ const UTTable = _ref => {
|
|
|
240
329
|
pageRows: currentRows
|
|
241
330
|
});
|
|
242
331
|
})));
|
|
243
|
-
|
|
332
|
+
var Header = /*#__PURE__*/_react.default.createElement(_TableRow.default, {
|
|
244
333
|
CellComponent: _HeaderCell.default,
|
|
245
334
|
cellProps: {
|
|
246
|
-
classes,
|
|
247
|
-
handleOrder,
|
|
248
|
-
order,
|
|
335
|
+
classes: classes,
|
|
336
|
+
handleOrder: handleOrder,
|
|
337
|
+
order: order,
|
|
249
338
|
style: rowStyles.headerCell,
|
|
250
|
-
removeDefaultOrderIcon
|
|
339
|
+
removeDefaultOrderIcon: removeDefaultOrderIcon
|
|
251
340
|
},
|
|
252
341
|
checkBoxOnChange: selectAllRows,
|
|
253
342
|
checkBoxClassName: "".concat(exclusiveSelection && _stylesModule.default.hideCheckBox),
|
|
@@ -255,10 +344,9 @@ const UTTable = _ref => {
|
|
|
255
344
|
className: "".concat((0, _array.isEmpty)(currentRows) && _stylesModule.default.disableHeader),
|
|
256
345
|
columnsDefinition: columnsDefinition,
|
|
257
346
|
columnSizes: columnSizes,
|
|
258
|
-
containerStyle: {
|
|
259
|
-
...rowStyles.headerRowContainer,
|
|
347
|
+
containerStyle: _objectSpread(_objectSpread({}, rowStyles.headerRowContainer), {}, {
|
|
260
348
|
minWidth: tableWidth
|
|
261
|
-
},
|
|
349
|
+
}),
|
|
262
350
|
selectable: selectable,
|
|
263
351
|
disableRowSelection: disableSelectAll,
|
|
264
352
|
disabledRowSelectionTooltip: disabledSelectAllTooltip,
|
|
@@ -284,7 +372,9 @@ const UTTable = _ref => {
|
|
|
284
372
|
}), Filters, !isResponsive && /*#__PURE__*/_react.default.createElement("div", {
|
|
285
373
|
className: stickyHeader && "".concat(_stylesModule.default.stickyHeader, " ").concat(classes.stickyHeader || '')
|
|
286
374
|
}, /*#__PURE__*/_react.default.createElement(_reactPerfectScrollbar.default, {
|
|
287
|
-
containerRef: el
|
|
375
|
+
containerRef: function containerRef(el) {
|
|
376
|
+
return scrollRef.current = el;
|
|
377
|
+
},
|
|
288
378
|
onSync: handleScrollbarSync,
|
|
289
379
|
onScroll: handleSinchronizeContent,
|
|
290
380
|
className: "\n ".concat(_stylesModule.default.scrollbar, "\n ").concat(classes.scrollbar, "\n ").concat(loading && _stylesModule.default.disableHeader),
|
|
@@ -334,7 +424,7 @@ UTTable.propTypes = {
|
|
|
334
424
|
key: _propTypes.string
|
|
335
425
|
}),
|
|
336
426
|
initialSelectedRows: (0, _propTypes.arrayOf)((0, _propTypes.oneOfType)([_propTypes.number, _propTypes.string])),
|
|
337
|
-
integrationType: (0, _propTypes.oneOf)(
|
|
427
|
+
integrationType: (0, _propTypes.oneOf)(_toConsumableArray(Object.values(_UTTable.INTEGRATION_TYPES))),
|
|
338
428
|
loading: _propTypes.bool,
|
|
339
429
|
noResultsLabel: _propTypes.string,
|
|
340
430
|
onOrderChange: _propTypes.func,
|
|
@@ -358,4 +448,5 @@ UTTable.propTypes = {
|
|
|
358
448
|
totalRows: _propTypes.number,
|
|
359
449
|
totalRowsLabel: _propTypes.string
|
|
360
450
|
};
|
|
361
|
-
var _default =
|
|
451
|
+
var _default = (0, _WithTheme.default)(_theme.retrieveStyle)(UTTable);
|
|
452
|
+
exports.default = _default;
|
|
@@ -8,12 +8,14 @@ var _seamlessImmutable = require("seamless-immutable");
|
|
|
8
8
|
var _colorsModule = _interopRequireDefault(require("../../scss/variables/colors.module.scss"));
|
|
9
9
|
var _classesUtils = require("../../utils/classesUtils");
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
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); }
|
|
12
|
+
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; }
|
|
13
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
14
|
+
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); }
|
|
15
|
+
var retrieveStyle = function retrieveStyle(_ref) {
|
|
16
|
+
var _theme$UTTable, _theme$UTTable2, _theme$UTTable3, _theme$UTTable4, _theme$UTTable5, _theme$UTTable6, _theme$UTTable7, _theme$UTTable8, _theme$UTTable9, _theme$UTTable10, _theme$UTTable11, _theme$UTTable12, _responsiveCell, _theme$UTTable13, _theme$UTTable14, _theme$UTTable15, _theme$UTTable16, _theme$UTTable17, _theme$UTTable18, _theme$UTTable19, _theme$UTTable20, _theme$UTTable21, _theme$UTTable22, _theme$UTTable23, _theme$UTTable24, _theme$UTTable25, _theme$UTTable26, _theme$UTTable27;
|
|
17
|
+
var theme = _ref.theme;
|
|
18
|
+
var tabletMobile = (0, _seamlessImmutable.getIn)(theme, ['Media', 'tabletMobile']);
|
|
17
19
|
return {
|
|
18
20
|
table: {
|
|
19
21
|
fontFamily: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'table', 'fontFamily'], (0, _seamlessImmutable.getIn)(theme, ['Fonts', 'fontFamily']))
|
|
@@ -119,22 +121,20 @@ const retrieveStyle = _ref => {
|
|
|
119
121
|
fontSize: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'rowCell', 'fontSize'], (0, _seamlessImmutable.getIn)(theme, ['Fonts', 'medium'])),
|
|
120
122
|
fontWeight: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'rowCell', 'fontWeight'])
|
|
121
123
|
},
|
|
122
|
-
responsiveCell: {
|
|
124
|
+
responsiveCell: (_responsiveCell = {
|
|
123
125
|
borderColor: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'rowCell', 'borderColor']),
|
|
124
126
|
borderStyle: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'rowCell', 'borderStyle'], 'solid'),
|
|
125
127
|
borderWidth: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'rowCell', 'borderWidth'], '1px'),
|
|
126
128
|
color: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'rowCell', 'color']),
|
|
127
129
|
fontSize: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'rowCell', 'fontSize'], (0, _seamlessImmutable.getIn)(theme, ['Fonts', 'medium'])),
|
|
128
|
-
fontWeight: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'rowCell', 'fontWeight'])
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
},
|
|
130
|
+
fontWeight: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'rowCell', 'fontWeight'])
|
|
131
|
+
}, _defineProperty(_responsiveCell, tabletMobile, {
|
|
132
|
+
fontSize: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'rowCell', 'tabletMobile', 'fontSize']),
|
|
133
|
+
fontWeight: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'rowCell', 'tabletMobile', 'fontWeight'])
|
|
134
|
+
}), _defineProperty(_responsiveCell, '&:first-child', {
|
|
135
|
+
borderTopLeftRadius: (0, _classesUtils.withImportant)(theme === null || theme === void 0 || (_theme$UTTable11 = theme.UTTable) === null || _theme$UTTable11 === void 0 || (_theme$UTTable11 = _theme$UTTable11.responsiveRow) === null || _theme$UTTable11 === void 0 ? void 0 : _theme$UTTable11.borderRadius),
|
|
136
|
+
borderTopRightRadius: (0, _classesUtils.withImportant)(theme === null || theme === void 0 || (_theme$UTTable12 = theme.UTTable) === null || _theme$UTTable12 === void 0 || (_theme$UTTable12 = _theme$UTTable12.responsiveRow) === null || _theme$UTTable12 === void 0 ? void 0 : _theme$UTTable12.borderRadius)
|
|
137
|
+
}), _responsiveCell),
|
|
138
138
|
lastCellContainer: {
|
|
139
139
|
borderBottomRightRadius: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'responsiveRow', 'borderRadius']),
|
|
140
140
|
borderBottomLeftRadius: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'responsiveRow', 'borderRadius'])
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.columnsType = exports.columnType = exports.columnSizesType = exports.classesType = void 0;
|
|
7
7
|
var _propTypes = require("prop-types");
|
|
8
|
-
|
|
8
|
+
var columnType = (0, _propTypes.shape)({
|
|
9
9
|
cellRenderer: _propTypes.func,
|
|
10
10
|
key: _propTypes.string,
|
|
11
11
|
name: _propTypes.string,
|
|
@@ -21,8 +21,10 @@ const columnType = exports.columnType = (0, _propTypes.shape)({
|
|
|
21
21
|
loading: _propTypes.bool
|
|
22
22
|
}))
|
|
23
23
|
});
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
exports.columnType = columnType;
|
|
25
|
+
var columnsType = (0, _propTypes.arrayOf)(columnType);
|
|
26
|
+
exports.columnsType = columnsType;
|
|
27
|
+
var classesType = (0, _propTypes.shape)({
|
|
26
28
|
table: _propTypes.string,
|
|
27
29
|
header: _propTypes.string,
|
|
28
30
|
headerCellHover: _propTypes.string,
|
|
@@ -47,4 +49,6 @@ const classesType = exports.classesType = (0, _propTypes.shape)({
|
|
|
47
49
|
checkBoxRoot: _propTypes.string,
|
|
48
50
|
checkboxColorPrimary: _propTypes.string
|
|
49
51
|
});
|
|
50
|
-
|
|
52
|
+
exports.classesType = classesType;
|
|
53
|
+
var columnSizesType = (0, _propTypes.oneOfType)([(0, _propTypes.objectOf)(_propTypes.string), (0, _propTypes.objectOf)(_propTypes.number), _propTypes.object]);
|
|
54
|
+
exports.columnSizesType = columnSizesType;
|