@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
|
});
|
|
@@ -24,62 +25,79 @@ var _theme = require("./theme");
|
|
|
24
25
|
var _utils = require("./utils");
|
|
25
26
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
26
27
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
|
-
function _getRequireWildcardCache(
|
|
28
|
-
function _interopRequireWildcard(
|
|
28
|
+
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); }
|
|
29
|
+
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; }
|
|
29
30
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
31
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
32
|
+
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."); }
|
|
33
|
+
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); }
|
|
34
|
+
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; }
|
|
35
|
+
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; } }
|
|
36
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
37
|
+
var UTMenu = function UTMenu(_ref) {
|
|
38
|
+
var anchor = _ref.anchor,
|
|
39
|
+
animation = _ref.animation,
|
|
40
|
+
animatorProps = _ref.animatorProps,
|
|
41
|
+
arrowProps = _ref.arrowProps,
|
|
42
|
+
themeClasses = _ref.classes,
|
|
43
|
+
classNames = _ref.classNames,
|
|
44
|
+
clickAwayListenerProps = _ref.clickAwayListenerProps,
|
|
45
|
+
_ref$contextData = _ref.contextData,
|
|
46
|
+
contextData = _ref$contextData === void 0 ? {} : _ref$contextData,
|
|
47
|
+
elevation = _ref.elevation,
|
|
48
|
+
iconBefore = _ref.iconBefore,
|
|
49
|
+
ItemComponent = _ref.ItemComponent,
|
|
50
|
+
itemIconProps = _ref.itemIconProps,
|
|
51
|
+
itemProps = _ref.itemProps,
|
|
52
|
+
items = _ref.items,
|
|
53
|
+
LastItem = _ref.LastItem,
|
|
54
|
+
lockScreenEnabled = _ref.lockScreenEnabled,
|
|
55
|
+
menuItemProps = _ref.menuItemProps,
|
|
56
|
+
menuListProps = _ref.menuListProps,
|
|
57
|
+
menuPlacement = _ref.menuPlacement,
|
|
58
|
+
modifiers = _ref.modifiers,
|
|
59
|
+
onClickItem = _ref.onClickItem,
|
|
60
|
+
onClose = _ref.onClose,
|
|
61
|
+
paperProps = _ref.paperProps,
|
|
62
|
+
popperProps = _ref.popperProps,
|
|
63
|
+
scrollBarProps = _ref.scrollBarProps,
|
|
64
|
+
withArrow = _ref.withArrow,
|
|
65
|
+
withDivider = _ref.withDivider,
|
|
66
|
+
withMenuItem = _ref.withMenuItem;
|
|
67
|
+
var blockerRef = (0, _react.useRef)(null);
|
|
68
|
+
var classes = (0, _react.useMemo)(function () {
|
|
69
|
+
return (0, _classesUtils.mergeClasses)(themeClasses, classNames);
|
|
70
|
+
}, [classNames]);
|
|
71
|
+
var _useState = (0, _react.useState)(null),
|
|
72
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
73
|
+
arrowRef = _useState2[0],
|
|
74
|
+
setArrowRef = _useState2[1];
|
|
75
|
+
var _useState3 = (0, _react.useState)(false),
|
|
76
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
77
|
+
open = _useState4[0],
|
|
78
|
+
handleOpenState = _useState4[1];
|
|
79
|
+
(0, _react.useEffect)(function () {
|
|
80
|
+
var shouldOpen = !!anchor && !(0, _array.isEmpty)(items);
|
|
67
81
|
handleOpenState(shouldOpen);
|
|
68
82
|
if (lockScreenEnabled && anchor) (0, _utils.lockScreen)(blockerRef, true);
|
|
69
|
-
return ()
|
|
83
|
+
return function () {
|
|
70
84
|
document.body.style.overflow = 'unset';
|
|
71
85
|
return lockScreenEnabled && (0, _utils.lockScreen)(blockerRef, false);
|
|
72
86
|
};
|
|
73
87
|
}, [anchor, items]);
|
|
74
|
-
|
|
88
|
+
var popperModifiers = Object.assign({
|
|
75
89
|
arrow: {
|
|
76
90
|
enabled: true,
|
|
77
91
|
element: arrowRef
|
|
78
92
|
}
|
|
79
93
|
}, modifiers);
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
94
|
+
var Animator = animation === 'grow' ? _Grow.default : _Fade.default;
|
|
95
|
+
var handleScrollbarSync = function handleScrollbarSync(ps) {
|
|
96
|
+
return setTimeout(function () {
|
|
97
|
+
return ps.update();
|
|
98
|
+
}, 350);
|
|
99
|
+
};
|
|
100
|
+
var lastItem = items.length - 1;
|
|
83
101
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, anchor && /*#__PURE__*/_react.default.createElement(_Popper.default, _extends({
|
|
84
102
|
anchorEl: anchor,
|
|
85
103
|
open: open,
|
|
@@ -87,11 +105,9 @@ const UTMenu = _ref => {
|
|
|
87
105
|
placement: menuPlacement,
|
|
88
106
|
modifiers: popperModifiers,
|
|
89
107
|
className: classes.popper
|
|
90
|
-
}, popperProps), _ref2
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
placement
|
|
94
|
-
} = _ref2;
|
|
108
|
+
}, popperProps), function (_ref2) {
|
|
109
|
+
var TransitionProps = _ref2.TransitionProps,
|
|
110
|
+
placement = _ref2.placement;
|
|
95
111
|
return /*#__PURE__*/_react.default.createElement(Animator, _extends({
|
|
96
112
|
in: open
|
|
97
113
|
}, TransitionProps, {
|
|
@@ -112,8 +128,8 @@ const UTMenu = _ref => {
|
|
|
112
128
|
}, menuListProps), /*#__PURE__*/_react.default.createElement(_reactPerfectScrollbar.default, _extends({
|
|
113
129
|
onSync: handleScrollbarSync,
|
|
114
130
|
className: classes.scrollBar
|
|
115
|
-
}, scrollBarProps), items === null || items === void 0 ? void 0 : items.map((item, index)
|
|
116
|
-
|
|
131
|
+
}, scrollBarProps), items === null || items === void 0 ? void 0 : items.map(function (item, index) {
|
|
132
|
+
var handleClick = function handleClick(event) {
|
|
117
133
|
if (item.onClick) item.onClick(event, contextData);else if (onClickItem) onClickItem(event, contextData);
|
|
118
134
|
if (contextData.clickCallback) contextData.clickCallback();
|
|
119
135
|
};
|
|
@@ -194,4 +210,5 @@ UTMenu.propTypes = {
|
|
|
194
210
|
withDivider: _propTypes.bool,
|
|
195
211
|
withMenuItem: _propTypes.bool
|
|
196
212
|
};
|
|
197
|
-
var _default =
|
|
213
|
+
var _default = (0, _WithTheme.default)(_theme.retrieveStyle, _theme.retrieveMuiTheme)(UTMenu);
|
|
214
|
+
exports.default = _default;
|
|
@@ -5,11 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.retrieveStyle = exports.retrieveMuiTheme = void 0;
|
|
7
7
|
var _styles = require("@material-ui/core/styles");
|
|
8
|
-
|
|
8
|
+
var retrieveStyle = function retrieveStyle(_ref) {
|
|
9
9
|
var _theme$UTMenu, _theme$UTMenu2, _theme$UTMenu3, _theme$UTMenu4, _theme$UTMenu5, _theme$UTMenu6, _theme$UTMenu7, _theme$UTMenu8, _theme$UTMenu9, _theme$UTMenu10, _theme$UTMenu11, _theme$UTMenu12, _theme$UTMenu13, _theme$UTMenu14, _theme$UTMenu15, _theme$UTMenu16, _theme$UTMenu17, _theme$UTMenu18, _theme$UTMenu19;
|
|
10
|
-
|
|
11
|
-
theme
|
|
12
|
-
} = _ref;
|
|
10
|
+
var theme = _ref.theme;
|
|
13
11
|
return {
|
|
14
12
|
paper: {
|
|
15
13
|
padding: theme === null || theme === void 0 || (_theme$UTMenu = theme.UTMenu) === null || _theme$UTMenu === void 0 || (_theme$UTMenu = _theme$UTMenu.paper) === null || _theme$UTMenu === void 0 ? void 0 : _theme$UTMenu.padding,
|
|
@@ -48,7 +46,7 @@ const retrieveStyle = _ref => {
|
|
|
48
46
|
};
|
|
49
47
|
};
|
|
50
48
|
exports.retrieveStyle = retrieveStyle;
|
|
51
|
-
|
|
49
|
+
var retrieveMuiTheme = function retrieveMuiTheme(theme) {
|
|
52
50
|
var _theme$UTMenu20, _theme$UTMenu21;
|
|
53
51
|
return (0, _styles.createTheme)({
|
|
54
52
|
overrides: {
|
|
@@ -5,14 +5,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.lockScreen = exports.getTransitionOrigin = exports.getScrollbarWidth = exports.bodyHasScroll = void 0;
|
|
7
7
|
var _browser = require("@widergy/web-utils/lib/browser");
|
|
8
|
-
|
|
8
|
+
var getTransitionOrigin = function getTransitionOrigin(placement) {
|
|
9
|
+
return placement.search('bottom') >= 0 ? placement.replace('bottom', 'top') : placement.search('top') >= 0 ? placement.replace('top', 'bottom') : placement;
|
|
10
|
+
};
|
|
9
11
|
exports.getTransitionOrigin = getTransitionOrigin;
|
|
10
|
-
|
|
12
|
+
var bodyHasScroll = function bodyHasScroll() {
|
|
13
|
+
return document.body && document.body.scrollHeight && window.innerHeight ? document.body.scrollHeight > window.innerHeight : false;
|
|
14
|
+
};
|
|
11
15
|
exports.bodyHasScroll = bodyHasScroll;
|
|
12
|
-
|
|
16
|
+
var getScrollbarWidth = function getScrollbarWidth() {
|
|
17
|
+
return document.body && document.body.clientWidth && window.innerWidth ? window.innerWidth - document.body.clientWidth : 0;
|
|
18
|
+
};
|
|
13
19
|
exports.getScrollbarWidth = getScrollbarWidth;
|
|
14
|
-
|
|
15
|
-
|
|
20
|
+
var lockScreen = function lockScreen(blocker, lock) {
|
|
21
|
+
var body = document.getElementsByTagName('body')[0];
|
|
16
22
|
body.style.paddingRight = lock && (0, _browser.isDesktop)(1024) && bodyHasScroll() ? "".concat(getScrollbarWidth(), "px") : '';
|
|
17
23
|
body.style.overflow = lock ? 'hidden' : '';
|
|
18
24
|
blocker.current.style.display = lock ? 'initial' : '';
|
|
@@ -1,11 +1,16 @@
|
|
|
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
|
});
|
|
6
7
|
exports.STATUS_ICONS = exports.STATUSES = exports.CANCEL_BUTTON_TEXT = exports.ACCEPT_BUTTON_TEXT = void 0;
|
|
7
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _STATUS_ICONS;
|
|
8
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
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; }
|
|
12
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
13
|
+
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); }
|
|
9
14
|
var InfoIcon = function InfoIcon(props) {
|
|
10
15
|
return /*#__PURE__*/_react.default.createElement("svg", props, /*#__PURE__*/_react.default.createElement("path", {
|
|
11
16
|
fillRule: "evenodd",
|
|
@@ -66,17 +71,16 @@ ErrorIcon.defaultProps = {
|
|
|
66
71
|
fill: "none",
|
|
67
72
|
xmlns: "http://www.w3.org/2000/svg"
|
|
68
73
|
};
|
|
69
|
-
|
|
74
|
+
var STATUSES = {
|
|
70
75
|
INFO: 'info',
|
|
71
76
|
WARNING: 'warning',
|
|
72
77
|
SUCCESS: 'success',
|
|
73
78
|
ERROR: 'error'
|
|
74
79
|
};
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
const ACCEPT_BUTTON_TEXT = exports.ACCEPT_BUTTON_TEXT = 'Aceptar';
|
|
80
|
+
exports.STATUSES = STATUSES;
|
|
81
|
+
var STATUS_ICONS = (_STATUS_ICONS = {}, _defineProperty(_STATUS_ICONS, STATUSES.INFO, InfoIcon), _defineProperty(_STATUS_ICONS, STATUSES.WARNING, WarningIcon), _defineProperty(_STATUS_ICONS, STATUSES.SUCCESS, SuccessIcon), _defineProperty(_STATUS_ICONS, STATUSES.ERROR, ErrorIcon), _STATUS_ICONS);
|
|
82
|
+
exports.STATUS_ICONS = STATUS_ICONS;
|
|
83
|
+
var CANCEL_BUTTON_TEXT = 'Cancelar';
|
|
84
|
+
exports.CANCEL_BUTTON_TEXT = CANCEL_BUTTON_TEXT;
|
|
85
|
+
var ACCEPT_BUTTON_TEXT = 'Aceptar';
|
|
86
|
+
exports.ACCEPT_BUTTON_TEXT = ACCEPT_BUTTON_TEXT;
|
|
@@ -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,35 +16,37 @@ var _theme = require("./theme");
|
|
|
15
16
|
var _constants = require("./constants");
|
|
16
17
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
17
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
|
-
function _getRequireWildcardCache(
|
|
19
|
-
function _interopRequireWildcard(
|
|
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; }
|
|
20
21
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
21
|
-
|
|
22
|
+
var UTModal = function UTModal(_ref) {
|
|
22
23
|
var _status$, _status$2;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const dialogRef = (0, _react.useRef)(null);
|
|
40
|
-
(0, _react.useEffect)(() => {
|
|
24
|
+
var cancelAction = _ref.cancelAction,
|
|
25
|
+
children = _ref.children,
|
|
26
|
+
themeClasses = _ref.classes,
|
|
27
|
+
classNames = _ref.classNames,
|
|
28
|
+
description = _ref.description,
|
|
29
|
+
handleClickAway = _ref.handleClickAway,
|
|
30
|
+
isOpen = _ref.isOpen,
|
|
31
|
+
primaryAction = _ref.primaryAction,
|
|
32
|
+
removeBodyPadding = _ref.removeBodyPadding,
|
|
33
|
+
secondaryAction = _ref.secondaryAction,
|
|
34
|
+
SecondaryActionComponent = _ref.SecondaryActionComponent,
|
|
35
|
+
size = _ref.size,
|
|
36
|
+
status = _ref.status,
|
|
37
|
+
title = _ref.title;
|
|
38
|
+
var dialogRef = (0, _react.useRef)(null);
|
|
39
|
+
(0, _react.useEffect)(function () {
|
|
41
40
|
if (isOpen) dialogRef.current.showModal();else dialogRef.current.close();
|
|
42
41
|
}, [isOpen]);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
var onClickDialog = function onClickDialog(event) {
|
|
43
|
+
return handleClickAway && event.target.tagName === 'DIALOG' && handleClickAway();
|
|
44
|
+
};
|
|
45
|
+
var classes = (0, _react.useMemo)(function () {
|
|
46
|
+
return (0, _classesUtils.mergeClasses)(themeClasses, classNames);
|
|
47
|
+
}, [classNames]);
|
|
48
|
+
var StatusIcon = _constants.STATUS_ICONS[status];
|
|
49
|
+
var withSecondaryActions = !(0, _object.objectIsEmpty)(secondaryAction) || SecondaryActionComponent;
|
|
47
50
|
return /*#__PURE__*/_react.default.createElement("dialog", {
|
|
48
51
|
className: "".concat(_stylesModule.default.container, " ").concat(classes.container, " ").concat(size ? _stylesModule.default["container".concat(size[0].toUpperCase()).concat(size.toLowerCase().slice(1))] : _stylesModule.default.containerM),
|
|
49
52
|
onClick: onClickDialog,
|
|
@@ -100,4 +103,5 @@ UTModal.propTypes = {
|
|
|
100
103
|
status: _propTypes.string,
|
|
101
104
|
title: _propTypes.string
|
|
102
105
|
};
|
|
103
|
-
var _default =
|
|
106
|
+
var _default = (0, _WithTheme.default)(_theme.retrieveStyle)(UTModal);
|
|
107
|
+
exports.default = _default;
|
|
@@ -5,11 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.retrieveStyle = void 0;
|
|
7
7
|
var _shadowUtils = require("../../utils/shadowUtils");
|
|
8
|
-
|
|
8
|
+
var retrieveStyle = function retrieveStyle(_ref) {
|
|
9
9
|
var _theme$Palette$shadow;
|
|
10
|
-
|
|
11
|
-
theme
|
|
12
|
-
} = _ref;
|
|
10
|
+
var theme = _ref.theme;
|
|
13
11
|
return {
|
|
14
12
|
container: {
|
|
15
13
|
backgroundColor: theme.Palette.light['01'],
|
|
@@ -12,16 +12,14 @@ var _commonTypes = require("../../../../types/commonTypes");
|
|
|
12
12
|
var _utils = require("./utils");
|
|
13
13
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
totalRows
|
|
24
|
-
} = _ref;
|
|
15
|
+
var PageSizeSelector = function PageSizeSelector(_ref) {
|
|
16
|
+
var classes = _ref.classes,
|
|
17
|
+
colorThemes = _ref.colorThemes,
|
|
18
|
+
options = _ref.options,
|
|
19
|
+
rowsPerPage = _ref.rowsPerPage,
|
|
20
|
+
onChangeRowPerPage = _ref.onChangeRowPerPage,
|
|
21
|
+
label = _ref.label,
|
|
22
|
+
totalRows = _ref.totalRows;
|
|
25
23
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
26
24
|
className: _stylesModule.default.pageSizeSelector
|
|
27
25
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -60,4 +58,5 @@ PageSizeSelector.propTypes = {
|
|
|
60
58
|
label: _propTypes.string,
|
|
61
59
|
totalRows: _propTypes.number
|
|
62
60
|
};
|
|
63
|
-
var _default =
|
|
61
|
+
var _default = PageSizeSelector;
|
|
62
|
+
exports.default = _default;
|
|
@@ -5,16 +5,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getPageSizeOptions = void 0;
|
|
7
7
|
var _array = require("@widergy/web-utils/lib/array");
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
var getPrevOption = function getPrevOption(options, index) {
|
|
9
|
+
return index === 0 ? 0 : options[index - 1];
|
|
10
|
+
};
|
|
11
|
+
var getPageSizeOptions = function getPageSizeOptions(originalOptions, totalRows) {
|
|
12
|
+
var filteredOptions = originalOptions.filter(function (_, index) {
|
|
13
|
+
return getPrevOption(originalOptions, index) < totalRows;
|
|
14
|
+
});
|
|
11
15
|
if ((0, _array.isEmpty)(filteredOptions)) return [{
|
|
12
16
|
value: originalOptions[0],
|
|
13
17
|
label: totalRows
|
|
14
18
|
}];
|
|
15
|
-
return filteredOptions.map(value
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
return filteredOptions.map(function (value) {
|
|
20
|
+
return {
|
|
21
|
+
value: value,
|
|
22
|
+
label: Math.min(value, totalRows)
|
|
23
|
+
};
|
|
24
|
+
});
|
|
19
25
|
};
|
|
20
26
|
exports.getPageSizeOptions = getPageSizeOptions;
|
package/dist/components/UTPagination/components/Pagination/components/NavigationButton/index.js
CHANGED
|
@@ -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
|
});
|
|
@@ -9,17 +10,15 @@ var _propTypes = require("prop-types");
|
|
|
9
10
|
var _UTButton = _interopRequireDefault(require("../../../../../UTButton"));
|
|
10
11
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
11
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
function _getRequireWildcardCache(
|
|
13
|
-
function _interopRequireWildcard(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
onClick
|
|
22
|
-
} = _ref;
|
|
13
|
+
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); }
|
|
14
|
+
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; }
|
|
15
|
+
var NavigationButton = function NavigationButton(_ref) {
|
|
16
|
+
var className = _ref.className,
|
|
17
|
+
colorTheme = _ref.colorTheme,
|
|
18
|
+
disabled = _ref.disabled,
|
|
19
|
+
Icon = _ref.Icon,
|
|
20
|
+
label = _ref.label,
|
|
21
|
+
onClick = _ref.onClick;
|
|
23
22
|
return /*#__PURE__*/_react.default.createElement(_UTButton.default, {
|
|
24
23
|
classNames: {
|
|
25
24
|
root: "\n ".concat(className, "\n ").concat(_stylesModule.default.navigationButton, "\n ")
|
|
@@ -42,4 +41,5 @@ NavigationButton.propTypes = {
|
|
|
42
41
|
label: (0, _propTypes.oneOfType)([_propTypes.string, _propTypes.number]),
|
|
43
42
|
onClick: _propTypes.func
|
|
44
43
|
};
|
|
45
|
-
var _default =
|
|
44
|
+
var _default = /*#__PURE__*/(0, _react.memo)(NavigationButton);
|
|
45
|
+
exports.default = _default;
|
|
@@ -69,19 +69,17 @@ NavigateHeaderNextIcon.defaultProps = {
|
|
|
69
69
|
viewBox: "0 0 14 14",
|
|
70
70
|
xmlns: "http://www.w3.org/2000/svg"
|
|
71
71
|
};
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
const pageList = (0, _utils.getPageNumbers)(totalPages, currentPage, isResponsive);
|
|
84
|
-
const navigationButtonColorTheme = colorThemes.navigationButton || 'secondary';
|
|
72
|
+
var Pagination = function Pagination(_ref) {
|
|
73
|
+
var classes = _ref.classes,
|
|
74
|
+
colorThemes = _ref.colorThemes,
|
|
75
|
+
currentPage = _ref.currentPage,
|
|
76
|
+
onChangePage = _ref.onChangePage,
|
|
77
|
+
rowsPerPage = _ref.rowsPerPage,
|
|
78
|
+
totalRows = _ref.totalRows,
|
|
79
|
+
isResponsive = _ref.isResponsive;
|
|
80
|
+
var totalPages = rowsPerPage >= totalRows ? 1 : Math.ceil(totalRows / rowsPerPage);
|
|
81
|
+
var pageList = (0, _utils.getPageNumbers)(totalPages, currentPage, isResponsive);
|
|
82
|
+
var navigationButtonColorTheme = colorThemes.navigationButton || 'secondary';
|
|
85
83
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
86
84
|
className: "".concat(_stylesModule.default.pagination, " ").concat(classes.pagination)
|
|
87
85
|
}, totalPages > _constants.PAGINATION_LIMIT_DOUBLE_ARROWS && !isResponsive && /*#__PURE__*/_react.default.createElement(_NavigationButton.default, {
|
|
@@ -90,33 +88,45 @@ const Pagination = _ref => {
|
|
|
90
88
|
Icon: NavigateHeaderBeforeIcon,
|
|
91
89
|
label: "1",
|
|
92
90
|
disabled: currentPage === 0,
|
|
93
|
-
onClick: ()
|
|
91
|
+
onClick: function onClick() {
|
|
92
|
+
return onChangePage(0);
|
|
93
|
+
}
|
|
94
94
|
}), /*#__PURE__*/_react.default.createElement(_NavigationButton.default, {
|
|
95
95
|
colorTheme: navigationButtonColorTheme,
|
|
96
96
|
Icon: NavigateBeforeIcon,
|
|
97
97
|
disabled: currentPage === 0,
|
|
98
|
-
onClick: ()
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
98
|
+
onClick: function onClick() {
|
|
99
|
+
return onChangePage(currentPage - 1);
|
|
100
|
+
}
|
|
101
|
+
}), pageList.map(function (page) {
|
|
102
|
+
return /*#__PURE__*/_react.default.createElement(_UTButton.default, {
|
|
103
|
+
key: "page_".concat(page),
|
|
104
|
+
classNames: {
|
|
105
|
+
childrenContainer: _stylesModule.default.pageButtonChildrenContainer,
|
|
106
|
+
root: "".concat(_stylesModule.default.pageButton, " ").concat(currentPage === page && _stylesModule.default.pageButtondisabled)
|
|
107
|
+
},
|
|
108
|
+
colorTheme: colorThemes.pageButton || currentPage === page ? 'primary' : 'secondary',
|
|
109
|
+
onClick: function onClick() {
|
|
110
|
+
return onChangePage(page);
|
|
111
|
+
},
|
|
112
|
+
variant: currentPage === page ? 'semitransparent' : 'text'
|
|
113
|
+
}, page + 1);
|
|
114
|
+
}), /*#__PURE__*/_react.default.createElement(_NavigationButton.default, {
|
|
109
115
|
colorTheme: navigationButtonColorTheme,
|
|
110
116
|
Icon: NavigateNextIcon,
|
|
111
117
|
disabled: currentPage === totalPages - 1,
|
|
112
|
-
onClick: ()
|
|
118
|
+
onClick: function onClick() {
|
|
119
|
+
return onChangePage(currentPage + 1);
|
|
120
|
+
}
|
|
113
121
|
}), totalPages > _constants.PAGINATION_LIMIT_DOUBLE_ARROWS && !isResponsive && /*#__PURE__*/_react.default.createElement(_NavigationButton.default, {
|
|
114
122
|
className: _stylesModule.default.navigationLabel,
|
|
115
123
|
colorTheme: navigationButtonColorTheme,
|
|
116
124
|
Icon: NavigateHeaderNextIcon,
|
|
117
125
|
label: totalPages,
|
|
118
126
|
disabled: currentPage === totalPages - 1,
|
|
119
|
-
onClick: ()
|
|
127
|
+
onClick: function onClick() {
|
|
128
|
+
return onChangePage(totalPages - 1);
|
|
129
|
+
}
|
|
120
130
|
}));
|
|
121
131
|
};
|
|
122
132
|
Pagination.propTypes = {
|
|
@@ -132,4 +142,5 @@ Pagination.propTypes = {
|
|
|
132
142
|
rowsPerPage: _propTypes.number,
|
|
133
143
|
totalRows: _propTypes.number
|
|
134
144
|
};
|
|
135
|
-
var _default =
|
|
145
|
+
var _default = Pagination;
|
|
146
|
+
exports.default = _default;
|
|
@@ -5,14 +5,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getPageNumbers = void 0;
|
|
7
7
|
var _constants = require("../../constants");
|
|
8
|
-
|
|
8
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
9
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
11
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
12
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
13
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
14
|
+
var getPageNumbers = function getPageNumbers(totalPages, currentPage, isResponsive) {
|
|
9
15
|
if (isResponsive) return [currentPage];
|
|
10
|
-
if (totalPages <= _constants.MAX_PAGINATION_ITEMS) return
|
|
11
|
-
|
|
12
|
-
if (currentPage < Math.ceil(paginationFactor)) return
|
|
13
|
-
if (totalPages - currentPage < paginationFactor) return
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return
|
|
16
|
+
if (totalPages <= _constants.MAX_PAGINATION_ITEMS) return _toConsumableArray(Array(totalPages).keys());
|
|
17
|
+
var paginationFactor = _constants.MAX_PAGINATION_ITEMS / 2;
|
|
18
|
+
if (currentPage < Math.ceil(paginationFactor)) return _toConsumableArray(Array(_constants.MAX_PAGINATION_ITEMS).keys());
|
|
19
|
+
if (totalPages - currentPage < paginationFactor) return _toConsumableArray(Array(totalPages).keys()).slice(totalPages - _constants.MAX_PAGINATION_ITEMS, totalPages);
|
|
20
|
+
var floorFactor = Math.floor(paginationFactor);
|
|
21
|
+
var ceilFactor = Math.ceil(paginationFactor);
|
|
22
|
+
return _toConsumableArray(Array(currentPage + ceilFactor).keys()).slice(currentPage - floorFactor);
|
|
17
23
|
};
|
|
18
24
|
exports.getPageNumbers = getPageNumbers;
|
|
@@ -4,6 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.PREPOSITION = exports.PAGINATION_LIMIT_DOUBLE_ARROWS = exports.MAX_PAGINATION_ITEMS = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
var PREPOSITION = 'de';
|
|
8
|
+
exports.PREPOSITION = PREPOSITION;
|
|
9
|
+
var PAGINATION_LIMIT_DOUBLE_ARROWS = 10;
|
|
10
|
+
exports.PAGINATION_LIMIT_DOUBLE_ARROWS = PAGINATION_LIMIT_DOUBLE_ARROWS;
|
|
11
|
+
var MAX_PAGINATION_ITEMS = 5;
|
|
12
|
+
exports.MAX_PAGINATION_ITEMS = MAX_PAGINATION_ITEMS;
|