@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
|
@@ -20,154 +20,179 @@ var _UTLabel = _interopRequireDefault(require("../UTLabel"));
|
|
|
20
20
|
var _constants = require("./constants");
|
|
21
21
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
22
22
|
var _theme = require("./theme");
|
|
23
|
+
var _excluded = ["adornmentInside", "autofocus", "bigInput", "captionLabel", "classes", "containerClassName", "disabled", "field", "id", "input", "inputClassName", "inputObjectKey", "label", "labelRootClassName", "meta", "onChangeText", "PasswordInvisibleIcon", "PasswordVisibleIcon", "placeholder", "preventEnterSubmit", "preventFocus", "tippyProps", "tooltip", "type", "variant"],
|
|
24
|
+
_excluded2 = ["base", "selectedOptionsIds", "retrieveStyle", "retrieveMuiTheme", "Component", "muiTheme"];
|
|
23
25
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
|
-
function _getRequireWildcardCache(
|
|
25
|
-
function _interopRequireWildcard(
|
|
26
|
+
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); }
|
|
27
|
+
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; }
|
|
28
|
+
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); }
|
|
26
29
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
30
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
31
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
32
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
33
|
+
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); } }
|
|
34
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
35
|
+
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); }
|
|
36
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
37
|
+
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); }; }
|
|
38
|
+
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); }
|
|
39
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
40
|
+
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; } }
|
|
41
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
27
42
|
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; }
|
|
28
|
-
function _toPropertyKey(
|
|
29
|
-
function _toPrimitive(
|
|
30
|
-
|
|
43
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
44
|
+
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); }
|
|
45
|
+
var preventDefault = function preventDefault(event) {
|
|
31
46
|
if (event.key === 'Enter') {
|
|
32
47
|
event.preventDefault();
|
|
33
48
|
}
|
|
34
49
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
50
|
+
var UTTextInput = /*#__PURE__*/function (_PureComponent) {
|
|
51
|
+
_inherits(UTTextInput, _PureComponent);
|
|
52
|
+
var _super = _createSuper(UTTextInput);
|
|
53
|
+
function UTTextInput() {
|
|
54
|
+
var _this;
|
|
55
|
+
_classCallCheck(this, UTTextInput);
|
|
56
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
57
|
+
args[_key] = arguments[_key];
|
|
58
|
+
}
|
|
59
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
60
|
+
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
39
61
|
visible: false
|
|
40
62
|
});
|
|
41
|
-
_defineProperty(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
63
|
+
_defineProperty(_assertThisInitialized(_this), "handleClickShowPassword", function () {
|
|
64
|
+
_this.setState(function (prevState) {
|
|
65
|
+
return {
|
|
66
|
+
visible: !prevState.visible
|
|
67
|
+
};
|
|
68
|
+
});
|
|
45
69
|
});
|
|
70
|
+
return _this;
|
|
46
71
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
};
|
|
86
|
-
const {
|
|
87
|
-
icon: Icon,
|
|
88
|
-
outsideIcon,
|
|
89
|
-
adornment,
|
|
90
|
-
helperText
|
|
91
|
-
} = (field === null || field === void 0 ? void 0 : field.configuration) || {};
|
|
92
|
-
|
|
93
|
-
// TODO. These props were forwarded to the inner dom element and they were
|
|
94
|
-
// causing errors and warnings. I quit them from the "..." spread to TextField.
|
|
95
|
-
// Deeper analysis should be done when refactoring the component to match
|
|
96
|
-
// design requirements.
|
|
97
|
-
const {
|
|
98
|
-
base,
|
|
99
|
-
selectedOptionsIds,
|
|
100
|
-
retrieveStyle: rs,
|
|
101
|
-
retrieveMuiTheme: rmt,
|
|
102
|
-
Component,
|
|
103
|
-
muiTheme,
|
|
104
|
-
...textFieldPropsToForward
|
|
105
|
-
} = others;
|
|
106
|
-
const endAction = type === _constants.INPUT_TYPES.PASSWORD ? /*#__PURE__*/_react.default.createElement(_UTButton.default, {
|
|
107
|
-
Icon: this.state.visible ? PasswordVisibleIcon : PasswordInvisibleIcon,
|
|
108
|
-
onClick: this.handleClickShowPassword,
|
|
109
|
-
variant: "text"
|
|
110
|
-
}) : adornment;
|
|
111
|
-
const value = inputObjectKey ? input.value[inputObjectKey] : input.value;
|
|
112
|
-
const errorMessage = (0, _form.shouldShowErrors)(meta) && meta.error || captionLabel || '';
|
|
113
|
-
const TextInput = /*#__PURE__*/_react.default.createElement(_TextField.default, _extends({
|
|
114
|
-
id: id || '',
|
|
115
|
-
placeholder: placeholder,
|
|
116
|
-
variant: variant,
|
|
117
|
-
label: Icon ? /*#__PURE__*/_react.default.createElement("div", {
|
|
118
|
-
className: classes.labelContainer
|
|
119
|
-
}, /*#__PURE__*/_react.default.createElement(Icon, {
|
|
120
|
-
className: classes.labelIcon
|
|
121
|
-
}), /*#__PURE__*/_react.default.createElement("div", null, label)) : label,
|
|
122
|
-
onKeyPress: preventEnterSubmit ? preventDefault : undefined,
|
|
123
|
-
error: (0, _form.shouldShowErrors)(meta),
|
|
124
|
-
FormHelperTextProps: {
|
|
125
|
-
component: 'div'
|
|
126
|
-
},
|
|
127
|
-
helperText: errorMessage || helperText ? /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
128
|
-
className: _stylesModule.default.helperText,
|
|
129
|
-
colorTheme: errorMessage ? 'error' : 'gray',
|
|
130
|
-
variant: "small",
|
|
131
|
-
withMarkdown: true
|
|
132
|
-
}, errorMessage || helperText) : undefined,
|
|
133
|
-
disabled: disabled,
|
|
134
|
-
onChange: handleChange,
|
|
135
|
-
onClick: handleClick,
|
|
136
|
-
value: value,
|
|
137
|
-
fullWidth: true,
|
|
138
|
-
autoFocus: autofocus,
|
|
139
|
-
margin: "none",
|
|
140
|
-
autoComplete: "off",
|
|
141
|
-
InputProps: {
|
|
142
|
-
endAdornment: endAction && /*#__PURE__*/_react.default.createElement(_InputAdornment.default, {
|
|
143
|
-
position: "end",
|
|
144
|
-
className: "".concat(adornmentInside && _stylesModule.default.adornmentInside)
|
|
145
|
-
}, endAction),
|
|
146
|
-
type: type === _constants.INPUT_TYPES.PASSWORD ? !this.state.visible ? _constants.INPUT_TYPES.PASSWORD : _constants.INPUT_TYPES.TEXT : type || _constants.INPUT_TYPES.TEXT,
|
|
147
|
-
classes: {
|
|
148
|
-
input: "\n ".concat(bigInput && classes.bigInput, "\n ").concat(type === _constants.INPUT_TYPES.NUMBER && _stylesModule.default.numberType, "\n ").concat(inputClassName, "\n ")
|
|
72
|
+
_createClass(UTTextInput, [{
|
|
73
|
+
key: "render",
|
|
74
|
+
value: function render() {
|
|
75
|
+
var _this$props = this.props,
|
|
76
|
+
adornmentInside = _this$props.adornmentInside,
|
|
77
|
+
autofocus = _this$props.autofocus,
|
|
78
|
+
bigInput = _this$props.bigInput,
|
|
79
|
+
captionLabel = _this$props.captionLabel,
|
|
80
|
+
classes = _this$props.classes,
|
|
81
|
+
containerClassName = _this$props.containerClassName,
|
|
82
|
+
disabled = _this$props.disabled,
|
|
83
|
+
field = _this$props.field,
|
|
84
|
+
id = _this$props.id,
|
|
85
|
+
input = _this$props.input,
|
|
86
|
+
inputClassName = _this$props.inputClassName,
|
|
87
|
+
inputObjectKey = _this$props.inputObjectKey,
|
|
88
|
+
label = _this$props.label,
|
|
89
|
+
labelRootClassName = _this$props.labelRootClassName,
|
|
90
|
+
meta = _this$props.meta,
|
|
91
|
+
onChangeText = _this$props.onChangeText,
|
|
92
|
+
PasswordInvisibleIcon = _this$props.PasswordInvisibleIcon,
|
|
93
|
+
PasswordVisibleIcon = _this$props.PasswordVisibleIcon,
|
|
94
|
+
placeholder = _this$props.placeholder,
|
|
95
|
+
preventEnterSubmit = _this$props.preventEnterSubmit,
|
|
96
|
+
preventFocus = _this$props.preventFocus,
|
|
97
|
+
tippyProps = _this$props.tippyProps,
|
|
98
|
+
tooltip = _this$props.tooltip,
|
|
99
|
+
type = _this$props.type,
|
|
100
|
+
variant = _this$props.variant,
|
|
101
|
+
others = _objectWithoutProperties(_this$props, _excluded);
|
|
102
|
+
var handleChange = function handleChange(event) {
|
|
103
|
+
if (preventFocus) event.preventDefault();
|
|
104
|
+
input.onChange(onChangeText(event.target.value));
|
|
105
|
+
};
|
|
106
|
+
var handleClick = function handleClick(event) {
|
|
107
|
+
if (preventFocus) {
|
|
108
|
+
event.preventDefault();
|
|
109
|
+
event.target.blur();
|
|
149
110
|
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
111
|
+
};
|
|
112
|
+
var _ref = (field === null || field === void 0 ? void 0 : field.configuration) || {},
|
|
113
|
+
Icon = _ref.icon,
|
|
114
|
+
outsideIcon = _ref.outsideIcon,
|
|
115
|
+
adornment = _ref.adornment,
|
|
116
|
+
helperText = _ref.helperText;
|
|
117
|
+
|
|
118
|
+
// TODO. These props were forwarded to the inner dom element and they were
|
|
119
|
+
// causing errors and warnings. I quit them from the "..." spread to TextField.
|
|
120
|
+
// Deeper analysis should be done when refactoring the component to match
|
|
121
|
+
// design requirements.
|
|
122
|
+
var base = others.base,
|
|
123
|
+
selectedOptionsIds = others.selectedOptionsIds,
|
|
124
|
+
rs = others.retrieveStyle,
|
|
125
|
+
rmt = others.retrieveMuiTheme,
|
|
126
|
+
Component = others.Component,
|
|
127
|
+
muiTheme = others.muiTheme,
|
|
128
|
+
textFieldPropsToForward = _objectWithoutProperties(others, _excluded2);
|
|
129
|
+
var endAction = type === _constants.INPUT_TYPES.PASSWORD ? /*#__PURE__*/_react.default.createElement(_UTButton.default, {
|
|
130
|
+
Icon: this.state.visible ? PasswordVisibleIcon : PasswordInvisibleIcon,
|
|
131
|
+
onClick: this.handleClickShowPassword,
|
|
132
|
+
variant: "text"
|
|
133
|
+
}) : adornment;
|
|
134
|
+
var value = inputObjectKey ? input.value[inputObjectKey] : input.value;
|
|
135
|
+
var errorMessage = (0, _form.shouldShowErrors)(meta) && meta.error || captionLabel || '';
|
|
136
|
+
var TextInput = /*#__PURE__*/_react.default.createElement(_TextField.default, _extends({
|
|
137
|
+
id: id || '',
|
|
138
|
+
placeholder: placeholder,
|
|
139
|
+
variant: variant,
|
|
140
|
+
label: Icon ? /*#__PURE__*/_react.default.createElement("div", {
|
|
141
|
+
className: classes.labelContainer
|
|
142
|
+
}, /*#__PURE__*/_react.default.createElement(Icon, {
|
|
143
|
+
className: classes.labelIcon
|
|
144
|
+
}), /*#__PURE__*/_react.default.createElement("div", null, label)) : label,
|
|
145
|
+
onKeyPress: preventEnterSubmit ? preventDefault : undefined,
|
|
146
|
+
error: (0, _form.shouldShowErrors)(meta),
|
|
147
|
+
FormHelperTextProps: {
|
|
148
|
+
component: 'div'
|
|
149
|
+
},
|
|
150
|
+
helperText: errorMessage || helperText ? /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
151
|
+
className: _stylesModule.default.helperText,
|
|
152
|
+
colorTheme: errorMessage ? 'error' : 'gray',
|
|
153
|
+
variant: "small",
|
|
154
|
+
withMarkdown: true
|
|
155
|
+
}, errorMessage || helperText) : undefined,
|
|
156
|
+
disabled: disabled,
|
|
157
|
+
onChange: handleChange,
|
|
158
|
+
onClick: handleClick,
|
|
159
|
+
value: value,
|
|
160
|
+
fullWidth: true,
|
|
161
|
+
autoFocus: autofocus,
|
|
162
|
+
margin: "none",
|
|
163
|
+
autoComplete: "off",
|
|
164
|
+
InputProps: {
|
|
165
|
+
endAdornment: endAction && /*#__PURE__*/_react.default.createElement(_InputAdornment.default, {
|
|
166
|
+
position: "end",
|
|
167
|
+
className: "".concat(adornmentInside && _stylesModule.default.adornmentInside)
|
|
168
|
+
}, endAction),
|
|
169
|
+
type: type === _constants.INPUT_TYPES.PASSWORD ? !this.state.visible ? _constants.INPUT_TYPES.PASSWORD : _constants.INPUT_TYPES.TEXT : type || _constants.INPUT_TYPES.TEXT,
|
|
170
|
+
classes: {
|
|
171
|
+
input: "\n ".concat(bigInput && classes.bigInput, "\n ").concat(type === _constants.INPUT_TYPES.NUMBER && _stylesModule.default.numberType, "\n ").concat(inputClassName, "\n ")
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
InputLabelProps: {
|
|
175
|
+
classes: {
|
|
176
|
+
root: labelRootClassName
|
|
177
|
+
}
|
|
154
178
|
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
179
|
+
}, textFieldPropsToForward));
|
|
180
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
181
|
+
className: "".concat(classes.container, " ").concat(containerClassName, " ").concat(tooltip && _stylesModule.default.containerWithTooltip)
|
|
182
|
+
}, tooltip ? /*#__PURE__*/_react.default.createElement(_react.Fragment, null, TextInput, /*#__PURE__*/_react.default.createElement(_UTTooltip.default, {
|
|
183
|
+
tippyProps: tippyProps,
|
|
184
|
+
content: tooltip
|
|
185
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
186
|
+
className: _stylesModule.default.tooltipIconContainer
|
|
187
|
+
}, /*#__PURE__*/_react.default.createElement(_HelpOutline.default, {
|
|
188
|
+
className: "".concat(classes.tooltipIcon, " ").concat(_stylesModule.default.tooltipIcon)
|
|
189
|
+
})))) : /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/(0, _react.isValidElement)(outsideIcon) && /*#__PURE__*/_react.default.createElement("div", {
|
|
190
|
+
className: _stylesModule.default.iconContainer
|
|
191
|
+
}, outsideIcon), TextInput));
|
|
192
|
+
}
|
|
193
|
+
}]);
|
|
194
|
+
return UTTextInput;
|
|
195
|
+
}(_react.PureComponent);
|
|
171
196
|
UTTextInput.propTypes = {
|
|
172
197
|
adornmentInside: _propTypes.bool,
|
|
173
198
|
autofocus: _propTypes.bool,
|
|
@@ -200,9 +225,12 @@ UTTextInput.defaultProps = {
|
|
|
200
225
|
autofocus: false,
|
|
201
226
|
classes: {},
|
|
202
227
|
meta: {},
|
|
203
|
-
onChangeText: val
|
|
228
|
+
onChangeText: function onChangeText(val) {
|
|
229
|
+
return val;
|
|
230
|
+
},
|
|
204
231
|
PasswordInvisibleIcon: _VisibilityOff.default,
|
|
205
232
|
PasswordVisibleIcon: _Visibility.default,
|
|
206
233
|
preventEnterSubmit: false
|
|
207
234
|
};
|
|
208
|
-
var _default =
|
|
235
|
+
var _default = (0, _WithTheme.default)(_theme.retrieveStyle, _theme.retrieveMuiTheme)(UTTextInput);
|
|
236
|
+
exports.default = _default;
|
|
@@ -9,10 +9,8 @@ var _styles = require("@material-ui/core/styles");
|
|
|
9
9
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
10
10
|
var _colorsModule = _interopRequireDefault(require("../../scss/variables/colors.module.scss"));
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
theme
|
|
15
|
-
} = _ref;
|
|
12
|
+
var retrieveStyle = function retrieveStyle(_ref) {
|
|
13
|
+
var theme = _ref.theme;
|
|
16
14
|
return {
|
|
17
15
|
container: {
|
|
18
16
|
display: (0, _seamlessImmutable.getIn)(theme, ['UTTextInput', 'container', 'display'], 'flex'),
|
|
@@ -41,8 +39,8 @@ const retrieveStyle = _ref => {
|
|
|
41
39
|
};
|
|
42
40
|
};
|
|
43
41
|
exports.retrieveStyle = retrieveStyle;
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
var retrieveMuiTheme = function retrieveMuiTheme(theme, muiTheme) {
|
|
43
|
+
var mui = {
|
|
46
44
|
typography: {
|
|
47
45
|
fontFamily: (0, _seamlessImmutable.getIn)(theme, ['Fonts', 'fontFamily'])
|
|
48
46
|
},
|
|
@@ -1,36 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.default = void 0;
|
|
7
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
9
|
var _propTypes = require("prop-types");
|
|
9
|
-
function _getRequireWildcardCache(
|
|
10
|
-
function _interopRequireWildcard(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const iframeRef = (0, _react.useRef)(null);
|
|
21
|
-
const handleCallback = event => {
|
|
10
|
+
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); }
|
|
11
|
+
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; }
|
|
12
|
+
var DEFAULT_IFRAME_SRC = 'https://mindmup.github.io/3rdpartycookiecheck/start.html';
|
|
13
|
+
var DEFAULT_IFRAME_TITLE = 'UTThirdPartyCookieChecker';
|
|
14
|
+
var UTThirdPartyCookieChecker = function UTThirdPartyCookieChecker(_ref) {
|
|
15
|
+
var disabledCallback = _ref.disabledCallback,
|
|
16
|
+
enabledCallback = _ref.enabledCallback,
|
|
17
|
+
iframeSrc = _ref.iframeSrc,
|
|
18
|
+
iframeTitle = _ref.iframeTitle;
|
|
19
|
+
var iframeRef = (0, _react.useRef)(null);
|
|
20
|
+
var handleCallback = function handleCallback(event) {
|
|
22
21
|
if (event.data === 'MM:3PCsupported' && enabledCallback) {
|
|
23
22
|
return enabledCallback();
|
|
24
23
|
}
|
|
25
24
|
if (event.data === 'MM:3PCunsupported' && disabledCallback) {
|
|
26
25
|
return disabledCallback();
|
|
27
26
|
}
|
|
28
|
-
return ()
|
|
27
|
+
return function () {
|
|
28
|
+
return undefined;
|
|
29
|
+
};
|
|
29
30
|
};
|
|
30
|
-
(0, _react.useEffect)(()
|
|
31
|
+
(0, _react.useEffect)(function () {
|
|
31
32
|
window.addEventListener('message', handleCallback, false);
|
|
32
33
|
iframeRef.current.src = iframeSrc || DEFAULT_IFRAME_SRC;
|
|
33
|
-
return ()
|
|
34
|
+
return function () {
|
|
35
|
+
return window.removeEventListener('message', handleCallback, false);
|
|
36
|
+
};
|
|
34
37
|
}, []);
|
|
35
38
|
return /*#__PURE__*/_react.default.createElement("iframe", {
|
|
36
39
|
ref: iframeRef,
|
|
@@ -46,4 +49,5 @@ UTThirdPartyCookieChecker.propTypes = {
|
|
|
46
49
|
iframeSrc: _propTypes.string,
|
|
47
50
|
iframeTitle: _propTypes.string
|
|
48
51
|
};
|
|
49
|
-
var _default =
|
|
52
|
+
var _default = /*#__PURE__*/(0, _react.memo)(UTThirdPartyCookieChecker);
|
|
53
|
+
exports.default = _default;
|
|
@@ -9,21 +9,21 @@ var _propTypes = require("prop-types");
|
|
|
9
9
|
var _UTTouchableWithoutFeedback = _interopRequireDefault(require("../../../UTTouchableWithoutFeedback"));
|
|
10
10
|
var _UTLabel = _interopRequireDefault(require("../../../UTLabel"));
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
12
|
+
var ToggleOption = function ToggleOption(_ref) {
|
|
13
|
+
var value = _ref.value,
|
|
14
|
+
onChange = _ref.onChange,
|
|
15
|
+
label = _ref.label,
|
|
16
|
+
isSelected = _ref.isSelected,
|
|
17
|
+
Icon = _ref.Icon,
|
|
18
|
+
SelectedIcon = _ref.SelectedIcon,
|
|
19
|
+
keyName = _ref.keyName,
|
|
20
|
+
className = _ref.className,
|
|
21
|
+
iconClassName = _ref.iconClassName,
|
|
22
|
+
classes = _ref.classes;
|
|
23
|
+
var onHandleClick = function onHandleClick() {
|
|
24
|
+
return onChange(value);
|
|
25
|
+
};
|
|
26
|
+
var IconComponent = Icon && (SelectedIcon && isSelected ? /*#__PURE__*/_react.default.createElement(SelectedIcon, {
|
|
27
27
|
className: "".concat(classes.icon, " ").concat(iconClassName)
|
|
28
28
|
}) : /*#__PURE__*/_react.default.createElement(Icon, {
|
|
29
29
|
className: "".concat(classes.icon, " ").concat(isSelected ? classes.selectedIcon : classes.unselectedIcon, " ").concat(iconClassName)
|
|
@@ -49,4 +49,5 @@ ToggleOption.propTypes = {
|
|
|
49
49
|
iconClassName: _propTypes.string,
|
|
50
50
|
classes: (0, _propTypes.objectOf)(_propTypes.string)
|
|
51
51
|
};
|
|
52
|
-
var _default =
|
|
52
|
+
var _default = ToggleOption;
|
|
53
|
+
exports.default = _default;
|
|
@@ -10,32 +10,32 @@ var _WithTheme = _interopRequireDefault(require("../WithTheme"));
|
|
|
10
10
|
var _ToggleOption = _interopRequireDefault(require("./components/ToggleOption"));
|
|
11
11
|
var _theme = require("./theme");
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
} = _ref;
|
|
23
|
-
const containerStyle = "".concat(classes.container, " ").concat(orientation === 'horizontal' ? classes.horizontalContainer : classes.verticalContainer, " ").concat(className, " ");
|
|
13
|
+
var UTToggle = function UTToggle(_ref) {
|
|
14
|
+
var options = _ref.options,
|
|
15
|
+
selectedOption = _ref.selectedOption,
|
|
16
|
+
onChangeOption = _ref.onChangeOption,
|
|
17
|
+
className = _ref.className,
|
|
18
|
+
optionClassName = _ref.optionClassName,
|
|
19
|
+
orientation = _ref.orientation,
|
|
20
|
+
classes = _ref.classes;
|
|
21
|
+
var containerStyle = "".concat(classes.container, " ").concat(orientation === 'horizontal' ? classes.horizontalContainer : classes.verticalContainer, " ").concat(className, " ");
|
|
24
22
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
25
23
|
className: containerStyle
|
|
26
|
-
}, options.map(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
24
|
+
}, options.map(function (option) {
|
|
25
|
+
return /*#__PURE__*/_react.default.createElement(_ToggleOption.default, {
|
|
26
|
+
key: option.key,
|
|
27
|
+
value: option.value,
|
|
28
|
+
label: option.label,
|
|
29
|
+
Icon: option.Icon,
|
|
30
|
+
SelectedIcon: option.SelectedIcon,
|
|
31
|
+
isSelected: option.value === selectedOption,
|
|
32
|
+
onChange: onChangeOption,
|
|
33
|
+
keyName: "toggle-option-".concat(option.value),
|
|
34
|
+
className: optionClassName,
|
|
35
|
+
iconClassName: option.iconClassName,
|
|
36
|
+
classes: classes
|
|
37
|
+
});
|
|
38
|
+
}));
|
|
39
39
|
};
|
|
40
40
|
UTToggle.propTypes = {
|
|
41
41
|
options: (0, _propTypes.arrayOf)((0, _propTypes.shape)({
|
|
@@ -53,4 +53,5 @@ UTToggle.propTypes = {
|
|
|
53
53
|
optionClassName: _propTypes.string,
|
|
54
54
|
orientation: _propTypes.string
|
|
55
55
|
};
|
|
56
|
-
var _default =
|
|
56
|
+
var _default = (0, _WithTheme.default)(_theme.retrieveStyle)(UTToggle);
|
|
57
|
+
exports.default = _default;
|
|
@@ -7,10 +7,8 @@ exports.retrieveStyle = void 0;
|
|
|
7
7
|
var _seamlessImmutable = require("seamless-immutable");
|
|
8
8
|
var _colorsModule = _interopRequireDefault(require("../../scss/variables/colors.module.scss"));
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
theme
|
|
13
|
-
} = _ref;
|
|
10
|
+
var retrieveStyle = function retrieveStyle(_ref) {
|
|
11
|
+
var theme = _ref.theme;
|
|
14
12
|
return {
|
|
15
13
|
container: {
|
|
16
14
|
alignItems: (0, _seamlessImmutable.getIn)(theme, ['UTToggle', 'container', 'alignItems'], 'center'),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
@@ -15,29 +16,34 @@ var _classesUtils = require("../../utils/classesUtils");
|
|
|
15
16
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
16
17
|
var _theme = require("./theme");
|
|
17
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
|
-
function _getRequireWildcardCache(
|
|
19
|
-
function _interopRequireWildcard(
|
|
19
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
20
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
20
21
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
arrow = true,
|
|
24
|
-
children,
|
|
25
|
-
classes
|
|
26
|
-
className,
|
|
27
|
-
content,
|
|
28
|
-
duration =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
22
|
+
var UTTooltip = function UTTooltip(_ref) {
|
|
23
|
+
var _ref$arrow = _ref.arrow,
|
|
24
|
+
arrow = _ref$arrow === void 0 ? true : _ref$arrow,
|
|
25
|
+
children = _ref.children,
|
|
26
|
+
themeStyles = _ref.classes,
|
|
27
|
+
className = _ref.className,
|
|
28
|
+
content = _ref.content,
|
|
29
|
+
_ref$duration = _ref.duration,
|
|
30
|
+
duration = _ref$duration === void 0 ? [600, 350] : _ref$duration,
|
|
31
|
+
forceArrow = _ref.forceArrow,
|
|
32
|
+
_ref$hideOnClick = _ref.hideOnClick,
|
|
33
|
+
hideOnClick = _ref$hideOnClick === void 0 ? false : _ref$hideOnClick,
|
|
34
|
+
_ref$inertia = _ref.inertia,
|
|
35
|
+
inertia = _ref$inertia === void 0 ? true : _ref$inertia,
|
|
36
|
+
_ref$interactive = _ref.interactive,
|
|
37
|
+
interactive = _ref$interactive === void 0 ? true : _ref$interactive,
|
|
38
|
+
stringContentClassName = _ref.stringContentClassName,
|
|
39
|
+
stringContentProps = _ref.stringContentProps,
|
|
40
|
+
tippyProps = _ref.tippyProps;
|
|
41
|
+
var theme = (0, _react.useMemo)(function () {
|
|
42
|
+
return (0, _classesUtils.mergeClasses)(themeStyles, {
|
|
43
|
+
container: className,
|
|
44
|
+
stringContent: stringContentClassName
|
|
45
|
+
});
|
|
46
|
+
}, [className, stringContentClassName]);
|
|
41
47
|
if (!content) return children;
|
|
42
48
|
return /*#__PURE__*/_react.default.createElement(_react2.default, _extends({
|
|
43
49
|
animation: "shift-toward",
|
|
@@ -71,4 +77,5 @@ UTTooltip.propTypes = {
|
|
|
71
77
|
stringContentProps: _propTypes.object,
|
|
72
78
|
tippyProps: _propTypes.object
|
|
73
79
|
};
|
|
74
|
-
var _default =
|
|
80
|
+
var _default = (0, _WithTheme.default)(_theme.retrieveStyle)(UTTooltip);
|
|
81
|
+
exports.default = _default;
|