@widergy/energy-ui 2.10.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/components/EnergyThemeProvider/index.js +12 -34
- package/dist/components/Loading/constants.js +1 -1
- package/dist/components/Loading/index.js +12 -10
- package/dist/components/Loading/theme.js +6 -3
- package/dist/components/UTAlert/AlertHandler.js +74 -99
- package/dist/components/UTAlert/index.js +64 -85
- package/dist/components/UTAlert/theme.js +34 -32
- package/dist/components/UTAttachment/components/Preview/index.js +7 -7
- package/dist/components/UTAttachment/constants.js +6 -6
- package/dist/components/UTAttachment/index.js +167 -257
- package/dist/components/UTAttachment/layout.js +25 -25
- package/dist/components/UTAttachment/theme.js +6 -3
- package/dist/components/UTAttachment/utils.js +44 -117
- package/dist/components/UTAutocomplete/components/ListBox/index.js +12 -19
- package/dist/components/UTAutocomplete/components/ListBox/utils.js +11 -12
- package/dist/components/UTAutocomplete/constants.js +11 -11
- package/dist/components/UTAutocomplete/index.js +53 -92
- package/dist/components/UTAutocomplete/theme.js +9 -5
- package/dist/components/UTAvatar/constants.js +1 -1
- package/dist/components/UTAvatar/index.js +17 -15
- package/dist/components/UTBarChart/components/Bars/components/Bar/components/Rect/index.js +21 -20
- package/dist/components/UTBarChart/components/Bars/components/Bar/constants.js +2 -1
- package/dist/components/UTBarChart/components/Bars/components/Bar/index.js +20 -20
- package/dist/components/UTBarChart/components/Bars/constants.js +3 -3
- package/dist/components/UTBarChart/components/Bars/index.js +69 -78
- package/dist/components/UTBarChart/components/Legend/constants.js +14 -17
- package/dist/components/UTBarChart/components/Legend/index.js +74 -91
- package/dist/components/UTBarChart/components/Legend/utils.js +2 -5
- package/dist/components/UTBarChart/components/Levels/index.js +15 -12
- package/dist/components/UTBarChart/components/Levels/utils.js +26 -27
- package/dist/components/UTBarChart/components/LinearPlot/constants.js +2 -2
- package/dist/components/UTBarChart/components/LinearPlot/index.js +24 -18
- package/dist/components/UTBarChart/components/LinearPlot/utils.js +39 -39
- package/dist/components/UTBarChart/components/Pagination/constants.js +1 -1
- package/dist/components/UTBarChart/components/Pagination/index.js +19 -22
- package/dist/components/UTBarChart/components/XAxis/components/AxisElement/index.js +20 -30
- package/dist/components/UTBarChart/components/XAxis/components/Decoration/constants.js +2 -2
- package/dist/components/UTBarChart/components/XAxis/components/Decoration/index.js +19 -17
- package/dist/components/UTBarChart/components/XAxis/constants.js +1 -1
- package/dist/components/UTBarChart/components/XAxis/index.js +53 -63
- package/dist/components/UTBarChart/components/YAxis/AxisElement/index.js +11 -9
- package/dist/components/UTBarChart/components/YAxis/constants.js +1 -1
- package/dist/components/UTBarChart/components/YAxis/index.js +29 -35
- package/dist/components/UTBarChart/components/YAxis/utils.js +6 -6
- package/dist/components/UTBarChart/constants.js +4 -4
- package/dist/components/UTBarChart/hooks/use-dynamic-margins.js +22 -38
- package/dist/components/UTBarChart/index.js +151 -164
- package/dist/components/UTBarChart/theme.js +6 -3
- package/dist/components/UTBarChart/types.js +9 -9
- package/dist/components/UTBarChart/utils.js +118 -111
- package/dist/components/UTBreadcrumbs/constants.js +22 -24
- package/dist/components/UTBreadcrumbs/index.js +75 -99
- package/dist/components/UTBreadcrumbs/styles.module.scss +1 -0
- package/dist/components/UTBreadcrumbs/theme.js +6 -3
- package/dist/components/UTButton/constants.js +11 -11
- package/dist/components/UTButton/index.js +27 -29
- package/dist/components/UTButton/theme.js +26 -24
- package/dist/components/UTCBUInput/index.js +35 -38
- package/dist/components/UTCBUInput/theme.js +6 -3
- package/dist/components/UTCaptcha/index.js +18 -43
- package/dist/components/UTCard/components/UTCardFooter/index.js +14 -14
- package/dist/components/UTCard/index.js +89 -123
- package/dist/components/UTCard/theme.js +13 -13
- package/dist/components/UTCard/types.js +1 -1
- package/dist/components/UTCarousel/components/Button/index.js +12 -11
- package/dist/components/UTCarousel/components/Legend/index.js +12 -13
- package/dist/components/UTCarousel/components/Slider/component/Slide/index.js +15 -14
- package/dist/components/UTCarousel/components/Slider/constants.js +5 -5
- package/dist/components/UTCarousel/components/Slider/index.js +213 -281
- package/dist/components/UTCarousel/components/Slider/layout.js +66 -92
- package/dist/components/UTCarousel/index.js +13 -13
- package/dist/components/UTCarousel/theme.js +6 -3
- package/dist/components/UTCheckList/constants.js +1 -1
- package/dist/components/UTCheckList/index.js +71 -91
- package/dist/components/UTCheckList/theme.js +34 -32
- package/dist/components/UTCheckbox/constants.js +2 -4
- package/dist/components/UTCheckbox/index.js +32 -43
- package/dist/components/UTCheckbox/theme.js +37 -35
- package/dist/components/UTConsumptionBar/components/ConsumptionBarIndicator/index.js +8 -7
- package/dist/components/UTConsumptionBar/constants.js +3 -3
- package/dist/components/UTConsumptionBar/index.js +52 -78
- package/dist/components/UTCuit/index.js +114 -137
- package/dist/components/UTCuit/theme.js +52 -53
- package/dist/components/UTDatePicker/components/Day/constants.js +1 -1
- package/dist/components/UTDatePicker/components/Day/index.js +11 -10
- package/dist/components/UTDatePicker/constants.js +21 -22
- package/dist/components/UTDatePicker/index.js +60 -102
- package/dist/components/UTDatePicker/theme.js +8 -4
- package/dist/components/UTDatePicker/types.js +1 -1
- package/dist/components/UTDatePicker/utils.js +4 -6
- package/dist/components/UTDialog/constants.js +2 -2
- package/dist/components/UTDialog/index.js +37 -35
- package/dist/components/UTDialog/theme.js +6 -3
- package/dist/components/UTDialog/types.js +1 -1
- package/dist/components/UTDotMenu/index.js +40 -61
- package/dist/components/UTEmojiPicker/constants.js +14 -18
- package/dist/components/UTEmojiPicker/index.js +46 -64
- package/dist/components/UTEmojiPicker/styles.module.scss +1 -1
- package/dist/components/UTEmojiPicker/theme.js +6 -3
- package/dist/components/UTEmojiPicker/utils.js +24 -52
- package/dist/components/UTExternalLink/constants.js +2 -2
- package/dist/components/UTExternalLink/index.js +17 -13
- package/dist/components/UTExternalLink/theme.js +11 -7
- package/dist/components/UTFileInput/constants.js +2 -2
- package/dist/components/UTFileInput/index.js +6 -29
- package/dist/components/UTFileInput/layout.js +72 -96
- package/dist/components/UTIconButton/index.js +48 -70
- package/dist/components/UTIconButton/theme.js +6 -3
- package/dist/components/UTImageRadio/components/ImageRadioCard/index.js +52 -56
- package/dist/components/UTImageRadio/constants.js +3 -3
- package/dist/components/UTImageRadio/index.js +38 -45
- package/dist/components/UTImageRadio/theme.js +13 -13
- package/dist/components/UTImageRadio/types.js +1 -1
- package/dist/components/UTImageRadio/utils.js +4 -6
- package/dist/components/UTLabel/constants.js +13 -11
- package/dist/components/UTLabel/index.js +17 -18
- package/dist/components/UTLabel/theme.js +19 -16
- package/dist/components/UTList/index.js +14 -16
- package/dist/components/UTLoading/index.js +14 -13
- package/dist/components/UTMap/components/GoogleMaps/constants.js +9 -10
- package/dist/components/UTMap/components/GoogleMaps/index.js +62 -89
- package/dist/components/UTMap/constants.js +6 -6
- package/dist/components/UTMap/index.js +162 -196
- package/dist/components/UTMap/types.js +3 -3
- package/dist/components/UTMap/utils.js +35 -46
- package/dist/components/UTMap/withGoogleMapScript.js +11 -15
- package/dist/components/UTMenu/index.js +51 -67
- package/dist/components/UTMenu/styles.module.scss +5 -5
- package/dist/components/UTMenu/theme.js +8 -4
- package/dist/components/UTMenu/utils.js +10 -12
- package/dist/components/UTModal/constants.js +13 -17
- package/dist/components/UTModal/index.js +25 -28
- package/dist/components/UTModal/styles.module.scss +1 -1
- package/dist/components/UTModal/theme.js +6 -3
- package/dist/components/UTPagination/components/PageSizeSelector/index.js +10 -8
- package/dist/components/UTPagination/components/PageSizeSelector/utils.js +9 -14
- package/dist/components/UTPagination/components/Pagination/components/NavigationButton/index.js +11 -10
- package/dist/components/UTPagination/components/Pagination/index.js +31 -45
- package/dist/components/UTPagination/components/Pagination/utils.js +10 -15
- package/dist/components/UTPagination/constants.js +3 -3
- package/dist/components/UTPagination/index.js +15 -15
- package/dist/components/UTPagination/theme.js +6 -3
- package/dist/components/UTPanel/index.js +37 -42
- package/dist/components/UTPasswordField/components/PasswordValidations/components/Error/index.js +12 -8
- package/dist/components/UTPasswordField/components/PasswordValidations/components/Validation/index.js +21 -17
- package/dist/components/UTPasswordField/components/PasswordValidations/index.js +62 -48
- package/dist/components/UTPasswordField/components/PasswordWarning/index.js +24 -24
- package/dist/components/UTPasswordField/index.js +25 -21
- package/dist/components/UTPasswordField/theme.js +6 -3
- package/dist/components/UTPhoneInput/constants.js +3 -3
- package/dist/components/UTPhoneInput/index.js +185 -209
- package/dist/components/UTPhoneInput/theme.js +79 -77
- package/dist/components/UTPieChart/components/ArrowLabel/constants.js +4 -4
- package/dist/components/UTPieChart/components/ArrowLabel/index.js +23 -21
- package/dist/components/UTPieChart/components/Legend/contants.js +3 -3
- package/dist/components/UTPieChart/components/Legend/index.js +26 -22
- package/dist/components/UTPieChart/constants.js +13 -13
- package/dist/components/UTPieChart/hooks/use-animated-value/index.js +14 -31
- package/dist/components/UTPieChart/index.js +72 -74
- package/dist/components/UTPieChart/theme.js +6 -3
- package/dist/components/UTPieChart/utils.js +6 -3
- package/dist/components/UTProgressBar/constants.js +2 -2
- package/dist/components/UTProgressBar/index.js +14 -15
- package/dist/components/UTProgressBar/theme.js +6 -3
- package/dist/components/UTProgressBar/types.js +1 -1
- package/dist/components/UTRadioGroup/index.js +55 -81
- package/dist/components/UTRadioGroup/theme.js +54 -52
- package/dist/components/UTRating/components/Circle/index.js +40 -54
- package/dist/components/UTRating/components/Faces/assets/mood-confuzed.svg +3 -0
- package/dist/components/UTRating/components/Faces/assets/mood-empty.svg +3 -0
- package/dist/components/UTRating/components/Faces/assets/mood-happy.svg +3 -0
- package/dist/components/UTRating/components/Faces/assets/mood-sad.svg +3 -0
- package/dist/components/UTRating/components/Faces/assets/mood-smile.svg +3 -0
- package/dist/components/UTRating/components/Faces/constants.js +80 -0
- package/dist/components/UTRating/components/Faces/index.js +76 -0
- package/dist/components/UTRating/components/Faces/styles.module.scss +78 -0
- package/dist/components/UTRating/components/Star/index.js +35 -38
- package/dist/components/UTRating/constants.js +5 -4
- package/dist/components/UTRating/index.js +35 -46
- package/dist/components/UTRating/styles.module.scss +1 -0
- package/dist/components/UTRating/theme.js +52 -3
- package/dist/components/UTRipple/Ripple.js +21 -37
- package/dist/components/UTRipple/index.js +17 -35
- package/dist/components/UTSelect/components/Option/index.js +12 -11
- package/dist/components/UTSelect/constants.js +4 -4
- package/dist/components/UTSelect/index.js +62 -83
- package/dist/components/UTSelect/theme.js +9 -5
- package/dist/components/UTSelect/utils.js +5 -14
- package/dist/components/UTSidebar/components/ListOption/index.js +33 -47
- package/dist/components/UTSidebar/components/LogosContainer/components/DynamicIcon/index.js +7 -6
- package/dist/components/UTSidebar/components/LogosContainer/index.js +13 -12
- package/dist/components/UTSidebar/components/Option/constants.js +1 -1
- package/dist/components/UTSidebar/components/Option/index.js +27 -30
- package/dist/components/UTSidebar/components/Toggler/index.js +10 -9
- package/dist/components/UTSidebar/index.js +41 -51
- package/dist/components/UTSidebar/theme.js +6 -3
- package/dist/components/UTSidebar/types.js +5 -5
- package/dist/components/UTSkeleton/index.js +9 -34
- package/dist/components/UTStatus/constants.js +4 -4
- package/dist/components/UTStatus/index.js +15 -13
- package/dist/components/UTStatus/theme.js +75 -59
- package/dist/components/UTSwitch/constants.js +3 -3
- package/dist/components/UTSwitch/index.js +41 -55
- package/dist/components/UTSwitch/theme.js +6 -3
- package/dist/components/UTTable/components/ActionIcons/constants.js +1 -1
- package/dist/components/UTTable/components/ActionIcons/index.js +46 -83
- package/dist/components/UTTable/components/Cell/components/ActionButton/index.js +9 -10
- package/dist/components/UTTable/components/Cell/index.js +17 -21
- package/dist/components/UTTable/components/HeaderCell/constants.js +1 -1
- package/dist/components/UTTable/components/HeaderCell/index.js +22 -28
- package/dist/components/UTTable/components/HeaderCell/utils.js +5 -4
- package/dist/components/UTTable/components/PrimaryAction/index.js +11 -9
- package/dist/components/UTTable/components/ResponsiveCell/index.js +18 -18
- package/dist/components/UTTable/components/Status/index.js +17 -17
- package/dist/components/UTTable/components/TableFooter/components/PageSizeSelector/index.js +9 -7
- package/dist/components/UTTable/components/TableFooter/components/PageSizeSelector/utils.js +9 -14
- package/dist/components/UTTable/components/TableFooter/components/Pagination/components/NavigationButton/index.js +11 -10
- package/dist/components/UTTable/components/TableFooter/components/Pagination/index.js +22 -36
- package/dist/components/UTTable/components/TableFooter/components/Pagination/utils.js +10 -15
- package/dist/components/UTTable/components/TableFooter/constants.js +1 -1
- package/dist/components/UTTable/components/TableFooter/index.js +14 -13
- package/dist/components/UTTable/components/TableHeader/index.js +10 -10
- package/dist/components/UTTable/components/TableRow/constants.js +2 -4
- package/dist/components/UTTable/components/TableRow/index.js +79 -93
- package/dist/components/UTTable/constants.js +26 -24
- package/dist/components/UTTable/hook.js +13 -27
- package/dist/components/UTTable/index.js +125 -213
- package/dist/components/UTTable/theme.js +19 -18
- package/dist/components/UTTable/types.js +4 -4
- package/dist/components/UTTable/utils.js +80 -75
- package/dist/components/UTTabs/components/TooltipTab/index.js +19 -28
- package/dist/components/UTTabs/constants.js +4 -4
- package/dist/components/UTTabs/index.js +56 -84
- package/dist/components/UTTabs/theme.js +6 -3
- package/dist/components/UTTabs/utils.js +3 -2
- package/dist/components/UTTextArea/constants.js +2 -4
- package/dist/components/UTTextArea/index.js +22 -21
- package/dist/components/UTTextArea/theme.js +6 -3
- package/dist/components/UTTextInput/constants.js +1 -1
- package/dist/components/UTTextInput/index.js +138 -165
- package/dist/components/UTTextInput/theme.js +9 -5
- package/dist/components/UTThirdPartyCookieChecker/index.js +16 -19
- package/dist/components/UTToggle/components/ToggleOption/index.js +15 -15
- package/dist/components/UTToggle/index.js +24 -24
- package/dist/components/UTToggle/theme.js +6 -3
- package/dist/components/UTTooltip/index.js +22 -28
- package/dist/components/UTTooltip/theme.js +6 -3
- package/dist/components/UTTopbar/components/Notifications/index.js +10 -12
- package/dist/components/UTTopbar/components/UserMenu/index.js +18 -17
- package/dist/components/UTTopbar/components/UserMenu/styles.module.scss +1 -1
- package/dist/components/UTTopbar/index.js +27 -29
- package/dist/components/UTTopbar/theme.js +6 -3
- package/dist/components/UTTopbar/types.js +4 -4
- package/dist/components/UTTouchableWithoutFeedback/index.js +15 -27
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/constants.js +2 -2
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/index.js +33 -29
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/utils.js +6 -5
- package/dist/components/UTVirtualizedList/components/VirtualizedData/constants.js +6 -6
- package/dist/components/UTVirtualizedList/components/VirtualizedData/hooks/use-ledger.js +7 -16
- package/dist/components/UTVirtualizedList/components/VirtualizedData/hooks/use-virtualized-data.js +22 -45
- package/dist/components/UTVirtualizedList/components/VirtualizedData/index.js +30 -32
- package/dist/components/UTVirtualizedList/components/VirtualizedData/utils.js +89 -94
- package/dist/components/UTVirtualizedList/constants.js +4 -4
- package/dist/components/UTVirtualizedList/index.js +25 -36
- package/dist/components/UTWorkflowContainer/components/ActionButton/index.js +14 -17
- package/dist/components/UTWorkflowContainer/constants.js +3 -3
- package/dist/components/UTWorkflowContainer/hooks/use-previous.js +5 -4
- package/dist/components/UTWorkflowContainer/index.js +31 -49
- package/dist/components/UTWorkflowContainer/theme.js +62 -54
- package/dist/components/UTWorkflowContainer/types.js +1 -1
- package/dist/components/WithLoading/index.js +9 -13
- package/dist/components/WithTheme/index.js +9 -15
- package/dist/components/WithTheme/layout.js +21 -26
- package/dist/components/WithTouch/index.js +11 -17
- package/dist/constants/UTTable.js +1 -1
- package/dist/index.js +58 -58
- package/dist/theme.js +8 -4
- package/dist/types/commonTypes.js +2 -2
- package/dist/types/consumptionTypes.js +2 -2
- package/dist/types/formTypes.js +3 -3
- package/dist/types/tableTypes.js +1 -1
- package/dist/utils/classesUtils.js +7 -13
- package/dist/utils/componentUtils.js +8 -10
- package/dist/utils/helperFunctions.js +6 -5
- package/dist/utils/shadowUtils.js +15 -12
- package/dist/utils/useScreenSize.js +1 -1
- package/package.json +29 -70
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -25,79 +24,62 @@ var _theme = require("./theme");
|
|
|
25
24
|
var _utils = require("./utils");
|
|
26
25
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
27
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
28
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function
|
|
29
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" !=
|
|
27
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
28
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
30
29
|
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); }
|
|
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
|
-
|
|
67
|
-
|
|
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);
|
|
30
|
+
const UTMenu = _ref => {
|
|
31
|
+
let {
|
|
32
|
+
anchor,
|
|
33
|
+
animation,
|
|
34
|
+
animatorProps,
|
|
35
|
+
arrowProps,
|
|
36
|
+
classes: themeClasses,
|
|
37
|
+
classNames,
|
|
38
|
+
clickAwayListenerProps,
|
|
39
|
+
contextData = {},
|
|
40
|
+
elevation,
|
|
41
|
+
iconBefore,
|
|
42
|
+
ItemComponent,
|
|
43
|
+
itemIconProps,
|
|
44
|
+
itemProps,
|
|
45
|
+
items,
|
|
46
|
+
LastItem,
|
|
47
|
+
lockScreenEnabled,
|
|
48
|
+
menuItemProps,
|
|
49
|
+
menuListProps,
|
|
50
|
+
menuPlacement,
|
|
51
|
+
modifiers,
|
|
52
|
+
onClickItem,
|
|
53
|
+
onClose,
|
|
54
|
+
paperProps,
|
|
55
|
+
popperProps,
|
|
56
|
+
scrollBarProps,
|
|
57
|
+
withArrow,
|
|
58
|
+
withDivider,
|
|
59
|
+
withMenuItem
|
|
60
|
+
} = _ref;
|
|
61
|
+
const blockerRef = (0, _react.useRef)(null);
|
|
62
|
+
const classes = (0, _react.useMemo)(() => (0, _classesUtils.mergeClasses)(themeClasses, classNames), [classNames]);
|
|
63
|
+
const [arrowRef, setArrowRef] = (0, _react.useState)(null);
|
|
64
|
+
const [open, handleOpenState] = (0, _react.useState)(false);
|
|
65
|
+
(0, _react.useEffect)(() => {
|
|
66
|
+
const shouldOpen = !!anchor && !(0, _array.isEmpty)(items);
|
|
81
67
|
handleOpenState(shouldOpen);
|
|
82
68
|
if (lockScreenEnabled && anchor) (0, _utils.lockScreen)(blockerRef, true);
|
|
83
|
-
return
|
|
69
|
+
return () => {
|
|
84
70
|
document.body.style.overflow = 'unset';
|
|
85
71
|
return lockScreenEnabled && (0, _utils.lockScreen)(blockerRef, false);
|
|
86
72
|
};
|
|
87
73
|
}, [anchor, items]);
|
|
88
|
-
|
|
74
|
+
const popperModifiers = Object.assign({
|
|
89
75
|
arrow: {
|
|
90
76
|
enabled: true,
|
|
91
77
|
element: arrowRef
|
|
92
78
|
}
|
|
93
79
|
}, modifiers);
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
return ps.update();
|
|
98
|
-
}, 350);
|
|
99
|
-
};
|
|
100
|
-
var lastItem = items.length - 1;
|
|
80
|
+
const Animator = animation === 'grow' ? _Grow.default : _Fade.default;
|
|
81
|
+
const handleScrollbarSync = ps => setTimeout(() => ps.update(), 350);
|
|
82
|
+
const lastItem = items.length - 1;
|
|
101
83
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, anchor && /*#__PURE__*/_react.default.createElement(_Popper.default, _extends({
|
|
102
84
|
anchorEl: anchor,
|
|
103
85
|
open: open,
|
|
@@ -105,9 +87,11 @@ var UTMenu = function UTMenu(_ref) {
|
|
|
105
87
|
placement: menuPlacement,
|
|
106
88
|
modifiers: popperModifiers,
|
|
107
89
|
className: classes.popper
|
|
108
|
-
}, popperProps),
|
|
109
|
-
|
|
110
|
-
|
|
90
|
+
}, popperProps), _ref2 => {
|
|
91
|
+
let {
|
|
92
|
+
TransitionProps,
|
|
93
|
+
placement
|
|
94
|
+
} = _ref2;
|
|
111
95
|
return /*#__PURE__*/_react.default.createElement(Animator, _extends({
|
|
112
96
|
in: open
|
|
113
97
|
}, TransitionProps, {
|
|
@@ -128,8 +112,8 @@ var UTMenu = function UTMenu(_ref) {
|
|
|
128
112
|
}, menuListProps), /*#__PURE__*/_react.default.createElement(_reactPerfectScrollbar.default, _extends({
|
|
129
113
|
onSync: handleScrollbarSync,
|
|
130
114
|
className: classes.scrollBar
|
|
131
|
-
}, scrollBarProps), items === null || items === void 0 ? void 0 : items.map(
|
|
132
|
-
|
|
115
|
+
}, scrollBarProps), items === null || items === void 0 ? void 0 : items.map((item, index) => {
|
|
116
|
+
const handleClick = event => {
|
|
133
117
|
if (item.onClick) item.onClick(event, contextData);else if (onClickItem) onClickItem(event, contextData);
|
|
134
118
|
if (contextData.clickCallback) contextData.clickCallback();
|
|
135
119
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
.arrow {
|
|
2
|
-
|
|
3
|
-
transform: translateY(-100%);
|
|
4
|
-
width: 0;
|
|
5
|
-
height: 0;
|
|
2
|
+
border-bottom: 7px solid white;
|
|
6
3
|
border-left: 7px solid transparent;
|
|
7
4
|
border-right: 7px solid transparent;
|
|
8
5
|
color: white;
|
|
9
|
-
|
|
6
|
+
height: 0;
|
|
7
|
+
position: absolute;
|
|
8
|
+
transform: translateY(-100%);
|
|
9
|
+
width: 0;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
.scrollBlocker {
|
|
@@ -5,9 +5,11 @@ 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
|
+
const 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
|
-
|
|
10
|
+
let {
|
|
11
|
+
theme
|
|
12
|
+
} = _ref;
|
|
11
13
|
return {
|
|
12
14
|
paper: {
|
|
13
15
|
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,
|
|
@@ -45,7 +47,8 @@ var retrieveStyle = exports.retrieveStyle = function retrieveStyle(_ref) {
|
|
|
45
47
|
}
|
|
46
48
|
};
|
|
47
49
|
};
|
|
48
|
-
|
|
50
|
+
exports.retrieveStyle = retrieveStyle;
|
|
51
|
+
const retrieveMuiTheme = theme => {
|
|
49
52
|
var _theme$UTMenu20, _theme$UTMenu21;
|
|
50
53
|
return (0, _styles.createTheme)({
|
|
51
54
|
overrides: {
|
|
@@ -57,4 +60,5 @@ var retrieveMuiTheme = exports.retrieveMuiTheme = function retrieveMuiTheme(them
|
|
|
57
60
|
}
|
|
58
61
|
}
|
|
59
62
|
});
|
|
60
|
-
};
|
|
63
|
+
};
|
|
64
|
+
exports.retrieveMuiTheme = retrieveMuiTheme;
|
|
@@ -5,18 +5,16 @@ 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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
17
|
-
var lockScreen = exports.lockScreen = function lockScreen(blocker, lock) {
|
|
18
|
-
var body = document.getElementsByTagName('body')[0];
|
|
8
|
+
const getTransitionOrigin = placement => placement.search('bottom') >= 0 ? placement.replace('bottom', 'top') : placement.search('top') >= 0 ? placement.replace('top', 'bottom') : placement;
|
|
9
|
+
exports.getTransitionOrigin = getTransitionOrigin;
|
|
10
|
+
const bodyHasScroll = () => document.body && document.body.scrollHeight && window.innerHeight ? document.body.scrollHeight > window.innerHeight : false;
|
|
11
|
+
exports.bodyHasScroll = bodyHasScroll;
|
|
12
|
+
const getScrollbarWidth = () => document.body && document.body.clientWidth && window.innerWidth ? window.innerWidth - document.body.clientWidth : 0;
|
|
13
|
+
exports.getScrollbarWidth = getScrollbarWidth;
|
|
14
|
+
const lockScreen = (blocker, lock) => {
|
|
15
|
+
const body = document.getElementsByTagName('body')[0];
|
|
19
16
|
body.style.paddingRight = lock && (0, _browser.isDesktop)(1024) && bodyHasScroll() ? "".concat(getScrollbarWidth(), "px") : '';
|
|
20
17
|
body.style.overflow = lock ? 'hidden' : '';
|
|
21
18
|
blocker.current.style.display = lock ? 'initial' : '';
|
|
22
|
-
};
|
|
19
|
+
};
|
|
20
|
+
exports.lockScreen = lockScreen;
|
|
@@ -1,28 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.STATUS_ICONS = exports.STATUSES = exports.CANCEL_BUTTON_TEXT = exports.ACCEPT_BUTTON_TEXT = void 0;
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _STATUS_ICONS;
|
|
10
8
|
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); }
|
|
14
9
|
var InfoIcon = function InfoIcon(props) {
|
|
15
10
|
return /*#__PURE__*/_react.default.createElement("svg", props, /*#__PURE__*/_react.default.createElement("path", {
|
|
16
11
|
fillRule: "evenodd",
|
|
17
12
|
clipRule: "evenodd",
|
|
18
|
-
d: "M14 3.333C8.109 3.333 3.333 8.11 3.333 14S8.11 24.667 14 24.667 24.667 19.89 24.667 14 19.89 3.333 14 3.
|
|
13
|
+
d: "M14 3.333C8.109 3.333 3.333 8.11 3.333 14S8.11 24.667 14 24.667 24.667 19.89 24.667 14 19.89 3.333 14 3.333ZM.667 14C.667 6.636 6.637.667 14 .667c7.364 0 13.333 5.97 13.333 13.333 0 7.364-5.97 13.333-13.333 13.333C6.636 27.333.667 21.363.667 14Zm12-5.333c0-.737.597-1.334 1.333-1.334h.013a1.333 1.333 0 1 1 0 2.667H14a1.333 1.333 0 0 1-1.333-1.333ZM11.333 14c0-.736.597-1.333 1.334-1.333H14c.736 0 1.333.597 1.333 1.333v4a1.333 1.333 0 1 1 0 2.667H14a1.333 1.333 0 0 1-1.333-1.334v-4A1.333 1.333 0 0 1 11.333 14Z",
|
|
19
14
|
fill: "#037DB4"
|
|
20
15
|
}));
|
|
21
16
|
};
|
|
22
17
|
InfoIcon.defaultProps = {
|
|
23
18
|
width: "28",
|
|
24
19
|
height: "28",
|
|
25
|
-
viewBox: "0 0 28 28",
|
|
26
20
|
fill: "none",
|
|
27
21
|
xmlns: "http://www.w3.org/2000/svg"
|
|
28
22
|
};
|
|
@@ -30,14 +24,13 @@ var WarningIcon = function WarningIcon(props) {
|
|
|
30
24
|
return /*#__PURE__*/_react.default.createElement("svg", props, /*#__PURE__*/_react.default.createElement("path", {
|
|
31
25
|
fillRule: "evenodd",
|
|
32
26
|
clipRule: "evenodd",
|
|
33
|
-
d: "M13.955 3.179a4 4 0 0 1 5.525 1.496l9.46 16.323c.032.054.06.11.083.169a3.999 3.999 0 0 1-3.68 5.5H6.667l-.073-.002a1.358 1.358 0 0 1-.143 0 3.999 3.999 0 0 1-3.5-5.5c.024-.057.051-.113.082-.167l9.46-16.323a4 4 0 0 1 1.462-1.
|
|
27
|
+
d: "M13.955 3.179a4 4 0 0 1 5.525 1.496l9.46 16.323c.032.054.06.11.083.169a3.999 3.999 0 0 1-3.68 5.5H6.667l-.073-.002a1.358 1.358 0 0 1-.143 0 3.999 3.999 0 0 1-3.5-5.5c.024-.057.051-.113.082-.167l9.46-16.323a4 4 0 0 1 1.462-1.496ZM6.593 24.002 6.667 24h18.66a1.332 1.332 0 0 0 1.25-1.76l-9.41-16.238-.014-.023a1.333 1.333 0 0 0-2.333 0l-.013.023-9.412 16.239A1.333 1.333 0 0 0 6.59 24l.004.001ZM16 10.667c.736 0 1.333.597 1.333 1.333v2.667a1.333 1.333 0 0 1-2.666 0V12c0-.736.597-1.333 1.333-1.333Zm0 8c.736 0 1.333.597 1.333 1.333v.013a1.333 1.333 0 0 1-2.666 0V20c0-.736.597-1.333 1.333-1.333Z",
|
|
34
28
|
fill: "#A86600"
|
|
35
29
|
}));
|
|
36
30
|
};
|
|
37
31
|
WarningIcon.defaultProps = {
|
|
38
32
|
width: "32",
|
|
39
33
|
height: "32",
|
|
40
|
-
viewBox: "0 0 32 32",
|
|
41
34
|
fill: "none",
|
|
42
35
|
xmlns: "http://www.w3.org/2000/svg"
|
|
43
36
|
};
|
|
@@ -45,14 +38,13 @@ var SuccessIcon = function SuccessIcon(props) {
|
|
|
45
38
|
return /*#__PURE__*/_react.default.createElement("svg", props, /*#__PURE__*/_react.default.createElement("path", {
|
|
46
39
|
fillRule: "evenodd",
|
|
47
40
|
clipRule: "evenodd",
|
|
48
|
-
d: "M16 5.333C10.109 5.333 5.333 10.11 5.333 16S10.11 26.667 16 26.667 26.667 21.89 26.667 16 21.89 5.333 16 5.
|
|
41
|
+
d: "M16 5.333C10.109 5.333 5.333 10.11 5.333 16S10.11 26.667 16 26.667 26.667 21.89 26.667 16 21.89 5.333 16 5.333ZM2.667 16C2.667 8.636 8.637 2.667 16 2.667c7.364 0 13.333 5.97 13.333 13.333 0 7.364-5.97 13.333-13.333 13.333-7.364 0-13.333-5.97-13.333-13.333Zm18.276-3.61c.52.521.52 1.365 0 1.886l-5.334 5.334c-.52.52-1.364.52-1.885 0l-2.667-2.667a1.333 1.333 0 1 1 1.886-1.886l1.724 1.724 4.39-4.39c.52-.521 1.365-.521 1.886 0Z",
|
|
49
42
|
fill: "#118460"
|
|
50
43
|
}));
|
|
51
44
|
};
|
|
52
45
|
SuccessIcon.defaultProps = {
|
|
53
46
|
width: "32",
|
|
54
47
|
height: "32",
|
|
55
|
-
viewBox: "0 0 32 32",
|
|
56
48
|
fill: "none",
|
|
57
49
|
xmlns: "http://www.w3.org/2000/svg"
|
|
58
50
|
};
|
|
@@ -60,23 +52,27 @@ var ErrorIcon = function ErrorIcon(props) {
|
|
|
60
52
|
return /*#__PURE__*/_react.default.createElement("svg", props, /*#__PURE__*/_react.default.createElement("path", {
|
|
61
53
|
fillRule: "evenodd",
|
|
62
54
|
clipRule: "evenodd",
|
|
63
|
-
d: "M16 5.333C10.109 5.333 5.333 10.11 5.333 16S10.11 26.667 16 26.667 26.667 21.89 26.667 16 21.89 5.333 16 5.
|
|
55
|
+
d: "M16 5.333C10.109 5.333 5.333 10.11 5.333 16S10.11 26.667 16 26.667 26.667 21.89 26.667 16 21.89 5.333 16 5.333ZM2.667 16C2.667 8.636 8.637 2.667 16 2.667c7.364 0 13.333 5.97 13.333 13.333 0 7.364-5.97 13.333-13.333 13.333-7.364 0-13.333-5.97-13.333-13.333Zm9.723-3.61c.521-.52 1.365-.52 1.886 0L16 14.114l1.724-1.724a1.333 1.333 0 1 1 1.885 1.886L17.886 16l1.723 1.724a1.333 1.333 0 1 1-1.885 1.886L16 17.886l-1.724 1.724a1.333 1.333 0 1 1-1.886-1.886L14.114 16l-1.724-1.724a1.333 1.333 0 0 1 0-1.886Z",
|
|
64
56
|
fill: "#E80C2C"
|
|
65
57
|
}));
|
|
66
58
|
};
|
|
67
59
|
ErrorIcon.defaultProps = {
|
|
68
60
|
width: "32",
|
|
69
61
|
height: "32",
|
|
70
|
-
viewBox: "0 0 32 32",
|
|
71
62
|
fill: "none",
|
|
72
63
|
xmlns: "http://www.w3.org/2000/svg"
|
|
73
64
|
};
|
|
74
|
-
|
|
65
|
+
const STATUSES = exports.STATUSES = {
|
|
75
66
|
INFO: 'info',
|
|
76
67
|
WARNING: 'warning',
|
|
77
68
|
SUCCESS: 'success',
|
|
78
69
|
ERROR: 'error'
|
|
79
70
|
};
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
71
|
+
const STATUS_ICONS = exports.STATUS_ICONS = {
|
|
72
|
+
[STATUSES.INFO]: InfoIcon,
|
|
73
|
+
[STATUSES.WARNING]: WarningIcon,
|
|
74
|
+
[STATUSES.SUCCESS]: SuccessIcon,
|
|
75
|
+
[STATUSES.ERROR]: ErrorIcon
|
|
76
|
+
};
|
|
77
|
+
const CANCEL_BUTTON_TEXT = exports.CANCEL_BUTTON_TEXT = 'Cancelar';
|
|
78
|
+
const ACCEPT_BUTTON_TEXT = exports.ACCEPT_BUTTON_TEXT = 'Aceptar';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -16,37 +15,35 @@ var _theme = require("./theme");
|
|
|
16
15
|
var _constants = require("./constants");
|
|
17
16
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
18
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function
|
|
20
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" !=
|
|
18
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
19
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
20
|
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); }
|
|
22
|
-
|
|
21
|
+
const UTModal = _ref => {
|
|
23
22
|
var _status$, _status$2;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
23
|
+
let {
|
|
24
|
+
cancelAction,
|
|
25
|
+
children,
|
|
26
|
+
classes: themeClasses,
|
|
27
|
+
classNames,
|
|
28
|
+
description,
|
|
29
|
+
handleClickAway,
|
|
30
|
+
isOpen,
|
|
31
|
+
primaryAction,
|
|
32
|
+
removeBodyPadding,
|
|
33
|
+
secondaryAction,
|
|
34
|
+
SecondaryActionComponent,
|
|
35
|
+
size,
|
|
36
|
+
status,
|
|
37
|
+
title
|
|
38
|
+
} = _ref;
|
|
39
|
+
const dialogRef = (0, _react.useRef)(null);
|
|
40
|
+
(0, _react.useEffect)(() => {
|
|
40
41
|
if (isOpen) dialogRef.current.showModal();else dialogRef.current.close();
|
|
41
42
|
}, [isOpen]);
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
return (0, _classesUtils.mergeClasses)(themeClasses, classNames);
|
|
47
|
-
}, [classNames]);
|
|
48
|
-
var StatusIcon = _constants.STATUS_ICONS[status];
|
|
49
|
-
var withSecondaryActions = !(0, _object.objectIsEmpty)(secondaryAction) || SecondaryActionComponent;
|
|
43
|
+
const onClickDialog = event => handleClickAway && event.target.tagName === 'DIALOG' && handleClickAway();
|
|
44
|
+
const classes = (0, _react.useMemo)(() => (0, _classesUtils.mergeClasses)(themeClasses, classNames), [classNames]);
|
|
45
|
+
const StatusIcon = _constants.STATUS_ICONS[status];
|
|
46
|
+
const withSecondaryActions = !(0, _object.objectIsEmpty)(secondaryAction) || SecondaryActionComponent;
|
|
50
47
|
return /*#__PURE__*/_react.default.createElement("dialog", {
|
|
51
48
|
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),
|
|
52
49
|
onClick: onClickDialog,
|
|
@@ -5,9 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.retrieveStyle = void 0;
|
|
7
7
|
var _shadowUtils = require("../../utils/shadowUtils");
|
|
8
|
-
|
|
8
|
+
const retrieveStyle = _ref => {
|
|
9
9
|
var _theme$Palette$shadow;
|
|
10
|
-
|
|
10
|
+
let {
|
|
11
|
+
theme
|
|
12
|
+
} = _ref;
|
|
11
13
|
return {
|
|
12
14
|
container: {
|
|
13
15
|
backgroundColor: theme.Palette.light['01'],
|
|
@@ -51,4 +53,5 @@ var retrieveStyle = exports.retrieveStyle = function retrieveStyle(_ref) {
|
|
|
51
53
|
borderTopColor: theme.Palette.light['04']
|
|
52
54
|
}
|
|
53
55
|
};
|
|
54
|
-
};
|
|
56
|
+
};
|
|
57
|
+
exports.retrieveStyle = retrieveStyle;
|
|
@@ -12,14 +12,16 @@ 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
|
-
|
|
15
|
+
const PageSizeSelector = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
classes,
|
|
18
|
+
colorThemes,
|
|
19
|
+
options,
|
|
20
|
+
rowsPerPage,
|
|
21
|
+
onChangeRowPerPage,
|
|
22
|
+
label,
|
|
23
|
+
totalRows
|
|
24
|
+
} = _ref;
|
|
23
25
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
24
26
|
className: _stylesModule.default.pageSizeSelector
|
|
25
27
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -5,21 +5,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getPageSizeOptions = void 0;
|
|
7
7
|
var _array = require("@widergy/web-utils/lib/array");
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var getPageSizeOptions = exports.getPageSizeOptions = function getPageSizeOptions(originalOptions, totalRows) {
|
|
12
|
-
var filteredOptions = originalOptions.filter(function (_, index) {
|
|
13
|
-
return getPrevOption(originalOptions, index) < totalRows;
|
|
14
|
-
});
|
|
8
|
+
const getPrevOption = (options, index) => index === 0 ? 0 : options[index - 1];
|
|
9
|
+
const getPageSizeOptions = (originalOptions, totalRows) => {
|
|
10
|
+
const filteredOptions = originalOptions.filter((_, index) => getPrevOption(originalOptions, index) < totalRows);
|
|
15
11
|
if ((0, _array.isEmpty)(filteredOptions)) return [{
|
|
16
12
|
value: originalOptions[0],
|
|
17
13
|
label: totalRows
|
|
18
14
|
}];
|
|
19
|
-
return filteredOptions.map(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
};
|
|
15
|
+
return filteredOptions.map(value => ({
|
|
16
|
+
value,
|
|
17
|
+
label: Math.min(value, totalRows)
|
|
18
|
+
}));
|
|
19
|
+
};
|
|
20
|
+
exports.getPageSizeOptions = getPageSizeOptions;
|
package/dist/components/UTPagination/components/Pagination/components/NavigationButton/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -10,15 +9,17 @@ var _propTypes = require("prop-types");
|
|
|
10
9
|
var _UTButton = _interopRequireDefault(require("../../../../../UTButton"));
|
|
11
10
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
12
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function
|
|
14
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" !=
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
+
const NavigationButton = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
className,
|
|
17
|
+
colorTheme,
|
|
18
|
+
disabled,
|
|
19
|
+
Icon,
|
|
20
|
+
label,
|
|
21
|
+
onClick
|
|
22
|
+
} = _ref;
|
|
22
23
|
return /*#__PURE__*/_react.default.createElement(_UTButton.default, {
|
|
23
24
|
classNames: {
|
|
24
25
|
root: "\n ".concat(className, "\n ").concat(_stylesModule.default.navigationButton, "\n ")
|