@widergy/energy-ui 2.10.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/components/EnergyThemeProvider/index.js +12 -34
- package/dist/components/Loading/constants.js +1 -1
- package/dist/components/Loading/index.js +12 -10
- package/dist/components/Loading/theme.js +6 -3
- package/dist/components/UTAlert/AlertHandler.js +74 -99
- package/dist/components/UTAlert/index.js +64 -85
- package/dist/components/UTAlert/theme.js +34 -32
- package/dist/components/UTAttachment/components/Preview/index.js +7 -7
- package/dist/components/UTAttachment/constants.js +6 -6
- package/dist/components/UTAttachment/index.js +167 -257
- package/dist/components/UTAttachment/layout.js +25 -25
- package/dist/components/UTAttachment/theme.js +6 -3
- package/dist/components/UTAttachment/utils.js +44 -117
- package/dist/components/UTAutocomplete/components/ListBox/index.js +12 -19
- package/dist/components/UTAutocomplete/components/ListBox/utils.js +11 -12
- package/dist/components/UTAutocomplete/constants.js +11 -11
- package/dist/components/UTAutocomplete/index.js +53 -92
- package/dist/components/UTAutocomplete/theme.js +9 -5
- package/dist/components/UTAvatar/constants.js +1 -1
- package/dist/components/UTAvatar/index.js +17 -15
- package/dist/components/UTBarChart/components/Bars/components/Bar/components/Rect/index.js +21 -20
- package/dist/components/UTBarChart/components/Bars/components/Bar/constants.js +2 -1
- package/dist/components/UTBarChart/components/Bars/components/Bar/index.js +20 -20
- package/dist/components/UTBarChart/components/Bars/constants.js +3 -3
- package/dist/components/UTBarChart/components/Bars/index.js +69 -78
- package/dist/components/UTBarChart/components/Legend/constants.js +14 -17
- package/dist/components/UTBarChart/components/Legend/index.js +74 -91
- package/dist/components/UTBarChart/components/Legend/utils.js +2 -5
- package/dist/components/UTBarChart/components/Levels/index.js +15 -12
- package/dist/components/UTBarChart/components/Levels/utils.js +26 -27
- package/dist/components/UTBarChart/components/LinearPlot/constants.js +2 -2
- package/dist/components/UTBarChart/components/LinearPlot/index.js +24 -18
- package/dist/components/UTBarChart/components/LinearPlot/utils.js +39 -39
- package/dist/components/UTBarChart/components/Pagination/constants.js +1 -1
- package/dist/components/UTBarChart/components/Pagination/index.js +19 -22
- package/dist/components/UTBarChart/components/XAxis/components/AxisElement/index.js +20 -30
- package/dist/components/UTBarChart/components/XAxis/components/Decoration/constants.js +2 -2
- package/dist/components/UTBarChart/components/XAxis/components/Decoration/index.js +19 -17
- package/dist/components/UTBarChart/components/XAxis/constants.js +1 -1
- package/dist/components/UTBarChart/components/XAxis/index.js +53 -63
- package/dist/components/UTBarChart/components/YAxis/AxisElement/index.js +11 -9
- package/dist/components/UTBarChart/components/YAxis/constants.js +1 -1
- package/dist/components/UTBarChart/components/YAxis/index.js +29 -35
- package/dist/components/UTBarChart/components/YAxis/utils.js +6 -6
- package/dist/components/UTBarChart/constants.js +4 -4
- package/dist/components/UTBarChart/hooks/use-dynamic-margins.js +22 -38
- package/dist/components/UTBarChart/index.js +151 -164
- package/dist/components/UTBarChart/theme.js +6 -3
- package/dist/components/UTBarChart/types.js +9 -9
- package/dist/components/UTBarChart/utils.js +118 -111
- package/dist/components/UTBreadcrumbs/constants.js +22 -24
- package/dist/components/UTBreadcrumbs/index.js +75 -99
- package/dist/components/UTBreadcrumbs/styles.module.scss +1 -0
- package/dist/components/UTBreadcrumbs/theme.js +6 -3
- package/dist/components/UTButton/constants.js +11 -11
- package/dist/components/UTButton/index.js +27 -29
- package/dist/components/UTButton/theme.js +26 -24
- package/dist/components/UTCBUInput/index.js +35 -38
- package/dist/components/UTCBUInput/theme.js +6 -3
- package/dist/components/UTCaptcha/index.js +18 -43
- package/dist/components/UTCard/components/UTCardFooter/index.js +14 -14
- package/dist/components/UTCard/index.js +89 -123
- package/dist/components/UTCard/theme.js +13 -13
- package/dist/components/UTCard/types.js +1 -1
- package/dist/components/UTCarousel/components/Button/index.js +12 -11
- package/dist/components/UTCarousel/components/Legend/index.js +12 -13
- package/dist/components/UTCarousel/components/Slider/component/Slide/index.js +15 -14
- package/dist/components/UTCarousel/components/Slider/constants.js +5 -5
- package/dist/components/UTCarousel/components/Slider/index.js +213 -281
- package/dist/components/UTCarousel/components/Slider/layout.js +66 -92
- package/dist/components/UTCarousel/index.js +13 -13
- package/dist/components/UTCarousel/theme.js +6 -3
- package/dist/components/UTCheckList/constants.js +1 -1
- package/dist/components/UTCheckList/index.js +71 -91
- package/dist/components/UTCheckList/theme.js +34 -32
- package/dist/components/UTCheckbox/constants.js +2 -4
- package/dist/components/UTCheckbox/index.js +32 -43
- package/dist/components/UTCheckbox/theme.js +37 -35
- package/dist/components/UTConsumptionBar/components/ConsumptionBarIndicator/index.js +8 -7
- package/dist/components/UTConsumptionBar/constants.js +3 -3
- package/dist/components/UTConsumptionBar/index.js +52 -78
- package/dist/components/UTCuit/index.js +114 -137
- package/dist/components/UTCuit/theme.js +52 -53
- package/dist/components/UTDatePicker/components/Day/constants.js +1 -1
- package/dist/components/UTDatePicker/components/Day/index.js +11 -10
- package/dist/components/UTDatePicker/constants.js +21 -22
- package/dist/components/UTDatePicker/index.js +60 -102
- package/dist/components/UTDatePicker/theme.js +8 -4
- package/dist/components/UTDatePicker/types.js +1 -1
- package/dist/components/UTDatePicker/utils.js +4 -6
- package/dist/components/UTDialog/constants.js +2 -2
- package/dist/components/UTDialog/index.js +37 -35
- package/dist/components/UTDialog/theme.js +6 -3
- package/dist/components/UTDialog/types.js +1 -1
- package/dist/components/UTDotMenu/index.js +40 -61
- package/dist/components/UTEmojiPicker/constants.js +14 -18
- package/dist/components/UTEmojiPicker/index.js +46 -64
- package/dist/components/UTEmojiPicker/styles.module.scss +1 -1
- package/dist/components/UTEmojiPicker/theme.js +6 -3
- package/dist/components/UTEmojiPicker/utils.js +24 -52
- package/dist/components/UTExternalLink/constants.js +2 -2
- package/dist/components/UTExternalLink/index.js +17 -13
- package/dist/components/UTExternalLink/theme.js +11 -7
- package/dist/components/UTFileInput/constants.js +2 -2
- package/dist/components/UTFileInput/index.js +6 -29
- package/dist/components/UTFileInput/layout.js +72 -96
- package/dist/components/UTIconButton/index.js +48 -70
- package/dist/components/UTIconButton/theme.js +6 -3
- package/dist/components/UTImageRadio/components/ImageRadioCard/index.js +52 -56
- package/dist/components/UTImageRadio/constants.js +3 -3
- package/dist/components/UTImageRadio/index.js +38 -45
- package/dist/components/UTImageRadio/theme.js +13 -13
- package/dist/components/UTImageRadio/types.js +1 -1
- package/dist/components/UTImageRadio/utils.js +4 -6
- package/dist/components/UTLabel/constants.js +13 -11
- package/dist/components/UTLabel/index.js +17 -18
- package/dist/components/UTLabel/theme.js +19 -16
- package/dist/components/UTList/index.js +14 -16
- package/dist/components/UTLoading/index.js +14 -13
- package/dist/components/UTMap/components/GoogleMaps/constants.js +9 -10
- package/dist/components/UTMap/components/GoogleMaps/index.js +62 -89
- package/dist/components/UTMap/constants.js +6 -6
- package/dist/components/UTMap/index.js +162 -196
- package/dist/components/UTMap/types.js +3 -3
- package/dist/components/UTMap/utils.js +35 -46
- package/dist/components/UTMap/withGoogleMapScript.js +11 -15
- package/dist/components/UTMenu/index.js +51 -67
- package/dist/components/UTMenu/styles.module.scss +5 -5
- package/dist/components/UTMenu/theme.js +8 -4
- package/dist/components/UTMenu/utils.js +10 -12
- package/dist/components/UTModal/constants.js +13 -17
- package/dist/components/UTModal/index.js +25 -28
- package/dist/components/UTModal/styles.module.scss +1 -1
- package/dist/components/UTModal/theme.js +6 -3
- package/dist/components/UTPagination/components/PageSizeSelector/index.js +10 -8
- package/dist/components/UTPagination/components/PageSizeSelector/utils.js +9 -14
- package/dist/components/UTPagination/components/Pagination/components/NavigationButton/index.js +11 -10
- package/dist/components/UTPagination/components/Pagination/index.js +31 -45
- package/dist/components/UTPagination/components/Pagination/utils.js +10 -15
- package/dist/components/UTPagination/constants.js +3 -3
- package/dist/components/UTPagination/index.js +15 -15
- package/dist/components/UTPagination/theme.js +6 -3
- package/dist/components/UTPanel/index.js +37 -42
- package/dist/components/UTPasswordField/components/PasswordValidations/components/Error/index.js +12 -8
- package/dist/components/UTPasswordField/components/PasswordValidations/components/Validation/index.js +21 -17
- package/dist/components/UTPasswordField/components/PasswordValidations/index.js +62 -48
- package/dist/components/UTPasswordField/components/PasswordWarning/index.js +24 -24
- package/dist/components/UTPasswordField/index.js +25 -21
- package/dist/components/UTPasswordField/theme.js +6 -3
- package/dist/components/UTPhoneInput/constants.js +3 -3
- package/dist/components/UTPhoneInput/index.js +185 -209
- package/dist/components/UTPhoneInput/theme.js +79 -77
- package/dist/components/UTPieChart/components/ArrowLabel/constants.js +4 -4
- package/dist/components/UTPieChart/components/ArrowLabel/index.js +23 -21
- package/dist/components/UTPieChart/components/Legend/contants.js +3 -3
- package/dist/components/UTPieChart/components/Legend/index.js +26 -22
- package/dist/components/UTPieChart/constants.js +13 -13
- package/dist/components/UTPieChart/hooks/use-animated-value/index.js +14 -31
- package/dist/components/UTPieChart/index.js +72 -74
- package/dist/components/UTPieChart/theme.js +6 -3
- package/dist/components/UTPieChart/utils.js +6 -3
- package/dist/components/UTProgressBar/constants.js +2 -2
- package/dist/components/UTProgressBar/index.js +14 -15
- package/dist/components/UTProgressBar/theme.js +6 -3
- package/dist/components/UTProgressBar/types.js +1 -1
- package/dist/components/UTRadioGroup/index.js +55 -81
- package/dist/components/UTRadioGroup/theme.js +54 -52
- package/dist/components/UTRating/components/Circle/index.js +40 -54
- package/dist/components/UTRating/components/Faces/assets/mood-confuzed.svg +3 -0
- package/dist/components/UTRating/components/Faces/assets/mood-empty.svg +3 -0
- package/dist/components/UTRating/components/Faces/assets/mood-happy.svg +3 -0
- package/dist/components/UTRating/components/Faces/assets/mood-sad.svg +3 -0
- package/dist/components/UTRating/components/Faces/assets/mood-smile.svg +3 -0
- package/dist/components/UTRating/components/Faces/constants.js +80 -0
- package/dist/components/UTRating/components/Faces/index.js +76 -0
- package/dist/components/UTRating/components/Faces/styles.module.scss +78 -0
- package/dist/components/UTRating/components/Star/index.js +35 -38
- package/dist/components/UTRating/constants.js +5 -4
- package/dist/components/UTRating/index.js +35 -46
- package/dist/components/UTRating/styles.module.scss +1 -0
- package/dist/components/UTRating/theme.js +52 -3
- package/dist/components/UTRipple/Ripple.js +21 -37
- package/dist/components/UTRipple/index.js +17 -35
- package/dist/components/UTSelect/components/Option/index.js +12 -11
- package/dist/components/UTSelect/constants.js +4 -4
- package/dist/components/UTSelect/index.js +62 -83
- package/dist/components/UTSelect/theme.js +9 -5
- package/dist/components/UTSelect/utils.js +5 -14
- package/dist/components/UTSidebar/components/ListOption/index.js +33 -47
- package/dist/components/UTSidebar/components/LogosContainer/components/DynamicIcon/index.js +7 -6
- package/dist/components/UTSidebar/components/LogosContainer/index.js +13 -12
- package/dist/components/UTSidebar/components/Option/constants.js +1 -1
- package/dist/components/UTSidebar/components/Option/index.js +27 -30
- package/dist/components/UTSidebar/components/Toggler/index.js +10 -9
- package/dist/components/UTSidebar/index.js +41 -51
- package/dist/components/UTSidebar/theme.js +6 -3
- package/dist/components/UTSidebar/types.js +5 -5
- package/dist/components/UTSkeleton/index.js +9 -34
- package/dist/components/UTStatus/constants.js +4 -4
- package/dist/components/UTStatus/index.js +15 -13
- package/dist/components/UTStatus/theme.js +75 -59
- package/dist/components/UTSwitch/constants.js +3 -3
- package/dist/components/UTSwitch/index.js +41 -55
- package/dist/components/UTSwitch/theme.js +6 -3
- package/dist/components/UTTable/components/ActionIcons/constants.js +1 -1
- package/dist/components/UTTable/components/ActionIcons/index.js +46 -83
- package/dist/components/UTTable/components/Cell/components/ActionButton/index.js +9 -10
- package/dist/components/UTTable/components/Cell/index.js +17 -21
- package/dist/components/UTTable/components/HeaderCell/constants.js +1 -1
- package/dist/components/UTTable/components/HeaderCell/index.js +22 -28
- package/dist/components/UTTable/components/HeaderCell/utils.js +5 -4
- package/dist/components/UTTable/components/PrimaryAction/index.js +11 -9
- package/dist/components/UTTable/components/ResponsiveCell/index.js +18 -18
- package/dist/components/UTTable/components/Status/index.js +17 -17
- package/dist/components/UTTable/components/TableFooter/components/PageSizeSelector/index.js +9 -7
- package/dist/components/UTTable/components/TableFooter/components/PageSizeSelector/utils.js +9 -14
- package/dist/components/UTTable/components/TableFooter/components/Pagination/components/NavigationButton/index.js +11 -10
- package/dist/components/UTTable/components/TableFooter/components/Pagination/index.js +22 -36
- package/dist/components/UTTable/components/TableFooter/components/Pagination/utils.js +10 -15
- package/dist/components/UTTable/components/TableFooter/constants.js +1 -1
- package/dist/components/UTTable/components/TableFooter/index.js +14 -13
- package/dist/components/UTTable/components/TableHeader/index.js +10 -10
- package/dist/components/UTTable/components/TableRow/constants.js +2 -4
- package/dist/components/UTTable/components/TableRow/index.js +79 -93
- package/dist/components/UTTable/constants.js +26 -24
- package/dist/components/UTTable/hook.js +13 -27
- package/dist/components/UTTable/index.js +125 -213
- package/dist/components/UTTable/theme.js +19 -18
- package/dist/components/UTTable/types.js +4 -4
- package/dist/components/UTTable/utils.js +80 -75
- package/dist/components/UTTabs/components/TooltipTab/index.js +19 -28
- package/dist/components/UTTabs/constants.js +4 -4
- package/dist/components/UTTabs/index.js +56 -84
- package/dist/components/UTTabs/theme.js +6 -3
- package/dist/components/UTTabs/utils.js +3 -2
- package/dist/components/UTTextArea/constants.js +2 -4
- package/dist/components/UTTextArea/index.js +22 -21
- package/dist/components/UTTextArea/theme.js +6 -3
- package/dist/components/UTTextInput/constants.js +1 -1
- package/dist/components/UTTextInput/index.js +138 -165
- package/dist/components/UTTextInput/theme.js +9 -5
- package/dist/components/UTThirdPartyCookieChecker/index.js +16 -19
- package/dist/components/UTToggle/components/ToggleOption/index.js +15 -15
- package/dist/components/UTToggle/index.js +24 -24
- package/dist/components/UTToggle/theme.js +6 -3
- package/dist/components/UTTooltip/index.js +22 -28
- package/dist/components/UTTooltip/theme.js +6 -3
- package/dist/components/UTTopbar/components/Notifications/index.js +10 -12
- package/dist/components/UTTopbar/components/UserMenu/index.js +18 -17
- package/dist/components/UTTopbar/components/UserMenu/styles.module.scss +1 -1
- package/dist/components/UTTopbar/index.js +27 -29
- package/dist/components/UTTopbar/theme.js +6 -3
- package/dist/components/UTTopbar/types.js +4 -4
- package/dist/components/UTTouchableWithoutFeedback/index.js +15 -27
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/constants.js +2 -2
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/index.js +33 -29
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/utils.js +6 -5
- package/dist/components/UTVirtualizedList/components/VirtualizedData/constants.js +6 -6
- package/dist/components/UTVirtualizedList/components/VirtualizedData/hooks/use-ledger.js +7 -16
- package/dist/components/UTVirtualizedList/components/VirtualizedData/hooks/use-virtualized-data.js +22 -45
- package/dist/components/UTVirtualizedList/components/VirtualizedData/index.js +30 -32
- package/dist/components/UTVirtualizedList/components/VirtualizedData/utils.js +89 -94
- package/dist/components/UTVirtualizedList/constants.js +4 -4
- package/dist/components/UTVirtualizedList/index.js +25 -36
- package/dist/components/UTWorkflowContainer/components/ActionButton/index.js +14 -17
- package/dist/components/UTWorkflowContainer/constants.js +3 -3
- package/dist/components/UTWorkflowContainer/hooks/use-previous.js +5 -4
- package/dist/components/UTWorkflowContainer/index.js +31 -49
- package/dist/components/UTWorkflowContainer/theme.js +62 -54
- package/dist/components/UTWorkflowContainer/types.js +1 -1
- package/dist/components/WithLoading/index.js +9 -13
- package/dist/components/WithTheme/index.js +9 -15
- package/dist/components/WithTheme/layout.js +21 -26
- package/dist/components/WithTouch/index.js +11 -17
- package/dist/constants/UTTable.js +1 -1
- package/dist/index.js +58 -58
- package/dist/theme.js +8 -4
- package/dist/types/commonTypes.js +2 -2
- package/dist/types/consumptionTypes.js +2 -2
- package/dist/types/formTypes.js +3 -3
- package/dist/types/tableTypes.js +1 -1
- package/dist/utils/classesUtils.js +7 -13
- package/dist/utils/componentUtils.js +8 -10
- package/dist/utils/helperFunctions.js +6 -5
- package/dist/utils/shadowUtils.js +15 -12
- package/dist/utils/useScreenSize.js +1 -1
- package/package.json +29 -70
|
@@ -22,34 +22,15 @@ var _types = require("./types");
|
|
|
22
22
|
var _constants = require("./constants");
|
|
23
23
|
var _utils = require("./utils");
|
|
24
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function
|
|
26
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" !=
|
|
27
|
-
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); }
|
|
25
|
+
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); }
|
|
26
|
+
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; }
|
|
28
27
|
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); }
|
|
29
|
-
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; }
|
|
30
|
-
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; }
|
|
31
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
32
|
-
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."); }
|
|
33
|
-
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); }
|
|
34
|
-
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; }
|
|
35
|
-
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; } }
|
|
36
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
37
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
38
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
39
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
40
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
41
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
42
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
43
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
44
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
45
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
46
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
47
28
|
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; }
|
|
48
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return
|
|
49
|
-
function _toPrimitive(input, hint) { if (
|
|
29
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
30
|
+
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); }
|
|
50
31
|
var CalendarIcon = function CalendarIcon(props) {
|
|
51
32
|
return /*#__PURE__*/_react.default.createElement("svg", props, /*#__PURE__*/_react.default.createElement("defs", null, /*#__PURE__*/_react.default.createElement("path", {
|
|
52
|
-
d: "M8 15c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-
|
|
33
|
+
d: "M8 15c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1Zm8 0c.55 0 1 .45 1 1s-.45 1-1 1h-4c-.55 0-1-.45-1-1s.45-1 1-1Zm2 5H6c-.551 0-1-.449-1-1v-6h14v6c0 .551-.449 1-1 1M6 6h1v1c0 .55.45 1 1 1s1-.45 1-1V6h6v1c0 .55.45 1 1 1s1-.45 1-1V6h1c.551 0 1 .449 1 1v4H5V7c0-.551.449-1 1-1m12-2h-1V3c0-.55-.45-1-1-1s-1 .45-1 1v1H9V3c0-.55-.45-1-1-1s-1 .45-1 1v1H6C4.346 4 3 5.346 3 7v12c0 1.654 1.346 3 3 3h12c1.654 0 3-1.346 3-3V7c0-1.654-1.346-3-3-3",
|
|
53
34
|
id: "a"
|
|
54
35
|
})), /*#__PURE__*/_react.default.createElement("use", {
|
|
55
36
|
fillRule: "nonzero",
|
|
@@ -61,91 +42,64 @@ var CalendarIcon = function CalendarIcon(props) {
|
|
|
61
42
|
CalendarIcon.defaultProps = {
|
|
62
43
|
width: "18",
|
|
63
44
|
height: "20",
|
|
64
|
-
viewBox: "0 0 18 20",
|
|
65
45
|
xmlns: "http://www.w3.org/2000/svg",
|
|
66
46
|
xmlnsXlink: "http://www.w3.org/1999/xlink"
|
|
67
47
|
};
|
|
68
48
|
_dayjs2.default.extend(_customParseFormat.default);
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
var _this;
|
|
74
|
-
_classCallCheck(this, CustomUtils);
|
|
75
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
76
|
-
args[_key] = arguments[_key];
|
|
77
|
-
}
|
|
78
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
79
|
-
_defineProperty(_assertThisInitialized(_this), "getCalendarHeaderText", function (date) {
|
|
80
|
-
return date.format('MMMM');
|
|
81
|
-
});
|
|
82
|
-
return _this;
|
|
49
|
+
class CustomUtils extends _dayjs.default {
|
|
50
|
+
constructor() {
|
|
51
|
+
super(...arguments);
|
|
52
|
+
_defineProperty(this, "getCalendarHeaderText", date => date.format('MMMM'));
|
|
83
53
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
var UTDatePicker = function UTDatePicker(_ref) {
|
|
54
|
+
}
|
|
55
|
+
const UTDatePicker = _ref => {
|
|
87
56
|
var _field$configuration;
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
disableToolbar =
|
|
94
|
-
disabled
|
|
95
|
-
field
|
|
96
|
-
iconAnchor
|
|
97
|
-
input
|
|
98
|
-
inputProps
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
var _useState = (0, _react.useState)(null),
|
|
116
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
117
|
-
pickedDate = _useState2[0],
|
|
118
|
-
setPickedDate = _useState2[1];
|
|
119
|
-
var _useState3 = (0, _react.useState)(null),
|
|
120
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
121
|
-
internalError = _useState4[0],
|
|
122
|
-
setInternalError = _useState4[1];
|
|
123
|
-
var handleChange = function handleChange(date) {
|
|
57
|
+
let {
|
|
58
|
+
classes: themeClasses,
|
|
59
|
+
classNames,
|
|
60
|
+
CustomIcon,
|
|
61
|
+
dayFormat,
|
|
62
|
+
disableToolbar = true,
|
|
63
|
+
disabled,
|
|
64
|
+
field,
|
|
65
|
+
iconAnchor,
|
|
66
|
+
input,
|
|
67
|
+
inputProps,
|
|
68
|
+
inputVariant = _constants.INPUT_VARIANT,
|
|
69
|
+
invalidDateMessage,
|
|
70
|
+
maxDateMessage,
|
|
71
|
+
minDateMessage,
|
|
72
|
+
meta = {},
|
|
73
|
+
pickerProps,
|
|
74
|
+
placeholder,
|
|
75
|
+
popoverProps,
|
|
76
|
+
variant,
|
|
77
|
+
withUpperTitle
|
|
78
|
+
} = _ref;
|
|
79
|
+
const classes = (0, _react.useMemo)(() => (0, _classesUtils.mergeClasses)(themeClasses, classNames), [classNames]);
|
|
80
|
+
const configMask = (field === null || field === void 0 || (_field$configuration = field.configuration) === null || _field$configuration === void 0 ? void 0 : _field$configuration.date_mask) || _constants.OUTPUT_LABEL_MASK;
|
|
81
|
+
const [pickedDate, setPickedDate] = (0, _react.useState)(null);
|
|
82
|
+
const [internalError, setInternalError] = (0, _react.useState)(null);
|
|
83
|
+
const handleChange = date => {
|
|
124
84
|
setPickedDate(date);
|
|
125
|
-
|
|
85
|
+
const newValue = (0, _dayjs2.default)(date, _constants.OUTPUT_LABEL_MASK, true);
|
|
126
86
|
if (newValue.isValid()) input.onChange(newValue.format(configMask));else input.onChange('');
|
|
127
87
|
};
|
|
128
|
-
(0, _react.useEffect)(
|
|
88
|
+
(0, _react.useEffect)(() => {
|
|
129
89
|
if (!input.value && pickedDate !== null && pickedDate !== void 0 && pickedDate.isValid()) setPickedDate(null);else if ((0, _utils.dateMatchesFormat)(input.value, configMask)) setPickedDate((0, _dayjs2.default)(input.value, configMask));
|
|
130
90
|
}, [input.value]);
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
var handleRemoveError = function handleRemoveError() {
|
|
144
|
-
return setInternalError(null);
|
|
145
|
-
};
|
|
146
|
-
var OpenerIcon = CustomIcon || CalendarIcon;
|
|
147
|
-
var operenerIconReference = (0, _react.useRef)();
|
|
148
|
-
var errorMessage = (0, _form.shouldShowErrors)(meta) && (internalError || meta.error) || '';
|
|
91
|
+
const renderDay = (date, _, dayInCurrentMonth) => /*#__PURE__*/_react.default.createElement(_Day.default, {
|
|
92
|
+
classes: classes,
|
|
93
|
+
dayFormat: dayFormat,
|
|
94
|
+
date: date,
|
|
95
|
+
pickedDate: pickedDate,
|
|
96
|
+
dayInCurrentMonth: dayInCurrentMonth
|
|
97
|
+
});
|
|
98
|
+
const handleError = error => setInternalError(error);
|
|
99
|
+
const handleRemoveError = () => setInternalError(null);
|
|
100
|
+
const OpenerIcon = CustomIcon || CalendarIcon;
|
|
101
|
+
const operenerIconReference = (0, _react.useRef)();
|
|
102
|
+
const errorMessage = (0, _form.shouldShowErrors)(meta) && (internalError || meta.error) || '';
|
|
149
103
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, withUpperTitle && /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
150
104
|
className: classes.upperTitle,
|
|
151
105
|
withMarkdown: true
|
|
@@ -171,13 +125,14 @@ var UTDatePicker = function UTDatePicker(_ref) {
|
|
|
171
125
|
className: disabled ? classes.disabledOpenerIcon : classes.openerIcon
|
|
172
126
|
})),
|
|
173
127
|
variant: variant || _constants.VARIANT,
|
|
174
|
-
InputProps:
|
|
128
|
+
InputProps: {
|
|
175
129
|
classes: {
|
|
176
130
|
root: classes.input,
|
|
177
131
|
notchedOutline: classes.notchedOutline
|
|
178
132
|
},
|
|
179
|
-
placeholder: inputVariant === 'outlined' && (placeholder || (field === null || field === void 0 ? void 0 : field.placeholder)) || undefined
|
|
180
|
-
|
|
133
|
+
placeholder: inputVariant === 'outlined' && (placeholder || (field === null || field === void 0 ? void 0 : field.placeholder)) || undefined,
|
|
134
|
+
...inputProps
|
|
135
|
+
},
|
|
181
136
|
invalidDateMessage: invalidDateMessage || _constants.WRONG_DATE_FORMAT,
|
|
182
137
|
inputVariant: inputVariant,
|
|
183
138
|
format: _constants.OUTPUT_LABEL_MASK,
|
|
@@ -188,7 +143,10 @@ var UTDatePicker = function UTDatePicker(_ref) {
|
|
|
188
143
|
},
|
|
189
144
|
onChange: handleChange,
|
|
190
145
|
renderDay: renderDay,
|
|
191
|
-
PopoverProps:
|
|
146
|
+
PopoverProps: {
|
|
147
|
+
...(iconAnchor ? (0, _constants.iconAnchorProps)(operenerIconReference) : {}),
|
|
148
|
+
...popoverProps
|
|
149
|
+
}
|
|
192
150
|
}, pickerProps))));
|
|
193
151
|
};
|
|
194
152
|
UTDatePicker.propTypes = {
|
|
@@ -9,8 +9,10 @@ var _styles = require("@material-ui/core/styles");
|
|
|
9
9
|
var _colorsModule = _interopRequireDefault(require("../../scss/variables/colors.module.scss"));
|
|
10
10
|
var _classesUtils = require("../../utils/classesUtils");
|
|
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
|
openerIcon: {
|
|
16
18
|
fill: (0, _seamlessImmutable.getIn)(theme, ['UTDatePicker', 'openerIcon', 'fill'], _colorsModule.default.orangeIcon)
|
|
@@ -50,7 +52,8 @@ var retrieveStyle = exports.retrieveStyle = function retrieveStyle(_ref) {
|
|
|
50
52
|
}
|
|
51
53
|
};
|
|
52
54
|
};
|
|
53
|
-
|
|
55
|
+
exports.retrieveStyle = retrieveStyle;
|
|
56
|
+
const materialTheme = theme => {
|
|
54
57
|
var _theme$UTDatePicker, _theme$UTDatePicker2, _theme$UTDatePicker3, _theme$UTDatePicker4;
|
|
55
58
|
return (0, _styles.createTheme)({
|
|
56
59
|
typography: {
|
|
@@ -227,4 +230,5 @@ var materialTheme = exports.materialTheme = function materialTheme(theme) {
|
|
|
227
230
|
}
|
|
228
231
|
}
|
|
229
232
|
});
|
|
230
|
-
};
|
|
233
|
+
};
|
|
234
|
+
exports.materialTheme = materialTheme;
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.classesPropTypes = void 0;
|
|
7
7
|
var _propTypes = require("prop-types");
|
|
8
|
-
|
|
8
|
+
const classesPropTypes = exports.classesPropTypes = (0, _propTypes.shape)({
|
|
9
9
|
content: _propTypes.string,
|
|
10
10
|
container: _propTypes.string,
|
|
11
11
|
root: _propTypes.string,
|
|
@@ -6,9 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.isSelected = exports.dateMatchesFormat = void 0;
|
|
7
7
|
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
8
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return (0, _dayjs.default)(date, targetFormat).format(targetFormat) === date;
|
|
14
|
-
};
|
|
9
|
+
const isSelected = (date, selectedDate) => selectedDate && date.isSame(selectedDate, 'day');
|
|
10
|
+
exports.isSelected = isSelected;
|
|
11
|
+
const dateMatchesFormat = (date, targetFormat) => (0, _dayjs.default)(date, targetFormat).format(targetFormat) === date;
|
|
12
|
+
exports.dateMatchesFormat = dateMatchesFormat;
|
|
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.CANCEL_BUTTON_TEXT = exports.ACCEPT_BUTTON_TEXT = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
const CANCEL_BUTTON_TEXT = exports.CANCEL_BUTTON_TEXT = 'Cancelar';
|
|
8
|
+
const ACCEPT_BUTTON_TEXT = exports.ACCEPT_BUTTON_TEXT = 'Aceptar';
|
|
@@ -20,40 +20,42 @@ var _theme = require("./theme");
|
|
|
20
20
|
var _constants = require("./constants");
|
|
21
21
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
22
22
|
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); }
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
isOpen =
|
|
39
|
-
onRequestClose
|
|
40
|
-
roundedCloseButton
|
|
41
|
-
title
|
|
42
|
-
TransitionProps
|
|
43
|
-
warningAlert
|
|
44
|
-
whiteTitle
|
|
45
|
-
withClickAway
|
|
46
|
-
withCloseButton
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
23
|
+
const UTDialog = _ref => {
|
|
24
|
+
let {
|
|
25
|
+
acceptButton,
|
|
26
|
+
alertConfig,
|
|
27
|
+
cancelButton,
|
|
28
|
+
children,
|
|
29
|
+
classes,
|
|
30
|
+
classNames,
|
|
31
|
+
contentName,
|
|
32
|
+
dialogProps,
|
|
33
|
+
disableEnforceFocus,
|
|
34
|
+
disableScrollLock,
|
|
35
|
+
disableTypography,
|
|
36
|
+
elevation,
|
|
37
|
+
FooterComponents,
|
|
38
|
+
isOpen = false,
|
|
39
|
+
onRequestClose,
|
|
40
|
+
roundedCloseButton,
|
|
41
|
+
title,
|
|
42
|
+
TransitionProps,
|
|
43
|
+
warningAlert,
|
|
44
|
+
whiteTitle,
|
|
45
|
+
withClickAway,
|
|
46
|
+
withCloseButton
|
|
47
|
+
} = _ref;
|
|
48
|
+
const CloseIcon = roundedCloseButton ? _CloseRounded.default : _Close.default;
|
|
49
|
+
const {
|
|
50
|
+
content,
|
|
51
|
+
container,
|
|
52
|
+
root,
|
|
53
|
+
closeButton,
|
|
54
|
+
mainTitle,
|
|
55
|
+
closeIcon,
|
|
56
|
+
warning,
|
|
57
|
+
dialogActions
|
|
58
|
+
} = classNames || {};
|
|
57
59
|
return /*#__PURE__*/_react.default.createElement(_Dialog.default, _extends({
|
|
58
60
|
open: isOpen,
|
|
59
61
|
onClose: withClickAway ? onRequestClose : undefined,
|
|
@@ -64,7 +66,7 @@ var UTDialog = function UTDialog(_ref) {
|
|
|
64
66
|
root: "".concat(classes.root, " ").concat(root)
|
|
65
67
|
},
|
|
66
68
|
PaperProps: {
|
|
67
|
-
elevation
|
|
69
|
+
elevation
|
|
68
70
|
},
|
|
69
71
|
disableEnforceFocus: disableEnforceFocus,
|
|
70
72
|
disableScrollLock: disableScrollLock,
|
|
@@ -8,9 +8,11 @@ var _seamlessImmutable = require("seamless-immutable");
|
|
|
8
8
|
var _colorsModule = _interopRequireDefault(require("../../scss/variables/colors.module.scss"));
|
|
9
9
|
var _classesUtils = require("../../utils/classesUtils");
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
11
|
+
const retrieveStyle = _ref => {
|
|
12
12
|
var _theme$UTDialog;
|
|
13
|
-
|
|
13
|
+
let {
|
|
14
|
+
theme
|
|
15
|
+
} = _ref;
|
|
14
16
|
return {
|
|
15
17
|
container: {
|
|
16
18
|
margin: (0, _seamlessImmutable.getIn)(theme, ['UTDialog', 'container', 'margin'], 0),
|
|
@@ -86,4 +88,5 @@ var retrieveStyle = exports.retrieveStyle = function retrieveStyle(_ref) {
|
|
|
86
88
|
fill: (0, _seamlessImmutable.getIn)(theme, ['UTDialog', 'closeIcon', 'fill'])
|
|
87
89
|
}
|
|
88
90
|
};
|
|
89
|
-
};
|
|
91
|
+
};
|
|
92
|
+
exports.retrieveStyle = retrieveStyle;
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.dialogButtonPropTypes = void 0;
|
|
7
7
|
var _propTypes = require("prop-types");
|
|
8
|
-
|
|
8
|
+
const dialogButtonPropTypes = exports.dialogButtonPropTypes = (0, _propTypes.shape)({
|
|
9
9
|
classNames: (0, _propTypes.objectOf)(_propTypes.string),
|
|
10
10
|
disabled: _propTypes.bool,
|
|
11
11
|
text: _propTypes.string,
|
|
@@ -11,75 +11,54 @@ var _MoreVert = _interopRequireDefault(require("@material-ui/icons/MoreVert"));
|
|
|
11
11
|
var _propTypes = require("prop-types");
|
|
12
12
|
var _UTButton = _interopRequireDefault(require("../UTButton"));
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
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); }
|
|
15
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
16
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
17
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
18
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
19
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
20
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
21
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
22
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
23
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
24
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
25
14
|
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; }
|
|
26
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return
|
|
27
|
-
function _toPrimitive(input, hint) { if (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
_classCallCheck(this, UTDotMenu);
|
|
34
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
35
|
-
args[_key] = arguments[_key];
|
|
36
|
-
}
|
|
37
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
38
|
-
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
39
|
-
anchorEl: null
|
|
40
|
-
});
|
|
41
|
-
_defineProperty(_assertThisInitialized(_this), "handleClick", function (event) {
|
|
42
|
-
_this.setState({
|
|
15
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
16
|
+
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); }
|
|
17
|
+
class UTDotMenu extends _react.default.Component {
|
|
18
|
+
constructor(props) {
|
|
19
|
+
super(props);
|
|
20
|
+
_defineProperty(this, "handleClick", event => {
|
|
21
|
+
this.setState({
|
|
43
22
|
anchorEl: event.currentTarget
|
|
44
23
|
});
|
|
45
24
|
});
|
|
46
|
-
_defineProperty(
|
|
47
|
-
|
|
25
|
+
_defineProperty(this, "handleClose", () => {
|
|
26
|
+
this.setState({
|
|
48
27
|
anchorEl: null
|
|
49
28
|
});
|
|
50
29
|
});
|
|
51
|
-
|
|
30
|
+
this.state = {
|
|
31
|
+
anchorEl: null
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
render() {
|
|
35
|
+
const {
|
|
36
|
+
anchorEl
|
|
37
|
+
} = this.state;
|
|
38
|
+
const {
|
|
39
|
+
classNames
|
|
40
|
+
} = this.props;
|
|
41
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
42
|
+
className: this.props.className
|
|
43
|
+
}, /*#__PURE__*/_react.default.createElement(_UTButton.default, {
|
|
44
|
+
classNames: {
|
|
45
|
+
icon: classNames.icon,
|
|
46
|
+
root: classNames.button
|
|
47
|
+
},
|
|
48
|
+
Icon: _MoreVert.default,
|
|
49
|
+
onClick: this.handleClick,
|
|
50
|
+
variant: "text"
|
|
51
|
+
}), /*#__PURE__*/_react.default.createElement(_Menu.default, {
|
|
52
|
+
id: "long-menu",
|
|
53
|
+
anchorEl: anchorEl,
|
|
54
|
+
open: Boolean(anchorEl),
|
|
55
|
+
onClose: this.handleClose
|
|
56
|
+
}, this.props.options.map(option => /*#__PURE__*/_react.default.createElement(_MenuItem.default, {
|
|
57
|
+
key: option.name,
|
|
58
|
+
onClick: option.onPress
|
|
59
|
+
}, option.name))));
|
|
52
60
|
}
|
|
53
|
-
|
|
54
|
-
key: "render",
|
|
55
|
-
value: function render() {
|
|
56
|
-
var anchorEl = this.state.anchorEl;
|
|
57
|
-
var classNames = this.props.classNames;
|
|
58
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
59
|
-
className: this.props.className
|
|
60
|
-
}, /*#__PURE__*/_react.default.createElement(_UTButton.default, {
|
|
61
|
-
classNames: {
|
|
62
|
-
icon: classNames.icon,
|
|
63
|
-
root: classNames.button
|
|
64
|
-
},
|
|
65
|
-
Icon: _MoreVert.default,
|
|
66
|
-
onClick: this.handleClick,
|
|
67
|
-
variant: "text"
|
|
68
|
-
}), /*#__PURE__*/_react.default.createElement(_Menu.default, {
|
|
69
|
-
id: "long-menu",
|
|
70
|
-
anchorEl: anchorEl,
|
|
71
|
-
open: Boolean(anchorEl),
|
|
72
|
-
onClose: this.handleClose
|
|
73
|
-
}, this.props.options.map(function (option) {
|
|
74
|
-
return /*#__PURE__*/_react.default.createElement(_MenuItem.default, {
|
|
75
|
-
key: option.name,
|
|
76
|
-
onClick: option.onPress
|
|
77
|
-
}, option.name);
|
|
78
|
-
})));
|
|
79
|
-
}
|
|
80
|
-
}]);
|
|
81
|
-
return UTDotMenu;
|
|
82
|
-
}(_react.default.Component);
|
|
61
|
+
}
|
|
83
62
|
UTDotMenu.propTypes = {
|
|
84
63
|
options: (0, _propTypes.arrayOf)((0, _propTypes.shape)({
|
|
85
64
|
name: _propTypes.string,
|