@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
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
# [3.0.0](https://github.com/widergy/energy-ui/compare/v2.11.0...v3.0.0) (2023-11-11)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* update dependencies energy UI ([#372](https://github.com/widergy/energy-ui/issues/372)) ([99af512](https://github.com/widergy/energy-ui/commit/99af5124a9ec2a3960742b9fe4f7ff07e54060e2))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### BREAKING CHANGES
|
|
10
|
+
|
|
11
|
+
* dependencies
|
|
12
|
+
* dependencies
|
|
13
|
+
|
|
14
|
+
# [2.11.0](https://github.com/widergy/energy-ui/compare/v2.10.1...v2.11.0) (2023-11-08)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* rating update ([#390](https://github.com/widergy/energy-ui/issues/390)) ([22e0242](https://github.com/widergy/energy-ui/commit/22e024273fc4045dddfa0bf41710352cdf98842b))
|
|
20
|
+
|
|
1
21
|
## [2.10.1](https://github.com/widergy/energy-ui/compare/v2.10.0...v2.10.1) (2023-11-01)
|
|
2
22
|
|
|
3
23
|
|
|
@@ -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
|
});
|
|
@@ -8,40 +7,19 @@ exports.default = void 0;
|
|
|
8
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
8
|
var _propTypes = require("prop-types");
|
|
10
9
|
var _theme = require("../../theme");
|
|
11
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function
|
|
12
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" !=
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
23
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
24
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
25
|
-
var ThemeProvider = /*#__PURE__*/function (_PureComponent) {
|
|
26
|
-
_inherits(ThemeProvider, _PureComponent);
|
|
27
|
-
var _super = _createSuper(ThemeProvider);
|
|
28
|
-
function ThemeProvider() {
|
|
29
|
-
_classCallCheck(this, ThemeProvider);
|
|
30
|
-
return _super.apply(this, arguments);
|
|
10
|
+
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); }
|
|
11
|
+
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; }
|
|
12
|
+
class ThemeProvider extends _react.PureComponent {
|
|
13
|
+
render() {
|
|
14
|
+
const {
|
|
15
|
+
children,
|
|
16
|
+
theme
|
|
17
|
+
} = this.props;
|
|
18
|
+
return /*#__PURE__*/_react.default.createElement(_theme.EnergyThemeProvider, {
|
|
19
|
+
value: theme
|
|
20
|
+
}, children);
|
|
31
21
|
}
|
|
32
|
-
|
|
33
|
-
key: "render",
|
|
34
|
-
value: function render() {
|
|
35
|
-
var _this$props = this.props,
|
|
36
|
-
children = _this$props.children,
|
|
37
|
-
theme = _this$props.theme;
|
|
38
|
-
return /*#__PURE__*/_react.default.createElement(_theme.EnergyThemeProvider, {
|
|
39
|
-
value: theme
|
|
40
|
-
}, children);
|
|
41
|
-
}
|
|
42
|
-
}]);
|
|
43
|
-
return ThemeProvider;
|
|
44
|
-
}(_react.PureComponent);
|
|
22
|
+
}
|
|
45
23
|
ThemeProvider.propTypes = {
|
|
46
24
|
theme: _propTypes.object
|
|
47
25
|
};
|
|
@@ -14,16 +14,18 @@ var _theme = require("./theme");
|
|
|
14
14
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
15
15
|
var _constants = require("./constants");
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
const Loading = _ref => {
|
|
18
|
+
let {
|
|
19
|
+
text,
|
|
20
|
+
className,
|
|
21
|
+
thickness,
|
|
22
|
+
size,
|
|
23
|
+
classes,
|
|
24
|
+
theme,
|
|
25
|
+
textClassName
|
|
26
|
+
} = _ref;
|
|
27
|
+
const defaultSize = (0, _seamlessImmutable.getIn)(theme, ['Loading', 'base', 'size'], 85);
|
|
28
|
+
const defaultThickness = (0, _seamlessImmutable.getIn)(theme, ['Loading', 'base', 'thickness'], 1.5);
|
|
27
29
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
28
30
|
className: "".concat(_stylesModule.default.container, " ").concat(className)
|
|
29
31
|
}, /*#__PURE__*/_react.default.createElement(_CircularProgress.default, {
|
|
@@ -7,8 +7,10 @@ exports.retrieveStyle = void 0;
|
|
|
7
7
|
var _seamlessImmutable = require("seamless-immutable");
|
|
8
8
|
var _colorsModule = _interopRequireDefault(require("../../scss/variables/colors.module.scss"));
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
const retrieveStyle = _ref => {
|
|
11
|
+
let {
|
|
12
|
+
theme
|
|
13
|
+
} = _ref;
|
|
12
14
|
return {
|
|
13
15
|
base: {
|
|
14
16
|
color: (0, _seamlessImmutable.getIn)(theme, ['Loading', 'base', 'color'], _colorsModule.default.loadingBase)
|
|
@@ -18,4 +20,5 @@ var retrieveStyle = exports.retrieveStyle = function retrieveStyle(_ref) {
|
|
|
18
20
|
fontSize: (0, _seamlessImmutable.getIn)(theme, ['Loading', 'text', 'fontSize'], (0, _seamlessImmutable.getIn)(theme, ['Fonts', 'medium']))
|
|
19
21
|
}
|
|
20
22
|
};
|
|
21
|
-
};
|
|
23
|
+
};
|
|
24
|
+
exports.retrieveStyle = retrieveStyle;
|
|
@@ -4,110 +4,85 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
14
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
15
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
16
|
-
var sendAlert = function sendAlert(setState, parameters) {
|
|
17
|
-
return setTimeout(function () {
|
|
18
|
-
return setState(_objectSpread(_objectSpread({}, parameters), {}, {
|
|
19
|
-
open: true
|
|
20
|
-
}));
|
|
21
|
-
}, 300);
|
|
22
|
-
};
|
|
23
|
-
var defaultState = {
|
|
7
|
+
const sendAlert = (setState, parameters) => setTimeout(() => setState({
|
|
8
|
+
...parameters,
|
|
9
|
+
open: true
|
|
10
|
+
}), 300);
|
|
11
|
+
const defaultState = {
|
|
24
12
|
open: false,
|
|
25
13
|
type: 'info',
|
|
26
14
|
message: '',
|
|
27
15
|
topRight: false,
|
|
28
16
|
timeDuration: 0
|
|
29
17
|
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
18
|
+
let currentAlert;
|
|
19
|
+
const close = setState => setState({
|
|
20
|
+
...currentAlert,
|
|
21
|
+
open: false
|
|
22
|
+
});
|
|
23
|
+
class AlertHandler {
|
|
24
|
+
init(_ref) {
|
|
25
|
+
let {
|
|
26
|
+
setState,
|
|
27
|
+
duration = 5000
|
|
28
|
+
} = _ref;
|
|
29
|
+
this.setState = setState;
|
|
30
|
+
defaultState.timeDuration = duration;
|
|
31
|
+
defaultState.onClose = () => close(setState);
|
|
32
|
+
currentAlert = defaultState;
|
|
33
|
+
this.setState(defaultState);
|
|
34
|
+
}
|
|
35
|
+
success(message) {
|
|
36
|
+
let topRight = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultState.topRight;
|
|
37
|
+
let timeDuration = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultState.timeDuration;
|
|
38
|
+
close(this.setState);
|
|
39
|
+
currentAlert = {
|
|
40
|
+
...currentAlert,
|
|
41
|
+
message,
|
|
42
|
+
type: 'success',
|
|
43
|
+
topRight,
|
|
44
|
+
timeDuration
|
|
45
|
+
};
|
|
46
|
+
sendAlert(this.setState, currentAlert);
|
|
47
|
+
}
|
|
48
|
+
error(message) {
|
|
49
|
+
let topRight = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultState.topRight;
|
|
50
|
+
let timeDuration = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultState.timeDuration;
|
|
51
|
+
close(this.setState);
|
|
52
|
+
currentAlert = {
|
|
53
|
+
...currentAlert,
|
|
54
|
+
message,
|
|
55
|
+
type: 'error',
|
|
56
|
+
topRight,
|
|
57
|
+
timeDuration
|
|
58
|
+
};
|
|
59
|
+
sendAlert(this.setState, currentAlert);
|
|
60
|
+
}
|
|
61
|
+
info(message) {
|
|
62
|
+
let topRight = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultState.topRight;
|
|
63
|
+
let timeDuration = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultState.timeDuration;
|
|
64
|
+
close(this.setState);
|
|
65
|
+
currentAlert = {
|
|
66
|
+
...currentAlert,
|
|
67
|
+
message,
|
|
68
|
+
type: 'info',
|
|
69
|
+
topRight,
|
|
70
|
+
timeDuration
|
|
71
|
+
};
|
|
72
|
+
sendAlert(this.setState, currentAlert);
|
|
73
|
+
}
|
|
74
|
+
warning(message) {
|
|
75
|
+
let topRight = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultState.topRight;
|
|
76
|
+
let timeDuration = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultState.timeDuration;
|
|
77
|
+
close(this.setState);
|
|
78
|
+
currentAlert = {
|
|
79
|
+
...currentAlert,
|
|
80
|
+
message,
|
|
81
|
+
type: 'warning',
|
|
82
|
+
topRight,
|
|
83
|
+
timeDuration
|
|
84
|
+
};
|
|
85
|
+
sendAlert(this.setState, currentAlert);
|
|
39
86
|
}
|
|
40
|
-
|
|
41
|
-
key: "init",
|
|
42
|
-
value: function init(_ref) {
|
|
43
|
-
var setState = _ref.setState,
|
|
44
|
-
_ref$duration = _ref.duration,
|
|
45
|
-
duration = _ref$duration === void 0 ? 5000 : _ref$duration;
|
|
46
|
-
this.setState = setState;
|
|
47
|
-
defaultState.timeDuration = duration;
|
|
48
|
-
defaultState.onClose = function () {
|
|
49
|
-
return close(setState);
|
|
50
|
-
};
|
|
51
|
-
currentAlert = defaultState;
|
|
52
|
-
this.setState(defaultState);
|
|
53
|
-
}
|
|
54
|
-
}, {
|
|
55
|
-
key: "success",
|
|
56
|
-
value: function success(message) {
|
|
57
|
-
var topRight = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultState.topRight;
|
|
58
|
-
var timeDuration = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultState.timeDuration;
|
|
59
|
-
close(this.setState);
|
|
60
|
-
currentAlert = _objectSpread(_objectSpread({}, currentAlert), {}, {
|
|
61
|
-
message: message,
|
|
62
|
-
type: 'success',
|
|
63
|
-
topRight: topRight,
|
|
64
|
-
timeDuration: timeDuration
|
|
65
|
-
});
|
|
66
|
-
sendAlert(this.setState, currentAlert);
|
|
67
|
-
}
|
|
68
|
-
}, {
|
|
69
|
-
key: "error",
|
|
70
|
-
value: function error(message) {
|
|
71
|
-
var topRight = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultState.topRight;
|
|
72
|
-
var timeDuration = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultState.timeDuration;
|
|
73
|
-
close(this.setState);
|
|
74
|
-
currentAlert = _objectSpread(_objectSpread({}, currentAlert), {}, {
|
|
75
|
-
message: message,
|
|
76
|
-
type: 'error',
|
|
77
|
-
topRight: topRight,
|
|
78
|
-
timeDuration: timeDuration
|
|
79
|
-
});
|
|
80
|
-
sendAlert(this.setState, currentAlert);
|
|
81
|
-
}
|
|
82
|
-
}, {
|
|
83
|
-
key: "info",
|
|
84
|
-
value: function info(message) {
|
|
85
|
-
var topRight = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultState.topRight;
|
|
86
|
-
var timeDuration = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultState.timeDuration;
|
|
87
|
-
close(this.setState);
|
|
88
|
-
currentAlert = _objectSpread(_objectSpread({}, currentAlert), {}, {
|
|
89
|
-
message: message,
|
|
90
|
-
type: 'info',
|
|
91
|
-
topRight: topRight,
|
|
92
|
-
timeDuration: timeDuration
|
|
93
|
-
});
|
|
94
|
-
sendAlert(this.setState, currentAlert);
|
|
95
|
-
}
|
|
96
|
-
}, {
|
|
97
|
-
key: "warning",
|
|
98
|
-
value: function warning(message) {
|
|
99
|
-
var topRight = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultState.topRight;
|
|
100
|
-
var timeDuration = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultState.timeDuration;
|
|
101
|
-
close(this.setState);
|
|
102
|
-
currentAlert = _objectSpread(_objectSpread({}, currentAlert), {}, {
|
|
103
|
-
message: message,
|
|
104
|
-
type: 'warning',
|
|
105
|
-
topRight: topRight,
|
|
106
|
-
timeDuration: timeDuration
|
|
107
|
-
});
|
|
108
|
-
sendAlert(this.setState, currentAlert);
|
|
109
|
-
}
|
|
110
|
-
}]);
|
|
111
|
-
return AlertHandler;
|
|
112
|
-
}();
|
|
87
|
+
}
|
|
113
88
|
var _default = exports.default = new AlertHandler();
|
|
@@ -18,50 +18,35 @@ var _WithTheme = _interopRequireDefault(require("../WithTheme"));
|
|
|
18
18
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
19
19
|
var _theme = require("./theme");
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function
|
|
22
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" !=
|
|
23
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
24
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
25
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
26
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
27
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
28
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
29
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
30
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
31
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
32
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
33
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
21
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
22
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
34
23
|
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; }
|
|
35
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return
|
|
36
|
-
function _toPrimitive(input, hint) { if (
|
|
37
|
-
|
|
24
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
25
|
+
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); }
|
|
26
|
+
const variantIcon = {
|
|
38
27
|
success: _CheckCircle.default,
|
|
39
28
|
error: _Error.default,
|
|
40
29
|
info: _Info.default,
|
|
41
30
|
warning: _Warning.default
|
|
42
31
|
};
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
var _this;
|
|
48
|
-
_classCallCheck(this, UTAlert);
|
|
49
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
50
|
-
args[_key] = arguments[_key];
|
|
51
|
-
}
|
|
52
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
53
|
-
_defineProperty(_assertThisInitialized(_this), "handleClose", function (_, reason) {
|
|
32
|
+
class UTAlert extends _react.PureComponent {
|
|
33
|
+
constructor() {
|
|
34
|
+
super(...arguments);
|
|
35
|
+
_defineProperty(this, "handleClose", (_, reason) => {
|
|
54
36
|
// In case you don't want to dismiss notification clicking away
|
|
55
37
|
if (reason === 'clickaway') {
|
|
56
38
|
return;
|
|
57
39
|
}
|
|
58
|
-
|
|
40
|
+
const {
|
|
41
|
+
content: alert
|
|
42
|
+
} = this.props;
|
|
59
43
|
return alert.onClose && alert.onClose();
|
|
60
44
|
});
|
|
61
|
-
_defineProperty(
|
|
62
|
-
|
|
63
|
-
alert
|
|
64
|
-
classes
|
|
45
|
+
_defineProperty(this, "selectAlertType", () => {
|
|
46
|
+
const {
|
|
47
|
+
content: alert,
|
|
48
|
+
classes
|
|
49
|
+
} = this.props;
|
|
65
50
|
switch (alert.type) {
|
|
66
51
|
case 'info':
|
|
67
52
|
return classes.info;
|
|
@@ -73,62 +58,56 @@ var UTAlert = /*#__PURE__*/function (_PureComponent) {
|
|
|
73
58
|
return classes.success;
|
|
74
59
|
}
|
|
75
60
|
});
|
|
76
|
-
return _this;
|
|
77
61
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
62
|
+
render() {
|
|
63
|
+
const {
|
|
64
|
+
content: alert = {},
|
|
65
|
+
withoutIcon,
|
|
66
|
+
classes = {}
|
|
67
|
+
} = this.props;
|
|
68
|
+
const anchor = {
|
|
69
|
+
vertical: alert.topRight ? 'top' : 'bottom',
|
|
70
|
+
horizontal: alert.topRight ? 'right' : 'left'
|
|
71
|
+
};
|
|
72
|
+
const transition = {
|
|
73
|
+
direction: alert.topRight ? 'left' : 'up'
|
|
74
|
+
};
|
|
75
|
+
const AlertTypeIcon = alert.type && variantIcon[alert.type];
|
|
76
|
+
return /*#__PURE__*/_react.default.createElement(_Snackbar.default, {
|
|
77
|
+
anchorOrigin: anchor,
|
|
78
|
+
open: alert.open,
|
|
79
|
+
autoHideDuration: alert.timeDuration,
|
|
80
|
+
onClose: this.handleClose,
|
|
81
|
+
TransitionProps: transition,
|
|
82
|
+
TransitionComponent: _Slide.default,
|
|
83
|
+
classes: {
|
|
84
|
+
root: _stylesModule.default.snackbarRoot
|
|
85
|
+
},
|
|
86
|
+
ContentProps: {
|
|
87
|
+
className: "".concat(_stylesModule.default.snackbarContent, " ").concat(classes.snackbarContent, " ").concat(this.selectAlertType()),
|
|
102
88
|
classes: {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
89
|
+
action: _stylesModule.default.action,
|
|
90
|
+
message: _stylesModule.default.message
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
message: /*#__PURE__*/_react.default.createElement("div", {
|
|
94
|
+
className: "".concat(_stylesModule.default.content, " ").concat(classes.content)
|
|
95
|
+
}, !withoutIcon && AlertTypeIcon && /*#__PURE__*/_react.default.createElement(AlertTypeIcon, {
|
|
96
|
+
classes: {
|
|
97
|
+
root: _stylesModule.default.alertTypeIcon
|
|
98
|
+
}
|
|
99
|
+
}), alert.message),
|
|
100
|
+
action: [/*#__PURE__*/_react.default.createElement(_IconButton.default, {
|
|
101
|
+
classes: {
|
|
102
|
+
root: classes.action
|
|
111
103
|
},
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
action: [/*#__PURE__*/_react.default.createElement(_IconButton.default, {
|
|
120
|
-
classes: {
|
|
121
|
-
root: classes.action
|
|
122
|
-
},
|
|
123
|
-
key: "close",
|
|
124
|
-
color: "inherit",
|
|
125
|
-
onClick: this.handleClose
|
|
126
|
-
}, /*#__PURE__*/_react.default.createElement(_Close.default, null))]
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
}]);
|
|
130
|
-
return UTAlert;
|
|
131
|
-
}(_react.PureComponent);
|
|
104
|
+
key: "close",
|
|
105
|
+
color: "inherit",
|
|
106
|
+
onClick: this.handleClose
|
|
107
|
+
}, /*#__PURE__*/_react.default.createElement(_Close.default, null))]
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
132
111
|
UTAlert.propTypes = {
|
|
133
112
|
content: (0, _propTypes.shape)({
|
|
134
113
|
message: _propTypes.string,
|
|
@@ -8,9 +8,11 @@ var _seamlessImmutable = require("seamless-immutable");
|
|
|
8
8
|
var _styles = require("@material-ui/core/styles");
|
|
9
9
|
var _colorsModule = _interopRequireDefault(require("../../scss/variables/colors.module.scss"));
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
11
|
+
const retrieveStyle = _ref => {
|
|
12
12
|
var _theme$Palette, _theme$Palette2, _theme$Palette3, _theme$Palette4;
|
|
13
|
-
|
|
13
|
+
let {
|
|
14
|
+
theme
|
|
15
|
+
} = _ref;
|
|
14
16
|
return {
|
|
15
17
|
error: {
|
|
16
18
|
backgroundColor: ((_theme$Palette = theme.Palette) === null || _theme$Palette === void 0 ? void 0 : _theme$Palette.error['04']) || _colorsModule.default.notificationError
|
|
@@ -37,40 +39,40 @@ var retrieveStyle = exports.retrieveStyle = function retrieveStyle(_ref) {
|
|
|
37
39
|
}
|
|
38
40
|
};
|
|
39
41
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
exports.retrieveStyle = retrieveStyle;
|
|
43
|
+
const retrieveMuiTheme = theme => (0, _styles.createTheme)({
|
|
44
|
+
typography: {
|
|
45
|
+
fontFamily: (0, _seamlessImmutable.getIn)(theme, ['Fonts', 'fontFamily'])
|
|
46
|
+
},
|
|
47
|
+
overrides: {
|
|
48
|
+
MuiSnackbarContent: {
|
|
49
|
+
root: {
|
|
50
|
+
minWidth: 288,
|
|
51
|
+
maxWidth: 568,
|
|
52
|
+
'@media (max-width : 767px)': {
|
|
53
|
+
borderRadius: 0,
|
|
54
|
+
width: '100%',
|
|
55
|
+
maxWidth: 'initial'
|
|
56
|
+
}
|
|
57
|
+
}
|
|
44
58
|
},
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
width: '100%',
|
|
53
|
-
maxWidth: 'initial'
|
|
54
|
-
}
|
|
59
|
+
MuiSnackbar: {
|
|
60
|
+
root: {
|
|
61
|
+
'@media (max-width : 767px)': {
|
|
62
|
+
maxWidth: 'initial',
|
|
63
|
+
width: '100%',
|
|
64
|
+
left: 0,
|
|
65
|
+
right: 0
|
|
55
66
|
}
|
|
56
67
|
},
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
maxWidth: 'initial',
|
|
61
|
-
width: '100%',
|
|
62
|
-
left: 0,
|
|
63
|
-
right: 0
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
anchorOriginBottomLeft: {
|
|
68
|
+
anchorOriginBottomLeft: {
|
|
69
|
+
bottom: 0,
|
|
70
|
+
'@media (max-width : 767px)': {
|
|
67
71
|
bottom: 0,
|
|
68
|
-
|
|
69
|
-
bottom: 0,
|
|
70
|
-
left: 0
|
|
71
|
-
}
|
|
72
|
+
left: 0
|
|
72
73
|
}
|
|
73
74
|
}
|
|
74
75
|
}
|
|
75
|
-
}
|
|
76
|
-
};
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
exports.retrieveMuiTheme = retrieveMuiTheme;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -11,13 +10,14 @@ var _utils = require("../../utils");
|
|
|
11
10
|
var _constants = require("../../constants");
|
|
12
11
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
13
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function
|
|
15
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" !=
|
|
13
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
14
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
15
|
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); } /* eslint-disable jsx-a11y/media-has-caption */
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
previewProps =
|
|
16
|
+
const Preview = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
preview,
|
|
19
|
+
previewProps = {}
|
|
20
|
+
} = _ref;
|
|
21
21
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, (0, _utils.isImage)(preview) && /*#__PURE__*/_react.default.createElement("img", _extends({
|
|
22
22
|
src: preview.src,
|
|
23
23
|
className: _stylesModule.default.previewImage,
|