@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
|
@@ -10,22 +10,11 @@ var _UTLabel = _interopRequireDefault(require("../UTLabel"));
|
|
|
10
10
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
11
11
|
var _constants = require("./constants");
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function
|
|
14
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" !=
|
|
15
|
-
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); }
|
|
16
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
17
|
-
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); } }
|
|
18
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
19
|
-
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); }
|
|
20
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
21
|
-
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); }; }
|
|
22
|
-
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); }
|
|
23
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
24
|
-
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; } }
|
|
25
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
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; }
|
|
26
15
|
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; }
|
|
27
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return
|
|
28
|
-
function _toPrimitive(input, hint) { if (
|
|
16
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
17
|
+
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); }
|
|
29
18
|
var uploadIcon = function uploadIcon(props) {
|
|
30
19
|
return /*#__PURE__*/_react.default.createElement("svg", props, /*#__PURE__*/_react.default.createElement("g", {
|
|
31
20
|
fill: "#4d97fa"
|
|
@@ -36,92 +25,79 @@ var uploadIcon = function uploadIcon(props) {
|
|
|
36
25
|
uploadIcon.defaultProps = {
|
|
37
26
|
xmlns: "http://www.w3.org/2000/svg",
|
|
38
27
|
viewBox: "0 0 414.165 414.165",
|
|
28
|
+
style: {
|
|
29
|
+
enableBackground: "new 0 0 414.165 414.165"
|
|
30
|
+
},
|
|
31
|
+
xmlSpace: "preserve",
|
|
39
32
|
width: "512",
|
|
40
33
|
height: "512"
|
|
41
34
|
};
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
var _this;
|
|
47
|
-
_classCallCheck(this, UTFileInput);
|
|
48
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
49
|
-
args[_key] = arguments[_key];
|
|
50
|
-
}
|
|
51
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
52
|
-
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
35
|
+
class UTFileInput extends _react.PureComponent {
|
|
36
|
+
constructor(props) {
|
|
37
|
+
super(props);
|
|
38
|
+
_defineProperty(this, "handleDragLeave", () => this.setState({
|
|
53
39
|
hasDrag: false
|
|
54
|
-
});
|
|
55
|
-
_defineProperty(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
40
|
+
}));
|
|
41
|
+
_defineProperty(this, "handleDragOver", target => target && this.setState({
|
|
42
|
+
hasDrag: true
|
|
43
|
+
}));
|
|
44
|
+
_defineProperty(this, "handleOnDrop", () => this.setState({
|
|
45
|
+
hasDrag: false
|
|
46
|
+
}));
|
|
47
|
+
this.state = {
|
|
48
|
+
hasDrag: false
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
render() {
|
|
52
|
+
const {
|
|
53
|
+
onChange,
|
|
54
|
+
name,
|
|
55
|
+
label,
|
|
56
|
+
loading,
|
|
57
|
+
fileType,
|
|
58
|
+
error,
|
|
59
|
+
errorText,
|
|
60
|
+
icon: Icon,
|
|
61
|
+
uploadingText,
|
|
62
|
+
classes,
|
|
63
|
+
loadingTextClassname,
|
|
64
|
+
inputClassname,
|
|
65
|
+
errorClassname,
|
|
66
|
+
containerClassname,
|
|
67
|
+
disabled
|
|
68
|
+
} = this.props;
|
|
69
|
+
const UploadImage = uploadIcon;
|
|
70
|
+
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
71
|
+
className: "\n ".concat(_stylesModule.default.inputContainer, "\n ").concat(this.state.hasDrag && _stylesModule.default.inputContainerDrag, "\n ").concat(loading && _stylesModule.default.inputContainerLoading, "\n ").concat(classes.container, "\n ").concat(containerClassname, "\n "),
|
|
72
|
+
onDragLeave: this.handleDragLeave,
|
|
73
|
+
onDragOver: this.handleDragOver,
|
|
74
|
+
onDrop: this.handleOnDrop
|
|
75
|
+
}, loading ? /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
76
|
+
colorTheme: "gray",
|
|
77
|
+
className: "".concat(_stylesModule.default.loadingLabel, " ").concat(loadingTextClassname)
|
|
78
|
+
}, uploadingText), /*#__PURE__*/_react.default.createElement("div", {
|
|
79
|
+
className: _stylesModule.default.loading
|
|
80
|
+
})) : /*#__PURE__*/_react.default.createElement("div", {
|
|
81
|
+
className: _stylesModule.default.insideContainer
|
|
82
|
+
}, Icon || /*#__PURE__*/_react.default.createElement(UploadImage, {
|
|
83
|
+
className: "".concat(_stylesModule.default.icon, " ").concat(classes.icon)
|
|
84
|
+
}), /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
85
|
+
variant: "small",
|
|
86
|
+
className: "".concat(_stylesModule.default.label, " ").concat(classes.fileInputLabel)
|
|
87
|
+
}, label)), /*#__PURE__*/_react.default.createElement("input", {
|
|
88
|
+
className: "".concat(_stylesModule.default.input, " ").concat(inputClassname),
|
|
89
|
+
accept: fileType,
|
|
90
|
+
type: "file",
|
|
91
|
+
onChange: onChange,
|
|
92
|
+
name: name,
|
|
93
|
+
disabled: disabled
|
|
94
|
+
})), error && /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
95
|
+
className: errorClassname,
|
|
96
|
+
colorTheme: "error",
|
|
97
|
+
variant: "small"
|
|
98
|
+
}, errorText));
|
|
71
99
|
}
|
|
72
|
-
|
|
73
|
-
key: "render",
|
|
74
|
-
value: function render() {
|
|
75
|
-
var _this$props = this.props,
|
|
76
|
-
onChange = _this$props.onChange,
|
|
77
|
-
name = _this$props.name,
|
|
78
|
-
label = _this$props.label,
|
|
79
|
-
loading = _this$props.loading,
|
|
80
|
-
fileType = _this$props.fileType,
|
|
81
|
-
error = _this$props.error,
|
|
82
|
-
errorText = _this$props.errorText,
|
|
83
|
-
Icon = _this$props.icon,
|
|
84
|
-
uploadingText = _this$props.uploadingText,
|
|
85
|
-
classes = _this$props.classes,
|
|
86
|
-
loadingTextClassname = _this$props.loadingTextClassname,
|
|
87
|
-
inputClassname = _this$props.inputClassname,
|
|
88
|
-
errorClassname = _this$props.errorClassname,
|
|
89
|
-
containerClassname = _this$props.containerClassname,
|
|
90
|
-
disabled = _this$props.disabled;
|
|
91
|
-
var UploadImage = uploadIcon;
|
|
92
|
-
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
93
|
-
className: "\n ".concat(_stylesModule.default.inputContainer, "\n ").concat(this.state.hasDrag && _stylesModule.default.inputContainerDrag, "\n ").concat(loading && _stylesModule.default.inputContainerLoading, "\n ").concat(classes.container, "\n ").concat(containerClassname, "\n "),
|
|
94
|
-
onDragLeave: this.handleDragLeave,
|
|
95
|
-
onDragOver: this.handleDragOver,
|
|
96
|
-
onDrop: this.handleOnDrop
|
|
97
|
-
}, loading ? /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
98
|
-
colorTheme: "gray",
|
|
99
|
-
className: "".concat(_stylesModule.default.loadingLabel, " ").concat(loadingTextClassname)
|
|
100
|
-
}, uploadingText), /*#__PURE__*/_react.default.createElement("div", {
|
|
101
|
-
className: _stylesModule.default.loading
|
|
102
|
-
})) : /*#__PURE__*/_react.default.createElement("div", {
|
|
103
|
-
className: _stylesModule.default.insideContainer
|
|
104
|
-
}, Icon || /*#__PURE__*/_react.default.createElement(UploadImage, {
|
|
105
|
-
className: "".concat(_stylesModule.default.icon, " ").concat(classes.icon)
|
|
106
|
-
}), /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
107
|
-
variant: "small",
|
|
108
|
-
className: "".concat(_stylesModule.default.label, " ").concat(classes.fileInputLabel)
|
|
109
|
-
}, label)), /*#__PURE__*/_react.default.createElement("input", {
|
|
110
|
-
className: "".concat(_stylesModule.default.input, " ").concat(inputClassname),
|
|
111
|
-
accept: fileType,
|
|
112
|
-
type: "file",
|
|
113
|
-
onChange: onChange,
|
|
114
|
-
name: name,
|
|
115
|
-
disabled: disabled
|
|
116
|
-
})), error && /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
117
|
-
className: errorClassname,
|
|
118
|
-
colorTheme: "error",
|
|
119
|
-
variant: "small"
|
|
120
|
-
}, errorText));
|
|
121
|
-
}
|
|
122
|
-
}]);
|
|
123
|
-
return UTFileInput;
|
|
124
|
-
}(_react.PureComponent);
|
|
100
|
+
}
|
|
125
101
|
UTFileInput.defaultProps = {
|
|
126
102
|
label: _constants.SELECT_FILE,
|
|
127
103
|
uploadingText: _constants.UPLOADING
|
|
@@ -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
|
});
|
|
@@ -15,76 +14,55 @@ var _WithTheme = _interopRequireDefault(require("../WithTheme"));
|
|
|
15
14
|
var _theme = require("./theme");
|
|
16
15
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
17
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function
|
|
19
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" !=
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
17
|
+
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); }
|
|
18
|
+
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; }
|
|
19
|
+
const variants = ['base', 'primary', 'secondary', 'alternative', 'gray', 'disabled'];
|
|
20
|
+
class UTIconButton extends _react.Component {
|
|
21
|
+
render() {
|
|
22
|
+
const {
|
|
23
|
+
type,
|
|
24
|
+
onClick,
|
|
25
|
+
disabled,
|
|
26
|
+
loading,
|
|
27
|
+
small,
|
|
28
|
+
large,
|
|
29
|
+
classes,
|
|
30
|
+
className,
|
|
31
|
+
children,
|
|
32
|
+
autoFocus,
|
|
33
|
+
imgSrc,
|
|
34
|
+
imgClassName,
|
|
35
|
+
style,
|
|
36
|
+
loadingClassName
|
|
37
|
+
} = this.props;
|
|
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);
|
|
39
64
|
}
|
|
40
|
-
|
|
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);
|
|
65
|
+
}
|
|
88
66
|
UTIconButton.propTypes = {
|
|
89
67
|
small: _propTypes.bool,
|
|
90
68
|
large: _propTypes.bool,
|
|
@@ -5,8 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.retrieveStyle = void 0;
|
|
7
7
|
var _seamlessImmutable = require("seamless-immutable");
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
const retrieveStyle = _ref => {
|
|
9
|
+
let {
|
|
10
|
+
theme
|
|
11
|
+
} = _ref;
|
|
10
12
|
return {
|
|
11
13
|
base: {
|
|
12
14
|
backgroundColor: (0, _seamlessImmutable.getIn)(theme, ['UTIconButton', 'base', 'backgroundColor']),
|
|
@@ -61,4 +63,5 @@ var retrieveStyle = exports.retrieveStyle = function retrieveStyle(_ref) {
|
|
|
61
63
|
}
|
|
62
64
|
}
|
|
63
65
|
};
|
|
64
|
-
};
|
|
66
|
+
};
|
|
67
|
+
exports.retrieveStyle = retrieveStyle;
|
|
@@ -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
|
});
|
|
@@ -13,61 +12,58 @@ var _UTTouchableWithoutFeedback = _interopRequireDefault(require("../../../UTTou
|
|
|
13
12
|
var _types = require("../../types");
|
|
14
13
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
15
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function
|
|
17
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" !=
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
option =
|
|
21
|
-
compact
|
|
22
|
-
oneColumn
|
|
23
|
-
isSelected
|
|
24
|
-
onChange
|
|
25
|
-
classes
|
|
26
|
-
disabled
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
configuration =
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
className: "".concat(classes.description, " ").concat(_stylesModule.default.text, " ").concat(isSelected && _stylesModule.default.selectedText)
|
|
69
|
-
}, description)));
|
|
70
|
-
};
|
|
15
|
+
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); }
|
|
16
|
+
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; }
|
|
17
|
+
const ImageRadioCard = _ref => {
|
|
18
|
+
let {
|
|
19
|
+
option = {},
|
|
20
|
+
compact,
|
|
21
|
+
oneColumn,
|
|
22
|
+
isSelected,
|
|
23
|
+
onChange,
|
|
24
|
+
classes,
|
|
25
|
+
disabled,
|
|
26
|
+
variant = {}
|
|
27
|
+
} = _ref;
|
|
28
|
+
const {
|
|
29
|
+
value,
|
|
30
|
+
name,
|
|
31
|
+
configuration = {}
|
|
32
|
+
} = option;
|
|
33
|
+
const {
|
|
34
|
+
transparent_background: transparent,
|
|
35
|
+
vertical
|
|
36
|
+
} = variant;
|
|
37
|
+
const {
|
|
38
|
+
image_url: imageUrl,
|
|
39
|
+
selected_image_url: selectedImageUrl,
|
|
40
|
+
UnselectedImageComponent,
|
|
41
|
+
SelectedImageComponent,
|
|
42
|
+
tooltip,
|
|
43
|
+
description
|
|
44
|
+
} = configuration;
|
|
45
|
+
const handleOnChange = () => onChange(value);
|
|
46
|
+
const ImageComponent = isSelected && SelectedImageComponent || UnselectedImageComponent;
|
|
47
|
+
const renderImage = (0, _react.useMemo)(() => selected => 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
|
+
}), [imageUrl, selectedImageUrl]);
|
|
54
|
+
const Content = () => /*#__PURE__*/_react.default.createElement(_UTTouchableWithoutFeedback.default, {
|
|
55
|
+
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, " "),
|
|
56
|
+
onClick: handleOnChange
|
|
57
|
+
}, (imageUrl || ImageComponent) && /*#__PURE__*/_react.default.createElement("div", {
|
|
58
|
+
className: "".concat(classes.image, " ").concat(_stylesModule.default.image)
|
|
59
|
+
}, imageUrl && renderImage(isSelected), ImageComponent && /*#__PURE__*/_react.default.createElement(ImageComponent, null)), /*#__PURE__*/_react.default.createElement("div", {
|
|
60
|
+
className: "".concat(_stylesModule.default.containerText, " ").concat(classes.containerText)
|
|
61
|
+
}, /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
62
|
+
className: "".concat(classes.name, " ").concat(_stylesModule.default.text, " ").concat(isSelected && !transparent && classes.selectedText)
|
|
63
|
+
}, name), description && /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
64
|
+
weight: "light",
|
|
65
|
+
className: "".concat(classes.description, " ").concat(_stylesModule.default.text, " ").concat(isSelected && _stylesModule.default.selectedText)
|
|
66
|
+
}, description)));
|
|
71
67
|
return tooltip ? /*#__PURE__*/_react.default.createElement(_UTTooltip.default, {
|
|
72
68
|
content: tooltip,
|
|
73
69
|
tippyProps: {
|
|
@@ -4,6 +4,6 @@ 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
|
+
const DEFAULT_ONE_COLUMN_BREAKPOINT = exports.DEFAULT_ONE_COLUMN_BREAKPOINT = 1000;
|
|
8
|
+
const validPaddings = exports.validPaddings = [16, 24];
|
|
9
|
+
const defaultGridGap = exports.defaultGridGap = 16;
|
|
@@ -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
|
});
|
|
@@ -20,53 +19,47 @@ var _utils = require("./utils");
|
|
|
20
19
|
var _constants = require("./constants");
|
|
21
20
|
var _types = require("./types");
|
|
22
21
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function
|
|
24
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" !=
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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);
|
|
22
|
+
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); }
|
|
23
|
+
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; }
|
|
24
|
+
const UTImageRadio = _ref => {
|
|
25
|
+
let {
|
|
26
|
+
oneColumnBreakpoint = _constants.DEFAULT_ONE_COLUMN_BREAKPOINT,
|
|
27
|
+
oneColumn,
|
|
28
|
+
leftAligned,
|
|
29
|
+
compact,
|
|
30
|
+
input = {},
|
|
31
|
+
field,
|
|
32
|
+
meta,
|
|
33
|
+
options = [],
|
|
34
|
+
disabled,
|
|
35
|
+
classNames,
|
|
36
|
+
classes: themeClasses
|
|
37
|
+
} = _ref;
|
|
38
|
+
const mutableOptions = [...options];
|
|
39
|
+
const {
|
|
40
|
+
value,
|
|
41
|
+
onChange
|
|
42
|
+
} = input;
|
|
43
|
+
const {
|
|
44
|
+
ref: containerRef,
|
|
45
|
+
width: containerWidth
|
|
46
|
+
} = (0, _energyHooks.useComponentDimensions)();
|
|
47
|
+
const alignToLeft = leftAligned || (field === null || field === void 0 ? void 0 : field.configuration.left_aligned);
|
|
48
|
+
const classes = (0, _classesUtils.mergeClasses)(themeClasses, classNames);
|
|
54
49
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
55
50
|
ref: containerRef,
|
|
56
51
|
className: "".concat(_stylesModule.default.container, " ").concat(classes.container, " ").concat(alignToLeft && _stylesModule.default.leftAligned)
|
|
57
|
-
}, mutableOptions.sort(_utils.sortOptions).map(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
});
|
|
69
|
-
})), meta && (0, _form.shouldShowErrors)(meta) && /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
52
|
+
}, mutableOptions.sort(_utils.sortOptions).map(item => /*#__PURE__*/_react.default.createElement(_ImageRadioCard.default, {
|
|
53
|
+
key: item.value,
|
|
54
|
+
option: item,
|
|
55
|
+
variant: field === null || field === void 0 ? void 0 : field.configuration,
|
|
56
|
+
compact: compact,
|
|
57
|
+
disabled: disabled,
|
|
58
|
+
oneColumn: oneColumn || containerWidth < oneColumnBreakpoint,
|
|
59
|
+
isSelected: value === item.value,
|
|
60
|
+
onChange: onChange,
|
|
61
|
+
classes: classes
|
|
62
|
+
}))), meta && (0, _form.shouldShowErrors)(meta) && /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
70
63
|
colorTheme: "error",
|
|
71
64
|
className: _stylesModule.default.error,
|
|
72
65
|
variant: "small"
|