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