@widergy/energy-ui 2.12.1 → 2.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/EnergyThemeProvider/index.js +36 -13
- package/dist/components/Loading/constants.js +2 -1
- package/dist/components/Loading/index.js +12 -13
- package/dist/components/Loading/theme.js +2 -4
- package/dist/components/UTAlert/AlertHandler.js +101 -75
- package/dist/components/UTAlert/index.js +87 -65
- package/dist/components/UTAlert/theme.js +32 -32
- package/dist/components/UTAttachment/components/Preview/index.js +9 -8
- package/dist/components/UTAttachment/constants.js +13 -7
- package/dist/components/UTAttachment/index.js +250 -159
- package/dist/components/UTAttachment/layout.js +27 -26
- package/dist/components/UTAttachment/theme.js +2 -4
- package/dist/components/UTAttachment/utils.js +117 -34
- package/dist/components/UTAutocomplete/components/ListBox/index.js +21 -13
- package/dist/components/UTAutocomplete/components/ListBox/utils.js +11 -9
- package/dist/components/UTAutocomplete/constants.js +23 -12
- package/dist/components/UTAutocomplete/index.js +94 -54
- package/dist/components/UTAutocomplete/theme.js +4 -6
- package/dist/components/UTAvatar/constants.js +3 -2
- package/dist/components/UTAvatar/index.js +17 -18
- package/dist/components/UTBarChart/components/Bars/components/Bar/components/Rect/index.js +22 -22
- package/dist/components/UTBarChart/components/Bars/components/Bar/constants.js +1 -1
- package/dist/components/UTBarChart/components/Bars/components/Bar/index.js +22 -21
- package/dist/components/UTBarChart/components/Bars/constants.js +6 -3
- package/dist/components/UTBarChart/components/Bars/index.js +80 -70
- package/dist/components/UTBarChart/components/Legend/constants.js +18 -12
- package/dist/components/UTBarChart/components/Legend/index.js +93 -75
- package/dist/components/UTBarChart/components/Legend/utils.js +5 -1
- package/dist/components/UTBarChart/components/Levels/index.js +14 -16
- package/dist/components/UTBarChart/components/Levels/utils.js +27 -25
- package/dist/components/UTBarChart/components/LinearPlot/constants.js +5 -3
- package/dist/components/UTBarChart/components/LinearPlot/index.js +20 -25
- package/dist/components/UTBarChart/components/LinearPlot/utils.js +39 -37
- package/dist/components/UTBarChart/components/Pagination/constants.js +2 -1
- package/dist/components/UTBarChart/components/Pagination/index.js +24 -20
- package/dist/components/UTBarChart/components/XAxis/components/AxisElement/index.js +32 -21
- package/dist/components/UTBarChart/components/XAxis/components/Decoration/constants.js +4 -2
- package/dist/components/UTBarChart/components/XAxis/components/Decoration/index.js +19 -20
- package/dist/components/UTBarChart/components/XAxis/constants.js +2 -1
- package/dist/components/UTBarChart/components/XAxis/index.js +65 -54
- package/dist/components/UTBarChart/components/YAxis/AxisElement/index.js +11 -12
- package/dist/components/UTBarChart/components/YAxis/constants.js +2 -1
- package/dist/components/UTBarChart/components/YAxis/index.js +37 -30
- package/dist/components/UTBarChart/components/YAxis/utils.js +6 -4
- package/dist/components/UTBarChart/constants.js +8 -4
- package/dist/components/UTBarChart/hooks/use-dynamic-margins.js +40 -23
- package/dist/components/UTBarChart/index.js +166 -152
- package/dist/components/UTBarChart/theme.js +2 -4
- package/dist/components/UTBarChart/types.js +19 -10
- package/dist/components/UTBarChart/utils.js +111 -107
- package/dist/components/UTBreadcrumbs/constants.js +31 -23
- package/dist/components/UTBreadcrumbs/index.js +101 -76
- package/dist/components/UTBreadcrumbs/theme.js +2 -4
- package/dist/components/UTButton/constants.js +17 -11
- package/dist/components/UTButton/index.js +31 -28
- package/dist/components/UTButton/theme.js +23 -23
- package/dist/components/UTCBUInput/index.js +40 -36
- package/dist/components/UTCBUInput/theme.js +2 -4
- package/dist/components/UTCaptcha/index.js +45 -19
- package/dist/components/UTCard/components/UTCardFooter/index.js +16 -15
- package/dist/components/UTCard/index.js +120 -85
- package/dist/components/UTCard/theme.js +12 -11
- package/dist/components/UTCard/types.js +3 -2
- package/dist/components/UTCarousel/components/Button/index.js +13 -13
- package/dist/components/UTCarousel/components/Legend/index.js +15 -13
- package/dist/components/UTCarousel/components/Slider/component/Slide/index.js +16 -16
- package/dist/components/UTCarousel/components/Slider/constants.js +10 -5
- package/dist/components/UTCarousel/components/Slider/index.js +273 -204
- package/dist/components/UTCarousel/components/Slider/layout.js +94 -67
- package/dist/components/UTCarousel/index.js +15 -14
- package/dist/components/UTCarousel/theme.js +2 -4
- package/dist/components/UTCheckList/constants.js +2 -1
- package/dist/components/UTCheckList/index.js +93 -72
- package/dist/components/UTCheckList/theme.js +31 -31
- package/dist/components/UTCheckbox/constants.js +6 -3
- package/dist/components/UTCheckbox/index.js +44 -32
- package/dist/components/UTCheckbox/theme.js +35 -35
- package/dist/components/UTConsumptionBar/components/ConsumptionBarIndicator/index.js +9 -9
- package/dist/components/UTConsumptionBar/constants.js +6 -3
- package/dist/components/UTConsumptionBar/index.js +80 -53
- package/dist/components/UTCuit/index.js +133 -109
- package/dist/components/UTCuit/theme.js +53 -51
- package/dist/components/UTDatePicker/components/Day/constants.js +2 -1
- package/dist/components/UTDatePicker/components/Day/index.js +12 -12
- package/dist/components/UTDatePicker/constants.js +31 -20
- package/dist/components/UTDatePicker/index.js +102 -60
- package/dist/components/UTDatePicker/theme.js +3 -5
- package/dist/components/UTDatePicker/types.js +3 -2
- package/dist/components/UTDatePicker/utils.js +6 -2
- package/dist/components/UTDialog/constants.js +4 -2
- package/dist/components/UTDialog/index.js +37 -38
- package/dist/components/UTDialog/theme.js +2 -4
- package/dist/components/UTDialog/types.js +3 -2
- package/dist/components/UTDotMenu/index.js +61 -39
- package/dist/components/UTEmojiPicker/constants.js +11 -6
- package/dist/components/UTEmojiPicker/index.js +65 -45
- package/dist/components/UTEmojiPicker/theme.js +2 -4
- package/dist/components/UTEmojiPicker/utils.js +51 -21
- package/dist/components/UTExternalLink/constants.js +5 -3
- package/dist/components/UTExternalLink/index.js +15 -18
- package/dist/components/UTExternalLink/theme.js +6 -8
- package/dist/components/UTFileInput/constants.js +4 -2
- package/dist/components/UTFileInput/index.js +31 -7
- package/dist/components/UTFileInput/layout.js +97 -68
- package/dist/components/UTIconButton/index.js +72 -49
- package/dist/components/UTIconButton/theme.js +2 -4
- package/dist/components/UTImageRadio/components/ImageRadioCard/index.js +58 -53
- package/dist/components/UTImageRadio/constants.js +6 -3
- package/dist/components/UTImageRadio/index.js +47 -39
- package/dist/components/UTImageRadio/theme.js +12 -11
- package/dist/components/UTImageRadio/types.js +3 -2
- package/dist/components/UTImageRadio/utils.js +6 -2
- package/dist/components/UTLabel/constants.js +20 -14
- package/dist/components/UTLabel/index.js +20 -18
- package/dist/components/UTLabel/theme.js +15 -15
- package/dist/components/UTList/index.js +18 -15
- package/dist/components/UTLoading/index.js +15 -15
- package/dist/components/UTMap/components/GoogleMaps/constants.js +11 -8
- package/dist/components/UTMap/components/GoogleMaps/index.js +91 -63
- package/dist/components/UTMap/components/GoogleMaps/styles.js +3 -2
- package/dist/components/UTMap/constants.js +12 -6
- package/dist/components/UTMap/index.js +198 -163
- package/dist/components/UTMap/types.js +6 -4
- package/dist/components/UTMap/utils.js +46 -29
- package/dist/components/UTMap/withGoogleMapScript.js +22 -18
- package/dist/components/UTMenu/index.js +69 -52
- package/dist/components/UTMenu/theme.js +3 -5
- package/dist/components/UTMenu/utils.js +11 -5
- package/dist/components/UTModal/constants.js +13 -9
- package/dist/components/UTModal/index.js +30 -26
- package/dist/components/UTModal/theme.js +2 -4
- package/dist/components/UTPagination/components/PageSizeSelector/index.js +10 -11
- package/dist/components/UTPagination/components/PageSizeSelector/utils.js +13 -7
- package/dist/components/UTPagination/components/Pagination/components/NavigationButton/index.js +12 -12
- package/dist/components/UTPagination/components/Pagination/index.js +39 -28
- package/dist/components/UTPagination/components/Pagination/utils.js +14 -8
- package/dist/components/UTPagination/constants.js +6 -3
- package/dist/components/UTPagination/index.js +17 -16
- package/dist/components/UTPagination/theme.js +2 -4
- package/dist/components/UTPanel/index.js +44 -38
- package/dist/components/UTPasswordField/components/PasswordValidations/components/Error/index.js +10 -13
- package/dist/components/UTPasswordField/components/PasswordValidations/components/Validation/index.js +19 -22
- package/dist/components/UTPasswordField/components/PasswordValidations/index.js +50 -63
- package/dist/components/UTPasswordField/components/PasswordWarning/index.js +26 -25
- package/dist/components/UTPasswordField/index.js +23 -26
- package/dist/components/UTPasswordField/theme.js +2 -4
- package/dist/components/UTPhoneInput/constants.js +6 -3
- package/dist/components/UTPhoneInput/index.js +205 -180
- package/dist/components/UTPhoneInput/theme.js +77 -77
- package/dist/components/UTPieChart/components/ArrowLabel/constants.js +8 -4
- package/dist/components/UTPieChart/components/ArrowLabel/index.js +23 -24
- package/dist/components/UTPieChart/components/Legend/contants.js +6 -3
- package/dist/components/UTPieChart/components/Legend/index.js +24 -27
- package/dist/components/UTPieChart/constants.js +26 -13
- package/dist/components/UTPieChart/hooks/use-animated-value/index.js +33 -15
- package/dist/components/UTPieChart/index.js +76 -73
- package/dist/components/UTPieChart/theme.js +2 -4
- package/dist/components/UTPieChart/utils.js +2 -4
- package/dist/components/UTProgressBar/constants.js +4 -2
- package/dist/components/UTProgressBar/index.js +17 -15
- package/dist/components/UTProgressBar/theme.js +2 -4
- package/dist/components/UTProgressBar/types.js +3 -2
- package/dist/components/UTRadioGroup/index.js +83 -56
- package/dist/components/UTRadioGroup/theme.js +52 -52
- package/dist/components/UTRating/components/Circle/index.js +56 -41
- package/dist/components/UTRating/components/Faces/constants.js +4 -2
- package/dist/components/UTRating/components/Faces/index.js +36 -34
- package/dist/components/UTRating/components/Star/index.js +40 -36
- package/dist/components/UTRating/constants.js +8 -4
- package/dist/components/UTRating/index.js +46 -31
- package/dist/components/UTRating/theme.js +2 -4
- package/dist/components/UTRipple/Ripple.js +39 -22
- package/dist/components/UTRipple/index.js +37 -18
- package/dist/components/UTSelect/components/Option/index.js +13 -13
- package/dist/components/UTSelect/constants.js +8 -4
- package/dist/components/UTSelect/index.js +85 -63
- package/dist/components/UTSelect/stylesJS.js +3 -2
- package/dist/components/UTSelect/theme.js +4 -6
- package/dist/components/UTSelect/utils.js +13 -3
- package/dist/components/UTSidebar/components/ListOption/index.js +49 -34
- package/dist/components/UTSidebar/components/LogosContainer/components/DynamicIcon/index.js +8 -8
- package/dist/components/UTSidebar/components/LogosContainer/index.js +14 -14
- package/dist/components/UTSidebar/components/Option/constants.js +3 -2
- package/dist/components/UTSidebar/components/Option/index.js +32 -28
- package/dist/components/UTSidebar/components/Toggler/index.js +11 -11
- package/dist/components/UTSidebar/index.js +53 -42
- package/dist/components/UTSidebar/theme.js +2 -4
- package/dist/components/UTSidebar/types.js +10 -5
- package/dist/components/UTSkeleton/index.js +36 -10
- package/dist/components/UTStatus/constants.js +9 -5
- package/dist/components/UTStatus/index.js +15 -16
- package/dist/components/UTStatus/theme.js +49 -66
- package/dist/components/UTSwitch/constants.js +6 -3
- package/dist/components/UTSwitch/index.js +57 -42
- package/dist/components/UTSwitch/theme.js +2 -4
- package/dist/components/UTTable/components/ActionIcons/constants.js +2 -1
- package/dist/components/UTTable/components/ActionIcons/index.js +85 -47
- package/dist/components/UTTable/components/Cell/components/ActionButton/index.js +12 -10
- package/dist/components/UTTable/components/Cell/index.js +23 -18
- package/dist/components/UTTable/components/HeaderCell/constants.js +3 -2
- package/dist/components/UTTable/components/HeaderCell/index.js +30 -23
- package/dist/components/UTTable/components/HeaderCell/utils.js +3 -3
- package/dist/components/UTTable/components/PrimaryAction/index.js +11 -12
- package/dist/components/UTTable/components/ResponsiveCell/index.js +20 -19
- package/dist/components/UTTable/components/Status/index.js +19 -18
- package/dist/components/UTTable/components/TableFooter/components/PageSizeSelector/index.js +9 -10
- package/dist/components/UTTable/components/TableFooter/components/PageSizeSelector/utils.js +13 -7
- package/dist/components/UTTable/components/TableFooter/components/Pagination/components/NavigationButton/index.js +12 -12
- package/dist/components/UTTable/components/TableFooter/components/Pagination/index.js +32 -21
- package/dist/components/UTTable/components/TableFooter/components/Pagination/utils.js +14 -8
- package/dist/components/UTTable/components/TableFooter/constants.js +2 -1
- package/dist/components/UTTable/components/TableFooter/index.js +15 -15
- package/dist/components/UTTable/components/TableHeader/index.js +11 -11
- package/dist/components/UTTable/components/TableRow/constants.js +6 -3
- package/dist/components/UTTable/components/TableRow/index.js +94 -79
- package/dist/components/UTTable/constants.js +43 -26
- package/dist/components/UTTable/hook.js +26 -11
- package/dist/components/UTTable/index.js +223 -132
- package/dist/components/UTTable/theme.js +17 -17
- package/dist/components/UTTable/types.js +8 -4
- package/dist/components/UTTable/utils.js +74 -70
- package/dist/components/UTTabs/components/TooltipTab/index.js +30 -20
- package/dist/components/UTTabs/constants.js +8 -4
- package/dist/components/UTTabs/index.js +86 -57
- package/dist/components/UTTabs/theme.js +2 -4
- package/dist/components/UTTabs/utils.js +1 -1
- package/dist/components/UTTextArea/constants.js +6 -3
- package/dist/components/UTTextArea/index.js +23 -23
- package/dist/components/UTTextArea/theme.js +2 -4
- package/dist/components/UTTextInput/constants.js +3 -2
- package/dist/components/UTTextInput/index.js +165 -137
- package/dist/components/UTTextInput/theme.js +4 -6
- package/dist/components/UTThirdPartyCookieChecker/index.js +21 -17
- package/dist/components/UTToggle/components/ToggleOption/index.js +17 -16
- package/dist/components/UTToggle/index.js +26 -25
- package/dist/components/UTToggle/theme.js +2 -4
- package/dist/components/UTTooltip/index.js +30 -23
- package/dist/components/UTTooltip/theme.js +2 -4
- package/dist/components/UTTopbar/components/Notifications/index.js +14 -11
- package/dist/components/UTTopbar/components/UserMenu/index.js +15 -15
- package/dist/components/UTTopbar/index.js +31 -28
- package/dist/components/UTTopbar/theme.js +2 -4
- package/dist/components/UTTopbar/types.js +9 -5
- package/dist/components/UTTouchableWithoutFeedback/index.js +27 -14
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/constants.js +4 -2
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/index.js +31 -34
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/utils.js +4 -4
- package/dist/components/UTVirtualizedList/components/VirtualizedData/constants.js +12 -6
- package/dist/components/UTVirtualizedList/components/VirtualizedData/hooks/use-ledger.js +18 -8
- package/dist/components/UTVirtualizedList/components/VirtualizedData/hooks/use-virtualized-data.js +47 -23
- package/dist/components/UTVirtualizedList/components/VirtualizedData/index.js +34 -31
- package/dist/components/UTVirtualizedList/components/VirtualizedData/utils.js +93 -81
- package/dist/components/UTVirtualizedList/constants.js +8 -4
- package/dist/components/UTVirtualizedList/index.js +38 -26
- package/dist/components/UTWorkflowContainer/components/ActionButton/index.js +21 -17
- package/dist/components/UTWorkflowContainer/constants.js +6 -3
- package/dist/components/UTWorkflowContainer/hooks/use-previous.js +3 -3
- package/dist/components/UTWorkflowContainer/index.js +51 -32
- package/dist/components/UTWorkflowContainer/theme.js +53 -60
- package/dist/components/UTWorkflowContainer/types.js +3 -2
- package/dist/components/WithLoading/index.js +15 -10
- package/dist/components/WithTheme/index.js +17 -10
- package/dist/components/WithTheme/layout.js +28 -22
- package/dist/components/WithTouch/index.js +19 -12
- package/dist/constants/UTTable.js +3 -2
- package/dist/index.js +58 -58
- package/dist/theme.js +5 -6
- package/dist/types/commonTypes.js +5 -3
- package/dist/types/consumptionTypes.js +5 -3
- package/dist/types/formTypes.js +7 -4
- package/dist/types/tableTypes.js +3 -2
- package/dist/utils/classesUtils.js +13 -5
- package/dist/utils/componentUtils.js +13 -10
- package/dist/utils/helperFunctions.js +4 -4
- package/dist/utils/shadowUtils.js +11 -13
- package/dist/utils/useScreenSize.js +3 -2
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
@@ -11,29 +12,46 @@ var _commonTypes = require("../../types/commonTypes");
|
|
|
11
12
|
var _Ripple = _interopRequireDefault(require("./Ripple"));
|
|
12
13
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
13
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
function _getRequireWildcardCache(
|
|
15
|
-
function _interopRequireWildcard(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
15
|
+
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); }
|
|
16
|
+
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; }
|
|
17
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
18
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
19
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
20
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
21
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
22
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
23
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
24
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
25
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
26
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
27
|
+
var UTRipple = function UTRipple(_ref) {
|
|
28
|
+
var elem = _ref.elem,
|
|
29
|
+
withRipple = _ref.withRipple;
|
|
30
|
+
var _useState = (0, _react.useState)([]),
|
|
31
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
32
|
+
ripples = _useState2[0],
|
|
33
|
+
setRipples = _useState2[1];
|
|
34
|
+
var setNewRipples = (0, _react.useCallback)(function (event) {
|
|
35
|
+
setRipples(function (prevRipples) {
|
|
36
|
+
return [].concat(_toConsumableArray(prevRipples), [/*#__PURE__*/_react.default.createElement(_Ripple.default, {
|
|
37
|
+
event: event,
|
|
38
|
+
elem: elem,
|
|
39
|
+
key: Math.random()
|
|
40
|
+
})]);
|
|
41
|
+
});
|
|
28
42
|
}, [elem]);
|
|
29
|
-
|
|
30
|
-
|
|
43
|
+
var removeRipple = (0, _react.useCallback)(function () {
|
|
44
|
+
return setRipples(function (prevRipples) {
|
|
45
|
+
return prevRipples.slice(1);
|
|
46
|
+
});
|
|
47
|
+
}, []);
|
|
48
|
+
(0, _react.useEffect)(function () {
|
|
31
49
|
if (withRipple && elem) {
|
|
32
50
|
elem.addEventListener('mousedown', setNewRipples);
|
|
33
51
|
elem.addEventListener('mouseup', removeRipple);
|
|
34
52
|
elem.addEventListener('mouseleave', removeRipple);
|
|
35
53
|
}
|
|
36
|
-
return ()
|
|
54
|
+
return function () {
|
|
37
55
|
if (withRipple && elem) {
|
|
38
56
|
elem.removeEventListener('mousedown', setNewRipples);
|
|
39
57
|
elem.removeEventListener('mouseup', removeRipple);
|
|
@@ -50,4 +68,5 @@ UTRipple.propTypes = {
|
|
|
50
68
|
elem: _commonTypes.refType,
|
|
51
69
|
withRipple: _propTypes.bool
|
|
52
70
|
};
|
|
53
|
-
var _default =
|
|
71
|
+
var _default = UTRipple;
|
|
72
|
+
exports.default = _default;
|
|
@@ -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
|
});
|
|
@@ -8,18 +9,16 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
8
9
|
var _propTypes = require("prop-types");
|
|
9
10
|
var _Checkbox = _interopRequireDefault(require("@material-ui/core/Checkbox"));
|
|
10
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
function _getRequireWildcardCache(
|
|
12
|
-
function _interopRequireWildcard(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
} = _ref;
|
|
22
|
-
const OptionIcon = optionProps.icon;
|
|
12
|
+
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); }
|
|
13
|
+
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; }
|
|
14
|
+
var Option = function Option(_ref) {
|
|
15
|
+
var classes = _ref.classes,
|
|
16
|
+
isMultiple = _ref.isMultiple,
|
|
17
|
+
labelKey = _ref.labelKey,
|
|
18
|
+
optionProps = _ref.optionProps,
|
|
19
|
+
value = _ref.value,
|
|
20
|
+
valueKey = _ref.valueKey;
|
|
21
|
+
var OptionIcon = optionProps.icon;
|
|
23
22
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, isMultiple && /*#__PURE__*/_react.default.createElement(_Checkbox.default, {
|
|
24
23
|
color: "primary",
|
|
25
24
|
checked: value.indexOf(optionProps[valueKey]) > -1
|
|
@@ -37,4 +36,5 @@ Option.propTypes = {
|
|
|
37
36
|
value: _propTypes.any,
|
|
38
37
|
valueKey: _propTypes.string
|
|
39
38
|
};
|
|
40
|
-
var _default =
|
|
39
|
+
var _default = /*#__PURE__*/(0, _react.memo)(Option);
|
|
40
|
+
exports.default = _default;
|
|
@@ -4,7 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.VALUE_KEY = exports.MENU_TITLE_MULTIPLE = exports.MENU_TITLE = exports.LABEL_KEY = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
var VALUE_KEY = 'value';
|
|
8
|
+
exports.VALUE_KEY = VALUE_KEY;
|
|
9
|
+
var LABEL_KEY = 'name';
|
|
10
|
+
exports.LABEL_KEY = LABEL_KEY;
|
|
11
|
+
var MENU_TITLE = 'Seleccione una opción';
|
|
12
|
+
exports.MENU_TITLE = MENU_TITLE;
|
|
13
|
+
var MENU_TITLE_MULTIPLE = 'Seleccione una o más opciones';
|
|
14
|
+
exports.MENU_TITLE_MULTIPLE = MENU_TITLE_MULTIPLE;
|
|
@@ -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
|
});
|
|
@@ -29,56 +30,74 @@ var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
|
29
30
|
var _constants = require("./constants");
|
|
30
31
|
var _utils = require("./utils");
|
|
31
32
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
32
|
-
function _getRequireWildcardCache(
|
|
33
|
-
function _interopRequireWildcard(
|
|
33
|
+
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); }
|
|
34
|
+
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; }
|
|
35
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
36
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
37
|
+
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; }
|
|
38
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
39
|
+
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); }
|
|
34
40
|
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); }
|
|
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
|
-
|
|
41
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
42
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
43
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
44
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
45
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
46
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
47
|
+
var UTSelect = function UTSelect(_ref) {
|
|
48
|
+
var captionLabel = _ref.captionLabel,
|
|
49
|
+
classNames = _ref.classNames,
|
|
50
|
+
themeClasses = _ref.classes,
|
|
51
|
+
disabled = _ref.disabled,
|
|
52
|
+
disableFirstOption = _ref.disableFirstOption,
|
|
53
|
+
field = _ref.field,
|
|
54
|
+
IconPlaceholder = _ref.iconPlaceholder,
|
|
55
|
+
input = _ref.input,
|
|
56
|
+
labelKey = _ref.labelKey,
|
|
57
|
+
labelProps = _ref.labelProps,
|
|
58
|
+
menuPlaceholder = _ref.menuPlaceholder,
|
|
59
|
+
meta = _ref.meta,
|
|
60
|
+
options = _ref.options,
|
|
61
|
+
placeholder = _ref.placeholder,
|
|
62
|
+
selectProps = _ref.selectProps,
|
|
63
|
+
tooltip = _ref.tooltip,
|
|
64
|
+
valueKey = _ref.valueKey,
|
|
65
|
+
variant = _ref.variant,
|
|
66
|
+
withAutoReset = _ref.withAutoReset,
|
|
67
|
+
withOrder = _ref.withOrder,
|
|
68
|
+
withoutFirstOption = _ref.withoutFirstOption;
|
|
69
|
+
var _ref2 = (field === null || field === void 0 ? void 0 : field.configuration) || {},
|
|
70
|
+
isMultiple = _ref2.multiple,
|
|
71
|
+
upperTitle = _ref2.upperTitle;
|
|
72
|
+
var classes = (0, _react.useMemo)(function () {
|
|
73
|
+
return (0, _classesUtils.mergeClasses)(themeClasses, classNames);
|
|
74
|
+
}, [classNames]);
|
|
75
|
+
(0, _react.useEffect)(function () {
|
|
65
76
|
if (withAutoReset && (0, _utils.shouldReset)(input.value, options, valueKey, isMultiple)) input.onChange(null);
|
|
66
77
|
}, [options]);
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
78
|
+
var handleChange = function handleChange(event) {
|
|
79
|
+
return input.onChange(event.target.value);
|
|
80
|
+
};
|
|
81
|
+
var handleRenderValue = function handleRenderValue(selected) {
|
|
82
|
+
var selectedOptions = options.filter(function (option) {
|
|
83
|
+
return selected.includes(option[valueKey]);
|
|
84
|
+
});
|
|
85
|
+
return selectedOptions.map(function (selection) {
|
|
86
|
+
return selection[labelKey];
|
|
87
|
+
}).join(', ');
|
|
71
88
|
};
|
|
72
|
-
|
|
73
|
-
sortedOptions = withOrder ? sortedOptions.sort((a, b)
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
89
|
+
var sortedOptions = _toConsumableArray(options);
|
|
90
|
+
sortedOptions = withOrder ? sortedOptions.sort(function (a, b) {
|
|
91
|
+
return a.order < b.order ? -1 : 1;
|
|
92
|
+
}) : sortedOptions;
|
|
93
|
+
var optionCommonProps = {
|
|
94
|
+
classes: classes,
|
|
95
|
+
isMultiple: isMultiple,
|
|
96
|
+
labelKey: labelKey,
|
|
78
97
|
value: input.value,
|
|
79
|
-
valueKey
|
|
98
|
+
valueKey: valueKey
|
|
80
99
|
};
|
|
81
|
-
|
|
100
|
+
var SelectInput = /*#__PURE__*/_react.default.createElement(_react.Fragment, null, upperTitle && /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
82
101
|
className: classes.upperTitle
|
|
83
102
|
}, upperTitle), /*#__PURE__*/_react.default.createElement(_FormControl.default, {
|
|
84
103
|
className: classes.formControl,
|
|
@@ -105,24 +124,26 @@ const UTSelect = _ref => {
|
|
|
105
124
|
} : {}, selectProps), !withoutFirstOption && /*#__PURE__*/_react.default.createElement(_MenuItem.default, {
|
|
106
125
|
value: "",
|
|
107
126
|
disabled: isMultiple || disableFirstOption
|
|
108
|
-
}, menuPlaceholder || (isMultiple ? _constants.MENU_TITLE_MULTIPLE : _constants.MENU_TITLE)), sortedOptions.map(
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}
|
|
127
|
+
}, menuPlaceholder || (isMultiple ? _constants.MENU_TITLE_MULTIPLE : _constants.MENU_TITLE)), sortedOptions.map(function (option) {
|
|
128
|
+
return (0, _array.isEmpty)(option.subOptions) ? /*#__PURE__*/_react.default.createElement(_MenuItem.default, {
|
|
129
|
+
key: option[valueKey],
|
|
130
|
+
value: option[valueKey]
|
|
131
|
+
}, /*#__PURE__*/_react.default.createElement(_Option.default, _extends({
|
|
132
|
+
optionProps: option
|
|
133
|
+
}, optionCommonProps))) : [/*#__PURE__*/_react.default.createElement(_ListSubheader.default, {
|
|
134
|
+
className: _stylesModule.default.subHeader
|
|
135
|
+
}, option[labelKey]), option.subOptions.map(function (subOption) {
|
|
136
|
+
return /*#__PURE__*/_react.default.createElement(_MenuItem.default, {
|
|
137
|
+
className: classes.subOption,
|
|
138
|
+
key: subOption[valueKey],
|
|
139
|
+
value: subOption[valueKey]
|
|
140
|
+
}, /*#__PURE__*/_react.default.createElement(_Option.default, _extends({
|
|
141
|
+
isSuboption: true,
|
|
142
|
+
optionProps: subOption
|
|
143
|
+
}, optionCommonProps)));
|
|
144
|
+
})];
|
|
145
|
+
})), captionLabel && /*#__PURE__*/_react.default.createElement(_FormHelperText.default, {
|
|
146
|
+
classes: _objectSpread({}, classes.formHelperText)
|
|
126
147
|
}, captionLabel), (0, _form.shouldShowErrors)(meta) && /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
127
148
|
className: _stylesModule.default.errorLabel,
|
|
128
149
|
colorTheme: "error",
|
|
@@ -196,4 +217,5 @@ UTSelect.propTypes = {
|
|
|
196
217
|
withOrder: _propTypes.bool,
|
|
197
218
|
withoutFirstOption: _propTypes.bool
|
|
198
219
|
};
|
|
199
|
-
var _default =
|
|
220
|
+
var _default = (0, _WithTheme.default)(_theme.retrieveStyle, _theme.retrieveMuiTheme)(UTSelect);
|
|
221
|
+
exports.default = _default;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _colorsModule = _interopRequireDefault(require("../../scss/variables/colors.module.scss"));
|
|
8
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
-
var _default =
|
|
9
|
+
var _default = {
|
|
10
10
|
icon: {
|
|
11
11
|
alignSelf: 'baseline',
|
|
12
12
|
paddingTop: 25,
|
|
@@ -15,4 +15,5 @@ var _default = exports.default = {
|
|
|
15
15
|
gridContainer: {
|
|
16
16
|
flexWrap: 'nowrap'
|
|
17
17
|
}
|
|
18
|
-
};
|
|
18
|
+
};
|
|
19
|
+
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, ['UTSelect', 'container', 'display'], 'flex'),
|
|
@@ -57,8 +55,8 @@ const retrieveStyle = _ref => {
|
|
|
57
55
|
};
|
|
58
56
|
};
|
|
59
57
|
exports.retrieveStyle = retrieveStyle;
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
var retrieveMuiTheme = function retrieveMuiTheme(theme, muiTheme) {
|
|
59
|
+
var mui = {
|
|
62
60
|
typography: {
|
|
63
61
|
fontFamily: (0, _seamlessImmutable.getIn)(theme, ['Fonts', 'fontFamily'])
|
|
64
62
|
},
|
|
@@ -5,9 +5,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.shouldReset = void 0;
|
|
7
7
|
var _array = require("@widergy/web-utils/lib/array");
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
var shouldResetMultipleSelect = function shouldResetMultipleSelect(value, options, valueKey) {
|
|
9
|
+
return !(0, _array.isEmpty)(value) && ((0, _array.isEmpty)(options) || value.some(function (el) {
|
|
10
|
+
return !options.some(function (opt) {
|
|
11
|
+
return opt[valueKey] === el;
|
|
12
|
+
});
|
|
13
|
+
}));
|
|
14
|
+
};
|
|
15
|
+
var shouldResetSimpleSelect = function shouldResetSimpleSelect(value, options, valueKey) {
|
|
16
|
+
return value && ((0, _array.isEmpty)(options) || !options.some(function (el) {
|
|
17
|
+
return el[valueKey] === value;
|
|
18
|
+
}));
|
|
19
|
+
};
|
|
20
|
+
var shouldReset = function shouldReset(value, options, valueKey, isMultiple) {
|
|
11
21
|
if (isMultiple) return shouldResetMultipleSelect(value, options, valueKey);
|
|
12
22
|
return shouldResetSimpleSelect(value, options, valueKey);
|
|
13
23
|
};
|
|
@@ -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
|
});
|
|
@@ -10,38 +11,49 @@ var _types = require("../../types");
|
|
|
10
11
|
var _Option = _interopRequireDefault(require("../Option"));
|
|
11
12
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
12
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
function _getRequireWildcardCache(
|
|
14
|
-
function _interopRequireWildcard(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
14
|
+
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); }
|
|
15
|
+
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; }
|
|
16
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
17
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
18
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
19
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
20
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
21
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
22
|
+
var ListOption = function ListOption(_ref) {
|
|
23
|
+
var classes = _ref.classes,
|
|
24
|
+
handleClose = _ref.handleClose,
|
|
25
|
+
handleRedirect = _ref.handleRedirect,
|
|
26
|
+
IconActive = _ref.IconActive,
|
|
27
|
+
IconInactive = _ref.IconInactive,
|
|
28
|
+
label = _ref.label,
|
|
29
|
+
labelAlwaysVisible = _ref.labelAlwaysVisible,
|
|
30
|
+
location = _ref.location,
|
|
31
|
+
open = _ref.open,
|
|
32
|
+
openDrawer = _ref.openDrawer,
|
|
33
|
+
options = _ref.options;
|
|
34
|
+
var _useState = (0, _react.useState)(false),
|
|
35
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
36
|
+
openMenu = _useState2[0],
|
|
37
|
+
setOpenMenu = _useState2[1];
|
|
38
|
+
var optionRef = (0, _react.useRef)();
|
|
39
|
+
(0, _react.useEffect)(function () {
|
|
32
40
|
if (!open) setOpenMenu(false);
|
|
33
41
|
}, [open]);
|
|
34
|
-
|
|
42
|
+
var toogleMenu = function toogleMenu() {
|
|
35
43
|
if (!open) {
|
|
36
44
|
openDrawer();
|
|
37
45
|
setOpenMenu(true);
|
|
38
46
|
} else setOpenMenu(!openMenu);
|
|
39
47
|
};
|
|
40
|
-
|
|
48
|
+
var optionHeight = (0, _react.useMemo)(function () {
|
|
41
49
|
var _optionRef$current;
|
|
42
50
|
return openMenu && open ? options.length * (optionRef === null || optionRef === void 0 || (_optionRef$current = optionRef.current) === null || _optionRef$current === void 0 ? void 0 : _optionRef$current.clientHeight) : 0;
|
|
43
51
|
}, [openMenu, open]);
|
|
44
|
-
|
|
52
|
+
var hasSelectedItem = (0, _react.useMemo)(function () {
|
|
53
|
+
return options.some(function (opt) {
|
|
54
|
+
return opt.link === location;
|
|
55
|
+
});
|
|
56
|
+
}, [location, options]);
|
|
45
57
|
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Option.default, {
|
|
46
58
|
classes: classes,
|
|
47
59
|
IconActive: IconActive,
|
|
@@ -60,17 +72,19 @@ const ListOption = _ref => {
|
|
|
60
72
|
style: {
|
|
61
73
|
height: optionHeight
|
|
62
74
|
}
|
|
63
|
-
}, options.map(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
75
|
+
}, options.map(function (op) {
|
|
76
|
+
return /*#__PURE__*/_react.default.createElement(_Option.default, {
|
|
77
|
+
classes: classes,
|
|
78
|
+
handleClose: handleClose,
|
|
79
|
+
handleRedirect: handleRedirect,
|
|
80
|
+
key: op.key,
|
|
81
|
+
label: op.label,
|
|
82
|
+
labelAlwaysVisible: labelAlwaysVisible,
|
|
83
|
+
link: op.link,
|
|
84
|
+
location: location,
|
|
85
|
+
open: open
|
|
86
|
+
});
|
|
87
|
+
})));
|
|
74
88
|
};
|
|
75
89
|
ListOption.propTypes = {
|
|
76
90
|
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
@@ -85,4 +99,5 @@ ListOption.propTypes = {
|
|
|
85
99
|
openDrawer: _propTypes.func,
|
|
86
100
|
options: (0, _propTypes.arrayOf)(_types.subOptionType)
|
|
87
101
|
};
|
|
88
|
-
var _default =
|
|
102
|
+
var _default = /*#__PURE__*/(0, _react.memo)(ListOption);
|
|
103
|
+
exports.default = _default;
|
|
@@ -1,18 +1,17 @@
|
|
|
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
|
-
Icon
|
|
15
|
-
} = _ref;
|
|
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 DynamicIcon = function DynamicIcon(_ref) {
|
|
13
|
+
var className = _ref.className,
|
|
14
|
+
Icon = _ref.Icon;
|
|
16
15
|
return typeof Icon === 'string' ? /*#__PURE__*/_react.default.createElement("img", {
|
|
17
16
|
src: Icon,
|
|
18
17
|
alt: "",
|
|
@@ -25,4 +24,5 @@ DynamicIcon.propTypes = {
|
|
|
25
24
|
className: _propTypes.string,
|
|
26
25
|
Icon: (0, _propTypes.oneOfType)([_propTypes.elementType, _propTypes.func, _propTypes.string])
|
|
27
26
|
};
|
|
28
|
-
var _default =
|
|
27
|
+
var _default = /*#__PURE__*/(0, _react.memo)(DynamicIcon);
|
|
28
|
+
exports.default = _default;
|
|
@@ -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
|
});
|
|
@@ -10,19 +11,17 @@ var _UTLabel = _interopRequireDefault(require("../../../UTLabel"));
|
|
|
10
11
|
var _DynamicIcon = _interopRequireDefault(require("./components/DynamicIcon"));
|
|
11
12
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
12
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
function _getRequireWildcardCache(
|
|
14
|
-
function _interopRequireWildcard(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
showBigLogo
|
|
25
|
-
} = _ref;
|
|
14
|
+
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); }
|
|
15
|
+
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; }
|
|
16
|
+
var LogosContainer = function LogosContainer(_ref) {
|
|
17
|
+
var badgeClassName = _ref.badgeClassName,
|
|
18
|
+
badgeContent = _ref.badgeContent,
|
|
19
|
+
BigLogo = _ref.BigLogo,
|
|
20
|
+
bigLogoClassName = _ref.bigLogoClassName,
|
|
21
|
+
containerClassName = _ref.containerClassName,
|
|
22
|
+
SmallLogo = _ref.SmallLogo,
|
|
23
|
+
smallLogoClassName = _ref.smallLogoClassName,
|
|
24
|
+
showBigLogo = _ref.showBigLogo;
|
|
26
25
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
27
26
|
className: "".concat(containerClassName, " ").concat(_stylesModule.default.logoContainer)
|
|
28
27
|
}, BigLogo && /*#__PURE__*/_react.default.createElement(_DynamicIcon.default, {
|
|
@@ -45,4 +44,5 @@ LogosContainer.propTypes = {
|
|
|
45
44
|
SmallLogo: _propTypes.elementType,
|
|
46
45
|
showBigLogo: _propTypes.bool
|
|
47
46
|
};
|
|
48
|
-
var _default =
|
|
47
|
+
var _default = /*#__PURE__*/(0, _react.memo)(LogosContainer);
|
|
48
|
+
exports.default = _default;
|