@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
|
});
|
|
@@ -12,49 +13,62 @@ var _UTLabel = _interopRequireDefault(require("../../../UTLabel"));
|
|
|
12
13
|
var _constants = require("../../constants");
|
|
13
14
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
14
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
function _getRequireWildcardCache(
|
|
16
|
-
function _interopRequireWildcard(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
[
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
showLabel: isFirst || isLast
|
|
45
|
-
},
|
|
46
|
-
[_constants.NO_TEXT]: {
|
|
47
|
-
containerClass: '',
|
|
48
|
-
labelClass: '',
|
|
49
|
-
showLabel: false
|
|
50
|
-
}
|
|
16
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
18
|
+
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; }
|
|
19
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
20
|
+
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); }
|
|
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 Circle = function Circle(_ref) {
|
|
28
|
+
var _textVariants;
|
|
29
|
+
var selected = _ref.selected,
|
|
30
|
+
onClick = _ref.onClick,
|
|
31
|
+
value = _ref.value,
|
|
32
|
+
order = _ref.order,
|
|
33
|
+
name = _ref.name,
|
|
34
|
+
isFirst = _ref.isFirst,
|
|
35
|
+
isLast = _ref.isLast,
|
|
36
|
+
textVariant = _ref.textVariant,
|
|
37
|
+
color = _ref.color,
|
|
38
|
+
classes = _ref.classes;
|
|
39
|
+
var _useState = (0, _react.useState)(false),
|
|
40
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
41
|
+
isHovered = _useState2[0],
|
|
42
|
+
setIsHovered = _useState2[1];
|
|
43
|
+
var handleClick = function handleClick() {
|
|
44
|
+
return onClick(order, value);
|
|
51
45
|
};
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
46
|
+
var handleHover = function handleHover() {
|
|
47
|
+
return setIsHovered(true);
|
|
48
|
+
};
|
|
49
|
+
var onMouseLeave = function onMouseLeave() {
|
|
50
|
+
return setIsHovered(false);
|
|
51
|
+
};
|
|
52
|
+
var onFocus = function onFocus() {};
|
|
53
|
+
var textVariants = (_textVariants = {}, _defineProperty(_textVariants, _constants.SIDE_TEXT, {
|
|
54
|
+
containerClass: isFirst ? _stylesModule.default.first : isLast && _stylesModule.default.last,
|
|
55
|
+
labelClass: classes.label,
|
|
56
|
+
showLabel: isFirst || isLast
|
|
57
|
+
}), _defineProperty(_textVariants, _constants.BOTTOM_TEXT, {
|
|
58
|
+
containerClass: "".concat(_stylesModule.default.withTextBottom, " ").concat(classes.circleWithTextBottom),
|
|
59
|
+
labelClass: "".concat(isFirst ? _stylesModule.default.labelBottomFirst : isLast && _stylesModule.default.labelBottomLast, " ").concat(classes.label, " ").concat(isFirst ? classes.labelBottomFirst : isLast && classes.labelBottomLast),
|
|
60
|
+
showLabel: isFirst || isLast
|
|
61
|
+
}), _defineProperty(_textVariants, _constants.NO_TEXT, {
|
|
62
|
+
containerClass: '',
|
|
63
|
+
labelClass: '',
|
|
64
|
+
showLabel: false
|
|
65
|
+
}), _textVariants);
|
|
66
|
+
var textVariantToUse = textVariants[textVariant] || textVariants[_constants.BOTTOM_TEXT];
|
|
67
|
+
var showPropColor = color && (isHovered || selected);
|
|
68
|
+
var avatarStyle = {
|
|
55
69
|
borderColor: color
|
|
56
70
|
};
|
|
57
|
-
|
|
71
|
+
var avatarSelectedStyle = {
|
|
58
72
|
backgroundColor: color,
|
|
59
73
|
borderColor: color
|
|
60
74
|
};
|
|
@@ -88,4 +102,5 @@ Circle.propTypes = {
|
|
|
88
102
|
avatar: _propTypes.string
|
|
89
103
|
})
|
|
90
104
|
};
|
|
91
|
-
var _default =
|
|
105
|
+
var _default = Circle;
|
|
106
|
+
exports.default = _default;
|
|
@@ -81,5 +81,7 @@ MoodSmile.defaultProps = {
|
|
|
81
81
|
fill: "none",
|
|
82
82
|
xmlns: "http://www.w3.org/2000/svg"
|
|
83
83
|
};
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
var FACES_ICONS = [MoodConfuzed, MoodSad, MoodEmpty, MoodSmile, MoodHappy];
|
|
85
|
+
exports.FACES_ICONS = FACES_ICONS;
|
|
86
|
+
var FACES_CLASSES = ['faceButtonConfuzed', 'faceButtonSad', 'faceButtonEmpty', 'faceButtonSmile', 'faceButtonHappy'];
|
|
87
|
+
exports.FACES_CLASSES = FACES_CLASSES;
|
|
@@ -12,40 +12,41 @@ var _constants = require("../../constants");
|
|
|
12
12
|
var _constants2 = require("./constants");
|
|
13
13
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
14
14
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
showLabel: isFirst || isLast
|
|
35
|
-
},
|
|
36
|
-
[_constants.BOTTOM_TEXT]: {
|
|
37
|
-
containerClass: "".concat(_stylesModule.default.withTextBottom, " ").concat(classes.facesWithTextBottom),
|
|
38
|
-
labelClass: classes.label,
|
|
39
|
-
showLabel: true
|
|
40
|
-
},
|
|
41
|
-
[_constants.NO_TEXT]: {
|
|
42
|
-
containerClass: '',
|
|
43
|
-
labelClass: '',
|
|
44
|
-
showLabel: false
|
|
45
|
-
}
|
|
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 _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); }
|
|
18
|
+
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; }
|
|
19
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
20
|
+
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); }
|
|
21
|
+
var Faces = function Faces(_ref) {
|
|
22
|
+
var _textVariants;
|
|
23
|
+
var classes = _ref.classes,
|
|
24
|
+
isFirst = _ref.isFirst,
|
|
25
|
+
isLast = _ref.isLast,
|
|
26
|
+
name = _ref.name,
|
|
27
|
+
onClick = _ref.onClick,
|
|
28
|
+
order = _ref.order,
|
|
29
|
+
selected = _ref.selected,
|
|
30
|
+
textVariant = _ref.textVariant,
|
|
31
|
+
value = _ref.value;
|
|
32
|
+
var handleClick = function handleClick() {
|
|
33
|
+
return onClick(order, value);
|
|
46
34
|
};
|
|
47
|
-
|
|
48
|
-
|
|
35
|
+
var textVariants = (_textVariants = {}, _defineProperty(_textVariants, _constants.SIDE_TEXT, {
|
|
36
|
+
containerClass: isFirst ? _stylesModule.default.first : isLast && _stylesModule.default.last,
|
|
37
|
+
labelClass: classes.label,
|
|
38
|
+
showLabel: isFirst || isLast
|
|
39
|
+
}), _defineProperty(_textVariants, _constants.BOTTOM_TEXT, {
|
|
40
|
+
containerClass: "".concat(_stylesModule.default.withTextBottom, " ").concat(classes.facesWithTextBottom),
|
|
41
|
+
labelClass: classes.label,
|
|
42
|
+
showLabel: true
|
|
43
|
+
}), _defineProperty(_textVariants, _constants.NO_TEXT, {
|
|
44
|
+
containerClass: '',
|
|
45
|
+
labelClass: '',
|
|
46
|
+
showLabel: false
|
|
47
|
+
}), _textVariants);
|
|
48
|
+
var textVariantToUse = textVariants[textVariant] || textVariants[_constants.NO_TEXT];
|
|
49
|
+
var Icon = _constants2.FACES_ICONS[order - 1];
|
|
49
50
|
return Icon && /*#__PURE__*/_react.default.createElement("div", {
|
|
50
51
|
className: "".concat(_stylesModule.default.container, " ").concat(textVariantToUse.containerClass)
|
|
51
52
|
}, /*#__PURE__*/_react.default.createElement(_UTButton.default, {
|
|
@@ -73,4 +74,5 @@ Faces.propTypes = {
|
|
|
73
74
|
textVariant: _propTypes.string,
|
|
74
75
|
value: (0, _propTypes.oneOfType)([_propTypes.number, _propTypes.string])
|
|
75
76
|
};
|
|
76
|
-
var _default =
|
|
77
|
+
var _default = /*#__PURE__*/(0, _react.memo)(Faces);
|
|
78
|
+
exports.default = _default;
|
|
@@ -12,41 +12,44 @@ var _UTLabel = _interopRequireDefault(require("../../../UTLabel"));
|
|
|
12
12
|
var _constants = require("../../constants");
|
|
13
13
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
[_constants.SIDE_TEXT]: {
|
|
37
|
-
containerClass: isFirst ? _stylesModule.default.first : isLast && _stylesModule.default.last,
|
|
38
|
-
showLabel: isFirst || isLast
|
|
39
|
-
},
|
|
40
|
-
[_constants.BOTTOM_TEXT]: {
|
|
41
|
-
containerClass: _stylesModule.default.withTextBottom,
|
|
42
|
-
showLabel: true
|
|
43
|
-
},
|
|
44
|
-
[_constants.NO_TEXT]: {
|
|
45
|
-
containerClass: '',
|
|
46
|
-
showLabel: false
|
|
47
|
-
}
|
|
15
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
16
|
+
function _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; }
|
|
17
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
18
|
+
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); }
|
|
19
|
+
var Star = function Star(_ref) {
|
|
20
|
+
var _textVariants;
|
|
21
|
+
var name = _ref.name,
|
|
22
|
+
onMouseLeave = _ref.onMouseLeave,
|
|
23
|
+
hovered = _ref.hovered,
|
|
24
|
+
selected = _ref.selected,
|
|
25
|
+
isFirst = _ref.isFirst,
|
|
26
|
+
isLast = _ref.isLast,
|
|
27
|
+
color = _ref.color,
|
|
28
|
+
order = _ref.order,
|
|
29
|
+
value = _ref.value,
|
|
30
|
+
onClick = _ref.onClick,
|
|
31
|
+
onHover = _ref.onHover,
|
|
32
|
+
classes = _ref.classes,
|
|
33
|
+
textVariant = _ref.textVariant;
|
|
34
|
+
var handleClick = function handleClick() {
|
|
35
|
+
return onClick(order, value);
|
|
48
36
|
};
|
|
49
|
-
|
|
37
|
+
var handleHover = function handleHover() {
|
|
38
|
+
return onHover(order);
|
|
39
|
+
};
|
|
40
|
+
var onFocus = function onFocus() {};
|
|
41
|
+
var showPropColor = color && (hovered || selected);
|
|
42
|
+
var textVariants = (_textVariants = {}, _defineProperty(_textVariants, _constants.SIDE_TEXT, {
|
|
43
|
+
containerClass: isFirst ? _stylesModule.default.first : isLast && _stylesModule.default.last,
|
|
44
|
+
showLabel: isFirst || isLast
|
|
45
|
+
}), _defineProperty(_textVariants, _constants.BOTTOM_TEXT, {
|
|
46
|
+
containerClass: _stylesModule.default.withTextBottom,
|
|
47
|
+
showLabel: true
|
|
48
|
+
}), _defineProperty(_textVariants, _constants.NO_TEXT, {
|
|
49
|
+
containerClass: '',
|
|
50
|
+
showLabel: false
|
|
51
|
+
}), _textVariants);
|
|
52
|
+
var textVariantToUse = textVariants[textVariant] || textVariants[_constants.SIDE_TEXT];
|
|
50
53
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
51
54
|
className: "".concat(_stylesModule.default.container, " ").concat(textVariantToUse.containerClass)
|
|
52
55
|
}, /*#__PURE__*/_react.default.createElement(_IconButton.default, {
|
|
@@ -55,7 +58,7 @@ const Star = _ref => {
|
|
|
55
58
|
onMouseLeave: onMouseLeave,
|
|
56
59
|
onClick: handleClick,
|
|
57
60
|
style: showPropColor ? {
|
|
58
|
-
color
|
|
61
|
+
color: color
|
|
59
62
|
} : {},
|
|
60
63
|
className: "".concat(_stylesModule.default.starButton, " ").concat(hovered && _stylesModule.default.starHovered, " ").concat(selected && _stylesModule.default.starsPainted)
|
|
61
64
|
}, /*#__PURE__*/_react.default.createElement(_StarRate.default, {
|
|
@@ -83,4 +86,5 @@ Star.propTypes = {
|
|
|
83
86
|
}),
|
|
84
87
|
textVariant: _propTypes.string
|
|
85
88
|
};
|
|
86
|
-
var _default =
|
|
89
|
+
var _default = Star;
|
|
90
|
+
exports.default = _default;
|
|
@@ -4,11 +4,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.SIDE_TEXT = exports.RATING_VARIANTS = exports.NO_TEXT = exports.BOTTOM_TEXT = void 0;
|
|
7
|
-
|
|
7
|
+
var RATING_VARIANTS = {
|
|
8
8
|
CIRCULAR: 'circular',
|
|
9
9
|
FACES: 'faces',
|
|
10
10
|
STAR: 'star'
|
|
11
11
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
exports.RATING_VARIANTS = RATING_VARIANTS;
|
|
13
|
+
var SIDE_TEXT = 'side_text';
|
|
14
|
+
exports.SIDE_TEXT = SIDE_TEXT;
|
|
15
|
+
var BOTTOM_TEXT = 'bottom_text';
|
|
16
|
+
exports.BOTTOM_TEXT = BOTTOM_TEXT;
|
|
17
|
+
var NO_TEXT = 'no_text';
|
|
18
|
+
exports.NO_TEXT = NO_TEXT;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
@@ -19,53 +20,66 @@ var _Faces = _interopRequireDefault(require("./components/Faces"));
|
|
|
19
20
|
var _Star = _interopRequireDefault(require("./components/Star"));
|
|
20
21
|
var _constants = require("./constants");
|
|
21
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
22
|
-
function _getRequireWildcardCache(
|
|
23
|
-
function _interopRequireWildcard(
|
|
23
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
24
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
24
25
|
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); }
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
26
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
27
|
+
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."); }
|
|
28
|
+
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); }
|
|
29
|
+
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; }
|
|
30
|
+
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; } }
|
|
31
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
32
|
+
var UTRatingContainer = function UTRatingContainer(_ref) {
|
|
33
|
+
var theme = _ref.classes,
|
|
34
|
+
classNames = _ref.classNames,
|
|
35
|
+
_ref$field = _ref.field,
|
|
36
|
+
field = _ref$field === void 0 ? {} : _ref$field,
|
|
37
|
+
onChange = _ref.onChange,
|
|
38
|
+
options = _ref.options,
|
|
39
|
+
titleProps = _ref.titleProps,
|
|
40
|
+
withUpperTitle = _ref.withUpperTitle;
|
|
41
|
+
var _useState = (0, _react.useState)([]),
|
|
42
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
43
|
+
selectedOptions = _useState2[0],
|
|
44
|
+
setSelectedOptions = _useState2[1];
|
|
45
|
+
var _useState3 = (0, _react.useState)([]),
|
|
46
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
47
|
+
hoveredOptions = _useState4[0],
|
|
48
|
+
setHoveredOptions = _useState4[1];
|
|
49
|
+
var _useState5 = (0, _react.useState)([]),
|
|
50
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
51
|
+
temporalSelected = _useState6[0],
|
|
52
|
+
setTemporalSelected = _useState6[1];
|
|
53
|
+
var classes = (0, _classesUtils.mergeClasses)(theme, classNames);
|
|
54
|
+
var _ref2 = field.configuration || {},
|
|
55
|
+
ignoreTitle = _ref2.ignore_title,
|
|
56
|
+
variant = _ref2.variant,
|
|
57
|
+
starColor = _ref2.star_color,
|
|
58
|
+
textVariant = _ref2.text_variant;
|
|
59
|
+
var shouldShowUpperTitle = ignoreTitle && withUpperTitle;
|
|
60
|
+
var handleClick = function handleClick(order, value) {
|
|
47
61
|
setSelectedOptions((0, _array.autocompleteWithNumbers)(1, order));
|
|
48
62
|
if ((0, _array.isEmpty)(selectedOptions)) setTemporalSelected((0, _array.autocompleteWithNumbers)(1, order));
|
|
49
63
|
onChange(value.toString());
|
|
50
64
|
};
|
|
51
|
-
|
|
65
|
+
var handleHover = function handleHover(value) {
|
|
52
66
|
setHoveredOptions((0, _array.autocompleteWithNumbers)(1, value));
|
|
53
67
|
setSelectedOptions([]);
|
|
54
68
|
};
|
|
55
|
-
|
|
69
|
+
var handleMouseLeave = function handleMouseLeave() {
|
|
56
70
|
setHoveredOptions([]);
|
|
57
71
|
setSelectedOptions(temporalSelected);
|
|
58
72
|
};
|
|
59
|
-
|
|
60
|
-
|
|
73
|
+
var handleMapOptions = function handleMapOptions(option) {
|
|
74
|
+
var defaultProps = {
|
|
61
75
|
onClick: handleClick,
|
|
62
76
|
value: option.value,
|
|
63
77
|
order: option.order,
|
|
64
78
|
isFirst: options[0].order === option.order,
|
|
65
79
|
isLast: options[options.length - 1].order === option.order,
|
|
66
|
-
textVariant,
|
|
80
|
+
textVariant: textVariant,
|
|
67
81
|
name: option.name,
|
|
68
|
-
classes,
|
|
82
|
+
classes: classes,
|
|
69
83
|
color: starColor || _colorsModule.default.ratingStarSelected
|
|
70
84
|
};
|
|
71
85
|
return variant === _constants.RATING_VARIANTS.CIRCULAR ? /*#__PURE__*/_react.default.createElement(_Circle.default, _extends({
|
|
@@ -102,4 +116,5 @@ UTRatingContainer.propTypes = {
|
|
|
102
116
|
titleProps: _propTypes.object,
|
|
103
117
|
withUpperTitle: _propTypes.bool
|
|
104
118
|
};
|
|
105
|
-
var _default =
|
|
119
|
+
var _default = (0, _WithTheme.default)(_theme.retrieveStyle)(UTRatingContainer);
|
|
120
|
+
exports.default = _default;
|
|
@@ -7,10 +7,8 @@ exports.retrieveStyle = void 0;
|
|
|
7
7
|
var _seamlessImmutable = require("seamless-immutable");
|
|
8
8
|
var _colorsModule = _interopRequireDefault(require("../../scss/variables/colors.module.scss"));
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
theme
|
|
13
|
-
} = _ref;
|
|
10
|
+
var retrieveStyle = function retrieveStyle(_ref) {
|
|
11
|
+
var theme = _ref.theme;
|
|
14
12
|
return {
|
|
15
13
|
faceButtonConfuzed: {
|
|
16
14
|
'&:hover path, &$faceButtonSelected path': {
|
|
@@ -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,43 +9,58 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
8
9
|
var _reactTransitionGroup = require("react-transition-group");
|
|
9
10
|
var _propTypes = require("prop-types");
|
|
10
11
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
12
|
+
var _excluded = ["elem", "event"];
|
|
11
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
function _getRequireWildcardCache(
|
|
13
|
-
function _interopRequireWildcard(
|
|
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; }
|
|
14
16
|
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); }
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
18
|
+
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."); }
|
|
19
|
+
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); }
|
|
20
|
+
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; }
|
|
21
|
+
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; } }
|
|
22
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
23
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
24
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
25
|
+
var Ripple = function Ripple(_ref) {
|
|
26
|
+
var elem = _ref.elem,
|
|
27
|
+
event = _ref.event,
|
|
28
|
+
other = _objectWithoutProperties(_ref, _excluded);
|
|
29
|
+
var _useState = (0, _react.useState)(false),
|
|
30
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
31
|
+
enter = _useState2[0],
|
|
32
|
+
setEnter = _useState2[1];
|
|
33
|
+
var _useState3 = (0, _react.useState)(false),
|
|
34
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
35
|
+
leaving = _useState4[0],
|
|
36
|
+
setLeaving = _useState4[1];
|
|
37
|
+
var handleEnter = function handleEnter() {
|
|
38
|
+
return setEnter(true);
|
|
39
|
+
};
|
|
40
|
+
var handleExit = function handleExit() {
|
|
25
41
|
setLeaving(true);
|
|
26
42
|
};
|
|
27
|
-
|
|
43
|
+
var rect = elem ? elem.getBoundingClientRect() : {
|
|
28
44
|
width: 0,
|
|
29
45
|
height: 0,
|
|
30
46
|
left: 0,
|
|
31
47
|
top: 0
|
|
32
48
|
};
|
|
33
|
-
|
|
34
|
-
|
|
49
|
+
var rippleX;
|
|
50
|
+
var rippleY;
|
|
35
51
|
if (event.clientX === 0 && event.clientY === 0 || !event.clientX && !event.touches) {
|
|
36
52
|
rippleX = Math.round(rect.width / 2);
|
|
37
53
|
rippleY = Math.round(rect.height / 2);
|
|
38
54
|
} else {
|
|
39
|
-
|
|
40
|
-
|
|
55
|
+
var clientX = event.clientX ? event.clientX : event.touches[0].clientX;
|
|
56
|
+
var clientY = event.clientY ? event.clientY : event.touches[0].clientY;
|
|
41
57
|
rippleX = Math.round(clientX - rect.left);
|
|
42
58
|
rippleY = Math.round(clientY - rect.top);
|
|
43
59
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
60
|
+
var sizeX = Math.max(Math.abs((elem ? elem.clientWidth : 0) - rippleX), rippleX) * 2 + 2;
|
|
61
|
+
var sizeY = Math.max(Math.abs((elem ? elem.clientHeight : 0) - rippleY), rippleY) * 2 + 2;
|
|
62
|
+
var rippleSize = Math.sqrt(Math.pow(sizeX, 2) + Math.pow(sizeY, 2));
|
|
63
|
+
var rippleStyles = {
|
|
48
64
|
width: rippleSize,
|
|
49
65
|
height: rippleSize,
|
|
50
66
|
top: -(rippleSize / 2) + rippleY,
|
|
@@ -66,4 +82,5 @@ Ripple.propTypes = {
|
|
|
66
82
|
elem: _propTypes.element,
|
|
67
83
|
event: _propTypes.any
|
|
68
84
|
};
|
|
69
|
-
var _default =
|
|
85
|
+
var _default = Ripple;
|
|
86
|
+
exports.default = _default;
|