@widergy/energy-ui 2.12.1 → 2.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/EnergyThemeProvider/index.js +36 -13
- package/dist/components/Loading/constants.js +2 -1
- package/dist/components/Loading/index.js +12 -13
- package/dist/components/Loading/theme.js +2 -4
- package/dist/components/UTAlert/AlertHandler.js +101 -75
- package/dist/components/UTAlert/index.js +87 -65
- package/dist/components/UTAlert/theme.js +32 -32
- package/dist/components/UTAttachment/components/Preview/index.js +9 -8
- package/dist/components/UTAttachment/constants.js +13 -7
- package/dist/components/UTAttachment/index.js +250 -159
- package/dist/components/UTAttachment/layout.js +27 -26
- package/dist/components/UTAttachment/theme.js +2 -4
- package/dist/components/UTAttachment/utils.js +117 -34
- package/dist/components/UTAutocomplete/components/ListBox/index.js +21 -13
- package/dist/components/UTAutocomplete/components/ListBox/utils.js +11 -9
- package/dist/components/UTAutocomplete/constants.js +23 -12
- package/dist/components/UTAutocomplete/index.js +94 -54
- package/dist/components/UTAutocomplete/theme.js +4 -6
- package/dist/components/UTAvatar/constants.js +3 -2
- package/dist/components/UTAvatar/index.js +17 -18
- package/dist/components/UTBarChart/components/Bars/components/Bar/components/Rect/index.js +22 -22
- package/dist/components/UTBarChart/components/Bars/components/Bar/constants.js +1 -1
- package/dist/components/UTBarChart/components/Bars/components/Bar/index.js +22 -21
- package/dist/components/UTBarChart/components/Bars/constants.js +6 -3
- package/dist/components/UTBarChart/components/Bars/index.js +80 -70
- package/dist/components/UTBarChart/components/Legend/constants.js +18 -12
- package/dist/components/UTBarChart/components/Legend/index.js +93 -75
- package/dist/components/UTBarChart/components/Legend/utils.js +5 -1
- package/dist/components/UTBarChart/components/Levels/index.js +14 -16
- package/dist/components/UTBarChart/components/Levels/utils.js +27 -25
- package/dist/components/UTBarChart/components/LinearPlot/constants.js +5 -3
- package/dist/components/UTBarChart/components/LinearPlot/index.js +20 -25
- package/dist/components/UTBarChart/components/LinearPlot/utils.js +39 -37
- package/dist/components/UTBarChart/components/Pagination/constants.js +2 -1
- package/dist/components/UTBarChart/components/Pagination/index.js +24 -20
- package/dist/components/UTBarChart/components/XAxis/components/AxisElement/index.js +32 -21
- package/dist/components/UTBarChart/components/XAxis/components/Decoration/constants.js +4 -2
- package/dist/components/UTBarChart/components/XAxis/components/Decoration/index.js +19 -20
- package/dist/components/UTBarChart/components/XAxis/constants.js +2 -1
- package/dist/components/UTBarChart/components/XAxis/index.js +65 -54
- package/dist/components/UTBarChart/components/YAxis/AxisElement/index.js +11 -12
- package/dist/components/UTBarChart/components/YAxis/constants.js +2 -1
- package/dist/components/UTBarChart/components/YAxis/index.js +37 -30
- package/dist/components/UTBarChart/components/YAxis/utils.js +6 -4
- package/dist/components/UTBarChart/constants.js +8 -4
- package/dist/components/UTBarChart/hooks/use-dynamic-margins.js +40 -23
- package/dist/components/UTBarChart/index.js +166 -152
- package/dist/components/UTBarChart/theme.js +2 -4
- package/dist/components/UTBarChart/types.js +19 -10
- package/dist/components/UTBarChart/utils.js +111 -107
- package/dist/components/UTBreadcrumbs/constants.js +31 -23
- package/dist/components/UTBreadcrumbs/index.js +101 -76
- package/dist/components/UTBreadcrumbs/theme.js +2 -4
- package/dist/components/UTButton/constants.js +17 -11
- package/dist/components/UTButton/index.js +31 -28
- package/dist/components/UTButton/theme.js +23 -23
- package/dist/components/UTCBUInput/index.js +40 -36
- package/dist/components/UTCBUInput/theme.js +2 -4
- package/dist/components/UTCaptcha/index.js +45 -19
- package/dist/components/UTCard/components/UTCardFooter/index.js +16 -15
- package/dist/components/UTCard/index.js +120 -85
- package/dist/components/UTCard/theme.js +12 -11
- package/dist/components/UTCard/types.js +3 -2
- package/dist/components/UTCarousel/components/Button/index.js +13 -13
- package/dist/components/UTCarousel/components/Legend/index.js +15 -13
- package/dist/components/UTCarousel/components/Slider/component/Slide/index.js +16 -16
- package/dist/components/UTCarousel/components/Slider/constants.js +10 -5
- package/dist/components/UTCarousel/components/Slider/index.js +273 -204
- package/dist/components/UTCarousel/components/Slider/layout.js +94 -67
- package/dist/components/UTCarousel/index.js +15 -14
- package/dist/components/UTCarousel/theme.js +2 -4
- package/dist/components/UTCheckList/constants.js +2 -1
- package/dist/components/UTCheckList/index.js +93 -72
- package/dist/components/UTCheckList/theme.js +31 -31
- package/dist/components/UTCheckbox/constants.js +6 -3
- package/dist/components/UTCheckbox/index.js +44 -32
- package/dist/components/UTCheckbox/theme.js +35 -35
- package/dist/components/UTConsumptionBar/components/ConsumptionBarIndicator/index.js +9 -9
- package/dist/components/UTConsumptionBar/constants.js +6 -3
- package/dist/components/UTConsumptionBar/index.js +80 -53
- package/dist/components/UTCuit/index.js +133 -109
- package/dist/components/UTCuit/theme.js +53 -51
- package/dist/components/UTDatePicker/components/Day/constants.js +2 -1
- package/dist/components/UTDatePicker/components/Day/index.js +12 -12
- package/dist/components/UTDatePicker/constants.js +31 -20
- package/dist/components/UTDatePicker/index.js +102 -60
- package/dist/components/UTDatePicker/theme.js +3 -5
- package/dist/components/UTDatePicker/types.js +3 -2
- package/dist/components/UTDatePicker/utils.js +6 -2
- package/dist/components/UTDialog/constants.js +4 -2
- package/dist/components/UTDialog/index.js +37 -38
- package/dist/components/UTDialog/theme.js +2 -4
- package/dist/components/UTDialog/types.js +3 -2
- package/dist/components/UTDotMenu/index.js +61 -39
- package/dist/components/UTEmojiPicker/constants.js +11 -6
- package/dist/components/UTEmojiPicker/index.js +65 -45
- package/dist/components/UTEmojiPicker/theme.js +2 -4
- package/dist/components/UTEmojiPicker/utils.js +51 -21
- package/dist/components/UTExternalLink/constants.js +5 -3
- package/dist/components/UTExternalLink/index.js +15 -18
- package/dist/components/UTExternalLink/theme.js +6 -8
- package/dist/components/UTFileInput/constants.js +4 -2
- package/dist/components/UTFileInput/index.js +31 -7
- package/dist/components/UTFileInput/layout.js +97 -68
- package/dist/components/UTIconButton/index.js +72 -49
- package/dist/components/UTIconButton/theme.js +2 -4
- package/dist/components/UTImageRadio/components/ImageRadioCard/index.js +58 -53
- package/dist/components/UTImageRadio/constants.js +6 -3
- package/dist/components/UTImageRadio/index.js +47 -39
- package/dist/components/UTImageRadio/theme.js +12 -11
- package/dist/components/UTImageRadio/types.js +3 -2
- package/dist/components/UTImageRadio/utils.js +6 -2
- package/dist/components/UTLabel/constants.js +20 -14
- package/dist/components/UTLabel/index.js +20 -18
- package/dist/components/UTLabel/theme.js +15 -15
- package/dist/components/UTList/index.js +18 -15
- package/dist/components/UTLoading/index.js +15 -15
- package/dist/components/UTMap/components/GoogleMaps/constants.js +11 -8
- package/dist/components/UTMap/components/GoogleMaps/index.js +91 -63
- package/dist/components/UTMap/components/GoogleMaps/styles.js +3 -2
- package/dist/components/UTMap/constants.js +12 -6
- package/dist/components/UTMap/index.js +198 -163
- package/dist/components/UTMap/types.js +6 -4
- package/dist/components/UTMap/utils.js +46 -29
- package/dist/components/UTMap/withGoogleMapScript.js +22 -18
- package/dist/components/UTMenu/index.js +69 -52
- package/dist/components/UTMenu/theme.js +3 -5
- package/dist/components/UTMenu/utils.js +11 -5
- package/dist/components/UTModal/constants.js +13 -9
- package/dist/components/UTModal/index.js +30 -26
- package/dist/components/UTModal/theme.js +2 -4
- package/dist/components/UTPagination/components/PageSizeSelector/index.js +10 -11
- package/dist/components/UTPagination/components/PageSizeSelector/utils.js +13 -7
- package/dist/components/UTPagination/components/Pagination/components/NavigationButton/index.js +12 -12
- package/dist/components/UTPagination/components/Pagination/index.js +39 -28
- package/dist/components/UTPagination/components/Pagination/utils.js +14 -8
- package/dist/components/UTPagination/constants.js +6 -3
- package/dist/components/UTPagination/index.js +17 -16
- package/dist/components/UTPagination/theme.js +2 -4
- package/dist/components/UTPanel/index.js +44 -38
- package/dist/components/UTPasswordField/components/PasswordValidations/components/Error/index.js +10 -13
- package/dist/components/UTPasswordField/components/PasswordValidations/components/Validation/index.js +19 -22
- package/dist/components/UTPasswordField/components/PasswordValidations/index.js +50 -63
- package/dist/components/UTPasswordField/components/PasswordWarning/index.js +26 -25
- package/dist/components/UTPasswordField/index.js +23 -26
- package/dist/components/UTPasswordField/theme.js +2 -4
- package/dist/components/UTPhoneInput/constants.js +6 -3
- package/dist/components/UTPhoneInput/index.js +205 -180
- package/dist/components/UTPhoneInput/theme.js +77 -77
- package/dist/components/UTPieChart/components/ArrowLabel/constants.js +8 -4
- package/dist/components/UTPieChart/components/ArrowLabel/index.js +23 -24
- package/dist/components/UTPieChart/components/Legend/contants.js +6 -3
- package/dist/components/UTPieChart/components/Legend/index.js +24 -27
- package/dist/components/UTPieChart/constants.js +26 -13
- package/dist/components/UTPieChart/hooks/use-animated-value/index.js +33 -15
- package/dist/components/UTPieChart/index.js +76 -73
- package/dist/components/UTPieChart/theme.js +2 -4
- package/dist/components/UTPieChart/utils.js +2 -4
- package/dist/components/UTProgressBar/constants.js +4 -2
- package/dist/components/UTProgressBar/index.js +17 -15
- package/dist/components/UTProgressBar/theme.js +2 -4
- package/dist/components/UTProgressBar/types.js +3 -2
- package/dist/components/UTRadioGroup/index.js +83 -56
- package/dist/components/UTRadioGroup/theme.js +52 -52
- package/dist/components/UTRating/components/Circle/index.js +56 -41
- package/dist/components/UTRating/components/Faces/constants.js +4 -2
- package/dist/components/UTRating/components/Faces/index.js +36 -34
- package/dist/components/UTRating/components/Star/index.js +40 -36
- package/dist/components/UTRating/constants.js +8 -4
- package/dist/components/UTRating/index.js +46 -31
- package/dist/components/UTRating/theme.js +2 -4
- package/dist/components/UTRipple/Ripple.js +39 -22
- package/dist/components/UTRipple/index.js +37 -18
- package/dist/components/UTSelect/components/Option/index.js +13 -13
- package/dist/components/UTSelect/constants.js +8 -4
- package/dist/components/UTSelect/index.js +85 -63
- package/dist/components/UTSelect/stylesJS.js +3 -2
- package/dist/components/UTSelect/theme.js +4 -6
- package/dist/components/UTSelect/utils.js +13 -3
- package/dist/components/UTSidebar/components/ListOption/index.js +49 -34
- package/dist/components/UTSidebar/components/LogosContainer/components/DynamicIcon/index.js +8 -8
- package/dist/components/UTSidebar/components/LogosContainer/index.js +14 -14
- package/dist/components/UTSidebar/components/Option/constants.js +3 -2
- package/dist/components/UTSidebar/components/Option/index.js +32 -28
- package/dist/components/UTSidebar/components/Toggler/index.js +11 -11
- package/dist/components/UTSidebar/index.js +53 -42
- package/dist/components/UTSidebar/theme.js +2 -4
- package/dist/components/UTSidebar/types.js +10 -5
- package/dist/components/UTSkeleton/index.js +36 -10
- package/dist/components/UTStatus/constants.js +9 -5
- package/dist/components/UTStatus/index.js +15 -16
- package/dist/components/UTStatus/theme.js +49 -66
- package/dist/components/UTSwitch/constants.js +6 -3
- package/dist/components/UTSwitch/index.js +57 -42
- package/dist/components/UTSwitch/theme.js +2 -4
- package/dist/components/UTTable/components/ActionIcons/constants.js +2 -1
- package/dist/components/UTTable/components/ActionIcons/index.js +85 -47
- package/dist/components/UTTable/components/Cell/components/ActionButton/index.js +12 -10
- package/dist/components/UTTable/components/Cell/index.js +23 -18
- package/dist/components/UTTable/components/HeaderCell/constants.js +3 -2
- package/dist/components/UTTable/components/HeaderCell/index.js +30 -23
- package/dist/components/UTTable/components/HeaderCell/utils.js +3 -3
- package/dist/components/UTTable/components/PrimaryAction/index.js +11 -12
- package/dist/components/UTTable/components/ResponsiveCell/index.js +20 -19
- package/dist/components/UTTable/components/Status/index.js +19 -18
- package/dist/components/UTTable/components/TableFooter/components/PageSizeSelector/index.js +9 -10
- package/dist/components/UTTable/components/TableFooter/components/PageSizeSelector/utils.js +13 -7
- package/dist/components/UTTable/components/TableFooter/components/Pagination/components/NavigationButton/index.js +12 -12
- package/dist/components/UTTable/components/TableFooter/components/Pagination/index.js +32 -21
- package/dist/components/UTTable/components/TableFooter/components/Pagination/utils.js +14 -8
- package/dist/components/UTTable/components/TableFooter/constants.js +2 -1
- package/dist/components/UTTable/components/TableFooter/index.js +15 -15
- package/dist/components/UTTable/components/TableHeader/index.js +11 -11
- package/dist/components/UTTable/components/TableRow/constants.js +6 -3
- package/dist/components/UTTable/components/TableRow/index.js +94 -79
- package/dist/components/UTTable/constants.js +43 -26
- package/dist/components/UTTable/hook.js +26 -11
- package/dist/components/UTTable/index.js +223 -132
- package/dist/components/UTTable/theme.js +17 -17
- package/dist/components/UTTable/types.js +8 -4
- package/dist/components/UTTable/utils.js +74 -70
- package/dist/components/UTTabs/components/TooltipTab/index.js +30 -20
- package/dist/components/UTTabs/constants.js +8 -4
- package/dist/components/UTTabs/index.js +86 -57
- package/dist/components/UTTabs/theme.js +2 -4
- package/dist/components/UTTabs/utils.js +1 -1
- package/dist/components/UTTextArea/constants.js +6 -3
- package/dist/components/UTTextArea/index.js +23 -23
- package/dist/components/UTTextArea/theme.js +2 -4
- package/dist/components/UTTextInput/constants.js +3 -2
- package/dist/components/UTTextInput/index.js +165 -137
- package/dist/components/UTTextInput/theme.js +4 -6
- package/dist/components/UTThirdPartyCookieChecker/index.js +21 -17
- package/dist/components/UTToggle/components/ToggleOption/index.js +17 -16
- package/dist/components/UTToggle/index.js +26 -25
- package/dist/components/UTToggle/theme.js +2 -4
- package/dist/components/UTTooltip/index.js +30 -23
- package/dist/components/UTTooltip/theme.js +2 -4
- package/dist/components/UTTopbar/components/Notifications/index.js +14 -11
- package/dist/components/UTTopbar/components/UserMenu/index.js +15 -15
- package/dist/components/UTTopbar/index.js +31 -28
- package/dist/components/UTTopbar/theme.js +2 -4
- package/dist/components/UTTopbar/types.js +9 -5
- package/dist/components/UTTouchableWithoutFeedback/index.js +27 -14
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/constants.js +4 -2
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/index.js +31 -34
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/utils.js +4 -4
- package/dist/components/UTVirtualizedList/components/VirtualizedData/constants.js +12 -6
- package/dist/components/UTVirtualizedList/components/VirtualizedData/hooks/use-ledger.js +18 -8
- package/dist/components/UTVirtualizedList/components/VirtualizedData/hooks/use-virtualized-data.js +47 -23
- package/dist/components/UTVirtualizedList/components/VirtualizedData/index.js +34 -31
- package/dist/components/UTVirtualizedList/components/VirtualizedData/utils.js +93 -81
- package/dist/components/UTVirtualizedList/constants.js +8 -4
- package/dist/components/UTVirtualizedList/index.js +38 -26
- package/dist/components/UTWorkflowContainer/components/ActionButton/index.js +21 -17
- package/dist/components/UTWorkflowContainer/constants.js +6 -3
- package/dist/components/UTWorkflowContainer/hooks/use-previous.js +3 -3
- package/dist/components/UTWorkflowContainer/index.js +51 -32
- package/dist/components/UTWorkflowContainer/theme.js +53 -60
- package/dist/components/UTWorkflowContainer/types.js +3 -2
- package/dist/components/WithLoading/index.js +15 -10
- package/dist/components/WithTheme/index.js +17 -10
- package/dist/components/WithTheme/layout.js +28 -22
- package/dist/components/WithTouch/index.js +19 -12
- package/dist/constants/UTTable.js +3 -2
- package/dist/index.js +58 -58
- package/dist/theme.js +5 -6
- package/dist/types/commonTypes.js +5 -3
- package/dist/types/consumptionTypes.js +5 -3
- package/dist/types/formTypes.js +7 -4
- package/dist/types/tableTypes.js +3 -2
- package/dist/utils/classesUtils.js +13 -5
- package/dist/utils/componentUtils.js +13 -10
- package/dist/utils/helperFunctions.js +4 -4
- package/dist/utils/shadowUtils.js +11 -13
- package/dist/utils/useScreenSize.js +3 -2
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
@@ -14,55 +15,76 @@ var _WithTheme = _interopRequireDefault(require("../WithTheme"));
|
|
|
14
15
|
var _theme = require("./theme");
|
|
15
16
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
16
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
function _getRequireWildcardCache(
|
|
18
|
-
function _interopRequireWildcard(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const size = small ? 'small' : large ? 'large' : 'medium';
|
|
39
|
-
const classNames = (0, _style.retrieveClassNamesFromProps)(variants, classes, this.props);
|
|
40
|
-
return loading ? /*#__PURE__*/_react.default.createElement("div", {
|
|
41
|
-
className: "".concat(_stylesModule.default.loadingContainer, " ").concat(loadingClassName)
|
|
42
|
-
}, /*#__PURE__*/_react.default.createElement(_CircularProgress.default, {
|
|
43
|
-
size: 24,
|
|
44
|
-
className: classes.loading
|
|
45
|
-
})) : imgSrc ? /*#__PURE__*/_react.default.createElement(_UTTouchableWithoutFeedback.default, {
|
|
46
|
-
onClick: onClick,
|
|
47
|
-
className: classes.imgIcon,
|
|
48
|
-
withRipple: true
|
|
49
|
-
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
50
|
-
src: imgSrc,
|
|
51
|
-
alt: "",
|
|
52
|
-
className: imgClassName
|
|
53
|
-
})) : /*#__PURE__*/_react.default.createElement(_IconButton.default, {
|
|
54
|
-
onClick: onClick,
|
|
55
|
-
disabled: disabled || loading,
|
|
56
|
-
size: size,
|
|
57
|
-
type: type,
|
|
58
|
-
autoFocus: autoFocus,
|
|
59
|
-
style: style,
|
|
60
|
-
classes: {
|
|
61
|
-
root: "".concat(classNames, " ").concat(small ? classes.small : large && classes.large, " ").concat(className)
|
|
62
|
-
}
|
|
63
|
-
}, children);
|
|
18
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
20
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
21
|
+
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); } }
|
|
22
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
23
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
24
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
25
|
+
function _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); }
|
|
26
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
27
|
+
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); }; }
|
|
28
|
+
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); }
|
|
29
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
30
|
+
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; } }
|
|
31
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
32
|
+
var variants = ['base', 'primary', 'secondary', 'alternative', 'gray', 'disabled'];
|
|
33
|
+
var UTIconButton = /*#__PURE__*/function (_Component) {
|
|
34
|
+
_inherits(UTIconButton, _Component);
|
|
35
|
+
var _super = _createSuper(UTIconButton);
|
|
36
|
+
function UTIconButton() {
|
|
37
|
+
_classCallCheck(this, UTIconButton);
|
|
38
|
+
return _super.apply(this, arguments);
|
|
64
39
|
}
|
|
65
|
-
|
|
40
|
+
_createClass(UTIconButton, [{
|
|
41
|
+
key: "render",
|
|
42
|
+
value: function render() {
|
|
43
|
+
var _this$props = this.props,
|
|
44
|
+
type = _this$props.type,
|
|
45
|
+
onClick = _this$props.onClick,
|
|
46
|
+
disabled = _this$props.disabled,
|
|
47
|
+
loading = _this$props.loading,
|
|
48
|
+
small = _this$props.small,
|
|
49
|
+
large = _this$props.large,
|
|
50
|
+
classes = _this$props.classes,
|
|
51
|
+
className = _this$props.className,
|
|
52
|
+
children = _this$props.children,
|
|
53
|
+
autoFocus = _this$props.autoFocus,
|
|
54
|
+
imgSrc = _this$props.imgSrc,
|
|
55
|
+
imgClassName = _this$props.imgClassName,
|
|
56
|
+
style = _this$props.style,
|
|
57
|
+
loadingClassName = _this$props.loadingClassName;
|
|
58
|
+
var size = small ? 'small' : large ? 'large' : 'medium';
|
|
59
|
+
var classNames = (0, _style.retrieveClassNamesFromProps)(variants, classes, this.props);
|
|
60
|
+
return loading ? /*#__PURE__*/_react.default.createElement("div", {
|
|
61
|
+
className: "".concat(_stylesModule.default.loadingContainer, " ").concat(loadingClassName)
|
|
62
|
+
}, /*#__PURE__*/_react.default.createElement(_CircularProgress.default, {
|
|
63
|
+
size: 24,
|
|
64
|
+
className: classes.loading
|
|
65
|
+
})) : imgSrc ? /*#__PURE__*/_react.default.createElement(_UTTouchableWithoutFeedback.default, {
|
|
66
|
+
onClick: onClick,
|
|
67
|
+
className: classes.imgIcon,
|
|
68
|
+
withRipple: true
|
|
69
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
70
|
+
src: imgSrc,
|
|
71
|
+
alt: "",
|
|
72
|
+
className: imgClassName
|
|
73
|
+
})) : /*#__PURE__*/_react.default.createElement(_IconButton.default, {
|
|
74
|
+
onClick: onClick,
|
|
75
|
+
disabled: disabled || loading,
|
|
76
|
+
size: size,
|
|
77
|
+
type: type,
|
|
78
|
+
autoFocus: autoFocus,
|
|
79
|
+
style: style,
|
|
80
|
+
classes: {
|
|
81
|
+
root: "".concat(classNames, " ").concat(small ? classes.small : large && classes.large, " ").concat(className)
|
|
82
|
+
}
|
|
83
|
+
}, children);
|
|
84
|
+
}
|
|
85
|
+
}]);
|
|
86
|
+
return UTIconButton;
|
|
87
|
+
}(_react.Component);
|
|
66
88
|
UTIconButton.propTypes = {
|
|
67
89
|
small: _propTypes.bool,
|
|
68
90
|
large: _propTypes.bool,
|
|
@@ -77,4 +99,5 @@ UTIconButton.propTypes = {
|
|
|
77
99
|
imgClassName: _propTypes.string,
|
|
78
100
|
loadingClassName: _propTypes.string
|
|
79
101
|
};
|
|
80
|
-
var _default =
|
|
102
|
+
var _default = (0, _WithTheme.default)(_theme.retrieveStyle)(UTIconButton);
|
|
103
|
+
exports.default = _default;
|
|
@@ -5,10 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.retrieveStyle = void 0;
|
|
7
7
|
var _seamlessImmutable = require("seamless-immutable");
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
theme
|
|
11
|
-
} = _ref;
|
|
8
|
+
var retrieveStyle = function retrieveStyle(_ref) {
|
|
9
|
+
var theme = _ref.theme;
|
|
12
10
|
return {
|
|
13
11
|
base: {
|
|
14
12
|
backgroundColor: (0, _seamlessImmutable.getIn)(theme, ['UTIconButton', 'base', 'backgroundColor']),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
@@ -12,58 +13,61 @@ var _UTTouchableWithoutFeedback = _interopRequireDefault(require("../../../UTTou
|
|
|
12
13
|
var _types = require("../../types");
|
|
13
14
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
14
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
function _getRequireWildcardCache(
|
|
16
|
-
function _interopRequireWildcard(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
option = {},
|
|
20
|
-
compact,
|
|
21
|
-
oneColumn,
|
|
22
|
-
isSelected,
|
|
23
|
-
onChange,
|
|
24
|
-
classes,
|
|
25
|
-
disabled,
|
|
26
|
-
variant =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
configuration = {}
|
|
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
|
-
|
|
16
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
18
|
+
var ImageRadioCard = function ImageRadioCard(_ref) {
|
|
19
|
+
var _ref$option = _ref.option,
|
|
20
|
+
option = _ref$option === void 0 ? {} : _ref$option,
|
|
21
|
+
compact = _ref.compact,
|
|
22
|
+
oneColumn = _ref.oneColumn,
|
|
23
|
+
isSelected = _ref.isSelected,
|
|
24
|
+
onChange = _ref.onChange,
|
|
25
|
+
classes = _ref.classes,
|
|
26
|
+
disabled = _ref.disabled,
|
|
27
|
+
_ref$variant = _ref.variant,
|
|
28
|
+
variant = _ref$variant === void 0 ? {} : _ref$variant;
|
|
29
|
+
var value = option.value,
|
|
30
|
+
name = option.name,
|
|
31
|
+
_option$configuration = option.configuration,
|
|
32
|
+
configuration = _option$configuration === void 0 ? {} : _option$configuration;
|
|
33
|
+
var transparent = variant.transparent_background,
|
|
34
|
+
vertical = variant.vertical;
|
|
35
|
+
var imageUrl = configuration.image_url,
|
|
36
|
+
selectedImageUrl = configuration.selected_image_url,
|
|
37
|
+
UnselectedImageComponent = configuration.UnselectedImageComponent,
|
|
38
|
+
SelectedImageComponent = configuration.SelectedImageComponent,
|
|
39
|
+
tooltip = configuration.tooltip,
|
|
40
|
+
description = configuration.description;
|
|
41
|
+
var handleOnChange = function handleOnChange() {
|
|
42
|
+
return onChange(value);
|
|
43
|
+
};
|
|
44
|
+
var ImageComponent = isSelected && SelectedImageComponent || UnselectedImageComponent;
|
|
45
|
+
var renderImage = (0, _react.useMemo)(function () {
|
|
46
|
+
return function (selected) {
|
|
47
|
+
return selected && selectedImageUrl ? /*#__PURE__*/_react.default.createElement("img", {
|
|
48
|
+
alt: "imageRadioSelected",
|
|
49
|
+
src: selectedImageUrl
|
|
50
|
+
}) : /*#__PURE__*/_react.default.createElement("img", {
|
|
51
|
+
alt: "imageRadioUnselected",
|
|
52
|
+
src: imageUrl
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
}, [imageUrl, selectedImageUrl]);
|
|
56
|
+
var Content = function Content() {
|
|
57
|
+
return /*#__PURE__*/_react.default.createElement(_UTTouchableWithoutFeedback.default, {
|
|
58
|
+
className: "".concat(_stylesModule.default.container, " ").concat(classes.containerCard, " ").concat(isSelected && "".concat(_stylesModule.default.isSelected, " ").concat(classes.isSelected), " ").concat(oneColumn && _stylesModule.default.oneColumn, " ").concat(compact && _stylesModule.default.compact, " ").concat(disabled && _stylesModule.default.disabled, " ").concat(transparent && _stylesModule.default.transparent, " ").concat(vertical && classes.vertical, " ").concat(tooltip && _stylesModule.default.contentWithTooltip, " "),
|
|
59
|
+
onClick: handleOnChange
|
|
60
|
+
}, (imageUrl || ImageComponent) && /*#__PURE__*/_react.default.createElement("div", {
|
|
61
|
+
className: "".concat(classes.image, " ").concat(_stylesModule.default.image)
|
|
62
|
+
}, imageUrl && renderImage(isSelected), ImageComponent && /*#__PURE__*/_react.default.createElement(ImageComponent, null)), /*#__PURE__*/_react.default.createElement("div", {
|
|
63
|
+
className: "".concat(_stylesModule.default.containerText, " ").concat(classes.containerText)
|
|
64
|
+
}, /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
65
|
+
className: "".concat(classes.name, " ").concat(_stylesModule.default.text, " ").concat(isSelected && !transparent && classes.selectedText)
|
|
66
|
+
}, name), description && /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
67
|
+
weight: "light",
|
|
68
|
+
className: "".concat(classes.description, " ").concat(_stylesModule.default.text, " ").concat(isSelected && _stylesModule.default.selectedText)
|
|
69
|
+
}, description)));
|
|
70
|
+
};
|
|
67
71
|
return tooltip ? /*#__PURE__*/_react.default.createElement(_UTTooltip.default, {
|
|
68
72
|
content: tooltip,
|
|
69
73
|
tippyProps: {
|
|
@@ -86,4 +90,5 @@ ImageRadioCard.propTypes = {
|
|
|
86
90
|
}),
|
|
87
91
|
classes: (0, _propTypes.objectOf)(_propTypes.string)
|
|
88
92
|
};
|
|
89
|
-
var _default =
|
|
93
|
+
var _default = /*#__PURE__*/(0, _react.memo)(ImageRadioCard);
|
|
94
|
+
exports.default = _default;
|
|
@@ -4,6 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.validPaddings = exports.defaultGridGap = exports.DEFAULT_ONE_COLUMN_BREAKPOINT = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
var DEFAULT_ONE_COLUMN_BREAKPOINT = 1000;
|
|
8
|
+
exports.DEFAULT_ONE_COLUMN_BREAKPOINT = DEFAULT_ONE_COLUMN_BREAKPOINT;
|
|
9
|
+
var validPaddings = [16, 24];
|
|
10
|
+
exports.validPaddings = validPaddings;
|
|
11
|
+
var defaultGridGap = 16;
|
|
12
|
+
exports.defaultGridGap = defaultGridGap;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
@@ -19,47 +20,53 @@ var _utils = require("./utils");
|
|
|
19
20
|
var _constants = require("./constants");
|
|
20
21
|
var _types = require("./types");
|
|
21
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
22
|
-
function _getRequireWildcardCache(
|
|
23
|
-
function _interopRequireWildcard(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
23
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
24
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
26
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
27
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
28
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
29
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
30
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
31
|
+
var UTImageRadio = function UTImageRadio(_ref) {
|
|
32
|
+
var _ref$oneColumnBreakpo = _ref.oneColumnBreakpoint,
|
|
33
|
+
oneColumnBreakpoint = _ref$oneColumnBreakpo === void 0 ? _constants.DEFAULT_ONE_COLUMN_BREAKPOINT : _ref$oneColumnBreakpo,
|
|
34
|
+
oneColumn = _ref.oneColumn,
|
|
35
|
+
leftAligned = _ref.leftAligned,
|
|
36
|
+
compact = _ref.compact,
|
|
37
|
+
_ref$input = _ref.input,
|
|
38
|
+
input = _ref$input === void 0 ? {} : _ref$input,
|
|
39
|
+
field = _ref.field,
|
|
40
|
+
meta = _ref.meta,
|
|
41
|
+
_ref$options = _ref.options,
|
|
42
|
+
options = _ref$options === void 0 ? [] : _ref$options,
|
|
43
|
+
disabled = _ref.disabled,
|
|
44
|
+
classNames = _ref.classNames,
|
|
45
|
+
themeClasses = _ref.classes;
|
|
46
|
+
var mutableOptions = _toConsumableArray(options);
|
|
47
|
+
var value = input.value,
|
|
48
|
+
onChange = input.onChange;
|
|
49
|
+
var _useComponentDimensio = (0, _energyHooks.useComponentDimensions)(),
|
|
50
|
+
containerRef = _useComponentDimensio.ref,
|
|
51
|
+
containerWidth = _useComponentDimensio.width;
|
|
52
|
+
var alignToLeft = leftAligned || (field === null || field === void 0 ? void 0 : field.configuration.left_aligned);
|
|
53
|
+
var classes = (0, _classesUtils.mergeClasses)(themeClasses, classNames);
|
|
49
54
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
50
55
|
ref: containerRef,
|
|
51
56
|
className: "".concat(_stylesModule.default.container, " ").concat(classes.container, " ").concat(alignToLeft && _stylesModule.default.leftAligned)
|
|
52
|
-
}, mutableOptions.sort(_utils.sortOptions).map(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
57
|
+
}, mutableOptions.sort(_utils.sortOptions).map(function (item) {
|
|
58
|
+
return /*#__PURE__*/_react.default.createElement(_ImageRadioCard.default, {
|
|
59
|
+
key: item.value,
|
|
60
|
+
option: item,
|
|
61
|
+
variant: field === null || field === void 0 ? void 0 : field.configuration,
|
|
62
|
+
compact: compact,
|
|
63
|
+
disabled: disabled,
|
|
64
|
+
oneColumn: oneColumn || containerWidth < oneColumnBreakpoint,
|
|
65
|
+
isSelected: value === item.value,
|
|
66
|
+
onChange: onChange,
|
|
67
|
+
classes: classes
|
|
68
|
+
});
|
|
69
|
+
})), meta && (0, _form.shouldShowErrors)(meta) && /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
63
70
|
colorTheme: "error",
|
|
64
71
|
className: _stylesModule.default.error,
|
|
65
72
|
variant: "small"
|
|
@@ -78,4 +85,5 @@ UTImageRadio.propTypes = {
|
|
|
78
85
|
classNames: (0, _propTypes.objectOf)(_propTypes.string),
|
|
79
86
|
classes: (0, _propTypes.objectOf)(_propTypes.string)
|
|
80
87
|
};
|
|
81
|
-
var _default =
|
|
88
|
+
var _default = (0, _WithTheme.default)(_theme.retrieveStyle)( /*#__PURE__*/(0, _react.memo)(UTImageRadio));
|
|
89
|
+
exports.default = _default;
|
|
@@ -10,12 +10,14 @@ var _classesUtils = require("../../utils/classesUtils");
|
|
|
10
10
|
var _constants = require("./constants");
|
|
11
11
|
var _utils = require("./utils");
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
13
|
+
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); }
|
|
14
|
+
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; }
|
|
15
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
16
|
+
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); }
|
|
17
|
+
var retrieveStyle = function retrieveStyle(_ref) {
|
|
14
18
|
var _theme$UTImageRadio, _theme$UTImageRadio2, _theme$UTImageRadio3, _theme$UTImageRadio4, _theme$UTImageRadio5, _theme$UTImageRadio6, _theme$UTImageRadio7, _theme$UTImageRadio8, _theme$UTImageRadio9, _theme$UTImageRadio10, _theme$UTImageRadio11;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} = _ref;
|
|
18
|
-
const tabletMobile = (0, _seamlessImmutable.getIn)(theme, ['Media', 'tabletMobile']);
|
|
19
|
+
var theme = _ref.theme;
|
|
20
|
+
var tabletMobile = (0, _seamlessImmutable.getIn)(theme, ['Media', 'tabletMobile']);
|
|
19
21
|
return {
|
|
20
22
|
containerCard: {
|
|
21
23
|
backgroundColor: (0, _seamlessImmutable.getIn)(theme, ['UTImageRadio', 'containerCard', 'backgroundColor'], _colorsModule.default.imageRadioBackground),
|
|
@@ -33,12 +35,11 @@ const retrieveStyle = _ref => {
|
|
|
33
35
|
backgroundColor: (0, _seamlessImmutable.getIn)(theme, ['UTImageRadio', 'isSelected', 'backgroundColor'], _colorsModule.default.blue),
|
|
34
36
|
pointerEvents: (0, _seamlessImmutable.getIn)(theme, ['UTImageRadio', 'isSelected', 'pointerEvents'], 'none')
|
|
35
37
|
},
|
|
36
|
-
containerText: {
|
|
37
|
-
width: (0, _classesUtils.withImportant)((theme === null || theme === void 0 || (_theme$UTImageRadio = theme.UTImageRadio) === null || _theme$UTImageRadio === void 0 || (_theme$UTImageRadio = _theme$UTImageRadio.containerText) === null || _theme$UTImageRadio === void 0 ? void 0 : _theme$UTImageRadio.width) || '100%')
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
},
|
|
38
|
+
containerText: _defineProperty({
|
|
39
|
+
width: (0, _classesUtils.withImportant)((theme === null || theme === void 0 || (_theme$UTImageRadio = theme.UTImageRadio) === null || _theme$UTImageRadio === void 0 || (_theme$UTImageRadio = _theme$UTImageRadio.containerText) === null || _theme$UTImageRadio === void 0 ? void 0 : _theme$UTImageRadio.width) || '100%')
|
|
40
|
+
}, tabletMobile, {
|
|
41
|
+
width: '100%'
|
|
42
|
+
}),
|
|
42
43
|
image: {
|
|
43
44
|
height: (0, _seamlessImmutable.getIn)(theme, ['UTImageRadio', 'image', 'height']),
|
|
44
45
|
width: (0, _seamlessImmutable.getIn)(theme, ['UTImageRadio', 'image', 'width'], '56px')
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.optionType = void 0;
|
|
7
7
|
var _propTypes = require("prop-types");
|
|
8
|
-
|
|
8
|
+
var optionType = (0, _propTypes.shape)({
|
|
9
9
|
configuration: (0, _propTypes.shape)({
|
|
10
10
|
image_url: _propTypes.string,
|
|
11
11
|
selected_image_url: _propTypes.string,
|
|
@@ -15,4 +15,5 @@ const optionType = exports.optionType = (0, _propTypes.shape)({
|
|
|
15
15
|
}),
|
|
16
16
|
value: _propTypes.string,
|
|
17
17
|
name: _propTypes.string
|
|
18
|
-
});
|
|
18
|
+
});
|
|
19
|
+
exports.optionType = optionType;
|
|
@@ -5,7 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.standarizePadding = exports.sortOptions = void 0;
|
|
7
7
|
var _constants = require("./constants");
|
|
8
|
-
|
|
8
|
+
var sortOptions = function sortOptions(a, b) {
|
|
9
|
+
return a.order - b.order;
|
|
10
|
+
};
|
|
9
11
|
exports.sortOptions = sortOptions;
|
|
10
|
-
|
|
12
|
+
var standarizePadding = function standarizePadding(padding) {
|
|
13
|
+
return _constants.validPaddings.includes(padding) || _constants.validPaddings[1];
|
|
14
|
+
};
|
|
11
15
|
exports.standarizePadding = standarizePadding;
|
|
@@ -8,14 +8,15 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
8
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
9
|
/* eslint-disable react/prop-types */
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
var SHADES = {
|
|
12
12
|
shade01: '01',
|
|
13
13
|
shade02: '02',
|
|
14
14
|
shade03: '03',
|
|
15
15
|
shade04: '04',
|
|
16
16
|
shade05: '05'
|
|
17
17
|
};
|
|
18
|
-
|
|
18
|
+
exports.SHADES = SHADES;
|
|
19
|
+
var VARIANTS = {
|
|
19
20
|
title1: 'h1',
|
|
20
21
|
title2: 'h2',
|
|
21
22
|
title3: 'h3',
|
|
@@ -27,7 +28,8 @@ const VARIANTS = exports.VARIANTS = {
|
|
|
27
28
|
th: 'th',
|
|
28
29
|
td: 'td'
|
|
29
30
|
};
|
|
30
|
-
|
|
31
|
+
exports.VARIANTS = VARIANTS;
|
|
32
|
+
var VARIANTS_SIZES = {
|
|
31
33
|
title1: '1.875rem',
|
|
32
34
|
title2: '1.5rem',
|
|
33
35
|
title3: '1.375rem',
|
|
@@ -39,7 +41,8 @@ const VARIANTS_SIZES = exports.VARIANTS_SIZES = {
|
|
|
39
41
|
th: '1rem',
|
|
40
42
|
td: '1rem'
|
|
41
43
|
};
|
|
42
|
-
|
|
44
|
+
exports.VARIANTS_SIZES = VARIANTS_SIZES;
|
|
45
|
+
var VARIANTS_LINE_HEIGHT = {
|
|
43
46
|
title1: '100%',
|
|
44
47
|
title2: '100%',
|
|
45
48
|
title3: '100%',
|
|
@@ -51,7 +54,8 @@ const VARIANTS_LINE_HEIGHT = exports.VARIANTS_LINE_HEIGHT = {
|
|
|
51
54
|
th: '1.375rem',
|
|
52
55
|
td: '1.375rem'
|
|
53
56
|
};
|
|
54
|
-
|
|
57
|
+
exports.VARIANTS_LINE_HEIGHT = VARIANTS_LINE_HEIGHT;
|
|
58
|
+
var WEIGHTS = {
|
|
55
59
|
thin: 100,
|
|
56
60
|
extralight: 200,
|
|
57
61
|
light: 300,
|
|
@@ -62,7 +66,8 @@ const WEIGHTS = exports.WEIGHTS = {
|
|
|
62
66
|
extrabold: 800,
|
|
63
67
|
black: 900
|
|
64
68
|
};
|
|
65
|
-
|
|
69
|
+
exports.WEIGHTS = WEIGHTS;
|
|
70
|
+
var COLOR_THEMES = {
|
|
66
71
|
dark: 'dark',
|
|
67
72
|
gray: 'gray',
|
|
68
73
|
light: 'light',
|
|
@@ -71,12 +76,11 @@ const COLOR_THEMES = exports.COLOR_THEMES = {
|
|
|
71
76
|
warning: 'warning',
|
|
72
77
|
information: 'information'
|
|
73
78
|
};
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
children
|
|
79
|
-
} = _ref;
|
|
79
|
+
exports.COLOR_THEMES = COLOR_THEMES;
|
|
80
|
+
var MARKDOWN_RENDERERS = {
|
|
81
|
+
a: function a(_ref) {
|
|
82
|
+
var href = _ref.href,
|
|
83
|
+
children = _ref.children;
|
|
80
84
|
return /*#__PURE__*/_react.default.createElement("a", {
|
|
81
85
|
href: href,
|
|
82
86
|
rel: "noopener noreferrer",
|
|
@@ -84,11 +88,13 @@ const MARKDOWN_RENDERERS = exports.MARKDOWN_RENDERERS = {
|
|
|
84
88
|
}, children);
|
|
85
89
|
}
|
|
86
90
|
};
|
|
87
|
-
|
|
91
|
+
exports.MARKDOWN_RENDERERS = MARKDOWN_RENDERERS;
|
|
92
|
+
var DEFAULT_PROPS = {
|
|
88
93
|
colorTheme: 'dark',
|
|
89
94
|
field: {},
|
|
90
95
|
markdownRenderers: MARKDOWN_RENDERERS,
|
|
91
96
|
variant: 'body',
|
|
92
97
|
weight: 'regular',
|
|
93
98
|
withMarkdown: false
|
|
94
|
-
};
|
|
99
|
+
};
|
|
100
|
+
exports.DEFAULT_PROPS = DEFAULT_PROPS;
|